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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bde9d785ef3b22d74c1750d24a1f87eeaaf4c43a | 750 | asm | Assembly | oeis/321/A321259.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/321/A321259.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/321/A321259.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A321259: a(n) = sigma_n(n) - n^n.
; Submitted by Christian Krause
; 0,1,1,17,1,794,1,65793,19684,9766650,1,2194095090,1,678223089234,30531927033,281479271743489,1,150196195641350171,1,100000096466944316978,558545874543637211,81402749386839765307626,1,79501574308536809523296482,298023223876953126,91733330193268616658466724874,58149737003047685287875157,123476696151234544428564049196450,1,191752059233106091910992604567642500,1,340282367000166625996085689103316680705,23225154419887808146560828362864655,684326450885775034048946719925772090356514
add $0,1
mov $2,$0
lpb $0
sub $0,1
mov $3,$2
mov $5,$0
cmp $5,0
add $0,$5
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
pow $3,$2
add $1,$3
mov $4,1
lpe
add $1,1
mul $4,$1
mov $0,$4
| 31.25 | 481 | 0.777333 |
29b059a3093e3f7d505c5a31889b16f1d94bbfd5 | 893 | asm | Assembly | programs/oeis/111/A111314.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/111/A111314.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/111/A111314.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A111314: a(n) = a(n-1) + a(n-2) + 2 where a(0) = a(1) = 1.
; 1,1,4,7,13,22,37,61,100,163,265,430,697,1129,1828,2959,4789,7750,12541,20293,32836,53131,85969,139102,225073,364177,589252,953431,1542685,2496118,4038805,6534925,10573732,17108659,27682393,44791054,72473449,117264505,189737956,307002463,496740421,803742886,1300483309,2104226197,3404709508,5508935707,8913645217,14422580926,23336226145,37758807073,61095033220,98853840295,159948873517,258802713814,418751587333,677554301149,1096305888484,1773860189635,2870166078121,4644026267758,7514192345881,12158218613641,19672410959524,31830629573167,51503040532693,83333670105862,134836710638557,218170380744421,353007091382980,571177472127403,924184563510385,1495362035637790,2419546599148177,3914908634785969,6334455233934148
sub $0,1
mov $1,1
mov $2,1
lpb $0
sub $0,1
mov $3,$2
mov $2,$1
add $1,$3
lpe
sub $1,1
mul $1,3
add $1,1
| 55.8125 | 718 | 0.81187 |
3e0f29de62773b76b13756be822fbfa3247a50a1 | 1,786 | asm | Assembly | programs/oeis/121/A121968.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/121/A121968.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/121/A121968.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A121968: a(n) = 2*a(n-1) - a(n-2) + n + 1.
; 1,2,6,14,27,46,72,106,149,202,266,342,431,534,652,786,937,1106,1294,1502,1731,1982,2256,2554,2877,3226,3602,4006,4439,4902,5396,5922,6481,7074,7702,8366,9067,9806,10584,11402,12261,13162,14106,15094,16127,17206,18332,19506,20729,22002,23326,24702,26131,27614,29152,30746,32397,34106,35874,37702,39591,41542,43556,45634,47777,49986,52262,54606,57019,59502,62056,64682,67381,70154,73002,75926,78927,82006,85164,88402,91721,95122,98606,102174,105827,109566,113392,117306,121309,125402,129586,133862,138231,142694,147252,151906,156657,161506,166454,171502,176651,181902,187256,192714,198277,203946,209722,215606,221599,227702,233916,240242,246681,253234,259902,266686,273587,280606,287744,295002,302381,309882,317506,325254,333127,341126,349252,357506,365889,374402,383046,391822,400731,409774,418952,428266,437717,447306,457034,466902,476911,487062,497356,507794,518377,529106,539982,551006,562179,573502,584976,596602,608381,620314,632402,644646,657047,669606,682324,695202,708241,721442,734806,748334,762027,775886,789912,804106,818469,833002,847706,862582,877631,892854,908252,923826,939577,955506,971614,987902,1004371,1021022,1037856,1054874,1072077,1089466,1107042,1124806,1142759,1160902,1179236,1197762,1216481,1235394,1254502,1273806,1293307,1313006,1332904,1353002,1373301,1393802,1414506,1435414,1456527,1477846,1499372,1521106,1543049,1565202,1587566,1610142,1632931,1655934,1679152,1702586,1726237,1750106,1774194,1798502,1823031,1847782,1872756,1897954,1923377,1949026,1974902,2001006,2027339,2053902,2080696,2107722,2134981,2162474,2190202,2218166,2246367,2274806,2303484,2332402,2361561,2390962,2420606,2450494,2480627,2511006,2541632,2572506,2603629,2635002
mov $1,1
mov $2,$0
pow $0,2
add $1,$2
bin $1,3
add $1,$0
add $1,1
| 162.363636 | 1,673 | 0.825868 |
1a415773d2ac43ddcdc98de82f9906dffe1c88bd | 285 | asm | Assembly | programs/oeis/084/A084630.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/084/A084630.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/084/A084630.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A084630: Floor(C(n+7,7)/C(n+5,5)).
; 1,1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,22,23,25,26,28,30,31,33,35,37,39,41,43,45,47,49,51,53,56,58,60,63,65,68,70,73,76,78,81,84,87,90,93,96,99,102,105,108,111,115,118,121,125,128,132,135
mov $1,$0
add $1,7
bin $1,2
div $1,21
| 35.625 | 208 | 0.624561 |
f9f469e8402ec0efc326045e48fe25b57518f143 | 5,181 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_242.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_242.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_242.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x11fbf, %r14
nop
inc %r11
mov $0x6162636465666768, %r12
movq %r12, (%r14)
add $16040, %r12
lea addresses_A_ht+0x1cba7, %rdi
nop
xor $44165, %rbx
mov $0x6162636465666768, %r15
movq %r15, (%rdi)
nop
nop
nop
nop
nop
sub $60740, %r12
lea addresses_WT_ht+0x665f, %rsi
lea addresses_A_ht+0x1563f, %rdi
clflush (%rsi)
nop
nop
sub $29086, %r12
mov $81, %rcx
rep movsw
nop
and %r12, %r12
lea addresses_WT_ht+0x193df, %rbx
nop
nop
nop
xor %r11, %r11
movb $0x61, (%rbx)
nop
nop
nop
nop
inc %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r14
push %rbp
push %rdi
// Store
lea addresses_UC+0x135df, %r14
nop
sub %r12, %r12
movw $0x5152, (%r14)
and $56987, %rbp
// Faulty Load
lea addresses_normal+0x95df, %r13
nop
nop
nop
nop
inc %rdi
vmovups (%r13), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r14
lea oracles, %rdi
and $0xff, %r14
shlq $12, %r14
mov (%rdi,%r14,1), %r14
pop %rdi
pop %rbp
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC', 'congruent': 10}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 3}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 6}, 'OP': 'STOR'}
{'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
*/
| 45.447368 | 2,999 | 0.661069 |
64c34adabd7cf8bc6a75753b1862294a16813f07 | 7,946 | asm | Assembly | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca_notsx.log_21829_1078.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca_notsx.log_21829_1078.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca_notsx.log_21829_1078.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 %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1e4e5, %rax
xor $59149, %rbx
mov (%rax), %rdx
nop
nop
cmp $61928, %r14
lea addresses_UC_ht+0x4060, %rsi
lea addresses_D_ht+0x17775, %rdi
nop
nop
nop
sub $54495, %r10
mov $120, %rcx
rep movsq
nop
nop
nop
and $7118, %rdi
lea addresses_WT_ht+0x81cd, %rsi
lea addresses_WT_ht+0x77ed, %rdi
nop
nop
nop
sub %rdx, %rdx
mov $91, %rcx
rep movsb
nop
cmp $21860, %rdx
lea addresses_D_ht+0x1de8d, %rax
nop
nop
nop
inc %rdi
movb $0x61, (%rax)
nop
nop
nop
nop
dec %rax
lea addresses_normal_ht+0x2f0d, %r14
nop
nop
nop
nop
xor %r10, %r10
movw $0x6162, (%r14)
nop
nop
nop
nop
nop
and %rbx, %rbx
lea addresses_D_ht+0x408d, %rsi
nop
inc %rbx
movb $0x61, (%rsi)
add $44609, %rdi
lea addresses_A_ht+0xbcd, %rax
clflush (%rax)
sub $6451, %rdx
mov (%rax), %edi
nop
nop
cmp $12022, %rax
lea addresses_D_ht+0x887d, %rsi
nop
nop
nop
nop
nop
sub %rcx, %rcx
movb $0x61, (%rsi)
nop
nop
nop
nop
inc %r14
lea addresses_A_ht+0x185fd, %rdx
nop
nop
nop
nop
nop
sub %rdi, %rdi
movb (%rdx), %cl
nop
nop
and %rdi, %rdi
lea addresses_UC_ht+0x51cd, %rdi
nop
nop
sub %rcx, %rcx
mov (%rdi), %ax
nop
and $8452, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_D+0xfecd, %r12
nop
nop
nop
nop
cmp $36732, %r9
movl $0x51525354, (%r12)
nop
nop
nop
xor %r12, %r12
// Store
lea addresses_normal+0x59cd, %r12
nop
nop
nop
sub %r8, %r8
movl $0x51525354, (%r12)
sub $47412, %rbx
// REPMOV
lea addresses_normal+0x105cd, %rsi
lea addresses_A+0x101cd, %rdi
nop
nop
nop
nop
sub $20561, %rbx
mov $35, %rcx
rep movsl
nop
nop
nop
inc %r8
// Store
lea addresses_UC+0x1984d, %rbx
clflush (%rbx)
nop
nop
nop
and %r15, %r15
mov $0x5152535455565758, %r12
movq %r12, %xmm7
vmovups %ymm7, (%rbx)
nop
nop
nop
nop
cmp %rsi, %rsi
// Store
lea addresses_RW+0x81bd, %r12
nop
nop
nop
add %rdi, %rdi
movl $0x51525354, (%r12)
// Exception!!!
nop
nop
nop
nop
mov (0), %rdx
nop
nop
nop
nop
inc %r8
// Store
lea addresses_D+0xa409, %r8
nop
sub %r15, %r15
mov $0x5152535455565758, %r13
movq %r13, (%r8)
nop
nop
nop
nop
xor $59260, %r13
// Faulty Load
lea addresses_A+0x101cd, %r8
nop
nop
nop
nop
and %r12, %r12
mov (%r8), %bx
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
pop %r12
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': 4, 'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_normal'}, 'dst': {'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': True, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 30.098485 | 2,999 | 0.651774 |
18aea4481f8a0b8195e455471a3673c9feb88d5e | 2,796 | asm | Assembly | bootloader/bandymai.asm | dr4g0nsr/simple-os | aa718cf7f2b4c8ca0150c872c3977a134e356525 | [
"MIT"
] | 46 | 2015-08-19T16:08:00.000Z | 2022-03-15T08:39:30.000Z | bootloader/bandymai.asm | dr4g0nsr/simple-os | aa718cf7f2b4c8ca0150c872c3977a134e356525 | [
"MIT"
] | 2 | 2017-06-23T07:30:13.000Z | 2017-07-10T16:44:31.000Z | bootloader/bandymai.asm | dr4g0nsr/simple-os | aa718cf7f2b4c8ca0150c872c3977a134e356525 | [
"MIT"
] | 15 | 2018-03-16T18:25:26.000Z | 2021-10-06T10:15:49.000Z | [BITS 16]
ORG 0x7C00
jmp START
;spausdina ax desimtainiu formatu
PrintDec:
pusha
mov cx, 0 ;skaitmenu skaitliukas
mov dx, 0 ;reikia, kad butu 0, nes DIV daro taip DX:AX / operandas
divide:
mov bx, 10
div bx
add cx, 1
push dx ;skaitmuo dedamas i steka
mov dx, 0
cmp ax, 0
jne divide
print:
pop dx ;skaitmuo imamas is steko
sub cx, 1
add dx, 30h ;gaunamas skaiciaus ASCII simbolis
mov si, sp
mov [si], dl
call print_bios
cmp cx, 0
jne print
popa
ret
keaboard_handler:
pusha
mov si, keyMsg
call print_bios
in al, 0x60
call print_keyCode
mov al, 0x20
out 0x20, al
popa
iret
kernel_handler:
pusha
push es
xor ax, ax
mov es, ax
mov si, welcomeMsg
call print_bios
pop es
popa
iret
print_keyCode:
ret
clear_scr:
pusha
push es
mov ax, 0xB800
mov es, ax
mov si, 0
keepClearing:
mov byte [es:si], ' '
inc si
mov byte [es:si], 0
inc si
cmp si, 4000 ;80*25*2
jl keepClearing
pop es
popa
ret
print_vram:
pusha
push es
mov ax, 0xB800
mov es, ax
mov di, 0
print_vramLoop:
mov al, [si]
cmp al, 0
je print_vramEnd
mov byte [es:di], al
mov byte [es:di + 1], 3 ;white
add di, 2
inc si
jmp print_vramLoop
print_vramEnd:
pop es
popa
ret
print_bios:
pusha
print_loop:
lodsb
or al, al ;nustatomas zf
jz print_loopEnd
mov ah, 0x0E
int 0x10
jmp print_loop
print_loopEnd:
popa
ret
;skaitoma i [es:bx]
read_2ndLoader:
pusha
mov ah, 2 ;read sector into memory
mov al, 4 ;sektoriu skaicius
mov ch, 0 ;cilindtas
mov cl, 2 ;sektorius
mov dh, 0 ;galvute
mov dl, 0 ;floppy drive number
int 0x13
jnc read_2ndLoaderEnd
mov si, floppyErrorMsg
call print_bios
read_2ndLoaderEnd:
popa
ret
START:
xor ax, ax ;ax = 0
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0xAC00 ;steko virsune, 300 baitu
mov si, startMsg
call print_bios
mov bx, 0xAD00
call read_2ndLoader
cli
mov si, 9
shl si, 2 ;9 * 4
mov [es:si], word keaboard_handler
mov [es:si + 2], cs
mov si, 0x80
shl si, 2 ;21 * 4
mov [es:si], word kernel_handler
mov [es:si + 2], cs
sti
call 0x0000:0xAD00
hang:
jmp hang
startMsg db 'ADOS 2011 :D', 13, 10, 0
keyMsg db 'Key pressed', 13, 10, 0
floppyErrorMsg db 'Error reading kernel from flopy!', 13, 10, 0
welcomeMsg db 'Greetings C kernel!', 13, 10, 0
times 510-($-$$) db 0
db 0x55
db 0xAA
;times 1474560-($-$$) db 0 ;1.44 MB
| 16.447059 | 67 | 0.572604 |
f1cb5982aa007806688ab74ff80b95a14fdc42e7 | 525 | asm | Assembly | programs/oeis/022/A022794.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/022/A022794.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/022/A022794.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A022794: Place where n-th 1 occurs in A023132.
; 1,2,3,5,7,9,12,15,18,22,26,30,35,40,45,51,57,64,71,78,86,94,102,111,120,129,139,149,159,170,181,192,204,216,229,242,255,269,283,297,312,327,342,358,374,390,407,424,441,459,477,496,515,534,554,574
mov $14,$0
mov $16,$0
add $16,1
lpb $16,1
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $13,$0
add $13,1
lpb $13,1
mov $0,$11
sub $13,1
sub $0,$13
mov $1,$0
mod $1,17
gcd $1,3
div $1,2
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
| 19.444444 | 197 | 0.582857 |
35da64c2657efdacb4379aca643c29620ee1baa6 | 905 | asm | Assembly | programs/oeis/165/A165725.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/165/A165725.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/165/A165725.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A165725: Largest divisor of n coprime to 30. I.e., a(n) = max { k | gcd(n, k) = k and gcd(k, 30) = 1 }.
; 1,1,1,1,1,1,7,1,1,1,11,1,13,7,1,1,17,1,19,1,7,11,23,1,1,13,1,7,29,1,31,1,11,17,7,1,37,19,13,1,41,7,43,11,1,23,47,1,49,1,17,13,53,1,11,7,19,29,59,1,61,31,7,1,13,11,67,17,23,7,71,1,73,37,1,19,77,13,79,1,1,41,83,7,17,43,29,11,89,1,91,23,31,47,19,1,97,49,11,1,101,17,103,13,7,53,107,1,109,11,37,7,113,19,23,29,13,59,119,1,121,61,41,31,1,7,127,1,43,13,131,11,133,67,1,17,137,23,139,7,47,71,143,1,29,73,49,37,149,1,151,19,17,77,31,13,157,79,53,1,161,1,163,41,11,83,167,7,169,17,19,43,173,29,7,11,59,89,179,1,181,91,61,23,37,31,187,47,7,19,191,1,193,97,13,49,197,11,199,1,67,101,203,17,41,103,23,13,209,7,211,53,71,107,43,1,217,109,73,11,221,37,223,7,1,113,227,19,229,23,77,29,233,13,47,59,79,119,239,1,241,121,1,61,49,41,247,31,83,1
add $0,1
lpb $0,1
mov $2,$0
gcd $2,120
div $0,$2
lpe
mov $1,$0
| 82.272727 | 728 | 0.630939 |
ac1639e9522f020f6ede2811ebd98952a22944f5 | 354 | asm | Assembly | programs/oeis/229/A229463.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/229/A229463.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/229/A229463.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A229463: Expansion of 1/((1-x)^2*(1-26*x)).
; 1,28,731,19010,494265,12850896,334123303,8687205886,225867353045,5872551179180,152686330658691,3969844597125978,103215959525275441,2683614947657161480,69773988639086198495,1814123704616241160886,47167216320022270183053
add $0,1
lpb $0
sub $0,1
add $2,1
mul $2,26
add $1,$2
lpe
div $1,26
mov $0,$1
| 27.230769 | 220 | 0.768362 |
4d0afa7ad27f396a8dbb5ee48b2a03b770435749 | 1,787 | asm | Assembly | Library/Kernel/File/fileManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/File/fileManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/File/fileManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @-----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: File
FILE: fileManager.asm
AUTHOR: Tony Requist
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/88 Initial version
DESCRIPTION:
This file assembles the file code.
See the spec for more information.
$Id: fileManager.asm,v 1.1 97/04/05 01:11:40 newdeal Exp $
-------------------------------------------------------------------------------@
include kernelGeode.def
;--------------------------------------
; Include files
;--------------------------------------
include fileEnum.def
include vm.def
include sem.def
include timer.def
include disk.def
include localize.def
include lmem.def ; for FileGetCurrentPathIDs
include object.def ; for FileGetCurrentPathIDs
include gcnlist.def ; for FILEFLUSHCHANGENOTIFICATIONS
include localize.def
include char.def
include Internal/geodeStr.def
include Internal/interrup.def
include Internal/fileStr.def
include kernelFS.def
;--------------------------------------
include fileMacro.def ;FILE macros
include fileConstant.def ;FILE constants
;-------------------------------------
include fileVariable.def
;-------------------------------------
FSResident segment
include fileEC.asm
include fileEnum.asm
include fileFile.asm
include fileIO.asm
include fileList.asm
include fileOpenClose.asm
include filePath.asm
include fileSync.asm
include fileUtils.asm
FSResident ends
include fileLink.asm
include fileC.asm
;-------------------------------------
kinit segment
include fileInit.asm
kinit ends
end
| 20.54023 | 81 | 0.571908 |
2693240c8417ad4c0ca3b3afc6ff4acc253778bc | 18,851 | asm | Assembly | bas816new_natshims.asm | dominicbeesley/CommunicatorBasic100 | f7859a1e1e6616799e7ddc3687d13185b6180974 | [
"MIT"
] | null | null | null | bas816new_natshims.asm | dominicbeesley/CommunicatorBasic100 | f7859a1e1e6616799e7ddc3687d13185b6180974 | [
"MIT"
] | null | null | null | bas816new_natshims.asm | dominicbeesley/CommunicatorBasic100 | f7859a1e1e6616799e7ddc3687d13185b6180974 | [
"MIT"
] | 1 | 2021-03-02T10:03:44.000Z | 2021-03-02T10:03:44.000Z |
; NOTE: this file is _included_ rather than linked!
; This sets up interrupt shims at 0A00 in system memory and native vectors
; at ChipRAM 008Fxx and tests interrupt entry/exit by reenabling interrupts and calling
; MOS functions
.assert __SHIMS_SIZE__ <= $100, error, "SHIMS size must be <=$100"
.IFDEF __NATVEC_SIZE__
.assert __NATVEC_SIZE__ = $10, error, "NATVEC size must be $10"
.ENDIF
debug_hex_byte:
.a8
.i8
pha
lsr A
lsr A
lsr A
lsr A
jsr @nyb
pla
and #$0f
@nyb:
cmp #$0a
bcc @dig
adc #$06
@dig:
adc #'0'
jmp call_OSWRCH
BL_debug_print:
lda [DP_BAS_BL_DEBUGPTR]
beq @sk
jsr call_OSWRCH
inc DP_BAS_BL_DEBUGPTR
bne BL_debug_print
inc DP_BAS_BL_DEBUGPTR+1
bne BL_debug_print
@sk: lda #$0A
jsr call_OSWRCH
lda #$0D
jmp call_OSWRCH
;TODO: ShowRegsL make new entry point here
; we assume stack looks like a native interrupt i.e.
; + 6 Program bank
; + 5 PCH
; + 4 PCL
; + 3 Native mode flags
; + 2 Caller retH
; + 1 Caller retL
ShowRegs: php ; save entry flags
; + 7 Program bank
; + 6 PCH
; + 5 PCL
; + 4 Native mode flags
; + 3 Caller retH
; + 2 Caller retL
; + 1 Entry flags
rep #$30
.a16
.i16
phb
phd
phy
phx
pha
pea MOS_BASIC_DP
pld
phk
plb
; + 16 Program bank
; + 15 PCH
; + 14 PCL
; + 13 Native mode flags
; + 12 Caller retH
; + 11 Caller retL
; + 10 Entry flags
; + 9 B
; + 7 DP
; + 5 Y (16)
; + 3 X (16)
; + 1 A (16)
sep #$30
.a8
.i8
jsr printStringAfter
.byte 13,10,"Flags="
nop
lda 13,S
jsr debug_hex_byte
lda #'='
jsr call_OSWRCH
ldx #7
lda 13,S
@lp: rol A
pha
lda FlagNames,X
bcc @skU
and #$DF
@skU: jsr call_OSWRCH
pla
dex
bpl @lp
jsr printStringAfter
.byte ", Stack="
nop
tsc
clc
adc #16
xba
bcc @sk1
inc A
@sk1: jsr debug_hex_byte
tsc
clc
adc #16
jsr debug_hex_byte
jsr printStringAfter
.byte ", PC="
nop
lda 16,S
jsr debug_hex_byte
lda 15,S
jsr debug_hex_byte
lda 14,S
jsr debug_hex_byte
jsr printStringAfter
.byte ", B="
nop
lda 9,S
jsr debug_hex_byte
jsr printStringAfter
.byte ", DP="
nop
lda 8,S
jsr debug_hex_byte
lda 7,S
jsr debug_hex_byte
jsr printCRLF
jsr printStringAfter
.byte "A="
lda 2,S
jsr debug_hex_byte
lda 1,S
jsr debug_hex_byte
jsr printStringAfter
.byte ", X="
lda 3,S
jsr debug_hex_byte
lda 4,S
jsr debug_hex_byte
jsr printStringAfter
.byte ", Y="
lda 5,S
jsr debug_hex_byte
lda 6,S
jsr debug_hex_byte
jsr printCRLF
rep #$30
.a16
.i16
pla
plx
ply
pld
plb
plp
rts
FlagNames: .byte "czidxmvn" ; backwards nvmxdizc
;
; we assume stack looks like a native interrupt i.e.
; + 6 Program bank
; + 5 PCH
; + 4 PCL
; + 3 Native mode flags
; + 2 Caller retH
; + 1 Caller retL
StackTrace: php
rep #$30
.a16
.i16
phd
pha
phx
phy
;
; we assume stack looks like a native interrupt i.e.
; + 15 Program bank
; + 14 PCH
; + 13 PCL
; + 12 Native mode flags
; + 11 Caller retH
; + 10 Caller retL
; + 9 Flags
; + 7 DP
; + 5 A
; + 3 X
; + 1 Y
sep #$30
.a8
.i8
pea MOS_BASIC_DP
pld
; assume 8 bit stack!
tsx
txa
clc
adc #16 ; skip stack crud
sta DP_BAS_BL_DEBUGPTR ; store stack start
and #$F8
tax
@lp0: txa
and #7
bne @sk0
jsr printCRLF
lda #'1' ; assumes page 1 stack!
jsr call_OSWRCH
txa
jsr debug_hex_byte
@sk0: jsr @spc
cpx DP_BAS_BL_DEBUGPTR
bcc @nop
lda f:$000100,X
jsr debug_hex_byte
@sk1: inx
bne @lp0
jsr printCRLF
rep #$30
.a16
.i16
ply
plx
pla
pld
plp
rts
.a8
.i8
@nop: jsr @spc2
bra @sk1
@spc2: jsr @spc
@spc: lda #' '
jmp call_OSWRCH
;============================================================================
; Shims initialise
;============================================================================
;
; The shims and any native vectors etc are setup here, in general shims
; are copied to bank 0 and used to jump onwards to the MOS entry points with
; emulation mode in force
MOS_shims_init:
.IFDEF BLITTER
;============================================================================
; BLITTER Shims initialise
;============================================================================
;
; Uses the JIM memory interface to copy the native mode vectors to the
; shadowed chip ram magic locations
;
; copies the shims code to bank0
;
; makes a native and emulation mode break vectors
;
; we're entering in 8bit emulation mode
.a8
.i8
php
sei
ldy #0
phy
plb
lda zp_mos_jimdevsave
pha
; enable blitter JIM interface
lda #JIM_DEVNO_BLITTER
sta zp_mos_jimdevsave
sta fred_JIM_DEVNO
; copy shims to sys memory
; check whether the page we're using is BLTURBO'd
lda sheila_MEM_LOMEMTURBO
and #1<<(>__SHIMS_RUN__ >> 4)
php
lda #0
plp
bne @skturbo
lda #$FF ; force SYS bank (actually bank 0 logical)
@skturbo:
sta fred_JIM_PAGE_HI
lda #>__SHIMS_RUN__
sta fred_JIM_PAGE_LO
ldx #<__SHIMS_SIZE__-1
@l1: phk
plb
lda __SHIMS_LOAD__,X
phy
plb
sta JIM+<__SHIMS_RUN__,X
dex
cpx #$FF
bne @l1
phy
plb
; copy vectors to ChipRAM
; lda #^NATVEC_CHIP
lda #$00 ; force 0 bank (actually hidden behind ROMS)
sta fred_JIM_PAGE_HI
lda #>NATVEC_CHIP
sta fred_JIM_PAGE_LO
ldx #<__NATVEC_SIZE__-1
@l2: phk
plb
lda __NATVEC_LOAD__,X
phy
plb
sta JIM+<__NATVEC_RUN__,X
dex
cpx #$FF
bne @l2
pla
sta zp_mos_jimdevsave
sta fred_JIM_DEVNO
; clear NATVEC_BRK
lda #<shim_brk_to_emu
sta NATVEC_BRK
lda #>shim_brk_to_emu
sta NATVEC_BRK+1
lda #^shim_brk_to_emu
sta NATVEC_BRK+2
; install our new BRKV handler to allow jumping long
; put old BRK handler in new vector
lda #0
sta NATVEC_BRK_EMU+2
lda BRKV
sta NATVEC_BRK_EMU
lda BRKV+1
sta NATVEC_BRK_EMU+1
lda #<shim_brk_emu
sta BRKV
lda #>shim_brk_emu
sta BRKV+1
plp
rts
.ENDIF
.IFDEF BEEB816
;============================================================================
; BEEB816 Shims initialise
;============================================================================
;
; Uses slow loopsto copy the native mode vectors to the
; shadowed chip ram magic locations, TODO: use MVN/P?
;
; copies the shims code to bank0
;
; makes a native and emulation mode break vectors
;
; HOGLET: check this for sanity please
; we're entering in 8bit emulation mode
.a8
.i8
php
sei
; point B at Bank 0 - destination for out copies
ldy #0
; copy shims to sys memory
ldx #<__SHIMS_SIZE__-1
@l1: phk
plb
lda __SHIMS_LOAD__,X
phy
plb
sta __SHIMS_RUN__,X
dex
cpx #$FF
bne @l1
; This should be the "shadow ram" for vectors defined in the .cfg file!?
ldy #^__NATVEC_RUN__
ldx #<__NATVEC_SIZE__-1
@l2: phk
plb
lda __NATVEC_LOAD__,X
phy
plb
sta __NATVEC_RUN__,X
dex
cpx #$FF
bne @l2
; clear NATVEC_BRK (not really needed as BASIC sets up its own native handler,
; emu mode handler will drop back to MOS, this should handle crashes before BASIC
; is started)
lda #<shim_brk_to_emu
sta NATVEC_BRK
lda #>shim_brk_to_emu
sta NATVEC_BRK+1
lda #^shim_brk_to_emu
sta NATVEC_BRK+2
; install our new BRKV handler to allow jumping long
; put old BRK handler in new vector
lda #0
sta NATVEC_BRK_EMU+2
lda BRKV
sta NATVEC_BRK_EMU
lda BRKV+1
sta NATVEC_BRK_EMU+1
lda #<shim_brk_emu
sta BRKV
lda #>shim_brk_emu
sta BRKV+1
plp
rts
.ENDIF
.IFDEF DOSSY
;============================================================================
; DOSSYtronics TUBE Shims initialise
;============================================================================
;
; No native mode vectors, this is handled by the Tube Client ROM
;
; copies the shims code to bank0
;
; Bodges together a pair of long break vectors...TODO: change client ROM to
; better handle native/emu mode BRKS
;
; assume we're entering in 8bit mode, native
.a8
.i8
; switch to native anyway just in case
clc
xce
; point B at Bank 0 - destination for out copies
ldy #0
; copy shims to sys memory
ldx #<__SHIMS_SIZE__-1
@l1: phk
plb
lda __SHIMS_LOAD__,X
phy
plb
sta __SHIMS_RUN__,X
dex
cpx #$FF
bne @l1
; the TUBE OS currently only has a single BRK entry point
; for both emulated and native mode, blithely pretend its
; a native brk, NATVEC_BRK_EMU is never called
lda #<defaultbrk
sta NATVEC_BRK
lda #>defaultbrk
sta NATVEC_BRK+1
lda #^defaultbrk
sta NATVEC_BRK+2
lda #<bodgeBRK
sta BRKV
lda #>bodgeBRK
sta BRKV+1
rts
PrintUnexBRK: jsr printStringAfter
.byte "UNEXPECTED BRK!",0
rts
defaultbrk:
; BRK vector in native mode stack will contain:
; + 4 Program bank
; + 3 PCH
; + 2 PCL
; + 1 Native mode flags
; BASIC should set up its own handlers, if this gets called
; something went wrong early in setup
jsr ShowRegs
jsr StackTrace
jsr PrintUnexBRK
@here: jmp @here
.ENDIF
.SEGMENT "SHIMS"
;============================================================================
; OS shims for BEEB816/BLITTER
;============================================================================
;
; These shims wrap code to enter emulation mode and call the normal MOS 1.20
; entry points
.IF .defined(BEEB816) || .defined(BLITTER)
; TODO: need to set D/B/K or do a long jump at least
nat_OSWRCH:
php ; save flags
phb
phd
jsr zeroBDPemu
jsr OSWRCH
clc
xce ; back to native mode
pld
plb
plp
rtl
nat_OSWORD:
php ; save flags
phd
phb
jsr zeroBDPemu
jsr OSWORD
bcs ret_SEC
bcc ret_CLC
nat_OSBYTE: ; force emulation, we don't care about A,X,Y losing 16bitness, OSBYTE return 8bits in A,X,Y
php ; but do save flags here
phd
phb
jsr zeroBDPemu
jsr OSBYTE
bcs ret_SEC
ret_CLC:
clc
xce ; back to native mode
plb
pld
plp
clc
rtl
ret_SEC:
clc
xce ; back to native mode
plb
pld
plp ; get original flags with Cy
sec
rtl
; note this expects X/Y to point to a string in Bank0!
nat_OSCLI:
php ; save flags
phd
phb
jsr zeroBDPemu
sec
xce ; enter emulation mode
jsr OSCLI
bra ret_CLC
nat_OSRDCH:
php ; save flags
phd
phb
jsr zeroBDPemu
jsr OSRDCH
bcc ret_CLC
bra ret_SEC
nat_OSFIND:
php ; save flags
phd
phb
jsr zeroBDPemu
jsr OSFIND
bcc ret_CLC
bra ret_SEC
nat_OSBGET:
php ; save flags
phd
phb
jsr zeroBDPemu
jsr OSBGET
bcc ret_CLC
bra ret_SEC
nat_OSBPUT:
php ; save flags
phd
phb
jsr zeroBDPemu
jsr OSBPUT
bcc ret_CLC
bra ret_SEC
nat_OSARGS:
php ; save flags
phd
phb
jsr zeroBDPemu
jsr OSARGS
bcc ret_CLC
bra ret_SEC
zeroBDPemu:
phk ; reset direct page register for MOSishness
phk
pld
phk
plb ; reset databank register TODO: is this the most efficient way?
sec
xce ; enter emulation mode
rts
; this is installed in the normal MOS brk vector and then jml onwards
; the default action is to call the old handler (when we were entered)
shim_brk_emu: jml (NATVEC_BRK_EMU)
; this handles native mode interrupts
shim_brk: jml (NATVEC_BRK)
; this is the default behaviour...pass down to the normal MOS handler
shim_brk_to_emu:
; BRK vector in native mode stack will contain:
; + 4 Program bank
; + 3 PCH
; + 2 PCL
; + 1 Native mode flags
; this handler ignores the program bank (the stack will probably)
; be reset anyway and just mangles the flags to look like a normal 6502
; BRK (i.e bit 5 is set and bit 6 is cleared)
; also this does nothing to try and save any extended registers
; for a more general Native mode BRK:
; - add a Native mode BRK vector, either use one of the unused MOS vectors
; or add our own in private RAM at 008Fxx?
; - default N_BRKV would point to this shim
sep #%00110000 ; 8 bit M, IX
.a8
.i8
pha ; save A but not sure of the utility of this as it might have been 16 bits!
phk ; We know K is always 0!
phk
pld ; set DP to 0
phk
plb ; set data bank to 0
lda 2,S
; make the flags look like those of an emulation mode BRK
and #%11001111 ; clear the M/X flags out of pushed flags
ora #%00010000 ; force the B bit in flags
sta 2,S
pla
sec
xce
jmp (HWVEC_6502_IRQ) ; jump to emulation mode brk vector
; TODO - jump straight to BRKV here?
shim_cop:
shim_abort:
shim_nmi:
rti ; TODO!
shim_irq:
;; irq handling code derived from http://cerebro.xu.edu/~ryanr/atari/65816.html
;; and https://github.com/BigEd/boot816/blob/master/boot816.as
;; this is called from the 816 irq vector, so only called in 816 mode
;; a beeb-hosted 816 must switch to 6502 mode to use the OS handler
;; or it could handle it itself
;; note that the machine will already have pushed P and done SEI
phd ; Save DBR and Direct
phb
; pea $0000 ; Clear Direct...
phk
phk ; use two phk's, cheaper than a pea?
pld ;
phk ; ... and with a single zero byte ...
plb ; ... clear the DBR
php ; push 816 P reg for reg width info (I was set as IRQ vector fetched)
rep #%00110000 ; 16 bits
.a16
.i16
pha
phx ; X&Y saved at present width, because resetting them
phy ; to 8 bits would destroy the upper half contents.
per shim_irq_ret ; push return address (then status) for the RTI
;; push a fake interrupt frame so we can call the 6502 host interrupt service
sep #%00110000 ; Set 8 bit regs
.a8
.i8
lda #%00000100 ; we want I set and B clear for the 6502 irq handler
pha ; saving for sake of 6502 handler and RTI
;; everything is safe
;; switch to 6502 mode for the host interrupt service routine
sec
xce
;; now jump to the appropriate interrupt vector, such as...
jmp (HWVEC_6502_IRQ) ; Its RTI will return to IRETURN
; done
shim_irq_ret:
clc ; beeb special: return to 816-mode (we're in the 816-mode handler!)
xce
rep #%00110000 ; 16 bits
.a16
.i16
ply ; now restore X&Y at whatever width they were saved at 16 bits
plx ;
pla
plp ; recover unmodified 816 status byte - for reg widths
; we know this saved P has SEI
; we don't worry about N and Z because the next RTI will pull a real P
plb ; Restore DBR and Direct
pld
rti ; Return to main program (pulling genuine user-mode P then 3 PC bytes)
.SEGMENT "NATVEC"
NV_RES0: .word .LOWORD(0)
NV_RES1: .word .LOWORD(0)
NV_COP: .word .LOWORD(shim_cop)
NV_BRK: .word .LOWORD(shim_brk)
NV_ABORT: .word .LOWORD(shim_abort)
NV_NMI: .word .LOWORD(shim_nmi)
NV_RES2: .word .LOWORD(0)
NV_IRQ: .word .LOWORD(shim_irq)
.ENDIF
.IFDEF DOSSY
;============================================================================
; OS shims for DOSSYtronics TUBE
;============================================================================
;
; These shims are simpler - the TUBE OS already contains native/emulation
; mode agnostic entry points
;
; At present these are entered with JSR so we just need to bounce down to
; bank 0 (here) and return with a JSL
DP0:
phk
phk
pld
phk
plb
rts
nat_OSWRCH:
phd
phb
jsr DP0
jsr OSWRCH
plb
pld
rtl
nat_OSWORD:
phd
phb
jsr DP0
jsr OSWORD
plb
pld
rtl
nat_OSBYTE: ; force emulation, we don't care about A,X,Y losing 16bitness, OSBYTE return 8bits in A,X,Y
phd
phb
jsr DP0
jsr OSBYTE
plb
pld
rtl
; note this expects X/Y to point to a string in Bank0!
nat_OSCLI:
phd
phb
jsr DP0
jsr OSCLI
plb
pld
rtl
nat_OSRDCH: phd
phb
jsr DP0
jsr OSRDCH
plb
pld
rtl
nat_OSFIND: phd
phb
jsr DP0
jsr OSFIND
plb
pld
rtl
nat_OSBGET: phd
phb
jsr DP0
jsr OSBGET
plb
pld
rtl
nat_OSFILE:
phd
phb
jsr DP0
jsr OSFILE
plb
pld
rtl
nat_OSBPUT: phd
phb
jsr DP0
jsr OSBPUT
plb
pld
rtl
nat_OSARGS: phd
phb
jsr DP0
jsr OSARGS
plb
pld
rtl
; !!! TODO: pretend all BRKs are native mode !!!
bodgeBRK: clc
xce
jml [NATVEC_BRK]
.ENDIF
.END | 19.003024 | 103 | 0.536895 |
d9eb04c509868c3b6d5410c4c0d37a39abc48e88 | 1,809 | asm | Assembly | Library/Kernel/FSD/fsdManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/FSD/fsdManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/FSD/fsdManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC/GEOS
MODULE: Kernel -- FSD
FILE: fsdManager.asm
AUTHOR: Adam de Boor, July 18, 1991
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 07/18/91 Initial revision.
DESCRIPTION:
Manager for this module.
$Id: fsdManager.asm,v 1.1 97/04/05 01:17:41 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
_FSD = 1
;------------------------------------------------------------------------------
; Include definitions.
;------------------------------------------------------------------------------
include kernelGeode.def
include sem.def
include localize.def
include gcnlist.def
include object.def
include Internal/interrup.def
include Internal/geodeStr.def
include Internal/fileStr.def
include Internal/timerInt.def ; For counting durations of operations
include kernelFS.def
;------------------------------------------------------------------------------
; Local variables.
;------------------------------------------------------------------------------
include fsdConstant.def
include fsdVariable.def
;------------------------------------------------------------------------------
; Here comes the code...
;------------------------------------------------------------------------------
include fsdDisk.asm ; Disk-related FSD support code
include fsdDrive.asm ; Drive-related FSD support code
include fsdFile.asm ; File-related FSD support code
include fsdSkeleton.asm ; Skeleton filesystem driver.
include fsdUtils.asm ; Various utility routines
include fsdEC.asm ; Error-checking routines
include fsdInit.asm
end
| 29.655738 | 80 | 0.469873 |
e26ca0f8b786fdd5cc14751c4c955b04b0894838 | 32,011 | asm | Assembly | Battleship.asm | agriel/Battleship-game | 6e13a91f95888c1099555e078a44082183ec5073 | [
"MIT"
] | 2 | 2015-02-01T16:46:26.000Z | 2018-02-22T18:44:45.000Z | Battleship.asm | agriel/Battleship-game | 6e13a91f95888c1099555e078a44082183ec5073 | [
"MIT"
] | null | null | null | Battleship.asm | agriel/Battleship-game | 6e13a91f95888c1099555e078a44082183ec5073 | [
"MIT"
] | null | null | null | #--------------------------- #
# Facundo Agriel #
# Project 4 #
# CS 366 #
#--------------------------- #
.data
EnterGuess: .asciiz "\nPlease enter your guess: \n"
Miss: .asciiz "\nMiss\n"
Hit: .asciiz "\nHit\n"
RowLabel: .asciiz "\n A B C D E F G H\n"
Welcome: .asciiz "Welcome to the game of battleship, please give me a moment while I place the ships on the grid for you to locate.\n"
incrrctInptMsg: .asciiz "\nSorry, you entered an incorrect input sequence. Please Try again.\n"
battleSunk: .asciiz "You've sunk my battle ship!\n"
cruiserSunk: .asciiz "You've sunk my cruiser ship!\n"
submarineSunk: .asciiz "You've sunk my submarine!\n"
mineSunk: .asciiz "You've sunk my minesweeper!\n"
endOfGame: .asciiz "\nGame Over!\n"
#Variables to keep track if a ship has been sunk
# For example, for the battleship,
# it is address -> bbbbxp
# the first 4 b's are the current positions
# the x is the offset to which index to go to in the array
# p is the parity bit. Which means that it keeps track if we already printed the message
# out.
arrayDisplay: .space 64 #allocate for 64 char array
input: .space 8 #7 bytes for showall + 1b for null char
cruiserMark: .space 7
battleMark: .space 6
sub1Mark: .space 5
sub2Mark: .space 5
mineMark: .space 4
subD1: .data 3 #to choose which sub to use
subD2: .data 3
.text
main:
jal __initialize
jal __placeShips
la $a0, Welcome
li $v0, 115
jal PrintDriver
jal __printBoard
li $s1, 5
gameLoop:
la $a0, EnterGuess
li $v0, 29
jal PrintDriver
jal __getInputAndConvert
jal __checkIfSunk
jal __printBoard
jal __checkEndOfGame
addi $s1, $s1, 1
bgt $s1, 4, gameLoop
b end
#--------------------------------------------------------------------- #
# This function initializes the board with dashes in the #
# array. Does not place ships. __placeShips does that #
#--------------------------------------------------------------------- #
__initialize:
li $t2, 45 #initialize char array with dashes
la $t0, arrayDisplay
addi $t1, $t0, 64 #$t1 will point to value after array
initLoop:
sb $t2, 0($t0) #store value read
addi $t0, $t0, 1 #change to 1 for char
blt $t0, $t1, initLoop #know end of array is when $t0 is at array + 64
jr $ra #return
#--------------------------------------------------------- #
# This function randomly places the ships in the board. #
# Ships are done in this order: #
# cruiser - size: 5 and qty: 1 #
# battleship - size: 4 and qty: 1 #
# submarine - size: 3 and qty: 2 #
# Some facts that will make the algorithm run more #
# efficiently and help eliminate some error checking #
# code: #
# -cruisers can only start at 1-4 if placed vertically #
# -start at A through D if horizontally #
# -battleship can only start at 1-5 if placed vertically #
# -start at A through E if placed horizontally #
# -submarines can only start at 1-6 if placed vertically #
# -start at A through F if placed horizontally #
# -minesweeper can only start at 1-7 if placed vertically #
# -start at A through G if placed horizontally #
# So there will be a total of of 6 functions to place the #
# ships on the board. #
# I used a sort of brute force approach to place the ships #
# For example, we generate a random number with an upper #
# bound of 4 for the battleship and initially check if #
# there is a dash there and proceed as long as there are #
# dashes. The process repeats untill the ship has been #
# placed (this is the "brute force approach" #
#--------------------------------------------------------- #
__placeShips:
#---cruiser placement is first.------------------------ #
#-------------------------------------------------- #
#---cruiser placement horizontal or vertical---#
randomVertorHorCruiser:
li $a1, 2 #upperbound is at 2 so 0-1 will be generated
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
beq $a0, 1, vertCruisrPlacement #if equal to 1 then it's vertical
#---horizontal placement of cruiser---#
horiCruisrPlacement:
li $a1, 4 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 8 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 99 #ascii code for 'c'
li, $t3, 0 #load var index for loop
storeHorCruiserLoop:
sb $t2, 0($t1) #store 'c'
addi $t1, $t1, 1 #increment
addi $t3, $t3, 1 #increment
blt $t3, 5, storeHorCruiserLoop #stop after 5 iterations
b placeBattleships
#---vertical placement of cruiser---#
vertCruisrPlacement:
li $a1, 8 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 4 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 99 #ascii code for 'c'
li, $t3, 0 #load var index for loop
storeVerCruiserLoop:
sb $t2, 0($t1) #store 'c'
addi $t1, $t1, 8 #increment
addi $t3, $t3, 1 #increment
blt $t3, 5, storeVerCruiserLoop #stop after 5 iterations
#---battleship placement is second.---#
placeBattleships:
#---randomize vertical or horizontal placement---#
li $a1, 2 #upperbound is at 2 so 0-1 will be generated
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
beq $a0, 1, vertBattlPlacement #if equal to 1 then it's vertical
#---horizontal placement of battleship---#
horiBattlePlacement:
li $a1, 4 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 8 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 98 #ascii code for 'b'
li $t3, 0 #load var index for loop
#check all positions that will placed aren't taken
checkHorBattleLoop:
lb $t4, 0($t1)
bne $t4, 45 horiBattlePlacement
addi $t3, $t3, 1
addi $t1, $t1, 1
blt $t3, 4, checkHorBattleLoop
addiu $t1, $t1, -4 #reset address+offset
li, $t3, 0 #reset
storeHorBattlLoop:
sb $t2, 0($t1) #store 'b'
addi $t1, $t1, 1 #increment
addi $t3, $t3, 1 #increment
blt $t3, 4, storeHorBattlLoop #stop after 4 iterations
b placeSubmarines
#---vertical placement of battleships---#
vertBattlPlacement:
li $a1, 8 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 5 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 98 #ascii code for 'b'
li, $t3, 0 #load var index for loop
checkVerBattleLoop:
lb $t4, 0($t1)
bne $t4, 45, vertBattlPlacement
addi $t3, $t3, 1
addi $t1, $t1, 8
blt $t3, 4, checkVerBattleLoop
addiu $t1, $t1, -32 #reset address+offset
li, $t3, 0 #reset
storeVerBattleLoop:
sb $t2, 0($t1) #store 'b'
addi $t1, $t1, 8 #increment
addi $t3, $t3, 1 #increment
blt $t3, 4, storeVerBattleLoop #stop after 4 iterations
#-------------------------------------------------------------------------------#
#---Placement of 2 submarines---#
li $t7, 0 #index for loop to place two ships
placeSubmarines: #$t7 might contain a diff value
#---randomize vertical or horizontal placement---#
li $a1, 2 #upperbound is at 2 so 0-1 will be generated
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
beq $a0, 1, vertSubPlacement #if equal to 1 then it's vertical
#---Store horizontal submarines---#
horiSubPlacement:
li $a1, 6 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 8 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 115 #ascii code for 's'
li $t3, 0 #load var index for loop
checkHorSubLoop:
lb $t4, 0($t1)
bne $t4, 45, horiSubPlacement
addi $t3, $t3, 1
addi $t1, $t1, 1
blt $t3, 3, checkHorSubLoop
addiu $t1, $t1, -3 #reset address+offset
li $t3, 0 #reset
storeHorSubLoop:
sb $t2, 0($t1) #store 's' $t1, array disp
addi $t1, $t1, 1 #increment
addi $t3, $t3, 1 #increment
#li $t3, 0
blt $t3, 3, storeHorSubLoop #stop after 3 iterations
b subLoop
#--Vertical placement of Subs--#
vertSubPlacement:
li $a1, 8 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 6 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 115 #ascii code for 's'
li, $t3, 0 #load var index for loop
checkVerSubLoop:
lb $t4, 0($t1)
bne $t4, 45, vertSubPlacement
addi $t3, $t3, 1
addi $t1, $t1, 8
blt $t3, 3, checkVerSubLoop
addiu $t1, $t1, -24 #reset address+offset
li $t3, 0 #reset
storeVerSubLoop:
sb $t2, 0($t1) #store 's'
addi $t1, $t1, 8 #increment
addi $t3, $t3, 1 #increment
blt $t3, 3, storeVerSubLoop #stop after 3 iterations
subLoop:
addiu $t7, $t7, 1
blt $t7, 2, placeSubmarines
#---Placement of minesweeper---#
placeMinesweeper:
#---randomize vertical or horizontal placement---#
li $a1, 2 #upperbound is at 2 so 0-1 will be generated
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
beq $a0, 1, vertMinPlacement #if equal to 1 then it's vertical
#---Store horizontal minesweeper---#
horiMinPlacement:
li $a1, 7 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 7 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 109 #ascii code for 'm'
li $t3, 0 #load var index for loop
checkHorMinLoop:
lb $t4, 0($t1)
bne $t4, 45, horiMinPlacement
addi $t3, $t3, 1
addi $t1, $t1, 1
blt $t3, 2, checkHorMinLoop
addiu $t1, $t1, -2 #reset address+offset
li $t3, 0 #reset
storeHorMinLoop:
sb $t2, 0($t1) #store 'm'
addi $t1, $t1, 1 #increment
addi $t3, $t3, 1 #increment
blt $t3, 2, storeHorMinLoop #stop after 2 iterations
b finishPlacingShips
#--Vertical placement of Minesweeper--#
vertMinPlacement:
li $a1, 7 #set upper bound
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $t0, $a0 #move out to make room for next random
li $a1, 7 #now we choose row
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal GenerateRandom
lw $ra, 0($sp)
addiu $sp, $sp, 4
addiu $sp, $sp, -12 #allocate space
sw $a0, 0($sp) #save last row random
sw $t0, 4($sp) #save column
sw $ra, 8($sp) #save return address
jal __convertNumber #need to convert row to array index
lw $ra, 8($sp) #load return address
lw $t0, 4($sp) #load column
lw $a0, 0($sp) #get value from function
addiu $sp, $sp, 12 #deallocate space
add $a0, $t0, $a0 #get offset of array index
la $t1, arrayDisplay #load address of array
addu $t1, $t1, $a0 #add offset to address
li $t2, 109 #ascii code for 'm'
li $t3, 0 #load var index for loop
checkVerMinLoop:
lb $t4, 0($t1)
bne $t4, 45, vertMinPlacement
addi $t3, $t3, 1
addi $t1, $t1, 8
blt $t3, 2, checkVerMinLoop
addiu $t1, $t1, -24 #reset address+offset
li, $t3, 0 #reset
storeVerMinLoop:
sb $t2, 0($t1) #store 'm'
addi $t1, $t1, 8 #increment
addi $t3, $t3, 1 #increment
blt $t3, 2, storeVerMinLoop #stop after 2 iterations
finishPlacingShips:
jr $ra
#----------------------------------------------------------- #
# This function checks if the game has ended #
#----------------------------------------------------------- #
__checkEndOfGame:
la $t0, arrayDisplay
li $t3, 0
eofGameLoop:
lb $t1, 0($t0)
beq $t1, 98, finishChecking # check if 'b' is seen
beq $t1, 99, finishChecking # check if 'c' is seen
beq $t1, 115, finishChecking # check if 's' is seen
beq $t1, 109, finishChecking # check if 'm' is seen
addiu $t0, $t0, 1
addiu $t3, $t3, 1
blt $t3, 64, eofGameLoop
la $a0, endOfGame
li $v0, 15
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
b end
finishChecking:
jr $ra
#----------------------------------------------------------- #
# This function is called to read input from user and to #
# convert input into a sequential number to work with the #
# array. For example. A1 -> 0, B1 -> 1, H8 -> 63 #
# decimal number is then stored in $a1 #
# #
# Registers used: #
# $a1 holds first part of input i.e. A,B,C and is converted #
# $t1 is out parameter. #
# to a decimal number. A->0, B->1, C->2, etc... #
#----------------------------------------------------------- #
__getInputAndConvert:
addiu $sp, $sp, -4
sw $ra, 0($sp)
la $a0, input
la $a0, input
jal GetKeyDriver # send to GetKDriver which gets input
lw $ra, 0($sp)
addiu $sp, $sp, 4
checkForShowall:
# check showall: 115, 104, 111, 119, 97, 108,108, 0
# rather crude, but it works.
lb $a1, 0($a0)
bne $a1, 115, checkIfBoardInput
lb $a1, 1($a0)
bne $a1, 104, checkIfBoardInput
lb $a1, 2($a0)
bne $a1, 111, checkIfBoardInput
lb $a1, 3($a0)
bne $a1, 119, checkIfBoardInput
lb $a1, 4($a0)
bne $a1, 97, checkIfBoardInput
lb $a1, 5($a0)
bne $a1, 108, checkIfBoardInput
lb $a1, 6($a0)
bne $a1, 108, checkIfBoardInput
lb $a1, 7($a0)
bne $a1, 0x0a, checkIfBoardInput
beq $s0, 1, turnOffCheat
li $s0, 1
b endGettingInput
turnOffCheat:
li $s0, 0 #enable showall
b endGettingInput
checkIfBoardInput:
lb $a1, 0($a0) #load letter. example A1 - get the A
addi $a1, $a1, -65 #convert letter to integer. A=0, B=1, C=2...
li $a2, 8 #check if value is in range
bgt $a1, $a2, incorrectInputLabel
li $a2, 0 #check input
blt $a1, $a2, incorrectInputLabel
lb $a0, 1($a0) #load integer example A1 - get the 1
#-------------------------------------------------------- #
# The following is essentially the same as a #
# switch case #
# in a higher level language. #
#-------------------------------------------------------- #
bne $a0, 49, second #if not equal to one add 0 for row
li $a0, 0 #load zero to register
b last #done. Branch to compute value
second: #Same as above...
bne $a0, 50, third
li $a0, 8
b last
third: #Same as above...
bne $a0, 51, fourth
li $a0, 16
b last
fourth: #Same as above...
bne $a0, 52, fifth
li $a0, 24
b last
fifth: #Same as above...
bne $a0, 53, sixth
li $a0, 32
b last
sixth: #Same as above...
bne $a0, 54, seventh
li $a0, 40
b last
seventh: #Same as above...
bne $a0, 55, eight
li $a0, 48
b last
eight:
bne $a0, 56, incorrectInputLabel
li $a0, 56
b last
incorrectInputLabel:
la $a0, incrrctInptMsg
li $v0, 68
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
b __getInputAndConvert
last: #last label
add $t0, $a0, $a1 #add value of letter to number
la $t1, arrayDisplay
addu $t1, $t0, $t1
lb $t2 0($t1)
beq $t2, 98, changeB
beq $t2, 99, changeC
beq $t2, 115, changeS
beq $t2, 109, changeM
beq $t2, 66, shipNoHitMiss
beq $t2, 67, shipNoHitMiss
beq $t2, 83, shipNoHitMiss
beq $t2, 77, shipNoHitMiss
beq $t2, 120, shipNoHitMiss
b shipNoHit
changeB:
la $t2, battleMark #load address
lb $t3, 4($t2) # get offset to add to addr
move $t4, $t2
add $t2, $t3, $t2 # add offset to addr
addiu $t3, $t3, 1 # increment offset
sb $t3, 4($t4) # store offset back - before incr
li $t3, 66
sb $t3, 0($t2)
sb $t3, 0($t1)
b shipHit
changeC:
la $t2, cruiserMark #load address
lb $t3, 5($t2) # get offset to add to addr
move $t4, $t2
add $t2, $t3, $t2 # add offset to addr
addiu $t3, $t3, 1 # increment offset
sb $t3, 5($t4) # store offset back - before incr
li $t3, 67 # get char
sb $t3, 0($t2) # write new char
sb $t3, 0($t1) # write to board
b shipHit
changeS:
li $t3, 83
sb $t3, 0($t1)
b shipHit
changeM:
la $t2, mineMark #load address
lb $t3, 2($t2) # get offset to add to addr
move $t4, $t2
add $t2, $t3, $t2 # add offset to addr
addiu $t3, $t3, 1 # increment offset
sb $t3, 2($t4) # store offset back - before incr
li $t3, 77
sb $t3, 0($t2)
sb $t3, 0($t1)
b shipHit
shipHit:
la $a0, Hit
li $v0, 7
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
b endGettingInput
shipNoHit:
li $t3, 120
sb $t3, 0($t1)
shipNoHitMiss:
la $a0, Miss
li $v0, 8
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
endGettingInput:
jr $ra
#----------------------------------------------------------------------------- #
# This function assists the __placeShips function #
# we are given an integer and find the value in the board #
# for the horizontal position. #
# For example. The value 1 is row 1 so it is converted to #
# a zero. After that, we just add the value of the column #
# and we esentially have the index of the array. Another #
# example is the number 8. This is converted to 56 #
# and so to get the array index, we just add the #
# corresponding value from the column. A = 1, B = 2, etc.. #
# The code is pretty simple: it is basically a switch case #
# in a higher level language. #
# value should be placed in 0($sp) and returned at same #
# stack offset #
#---------------------------------------------------------- #
__convertNumber:
lw $t0, 0($sp)
one:
bne $t0, 0, two
li $t0, 0
b finishConvNum
two:
bne $t0, 1, three
li $t0, 8
b finishConvNum
three:
bne $t0, 2, four
li $t0, 16
b finishConvNum
four:
bne $t0, 3, five
li $t0, 24
b finishConvNum
five:
bne $t0, 4, six
li $t0, 32
b finishConvNum
six:
bne $t0, 5, seven
li $t0, 40
b finishConvNum
seven:
bne $t0, 6, eightt
li $t0, 48
b finishConvNum
eightt:
li $t0, 56
finishConvNum:
sw $t0, 0($sp)
jr $ra
#--------------------------------------------------------- #
# This function prints the board out #
#--------------------------------------------------------- #
__printBoard:
addiu $sp, $sp, -4
sw $ra, 0($sp) #save return address
la $t0, arrayDisplay #Load address of array
la $t1, arrayDisplay
addiu $t1, $t1, 64
li $v0, 19 # length of string to print
la $a0, RowLabel #print " A B C D E F G H"
jal PrintDriver
li $t4, 49 #for printing number 1 through 8
li $t5, 1 #move number 1 for comparison
li $t6, 9 #move the number 4 for comparison
move $a0, $t4 #print out the number 1
addiu $sp, $sp, -4
jal PrintCharDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4 #print
li $a0, 32 #print out a space. $v0, 11 from previous
addiu $sp, $sp, -4
jal PrintCharDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4 #call function
addiu $t4, $t4, 1 #add 1 to $t4
PrintLoop:
bne $t6, $t5, PrintNum #print if not at end of column
li $a0, 10 #
jal PrintCharDriver #
move $a0, $t4 #print out the next number
jal PrintCharDriver #print
li $a0, 32 #print out a space.
addiu $sp, $sp, -4
jal PrintCharDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4 #print
li $t5, 1 #
addiu $t4, $t4, 1 #increase by one each iteration
PrintNum:
beq $s0, 1, cheatCodeOn
lb $a0, 0($t0) #load
beq $a0, 99, replaceDash
beq $a0, 98, replaceDash
beq $a0, 115, replaceDash
beq $a0, 109, replaceDash
b cheatCodeOn
replaceDash:
addiu $t5, $t5, 1
li $a0, 45
addiu $sp, $sp, -4
jal PrintCharDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
b nextFormat
cheatCodeOn:
lb $a0, 0($t0) #load
addiu $t5, $t5, 1 #
addiu $sp, $sp, -4
jal PrintCharDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
nextFormat:
li $a0, 32 #load space char
addiu $sp, $sp, -4
jal PrintCharDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4 #print
addi $t0, $t0, 1 #increase count by one
blt $t0, $t1, PrintLoop #know end of array is when $t0 is at array + 64
lw $ra, 0($sp)
addiu $sp, $sp, 4
jr $ra #jump back to return address
# NEW FUNCTION #
#---------------------------------------------------------------------- #
# This function takes the address of a string and #
# the length of the string and prints it out using #
# the display driver #
# $a0 = address of string #
# $v0 = length of address #
# uses $a1 for address of driver #
# uses $t2 for byte to print #
# uses $t1 for checking if driver is ready #
#-------------------------------------------------------------------- #
PrintDriver:
#save registers that we are going to use
addiu $sp, $sp, -12
sw $a1, 0($sp)
sw $t1, 4($sp)
sw $t2, 8($sp)
li $a1, 0xffff0000
PDLoop:
lb $t2, 0($a0)
PDReady: #Poll the Display
lw $t1, 8($a1)
andi $t1, $t1, 1
beqz $t1, PDReady
sw $t2, 12($a1)
addi $a0, $a0, 1
addi $v0, $v0 , -1
bne $v0, $0, PDLoop
lw $a1, 0($sp)
lw $t1, 4($sp)
lw $t2, 8($sp)
addiu $sp, $sp, 12
jr $ra
# NEW FUNCTION #
#---------------------------------------------------------------------- #
# This function takes the address of a string and #
# the length of the string and prints it out using #
# the display driver #
# $a0 = character to print #
# uses $t1 for address of driver #
# Uses $a1 for address of driver #
#-------------------------------------------------------------------- #
PrintCharDriver:
addiu $sp, $sp, -8
sw $a1, 0($sp)
sw $t1, 4($sp)
li $a1, 0xffff0000
PCDReady: #Poll the display
lw $t1, 8($a1)
andi $t1, $t1, 1
beqz $t1, PCDReady
sw $a0, 12($a1)
lw $t1, 4($sp)
lw $a1, 0($sp)
addiu $sp, $sp, 8
jr $ra
# NEW FUNCTION #
#---------------------------------------------------------------------- #
# This function reads from the keyboard #
# Only needs the following: #
# $a0 = address of input #
# uses $t1 for address of driver #
# Uses $a1 for address of driver #
# ----------- #
# Functions: #
# We first clear the input data variable of any left over #
# input, then #
# We get 8 characters, and store them in the address #
# of the input variable #
# We stop input if we find an enter value in the input #
# #
#-------------------------------------------------------------------- #
GetKeyDriver:
addiu $sp, $sp, -24 # allocate space on the stack
sw $a0, 0($sp) # save register we will be using
sw $a1, 4($sp)
sw $t1, 8($sp)
sw $t2, 12($sp)
sw $t3, 16($sp)
sw $a2, 20($sp)
li $a1, 0xffff0000
li $t2, 8
li $t3, 0x0a
clearinputloop:
sb $0, 0($a0)
addi $a0, $a0, 1
addi $t2, $t2, -1
bne $t2, $0, clearinputloop
li $t2, 8
la $a0, input
getkloop: # loop to get input 8 times.
KReady: #Poll the keyboard
lw $t1, 0($a1) #
andi $t1, $t1, 1 #
beqz $t1, KReady #
lb $a2, 4($a1) # use $a2 to get word
sb $a2, 0($a0) #
beq $a2, $t3, getkreturn #
addi $t2, $t2, -1
addi $a0, $a0, 1 #
bne $t2, $0, getkloop #
getkreturn: #
lw $a0, 0($sp) # save register we will be using
lw $a1, 4($sp) #
lw $t1, 8($sp)
lw $t2, 12($sp)
lw $t3, 16($sp)
lw $a2, 20($sp)
addiu $sp, $sp, 24 #
jr $ra #
# NEW FUNCTION #
#---------------------------------------------------------------------- #
# This function generates random integers #
# with the use of the time syscall #
# Only needs the following: #
# $a1 = upper bound of number
# $a0 = 0 - upper bound
# #
#-------------------------------------------------------------------- #
GenerateRandom:
#don't save a1 and v0
addiu $sp, $sp, -4
sw $a2, 0($sp)
move $a2, $a1 # save $a1( will get overwritten)
li $v0, 30 # get the low 32 bits of time in $a0
syscall # used to get the time
div $a0, $a2 # divide by upper bound
mfhi $a0 # get remainder from hi register
lw $a2, 0($sp)
addiu $sp, $sp, 4
jr $ra
__checkIfSunk:
#First check cruiser
la $t0, cruiserMark
lb $t1, 6($t0) # get parity bit - tells us if msg printed already
andi $t1, $t1, 1 # and parity bit with a one
bgtz $t1, checkifsunkbattle # message already printed, skip
li $t2, 5 # check 5 chars
cruisersunkloop:
lb $t1, 0($t0) # load first char
beq $t1, 0, checkifsunkbattle # if char is 'c' then skip
addi $t0, $t0, 1
addi $t2, $t2, -1
bne $t2, $0, cruisersunkloop
la $t0, cruiserMark
li $a0, 1 #load parity bit
sb $a0, 6($t0) # write parity bit
la $a0, cruiserSunk #print message you've sunk my ship
li $v0, 30
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
b checksunkend
#----------------------Check if battleship is sunk---------------------------#
checkifsunkbattle:
#Now check battle
la $t0, battleMark
lb $t1, 5($t0) # get parity bit - tells us if msg printed already
andi $t1, $t1, 1 # and parity bit with a one
bgtz $t1, checkifsunkmine # message already printed, skip
li $t2, 4 # check 4 chars
battlesunkloop:
lb $t1, 0($t0) # load first char
beq $t1, 0, checkifsunkmine # if char is '0' if so, then skip
addi $t0, $t0, 1
addi $t2, $t2, -1
bne $t2, $0, battlesunkloop
la $t0, battleMark
li $a0, 1 #load parity bit
sb $a0, 5($t0) # write parity bit
la $a0, battleSunk #print message you've sunk my ship
li $v0, 29
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
b checksunkend
#----------------------Check if minesweeper is sunk---------------------------#
checkifsunkmine:
#Now check minesweeper
la $t0, mineMark
lb $t1, 3($t0) # get parity bit - tells us if msg printed already
andi $t1, $t1, 1 # and parity bit with a one
bgtz $t1, checksunkend # message already printed, skip
li $t2, 2 # check 2 chars
minesunkloop:
lb $t1, 0($t0) # load first char
beq $t1, 0, checksunkend # if char is '0' if so, then skip
addi $t0, $t0, 1
addi $t2, $t2, -1
bne $t2, $0, minesunkloop
la $t0, mineMark #reload base address
li $a0, 1 #load parity bit
sb $a0, 3($t0) # write parity bit
la $a0, mineSunk #print message you've sunk my ship
li $v0, 31
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal PrintDriver
lw $ra, 0($sp)
addiu $sp, $sp, 4
checksunkend:
jr $ra
end:
li $v0, 10
syscall
| 28.969231 | 137 | 0.558152 |
903f3fe55ab920acd3351cf927709ae72fe8955f | 594 | asm | Assembly | oeis/275/A275636.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/275/A275636.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/275/A275636.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A275636: a(n) = (3^n-1)*(3^n+3)/3!.
; 0,2,16,130,1120,9922,88816,797890,7176640,64576642,581150416,5230235650,47071766560,423644836162,3812800336816,34315193465410,308836712490880,2779530326324482,25015772678640016,225141953332919170,2026277577671749600,18236498192072177602,164128483707728892016,1477156353306797908930,13294407179572894822720,119649664615591194331522,1076846981538626171764816,9691622833842551814226690,87224605504567715133070240,785021449541063682612722242,7065193045869435882759770416,63586737412824511162573744450
mov $1,3
pow $1,$0
add $1,1
pow $1,2
div $1,6
mov $0,$1
| 59.4 | 498 | 0.860269 |
c266d4e32a4cb6a3de254ce168b07bfb6f3cf09d | 997 | asm | Assembly | computerArchitecture/890468754 - Naoki Atkins - Mips3BitwiseShift.asm | naokishami/Classwork | ac59d640f15e88294804fdb518b6c84b10e0d2bd | [
"MIT"
] | null | null | null | computerArchitecture/890468754 - Naoki Atkins - Mips3BitwiseShift.asm | naokishami/Classwork | ac59d640f15e88294804fdb518b6c84b10e0d2bd | [
"MIT"
] | null | null | null | computerArchitecture/890468754 - Naoki Atkins - Mips3BitwiseShift.asm | naokishami/Classwork | ac59d640f15e88294804fdb518b6c84b10e0d2bd | [
"MIT"
] | null | null | null | # BEGIN ASSIGNMENT TAGS
# CWID = 890468754
# NaMe = Naoki Atkins
# Assignment = Mips3BitwiseShift
# END ASSIGNMENT TAGS
.data
newline: .asciiz "\n"
int1: .word 1
.text
main:
# Load first integer
li $v0, 5
syscall
move $s0, $v0
# Load second integer
li $v0, 5
syscall
move $s1, $v0
# $1 shifted left by $2 bits
sll $t0, $s0, $s1
li $v0, 1
move $a0, $t0
syscall
# Print newline
li $v0, 4
la $a0, newline
syscall
# Load int1 into $s2
lw $s2, int1
move $a0, $s2
# $1 shifted left by $H bits
sll $t1, $s0, $s2
li $v0, 1
move $a0, $t1
syscall
# Print newline
li $v0, 4
la $a0, newline
syscall
# $1 shifted right by $2 bits
srl $t0, $s0, $s1
li $v0, 1
move $a0, $t0
syscall
# Print newline
li $v0, 4
la $a0, newline
syscall
# $1 shifted right by $H bits
srl $t1, $s0, $s2
li $v0, 1
move $a0, $t1
syscall
# Print newline
li $v0, 4
la $a0, newline
syscall
# Exit properly
li $v0, 10
syscall
| 12.948052 | 33 | 0.589769 |
03274e3791abb16f68c50142b9f54c9b5cbbea5a | 8,480 | asm | Assembly | Palmtree.Math.Core.Implements/vs_build/x86_Debug/pmc_to.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Implements/vs_build/x86_Debug/pmc_to.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Implements/vs_build/x86_Debug/pmc_to.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
TITLE Z:\Sources\Lunor\Repos\rougemeilland\Palmtree.Math.Core.Implements\Palmtree.Math.Core.Implements\pmc_to.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
msvcjmc SEGMENT
__7B7A869E_ctype@h DB 01H
__457DD326_basetsd@h DB 01H
__4384A2D9_corecrt_memcpy_s@h DB 01H
__4E51A221_corecrt_wstring@h DB 01H
__2140C079_string@h DB 01H
__1887E595_winnt@h DB 01H
__9FC7C64B_processthreadsapi@h DB 01H
__FA470AEC_memoryapi@h DB 01H
__F37DAFF1_winerror@h DB 01H
__7A450CCC_winbase@h DB 01H
__B4B40122_winioctl@h DB 01H
__86261D59_stralign@h DB 01H
__7B8DBFC3_pmc_uint_internal@h DB 01H
__6B0481B0_pmc_inline_func@h DB 01H
__83853269_pmc_to@c DB 01H
msvcjmc ENDS
PUBLIC _Initialize_To
PUBLIC _PMC_To_X_I@8
PUBLIC _PMC_To_X_L@8
PUBLIC __JustMyCode_Default
EXTRN _CheckNumber:PROC
EXTRN @__CheckForDebuggerJustMyCode@4:PROC
EXTRN __RTC_CheckEsp:PROC
EXTRN __RTC_InitBase:PROC
EXTRN __RTC_Shutdown:PROC
EXTRN __allshl:PROC
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
rtc$IMZ ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
push ebp
mov ebp, esp
pop ebp
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
_TEXT SEGMENT
_value_high$ = 8 ; size = 4
_value_low$ = 12 ; size = 4
__FROMWORDTODWORD PROC
; 177 : {
push ebp
mov ebp, esp
mov ecx, OFFSET __6B0481B0_pmc_inline_func@h
call @__CheckForDebuggerJustMyCode@4
; 178 : return (((_UINT64_T)value_high << 32) | value_low);
xor edx, edx
mov eax, DWORD PTR _value_high$[ebp]
mov cl, 32 ; 00000020H
call __allshl
xor ecx, ecx
or eax, DWORD PTR _value_low$[ebp]
or edx, ecx
; 179 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
__FROMWORDTODWORD ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_to.c
_TEXT SEGMENT
_result$ = -8 ; size = 4
_np$ = -4 ; size = 4
_p$ = 8 ; size = 4
_o$ = 12 ; size = 4
_PMC_To_X_L@8 PROC
; 59 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __83853269_pmc_to@c
call @__CheckForDebuggerJustMyCode@4
; 60 : if (sizeof(__UNIT_TYPE) * 2 < sizeof(*o))
xor eax, eax
je SHORT $LN2@PMC_To_X_L
; 61 : {
; 62 : // 32bit未満のCPUは未対応
; 63 : return (PMC_STATUS_NOT_SUPPORTED);
mov eax, -6 ; fffffffaH
jmp $LN1@PMC_To_X_L
$LN2@PMC_To_X_L:
; 64 : }
; 65 : NUMBER_HEADER* np = (NUMBER_HEADER*)p;
mov ecx, DWORD PTR _p$[ebp]
mov DWORD PTR _np$[ebp], ecx
; 66 : PMC_STATUS_CODE result;
; 67 : if ((result = CheckNumber(np)) != PMC_STATUS_OK)
mov edx, DWORD PTR _np$[ebp]
push edx
call _CheckNumber
add esp, 4
mov DWORD PTR _result$[ebp], eax
cmp DWORD PTR _result$[ebp], 0
je SHORT $LN3@PMC_To_X_L
; 68 : return (result);
mov eax, DWORD PTR _result$[ebp]
jmp $LN1@PMC_To_X_L
$LN3@PMC_To_X_L:
; 69 : if (np->UNIT_BIT_COUNT > sizeof(*o) * 8)
mov eax, DWORD PTR _np$[ebp]
cmp DWORD PTR [eax+12], 64 ; 00000040H
jbe SHORT $LN4@PMC_To_X_L
; 70 : return (PMC_STATUS_OVERFLOW);
mov eax, -2 ; fffffffeH
jmp $LN1@PMC_To_X_L
$LN4@PMC_To_X_L:
; 71 : if (np->IS_ZERO)
mov ecx, DWORD PTR _np$[ebp]
mov edx, DWORD PTR [ecx+24]
shr edx, 1
and edx, 1
je SHORT $LN5@PMC_To_X_L
; 72 : {
; 73 : *o = 0;
mov eax, DWORD PTR _o$[ebp]
mov DWORD PTR [eax], 0
mov DWORD PTR [eax+4], 0
; 74 : return (PMC_STATUS_OK);
xor eax, eax
jmp SHORT $LN1@PMC_To_X_L
$LN5@PMC_To_X_L:
; 75 : }
; 76 : if (np->UNIT_BIT_COUNT <= __UNIT_TYPE_BIT_COUNT)
mov ecx, DWORD PTR _np$[ebp]
cmp DWORD PTR [ecx+12], 32 ; 00000020H
ja SHORT $LN6@PMC_To_X_L
; 77 : {
; 78 : // 値が 1 ワードで表現できる場合
; 79 : *o = np->BLOCK[0];
mov edx, 4
imul eax, edx, 0
mov ecx, DWORD PTR _np$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR [edx+eax]
xor ecx, ecx
mov edx, DWORD PTR _o$[ebp]
mov DWORD PTR [edx], eax
mov DWORD PTR [edx+4], ecx
; 80 : return (PMC_STATUS_OK);
xor eax, eax
jmp SHORT $LN1@PMC_To_X_L
; 81 : }
jmp SHORT $LN1@PMC_To_X_L
$LN6@PMC_To_X_L:
; 82 : else if (np->UNIT_BIT_COUNT <= __UNIT_TYPE_BIT_COUNT * 2)
mov eax, DWORD PTR _np$[ebp]
cmp DWORD PTR [eax+12], 64 ; 00000040H
ja SHORT $LN8@PMC_To_X_L
; 83 : {
; 84 : // 値が 2 ワードで表現できる場合
; 85 : *o = _FROMWORDTODWORD((_UINT32_T)np->BLOCK[1], (_UINT32_T)np->BLOCK[0]);
mov ecx, 4
imul edx, ecx, 0
mov eax, DWORD PTR _np$[ebp]
mov ecx, DWORD PTR [eax+32]
mov edx, DWORD PTR [ecx+edx]
push edx
mov eax, 4
shl eax, 0
mov ecx, DWORD PTR _np$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR [edx+eax]
push eax
call __FROMWORDTODWORD
add esp, 8
mov ecx, DWORD PTR _o$[ebp]
mov DWORD PTR [ecx], eax
mov DWORD PTR [ecx+4], edx
; 86 : return (PMC_STATUS_OK);
xor eax, eax
jmp SHORT $LN1@PMC_To_X_L
; 87 : }
jmp SHORT $LN1@PMC_To_X_L
$LN8@PMC_To_X_L:
; 88 : else
; 89 : return (PMC_STATUS_ARGUMENT_ERROR);
or eax, -1
$LN1@PMC_To_X_L:
; 90 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 8
_PMC_To_X_L@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_to.c
_TEXT SEGMENT
_result$ = -8 ; size = 4
_np$ = -4 ; size = 4
_p$ = 8 ; size = 4
_o$ = 12 ; size = 4
_PMC_To_X_I@8 PROC
; 39 : {
push ebp
mov ebp, esp
sub esp, 8
mov DWORD PTR [ebp-8], -858993460 ; ccccccccH
mov DWORD PTR [ebp-4], -858993460 ; ccccccccH
mov ecx, OFFSET __83853269_pmc_to@c
call @__CheckForDebuggerJustMyCode@4
; 40 : if (sizeof(__UNIT_TYPE) < sizeof(*o))
xor eax, eax
je SHORT $LN2@PMC_To_X_I
; 41 : {
; 42 : // 32bit未満のCPUは未対応
; 43 : return (PMC_STATUS_NOT_SUPPORTED);
mov eax, -6 ; fffffffaH
jmp SHORT $LN1@PMC_To_X_I
$LN2@PMC_To_X_I:
; 44 : }
; 45 : NUMBER_HEADER* np = (NUMBER_HEADER*)p;
mov ecx, DWORD PTR _p$[ebp]
mov DWORD PTR _np$[ebp], ecx
; 46 : PMC_STATUS_CODE result;
; 47 : if ((result = CheckNumber(np)) != PMC_STATUS_OK)
mov edx, DWORD PTR _np$[ebp]
push edx
call _CheckNumber
add esp, 4
mov DWORD PTR _result$[ebp], eax
cmp DWORD PTR _result$[ebp], 0
je SHORT $LN3@PMC_To_X_I
; 48 : return (result);
mov eax, DWORD PTR _result$[ebp]
jmp SHORT $LN1@PMC_To_X_I
$LN3@PMC_To_X_I:
; 49 : if (np->UNIT_BIT_COUNT > sizeof(*o) * 8)
mov eax, DWORD PTR _np$[ebp]
cmp DWORD PTR [eax+12], 32 ; 00000020H
jbe SHORT $LN4@PMC_To_X_I
; 50 : return (PMC_STATUS_OVERFLOW);
mov eax, -2 ; fffffffeH
jmp SHORT $LN1@PMC_To_X_I
$LN4@PMC_To_X_I:
; 51 : if (np->IS_ZERO)
mov ecx, DWORD PTR _np$[ebp]
mov edx, DWORD PTR [ecx+24]
shr edx, 1
and edx, 1
je SHORT $LN5@PMC_To_X_I
; 52 : *o = 0;
mov eax, DWORD PTR _o$[ebp]
mov DWORD PTR [eax], 0
jmp SHORT $LN6@PMC_To_X_I
$LN5@PMC_To_X_I:
; 53 : else
; 54 : *o = (_UINT32_T)np->BLOCK[0];
mov ecx, 4
imul edx, ecx, 0
mov eax, DWORD PTR _np$[ebp]
mov ecx, DWORD PTR [eax+32]
mov eax, DWORD PTR _o$[ebp]
mov ecx, DWORD PTR [edx+ecx]
mov DWORD PTR [eax], ecx
$LN6@PMC_To_X_I:
; 55 : return (PMC_STATUS_OK);
xor eax, eax
$LN1@PMC_To_X_I:
; 56 : }
add esp, 8
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 8
_PMC_To_X_I@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_to.c
_TEXT SEGMENT
_feature$ = 8 ; size = 4
_Initialize_To PROC
; 93 : {
push ebp
mov ebp, esp
mov ecx, OFFSET __83853269_pmc_to@c
call @__CheckForDebuggerJustMyCode@4
; 94 : return (PMC_STATUS_OK);
xor eax, eax
; 95 : }
cmp ebp, esp
call __RTC_CheckEsp
pop ebp
ret 0
_Initialize_To ENDP
_TEXT ENDS
END
| 21.360202 | 121 | 0.668632 |
168275bbc469562f1e79b97f4c4812da6095887f | 1,404 | asm | Assembly | programs/oeis/267/A267938.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/267/A267938.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/267/A267938.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A267938: Decimal representation of the n-th iteration of the "Rule 251" elementary cellular automaton starting with a single ON (black) cell.
; 1,5,31,127,511,2047,8191,32767,131071,524287,2097151,8388607,33554431,134217727,536870911,2147483647,8589934591,34359738367,137438953471,549755813887,2199023255551,8796093022207,35184372088831,140737488355327,562949953421311,2251799813685247,9007199254740991,36028797018963967,144115188075855871,576460752303423487,2305843009213693951,9223372036854775807,36893488147419103231,147573952589676412927,590295810358705651711,2361183241434822606847,9444732965739290427391,37778931862957161709567,151115727451828646838271,604462909807314587353087,2417851639229258349412351,9671406556917033397649407,38685626227668133590597631,154742504910672534362390527,618970019642690137449562111,2475880078570760549798248447,9903520314283042199192993791,39614081257132168796771975167,158456325028528675187087900671,633825300114114700748351602687,2535301200456458802993406410751,10141204801825835211973625643007,40564819207303340847894502572031,162259276829213363391578010288127,649037107316853453566312041152511,2596148429267413814265248164610047,10384593717069655257060992658440191,41538374868278621028243970633760767,166153499473114484112975882535043071,664613997892457936451903530140172287
mov $1,4
pow $1,$0
mov $2,7
div $2,$1
sub $1,1
trn $1,$2
mul $1,2
add $1,1
mov $0,$1
| 108 | 1,173 | 0.905271 |
e48ff6124121abbb6975231f871d6fe0e9544956 | 343 | asm | Assembly | programs/oeis/065/A065168.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/065/A065168.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/065/A065168.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A065168: Permutation t->t-1 of Z, folded to N.
; 3,1,5,2,7,4,9,6,11,8,13,10,15,12,17,14,19,16,21,18,23,20,25,22,27,24,29,26,31,28,33,30,35,32,37,34,39,36,41,38,43,40,45,42,47,44,49,46,51,48,53,50,55,52,57,54,59,56,61,58,63,60,65,62,67,64,69,66,71,68,73,70
mov $1,1
add $1,$0
sub $0,2
mod $1,2
mul $1,4
add $1,$0
max $1,0
add $1,1
mov $0,$1
| 26.384615 | 208 | 0.620991 |
19136fb4b6e351dcc746971b7e3eff8b9fdbc0d8 | 4,837 | asm | Assembly | ProfilerCore/HookFunction64.asm | corefan/brofiler | f9c49eb342eb8e242a9bae4f008ea2cbef4128ec | [
"MIT"
] | 3 | 2021-05-02T01:22:01.000Z | 2021-05-02T21:20:09.000Z | ProfilerCore/HookFunction64.asm | welford/brofiler | f9c49eb342eb8e242a9bae4f008ea2cbef4128ec | [
"MIT"
] | null | null | null | ProfilerCore/HookFunction64.asm | welford/brofiler | f9c49eb342eb8e242a9bae4f008ea2cbef4128ec | [
"MIT"
] | null | null | null | @PushAllRegisters MACRO
push rax
push rbx
push rcx
push rdx
push r8
push r9
ENDM
@PopAllRegisters MACRO
pop r9
pop r8
pop rdx
pop rcx
pop rbx
pop rax
ENDM
@FunctionBody MACRO index
HookFunctionASM&index proc
@PushAllRegisters
call NextEvent ;Check wheter profiler is active and create new EventData
cmp rax, 0 ;Check for null
je NotActiveProlog&index ;Jump if Profiler is not active
mov rbx, rax ;Store EventData in rbx
call GetTime ;GetTime
mov qword ptr[rbx], rax ;StartTime
mov rax, [hookSlotData + index * HookDataSize + EventDescriptionAddress] ;Store description
mov qword ptr[rbx + 16], rax ;EventDescription
mov [hookSlotData + index * HookDataSize + EventDataAddress], rbx ;StoreActive EventData
NotActiveProlog&index:
@PopAllRegisters
pop [hookSlotData + index * HookDataSize + ReturnAddress] ;Store return address
call [hookSlotData + index * HookDataSize + OriginalAddress] ;Call original function
push [hookSlotData + index * HookDataSize + ReturnAddress] ;Restore return address
cmp [hookSlotData + index * HookDataSize + EventDataAddress], 0 ;Check for active EventData
je NotActiveEpilog&index ;If not active go to return
@PushAllRegisters
call GetTime ;Get Finish Time
mov rbx, [hookSlotData + index * HookDataSize + EventDataAddress] ;Store EventData address
mov [rbx + 8h], rax ;Store FinishTime
@PopAllRegisters
NotActiveEpilog&index:
ret
HookFunctionASM&index endp
ENDM
.data
extern NextEvent : proc
extern GetTime : proc
extern hookSlotData : qword
ReturnAddress = 0 ; [hookSlotData + 0 ] - Return Address
OriginalAddress = 8 ; [hookSlotData + 8 ] - Original Function Address
EventDataAddress = 16 ; [hookSlotData + 16] - EventData
EventDescriptionAddress = 24 ; [hookSlotData + 24] - EventDescription
HookDataSize = 32 ; Sizeof(HookData)
.code
@FunctionBody 0
@FunctionBody 1
@FunctionBody 2
@FunctionBody 3
@FunctionBody 4
@FunctionBody 5
@FunctionBody 6
@FunctionBody 7
@FunctionBody 8
@FunctionBody 9
@FunctionBody 10
@FunctionBody 11
@FunctionBody 12
@FunctionBody 13
@FunctionBody 14
@FunctionBody 15
@FunctionBody 16
@FunctionBody 17
@FunctionBody 18
@FunctionBody 19
@FunctionBody 20
@FunctionBody 21
@FunctionBody 22
@FunctionBody 23
@FunctionBody 24
@FunctionBody 25
@FunctionBody 26
@FunctionBody 27
@FunctionBody 28
@FunctionBody 29
@FunctionBody 30
@FunctionBody 31
@FunctionBody 32
@FunctionBody 33
@FunctionBody 34
@FunctionBody 35
@FunctionBody 36
@FunctionBody 37
@FunctionBody 38
@FunctionBody 39
@FunctionBody 40
@FunctionBody 41
@FunctionBody 42
@FunctionBody 43
@FunctionBody 44
@FunctionBody 45
@FunctionBody 46
@FunctionBody 47
@FunctionBody 48
@FunctionBody 49
@FunctionBody 50
@FunctionBody 51
@FunctionBody 52
@FunctionBody 53
@FunctionBody 54
@FunctionBody 55
@FunctionBody 56
@FunctionBody 57
@FunctionBody 58
@FunctionBody 59
@FunctionBody 60
@FunctionBody 61
@FunctionBody 62
@FunctionBody 63
@FunctionBody 64
@FunctionBody 65
@FunctionBody 66
@FunctionBody 67
@FunctionBody 68
@FunctionBody 69
@FunctionBody 70
@FunctionBody 71
@FunctionBody 72
@FunctionBody 73
@FunctionBody 74
@FunctionBody 75
@FunctionBody 76
@FunctionBody 77
@FunctionBody 78
@FunctionBody 79
@FunctionBody 80
@FunctionBody 81
@FunctionBody 82
@FunctionBody 83
@FunctionBody 84
@FunctionBody 85
@FunctionBody 86
@FunctionBody 87
@FunctionBody 88
@FunctionBody 89
@FunctionBody 90
@FunctionBody 91
@FunctionBody 92
@FunctionBody 93
@FunctionBody 94
@FunctionBody 95
@FunctionBody 96
@FunctionBody 97
@FunctionBody 98
@FunctionBody 99
@FunctionBody 100
@FunctionBody 101
@FunctionBody 102
@FunctionBody 103
@FunctionBody 104
@FunctionBody 105
@FunctionBody 106
@FunctionBody 107
@FunctionBody 108
@FunctionBody 109
@FunctionBody 110
@FunctionBody 111
@FunctionBody 112
@FunctionBody 113
@FunctionBody 114
@FunctionBody 115
@FunctionBody 116
@FunctionBody 117
@FunctionBody 118
@FunctionBody 119
@FunctionBody 120
@FunctionBody 121
@FunctionBody 122
@FunctionBody 123
@FunctionBody 124
@FunctionBody 125
@FunctionBody 126
@FunctionBody 127
end | 24.93299 | 110 | 0.663841 |
71daed50f56df7e2bcc4364d565464ddb7b2b9d9 | 17,897 | asm | Assembly | 45/runtime/rt/inpdsk.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | 45/runtime/rt/inpdsk.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | 45/runtime/rt/inpdsk.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | TITLE INPDSK - disk input
page ,132
;***
; INPDSK - disk input
;
; Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
;
;BASIC Syntax mapping to included runtime entry points:
;
;i) INPUT[;]["prompt";|,]variable[,variable]...
;
; BASCOM 2.0 generates calls to IN0A, IPUA, and a call to IPUB for
; each variable. Now it will generate the following calls :
;
; 1. void B$INPP (sd *psdPrompt, I2 FAR *pBlock)
;
; Where pBlock is a far pointer to a block
; with the following information :
;
; word 1 .... word count of the length of this block
; byte 3 .... an encoded flag having information about
; CRLF and the ?. It is described below.
; bytes 4 to n+3 .... have the n types.
;
; the block would look like :
;
; 1 2 3 4
; ----------------------------------------------
; | n+3 | fCRLFqMark|<---------n types-------->|
; ______________________________________________
; ^
; |
; |
; |
; pBlock
;
; The CRLFqMark flag can take the following values :
;
; 0 .... no ';' before prompt and ';' after prompt.
; 1 .... no ';' before prompt and ',' after prompt.
; 2 .... ';' before prompt and ';' after prompt.
; 3 .... ';' before prompt and ',' after prompt.
;
; Note: the above has the same meaning as:
; bit 0 set if NO question mark will be displayed
; bit 1 set if NO no carriage return will be forced.
;
; The types are as follows :
;
; I2 .... 2H \
; I4 .... 14H \ This is what the runtime is
; R4 .... 4H using.
; R8 .... 8H /
; SD .... 3H /
;
; (INPP stands for INPut Preamble)
;
; The value of b$FInput will be:
;
; default 0FFH
; inptty 0H
; inpdsk 1H
;
; 2. void B$RD<type> (<type> *pDest)
;
; Where,
; <type> = I2: Two byte integer
; I4: Four byte integer
; R4: Single precision real
; R8: Double precision real
; SD: String descriptor
;
; This will be called once for each variable.
;
; The B$RD<type> routines are going to be shared between
; the READ and INPUT statements and they need to know whether
; they are called from an INPUT statement or a READ
; statement. This is done by setting a flag (say b$FInput)
; in B$DSKI.
; (The default value of b$FInput would be used for READ)
;
; (Note:
; In the case of interpreted code, the B$RD<type>
; routines will call the interpreter to get a pointer to
; the next DATA item and return the # of bytes consumed.)
;
; 3. void B$PEOS(void)
;
; The flag b$FInput gets cleared in B$PEOS.
;
;ii) INPUT #filenum, variable [,variable]...
;
; BASCOM 2.0 generates calls to IN0B, IPUA and IPUB. Now it will
; generate the following calls :
;
;
; 1. void B$DSKI (I2 channel)
;
; 2. void B$RD<type> (<type> *pDest)
;
; Refer to the description above.
;
; 3. void B$PEOS(void)
;
; Refer to the description above.
;
;iii) LINE INPUT [;]["prompt";|,] stringvar
;
; BASCOM 2.0 generates calls to IN0A and LIPA. Now it will generate
; a call to B$LNIN. (see routine documentation).
;
;iv) LINE INPUT #filenum, stringvar
;
; BASCOM 2.0 generates calls to IN0B and LIPA. Now it will generate
; calls to B$DSKI followed by B$LNIN.
;
; Since B$LNIN is shared between LINE INPUT and LINE INPUT #, B$DSKI
; sets b$FInput telling B$LNIN that this is disk input. b$FInput gets
; cleared before exiting B$LNIN.
;
; B$INPP is in inptty.asm
; B$DSKI is in inpdsk.asm
; B$LNIN is in lininp.asm
; B$RD<type> is in read.asm
;
;******************************************************************************
INCLUDE switch.inc
INCLUDE rmacros.inc
;Code segment
useSeg DK_TEXT
useSeg NH_TEXT
useSeg ST_TEXT
useSeg MT_TEXT
useSeg ER_TEXT
;Data segment
useSeg _DATA
useSeg _BSS
INCLUDE seg.inc
INCLUDE baslibma.inc
INCLUDE devdef.inc
INCLUDE files.inc
INCLUDE ascii.inc
INCLUDE rtps.inc ; constants shared with QBI
INCLUDE idmac.inc
SUBTTL local constant definitions
page
NEWLINE= ASCCR
InpDefault EQU 0FFH ;default READ statement
InpTTY EQU 0H ;console input
InpDsk EQU 1H ;device input
SUBTTL data definitions
page
sBegin _DATA
externW B$ENTRY_BUFCNT ;buffer position in fdb before current stmt.
externB b$FInput ;default InpDefault
externW b$GetOneVal ;default OFFSET ReadVal
externW b$SDBuf1 ; sd of b$Buf1
externW B$AC
sEnd ;_DATA
sBegin _BSS
externW b$PTRFIL ;defined in GOSTOP.ASM
externB b$Buf1 ; defined in GWINI.ASM
externB b$VTYP ;defined in GLOBAL.INC
sEnd ;_BSS
SUBTTL code externals
page
sBegin NH_TEXT
externNP B$STDALCTMP
externNP B$STALCTMP
externNP B$STGETSTRLEN
externNP B$STALCTMPCPY
externNP B$LHFDBLOC
sEnd ;NH_TEXT
sBegin DK_TEXT
externNP B$$RCH
externNP B$PtrDispatch
externNP B$ChkFNUM
sEnd ;DK_TEXT
sBegin ER_TEXT
externNP B$ERR_IFN
externNP B$ERR_RPE
externNP B$ERR_BFM
sEnd ;ER_TEXT
sBegin ST_TEXT
externFP B$SCAT
sEnd ;ST_TEXT
sBegin MT_TEXT
externNP B$FIN
externNP B$STRSCAN
sEnd ;MT_TEXT
assumes CS,DK_TEXT
sBegin DK_TEXT
SUBTTL disk input interface -- B$DSKI & B$RD<type>
page
;***
;B$DSKI -- preamble for disk input
;void B$DSKI(I2 channel)
;
;Purpose:
; This is the preamble of disk input. It sets up flags and variables
; for subsequent calls to B$RD<type>.
;Entry:
; Parameter is in stack.
; int channel
;Exit:
; [b$PTRFIL] = *FDB
; [b$FInput] = InpDsk
; [b$GetOneVal] = OFFSET DskInpVal
;Uses:
; none
;Exceptions:
; illegal file number -- B$ERR_IFN
; read pass end -- B$ERR_RPE
;*******************************************************************************
cProc B$DSKI,<PUBLIC,FAR>,<SI>
ParmW Channel ;I2 filenum
cBegin
MOV BX,Channel ;BX has the file number
CALL B$ChkFNUM ; make sure in range 1-255
CALL B$LHFDBLOC ;NZ & SI= *FDB if file exists
JZ ERCIFN ;Brif not exist, give "illegal file number"
FDB_PTR ES,SI,SI ;(ES:)[SI] = *FDB
MOV AX,FileDB.FD_BUFCNT ; Save current buffer postion
MOV B$ENTRY_BUFCNT,AX ; Used to reset on error
TEST FileDB.FD_MODE,MD_SQO+MD_APP
JNZ ERCRPE ;if output mode, give "read pass end"
TEST FileDB.FD_MODE,MD_BIN ; binary mode?
JNZ ERCBFM ; brif so -- give "bad file mode"
MOV [b$PTRFIL],SI ;set up PTRFIL
MOV [b$GetOneVal],OFFSET DskInpVal
;set routine to input one item
MOV [b$FInput],InpDsk
;indicate disk input
cEnd ;pop si and exit to caller
ERCIFN: JMP B$ERR_IFN ;illegal file number
ERCRPE: JMP B$ERR_RPE ;read pass end
ERCBFM: JMP B$ERR_BFM ;bad file mode
SUBTTL READ/disk [LINE] INPUT supporting routines
page
;***
;DskInpVal -- input one item from a disk file or from a device
;
;Purpose:
; This routine is to get one value for disk (device) input.
;
; After the input preamble, the succeeding calls will assign values
; into variables. The functionality of those assignment routines,
; B$RD<type>, may be roughly split into two parts -- namely, getting
; one value and then assigning it to the variable. In BASCOM 3.0,
; those assignment routines are shared by READ stmt, input from TTY
; and input from a disk file (or a device). Generally speaking,
; the second part of the assignment routines DOESN'T discriminate
; among the statements which share its use. However, the first part
; of the assignment routines MUST discriminate among the statements
; which share its use. In order to achieve this, the first part of
; the assignment routines uses an indirect call, CALL [b$GetOneVal],
; to get one value. [b$GetOneVal] is default to the address of
; ReadVal, which gets one value for READ stmt, or contains either
; the address of TTYInpVal for TTY input or the address of DskInpVal
; for disk (device) input.
;Entry:
; [b$VTYP] = types
;Exit:
; [SI] = pointer to source
;Uses:
; none
;Exceptions:
; B$ERR_RPE -- read pass end (B$FillBuf generates)
; B$RUNERR handles it
;*******************************************************************************
cProc DskInpVal,<NEAR>
cBegin
MOV DX,"," SHL 8 + " " ;default delimiters for number
CMP [b$VTYP],VT_SD ; is string ?
JNZ GetVal ;Brif not
MOV DL,DH ;both delimiters be "," for string
GetVal:
cCall B$FillBuf ;get one value (in the form of character
; stream in buffer), on return, SI=*sd
cCall DeviceFin ;convert it into number if it is
; B$AC or B$DAC has the result
MOV SI,OFFSET DGROUP:B$AC
TEST [b$VTYP],8 ;R8 or currency (8-byte values)?
JZ DskInpExit ;go if not
SUB SI,4 ;points to B$DAC
DskInpExit:
cEnd ;exit to caller
page
;***
;B$FillBuf -- fill one input item into the buffer
;
;Purpose:
; According to the delimiters, fill in the buffer with one input item,
; which is still in the form of character stream, from a disk file or
; from a device.
;
; A data file for input could be created by any editor or by a BASIC
; program. If it is created by BASIC, we should keep our eyes on the
; continuation mark, LF, and the end-of-line mark, "CR LF."
;
; This routine abides by two rules. The first rule is for inputing
; a quoted string and the second is for unquoted string and numbers
; as well. The first rule says to pick up all characters between
; two '"'s inclusively. The second rule says that, when a combination
; of continuation marks and end-of-line marks has been encountered,
; within the input character stream, if a LF precedes a CR, the CR is
; ignored. These rules are for INPUT # stmt. LINE INPUT # statement
; follows the second rule, except that, if a LF precedes a CR, the CR
; is still stored as part of the character stream.
;
; This routine checks for the situation mentioned above.
;
; Note: The continuation mark, LF, is treated as a regular character
; and is stored in the buffer as part of the item if the input
; is for a number; whereas the LF is NOT stored if the input
; is for a unquoted string. One reason for this is that the
; next call, B$FIN, will take care of the LF when converting
; the digital stream into a number.
;
;Entry:
; [DX] = 0 if LINE INPUT #
; = ","+" " if INPUT #, numberVar
; = ","+"," if INPUT #, stringVar
; [b$FInput] = DskInp
; [b$PTRFIL] = *FDB
;Exit:
; [SI] = *sd of the character stream of the input item
;Uses:
; none
;Exceptions:
; read pass end -- _BERR_RPE
;*******************************************************************************
cProc B$FillBuf,<PUBLIC,NEAR>,<DI,ES> ;save DI,ES
cBegin
PUSH DS
POP ES ; make sure ES=DS
SkipLeading:
CALL B$$RCH ;get next char in AL
JC ERCRPE ;Brif no char got, give "read pass end"
OR DL,DL ;line input?
JZ Get1stChar ;Brif yes
CMP AL," " ;is blank ?
JZ SkipLeading ;skip it
Get1stChar:
MOV SI,OFFSET DGROUP:b$SDBuf1 ; initialze string to b$Buf1
MOV DI,OFFSET DGROUP:b$Buf1
MOV CL,255 ;allow max of 255 characters per buffer
CMP AL,'"' ;quoted string?
JNZ CharLoop ;Brif not
CMP DL,"," ;looking for a string?
JNZ CharLoop ;Brif not
cCall StoreChar ;save '"' at start of string so FIN can match it
MOV DX,'""' ;Set delimiters to '"'
CALL B$$RCH ;get next char
JC Quit ;Brif null string
CharLoop:
CMP DH,'"' ;getting a quoted string?
JZ NotCRLF ;Brif yes, don't check LF CR
CMP AL,NEWLINE ;end of a line? (unquoted string or number)
JZ EndCR ;Brif yes
CMP AL,ASCLF ;check LF CR, the CR will be ignored
JNZ NotCRLF ;Brif not
GotLF: ;have a continuation mark and not a quoted str
CMP DL,"," ;getting an unquoted string?
JZ ChkLFCR ;don't store linefeeds if unquoted strings
cCall StoreChar ;store LF for numbers
ChkLFCR:
CALL B$$RCH ;get next char
JC QUIT ; quit if eof.
CMP AL,ASCLF ;check for LF after LF
JZ GotLF ;Brif yes
CMP AL,NEWLINE ;ignore CR after LF if NOT LINE INPUT
JNZ NotCRLF ;Brif not
OR DL,DL ;is LINE INPUT ?
JNZ NextChar ;Brif not (ignore CR)
NotCRLF:
OR AL,AL
JZ NextChar ;ignore nulls
CMP AL,DH ;check for first terminator
JZ Quit ;Brif yes
CMP AL,DL ;check for second terminator
JZ Quit ;Brif yes
cCall StoreChar ;store the character
NextChar:
CALL B$$RCH ;read next char
JNC CharLoop ;loop again
Quit: ;AL="," or '"' or " "
CMP AL,"," ;must has more item
JZ PutZero
SkipEnding: ;skip ending blanks
CALL B$$RCH
JC PutZero
CMP AL," "
JZ SkipEnding
CMP AL,"," ;has more item to go
JZ PutZero
CMP AL,NEWLINE ;ends ?
JNZ BackOneChar ;back up one char for next time
EndCR:
MOV BX,[b$PTRFIL] ;get file pointer (never 0000)
MOV AL,[BX].FD_DEVICE ; Get device type
CMP AL,DN_PIPE ; are we piping?
JZ ENDCR_PIPE ; Then just process like a file
OR AL,AL ; See if other special device
JS PutZero ;do not look for LF if special device
ENDCR_PIPE:
CALL B$$RCH
JC PutZero
CMP AL,ASCLF
JZ PutZero
BackOneChar:
PUSH SI ; Save SI
MOV SI,[b$PTRFIL] ; Get File pointer (not 0)
MOV AH,DV_BAKC ; Back up one char
CALL B$PtrDispatch
POP SI ; Restore SI
PutZero:
XOR AL,AL
STOSB ;terminated by 00H
MOV BX,OFFSET DGROUP:b$Buf1
CALL B$STGETSTRLEN ;find length of string in input buffer
INC AX ;ensure room for terminating zero
MOV b$SDBuf1,AX ; make sd
cCall Concat ;concatenate buffer to string, if necessary
;on return SI=*sd of concatenated string
cEnd ;exit to caller
page
;***
;StoreChar -- store char in buffer
;
;Purpose:
; Store character in AL into location ES:DI. If the buffer is full,
; then concatenate the buffer into a string, and reset the buffer for
; next input.
;Entry:
; [SI] = *sd of result string
; [AL] = char
; ES:DI = buffer location
; [CL] = buffer count
;Exit:
; if buffer is not full then
; SI = *sd of result string
; character is stored in buffer pointed by ES:DI
; DI is incremented by one (buffer pointer)
; CL is decremented by one (buffer count)
; else
; SI = *sd of concatenated string
; DI = *b$Buf1
; CL = 255
; endif
;Uses:
; none
;Preserves: (optional)
; DX
;Exceptions:
; none
;*******************************************************************************
cProc StoreChar,<NEAR>
cBegin
OR AL,AL
JZ StoreExit ;no char, exit
STOSB ;store in ES:DI, DI incremented
DEC CL ;Buffer full?
JNZ StoreExit ;no, continue
MOV b$SDBuf1,255 ; yes, note buffer length
PUSH DX ; Save DX Flags (trashed in Concat + below)
cCall Concat ;concatenate buffer to string, if necessary
JNZ BufferReset ;already had a string, return concatenated one
;first buffer overflow, need initial string
MOV BX,255 ;string length
MOV DX,[SI+2] ;point to the string
CALL B$STALCTMPCPY ;copy contents of b$Buf1 into temp string
MOV SI,BX ;note string as start of input data
BufferReset:
POP DX ; Restore Flags
MOV DI,OFFSET DGROUP:b$Buf1
MOV CL,255 ;reset input to start of buffer
StoreExit:
cEnd ;exit to caller
page
;***
;Concat -- concatenate the buffer into a string
;
;Purpose:
; Concatenate the buffer b$Buf1, whose sd is b$SDBuf1, into the
; current string pointed by SI, if the current one is not b$Buf1.
;Entry:
; SI = *sd of current string
;Exit:
; ZR if no concatenation happened (SI = addr of b$SDBuf1)
; NZ & SI=*sd of concatenated string
;Uses:
; none
;Exceptions:
; none
;*******************************************************************************
DbPub Concat
cProc Concat,<NEAR>
cBegin
MOV BX,OFFSET DGROUP:b$SDBuf1
CMP BX,SI ;is the current string the input buffer
JZ ConcatExit ;yes, just return it with ZR
cCall B$SCAT,<SI,BX> ; concatenate buffer to current string
MOV SI,AX ;SI has the concatenated string
ConcatExit:
cEnd ;exit to caller
page
;***
;DeviceFin
;
;Purpose:
; Device (disk) float or string input.
;
; Allocating the string could make all temp string offsets changed.
; Only string descriptor is still valid in that case.
;
; For device (disk) input, if an input string is longer than 255
; bytes, we use a temp string instead of the static buffer. (Refer
; to the above routine, B$FillBuf) This caused problem when we use
; B$FIN for disk input.
;
; B$FIN takes the pointer of the given string (NOT *SD) and does
; the string move using that string pointer after allocating a temp.
; This will be fine if the pointer passed to B$FIN is a static one.
; However, device (disk) input isn't the case if the length of input
; string is longer than 255.
;
; In this routine, it takes *SD instead of *string for a string input.
;
;Entry:
; [b$VTYP] = type of var
; [SI] = *sd of variable character string
;Exit:
; AC has integer value ([b$VTYP] = VT_I2) (calls B$FIN)
; AC has integer value ([b$VTYP] = VT_I4) (calls B$FIN)
; AC has the address of string descriptor ([b$VTYP] = VT_SD)
; AC has S.P. value ([b$VTYP] = VT_R4) (calls B$FIN)
; DAC has D.P. value ([b$VTYP] = VT_R8) (calls B$FIN)
; DAC has CY value ([b$VTYP] = VT_CY) (calls B$FIN)
; endif
;Uses:
; none
;Exceptions:
; if error, runtime error handler is invoked, and this never returns
;*******************************************************************************
DbPub DeviceFin
cProc DeviceFin,<NEAR>,<SI,DI,ES>
cBegin
PUSH SI ;save *sd one more copy for later use
MOV SI,[SI+2] ;B$FIN likes string offset...
CMP [b$VTYP],VT_SD ; test if string
JZ GetString ;jump to special case
CALL B$FIN ;process non-string value
JMP SHORT FinExit ;jump to finish up
GetString:
PUSH DS
POP ES ; make ES=DS
CALL B$STRSCAN ; get string from buffer pointed by ES:SI
; do all of $GETSTR except for temp string
; creation, on return DX=*string, CX=length
POP DI ;get input string description (pushed as SI)
PUSH DI ;and put it back on stack
MOV AX,DX ;get offset of the string
SUB AX,[DI+2] ;skip count for leading white spaces
MOV BX,CX ;get length of new string
CALL B$STALCTMP ;allocate a temporary string
MOV DI,[BX+2] ;get new string pointer
POP SI ;get old descriptor again
PUSH SI ;still want it on stack
MOV SI,[SI+2] ;get pointer of the old string
ADD SI,AX ;get pointer of the old string without white
; white spaces
INC CX ;roundup byte count
SHR CX,1 ;make a word count for transfer
REP MOVSW ;move from old to new string
MOV [B$AC],BX ;put output string desc in BX
FinExit:
POP BX ;done - restore descriptor
;this was pushed as SI
CALL B$STDALCTMP ;delete if temporary
cEnd ;pop registers and return to caller
sEnd ;DK_TEXT
END
| 28.095761 | 80 | 0.67989 |
9d1ba2739b332cfc58d7eb83967100b99ce47a64 | 1,338 | asm | Assembly | largest_prime_fac.asm | guynan/asmpe | 86742a309a7837b884a6396893fcb4896fa1003a | [
"MIT"
] | null | null | null | largest_prime_fac.asm | guynan/asmpe | 86742a309a7837b884a6396893fcb4896fa1003a | [
"MIT"
] | null | null | null | largest_prime_fac.asm | guynan/asmpe | 86742a309a7837b884a6396893fcb4896fa1003a | [
"MIT"
] | null | null | null |
global _start
extern printf
extern asm_prime
section .text
_start:
; RCX will hold our counter and r9 will hold the then largest factor
mov rcx, 1
xor r9, r9
iter_factors:
mov rbx, rcx
imul rbx, rbx
; We check if our current factor is fewer than the square root
mov rax, qword max_
cmp rbx, rax
jg _complete_res ; rcx * rcx > MAX
xor rdx, rdx
mov rbx, rcx
xor rdx, rdx
idiv rbx
cmp rdx, 0
jne next_factor
mov edi, ecx
push rcx
call asm_prime
pop rcx
cmp rax, 1
jne next_factor
mov r9, rcx
next_factor:
add rcx, 2
jmp iter_factors
_complete_res:
mov rdi, r9
call print_result
call _end_execution
print_result:
mov ebx, edi
push rdi
mov rdi, format
mov esi, ebx
xor rax, rax
call printf
pop rdi
ret
_end_execution:
mov rax, 60
mov rdi, 0
syscall
ret
section .data
max_ equ 600851475143
format:
db "%ld", 10, 0
; vim: ft=nasm
| 15.204545 | 76 | 0.46861 |
e409ce7a4f1afbc3727cbeb853266154d6a6ff17 | 1,197 | asm | Assembly | programs/oeis/324/A324161.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/324/A324161.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/324/A324161.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A324161: Number of zerofree nonnegative integers <= n.
; 0,1,2,3,4,5,6,7,8,9,9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,34,35,36,36,37,38,39,40,41,42,43,44,45,45,46,47,48,49,50,51,52,53,54,54,55,56,57,58,59,60,61,62,63,63,64,65,66,67,68,69,70,71,72,72,73,74,75,76,77,78,79,80,81,81,82,83,84,85,86,87,88,89,90,90,90,90,90,90,90,90,90,90,90,90,91,92,93,94,95,96,97,98,99,99,100,101,102,103,104,105,106,107,108,108,109,110,111,112,113,114,115,116,117,117,118,119,120,121,122,123,124,125,126,126,127,128,129,130,131,132,133,134,135,135,136,137,138,139,140,141,142,143,144,144,145,146,147,148,149,150,151,152,153,153,154,155,156,157,158,159,160,161,162,162,163,164,165,166,167,168,169,170,171,171,171,171,171,171,171,171,171,171,171,171,172,173,174,175,176,177,178,179,180,180,181,182,183,184,185,186,187,188,189,189,190,191,192,193,194,195,196,197,198,198,199,200,201,202,203,204,205,206,207
mov $12,$0
add $12,1
lpb $12,1
clr $0,10
sub $12,1
sub $0,$12
mov $4,1
mov $5,1
add $6,4
lpb $4,1
cal $0,98736 ; a(n) = product of n and all its digits.
add $4,$0
sub $4,$5
mov $6,1
lpe
mov $1,$6
div $1,3
add $11,$1
lpe
mov $1,$11
| 49.875 | 869 | 0.664996 |
e04d646b75e22244b25247d84d2875bdc29b973a | 523 | asm | Assembly | maps/Route10North.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | maps/Route10North.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | maps/Route10North.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | Route10North_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
PowerPlantSign:
jumptext PowerPlantSignText
Route10PokecenterSign:
jumpstd pokecentersign
PowerPlantSignText:
text "KANTO POWER PLANT"
done
Route10North_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 11, 1, ROUTE_10_POKECENTER_1F, 1
warp_event 3, 9, POWER_PLANT, 1
db 0 ; coord events
db 2 ; bg events
bg_event 5, 11, BGEVENT_READ, PowerPlantSign
bg_event 12, 1, BGEVENT_READ, Route10PokecenterSign
db 0 ; object events
| 17.433333 | 53 | 0.762906 |
30742ac72b8977f3e25709b81838bd2a4e9a2f2a | 625 | asm | Assembly | oeis/020/A020770.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/020/A020770.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/020/A020770.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A020770: Decimal expansion of 1/sqrt(13).
; Submitted by Jamie Morken(s1)
; 2,7,7,3,5,0,0,9,8,1,1,2,6,1,4,5,6,1,0,0,9,1,7,0,8,6,6,7,2,8,4,9,9,6,8,8,1,7,3,1,7,6,6,5,9,5,2,6,5,5,7,4,0,0,9,7,7,7,2,7,1,5,8,1,7,1,3,2,0,5,3,4,4,8,4,0,7,7,7,2,6,5,5,4,2,0,1,4,6,7,8,4,7,5,7,6,2,0,9,0
mov $1,1
mov $2,1
mov $4,$0
mov $0,2
mov $3,16
add $4,3
mov $7,10
pow $7,$4
mov $9,10
lpb $3
mov $4,$2
pow $4,2
mul $4,13
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,2
div $1,$8
div $2,$8
sub $3,1
lpe
mov $3,$9
pow $3,$0
div $2,$3
mov $0,$2
mod $0,10
| 16.447368 | 201 | 0.5168 |
a05730b320093d4dc77a9f4ac202b17c339f8cf0 | 798 | asm | Assembly | oeis/116/A116798.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/116/A116798.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/116/A116798.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A116798: Number of permutations of length n which avoid the patterns 1234, 1342, 1432.
; Submitted by Christian Krause
; 1,2,6,21,76,277,1012,3702,13553,49642,181885,666542,2442922,8954133,32821408,120310377,441018216,1616644946,5926191305,21723934190,79634709513,291922123258,1070118922286,3922810609205,14380129657444,52714290239405,193238646748572,708369168053198,2596721278804929,9518993674352610,34894481446733797,127915291574542054,468908585902251346,1718913042588642549,6301147272566488856,23098583839336922401,84674195497629437968,310396491763817679530,1137843490297288867033,4171077454579669926726
add $0,1
lpb $0
sub $0,1
add $4,$1
add $1,$3
add $3,$1
mul $5,3
add $5,1
add $5,$2
add $1,$5
add $1,2
mov $2,$3
add $2,$4
sub $2,$3
lpe
mov $0,$5
div $0,3
add $0,1
| 34.695652 | 487 | 0.786967 |
2fd03d9c44812bf11ec3609accdb82f04cb5ee46 | 42,064 | asm | Assembly | stage1_sigfpe.asm | briansrls/xv6 | a239977076a9bd2ede261e8d8bffd09a25d43598 | [
"MIT-0"
] | null | null | null | stage1_sigfpe.asm | briansrls/xv6 | a239977076a9bd2ede261e8d8bffd09a25d43598 | [
"MIT-0"
] | null | null | null | stage1_sigfpe.asm | briansrls/xv6 | a239977076a9bd2ede261e8d8bffd09a25d43598 | [
"MIT-0"
] | null | null | null |
_stage1_sigfpe: file format elf32-i386
Disassembly of section .text:
00000000 <dummy>:
#include "stat.h"
#include "user.h"
#include "signal.h"
void dummy(void)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
}
3: 5d pop %ebp
4: c3 ret
00000005 <handle_signal>:
void handle_signal(siginfo_t info)
{
5: 55 push %ebp
6: 89 e5 mov %esp,%ebp
8: 83 ec 18 sub $0x18,%esp
printf(1, "Caught signal %d...\n", info.signum);
b: 8b 45 08 mov 0x8(%ebp),%eax
e: 89 44 24 08 mov %eax,0x8(%esp)
12: c7 44 24 04 84 08 00 movl $0x884,0x4(%esp)
19: 00
1a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
21: e8 96 04 00 00 call 4bc <printf>
if (info.signum == SIGFPE)
26: 8b 45 08 mov 0x8(%ebp),%eax
29: 85 c0 test %eax,%eax
2b: 75 16 jne 43 <handle_signal+0x3e>
printf(1, "TEST PASSED\n");
2d: c7 44 24 04 99 08 00 movl $0x899,0x4(%esp)
34: 00
35: c7 04 24 01 00 00 00 movl $0x1,(%esp)
3c: e8 7b 04 00 00 call 4bc <printf>
41: eb 14 jmp 57 <handle_signal+0x52>
else
printf(1, "TEST FAILED: wrong signal sent.\n");
43: c7 44 24 04 a8 08 00 movl $0x8a8,0x4(%esp)
4a: 00
4b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
52: e8 65 04 00 00 call 4bc <printf>
exit();
57: e8 d0 02 00 00 call 32c <exit>
0000005c <main>:
}
int main(int argc, char *argv[])
{
5c: 55 push %ebp
5d: 89 e5 mov %esp,%ebp
5f: 83 e4 f0 and $0xfffffff0,%esp
62: 83 ec 20 sub $0x20,%esp
int x = 5;
65: c7 44 24 1c 05 00 00 movl $0x5,0x1c(%esp)
6c: 00
int y = 0;
6d: c7 44 24 18 00 00 00 movl $0x0,0x18(%esp)
74: 00
signal(SIGFPE, handle_signal);
75: c7 44 24 04 05 00 00 movl $0x5,0x4(%esp)
7c: 00
7d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
84: e8 73 02 00 00 call 2fc <signal>
x = x / y;
89: 8b 44 24 1c mov 0x1c(%esp),%eax
8d: 99 cltd
8e: f7 7c 24 18 idivl 0x18(%esp)
92: 89 44 24 1c mov %eax,0x1c(%esp)
printf(1, "TEST FAILED: no signal sent.\n");
96: c7 44 24 04 c9 08 00 movl $0x8c9,0x4(%esp)
9d: 00
9e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
a5: e8 12 04 00 00 call 4bc <printf>
exit();
aa: e8 7d 02 00 00 call 32c <exit>
af: 90 nop
000000b0 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 57 push %edi
b4: 53 push %ebx
asm volatile("cld; rep stosb" :
b5: 8b 4d 08 mov 0x8(%ebp),%ecx
b8: 8b 55 10 mov 0x10(%ebp),%edx
bb: 8b 45 0c mov 0xc(%ebp),%eax
be: 89 cb mov %ecx,%ebx
c0: 89 df mov %ebx,%edi
c2: 89 d1 mov %edx,%ecx
c4: fc cld
c5: f3 aa rep stos %al,%es:(%edi)
c7: 89 ca mov %ecx,%edx
c9: 89 fb mov %edi,%ebx
cb: 89 5d 08 mov %ebx,0x8(%ebp)
ce: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
d1: 5b pop %ebx
d2: 5f pop %edi
d3: 5d pop %ebp
d4: c3 ret
000000d5 <strcpy>:
#include "x86.h"
#include "signal.h"
char*
strcpy(char *s, char *t)
{
d5: 55 push %ebp
d6: 89 e5 mov %esp,%ebp
d8: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
db: 8b 45 08 mov 0x8(%ebp),%eax
de: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
e1: 90 nop
e2: 8b 45 0c mov 0xc(%ebp),%eax
e5: 8a 10 mov (%eax),%dl
e7: 8b 45 08 mov 0x8(%ebp),%eax
ea: 88 10 mov %dl,(%eax)
ec: 8b 45 08 mov 0x8(%ebp),%eax
ef: 8a 00 mov (%eax),%al
f1: 84 c0 test %al,%al
f3: 0f 95 c0 setne %al
f6: ff 45 08 incl 0x8(%ebp)
f9: ff 45 0c incl 0xc(%ebp)
fc: 84 c0 test %al,%al
fe: 75 e2 jne e2 <strcpy+0xd>
;
return os;
100: 8b 45 fc mov -0x4(%ebp),%eax
}
103: c9 leave
104: c3 ret
00000105 <strcmp>:
int
strcmp(const char *p, const char *q)
{
105: 55 push %ebp
106: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
108: eb 06 jmp 110 <strcmp+0xb>
p++, q++;
10a: ff 45 08 incl 0x8(%ebp)
10d: ff 45 0c incl 0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
110: 8b 45 08 mov 0x8(%ebp),%eax
113: 8a 00 mov (%eax),%al
115: 84 c0 test %al,%al
117: 74 0e je 127 <strcmp+0x22>
119: 8b 45 08 mov 0x8(%ebp),%eax
11c: 8a 10 mov (%eax),%dl
11e: 8b 45 0c mov 0xc(%ebp),%eax
121: 8a 00 mov (%eax),%al
123: 38 c2 cmp %al,%dl
125: 74 e3 je 10a <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
127: 8b 45 08 mov 0x8(%ebp),%eax
12a: 8a 00 mov (%eax),%al
12c: 0f b6 d0 movzbl %al,%edx
12f: 8b 45 0c mov 0xc(%ebp),%eax
132: 8a 00 mov (%eax),%al
134: 0f b6 c0 movzbl %al,%eax
137: 89 d1 mov %edx,%ecx
139: 29 c1 sub %eax,%ecx
13b: 89 c8 mov %ecx,%eax
}
13d: 5d pop %ebp
13e: c3 ret
0000013f <strlen>:
uint
strlen(char *s)
{
13f: 55 push %ebp
140: 89 e5 mov %esp,%ebp
142: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
145: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
14c: eb 03 jmp 151 <strlen+0x12>
14e: ff 45 fc incl -0x4(%ebp)
151: 8b 55 fc mov -0x4(%ebp),%edx
154: 8b 45 08 mov 0x8(%ebp),%eax
157: 01 d0 add %edx,%eax
159: 8a 00 mov (%eax),%al
15b: 84 c0 test %al,%al
15d: 75 ef jne 14e <strlen+0xf>
;
return n;
15f: 8b 45 fc mov -0x4(%ebp),%eax
}
162: c9 leave
163: c3 ret
00000164 <memset>:
void*
memset(void *dst, int c, uint n)
{
164: 55 push %ebp
165: 89 e5 mov %esp,%ebp
167: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
16a: 8b 45 10 mov 0x10(%ebp),%eax
16d: 89 44 24 08 mov %eax,0x8(%esp)
171: 8b 45 0c mov 0xc(%ebp),%eax
174: 89 44 24 04 mov %eax,0x4(%esp)
178: 8b 45 08 mov 0x8(%ebp),%eax
17b: 89 04 24 mov %eax,(%esp)
17e: e8 2d ff ff ff call b0 <stosb>
return dst;
183: 8b 45 08 mov 0x8(%ebp),%eax
}
186: c9 leave
187: c3 ret
00000188 <strchr>:
char*
strchr(const char *s, char c)
{
188: 55 push %ebp
189: 89 e5 mov %esp,%ebp
18b: 83 ec 04 sub $0x4,%esp
18e: 8b 45 0c mov 0xc(%ebp),%eax
191: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
194: eb 12 jmp 1a8 <strchr+0x20>
if(*s == c)
196: 8b 45 08 mov 0x8(%ebp),%eax
199: 8a 00 mov (%eax),%al
19b: 3a 45 fc cmp -0x4(%ebp),%al
19e: 75 05 jne 1a5 <strchr+0x1d>
return (char*)s;
1a0: 8b 45 08 mov 0x8(%ebp),%eax
1a3: eb 11 jmp 1b6 <strchr+0x2e>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
1a5: ff 45 08 incl 0x8(%ebp)
1a8: 8b 45 08 mov 0x8(%ebp),%eax
1ab: 8a 00 mov (%eax),%al
1ad: 84 c0 test %al,%al
1af: 75 e5 jne 196 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
1b1: b8 00 00 00 00 mov $0x0,%eax
}
1b6: c9 leave
1b7: c3 ret
000001b8 <gets>:
char*
gets(char *buf, int max)
{
1b8: 55 push %ebp
1b9: 89 e5 mov %esp,%ebp
1bb: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
1be: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1c5: eb 42 jmp 209 <gets+0x51>
cc = read(0, &c, 1);
1c7: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1ce: 00
1cf: 8d 45 ef lea -0x11(%ebp),%eax
1d2: 89 44 24 04 mov %eax,0x4(%esp)
1d6: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1dd: e8 62 01 00 00 call 344 <read>
1e2: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
1e5: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
1e9: 7e 29 jle 214 <gets+0x5c>
break;
buf[i++] = c;
1eb: 8b 55 f4 mov -0xc(%ebp),%edx
1ee: 8b 45 08 mov 0x8(%ebp),%eax
1f1: 01 c2 add %eax,%edx
1f3: 8a 45 ef mov -0x11(%ebp),%al
1f6: 88 02 mov %al,(%edx)
1f8: ff 45 f4 incl -0xc(%ebp)
if(c == '\n' || c == '\r')
1fb: 8a 45 ef mov -0x11(%ebp),%al
1fe: 3c 0a cmp $0xa,%al
200: 74 13 je 215 <gets+0x5d>
202: 8a 45 ef mov -0x11(%ebp),%al
205: 3c 0d cmp $0xd,%al
207: 74 0c je 215 <gets+0x5d>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
209: 8b 45 f4 mov -0xc(%ebp),%eax
20c: 40 inc %eax
20d: 3b 45 0c cmp 0xc(%ebp),%eax
210: 7c b5 jl 1c7 <gets+0xf>
212: eb 01 jmp 215 <gets+0x5d>
cc = read(0, &c, 1);
if(cc < 1)
break;
214: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
215: 8b 55 f4 mov -0xc(%ebp),%edx
218: 8b 45 08 mov 0x8(%ebp),%eax
21b: 01 d0 add %edx,%eax
21d: c6 00 00 movb $0x0,(%eax)
return buf;
220: 8b 45 08 mov 0x8(%ebp),%eax
}
223: c9 leave
224: c3 ret
00000225 <stat>:
int
stat(char *n, struct stat *st)
{
225: 55 push %ebp
226: 89 e5 mov %esp,%ebp
228: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
22b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
232: 00
233: 8b 45 08 mov 0x8(%ebp),%eax
236: 89 04 24 mov %eax,(%esp)
239: e8 2e 01 00 00 call 36c <open>
23e: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
241: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
245: 79 07 jns 24e <stat+0x29>
return -1;
247: b8 ff ff ff ff mov $0xffffffff,%eax
24c: eb 23 jmp 271 <stat+0x4c>
r = fstat(fd, st);
24e: 8b 45 0c mov 0xc(%ebp),%eax
251: 89 44 24 04 mov %eax,0x4(%esp)
255: 8b 45 f4 mov -0xc(%ebp),%eax
258: 89 04 24 mov %eax,(%esp)
25b: e8 24 01 00 00 call 384 <fstat>
260: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
263: 8b 45 f4 mov -0xc(%ebp),%eax
266: 89 04 24 mov %eax,(%esp)
269: e8 e6 00 00 00 call 354 <close>
return r;
26e: 8b 45 f0 mov -0x10(%ebp),%eax
}
271: c9 leave
272: c3 ret
00000273 <atoi>:
int
atoi(const char *s)
{
273: 55 push %ebp
274: 89 e5 mov %esp,%ebp
276: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
279: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
280: eb 21 jmp 2a3 <atoi+0x30>
n = n*10 + *s++ - '0';
282: 8b 55 fc mov -0x4(%ebp),%edx
285: 89 d0 mov %edx,%eax
287: c1 e0 02 shl $0x2,%eax
28a: 01 d0 add %edx,%eax
28c: d1 e0 shl %eax
28e: 89 c2 mov %eax,%edx
290: 8b 45 08 mov 0x8(%ebp),%eax
293: 8a 00 mov (%eax),%al
295: 0f be c0 movsbl %al,%eax
298: 01 d0 add %edx,%eax
29a: 83 e8 30 sub $0x30,%eax
29d: 89 45 fc mov %eax,-0x4(%ebp)
2a0: ff 45 08 incl 0x8(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
2a3: 8b 45 08 mov 0x8(%ebp),%eax
2a6: 8a 00 mov (%eax),%al
2a8: 3c 2f cmp $0x2f,%al
2aa: 7e 09 jle 2b5 <atoi+0x42>
2ac: 8b 45 08 mov 0x8(%ebp),%eax
2af: 8a 00 mov (%eax),%al
2b1: 3c 39 cmp $0x39,%al
2b3: 7e cd jle 282 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
2b5: 8b 45 fc mov -0x4(%ebp),%eax
}
2b8: c9 leave
2b9: c3 ret
000002ba <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
2ba: 55 push %ebp
2bb: 89 e5 mov %esp,%ebp
2bd: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
2c0: 8b 45 08 mov 0x8(%ebp),%eax
2c3: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
2c6: 8b 45 0c mov 0xc(%ebp),%eax
2c9: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
2cc: eb 10 jmp 2de <memmove+0x24>
*dst++ = *src++;
2ce: 8b 45 f8 mov -0x8(%ebp),%eax
2d1: 8a 10 mov (%eax),%dl
2d3: 8b 45 fc mov -0x4(%ebp),%eax
2d6: 88 10 mov %dl,(%eax)
2d8: ff 45 fc incl -0x4(%ebp)
2db: ff 45 f8 incl -0x8(%ebp)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2de: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
2e2: 0f 9f c0 setg %al
2e5: ff 4d 10 decl 0x10(%ebp)
2e8: 84 c0 test %al,%al
2ea: 75 e2 jne 2ce <memmove+0x14>
*dst++ = *src++;
return vdst;
2ec: 8b 45 08 mov 0x8(%ebp),%eax
}
2ef: c9 leave
2f0: c3 ret
000002f1 <trampoline>:
2f1: 5a pop %edx
2f2: 59 pop %ecx
2f3: 58 pop %eax
2f4: 03 25 04 00 00 00 add 0x4,%esp
2fa: c9 leave
2fb: c3 ret
000002fc <signal>:
"addl 4, %esp\n\t"
"leave\n\t"
"ret\n\t"
);
int signal(int signum, sighandler_t handler)
{
2fc: 55 push %ebp
2fd: 89 e5 mov %esp,%ebp
2ff: 83 ec 18 sub $0x18,%esp
register_signal_handler(signum, handler, trampoline);
302: c7 44 24 08 f1 02 00 movl $0x2f1,0x8(%esp)
309: 00
30a: 8b 45 0c mov 0xc(%ebp),%eax
30d: 89 44 24 04 mov %eax,0x4(%esp)
311: 8b 45 08 mov 0x8(%ebp),%eax
314: 89 04 24 mov %eax,(%esp)
317: e8 b8 00 00 00 call 3d4 <register_signal_handler>
return 0;
31c: b8 00 00 00 00 mov $0x0,%eax
}
321: c9 leave
322: c3 ret
323: 90 nop
00000324 <fork>:
324: b8 01 00 00 00 mov $0x1,%eax
329: cd 40 int $0x40
32b: c3 ret
0000032c <exit>:
32c: b8 02 00 00 00 mov $0x2,%eax
331: cd 40 int $0x40
333: c3 ret
00000334 <wait>:
334: b8 03 00 00 00 mov $0x3,%eax
339: cd 40 int $0x40
33b: c3 ret
0000033c <pipe>:
33c: b8 04 00 00 00 mov $0x4,%eax
341: cd 40 int $0x40
343: c3 ret
00000344 <read>:
344: b8 05 00 00 00 mov $0x5,%eax
349: cd 40 int $0x40
34b: c3 ret
0000034c <write>:
34c: b8 10 00 00 00 mov $0x10,%eax
351: cd 40 int $0x40
353: c3 ret
00000354 <close>:
354: b8 15 00 00 00 mov $0x15,%eax
359: cd 40 int $0x40
35b: c3 ret
0000035c <kill>:
35c: b8 06 00 00 00 mov $0x6,%eax
361: cd 40 int $0x40
363: c3 ret
00000364 <exec>:
364: b8 07 00 00 00 mov $0x7,%eax
369: cd 40 int $0x40
36b: c3 ret
0000036c <open>:
36c: b8 0f 00 00 00 mov $0xf,%eax
371: cd 40 int $0x40
373: c3 ret
00000374 <mknod>:
374: b8 11 00 00 00 mov $0x11,%eax
379: cd 40 int $0x40
37b: c3 ret
0000037c <unlink>:
37c: b8 12 00 00 00 mov $0x12,%eax
381: cd 40 int $0x40
383: c3 ret
00000384 <fstat>:
384: b8 08 00 00 00 mov $0x8,%eax
389: cd 40 int $0x40
38b: c3 ret
0000038c <link>:
38c: b8 13 00 00 00 mov $0x13,%eax
391: cd 40 int $0x40
393: c3 ret
00000394 <mkdir>:
394: b8 14 00 00 00 mov $0x14,%eax
399: cd 40 int $0x40
39b: c3 ret
0000039c <chdir>:
39c: b8 09 00 00 00 mov $0x9,%eax
3a1: cd 40 int $0x40
3a3: c3 ret
000003a4 <dup>:
3a4: b8 0a 00 00 00 mov $0xa,%eax
3a9: cd 40 int $0x40
3ab: c3 ret
000003ac <getpid>:
3ac: b8 0b 00 00 00 mov $0xb,%eax
3b1: cd 40 int $0x40
3b3: c3 ret
000003b4 <sbrk>:
3b4: b8 0c 00 00 00 mov $0xc,%eax
3b9: cd 40 int $0x40
3bb: c3 ret
000003bc <sleep>:
3bc: b8 0d 00 00 00 mov $0xd,%eax
3c1: cd 40 int $0x40
3c3: c3 ret
000003c4 <uptime>:
3c4: b8 0e 00 00 00 mov $0xe,%eax
3c9: cd 40 int $0x40
3cb: c3 ret
000003cc <halt>:
3cc: b8 16 00 00 00 mov $0x16,%eax
3d1: cd 40 int $0x40
3d3: c3 ret
000003d4 <register_signal_handler>:
3d4: b8 17 00 00 00 mov $0x17,%eax
3d9: cd 40 int $0x40
3db: c3 ret
000003dc <alarm>:
3dc: b8 18 00 00 00 mov $0x18,%eax
3e1: cd 40 int $0x40
3e3: c3 ret
000003e4 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
3e4: 55 push %ebp
3e5: 89 e5 mov %esp,%ebp
3e7: 83 ec 28 sub $0x28,%esp
3ea: 8b 45 0c mov 0xc(%ebp),%eax
3ed: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
3f0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
3f7: 00
3f8: 8d 45 f4 lea -0xc(%ebp),%eax
3fb: 89 44 24 04 mov %eax,0x4(%esp)
3ff: 8b 45 08 mov 0x8(%ebp),%eax
402: 89 04 24 mov %eax,(%esp)
405: e8 42 ff ff ff call 34c <write>
}
40a: c9 leave
40b: c3 ret
0000040c <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
40c: 55 push %ebp
40d: 89 e5 mov %esp,%ebp
40f: 83 ec 48 sub $0x48,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
412: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
419: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
41d: 74 17 je 436 <printint+0x2a>
41f: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
423: 79 11 jns 436 <printint+0x2a>
neg = 1;
425: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
42c: 8b 45 0c mov 0xc(%ebp),%eax
42f: f7 d8 neg %eax
431: 89 45 ec mov %eax,-0x14(%ebp)
434: eb 06 jmp 43c <printint+0x30>
} else {
x = xx;
436: 8b 45 0c mov 0xc(%ebp),%eax
439: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
43c: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
443: 8b 4d 10 mov 0x10(%ebp),%ecx
446: 8b 45 ec mov -0x14(%ebp),%eax
449: ba 00 00 00 00 mov $0x0,%edx
44e: f7 f1 div %ecx
450: 89 d0 mov %edx,%eax
452: 8a 80 88 0b 00 00 mov 0xb88(%eax),%al
458: 8d 4d dc lea -0x24(%ebp),%ecx
45b: 8b 55 f4 mov -0xc(%ebp),%edx
45e: 01 ca add %ecx,%edx
460: 88 02 mov %al,(%edx)
462: ff 45 f4 incl -0xc(%ebp)
}while((x /= base) != 0);
465: 8b 55 10 mov 0x10(%ebp),%edx
468: 89 55 d4 mov %edx,-0x2c(%ebp)
46b: 8b 45 ec mov -0x14(%ebp),%eax
46e: ba 00 00 00 00 mov $0x0,%edx
473: f7 75 d4 divl -0x2c(%ebp)
476: 89 45 ec mov %eax,-0x14(%ebp)
479: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
47d: 75 c4 jne 443 <printint+0x37>
if(neg)
47f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
483: 74 2c je 4b1 <printint+0xa5>
buf[i++] = '-';
485: 8d 55 dc lea -0x24(%ebp),%edx
488: 8b 45 f4 mov -0xc(%ebp),%eax
48b: 01 d0 add %edx,%eax
48d: c6 00 2d movb $0x2d,(%eax)
490: ff 45 f4 incl -0xc(%ebp)
while(--i >= 0)
493: eb 1c jmp 4b1 <printint+0xa5>
putc(fd, buf[i]);
495: 8d 55 dc lea -0x24(%ebp),%edx
498: 8b 45 f4 mov -0xc(%ebp),%eax
49b: 01 d0 add %edx,%eax
49d: 8a 00 mov (%eax),%al
49f: 0f be c0 movsbl %al,%eax
4a2: 89 44 24 04 mov %eax,0x4(%esp)
4a6: 8b 45 08 mov 0x8(%ebp),%eax
4a9: 89 04 24 mov %eax,(%esp)
4ac: e8 33 ff ff ff call 3e4 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
4b1: ff 4d f4 decl -0xc(%ebp)
4b4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4b8: 79 db jns 495 <printint+0x89>
putc(fd, buf[i]);
}
4ba: c9 leave
4bb: c3 ret
000004bc <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4bc: 55 push %ebp
4bd: 89 e5 mov %esp,%ebp
4bf: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4c2: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
4c9: 8d 45 0c lea 0xc(%ebp),%eax
4cc: 83 c0 04 add $0x4,%eax
4cf: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
4d2: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
4d9: e9 78 01 00 00 jmp 656 <printf+0x19a>
c = fmt[i] & 0xff;
4de: 8b 55 0c mov 0xc(%ebp),%edx
4e1: 8b 45 f0 mov -0x10(%ebp),%eax
4e4: 01 d0 add %edx,%eax
4e6: 8a 00 mov (%eax),%al
4e8: 0f be c0 movsbl %al,%eax
4eb: 25 ff 00 00 00 and $0xff,%eax
4f0: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
4f3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4f7: 75 2c jne 525 <printf+0x69>
if(c == '%'){
4f9: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
4fd: 75 0c jne 50b <printf+0x4f>
state = '%';
4ff: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
506: e9 48 01 00 00 jmp 653 <printf+0x197>
} else {
putc(fd, c);
50b: 8b 45 e4 mov -0x1c(%ebp),%eax
50e: 0f be c0 movsbl %al,%eax
511: 89 44 24 04 mov %eax,0x4(%esp)
515: 8b 45 08 mov 0x8(%ebp),%eax
518: 89 04 24 mov %eax,(%esp)
51b: e8 c4 fe ff ff call 3e4 <putc>
520: e9 2e 01 00 00 jmp 653 <printf+0x197>
}
} else if(state == '%'){
525: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
529: 0f 85 24 01 00 00 jne 653 <printf+0x197>
if(c == 'd'){
52f: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
533: 75 2d jne 562 <printf+0xa6>
printint(fd, *ap, 10, 1);
535: 8b 45 e8 mov -0x18(%ebp),%eax
538: 8b 00 mov (%eax),%eax
53a: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
541: 00
542: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
549: 00
54a: 89 44 24 04 mov %eax,0x4(%esp)
54e: 8b 45 08 mov 0x8(%ebp),%eax
551: 89 04 24 mov %eax,(%esp)
554: e8 b3 fe ff ff call 40c <printint>
ap++;
559: 83 45 e8 04 addl $0x4,-0x18(%ebp)
55d: e9 ea 00 00 00 jmp 64c <printf+0x190>
} else if(c == 'x' || c == 'p'){
562: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
566: 74 06 je 56e <printf+0xb2>
568: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
56c: 75 2d jne 59b <printf+0xdf>
printint(fd, *ap, 16, 0);
56e: 8b 45 e8 mov -0x18(%ebp),%eax
571: 8b 00 mov (%eax),%eax
573: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
57a: 00
57b: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
582: 00
583: 89 44 24 04 mov %eax,0x4(%esp)
587: 8b 45 08 mov 0x8(%ebp),%eax
58a: 89 04 24 mov %eax,(%esp)
58d: e8 7a fe ff ff call 40c <printint>
ap++;
592: 83 45 e8 04 addl $0x4,-0x18(%ebp)
596: e9 b1 00 00 00 jmp 64c <printf+0x190>
} else if(c == 's'){
59b: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
59f: 75 43 jne 5e4 <printf+0x128>
s = (char*)*ap;
5a1: 8b 45 e8 mov -0x18(%ebp),%eax
5a4: 8b 00 mov (%eax),%eax
5a6: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
5a9: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5ad: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5b1: 75 25 jne 5d8 <printf+0x11c>
s = "(null)";
5b3: c7 45 f4 e7 08 00 00 movl $0x8e7,-0xc(%ebp)
while(*s != 0){
5ba: eb 1c jmp 5d8 <printf+0x11c>
putc(fd, *s);
5bc: 8b 45 f4 mov -0xc(%ebp),%eax
5bf: 8a 00 mov (%eax),%al
5c1: 0f be c0 movsbl %al,%eax
5c4: 89 44 24 04 mov %eax,0x4(%esp)
5c8: 8b 45 08 mov 0x8(%ebp),%eax
5cb: 89 04 24 mov %eax,(%esp)
5ce: e8 11 fe ff ff call 3e4 <putc>
s++;
5d3: ff 45 f4 incl -0xc(%ebp)
5d6: eb 01 jmp 5d9 <printf+0x11d>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
5d8: 90 nop
5d9: 8b 45 f4 mov -0xc(%ebp),%eax
5dc: 8a 00 mov (%eax),%al
5de: 84 c0 test %al,%al
5e0: 75 da jne 5bc <printf+0x100>
5e2: eb 68 jmp 64c <printf+0x190>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5e4: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
5e8: 75 1d jne 607 <printf+0x14b>
putc(fd, *ap);
5ea: 8b 45 e8 mov -0x18(%ebp),%eax
5ed: 8b 00 mov (%eax),%eax
5ef: 0f be c0 movsbl %al,%eax
5f2: 89 44 24 04 mov %eax,0x4(%esp)
5f6: 8b 45 08 mov 0x8(%ebp),%eax
5f9: 89 04 24 mov %eax,(%esp)
5fc: e8 e3 fd ff ff call 3e4 <putc>
ap++;
601: 83 45 e8 04 addl $0x4,-0x18(%ebp)
605: eb 45 jmp 64c <printf+0x190>
} else if(c == '%'){
607: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
60b: 75 17 jne 624 <printf+0x168>
putc(fd, c);
60d: 8b 45 e4 mov -0x1c(%ebp),%eax
610: 0f be c0 movsbl %al,%eax
613: 89 44 24 04 mov %eax,0x4(%esp)
617: 8b 45 08 mov 0x8(%ebp),%eax
61a: 89 04 24 mov %eax,(%esp)
61d: e8 c2 fd ff ff call 3e4 <putc>
622: eb 28 jmp 64c <printf+0x190>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
624: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
62b: 00
62c: 8b 45 08 mov 0x8(%ebp),%eax
62f: 89 04 24 mov %eax,(%esp)
632: e8 ad fd ff ff call 3e4 <putc>
putc(fd, c);
637: 8b 45 e4 mov -0x1c(%ebp),%eax
63a: 0f be c0 movsbl %al,%eax
63d: 89 44 24 04 mov %eax,0x4(%esp)
641: 8b 45 08 mov 0x8(%ebp),%eax
644: 89 04 24 mov %eax,(%esp)
647: e8 98 fd ff ff call 3e4 <putc>
}
state = 0;
64c: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
653: ff 45 f0 incl -0x10(%ebp)
656: 8b 55 0c mov 0xc(%ebp),%edx
659: 8b 45 f0 mov -0x10(%ebp),%eax
65c: 01 d0 add %edx,%eax
65e: 8a 00 mov (%eax),%al
660: 84 c0 test %al,%al
662: 0f 85 76 fe ff ff jne 4de <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
668: c9 leave
669: c3 ret
66a: 66 90 xchg %ax,%ax
0000066c <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
66c: 55 push %ebp
66d: 89 e5 mov %esp,%ebp
66f: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
672: 8b 45 08 mov 0x8(%ebp),%eax
675: 83 e8 08 sub $0x8,%eax
678: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
67b: a1 a4 0b 00 00 mov 0xba4,%eax
680: 89 45 fc mov %eax,-0x4(%ebp)
683: eb 24 jmp 6a9 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
685: 8b 45 fc mov -0x4(%ebp),%eax
688: 8b 00 mov (%eax),%eax
68a: 3b 45 fc cmp -0x4(%ebp),%eax
68d: 77 12 ja 6a1 <free+0x35>
68f: 8b 45 f8 mov -0x8(%ebp),%eax
692: 3b 45 fc cmp -0x4(%ebp),%eax
695: 77 24 ja 6bb <free+0x4f>
697: 8b 45 fc mov -0x4(%ebp),%eax
69a: 8b 00 mov (%eax),%eax
69c: 3b 45 f8 cmp -0x8(%ebp),%eax
69f: 77 1a ja 6bb <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)
6a1: 8b 45 fc mov -0x4(%ebp),%eax
6a4: 8b 00 mov (%eax),%eax
6a6: 89 45 fc mov %eax,-0x4(%ebp)
6a9: 8b 45 f8 mov -0x8(%ebp),%eax
6ac: 3b 45 fc cmp -0x4(%ebp),%eax
6af: 76 d4 jbe 685 <free+0x19>
6b1: 8b 45 fc mov -0x4(%ebp),%eax
6b4: 8b 00 mov (%eax),%eax
6b6: 3b 45 f8 cmp -0x8(%ebp),%eax
6b9: 76 ca jbe 685 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
6bb: 8b 45 f8 mov -0x8(%ebp),%eax
6be: 8b 40 04 mov 0x4(%eax),%eax
6c1: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6c8: 8b 45 f8 mov -0x8(%ebp),%eax
6cb: 01 c2 add %eax,%edx
6cd: 8b 45 fc mov -0x4(%ebp),%eax
6d0: 8b 00 mov (%eax),%eax
6d2: 39 c2 cmp %eax,%edx
6d4: 75 24 jne 6fa <free+0x8e>
bp->s.size += p->s.ptr->s.size;
6d6: 8b 45 f8 mov -0x8(%ebp),%eax
6d9: 8b 50 04 mov 0x4(%eax),%edx
6dc: 8b 45 fc mov -0x4(%ebp),%eax
6df: 8b 00 mov (%eax),%eax
6e1: 8b 40 04 mov 0x4(%eax),%eax
6e4: 01 c2 add %eax,%edx
6e6: 8b 45 f8 mov -0x8(%ebp),%eax
6e9: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
6ec: 8b 45 fc mov -0x4(%ebp),%eax
6ef: 8b 00 mov (%eax),%eax
6f1: 8b 10 mov (%eax),%edx
6f3: 8b 45 f8 mov -0x8(%ebp),%eax
6f6: 89 10 mov %edx,(%eax)
6f8: eb 0a jmp 704 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
6fa: 8b 45 fc mov -0x4(%ebp),%eax
6fd: 8b 10 mov (%eax),%edx
6ff: 8b 45 f8 mov -0x8(%ebp),%eax
702: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
704: 8b 45 fc mov -0x4(%ebp),%eax
707: 8b 40 04 mov 0x4(%eax),%eax
70a: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
711: 8b 45 fc mov -0x4(%ebp),%eax
714: 01 d0 add %edx,%eax
716: 3b 45 f8 cmp -0x8(%ebp),%eax
719: 75 20 jne 73b <free+0xcf>
p->s.size += bp->s.size;
71b: 8b 45 fc mov -0x4(%ebp),%eax
71e: 8b 50 04 mov 0x4(%eax),%edx
721: 8b 45 f8 mov -0x8(%ebp),%eax
724: 8b 40 04 mov 0x4(%eax),%eax
727: 01 c2 add %eax,%edx
729: 8b 45 fc mov -0x4(%ebp),%eax
72c: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
72f: 8b 45 f8 mov -0x8(%ebp),%eax
732: 8b 10 mov (%eax),%edx
734: 8b 45 fc mov -0x4(%ebp),%eax
737: 89 10 mov %edx,(%eax)
739: eb 08 jmp 743 <free+0xd7>
} else
p->s.ptr = bp;
73b: 8b 45 fc mov -0x4(%ebp),%eax
73e: 8b 55 f8 mov -0x8(%ebp),%edx
741: 89 10 mov %edx,(%eax)
freep = p;
743: 8b 45 fc mov -0x4(%ebp),%eax
746: a3 a4 0b 00 00 mov %eax,0xba4
}
74b: c9 leave
74c: c3 ret
0000074d <morecore>:
static Header*
morecore(uint nu)
{
74d: 55 push %ebp
74e: 89 e5 mov %esp,%ebp
750: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
753: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
75a: 77 07 ja 763 <morecore+0x16>
nu = 4096;
75c: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
763: 8b 45 08 mov 0x8(%ebp),%eax
766: c1 e0 03 shl $0x3,%eax
769: 89 04 24 mov %eax,(%esp)
76c: e8 43 fc ff ff call 3b4 <sbrk>
771: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
774: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
778: 75 07 jne 781 <morecore+0x34>
return 0;
77a: b8 00 00 00 00 mov $0x0,%eax
77f: eb 22 jmp 7a3 <morecore+0x56>
hp = (Header*)p;
781: 8b 45 f4 mov -0xc(%ebp),%eax
784: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
787: 8b 45 f0 mov -0x10(%ebp),%eax
78a: 8b 55 08 mov 0x8(%ebp),%edx
78d: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
790: 8b 45 f0 mov -0x10(%ebp),%eax
793: 83 c0 08 add $0x8,%eax
796: 89 04 24 mov %eax,(%esp)
799: e8 ce fe ff ff call 66c <free>
return freep;
79e: a1 a4 0b 00 00 mov 0xba4,%eax
}
7a3: c9 leave
7a4: c3 ret
000007a5 <malloc>:
void*
malloc(uint nbytes)
{
7a5: 55 push %ebp
7a6: 89 e5 mov %esp,%ebp
7a8: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7ab: 8b 45 08 mov 0x8(%ebp),%eax
7ae: 83 c0 07 add $0x7,%eax
7b1: c1 e8 03 shr $0x3,%eax
7b4: 40 inc %eax
7b5: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
7b8: a1 a4 0b 00 00 mov 0xba4,%eax
7bd: 89 45 f0 mov %eax,-0x10(%ebp)
7c0: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7c4: 75 23 jne 7e9 <malloc+0x44>
base.s.ptr = freep = prevp = &base;
7c6: c7 45 f0 9c 0b 00 00 movl $0xb9c,-0x10(%ebp)
7cd: 8b 45 f0 mov -0x10(%ebp),%eax
7d0: a3 a4 0b 00 00 mov %eax,0xba4
7d5: a1 a4 0b 00 00 mov 0xba4,%eax
7da: a3 9c 0b 00 00 mov %eax,0xb9c
base.s.size = 0;
7df: c7 05 a0 0b 00 00 00 movl $0x0,0xba0
7e6: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7e9: 8b 45 f0 mov -0x10(%ebp),%eax
7ec: 8b 00 mov (%eax),%eax
7ee: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7f1: 8b 45 f4 mov -0xc(%ebp),%eax
7f4: 8b 40 04 mov 0x4(%eax),%eax
7f7: 3b 45 ec cmp -0x14(%ebp),%eax
7fa: 72 4d jb 849 <malloc+0xa4>
if(p->s.size == nunits)
7fc: 8b 45 f4 mov -0xc(%ebp),%eax
7ff: 8b 40 04 mov 0x4(%eax),%eax
802: 3b 45 ec cmp -0x14(%ebp),%eax
805: 75 0c jne 813 <malloc+0x6e>
prevp->s.ptr = p->s.ptr;
807: 8b 45 f4 mov -0xc(%ebp),%eax
80a: 8b 10 mov (%eax),%edx
80c: 8b 45 f0 mov -0x10(%ebp),%eax
80f: 89 10 mov %edx,(%eax)
811: eb 26 jmp 839 <malloc+0x94>
else {
p->s.size -= nunits;
813: 8b 45 f4 mov -0xc(%ebp),%eax
816: 8b 40 04 mov 0x4(%eax),%eax
819: 89 c2 mov %eax,%edx
81b: 2b 55 ec sub -0x14(%ebp),%edx
81e: 8b 45 f4 mov -0xc(%ebp),%eax
821: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
824: 8b 45 f4 mov -0xc(%ebp),%eax
827: 8b 40 04 mov 0x4(%eax),%eax
82a: c1 e0 03 shl $0x3,%eax
82d: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
830: 8b 45 f4 mov -0xc(%ebp),%eax
833: 8b 55 ec mov -0x14(%ebp),%edx
836: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
839: 8b 45 f0 mov -0x10(%ebp),%eax
83c: a3 a4 0b 00 00 mov %eax,0xba4
return (void*)(p + 1);
841: 8b 45 f4 mov -0xc(%ebp),%eax
844: 83 c0 08 add $0x8,%eax
847: eb 38 jmp 881 <malloc+0xdc>
}
if(p == freep)
849: a1 a4 0b 00 00 mov 0xba4,%eax
84e: 39 45 f4 cmp %eax,-0xc(%ebp)
851: 75 1b jne 86e <malloc+0xc9>
if((p = morecore(nunits)) == 0)
853: 8b 45 ec mov -0x14(%ebp),%eax
856: 89 04 24 mov %eax,(%esp)
859: e8 ef fe ff ff call 74d <morecore>
85e: 89 45 f4 mov %eax,-0xc(%ebp)
861: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
865: 75 07 jne 86e <malloc+0xc9>
return 0;
867: b8 00 00 00 00 mov $0x0,%eax
86c: eb 13 jmp 881 <malloc+0xdc>
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){
86e: 8b 45 f4 mov -0xc(%ebp),%eax
871: 89 45 f0 mov %eax,-0x10(%ebp)
874: 8b 45 f4 mov -0xc(%ebp),%eax
877: 8b 00 mov (%eax),%eax
879: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
87c: e9 70 ff ff ff jmp 7f1 <malloc+0x4c>
}
881: c9 leave
882: c3 ret
| 34.032362 | 64 | 0.423997 |
05e92ceb91125ea13c4abbce508f65070884cf60 | 33,686 | asm | Assembly | Library/ConView/Main/mainCopy.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/ConView/Main/mainCopy.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/ConView/Main/mainCopy.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: Condo viewer (library)
MODULE: main - view and text
FILE: mainCopy.asm
AUTHOR: Jonathan Magasin, Jun 16, 1994
METHODS:
Name Description
---- -----------
MSG_CGV_CLIPBOARD_SEND Copy the selected text to the clipboard.
MSG_PRINT_GET_DOC_NAME Tells print controller the name of the
document region to be printed.
MSG_CT_PRINT_START_PRINTING
Draw the whole or selected text to the
passed gstate for the print controller.
MSG_CT_PRINT_CONTENT_TEXT
Draw the ContentText to the passed gstate
for the print controller.
ROUTINES:
Name Description
---- -----------
INT MCGetTextSelected Checks if any text is selected and fills
in the range if there is a selection.
INT MCCreateTransferItem Creates a transfer item for the text.
INT MCCreateTempText Creates a temporary text object that will
hold the selected text (which is now in a
transfer item).
INT MCCopyTransferItemToTempText
Copies transfer item (which holds selected
text) to temp text and frees transfer item.
INT CheckClippingTextAndSetPrintAreaBottom
Check if we will clip any text and set
printAreaBottom.
INT GetLineHeight Returns the height of a text line.
INT SetPageMarginsAndSize Set the page margins and printableSize and
other things.
INT ChangeTextWidth Change the width of the text object.
INT CallPrintControl Call the Print-Control object.
INT SetPageClipRect Clip all drawing to the current page.
INT TranslateToPage Translate all drawing operations to be in
the right place.
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 6/16/94 Initial revision
lester 10/20/94 added printing support
DESCRIPTION:
Handlers for copying text to clipboard and printer.
$Id: mainCopy.asm,v 1.1 97/04/04 17:49:28 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ContentLibraryCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CGVMetaStartMoveCopy
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Disable quick-copy if book send feature is not set.
CALLED BY: MSG_META_START_MOVE_COPY
PASS: *ds:si = ContentGenViewClass object
ds:di = ContentGenViewClass instance data
ds:bx = ContentGenViewClass object (same as *ds:si)
es = segment of ContentGenViewClass
ax = message #
cx - X position of mouse, in document coordinates of
receiving object
dx - X position of mouse, in document coordinates of
receiving object
bp low - ButtonInfo
bp high - UIFunctionsActive
RETURN: ax - MouseReturnFlags
DESTROYED: whatever superclass destroys
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CGVMetaStartMoveCopy method dynamic ContentGenViewClass,
MSG_META_START_MOVE_COPY
.enter
;
; Only allow quick-copy if the book has the Send feature set.
;
test ds:[di].CGVI_bookFeatures, mask BFF_SEND
jnz callSuper
mov ax, mask MRF_PROCESSED
jmp done
callSuper:
mov di, offset ContentGenViewClass
call ObjCallSuperNoLock
done:
.leave
ret
CGVMetaStartMoveCopy endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CGVClipboardSend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy the selected text to the clipboard.
CALLED BY: MSG_CGV_CLIPBOARD_SEND
PASS: *ds:si = ContentGenViewClass object
ds:di = ContentGenViewClass instance data
ds:bx = ContentGenViewClass object (same as *ds:si)
es = segment of ContentGenViewClass
ax = message #
RETURN: nothing
DESTROYED: ax, bp, dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 6/16/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CGVClipboardSend method dynamic ContentGenViewClass,
MSG_CGV_CLIPBOARD_SEND
clr di ; get text object
call ContentGetText
tst bx
jz done
mov ax, MSG_META_CLIPBOARD_COPY
clr di
call ObjMessage
done:
ret
CGVClipboardSend endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CGVPrintGetDocName
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Tells print controller the name of the
document region to be printed.
CALLED BY: MSG_PRINT_GET_DOC_NAME
PASS: *ds:si = ContentGenViewClass object
ds:di = ContentGenViewClass instance data
ds:bx = ContentGenViewClass object (same as *ds:si)
es = segment of ContentGenViewClass
ax = message #
cx:dx = OD of the print control class instance
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 6/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CGVPrintGetDocName method dynamic ContentGenViewClass,
MSG_PRINT_GET_DOC_NAME
.enter
;;; SHOULD THIS BE BOOKNAME, if it exists?
mov ax, CONTENT_FILENAME
call ObjVarFindData ;ds:bx = file name
EC < ERROR_NC CONTENT_COULDNT_FIND_VARDATA_ITEM >
segmov es, ds, ax
mov_tr di, bx
mov_tr ax, cx ;Save cx
call LocalStringSize ; string length w/
inc cx ; null
mov bp, cx ;Save length.
sub sp, cx
mov_tr si, di ;ds:si = src
segmov es, ss, bx
mov di, sp ;es:di = dest
rep movsb ;copy file name
mov_tr si, dx ;^lbx:si = print
mov_tr bx, ax ; controller
mov cx, ss
mov dx, sp ;cx:dx = file name
mov ax, MSG_PRINT_CONTROL_SET_DOC_NAME
mov di, mask MF_CALL
call ObjMessage
add sp, bp
.leave
ret
CGVPrintGetDocName endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CGVPrintStartPrinting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Tell the ContentText object to deal with printing.
CALLED BY: MSG_PRINT_START_PRINTING
PASS: *ds:si = ContentGenViewClass object
ds:di = ContentGenViewClass instance data
ds:bx = ContentGenViewClass object (same as *ds:si)
es = segment of ContentGenViewClass
ax = message #
cx:dx = OD of the PrintControlClass object
bp = GState handle to print (draw) to
RETURN: nothing
DESTROYED: ax,cx,dx,bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
We can NOT call from the UI thread to the process thread or
deadlock will occur. The ContentGenView object is in the UI
thread and the ContentText object is in the process thread,
so we need to have the ContentText object deal with the printing.
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 6/20/94 Initial version
lester 10/ 5/94 changed to send MSG_CT_PRINT_START_PRINTING
to the ContentText object
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CGVPrintStartPrinting method dynamic ContentGenViewClass,
MSG_PRINT_START_PRINTING
.enter
clr di ; get text object
call ContentGetText
clr di
mov ax, MSG_CT_PRINT_START_PRINTING
call ObjMessage
.leave
ret
CGVPrintStartPrinting endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CTPrintStartPrinting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the whole or selected text to the passed gstate
for the print controller.
CALLED BY: MSG_CT_PRINT_START_PRINTING
PASS: *ds:si = ContentTextClass object
ds:di = ContentTextClass instance data
ds:bx = ContentTextClass object (same as *ds:si)
es = segment of ContentTextClass
ax = message #
cx:dx = OD of the PrintControlClass object
bp = GState handle to print (draw) to
RETURN: nothing
DESTROYED: ax,cx,dx,bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
If there is a text selection, copy that selection into a
temporary ContentText object and then send(call) that object a
MSG_CT_PRINT_CONTENT_TEXT. And then destroy the temporary
ContentText object.
Otherwise, just send(call) ourself a MSG_CT_PRINT_CONTENT_TEXT.
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CTPrintStartPrinting method dynamic ContentTextClass,
MSG_CT_PRINT_START_PRINTING
gstate local hptr push bp ; bp needs to be first one
printControl local optr push cx, dx
transParams local CommonTransferParams
ForceRef transParams
.enter
;
; See if any text is selected.
;
call MCGetTextSelected ; filled in transParams range
jz printEntireText
;
; Get the selected text into a transfer item.
;
call MCCreateTransferItem ; fills in rest of transParams
;
; Get our width to use later in setting the temp ContentText width
;
push bp
mov ax, MSG_VIS_GET_SIZE
call ObjCallInstanceNoLock ; cx <- width
pop bp
push cx
;
; Create a temp ContentText object.
;
call MCCreateTempText ; ^lbx:si <- temp ContentText obj
; The temp ContentText is instantiated in our
; object block and ds is fixed up so:
; ^lbx:si = *ds:si = temporary ContentText object
;
; Copy selection range to a temp ContentText object.
;
call MCCopyTransferItemToTempText
;
; Set the width of the temp ContentText object.
; This also makes it calculate its correct height which we use
; while printing.
; NOTE: We need to set the temp ContentText width after we have
; copied the selection into it in order to get the corrent
; height.
;
pop cx ; cx <- width
call ChangeTextWidth
;
; Tell the temp ContentText object to print itself
;
push bp
mov ax, MSG_CT_PRINT_CONTENT_TEXT
movdw cxdx, printControl
mov bp, gstate
call ObjCallInstanceNoLock
pop bp
;
; Destroy the temp ContentText object
;
push bp
mov ax, MSG_VIS_DESTROY
mov dl, VUM_NOW
call ObjCallInstanceNoLock
pop bp
jmp done
printEntireText:
;
; Tell ourself to print
;
push bp
mov ax, MSG_CT_PRINT_CONTENT_TEXT
movdw cxdx, printControl
mov bp, gstate
call ObjCallInstanceNoLock
pop bp
done:
.leave
ret
CTPrintStartPrinting endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MCGetTextSelected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Checks if any text is selected and fills in the range
if there is a selection.
CALLED BY: (INTERNAL) CTPrintStartPrinting
PASS: *ds:si = ContentText Instance
ss:bp = Inheritable stack frame
RETURN: transParams.CTP_range filled in
DESTROYED: ax, cx, dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 7/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MCGetTextSelected proc near
.enter inherit CTPrintStartPrinting
push bp
mov ax, MSG_VIS_TEXT_GET_SELECTION_RANGE
mov dx, ss
lea bp, ss:transParams.CTP_range
call ObjCallInstanceNoLock
pop bp
cmpdw ss:transParams.CTP_range.VTR_start, \
ss:transParams.CTP_range.VTR_end, ax
.leave
ret
MCGetTextSelected endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MCCreateTransferItem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Creates a transfer item for the text.
CALLED BY: (INTERNAL) CTPrintStartPrinting only
PASS: *ds:si = ContentText Instance
ss:bp = Inheritable stack frame
RETURN: filled in:
transParams.CTP_vmFile
transParams.CTP_vmBlock
transParams.CTP_pasteFrame
DESTROYED: ax,cx,dx
SIDE EFFECTS:
Uses clipboard VM file for the transfer.
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 7/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MCCreateTransferItem proc near
.enter inherit CTPrintStartPrinting
push bx ;Save text block
call ClipboardGetClipboardFile ;bx<-VM file handle
EC < cmp bx, 0 >
EC < ERROR_Z JM_SEE_BACKTRACE ;no clipboard >
mov ss:transParams.CTP_vmFile, bx
clr ss:transParams.CTP_vmBlock
clr ss:transParams.CTP_pasteFrame
mov dx, (size CommonTransferParams)
pop bx ;Recall text block
push bp
lea bp, ss:transParams
mov ax, MSG_VIS_TEXT_CREATE_TRANSFER_FORMAT
call ObjCallInstanceNoLock ; ax <- new VM block handle
pop bp
mov ss:transParams.CTP_vmBlock, ax
.leave
ret
MCCreateTransferItem endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MCCreateTempText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Creates a temporary text object that will hold the
selected text (which is now in a transfer item).
CALLED BY: (INTERNAL) CTPrintStartPrinting only
PASS: *ds:si = ContentText Instance
RETURN: ^lbx:si - temp ContentText obj
DESTROYED: ax,cx,dx,di,es
SIDE EFFECTS:
ds - updated to point at segment of same block as on entry
PSEUDO CODE/STRATEGY:
Create a temporary ContentText object.
Tell the temporary text to use the clipboard vm file.
The temp text needs a vm file so we can copy selected graphics
into it.
Set up the temp text storage.
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 7/21/94 Initial version
lester 10/20/94 complete rewrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MCCreateTempText proc near
class ContentTextClass
uses bp
.enter
EC < call AssertIsCText >
; Create temporary ContentText object
mov di, segment ContentTextClass
mov es, di
mov di, offset ContentTextClass
mov bx, ds:[LMBH_handle]
call ObjInstantiate ; ^lbx:si = temp text
; Set the vm file for temporary ContentText
mov_tr cx, bx ; save temp text handle
call ClipboardGetClipboardFile ; bx <- vm file handle
xchg cx, bx ; cx <- vm file, bx <- temp text handle
mov ax, MSG_VIS_TEXT_SET_VM_FILE
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
; Set up temporary ContentText storage
mov ax, MSG_VIS_TEXT_CREATE_STORAGE
mov cx, mask VTSF_MULTIPLE_CHAR_ATTRS or \
mask VTSF_MULTIPLE_PARA_ATTRS or \
mask VTSF_GRAPHICS or \
mask VTSF_TYPES ;ch <- no regions
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
; Get ready to make temporary ContentText same width as ourself
; HACK here. Manually clear the geometry invalid bit.
mov di, ds:[si]
add di, ds:[di].Vis_offset
BitClr ds:[di].VI_optFlags, VOF_GEOMETRY_INVALID
.leave
ret
MCCreateTempText endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MCCopyTransferItemToTempText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copies transfer item (which holds selected text)
to temp text and frees transfer item.
CALLED BY: (INTERNAL) CTPrintStartPrinting
PASS: *ds:si = ContentText Instance
ss:bp = Inheritable stack frame
RETURN: nothing
DESTROYED: ax, cx, dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JM 7/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MCCopyTransferItemToTempText proc near
.enter inherit CTPrintStartPrinting
push bp
mov ax, MSG_VIS_TEXT_REPLACE_WITH_TEXT_TRANSFER_FORMAT
mov dx, (size CommonTransferParams)
clrdw ss:transParams.CTP_range.VTR_start
clrdw ss:transParams.CTP_range.VTR_end
lea bp, ss:transParams
call ObjCallInstanceNoLock
pop bp
push bx
mov bx, ss:transParams.CTP_vmFile
mov ax, ss:transParams.CTP_vmBlock
call VMFree ;Get rid of xfer item
pop bx
.leave
ret
MCCopyTransferItemToTempText endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CTPrintContentText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the ContentText to the passed gstate for the print
controller.
CALLED BY: MSG_CT_PRINT_CONTENT_TEXT
PASS: *ds:si = ContentTextClass object
ds:di = CpontentTextClass instance data
ds:bx = ContentTextClass object (same as *ds:si)
es = segment of ContentTextClass
ax = message #
cx:dx = OD of the PrintControlClass object
bp = GState handle to print (draw) to
RETURN: nothing
DESTROYED: ax,cx,dx,bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
In the print loop, we check if we are clipping any text and adjust
the printable area so the cliped text will be printed on the next
page.
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/17/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CTPrintContentText method dynamic ContentTextClass,
MSG_CT_PRINT_CONTENT_TEXT
gstate local hptr push bp ; bp needs to be first one
;
; Handle of gstate to draw to.
;
printControl local optr push cx, dx
;
; Print control object to send messages to.
;
printableSize local XYSize
;
; Size of the printable area on the paper.
;
printAreaTop local word
;
; Top Y coordinate of page currently being printed.
;
printAreaBottom local word
;
; Bottom Y coordinate of page currently being printed.
;
textHeight local word
;
; Height of text object being printed.
;
pageCount local word
;
; The number of pages needed to print the TextObject.
;
pageMargins local Rectangle
;
; Margins.
;
oldTextSize local XYSize
;
; Old size of the text object. Used when we change the width of the
; text object to match the printer margins.
;
textResized local BooleanByte
;
; Flag indicating if the text object was resized to fit the
; printer margins.
;
ForceRef printControl
ForceRef printableSize
ForceRef pageMargins
.enter
;
; Fill in the printableSize and pageMargins local variables.
;
call SetPageMarginsAndSize
; Set up for the print loop
mov di, gstate
clr pageCount ; first page is 0
mov printAreaBottom, -1
;-----------------------------------------------------------------------------
; Print Loop
;-----------------------------------------------------------------------------
;
; di = GState to print with
;
; The following local variables set:
; textHeight - Height of text object (after changing
; the width)
; printAreaBottom - Y coordinate of the bottom of the
; area currently being printed.
; At the start of the loop printAreaBottom is
; set to the bottom of the last page printed.
; pageCount - Count of pages printed so far (0 based)
; pageMargins - Offset to page in drawing area
; printableSize - Printable size of the paper we are
; printing to
printLoop:
;
; Set the printAreaTop
;
mov ax, printAreaBottom
inc ax ; don't repeat bottom line
mov printAreaTop, ax
;
; Check if we are clipping any text at the bottom of the page and
; set printAreaBottom
;
call CheckClippingTextAndSetPrintAreaBottom
;
; Want to make the page self-describing. This should force that
; notion...
;
call GrSaveState
;
; Set the clip rectangle so that we only draw this page.
;
call SetPageClipRect ; Clip to page only
;
; Compute the position of the current page and translate there.
; Account for margins too.
;
call TranslateToPage ; Put drawing in right place
;
; Draw the text.
;
push bp
mov bp, di ; bp <- gstate
mov cl, mask DF_PRINT ; cl <- DrawFlags
mov ax, MSG_VIS_DRAW
call ObjCallInstanceNoLock
pop bp
;
; Before finishing, restore the state of things
;
call GrRestoreState
;
; Move down a page
;
mov al, PEC_FORM_FEED
call GrNewPage
;
; Move to do next page
;
endPrintLoop::
; printAreaBottom is the bottom of the page we just printed
mov ax, printAreaBottom
cmp ax, textHeight ; all done?
jae outOfPrintLoop
inc pageCount ; keep track of how many pages
jmp printLoop ; Loop to do next page
outOfPrintLoop:
;
; Tell print controller the page range
; pageCount is based on firstPage being numbered 0
;
push bp
mov ax, MSG_PRINT_CONTROL_SET_TOTAL_PAGE_RANGE
clr cx ; first page
mov dx, pageCount ; last page
call CallPrintControl
pop bp
;
; tell print controller that we are done
;
push bp
mov ax, MSG_PRINT_CONTROL_PRINTING_COMPLETED
call CallPrintControl
pop bp
;
; Restore the text size if we changed it.
;
tst textResized
jz afterRestoreSize
mov cx, oldTextSize.XYS_width
call ChangeTextWidth
afterRestoreSize:
.leave
ret
CTPrintContentText endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckClippingTextAndSetPrintAreaBottom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check if we will clip any text and set printAreaBottom.
CALLED BY: (INTERNAL) CTPrintContentText
PASS: *ds:si = Content Text Instance
ss:bp = Inheritable stack frame
RETURN: Set:
printAreaBottom
DESTROYED: ax,cx,dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Check if any text will be clipped by the bottom of the page.
If so, print down to the top of the line so the clipped text
will be printed on the next page.
Also check if the text line is too big to fit on a page, in which
case it needs to be clipped somewhere, so here is a good spot.
The same logic and code applies to graphics because they are
just characters.
NOTE: Blank lines of text are treated just like any other lines
of text which might not be exactly what you want if the
blank lines are in a large point size and they fall on the
page boundary.
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckClippingTextAndSetPrintAreaBottom proc near
uses di
.enter inherit CTPrintContentText
EC < call AssertIsCText >
; Assume printing the full page
mov ax, printAreaTop
add ax, printableSize.XYS_height
mov printAreaBottom, ax
;
; Get the nearest character position to the bottom of the page
;
push bp
sub sp, size PointDWFixed
mov bp, sp
; ax = printAreaBottom
clr dx, cx
movdw ss:[bp].PDF_y.DWF_int, dxax
mov ss:[bp].PDF_y.DWF_frac, dx
movdw ss:[bp].PDF_x.DWF_int, dxcx
mov ss:[bp].PDF_x.DWF_frac, dx
mov ax, MSG_VIS_TEXT_GET_TEXT_POSITION_FROM_COORD
call ObjCallInstanceNoLock
; ss:bp - nearest valid X and Y positions
; dx:ax - nearest character position
; The nearest valid XY position is the top left of the character
movdw dicx, ss:[bp].PDF_y.DWF_int
add sp, size PointDWFixed
pop bp
push cx ; save Y position of top of line
;
; Get the line from the character position
;
push bp
mov cx, dx
mov dx, ax ; cx:dx - offset
mov ax, MSG_VIS_TEXT_GET_LINE_FROM_OFFSET
call ObjCallInstanceNoLock
; dx:ax - line number
; cx:bp - offset of start of line
pop bp
;
; Get line height
;
call GetLineHeight ; ax <- line height
pop dx ; dx <- Y position of top of line
;
; Check if line height is larger that the printable page height
;
cmp ax, printableSize.XYS_height
ja done ; line height > page height
;
; Check if bottom of text line is on this page
;
add ax, dx ; ax <- bottom of line
mov cx, printAreaBottom
cmp ax, cx
jbe done ; bottom of line <= bottom of page
; So line is completely on
; this page.
;
; Check if top of line is on next page
;
; NOTE: This does not ever seem to happe. I think this check could
; be taken out.
;
cmp dx, cx
ja done ; top of line > bottom of page
; So line is completely on
; the next page
;
; Adjust printAreaBottom so text line is printed on next page
;
mov printAreaBottom, dx
done:
.leave
ret
CheckClippingTextAndSetPrintAreaBottom endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetLineHeight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns the height of a text line.
CALLED BY: (INTERNAL) CheckClippingTextAndSetPrintAreaBottom
PASS: *ds:si = Content Text Instance
dx:ax - line number
RETURN: ax - line height (ceiling of WBFixed)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 11/16/92 Initial version
lester 10/20/94 added line number as an argument
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetLineHeight proc near
uses cx, dx, di, bp
params local VisTextGetLineInfoParameters
lineInfo local LineInfo
.enter
EC < call AssertIsCText >
lea di, lineInfo
movdw params.VTGLIP_buffer, ssdi
mov params.VTGLIP_bsize, size lineInfo
movdw params.VTGLIP_line, dxax
push bp
lea bp, params
mov dx, ss
mov ax, MSG_VIS_TEXT_GET_LINE_INFO
call ObjCallInstanceNoLock
EC < ERROR_C LINE_DOES_NOT_EXIST >
pop bp
movwbf axcl, lineInfo.LI_hgt
ceilwbf axcl, ax ; ax <- ceiling of height
.leave
ret
GetLineHeight endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetPageMarginsAndSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the page margins and printableSize and other things.
CALLED BY: (INTERNAL) CTPrintContentText
PASS: *ds:si = Content Text Instance
ss:bp = Inheritable stack frame
RETURN: Set:
pageMargins
printableSize
textResized
oldTextSize
textHeight
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Get printable area.
Set document size.
Set document margins.
Change the width of the text object if it is wider than the
printable width.
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/17/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetPageMarginsAndSize proc near
uses ax,cx,dx,di
.enter inherit CTPrintContentText
EC < call AssertIsCText >
; set the doc size
push bp
mov ax, MSG_PRINT_CONTROL_GET_PAPER_SIZE
call CallPrintControl ; paper dimmensions -> cx, dx
pop bp
push bp
mov ax, MSG_PRINT_CONTROL_SET_DOC_SIZE
call CallPrintControl
pop bp
mov printableSize.XYS_width, cx ; incorrect size
mov printableSize.XYS_height, dx ; incorrect size
; Get the printer margins. Also set the document margins.
push bp
mov ax, MSG_PRINT_CONTROL_GET_PRINTER_MARGINS
mov dx, TRUE ; do set the doc margins
call CallPrintControl ;CKS margins => AX, CX, DX, BP
mov di, bp
pop bp
; Store the margins in a local variable.
mov pageMargins.R_left, ax
mov pageMargins.R_top, cx
mov pageMargins.R_right, dx
mov pageMargins.R_bottom, di
; Set the printable size.
add cx, di
sub printableSize.XYS_height, cx
add ax, dx
mov di, printableSize.XYS_width
sub di, ax
mov printableSize.XYS_width, di
; Get text object width and height.
push bp
mov ax, MSG_VIS_GET_SIZE
call ObjCallInstanceNoLock ; cx <- width, dx <- height
pop bp
; Check if text is wider than the printableSize
; di still printable width
mov textResized, BB_FALSE ; assume text width is OK
mov textHeight, dx ; assume text width is OK
cmp cx, di ; need to change width?
jbe textOkWidth
; Save old text size
mov textResized, BB_TRUE
mov oldTextSize.XYS_width, cx
mov oldTextSize.XYS_height, dx
; Change text width
mov cx, di
call ChangeTextWidth ; dx <- new height
mov textHeight, dx
textOkWidth:
.leave
ret
SetPageMarginsAndSize endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChangeTextWidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the width of the text object.
CALLED BY: (INTERNAL) SetPageMarginsAndSize, CTPrintContentText,
CTPrintStartPrinting
PASS: *ds:si - Content Text Instance
cx - desired text width
RETURN: dx - new text height
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChangeTextWidth proc near
uses ax,cx,bp
.enter
EC < call AssertIsCText >
; Compute the height for the new width
push cx
mov ax, MSG_VIS_TEXT_CALC_HEIGHT
clr dx ; dx must be 0
; cx is new width
call ObjCallInstanceNoLock ; dx <- calculated height
pop cx
push dx ; save new height
; Set the new real size
mov ax, MSG_VIS_SET_SIZE
; cx = new width
; dx = new height
call ObjCallInstanceNoLock
; Tell object that geometry has changed
mov ax, MSG_VIS_NOTIFY_GEOMETRY_VALID
call ObjCallInstanceNoLock
pop dx ; return new height
.leave
ret
ChangeTextWidth endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CallPrintControl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call the Print-Control object.
CALLED BY: (INTERNAL) CTPrintContentText, SetPageMarginsAndSize
PASS: ss:bp = Inheritable stack frame
<arguments for the message>
RETURN: <return values from message>
DESTROYED: <destroyed values from message>
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 10/26/92 Initial version
lester 10/17/94 added MF_FIXUP_DS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CallPrintControl proc near
.enter inherit CTPrintContentText
push di
mov di, mask MF_CALL or mask MF_FIXUP_DS
;;; callSendCommon label near
push bx, si
movdw bxsi, printControl
call ObjMessage
pop bx, si
pop di
.leave
ret
CallPrintControl endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetPageClipRect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clip all drawing to the current page.
CALLED BY: (INTERNAL) CTPrintContentText
PASS: di = GState to clip in
ss:bp = Inheritable stack frame
RETURN: nothing
DESTROYED: ax, bx, cx, dx
PSEUDO CODE/STRATEGY:
NOTE: We set the clip rectangle *before* any translations
are applied, so the clip area is always on the part
of the page that is being printed.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/18/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetPageClipRect proc near
uses si
.enter inherit CTPrintContentText
;
; Set the clip-rectangle
;
mov ax, pageMargins.R_left
mov bx, pageMargins.R_top
mov cx, ax
add cx, printableSize.XYS_width
mov dx, printAreaBottom
sub dx, printAreaTop ; calculate printArea height
add dx, bx ; add in the top margin
mov si, PCT_REPLACE ; Replace old clip-rect
call GrSetClipRect ; Clip to page
.leave
ret
SetPageClipRect endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TranslateToPage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Translate all drawing operations to be in the right place
CALLED BY: (INTERNAL) CTPrintContentText
PASS: ss:bp = Inheritable stack frame
di = GState to translate in
RETURN: nothing
DESTROYED: ax, bx, cx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
lester 10/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TranslateToPage proc near
.enter inherit CTPrintContentText
;
; Calculate Y translation
;
clr bx
mov ax, printAreaTop ; bx.ax = y pos of top of page
clr dx
mov cx, pageMargins.R_top
subdw bxax, dxcx ; account for top margin
; bx.ax <- Y translation
negdw bxax ; negate to translate the
; text up to the clipping rect
;
; Calculate X translation
;
clr dx
mov cx, pageMargins.R_left ; dx.cx <- X translation
; Do the translation
call GrApplyTranslationDWord ; Translate to the right spot
.leave
ret
TranslateToPage endp
ContentLibraryCode ends
| 25.232959 | 79 | 0.61527 |
bf34935c9a9b8615d61f41289f5293f989f48504 | 1,821 | asm | Assembly | programs/oeis/177/A177100.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/177/A177100.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/177/A177100.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A177100: Partial sums of round(n^2/9).
; 0,0,0,1,3,6,10,15,22,31,42,55,71,90,112,137,165,197,233,273,317,366,420,479,543,612,687,768,855,948,1048,1155,1269,1390,1518,1654,1798,1950,2110,2279,2457,2644,2840,3045,3260,3485,3720,3965,4221,4488,4766,5055,5355,5667,5991,6327,6675,7036,7410,7797,8197,8610,9037,9478,9933,10402,10886,11385,11899,12428,12972,13532,14108,14700,15308,15933,16575,17234,17910,18603,19314,20043,20790,21555,22339,23142,23964,24805,25665,26545,27445,28365,29305,30266,31248,32251,33275,34320,35387,36476,37587,38720,39876,41055,42257,43482,44730,46002,47298,48618,49962,51331,52725,54144,55588,57057,58552,60073,61620,63193,64793,66420,68074,69755,71463,73199,74963,76755,78575,80424,82302,84209,86145,88110,90105,92130,94185,96270,98386,100533,102711,104920,107160,109432,111736,114072,116440,118841,121275,123742,126242,128775,131342,133943,136578,139247,141951,144690,147464,150273,153117,155997,158913,161865,164853,167878,170940,174039,177175,180348,183559,186808,190095,193420,196784,200187,203629,207110,210630,214190,217790,221430,225110,228831,232593,236396,240240,244125,248052,252021,256032,260085,264181,268320,272502,276727,280995,285307,289663,294063,298507,302996,307530,312109,316733,321402,326117,330878,335685,340538,345438,350385,355379,360420,365508,370644,375828,381060,386340,391669,397047,402474,407950,413475,419050,424675,430350,436075,441851,447678,453556,459485,465465,471497,477581,483717,489905,496146,502440,508787,515187,521640,528147,534708,541323,547992,554716,561495,568329,575218
mov $14,$0
mov $16,$0
lpb $16,1
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
lpb $13,1
mov $0,$11
sub $13,1
sub $0,$13
mov $7,$0
mul $7,2
mov $1,$7
add $1,3
div $1,9
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
| 67.444444 | 1,497 | 0.769907 |
b0544225c74f9da85647530132fb95007e5c6859 | 318 | asm | Assembly | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_PrintString_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_PrintString_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_PrintString_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void __CALLEE__ sp1_PrintString_callee(struct sp1_pss *ps, uchar *s)
; 02.2008 aralbrec, Sprite Pack v3.0
; zxz81 hi-res version
SECTION code_clib
SECTION code_temp_sp1
PUBLIC sp1_PrintString_callee
EXTERN asm_sp1_PrintString
sp1_PrintString_callee:
pop hl
pop de
ex (sp),hl
jp asm_sp1_PrintString
| 16.736842 | 70 | 0.783019 |
224cc40c634094c03aa7c4acc4ac19b57cf3194d | 7,365 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1237.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1237.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1237.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 %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x10520, %rbx
nop
nop
and %r14, %r14
mov (%rbx), %dx
nop
nop
nop
nop
nop
add $15718, %r8
lea addresses_A_ht+0x1eb80, %rsi
nop
nop
nop
nop
nop
xor %rax, %rax
mov (%rsi), %bx
add $46139, %rax
lea addresses_UC_ht+0x1c3b0, %r8
and $60128, %rax
mov (%r8), %ebx
nop
nop
nop
and %rax, %rax
lea addresses_A_ht+0x12d80, %rsi
lea addresses_D_ht+0xae70, %rdi
nop
nop
nop
nop
sub $17967, %r14
mov $103, %rcx
rep movsl
dec %rsi
lea addresses_D_ht+0xae80, %rax
clflush (%rax)
nop
nop
nop
nop
xor $40705, %rcx
vmovups (%rax), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r8
nop
nop
nop
nop
mfence
lea addresses_WT_ht+0x11ad0, %r8
nop
add %rcx, %rcx
mov (%r8), %esi
nop
nop
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x5500, %rdi
sub %rdx, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, (%rdi)
nop
nop
xor %rdi, %rdi
lea addresses_A_ht+0xf980, %rax
dec %r8
movw $0x6162, (%rax)
cmp $436, %rsi
lea addresses_WT_ht+0xd380, %rsi
lea addresses_A_ht+0x14180, %rdi
clflush (%rsi)
nop
cmp %rbx, %rbx
mov $24, %rcx
rep movsq
nop
xor %rcx, %rcx
lea addresses_WC_ht+0x1ee90, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
inc %rsi
mov (%rbx), %r8w
nop
nop
nop
nop
nop
add %r8, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %rbp
push %rbx
push %rcx
push %rdx
push %rsi
// Store
mov $0xcd0, %rbx
nop
nop
inc %r12
movl $0x51525354, (%rbx)
nop
nop
nop
nop
sub %rbp, %rbp
// Store
lea addresses_D+0x9980, %rsi
nop
nop
nop
nop
nop
dec %rdx
mov $0x5152535455565758, %r12
movq %r12, (%rsi)
sub $35204, %r12
// Store
lea addresses_D+0xda80, %rsi
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov $0x5152535455565758, %rbx
movq %rbx, %xmm7
vmovups %ymm7, (%rsi)
sub %rbp, %rbp
// Store
lea addresses_D+0x5500, %rdx
nop
cmp %rbx, %rbx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
movups %xmm2, (%rdx)
add %rbx, %rbx
// Faulty Load
lea addresses_D+0x11d80, %rsi
nop
nop
nop
nop
nop
xor $14225, %rdx
movb (%rsi), %r10b
lea oracles, %rdx
and $0xff, %r10
shlq $12, %r10
mov (%rdx,%r10,1), %r10
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'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
*/
| 33.784404 | 2,999 | 0.651867 |
e2b0e915ca83a4eb0fc5059880427b28e1350f2a | 507 | asm | Assembly | dino/lcs/base/4DF.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/base/4DF.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/base/4DF.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
01DFA0 bset D0, ($4df,A5) [123p+ 2]
01DFA4 moveq #$0, D0 [base+4DF]
01DFAA cmp.b ($4df,A5), D0 [base+4DD]
01DFAE bne $1dfc0 [base+4DF]
01E072 move.b D0, ($4df,A5)
01E076 addq.b #2, ($d3,A6)
01E12E move.b D0, ($4df,A5)
01E132 addq.b #2, ($d3,A6)
01E30C move.b D0, ($4df,A5)
01E310 addq.b #2, ($d3,A6)
01E4D8 move.b D0, ($4df,A5)
01E4DC addq.b #2, ($d3,A6)
copyright zengfr site:http://github.com/zengfr/romhack
| 29.823529 | 54 | 0.619329 |
474e7b424f5e56daef5445ff62a2c2501a49d0a9 | 2,557 | asm | Assembly | ASM/helloworld.asm | TravorLZH/various-code | a80018a4034b7e4e9b986157554bf7eec9aadfe4 | [
"Unlicense"
] | null | null | null | ASM/helloworld.asm | TravorLZH/various-code | a80018a4034b7e4e9b986157554bf7eec9aadfe4 | [
"Unlicense"
] | null | null | null | ASM/helloworld.asm | TravorLZH/various-code | a80018a4034b7e4e9b986157554bf7eec9aadfe4 | [
"Unlicense"
] | null | null | null | ; Disassembly of file: helloworld.o
; Mon Sep 18 07:52:06 2017
; Mode: 32 bits
; Syntax: YASM/NASM
; Instruction set: 80386
global _main: function
extern _printf ; near
extern __alloca ; near
extern ___main ; near
SECTION .text align=1 execute ; section number 1, code
.text: ; Local function
_main:
push ebp ; 0000 _ 55
mov ebp, esp ; 0001 _ 89. E5
sub esp, 8 ; 0003 _ 83. EC, 08
and esp, 0FFFFFFF0H ; 0006 _ 83. E4, F0
mov eax, 0 ; 0009 _ B8, 00000000
add eax, 15 ; 000E _ 83. C0, 0F
add eax, 15 ; 0011 _ 83. C0, 0F
shr eax, 4 ; 0014 _ C1. E8, 04
shl eax, 4 ; 0017 _ C1. E0, 04
mov dword [ebp-4H], eax ; 001A _ 89. 45, FC
mov eax, dword [ebp-4H] ; 001D _ 8B. 45, FC
call __alloca ; 0020 _ E8, 00000000(rel)
call ___main ; 0025 _ E8, 00000000(rel)
mov dword [esp], ?_001 ; 002A _ C7. 04 24, 00000000(d)
call _printf ; 0031 _ E8, 00000000(rel)
mov eax, 0 ; 0036 _ B8, 00000000
leave ; 003B _ C9
ret ; 003C _ C3
nop ; 003D _ 90
nop ; 003E _ 90
nop ; 003F _ 90
SECTION .data align=1 noexecute ; section number 2, data
SECTION .bss align=1 noexecute ; section number 3, bss
SECTION .rdata align=1 noexecute ; section number 4, const
?_001: ; byte
db 48H, 65H, 6CH, 6CH, 6FH, 20H, 77H, 6FH ; 0000 _ Hello wo
db 72H, 6CH, 64H, 21H, 0AH, 00H, 00H, 00H ; 0008 _ rld!....
| 44.859649 | 88 | 0.336332 |
3f35636db312cb3b6b9712d2e673e226d8774195 | 399 | asm | Assembly | src/fs/NextAvalibleFileSlot.asm | beckadamtheinventor/BOSos | 42471126eb47517fc1beec15960b72a9cb76601b | [
"BSD-3-Clause"
] | 1 | 2019-07-21T20:51:38.000Z | 2019-07-21T20:51:38.000Z | src/fs/NextAvalibleFileSlot.asm | beckadamtheinventor/BOSos | 42471126eb47517fc1beec15960b72a9cb76601b | [
"BSD-3-Clause"
] | null | null | null | src/fs/NextAvalibleFileSlot.asm | beckadamtheinventor/BOSos | 42471126eb47517fc1beec15960b72a9cb76601b | [
"BSD-3-Clause"
] | null | null | null | ;find the next avalible file handle
;saves HL
;returns:
; DE = file slot handle pointer
; C = file slot
; Z flag set if success, else failed
fs_NextAvalibleFileSlot:
push hl
ld de,open_files_table
ld c,1
ld hl,8 ; length of file handle
.loop:
ld a,(de)
or a,a
jr z,.success
inc a
jr z,.fail
inc c
ex hl,de
add hl,de
ex hl,de
jr .loop
.success:
pop hl
ret
.fail:
pop hl
inc a
ret
| 12.870968 | 36 | 0.681704 |
67fe8de692e4ccb9edd25f49f6a7adcc4d17b28b | 410 | asm | Assembly | CS2610/problem1a.asm | shariefsmm/College-Codes | 8fac4a980f8c20978862f3a16446b7cdb550d95a | [
"MIT"
] | null | null | null | CS2610/problem1a.asm | shariefsmm/College-Codes | 8fac4a980f8c20978862f3a16446b7cdb550d95a | [
"MIT"
] | null | null | null | CS2610/problem1a.asm | shariefsmm/College-Codes | 8fac4a980f8c20978862f3a16446b7cdb550d95a | [
"MIT"
] | null | null | null | #problem1a.asm
.data
.text
.globl main
main:
li $t0, 0xf
li $t1, 0xf
li $t2, 0xf
li $t3, 0xf
li $t4, 0xf
li $t5, 0xf
li $t6, 0xf
li $t7, 0xf
li $t8, 0xf
li $t9, 0xf
li $s0, 0xa
li $s1, 0xa
li $s2, 0xa
li $s3, 0xa
li $s4, 0xa
li $s5, 0xa
li $s6, 0xa
li $s7, 0xa
move $s4, $t6
move $t5, $s7
li $v0, 10
syscall | 13.666667 | 17 | 0.458537 |
31d1f50acf81d79ea7f38af864fa7835c5183f1a | 4,339 | asm | Assembly | eurasia/services4/srvinit/devices/sgx/tasarestore.pds.asm | shaqfu786/GFX_Linux_DDK | f184ac914561fa100a5c92a488df777de8785f93 | [
"FSFAP"
] | 3 | 2020-03-13T23:37:00.000Z | 2021-09-03T06:34:04.000Z | eurasia/services4/srvinit/devices/sgx/tasarestore.pds.asm | zzpianoman/GFX_Linux_DDK | f184ac914561fa100a5c92a488df777de8785f93 | [
"FSFAP"
] | null | null | null | eurasia/services4/srvinit/devices/sgx/tasarestore.pds.asm | zzpianoman/GFX_Linux_DDK | f184ac914561fa100a5c92a488df777de8785f93 | [
"FSFAP"
] | 6 | 2015-02-05T03:01:01.000Z | 2021-07-24T01:07:18.000Z | /*****************************************************************************
Name : tasarestore.pds.asm
Title : PDS Assembly Code
Author : Imagination Technologies
Created : 01/01/2008
Copyright : 2007 by Imagination Technologies Limited. All rights reserved.
No part of this software, either material or conceptual
may be copied or distributed, transmitted, transcribed,
stored in a retrieval system or translated into any
human or computer language in any form by any means,
electronic, mechanical, manual or other-wise, or
disclosed to third parties without the express written
permission of Imagination Technologies Limited, HomePark
Industrial Estate, King's Langley, Hertfordshire,
WD4 8LZ, U.K.
Description : PDS program used to scheduling the USE program respondsible
for reloading the secondary attributes after a context switch
Program Type : PDS assembly language
Version : $Revision: 1.4 $
Modifications :
$Log: tasarestore.pds.asm $
******************************************************************************/
#include "sgxdefs.h"
#include "sgx_mkif.h"
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(SGX_FEATURE_USE_SA_COUNT_REGISTER)
/*!****************************************************************************
* Register declarations
******************************************************************************/
/* Constants */
data dword INPUT_DOUTU0;
data dword INPUT_DOUTU1;
data dword INPUT_DOUTU2;
#if 1 // SGX_SUPPORT_MASTER_ONLY_SWITCHING
data dword INPUT_DOUTD0;
data dword INPUT_DOUTD1;
data dword INPUT_DOUTD1_REMBLOCKS; /* DOUT1 for last DMA which may be less than full 16x 16 dwords */
data dword INPUT_DMABLOCKS; /* Number of complete 16x 16 dword SA blocks (>= 0) */
#endif
#if defined(FIX_HW_BRN_25339)
temp dword temp_ds1 = ds1[48];
#endif
#if 1 // SGX_SUPPORT_MASTER_ONLY_SWITCHING
/*
* Use DMA to load the attributes
*/
temp dword src_address;
temp dword loop_count;
temp dword dest_offset; /* dword offset into SA buffer */
temp dword dest_offset_copy;
temp dword dout1_word; /* dout1 config word */
temp dword dma_size; /* Size of DMA, typically 16 lines of 16 dwords */
temp dword dma_size_dw; /* Size of DMA in dwords */
/* Set up DMA source address */
mov32 src_address, INPUT_DOUTD0;
mov32 dout1_word, INPUT_DOUTD1;
mov32 dest_offset, 0;
/* Set up size of DMA (bytes) */
mov32 dma_size, SGX_UKERNEL_SA_BURST_SIZE;
shl dma_size_dw, dma_size, SGX_31425_DMA_NLINES_SHIFT;
shl dma_size, dma_size, (SGX_31425_DMA_NLINES_SHIFT+2);
/* Several DMAs may be necessary */
mov32 loop_count, INPUT_DMABLOCKS;
TASARestore_NextDMABlock:
/* Branch once all the full 16x16 dword blocks are done */
tstz p0, loop_count;
p0 bra TASARestore_CheckDMASubBlock;
/* Start the DMA */
movs doutd, src_address, dout1_word;
/* Increment base address */
add src_address, src_address, dma_size;
/* Increment attribute offset */
add dest_offset, dest_offset, dma_size_dw;
shl dest_offset, dest_offset, EURASIA_PDS_DOUTD1_AO_SHIFT;
and dout1_word, dout1_word, EURASIA_PDS_DOUTD1_AO_CLRMSK;
mov32 dest_offset_copy, dest_offset;
or dout1_word, dout1_word, dest_offset_copy;
sub loop_count, loop_count, 1;
bra TASARestore_NextDMABlock;
/*** End Loop ***/
TASARestore_CheckDMASubBlock:
/* Check if there's any SAs outstanding */
tstz p0, INPUT_DOUTD1_REMBLOCKS;
p0 bra TASARestore_NoDMASubBlock;
/* Use correct attribute buffer offset with new config word */
mov32 dout1_word, INPUT_DOUTD1_REMBLOCKS;
and dout1_word, dout1_word, EURASIA_PDS_DOUTD1_AO_CLRMSK;
mov32 dest_offset_copy, dest_offset;
or dout1_word, dout1_word, dest_offset_copy;
/* DMA in the remaining attribs */
movs doutd, src_address, dout1_word;
/*** End If ***/
TASARestore_NoDMASubBlock:
#endif
/*!****************************************************************************
* Issue the task to the USSE
******************************************************************************/
/* Issue USE task and exit */
movs doutu, INPUT_DOUTU0, INPUT_DOUTU1, INPUT_DOUTU2;
/* End of program */
halt;
#endif
/******************************************************************************
End of file (tastaterestorepds.asm)
******************************************************************************/
| 32.871212 | 101 | 0.648997 |
49826f0e79a7bb50fdbdc81c7f7bbbd9c2386e77 | 417 | asm | Assembly | assembler/test/divider.asm | dbajgoric/ARSC | 27a092305105ce68bde8d8bc61e42e0a69ad0fa1 | [
"BSD-3-Clause"
] | 3 | 2017-01-28T15:45:19.000Z | 2022-03-22T17:37:37.000Z | assembler/test/divider.asm | dbajgoric/ARSC | 27a092305105ce68bde8d8bc61e42e0a69ad0fa1 | [
"BSD-3-Clause"
] | null | null | null | assembler/test/divider.asm | dbajgoric/ARSC | 27a092305105ce68bde8d8bc61e42e0a69ad0fa1 | [
"BSD-3-Clause"
] | null | null | null | LDA DIVIDEND
STA A
BIP NEXT
BRU OUT
NEXT:
LDA DIVISOR
STA B
BIP INIT
BRU OUT
INIT:
LDA ZERO
STA QUOTIENT
LDA B
TCA
STA B
LOOP:
LDA B
ADD A
STA A
BIN FINISH
BIP OTHER
LDA QUOTIENT
ADD ONE
BRU OUT1
FINISH:
ADD DIVISOR
STA REMAINDER
BRU OUT1
OTHER:
LDA QUOTIENT
ADD ONE
STA QUOTIENT
BRU LOOP
OUT:
LDA ZERO
OUT1:
HLT
A BSS 1
B BSS 1
QUOTIENT BSS 1
REMAINDER BSS 1
DIVIDEND BSC 7569
DIVISOR BSC 67
ZERO BSC 0
ONE BSC 1
END | 9.065217 | 17 | 0.769784 |
5710195212695e8e35fddde32e51030ea2ecde27 | 412 | asm | Assembly | oeis/230/A230366.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/230/A230366.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/230/A230366.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A230366: Sum_{k=1..floor(n/2)} (k^2 mod n).
; Submitted by Christian Krause
; 0,1,1,1,5,8,7,6,12,25,22,19,39,42,35,28,68,69,76,65,91,110,92,74,125,169,144,147,203,190,186,152,242,289,245,201,333,342,286,270,410,413,430,363,420,460,423,340,490,575,578,585,689,666,605,546,760,841
add $0,1
mov $2,$0
div $0,2
lpb $0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
pow $3,2
mod $3,$2
add $1,$3
lpe
mov $0,$1
| 22.888889 | 202 | 0.623786 |
0e4edcb0336d6a577966d81575a2276ad77f8c25 | 376 | asm | Assembly | oeis/140/A140777.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/140/A140777.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/140/A140777.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A140777: a(n) = 2*prime(n) - 4.
; Submitted by Jamie Morken(s3)
; 0,2,6,10,18,22,30,34,42,54,58,70,78,82,90,102,114,118,130,138,142,154,162,174,190,198,202,210,214,222,250,258,270,274,294,298,310,322,330,342,354,358,378,382,390,394,418,442,450,454,462,474,478,498,510,522
mul $0,2
max $0,1
seq $0,173919 ; Numbers that are prime or one less than a prime.
sub $0,2
mul $0,2
| 37.6 | 207 | 0.68883 |
28e29d1edf6c003fd457ba4deb706774f2411ab0 | 397 | asm | Assembly | Lehrjahr_4/Modul_121/keyboard.asm | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 5 | 2015-05-19T14:26:53.000Z | 2016-06-24T17:03:03.000Z | Lehrjahr_4/Modul_121/keyboard.asm | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | null | null | null | Lehrjahr_4/Modul_121/keyboard.asm | severinkaderli/gibb | 5b4952cedacb3885ab4a0eb9fd6c1cab5674e3ee | [
"MIT"
] | 6 | 2015-05-26T06:25:05.000Z | 2020-04-30T07:25:30.000Z | CLO ; Close unwanted windows.
MOV BL,C0
Input:
IN 00 ; Wait for key press - Store it in AL.
MOV [BL],AL
CMP BL,FF
JZ Clear
INC BL
CMP AL,0D ; Was it the Enter key? (ASCII 0D)
JNZ Input ; No - jump back. Yes - end.
Clear:
CALL 30
MOV BL,C0
JMP Input
; Clear display
ORG 30
PUSHF
PUSH BL
MOV BL,C0
MOV AL,20
Loop:
MOV [BL],AL
INC BL
JNZ Loop
POP BL
POPF
RET
END
| 11.027778 | 46 | 0.632242 |
7a6c926c27deb5782a30cf7182a5d2e2498e627c | 1,014 | asm | Assembly | asm/doorrando.asm | codemann8/ALttPDoorRandomizer | b4a873755ec068418360c30481159090ca92bdb9 | [
"MIT"
] | 3 | 2021-08-06T14:14:42.000Z | 2022-01-23T19:45:35.000Z | asm/doorrando.asm | codemann8/ALttPDoorRandomizer | b4a873755ec068418360c30481159090ca92bdb9 | [
"MIT"
] | 2 | 2021-05-01T00:22:47.000Z | 2021-05-24T09:33:27.000Z | asm/doorrando.asm | codemann8/ALttPDoorRandomizer | b4a873755ec068418360c30481159090ca92bdb9 | [
"MIT"
] | 1 | 2021-06-22T01:23:05.000Z | 2021-06-22T01:23:05.000Z | !add = "clc : adc"
!addl = "clc : adc.l"
!sub = "sec : sbc"
!bge = "bcs"
!blt = "bcc"
; Free RAM notes
; Normal doors use $AB-AC for scrolling indicator
; Normal doors use $FE to store the trap door indicator
; Normal doors use $045e to store Y coordinate when transitioning to in-room stairs
; Normal doors use $045f to determine the order in which supertile quadrants are drawn
; Straight stairs use $046d to store X coordinate on animation start
; Spiral doors use $045e to store stair type
; Gfx uses $b1 to for sub-sub-sub-module thing
; Hooks into various routines
incsrc drhooks.asm
;Main Code
org $278000 ;138000
db $44, $52 ;DR
DRMode:
dw 0
DRFlags:
dw 0
DRScroll:
db 0
OffsetTable:
dw -8, 8
incsrc normal.asm
incsrc scroll.asm
incsrc spiral.asm
incsrc gfx.asm
incsrc keydoors.asm
incsrc overrides.asm
incsrc edges.asm
incsrc math.asm
incsrc hudadditions.asm
incsrc dr_lobby.asm
warnpc $279C00
incsrc doortables.asm
warnpc $288000
; deals with own hooks
incsrc keydropshuffle.asm
incsrc owrando.asm
| 20.693878 | 86 | 0.75641 |
b9eaf3ae310952b02bc44d4739c852f27402a9e1 | 219 | asm | Assembly | mp3/short.asm | Candy-Crusher/ece220 | 18001a82a46711b0451d37b3dd2c747f85abad69 | [
"MIT"
] | null | null | null | mp3/short.asm | Candy-Crusher/ece220 | 18001a82a46711b0451d37b3dd2c747f85abad69 | [
"MIT"
] | 1 | 2021-04-26T10:50:25.000Z | 2021-04-26T10:50:25.000Z | mp3/short.asm | Candy-Crusher/ece220 | 18001a82a46711b0451d37b3dd2c747f85abad69 | [
"MIT"
] | null | null | null | .ORIG x4800
.FILL x15 ; M W F
.FILL NAME1 ; "x1"
.FILL x0288 ; 9, 13, 15
.FILL x1C ; M Tu W
.FILL NAME2 ; "x2"
.FILL x0888 ; 9, 13, 17
.FILL #-1 ; end of list
NAME1 .STRINGZ "x1"
NAME2 .STRINGZ "x2"
.END
| 12.166667 | 24 | 0.570776 |
572c409de3b3db2d4ee1cbf13d934af209771362 | 2,256 | asm | Assembly | programs/oeis/142/A142962.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/142/A142962.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/142/A142962.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A142962: Scaled convolution of (n^3)*A000984(n) with A000984(n). A000984(n) = binomial(2*n,n) (central binomial coefficients).
; 4,26,81,184,350,594,931,1376,1944,2650,3509,4536,5746,7154,8775,10624,12716,15066,17689,20600,23814,27346,31211,35424,40000,44954,50301,56056,62234,68850,75919,83456,91476,99994,109025,118584,128686,139346,150579,162400,174824,187866,201541,215864,230850,246514,262871,279936,297724,316250,335529,355576,376406,398034,420475,443744,467856,492826,518669,545400,573034,601586,631071,661504,692900,725274,758641,793016,828414,864850,902339,940896,980536,1021274,1063125,1106104,1150226,1195506,1241959,1289600,1338444,1388506,1439801,1492344,1546150,1601234,1657611,1715296,1774304,1834650,1896349,1959416,2023866,2089714,2156975,2225664,2295796,2367386,2440449,2515000,2591054,2668626,2747731,2828384,2910600,2994394,3079781,3166776,3255394,3345650,3437559,3531136,3626396,3723354,3822025,3922424,4024566,4128466,4234139,4341600,4450864,4561946,4674861,4789624,4906250,5024754,5145151,5267456,5391684,5517850,5645969,5776056,5908126,6042194,6178275,6316384,6456536,6598746,6743029,6889400,7037874,7188466,7341191,7496064,7653100,7812314,7973721,8137336,8303174,8471250,8641579,8814176,8989056,9166234,9345725,9527544,9711706,9898226,10087119,10278400,10472084,10668186,10866721,11067704,11271150,11477074,11685491,11896416,12109864,12325850,12544389,12765496,12989186,13215474,13444375,13675904,13910076,14146906,14386409,14628600,14873494,15121106,15371451,15624544,15880400,16139034,16400461,16664696,16931754,17201650,17474399,17750016,18028516,18309914,18594225,18881464,19171646,19464786,19760899,20060000,20362104,20667226,20975381,21286584,21600850,21918194,22238631,22562176,22888844,23218650,23551609,23887736,24227046,24569554,24915275,25264224,25616416,25971866,26330589,26692600,27057914,27426546,27798511,28173824,28552500,28934554,29320001,29708856,30101134,30496850,30896019,31298656,31704776,32114394,32527525,32944184,33364386,33788146,34215479,34646400,35080924,35519066,35960841,36406264,36855350,37308114,37764571,38224736,38688624,39156250
mov $1,5
mov $2,$0
mov $3,4
lpb $0,1
sub $0,1
add $1,2
add $3,11
add $4,3
add $4,$3
add $1,$4
add $3,4
lpe
lpb $2,1
add $1,2
sub $2,1
lpe
sub $1,1
| 107.428571 | 1,960 | 0.83555 |
6c0196772d8aab63cc6ccefaf286dac81585b0c1 | 121 | asm | Assembly | lab3_test_harness/Lab1test/jsr.asm | Zaydax/PipelineProcessor | f45f7d1a245f291218d53a7f16fd7f98a50ce47e | [
"MIT"
] | 2 | 2017-03-05T17:40:26.000Z | 2017-03-15T01:41:25.000Z | lab3_test_harness/Lab1test/jsr.asm | Zaydax/PipelineProcessor | f45f7d1a245f291218d53a7f16fd7f98a50ce47e | [
"MIT"
] | null | null | null | lab3_test_harness/Lab1test/jsr.asm | Zaydax/PipelineProcessor | f45f7d1a245f291218d53a7f16fd7f98a50ce47e | [
"MIT"
] | null | null | null | .ORIG x3000
AND R0, R0, #0
ADD R0, R0, #5
LEA R7, B
JSR A
ADD R0, R0, #5
HALT
A ADD R0, R0, #5
RET
B HALT
.END
| 10.083333 | 17 | 0.553719 |
033c0c85b2b2805b87b1e7d8d17af3674c6b7aa7 | 7,685 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_708.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_708.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_708.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 %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xbb88, %rdx
sub %rdi, %rdi
movb (%rdx), %bl
nop
nop
nop
nop
xor $36443, %r11
lea addresses_D_ht+0x102b8, %rsi
lea addresses_A_ht+0xb488, %rdi
nop
nop
nop
nop
and %rbp, %rbp
mov $5, %rcx
rep movsw
nop
nop
nop
add $53383, %rbp
lea addresses_normal_ht+0x190c8, %rdx
nop
cmp %rbp, %rbp
movb (%rdx), %cl
nop
nop
xor $4580, %rbp
lea addresses_D_ht+0xd6c8, %rsi
lea addresses_normal_ht+0x3248, %rdi
clflush (%rsi)
add $35187, %r8
mov $53, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $25557, %rdx
lea addresses_A_ht+0x1acc8, %rdi
nop
nop
nop
nop
nop
cmp %rbp, %rbp
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x1cec8, %rcx
nop
nop
nop
nop
nop
add $7409, %rbp
mov (%rcx), %edx
nop
cmp %rbx, %rbx
lea addresses_UC_ht+0x6048, %rsi
lea addresses_normal_ht+0x15ac8, %rdi
nop
nop
nop
inc %rdx
mov $115, %rcx
rep movsw
nop
inc %r11
lea addresses_A_ht+0x132c8, %rsi
lea addresses_WC_ht+0x18658, %rdi
clflush (%rdi)
nop
sub %r8, %r8
mov $122, %rcx
rep movsb
and %rdx, %rdx
lea addresses_D_ht+0x19748, %rbp
nop
nop
nop
nop
sub $63189, %rbx
mov (%rbp), %rsi
nop
nop
nop
xor %rdx, %rdx
lea addresses_D_ht+0x1891d, %rcx
nop
nop
nop
nop
add $51573, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
movups %xmm3, (%rcx)
add $31853, %r11
lea addresses_WT_ht+0x15ce8, %rsi
lea addresses_UC_ht+0x16c8, %rdi
nop
nop
nop
cmp $5227, %rdx
mov $121, %rcx
rep movsq
nop
nop
nop
nop
and $8024, %rdi
lea addresses_A_ht+0x5ec8, %r11
nop
nop
nop
nop
sub $50262, %r8
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
and $0xffffffffffffffc0, %r11
movaps %xmm3, (%r11)
nop
nop
nop
nop
and $10464, %r8
lea addresses_WC_ht+0x1a08, %rsi
lea addresses_A_ht+0x2b48, %rdi
nop
nop
nop
nop
nop
dec %r8
mov $56, %rcx
rep movsq
nop
nop
nop
nop
xor $62169, %rcx
lea addresses_WT_ht+0x32e8, %rsi
lea addresses_WC_ht+0x1579f, %rdi
nop
nop
add $49417, %rdx
mov $57, %rcx
rep movsb
sub %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %r9
push %rbx
push %rsi
// Faulty Load
mov $0x28b30f0000000ec8, %r13
nop
nop
nop
and $23849, %r14
movups (%r13), %xmm4
vpextrq $0, %xmm4, %r8
lea oracles, %rsi
and $0xff, %r8
shlq $12, %r8
mov (%rsi,%r8,1), %r8
pop %rsi
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_A_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': True, 'AVXalign': True, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 0}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 33.70614 | 2,999 | 0.660117 |
68049cf6240ca0b638a41af11ee187857632fe4d | 4,919 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_390.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_390.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_390.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 %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1cbe7, %rsi
lea addresses_WT_ht+0x16637, %rdi
nop
nop
nop
dec %r14
mov $42, %rcx
rep movsl
nop
nop
nop
add $23412, %rax
lea addresses_A_ht+0x1cf7, %rsi
lea addresses_WC_ht+0x15683, %rdi
nop
nop
add $6749, %rbp
mov $80, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $39671, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %r9
push %rbp
push %rbx
push %rsi
// Store
lea addresses_UC+0x1e387, %r9
nop
cmp $16683, %rsi
movw $0x5152, (%r9)
and $31233, %rsi
// Store
lea addresses_UC+0x187bd, %r8
nop
nop
nop
nop
and %r10, %r10
mov $0x5152535455565758, %rsi
movq %rsi, %xmm7
movups %xmm7, (%r8)
nop
nop
nop
add $33850, %r14
// Faulty Load
lea addresses_UC+0x1e387, %r10
nop
nop
nop
add %rsi, %rsi
mov (%r10), %r8
lea oracles, %rbp
and $0xff, %r8
shlq $12, %r8
mov (%rbp,%r8,1), %r8
pop %rsi
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_UC', 'congruent': 0}}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC', 'congruent': 1}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'52': 21829}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 45.546296 | 2,999 | 0.660703 |
fe5218683b22cfdd2b515b545548e107c37896ac | 12,195 | asm | Assembly | MH6502-4/ASM/lcd.asm | FredericSegard/Micro-Hobbyist | 4074e5d91154db92efedda5952a58f48531b4cf3 | [
"MIT"
] | null | null | null | MH6502-4/ASM/lcd.asm | FredericSegard/Micro-Hobbyist | 4074e5d91154db92efedda5952a58f48531b4cf3 | [
"MIT"
] | null | null | null | MH6502-4/ASM/lcd.asm | FredericSegard/Micro-Hobbyist | 4074e5d91154db92efedda5952a58f48531b4cf3 | [
"MIT"
] | null | null | null | ; _ _ _ _ _ _
; | | ___ __| | ___ | | ___ __ _ _ __ __| | (_) ___ _ __ | | __ _ _ _
; | | / __| / _` | / __| | | / _ \ / _` | | '__| / _` | | | / __| | '_ \ | | / _` | | | | |
; | | | (__ | (_| | | (__ | | | __/ | (_| | | | | (_| | | | \__ \ | |_) | | | | (_| | | |_| |
; |_| \___| \__,_| _____ \___| |_| \___| \__,_| |_| _____ \__,_| |_| |___/ | .__/ |_| \__,_| \__, |
; |_____| |_____| |_| |___/
;
; Clears the LCD display
; ----------------------------------------------------------------------------------------------------------------------
lcd_clear_display:
pha
; ERASE PHYSICAL LCD
lda #$01 ; Clear display instruction (Write's $20 to DDRAM, and sets Address Counter to $00")
jsr lcd_instruction ; Send instruction to LCD
stz LCD_PTR ; Reset Virtual Address Counter
lcd_clear_display_end:
pla
rts
; _ _ _
; | | ___ __| | ___ _ _ _ __ ___ ___ _ __ | |__ ___ _ __ ___ ___
; | | / __| / _` | / __| | | | | | '__| / __| / _ \ | '__| | '_ \ / _ \ | '_ ` _ \ / _ \
; | | | (__ | (_| | | (__ | |_| | | | \__ \ | (_) | | | | | | | | (_) | | | | | | | | __/
; |_| \___| \__,_| _____ \___| \__,_| |_| |___/ \___/ |_| _____ |_| |_| \___/ |_| |_| |_| \___|
; |_____| |_____|
; Return cursor home. The contend of DDRAM are not changed
; ----------------------------------------------------------------------------------------------------------------------
lcd_cursor_home:
pha
lda #$80 ; Return Home: Set DDRAM Address to $00
jsr lcd_instruction ; Send instruction to LCD
stz LCD_PTR ; Reset virtual address counter to 0
pla
rts
; _ _
; | | ___ __| | ___ _ _ _ __ ___ ___ _ __ __ __ _ _
; | | / __| / _` | / __| | | | | | '__| / __| / _ \ | '__| \ \/ / | | | |
; | | | (__ | (_| | | (__ | |_| | | | \__ \ | (_) | | | > < | |_| |
; |_| \___| \__,_| _____ \___| \__,_| |_| |___/ \___/ |_| _____ /_/\_\ \__, |
; |_____| |_____| |___/
; Sets cursor to location x, y
; ----------------------------------------------------------------------------------------------------------------------
; INPUT: X and Y for the position on the screen (buffered)
; CHANGES: LCD_PTR (Virtual Address Counter)
lcd_cursor_xy:
pha
lcd_cursor_row:
cpy #0
beq lcd_cursor_row0
cpy #1
beq lcd_cursor_row1
lcd_cursor_row0:
ldy #0
bra lcd_cursor_col
lcd_cursor_row1:
ldy #40
lcd_cursor_col:
sty LCD_PTR
txa
clc
adc LCD_PTR
sta LCD_PTR
ora #$80
sta LCD_DATA ; Set DDRAM address
stz LCD_CTRL ; DI = 0, R/W = 0
nop
lda #LCD_E ; Activate enable pin
sta LCD_CTRL
nop
nop
stz LCD_CTRL
pla
rts
; _ _ _ _ _
; | | ___ __| | (_) _ __ (_) | |_
; | | / __| / _` | | | | '_ \ | | | __|
; | | | (__ | (_| | | | | | | | | | | |_
; |_| \___| \__,_| _____ |_| |_| |_| |_| \__|
; |_____|
; Initialize the LCD
; ----------------------------------------------------------------------------------------------------------------------
; The reset circuitry delay, using the DS1813, is 150ms. No need for the prescribed 40ms delay upon power up for the LCD
lcd_init:
lda #%11111000 ; Set LCD control pins on port A to outputs (E, RW, DI, CS2, CS1)
sta VIA2_DDRA
; EXECUTE WAKEUP SEQUENCE 4 TIMES
; -------------------------------
ldx #4
init_lcd_loop:
lda #$38 ; Function set to wake up LCD (8 bits, 2 lines)
sta LCD_DATA ; Push instruction on VIA data bus
lda #LCD_E ; Activate enable pin, implies instruction mode (0)
sta LCD_CTRL ;
nop ; Wait 2 cycles so LCD has the time to grap what's on LCD_DATA bus
stz LCD_CTRL ; Deactivate enable pin
lda #5 ; Wait 5ms
jsr millis ;
dex ; Decrement counter
bne init_lcd_loop ; If loop hasn'nt been executed 4 times, then loop again.
; FUNCTION SET
; ------------
lda #$38 ; Bit5: Function, Bit4: Data length (8), Bit3: Lines (2), Bit2: Font type (5x8)
jsr lcd_instruction
; CLEAR DISPLAY
; -------------
lda #%00000001 ; Bit0: Clear Display
jsr lcd_instruction
; CURSOR MOVE DIRECTION
; ---------------------
lda #%00000110 ; Bit2: Entry mode, Bit1: Inc/Dec AC (inc), Bit0: Shift Display (no shift)
jsr lcd_instruction
; DISPLAY ON/OFF, CURSOR, BLINKING
; --------------------------------
lda #%00001100 ; Bit3: Display on/off, Bit2: Display on, Bit1: Cursor off, Bit 0, Blinking off
jsr lcd_instruction
jsr lcd_clear_display ; Clear the physical AND virtual (buffer) display
rts
; _ _ _ _ _ _
; | | ___ __| | (_) _ __ ___ | |_ _ __ _ _ ___ | |_ (_) ___ _ __
; | | / __| / _` | | | | '_ \ / __| | __| | '__| | | | | / __| | __| | | / _ \ | '_ \
; | | | (__ | (_| | | | | | | | \__ \ | |_ | | | |_| | | (__ | |_ | | | (_) | | | | |
; |_| \___| \__,_| _____ |_| |_| |_| |___/ \__| |_| \__,_| \___| \__| |_| \___/ |_| |_|
; |_____|
; Send instruction to LCD (normal operations)
; -------------------------------------------
lcd_instruction:
pha
jsr lcd_wait ; Wait for LCD to be ready
sta LCD_DATA
lda #LCD_E ; Set Enable bit
sta LCD_CTRL
nop
stz LCD_CTRL ; Clear Enable bit
pla
rts
; _ _ _ _ _ _
; | | ___ __| | _ __ _ __ (_) _ __ | |_ | |__ _ _ | |_ ___
; | | / __| / _` | | '_ \ | '__| | | | '_ \ | __| | '_ \ | | | | | __| / _ \
; | | | (__ | (_| | | |_) | | | | | | | | | | |_ | |_) | | |_| | | |_ | __/
; |_| \___| \__,_| _____ | .__/ |_| |_| |_| |_| \__| _____ |_.__/ \__, | \__| \___|
; |_____| |_| |_____| |___/
; Prints a HEX representation of a byte on the LCD - Value in A
;-----------------------------------------------------------------------------------------------------------------------
lcd_print_byte:
pha
phx
phy
tax ; Store A for later use
lsr ; Move MSB nibble to LSB position
lsr ;
lsr ;
lsr ;
tay ; Index A for first nibble
lda hexascii,y ; Load ascii value according to index (see print_byte)
jsr lcd_print_char ; Print first nibble to terminal
txa ; Restore A
and #$0F ; Isolate LSB nibble
tay ; Index A for second nibble
lda hexascii,y ; Load ascii value according to index
jsr lcd_print_char ; Print second nibble to terminal
ply
plx
pla
rts
; _ _ _ _ _
; | | ___ __| | _ __ _ __ (_) _ __ | |_ ___ | |__ __ _ _ __
; | | / __| / _` | | '_ \ | '__| | | | '_ \ | __| / __| | '_ \ / _` | | '__|
; | | | (__ | (_| | | |_) | | | | | | | | | | |_ | (__ | | | | | (_| | | |
; |_| \___| \__,_| _____ | .__/ |_| |_| |_| |_| \__| _____ \___| |_| |_| \__,_| |_|
; |_____| |_| |_____|
; Write a character to physical LCD
; ----------------------------------------------------------------------------------------------------------------------
; INPUT: Character in A
lcd_print_char:
pha
jsr lcd_wait ; Wait for LCD to be ready
sta LCD_DATA ; Print character
lda #LCD_DI ; Set DI = 1, Write = 0
sta LCD_CTRL
nop
lda #(LCD_DI|LCD_E) ; Set E bit and DI bit
sta LCD_CTRL
nop
nop
stz LCD_CTRL ; Clear Enable bit and DI
inc LCD_PTR ;
pla
rts
; _ _ _ _ _ _ _ _
; | | ___ __| | _ __ _ __ (_) _ __ | |_ __| | __ _ | |_ ___ | |_ (_) _ __ ___ ___
; | | / __| / _` | | '_ \ | '__| | | | '_ \ | __| / _` | / _` | | __| / _ \ | __| | | | '_ ` _ \ / _ \
; | | | (__ | (_| | | |_) | | | | | | | | | | |_ | (_| | | (_| | | |_ | __/ | |_ | | | | | | | | | __/
; |_| \___| \__,_| _____ | .__/ |_| |_| |_| |_| \__| _____ \__,_| \__,_| \__| \___| \__| |_| |_| |_| |_| \___|
; |_____| |_| |_____|
; Prints date and time on the LCD
; ----------------------------------------------------------------------------------------------------------------------
lcd_print_datetime:
pha
lda RTC_YEAR
jsr lcd_print_byte
lda #"-"
jsr lcd_print_char
lda RTC_MONTH
jsr lcd_print_byte
lda #"-"
jsr lcd_print_char
lda RTC_DATE
jsr lcd_print_byte
lda #" "
jsr lcd_print_char
jsr lcd_print_char
lda RTC_HOURS
jsr lcd_print_byte
lda #":"
jsr lcd_print_char
lda RTC_MINUTES
jsr lcd_print_byte
lda #" "
jsr lcd_print_char
jsr lcd_print_char
pla
rts
; _ _ _ _ _ _
; | | ___ __| | _ __ _ __ (_) _ __ | |_ ___ | |_ _ __ (_) _ __ __ _
; | | / __| / _` | | '_ \ | '__| | | | '_ \ | __| / __| | __| | '__| | | | '_ \ / _` |
; | | | (__ | (_| | | |_) | | | | | | | | | | |_ \__ \ | |_ | | | | | | | | | (_| |
; |_| \___| \__,_| _____ | .__/ |_| |_| |_| |_| \__| _____ |___/ \__| |_| |_| |_| |_| \__, |
; |_____| |_| |_____| |___/
;
; Print a string of any length to the LCD
; ----------------------------------------------------------------------------------------------------------------------
; INPUT: Pass address of string in X (LOW BYTE) and Y (HIGH BYTE)
; VARIABLE: Using TEMP
lcd_print_string:
pha ; Save A
stx TEMP ; Store address LSB of the string to print
sty TEMP+1 ; Store address MSB of the string to print
ldy #0 ; Clear pointer
lcd_print_string_loop:
lda (TEMP),y ; Load character pointed by Y
beq lcd_print_string_end ; Once null character reached, end subroutine
jsr lcd_print_char ; Print character
iny ; Increment pointer
bne lcd_print_string_loop ; If pointer didn't roll over to 0, print next character
inc TEMP+1 ; Increment MSB to print a string longer then 256 characters
bra lcd_print_string_loop ; Go read more characters
lcd_print_string_end:
pla ; Restore A
rts ; Done
; _ _ _ _
; | | ___ __| | __ __ __ _ (_) | |_
; | | / __| / _` | \ \ /\ / / / _` | | | | __|
; | | | (__ | (_| | \ V V / | (_| | | | | |_
; |_| \___| \__,_| _____ \_/\_/ \__,_| |_| \__|
; |_____|
; Read LCD Busy Flag
; ----------------------------------------------------------------------------------------------------------------------
; INPUT: n/a
; OUTPUT: n/a
lcd_wait:
pha
lda #%00000000 ; Change port direction to input
sta VIA2_DDRB ;
lcd_wait_busy:
lda #LCD_RW ; Set read pin
sta LCD_CTRL ; Activate read pin
nop
lda #(LCD_RW|LCD_E) ; Set enable pin
sta LCD_CTRL ; Activate enable pin
nop
nop
lda LCD_DATA ; Read data from LCD
nop
stz LCD_CTRL ; Turn off Read and Enable bits
and #%10000000 ; Compare A to the Busy flag
bne lcd_wait_busy ; LCD still busy, loop again.
lda #%11111111 ; Set Port A direction to output
sta VIA2_DDRB ;
pla
rts | 35.245665 | 126 | 0.399344 |
d03e772f089ed75316bb55f96ad4a89676859d7b | 94 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_dmul_s.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_dmul_s.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_dmul_s.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC asm_dmul_s
EXTERN am48_dmul_s
defc asm_dmul_s = am48_dmul_s
| 10.444444 | 29 | 0.840426 |
56afcc024ed1a16a5039449611c7b8bdd351532e | 2,296 | asm | Assembly | tools/x-mode/pixel.asm | dvorka/naaga | dce26f9803816befd3185bec3ea43ecfe3ffcaad | [
"Apache-2.0"
] | 1 | 2015-04-06T17:49:02.000Z | 2015-04-06T17:49:02.000Z | tools/x-mode/pixel.asm | dvorka/naaga | dce26f9803816befd3185bec3ea43ecfe3ffcaad | [
"Apache-2.0"
] | null | null | null | tools/x-mode/pixel.asm | dvorka/naaga | dce26f9803816befd3185bec3ea43ecfe3ffcaad | [
"Apache-2.0"
] | null | null | null | .model small
public _PutPixelX
public _GetPixelX
SC_INDEX equ 03c4h ; sequencer port
MAP_MASK equ 02h ; index map mask registru
SCREEN_WIDTH equ 80 ; 80 * 4 rows = 320
SCREEN_SEG equ 0a000h
. data
parms struc ; structure parms
dw 2 dup (?) ; save BP and IP - without name
X dw ? ; pixel X position
Y dw ?
PageBase dw ? ; offset in video RAM
Color dw ?
parms ends
.code
;-----------------------------------------------------------------------------
;
; X - mode 320 x 240
;
; void PutPixelX( int X, int Y, unsigned int PageBase, int Color );
;
;-----------------------------------------------------------------------------
_PutPixelX proc near
push bp
mov bp, sp
; filling structure
mov ax, SCREEN_WIDTH
mul [bp+Y] ; addr of row
mov bx, [bp+X]
shr bx, 1
shr bx, 1 ; X/4 == offset in row
add bx, ax ; offset in page
add bx, [bp+PageBase] ; point in video RAM
mov ax, SCREEN_SEG
mov es, ax ; point is ES:bx
mov cl, byte ptr[bp+X] ;
and cl, 011b ; count number of row we will write to
mov ax, 0100+MAP_MASK ; index v SC na map mask registeru
shl ah, cl ; vypocteni bitu pro zapis do defin. vrstvy
mov dx, SC_INDEX ; nastaveni masky povolujici zapis
out dx, ax
mov al, byte ptr[bp+Color]
mov es:[bx], al
pop bp
ret
endp _PutPixelX
;-----------------------------------------------------------------------------
;
; X - mode 320 x 240
;
; unsigned int GetPixelX( int X, int Y, unsigned int PageBase );
;
;-----------------------------------------------------------------------------
GC_INDEX equ 03ceh ; Graphic controller port
READ_MAP equ 04h ; index v GC na the read map register
_GetPixelX proc near
push bp
mov bp, sp
mov ax, SCREEN_WIDTH
mul [bp+Y] ; count line number in page
mov bx, [bp+X]
shr bx, 1
shr bx, 1 ; X/4 = offset in row
add bx, ax ; offset in page
add bx, [bp+PageBase] ; point in video RAM
mov ax, SCREEN_SEG
mov es, ax
mov ah, byte ptr [bp+X]
and ah, 011b
mov al, READ_MAP
mov dx, GC_INDEX
out dx, ax
mov al, es:[bx]
sub ah, ah ; konversion to unsigned int!
pop bp
ret
_GetPixelX endp
end
| 21.660377 | 79 | 0.523084 |
c51001724f03bfce8b0eb8fe2b5363fb003f58ce | 4,927 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_61_2751.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_61_2751.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_61_2751.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x19913, %r11
nop
nop
nop
nop
cmp $37461, %rbp
movups (%r11), %xmm2
vpextrq $1, %xmm2, %r15
nop
sub $7705, %rax
lea addresses_UC_ht+0x1b683, %r11
and $64339, %r12
movl $0x61626364, (%r11)
nop
nop
and $16956, %rbp
lea addresses_normal_ht+0xf993, %rdx
cmp %rdi, %rdi
movups (%rdx), %xmm3
vpextrq $1, %xmm3, %r11
nop
nop
nop
nop
xor $46537, %rbp
lea addresses_A_ht+0x8b13, %rsi
lea addresses_D_ht+0x8b13, %rdi
nop
nop
nop
nop
nop
dec %rax
mov $40, %rcx
rep movsl
inc %r12
lea addresses_WC_ht+0x18feb, %rdi
nop
nop
nop
sub %rcx, %rcx
mov $0x6162636465666768, %r12
movq %r12, %xmm2
movups %xmm2, (%rdi)
nop
xor %rdi, %rdi
lea addresses_normal_ht+0x10313, %r15
clflush (%r15)
sub %rdx, %rdx
mov (%r15), %rdi
nop
nop
nop
xor $56771, %r15
lea addresses_WT_ht+0x14913, %r11
nop
nop
nop
xor %rdx, %rdx
movw $0x6162, (%r11)
nop
and %r15, %r15
lea addresses_UC_ht+0x18f3, %r12
nop
nop
nop
and $49172, %rax
movups (%r12), %xmm4
vpextrq $1, %xmm4, %rcx
nop
nop
add $61955, %rbp
lea addresses_D_ht+0x22b, %r11
cmp $31177, %rdi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm3
movups %xmm3, (%r11)
nop
nop
nop
nop
sub $33031, %rax
lea addresses_normal_ht+0x18ab3, %rsi
lea addresses_D_ht+0x10113, %rdi
nop
nop
nop
and $42074, %rbp
mov $85, %rcx
rep movsw
sub %r12, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %rax
push %rbx
push %rcx
push %rsi
// Store
lea addresses_A+0x41e3, %r12
nop
and $24991, %rbx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
vmovaps %ymm6, (%r12)
nop
nop
nop
nop
cmp %rax, %rax
// Store
mov $0xe13, %r10
nop
nop
nop
nop
sub $61748, %r13
movb $0x51, (%r10)
nop
nop
nop
nop
inc %r13
// Store
lea addresses_RW+0xe13, %rax
nop
nop
nop
xor $38050, %rsi
mov $0x5152535455565758, %r13
movq %r13, (%rax)
nop
nop
nop
nop
and $43187, %r13
// Load
lea addresses_A+0xcd15, %rax
and %rbx, %rbx
movups (%rax), %xmm7
vpextrq $1, %xmm7, %r10
nop
xor $31378, %r13
// Store
lea addresses_RW+0x1a513, %rbx
nop
xor %r13, %r13
movw $0x5152, (%rbx)
nop
nop
and $8380, %rcx
// Faulty Load
lea addresses_US+0x9913, %r13
nop
nop
nop
nop
xor $59624, %rsi
movups (%r13), %xmm2
vpextrq $1, %xmm2, %rax
lea oracles, %rsi
and $0xff, %rax
shlq $12, %rax
mov (%rsi,%rax,1), %rax
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'00': 61}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 21.515284 | 182 | 0.645017 |
5be2712d810dc84b3cd868451b20927a4b2e88b9 | 39,541 | asm | Assembly | mkdir.asm | gandharvm/xv6 | 70b0f0c44f698217fff0bf186748c25c2821b716 | [
"MIT-0"
] | null | null | null | mkdir.asm | gandharvm/xv6 | 70b0f0c44f698217fff0bf186748c25c2821b716 | [
"MIT-0"
] | null | null | null | mkdir.asm | gandharvm/xv6 | 70b0f0c44f698217fff0bf186748c25c2821b716 | [
"MIT-0"
] | null | null | null |
_mkdir: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 57 push %edi
e: 56 push %esi
f: 53 push %ebx
10: 51 push %ecx
11: bf 01 00 00 00 mov $0x1,%edi
16: 83 ec 08 sub $0x8,%esp
19: 8b 31 mov (%ecx),%esi
1b: 8b 59 04 mov 0x4(%ecx),%ebx
1e: 83 c3 04 add $0x4,%ebx
int i;
if(argc < 2){
21: 83 fe 01 cmp $0x1,%esi
24: 7e 3e jle 64 <main+0x64>
26: 8d 76 00 lea 0x0(%esi),%esi
29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
printf(2, "Usage: mkdir files...\n");
exit();
}
for(i = 1; i < argc; i++){
if(mkdir(argv[i]) < 0){
30: 83 ec 0c sub $0xc,%esp
33: ff 33 pushl (%ebx)
35: e8 00 03 00 00 call 33a <mkdir>
3a: 83 c4 10 add $0x10,%esp
3d: 85 c0 test %eax,%eax
3f: 78 0f js 50 <main+0x50>
for(i = 1; i < argc; i++){
41: 83 c7 01 add $0x1,%edi
44: 83 c3 04 add $0x4,%ebx
47: 39 fe cmp %edi,%esi
49: 75 e5 jne 30 <main+0x30>
printf(2, "mkdir: %s failed to create\n", argv[i]);
break;
}
}
exit();
4b: e8 82 02 00 00 call 2d2 <exit>
printf(2, "mkdir: %s failed to create\n", argv[i]);
50: 50 push %eax
51: ff 33 pushl (%ebx)
53: 68 67 07 00 00 push $0x767
58: 6a 02 push $0x2
5a: e8 d1 03 00 00 call 430 <printf>
break;
5f: 83 c4 10 add $0x10,%esp
62: eb e7 jmp 4b <main+0x4b>
printf(2, "Usage: mkdir files...\n");
64: 52 push %edx
65: 52 push %edx
66: 68 50 07 00 00 push $0x750
6b: 6a 02 push $0x2
6d: e8 be 03 00 00 call 430 <printf>
exit();
72: e8 5b 02 00 00 call 2d2 <exit>
77: 66 90 xchg %ax,%ax
79: 66 90 xchg %ax,%ax
7b: 66 90 xchg %ax,%ax
7d: 66 90 xchg %ax,%ax
7f: 90 nop
00000080 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
80: 55 push %ebp
81: 89 e5 mov %esp,%ebp
83: 53 push %ebx
84: 8b 45 08 mov 0x8(%ebp),%eax
87: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
8a: 89 c2 mov %eax,%edx
8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
90: 83 c1 01 add $0x1,%ecx
93: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
97: 83 c2 01 add $0x1,%edx
9a: 84 db test %bl,%bl
9c: 88 5a ff mov %bl,-0x1(%edx)
9f: 75 ef jne 90 <strcpy+0x10>
;
return os;
}
a1: 5b pop %ebx
a2: 5d pop %ebp
a3: c3 ret
a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000000b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 53 push %ebx
b4: 8b 55 08 mov 0x8(%ebp),%edx
b7: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
ba: 0f b6 02 movzbl (%edx),%eax
bd: 0f b6 19 movzbl (%ecx),%ebx
c0: 84 c0 test %al,%al
c2: 75 1c jne e0 <strcmp+0x30>
c4: eb 2a jmp f0 <strcmp+0x40>
c6: 8d 76 00 lea 0x0(%esi),%esi
c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
d0: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
d3: 0f b6 02 movzbl (%edx),%eax
p++, q++;
d6: 83 c1 01 add $0x1,%ecx
d9: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
dc: 84 c0 test %al,%al
de: 74 10 je f0 <strcmp+0x40>
e0: 38 d8 cmp %bl,%al
e2: 74 ec je d0 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
e4: 29 d8 sub %ebx,%eax
}
e6: 5b pop %ebx
e7: 5d pop %ebp
e8: c3 ret
e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
f0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
f2: 29 d8 sub %ebx,%eax
}
f4: 5b pop %ebx
f5: 5d pop %ebp
f6: c3 ret
f7: 89 f6 mov %esi,%esi
f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000100 <strlen>:
uint
strlen(char *s)
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
106: 80 39 00 cmpb $0x0,(%ecx)
109: 74 15 je 120 <strlen+0x20>
10b: 31 d2 xor %edx,%edx
10d: 8d 76 00 lea 0x0(%esi),%esi
110: 83 c2 01 add $0x1,%edx
113: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
117: 89 d0 mov %edx,%eax
119: 75 f5 jne 110 <strlen+0x10>
;
return n;
}
11b: 5d pop %ebp
11c: c3 ret
11d: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
120: 31 c0 xor %eax,%eax
}
122: 5d pop %ebp
123: c3 ret
124: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
12a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000130 <memset>:
void*
memset(void *dst, int c, uint n)
{
130: 55 push %ebp
131: 89 e5 mov %esp,%ebp
133: 57 push %edi
134: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
137: 8b 4d 10 mov 0x10(%ebp),%ecx
13a: 8b 45 0c mov 0xc(%ebp),%eax
13d: 89 d7 mov %edx,%edi
13f: fc cld
140: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
142: 89 d0 mov %edx,%eax
144: 5f pop %edi
145: 5d pop %ebp
146: c3 ret
147: 89 f6 mov %esi,%esi
149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000150 <strchr>:
char*
strchr(const char *s, char c)
{
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 53 push %ebx
154: 8b 45 08 mov 0x8(%ebp),%eax
157: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
15a: 0f b6 10 movzbl (%eax),%edx
15d: 84 d2 test %dl,%dl
15f: 74 1d je 17e <strchr+0x2e>
if(*s == c)
161: 38 d3 cmp %dl,%bl
163: 89 d9 mov %ebx,%ecx
165: 75 0d jne 174 <strchr+0x24>
167: eb 17 jmp 180 <strchr+0x30>
169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
170: 38 ca cmp %cl,%dl
172: 74 0c je 180 <strchr+0x30>
for(; *s; s++)
174: 83 c0 01 add $0x1,%eax
177: 0f b6 10 movzbl (%eax),%edx
17a: 84 d2 test %dl,%dl
17c: 75 f2 jne 170 <strchr+0x20>
return (char*)s;
return 0;
17e: 31 c0 xor %eax,%eax
}
180: 5b pop %ebx
181: 5d pop %ebp
182: c3 ret
183: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000190 <gets>:
char*
gets(char *buf, int max)
{
190: 55 push %ebp
191: 89 e5 mov %esp,%ebp
193: 57 push %edi
194: 56 push %esi
195: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
196: 31 f6 xor %esi,%esi
198: 89 f3 mov %esi,%ebx
{
19a: 83 ec 1c sub $0x1c,%esp
19d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
1a0: eb 2f jmp 1d1 <gets+0x41>
1a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
1a8: 8d 45 e7 lea -0x19(%ebp),%eax
1ab: 83 ec 04 sub $0x4,%esp
1ae: 6a 01 push $0x1
1b0: 50 push %eax
1b1: 6a 00 push $0x0
1b3: e8 32 01 00 00 call 2ea <read>
if(cc < 1)
1b8: 83 c4 10 add $0x10,%esp
1bb: 85 c0 test %eax,%eax
1bd: 7e 1c jle 1db <gets+0x4b>
break;
buf[i++] = c;
1bf: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
1c3: 83 c7 01 add $0x1,%edi
1c6: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
1c9: 3c 0a cmp $0xa,%al
1cb: 74 23 je 1f0 <gets+0x60>
1cd: 3c 0d cmp $0xd,%al
1cf: 74 1f je 1f0 <gets+0x60>
for(i=0; i+1 < max; ){
1d1: 83 c3 01 add $0x1,%ebx
1d4: 3b 5d 0c cmp 0xc(%ebp),%ebx
1d7: 89 fe mov %edi,%esi
1d9: 7c cd jl 1a8 <gets+0x18>
1db: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
1dd: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
1e0: c6 03 00 movb $0x0,(%ebx)
}
1e3: 8d 65 f4 lea -0xc(%ebp),%esp
1e6: 5b pop %ebx
1e7: 5e pop %esi
1e8: 5f pop %edi
1e9: 5d pop %ebp
1ea: c3 ret
1eb: 90 nop
1ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1f0: 8b 75 08 mov 0x8(%ebp),%esi
1f3: 8b 45 08 mov 0x8(%ebp),%eax
1f6: 01 de add %ebx,%esi
1f8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
1fa: c6 03 00 movb $0x0,(%ebx)
}
1fd: 8d 65 f4 lea -0xc(%ebp),%esp
200: 5b pop %ebx
201: 5e pop %esi
202: 5f pop %edi
203: 5d pop %ebp
204: c3 ret
205: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000210 <stat>:
int
stat(char *n, struct stat *st)
{
210: 55 push %ebp
211: 89 e5 mov %esp,%ebp
213: 56 push %esi
214: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
215: 83 ec 08 sub $0x8,%esp
218: 6a 00 push $0x0
21a: ff 75 08 pushl 0x8(%ebp)
21d: e8 f0 00 00 00 call 312 <open>
if(fd < 0)
222: 83 c4 10 add $0x10,%esp
225: 85 c0 test %eax,%eax
227: 78 27 js 250 <stat+0x40>
return -1;
r = fstat(fd, st);
229: 83 ec 08 sub $0x8,%esp
22c: ff 75 0c pushl 0xc(%ebp)
22f: 89 c3 mov %eax,%ebx
231: 50 push %eax
232: e8 f3 00 00 00 call 32a <fstat>
close(fd);
237: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
23a: 89 c6 mov %eax,%esi
close(fd);
23c: e8 b9 00 00 00 call 2fa <close>
return r;
241: 83 c4 10 add $0x10,%esp
}
244: 8d 65 f8 lea -0x8(%ebp),%esp
247: 89 f0 mov %esi,%eax
249: 5b pop %ebx
24a: 5e pop %esi
24b: 5d pop %ebp
24c: c3 ret
24d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
250: be ff ff ff ff mov $0xffffffff,%esi
255: eb ed jmp 244 <stat+0x34>
257: 89 f6 mov %esi,%esi
259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000260 <atoi>:
int
atoi(const char *s)
{
260: 55 push %ebp
261: 89 e5 mov %esp,%ebp
263: 53 push %ebx
264: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
267: 0f be 11 movsbl (%ecx),%edx
26a: 8d 42 d0 lea -0x30(%edx),%eax
26d: 3c 09 cmp $0x9,%al
n = 0;
26f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
274: 77 1f ja 295 <atoi+0x35>
276: 8d 76 00 lea 0x0(%esi),%esi
279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
280: 8d 04 80 lea (%eax,%eax,4),%eax
283: 83 c1 01 add $0x1,%ecx
286: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
28a: 0f be 11 movsbl (%ecx),%edx
28d: 8d 5a d0 lea -0x30(%edx),%ebx
290: 80 fb 09 cmp $0x9,%bl
293: 76 eb jbe 280 <atoi+0x20>
return n;
}
295: 5b pop %ebx
296: 5d pop %ebp
297: c3 ret
298: 90 nop
299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000002a0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
2a0: 55 push %ebp
2a1: 89 e5 mov %esp,%ebp
2a3: 56 push %esi
2a4: 53 push %ebx
2a5: 8b 5d 10 mov 0x10(%ebp),%ebx
2a8: 8b 45 08 mov 0x8(%ebp),%eax
2ab: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2ae: 85 db test %ebx,%ebx
2b0: 7e 14 jle 2c6 <memmove+0x26>
2b2: 31 d2 xor %edx,%edx
2b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
2b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
2bc: 88 0c 10 mov %cl,(%eax,%edx,1)
2bf: 83 c2 01 add $0x1,%edx
while(n-- > 0)
2c2: 39 d3 cmp %edx,%ebx
2c4: 75 f2 jne 2b8 <memmove+0x18>
return vdst;
}
2c6: 5b pop %ebx
2c7: 5e pop %esi
2c8: 5d pop %ebp
2c9: c3 ret
000002ca <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2ca: b8 01 00 00 00 mov $0x1,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <exit>:
SYSCALL(exit)
2d2: b8 02 00 00 00 mov $0x2,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <wait>:
SYSCALL(wait)
2da: b8 03 00 00 00 mov $0x3,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <pipe>:
SYSCALL(pipe)
2e2: b8 04 00 00 00 mov $0x4,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <read>:
SYSCALL(read)
2ea: b8 05 00 00 00 mov $0x5,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <write>:
SYSCALL(write)
2f2: b8 10 00 00 00 mov $0x10,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <close>:
SYSCALL(close)
2fa: b8 15 00 00 00 mov $0x15,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <kill>:
SYSCALL(kill)
302: b8 06 00 00 00 mov $0x6,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <exec>:
SYSCALL(exec)
30a: b8 07 00 00 00 mov $0x7,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <open>:
SYSCALL(open)
312: b8 0f 00 00 00 mov $0xf,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <mknod>:
SYSCALL(mknod)
31a: b8 11 00 00 00 mov $0x11,%eax
31f: cd 40 int $0x40
321: c3 ret
00000322 <unlink>:
SYSCALL(unlink)
322: b8 12 00 00 00 mov $0x12,%eax
327: cd 40 int $0x40
329: c3 ret
0000032a <fstat>:
SYSCALL(fstat)
32a: b8 08 00 00 00 mov $0x8,%eax
32f: cd 40 int $0x40
331: c3 ret
00000332 <link>:
SYSCALL(link)
332: b8 13 00 00 00 mov $0x13,%eax
337: cd 40 int $0x40
339: c3 ret
0000033a <mkdir>:
SYSCALL(mkdir)
33a: b8 14 00 00 00 mov $0x14,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <chdir>:
SYSCALL(chdir)
342: b8 09 00 00 00 mov $0x9,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <dup>:
SYSCALL(dup)
34a: b8 0a 00 00 00 mov $0xa,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <getpid>:
SYSCALL(getpid)
352: b8 0b 00 00 00 mov $0xb,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <sbrk>:
SYSCALL(sbrk)
35a: b8 0c 00 00 00 mov $0xc,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <sleep>:
SYSCALL(sleep)
362: b8 0d 00 00 00 mov $0xd,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <uptime>:
SYSCALL(uptime)
36a: b8 0e 00 00 00 mov $0xe,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <bstat>:
SYSCALL(bstat)
372: b8 16 00 00 00 mov $0x16,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <swap>:
SYSCALL(swap)
37a: b8 17 00 00 00 mov $0x17,%eax
37f: cd 40 int $0x40
381: c3 ret
382: 66 90 xchg %ax,%ax
384: 66 90 xchg %ax,%ax
386: 66 90 xchg %ax,%ax
388: 66 90 xchg %ax,%ax
38a: 66 90 xchg %ax,%ax
38c: 66 90 xchg %ax,%ax
38e: 66 90 xchg %ax,%ax
00000390 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
390: 55 push %ebp
391: 89 e5 mov %esp,%ebp
393: 57 push %edi
394: 56 push %esi
395: 53 push %ebx
396: 89 c6 mov %eax,%esi
398: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
39b: 8b 5d 08 mov 0x8(%ebp),%ebx
39e: 85 db test %ebx,%ebx
3a0: 74 7e je 420 <printint+0x90>
3a2: 89 d0 mov %edx,%eax
3a4: c1 e8 1f shr $0x1f,%eax
3a7: 84 c0 test %al,%al
3a9: 74 75 je 420 <printint+0x90>
neg = 1;
x = -xx;
3ab: 89 d0 mov %edx,%eax
neg = 1;
3ad: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
3b4: f7 d8 neg %eax
3b6: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
3b9: 31 ff xor %edi,%edi
3bb: 8d 5d d7 lea -0x29(%ebp),%ebx
3be: 89 ce mov %ecx,%esi
3c0: eb 08 jmp 3ca <printint+0x3a>
3c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
3c8: 89 cf mov %ecx,%edi
3ca: 31 d2 xor %edx,%edx
3cc: 8d 4f 01 lea 0x1(%edi),%ecx
3cf: f7 f6 div %esi
3d1: 0f b6 92 8c 07 00 00 movzbl 0x78c(%edx),%edx
}while((x /= base) != 0);
3d8: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
3da: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
3dd: 75 e9 jne 3c8 <printint+0x38>
if(neg)
3df: 8b 45 c4 mov -0x3c(%ebp),%eax
3e2: 8b 75 c0 mov -0x40(%ebp),%esi
3e5: 85 c0 test %eax,%eax
3e7: 74 08 je 3f1 <printint+0x61>
buf[i++] = '-';
3e9: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
3ee: 8d 4f 02 lea 0x2(%edi),%ecx
3f1: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi
3f5: 8d 76 00 lea 0x0(%esi),%esi
3f8: 0f b6 07 movzbl (%edi),%eax
write(fd, &c, 1);
3fb: 83 ec 04 sub $0x4,%esp
3fe: 83 ef 01 sub $0x1,%edi
401: 6a 01 push $0x1
403: 53 push %ebx
404: 56 push %esi
405: 88 45 d7 mov %al,-0x29(%ebp)
408: e8 e5 fe ff ff call 2f2 <write>
while(--i >= 0)
40d: 83 c4 10 add $0x10,%esp
410: 39 df cmp %ebx,%edi
412: 75 e4 jne 3f8 <printint+0x68>
putc(fd, buf[i]);
}
414: 8d 65 f4 lea -0xc(%ebp),%esp
417: 5b pop %ebx
418: 5e pop %esi
419: 5f pop %edi
41a: 5d pop %ebp
41b: c3 ret
41c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
x = xx;
420: 89 d0 mov %edx,%eax
neg = 0;
422: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
429: eb 8b jmp 3b6 <printint+0x26>
42b: 90 nop
42c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000430 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
430: 55 push %ebp
431: 89 e5 mov %esp,%ebp
433: 57 push %edi
434: 56 push %esi
435: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
436: 8d 45 10 lea 0x10(%ebp),%eax
{
439: 83 ec 2c sub $0x2c,%esp
for(i = 0; fmt[i]; i++){
43c: 8b 75 0c mov 0xc(%ebp),%esi
{
43f: 8b 7d 08 mov 0x8(%ebp),%edi
for(i = 0; fmt[i]; i++){
442: 89 45 d0 mov %eax,-0x30(%ebp)
445: 0f b6 1e movzbl (%esi),%ebx
448: 83 c6 01 add $0x1,%esi
44b: 84 db test %bl,%bl
44d: 0f 84 b0 00 00 00 je 503 <printf+0xd3>
453: 31 d2 xor %edx,%edx
455: eb 39 jmp 490 <printf+0x60>
457: 89 f6 mov %esi,%esi
459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
460: 83 f8 25 cmp $0x25,%eax
463: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
466: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
46b: 74 18 je 485 <printf+0x55>
write(fd, &c, 1);
46d: 8d 45 e2 lea -0x1e(%ebp),%eax
470: 83 ec 04 sub $0x4,%esp
473: 88 5d e2 mov %bl,-0x1e(%ebp)
476: 6a 01 push $0x1
478: 50 push %eax
479: 57 push %edi
47a: e8 73 fe ff ff call 2f2 <write>
47f: 8b 55 d4 mov -0x2c(%ebp),%edx
482: 83 c4 10 add $0x10,%esp
485: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
488: 0f b6 5e ff movzbl -0x1(%esi),%ebx
48c: 84 db test %bl,%bl
48e: 74 73 je 503 <printf+0xd3>
if(state == 0){
490: 85 d2 test %edx,%edx
c = fmt[i] & 0xff;
492: 0f be cb movsbl %bl,%ecx
495: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
498: 74 c6 je 460 <printf+0x30>
} else {
putc(fd, c);
}
} else if(state == '%'){
49a: 83 fa 25 cmp $0x25,%edx
49d: 75 e6 jne 485 <printf+0x55>
if(c == 'd'){
49f: 83 f8 64 cmp $0x64,%eax
4a2: 0f 84 f8 00 00 00 je 5a0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
4a8: 81 e1 f7 00 00 00 and $0xf7,%ecx
4ae: 83 f9 70 cmp $0x70,%ecx
4b1: 74 5d je 510 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
4b3: 83 f8 73 cmp $0x73,%eax
4b6: 0f 84 84 00 00 00 je 540 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4bc: 83 f8 63 cmp $0x63,%eax
4bf: 0f 84 ea 00 00 00 je 5af <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
4c5: 83 f8 25 cmp $0x25,%eax
4c8: 0f 84 c2 00 00 00 je 590 <printf+0x160>
write(fd, &c, 1);
4ce: 8d 45 e7 lea -0x19(%ebp),%eax
4d1: 83 ec 04 sub $0x4,%esp
4d4: c6 45 e7 25 movb $0x25,-0x19(%ebp)
4d8: 6a 01 push $0x1
4da: 50 push %eax
4db: 57 push %edi
4dc: e8 11 fe ff ff call 2f2 <write>
4e1: 83 c4 0c add $0xc,%esp
4e4: 8d 45 e6 lea -0x1a(%ebp),%eax
4e7: 88 5d e6 mov %bl,-0x1a(%ebp)
4ea: 6a 01 push $0x1
4ec: 50 push %eax
4ed: 57 push %edi
4ee: 83 c6 01 add $0x1,%esi
4f1: e8 fc fd ff ff call 2f2 <write>
for(i = 0; fmt[i]; i++){
4f6: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
4fa: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
4fd: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
4ff: 84 db test %bl,%bl
501: 75 8d jne 490 <printf+0x60>
}
}
}
503: 8d 65 f4 lea -0xc(%ebp),%esp
506: 5b pop %ebx
507: 5e pop %esi
508: 5f pop %edi
509: 5d pop %ebp
50a: c3 ret
50b: 90 nop
50c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 16, 0);
510: 83 ec 0c sub $0xc,%esp
513: b9 10 00 00 00 mov $0x10,%ecx
518: 6a 00 push $0x0
51a: 8b 5d d0 mov -0x30(%ebp),%ebx
51d: 89 f8 mov %edi,%eax
51f: 8b 13 mov (%ebx),%edx
521: e8 6a fe ff ff call 390 <printint>
ap++;
526: 89 d8 mov %ebx,%eax
528: 83 c4 10 add $0x10,%esp
state = 0;
52b: 31 d2 xor %edx,%edx
ap++;
52d: 83 c0 04 add $0x4,%eax
530: 89 45 d0 mov %eax,-0x30(%ebp)
533: e9 4d ff ff ff jmp 485 <printf+0x55>
538: 90 nop
539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
540: 8b 45 d0 mov -0x30(%ebp),%eax
543: 8b 18 mov (%eax),%ebx
ap++;
545: 83 c0 04 add $0x4,%eax
548: 89 45 d0 mov %eax,-0x30(%ebp)
s = "(null)";
54b: b8 83 07 00 00 mov $0x783,%eax
550: 85 db test %ebx,%ebx
552: 0f 44 d8 cmove %eax,%ebx
while(*s != 0){
555: 0f b6 03 movzbl (%ebx),%eax
558: 84 c0 test %al,%al
55a: 74 23 je 57f <printf+0x14f>
55c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
560: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
563: 8d 45 e3 lea -0x1d(%ebp),%eax
566: 83 ec 04 sub $0x4,%esp
569: 6a 01 push $0x1
s++;
56b: 83 c3 01 add $0x1,%ebx
write(fd, &c, 1);
56e: 50 push %eax
56f: 57 push %edi
570: e8 7d fd ff ff call 2f2 <write>
while(*s != 0){
575: 0f b6 03 movzbl (%ebx),%eax
578: 83 c4 10 add $0x10,%esp
57b: 84 c0 test %al,%al
57d: 75 e1 jne 560 <printf+0x130>
state = 0;
57f: 31 d2 xor %edx,%edx
581: e9 ff fe ff ff jmp 485 <printf+0x55>
586: 8d 76 00 lea 0x0(%esi),%esi
589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
write(fd, &c, 1);
590: 83 ec 04 sub $0x4,%esp
593: 88 5d e5 mov %bl,-0x1b(%ebp)
596: 8d 45 e5 lea -0x1b(%ebp),%eax
599: 6a 01 push $0x1
59b: e9 4c ff ff ff jmp 4ec <printf+0xbc>
printint(fd, *ap, 10, 1);
5a0: 83 ec 0c sub $0xc,%esp
5a3: b9 0a 00 00 00 mov $0xa,%ecx
5a8: 6a 01 push $0x1
5aa: e9 6b ff ff ff jmp 51a <printf+0xea>
5af: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
5b2: 83 ec 04 sub $0x4,%esp
5b5: 8b 03 mov (%ebx),%eax
5b7: 6a 01 push $0x1
5b9: 88 45 e4 mov %al,-0x1c(%ebp)
5bc: 8d 45 e4 lea -0x1c(%ebp),%eax
5bf: 50 push %eax
5c0: 57 push %edi
5c1: e8 2c fd ff ff call 2f2 <write>
5c6: e9 5b ff ff ff jmp 526 <printf+0xf6>
5cb: 66 90 xchg %ax,%ax
5cd: 66 90 xchg %ax,%ax
5cf: 90 nop
000005d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5d0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5d1: a1 2c 0a 00 00 mov 0xa2c,%eax
{
5d6: 89 e5 mov %esp,%ebp
5d8: 57 push %edi
5d9: 56 push %esi
5da: 53 push %ebx
5db: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5de: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
5e0: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5e3: 39 c8 cmp %ecx,%eax
5e5: 73 19 jae 600 <free+0x30>
5e7: 89 f6 mov %esi,%esi
5e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
5f0: 39 d1 cmp %edx,%ecx
5f2: 72 1c jb 610 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5f4: 39 d0 cmp %edx,%eax
5f6: 73 18 jae 610 <free+0x40>
{
5f8: 89 d0 mov %edx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5fa: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5fc: 8b 10 mov (%eax),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5fe: 72 f0 jb 5f0 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
600: 39 d0 cmp %edx,%eax
602: 72 f4 jb 5f8 <free+0x28>
604: 39 d1 cmp %edx,%ecx
606: 73 f0 jae 5f8 <free+0x28>
608: 90 nop
609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
610: 8b 73 fc mov -0x4(%ebx),%esi
613: 8d 3c f1 lea (%ecx,%esi,8),%edi
616: 39 d7 cmp %edx,%edi
618: 74 19 je 633 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
61a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
61d: 8b 50 04 mov 0x4(%eax),%edx
620: 8d 34 d0 lea (%eax,%edx,8),%esi
623: 39 f1 cmp %esi,%ecx
625: 74 23 je 64a <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
627: 89 08 mov %ecx,(%eax)
freep = p;
629: a3 2c 0a 00 00 mov %eax,0xa2c
}
62e: 5b pop %ebx
62f: 5e pop %esi
630: 5f pop %edi
631: 5d pop %ebp
632: c3 ret
bp->s.size += p->s.ptr->s.size;
633: 03 72 04 add 0x4(%edx),%esi
636: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
639: 8b 10 mov (%eax),%edx
63b: 8b 12 mov (%edx),%edx
63d: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
640: 8b 50 04 mov 0x4(%eax),%edx
643: 8d 34 d0 lea (%eax,%edx,8),%esi
646: 39 f1 cmp %esi,%ecx
648: 75 dd jne 627 <free+0x57>
p->s.size += bp->s.size;
64a: 03 53 fc add -0x4(%ebx),%edx
freep = p;
64d: a3 2c 0a 00 00 mov %eax,0xa2c
p->s.size += bp->s.size;
652: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
655: 8b 53 f8 mov -0x8(%ebx),%edx
658: 89 10 mov %edx,(%eax)
}
65a: 5b pop %ebx
65b: 5e pop %esi
65c: 5f pop %edi
65d: 5d pop %ebp
65e: c3 ret
65f: 90 nop
00000660 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
660: 55 push %ebp
661: 89 e5 mov %esp,%ebp
663: 57 push %edi
664: 56 push %esi
665: 53 push %ebx
666: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
669: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
66c: 8b 15 2c 0a 00 00 mov 0xa2c,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
672: 8d 78 07 lea 0x7(%eax),%edi
675: c1 ef 03 shr $0x3,%edi
678: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
67b: 85 d2 test %edx,%edx
67d: 0f 84 a3 00 00 00 je 726 <malloc+0xc6>
683: 8b 02 mov (%edx),%eax
685: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
688: 39 cf cmp %ecx,%edi
68a: 76 74 jbe 700 <malloc+0xa0>
68c: 81 ff 00 10 00 00 cmp $0x1000,%edi
692: be 00 10 00 00 mov $0x1000,%esi
697: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
69e: 0f 43 f7 cmovae %edi,%esi
6a1: ba 00 80 00 00 mov $0x8000,%edx
6a6: 81 ff ff 0f 00 00 cmp $0xfff,%edi
6ac: 0f 46 da cmovbe %edx,%ebx
6af: eb 10 jmp 6c1 <malloc+0x61>
6b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
6b8: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
6ba: 8b 48 04 mov 0x4(%eax),%ecx
6bd: 39 cf cmp %ecx,%edi
6bf: 76 3f jbe 700 <malloc+0xa0>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
6c1: 39 05 2c 0a 00 00 cmp %eax,0xa2c
6c7: 89 c2 mov %eax,%edx
6c9: 75 ed jne 6b8 <malloc+0x58>
p = sbrk(nu * sizeof(Header));
6cb: 83 ec 0c sub $0xc,%esp
6ce: 53 push %ebx
6cf: e8 86 fc ff ff call 35a <sbrk>
if(p == (char*)-1)
6d4: 83 c4 10 add $0x10,%esp
6d7: 83 f8 ff cmp $0xffffffff,%eax
6da: 74 1c je 6f8 <malloc+0x98>
hp->s.size = nu;
6dc: 89 70 04 mov %esi,0x4(%eax)
free((void*)(hp + 1));
6df: 83 ec 0c sub $0xc,%esp
6e2: 83 c0 08 add $0x8,%eax
6e5: 50 push %eax
6e6: e8 e5 fe ff ff call 5d0 <free>
return freep;
6eb: 8b 15 2c 0a 00 00 mov 0xa2c,%edx
if((p = morecore(nunits)) == 0)
6f1: 83 c4 10 add $0x10,%esp
6f4: 85 d2 test %edx,%edx
6f6: 75 c0 jne 6b8 <malloc+0x58>
return 0;
6f8: 31 c0 xor %eax,%eax
6fa: eb 1c jmp 718 <malloc+0xb8>
6fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
700: 39 cf cmp %ecx,%edi
702: 74 1c je 720 <malloc+0xc0>
p->s.size -= nunits;
704: 29 f9 sub %edi,%ecx
706: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
709: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
70c: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
70f: 89 15 2c 0a 00 00 mov %edx,0xa2c
return (void*)(p + 1);
715: 83 c0 08 add $0x8,%eax
}
}
718: 8d 65 f4 lea -0xc(%ebp),%esp
71b: 5b pop %ebx
71c: 5e pop %esi
71d: 5f pop %edi
71e: 5d pop %ebp
71f: c3 ret
prevp->s.ptr = p->s.ptr;
720: 8b 08 mov (%eax),%ecx
722: 89 0a mov %ecx,(%edx)
724: eb e9 jmp 70f <malloc+0xaf>
base.s.ptr = freep = prevp = &base;
726: c7 05 2c 0a 00 00 30 movl $0xa30,0xa2c
72d: 0a 00 00
730: c7 05 30 0a 00 00 30 movl $0xa30,0xa30
737: 0a 00 00
base.s.size = 0;
73a: b8 30 0a 00 00 mov $0xa30,%eax
73f: c7 05 34 0a 00 00 00 movl $0x0,0xa34
746: 00 00 00
749: e9 3e ff ff ff jmp 68c <malloc+0x2c>
| 33.969931 | 60 | 0.408892 |
2f6dac62b7b69694155b6588a3f986745f84c130 | 4,109 | asm | Assembly | Source/font6x8.asm | daltonmatos/avrgcc-mixed-with-avrasm2 | f28120af3089fdd150d7a609409c56f5408a1658 | [
"BSD-3-Clause"
] | 2 | 2019-01-15T16:30:19.000Z | 2019-08-15T02:31:22.000Z | Source/font6x8.asm | daltonmatos/avrgcc-mixed-with-avrasm2 | f28120af3089fdd150d7a609409c56f5408a1658 | [
"BSD-3-Clause"
] | null | null | null | Source/font6x8.asm | daltonmatos/avrgcc-mixed-with-avrasm2 | f28120af3089fdd150d7a609409c56f5408a1658 | [
"BSD-3-Clause"
] | null | null | null | .db 0x00,0x00,0x00,0x00,0x00,0x00 ;
.db 0x10,0xE3,0x84,0x10,0x01,0x00 ; !
.db 0x6D,0xB4,0x80,0x00,0x00,0x00 ; "
.db 0x00,0xA7,0xCA,0x29,0xF2,0x80 ; #
.db 0x20,0xE4,0x0C,0x09,0xC1,0x00 ; $
.db 0x65,0x90,0x84,0x21,0x34,0xC0 ; %
.db 0x21,0x45,0x08,0x55,0x23,0x40 ; &
.db 0x30,0xC2,0x00,0x00,0x00,0x00 ; '
.db 0x10,0x82,0x08,0x20,0x81,0x00 ; (
.db 0x20,0x41,0x04,0x10,0x42,0x00 ; )
.db 0x18,0x92,0x46,0x00,0x00,0x00 ; Custom degree symbol .db 0x00,0xA3,0x9F,0x38,0xA0,0x00 ; *
.db 0x00,0x41,0x1F,0x10,0x40,0x00 ; +
.db 0x00,0x00,0x00,0x00,0xC3,0x08 ; ,
.db 0x00,0x00,0x1F,0x00,0x00,0x00 ; -
.db 0x00,0x00,0x00,0x00,0xC3,0x00 ; .
.db 0x00,0x10,0x84,0x21,0x00,0x00 ; /
.db 0x39,0x14,0xD5,0x65,0x13,0x80 ; 0
.db 0x10,0xC1,0x04,0x10,0x43,0x80 ; 1
.db 0x39,0x10,0x46,0x21,0x07,0xC0 ; 2
.db 0x39,0x10,0x4E,0x05,0x13,0x80 ; 3
.db 0x08,0x62,0x92,0x7C,0x20,0x80 ; 4
.db 0x7D,0x04,0x1E,0x05,0x13,0x80 ; 5
.db 0x18,0x84,0x1E,0x45,0x13,0x80 ; 6
.db 0x7C,0x10,0x84,0x20,0x82,0x00 ; 7
.db 0x39,0x14,0x4E,0x45,0x13,0x80 ; 8
.db 0x39,0x14,0x4F,0x04,0x23,0x00 ; 9
.db 0x00,0x03,0x0C,0x00,0xC3,0x00 ; :
.db 0x00,0x03,0x0C,0x00,0xC3,0x08 ; ;
.db 0x00,0x07,0xCE,0x10,0x00,0x00 ; Custom triangle pointing down. .db 0x08,0x42,0x10,0x20,0x40,0x80 ; <
.db 0x00,0x07,0xC0,0x01,0xF0,0x00 ; =
.db 0x00,0x01,0x0E,0x7C,0x00,0x00 ; Custom triangle pointing up. .db 0x20,0x40,0x81,0x08,0x42,0x00 ; >
.db 0x39,0x10,0x46,0x10,0x01,0x00 ; ?
.db 0x00,0xE7,0xDF,0x7C,0xE0,0x00 ; Custom selection ball. .db 0x39,0x15,0xD5,0x5D,0x03,0x80 ; @
.db 0x39,0x14,0x51,0x7D,0x14,0x40 ; A
.db 0x79,0x14,0x5E,0x45,0x17,0x80 ; B
.db 0x39,0x14,0x10,0x41,0x13,0x80 ; C
.db 0x79,0x14,0x51,0x45,0x17,0x80 ; D
.db 0x7D,0x04,0x1E,0x41,0x07,0xC0 ; E
.db 0x7D,0x04,0x1E,0x41,0x04,0x00 ; F
.db 0x39,0x14,0x17,0x45,0x13,0xC0 ; G
.db 0x45,0x14,0x5F,0x45,0x14,0x40 ; H
.db 0x38,0x41,0x04,0x10,0x43,0x80 ; I
.db 0x04,0x10,0x41,0x45,0x13,0x80 ; J
.db 0x45,0x25,0x18,0x51,0x24,0x40 ; K
.db 0x41,0x04,0x10,0x41,0x07,0xC0 ; L
.db 0x45,0xB5,0x51,0x45,0x14,0x40 ; M
.db 0x45,0x95,0x53,0x45,0x14,0x40 ; N
.db 0x39,0x14,0x51,0x45,0x13,0x80 ; O
.db 0x79,0x14,0x5E,0x41,0x04,0x00 ; P
.db 0x39,0x14,0x51,0x55,0x23,0x40 ; Q
.db 0x79,0x14,0x5E,0x49,0x14,0x40 ; R
.db 0x39,0x14,0x0E,0x05,0x13,0x80 ; S
.db 0x7C,0x41,0x04,0x10,0x41,0x00 ; T
.db 0x45,0x14,0x51,0x45,0x13,0x80 ; U
.db 0x45,0x14,0x51,0x44,0xA1,0x00 ; V
.db 0x45,0x15,0x55,0x55,0x52,0x80 ; W
.db 0x45,0x12,0x84,0x29,0x14,0x40 ; X
.db 0x45,0x14,0x4A,0x10,0x41,0x00 ; Y
.db 0x78,0x21,0x08,0x41,0x07,0x80 ; Z
.db 0x38,0x82,0x08,0x20,0x83,0x80 ; [
.db 0x01,0x02,0x04,0x08,0x10,0x00 ; \
.db 0x38,0x20,0x82,0x08,0x23,0x80 ; ]
.db 0x10,0xA4,0x40,0x00,0x00,0x00 ; ^
.db 0x00,0x00,0x00,0x00,0x00,0x3F ; _
.db 0x30,0xC1,0x00,0x00,0x00,0x00 ; `
.db 0x00,0x03,0x81,0x3D,0x13,0xC0 ; a
.db 0x41,0x07,0x91,0x45,0x17,0x80 ; b
.db 0x00,0x03,0x91,0x41,0x13,0x80 ; c
.db 0x04,0x13,0xD1,0x45,0x13,0xC0 ; d
.db 0x00,0x03,0x91,0x79,0x03,0x80 ; e
.db 0x18,0x82,0x1E,0x20,0x82,0x00 ; f
.db 0x00,0x03,0xD1,0x44,0xF0,0x4E ; g
.db 0x41,0x07,0x12,0x49,0x24,0x80 ; h
.db 0x10,0x01,0x04,0x10,0x41,0x80 ; i
.db 0x08,0x01,0x82,0x08,0x24,0x8C ; j
.db 0x41,0x04,0x94,0x61,0x44,0x80 ; k
.db 0x10,0x41,0x04,0x10,0x41,0x80 ; l
.db 0x00,0x06,0x95,0x55,0x14,0x40 ; m
.db 0x00,0x07,0x12,0x49,0x24,0x80 ; n
.db 0x00,0x03,0x91,0x45,0x13,0x80 ; o
.db 0x00,0x07,0x91,0x45,0x17,0x90 ; p
.db 0x00,0x03,0xD1,0x45,0x13,0xC1 ; q
.db 0x00,0x05,0x89,0x20,0x87,0x00 ; r
.db 0x00,0x03,0x90,0x38,0x13,0x80 ; s
.db 0x00,0x87,0x88,0x20,0xA1,0x00 ; t
.db 0x00,0x04,0x92,0x49,0x62,0x80 ; u
.db 0x00,0x04,0x51,0x44,0xA1,0x00 ; v
.db 0x00,0x04,0x51,0x55,0xF2,0x80 ; w
.db 0x00,0x04,0x92,0x31,0x24,0x80 ; x
.db 0x00,0x04,0x92,0x48,0xE1,0x18 ; y
.db 0x00,0x07,0x82,0x31,0x07,0x80 ; z
.db 0x18,0x82,0x18,0x20,0x81,0x80 ; {
.db 0x10,0x41,0x00,0x10,0x41,0x00 ; |
.db 0x30,0x20,0x83,0x08,0x23,0x00 ; }
.db 0x29,0x40,0x00,0x00,0x00,0x00 ; ~
.db 0x10,0xE6,0xD1,0x45,0xF0,0x00 ;
| 41.928571 | 109 | 0.67194 |
f7b22ac824083910092c2842461179981a53b62a | 11,558 | asm | Assembly | game/data/tilesets/magma.asm | benoitryder/super-tilt-bro | 8d5035f54e906a401d0808c2e104d32fa1fadd7f | [
"WTFPL"
] | 91 | 2017-08-06T18:30:13.000Z | 2022-02-17T00:26:45.000Z | game/data/tilesets/magma.asm | pompshuffle/super-tilt-bro | d0f836290223085d7794c445c696e1c644c674d2 | [
"WTFPL"
] | 2 | 2018-10-12T04:34:13.000Z | 2021-12-25T17:01:18.000Z | game/data/tilesets/magma.asm | pompshuffle/super-tilt-bro | d0f836290223085d7794c445c696e1c644c674d2 | [
"WTFPL"
] | 9 | 2016-10-08T21:24:37.000Z | 2022-02-05T00:13:31.000Z | TILESET_MAGMA_BANK_NUMBER = CURRENT_BANK_NUMBER
tileset_magma:
; Tileset's size in tiles (zero means 256)
.byt $32
TILESET_MAGMA_0 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
TILESET_MAGMA_1 = (*-(tileset_magma+1))/16
.byt %11010101, %11101011, %11010111, %11101111, %11110111, %11111111, %11111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_2 = (*-(tileset_magma+1))/16
.byt %01111110, %00111100, %00111100, %00011000, %00011000, %10000000, %01000001, %10100010
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_3 = (*-(tileset_magma+1))/16
.byt %00000000, %00001000, %00011100, %01111110, %01111111, %11111111, %11111111, %11111111
.byt %00011000, %00010100, %01100010, %10000001, %10000000, %00000000, %01111110, %11111111
TILESET_MAGMA_4 = (*-(tileset_magma+1))/16
.byt %00000001, %00000111, %00011110, %00111011, %01111111, %11101111, %11110110, %01011010
.byt %00000001, %00000011, %00011101, %00111101, %01111011, %11110111, %11101111, %11100111
TILESET_MAGMA_5 = (*-(tileset_magma+1))/16
.byt %00110000, %01111000, %11111110, %10101100, %11111101, %01100101, %11111011, %11110111
.byt %11101000, %11110100, %00110000, %11011110, %10011110, %10011110, %00110100, %01111000
TILESET_MAGMA_6 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00011010, %00110101, %01101111
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00011100, %00111010, %01111100
TILESET_MAGMA_7 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00110000, %01111000, %11111000, %10001101, %01011011, %11011011
.byt %00000000, %00000000, %00111000, %01111100, %11111110, %11110010, %11101100, %11111100
TILESET_MAGMA_8 = (*-(tileset_magma+1))/16
.byt %11111111, %01111111, %00011111, %00000000, %01111111, %00111111, %00011111, %00001111
.byt %11111111, %11111111, %11111111, %01111111, %00000000, %00000000, %00000000, %00000000
TILESET_MAGMA_9 = (*-(tileset_magma+1))/16
.byt %11111111, %11111111, %11111111, %00000000, %01000000, %11101111, %11111111, %11111110
.byt %11111111, %11111111, %11111111, %11111111, %10111111, %00010000, %00000000, %00000000
TILESET_MAGMA_10 = (*-(tileset_magma+1))/16
.byt %11111111, %11111111, %11111111, %11111100, %00000000, %11000001, %11111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %00111110, %00000000, %00000000
TILESET_MAGMA_11 = (*-(tileset_magma+1))/16
.byt %11111111, %11111110, %11111100, %00000000, %01100011, %11111110, %11111110, %00111110
.byt %11111111, %11111111, %11111111, %11111111, %10011100, %00000000, %00000000, %00000000
TILESET_MAGMA_12 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00100000, %00000000, %00000000, %00000110, %00000011, %00000011
.byt %00000000, %01000011, %00000111, %00000111, %00000110, %00111000, %01101000, %01000000
TILESET_MAGMA_13 = (*-(tileset_magma+1))/16
.byt %00000000, %00001000, %00000000, %00000010, %00000010, %00000011, %00000011, %00000111
.byt %11100000, %11110000, %11111000, %11110000, %10100000, %01000000, %00000000, %00000000
TILESET_MAGMA_14 = (*-(tileset_magma+1))/16
.byt %00001111, %10001111, %11111111, %11111100, %11111100, %11110000, %11100000, %00000000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
TILESET_MAGMA_15 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %01100000, %01110000, %11010000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %01010000, %01100000, %11101000
TILESET_MAGMA_16 = (*-(tileset_magma+1))/16
.byt %01011100, %00110011, %00100001, %01110000, %01111000, %00111111, %00001111, %00000000
.byt %00000000, %00001100, %00010100, %00001000, %00000000, %00000000, %00000000, %00000000
TILESET_MAGMA_17 = (*-(tileset_magma+1))/16
.byt %11101111, %01111100, %11111010, %11010100, %11101000, %00000000, %00000000, %00000000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
TILESET_MAGMA_18 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00000000, %00000000, %00101011, %01010011, %01111110, %00011100
.byt %00111100, %01101110, %01110110, %11100000, %10000000, %00000000, %00000000, %00000000
TILESET_MAGMA_19 = (*-(tileset_magma+1))/16
.byt %00010000, %00011000, %10010000, %11110000, %01100000, %11100000, %10100000, %00000000
.byt %01100011, %11000111, %00001110, %00001101, %00011010, %00010001, %01000000, %01000000
TILESET_MAGMA_20 = (*-(tileset_magma+1))/16
.byt %00000000, %00100000, %00110000, %01010000, %10110000, %11100000, %10000000, %00000000
.byt %10000000, %00000000, %00000000, %00000000, %00000000, %00011000, %01111110, %10001110
TILESET_MAGMA_21 = (*-(tileset_magma+1))/16
.byt %00110000, %01111000, %11111110, %10101101, %11111101, %01100101, %11111011, %11110111
.byt %11101000, %11110100, %00110000, %11011110, %10011110, %10011110, %00110100, %01111000
TILESET_MAGMA_22 = (*-(tileset_magma+1))/16
.byt %00011011, %00011111, %00000111, %00000011, %00001101, %00111100, %00011000, %00000000
.byt %00000000, %00000000, %00110000, %01100000, %00100000, %00000000, %00000000, %00000000
TILESET_MAGMA_23 = (*-(tileset_magma+1))/16
.byt %01111111, %01111111, %10011111, %11001111, %11100000, %11111001, %11111111, %11111111
.byt %11111111, %11111111, %01111111, %00111111, %00011111, %00000110, %00000000, %00000000
TILESET_MAGMA_24 = (*-(tileset_magma+1))/16
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %00111110, %11000000, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00111111, %00000000
TILESET_MAGMA_25 = (*-(tileset_magma+1))/16
.byt %11111111, %11111111, %11111111, %11000011, %00000001, %00111100, %01111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11000011, %10000000, %00000000
TILESET_MAGMA_26 = (*-(tileset_magma+1))/16
.byt %11111110, %11111110, %11111001, %11110011, %11000111, %00001111, %11111111, %11111111
.byt %11111111, %11111111, %11111110, %11111100, %11111000, %11110000, %00000000, %00000000
TILESET_MAGMA_27 = (*-(tileset_magma+1))/16
.byt %11100000, %11100110, %11110100, %11110000, %11100000, %11000000, %11011100, %11011000
.byt %00011111, %00011001, %00001011, %00001111, %00011111, %00111111, %00100011, %00100111
TILESET_MAGMA_28 = (*-(tileset_magma+1))/16
.byt %11111111, %01110111, %10101010, %00000101, %00000000, %00000000, %00000000, %00000000
.byt %00000000, %10001000, %01010101, %11111010, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_29 = (*-(tileset_magma+1))/16
.byt %11101011, %11010101, %10101010, %01000001, %00000000, %00000000, %00000000, %00000000
.byt %00010100, %00101010, %01010101, %10111110, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_30 = (*-(tileset_magma+1))/16
.byt %00111100, %01101110, %01110110, %11100000, %10101011, %01010011, %01111110, %00011100
.byt %11111111, %11111111, %11111111, %11111111, %11010100, %10101100, %10000001, %11100011
TILESET_MAGMA_31 = (*-(tileset_magma+1))/16
.byt %00000111, %01100111, %00101111, %00001111, %00000111, %00000011, %00111011, %00011011
.byt %11111000, %10011000, %11010000, %11110000, %11111000, %11111100, %11000100, %11100100
TILESET_MAGMA_32 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00000000, %00000000, %00101000, %01010101, %10101010, %11111111
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
TILESET_MAGMA_33 = (*-(tileset_magma+1))/16
.byt %11000000, %11100000, %11110100, %11100110, %11110000, %11110000, %11101100, %11001000
.byt %00111111, %00011111, %00001011, %00011001, %00001111, %00001111, %00010011, %00110111
TILESET_MAGMA_34 = (*-(tileset_magma+1))/16
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_35 = (*-(tileset_magma+1))/16
.byt %01110011, %11011111, %10011110, %11111101, %01111010, %11110001, %11100000, %01000000
.byt %11101111, %11100111, %01101111, %00001111, %10011111, %00011111, %01011111, %11111111
TILESET_MAGMA_36 = (*-(tileset_magma+1))/16
.byt %11100000, %11111000, %11111000, %11110010, %10100010, %01000011, %00000011, %00000111
.byt %11111111, %11110111, %11111111, %11111101, %11111101, %11111100, %11111100, %11111000
TILESET_MAGMA_37 = (*-(tileset_magma+1))/16
.byt %00000000, %01000011, %00100111, %00000111, %00000110, %00111110, %01101011, %01000011
.byt %11111111, %11111111, %11011111, %11111111, %11111111, %11111001, %11111100, %11111100
TILESET_MAGMA_38 = (*-(tileset_magma+1))/16
.byt %10000000, %00100000, %00110000, %01010000, %10110000, %11111000, %11111110, %10001110
.byt %11111111, %11011111, %11001111, %10101111, %01001111, %00011111, %01111111, %11111111
TILESET_MAGMA_39 = (*-(tileset_magma+1))/16
.byt %00000011, %00000111, %00101111, %01100111, %00001111, %00001111, %00110111, %00010011
.byt %11111100, %11111000, %11010000, %10011000, %11110000, %11110000, %11001000, %11101100
TILESET_MAGMA_40 = (*-(tileset_magma+1))/16
.byt %00000000, %10101010, %01010101, %10101110, %01011111, %11111011, %10110101, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_41 = (*-(tileset_magma+1))/16
.byt %01011100, %00111111, %00110101, %01111000, %01111000, %00111111, %00001111, %00000000
.byt %10100011, %11001100, %11011110, %10001111, %10000111, %11000000, %11110000, %11111111
TILESET_MAGMA_42 = (*-(tileset_magma+1))/16
.byt %00001111, %10001111, %11111111, %11111100, %11111100, %11110000, %11100000, %00000000
.byt %11110000, %01110000, %00000000, %00000011, %00000011, %00001111, %00011111, %11111111
TILESET_MAGMA_43 = (*-(tileset_magma+1))/16
.byt %11101111, %01111100, %11111010, %11010100, %11101000, %00000000, %00000000, %00000000
.byt %00010000, %10000011, %00000101, %00101011, %00010111, %11111111, %11111111, %11111111
TILESET_MAGMA_44 = (*-(tileset_magma+1))/16
.byt %00011011, %00011111, %00110111, %01100011, %00101101, %00111100, %00011000, %00000000
.byt %11100100, %11100000, %11111000, %11111100, %11110010, %11000011, %11100111, %11111111
TILESET_MAGMA_45 = (*-(tileset_magma+1))/16
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
TILESET_MAGMA_46 = (*-(tileset_magma+1))/16
.byt %00000111, %00011110, %00110101, %01101011, %11010101, %10101001, %11011111, %10100111
.byt %11111111, %11111111, %11111111, %11111110, %11111110, %11111110, %11110001, %11111001
TILESET_MAGMA_47 = (*-(tileset_magma+1))/16
.byt %11111000, %10001100, %00100010, %10100010, %11110101, %11111001, %11111001, %01111111
.byt %11000111, %11110011, %11111101, %11011101, %00011010, %11100110, %10101110, %10010000
TILESET_MAGMA_48 = (*-(tileset_magma+1))/16
.byt %11010011, %10100001, %10000010, %10000101, %11000011, %01000011, %01001111, %00111000
.byt %11111100, %11111110, %11111101, %01111010, %00111100, %10111100, %10110000, %11000111
TILESET_MAGMA_49 = (*-(tileset_magma+1))/16
.byt %00100111, %10101011, %11010110, %11111100, %11111000, %11100000, %00000000, %00000000
.byt %11011000, %01010100, %00101001, %00000011, %00000111, %00011111, %11111111, %11111111
| 55.567308 | 91 | 0.725298 |
1844af6b0503aa2d25df567f058b9d616ba68d58 | 16,016 | asm | Assembly | src/test/ref/examples/c64/rotate/rotate.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/examples/c64/rotate/rotate.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/examples/c64/rotate/rotate.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // 2D rotattion of 8 sprites
// Commodore 64 PRG executable file
.file [name="rotate.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
/// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
/// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.const GREEN = 5
.const LIGHT_BLUE = $e
/// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
/// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10
/// Sprite X position register for sprite #0
.label SPRITES_XPOS = $d000
/// Sprite Y position register for sprite #0
.label SPRITES_YPOS = $d001
/// Sprite colors register for sprite #0
.label SPRITES_COLOR = $d027
/// The VIC-II MOS 6567/6569
.label VICII = $d000
/// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
/// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
.label SCREEN = $400
.label COS = SIN+$40
.segment Code
// sin(x) = cos(x+PI/2)
main: {
// asm
sei
// init()
jsr init
// anim()
jsr anim
// }
rts
}
init: {
.label sprites_ptr = SCREEN+$3f8
// mulf_init()
jsr mulf_init
// VICII->SPRITES_ENABLE = %11111111
lda #$ff
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
ldx #0
__b1:
// sprites_ptr[i] = (char)(SPRITE/$40)
lda #$ff&SPRITE/$40
sta sprites_ptr,x
// SPRITES_COLOR[i] = GREEN
lda #GREEN
sta SPRITES_COLOR,x
// for(char i: 0..7)
inx
cpx #8
bne __b1
// }
rts
}
anim: {
.label __4 = 4
.label __6 = 4
.label __9 = 4
.label __10 = 4
.label __11 = 4
.label __12 = 4
.label __26 = $f
.label x = 8
.label y = $14
.label xr = $b
.label yr = 9
.label xpos = 6
// signed fixed[0.7]
.label sprite_msb = $d
.label i = $e
.label angle = $13
.label cyclecount = $f
lda #0
sta.z angle
__b2:
// while(VICII->RASTER!=$ff)
lda #$ff
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// clock_start()
jsr clock_start
lda #0
sta.z sprite_msb
sta.z i
__b4:
// signed char x = xs[i]
ldy.z i
lda xs,y
sta.z x
// signed char y = ys[i]
// signed fixed[7.0]
lda ys,y
sta.z y
ldy.z angle
lda COS,y
// mulf8u_prepare((char)a)
jsr mulf8u_prepare
// mulf8s_prepared(x)
ldy.z x
jsr mulf8s_prepared
// mulf8s_prepared(x)
// signed int xr = mulf8s_prepared(x)*2
lda.z __4
asl
sta.z xr
lda.z __4+1
rol
sta.z xr+1
// mulf8s_prepared(y)
ldy.z y
jsr mulf8s_prepared
// mulf8s_prepared(y)
// signed int yr = mulf8s_prepared(y)*2
// signed fixed[8.8]
lda.z __6
asl
sta.z yr
lda.z __6+1
rol
sta.z yr+1
ldy.z angle
lda SIN,y
// mulf8u_prepare((char)a)
jsr mulf8u_prepare
// mulf8s_prepared(y)
ldy.z y
jsr mulf8s_prepared
// mulf8s_prepared(y)
// mulf8s_prepared(y)*2
asl.z __10
rol.z __10+1
// xr -= mulf8s_prepared(y)*2
lda.z xr
sec
sbc.z __10
sta.z xr
lda.z xr+1
sbc.z __10+1
sta.z xr+1
// mulf8s_prepared(x)
ldy.z x
jsr mulf8s_prepared
// mulf8s_prepared(x)
// mulf8s_prepared(x)*2
asl.z __12
rol.z __12+1
// yr += mulf8s_prepared(x)*2
// signed fixed[8.8]
clc
lda.z yr
adc.z __12
sta.z yr
lda.z yr+1
adc.z __12+1
sta.z yr+1
// BYTE1(xr)
lda.z xr+1
// signed int xpos = ((signed char) BYTE1(xr)) + 24 /*border*/ + 149
// signed fixed[8.8]
sta.z $ff
clc
adc #<$18+$95
sta.z xpos
lda.z $ff
ora #$7f
bmi !+
lda #0
!:
adc #>$18+$95
sta.z xpos+1
// sprite_msb = sprite_msb/2
lsr.z sprite_msb
// BYTE1(xpos)
// if(BYTE1(xpos)!=0)
cmp #0
beq __b5
// sprite_msb |= $80
lda #$80
ora.z sprite_msb
sta.z sprite_msb
__b5:
// BYTE1(yr) + 89
lda.z yr+1
// char ypos = BYTE1(yr) + 89 /*center*/+ 51
clc
adc #$59+$33
tay
// char i2 = i*2
lda.z i
asl
tax
// BYTE0(xpos)
lda.z xpos
// SPRITES_XPOS[i2] = BYTE0(xpos)
sta SPRITES_XPOS,x
// SPRITES_YPOS[i2] = ypos
tya
sta SPRITES_YPOS,x
// for(char i: 0..7)
inc.z i
lda #8
cmp.z i
beq !__b4+
jmp __b4
!__b4:
// VICII->SPRITES_XMSB = sprite_msb
lda.z sprite_msb
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB
// angle++;
inc.z angle
// clock()
jsr clock
// unsigned long cyclecount = clock()-CLOCKS_PER_INIT
// Calculate the cycle count - 0x12 is the base usage of start/read
lda.z cyclecount
sec
sbc #<CLOCKS_PER_INIT
sta.z cyclecount
lda.z cyclecount+1
sbc #>CLOCKS_PER_INIT
sta.z cyclecount+1
lda.z cyclecount+2
sbc #<CLOCKS_PER_INIT>>$10
sta.z cyclecount+2
lda.z cyclecount+3
sbc #>CLOCKS_PER_INIT>>$10
sta.z cyclecount+3
// print_ulong_at(cyclecount, SCREEN)
// Print cycle count
jsr print_ulong_at
// VICII->BORDER_COLOR = LIGHT_BLUE
lda #LIGHT_BLUE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b2
}
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
mulf_init: {
// x/2
.label c = $13
// Counter used for determining x%2==0
.label sqr1_hi = 9
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
.label sqr = $b
.label sqr1_lo = 4
// Decrease or increase x_255 - initially we decrease
.label sqr2_hi = 2
.label sqr2_lo = 6
//Start with g(0)=f(255)
.label dir = $e
ldx #0
lda #<mulf_sqr1_hi+1
sta.z sqr1_hi
lda #>mulf_sqr1_hi+1
sta.z sqr1_hi+1
txa
sta.z sqr
sta.z sqr+1
sta.z c
lda #<mulf_sqr1_lo+1
sta.z sqr1_lo
lda #>mulf_sqr1_lo+1
sta.z sqr1_lo+1
__b1:
// for(char* sqr1_lo = mulf_sqr1_lo+1; sqr1_lo!=mulf_sqr1_lo+512; sqr1_lo++)
lda.z sqr1_lo+1
cmp #>mulf_sqr1_lo+$200
bne __b2
lda.z sqr1_lo
cmp #<mulf_sqr1_lo+$200
bne __b2
lda #$ff
sta.z dir
lda #<mulf_sqr2_hi
sta.z sqr2_hi
lda #>mulf_sqr2_hi
sta.z sqr2_hi+1
ldx #-1
lda #<mulf_sqr2_lo
sta.z sqr2_lo
lda #>mulf_sqr2_lo
sta.z sqr2_lo+1
__b5:
// for(char* sqr2_lo = mulf_sqr2_lo; sqr2_lo!=mulf_sqr2_lo+511; sqr2_lo++)
lda.z sqr2_lo+1
cmp #>mulf_sqr2_lo+$1ff
bne __b6
lda.z sqr2_lo
cmp #<mulf_sqr2_lo+$1ff
bne __b6
// *(mulf_sqr2_lo+511) = *(mulf_sqr1_lo+256)
// Set the very last value g(511) = f(256)
lda mulf_sqr1_lo+$100
sta mulf_sqr2_lo+$1ff
// *(mulf_sqr2_hi+511) = *(mulf_sqr1_hi+256)
lda mulf_sqr1_hi+$100
sta mulf_sqr2_hi+$1ff
// }
rts
__b6:
// *sqr2_lo = mulf_sqr1_lo[x_255]
lda mulf_sqr1_lo,x
ldy #0
sta (sqr2_lo),y
// *sqr2_hi++ = mulf_sqr1_hi[x_255]
lda mulf_sqr1_hi,x
sta (sqr2_hi),y
// *sqr2_hi++ = mulf_sqr1_hi[x_255];
inc.z sqr2_hi
bne !+
inc.z sqr2_hi+1
!:
// x_255 = x_255 + dir
txa
clc
adc.z dir
tax
// if(x_255==0)
cpx #0
bne __b8
lda #1
sta.z dir
__b8:
// for(char* sqr2_lo = mulf_sqr2_lo; sqr2_lo!=mulf_sqr2_lo+511; sqr2_lo++)
inc.z sqr2_lo
bne !+
inc.z sqr2_lo+1
!:
jmp __b5
__b2:
// if((++c&1)==0)
inc.z c
// ++c&1
lda #1
and.z c
// if((++c&1)==0)
cmp #0
bne __b3
// x_2++;
inx
// sqr++;
inc.z sqr
bne !+
inc.z sqr+1
!:
__b3:
// BYTE0(sqr)
lda.z sqr
// *sqr1_lo = BYTE0(sqr)
ldy #0
sta (sqr1_lo),y
// BYTE1(sqr)
lda.z sqr+1
// *sqr1_hi++ = BYTE1(sqr)
sta (sqr1_hi),y
// *sqr1_hi++ = BYTE1(sqr);
inc.z sqr1_hi
bne !+
inc.z sqr1_hi+1
!:
// sqr = sqr + x_2
txa
clc
adc.z sqr
sta.z sqr
bcc !+
inc.z sqr+1
!:
// for(char* sqr1_lo = mulf_sqr1_lo+1; sqr1_lo!=mulf_sqr1_lo+512; sqr1_lo++)
inc.z sqr1_lo
bne !+
inc.z sqr1_lo+1
!:
jmp __b1
}
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// *CIA2_TIMER_AB = 0xffffffff
lda #<$ffffffff
sta CIA2_TIMER_AB
lda #>$ffffffff
sta CIA2_TIMER_AB+1
lda #<$ffffffff>>$10
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
lda #CIA_TIMER_CONTROL_START
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// }
rts
}
// Prepare for fast multiply with an unsigned char to a unsigned int result
// void mulf8u_prepare(__register(A) char a)
mulf8u_prepare: {
.label memA = $fd
// *memA = a
sta.z memA
// asm
sta mulf8u_prepared.sm1+1
sta mulf8u_prepared.sm3+1
eor #$ff
sta mulf8u_prepared.sm2+1
sta mulf8u_prepared.sm4+1
// }
rts
}
// Calculate fast multiply with a prepared unsigned char to a unsigned int result
// The prepared number is set by calling mulf8s_prepare(char a)
// int mulf8s_prepared(__register(Y) signed char b)
mulf8s_prepared: {
.label memA = $fd
.label m = 4
// unsigned int m = mulf8u_prepared((char) b)
tya
jsr mulf8u_prepared
// if(*memA<0)
lda.z memA
cmp #0
bpl __b1
// BYTE1(m)
lda.z m+1
// BYTE1(m) = BYTE1(m)-(char)b
sty.z $ff
sec
sbc.z $ff
sta.z m+1
__b1:
// if(b<0)
cpy #0
bpl __b2
// BYTE1(m)
lda.z m+1
// BYTE1(m) = BYTE1(m)-(char)*memA
sec
sbc.z memA
sta.z m+1
__b2:
// }
rts
}
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock: {
.label return = $f
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// Stop the timer
lda #0
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// clock_t ticks = 0xffffffff - *CIA2_TIMER_AB
lda #<$ffffffff
sec
sbc CIA2_TIMER_AB
sta.z return
lda #>$ffffffff
sbc CIA2_TIMER_AB+1
sta.z return+1
lda #<$ffffffff>>$10
sbc CIA2_TIMER_AB+2
sta.z return+2
lda #>$ffffffff>>$10
sbc CIA2_TIMER_AB+3
sta.z return+3
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// Start the timer
lda #CIA_TIMER_CONTROL_START
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// }
rts
}
// Print a unsigned long as HEX at a specific position
// void print_ulong_at(__zp($f) unsigned long dw, char *at)
print_ulong_at: {
.label dw = $f
// print_uint_at(WORD1(dw), at)
lda.z dw+2
sta.z print_uint_at.w
lda.z dw+3
sta.z print_uint_at.w+1
lda #<SCREEN
sta.z print_uint_at.at
lda #>SCREEN
sta.z print_uint_at.at+1
jsr print_uint_at
// print_uint_at(WORD0(dw), at+4)
lda.z dw
sta.z print_uint_at.w
lda.z dw+1
sta.z print_uint_at.w+1
lda #<SCREEN+4
sta.z print_uint_at.at
lda #>SCREEN+4
sta.z print_uint_at.at+1
jsr print_uint_at
// }
rts
}
// Calculate fast multiply with a prepared unsigned char to a unsigned int result
// The prepared number is set by calling mulf8u_prepare(char a)
// __zp(4) unsigned int mulf8u_prepared(__register(A) char b)
mulf8u_prepared: {
.label resL = $fe
.label memB = $ff
.label return = 4
// *memB = b
sta.z memB
// asm
tax
sec
sm1:
lda mulf_sqr1_lo,x
sm2:
sbc mulf_sqr2_lo,x
sta resL
sm3:
lda mulf_sqr1_hi,x
sm4:
sbc mulf_sqr2_hi,x
sta memB
// MAKEWORD( *memB, *resL )
sta.z return+1
lda.z resL
sta.z return
// }
rts
}
// Print a unsigned int as HEX at a specific position
// void print_uint_at(__zp(9) unsigned int w, __zp(6) char *at)
print_uint_at: {
.label w = 9
.label at = 6
// print_uchar_at(BYTE1(w), at)
lda.z w+1
sta.z print_uchar_at.b
jsr print_uchar_at
// print_uchar_at(BYTE0(w), at+2)
lda.z w
sta.z print_uchar_at.b
lda #2
clc
adc.z print_uchar_at.at
sta.z print_uchar_at.at
bcc !+
inc.z print_uchar_at.at+1
!:
jsr print_uchar_at
// }
rts
}
// Print a char as HEX at a specific position
// void print_uchar_at(__zp(8) char b, __zp(6) char *at)
print_uchar_at: {
.label b = 8
.label at = 6
// b>>4
lda.z b
lsr
lsr
lsr
lsr
// print_char_at(print_hextab[b>>4], at)
tay
ldx print_hextab,y
lda.z at
sta.z print_char_at.at
lda.z at+1
sta.z print_char_at.at+1
// Table of hexadecimal digits
jsr print_char_at
// b&$f
lda #$f
and.z b
tay
// print_char_at(print_hextab[b&$f], at+1)
clc
lda.z at
adc #1
sta.z print_char_at.at
lda.z at+1
adc #0
sta.z print_char_at.at+1
ldx print_hextab,y
jsr print_char_at
// }
rts
}
// Print a single char
// void print_char_at(__register(X) char ch, __zp(2) char *at)
print_char_at: {
.label at = 2
// *(at) = ch
txa
ldy #0
sta (at),y
// }
rts
}
.segment Data
// mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255).
// <f(x) = <(( x * x )/4)
.align $100
mulf_sqr1_lo: .fill $200, 0
// >f(x) = >(( x * x )/4)
.align $100
mulf_sqr1_hi: .fill $200, 0
// <g(x) = <((( x - 255) * ( x - 255 ))/4)
.align $100
mulf_sqr2_lo: .fill $200, 0
// >g(x) = >((( x - 255) * ( x - 255 ))/4)
.align $100
mulf_sqr2_hi: .fill $200, 0
print_hextab: .text "0123456789abcdef"
// Sine and Cosine tables
// Angles: $00=0, $80=PI,$100=2*PI
// Sine/Cosine: signed fixed [-$7f,$7f]
.align $40
SIN:
.for(var i=0;i<$140;i++)
.byte >round($7fff*sin(i*2*PI/256))
// Positions to rotate
xs: .byte -$46, -$46, -$46, 0, 0, $46, $46, $46
ys: .byte -$46, 0, $46, -$46, $46, -$46, 0, $46
.pc = $3000 "SPRITE"
// A single sprite
SPRITE:
.var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
.byte pic.getSinglecolorByte(x,y)
| 24.193353 | 173 | 0.615884 |
3ade717542bb929a8882961c28b8e8b6351f0256 | 10,672 | asm | Assembly | P6/data_P6_2/MDTest165.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | 1 | 2022-01-23T09:24:47.000Z | 2022-01-23T09:24:47.000Z | P6/data_P6_2/MDTest165.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P6/data_P6_2/MDTest165.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | ori $ra,$ra,0xf
sll $1,$2,19
sb $4,0($0)
mflo $5
mthi $5
mfhi $4
sll $4,$4,15
lb $5,7($0)
divu $2,$ra
mfhi $1
ori $1,$1,6427
mult $1,$1
mthi $5
mult $1,$1
divu $5,$ra
multu $5,$4
mtlo $1
srav $4,$6,$6
srav $2,$2,$4
mthi $2
ori $5,$5,16966
mtlo $2
addu $2,$2,$2
multu $5,$5
lb $1,14($0)
lui $3,4369
ori $5,$2,11868
sll $5,$2,14
ori $4,$5,3893
srav $1,$4,$1
ori $2,$2,30602
srav $4,$2,$3
ori $0,$2,45392
ori $0,$2,39889
mflo $4
addiu $3,$5,-12358
srav $4,$2,$4
addu $0,$2,$3
multu $2,$4
addu $5,$2,$5
mtlo $6
sb $6,13($0)
mtlo $3
srav $2,$2,$2
lb $5,3($0)
addu $0,$0,$0
divu $1,$ra
divu $4,$ra
sb $0,0($0)
addiu $5,$4,-19114
mthi $5
div $6,$ra
mfhi $1
sb $4,7($0)
mtlo $5
multu $6,$5
addu $5,$4,$1
sll $0,$0,13
mthi $1
divu $0,$ra
mthi $5
mtlo $0
srav $5,$4,$4
srav $6,$4,$4
sll $0,$5,8
sb $5,13($0)
addiu $2,$1,-26486
addiu $1,$1,16730
mult $1,$4
lui $4,35557
lb $5,1($0)
mflo $2
addiu $0,$1,-5725
lb $4,14($0)
mfhi $0
addu $1,$1,$1
sb $3,10($0)
divu $5,$ra
mflo $2
ori $3,$2,13346
lb $4,13($0)
mtlo $2
srav $4,$1,$1
mthi $4
div $4,$ra
ori $3,$2,42425
lb $3,4($0)
divu $1,$ra
lui $2,24821
mfhi $3
multu $0,$6
sll $3,$3,23
sb $6,6($0)
mult $5,$5
sll $4,$4,24
mult $4,$2
lb $5,1($0)
div $1,$ra
mfhi $2
mtlo $5
divu $4,$ra
sb $0,1($0)
multu $2,$4
addu $1,$2,$3
lui $1,17432
addu $0,$0,$1
mflo $1
lui $4,31006
ori $2,$2,55725
div $5,$ra
mult $1,$1
ori $1,$2,29073
mflo $1
sb $1,13($0)
mfhi $4
sb $5,14($0)
lui $6,51402
lui $3,4733
mult $4,$5
div $1,$ra
mtlo $1
divu $5,$ra
mtlo $4
mthi $5
addu $4,$3,$3
sb $5,6($0)
mthi $1
ori $1,$5,19077
mult $1,$3
sb $0,9($0)
mflo $1
sll $0,$1,17
lui $4,1195
mthi $0
lui $5,25845
div $4,$ra
lb $5,3($0)
sll $5,$5,25
mult $2,$2
div $1,$ra
divu $2,$ra
mfhi $4
addiu $0,$4,-29019
sll $2,$5,12
multu $4,$6
div $4,$ra
mult $1,$1
ori $1,$4,15367
mult $5,$2
ori $6,$2,53819
mtlo $1
mthi $4
lui $1,21751
div $1,$ra
mflo $6
mult $5,$5
mtlo $4
ori $4,$5,9576
ori $5,$5,20404
lb $4,11($0)
lb $2,10($0)
sb $5,15($0)
addu $2,$2,$4
mult $4,$2
multu $5,$5
srav $1,$1,$0
mfhi $6
mfhi $0
lb $5,14($0)
sb $6,9($0)
mfhi $4
addu $2,$5,$2
div $5,$ra
sb $6,0($0)
divu $4,$ra
mfhi $5
divu $4,$ra
div $2,$ra
lb $5,14($0)
ori $5,$2,39101
divu $4,$ra
div $5,$ra
ori $5,$2,22957
mthi $2
mult $3,$3
sll $3,$2,9
mtlo $1
srav $0,$2,$5
sll $1,$2,7
srav $1,$1,$3
addiu $1,$2,17370
lb $4,7($0)
sb $2,6($0)
ori $4,$4,10821
lui $0,6486
addiu $4,$4,23901
addiu $1,$1,25611
mflo $2
srav $2,$2,$3
addiu $5,$2,-23261
mthi $4
mflo $0
lui $0,28157
mthi $4
sb $3,7($0)
divu $2,$ra
srav $4,$0,$0
addu $0,$0,$2
mflo $1
mthi $2
lui $1,53529
mfhi $3
lui $5,65198
mflo $1
mult $1,$4
lb $2,11($0)
mult $5,$2
addu $2,$2,$5
addu $1,$0,$1
sll $3,$1,9
sll $0,$0,20
lb $1,9($0)
addu $1,$5,$3
mfhi $6
ori $1,$4,46779
ori $4,$4,52039
srav $2,$2,$2
sb $2,11($0)
mtlo $1
mfhi $2
srav $0,$0,$2
sb $4,9($0)
div $4,$ra
addiu $4,$3,1340
mfhi $4
div $4,$ra
ori $3,$3,20135
sll $4,$2,2
addiu $2,$2,-11432
srav $1,$0,$3
srav $1,$0,$1
multu $0,$1
ori $0,$5,21997
srav $6,$6,$0
div $5,$ra
mfhi $5
multu $6,$5
srav $5,$5,$5
mtlo $3
ori $4,$4,54482
mult $0,$1
div $6,$ra
mthi $1
ori $1,$6,22721
mfhi $1
lb $1,4($0)
multu $4,$1
lui $4,3625
ori $6,$6,24707
addiu $0,$4,27461
sll $0,$2,1
sll $1,$4,3
divu $2,$ra
lb $5,5($0)
lui $3,6528
mflo $2
srav $4,$1,$4
sb $4,7($0)
addiu $3,$1,-29986
srav $4,$3,$3
lb $5,1($0)
sll $1,$0,27
sll $0,$0,5
mthi $5
lb $1,13($0)
mult $1,$1
lb $1,8($0)
sb $1,7($0)
sb $0,5($0)
lui $4,30205
multu $5,$5
mflo $1
addiu $5,$2,-4707
addu $4,$6,$6
mult $4,$2
addiu $0,$4,584
addiu $3,$3,26629
mflo $1
mthi $5
addiu $5,$5,2655
addiu $1,$4,27532
sb $6,13($0)
mtlo $4
addu $4,$4,$4
multu $5,$0
srav $4,$5,$3
sb $2,11($0)
sll $1,$2,30
sb $4,11($0)
sll $4,$4,21
mthi $4
divu $1,$ra
mtlo $6
mult $5,$5
addiu $0,$0,159
mult $4,$2
divu $4,$ra
mult $5,$2
mflo $4
mflo $1
srav $4,$5,$5
sll $1,$2,31
lui $5,53331
mthi $6
mfhi $3
mfhi $5
addiu $1,$4,6799
mult $4,$4
addu $1,$2,$1
multu $1,$0
divu $1,$ra
lb $1,8($0)
multu $3,$5
mthi $4
mtlo $4
ori $5,$5,1135
mtlo $3
addu $5,$2,$0
mthi $0
mtlo $4
sb $1,1($0)
addiu $6,$1,-30203
sll $2,$4,0
sb $2,4($0)
ori $4,$2,1860
multu $1,$0
addiu $3,$4,14374
divu $5,$ra
ori $3,$2,32178
div $4,$ra
mult $2,$2
ori $4,$2,30604
ori $5,$3,8259
lb $4,6($0)
div $2,$ra
addu $1,$4,$2
ori $5,$1,50860
mult $0,$4
multu $5,$1
divu $2,$ra
mthi $4
srav $3,$3,$3
mfhi $5
lui $1,20900
mult $1,$3
sll $1,$4,5
div $2,$ra
divu $1,$ra
mflo $4
lb $4,8($0)
mult $1,$1
divu $4,$ra
divu $4,$ra
mflo $6
ori $6,$4,37501
addu $2,$2,$0
mfhi $1
mthi $4
sll $2,$2,27
multu $1,$2
addiu $4,$5,4210
mtlo $3
lui $4,19344
addiu $1,$6,-27391
ori $1,$2,41725
mthi $4
mflo $3
mfhi $4
mfhi $4
mult $1,$0
mthi $5
mthi $4
addu $6,$6,$2
div $2,$ra
divu $6,$ra
lb $4,0($0)
mthi $4
srav $4,$2,$1
ori $0,$5,19505
mfhi $3
mflo $5
srav $2,$2,$2
mflo $5
sb $3,9($0)
sll $4,$1,16
multu $5,$2
multu $2,$2
divu $1,$ra
srav $3,$0,$3
multu $4,$2
lui $4,26904
srav $5,$2,$3
divu $4,$ra
lui $4,42358
mthi $5
mult $2,$4
addiu $4,$4,4345
mthi $1
mult $1,$2
lui $3,261
lui $4,56667
div $1,$ra
mflo $1
ori $4,$1,984
srav $1,$1,$4
mthi $4
lui $2,7709
srav $1,$0,$6
srav $3,$3,$3
mfhi $1
addiu $5,$5,6208
mult $2,$4
addu $4,$2,$3
sb $0,15($0)
divu $4,$ra
addu $2,$2,$3
mult $1,$2
mthi $0
ori $2,$2,22240
multu $4,$2
mtlo $5
div $4,$ra
mult $2,$2
mthi $4
lui $5,31554
addiu $5,$5,-4634
ori $5,$4,10099
div $1,$ra
lb $4,3($0)
ori $5,$2,64558
mtlo $2
mflo $3
divu $4,$ra
mtlo $5
mfhi $5
srav $6,$5,$5
sb $4,3($0)
srav $0,$0,$2
mflo $1
sll $3,$6,16
mtlo $4
addiu $4,$4,-3065
lb $0,10($0)
mtlo $1
lui $6,55971
mult $5,$5
sb $5,4($0)
lb $0,0($0)
mthi $3
mthi $4
lui $5,11
mflo $6
mtlo $6
addu $5,$5,$1
div $4,$ra
div $1,$ra
lui $5,54834
addiu $4,$4,21152
mfhi $4
lb $3,13($0)
sll $4,$2,3
mthi $6
sll $1,$0,13
mflo $5
ori $4,$6,24332
divu $1,$ra
div $4,$ra
sb $1,1($0)
multu $6,$4
mult $4,$5
mthi $0
divu $4,$ra
addu $4,$4,$5
mflo $2
mthi $4
mtlo $0
addu $0,$6,$3
mfhi $2
addiu $0,$0,-17997
div $1,$ra
sb $6,7($0)
sll $1,$2,22
mtlo $4
lui $5,12160
multu $1,$2
sll $0,$1,16
divu $4,$ra
multu $4,$3
mthi $6
ori $1,$4,26242
lb $4,2($0)
srav $3,$1,$3
divu $5,$ra
addu $1,$0,$4
addiu $4,$1,3423
div $0,$ra
addu $1,$6,$1
divu $0,$ra
mtlo $2
mthi $0
div $4,$ra
addiu $5,$0,-3866
addu $1,$4,$0
lb $1,5($0)
mult $4,$2
divu $0,$ra
mtlo $4
mflo $0
sb $2,11($0)
mfhi $2
ori $1,$4,19708
mult $5,$2
multu $5,$5
lui $3,42082
lui $2,29684
addiu $2,$1,-22929
divu $1,$ra
divu $2,$ra
lb $5,4($0)
multu $6,$2
mflo $4
multu $4,$4
sll $5,$2,0
sll $1,$1,16
divu $2,$ra
sll $5,$2,0
mult $0,$5
ori $5,$5,2577
srav $4,$2,$3
divu $4,$ra
mtlo $0
sb $2,7($0)
addiu $1,$1,-20887
divu $1,$ra
sb $4,3($0)
sb $4,9($0)
div $5,$ra
addu $5,$1,$3
addu $2,$2,$1
srav $6,$4,$2
sll $4,$0,20
addiu $1,$0,-23545
lb $0,12($0)
mult $4,$5
addiu $6,$4,8072
mflo $5
mfhi $4
ori $1,$6,11366
ori $5,$2,4548
mult $4,$5
mfhi $4
mult $4,$5
addu $5,$5,$1
sb $2,9($0)
mult $5,$6
lb $2,14($0)
multu $3,$5
addiu $4,$4,-13846
lui $0,26815
multu $6,$5
mflo $2
addu $5,$4,$2
addiu $1,$5,-18006
srav $6,$6,$6
divu $4,$ra
lb $0,2($0)
multu $0,$5
lb $4,6($0)
mfhi $5
ori $5,$0,57229
srav $5,$5,$4
lb $2,8($0)
addiu $3,$4,14602
div $4,$ra
mtlo $6
mfhi $6
addu $5,$2,$3
mfhi $5
addiu $5,$6,25354
mult $6,$6
multu $3,$5
mflo $0
addu $5,$5,$5
addu $4,$4,$6
div $5,$ra
mult $2,$2
divu $4,$ra
addiu $4,$2,27014
srav $5,$3,$3
mflo $4
lui $1,2155
srav $5,$4,$0
multu $4,$2
addiu $4,$4,25970
addu $1,$1,$5
mflo $4
addu $5,$5,$1
mthi $5
divu $2,$ra
lui $4,49483
lui $5,4168
mult $3,$1
mtlo $5
addu $1,$1,$4
lb $1,2($0)
ori $1,$1,56009
div $4,$ra
lui $5,11560
mfhi $1
mult $4,$1
addu $4,$1,$4
mfhi $0
lb $3,11($0)
div $1,$ra
divu $5,$ra
mfhi $4
ori $5,$2,9589
mfhi $6
divu $4,$ra
divu $4,$ra
mult $6,$1
mult $5,$5
addu $6,$6,$3
mflo $1
divu $2,$ra
addiu $2,$2,-8137
divu $4,$ra
addu $2,$2,$2
sb $1,15($0)
sb $4,14($0)
mflo $5
sb $6,12($0)
mtlo $4
mfhi $4
sb $4,8($0)
divu $4,$ra
mfhi $1
lui $4,34651
ori $1,$1,20958
mtlo $0
sll $1,$1,0
mult $1,$4
addiu $1,$4,-11521
divu $6,$ra
div $5,$ra
lb $2,15($0)
mflo $1
lui $2,36557
mult $0,$2
mthi $4
divu $0,$ra
divu $6,$ra
divu $5,$ra
addiu $1,$1,-10720
addu $4,$4,$5
ori $4,$1,18044
srav $6,$2,$5
ori $4,$4,54279
addiu $0,$2,-31363
div $1,$ra
mult $5,$4
lui $4,39563
mfhi $1
multu $5,$0
lui $4,3071
ori $5,$0,63231
div $4,$ra
sb $4,15($0)
lui $0,4821
srav $4,$4,$4
mtlo $6
mult $5,$4
lb $1,12($0)
addiu $1,$4,-25549
sb $4,11($0)
mult $5,$2
addiu $5,$4,14412
multu $2,$2
divu $6,$ra
mflo $2
multu $0,$0
mfhi $5
addu $0,$0,$3
addu $3,$2,$3
ori $4,$4,64619
sb $5,15($0)
sll $4,$2,22
srav $4,$6,$0
sb $3,15($0)
ori $3,$6,53913
addu $0,$5,$4
sll $2,$2,17
srav $6,$2,$3
addiu $1,$1,25779
addu $4,$4,$4
lui $4,8820
div $5,$ra
lui $1,55757
mtlo $6
mult $6,$1
srav $4,$6,$6
ori $2,$2,28623
mtlo $4
sll $4,$1,6
addiu $5,$1,-23925
srav $0,$4,$0
mtlo $1
mtlo $6
mflo $2
ori $2,$6,65146
srav $1,$4,$4
mult $2,$2
sb $5,0($0)
mthi $1
multu $4,$6
sll $4,$1,1
div $6,$ra
mfhi $1
mflo $1
mtlo $3
srav $0,$0,$4
lb $0,0($0)
mtlo $4
divu $5,$ra
divu $0,$ra
sb $1,8($0)
mfhi $0
sb $5,7($0)
sll $3,$3,11
sb $1,10($0)
mult $0,$4
srav $1,$5,$6
mtlo $2
mult $6,$6
sb $5,11($0)
mflo $2
mfhi $4
divu $6,$ra
srav $3,$5,$3
mtlo $6
lui $1,48723
srav $5,$1,$3
lui $1,40625
multu $2,$2
mfhi $0
addiu $4,$1,-16917
mflo $0
addu $4,$4,$4
mult $0,$2
srav $4,$4,$4
mtlo $1
mthi $4
divu $6,$ra
mult $1,$6
srav $0,$4,$4
div $3,$ra
addu $1,$1,$3
addiu $2,$2,16580
srav $4,$4,$4
divu $1,$ra
mtlo $4
sll $1,$2,20
divu $4,$ra
div $4,$ra
mfhi $3
addu $4,$2,$4
addiu $4,$4,8480
mult $0,$2
srav $5,$5,$5
sll $5,$1,11
mtlo $4
lui $6,46908
sll $4,$6,19
divu $4,$ra
sb $1,11($0)
mflo $1
sll $3,$5,7
divu $4,$ra
mfhi $4
addiu $2,$2,29925
sll $1,$6,22
lb $0,9($0)
sb $4,15($0)
addu $1,$4,$1
multu $4,$4
mult $4,$3
multu $1,$0
lui $6,2793
addiu $6,$4,-1544
addu $0,$0,$3
addu $5,$4,$3
mfhi $4
addiu $2,$5,26884
multu $6,$0
ori $2,$2,26613
lui $4,44303
mtlo $1
mflo $4
divu $4,$ra
mflo $1
lui $5,44658
mfhi $6
lui $2,43315
divu $4,$ra
div $1,$ra
addiu $4,$4,1064
mthi $6
div $4,$ra
divu $5,$ra
sll $4,$1,22
sb $3,6($0)
sb $2,10($0)
mfhi $6
mflo $4
addu $4,$4,$4
mthi $4
divu $5,$ra
mtlo $6
mult $4,$6
divu $6,$ra
mthi $4
lb $4,11($0)
ori $4,$4,11476
mtlo $5
multu $2,$2
divu $1,$ra
multu $5,$1
mflo $5
sll $1,$4,21
mfhi $6
lb $6,15($0)
divu $5,$ra
multu $6,$2
multu $3,$3
mult $1,$1
mtlo $5
div $5,$ra
sll $5,$1,21
addiu $2,$0,-19955
sll $4,$4,31
ori $5,$4,22490
ori $4,$4,61727
mtlo $4
mult $6,$4
mult $0,$0
sll $6,$5,15
mthi $2
mult $1,$4
addiu $5,$5,3721
mflo $1
addiu $5,$5,12245
lb $0,12($0)
div $0,$ra
mtlo $5
mult $4,$1
addu $6,$4,$6
lb $4,0($0)
sll $6,$4,23
ori $6,$2,3412
mfhi $4
sll $1,$1,7
div $4,$ra
lui $0,21634
multu $4,$5
divu $6,$ra
div $6,$ra
mult $2,$4
lui $0,20364
mult $5,$5
mthi $3
mfhi $4
divu $1,$ra
mult $3,$0
addiu $4,$4,-2714
div $4,$ra
addu $1,$2,$1
multu $2,$2
mflo $3
sb $4,0($0)
| 11.991011 | 18 | 0.56756 |
d7675b8ce8f0eccda2b1d7ae9cc9f2c608a7ff32 | 785 | asm | Assembly | programs/oeis/098/A098401.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/098/A098401.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/098/A098401.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A098401: a(n) = (0^n + 3^n*binomial(2n,n))/2.
; 1,3,27,270,2835,30618,336798,3752892,42220035,478493730,5454828522,62482581252,718549684398,8290957896900,95938227092700,1112883434275320,12937269923450595,150681143814306930,1757946677833580850,20540219077844997300,240320563210786468410,2815183740469212915660,33014427501866224192740,387560670674081762262600,4553837880420460706585550,53553133473744617909446068,630279186267917426165019108,7423288193822138574832447272,87488753712903776060525271420,1031763923097003152162056649160,12174814292544637195512268460088,143741355841010877856693234077168,1697944765871940994682188827536547,20066619960304757209880413416341010,237258271295368011716821358628502530
seq $0,98658 ; a(n) = 3^n*(2*n)!/(n!)^2.
mul $0,2
sub $0,3
div $0,4
add $0,1
| 87.222222 | 658 | 0.871338 |
3b30149b553471a2e27602eaf851ab8b8dd7dd64 | 487 | asm | Assembly | oeis/002/A002586.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/002/A002586.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/002/A002586.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A002586: Smallest prime factor of 2^n + 1.
; Submitted by Jon Maiga
; 3,5,3,17,3,5,3,257,3,5,3,17,3,5,3,65537,3,5,3,17,3,5,3,97,3,5,3,17,3,5,3,641,3,5,3,17,3,5,3,257,3,5,3,17,3,5,3,193,3,5,3,17,3,5,3,257,3,5,3,17,3,5,3,274177,3,5,3,17,3,5,3,97,3,5,3,17,3,5,3,65537,3,5,3,17,3,5,3,257,3,5,3,17,3,5,3,641,3,5,3,17
add $0,1
mov $1,2
pow $1,$0
mov $0,$1
seq $0,20639 ; Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.
| 48.7 | 243 | 0.620123 |
d03ed6ee206015abcf17450fed560ca550461d14 | 1,037 | asm | Assembly | _build/dispatcher/jmp_ippsAES_XTSInit_82d8826e.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsAES_XTSInit_82d8826e.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsAES_XTSInit_82d8826e.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsAES_XTSInit:function
extern n8_ippsAES_XTSInit:function
extern y8_ippsAES_XTSInit:function
extern e9_ippsAES_XTSInit:function
extern l9_ippsAES_XTSInit:function
extern n0_ippsAES_XTSInit:function
extern k0_ippsAES_XTSInit:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsAES_XTSInit
.Larraddr_ippsAES_XTSInit:
dq m7_ippsAES_XTSInit
dq n8_ippsAES_XTSInit
dq y8_ippsAES_XTSInit
dq e9_ippsAES_XTSInit
dq l9_ippsAES_XTSInit
dq n0_ippsAES_XTSInit
dq k0_ippsAES_XTSInit
segment .text
global ippsAES_XTSInit:function (ippsAES_XTSInit.LEndippsAES_XTSInit - ippsAES_XTSInit)
.Lin_ippsAES_XTSInit:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsAES_XTSInit:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsAES_XTSInit]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsAES_XTSInit:
| 26.589744 | 87 | 0.78785 |
5e6755f40df000fd166d3837fe578e78e5ccf233 | 6,527 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1148.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1148.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1148.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 %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1c859, %r15
nop
nop
nop
nop
nop
sub $56932, %rsi
movw $0x6162, (%r15)
add $27185, %rcx
lea addresses_WT_ht+0x19899, %rsi
lea addresses_D_ht+0x7499, %rdi
nop
nop
nop
nop
cmp %r8, %r8
mov $82, %rcx
rep movsq
nop
nop
sub %r15, %r15
lea addresses_WT_ht+0x19499, %rsi
lea addresses_normal_ht+0x1d341, %rdi
clflush (%rdi)
nop
dec %rax
mov $52, %rcx
rep movsq
nop
nop
nop
nop
add %r15, %r15
lea addresses_WT_ht+0x11eb9, %r15
nop
nop
nop
cmp $49614, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
movups %xmm5, (%r15)
cmp %rsi, %rsi
lea addresses_WC_ht+0xf499, %r15
nop
nop
nop
cmp $23506, %r8
movw $0x6162, (%r15)
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_normal_ht+0x12499, %rdi
nop
nop
nop
nop
nop
add $60935, %r8
mov (%rdi), %ecx
nop
nop
nop
add %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r8
push %r9
push %rbx
push %rsi
// Store
lea addresses_US+0x16ea5, %r12
nop
cmp $1334, %rbx
mov $0x5152535455565758, %r9
movq %r9, %xmm2
vmovups %ymm2, (%r12)
dec %r12
// Store
lea addresses_WT+0x13499, %rsi
nop
nop
nop
nop
cmp %r15, %r15
mov $0x5152535455565758, %r8
movq %r8, (%rsi)
add $19929, %rbx
// Store
lea addresses_UC+0x5299, %rbx
nop
nop
nop
nop
nop
and %r12, %r12
mov $0x5152535455565758, %r8
movq %r8, (%rbx)
nop
nop
nop
nop
nop
sub $5837, %rsi
// Store
lea addresses_US+0x19f99, %rbx
nop
nop
nop
nop
nop
dec %r12
mov $0x5152535455565758, %r15
movq %r15, %xmm3
movups %xmm3, (%rbx)
nop
nop
nop
nop
xor $12667, %r12
// Faulty Load
lea addresses_US+0x2c99, %r12
nop
nop
nop
and %r14, %r14
movups (%r12), %xmm4
vpextrq $1, %xmm4, %rsi
lea oracles, %r8
and $0xff, %rsi
shlq $12, %rsi
mov (%r8,%rsi,1), %rsi
pop %rsi
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 34.903743 | 2,999 | 0.657729 |
b50ed7d3478f48a6da1d11258694d2e18725796d | 2,015 | asm | Assembly | programs/oeis/200/A200058.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/200/A200058.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/200/A200058.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A200058: Number of -n..n arrays x(0..3) of 4 elements with zero sum and elements alternately strictly increasing and strictly decreasing.
; 4,26,78,172,324,546,850,1252,1764,2398,3170,4092,5176,6438,7890,9544,11416,13518,15862,18464,21336,24490,27942,31704,35788,40210,44982,50116,55628,61530,67834,74556,81708,89302,97354,105876,114880,124382,134394,144928,156000,167622,179806,192568,205920,219874,234446,249648,265492,281994,299166,317020,335572,354834,374818,395540,417012,439246,462258,486060,510664,536086,562338,589432,617384,646206,675910,706512,738024,770458,803830,838152,873436,909698,946950,985204,1024476,1064778,1106122,1148524,1191996,1236550,1282202,1328964,1376848,1425870,1476042,1527376,1579888,1633590,1688494,1744616,1801968,1860562,1920414,1981536,2043940,2107642,2172654,2238988,2306660,2375682,2446066,2517828,2590980,2665534,2741506,2818908,2897752,2978054,3059826,3143080,3227832,3314094,3401878,3491200,3582072,3674506,3768518,3864120,3961324,4060146,4160598,4262692,4366444,4471866,4578970,4687772,4798284,4910518,5024490,5140212,5257696,5376958,5498010,5620864,5745536,5872038,6000382,6130584,6262656,6396610,6532462,6670224,6809908,6951530,7095102,7240636,7388148,7537650,7689154,7842676,7998228,8155822,8315474,8477196,8641000,8806902,8974914,9145048,9317320,9491742,9668326,9847088,10028040,10211194,10396566,10584168,10774012,10966114,11160486,11357140,11556092,11757354,11960938,12166860,12375132,12585766,12798778,13014180,13231984,13452206,13674858,13899952,14127504,14357526,14590030,14825032,15062544,15302578,15545150,15790272,16037956,16288218,16541070,16796524,17054596,17315298,17578642,17844644
mov $8,$0
mov $10,$0
add $10,1
lpb $10,1
clr $0,8
mov $0,$8
sub $10,1
sub $0,$10
mov $5,$0
mov $7,$0
add $7,1
lpb $7,1
mov $0,$5
sub $7,1
sub $0,$7
mul $0,2
cal $0,63087 ; Dimension of the space of weight 2n cusp forms for Gamma_0( 19 ).
mov $4,4
add $4,$0
add $4,$0
sub $4,2
add $6,$4
lpe
add $9,$6
lpe
mov $1,$9
| 67.166667 | 1,499 | 0.790074 |
e8ba97eca8921a6f60c56f5e1400677af1de4401 | 587 | asm | Assembly | oeis/094/A094971.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/094/A094971.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/094/A094971.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A094971: a(n) = floor(9^n/2^n).
; 1,4,20,91,410,1845,8303,37366,168151,756680,3405062,15322783,68952523,310286355,1396288601,6283298708,28274844190,127236798856,572565594852,2576545176835,11594453295761,52175039830928,234787679239180,1056544556576311,4754450504593402,21395027270670312,96277622718016405,433249302231073824,1949621860039832209,8773298370179244940,39479842665806602234,177659291996129710054,799466813982583695244,3597600662921626628600,16189202983147319828700,72851413424162939229152,327831360408733226531187
mov $1,81
pow $1,$0
mov $2,18
pow $2,$0
div $1,$2
mov $0,$1
| 58.7 | 491 | 0.856899 |
357bf6c361ca6c1a4d85a9098735f0a085f92a9f | 449 | asm | Assembly | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_InitCharStruct.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_InitCharStruct.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_InitCharStruct.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void sp1_InitCharStruct(struct sp1_cs *cs, void *drawf, uchar type, void *graphic, uchar plane)
; CALLER linkage for function pointers
SECTION code_clib
SECTION code_temp_sp1
PUBLIC sp1_InitCharStruct
EXTERN asm_sp1_InitCharStruct
sp1_InitCharStruct:
pop ix
pop bc
ld a,c
ex af,af
pop bc
pop de
ld a,e
pop de
pop hl
push hl
push de
push de
push bc
push bc
push ix
jp asm_sp1_InitCharStruct
| 14.966667 | 97 | 0.706013 |
f9f12ccdf81b90068b15ad544a5d2bafc81b72bd | 842 | asm | Assembly | Driver/Printer/PrintCom/printcomCapslDialog.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/PrintCom/printcomCapslDialog.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/PrintCom/printcomCapslDialog.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z |
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: print drivers
FILE: printcomCapslDialog.asm
AUTHOR: Dave Durran
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 6/92 Initial revision
DESCRIPTION:
$Id: printcomCapslDialog.asm,v 1.1 97/04/18 11:50:50 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include UI/uiGetNoMain.asm ;pass no tree for Main box
include UI/uiGetOptions.asm ;pass tree for Options box
include UI/uiEval.asm ;call the routine specified in device
;info resource.
include UI/uiEvalCapsl.asm ;paper input path selecting routines.
| 25.515152 | 79 | 0.558195 |
8a34c87cee525953357d63eec8a508bb5ba00f00 | 126 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Dutch/_ff_ao_Dutch.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Dutch/_ff_ao_Dutch.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Dutch/_ff_ao_Dutch.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION rodata_font
SECTION rodata_font_fzx
PUBLIC _ff_ao_Dutch
_ff_ao_Dutch:
BINARY "font/fzx/fonts/ao/Dutch/Dutch.fzx"
| 11.454545 | 42 | 0.81746 |
af2b43256278748943bf77df962f99ba26892042 | 1,851 | asm | Assembly | programs/oeis/126/A126284.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/126/A126284.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/126/A126284.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A126284: a(n) = 5*2^n - 4*n - 5.
; 1,7,23,59,135,291,607,1243,2519,5075,10191,20427,40903,81859,163775,327611,655287,1310643,2621359,5242795,10485671,20971427,41942943,83885979,167772055,335544211,671088527,1342177163,2684354439,5368708995,10737418111,21474836347,42949672823,85899345779,171798691695,343597383531,687194767207,1374389534563,2748779069279,5497558138715,10995116277591,21990232555347,43980465110863,87960930221899,175921860443975,351843720888131,703687441776447,1407374883553083,2814749767106359,5629499534212915,11258999068426031,22517998136852267,45035996273704743,90071992547409699,180143985094819615,360287970189639451,720575940379279127,1441151880758558483,2882303761517117199,5764607523034234635,11529215046068469511,23058430092136939267,46116860184273878783,92233720368547757819,184467440737095515895,368934881474191032051,737869762948382064367,1475739525896764129003,2951479051793528258279,5902958103587056516835,11805916207174113033951,23611832414348226068187,47223664828696452136663,94447329657392904273619,188894659314785808547535,377789318629571617095371,755578637259143234191047,1511157274518286468382403,3022314549036572936765119,6044629098073145873530555,12089258196146291747061431,24178516392292583494123187,48357032784585166988246703,96714065569170333976493739,193428131138340667952987815,386856262276681335905975971,773712524553362671811952287,1547425049106725343623904923,3094850098213450687247810199,6189700196426901374495620755,12379400392853802748991241871,24758800785707605497982484107,49517601571415210995964968583,99035203142830421991929937539,198070406285660843983859875455,396140812571321687967719751291,792281625142643375935439502967,1584563250285286751870879006323,3169126500570573503741758013039,6338253001141147007483516026475
mov $1,$0
lpb $1
sub $1,1
add $2,5
add $0,$2
mul $2,2
lpe
add $0,1
| 154.25 | 1,739 | 0.91302 |
a7d610a4fa8c0c7cc5f3048fa5998d3e72b3f0dc | 467 | asm | Assembly | oeis/180/A180144.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/180/A180144.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/180/A180144.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A180144: Eight rooks and one berserker on a 3 X 3 chessboard. G.f.: (1 - 2*x^2)/(1 - 4*x + x^2 + 2*x^3).
; Submitted by Christian Krause
; 1,4,13,46,163,580,2065,7354,26191,93280,332221,1183222,4214107,15008764,53454505,190381042,678052135,2414918488,8600859733,30632416174,109098967987,388561736308,1383883144897,4928772907306
mov $2,1
mov $4,1
lpb $0
sub $0,1
mul $2,2
mov $3,$4
mov $4,$2
add $2,$3
add $4,$2
lpe
mov $0,$4
div $0,4
mul $0,3
add $0,1
| 24.578947 | 190 | 0.685225 |
4749b013088fc607c9639dc80acc8d0e14c02f41 | 536 | asm | Assembly | libsrc/_DEVELOPMENT/l/z80/long/small/l_small_asr_dehl.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/l/z80/long/small/l_small_asr_dehl.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/l/z80/long/small/l_small_asr_dehl.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_l
PUBLIC l_small_asr_dehl
EXTERN error_lznc, error_lmnc
l_small_asr_dehl:
; arithmetic shift right 32-bit signed long
;
; enter : dehl = 32-bit number
; a = shift amount
;
; exit : dehl = dehl >> a
;
; uses : af, b, de, hl
or a
ret z
cp 32
jr nc, shift_infinite
ld b,a
ld a,e
shift_loop:
sra d
rra
rr h
rr l
djnz shift_loop
ld e,a
ret
shift_infinite:
bit 7,d
jp z, error_lznc
jp error_lmnc
| 11.404255 | 46 | 0.576493 |
5e47a3cac0b320d8f9cd99b8ee640ad6b999564f | 207,304 | asm | Assembly | usr/usertests.asm | AnvithShetty10/xv6_rpi3_port | 93b850b67b2d0ef0fedf8863ba317e52a5c9c987 | [
"MIT-0"
] | 1 | 2022-03-31T22:08:59.000Z | 2022-03-31T22:08:59.000Z | usr/usertests.asm | AnvithShetty10/xv6_rpi3_port | 93b850b67b2d0ef0fedf8863ba317e52a5c9c987 | [
"MIT-0"
] | null | null | null | usr/usertests.asm | AnvithShetty10/xv6_rpi3_port | 93b850b67b2d0ef0fedf8863ba317e52a5c9c987 | [
"MIT-0"
] | null | null | null |
_usertests: file format elf32-littlearm
Disassembly of section .text:
00000000 <opentest>:
0: e92d4800 push {fp, lr}
4: e28db004 add fp, sp, #4
8: e24dd008 sub sp, sp, #8
c: e59f3098 ldr r3, [pc, #152] ; ac <opentest+0xac>
10: e5933000 ldr r3, [r3]
14: e1a00003 mov r0, r3
18: e59f1090 ldr r1, [pc, #144] ; b0 <opentest+0xb0>
1c: eb001256 bl 497c <printf>
20: e59f008c ldr r0, [pc, #140] ; b4 <opentest+0xb4>
24: e3a01000 mov r1, #0
28: eb00118e bl 4668 <open>
2c: e50b0008 str r0, [fp, #-8]
30: e51b3008 ldr r3, [fp, #-8]
34: e3530000 cmp r3, #0
38: aa000005 bge 54 <opentest+0x54>
3c: e59f3068 ldr r3, [pc, #104] ; ac <opentest+0xac>
40: e5933000 ldr r3, [r3]
44: e1a00003 mov r0, r3
48: e59f1068 ldr r1, [pc, #104] ; b8 <opentest+0xb8>
4c: eb00124a bl 497c <printf>
50: eb00113c bl 4548 <exit>
54: e51b0008 ldr r0, [fp, #-8]
58: eb001167 bl 45fc <close>
5c: e59f0058 ldr r0, [pc, #88] ; bc <opentest+0xbc>
60: e3a01000 mov r1, #0
64: eb00117f bl 4668 <open>
68: e50b0008 str r0, [fp, #-8]
6c: e51b3008 ldr r3, [fp, #-8]
70: e3530000 cmp r3, #0
74: ba000005 blt 90 <opentest+0x90>
78: e59f302c ldr r3, [pc, #44] ; ac <opentest+0xac>
7c: e5933000 ldr r3, [r3]
80: e1a00003 mov r0, r3
84: e59f1034 ldr r1, [pc, #52] ; c0 <opentest+0xc0>
88: eb00123b bl 497c <printf>
8c: eb00112d bl 4548 <exit>
90: e59f3014 ldr r3, [pc, #20] ; ac <opentest+0xac>
94: e5933000 ldr r3, [r3]
98: e1a00003 mov r0, r3
9c: e59f1020 ldr r1, [pc, #32] ; c4 <opentest+0xc4>
a0: eb001235 bl 497c <printf>
a4: e24bd004 sub sp, fp, #4
a8: e8bd8800 pop {fp, pc}
ac: 000068c8 .word 0x000068c8
b0: 00005048 .word 0x00005048
b4: 0000502c .word 0x0000502c
b8: 00005054 .word 0x00005054
bc: 00005068 .word 0x00005068
c0: 00005078 .word 0x00005078
c4: 00005098 .word 0x00005098
000000c8 <writetest>:
c8: e92d4800 push {fp, lr}
cc: e28db004 add fp, sp, #4
d0: e24dd008 sub sp, sp, #8
d4: e59f31f0 ldr r3, [pc, #496] ; 2cc <writetest+0x204>
d8: e5933000 ldr r3, [r3]
dc: e1a00003 mov r0, r3
e0: e59f11e8 ldr r1, [pc, #488] ; 2d0 <writetest+0x208>
e4: eb001224 bl 497c <printf>
e8: e59f01e4 ldr r0, [pc, #484] ; 2d4 <writetest+0x20c>
ec: e59f11e4 ldr r1, [pc, #484] ; 2d8 <writetest+0x210>
f0: eb00115c bl 4668 <open>
f4: e50b000c str r0, [fp, #-12]
f8: e51b300c ldr r3, [fp, #-12]
fc: e3530000 cmp r3, #0
100: ba000007 blt 124 <writetest+0x5c>
104: e59f31c0 ldr r3, [pc, #448] ; 2cc <writetest+0x204>
108: e5933000 ldr r3, [r3]
10c: e1a00003 mov r0, r3
110: e59f11c4 ldr r1, [pc, #452] ; 2dc <writetest+0x214>
114: eb001218 bl 497c <printf>
118: e3a03000 mov r3, #0
11c: e50b3008 str r3, [fp, #-8]
120: ea000024 b 1b8 <writetest+0xf0>
124: e59f31a0 ldr r3, [pc, #416] ; 2cc <writetest+0x204>
128: e5933000 ldr r3, [r3]
12c: e1a00003 mov r0, r3
130: e59f11a8 ldr r1, [pc, #424] ; 2e0 <writetest+0x218>
134: eb001210 bl 497c <printf>
138: eb001102 bl 4548 <exit>
13c: e51b000c ldr r0, [fp, #-12]
140: e59f119c ldr r1, [pc, #412] ; 2e4 <writetest+0x21c>
144: e3a0200a mov r2, #10
148: eb001122 bl 45d8 <write>
14c: e1a03000 mov r3, r0
150: e353000a cmp r3, #10
154: 0a000006 beq 174 <writetest+0xac>
158: e59f316c ldr r3, [pc, #364] ; 2cc <writetest+0x204>
15c: e5933000 ldr r3, [r3]
160: e1a00003 mov r0, r3
164: e59f117c ldr r1, [pc, #380] ; 2e8 <writetest+0x220>
168: e51b2008 ldr r2, [fp, #-8]
16c: eb001202 bl 497c <printf>
170: eb0010f4 bl 4548 <exit>
174: e51b000c ldr r0, [fp, #-12]
178: e59f116c ldr r1, [pc, #364] ; 2ec <writetest+0x224>
17c: e3a0200a mov r2, #10
180: eb001114 bl 45d8 <write>
184: e1a03000 mov r3, r0
188: e353000a cmp r3, #10
18c: 0a000006 beq 1ac <writetest+0xe4>
190: e59f3134 ldr r3, [pc, #308] ; 2cc <writetest+0x204>
194: e5933000 ldr r3, [r3]
198: e1a00003 mov r0, r3
19c: e59f114c ldr r1, [pc, #332] ; 2f0 <writetest+0x228>
1a0: e51b2008 ldr r2, [fp, #-8]
1a4: eb0011f4 bl 497c <printf>
1a8: eb0010e6 bl 4548 <exit>
1ac: e51b3008 ldr r3, [fp, #-8]
1b0: e2833001 add r3, r3, #1
1b4: e50b3008 str r3, [fp, #-8]
1b8: e51b3008 ldr r3, [fp, #-8]
1bc: e3530063 cmp r3, #99 ; 0x63
1c0: daffffdd ble 13c <writetest+0x74>
1c4: e59f3100 ldr r3, [pc, #256] ; 2cc <writetest+0x204>
1c8: e5933000 ldr r3, [r3]
1cc: e1a00003 mov r0, r3
1d0: e59f111c ldr r1, [pc, #284] ; 2f4 <writetest+0x22c>
1d4: eb0011e8 bl 497c <printf>
1d8: e51b000c ldr r0, [fp, #-12]
1dc: eb001106 bl 45fc <close>
1e0: e59f00ec ldr r0, [pc, #236] ; 2d4 <writetest+0x20c>
1e4: e3a01000 mov r1, #0
1e8: eb00111e bl 4668 <open>
1ec: e50b000c str r0, [fp, #-12]
1f0: e51b300c ldr r3, [fp, #-12]
1f4: e3530000 cmp r3, #0
1f8: ba00000d blt 234 <writetest+0x16c>
1fc: e59f30c8 ldr r3, [pc, #200] ; 2cc <writetest+0x204>
200: e5933000 ldr r3, [r3]
204: e1a00003 mov r0, r3
208: e59f10e8 ldr r1, [pc, #232] ; 2f8 <writetest+0x230>
20c: eb0011da bl 497c <printf>
210: e51b000c ldr r0, [fp, #-12]
214: e59f10e0 ldr r1, [pc, #224] ; 2fc <writetest+0x234>
218: e3a02e7d mov r2, #2000 ; 0x7d0
21c: eb0010e4 bl 45b4 <read>
220: e50b0008 str r0, [fp, #-8]
224: e51b3008 ldr r3, [fp, #-8]
228: e3530e7d cmp r3, #2000 ; 0x7d0
22c: 1a000013 bne 280 <writetest+0x1b8>
230: ea000005 b 24c <writetest+0x184>
234: e59f3090 ldr r3, [pc, #144] ; 2cc <writetest+0x204>
238: e5933000 ldr r3, [r3]
23c: e1a00003 mov r0, r3
240: e59f10b8 ldr r1, [pc, #184] ; 300 <writetest+0x238>
244: eb0011cc bl 497c <printf>
248: eb0010be bl 4548 <exit>
24c: e59f3078 ldr r3, [pc, #120] ; 2cc <writetest+0x204>
250: e5933000 ldr r3, [r3]
254: e1a00003 mov r0, r3
258: e59f10a4 ldr r1, [pc, #164] ; 304 <writetest+0x23c>
25c: eb0011c6 bl 497c <printf>
260: e51b000c ldr r0, [fp, #-12]
264: eb0010e4 bl 45fc <close>
268: e59f0064 ldr r0, [pc, #100] ; 2d4 <writetest+0x20c>
26c: eb00110f bl 46b0 <unlink>
270: e1a03000 mov r3, r0
274: e3530000 cmp r3, #0
278: aa00000c bge 2b0 <writetest+0x1e8>
27c: ea000005 b 298 <writetest+0x1d0>
280: e59f3044 ldr r3, [pc, #68] ; 2cc <writetest+0x204>
284: e5933000 ldr r3, [r3]
288: e1a00003 mov r0, r3
28c: e59f1074 ldr r1, [pc, #116] ; 308 <writetest+0x240>
290: eb0011b9 bl 497c <printf>
294: eb0010ab bl 4548 <exit>
298: e59f302c ldr r3, [pc, #44] ; 2cc <writetest+0x204>
29c: e5933000 ldr r3, [r3]
2a0: e1a00003 mov r0, r3
2a4: e59f1060 ldr r1, [pc, #96] ; 30c <writetest+0x244>
2a8: eb0011b3 bl 497c <printf>
2ac: eb0010a5 bl 4548 <exit>
2b0: e59f3014 ldr r3, [pc, #20] ; 2cc <writetest+0x204>
2b4: e5933000 ldr r3, [r3]
2b8: e1a00003 mov r0, r3
2bc: e59f104c ldr r1, [pc, #76] ; 310 <writetest+0x248>
2c0: eb0011ad bl 497c <printf>
2c4: e24bd004 sub sp, fp, #4
2c8: e8bd8800 pop {fp, pc}
2cc: 000068c8 .word 0x000068c8
2d0: 000050a8 .word 0x000050a8
2d4: 000050bc .word 0x000050bc
2d8: 00000202 .word 0x00000202
2dc: 000050c4 .word 0x000050c4
2e0: 000050e0 .word 0x000050e0
2e4: 000050fc .word 0x000050fc
2e8: 00005108 .word 0x00005108
2ec: 0000512c .word 0x0000512c
2f0: 00005138 .word 0x00005138
2f4: 0000515c .word 0x0000515c
2f8: 00005168 .word 0x00005168
2fc: 00009080 .word 0x00009080
300: 00005184 .word 0x00005184
304: 000051a0 .word 0x000051a0
308: 000051b4 .word 0x000051b4
30c: 000051c4 .word 0x000051c4
310: 000051dc .word 0x000051dc
00000314 <writetest1>:
314: e92d4800 push {fp, lr}
318: e28db004 add fp, sp, #4
31c: e24dd010 sub sp, sp, #16
320: e59f31fc ldr r3, [pc, #508] ; 524 <writetest1+0x210>
324: e5933000 ldr r3, [r3]
328: e1a00003 mov r0, r3
32c: e59f11f4 ldr r1, [pc, #500] ; 528 <writetest1+0x214>
330: eb001191 bl 497c <printf>
334: e59f01f0 ldr r0, [pc, #496] ; 52c <writetest1+0x218>
338: e59f11f0 ldr r1, [pc, #496] ; 530 <writetest1+0x21c>
33c: eb0010c9 bl 4668 <open>
340: e50b0010 str r0, [fp, #-16]
344: e51b3010 ldr r3, [fp, #-16]
348: e3530000 cmp r3, #0
34c: aa000005 bge 368 <writetest1+0x54>
350: e59f31cc ldr r3, [pc, #460] ; 524 <writetest1+0x210>
354: e5933000 ldr r3, [r3]
358: e1a00003 mov r0, r3
35c: e59f11d0 ldr r1, [pc, #464] ; 534 <writetest1+0x220>
360: eb001185 bl 497c <printf>
364: eb001077 bl 4548 <exit>
368: e3a03000 mov r3, #0
36c: e50b3008 str r3, [fp, #-8]
370: ea000013 b 3c4 <writetest1+0xb0>
374: e59f21bc ldr r2, [pc, #444] ; 538 <writetest1+0x224>
378: e51b3008 ldr r3, [fp, #-8]
37c: e5823000 str r3, [r2]
380: e51b0010 ldr r0, [fp, #-16]
384: e59f11ac ldr r1, [pc, #428] ; 538 <writetest1+0x224>
388: e3a02c02 mov r2, #512 ; 0x200
38c: eb001091 bl 45d8 <write>
390: e1a03000 mov r3, r0
394: e3530c02 cmp r3, #512 ; 0x200
398: 0a000006 beq 3b8 <writetest1+0xa4>
39c: e59f3180 ldr r3, [pc, #384] ; 524 <writetest1+0x210>
3a0: e5933000 ldr r3, [r3]
3a4: e1a00003 mov r0, r3
3a8: e59f118c ldr r1, [pc, #396] ; 53c <writetest1+0x228>
3ac: e51b2008 ldr r2, [fp, #-8]
3b0: eb001171 bl 497c <printf>
3b4: eb001063 bl 4548 <exit>
3b8: e51b3008 ldr r3, [fp, #-8]
3bc: e2833001 add r3, r3, #1
3c0: e50b3008 str r3, [fp, #-8]
3c4: e51b3008 ldr r3, [fp, #-8]
3c8: e353008b cmp r3, #139 ; 0x8b
3cc: 9affffe8 bls 374 <writetest1+0x60>
3d0: e51b0010 ldr r0, [fp, #-16]
3d4: eb001088 bl 45fc <close>
3d8: e59f014c ldr r0, [pc, #332] ; 52c <writetest1+0x218>
3dc: e3a01000 mov r1, #0
3e0: eb0010a0 bl 4668 <open>
3e4: e50b0010 str r0, [fp, #-16]
3e8: e51b3010 ldr r3, [fp, #-16]
3ec: e3530000 cmp r3, #0
3f0: aa000005 bge 40c <writetest1+0xf8>
3f4: e59f3128 ldr r3, [pc, #296] ; 524 <writetest1+0x210>
3f8: e5933000 ldr r3, [r3]
3fc: e1a00003 mov r0, r3
400: e59f1138 ldr r1, [pc, #312] ; 540 <writetest1+0x22c>
404: eb00115c bl 497c <printf>
408: eb00104e bl 4548 <exit>
40c: e3a03000 mov r3, #0
410: e50b300c str r3, [fp, #-12]
414: e51b0010 ldr r0, [fp, #-16]
418: e59f1118 ldr r1, [pc, #280] ; 538 <writetest1+0x224>
41c: e3a02c02 mov r2, #512 ; 0x200
420: eb001063 bl 45b4 <read>
424: e50b0008 str r0, [fp, #-8]
428: e51b3008 ldr r3, [fp, #-8]
42c: e3530000 cmp r3, #0
430: 1a000012 bne 480 <writetest1+0x16c>
434: e51b300c ldr r3, [fp, #-12]
438: e353008b cmp r3, #139 ; 0x8b
43c: 1a000006 bne 45c <writetest1+0x148>
440: e59f30dc ldr r3, [pc, #220] ; 524 <writetest1+0x210>
444: e5933000 ldr r3, [r3]
448: e1a00003 mov r0, r3
44c: e59f10f0 ldr r1, [pc, #240] ; 544 <writetest1+0x230>
450: e51b200c ldr r2, [fp, #-12]
454: eb001148 bl 497c <printf>
458: eb00103a bl 4548 <exit>
45c: e1a00000 nop ; (mov r0, r0)
460: e51b0010 ldr r0, [fp, #-16]
464: eb001064 bl 45fc <close>
468: e59f00bc ldr r0, [pc, #188] ; 52c <writetest1+0x218>
46c: eb00108f bl 46b0 <unlink>
470: e1a03000 mov r3, r0
474: e3530000 cmp r3, #0
478: aa000022 bge 508 <writetest1+0x1f4>
47c: ea00001b b 4f0 <writetest1+0x1dc>
480: e51b3008 ldr r3, [fp, #-8]
484: e3530c02 cmp r3, #512 ; 0x200
488: 0a000006 beq 4a8 <writetest1+0x194>
48c: e59f3090 ldr r3, [pc, #144] ; 524 <writetest1+0x210>
490: e5933000 ldr r3, [r3]
494: e1a00003 mov r0, r3
498: e59f10a8 ldr r1, [pc, #168] ; 548 <writetest1+0x234>
49c: e51b2008 ldr r2, [fp, #-8]
4a0: eb001135 bl 497c <printf>
4a4: eb001027 bl 4548 <exit>
4a8: e59f3088 ldr r3, [pc, #136] ; 538 <writetest1+0x224>
4ac: e5932000 ldr r2, [r3]
4b0: e51b300c ldr r3, [fp, #-12]
4b4: e1520003 cmp r2, r3
4b8: 0a000008 beq 4e0 <writetest1+0x1cc>
4bc: e59f3060 ldr r3, [pc, #96] ; 524 <writetest1+0x210>
4c0: e5932000 ldr r2, [r3]
4c4: e59f306c ldr r3, [pc, #108] ; 538 <writetest1+0x224>
4c8: e5933000 ldr r3, [r3]
4cc: e1a00002 mov r0, r2
4d0: e59f1074 ldr r1, [pc, #116] ; 54c <writetest1+0x238>
4d4: e51b200c ldr r2, [fp, #-12]
4d8: eb001127 bl 497c <printf>
4dc: eb001019 bl 4548 <exit>
4e0: e51b300c ldr r3, [fp, #-12]
4e4: e2833001 add r3, r3, #1
4e8: e50b300c str r3, [fp, #-12]
4ec: eaffffc8 b 414 <writetest1+0x100>
4f0: e59f302c ldr r3, [pc, #44] ; 524 <writetest1+0x210>
4f4: e5933000 ldr r3, [r3]
4f8: e1a00003 mov r0, r3
4fc: e59f104c ldr r1, [pc, #76] ; 550 <writetest1+0x23c>
500: eb00111d bl 497c <printf>
504: eb00100f bl 4548 <exit>
508: e59f3014 ldr r3, [pc, #20] ; 524 <writetest1+0x210>
50c: e5933000 ldr r3, [r3]
510: e1a00003 mov r0, r3
514: e59f1038 ldr r1, [pc, #56] ; 554 <writetest1+0x240>
518: eb001117 bl 497c <printf>
51c: e24bd004 sub sp, fp, #4
520: e8bd8800 pop {fp, pc}
524: 000068c8 .word 0x000068c8
528: 000051f0 .word 0x000051f0
52c: 00005200 .word 0x00005200
530: 00000202 .word 0x00000202
534: 00005204 .word 0x00005204
538: 00009080 .word 0x00009080
53c: 00005220 .word 0x00005220
540: 00005240 .word 0x00005240
544: 0000525c .word 0x0000525c
548: 0000527c .word 0x0000527c
54c: 0000528c .word 0x0000528c
550: 000052ac .word 0x000052ac
554: 000052c0 .word 0x000052c0
00000558 <createtest>:
558: e92d4800 push {fp, lr}
55c: e28db004 add fp, sp, #4
560: e24dd008 sub sp, sp, #8
564: e59f30f0 ldr r3, [pc, #240] ; 65c <createtest+0x104>
568: e5933000 ldr r3, [r3]
56c: e1a00003 mov r0, r3
570: e59f10e8 ldr r1, [pc, #232] ; 660 <createtest+0x108>
574: eb001100 bl 497c <printf>
578: e59f30e4 ldr r3, [pc, #228] ; 664 <createtest+0x10c>
57c: e3a02061 mov r2, #97 ; 0x61
580: e5c32000 strb r2, [r3]
584: e59f30d8 ldr r3, [pc, #216] ; 664 <createtest+0x10c>
588: e3a02000 mov r2, #0
58c: e5c32002 strb r2, [r3, #2]
590: e3a03000 mov r3, #0
594: e50b3008 str r3, [fp, #-8]
598: ea00000e b 5d8 <createtest+0x80>
59c: e51b3008 ldr r3, [fp, #-8]
5a0: e6ef3073 uxtb r3, r3
5a4: e2833030 add r3, r3, #48 ; 0x30
5a8: e6ef2073 uxtb r2, r3
5ac: e59f30b0 ldr r3, [pc, #176] ; 664 <createtest+0x10c>
5b0: e5c32001 strb r2, [r3, #1]
5b4: e59f00a8 ldr r0, [pc, #168] ; 664 <createtest+0x10c>
5b8: e59f10a8 ldr r1, [pc, #168] ; 668 <createtest+0x110>
5bc: eb001029 bl 4668 <open>
5c0: e50b000c str r0, [fp, #-12]
5c4: e51b000c ldr r0, [fp, #-12]
5c8: eb00100b bl 45fc <close>
5cc: e51b3008 ldr r3, [fp, #-8]
5d0: e2833001 add r3, r3, #1
5d4: e50b3008 str r3, [fp, #-8]
5d8: e51b3008 ldr r3, [fp, #-8]
5dc: e3530033 cmp r3, #51 ; 0x33
5e0: daffffed ble 59c <createtest+0x44>
5e4: e59f3078 ldr r3, [pc, #120] ; 664 <createtest+0x10c>
5e8: e3a02061 mov r2, #97 ; 0x61
5ec: e5c32000 strb r2, [r3]
5f0: e59f306c ldr r3, [pc, #108] ; 664 <createtest+0x10c>
5f4: e3a02000 mov r2, #0
5f8: e5c32002 strb r2, [r3, #2]
5fc: e3a03000 mov r3, #0
600: e50b3008 str r3, [fp, #-8]
604: ea00000a b 634 <createtest+0xdc>
608: e51b3008 ldr r3, [fp, #-8]
60c: e6ef3073 uxtb r3, r3
610: e2833030 add r3, r3, #48 ; 0x30
614: e6ef2073 uxtb r2, r3
618: e59f3044 ldr r3, [pc, #68] ; 664 <createtest+0x10c>
61c: e5c32001 strb r2, [r3, #1]
620: e59f003c ldr r0, [pc, #60] ; 664 <createtest+0x10c>
624: eb001021 bl 46b0 <unlink>
628: e51b3008 ldr r3, [fp, #-8]
62c: e2833001 add r3, r3, #1
630: e50b3008 str r3, [fp, #-8]
634: e51b3008 ldr r3, [fp, #-8]
638: e3530033 cmp r3, #51 ; 0x33
63c: dafffff1 ble 608 <createtest+0xb0>
640: e59f3014 ldr r3, [pc, #20] ; 65c <createtest+0x104>
644: e5933000 ldr r3, [r3]
648: e1a00003 mov r0, r3
64c: e59f1018 ldr r1, [pc, #24] ; 66c <createtest+0x114>
650: eb0010c9 bl 497c <printf>
654: e24bd004 sub sp, fp, #4
658: e8bd8800 pop {fp, pc}
65c: 000068c8 .word 0x000068c8
660: 000052d0 .word 0x000052d0
664: 0000b080 .word 0x0000b080
668: 00000202 .word 0x00000202
66c: 000052f8 .word 0x000052f8
00000670 <dirtest>:
670: e92d4800 push {fp, lr}
674: e28db004 add fp, sp, #4
678: e59f30d4 ldr r3, [pc, #212] ; 754 <dirtest+0xe4>
67c: e5933000 ldr r3, [r3]
680: e1a00003 mov r0, r3
684: e59f10cc ldr r1, [pc, #204] ; 758 <dirtest+0xe8>
688: eb0010bb bl 497c <printf>
68c: e59f00c8 ldr r0, [pc, #200] ; 75c <dirtest+0xec>
690: eb001021 bl 471c <mkdir>
694: e1a03000 mov r3, r0
698: e3530000 cmp r3, #0
69c: aa000005 bge 6b8 <dirtest+0x48>
6a0: e59f30ac ldr r3, [pc, #172] ; 754 <dirtest+0xe4>
6a4: e5933000 ldr r3, [r3]
6a8: e1a00003 mov r0, r3
6ac: e59f10ac ldr r1, [pc, #172] ; 760 <dirtest+0xf0>
6b0: eb0010b1 bl 497c <printf>
6b4: eb000fa3 bl 4548 <exit>
6b8: e59f009c ldr r0, [pc, #156] ; 75c <dirtest+0xec>
6bc: eb00101f bl 4740 <chdir>
6c0: e1a03000 mov r3, r0
6c4: e3530000 cmp r3, #0
6c8: aa000005 bge 6e4 <dirtest+0x74>
6cc: e59f3080 ldr r3, [pc, #128] ; 754 <dirtest+0xe4>
6d0: e5933000 ldr r3, [r3]
6d4: e1a00003 mov r0, r3
6d8: e59f1084 ldr r1, [pc, #132] ; 764 <dirtest+0xf4>
6dc: eb0010a6 bl 497c <printf>
6e0: eb000f98 bl 4548 <exit>
6e4: e59f007c ldr r0, [pc, #124] ; 768 <dirtest+0xf8>
6e8: eb001014 bl 4740 <chdir>
6ec: e1a03000 mov r3, r0
6f0: e3530000 cmp r3, #0
6f4: aa000005 bge 710 <dirtest+0xa0>
6f8: e59f3054 ldr r3, [pc, #84] ; 754 <dirtest+0xe4>
6fc: e5933000 ldr r3, [r3]
700: e1a00003 mov r0, r3
704: e59f1060 ldr r1, [pc, #96] ; 76c <dirtest+0xfc>
708: eb00109b bl 497c <printf>
70c: eb000f8d bl 4548 <exit>
710: e59f0044 ldr r0, [pc, #68] ; 75c <dirtest+0xec>
714: eb000fe5 bl 46b0 <unlink>
718: e1a03000 mov r3, r0
71c: e3530000 cmp r3, #0
720: aa000005 bge 73c <dirtest+0xcc>
724: e59f3028 ldr r3, [pc, #40] ; 754 <dirtest+0xe4>
728: e5933000 ldr r3, [r3]
72c: e1a00003 mov r0, r3
730: e59f1038 ldr r1, [pc, #56] ; 770 <dirtest+0x100>
734: eb001090 bl 497c <printf>
738: eb000f82 bl 4548 <exit>
73c: e59f3010 ldr r3, [pc, #16] ; 754 <dirtest+0xe4>
740: e5933000 ldr r3, [r3]
744: e1a00003 mov r0, r3
748: e59f1008 ldr r1, [pc, #8] ; 758 <dirtest+0xe8>
74c: eb00108a bl 497c <printf>
750: e8bd8800 pop {fp, pc}
754: 000068c8 .word 0x000068c8
758: 00005320 .word 0x00005320
75c: 0000532c .word 0x0000532c
760: 00005334 .word 0x00005334
764: 00005344 .word 0x00005344
768: 00005358 .word 0x00005358
76c: 0000535c .word 0x0000535c
770: 00005370 .word 0x00005370
00000774 <exectest>:
774: e92d4800 push {fp, lr}
778: e28db004 add fp, sp, #4
77c: e59f3040 ldr r3, [pc, #64] ; 7c4 <exectest+0x50>
780: e5933000 ldr r3, [r3]
784: e1a00003 mov r0, r3
788: e59f1038 ldr r1, [pc, #56] ; 7c8 <exectest+0x54>
78c: eb00107a bl 497c <printf>
790: e59f0034 ldr r0, [pc, #52] ; 7cc <exectest+0x58>
794: e59f1034 ldr r1, [pc, #52] ; 7d0 <exectest+0x5c>
798: eb000fa9 bl 4644 <exec>
79c: e1a03000 mov r3, r0
7a0: e3530000 cmp r3, #0
7a4: aa000005 bge 7c0 <exectest+0x4c>
7a8: e59f3014 ldr r3, [pc, #20] ; 7c4 <exectest+0x50>
7ac: e5933000 ldr r3, [r3]
7b0: e1a00003 mov r0, r3
7b4: e59f1018 ldr r1, [pc, #24] ; 7d4 <exectest+0x60>
7b8: eb00106f bl 497c <printf>
7bc: eb000f61 bl 4548 <exit>
7c0: e8bd8800 pop {fp, pc}
7c4: 000068c8 .word 0x000068c8
7c8: 00005384 .word 0x00005384
7cc: 0000502c .word 0x0000502c
7d0: 000068b4 .word 0x000068b4
7d4: 00005390 .word 0x00005390
000007d8 <pipe1>:
7d8: e92d4800 push {fp, lr}
7dc: e28db004 add fp, sp, #4
7e0: e24dd020 sub sp, sp, #32
7e4: e3a00001 mov r0, #1
7e8: e59f1238 ldr r1, [pc, #568] ; a28 <pipe1+0x250>
7ec: eb001062 bl 497c <printf>
7f0: e24b3024 sub r3, fp, #36 ; 0x24
7f4: e1a00003 mov r0, r3
7f8: eb000f64 bl 4590 <pipe>
7fc: e1a03000 mov r3, r0
800: e3530000 cmp r3, #0
804: 0a000003 beq 818 <pipe1+0x40>
808: e3a00001 mov r0, #1
80c: e59f1218 ldr r1, [pc, #536] ; a2c <pipe1+0x254>
810: eb001059 bl 497c <printf>
814: eb000f4b bl 4548 <exit>
818: eb000f41 bl 4524 <fork>
81c: e50b001c str r0, [fp, #-28] ; 0xffffffe4
820: e3a03000 mov r3, #0
824: e50b3008 str r3, [fp, #-8]
828: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
82c: e3530000 cmp r3, #0
830: 1a00002c bne 8e8 <pipe1+0x110>
834: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
838: e1a00003 mov r0, r3
83c: eb000f6e bl 45fc <close>
840: e3a03000 mov r3, #0
844: e50b3010 str r3, [fp, #-16]
848: ea000022 b 8d8 <pipe1+0x100>
84c: e3a03000 mov r3, #0
850: e50b300c str r3, [fp, #-12]
854: ea00000b b 888 <pipe1+0xb0>
858: e51b3008 ldr r3, [fp, #-8]
85c: e2832001 add r2, r3, #1
860: e50b2008 str r2, [fp, #-8]
864: e6ef1073 uxtb r1, r3
868: e59f21c0 ldr r2, [pc, #448] ; a30 <pipe1+0x258>
86c: e51b300c ldr r3, [fp, #-12]
870: e0823003 add r3, r2, r3
874: e1a02001 mov r2, r1
878: e5c32000 strb r2, [r3]
87c: e51b300c ldr r3, [fp, #-12]
880: e2833001 add r3, r3, #1
884: e50b300c str r3, [fp, #-12]
888: e51b300c ldr r3, [fp, #-12]
88c: e59f21a0 ldr r2, [pc, #416] ; a34 <pipe1+0x25c>
890: e1530002 cmp r3, r2
894: daffffef ble 858 <pipe1+0x80>
898: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
89c: e1a00003 mov r0, r3
8a0: e59f1188 ldr r1, [pc, #392] ; a30 <pipe1+0x258>
8a4: e59f218c ldr r2, [pc, #396] ; a38 <pipe1+0x260>
8a8: eb000f4a bl 45d8 <write>
8ac: e1a02000 mov r2, r0
8b0: e59f3180 ldr r3, [pc, #384] ; a38 <pipe1+0x260>
8b4: e1520003 cmp r2, r3
8b8: 0a000003 beq 8cc <pipe1+0xf4>
8bc: e3a00001 mov r0, #1
8c0: e59f1174 ldr r1, [pc, #372] ; a3c <pipe1+0x264>
8c4: eb00102c bl 497c <printf>
8c8: eb000f1e bl 4548 <exit>
8cc: e51b3010 ldr r3, [fp, #-16]
8d0: e2833001 add r3, r3, #1
8d4: e50b3010 str r3, [fp, #-16]
8d8: e51b3010 ldr r3, [fp, #-16]
8dc: e3530004 cmp r3, #4
8e0: daffffd9 ble 84c <pipe1+0x74>
8e4: eb000f17 bl 4548 <exit>
8e8: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
8ec: e3530000 cmp r3, #0
8f0: da000046 ble a10 <pipe1+0x238>
8f4: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
8f8: e1a00003 mov r0, r3
8fc: eb000f3e bl 45fc <close>
900: e3a03000 mov r3, #0
904: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
908: e3a03001 mov r3, #1
90c: e50b3014 str r3, [fp, #-20] ; 0xffffffec
910: ea000024 b 9a8 <pipe1+0x1d0>
914: e3a03000 mov r3, #0
918: e50b300c str r3, [fp, #-12]
91c: ea000011 b 968 <pipe1+0x190>
920: e59f2108 ldr r2, [pc, #264] ; a30 <pipe1+0x258>
924: e51b300c ldr r3, [fp, #-12]
928: e0823003 add r3, r2, r3
92c: e5d33000 ldrb r3, [r3]
930: e1a01003 mov r1, r3
934: e51b3008 ldr r3, [fp, #-8]
938: e2832001 add r2, r3, #1
93c: e50b2008 str r2, [fp, #-8]
940: e6ef3073 uxtb r3, r3
944: e1510003 cmp r1, r3
948: 0a000003 beq 95c <pipe1+0x184>
94c: e3a00001 mov r0, #1
950: e59f10e8 ldr r1, [pc, #232] ; a40 <pipe1+0x268>
954: eb001008 bl 497c <printf>
958: ea000030 b a20 <pipe1+0x248>
95c: e51b300c ldr r3, [fp, #-12]
960: e2833001 add r3, r3, #1
964: e50b300c str r3, [fp, #-12]
968: e51b200c ldr r2, [fp, #-12]
96c: e51b3010 ldr r3, [fp, #-16]
970: e1520003 cmp r2, r3
974: baffffe9 blt 920 <pipe1+0x148>
978: e51b2018 ldr r2, [fp, #-24] ; 0xffffffe8
97c: e51b3010 ldr r3, [fp, #-16]
980: e0823003 add r3, r2, r3
984: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
988: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
98c: e1a03083 lsl r3, r3, #1
990: e50b3014 str r3, [fp, #-20] ; 0xffffffec
994: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
998: e3530a02 cmp r3, #8192 ; 0x2000
99c: 9a000001 bls 9a8 <pipe1+0x1d0>
9a0: e3a03a02 mov r3, #8192 ; 0x2000
9a4: e50b3014 str r3, [fp, #-20] ; 0xffffffec
9a8: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
9ac: e1a00003 mov r0, r3
9b0: e59f1078 ldr r1, [pc, #120] ; a30 <pipe1+0x258>
9b4: e51b2014 ldr r2, [fp, #-20] ; 0xffffffec
9b8: eb000efd bl 45b4 <read>
9bc: e50b0010 str r0, [fp, #-16]
9c0: e51b3010 ldr r3, [fp, #-16]
9c4: e3530000 cmp r3, #0
9c8: caffffd1 bgt 914 <pipe1+0x13c>
9cc: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
9d0: e59f206c ldr r2, [pc, #108] ; a44 <pipe1+0x26c>
9d4: e1530002 cmp r3, r2
9d8: 0a000004 beq 9f0 <pipe1+0x218>
9dc: e3a00001 mov r0, #1
9e0: e59f1060 ldr r1, [pc, #96] ; a48 <pipe1+0x270>
9e4: e51b2018 ldr r2, [fp, #-24] ; 0xffffffe8
9e8: eb000fe3 bl 497c <printf>
9ec: eb000ed5 bl 4548 <exit>
9f0: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
9f4: e1a00003 mov r0, r3
9f8: eb000eff bl 45fc <close>
9fc: eb000eda bl 456c <wait>
a00: e3a00001 mov r0, #1
a04: e59f1040 ldr r1, [pc, #64] ; a4c <pipe1+0x274>
a08: eb000fdb bl 497c <printf>
a0c: ea000003 b a20 <pipe1+0x248>
a10: e3a00001 mov r0, #1
a14: e59f1034 ldr r1, [pc, #52] ; a50 <pipe1+0x278>
a18: eb000fd7 bl 497c <printf>
a1c: eb000ec9 bl 4548 <exit>
a20: e24bd004 sub sp, fp, #4
a24: e8bd8800 pop {fp, pc}
a28: 000053a4 .word 0x000053a4
a2c: 000053b0 .word 0x000053b0
a30: 00009080 .word 0x00009080
a34: 00000408 .word 0x00000408
a38: 00000409 .word 0x00000409
a3c: 000053c0 .word 0x000053c0
a40: 000053d0 .word 0x000053d0
a44: 0000142d .word 0x0000142d
a48: 000053e0 .word 0x000053e0
a4c: 00005408 .word 0x00005408
a50: 000053f8 .word 0x000053f8
00000a54 <preempt>:
a54: e92d4800 push {fp, lr}
a58: e28db004 add fp, sp, #4
a5c: e24dd018 sub sp, sp, #24
a60: e3a00001 mov r0, #1
a64: e59f1130 ldr r1, [pc, #304] ; b9c <preempt+0x148>
a68: eb000fc3 bl 497c <printf>
a6c: eb000eac bl 4524 <fork>
a70: e50b0008 str r0, [fp, #-8]
a74: e51b3008 ldr r3, [fp, #-8]
a78: e3530000 cmp r3, #0
a7c: 1a000000 bne a84 <preempt+0x30>
a80: eafffffe b a80 <preempt+0x2c>
a84: eb000ea6 bl 4524 <fork>
a88: e50b000c str r0, [fp, #-12]
a8c: e51b300c ldr r3, [fp, #-12]
a90: e3530000 cmp r3, #0
a94: 1a000000 bne a9c <preempt+0x48>
a98: eafffffe b a98 <preempt+0x44>
a9c: e24b3018 sub r3, fp, #24
aa0: e1a00003 mov r0, r3
aa4: eb000eb9 bl 4590 <pipe>
aa8: eb000e9d bl 4524 <fork>
aac: e50b0010 str r0, [fp, #-16]
ab0: e51b3010 ldr r3, [fp, #-16]
ab4: e3530000 cmp r3, #0
ab8: 1a000011 bne b04 <preempt+0xb0>
abc: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
ac0: e1a00003 mov r0, r3
ac4: eb000ecc bl 45fc <close>
ac8: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
acc: e1a00003 mov r0, r3
ad0: e59f10c8 ldr r1, [pc, #200] ; ba0 <preempt+0x14c>
ad4: e3a02001 mov r2, #1
ad8: eb000ebe bl 45d8 <write>
adc: e1a03000 mov r3, r0
ae0: e3530001 cmp r3, #1
ae4: 0a000002 beq af4 <preempt+0xa0>
ae8: e3a00001 mov r0, #1
aec: e59f10b0 ldr r1, [pc, #176] ; ba4 <preempt+0x150>
af0: eb000fa1 bl 497c <printf>
af4: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
af8: e1a00003 mov r0, r3
afc: eb000ebe bl 45fc <close>
b00: eafffffe b b00 <preempt+0xac>
b04: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
b08: e1a00003 mov r0, r3
b0c: eb000eba bl 45fc <close>
b10: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
b14: e1a00003 mov r0, r3
b18: e59f1088 ldr r1, [pc, #136] ; ba8 <preempt+0x154>
b1c: e3a02a02 mov r2, #8192 ; 0x2000
b20: eb000ea3 bl 45b4 <read>
b24: e1a03000 mov r3, r0
b28: e3530001 cmp r3, #1
b2c: 0a000003 beq b40 <preempt+0xec>
b30: e3a00001 mov r0, #1
b34: e59f1070 ldr r1, [pc, #112] ; bac <preempt+0x158>
b38: eb000f8f bl 497c <printf>
b3c: ea000014 b b94 <preempt+0x140>
b40: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
b44: e1a00003 mov r0, r3
b48: eb000eab bl 45fc <close>
b4c: e3a00001 mov r0, #1
b50: e59f1058 ldr r1, [pc, #88] ; bb0 <preempt+0x15c>
b54: eb000f88 bl 497c <printf>
b58: e51b0008 ldr r0, [fp, #-8]
b5c: eb000eaf bl 4620 <kill>
b60: e51b000c ldr r0, [fp, #-12]
b64: eb000ead bl 4620 <kill>
b68: e51b0010 ldr r0, [fp, #-16]
b6c: eb000eab bl 4620 <kill>
b70: e3a00001 mov r0, #1
b74: e59f1038 ldr r1, [pc, #56] ; bb4 <preempt+0x160>
b78: eb000f7f bl 497c <printf>
b7c: eb000e7a bl 456c <wait>
b80: eb000e79 bl 456c <wait>
b84: eb000e78 bl 456c <wait>
b88: e3a00001 mov r0, #1
b8c: e59f1024 ldr r1, [pc, #36] ; bb8 <preempt+0x164>
b90: eb000f79 bl 497c <printf>
b94: e24bd004 sub sp, fp, #4
b98: e8bd8800 pop {fp, pc}
b9c: 00005414 .word 0x00005414
ba0: 00005420 .word 0x00005420
ba4: 00005424 .word 0x00005424
ba8: 00009080 .word 0x00009080
bac: 00005438 .word 0x00005438
bb0: 0000544c .word 0x0000544c
bb4: 00005458 .word 0x00005458
bb8: 00005464 .word 0x00005464
00000bbc <exitwait>:
bbc: e92d4800 push {fp, lr}
bc0: e28db004 add fp, sp, #4
bc4: e24dd008 sub sp, sp, #8
bc8: e3a03000 mov r3, #0
bcc: e50b3008 str r3, [fp, #-8]
bd0: ea000018 b c38 <exitwait+0x7c>
bd4: eb000e52 bl 4524 <fork>
bd8: e50b000c str r0, [fp, #-12]
bdc: e51b300c ldr r3, [fp, #-12]
be0: e3530000 cmp r3, #0
be4: aa000003 bge bf8 <exitwait+0x3c>
be8: e3a00001 mov r0, #1
bec: e59f1064 ldr r1, [pc, #100] ; c58 <exitwait+0x9c>
bf0: eb000f61 bl 497c <printf>
bf4: ea000015 b c50 <exitwait+0x94>
bf8: e51b300c ldr r3, [fp, #-12]
bfc: e3530000 cmp r3, #0
c00: 0a000008 beq c28 <exitwait+0x6c>
c04: eb000e58 bl 456c <wait>
c08: e1a02000 mov r2, r0
c0c: e51b300c ldr r3, [fp, #-12]
c10: e1520003 cmp r2, r3
c14: 0a000004 beq c2c <exitwait+0x70>
c18: e3a00001 mov r0, #1
c1c: e59f1038 ldr r1, [pc, #56] ; c5c <exitwait+0xa0>
c20: eb000f55 bl 497c <printf>
c24: ea000009 b c50 <exitwait+0x94>
c28: eb000e46 bl 4548 <exit>
c2c: e51b3008 ldr r3, [fp, #-8]
c30: e2833001 add r3, r3, #1
c34: e50b3008 str r3, [fp, #-8]
c38: e51b3008 ldr r3, [fp, #-8]
c3c: e3530063 cmp r3, #99 ; 0x63
c40: daffffe3 ble bd4 <exitwait+0x18>
c44: e3a00001 mov r0, #1
c48: e59f1010 ldr r1, [pc, #16] ; c60 <exitwait+0xa4>
c4c: eb000f4a bl 497c <printf>
c50: e24bd004 sub sp, fp, #4
c54: e8bd8800 pop {fp, pc}
c58: 00005470 .word 0x00005470
c5c: 00005480 .word 0x00005480
c60: 00005490 .word 0x00005490
00000c64 <mem>:
c64: e92d4800 push {fp, lr}
c68: e28db004 add fp, sp, #4
c6c: e24dd010 sub sp, sp, #16
c70: e3a00001 mov r0, #1
c74: e59f1108 ldr r1, [pc, #264] ; d84 <mem+0x120>
c78: eb000f3f bl 497c <printf>
c7c: eb000ec1 bl 4788 <getpid>
c80: e50b000c str r0, [fp, #-12]
c84: eb000e26 bl 4524 <fork>
c88: e50b0010 str r0, [fp, #-16]
c8c: e51b3010 ldr r3, [fp, #-16]
c90: e3530000 cmp r3, #0
c94: 1a000030 bne d5c <mem+0xf8>
c98: e3a03000 mov r3, #0
c9c: e50b3008 str r3, [fp, #-8]
ca0: e3a00001 mov r0, #1
ca4: e59f10dc ldr r1, [pc, #220] ; d88 <mem+0x124>
ca8: eb000f33 bl 497c <printf>
cac: ea000004 b cc4 <mem+0x60>
cb0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
cb4: e51b2008 ldr r2, [fp, #-8]
cb8: e5832000 str r2, [r3]
cbc: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
cc0: e50b3008 str r3, [fp, #-8]
cc4: e59f00c0 ldr r0, [pc, #192] ; d8c <mem+0x128>
cc8: eb001037 bl 4dac <malloc>
ccc: e50b0014 str r0, [fp, #-20] ; 0xffffffec
cd0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
cd4: e3530000 cmp r3, #0
cd8: 1afffff4 bne cb0 <mem+0x4c>
cdc: ea000006 b cfc <mem+0x98>
ce0: e51b3008 ldr r3, [fp, #-8]
ce4: e5933000 ldr r3, [r3]
ce8: e50b3014 str r3, [fp, #-20] ; 0xffffffec
cec: e51b0008 ldr r0, [fp, #-8]
cf0: eb000fad bl 4bac <free>
cf4: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
cf8: e50b3008 str r3, [fp, #-8]
cfc: e51b3008 ldr r3, [fp, #-8]
d00: e3530000 cmp r3, #0
d04: 1afffff5 bne ce0 <mem+0x7c>
d08: e3a00001 mov r0, #1
d0c: e59f107c ldr r1, [pc, #124] ; d90 <mem+0x12c>
d10: eb000f19 bl 497c <printf>
d14: e3a00a05 mov r0, #20480 ; 0x5000
d18: eb001023 bl 4dac <malloc>
d1c: e50b0008 str r0, [fp, #-8]
d20: e51b3008 ldr r3, [fp, #-8]
d24: e3530000 cmp r3, #0
d28: 1a000005 bne d44 <mem+0xe0>
d2c: e3a00001 mov r0, #1
d30: e59f105c ldr r1, [pc, #92] ; d94 <mem+0x130>
d34: eb000f10 bl 497c <printf>
d38: e51b000c ldr r0, [fp, #-12]
d3c: eb000e37 bl 4620 <kill>
d40: eb000e00 bl 4548 <exit>
d44: e51b0008 ldr r0, [fp, #-8]
d48: eb000f97 bl 4bac <free>
d4c: e3a00001 mov r0, #1
d50: e59f1040 ldr r1, [pc, #64] ; d98 <mem+0x134>
d54: eb000f08 bl 497c <printf>
d58: eb000dfa bl 4548 <exit>
d5c: e51b3010 ldr r3, [fp, #-16]
d60: e3530000 cmp r3, #0
d64: aa000003 bge d78 <mem+0x114>
d68: e3a00001 mov r0, #1
d6c: e59f1028 ldr r1, [pc, #40] ; d9c <mem+0x138>
d70: eb000f01 bl 497c <printf>
d74: ea000000 b d7c <mem+0x118>
d78: eb000dfb bl 456c <wait>
d7c: e24bd004 sub sp, fp, #4
d80: e8bd8800 pop {fp, pc}
d84: 000054a0 .word 0x000054a0
d88: 000054ac .word 0x000054ac
d8c: 00002711 .word 0x00002711
d90: 000054c4 .word 0x000054c4
d94: 000054e0 .word 0x000054e0
d98: 000054fc .word 0x000054fc
d9c: 00005504 .word 0x00005504
00000da0 <sharedfd>:
da0: e92d4800 push {fp, lr}
da4: e28db004 add fp, sp, #4
da8: e24dd028 sub sp, sp, #40 ; 0x28
dac: e3a00001 mov r0, #1
db0: e59f1208 ldr r1, [pc, #520] ; fc0 <sharedfd+0x220>
db4: eb000ef0 bl 497c <printf>
db8: e59f0204 ldr r0, [pc, #516] ; fc4 <sharedfd+0x224>
dbc: eb000e3b bl 46b0 <unlink>
dc0: e59f01fc ldr r0, [pc, #508] ; fc4 <sharedfd+0x224>
dc4: e59f11fc ldr r1, [pc, #508] ; fc8 <sharedfd+0x228>
dc8: eb000e26 bl 4668 <open>
dcc: e50b0014 str r0, [fp, #-20] ; 0xffffffec
dd0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
dd4: e3530000 cmp r3, #0
dd8: aa000003 bge dec <sharedfd+0x4c>
ddc: e3a00001 mov r0, #1
de0: e59f11e4 ldr r1, [pc, #484] ; fcc <sharedfd+0x22c>
de4: eb000ee4 bl 497c <printf>
de8: ea000072 b fb8 <sharedfd+0x218>
dec: eb000dcc bl 4524 <fork>
df0: e50b0018 str r0, [fp, #-24] ; 0xffffffe8
df4: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
df8: e3530000 cmp r3, #0
dfc: 1a000001 bne e08 <sharedfd+0x68>
e00: e3a03063 mov r3, #99 ; 0x63
e04: ea000000 b e0c <sharedfd+0x6c>
e08: e3a03070 mov r3, #112 ; 0x70
e0c: e24b2028 sub r2, fp, #40 ; 0x28
e10: e1a00002 mov r0, r2
e14: e1a01003 mov r1, r3
e18: e3a0200a mov r2, #10
e1c: eb000cd9 bl 4188 <memset>
e20: e3a03000 mov r3, #0
e24: e50b3008 str r3, [fp, #-8]
e28: ea00000e b e68 <sharedfd+0xc8>
e2c: e24b3028 sub r3, fp, #40 ; 0x28
e30: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
e34: e1a01003 mov r1, r3
e38: e3a0200a mov r2, #10
e3c: eb000de5 bl 45d8 <write>
e40: e1a03000 mov r3, r0
e44: e353000a cmp r3, #10
e48: 0a000003 beq e5c <sharedfd+0xbc>
e4c: e3a00001 mov r0, #1
e50: e59f1178 ldr r1, [pc, #376] ; fd0 <sharedfd+0x230>
e54: eb000ec8 bl 497c <printf>
e58: ea000005 b e74 <sharedfd+0xd4>
e5c: e51b3008 ldr r3, [fp, #-8]
e60: e2833001 add r3, r3, #1
e64: e50b3008 str r3, [fp, #-8]
e68: e51b3008 ldr r3, [fp, #-8]
e6c: e3530ffa cmp r3, #1000 ; 0x3e8
e70: baffffed blt e2c <sharedfd+0x8c>
e74: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
e78: e3530000 cmp r3, #0
e7c: 1a000000 bne e84 <sharedfd+0xe4>
e80: eb000db0 bl 4548 <exit>
e84: eb000db8 bl 456c <wait>
e88: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
e8c: eb000dda bl 45fc <close>
e90: e59f012c ldr r0, [pc, #300] ; fc4 <sharedfd+0x224>
e94: e3a01000 mov r1, #0
e98: eb000df2 bl 4668 <open>
e9c: e50b0014 str r0, [fp, #-20] ; 0xffffffec
ea0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
ea4: e3530000 cmp r3, #0
ea8: aa000003 bge ebc <sharedfd+0x11c>
eac: e3a00001 mov r0, #1
eb0: e59f111c ldr r1, [pc, #284] ; fd4 <sharedfd+0x234>
eb4: eb000eb0 bl 497c <printf>
eb8: ea00003e b fb8 <sharedfd+0x218>
ebc: e3a03000 mov r3, #0
ec0: e50b3010 str r3, [fp, #-16]
ec4: e51b3010 ldr r3, [fp, #-16]
ec8: e50b300c str r3, [fp, #-12]
ecc: ea00001a b f3c <sharedfd+0x19c>
ed0: e3a03000 mov r3, #0
ed4: e50b3008 str r3, [fp, #-8]
ed8: ea000014 b f30 <sharedfd+0x190>
edc: e24b2028 sub r2, fp, #40 ; 0x28
ee0: e51b3008 ldr r3, [fp, #-8]
ee4: e0823003 add r3, r2, r3
ee8: e5d33000 ldrb r3, [r3]
eec: e3530063 cmp r3, #99 ; 0x63
ef0: 1a000002 bne f00 <sharedfd+0x160>
ef4: e51b300c ldr r3, [fp, #-12]
ef8: e2833001 add r3, r3, #1
efc: e50b300c str r3, [fp, #-12]
f00: e24b2028 sub r2, fp, #40 ; 0x28
f04: e51b3008 ldr r3, [fp, #-8]
f08: e0823003 add r3, r2, r3
f0c: e5d33000 ldrb r3, [r3]
f10: e3530070 cmp r3, #112 ; 0x70
f14: 1a000002 bne f24 <sharedfd+0x184>
f18: e51b3010 ldr r3, [fp, #-16]
f1c: e2833001 add r3, r3, #1
f20: e50b3010 str r3, [fp, #-16]
f24: e51b3008 ldr r3, [fp, #-8]
f28: e2833001 add r3, r3, #1
f2c: e50b3008 str r3, [fp, #-8]
f30: e51b3008 ldr r3, [fp, #-8]
f34: e3530009 cmp r3, #9
f38: 9affffe7 bls edc <sharedfd+0x13c>
f3c: e24b3028 sub r3, fp, #40 ; 0x28
f40: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
f44: e1a01003 mov r1, r3
f48: e3a0200a mov r2, #10
f4c: eb000d98 bl 45b4 <read>
f50: e50b001c str r0, [fp, #-28] ; 0xffffffe4
f54: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
f58: e3530000 cmp r3, #0
f5c: caffffdb bgt ed0 <sharedfd+0x130>
f60: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
f64: eb000da4 bl 45fc <close>
f68: e59f0054 ldr r0, [pc, #84] ; fc4 <sharedfd+0x224>
f6c: eb000dcf bl 46b0 <unlink>
f70: e51b300c ldr r3, [fp, #-12]
f74: e59f205c ldr r2, [pc, #92] ; fd8 <sharedfd+0x238>
f78: e1530002 cmp r3, r2
f7c: 1a000007 bne fa0 <sharedfd+0x200>
f80: e51b3010 ldr r3, [fp, #-16]
f84: e59f204c ldr r2, [pc, #76] ; fd8 <sharedfd+0x238>
f88: e1530002 cmp r3, r2
f8c: 1a000003 bne fa0 <sharedfd+0x200>
f90: e3a00001 mov r0, #1
f94: e59f1040 ldr r1, [pc, #64] ; fdc <sharedfd+0x23c>
f98: eb000e77 bl 497c <printf>
f9c: ea000005 b fb8 <sharedfd+0x218>
fa0: e3a00001 mov r0, #1
fa4: e59f1034 ldr r1, [pc, #52] ; fe0 <sharedfd+0x240>
fa8: e51b200c ldr r2, [fp, #-12]
fac: e51b3010 ldr r3, [fp, #-16]
fb0: eb000e71 bl 497c <printf>
fb4: eb000d63 bl 4548 <exit>
fb8: e24bd004 sub sp, fp, #4
fbc: e8bd8800 pop {fp, pc}
fc0: 00005514 .word 0x00005514
fc4: 00005524 .word 0x00005524
fc8: 00000202 .word 0x00000202
fcc: 00005530 .word 0x00005530
fd0: 0000555c .word 0x0000555c
fd4: 0000557c .word 0x0000557c
fd8: 00002710 .word 0x00002710
fdc: 000055a8 .word 0x000055a8
fe0: 000055b8 .word 0x000055b8
00000fe4 <twofiles>:
fe4: e92d4800 push {fp, lr}
fe8: e28db004 add fp, sp, #4
fec: e24dd020 sub sp, sp, #32
ff0: e3a00001 mov r0, #1
ff4: e59f125c ldr r1, [pc, #604] ; 1258 <twofiles+0x274>
ff8: eb000e5f bl 497c <printf>
ffc: e59f0258 ldr r0, [pc, #600] ; 125c <twofiles+0x278>
1000: eb000daa bl 46b0 <unlink>
1004: e59f0254 ldr r0, [pc, #596] ; 1260 <twofiles+0x27c>
1008: eb000da8 bl 46b0 <unlink>
100c: eb000d44 bl 4524 <fork>
1010: e50b0014 str r0, [fp, #-20] ; 0xffffffec
1014: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
1018: e3530000 cmp r3, #0
101c: aa000003 bge 1030 <twofiles+0x4c>
1020: e3a00001 mov r0, #1
1024: e59f1238 ldr r1, [pc, #568] ; 1264 <twofiles+0x280>
1028: eb000e53 bl 497c <printf>
102c: eb000d45 bl 4548 <exit>
1030: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
1034: e3530000 cmp r3, #0
1038: 0a000001 beq 1044 <twofiles+0x60>
103c: e59f3218 ldr r3, [pc, #536] ; 125c <twofiles+0x278>
1040: ea000000 b 1048 <twofiles+0x64>
1044: e59f3214 ldr r3, [pc, #532] ; 1260 <twofiles+0x27c>
1048: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
104c: e51b0018 ldr r0, [fp, #-24] ; 0xffffffe8
1050: e59f1210 ldr r1, [pc, #528] ; 1268 <twofiles+0x284>
1054: eb000d83 bl 4668 <open>
1058: e50b001c str r0, [fp, #-28] ; 0xffffffe4
105c: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
1060: e3530000 cmp r3, #0
1064: aa000003 bge 1078 <twofiles+0x94>
1068: e3a00001 mov r0, #1
106c: e59f11f8 ldr r1, [pc, #504] ; 126c <twofiles+0x288>
1070: eb000e41 bl 497c <printf>
1074: eb000d33 bl 4548 <exit>
1078: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
107c: e3530000 cmp r3, #0
1080: 0a000001 beq 108c <twofiles+0xa8>
1084: e3a03070 mov r3, #112 ; 0x70
1088: ea000000 b 1090 <twofiles+0xac>
108c: e3a03063 mov r3, #99 ; 0x63
1090: e59f01d8 ldr r0, [pc, #472] ; 1270 <twofiles+0x28c>
1094: e1a01003 mov r1, r3
1098: e3a02c02 mov r2, #512 ; 0x200
109c: eb000c39 bl 4188 <memset>
10a0: e3a03000 mov r3, #0
10a4: e50b3008 str r3, [fp, #-8]
10a8: ea00000f b 10ec <twofiles+0x108>
10ac: e51b001c ldr r0, [fp, #-28] ; 0xffffffe4
10b0: e59f11b8 ldr r1, [pc, #440] ; 1270 <twofiles+0x28c>
10b4: e3a02f7d mov r2, #500 ; 0x1f4
10b8: eb000d46 bl 45d8 <write>
10bc: e50b0020 str r0, [fp, #-32] ; 0xffffffe0
10c0: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
10c4: e3530f7d cmp r3, #500 ; 0x1f4
10c8: 0a000004 beq 10e0 <twofiles+0xfc>
10cc: e3a00001 mov r0, #1
10d0: e59f119c ldr r1, [pc, #412] ; 1274 <twofiles+0x290>
10d4: e51b2020 ldr r2, [fp, #-32] ; 0xffffffe0
10d8: eb000e27 bl 497c <printf>
10dc: eb000d19 bl 4548 <exit>
10e0: e51b3008 ldr r3, [fp, #-8]
10e4: e2833001 add r3, r3, #1
10e8: e50b3008 str r3, [fp, #-8]
10ec: e51b3008 ldr r3, [fp, #-8]
10f0: e353000b cmp r3, #11
10f4: daffffec ble 10ac <twofiles+0xc8>
10f8: e51b001c ldr r0, [fp, #-28] ; 0xffffffe4
10fc: eb000d3e bl 45fc <close>
1100: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
1104: e3530000 cmp r3, #0
1108: 0a000003 beq 111c <twofiles+0x138>
110c: eb000d16 bl 456c <wait>
1110: e3a03000 mov r3, #0
1114: e50b3008 str r3, [fp, #-8]
1118: ea000042 b 1228 <twofiles+0x244>
111c: eb000d09 bl 4548 <exit>
1120: e51b3008 ldr r3, [fp, #-8]
1124: e3530000 cmp r3, #0
1128: 0a000001 beq 1134 <twofiles+0x150>
112c: e59f3128 ldr r3, [pc, #296] ; 125c <twofiles+0x278>
1130: ea000000 b 1138 <twofiles+0x154>
1134: e59f3124 ldr r3, [pc, #292] ; 1260 <twofiles+0x27c>
1138: e1a00003 mov r0, r3
113c: e3a01000 mov r1, #0
1140: eb000d48 bl 4668 <open>
1144: e50b001c str r0, [fp, #-28] ; 0xffffffe4
1148: e3a03000 mov r3, #0
114c: e50b3010 str r3, [fp, #-16]
1150: ea00001e b 11d0 <twofiles+0x1ec>
1154: e3a03000 mov r3, #0
1158: e50b300c str r3, [fp, #-12]
115c: ea000013 b 11b0 <twofiles+0x1cc>
1160: e59f2108 ldr r2, [pc, #264] ; 1270 <twofiles+0x28c>
1164: e51b300c ldr r3, [fp, #-12]
1168: e0823003 add r3, r2, r3
116c: e5d33000 ldrb r3, [r3]
1170: e1a02003 mov r2, r3
1174: e51b3008 ldr r3, [fp, #-8]
1178: e3530000 cmp r3, #0
117c: 0a000001 beq 1188 <twofiles+0x1a4>
1180: e3a03070 mov r3, #112 ; 0x70
1184: ea000000 b 118c <twofiles+0x1a8>
1188: e3a03063 mov r3, #99 ; 0x63
118c: e1520003 cmp r2, r3
1190: 0a000003 beq 11a4 <twofiles+0x1c0>
1194: e3a00001 mov r0, #1
1198: e59f10d8 ldr r1, [pc, #216] ; 1278 <twofiles+0x294>
119c: eb000df6 bl 497c <printf>
11a0: eb000ce8 bl 4548 <exit>
11a4: e51b300c ldr r3, [fp, #-12]
11a8: e2833001 add r3, r3, #1
11ac: e50b300c str r3, [fp, #-12]
11b0: e51b200c ldr r2, [fp, #-12]
11b4: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
11b8: e1520003 cmp r2, r3
11bc: baffffe7 blt 1160 <twofiles+0x17c>
11c0: e51b2010 ldr r2, [fp, #-16]
11c4: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
11c8: e0823003 add r3, r2, r3
11cc: e50b3010 str r3, [fp, #-16]
11d0: e51b001c ldr r0, [fp, #-28] ; 0xffffffe4
11d4: e59f1094 ldr r1, [pc, #148] ; 1270 <twofiles+0x28c>
11d8: e3a02a02 mov r2, #8192 ; 0x2000
11dc: eb000cf4 bl 45b4 <read>
11e0: e50b0020 str r0, [fp, #-32] ; 0xffffffe0
11e4: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
11e8: e3530000 cmp r3, #0
11ec: caffffd8 bgt 1154 <twofiles+0x170>
11f0: e51b001c ldr r0, [fp, #-28] ; 0xffffffe4
11f4: eb000d00 bl 45fc <close>
11f8: e51b3010 ldr r3, [fp, #-16]
11fc: e59f2078 ldr r2, [pc, #120] ; 127c <twofiles+0x298>
1200: e1530002 cmp r3, r2
1204: 0a000004 beq 121c <twofiles+0x238>
1208: e3a00001 mov r0, #1
120c: e59f106c ldr r1, [pc, #108] ; 1280 <twofiles+0x29c>
1210: e51b2010 ldr r2, [fp, #-16]
1214: eb000dd8 bl 497c <printf>
1218: eb000cca bl 4548 <exit>
121c: e51b3008 ldr r3, [fp, #-8]
1220: e2833001 add r3, r3, #1
1224: e50b3008 str r3, [fp, #-8]
1228: e51b3008 ldr r3, [fp, #-8]
122c: e3530001 cmp r3, #1
1230: daffffba ble 1120 <twofiles+0x13c>
1234: e59f0020 ldr r0, [pc, #32] ; 125c <twofiles+0x278>
1238: eb000d1c bl 46b0 <unlink>
123c: e59f001c ldr r0, [pc, #28] ; 1260 <twofiles+0x27c>
1240: eb000d1a bl 46b0 <unlink>
1244: e3a00001 mov r0, #1
1248: e59f1034 ldr r1, [pc, #52] ; 1284 <twofiles+0x2a0>
124c: eb000dca bl 497c <printf>
1250: e24bd004 sub sp, fp, #4
1254: e8bd8800 pop {fp, pc}
1258: 000055d0 .word 0x000055d0
125c: 000055e0 .word 0x000055e0
1260: 000055e4 .word 0x000055e4
1264: 00005470 .word 0x00005470
1268: 00000202 .word 0x00000202
126c: 000055e8 .word 0x000055e8
1270: 00009080 .word 0x00009080
1274: 000055f8 .word 0x000055f8
1278: 0000560c .word 0x0000560c
127c: 00001770 .word 0x00001770
1280: 00005618 .word 0x00005618
1284: 0000562c .word 0x0000562c
00001288 <createdelete>:
1288: e92d4800 push {fp, lr}
128c: e28db004 add fp, sp, #4
1290: e24dd030 sub sp, sp, #48 ; 0x30
1294: e3a00001 mov r0, #1
1298: e59f1340 ldr r1, [pc, #832] ; 15e0 <createdelete+0x358>
129c: eb000db6 bl 497c <printf>
12a0: eb000c9f bl 4524 <fork>
12a4: e50b000c str r0, [fp, #-12]
12a8: e51b300c ldr r3, [fp, #-12]
12ac: e3530000 cmp r3, #0
12b0: aa000003 bge 12c4 <createdelete+0x3c>
12b4: e3a00001 mov r0, #1
12b8: e59f1324 ldr r1, [pc, #804] ; 15e4 <createdelete+0x35c>
12bc: eb000dae bl 497c <printf>
12c0: eb000ca0 bl 4548 <exit>
12c4: e51b300c ldr r3, [fp, #-12]
12c8: e3530000 cmp r3, #0
12cc: 0a000001 beq 12d8 <createdelete+0x50>
12d0: e3a03070 mov r3, #112 ; 0x70
12d4: ea000000 b 12dc <createdelete+0x54>
12d8: e3a03063 mov r3, #99 ; 0x63
12dc: e54b3030 strb r3, [fp, #-48] ; 0xffffffd0
12e0: e3a03000 mov r3, #0
12e4: e54b302e strb r3, [fp, #-46] ; 0xffffffd2
12e8: e3a03000 mov r3, #0
12ec: e50b3008 str r3, [fp, #-8]
12f0: ea00002e b 13b0 <createdelete+0x128>
12f4: e51b3008 ldr r3, [fp, #-8]
12f8: e6ef3073 uxtb r3, r3
12fc: e2833030 add r3, r3, #48 ; 0x30
1300: e6ef3073 uxtb r3, r3
1304: e54b302f strb r3, [fp, #-47] ; 0xffffffd1
1308: e24b3030 sub r3, fp, #48 ; 0x30
130c: e1a00003 mov r0, r3
1310: e59f12d0 ldr r1, [pc, #720] ; 15e8 <createdelete+0x360>
1314: eb000cd3 bl 4668 <open>
1318: e50b0010 str r0, [fp, #-16]
131c: e51b3010 ldr r3, [fp, #-16]
1320: e3530000 cmp r3, #0
1324: aa000003 bge 1338 <createdelete+0xb0>
1328: e3a00001 mov r0, #1
132c: e59f12b8 ldr r1, [pc, #696] ; 15ec <createdelete+0x364>
1330: eb000d91 bl 497c <printf>
1334: eb000c83 bl 4548 <exit>
1338: e51b0010 ldr r0, [fp, #-16]
133c: eb000cae bl 45fc <close>
1340: e51b3008 ldr r3, [fp, #-8]
1344: e3530000 cmp r3, #0
1348: da000015 ble 13a4 <createdelete+0x11c>
134c: e51b3008 ldr r3, [fp, #-8]
1350: e2033001 and r3, r3, #1
1354: e3530000 cmp r3, #0
1358: 1a000011 bne 13a4 <createdelete+0x11c>
135c: e51b3008 ldr r3, [fp, #-8]
1360: e1a02fa3 lsr r2, r3, #31
1364: e0823003 add r3, r2, r3
1368: e1a030c3 asr r3, r3, #1
136c: e6ef3073 uxtb r3, r3
1370: e2833030 add r3, r3, #48 ; 0x30
1374: e6ef3073 uxtb r3, r3
1378: e54b302f strb r3, [fp, #-47] ; 0xffffffd1
137c: e24b3030 sub r3, fp, #48 ; 0x30
1380: e1a00003 mov r0, r3
1384: eb000cc9 bl 46b0 <unlink>
1388: e1a03000 mov r3, r0
138c: e3530000 cmp r3, #0
1390: aa000003 bge 13a4 <createdelete+0x11c>
1394: e3a00001 mov r0, #1
1398: e59f1250 ldr r1, [pc, #592] ; 15f0 <createdelete+0x368>
139c: eb000d76 bl 497c <printf>
13a0: eb000c68 bl 4548 <exit>
13a4: e51b3008 ldr r3, [fp, #-8]
13a8: e2833001 add r3, r3, #1
13ac: e50b3008 str r3, [fp, #-8]
13b0: e51b3008 ldr r3, [fp, #-8]
13b4: e3530013 cmp r3, #19
13b8: daffffcd ble 12f4 <createdelete+0x6c>
13bc: e51b300c ldr r3, [fp, #-12]
13c0: e3530000 cmp r3, #0
13c4: 1a000000 bne 13cc <createdelete+0x144>
13c8: eb000c5e bl 4548 <exit>
13cc: eb000c66 bl 456c <wait>
13d0: e3a03000 mov r3, #0
13d4: e50b3008 str r3, [fp, #-8]
13d8: ea000060 b 1560 <createdelete+0x2d8>
13dc: e3a03070 mov r3, #112 ; 0x70
13e0: e54b3030 strb r3, [fp, #-48] ; 0xffffffd0
13e4: e51b3008 ldr r3, [fp, #-8]
13e8: e6ef3073 uxtb r3, r3
13ec: e2833030 add r3, r3, #48 ; 0x30
13f0: e6ef3073 uxtb r3, r3
13f4: e54b302f strb r3, [fp, #-47] ; 0xffffffd1
13f8: e24b3030 sub r3, fp, #48 ; 0x30
13fc: e1a00003 mov r0, r3
1400: e3a01000 mov r1, #0
1404: eb000c97 bl 4668 <open>
1408: e50b0010 str r0, [fp, #-16]
140c: e51b3008 ldr r3, [fp, #-8]
1410: e3530000 cmp r3, #0
1414: 0a000002 beq 1424 <createdelete+0x19c>
1418: e51b3008 ldr r3, [fp, #-8]
141c: e3530009 cmp r3, #9
1420: da000008 ble 1448 <createdelete+0x1c0>
1424: e51b3010 ldr r3, [fp, #-16]
1428: e3530000 cmp r3, #0
142c: aa000005 bge 1448 <createdelete+0x1c0>
1430: e24b3030 sub r3, fp, #48 ; 0x30
1434: e3a00001 mov r0, #1
1438: e59f11b4 ldr r1, [pc, #436] ; 15f4 <createdelete+0x36c>
143c: e1a02003 mov r2, r3
1440: eb000d4d bl 497c <printf>
1444: eb000c3f bl 4548 <exit>
1448: e51b3008 ldr r3, [fp, #-8]
144c: e3530000 cmp r3, #0
1450: da00000b ble 1484 <createdelete+0x1fc>
1454: e51b3008 ldr r3, [fp, #-8]
1458: e3530009 cmp r3, #9
145c: ca000008 bgt 1484 <createdelete+0x1fc>
1460: e51b3010 ldr r3, [fp, #-16]
1464: e3530000 cmp r3, #0
1468: ba000005 blt 1484 <createdelete+0x1fc>
146c: e24b3030 sub r3, fp, #48 ; 0x30
1470: e3a00001 mov r0, #1
1474: e59f117c ldr r1, [pc, #380] ; 15f8 <createdelete+0x370>
1478: e1a02003 mov r2, r3
147c: eb000d3e bl 497c <printf>
1480: eb000c30 bl 4548 <exit>
1484: e51b3010 ldr r3, [fp, #-16]
1488: e3530000 cmp r3, #0
148c: ba000001 blt 1498 <createdelete+0x210>
1490: e51b0010 ldr r0, [fp, #-16]
1494: eb000c58 bl 45fc <close>
1498: e3a03063 mov r3, #99 ; 0x63
149c: e54b3030 strb r3, [fp, #-48] ; 0xffffffd0
14a0: e51b3008 ldr r3, [fp, #-8]
14a4: e6ef3073 uxtb r3, r3
14a8: e2833030 add r3, r3, #48 ; 0x30
14ac: e6ef3073 uxtb r3, r3
14b0: e54b302f strb r3, [fp, #-47] ; 0xffffffd1
14b4: e24b3030 sub r3, fp, #48 ; 0x30
14b8: e1a00003 mov r0, r3
14bc: e3a01000 mov r1, #0
14c0: eb000c68 bl 4668 <open>
14c4: e50b0010 str r0, [fp, #-16]
14c8: e51b3008 ldr r3, [fp, #-8]
14cc: e3530000 cmp r3, #0
14d0: 0a000002 beq 14e0 <createdelete+0x258>
14d4: e51b3008 ldr r3, [fp, #-8]
14d8: e3530009 cmp r3, #9
14dc: da000008 ble 1504 <createdelete+0x27c>
14e0: e51b3010 ldr r3, [fp, #-16]
14e4: e3530000 cmp r3, #0
14e8: aa000005 bge 1504 <createdelete+0x27c>
14ec: e24b3030 sub r3, fp, #48 ; 0x30
14f0: e3a00001 mov r0, #1
14f4: e59f10f8 ldr r1, [pc, #248] ; 15f4 <createdelete+0x36c>
14f8: e1a02003 mov r2, r3
14fc: eb000d1e bl 497c <printf>
1500: eb000c10 bl 4548 <exit>
1504: e51b3008 ldr r3, [fp, #-8]
1508: e3530000 cmp r3, #0
150c: da00000b ble 1540 <createdelete+0x2b8>
1510: e51b3008 ldr r3, [fp, #-8]
1514: e3530009 cmp r3, #9
1518: ca000008 bgt 1540 <createdelete+0x2b8>
151c: e51b3010 ldr r3, [fp, #-16]
1520: e3530000 cmp r3, #0
1524: ba000005 blt 1540 <createdelete+0x2b8>
1528: e24b3030 sub r3, fp, #48 ; 0x30
152c: e3a00001 mov r0, #1
1530: e59f10c0 ldr r1, [pc, #192] ; 15f8 <createdelete+0x370>
1534: e1a02003 mov r2, r3
1538: eb000d0f bl 497c <printf>
153c: eb000c01 bl 4548 <exit>
1540: e51b3010 ldr r3, [fp, #-16]
1544: e3530000 cmp r3, #0
1548: ba000001 blt 1554 <createdelete+0x2cc>
154c: e51b0010 ldr r0, [fp, #-16]
1550: eb000c29 bl 45fc <close>
1554: e51b3008 ldr r3, [fp, #-8]
1558: e2833001 add r3, r3, #1
155c: e50b3008 str r3, [fp, #-8]
1560: e51b3008 ldr r3, [fp, #-8]
1564: e3530013 cmp r3, #19
1568: daffff9b ble 13dc <createdelete+0x154>
156c: e3a03000 mov r3, #0
1570: e50b3008 str r3, [fp, #-8]
1574: ea000011 b 15c0 <createdelete+0x338>
1578: e3a03070 mov r3, #112 ; 0x70
157c: e54b3030 strb r3, [fp, #-48] ; 0xffffffd0
1580: e51b3008 ldr r3, [fp, #-8]
1584: e6ef3073 uxtb r3, r3
1588: e2833030 add r3, r3, #48 ; 0x30
158c: e6ef3073 uxtb r3, r3
1590: e54b302f strb r3, [fp, #-47] ; 0xffffffd1
1594: e24b3030 sub r3, fp, #48 ; 0x30
1598: e1a00003 mov r0, r3
159c: eb000c43 bl 46b0 <unlink>
15a0: e3a03063 mov r3, #99 ; 0x63
15a4: e54b3030 strb r3, [fp, #-48] ; 0xffffffd0
15a8: e24b3030 sub r3, fp, #48 ; 0x30
15ac: e1a00003 mov r0, r3
15b0: eb000c3e bl 46b0 <unlink>
15b4: e51b3008 ldr r3, [fp, #-8]
15b8: e2833001 add r3, r3, #1
15bc: e50b3008 str r3, [fp, #-8]
15c0: e51b3008 ldr r3, [fp, #-8]
15c4: e3530013 cmp r3, #19
15c8: daffffea ble 1578 <createdelete+0x2f0>
15cc: e3a00001 mov r0, #1
15d0: e59f1024 ldr r1, [pc, #36] ; 15fc <createdelete+0x374>
15d4: eb000ce8 bl 497c <printf>
15d8: e24bd004 sub sp, fp, #4
15dc: e8bd8800 pop {fp, pc}
15e0: 0000563c .word 0x0000563c
15e4: 00005470 .word 0x00005470
15e8: 00000202 .word 0x00000202
15ec: 000055e8 .word 0x000055e8
15f0: 00005650 .word 0x00005650
15f4: 00005660 .word 0x00005660
15f8: 00005684 .word 0x00005684
15fc: 000056a4 .word 0x000056a4
00001600 <unlinkread>:
1600: e92d4800 push {fp, lr}
1604: e28db004 add fp, sp, #4
1608: e24dd008 sub sp, sp, #8
160c: e3a00001 mov r0, #1
1610: e59f1158 ldr r1, [pc, #344] ; 1770 <unlinkread+0x170>
1614: eb000cd8 bl 497c <printf>
1618: e59f0154 ldr r0, [pc, #340] ; 1774 <unlinkread+0x174>
161c: e59f1154 ldr r1, [pc, #340] ; 1778 <unlinkread+0x178>
1620: eb000c10 bl 4668 <open>
1624: e50b0008 str r0, [fp, #-8]
1628: e51b3008 ldr r3, [fp, #-8]
162c: e3530000 cmp r3, #0
1630: aa000003 bge 1644 <unlinkread+0x44>
1634: e3a00001 mov r0, #1
1638: e59f113c ldr r1, [pc, #316] ; 177c <unlinkread+0x17c>
163c: eb000cce bl 497c <printf>
1640: eb000bc0 bl 4548 <exit>
1644: e51b0008 ldr r0, [fp, #-8]
1648: e59f1130 ldr r1, [pc, #304] ; 1780 <unlinkread+0x180>
164c: e3a02005 mov r2, #5
1650: eb000be0 bl 45d8 <write>
1654: e51b0008 ldr r0, [fp, #-8]
1658: eb000be7 bl 45fc <close>
165c: e59f0110 ldr r0, [pc, #272] ; 1774 <unlinkread+0x174>
1660: e3a01002 mov r1, #2
1664: eb000bff bl 4668 <open>
1668: e50b0008 str r0, [fp, #-8]
166c: e51b3008 ldr r3, [fp, #-8]
1670: e3530000 cmp r3, #0
1674: aa000003 bge 1688 <unlinkread+0x88>
1678: e3a00001 mov r0, #1
167c: e59f1100 ldr r1, [pc, #256] ; 1784 <unlinkread+0x184>
1680: eb000cbd bl 497c <printf>
1684: eb000baf bl 4548 <exit>
1688: e59f00e4 ldr r0, [pc, #228] ; 1774 <unlinkread+0x174>
168c: eb000c07 bl 46b0 <unlink>
1690: e1a03000 mov r3, r0
1694: e3530000 cmp r3, #0
1698: 0a000003 beq 16ac <unlinkread+0xac>
169c: e3a00001 mov r0, #1
16a0: e59f10e0 ldr r1, [pc, #224] ; 1788 <unlinkread+0x188>
16a4: eb000cb4 bl 497c <printf>
16a8: eb000ba6 bl 4548 <exit>
16ac: e59f00c0 ldr r0, [pc, #192] ; 1774 <unlinkread+0x174>
16b0: e59f10c0 ldr r1, [pc, #192] ; 1778 <unlinkread+0x178>
16b4: eb000beb bl 4668 <open>
16b8: e50b000c str r0, [fp, #-12]
16bc: e51b000c ldr r0, [fp, #-12]
16c0: e59f10c4 ldr r1, [pc, #196] ; 178c <unlinkread+0x18c>
16c4: e3a02003 mov r2, #3
16c8: eb000bc2 bl 45d8 <write>
16cc: e51b000c ldr r0, [fp, #-12]
16d0: eb000bc9 bl 45fc <close>
16d4: e51b0008 ldr r0, [fp, #-8]
16d8: e59f10b0 ldr r1, [pc, #176] ; 1790 <unlinkread+0x190>
16dc: e3a02a02 mov r2, #8192 ; 0x2000
16e0: eb000bb3 bl 45b4 <read>
16e4: e1a03000 mov r3, r0
16e8: e3530005 cmp r3, #5
16ec: 0a000003 beq 1700 <unlinkread+0x100>
16f0: e3a00001 mov r0, #1
16f4: e59f1098 ldr r1, [pc, #152] ; 1794 <unlinkread+0x194>
16f8: eb000c9f bl 497c <printf>
16fc: eb000b91 bl 4548 <exit>
1700: e59f3088 ldr r3, [pc, #136] ; 1790 <unlinkread+0x190>
1704: e5d33000 ldrb r3, [r3]
1708: e3530068 cmp r3, #104 ; 0x68
170c: 0a000003 beq 1720 <unlinkread+0x120>
1710: e3a00001 mov r0, #1
1714: e59f107c ldr r1, [pc, #124] ; 1798 <unlinkread+0x198>
1718: eb000c97 bl 497c <printf>
171c: eb000b89 bl 4548 <exit>
1720: e51b0008 ldr r0, [fp, #-8]
1724: e59f1064 ldr r1, [pc, #100] ; 1790 <unlinkread+0x190>
1728: e3a0200a mov r2, #10
172c: eb000ba9 bl 45d8 <write>
1730: e1a03000 mov r3, r0
1734: e353000a cmp r3, #10
1738: 0a000003 beq 174c <unlinkread+0x14c>
173c: e3a00001 mov r0, #1
1740: e59f1054 ldr r1, [pc, #84] ; 179c <unlinkread+0x19c>
1744: eb000c8c bl 497c <printf>
1748: eb000b7e bl 4548 <exit>
174c: e51b0008 ldr r0, [fp, #-8]
1750: eb000ba9 bl 45fc <close>
1754: e59f0018 ldr r0, [pc, #24] ; 1774 <unlinkread+0x174>
1758: eb000bd4 bl 46b0 <unlink>
175c: e3a00001 mov r0, #1
1760: e59f1038 ldr r1, [pc, #56] ; 17a0 <unlinkread+0x1a0>
1764: eb000c84 bl 497c <printf>
1768: e24bd004 sub sp, fp, #4
176c: e8bd8800 pop {fp, pc}
1770: 000056b8 .word 0x000056b8
1774: 000056cc .word 0x000056cc
1778: 00000202 .word 0x00000202
177c: 000056d8 .word 0x000056d8
1780: 000056f4 .word 0x000056f4
1784: 000056fc .word 0x000056fc
1788: 00005714 .word 0x00005714
178c: 00005730 .word 0x00005730
1790: 00009080 .word 0x00009080
1794: 00005734 .word 0x00005734
1798: 0000574c .word 0x0000574c
179c: 00005764 .word 0x00005764
17a0: 00005780 .word 0x00005780
000017a4 <linktest>:
17a4: e92d4800 push {fp, lr}
17a8: e28db004 add fp, sp, #4
17ac: e24dd008 sub sp, sp, #8
17b0: e3a00001 mov r0, #1
17b4: e59f11bc ldr r1, [pc, #444] ; 1978 <linktest+0x1d4>
17b8: eb000c6f bl 497c <printf>
17bc: e59f01b8 ldr r0, [pc, #440] ; 197c <linktest+0x1d8>
17c0: eb000bba bl 46b0 <unlink>
17c4: e59f01b4 ldr r0, [pc, #436] ; 1980 <linktest+0x1dc>
17c8: eb000bb8 bl 46b0 <unlink>
17cc: e59f01a8 ldr r0, [pc, #424] ; 197c <linktest+0x1d8>
17d0: e59f11ac ldr r1, [pc, #428] ; 1984 <linktest+0x1e0>
17d4: eb000ba3 bl 4668 <open>
17d8: e50b0008 str r0, [fp, #-8]
17dc: e51b3008 ldr r3, [fp, #-8]
17e0: e3530000 cmp r3, #0
17e4: aa000003 bge 17f8 <linktest+0x54>
17e8: e3a00001 mov r0, #1
17ec: e59f1194 ldr r1, [pc, #404] ; 1988 <linktest+0x1e4>
17f0: eb000c61 bl 497c <printf>
17f4: eb000b53 bl 4548 <exit>
17f8: e51b0008 ldr r0, [fp, #-8]
17fc: e59f1188 ldr r1, [pc, #392] ; 198c <linktest+0x1e8>
1800: e3a02005 mov r2, #5
1804: eb000b73 bl 45d8 <write>
1808: e1a03000 mov r3, r0
180c: e3530005 cmp r3, #5
1810: 0a000003 beq 1824 <linktest+0x80>
1814: e3a00001 mov r0, #1
1818: e59f1170 ldr r1, [pc, #368] ; 1990 <linktest+0x1ec>
181c: eb000c56 bl 497c <printf>
1820: eb000b48 bl 4548 <exit>
1824: e51b0008 ldr r0, [fp, #-8]
1828: eb000b73 bl 45fc <close>
182c: e59f0148 ldr r0, [pc, #328] ; 197c <linktest+0x1d8>
1830: e59f1148 ldr r1, [pc, #328] ; 1980 <linktest+0x1dc>
1834: eb000baf bl 46f8 <link>
1838: e1a03000 mov r3, r0
183c: e3530000 cmp r3, #0
1840: aa000003 bge 1854 <linktest+0xb0>
1844: e3a00001 mov r0, #1
1848: e59f1144 ldr r1, [pc, #324] ; 1994 <linktest+0x1f0>
184c: eb000c4a bl 497c <printf>
1850: eb000b3c bl 4548 <exit>
1854: e59f0120 ldr r0, [pc, #288] ; 197c <linktest+0x1d8>
1858: eb000b94 bl 46b0 <unlink>
185c: e59f0118 ldr r0, [pc, #280] ; 197c <linktest+0x1d8>
1860: e3a01000 mov r1, #0
1864: eb000b7f bl 4668 <open>
1868: e1a03000 mov r3, r0
186c: e3530000 cmp r3, #0
1870: ba000003 blt 1884 <linktest+0xe0>
1874: e3a00001 mov r0, #1
1878: e59f1118 ldr r1, [pc, #280] ; 1998 <linktest+0x1f4>
187c: eb000c3e bl 497c <printf>
1880: eb000b30 bl 4548 <exit>
1884: e59f00f4 ldr r0, [pc, #244] ; 1980 <linktest+0x1dc>
1888: e3a01000 mov r1, #0
188c: eb000b75 bl 4668 <open>
1890: e50b0008 str r0, [fp, #-8]
1894: e51b3008 ldr r3, [fp, #-8]
1898: e3530000 cmp r3, #0
189c: aa000003 bge 18b0 <linktest+0x10c>
18a0: e3a00001 mov r0, #1
18a4: e59f10f0 ldr r1, [pc, #240] ; 199c <linktest+0x1f8>
18a8: eb000c33 bl 497c <printf>
18ac: eb000b25 bl 4548 <exit>
18b0: e51b0008 ldr r0, [fp, #-8]
18b4: e59f10e4 ldr r1, [pc, #228] ; 19a0 <linktest+0x1fc>
18b8: e3a02a02 mov r2, #8192 ; 0x2000
18bc: eb000b3c bl 45b4 <read>
18c0: e1a03000 mov r3, r0
18c4: e3530005 cmp r3, #5
18c8: 0a000003 beq 18dc <linktest+0x138>
18cc: e3a00001 mov r0, #1
18d0: e59f10cc ldr r1, [pc, #204] ; 19a4 <linktest+0x200>
18d4: eb000c28 bl 497c <printf>
18d8: eb000b1a bl 4548 <exit>
18dc: e51b0008 ldr r0, [fp, #-8]
18e0: eb000b45 bl 45fc <close>
18e4: e59f0094 ldr r0, [pc, #148] ; 1980 <linktest+0x1dc>
18e8: e59f1090 ldr r1, [pc, #144] ; 1980 <linktest+0x1dc>
18ec: eb000b81 bl 46f8 <link>
18f0: e1a03000 mov r3, r0
18f4: e3530000 cmp r3, #0
18f8: ba000003 blt 190c <linktest+0x168>
18fc: e3a00001 mov r0, #1
1900: e59f10a0 ldr r1, [pc, #160] ; 19a8 <linktest+0x204>
1904: eb000c1c bl 497c <printf>
1908: eb000b0e bl 4548 <exit>
190c: e59f006c ldr r0, [pc, #108] ; 1980 <linktest+0x1dc>
1910: eb000b66 bl 46b0 <unlink>
1914: e59f0064 ldr r0, [pc, #100] ; 1980 <linktest+0x1dc>
1918: e59f105c ldr r1, [pc, #92] ; 197c <linktest+0x1d8>
191c: eb000b75 bl 46f8 <link>
1920: e1a03000 mov r3, r0
1924: e3530000 cmp r3, #0
1928: ba000003 blt 193c <linktest+0x198>
192c: e3a00001 mov r0, #1
1930: e59f1074 ldr r1, [pc, #116] ; 19ac <linktest+0x208>
1934: eb000c10 bl 497c <printf>
1938: eb000b02 bl 4548 <exit>
193c: e59f006c ldr r0, [pc, #108] ; 19b0 <linktest+0x20c>
1940: e59f1034 ldr r1, [pc, #52] ; 197c <linktest+0x1d8>
1944: eb000b6b bl 46f8 <link>
1948: e1a03000 mov r3, r0
194c: e3530000 cmp r3, #0
1950: ba000003 blt 1964 <linktest+0x1c0>
1954: e3a00001 mov r0, #1
1958: e59f1054 ldr r1, [pc, #84] ; 19b4 <linktest+0x210>
195c: eb000c06 bl 497c <printf>
1960: eb000af8 bl 4548 <exit>
1964: e3a00001 mov r0, #1
1968: e59f1048 ldr r1, [pc, #72] ; 19b8 <linktest+0x214>
196c: eb000c02 bl 497c <printf>
1970: e24bd004 sub sp, fp, #4
1974: e8bd8800 pop {fp, pc}
1978: 00005790 .word 0x00005790
197c: 0000579c .word 0x0000579c
1980: 000057a0 .word 0x000057a0
1984: 00000202 .word 0x00000202
1988: 000057a4 .word 0x000057a4
198c: 000056f4 .word 0x000056f4
1990: 000057b8 .word 0x000057b8
1994: 000057cc .word 0x000057cc
1998: 000057e4 .word 0x000057e4
199c: 0000580c .word 0x0000580c
19a0: 00009080 .word 0x00009080
19a4: 00005820 .word 0x00005820
19a8: 00005834 .word 0x00005834
19ac: 00005854 .word 0x00005854
19b0: 00005878 .word 0x00005878
19b4: 0000587c .word 0x0000587c
19b8: 00005898 .word 0x00005898
000019bc <concreate>:
19bc: e92d4800 push {fp, lr}
19c0: e28db004 add fp, sp, #4
19c4: e24dd050 sub sp, sp, #80 ; 0x50
19c8: e3a00001 mov r0, #1
19cc: e59f1414 ldr r1, [pc, #1044] ; 1de8 <concreate+0x42c>
19d0: eb000be9 bl 497c <printf>
19d4: e3a03043 mov r3, #67 ; 0x43
19d8: e54b3018 strb r3, [fp, #-24] ; 0xffffffe8
19dc: e3a03000 mov r3, #0
19e0: e54b3016 strb r3, [fp, #-22] ; 0xffffffea
19e4: e3a03000 mov r3, #0
19e8: e50b3008 str r3, [fp, #-8]
19ec: ea000048 b 1b14 <concreate+0x158>
19f0: e51b3008 ldr r3, [fp, #-8]
19f4: e6ef3073 uxtb r3, r3
19f8: e2833030 add r3, r3, #48 ; 0x30
19fc: e6ef3073 uxtb r3, r3
1a00: e54b3017 strb r3, [fp, #-23] ; 0xffffffe9
1a04: e24b3018 sub r3, fp, #24
1a08: e1a00003 mov r0, r3
1a0c: eb000b27 bl 46b0 <unlink>
1a10: eb000ac3 bl 4524 <fork>
1a14: e50b0010 str r0, [fp, #-16]
1a18: e51b3010 ldr r3, [fp, #-16]
1a1c: e3530000 cmp r3, #0
1a20: 0a00000f beq 1a64 <concreate+0xa8>
1a24: e51b1008 ldr r1, [fp, #-8]
1a28: e59f33bc ldr r3, [pc, #956] ; 1dec <concreate+0x430>
1a2c: e0c23193 smull r3, r2, r3, r1
1a30: e1a03fc1 asr r3, r1, #31
1a34: e0632002 rsb r2, r3, r2
1a38: e1a03002 mov r3, r2
1a3c: e1a03083 lsl r3, r3, #1
1a40: e0833002 add r3, r3, r2
1a44: e0632001 rsb r2, r3, r1
1a48: e3520001 cmp r2, #1
1a4c: 1a000004 bne 1a64 <concreate+0xa8>
1a50: e24b3018 sub r3, fp, #24
1a54: e59f0394 ldr r0, [pc, #916] ; 1df0 <concreate+0x434>
1a58: e1a01003 mov r1, r3
1a5c: eb000b25 bl 46f8 <link>
1a60: ea000023 b 1af4 <concreate+0x138>
1a64: e51b3010 ldr r3, [fp, #-16]
1a68: e3530000 cmp r3, #0
1a6c: 1a000010 bne 1ab4 <concreate+0xf8>
1a70: e51b1008 ldr r1, [fp, #-8]
1a74: e59f3378 ldr r3, [pc, #888] ; 1df4 <concreate+0x438>
1a78: e0c32193 smull r2, r3, r3, r1
1a7c: e1a020c3 asr r2, r3, #1
1a80: e1a03fc1 asr r3, r1, #31
1a84: e0632002 rsb r2, r3, r2
1a88: e1a03002 mov r3, r2
1a8c: e1a03103 lsl r3, r3, #2
1a90: e0833002 add r3, r3, r2
1a94: e0632001 rsb r2, r3, r1
1a98: e3520001 cmp r2, #1
1a9c: 1a000004 bne 1ab4 <concreate+0xf8>
1aa0: e24b3018 sub r3, fp, #24
1aa4: e59f0344 ldr r0, [pc, #836] ; 1df0 <concreate+0x434>
1aa8: e1a01003 mov r1, r3
1aac: eb000b11 bl 46f8 <link>
1ab0: ea00000f b 1af4 <concreate+0x138>
1ab4: e24b3018 sub r3, fp, #24
1ab8: e1a00003 mov r0, r3
1abc: e59f1334 ldr r1, [pc, #820] ; 1df8 <concreate+0x43c>
1ac0: eb000ae8 bl 4668 <open>
1ac4: e50b0014 str r0, [fp, #-20] ; 0xffffffec
1ac8: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
1acc: e3530000 cmp r3, #0
1ad0: aa000005 bge 1aec <concreate+0x130>
1ad4: e24b3018 sub r3, fp, #24
1ad8: e3a00001 mov r0, #1
1adc: e59f1318 ldr r1, [pc, #792] ; 1dfc <concreate+0x440>
1ae0: e1a02003 mov r2, r3
1ae4: eb000ba4 bl 497c <printf>
1ae8: eb000a96 bl 4548 <exit>
1aec: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
1af0: eb000ac1 bl 45fc <close>
1af4: e51b3010 ldr r3, [fp, #-16]
1af8: e3530000 cmp r3, #0
1afc: 1a000000 bne 1b04 <concreate+0x148>
1b00: eb000a90 bl 4548 <exit>
1b04: eb000a98 bl 456c <wait>
1b08: e51b3008 ldr r3, [fp, #-8]
1b0c: e2833001 add r3, r3, #1
1b10: e50b3008 str r3, [fp, #-8]
1b14: e51b3008 ldr r3, [fp, #-8]
1b18: e3530027 cmp r3, #39 ; 0x27
1b1c: daffffb3 ble 19f0 <concreate+0x34>
1b20: e24b3040 sub r3, fp, #64 ; 0x40
1b24: e1a00003 mov r0, r3
1b28: e3a01000 mov r1, #0
1b2c: e3a02028 mov r2, #40 ; 0x28
1b30: eb000994 bl 4188 <memset>
1b34: e59f02c4 ldr r0, [pc, #708] ; 1e00 <concreate+0x444>
1b38: e3a01000 mov r1, #0
1b3c: eb000ac9 bl 4668 <open>
1b40: e50b0014 str r0, [fp, #-20] ; 0xffffffec
1b44: e3a03000 mov r3, #0
1b48: e50b300c str r3, [fp, #-12]
1b4c: ea00002e b 1c0c <concreate+0x250>
1b50: e15b35b0 ldrh r3, [fp, #-80] ; 0xffffffb0
1b54: e3530000 cmp r3, #0
1b58: 1a000000 bne 1b60 <concreate+0x1a4>
1b5c: ea00002a b 1c0c <concreate+0x250>
1b60: e55b304e ldrb r3, [fp, #-78] ; 0xffffffb2
1b64: e3530043 cmp r3, #67 ; 0x43
1b68: 1a000027 bne 1c0c <concreate+0x250>
1b6c: e55b304c ldrb r3, [fp, #-76] ; 0xffffffb4
1b70: e3530000 cmp r3, #0
1b74: 1a000024 bne 1c0c <concreate+0x250>
1b78: e55b304d ldrb r3, [fp, #-77] ; 0xffffffb3
1b7c: e2433030 sub r3, r3, #48 ; 0x30
1b80: e50b3008 str r3, [fp, #-8]
1b84: e51b3008 ldr r3, [fp, #-8]
1b88: e3530000 cmp r3, #0
1b8c: ba000002 blt 1b9c <concreate+0x1e0>
1b90: e51b3008 ldr r3, [fp, #-8]
1b94: e3530027 cmp r3, #39 ; 0x27
1b98: 9a000006 bls 1bb8 <concreate+0x1fc>
1b9c: e24b3050 sub r3, fp, #80 ; 0x50
1ba0: e2833002 add r3, r3, #2
1ba4: e3a00001 mov r0, #1
1ba8: e59f1254 ldr r1, [pc, #596] ; 1e04 <concreate+0x448>
1bac: e1a02003 mov r2, r3
1bb0: eb000b71 bl 497c <printf>
1bb4: eb000a63 bl 4548 <exit>
1bb8: e24b2040 sub r2, fp, #64 ; 0x40
1bbc: e51b3008 ldr r3, [fp, #-8]
1bc0: e0823003 add r3, r2, r3
1bc4: e5d33000 ldrb r3, [r3]
1bc8: e3530000 cmp r3, #0
1bcc: 0a000006 beq 1bec <concreate+0x230>
1bd0: e24b3050 sub r3, fp, #80 ; 0x50
1bd4: e2833002 add r3, r3, #2
1bd8: e3a00001 mov r0, #1
1bdc: e59f1224 ldr r1, [pc, #548] ; 1e08 <concreate+0x44c>
1be0: e1a02003 mov r2, r3
1be4: eb000b64 bl 497c <printf>
1be8: eb000a56 bl 4548 <exit>
1bec: e24b2040 sub r2, fp, #64 ; 0x40
1bf0: e51b3008 ldr r3, [fp, #-8]
1bf4: e0823003 add r3, r2, r3
1bf8: e3a02001 mov r2, #1
1bfc: e5c32000 strb r2, [r3]
1c00: e51b300c ldr r3, [fp, #-12]
1c04: e2833001 add r3, r3, #1
1c08: e50b300c str r3, [fp, #-12]
1c0c: e24b3050 sub r3, fp, #80 ; 0x50
1c10: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
1c14: e1a01003 mov r1, r3
1c18: e3a02010 mov r2, #16
1c1c: eb000a64 bl 45b4 <read>
1c20: e1a03000 mov r3, r0
1c24: e3530000 cmp r3, #0
1c28: caffffc8 bgt 1b50 <concreate+0x194>
1c2c: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
1c30: eb000a71 bl 45fc <close>
1c34: e51b300c ldr r3, [fp, #-12]
1c38: e3530028 cmp r3, #40 ; 0x28
1c3c: 0a000003 beq 1c50 <concreate+0x294>
1c40: e3a00001 mov r0, #1
1c44: e59f11c0 ldr r1, [pc, #448] ; 1e0c <concreate+0x450>
1c48: eb000b4b bl 497c <printf>
1c4c: eb000a3d bl 4548 <exit>
1c50: e3a03000 mov r3, #0
1c54: e50b3008 str r3, [fp, #-8]
1c58: ea00005a b 1dc8 <concreate+0x40c>
1c5c: e51b3008 ldr r3, [fp, #-8]
1c60: e6ef3073 uxtb r3, r3
1c64: e2833030 add r3, r3, #48 ; 0x30
1c68: e6ef3073 uxtb r3, r3
1c6c: e54b3017 strb r3, [fp, #-23] ; 0xffffffe9
1c70: eb000a2b bl 4524 <fork>
1c74: e50b0010 str r0, [fp, #-16]
1c78: e51b3010 ldr r3, [fp, #-16]
1c7c: e3530000 cmp r3, #0
1c80: aa000003 bge 1c94 <concreate+0x2d8>
1c84: e3a00001 mov r0, #1
1c88: e59f1180 ldr r1, [pc, #384] ; 1e10 <concreate+0x454>
1c8c: eb000b3a bl 497c <printf>
1c90: eb000a2c bl 4548 <exit>
1c94: e51b1008 ldr r1, [fp, #-8]
1c98: e59f314c ldr r3, [pc, #332] ; 1dec <concreate+0x430>
1c9c: e0c23193 smull r3, r2, r3, r1
1ca0: e1a03fc1 asr r3, r1, #31
1ca4: e0632002 rsb r2, r3, r2
1ca8: e1a03002 mov r3, r2
1cac: e1a03083 lsl r3, r3, #1
1cb0: e0833002 add r3, r3, r2
1cb4: e0632001 rsb r2, r3, r1
1cb8: e3520000 cmp r2, #0
1cbc: 1a000002 bne 1ccc <concreate+0x310>
1cc0: e51b3010 ldr r3, [fp, #-16]
1cc4: e3530000 cmp r3, #0
1cc8: 0a00000d beq 1d04 <concreate+0x348>
1ccc: e51b1008 ldr r1, [fp, #-8]
1cd0: e59f3114 ldr r3, [pc, #276] ; 1dec <concreate+0x430>
1cd4: e0c23193 smull r3, r2, r3, r1
1cd8: e1a03fc1 asr r3, r1, #31
1cdc: e0632002 rsb r2, r3, r2
1ce0: e1a03002 mov r3, r2
1ce4: e1a03083 lsl r3, r3, #1
1ce8: e0833002 add r3, r3, r2
1cec: e0632001 rsb r2, r3, r1
1cf0: e3520001 cmp r2, #1
1cf4: 1a00001f bne 1d78 <concreate+0x3bc>
1cf8: e51b3010 ldr r3, [fp, #-16]
1cfc: e3530000 cmp r3, #0
1d00: 0a00001c beq 1d78 <concreate+0x3bc>
1d04: e24b3018 sub r3, fp, #24
1d08: e1a00003 mov r0, r3
1d0c: e3a01000 mov r1, #0
1d10: eb000a54 bl 4668 <open>
1d14: e1a03000 mov r3, r0
1d18: e1a00003 mov r0, r3
1d1c: eb000a36 bl 45fc <close>
1d20: e24b3018 sub r3, fp, #24
1d24: e1a00003 mov r0, r3
1d28: e3a01000 mov r1, #0
1d2c: eb000a4d bl 4668 <open>
1d30: e1a03000 mov r3, r0
1d34: e1a00003 mov r0, r3
1d38: eb000a2f bl 45fc <close>
1d3c: e24b3018 sub r3, fp, #24
1d40: e1a00003 mov r0, r3
1d44: e3a01000 mov r1, #0
1d48: eb000a46 bl 4668 <open>
1d4c: e1a03000 mov r3, r0
1d50: e1a00003 mov r0, r3
1d54: eb000a28 bl 45fc <close>
1d58: e24b3018 sub r3, fp, #24
1d5c: e1a00003 mov r0, r3
1d60: e3a01000 mov r1, #0
1d64: eb000a3f bl 4668 <open>
1d68: e1a03000 mov r3, r0
1d6c: e1a00003 mov r0, r3
1d70: eb000a21 bl 45fc <close>
1d74: ea00000b b 1da8 <concreate+0x3ec>
1d78: e24b3018 sub r3, fp, #24
1d7c: e1a00003 mov r0, r3
1d80: eb000a4a bl 46b0 <unlink>
1d84: e24b3018 sub r3, fp, #24
1d88: e1a00003 mov r0, r3
1d8c: eb000a47 bl 46b0 <unlink>
1d90: e24b3018 sub r3, fp, #24
1d94: e1a00003 mov r0, r3
1d98: eb000a44 bl 46b0 <unlink>
1d9c: e24b3018 sub r3, fp, #24
1da0: e1a00003 mov r0, r3
1da4: eb000a41 bl 46b0 <unlink>
1da8: e51b3010 ldr r3, [fp, #-16]
1dac: e3530000 cmp r3, #0
1db0: 1a000000 bne 1db8 <concreate+0x3fc>
1db4: eb0009e3 bl 4548 <exit>
1db8: eb0009eb bl 456c <wait>
1dbc: e51b3008 ldr r3, [fp, #-8]
1dc0: e2833001 add r3, r3, #1
1dc4: e50b3008 str r3, [fp, #-8]
1dc8: e51b3008 ldr r3, [fp, #-8]
1dcc: e3530027 cmp r3, #39 ; 0x27
1dd0: daffffa1 ble 1c5c <concreate+0x2a0>
1dd4: e3a00001 mov r0, #1
1dd8: e59f1034 ldr r1, [pc, #52] ; 1e14 <concreate+0x458>
1ddc: eb000ae6 bl 497c <printf>
1de0: e24bd004 sub sp, fp, #4
1de4: e8bd8800 pop {fp, pc}
1de8: 000058a8 .word 0x000058a8
1dec: 55555556 .word 0x55555556
1df0: 000058b8 .word 0x000058b8
1df4: 66666667 .word 0x66666667
1df8: 00000202 .word 0x00000202
1dfc: 000058bc .word 0x000058bc
1e00: 00005878 .word 0x00005878
1e04: 000058d8 .word 0x000058d8
1e08: 000058f4 .word 0x000058f4
1e0c: 00005914 .word 0x00005914
1e10: 00005470 .word 0x00005470
1e14: 00005948 .word 0x00005948
00001e18 <linkunlink>:
1e18: e92d4800 push {fp, lr}
1e1c: e28db004 add fp, sp, #4
1e20: e24dd010 sub sp, sp, #16
1e24: e3a00001 mov r0, #1
1e28: e59f1134 ldr r1, [pc, #308] ; 1f64 <linkunlink+0x14c>
1e2c: eb000ad2 bl 497c <printf>
1e30: e59f0130 ldr r0, [pc, #304] ; 1f68 <linkunlink+0x150>
1e34: eb000a1d bl 46b0 <unlink>
1e38: eb0009b9 bl 4524 <fork>
1e3c: e50b0010 str r0, [fp, #-16]
1e40: e51b3010 ldr r3, [fp, #-16]
1e44: e3530000 cmp r3, #0
1e48: aa000003 bge 1e5c <linkunlink+0x44>
1e4c: e3a00001 mov r0, #1
1e50: e59f1114 ldr r1, [pc, #276] ; 1f6c <linkunlink+0x154>
1e54: eb000ac8 bl 497c <printf>
1e58: eb0009ba bl 4548 <exit>
1e5c: e51b3010 ldr r3, [fp, #-16]
1e60: e3530000 cmp r3, #0
1e64: 0a000001 beq 1e70 <linkunlink+0x58>
1e68: e3a03001 mov r3, #1
1e6c: ea000000 b 1e74 <linkunlink+0x5c>
1e70: e3a03061 mov r3, #97 ; 0x61
1e74: e50b300c str r3, [fp, #-12]
1e78: e3a03000 mov r3, #0
1e7c: e50b3008 str r3, [fp, #-8]
1e80: ea000029 b 1f2c <linkunlink+0x114>
1e84: e51b300c ldr r3, [fp, #-12]
1e88: e59f20e0 ldr r2, [pc, #224] ; 1f70 <linkunlink+0x158>
1e8c: e0030392 mul r3, r2, r3
1e90: e2833a03 add r3, r3, #12288 ; 0x3000
1e94: e2833039 add r3, r3, #57 ; 0x39
1e98: e50b300c str r3, [fp, #-12]
1e9c: e51b100c ldr r1, [fp, #-12]
1ea0: e59f30cc ldr r3, [pc, #204] ; 1f74 <linkunlink+0x15c>
1ea4: e0832193 umull r2, r3, r3, r1
1ea8: e1a020a3 lsr r2, r3, #1
1eac: e1a03002 mov r3, r2
1eb0: e1a03083 lsl r3, r3, #1
1eb4: e0833002 add r3, r3, r2
1eb8: e0632001 rsb r2, r3, r1
1ebc: e3520000 cmp r2, #0
1ec0: 1a000006 bne 1ee0 <linkunlink+0xc8>
1ec4: e59f009c ldr r0, [pc, #156] ; 1f68 <linkunlink+0x150>
1ec8: e59f10a8 ldr r1, [pc, #168] ; 1f78 <linkunlink+0x160>
1ecc: eb0009e5 bl 4668 <open>
1ed0: e1a03000 mov r3, r0
1ed4: e1a00003 mov r0, r3
1ed8: eb0009c7 bl 45fc <close>
1edc: ea00000f b 1f20 <linkunlink+0x108>
1ee0: e51b100c ldr r1, [fp, #-12]
1ee4: e59f3088 ldr r3, [pc, #136] ; 1f74 <linkunlink+0x15c>
1ee8: e0832193 umull r2, r3, r3, r1
1eec: e1a020a3 lsr r2, r3, #1
1ef0: e1a03002 mov r3, r2
1ef4: e1a03083 lsl r3, r3, #1
1ef8: e0833002 add r3, r3, r2
1efc: e0632001 rsb r2, r3, r1
1f00: e3520001 cmp r2, #1
1f04: 1a000003 bne 1f18 <linkunlink+0x100>
1f08: e59f006c ldr r0, [pc, #108] ; 1f7c <linkunlink+0x164>
1f0c: e59f1054 ldr r1, [pc, #84] ; 1f68 <linkunlink+0x150>
1f10: eb0009f8 bl 46f8 <link>
1f14: ea000001 b 1f20 <linkunlink+0x108>
1f18: e59f0048 ldr r0, [pc, #72] ; 1f68 <linkunlink+0x150>
1f1c: eb0009e3 bl 46b0 <unlink>
1f20: e51b3008 ldr r3, [fp, #-8]
1f24: e2833001 add r3, r3, #1
1f28: e50b3008 str r3, [fp, #-8]
1f2c: e51b3008 ldr r3, [fp, #-8]
1f30: e3530063 cmp r3, #99 ; 0x63
1f34: daffffd2 ble 1e84 <linkunlink+0x6c>
1f38: e51b3010 ldr r3, [fp, #-16]
1f3c: e3530000 cmp r3, #0
1f40: 0a000001 beq 1f4c <linkunlink+0x134>
1f44: eb000988 bl 456c <wait>
1f48: ea000000 b 1f50 <linkunlink+0x138>
1f4c: eb00097d bl 4548 <exit>
1f50: e3a00001 mov r0, #1
1f54: e59f1024 ldr r1, [pc, #36] ; 1f80 <linkunlink+0x168>
1f58: eb000a87 bl 497c <printf>
1f5c: e24bd004 sub sp, fp, #4
1f60: e8bd8800 pop {fp, pc}
1f64: 00005958 .word 0x00005958
1f68: 00005420 .word 0x00005420
1f6c: 00005470 .word 0x00005470
1f70: 41c64e6d .word 0x41c64e6d
1f74: aaaaaaab .word 0xaaaaaaab
1f78: 00000202 .word 0x00000202
1f7c: 0000596c .word 0x0000596c
1f80: 00005970 .word 0x00005970
00001f84 <bigdir>:
1f84: e92d4800 push {fp, lr}
1f88: e28db004 add fp, sp, #4
1f8c: e24dd018 sub sp, sp, #24
1f90: e3a00001 mov r0, #1
1f94: e59f11b4 ldr r1, [pc, #436] ; 2150 <bigdir+0x1cc>
1f98: eb000a77 bl 497c <printf>
1f9c: e59f01b0 ldr r0, [pc, #432] ; 2154 <bigdir+0x1d0>
1fa0: eb0009c2 bl 46b0 <unlink>
1fa4: e59f01a8 ldr r0, [pc, #424] ; 2154 <bigdir+0x1d0>
1fa8: e3a01c02 mov r1, #512 ; 0x200
1fac: eb0009ad bl 4668 <open>
1fb0: e50b000c str r0, [fp, #-12]
1fb4: e51b300c ldr r3, [fp, #-12]
1fb8: e3530000 cmp r3, #0
1fbc: aa000003 bge 1fd0 <bigdir+0x4c>
1fc0: e3a00001 mov r0, #1
1fc4: e59f118c ldr r1, [pc, #396] ; 2158 <bigdir+0x1d4>
1fc8: eb000a6b bl 497c <printf>
1fcc: eb00095d bl 4548 <exit>
1fd0: e51b000c ldr r0, [fp, #-12]
1fd4: eb000988 bl 45fc <close>
1fd8: e3a03000 mov r3, #0
1fdc: e50b3008 str r3, [fp, #-8]
1fe0: ea000025 b 207c <bigdir+0xf8>
1fe4: e3a03078 mov r3, #120 ; 0x78
1fe8: e54b3018 strb r3, [fp, #-24] ; 0xffffffe8
1fec: e51b3008 ldr r3, [fp, #-8]
1ff0: e283203f add r2, r3, #63 ; 0x3f
1ff4: e3530000 cmp r3, #0
1ff8: b1a03002 movlt r3, r2
1ffc: a1a03003 movge r3, r3
2000: e1a03343 asr r3, r3, #6
2004: e6ef3073 uxtb r3, r3
2008: e2833030 add r3, r3, #48 ; 0x30
200c: e6ef3073 uxtb r3, r3
2010: e54b3017 strb r3, [fp, #-23] ; 0xffffffe9
2014: e51b2008 ldr r2, [fp, #-8]
2018: e1a03fc2 asr r3, r2, #31
201c: e1a03d23 lsr r3, r3, #26
2020: e0822003 add r2, r2, r3
2024: e202203f and r2, r2, #63 ; 0x3f
2028: e0633002 rsb r3, r3, r2
202c: e6ef3073 uxtb r3, r3
2030: e2833030 add r3, r3, #48 ; 0x30
2034: e6ef3073 uxtb r3, r3
2038: e54b3016 strb r3, [fp, #-22] ; 0xffffffea
203c: e3a03000 mov r3, #0
2040: e54b3015 strb r3, [fp, #-21] ; 0xffffffeb
2044: e24b3018 sub r3, fp, #24
2048: e59f0104 ldr r0, [pc, #260] ; 2154 <bigdir+0x1d0>
204c: e1a01003 mov r1, r3
2050: eb0009a8 bl 46f8 <link>
2054: e1a03000 mov r3, r0
2058: e3530000 cmp r3, #0
205c: 0a000003 beq 2070 <bigdir+0xec>
2060: e3a00001 mov r0, #1
2064: e59f10f0 ldr r1, [pc, #240] ; 215c <bigdir+0x1d8>
2068: eb000a43 bl 497c <printf>
206c: eb000935 bl 4548 <exit>
2070: e51b3008 ldr r3, [fp, #-8]
2074: e2833001 add r3, r3, #1
2078: e50b3008 str r3, [fp, #-8]
207c: e51b3008 ldr r3, [fp, #-8]
2080: e3530f7d cmp r3, #500 ; 0x1f4
2084: baffffd6 blt 1fe4 <bigdir+0x60>
2088: e59f00c4 ldr r0, [pc, #196] ; 2154 <bigdir+0x1d0>
208c: eb000987 bl 46b0 <unlink>
2090: e3a03000 mov r3, #0
2094: e50b3008 str r3, [fp, #-8]
2098: ea000024 b 2130 <bigdir+0x1ac>
209c: e3a03078 mov r3, #120 ; 0x78
20a0: e54b3018 strb r3, [fp, #-24] ; 0xffffffe8
20a4: e51b3008 ldr r3, [fp, #-8]
20a8: e283203f add r2, r3, #63 ; 0x3f
20ac: e3530000 cmp r3, #0
20b0: b1a03002 movlt r3, r2
20b4: a1a03003 movge r3, r3
20b8: e1a03343 asr r3, r3, #6
20bc: e6ef3073 uxtb r3, r3
20c0: e2833030 add r3, r3, #48 ; 0x30
20c4: e6ef3073 uxtb r3, r3
20c8: e54b3017 strb r3, [fp, #-23] ; 0xffffffe9
20cc: e51b2008 ldr r2, [fp, #-8]
20d0: e1a03fc2 asr r3, r2, #31
20d4: e1a03d23 lsr r3, r3, #26
20d8: e0822003 add r2, r2, r3
20dc: e202203f and r2, r2, #63 ; 0x3f
20e0: e0633002 rsb r3, r3, r2
20e4: e6ef3073 uxtb r3, r3
20e8: e2833030 add r3, r3, #48 ; 0x30
20ec: e6ef3073 uxtb r3, r3
20f0: e54b3016 strb r3, [fp, #-22] ; 0xffffffea
20f4: e3a03000 mov r3, #0
20f8: e54b3015 strb r3, [fp, #-21] ; 0xffffffeb
20fc: e24b3018 sub r3, fp, #24
2100: e1a00003 mov r0, r3
2104: eb000969 bl 46b0 <unlink>
2108: e1a03000 mov r3, r0
210c: e3530000 cmp r3, #0
2110: 0a000003 beq 2124 <bigdir+0x1a0>
2114: e3a00001 mov r0, #1
2118: e59f1040 ldr r1, [pc, #64] ; 2160 <bigdir+0x1dc>
211c: eb000a16 bl 497c <printf>
2120: eb000908 bl 4548 <exit>
2124: e51b3008 ldr r3, [fp, #-8]
2128: e2833001 add r3, r3, #1
212c: e50b3008 str r3, [fp, #-8]
2130: e51b3008 ldr r3, [fp, #-8]
2134: e3530f7d cmp r3, #500 ; 0x1f4
2138: baffffd7 blt 209c <bigdir+0x118>
213c: e3a00001 mov r0, #1
2140: e59f101c ldr r1, [pc, #28] ; 2164 <bigdir+0x1e0>
2144: eb000a0c bl 497c <printf>
2148: e24bd004 sub sp, fp, #4
214c: e8bd8800 pop {fp, pc}
2150: 00005980 .word 0x00005980
2154: 00005990 .word 0x00005990
2158: 00005994 .word 0x00005994
215c: 000059ac .word 0x000059ac
2160: 000059c0 .word 0x000059c0
2164: 000059d8 .word 0x000059d8
00002168 <subdir>:
2168: e92d4800 push {fp, lr}
216c: e28db004 add fp, sp, #4
2170: e24dd008 sub sp, sp, #8
2174: e3a00001 mov r0, #1
2178: e59f1600 ldr r1, [pc, #1536] ; 2780 <subdir+0x618>
217c: eb0009fe bl 497c <printf>
2180: e59f05fc ldr r0, [pc, #1532] ; 2784 <subdir+0x61c>
2184: eb000949 bl 46b0 <unlink>
2188: e59f05f8 ldr r0, [pc, #1528] ; 2788 <subdir+0x620>
218c: eb000962 bl 471c <mkdir>
2190: e1a03000 mov r3, r0
2194: e3530000 cmp r3, #0
2198: 0a000003 beq 21ac <subdir+0x44>
219c: e3a00001 mov r0, #1
21a0: e59f15e4 ldr r1, [pc, #1508] ; 278c <subdir+0x624>
21a4: eb0009f4 bl 497c <printf>
21a8: eb0008e6 bl 4548 <exit>
21ac: e59f05dc ldr r0, [pc, #1500] ; 2790 <subdir+0x628>
21b0: e59f15dc ldr r1, [pc, #1500] ; 2794 <subdir+0x62c>
21b4: eb00092b bl 4668 <open>
21b8: e50b0008 str r0, [fp, #-8]
21bc: e51b3008 ldr r3, [fp, #-8]
21c0: e3530000 cmp r3, #0
21c4: aa000003 bge 21d8 <subdir+0x70>
21c8: e3a00001 mov r0, #1
21cc: e59f15c4 ldr r1, [pc, #1476] ; 2798 <subdir+0x630>
21d0: eb0009e9 bl 497c <printf>
21d4: eb0008db bl 4548 <exit>
21d8: e51b0008 ldr r0, [fp, #-8]
21dc: e59f15a0 ldr r1, [pc, #1440] ; 2784 <subdir+0x61c>
21e0: e3a02002 mov r2, #2
21e4: eb0008fb bl 45d8 <write>
21e8: e51b0008 ldr r0, [fp, #-8]
21ec: eb000902 bl 45fc <close>
21f0: e59f0590 ldr r0, [pc, #1424] ; 2788 <subdir+0x620>
21f4: eb00092d bl 46b0 <unlink>
21f8: e1a03000 mov r3, r0
21fc: e3530000 cmp r3, #0
2200: ba000003 blt 2214 <subdir+0xac>
2204: e3a00001 mov r0, #1
2208: e59f158c ldr r1, [pc, #1420] ; 279c <subdir+0x634>
220c: eb0009da bl 497c <printf>
2210: eb0008cc bl 4548 <exit>
2214: e59f0584 ldr r0, [pc, #1412] ; 27a0 <subdir+0x638>
2218: eb00093f bl 471c <mkdir>
221c: e1a03000 mov r3, r0
2220: e3530000 cmp r3, #0
2224: 0a000003 beq 2238 <subdir+0xd0>
2228: e3a00001 mov r0, #1
222c: e59f1570 ldr r1, [pc, #1392] ; 27a4 <subdir+0x63c>
2230: eb0009d1 bl 497c <printf>
2234: eb0008c3 bl 4548 <exit>
2238: e59f0568 ldr r0, [pc, #1384] ; 27a8 <subdir+0x640>
223c: e59f1550 ldr r1, [pc, #1360] ; 2794 <subdir+0x62c>
2240: eb000908 bl 4668 <open>
2244: e50b0008 str r0, [fp, #-8]
2248: e51b3008 ldr r3, [fp, #-8]
224c: e3530000 cmp r3, #0
2250: aa000003 bge 2264 <subdir+0xfc>
2254: e3a00001 mov r0, #1
2258: e59f154c ldr r1, [pc, #1356] ; 27ac <subdir+0x644>
225c: eb0009c6 bl 497c <printf>
2260: eb0008b8 bl 4548 <exit>
2264: e51b0008 ldr r0, [fp, #-8]
2268: e59f1540 ldr r1, [pc, #1344] ; 27b0 <subdir+0x648>
226c: e3a02002 mov r2, #2
2270: eb0008d8 bl 45d8 <write>
2274: e51b0008 ldr r0, [fp, #-8]
2278: eb0008df bl 45fc <close>
227c: e59f0530 ldr r0, [pc, #1328] ; 27b4 <subdir+0x64c>
2280: e3a01000 mov r1, #0
2284: eb0008f7 bl 4668 <open>
2288: e50b0008 str r0, [fp, #-8]
228c: e51b3008 ldr r3, [fp, #-8]
2290: e3530000 cmp r3, #0
2294: aa000003 bge 22a8 <subdir+0x140>
2298: e3a00001 mov r0, #1
229c: e59f1514 ldr r1, [pc, #1300] ; 27b8 <subdir+0x650>
22a0: eb0009b5 bl 497c <printf>
22a4: eb0008a7 bl 4548 <exit>
22a8: e51b0008 ldr r0, [fp, #-8]
22ac: e59f1508 ldr r1, [pc, #1288] ; 27bc <subdir+0x654>
22b0: e3a02a02 mov r2, #8192 ; 0x2000
22b4: eb0008be bl 45b4 <read>
22b8: e50b000c str r0, [fp, #-12]
22bc: e51b300c ldr r3, [fp, #-12]
22c0: e3530002 cmp r3, #2
22c4: 1a000003 bne 22d8 <subdir+0x170>
22c8: e59f34ec ldr r3, [pc, #1260] ; 27bc <subdir+0x654>
22cc: e5d33000 ldrb r3, [r3]
22d0: e3530066 cmp r3, #102 ; 0x66
22d4: 0a000003 beq 22e8 <subdir+0x180>
22d8: e3a00001 mov r0, #1
22dc: e59f14dc ldr r1, [pc, #1244] ; 27c0 <subdir+0x658>
22e0: eb0009a5 bl 497c <printf>
22e4: eb000897 bl 4548 <exit>
22e8: e51b0008 ldr r0, [fp, #-8]
22ec: eb0008c2 bl 45fc <close>
22f0: e59f04b0 ldr r0, [pc, #1200] ; 27a8 <subdir+0x640>
22f4: e59f14c8 ldr r1, [pc, #1224] ; 27c4 <subdir+0x65c>
22f8: eb0008fe bl 46f8 <link>
22fc: e1a03000 mov r3, r0
2300: e3530000 cmp r3, #0
2304: 0a000003 beq 2318 <subdir+0x1b0>
2308: e3a00001 mov r0, #1
230c: e59f14b4 ldr r1, [pc, #1204] ; 27c8 <subdir+0x660>
2310: eb000999 bl 497c <printf>
2314: eb00088b bl 4548 <exit>
2318: e59f0488 ldr r0, [pc, #1160] ; 27a8 <subdir+0x640>
231c: eb0008e3 bl 46b0 <unlink>
2320: e1a03000 mov r3, r0
2324: e3530000 cmp r3, #0
2328: 0a000003 beq 233c <subdir+0x1d4>
232c: e3a00001 mov r0, #1
2330: e59f1494 ldr r1, [pc, #1172] ; 27cc <subdir+0x664>
2334: eb000990 bl 497c <printf>
2338: eb000882 bl 4548 <exit>
233c: e59f0464 ldr r0, [pc, #1124] ; 27a8 <subdir+0x640>
2340: e3a01000 mov r1, #0
2344: eb0008c7 bl 4668 <open>
2348: e1a03000 mov r3, r0
234c: e3530000 cmp r3, #0
2350: ba000003 blt 2364 <subdir+0x1fc>
2354: e3a00001 mov r0, #1
2358: e59f1470 ldr r1, [pc, #1136] ; 27d0 <subdir+0x668>
235c: eb000986 bl 497c <printf>
2360: eb000878 bl 4548 <exit>
2364: e59f041c ldr r0, [pc, #1052] ; 2788 <subdir+0x620>
2368: eb0008f4 bl 4740 <chdir>
236c: e1a03000 mov r3, r0
2370: e3530000 cmp r3, #0
2374: 0a000003 beq 2388 <subdir+0x220>
2378: e3a00001 mov r0, #1
237c: e59f1450 ldr r1, [pc, #1104] ; 27d4 <subdir+0x66c>
2380: eb00097d bl 497c <printf>
2384: eb00086f bl 4548 <exit>
2388: e59f0448 ldr r0, [pc, #1096] ; 27d8 <subdir+0x670>
238c: eb0008eb bl 4740 <chdir>
2390: e1a03000 mov r3, r0
2394: e3530000 cmp r3, #0
2398: 0a000003 beq 23ac <subdir+0x244>
239c: e3a00001 mov r0, #1
23a0: e59f1434 ldr r1, [pc, #1076] ; 27dc <subdir+0x674>
23a4: eb000974 bl 497c <printf>
23a8: eb000866 bl 4548 <exit>
23ac: e59f042c ldr r0, [pc, #1068] ; 27e0 <subdir+0x678>
23b0: eb0008e2 bl 4740 <chdir>
23b4: e1a03000 mov r3, r0
23b8: e3530000 cmp r3, #0
23bc: 0a000003 beq 23d0 <subdir+0x268>
23c0: e3a00001 mov r0, #1
23c4: e59f1410 ldr r1, [pc, #1040] ; 27dc <subdir+0x674>
23c8: eb00096b bl 497c <printf>
23cc: eb00085d bl 4548 <exit>
23d0: e59f040c ldr r0, [pc, #1036] ; 27e4 <subdir+0x67c>
23d4: eb0008d9 bl 4740 <chdir>
23d8: e1a03000 mov r3, r0
23dc: e3530000 cmp r3, #0
23e0: 0a000003 beq 23f4 <subdir+0x28c>
23e4: e3a00001 mov r0, #1
23e8: e59f13f8 ldr r1, [pc, #1016] ; 27e8 <subdir+0x680>
23ec: eb000962 bl 497c <printf>
23f0: eb000854 bl 4548 <exit>
23f4: e59f03c8 ldr r0, [pc, #968] ; 27c4 <subdir+0x65c>
23f8: e3a01000 mov r1, #0
23fc: eb000899 bl 4668 <open>
2400: e50b0008 str r0, [fp, #-8]
2404: e51b3008 ldr r3, [fp, #-8]
2408: e3530000 cmp r3, #0
240c: aa000003 bge 2420 <subdir+0x2b8>
2410: e3a00001 mov r0, #1
2414: e59f13d0 ldr r1, [pc, #976] ; 27ec <subdir+0x684>
2418: eb000957 bl 497c <printf>
241c: eb000849 bl 4548 <exit>
2420: e51b0008 ldr r0, [fp, #-8]
2424: e59f1390 ldr r1, [pc, #912] ; 27bc <subdir+0x654>
2428: e3a02a02 mov r2, #8192 ; 0x2000
242c: eb000860 bl 45b4 <read>
2430: e1a03000 mov r3, r0
2434: e3530002 cmp r3, #2
2438: 0a000003 beq 244c <subdir+0x2e4>
243c: e3a00001 mov r0, #1
2440: e59f13a8 ldr r1, [pc, #936] ; 27f0 <subdir+0x688>
2444: eb00094c bl 497c <printf>
2448: eb00083e bl 4548 <exit>
244c: e51b0008 ldr r0, [fp, #-8]
2450: eb000869 bl 45fc <close>
2454: e59f034c ldr r0, [pc, #844] ; 27a8 <subdir+0x640>
2458: e3a01000 mov r1, #0
245c: eb000881 bl 4668 <open>
2460: e1a03000 mov r3, r0
2464: e3530000 cmp r3, #0
2468: ba000003 blt 247c <subdir+0x314>
246c: e3a00001 mov r0, #1
2470: e59f137c ldr r1, [pc, #892] ; 27f4 <subdir+0x68c>
2474: eb000940 bl 497c <printf>
2478: eb000832 bl 4548 <exit>
247c: e59f0374 ldr r0, [pc, #884] ; 27f8 <subdir+0x690>
2480: e59f130c ldr r1, [pc, #780] ; 2794 <subdir+0x62c>
2484: eb000877 bl 4668 <open>
2488: e1a03000 mov r3, r0
248c: e3530000 cmp r3, #0
2490: ba000003 blt 24a4 <subdir+0x33c>
2494: e3a00001 mov r0, #1
2498: e59f135c ldr r1, [pc, #860] ; 27fc <subdir+0x694>
249c: eb000936 bl 497c <printf>
24a0: eb000828 bl 4548 <exit>
24a4: e59f0354 ldr r0, [pc, #852] ; 2800 <subdir+0x698>
24a8: e59f12e4 ldr r1, [pc, #740] ; 2794 <subdir+0x62c>
24ac: eb00086d bl 4668 <open>
24b0: e1a03000 mov r3, r0
24b4: e3530000 cmp r3, #0
24b8: ba000003 blt 24cc <subdir+0x364>
24bc: e3a00001 mov r0, #1
24c0: e59f133c ldr r1, [pc, #828] ; 2804 <subdir+0x69c>
24c4: eb00092c bl 497c <printf>
24c8: eb00081e bl 4548 <exit>
24cc: e59f02b4 ldr r0, [pc, #692] ; 2788 <subdir+0x620>
24d0: e3a01c02 mov r1, #512 ; 0x200
24d4: eb000863 bl 4668 <open>
24d8: e1a03000 mov r3, r0
24dc: e3530000 cmp r3, #0
24e0: ba000003 blt 24f4 <subdir+0x38c>
24e4: e3a00001 mov r0, #1
24e8: e59f1318 ldr r1, [pc, #792] ; 2808 <subdir+0x6a0>
24ec: eb000922 bl 497c <printf>
24f0: eb000814 bl 4548 <exit>
24f4: e59f028c ldr r0, [pc, #652] ; 2788 <subdir+0x620>
24f8: e3a01002 mov r1, #2
24fc: eb000859 bl 4668 <open>
2500: e1a03000 mov r3, r0
2504: e3530000 cmp r3, #0
2508: ba000003 blt 251c <subdir+0x3b4>
250c: e3a00001 mov r0, #1
2510: e59f12f4 ldr r1, [pc, #756] ; 280c <subdir+0x6a4>
2514: eb000918 bl 497c <printf>
2518: eb00080a bl 4548 <exit>
251c: e59f0264 ldr r0, [pc, #612] ; 2788 <subdir+0x620>
2520: e3a01001 mov r1, #1
2524: eb00084f bl 4668 <open>
2528: e1a03000 mov r3, r0
252c: e3530000 cmp r3, #0
2530: ba000003 blt 2544 <subdir+0x3dc>
2534: e3a00001 mov r0, #1
2538: e59f12d0 ldr r1, [pc, #720] ; 2810 <subdir+0x6a8>
253c: eb00090e bl 497c <printf>
2540: eb000800 bl 4548 <exit>
2544: e59f02ac ldr r0, [pc, #684] ; 27f8 <subdir+0x690>
2548: e59f12c4 ldr r1, [pc, #708] ; 2814 <subdir+0x6ac>
254c: eb000869 bl 46f8 <link>
2550: e1a03000 mov r3, r0
2554: e3530000 cmp r3, #0
2558: 1a000003 bne 256c <subdir+0x404>
255c: e3a00001 mov r0, #1
2560: e59f12b0 ldr r1, [pc, #688] ; 2818 <subdir+0x6b0>
2564: eb000904 bl 497c <printf>
2568: eb0007f6 bl 4548 <exit>
256c: e59f028c ldr r0, [pc, #652] ; 2800 <subdir+0x698>
2570: e59f129c ldr r1, [pc, #668] ; 2814 <subdir+0x6ac>
2574: eb00085f bl 46f8 <link>
2578: e1a03000 mov r3, r0
257c: e3530000 cmp r3, #0
2580: 1a000003 bne 2594 <subdir+0x42c>
2584: e3a00001 mov r0, #1
2588: e59f128c ldr r1, [pc, #652] ; 281c <subdir+0x6b4>
258c: eb0008fa bl 497c <printf>
2590: eb0007ec bl 4548 <exit>
2594: e59f01f4 ldr r0, [pc, #500] ; 2790 <subdir+0x628>
2598: e59f1224 ldr r1, [pc, #548] ; 27c4 <subdir+0x65c>
259c: eb000855 bl 46f8 <link>
25a0: e1a03000 mov r3, r0
25a4: e3530000 cmp r3, #0
25a8: 1a000003 bne 25bc <subdir+0x454>
25ac: e3a00001 mov r0, #1
25b0: e59f1268 ldr r1, [pc, #616] ; 2820 <subdir+0x6b8>
25b4: eb0008f0 bl 497c <printf>
25b8: eb0007e2 bl 4548 <exit>
25bc: e59f0234 ldr r0, [pc, #564] ; 27f8 <subdir+0x690>
25c0: eb000855 bl 471c <mkdir>
25c4: e1a03000 mov r3, r0
25c8: e3530000 cmp r3, #0
25cc: 1a000003 bne 25e0 <subdir+0x478>
25d0: e3a00001 mov r0, #1
25d4: e59f1248 ldr r1, [pc, #584] ; 2824 <subdir+0x6bc>
25d8: eb0008e7 bl 497c <printf>
25dc: eb0007d9 bl 4548 <exit>
25e0: e59f0218 ldr r0, [pc, #536] ; 2800 <subdir+0x698>
25e4: eb00084c bl 471c <mkdir>
25e8: e1a03000 mov r3, r0
25ec: e3530000 cmp r3, #0
25f0: 1a000003 bne 2604 <subdir+0x49c>
25f4: e3a00001 mov r0, #1
25f8: e59f1228 ldr r1, [pc, #552] ; 2828 <subdir+0x6c0>
25fc: eb0008de bl 497c <printf>
2600: eb0007d0 bl 4548 <exit>
2604: e59f01b8 ldr r0, [pc, #440] ; 27c4 <subdir+0x65c>
2608: eb000843 bl 471c <mkdir>
260c: e1a03000 mov r3, r0
2610: e3530000 cmp r3, #0
2614: 1a000003 bne 2628 <subdir+0x4c0>
2618: e3a00001 mov r0, #1
261c: e59f1208 ldr r1, [pc, #520] ; 282c <subdir+0x6c4>
2620: eb0008d5 bl 497c <printf>
2624: eb0007c7 bl 4548 <exit>
2628: e59f01d0 ldr r0, [pc, #464] ; 2800 <subdir+0x698>
262c: eb00081f bl 46b0 <unlink>
2630: e1a03000 mov r3, r0
2634: e3530000 cmp r3, #0
2638: 1a000003 bne 264c <subdir+0x4e4>
263c: e3a00001 mov r0, #1
2640: e59f11e8 ldr r1, [pc, #488] ; 2830 <subdir+0x6c8>
2644: eb0008cc bl 497c <printf>
2648: eb0007be bl 4548 <exit>
264c: e59f01a4 ldr r0, [pc, #420] ; 27f8 <subdir+0x690>
2650: eb000816 bl 46b0 <unlink>
2654: e1a03000 mov r3, r0
2658: e3530000 cmp r3, #0
265c: 1a000003 bne 2670 <subdir+0x508>
2660: e3a00001 mov r0, #1
2664: e59f11c8 ldr r1, [pc, #456] ; 2834 <subdir+0x6cc>
2668: eb0008c3 bl 497c <printf>
266c: eb0007b5 bl 4548 <exit>
2670: e59f0118 ldr r0, [pc, #280] ; 2790 <subdir+0x628>
2674: eb000831 bl 4740 <chdir>
2678: e1a03000 mov r3, r0
267c: e3530000 cmp r3, #0
2680: 1a000003 bne 2694 <subdir+0x52c>
2684: e3a00001 mov r0, #1
2688: e59f11a8 ldr r1, [pc, #424] ; 2838 <subdir+0x6d0>
268c: eb0008ba bl 497c <printf>
2690: eb0007ac bl 4548 <exit>
2694: e59f01a0 ldr r0, [pc, #416] ; 283c <subdir+0x6d4>
2698: eb000828 bl 4740 <chdir>
269c: e1a03000 mov r3, r0
26a0: e3530000 cmp r3, #0
26a4: 1a000003 bne 26b8 <subdir+0x550>
26a8: e3a00001 mov r0, #1
26ac: e59f118c ldr r1, [pc, #396] ; 2840 <subdir+0x6d8>
26b0: eb0008b1 bl 497c <printf>
26b4: eb0007a3 bl 4548 <exit>
26b8: e59f0104 ldr r0, [pc, #260] ; 27c4 <subdir+0x65c>
26bc: eb0007fb bl 46b0 <unlink>
26c0: e1a03000 mov r3, r0
26c4: e3530000 cmp r3, #0
26c8: 0a000003 beq 26dc <subdir+0x574>
26cc: e3a00001 mov r0, #1
26d0: e59f10f4 ldr r1, [pc, #244] ; 27cc <subdir+0x664>
26d4: eb0008a8 bl 497c <printf>
26d8: eb00079a bl 4548 <exit>
26dc: e59f00ac ldr r0, [pc, #172] ; 2790 <subdir+0x628>
26e0: eb0007f2 bl 46b0 <unlink>
26e4: e1a03000 mov r3, r0
26e8: e3530000 cmp r3, #0
26ec: 0a000003 beq 2700 <subdir+0x598>
26f0: e3a00001 mov r0, #1
26f4: e59f1148 ldr r1, [pc, #328] ; 2844 <subdir+0x6dc>
26f8: eb00089f bl 497c <printf>
26fc: eb000791 bl 4548 <exit>
2700: e59f0080 ldr r0, [pc, #128] ; 2788 <subdir+0x620>
2704: eb0007e9 bl 46b0 <unlink>
2708: e1a03000 mov r3, r0
270c: e3530000 cmp r3, #0
2710: 1a000003 bne 2724 <subdir+0x5bc>
2714: e3a00001 mov r0, #1
2718: e59f1128 ldr r1, [pc, #296] ; 2848 <subdir+0x6e0>
271c: eb000896 bl 497c <printf>
2720: eb000788 bl 4548 <exit>
2724: e59f0120 ldr r0, [pc, #288] ; 284c <subdir+0x6e4>
2728: eb0007e0 bl 46b0 <unlink>
272c: e1a03000 mov r3, r0
2730: e3530000 cmp r3, #0
2734: aa000003 bge 2748 <subdir+0x5e0>
2738: e3a00001 mov r0, #1
273c: e59f110c ldr r1, [pc, #268] ; 2850 <subdir+0x6e8>
2740: eb00088d bl 497c <printf>
2744: eb00077f bl 4548 <exit>
2748: e59f0038 ldr r0, [pc, #56] ; 2788 <subdir+0x620>
274c: eb0007d7 bl 46b0 <unlink>
2750: e1a03000 mov r3, r0
2754: e3530000 cmp r3, #0
2758: aa000003 bge 276c <subdir+0x604>
275c: e3a00001 mov r0, #1
2760: e59f10ec ldr r1, [pc, #236] ; 2854 <subdir+0x6ec>
2764: eb000884 bl 497c <printf>
2768: eb000776 bl 4548 <exit>
276c: e3a00001 mov r0, #1
2770: e59f10e0 ldr r1, [pc, #224] ; 2858 <subdir+0x6f0>
2774: eb000880 bl 497c <printf>
2778: e24bd004 sub sp, fp, #4
277c: e8bd8800 pop {fp, pc}
2780: 000059e4 .word 0x000059e4
2784: 000059f4 .word 0x000059f4
2788: 000059f8 .word 0x000059f8
278c: 000059fc .word 0x000059fc
2790: 00005a14 .word 0x00005a14
2794: 00000202 .word 0x00000202
2798: 00005a1c .word 0x00005a1c
279c: 00005a34 .word 0x00005a34
27a0: 00005a5c .word 0x00005a5c
27a4: 00005a64 .word 0x00005a64
27a8: 00005a80 .word 0x00005a80
27ac: 00005a8c .word 0x00005a8c
27b0: 00005aa4 .word 0x00005aa4
27b4: 00005aa8 .word 0x00005aa8
27b8: 00005ab4 .word 0x00005ab4
27bc: 00009080 .word 0x00009080
27c0: 00005ad0 .word 0x00005ad0
27c4: 00005aec .word 0x00005aec
27c8: 00005af8 .word 0x00005af8
27cc: 00005b1c .word 0x00005b1c
27d0: 00005b34 .word 0x00005b34
27d4: 00005b58 .word 0x00005b58
27d8: 00005b6c .word 0x00005b6c
27dc: 00005b78 .word 0x00005b78
27e0: 00005b94 .word 0x00005b94
27e4: 00005ba4 .word 0x00005ba4
27e8: 00005bac .word 0x00005bac
27ec: 00005bc0 .word 0x00005bc0
27f0: 00005bd8 .word 0x00005bd8
27f4: 00005bf4 .word 0x00005bf4
27f8: 00005c1c .word 0x00005c1c
27fc: 00005c28 .word 0x00005c28
2800: 00005c44 .word 0x00005c44
2804: 00005c50 .word 0x00005c50
2808: 00005c6c .word 0x00005c6c
280c: 00005c84 .word 0x00005c84
2810: 00005ca0 .word 0x00005ca0
2814: 00005cbc .word 0x00005cbc
2818: 00005cc8 .word 0x00005cc8
281c: 00005cec .word 0x00005cec
2820: 00005d10 .word 0x00005d10
2824: 00005d34 .word 0x00005d34
2828: 00005d50 .word 0x00005d50
282c: 00005d6c .word 0x00005d6c
2830: 00005d8c .word 0x00005d8c
2834: 00005da8 .word 0x00005da8
2838: 00005dc4 .word 0x00005dc4
283c: 00005ddc .word 0x00005ddc
2840: 00005de4 .word 0x00005de4
2844: 00005dfc .word 0x00005dfc
2848: 00005e14 .word 0x00005e14
284c: 00005e34 .word 0x00005e34
2850: 00005e3c .word 0x00005e3c
2854: 00005e54 .word 0x00005e54
2858: 00005e68 .word 0x00005e68
0000285c <bigwrite>:
285c: e92d4800 push {fp, lr}
2860: e28db004 add fp, sp, #4
2864: e24dd010 sub sp, sp, #16
2868: e3a00001 mov r0, #1
286c: e59f10e0 ldr r1, [pc, #224] ; 2954 <bigwrite+0xf8>
2870: eb000841 bl 497c <printf>
2874: e59f00dc ldr r0, [pc, #220] ; 2958 <bigwrite+0xfc>
2878: eb00078c bl 46b0 <unlink>
287c: e59f30d8 ldr r3, [pc, #216] ; 295c <bigwrite+0x100>
2880: e50b3008 str r3, [fp, #-8]
2884: ea00002a b 2934 <bigwrite+0xd8>
2888: e59f00c8 ldr r0, [pc, #200] ; 2958 <bigwrite+0xfc>
288c: e59f10cc ldr r1, [pc, #204] ; 2960 <bigwrite+0x104>
2890: eb000774 bl 4668 <open>
2894: e50b0010 str r0, [fp, #-16]
2898: e51b3010 ldr r3, [fp, #-16]
289c: e3530000 cmp r3, #0
28a0: aa000003 bge 28b4 <bigwrite+0x58>
28a4: e3a00001 mov r0, #1
28a8: e59f10b4 ldr r1, [pc, #180] ; 2964 <bigwrite+0x108>
28ac: eb000832 bl 497c <printf>
28b0: eb000724 bl 4548 <exit>
28b4: e3a03000 mov r3, #0
28b8: e50b300c str r3, [fp, #-12]
28bc: ea000011 b 2908 <bigwrite+0xac>
28c0: e51b0010 ldr r0, [fp, #-16]
28c4: e59f109c ldr r1, [pc, #156] ; 2968 <bigwrite+0x10c>
28c8: e51b2008 ldr r2, [fp, #-8]
28cc: eb000741 bl 45d8 <write>
28d0: e50b0014 str r0, [fp, #-20] ; 0xffffffec
28d4: e51b2014 ldr r2, [fp, #-20] ; 0xffffffec
28d8: e51b3008 ldr r3, [fp, #-8]
28dc: e1520003 cmp r2, r3
28e0: 0a000005 beq 28fc <bigwrite+0xa0>
28e4: e3a00001 mov r0, #1
28e8: e59f107c ldr r1, [pc, #124] ; 296c <bigwrite+0x110>
28ec: e51b2008 ldr r2, [fp, #-8]
28f0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
28f4: eb000820 bl 497c <printf>
28f8: eb000712 bl 4548 <exit>
28fc: e51b300c ldr r3, [fp, #-12]
2900: e2833001 add r3, r3, #1
2904: e50b300c str r3, [fp, #-12]
2908: e51b300c ldr r3, [fp, #-12]
290c: e3530001 cmp r3, #1
2910: daffffea ble 28c0 <bigwrite+0x64>
2914: e51b0010 ldr r0, [fp, #-16]
2918: eb000737 bl 45fc <close>
291c: e59f0034 ldr r0, [pc, #52] ; 2958 <bigwrite+0xfc>
2920: eb000762 bl 46b0 <unlink>
2924: e51b3008 ldr r3, [fp, #-8]
2928: e2833f75 add r3, r3, #468 ; 0x1d4
292c: e2833003 add r3, r3, #3
2930: e50b3008 str r3, [fp, #-8]
2934: e51b3008 ldr r3, [fp, #-8]
2938: e3530b06 cmp r3, #6144 ; 0x1800
293c: baffffd1 blt 2888 <bigwrite+0x2c>
2940: e3a00001 mov r0, #1
2944: e59f1024 ldr r1, [pc, #36] ; 2970 <bigwrite+0x114>
2948: eb00080b bl 497c <printf>
294c: e24bd004 sub sp, fp, #4
2950: e8bd8800 pop {fp, pc}
2954: 00005e74 .word 0x00005e74
2958: 00005e84 .word 0x00005e84
295c: 000001f3 .word 0x000001f3
2960: 00000202 .word 0x00000202
2964: 00005e90 .word 0x00005e90
2968: 00009080 .word 0x00009080
296c: 00005ea8 .word 0x00005ea8
2970: 00005ebc .word 0x00005ebc
00002974 <bigfile>:
2974: e92d4800 push {fp, lr}
2978: e28db004 add fp, sp, #4
297c: e24dd010 sub sp, sp, #16
2980: e3a00001 mov r0, #1
2984: e59f11f4 ldr r1, [pc, #500] ; 2b80 <bigfile+0x20c>
2988: eb0007fb bl 497c <printf>
298c: e59f01f0 ldr r0, [pc, #496] ; 2b84 <bigfile+0x210>
2990: eb000746 bl 46b0 <unlink>
2994: e59f01e8 ldr r0, [pc, #488] ; 2b84 <bigfile+0x210>
2998: e59f11e8 ldr r1, [pc, #488] ; 2b88 <bigfile+0x214>
299c: eb000731 bl 4668 <open>
29a0: e50b0010 str r0, [fp, #-16]
29a4: e51b3010 ldr r3, [fp, #-16]
29a8: e3530000 cmp r3, #0
29ac: aa000003 bge 29c0 <bigfile+0x4c>
29b0: e3a00001 mov r0, #1
29b4: e59f11d0 ldr r1, [pc, #464] ; 2b8c <bigfile+0x218>
29b8: eb0007ef bl 497c <printf>
29bc: eb0006e1 bl 4548 <exit>
29c0: e3a03000 mov r3, #0
29c4: e50b3008 str r3, [fp, #-8]
29c8: ea000011 b 2a14 <bigfile+0xa0>
29cc: e59f01bc ldr r0, [pc, #444] ; 2b90 <bigfile+0x21c>
29d0: e51b1008 ldr r1, [fp, #-8]
29d4: e3a02f96 mov r2, #600 ; 0x258
29d8: eb0005ea bl 4188 <memset>
29dc: e51b0010 ldr r0, [fp, #-16]
29e0: e59f11a8 ldr r1, [pc, #424] ; 2b90 <bigfile+0x21c>
29e4: e3a02f96 mov r2, #600 ; 0x258
29e8: eb0006fa bl 45d8 <write>
29ec: e1a03000 mov r3, r0
29f0: e3530f96 cmp r3, #600 ; 0x258
29f4: 0a000003 beq 2a08 <bigfile+0x94>
29f8: e3a00001 mov r0, #1
29fc: e59f1190 ldr r1, [pc, #400] ; 2b94 <bigfile+0x220>
2a00: eb0007dd bl 497c <printf>
2a04: eb0006cf bl 4548 <exit>
2a08: e51b3008 ldr r3, [fp, #-8]
2a0c: e2833001 add r3, r3, #1
2a10: e50b3008 str r3, [fp, #-8]
2a14: e51b3008 ldr r3, [fp, #-8]
2a18: e3530013 cmp r3, #19
2a1c: daffffea ble 29cc <bigfile+0x58>
2a20: e51b0010 ldr r0, [fp, #-16]
2a24: eb0006f4 bl 45fc <close>
2a28: e59f0154 ldr r0, [pc, #340] ; 2b84 <bigfile+0x210>
2a2c: e3a01000 mov r1, #0
2a30: eb00070c bl 4668 <open>
2a34: e50b0010 str r0, [fp, #-16]
2a38: e51b3010 ldr r3, [fp, #-16]
2a3c: e3530000 cmp r3, #0
2a40: aa000003 bge 2a54 <bigfile+0xe0>
2a44: e3a00001 mov r0, #1
2a48: e59f1148 ldr r1, [pc, #328] ; 2b98 <bigfile+0x224>
2a4c: eb0007ca bl 497c <printf>
2a50: eb0006bc bl 4548 <exit>
2a54: e3a03000 mov r3, #0
2a58: e50b300c str r3, [fp, #-12]
2a5c: e3a03000 mov r3, #0
2a60: e50b3008 str r3, [fp, #-8]
2a64: e51b0010 ldr r0, [fp, #-16]
2a68: e59f1120 ldr r1, [pc, #288] ; 2b90 <bigfile+0x21c>
2a6c: e3a02f4b mov r2, #300 ; 0x12c
2a70: eb0006cf bl 45b4 <read>
2a74: e50b0014 str r0, [fp, #-20] ; 0xffffffec
2a78: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
2a7c: e3530000 cmp r3, #0
2a80: aa000003 bge 2a94 <bigfile+0x120>
2a84: e3a00001 mov r0, #1
2a88: e59f110c ldr r1, [pc, #268] ; 2b9c <bigfile+0x228>
2a8c: eb0007ba bl 497c <printf>
2a90: eb0006ac bl 4548 <exit>
2a94: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
2a98: e3530000 cmp r3, #0
2a9c: 1a000007 bne 2ac0 <bigfile+0x14c>
2aa0: e1a00000 nop ; (mov r0, r0)
2aa4: e51b0010 ldr r0, [fp, #-16]
2aa8: eb0006d3 bl 45fc <close>
2aac: e51b300c ldr r3, [fp, #-12]
2ab0: e59f20e8 ldr r2, [pc, #232] ; 2ba0 <bigfile+0x22c>
2ab4: e1530002 cmp r3, r2
2ab8: 0a000029 beq 2b64 <bigfile+0x1f0>
2abc: ea000024 b 2b54 <bigfile+0x1e0>
2ac0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
2ac4: e3530f4b cmp r3, #300 ; 0x12c
2ac8: 0a000003 beq 2adc <bigfile+0x168>
2acc: e3a00001 mov r0, #1
2ad0: e59f10cc ldr r1, [pc, #204] ; 2ba4 <bigfile+0x230>
2ad4: eb0007a8 bl 497c <printf>
2ad8: eb00069a bl 4548 <exit>
2adc: e59f30ac ldr r3, [pc, #172] ; 2b90 <bigfile+0x21c>
2ae0: e5d33000 ldrb r3, [r3]
2ae4: e1a01003 mov r1, r3
2ae8: e51b3008 ldr r3, [fp, #-8]
2aec: e1a02fa3 lsr r2, r3, #31
2af0: e0823003 add r3, r2, r3
2af4: e1a030c3 asr r3, r3, #1
2af8: e1510003 cmp r1, r3
2afc: 1a000008 bne 2b24 <bigfile+0x1b0>
2b00: e59f3088 ldr r3, [pc, #136] ; 2b90 <bigfile+0x21c>
2b04: e5d3312b ldrb r3, [r3, #299] ; 0x12b
2b08: e1a01003 mov r1, r3
2b0c: e51b3008 ldr r3, [fp, #-8]
2b10: e1a02fa3 lsr r2, r3, #31
2b14: e0823003 add r3, r2, r3
2b18: e1a030c3 asr r3, r3, #1
2b1c: e1510003 cmp r1, r3
2b20: 0a000003 beq 2b34 <bigfile+0x1c0>
2b24: e3a00001 mov r0, #1
2b28: e59f1078 ldr r1, [pc, #120] ; 2ba8 <bigfile+0x234>
2b2c: eb000792 bl 497c <printf>
2b30: eb000684 bl 4548 <exit>
2b34: e51b200c ldr r2, [fp, #-12]
2b38: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
2b3c: e0823003 add r3, r2, r3
2b40: e50b300c str r3, [fp, #-12]
2b44: e51b3008 ldr r3, [fp, #-8]
2b48: e2833001 add r3, r3, #1
2b4c: e50b3008 str r3, [fp, #-8]
2b50: eaffffc3 b 2a64 <bigfile+0xf0>
2b54: e3a00001 mov r0, #1
2b58: e59f104c ldr r1, [pc, #76] ; 2bac <bigfile+0x238>
2b5c: eb000786 bl 497c <printf>
2b60: eb000678 bl 4548 <exit>
2b64: e59f0018 ldr r0, [pc, #24] ; 2b84 <bigfile+0x210>
2b68: eb0006d0 bl 46b0 <unlink>
2b6c: e3a00001 mov r0, #1
2b70: e59f1038 ldr r1, [pc, #56] ; 2bb0 <bigfile+0x23c>
2b74: eb000780 bl 497c <printf>
2b78: e24bd004 sub sp, fp, #4
2b7c: e8bd8800 pop {fp, pc}
2b80: 00005ecc .word 0x00005ecc
2b84: 00005edc .word 0x00005edc
2b88: 00000202 .word 0x00000202
2b8c: 00005ee4 .word 0x00005ee4
2b90: 00009080 .word 0x00009080
2b94: 00005efc .word 0x00005efc
2b98: 00005f14 .word 0x00005f14
2b9c: 00005f2c .word 0x00005f2c
2ba0: 00002ee0 .word 0x00002ee0
2ba4: 00005f44 .word 0x00005f44
2ba8: 00005f58 .word 0x00005f58
2bac: 00005f74 .word 0x00005f74
2bb0: 00005f90 .word 0x00005f90
00002bb4 <fourteen>:
2bb4: e92d4800 push {fp, lr}
2bb8: e28db004 add fp, sp, #4
2bbc: e24dd008 sub sp, sp, #8
2bc0: e3a00001 mov r0, #1
2bc4: e59f110c ldr r1, [pc, #268] ; 2cd8 <fourteen+0x124>
2bc8: eb00076b bl 497c <printf>
2bcc: e59f0108 ldr r0, [pc, #264] ; 2cdc <fourteen+0x128>
2bd0: eb0006d1 bl 471c <mkdir>
2bd4: e1a03000 mov r3, r0
2bd8: e3530000 cmp r3, #0
2bdc: 0a000003 beq 2bf0 <fourteen+0x3c>
2be0: e3a00001 mov r0, #1
2be4: e59f10f4 ldr r1, [pc, #244] ; 2ce0 <fourteen+0x12c>
2be8: eb000763 bl 497c <printf>
2bec: eb000655 bl 4548 <exit>
2bf0: e59f00ec ldr r0, [pc, #236] ; 2ce4 <fourteen+0x130>
2bf4: eb0006c8 bl 471c <mkdir>
2bf8: e1a03000 mov r3, r0
2bfc: e3530000 cmp r3, #0
2c00: 0a000003 beq 2c14 <fourteen+0x60>
2c04: e3a00001 mov r0, #1
2c08: e59f10d8 ldr r1, [pc, #216] ; 2ce8 <fourteen+0x134>
2c0c: eb00075a bl 497c <printf>
2c10: eb00064c bl 4548 <exit>
2c14: e59f00d0 ldr r0, [pc, #208] ; 2cec <fourteen+0x138>
2c18: e3a01c02 mov r1, #512 ; 0x200
2c1c: eb000691 bl 4668 <open>
2c20: e50b0008 str r0, [fp, #-8]
2c24: e51b3008 ldr r3, [fp, #-8]
2c28: e3530000 cmp r3, #0
2c2c: aa000003 bge 2c40 <fourteen+0x8c>
2c30: e3a00001 mov r0, #1
2c34: e59f10b4 ldr r1, [pc, #180] ; 2cf0 <fourteen+0x13c>
2c38: eb00074f bl 497c <printf>
2c3c: eb000641 bl 4548 <exit>
2c40: e51b0008 ldr r0, [fp, #-8]
2c44: eb00066c bl 45fc <close>
2c48: e59f00a4 ldr r0, [pc, #164] ; 2cf4 <fourteen+0x140>
2c4c: e3a01000 mov r1, #0
2c50: eb000684 bl 4668 <open>
2c54: e50b0008 str r0, [fp, #-8]
2c58: e51b3008 ldr r3, [fp, #-8]
2c5c: e3530000 cmp r3, #0
2c60: aa000003 bge 2c74 <fourteen+0xc0>
2c64: e3a00001 mov r0, #1
2c68: e59f1088 ldr r1, [pc, #136] ; 2cf8 <fourteen+0x144>
2c6c: eb000742 bl 497c <printf>
2c70: eb000634 bl 4548 <exit>
2c74: e51b0008 ldr r0, [fp, #-8]
2c78: eb00065f bl 45fc <close>
2c7c: e59f0078 ldr r0, [pc, #120] ; 2cfc <fourteen+0x148>
2c80: eb0006a5 bl 471c <mkdir>
2c84: e1a03000 mov r3, r0
2c88: e3530000 cmp r3, #0
2c8c: 1a000003 bne 2ca0 <fourteen+0xec>
2c90: e3a00001 mov r0, #1
2c94: e59f1064 ldr r1, [pc, #100] ; 2d00 <fourteen+0x14c>
2c98: eb000737 bl 497c <printf>
2c9c: eb000629 bl 4548 <exit>
2ca0: e59f005c ldr r0, [pc, #92] ; 2d04 <fourteen+0x150>
2ca4: eb00069c bl 471c <mkdir>
2ca8: e1a03000 mov r3, r0
2cac: e3530000 cmp r3, #0
2cb0: 1a000003 bne 2cc4 <fourteen+0x110>
2cb4: e3a00001 mov r0, #1
2cb8: e59f1048 ldr r1, [pc, #72] ; 2d08 <fourteen+0x154>
2cbc: eb00072e bl 497c <printf>
2cc0: eb000620 bl 4548 <exit>
2cc4: e3a00001 mov r0, #1
2cc8: e59f103c ldr r1, [pc, #60] ; 2d0c <fourteen+0x158>
2ccc: eb00072a bl 497c <printf>
2cd0: e24bd004 sub sp, fp, #4
2cd4: e8bd8800 pop {fp, pc}
2cd8: 00005fa4 .word 0x00005fa4
2cdc: 00005fb4 .word 0x00005fb4
2ce0: 00005fc4 .word 0x00005fc4
2ce4: 00005fe4 .word 0x00005fe4
2ce8: 00006004 .word 0x00006004
2cec: 00006034 .word 0x00006034
2cf0: 00006064 .word 0x00006064
2cf4: 000060a4 .word 0x000060a4
2cf8: 000060d4 .word 0x000060d4
2cfc: 00006110 .word 0x00006110
2d00: 00006130 .word 0x00006130
2d04: 00006160 .word 0x00006160
2d08: 00006180 .word 0x00006180
2d0c: 000061b4 .word 0x000061b4
00002d10 <rmdot>:
2d10: e92d4800 push {fp, lr}
2d14: e28db004 add fp, sp, #4
2d18: e3a00001 mov r0, #1
2d1c: e59f1130 ldr r1, [pc, #304] ; 2e54 <rmdot+0x144>
2d20: eb000715 bl 497c <printf>
2d24: e59f012c ldr r0, [pc, #300] ; 2e58 <rmdot+0x148>
2d28: eb00067b bl 471c <mkdir>
2d2c: e1a03000 mov r3, r0
2d30: e3530000 cmp r3, #0
2d34: 0a000003 beq 2d48 <rmdot+0x38>
2d38: e3a00001 mov r0, #1
2d3c: e59f1118 ldr r1, [pc, #280] ; 2e5c <rmdot+0x14c>
2d40: eb00070d bl 497c <printf>
2d44: eb0005ff bl 4548 <exit>
2d48: e59f0108 ldr r0, [pc, #264] ; 2e58 <rmdot+0x148>
2d4c: eb00067b bl 4740 <chdir>
2d50: e1a03000 mov r3, r0
2d54: e3530000 cmp r3, #0
2d58: 0a000003 beq 2d6c <rmdot+0x5c>
2d5c: e3a00001 mov r0, #1
2d60: e59f10f8 ldr r1, [pc, #248] ; 2e60 <rmdot+0x150>
2d64: eb000704 bl 497c <printf>
2d68: eb0005f6 bl 4548 <exit>
2d6c: e59f00f0 ldr r0, [pc, #240] ; 2e64 <rmdot+0x154>
2d70: eb00064e bl 46b0 <unlink>
2d74: e1a03000 mov r3, r0
2d78: e3530000 cmp r3, #0
2d7c: 1a000003 bne 2d90 <rmdot+0x80>
2d80: e3a00001 mov r0, #1
2d84: e59f10dc ldr r1, [pc, #220] ; 2e68 <rmdot+0x158>
2d88: eb0006fb bl 497c <printf>
2d8c: eb0005ed bl 4548 <exit>
2d90: e59f00d4 ldr r0, [pc, #212] ; 2e6c <rmdot+0x15c>
2d94: eb000645 bl 46b0 <unlink>
2d98: e1a03000 mov r3, r0
2d9c: e3530000 cmp r3, #0
2da0: 1a000003 bne 2db4 <rmdot+0xa4>
2da4: e3a00001 mov r0, #1
2da8: e59f10c0 ldr r1, [pc, #192] ; 2e70 <rmdot+0x160>
2dac: eb0006f2 bl 497c <printf>
2db0: eb0005e4 bl 4548 <exit>
2db4: e59f00b8 ldr r0, [pc, #184] ; 2e74 <rmdot+0x164>
2db8: eb000660 bl 4740 <chdir>
2dbc: e1a03000 mov r3, r0
2dc0: e3530000 cmp r3, #0
2dc4: 0a000003 beq 2dd8 <rmdot+0xc8>
2dc8: e3a00001 mov r0, #1
2dcc: e59f10a4 ldr r1, [pc, #164] ; 2e78 <rmdot+0x168>
2dd0: eb0006e9 bl 497c <printf>
2dd4: eb0005db bl 4548 <exit>
2dd8: e59f009c ldr r0, [pc, #156] ; 2e7c <rmdot+0x16c>
2ddc: eb000633 bl 46b0 <unlink>
2de0: e1a03000 mov r3, r0
2de4: e3530000 cmp r3, #0
2de8: 1a000003 bne 2dfc <rmdot+0xec>
2dec: e3a00001 mov r0, #1
2df0: e59f1088 ldr r1, [pc, #136] ; 2e80 <rmdot+0x170>
2df4: eb0006e0 bl 497c <printf>
2df8: eb0005d2 bl 4548 <exit>
2dfc: e59f0080 ldr r0, [pc, #128] ; 2e84 <rmdot+0x174>
2e00: eb00062a bl 46b0 <unlink>
2e04: e1a03000 mov r3, r0
2e08: e3530000 cmp r3, #0
2e0c: 1a000003 bne 2e20 <rmdot+0x110>
2e10: e3a00001 mov r0, #1
2e14: e59f106c ldr r1, [pc, #108] ; 2e88 <rmdot+0x178>
2e18: eb0006d7 bl 497c <printf>
2e1c: eb0005c9 bl 4548 <exit>
2e20: e59f0030 ldr r0, [pc, #48] ; 2e58 <rmdot+0x148>
2e24: eb000621 bl 46b0 <unlink>
2e28: e1a03000 mov r3, r0
2e2c: e3530000 cmp r3, #0
2e30: 0a000003 beq 2e44 <rmdot+0x134>
2e34: e3a00001 mov r0, #1
2e38: e59f104c ldr r1, [pc, #76] ; 2e8c <rmdot+0x17c>
2e3c: eb0006ce bl 497c <printf>
2e40: eb0005c0 bl 4548 <exit>
2e44: e3a00001 mov r0, #1
2e48: e59f1040 ldr r1, [pc, #64] ; 2e90 <rmdot+0x180>
2e4c: eb0006ca bl 497c <printf>
2e50: e8bd8800 pop {fp, pc}
2e54: 000061c4 .word 0x000061c4
2e58: 000061d0 .word 0x000061d0
2e5c: 000061d8 .word 0x000061d8
2e60: 000061ec .word 0x000061ec
2e64: 00005878 .word 0x00005878
2e68: 00006200 .word 0x00006200
2e6c: 00005358 .word 0x00005358
2e70: 00006210 .word 0x00006210
2e74: 00006220 .word 0x00006220
2e78: 00006224 .word 0x00006224
2e7c: 00006234 .word 0x00006234
2e80: 0000623c .word 0x0000623c
2e84: 00006254 .word 0x00006254
2e88: 0000625c .word 0x0000625c
2e8c: 00006274 .word 0x00006274
2e90: 0000628c .word 0x0000628c
00002e94 <dirfile>:
2e94: e92d4800 push {fp, lr}
2e98: e28db004 add fp, sp, #4
2e9c: e24dd008 sub sp, sp, #8
2ea0: e3a00001 mov r0, #1
2ea4: e59f11c8 ldr r1, [pc, #456] ; 3074 <dirfile+0x1e0>
2ea8: eb0006b3 bl 497c <printf>
2eac: e59f01c4 ldr r0, [pc, #452] ; 3078 <dirfile+0x1e4>
2eb0: e3a01c02 mov r1, #512 ; 0x200
2eb4: eb0005eb bl 4668 <open>
2eb8: e50b0008 str r0, [fp, #-8]
2ebc: e51b3008 ldr r3, [fp, #-8]
2ec0: e3530000 cmp r3, #0
2ec4: aa000003 bge 2ed8 <dirfile+0x44>
2ec8: e3a00001 mov r0, #1
2ecc: e59f11a8 ldr r1, [pc, #424] ; 307c <dirfile+0x1e8>
2ed0: eb0006a9 bl 497c <printf>
2ed4: eb00059b bl 4548 <exit>
2ed8: e51b0008 ldr r0, [fp, #-8]
2edc: eb0005c6 bl 45fc <close>
2ee0: e59f0190 ldr r0, [pc, #400] ; 3078 <dirfile+0x1e4>
2ee4: eb000615 bl 4740 <chdir>
2ee8: e1a03000 mov r3, r0
2eec: e3530000 cmp r3, #0
2ef0: 1a000003 bne 2f04 <dirfile+0x70>
2ef4: e3a00001 mov r0, #1
2ef8: e59f1180 ldr r1, [pc, #384] ; 3080 <dirfile+0x1ec>
2efc: eb00069e bl 497c <printf>
2f00: eb000590 bl 4548 <exit>
2f04: e59f0178 ldr r0, [pc, #376] ; 3084 <dirfile+0x1f0>
2f08: e3a01000 mov r1, #0
2f0c: eb0005d5 bl 4668 <open>
2f10: e50b0008 str r0, [fp, #-8]
2f14: e51b3008 ldr r3, [fp, #-8]
2f18: e3530000 cmp r3, #0
2f1c: ba000003 blt 2f30 <dirfile+0x9c>
2f20: e3a00001 mov r0, #1
2f24: e59f115c ldr r1, [pc, #348] ; 3088 <dirfile+0x1f4>
2f28: eb000693 bl 497c <printf>
2f2c: eb000585 bl 4548 <exit>
2f30: e59f014c ldr r0, [pc, #332] ; 3084 <dirfile+0x1f0>
2f34: e3a01c02 mov r1, #512 ; 0x200
2f38: eb0005ca bl 4668 <open>
2f3c: e50b0008 str r0, [fp, #-8]
2f40: e51b3008 ldr r3, [fp, #-8]
2f44: e3530000 cmp r3, #0
2f48: ba000003 blt 2f5c <dirfile+0xc8>
2f4c: e3a00001 mov r0, #1
2f50: e59f1130 ldr r1, [pc, #304] ; 3088 <dirfile+0x1f4>
2f54: eb000688 bl 497c <printf>
2f58: eb00057a bl 4548 <exit>
2f5c: e59f0120 ldr r0, [pc, #288] ; 3084 <dirfile+0x1f0>
2f60: eb0005ed bl 471c <mkdir>
2f64: e1a03000 mov r3, r0
2f68: e3530000 cmp r3, #0
2f6c: 1a000003 bne 2f80 <dirfile+0xec>
2f70: e3a00001 mov r0, #1
2f74: e59f1110 ldr r1, [pc, #272] ; 308c <dirfile+0x1f8>
2f78: eb00067f bl 497c <printf>
2f7c: eb000571 bl 4548 <exit>
2f80: e59f00fc ldr r0, [pc, #252] ; 3084 <dirfile+0x1f0>
2f84: eb0005c9 bl 46b0 <unlink>
2f88: e1a03000 mov r3, r0
2f8c: e3530000 cmp r3, #0
2f90: 1a000003 bne 2fa4 <dirfile+0x110>
2f94: e3a00001 mov r0, #1
2f98: e59f10f0 ldr r1, [pc, #240] ; 3090 <dirfile+0x1fc>
2f9c: eb000676 bl 497c <printf>
2fa0: eb000568 bl 4548 <exit>
2fa4: e59f00e8 ldr r0, [pc, #232] ; 3094 <dirfile+0x200>
2fa8: e59f10d4 ldr r1, [pc, #212] ; 3084 <dirfile+0x1f0>
2fac: eb0005d1 bl 46f8 <link>
2fb0: e1a03000 mov r3, r0
2fb4: e3530000 cmp r3, #0
2fb8: 1a000003 bne 2fcc <dirfile+0x138>
2fbc: e3a00001 mov r0, #1
2fc0: e59f10d0 ldr r1, [pc, #208] ; 3098 <dirfile+0x204>
2fc4: eb00066c bl 497c <printf>
2fc8: eb00055e bl 4548 <exit>
2fcc: e59f00a4 ldr r0, [pc, #164] ; 3078 <dirfile+0x1e4>
2fd0: eb0005b6 bl 46b0 <unlink>
2fd4: e1a03000 mov r3, r0
2fd8: e3530000 cmp r3, #0
2fdc: 0a000003 beq 2ff0 <dirfile+0x15c>
2fe0: e3a00001 mov r0, #1
2fe4: e59f10b0 ldr r1, [pc, #176] ; 309c <dirfile+0x208>
2fe8: eb000663 bl 497c <printf>
2fec: eb000555 bl 4548 <exit>
2ff0: e59f00a8 ldr r0, [pc, #168] ; 30a0 <dirfile+0x20c>
2ff4: e3a01002 mov r1, #2
2ff8: eb00059a bl 4668 <open>
2ffc: e50b0008 str r0, [fp, #-8]
3000: e51b3008 ldr r3, [fp, #-8]
3004: e3530000 cmp r3, #0
3008: ba000003 blt 301c <dirfile+0x188>
300c: e3a00001 mov r0, #1
3010: e59f108c ldr r1, [pc, #140] ; 30a4 <dirfile+0x210>
3014: eb000658 bl 497c <printf>
3018: eb00054a bl 4548 <exit>
301c: e59f007c ldr r0, [pc, #124] ; 30a0 <dirfile+0x20c>
3020: e3a01000 mov r1, #0
3024: eb00058f bl 4668 <open>
3028: e50b0008 str r0, [fp, #-8]
302c: e51b0008 ldr r0, [fp, #-8]
3030: e59f1070 ldr r1, [pc, #112] ; 30a8 <dirfile+0x214>
3034: e3a02001 mov r2, #1
3038: eb000566 bl 45d8 <write>
303c: e1a03000 mov r3, r0
3040: e3530000 cmp r3, #0
3044: da000003 ble 3058 <dirfile+0x1c4>
3048: e3a00001 mov r0, #1
304c: e59f1058 ldr r1, [pc, #88] ; 30ac <dirfile+0x218>
3050: eb000649 bl 497c <printf>
3054: eb00053b bl 4548 <exit>
3058: e51b0008 ldr r0, [fp, #-8]
305c: eb000566 bl 45fc <close>
3060: e3a00001 mov r0, #1
3064: e59f1044 ldr r1, [pc, #68] ; 30b0 <dirfile+0x21c>
3068: eb000643 bl 497c <printf>
306c: e24bd004 sub sp, fp, #4
3070: e8bd8800 pop {fp, pc}
3074: 00006298 .word 0x00006298
3078: 000062a8 .word 0x000062a8
307c: 000062b0 .word 0x000062b0
3080: 000062c8 .word 0x000062c8
3084: 000062e4 .word 0x000062e4
3088: 000062f0 .word 0x000062f0
308c: 00006310 .word 0x00006310
3090: 00006330 .word 0x00006330
3094: 00006350 .word 0x00006350
3098: 00006358 .word 0x00006358
309c: 00006378 .word 0x00006378
30a0: 00005878 .word 0x00005878
30a4: 00006390 .word 0x00006390
30a8: 00005420 .word 0x00005420
30ac: 000063b0 .word 0x000063b0
30b0: 000063c4 .word 0x000063c4
000030b4 <iref>:
30b4: e92d4800 push {fp, lr}
30b8: e28db004 add fp, sp, #4
30bc: e24dd008 sub sp, sp, #8
30c0: e3a00001 mov r0, #1
30c4: e59f10ec ldr r1, [pc, #236] ; 31b8 <iref+0x104>
30c8: eb00062b bl 497c <printf>
30cc: e3a03000 mov r3, #0
30d0: e50b3008 str r3, [fp, #-8]
30d4: ea00002d b 3190 <iref+0xdc>
30d8: e59f00dc ldr r0, [pc, #220] ; 31bc <iref+0x108>
30dc: eb00058e bl 471c <mkdir>
30e0: e1a03000 mov r3, r0
30e4: e3530000 cmp r3, #0
30e8: 0a000003 beq 30fc <iref+0x48>
30ec: e3a00001 mov r0, #1
30f0: e59f10c8 ldr r1, [pc, #200] ; 31c0 <iref+0x10c>
30f4: eb000620 bl 497c <printf>
30f8: eb000512 bl 4548 <exit>
30fc: e59f00b8 ldr r0, [pc, #184] ; 31bc <iref+0x108>
3100: eb00058e bl 4740 <chdir>
3104: e1a03000 mov r3, r0
3108: e3530000 cmp r3, #0
310c: 0a000003 beq 3120 <iref+0x6c>
3110: e3a00001 mov r0, #1
3114: e59f10a8 ldr r1, [pc, #168] ; 31c4 <iref+0x110>
3118: eb000617 bl 497c <printf>
311c: eb000509 bl 4548 <exit>
3120: e59f00a0 ldr r0, [pc, #160] ; 31c8 <iref+0x114>
3124: eb00057c bl 471c <mkdir>
3128: e59f009c ldr r0, [pc, #156] ; 31cc <iref+0x118>
312c: e59f1094 ldr r1, [pc, #148] ; 31c8 <iref+0x114>
3130: eb000570 bl 46f8 <link>
3134: e59f008c ldr r0, [pc, #140] ; 31c8 <iref+0x114>
3138: e3a01c02 mov r1, #512 ; 0x200
313c: eb000549 bl 4668 <open>
3140: e50b000c str r0, [fp, #-12]
3144: e51b300c ldr r3, [fp, #-12]
3148: e3530000 cmp r3, #0
314c: ba000001 blt 3158 <iref+0xa4>
3150: e51b000c ldr r0, [fp, #-12]
3154: eb000528 bl 45fc <close>
3158: e59f0070 ldr r0, [pc, #112] ; 31d0 <iref+0x11c>
315c: e3a01c02 mov r1, #512 ; 0x200
3160: eb000540 bl 4668 <open>
3164: e50b000c str r0, [fp, #-12]
3168: e51b300c ldr r3, [fp, #-12]
316c: e3530000 cmp r3, #0
3170: ba000001 blt 317c <iref+0xc8>
3174: e51b000c ldr r0, [fp, #-12]
3178: eb00051f bl 45fc <close>
317c: e59f004c ldr r0, [pc, #76] ; 31d0 <iref+0x11c>
3180: eb00054a bl 46b0 <unlink>
3184: e51b3008 ldr r3, [fp, #-8]
3188: e2833001 add r3, r3, #1
318c: e50b3008 str r3, [fp, #-8]
3190: e51b3008 ldr r3, [fp, #-8]
3194: e3530032 cmp r3, #50 ; 0x32
3198: daffffce ble 30d8 <iref+0x24>
319c: e59f0030 ldr r0, [pc, #48] ; 31d4 <iref+0x120>
31a0: eb000566 bl 4740 <chdir>
31a4: e3a00001 mov r0, #1
31a8: e59f1028 ldr r1, [pc, #40] ; 31d8 <iref+0x124>
31ac: eb0005f2 bl 497c <printf>
31b0: e24bd004 sub sp, fp, #4
31b4: e8bd8800 pop {fp, pc}
31b8: 000063d4 .word 0x000063d4
31bc: 000063e8 .word 0x000063e8
31c0: 000063f0 .word 0x000063f0
31c4: 00006404 .word 0x00006404
31c8: 00006418 .word 0x00006418
31cc: 00006350 .word 0x00006350
31d0: 0000641c .word 0x0000641c
31d4: 00006220 .word 0x00006220
31d8: 00006420 .word 0x00006420
000031dc <forktest>:
31dc: e92d4800 push {fp, lr}
31e0: e28db004 add fp, sp, #4
31e4: e24dd008 sub sp, sp, #8
31e8: e3a00001 mov r0, #1
31ec: e59f10d8 ldr r1, [pc, #216] ; 32cc <forktest+0xf0>
31f0: eb0005e1 bl 497c <printf>
31f4: e3a03000 mov r3, #0
31f8: e50b3008 str r3, [fp, #-8]
31fc: ea00000c b 3234 <forktest+0x58>
3200: eb0004c7 bl 4524 <fork>
3204: e50b000c str r0, [fp, #-12]
3208: e51b300c ldr r3, [fp, #-12]
320c: e3530000 cmp r3, #0
3210: aa000000 bge 3218 <forktest+0x3c>
3214: ea000009 b 3240 <forktest+0x64>
3218: e51b300c ldr r3, [fp, #-12]
321c: e3530000 cmp r3, #0
3220: 1a000000 bne 3228 <forktest+0x4c>
3224: eb0004c7 bl 4548 <exit>
3228: e51b3008 ldr r3, [fp, #-8]
322c: e2833001 add r3, r3, #1
3230: e50b3008 str r3, [fp, #-8]
3234: e51b3008 ldr r3, [fp, #-8]
3238: e3530ffa cmp r3, #1000 ; 0x3e8
323c: baffffef blt 3200 <forktest+0x24>
3240: e51b3008 ldr r3, [fp, #-8]
3244: e3530ffa cmp r3, #1000 ; 0x3e8
3248: 1a000003 bne 325c <forktest+0x80>
324c: e3a00001 mov r0, #1
3250: e59f1078 ldr r1, [pc, #120] ; 32d0 <forktest+0xf4>
3254: eb0005c8 bl 497c <printf>
3258: eb0004ba bl 4548 <exit>
325c: ea00000a b 328c <forktest+0xb0>
3260: eb0004c1 bl 456c <wait>
3264: e1a03000 mov r3, r0
3268: e3530000 cmp r3, #0
326c: aa000003 bge 3280 <forktest+0xa4>
3270: e3a00001 mov r0, #1
3274: e59f1058 ldr r1, [pc, #88] ; 32d4 <forktest+0xf8>
3278: eb0005bf bl 497c <printf>
327c: eb0004b1 bl 4548 <exit>
3280: e51b3008 ldr r3, [fp, #-8]
3284: e2433001 sub r3, r3, #1
3288: e50b3008 str r3, [fp, #-8]
328c: e51b3008 ldr r3, [fp, #-8]
3290: e3530000 cmp r3, #0
3294: cafffff1 bgt 3260 <forktest+0x84>
3298: eb0004b3 bl 456c <wait>
329c: e1a03000 mov r3, r0
32a0: e3730001 cmn r3, #1
32a4: 0a000003 beq 32b8 <forktest+0xdc>
32a8: e3a00001 mov r0, #1
32ac: e59f1024 ldr r1, [pc, #36] ; 32d8 <forktest+0xfc>
32b0: eb0005b1 bl 497c <printf>
32b4: eb0004a3 bl 4548 <exit>
32b8: e3a00001 mov r0, #1
32bc: e59f1018 ldr r1, [pc, #24] ; 32dc <forktest+0x100>
32c0: eb0005ad bl 497c <printf>
32c4: e24bd004 sub sp, fp, #4
32c8: e8bd8800 pop {fp, pc}
32cc: 00006434 .word 0x00006434
32d0: 00006440 .word 0x00006440
32d4: 00006464 .word 0x00006464
32d8: 00006478 .word 0x00006478
32dc: 0000648c .word 0x0000648c
000032e0 <sbrktest>:
32e0: e92d4810 push {r4, fp, lr}
32e4: e28db008 add fp, sp, #8
32e8: e24dd044 sub sp, sp, #68 ; 0x44
32ec: e59f3564 ldr r3, [pc, #1380] ; 3858 <sbrktest+0x578>
32f0: e5933000 ldr r3, [r3]
32f4: e1a00003 mov r0, r3
32f8: e59f155c ldr r1, [pc, #1372] ; 385c <sbrktest+0x57c>
32fc: eb00059e bl 497c <printf>
3300: e3a00000 mov r0, #0
3304: eb000528 bl 47ac <sbrk>
3308: e50b0018 str r0, [fp, #-24] ; 0xffffffe8
330c: e3a00000 mov r0, #0
3310: eb000525 bl 47ac <sbrk>
3314: e50b0010 str r0, [fp, #-16]
3318: e3a03000 mov r3, #0
331c: e50b3014 str r3, [fp, #-20] ; 0xffffffec
3320: ea000019 b 338c <sbrktest+0xac>
3324: e3a00001 mov r0, #1
3328: eb00051f bl 47ac <sbrk>
332c: e50b001c str r0, [fp, #-28] ; 0xffffffe4
3330: e51b201c ldr r2, [fp, #-28] ; 0xffffffe4
3334: e51b3010 ldr r3, [fp, #-16]
3338: e1520003 cmp r2, r3
333c: 0a000009 beq 3368 <sbrktest+0x88>
3340: e59f3510 ldr r3, [pc, #1296] ; 3858 <sbrktest+0x578>
3344: e5932000 ldr r2, [r3]
3348: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
334c: e58d3000 str r3, [sp]
3350: e1a00002 mov r0, r2
3354: e59f1504 ldr r1, [pc, #1284] ; 3860 <sbrktest+0x580>
3358: e51b2014 ldr r2, [fp, #-20] ; 0xffffffec
335c: e51b3010 ldr r3, [fp, #-16]
3360: eb000585 bl 497c <printf>
3364: eb000477 bl 4548 <exit>
3368: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
336c: e3a02001 mov r2, #1
3370: e5c32000 strb r2, [r3]
3374: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
3378: e2833001 add r3, r3, #1
337c: e50b3010 str r3, [fp, #-16]
3380: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
3384: e2833001 add r3, r3, #1
3388: e50b3014 str r3, [fp, #-20] ; 0xffffffec
338c: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
3390: e59f24cc ldr r2, [pc, #1228] ; 3864 <sbrktest+0x584>
3394: e1530002 cmp r3, r2
3398: daffffe1 ble 3324 <sbrktest+0x44>
339c: eb000460 bl 4524 <fork>
33a0: e50b0020 str r0, [fp, #-32] ; 0xffffffe0
33a4: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
33a8: e3530000 cmp r3, #0
33ac: aa000005 bge 33c8 <sbrktest+0xe8>
33b0: e59f34a0 ldr r3, [pc, #1184] ; 3858 <sbrktest+0x578>
33b4: e5933000 ldr r3, [r3]
33b8: e1a00003 mov r0, r3
33bc: e59f14a4 ldr r1, [pc, #1188] ; 3868 <sbrktest+0x588>
33c0: eb00056d bl 497c <printf>
33c4: eb00045f bl 4548 <exit>
33c8: e3a00001 mov r0, #1
33cc: eb0004f6 bl 47ac <sbrk>
33d0: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
33d4: e3a00001 mov r0, #1
33d8: eb0004f3 bl 47ac <sbrk>
33dc: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
33e0: e51b3010 ldr r3, [fp, #-16]
33e4: e2832001 add r2, r3, #1
33e8: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
33ec: e1520003 cmp r2, r3
33f0: 0a000005 beq 340c <sbrktest+0x12c>
33f4: e59f345c ldr r3, [pc, #1116] ; 3858 <sbrktest+0x578>
33f8: e5933000 ldr r3, [r3]
33fc: e1a00003 mov r0, r3
3400: e59f1464 ldr r1, [pc, #1124] ; 386c <sbrktest+0x58c>
3404: eb00055c bl 497c <printf>
3408: eb00044e bl 4548 <exit>
340c: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
3410: e3530000 cmp r3, #0
3414: 1a000000 bne 341c <sbrktest+0x13c>
3418: eb00044a bl 4548 <exit>
341c: eb000452 bl 456c <wait>
3420: e3a00000 mov r0, #0
3424: eb0004e0 bl 47ac <sbrk>
3428: e50b0010 str r0, [fp, #-16]
342c: e51b3010 ldr r3, [fp, #-16]
3430: e2633519 rsb r3, r3, #104857600 ; 0x6400000
3434: e50b3028 str r3, [fp, #-40] ; 0xffffffd8
3438: e51b3028 ldr r3, [fp, #-40] ; 0xffffffd8
343c: e1a00003 mov r0, r3
3440: eb0004d9 bl 47ac <sbrk>
3444: e50b002c str r0, [fp, #-44] ; 0xffffffd4
3448: e51b202c ldr r2, [fp, #-44] ; 0xffffffd4
344c: e51b3010 ldr r3, [fp, #-16]
3450: e1520003 cmp r2, r3
3454: 0a000005 beq 3470 <sbrktest+0x190>
3458: e59f33f8 ldr r3, [pc, #1016] ; 3858 <sbrktest+0x578>
345c: e5933000 ldr r3, [r3]
3460: e1a00003 mov r0, r3
3464: e59f1404 ldr r1, [pc, #1028] ; 3870 <sbrktest+0x590>
3468: eb000543 bl 497c <printf>
346c: eb000435 bl 4548 <exit>
3470: e59f33fc ldr r3, [pc, #1020] ; 3874 <sbrktest+0x594>
3474: e50b3030 str r3, [fp, #-48] ; 0xffffffd0
3478: e51b3030 ldr r3, [fp, #-48] ; 0xffffffd0
347c: e3a02063 mov r2, #99 ; 0x63
3480: e5c32000 strb r2, [r3]
3484: e3a00000 mov r0, #0
3488: eb0004c7 bl 47ac <sbrk>
348c: e50b0010 str r0, [fp, #-16]
3490: e59f03e0 ldr r0, [pc, #992] ; 3878 <sbrktest+0x598>
3494: eb0004c4 bl 47ac <sbrk>
3498: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
349c: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
34a0: e3730001 cmn r3, #1
34a4: 1a000005 bne 34c0 <sbrktest+0x1e0>
34a8: e59f33a8 ldr r3, [pc, #936] ; 3858 <sbrktest+0x578>
34ac: e5933000 ldr r3, [r3]
34b0: e1a00003 mov r0, r3
34b4: e59f13c0 ldr r1, [pc, #960] ; 387c <sbrktest+0x59c>
34b8: eb00052f bl 497c <printf>
34bc: eb000421 bl 4548 <exit>
34c0: e3a00000 mov r0, #0
34c4: eb0004b8 bl 47ac <sbrk>
34c8: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
34cc: e51b3010 ldr r3, [fp, #-16]
34d0: e2432a01 sub r2, r3, #4096 ; 0x1000
34d4: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
34d8: e1520003 cmp r2, r3
34dc: 0a000007 beq 3500 <sbrktest+0x220>
34e0: e59f3370 ldr r3, [pc, #880] ; 3858 <sbrktest+0x578>
34e4: e5933000 ldr r3, [r3]
34e8: e1a00003 mov r0, r3
34ec: e59f138c ldr r1, [pc, #908] ; 3880 <sbrktest+0x5a0>
34f0: e51b2010 ldr r2, [fp, #-16]
34f4: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
34f8: eb00051f bl 497c <printf>
34fc: eb000411 bl 4548 <exit>
3500: e3a00000 mov r0, #0
3504: eb0004a8 bl 47ac <sbrk>
3508: e50b0010 str r0, [fp, #-16]
350c: e3a00a01 mov r0, #4096 ; 0x1000
3510: eb0004a5 bl 47ac <sbrk>
3514: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
3518: e51b2024 ldr r2, [fp, #-36] ; 0xffffffdc
351c: e51b3010 ldr r3, [fp, #-16]
3520: e1520003 cmp r2, r3
3524: 1a000006 bne 3544 <sbrktest+0x264>
3528: e3a00000 mov r0, #0
352c: eb00049e bl 47ac <sbrk>
3530: e1a02000 mov r2, r0
3534: e51b3010 ldr r3, [fp, #-16]
3538: e2833a01 add r3, r3, #4096 ; 0x1000
353c: e1520003 cmp r2, r3
3540: 0a000007 beq 3564 <sbrktest+0x284>
3544: e59f330c ldr r3, [pc, #780] ; 3858 <sbrktest+0x578>
3548: e5933000 ldr r3, [r3]
354c: e1a00003 mov r0, r3
3550: e59f132c ldr r1, [pc, #812] ; 3884 <sbrktest+0x5a4>
3554: e51b2010 ldr r2, [fp, #-16]
3558: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
355c: eb000506 bl 497c <printf>
3560: eb0003f8 bl 4548 <exit>
3564: e51b3030 ldr r3, [fp, #-48] ; 0xffffffd0
3568: e5d33000 ldrb r3, [r3]
356c: e3530063 cmp r3, #99 ; 0x63
3570: 1a000005 bne 358c <sbrktest+0x2ac>
3574: e59f32dc ldr r3, [pc, #732] ; 3858 <sbrktest+0x578>
3578: e5933000 ldr r3, [r3]
357c: e1a00003 mov r0, r3
3580: e59f1300 ldr r1, [pc, #768] ; 3888 <sbrktest+0x5a8>
3584: eb0004fc bl 497c <printf>
3588: eb0003ee bl 4548 <exit>
358c: e3a00000 mov r0, #0
3590: eb000485 bl 47ac <sbrk>
3594: e50b0010 str r0, [fp, #-16]
3598: e51b4018 ldr r4, [fp, #-24] ; 0xffffffe8
359c: e3a00000 mov r0, #0
35a0: eb000481 bl 47ac <sbrk>
35a4: e1a03000 mov r3, r0
35a8: e0633004 rsb r3, r3, r4
35ac: e1a00003 mov r0, r3
35b0: eb00047d bl 47ac <sbrk>
35b4: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
35b8: e51b2024 ldr r2, [fp, #-36] ; 0xffffffdc
35bc: e51b3010 ldr r3, [fp, #-16]
35c0: e1520003 cmp r2, r3
35c4: 0a000007 beq 35e8 <sbrktest+0x308>
35c8: e59f3288 ldr r3, [pc, #648] ; 3858 <sbrktest+0x578>
35cc: e5933000 ldr r3, [r3]
35d0: e1a00003 mov r0, r3
35d4: e59f12b0 ldr r1, [pc, #688] ; 388c <sbrktest+0x5ac>
35d8: e51b2010 ldr r2, [fp, #-16]
35dc: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
35e0: eb0004e5 bl 497c <printf>
35e4: eb0003d7 bl 4548 <exit>
35e8: e3a03102 mov r3, #-2147483648 ; 0x80000000
35ec: e50b3010 str r3, [fp, #-16]
35f0: ea00001f b 3674 <sbrktest+0x394>
35f4: eb000463 bl 4788 <getpid>
35f8: e50b0034 str r0, [fp, #-52] ; 0xffffffcc
35fc: eb0003c8 bl 4524 <fork>
3600: e50b0020 str r0, [fp, #-32] ; 0xffffffe0
3604: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
3608: e3530000 cmp r3, #0
360c: aa000005 bge 3628 <sbrktest+0x348>
3610: e59f3240 ldr r3, [pc, #576] ; 3858 <sbrktest+0x578>
3614: e5933000 ldr r3, [r3]
3618: e1a00003 mov r0, r3
361c: e59f126c ldr r1, [pc, #620] ; 3890 <sbrktest+0x5b0>
3620: eb0004d5 bl 497c <printf>
3624: eb0003c7 bl 4548 <exit>
3628: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
362c: e3530000 cmp r3, #0
3630: 1a00000a bne 3660 <sbrktest+0x380>
3634: e59f321c ldr r3, [pc, #540] ; 3858 <sbrktest+0x578>
3638: e5932000 ldr r2, [r3]
363c: e51b3010 ldr r3, [fp, #-16]
3640: e5d33000 ldrb r3, [r3]
3644: e1a00002 mov r0, r2
3648: e59f1244 ldr r1, [pc, #580] ; 3894 <sbrktest+0x5b4>
364c: e51b2010 ldr r2, [fp, #-16]
3650: eb0004c9 bl 497c <printf>
3654: e51b0034 ldr r0, [fp, #-52] ; 0xffffffcc
3658: eb0003f0 bl 4620 <kill>
365c: eb0003b9 bl 4548 <exit>
3660: eb0003c1 bl 456c <wait>
3664: e51b3010 ldr r3, [fp, #-16]
3668: e2833cc3 add r3, r3, #49920 ; 0xc300
366c: e2833050 add r3, r3, #80 ; 0x50
3670: e50b3010 str r3, [fp, #-16]
3674: e51b3010 ldr r3, [fp, #-16]
3678: e59f2218 ldr r2, [pc, #536] ; 3898 <sbrktest+0x5b8>
367c: e1530002 cmp r3, r2
3680: 9affffdb bls 35f4 <sbrktest+0x314>
3684: e24b303c sub r3, fp, #60 ; 0x3c
3688: e1a00003 mov r0, r3
368c: eb0003bf bl 4590 <pipe>
3690: e1a03000 mov r3, r0
3694: e3530000 cmp r3, #0
3698: 0a000003 beq 36ac <sbrktest+0x3cc>
369c: e3a00001 mov r0, #1
36a0: e59f11f4 ldr r1, [pc, #500] ; 389c <sbrktest+0x5bc>
36a4: eb0004b4 bl 497c <printf>
36a8: eb0003a6 bl 4548 <exit>
36ac: e3a03000 mov r3, #0
36b0: e50b3014 str r3, [fp, #-20] ; 0xffffffec
36b4: ea00002b b 3768 <sbrktest+0x488>
36b8: eb000399 bl 4524 <fork>
36bc: e1a02000 mov r2, r0
36c0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
36c4: e1a03103 lsl r3, r3, #2
36c8: e24b100c sub r1, fp, #12
36cc: e0813003 add r3, r1, r3
36d0: e5032034 str r2, [r3, #-52] ; 0xffffffcc
36d4: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
36d8: e1a03103 lsl r3, r3, #2
36dc: e24b200c sub r2, fp, #12
36e0: e0823003 add r3, r2, r3
36e4: e5133034 ldr r3, [r3, #-52] ; 0xffffffcc
36e8: e3530000 cmp r3, #0
36ec: 1a00000d bne 3728 <sbrktest+0x448>
36f0: e3a00000 mov r0, #0
36f4: eb00042c bl 47ac <sbrk>
36f8: e1a03000 mov r3, r0
36fc: e2633519 rsb r3, r3, #104857600 ; 0x6400000
3700: e1a00003 mov r0, r3
3704: eb000428 bl 47ac <sbrk>
3708: e51b3038 ldr r3, [fp, #-56] ; 0xffffffc8
370c: e1a00003 mov r0, r3
3710: e59f1188 ldr r1, [pc, #392] ; 38a0 <sbrktest+0x5c0>
3714: e3a02001 mov r2, #1
3718: eb0003ae bl 45d8 <write>
371c: e3a00ffa mov r0, #1000 ; 0x3e8
3720: eb00042a bl 47d0 <sleep>
3724: eafffffc b 371c <sbrktest+0x43c>
3728: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
372c: e1a03103 lsl r3, r3, #2
3730: e24b200c sub r2, fp, #12
3734: e0823003 add r3, r2, r3
3738: e5133034 ldr r3, [r3, #-52] ; 0xffffffcc
373c: e3730001 cmn r3, #1
3740: 0a000005 beq 375c <sbrktest+0x47c>
3744: e51b203c ldr r2, [fp, #-60] ; 0xffffffc4
3748: e24b3041 sub r3, fp, #65 ; 0x41
374c: e1a00002 mov r0, r2
3750: e1a01003 mov r1, r3
3754: e3a02001 mov r2, #1
3758: eb000395 bl 45b4 <read>
375c: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
3760: e2833001 add r3, r3, #1
3764: e50b3014 str r3, [fp, #-20] ; 0xffffffec
3768: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
376c: e3530000 cmp r3, #0
3770: 0affffd0 beq 36b8 <sbrktest+0x3d8>
3774: e3a00a01 mov r0, #4096 ; 0x1000
3778: eb00040b bl 47ac <sbrk>
377c: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
3780: e3a03000 mov r3, #0
3784: e50b3014 str r3, [fp, #-20] ; 0xffffffec
3788: ea000012 b 37d8 <sbrktest+0x4f8>
378c: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
3790: e1a03103 lsl r3, r3, #2
3794: e24b200c sub r2, fp, #12
3798: e0823003 add r3, r2, r3
379c: e5133034 ldr r3, [r3, #-52] ; 0xffffffcc
37a0: e3730001 cmn r3, #1
37a4: 1a000000 bne 37ac <sbrktest+0x4cc>
37a8: ea000007 b 37cc <sbrktest+0x4ec>
37ac: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
37b0: e1a03103 lsl r3, r3, #2
37b4: e24b200c sub r2, fp, #12
37b8: e0823003 add r3, r2, r3
37bc: e5133034 ldr r3, [r3, #-52] ; 0xffffffcc
37c0: e1a00003 mov r0, r3
37c4: eb000395 bl 4620 <kill>
37c8: eb000367 bl 456c <wait>
37cc: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
37d0: e2833001 add r3, r3, #1
37d4: e50b3014 str r3, [fp, #-20] ; 0xffffffec
37d8: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
37dc: e3530000 cmp r3, #0
37e0: 0affffe9 beq 378c <sbrktest+0x4ac>
37e4: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
37e8: e3730001 cmn r3, #1
37ec: 1a000005 bne 3808 <sbrktest+0x528>
37f0: e59f3060 ldr r3, [pc, #96] ; 3858 <sbrktest+0x578>
37f4: e5933000 ldr r3, [r3]
37f8: e1a00003 mov r0, r3
37fc: e59f10a0 ldr r1, [pc, #160] ; 38a4 <sbrktest+0x5c4>
3800: eb00045d bl 497c <printf>
3804: eb00034f bl 4548 <exit>
3808: e3a00000 mov r0, #0
380c: eb0003e6 bl 47ac <sbrk>
3810: e1a02000 mov r2, r0
3814: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
3818: e1520003 cmp r2, r3
381c: 9a000006 bls 383c <sbrktest+0x55c>
3820: e51b4018 ldr r4, [fp, #-24] ; 0xffffffe8
3824: e3a00000 mov r0, #0
3828: eb0003df bl 47ac <sbrk>
382c: e1a03000 mov r3, r0
3830: e0633004 rsb r3, r3, r4
3834: e1a00003 mov r0, r3
3838: eb0003db bl 47ac <sbrk>
383c: e59f3014 ldr r3, [pc, #20] ; 3858 <sbrktest+0x578>
3840: e5933000 ldr r3, [r3]
3844: e1a00003 mov r0, r3
3848: e59f1058 ldr r1, [pc, #88] ; 38a8 <sbrktest+0x5c8>
384c: eb00044a bl 497c <printf>
3850: e24bd008 sub sp, fp, #8
3854: e8bd8810 pop {r4, fp, pc}
3858: 000068c8 .word 0x000068c8
385c: 0000649c .word 0x0000649c
3860: 000064a8 .word 0x000064a8
3864: 00001387 .word 0x00001387
3868: 000064c4 .word 0x000064c4
386c: 000064dc .word 0x000064dc
3870: 000064f8 .word 0x000064f8
3874: 063fffff .word 0x063fffff
3878: fffff000 .word 0xfffff000
387c: 00006538 .word 0x00006538
3880: 00006554 .word 0x00006554
3884: 0000658c .word 0x0000658c
3888: 000065b4 .word 0x000065b4
388c: 000065e4 .word 0x000065e4
3890: 00005470 .word 0x00005470
3894: 00006608 .word 0x00006608
3898: 801e847f .word 0x801e847f
389c: 000053b0 .word 0x000053b0
38a0: 00005420 .word 0x00005420
38a4: 00006624 .word 0x00006624
38a8: 00006640 .word 0x00006640
000038ac <validateint>:
38ac: e52db004 push {fp} ; (str fp, [sp, #-4]!)
38b0: e28db000 add fp, sp, #0
38b4: e24dd00c sub sp, sp, #12
38b8: e50b0008 str r0, [fp, #-8]
38bc: e24bd000 sub sp, fp, #0
38c0: e49db004 pop {fp} ; (ldr fp, [sp], #4)
38c4: e12fff1e bx lr
000038c8 <validatetest>:
38c8: e92d4800 push {fp, lr}
38cc: e28db004 add fp, sp, #4
38d0: e24dd010 sub sp, sp, #16
38d4: e59f30cc ldr r3, [pc, #204] ; 39a8 <validatetest+0xe0>
38d8: e5933000 ldr r3, [r3]
38dc: e1a00003 mov r0, r3
38e0: e59f10c4 ldr r1, [pc, #196] ; 39ac <validatetest+0xe4>
38e4: eb000424 bl 497c <printf>
38e8: e59f30c0 ldr r3, [pc, #192] ; 39b0 <validatetest+0xe8>
38ec: e50b300c str r3, [fp, #-12]
38f0: e3a03000 mov r3, #0
38f4: e50b3008 str r3, [fp, #-8]
38f8: ea00001f b 397c <validatetest+0xb4>
38fc: eb000308 bl 4524 <fork>
3900: e50b0010 str r0, [fp, #-16]
3904: e51b3010 ldr r3, [fp, #-16]
3908: e3530000 cmp r3, #0
390c: 1a000003 bne 3920 <validatetest+0x58>
3910: e51b3008 ldr r3, [fp, #-8]
3914: e1a00003 mov r0, r3
3918: ebffffe3 bl 38ac <validateint>
391c: eb000309 bl 4548 <exit>
3920: e3a00000 mov r0, #0
3924: eb0003a9 bl 47d0 <sleep>
3928: e3a00000 mov r0, #0
392c: eb0003a7 bl 47d0 <sleep>
3930: e51b0010 ldr r0, [fp, #-16]
3934: eb000339 bl 4620 <kill>
3938: eb00030b bl 456c <wait>
393c: e51b3008 ldr r3, [fp, #-8]
3940: e59f006c ldr r0, [pc, #108] ; 39b4 <validatetest+0xec>
3944: e1a01003 mov r1, r3
3948: eb00036a bl 46f8 <link>
394c: e1a03000 mov r3, r0
3950: e3730001 cmn r3, #1
3954: 0a000005 beq 3970 <validatetest+0xa8>
3958: e59f3048 ldr r3, [pc, #72] ; 39a8 <validatetest+0xe0>
395c: e5933000 ldr r3, [r3]
3960: e1a00003 mov r0, r3
3964: e59f104c ldr r1, [pc, #76] ; 39b8 <validatetest+0xf0>
3968: eb000403 bl 497c <printf>
396c: eb0002f5 bl 4548 <exit>
3970: e51b3008 ldr r3, [fp, #-8]
3974: e2833a01 add r3, r3, #4096 ; 0x1000
3978: e50b3008 str r3, [fp, #-8]
397c: e51b200c ldr r2, [fp, #-12]
3980: e51b3008 ldr r3, [fp, #-8]
3984: e1520003 cmp r2, r3
3988: 2affffdb bcs 38fc <validatetest+0x34>
398c: e59f3014 ldr r3, [pc, #20] ; 39a8 <validatetest+0xe0>
3990: e5933000 ldr r3, [r3]
3994: e1a00003 mov r0, r3
3998: e59f101c ldr r1, [pc, #28] ; 39bc <validatetest+0xf4>
399c: eb0003f6 bl 497c <printf>
39a0: e24bd004 sub sp, fp, #4
39a4: e8bd8800 pop {fp, pc}
39a8: 000068c8 .word 0x000068c8
39ac: 00006650 .word 0x00006650
39b0: 00113000 .word 0x00113000
39b4: 00006660 .word 0x00006660
39b8: 0000666c .word 0x0000666c
39bc: 00006688 .word 0x00006688
000039c0 <bsstest>:
39c0: e92d4800 push {fp, lr}
39c4: e28db004 add fp, sp, #4
39c8: e24dd008 sub sp, sp, #8
39cc: e59f3080 ldr r3, [pc, #128] ; 3a54 <bsstest+0x94>
39d0: e5933000 ldr r3, [r3]
39d4: e1a00003 mov r0, r3
39d8: e59f1078 ldr r1, [pc, #120] ; 3a58 <bsstest+0x98>
39dc: eb0003e6 bl 497c <printf>
39e0: e3a03000 mov r3, #0
39e4: e50b3008 str r3, [fp, #-8]
39e8: ea00000e b 3a28 <bsstest+0x68>
39ec: e59f2068 ldr r2, [pc, #104] ; 3a5c <bsstest+0x9c>
39f0: e51b3008 ldr r3, [fp, #-8]
39f4: e0823003 add r3, r2, r3
39f8: e5d33000 ldrb r3, [r3]
39fc: e3530000 cmp r3, #0
3a00: 0a000005 beq 3a1c <bsstest+0x5c>
3a04: e59f3048 ldr r3, [pc, #72] ; 3a54 <bsstest+0x94>
3a08: e5933000 ldr r3, [r3]
3a0c: e1a00003 mov r0, r3
3a10: e59f1048 ldr r1, [pc, #72] ; 3a60 <bsstest+0xa0>
3a14: eb0003d8 bl 497c <printf>
3a18: eb0002ca bl 4548 <exit>
3a1c: e51b3008 ldr r3, [fp, #-8]
3a20: e2833001 add r3, r3, #1
3a24: e50b3008 str r3, [fp, #-8]
3a28: e51b3008 ldr r3, [fp, #-8]
3a2c: e59f2030 ldr r2, [pc, #48] ; 3a64 <bsstest+0xa4>
3a30: e1530002 cmp r3, r2
3a34: 9affffec bls 39ec <bsstest+0x2c>
3a38: e59f3014 ldr r3, [pc, #20] ; 3a54 <bsstest+0x94>
3a3c: e5933000 ldr r3, [r3]
3a40: e1a00003 mov r0, r3
3a44: e59f101c ldr r1, [pc, #28] ; 3a68 <bsstest+0xa8>
3a48: eb0003cb bl 497c <printf>
3a4c: e24bd004 sub sp, fp, #4
3a50: e8bd8800 pop {fp, pc}
3a54: 000068c8 .word 0x000068c8
3a58: 00006698 .word 0x00006698
3a5c: 00006970 .word 0x00006970
3a60: 000066a4 .word 0x000066a4
3a64: 0000270f .word 0x0000270f
3a68: 000066b8 .word 0x000066b8
00003a6c <bigargtest>:
3a6c: e92d4800 push {fp, lr}
3a70: e28db004 add fp, sp, #4
3a74: e24dd010 sub sp, sp, #16
3a78: e59f0118 ldr r0, [pc, #280] ; 3b98 <bigargtest+0x12c>
3a7c: eb00030b bl 46b0 <unlink>
3a80: eb0002a7 bl 4524 <fork>
3a84: e50b000c str r0, [fp, #-12]
3a88: e51b300c ldr r3, [fp, #-12]
3a8c: e3530000 cmp r3, #0
3a90: 1a000023 bne 3b24 <bigargtest+0xb8>
3a94: e3a03000 mov r3, #0
3a98: e50b3008 str r3, [fp, #-8]
3a9c: ea000006 b 3abc <bigargtest+0x50>
3aa0: e59f20f4 ldr r2, [pc, #244] ; 3b9c <bigargtest+0x130>
3aa4: e51b3008 ldr r3, [fp, #-8]
3aa8: e59f10f0 ldr r1, [pc, #240] ; 3ba0 <bigargtest+0x134>
3aac: e7821103 str r1, [r2, r3, lsl #2]
3ab0: e51b3008 ldr r3, [fp, #-8]
3ab4: e2833001 add r3, r3, #1
3ab8: e50b3008 str r3, [fp, #-8]
3abc: e51b3008 ldr r3, [fp, #-8]
3ac0: e353001e cmp r3, #30
3ac4: dafffff5 ble 3aa0 <bigargtest+0x34>
3ac8: e59f30cc ldr r3, [pc, #204] ; 3b9c <bigargtest+0x130>
3acc: e3a02000 mov r2, #0
3ad0: e583207c str r2, [r3, #124] ; 0x7c
3ad4: e59f30c8 ldr r3, [pc, #200] ; 3ba4 <bigargtest+0x138>
3ad8: e5933000 ldr r3, [r3]
3adc: e1a00003 mov r0, r3
3ae0: e59f10c0 ldr r1, [pc, #192] ; 3ba8 <bigargtest+0x13c>
3ae4: eb0003a4 bl 497c <printf>
3ae8: e59f00bc ldr r0, [pc, #188] ; 3bac <bigargtest+0x140>
3aec: e59f10a8 ldr r1, [pc, #168] ; 3b9c <bigargtest+0x130>
3af0: eb0002d3 bl 4644 <exec>
3af4: e59f30a8 ldr r3, [pc, #168] ; 3ba4 <bigargtest+0x138>
3af8: e5933000 ldr r3, [r3]
3afc: e1a00003 mov r0, r3
3b00: e59f10a8 ldr r1, [pc, #168] ; 3bb0 <bigargtest+0x144>
3b04: eb00039c bl 497c <printf>
3b08: e59f0088 ldr r0, [pc, #136] ; 3b98 <bigargtest+0x12c>
3b0c: e3a01c02 mov r1, #512 ; 0x200
3b10: eb0002d4 bl 4668 <open>
3b14: e50b0010 str r0, [fp, #-16]
3b18: e51b0010 ldr r0, [fp, #-16]
3b1c: eb0002b6 bl 45fc <close>
3b20: eb000288 bl 4548 <exit>
3b24: e51b300c ldr r3, [fp, #-12]
3b28: e3530000 cmp r3, #0
3b2c: aa000005 bge 3b48 <bigargtest+0xdc>
3b30: e59f306c ldr r3, [pc, #108] ; 3ba4 <bigargtest+0x138>
3b34: e5933000 ldr r3, [r3]
3b38: e1a00003 mov r0, r3
3b3c: e59f1070 ldr r1, [pc, #112] ; 3bb4 <bigargtest+0x148>
3b40: eb00038d bl 497c <printf>
3b44: eb00027f bl 4548 <exit>
3b48: eb000287 bl 456c <wait>
3b4c: e59f0044 ldr r0, [pc, #68] ; 3b98 <bigargtest+0x12c>
3b50: e3a01000 mov r1, #0
3b54: eb0002c3 bl 4668 <open>
3b58: e50b0010 str r0, [fp, #-16]
3b5c: e51b3010 ldr r3, [fp, #-16]
3b60: e3530000 cmp r3, #0
3b64: aa000005 bge 3b80 <bigargtest+0x114>
3b68: e59f3034 ldr r3, [pc, #52] ; 3ba4 <bigargtest+0x138>
3b6c: e5933000 ldr r3, [r3]
3b70: e1a00003 mov r0, r3
3b74: e59f103c ldr r1, [pc, #60] ; 3bb8 <bigargtest+0x14c>
3b78: eb00037f bl 497c <printf>
3b7c: eb000271 bl 4548 <exit>
3b80: e51b0010 ldr r0, [fp, #-16]
3b84: eb00029c bl 45fc <close>
3b88: e59f0008 ldr r0, [pc, #8] ; 3b98 <bigargtest+0x12c>
3b8c: eb0002c7 bl 46b0 <unlink>
3b90: e24bd004 sub sp, fp, #4
3b94: e8bd8800 pop {fp, pc}
3b98: 000066c8 .word 0x000066c8
3b9c: 000068e4 .word 0x000068e4
3ba0: 000066d4 .word 0x000066d4
3ba4: 000068c8 .word 0x000068c8
3ba8: 000067b4 .word 0x000067b4
3bac: 0000502c .word 0x0000502c
3bb0: 000067c4 .word 0x000067c4
3bb4: 000067d4 .word 0x000067d4
3bb8: 000067f0 .word 0x000067f0
00003bbc <fsfull>:
3bbc: e92d4800 push {fp, lr}
3bc0: e28db004 add fp, sp, #4
3bc4: e24dd058 sub sp, sp, #88 ; 0x58
3bc8: e3a03000 mov r3, #0
3bcc: e50b300c str r3, [fp, #-12]
3bd0: e3a00001 mov r0, #1
3bd4: e59f1320 ldr r1, [pc, #800] ; 3efc <fsfull+0x340>
3bd8: eb000367 bl 497c <printf>
3bdc: e3a03000 mov r3, #0
3be0: e50b3008 str r3, [fp, #-8]
3be4: e3a03066 mov r3, #102 ; 0x66
3be8: e54b3058 strb r3, [fp, #-88] ; 0xffffffa8
3bec: e51b3008 ldr r3, [fp, #-8]
3bf0: e59f2308 ldr r2, [pc, #776] ; 3f00 <fsfull+0x344>
3bf4: e0c21392 smull r1, r2, r2, r3
3bf8: e1a02342 asr r2, r2, #6
3bfc: e1a03fc3 asr r3, r3, #31
3c00: e0633002 rsb r3, r3, r2
3c04: e6ef3073 uxtb r3, r3
3c08: e2833030 add r3, r3, #48 ; 0x30
3c0c: e6ef3073 uxtb r3, r3
3c10: e54b3057 strb r3, [fp, #-87] ; 0xffffffa9
3c14: e51b2008 ldr r2, [fp, #-8]
3c18: e59f32e0 ldr r3, [pc, #736] ; 3f00 <fsfull+0x344>
3c1c: e0c31293 smull r1, r3, r3, r2
3c20: e1a01343 asr r1, r3, #6
3c24: e1a03fc2 asr r3, r2, #31
3c28: e0633001 rsb r3, r3, r1
3c2c: e3a01ffa mov r1, #1000 ; 0x3e8
3c30: e0030391 mul r3, r1, r3
3c34: e0633002 rsb r3, r3, r2
3c38: e59f22c4 ldr r2, [pc, #708] ; 3f04 <fsfull+0x348>
3c3c: e0c21392 smull r1, r2, r2, r3
3c40: e1a022c2 asr r2, r2, #5
3c44: e1a03fc3 asr r3, r3, #31
3c48: e0633002 rsb r3, r3, r2
3c4c: e6ef3073 uxtb r3, r3
3c50: e2833030 add r3, r3, #48 ; 0x30
3c54: e6ef3073 uxtb r3, r3
3c58: e54b3056 strb r3, [fp, #-86] ; 0xffffffaa
3c5c: e51b2008 ldr r2, [fp, #-8]
3c60: e59f329c ldr r3, [pc, #668] ; 3f04 <fsfull+0x348>
3c64: e0c31293 smull r1, r3, r3, r2
3c68: e1a012c3 asr r1, r3, #5
3c6c: e1a03fc2 asr r3, r2, #31
3c70: e0633001 rsb r3, r3, r1
3c74: e3a01064 mov r1, #100 ; 0x64
3c78: e0030391 mul r3, r1, r3
3c7c: e0633002 rsb r3, r3, r2
3c80: e59f2280 ldr r2, [pc, #640] ; 3f08 <fsfull+0x34c>
3c84: e0c21392 smull r1, r2, r2, r3
3c88: e1a02142 asr r2, r2, #2
3c8c: e1a03fc3 asr r3, r3, #31
3c90: e0633002 rsb r3, r3, r2
3c94: e6ef3073 uxtb r3, r3
3c98: e2833030 add r3, r3, #48 ; 0x30
3c9c: e6ef3073 uxtb r3, r3
3ca0: e54b3055 strb r3, [fp, #-85] ; 0xffffffab
3ca4: e51b2008 ldr r2, [fp, #-8]
3ca8: e59f3258 ldr r3, [pc, #600] ; 3f08 <fsfull+0x34c>
3cac: e0c31293 smull r1, r3, r3, r2
3cb0: e1a01143 asr r1, r3, #2
3cb4: e1a03fc2 asr r3, r2, #31
3cb8: e0631001 rsb r1, r3, r1
3cbc: e1a03001 mov r3, r1
3cc0: e1a03103 lsl r3, r3, #2
3cc4: e0833001 add r3, r3, r1
3cc8: e1a03083 lsl r3, r3, #1
3ccc: e0631002 rsb r1, r3, r2
3cd0: e6ef3071 uxtb r3, r1
3cd4: e2833030 add r3, r3, #48 ; 0x30
3cd8: e6ef3073 uxtb r3, r3
3cdc: e54b3054 strb r3, [fp, #-84] ; 0xffffffac
3ce0: e3a03000 mov r3, #0
3ce4: e54b3053 strb r3, [fp, #-83] ; 0xffffffad
3ce8: e24b3058 sub r3, fp, #88 ; 0x58
3cec: e3a00001 mov r0, #1
3cf0: e59f1214 ldr r1, [pc, #532] ; 3f0c <fsfull+0x350>
3cf4: e1a02003 mov r2, r3
3cf8: eb00031f bl 497c <printf>
3cfc: e24b3058 sub r3, fp, #88 ; 0x58
3d00: e1a00003 mov r0, r3
3d04: e59f1204 ldr r1, [pc, #516] ; 3f10 <fsfull+0x354>
3d08: eb000256 bl 4668 <open>
3d0c: e50b0014 str r0, [fp, #-20] ; 0xffffffec
3d10: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
3d14: e3530000 cmp r3, #0
3d18: aa000005 bge 3d34 <fsfull+0x178>
3d1c: e24b3058 sub r3, fp, #88 ; 0x58
3d20: e3a00001 mov r0, #1
3d24: e59f11e8 ldr r1, [pc, #488] ; 3f14 <fsfull+0x358>
3d28: e1a02003 mov r2, r3
3d2c: eb000312 bl 497c <printf>
3d30: ea000021 b 3dbc <fsfull+0x200>
3d34: e3a03000 mov r3, #0
3d38: e50b3010 str r3, [fp, #-16]
3d3c: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
3d40: e59f11d0 ldr r1, [pc, #464] ; 3f18 <fsfull+0x35c>
3d44: e3a02c02 mov r2, #512 ; 0x200
3d48: eb000222 bl 45d8 <write>
3d4c: e50b0018 str r0, [fp, #-24] ; 0xffffffe8
3d50: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
3d54: e3530c02 cmp r3, #512 ; 0x200
3d58: aa00000a bge 3d88 <fsfull+0x1cc>
3d5c: e1a00000 nop ; (mov r0, r0)
3d60: e3a00001 mov r0, #1
3d64: e59f11b0 ldr r1, [pc, #432] ; 3f1c <fsfull+0x360>
3d68: e51b2010 ldr r2, [fp, #-16]
3d6c: eb000302 bl 497c <printf>
3d70: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
3d74: eb000220 bl 45fc <close>
3d78: e51b3010 ldr r3, [fp, #-16]
3d7c: e3530000 cmp r3, #0
3d80: 1a000009 bne 3dac <fsfull+0x1f0>
3d84: ea000007 b 3da8 <fsfull+0x1ec>
3d88: e51b2010 ldr r2, [fp, #-16]
3d8c: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
3d90: e0823003 add r3, r2, r3
3d94: e50b3010 str r3, [fp, #-16]
3d98: e51b300c ldr r3, [fp, #-12]
3d9c: e2833001 add r3, r3, #1
3da0: e50b300c str r3, [fp, #-12]
3da4: eaffffe4 b 3d3c <fsfull+0x180>
3da8: ea000003 b 3dbc <fsfull+0x200>
3dac: e51b3008 ldr r3, [fp, #-8]
3db0: e2833001 add r3, r3, #1
3db4: e50b3008 str r3, [fp, #-8]
3db8: eaffff89 b 3be4 <fsfull+0x28>
3dbc: ea000046 b 3edc <fsfull+0x320>
3dc0: e3a03066 mov r3, #102 ; 0x66
3dc4: e54b3058 strb r3, [fp, #-88] ; 0xffffffa8
3dc8: e51b3008 ldr r3, [fp, #-8]
3dcc: e59f212c ldr r2, [pc, #300] ; 3f00 <fsfull+0x344>
3dd0: e0c21392 smull r1, r2, r2, r3
3dd4: e1a02342 asr r2, r2, #6
3dd8: e1a03fc3 asr r3, r3, #31
3ddc: e0633002 rsb r3, r3, r2
3de0: e6ef3073 uxtb r3, r3
3de4: e2833030 add r3, r3, #48 ; 0x30
3de8: e6ef3073 uxtb r3, r3
3dec: e54b3057 strb r3, [fp, #-87] ; 0xffffffa9
3df0: e51b2008 ldr r2, [fp, #-8]
3df4: e59f3104 ldr r3, [pc, #260] ; 3f00 <fsfull+0x344>
3df8: e0c31293 smull r1, r3, r3, r2
3dfc: e1a01343 asr r1, r3, #6
3e00: e1a03fc2 asr r3, r2, #31
3e04: e0633001 rsb r3, r3, r1
3e08: e3a01ffa mov r1, #1000 ; 0x3e8
3e0c: e0030391 mul r3, r1, r3
3e10: e0633002 rsb r3, r3, r2
3e14: e59f20e8 ldr r2, [pc, #232] ; 3f04 <fsfull+0x348>
3e18: e0c21392 smull r1, r2, r2, r3
3e1c: e1a022c2 asr r2, r2, #5
3e20: e1a03fc3 asr r3, r3, #31
3e24: e0633002 rsb r3, r3, r2
3e28: e6ef3073 uxtb r3, r3
3e2c: e2833030 add r3, r3, #48 ; 0x30
3e30: e6ef3073 uxtb r3, r3
3e34: e54b3056 strb r3, [fp, #-86] ; 0xffffffaa
3e38: e51b2008 ldr r2, [fp, #-8]
3e3c: e59f30c0 ldr r3, [pc, #192] ; 3f04 <fsfull+0x348>
3e40: e0c31293 smull r1, r3, r3, r2
3e44: e1a012c3 asr r1, r3, #5
3e48: e1a03fc2 asr r3, r2, #31
3e4c: e0633001 rsb r3, r3, r1
3e50: e3a01064 mov r1, #100 ; 0x64
3e54: e0030391 mul r3, r1, r3
3e58: e0633002 rsb r3, r3, r2
3e5c: e59f20a4 ldr r2, [pc, #164] ; 3f08 <fsfull+0x34c>
3e60: e0c21392 smull r1, r2, r2, r3
3e64: e1a02142 asr r2, r2, #2
3e68: e1a03fc3 asr r3, r3, #31
3e6c: e0633002 rsb r3, r3, r2
3e70: e6ef3073 uxtb r3, r3
3e74: e2833030 add r3, r3, #48 ; 0x30
3e78: e6ef3073 uxtb r3, r3
3e7c: e54b3055 strb r3, [fp, #-85] ; 0xffffffab
3e80: e51b2008 ldr r2, [fp, #-8]
3e84: e59f307c ldr r3, [pc, #124] ; 3f08 <fsfull+0x34c>
3e88: e0c31293 smull r1, r3, r3, r2
3e8c: e1a01143 asr r1, r3, #2
3e90: e1a03fc2 asr r3, r2, #31
3e94: e0631001 rsb r1, r3, r1
3e98: e1a03001 mov r3, r1
3e9c: e1a03103 lsl r3, r3, #2
3ea0: e0833001 add r3, r3, r1
3ea4: e1a03083 lsl r3, r3, #1
3ea8: e0631002 rsb r1, r3, r2
3eac: e6ef3071 uxtb r3, r1
3eb0: e2833030 add r3, r3, #48 ; 0x30
3eb4: e6ef3073 uxtb r3, r3
3eb8: e54b3054 strb r3, [fp, #-84] ; 0xffffffac
3ebc: e3a03000 mov r3, #0
3ec0: e54b3053 strb r3, [fp, #-83] ; 0xffffffad
3ec4: e24b3058 sub r3, fp, #88 ; 0x58
3ec8: e1a00003 mov r0, r3
3ecc: eb0001f7 bl 46b0 <unlink>
3ed0: e51b3008 ldr r3, [fp, #-8]
3ed4: e2433001 sub r3, r3, #1
3ed8: e50b3008 str r3, [fp, #-8]
3edc: e51b3008 ldr r3, [fp, #-8]
3ee0: e3530000 cmp r3, #0
3ee4: aaffffb5 bge 3dc0 <fsfull+0x204>
3ee8: e3a00001 mov r0, #1
3eec: e59f102c ldr r1, [pc, #44] ; 3f20 <fsfull+0x364>
3ef0: eb0002a1 bl 497c <printf>
3ef4: e24bd004 sub sp, fp, #4
3ef8: e8bd8800 pop {fp, pc}
3efc: 00006808 .word 0x00006808
3f00: 10624dd3 .word 0x10624dd3
3f04: 51eb851f .word 0x51eb851f
3f08: 66666667 .word 0x66666667
3f0c: 00006818 .word 0x00006818
3f10: 00000202 .word 0x00000202
3f14: 00006824 .word 0x00006824
3f18: 00009080 .word 0x00009080
3f1c: 00006834 .word 0x00006834
3f20: 00006844 .word 0x00006844
00003f24 <rand>:
3f24: e52db004 push {fp} ; (str fp, [sp, #-4]!)
3f28: e28db000 add fp, sp, #0
3f2c: e59f3030 ldr r3, [pc, #48] ; 3f64 <rand+0x40>
3f30: e5933000 ldr r3, [r3]
3f34: e59f202c ldr r2, [pc, #44] ; 3f68 <rand+0x44>
3f38: e0020392 mul r2, r2, r3
3f3c: e59f3028 ldr r3, [pc, #40] ; 3f6c <rand+0x48>
3f40: e0823003 add r3, r2, r3
3f44: e59f2018 ldr r2, [pc, #24] ; 3f64 <rand+0x40>
3f48: e5823000 str r3, [r2]
3f4c: e59f3010 ldr r3, [pc, #16] ; 3f64 <rand+0x40>
3f50: e5933000 ldr r3, [r3]
3f54: e1a00003 mov r0, r3
3f58: e24bd000 sub sp, fp, #0
3f5c: e49db004 pop {fp} ; (ldr fp, [sp], #4)
3f60: e12fff1e bx lr
3f64: 000068cc .word 0x000068cc
3f68: 0019660d .word 0x0019660d
3f6c: 3c6ef35f .word 0x3c6ef35f
00003f70 <main>:
3f70: e92d4800 push {fp, lr}
3f74: e28db004 add fp, sp, #4
3f78: e24dd008 sub sp, sp, #8
3f7c: e50b0008 str r0, [fp, #-8]
3f80: e50b100c str r1, [fp, #-12]
3f84: e3a00001 mov r0, #1
3f88: e59f10b8 ldr r1, [pc, #184] ; 4048 <main+0xd8>
3f8c: eb00027a bl 497c <printf>
3f90: e59f00b4 ldr r0, [pc, #180] ; 404c <main+0xdc>
3f94: e3a01000 mov r1, #0
3f98: eb0001b2 bl 4668 <open>
3f9c: e1a03000 mov r3, r0
3fa0: e3530000 cmp r3, #0
3fa4: ba000003 blt 3fb8 <main+0x48>
3fa8: e3a00001 mov r0, #1
3fac: e59f109c ldr r1, [pc, #156] ; 4050 <main+0xe0>
3fb0: eb000271 bl 497c <printf>
3fb4: eb000163 bl 4548 <exit>
3fb8: e59f008c ldr r0, [pc, #140] ; 404c <main+0xdc>
3fbc: e3a01c02 mov r1, #512 ; 0x200
3fc0: eb0001a8 bl 4668 <open>
3fc4: e1a03000 mov r3, r0
3fc8: e1a00003 mov r0, r3
3fcc: eb00018a bl 45fc <close>
3fd0: ebfffea5 bl 3a6c <bigargtest>
3fd4: ebfffa20 bl 285c <bigwrite>
3fd8: ebfffea3 bl 3a6c <bigargtest>
3fdc: ebfffe77 bl 39c0 <bsstest>
3fe0: ebfffcbe bl 32e0 <sbrktest>
3fe4: ebfffe37 bl 38c8 <validatetest>
3fe8: ebfff004 bl 0 <opentest>
3fec: ebfff035 bl c8 <writetest>
3ff0: ebfff0c7 bl 314 <writetest1>
3ff4: ebfff157 bl 558 <createtest>
3ff8: ebfff319 bl c64 <mem>
3ffc: ebfff1f5 bl 7d8 <pipe1>
4000: ebfff2ed bl bbc <exitwait>
4004: ebfffb41 bl 2d10 <rmdot>
4008: ebfffae9 bl 2bb4 <fourteen>
400c: ebfffa58 bl 2974 <bigfile>
4010: ebfff854 bl 2168 <subdir>
4014: ebfff668 bl 19bc <concreate>
4018: ebfff77e bl 1e18 <linkunlink>
401c: ebfff5e0 bl 17a4 <linktest>
4020: ebfff576 bl 1600 <unlinkread>
4024: ebfff497 bl 1288 <createdelete>
4028: ebfff3ed bl fe4 <twofiles>
402c: ebfff35b bl da0 <sharedfd>
4030: ebfffb97 bl 2e94 <dirfile>
4034: ebfffc1e bl 30b4 <iref>
4038: ebfffc67 bl 31dc <forktest>
403c: ebfff7d0 bl 1f84 <bigdir>
4040: ebfff1cb bl 774 <exectest>
4044: eb00013f bl 4548 <exit>
4048: 0000685c .word 0x0000685c
404c: 00006870 .word 0x00006870
4050: 00006880 .word 0x00006880
00004054 <strcpy>:
4054: e52db004 push {fp} ; (str fp, [sp, #-4]!)
4058: e28db000 add fp, sp, #0
405c: e24dd014 sub sp, sp, #20
4060: e50b0010 str r0, [fp, #-16]
4064: e50b1014 str r1, [fp, #-20] ; 0xffffffec
4068: e51b3010 ldr r3, [fp, #-16]
406c: e50b3008 str r3, [fp, #-8]
4070: e1a00000 nop ; (mov r0, r0)
4074: e51b3010 ldr r3, [fp, #-16]
4078: e2832001 add r2, r3, #1
407c: e50b2010 str r2, [fp, #-16]
4080: e51b2014 ldr r2, [fp, #-20] ; 0xffffffec
4084: e2821001 add r1, r2, #1
4088: e50b1014 str r1, [fp, #-20] ; 0xffffffec
408c: e5d22000 ldrb r2, [r2]
4090: e5c32000 strb r2, [r3]
4094: e5d33000 ldrb r3, [r3]
4098: e3530000 cmp r3, #0
409c: 1afffff4 bne 4074 <strcpy+0x20>
40a0: e51b3008 ldr r3, [fp, #-8]
40a4: e1a00003 mov r0, r3
40a8: e24bd000 sub sp, fp, #0
40ac: e49db004 pop {fp} ; (ldr fp, [sp], #4)
40b0: e12fff1e bx lr
000040b4 <strcmp>:
40b4: e52db004 push {fp} ; (str fp, [sp, #-4]!)
40b8: e28db000 add fp, sp, #0
40bc: e24dd00c sub sp, sp, #12
40c0: e50b0008 str r0, [fp, #-8]
40c4: e50b100c str r1, [fp, #-12]
40c8: ea000005 b 40e4 <strcmp+0x30>
40cc: e51b3008 ldr r3, [fp, #-8]
40d0: e2833001 add r3, r3, #1
40d4: e50b3008 str r3, [fp, #-8]
40d8: e51b300c ldr r3, [fp, #-12]
40dc: e2833001 add r3, r3, #1
40e0: e50b300c str r3, [fp, #-12]
40e4: e51b3008 ldr r3, [fp, #-8]
40e8: e5d33000 ldrb r3, [r3]
40ec: e3530000 cmp r3, #0
40f0: 0a000005 beq 410c <strcmp+0x58>
40f4: e51b3008 ldr r3, [fp, #-8]
40f8: e5d32000 ldrb r2, [r3]
40fc: e51b300c ldr r3, [fp, #-12]
4100: e5d33000 ldrb r3, [r3]
4104: e1520003 cmp r2, r3
4108: 0affffef beq 40cc <strcmp+0x18>
410c: e51b3008 ldr r3, [fp, #-8]
4110: e5d33000 ldrb r3, [r3]
4114: e1a02003 mov r2, r3
4118: e51b300c ldr r3, [fp, #-12]
411c: e5d33000 ldrb r3, [r3]
4120: e0633002 rsb r3, r3, r2
4124: e1a00003 mov r0, r3
4128: e24bd000 sub sp, fp, #0
412c: e49db004 pop {fp} ; (ldr fp, [sp], #4)
4130: e12fff1e bx lr
00004134 <strlen>:
4134: e52db004 push {fp} ; (str fp, [sp, #-4]!)
4138: e28db000 add fp, sp, #0
413c: e24dd014 sub sp, sp, #20
4140: e50b0010 str r0, [fp, #-16]
4144: e3a03000 mov r3, #0
4148: e50b3008 str r3, [fp, #-8]
414c: ea000002 b 415c <strlen+0x28>
4150: e51b3008 ldr r3, [fp, #-8]
4154: e2833001 add r3, r3, #1
4158: e50b3008 str r3, [fp, #-8]
415c: e51b3008 ldr r3, [fp, #-8]
4160: e51b2010 ldr r2, [fp, #-16]
4164: e0823003 add r3, r2, r3
4168: e5d33000 ldrb r3, [r3]
416c: e3530000 cmp r3, #0
4170: 1afffff6 bne 4150 <strlen+0x1c>
4174: e51b3008 ldr r3, [fp, #-8]
4178: e1a00003 mov r0, r3
417c: e24bd000 sub sp, fp, #0
4180: e49db004 pop {fp} ; (ldr fp, [sp], #4)
4184: e12fff1e bx lr
00004188 <memset>:
4188: e52db004 push {fp} ; (str fp, [sp, #-4]!)
418c: e28db000 add fp, sp, #0
4190: e24dd024 sub sp, sp, #36 ; 0x24
4194: e50b0018 str r0, [fp, #-24] ; 0xffffffe8
4198: e50b101c str r1, [fp, #-28] ; 0xffffffe4
419c: e50b2020 str r2, [fp, #-32] ; 0xffffffe0
41a0: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
41a4: e50b3008 str r3, [fp, #-8]
41a8: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
41ac: e54b300d strb r3, [fp, #-13]
41b0: e55b300d ldrb r3, [fp, #-13]
41b4: e1a02c03 lsl r2, r3, #24
41b8: e55b300d ldrb r3, [fp, #-13]
41bc: e1a03803 lsl r3, r3, #16
41c0: e1822003 orr r2, r2, r3
41c4: e55b300d ldrb r3, [fp, #-13]
41c8: e1a03403 lsl r3, r3, #8
41cc: e1822003 orr r2, r2, r3
41d0: e55b300d ldrb r3, [fp, #-13]
41d4: e1823003 orr r3, r2, r3
41d8: e50b3014 str r3, [fp, #-20] ; 0xffffffec
41dc: ea000008 b 4204 <memset+0x7c>
41e0: e51b3008 ldr r3, [fp, #-8]
41e4: e55b200d ldrb r2, [fp, #-13]
41e8: e5c32000 strb r2, [r3]
41ec: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
41f0: e2433001 sub r3, r3, #1
41f4: e50b3020 str r3, [fp, #-32] ; 0xffffffe0
41f8: e51b3008 ldr r3, [fp, #-8]
41fc: e2833001 add r3, r3, #1
4200: e50b3008 str r3, [fp, #-8]
4204: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
4208: e3530000 cmp r3, #0
420c: 0a000003 beq 4220 <memset+0x98>
4210: e51b3008 ldr r3, [fp, #-8]
4214: e2033003 and r3, r3, #3
4218: e3530000 cmp r3, #0
421c: 1affffef bne 41e0 <memset+0x58>
4220: e51b3008 ldr r3, [fp, #-8]
4224: e50b300c str r3, [fp, #-12]
4228: ea000008 b 4250 <memset+0xc8>
422c: e51b300c ldr r3, [fp, #-12]
4230: e51b2014 ldr r2, [fp, #-20] ; 0xffffffec
4234: e5832000 str r2, [r3]
4238: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
423c: e2433004 sub r3, r3, #4
4240: e50b3020 str r3, [fp, #-32] ; 0xffffffe0
4244: e51b300c ldr r3, [fp, #-12]
4248: e2833004 add r3, r3, #4
424c: e50b300c str r3, [fp, #-12]
4250: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
4254: e3530003 cmp r3, #3
4258: 8afffff3 bhi 422c <memset+0xa4>
425c: e51b300c ldr r3, [fp, #-12]
4260: e50b3008 str r3, [fp, #-8]
4264: ea000008 b 428c <memset+0x104>
4268: e51b3008 ldr r3, [fp, #-8]
426c: e55b200d ldrb r2, [fp, #-13]
4270: e5c32000 strb r2, [r3]
4274: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
4278: e2433001 sub r3, r3, #1
427c: e50b3020 str r3, [fp, #-32] ; 0xffffffe0
4280: e51b3008 ldr r3, [fp, #-8]
4284: e2833001 add r3, r3, #1
4288: e50b3008 str r3, [fp, #-8]
428c: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
4290: e3530000 cmp r3, #0
4294: 1afffff3 bne 4268 <memset+0xe0>
4298: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
429c: e1a00003 mov r0, r3
42a0: e24bd000 sub sp, fp, #0
42a4: e49db004 pop {fp} ; (ldr fp, [sp], #4)
42a8: e12fff1e bx lr
000042ac <strchr>:
42ac: e52db004 push {fp} ; (str fp, [sp, #-4]!)
42b0: e28db000 add fp, sp, #0
42b4: e24dd00c sub sp, sp, #12
42b8: e50b0008 str r0, [fp, #-8]
42bc: e1a03001 mov r3, r1
42c0: e54b3009 strb r3, [fp, #-9]
42c4: ea000009 b 42f0 <strchr+0x44>
42c8: e51b3008 ldr r3, [fp, #-8]
42cc: e5d33000 ldrb r3, [r3]
42d0: e55b2009 ldrb r2, [fp, #-9]
42d4: e1520003 cmp r2, r3
42d8: 1a000001 bne 42e4 <strchr+0x38>
42dc: e51b3008 ldr r3, [fp, #-8]
42e0: ea000007 b 4304 <strchr+0x58>
42e4: e51b3008 ldr r3, [fp, #-8]
42e8: e2833001 add r3, r3, #1
42ec: e50b3008 str r3, [fp, #-8]
42f0: e51b3008 ldr r3, [fp, #-8]
42f4: e5d33000 ldrb r3, [r3]
42f8: e3530000 cmp r3, #0
42fc: 1afffff1 bne 42c8 <strchr+0x1c>
4300: e3a03000 mov r3, #0
4304: e1a00003 mov r0, r3
4308: e24bd000 sub sp, fp, #0
430c: e49db004 pop {fp} ; (ldr fp, [sp], #4)
4310: e12fff1e bx lr
00004314 <gets>:
4314: e92d4800 push {fp, lr}
4318: e28db004 add fp, sp, #4
431c: e24dd018 sub sp, sp, #24
4320: e50b0018 str r0, [fp, #-24] ; 0xffffffe8
4324: e50b101c str r1, [fp, #-28] ; 0xffffffe4
4328: e3a03000 mov r3, #0
432c: e50b3008 str r3, [fp, #-8]
4330: ea000017 b 4394 <gets+0x80>
4334: e24b300d sub r3, fp, #13
4338: e3a00000 mov r0, #0
433c: e1a01003 mov r1, r3
4340: e3a02001 mov r2, #1
4344: eb00009a bl 45b4 <read>
4348: e50b000c str r0, [fp, #-12]
434c: e51b300c ldr r3, [fp, #-12]
4350: e3530000 cmp r3, #0
4354: ca000000 bgt 435c <gets+0x48>
4358: ea000012 b 43a8 <gets+0x94>
435c: e51b3008 ldr r3, [fp, #-8]
4360: e2832001 add r2, r3, #1
4364: e50b2008 str r2, [fp, #-8]
4368: e1a02003 mov r2, r3
436c: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4370: e0833002 add r3, r3, r2
4374: e55b200d ldrb r2, [fp, #-13]
4378: e5c32000 strb r2, [r3]
437c: e55b300d ldrb r3, [fp, #-13]
4380: e353000a cmp r3, #10
4384: 0a000007 beq 43a8 <gets+0x94>
4388: e55b300d ldrb r3, [fp, #-13]
438c: e353000d cmp r3, #13
4390: 0a000004 beq 43a8 <gets+0x94>
4394: e51b3008 ldr r3, [fp, #-8]
4398: e2832001 add r2, r3, #1
439c: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
43a0: e1520003 cmp r2, r3
43a4: baffffe2 blt 4334 <gets+0x20>
43a8: e51b3008 ldr r3, [fp, #-8]
43ac: e51b2018 ldr r2, [fp, #-24] ; 0xffffffe8
43b0: e0823003 add r3, r2, r3
43b4: e3a02000 mov r2, #0
43b8: e5c32000 strb r2, [r3]
43bc: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
43c0: e1a00003 mov r0, r3
43c4: e24bd004 sub sp, fp, #4
43c8: e8bd8800 pop {fp, pc}
000043cc <stat>:
43cc: e92d4800 push {fp, lr}
43d0: e28db004 add fp, sp, #4
43d4: e24dd010 sub sp, sp, #16
43d8: e50b0010 str r0, [fp, #-16]
43dc: e50b1014 str r1, [fp, #-20] ; 0xffffffec
43e0: e51b0010 ldr r0, [fp, #-16]
43e4: e3a01000 mov r1, #0
43e8: eb00009e bl 4668 <open>
43ec: e50b0008 str r0, [fp, #-8]
43f0: e51b3008 ldr r3, [fp, #-8]
43f4: e3530000 cmp r3, #0
43f8: aa000001 bge 4404 <stat+0x38>
43fc: e3e03000 mvn r3, #0
4400: ea000006 b 4420 <stat+0x54>
4404: e51b0008 ldr r0, [fp, #-8]
4408: e51b1014 ldr r1, [fp, #-20] ; 0xffffffec
440c: eb0000b0 bl 46d4 <fstat>
4410: e50b000c str r0, [fp, #-12]
4414: e51b0008 ldr r0, [fp, #-8]
4418: eb000077 bl 45fc <close>
441c: e51b300c ldr r3, [fp, #-12]
4420: e1a00003 mov r0, r3
4424: e24bd004 sub sp, fp, #4
4428: e8bd8800 pop {fp, pc}
0000442c <atoi>:
442c: e52db004 push {fp} ; (str fp, [sp, #-4]!)
4430: e28db000 add fp, sp, #0
4434: e24dd014 sub sp, sp, #20
4438: e50b0010 str r0, [fp, #-16]
443c: e3a03000 mov r3, #0
4440: e50b3008 str r3, [fp, #-8]
4444: ea00000c b 447c <atoi+0x50>
4448: e51b2008 ldr r2, [fp, #-8]
444c: e1a03002 mov r3, r2
4450: e1a03103 lsl r3, r3, #2
4454: e0833002 add r3, r3, r2
4458: e1a03083 lsl r3, r3, #1
445c: e1a01003 mov r1, r3
4460: e51b3010 ldr r3, [fp, #-16]
4464: e2832001 add r2, r3, #1
4468: e50b2010 str r2, [fp, #-16]
446c: e5d33000 ldrb r3, [r3]
4470: e0813003 add r3, r1, r3
4474: e2433030 sub r3, r3, #48 ; 0x30
4478: e50b3008 str r3, [fp, #-8]
447c: e51b3010 ldr r3, [fp, #-16]
4480: e5d33000 ldrb r3, [r3]
4484: e353002f cmp r3, #47 ; 0x2f
4488: 9a000003 bls 449c <atoi+0x70>
448c: e51b3010 ldr r3, [fp, #-16]
4490: e5d33000 ldrb r3, [r3]
4494: e3530039 cmp r3, #57 ; 0x39
4498: 9affffea bls 4448 <atoi+0x1c>
449c: e51b3008 ldr r3, [fp, #-8]
44a0: e1a00003 mov r0, r3
44a4: e24bd000 sub sp, fp, #0
44a8: e49db004 pop {fp} ; (ldr fp, [sp], #4)
44ac: e12fff1e bx lr
000044b0 <memmove>:
44b0: e52db004 push {fp} ; (str fp, [sp, #-4]!)
44b4: e28db000 add fp, sp, #0
44b8: e24dd01c sub sp, sp, #28
44bc: e50b0010 str r0, [fp, #-16]
44c0: e50b1014 str r1, [fp, #-20] ; 0xffffffec
44c4: e50b2018 str r2, [fp, #-24] ; 0xffffffe8
44c8: e51b3010 ldr r3, [fp, #-16]
44cc: e50b3008 str r3, [fp, #-8]
44d0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
44d4: e50b300c str r3, [fp, #-12]
44d8: ea000007 b 44fc <memmove+0x4c>
44dc: e51b3008 ldr r3, [fp, #-8]
44e0: e2832001 add r2, r3, #1
44e4: e50b2008 str r2, [fp, #-8]
44e8: e51b200c ldr r2, [fp, #-12]
44ec: e2821001 add r1, r2, #1
44f0: e50b100c str r1, [fp, #-12]
44f4: e5d22000 ldrb r2, [r2]
44f8: e5c32000 strb r2, [r3]
44fc: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4500: e2432001 sub r2, r3, #1
4504: e50b2018 str r2, [fp, #-24] ; 0xffffffe8
4508: e3530000 cmp r3, #0
450c: cafffff2 bgt 44dc <memmove+0x2c>
4510: e51b3010 ldr r3, [fp, #-16]
4514: e1a00003 mov r0, r3
4518: e24bd000 sub sp, fp, #0
451c: e49db004 pop {fp} ; (ldr fp, [sp], #4)
4520: e12fff1e bx lr
00004524 <fork>:
4524: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4528: e1a04003 mov r4, r3
452c: e1a03002 mov r3, r2
4530: e1a02001 mov r2, r1
4534: e1a01000 mov r1, r0
4538: e3a00001 mov r0, #1
453c: ef000000 svc 0x00000000
4540: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4544: e12fff1e bx lr
00004548 <exit>:
4548: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
454c: e1a04003 mov r4, r3
4550: e1a03002 mov r3, r2
4554: e1a02001 mov r2, r1
4558: e1a01000 mov r1, r0
455c: e3a00002 mov r0, #2
4560: ef000000 svc 0x00000000
4564: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4568: e12fff1e bx lr
0000456c <wait>:
456c: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4570: e1a04003 mov r4, r3
4574: e1a03002 mov r3, r2
4578: e1a02001 mov r2, r1
457c: e1a01000 mov r1, r0
4580: e3a00003 mov r0, #3
4584: ef000000 svc 0x00000000
4588: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
458c: e12fff1e bx lr
00004590 <pipe>:
4590: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4594: e1a04003 mov r4, r3
4598: e1a03002 mov r3, r2
459c: e1a02001 mov r2, r1
45a0: e1a01000 mov r1, r0
45a4: e3a00004 mov r0, #4
45a8: ef000000 svc 0x00000000
45ac: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
45b0: e12fff1e bx lr
000045b4 <read>:
45b4: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
45b8: e1a04003 mov r4, r3
45bc: e1a03002 mov r3, r2
45c0: e1a02001 mov r2, r1
45c4: e1a01000 mov r1, r0
45c8: e3a00005 mov r0, #5
45cc: ef000000 svc 0x00000000
45d0: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
45d4: e12fff1e bx lr
000045d8 <write>:
45d8: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
45dc: e1a04003 mov r4, r3
45e0: e1a03002 mov r3, r2
45e4: e1a02001 mov r2, r1
45e8: e1a01000 mov r1, r0
45ec: e3a00010 mov r0, #16
45f0: ef000000 svc 0x00000000
45f4: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
45f8: e12fff1e bx lr
000045fc <close>:
45fc: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4600: e1a04003 mov r4, r3
4604: e1a03002 mov r3, r2
4608: e1a02001 mov r2, r1
460c: e1a01000 mov r1, r0
4610: e3a00015 mov r0, #21
4614: ef000000 svc 0x00000000
4618: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
461c: e12fff1e bx lr
00004620 <kill>:
4620: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4624: e1a04003 mov r4, r3
4628: e1a03002 mov r3, r2
462c: e1a02001 mov r2, r1
4630: e1a01000 mov r1, r0
4634: e3a00006 mov r0, #6
4638: ef000000 svc 0x00000000
463c: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4640: e12fff1e bx lr
00004644 <exec>:
4644: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4648: e1a04003 mov r4, r3
464c: e1a03002 mov r3, r2
4650: e1a02001 mov r2, r1
4654: e1a01000 mov r1, r0
4658: e3a00007 mov r0, #7
465c: ef000000 svc 0x00000000
4660: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4664: e12fff1e bx lr
00004668 <open>:
4668: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
466c: e1a04003 mov r4, r3
4670: e1a03002 mov r3, r2
4674: e1a02001 mov r2, r1
4678: e1a01000 mov r1, r0
467c: e3a0000f mov r0, #15
4680: ef000000 svc 0x00000000
4684: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4688: e12fff1e bx lr
0000468c <mknod>:
468c: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4690: e1a04003 mov r4, r3
4694: e1a03002 mov r3, r2
4698: e1a02001 mov r2, r1
469c: e1a01000 mov r1, r0
46a0: e3a00011 mov r0, #17
46a4: ef000000 svc 0x00000000
46a8: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
46ac: e12fff1e bx lr
000046b0 <unlink>:
46b0: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
46b4: e1a04003 mov r4, r3
46b8: e1a03002 mov r3, r2
46bc: e1a02001 mov r2, r1
46c0: e1a01000 mov r1, r0
46c4: e3a00012 mov r0, #18
46c8: ef000000 svc 0x00000000
46cc: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
46d0: e12fff1e bx lr
000046d4 <fstat>:
46d4: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
46d8: e1a04003 mov r4, r3
46dc: e1a03002 mov r3, r2
46e0: e1a02001 mov r2, r1
46e4: e1a01000 mov r1, r0
46e8: e3a00008 mov r0, #8
46ec: ef000000 svc 0x00000000
46f0: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
46f4: e12fff1e bx lr
000046f8 <link>:
46f8: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
46fc: e1a04003 mov r4, r3
4700: e1a03002 mov r3, r2
4704: e1a02001 mov r2, r1
4708: e1a01000 mov r1, r0
470c: e3a00013 mov r0, #19
4710: ef000000 svc 0x00000000
4714: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4718: e12fff1e bx lr
0000471c <mkdir>:
471c: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4720: e1a04003 mov r4, r3
4724: e1a03002 mov r3, r2
4728: e1a02001 mov r2, r1
472c: e1a01000 mov r1, r0
4730: e3a00014 mov r0, #20
4734: ef000000 svc 0x00000000
4738: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
473c: e12fff1e bx lr
00004740 <chdir>:
4740: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4744: e1a04003 mov r4, r3
4748: e1a03002 mov r3, r2
474c: e1a02001 mov r2, r1
4750: e1a01000 mov r1, r0
4754: e3a00009 mov r0, #9
4758: ef000000 svc 0x00000000
475c: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4760: e12fff1e bx lr
00004764 <dup>:
4764: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
4768: e1a04003 mov r4, r3
476c: e1a03002 mov r3, r2
4770: e1a02001 mov r2, r1
4774: e1a01000 mov r1, r0
4778: e3a0000a mov r0, #10
477c: ef000000 svc 0x00000000
4780: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4784: e12fff1e bx lr
00004788 <getpid>:
4788: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
478c: e1a04003 mov r4, r3
4790: e1a03002 mov r3, r2
4794: e1a02001 mov r2, r1
4798: e1a01000 mov r1, r0
479c: e3a0000b mov r0, #11
47a0: ef000000 svc 0x00000000
47a4: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
47a8: e12fff1e bx lr
000047ac <sbrk>:
47ac: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
47b0: e1a04003 mov r4, r3
47b4: e1a03002 mov r3, r2
47b8: e1a02001 mov r2, r1
47bc: e1a01000 mov r1, r0
47c0: e3a0000c mov r0, #12
47c4: ef000000 svc 0x00000000
47c8: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
47cc: e12fff1e bx lr
000047d0 <sleep>:
47d0: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
47d4: e1a04003 mov r4, r3
47d8: e1a03002 mov r3, r2
47dc: e1a02001 mov r2, r1
47e0: e1a01000 mov r1, r0
47e4: e3a0000d mov r0, #13
47e8: ef000000 svc 0x00000000
47ec: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
47f0: e12fff1e bx lr
000047f4 <uptime>:
47f4: e52d4004 push {r4} ; (str r4, [sp, #-4]!)
47f8: e1a04003 mov r4, r3
47fc: e1a03002 mov r3, r2
4800: e1a02001 mov r2, r1
4804: e1a01000 mov r1, r0
4808: e3a0000e mov r0, #14
480c: ef000000 svc 0x00000000
4810: e49d4004 pop {r4} ; (ldr r4, [sp], #4)
4814: e12fff1e bx lr
00004818 <putc>:
4818: e92d4800 push {fp, lr}
481c: e28db004 add fp, sp, #4
4820: e24dd008 sub sp, sp, #8
4824: e50b0008 str r0, [fp, #-8]
4828: e1a03001 mov r3, r1
482c: e54b3009 strb r3, [fp, #-9]
4830: e24b3009 sub r3, fp, #9
4834: e51b0008 ldr r0, [fp, #-8]
4838: e1a01003 mov r1, r3
483c: e3a02001 mov r2, #1
4840: ebffff64 bl 45d8 <write>
4844: e24bd004 sub sp, fp, #4
4848: e8bd8800 pop {fp, pc}
0000484c <printint>:
484c: e92d4810 push {r4, fp, lr}
4850: e28db008 add fp, sp, #8
4854: e24dd034 sub sp, sp, #52 ; 0x34
4858: e50b0030 str r0, [fp, #-48] ; 0xffffffd0
485c: e50b1034 str r1, [fp, #-52] ; 0xffffffcc
4860: e50b2038 str r2, [fp, #-56] ; 0xffffffc8
4864: e50b303c str r3, [fp, #-60] ; 0xffffffc4
4868: e3a03000 mov r3, #0
486c: e50b3014 str r3, [fp, #-20] ; 0xffffffec
4870: e51b303c ldr r3, [fp, #-60] ; 0xffffffc4
4874: e3530000 cmp r3, #0
4878: 0a000008 beq 48a0 <printint+0x54>
487c: e51b3034 ldr r3, [fp, #-52] ; 0xffffffcc
4880: e3530000 cmp r3, #0
4884: aa000005 bge 48a0 <printint+0x54>
4888: e3a03001 mov r3, #1
488c: e50b3014 str r3, [fp, #-20] ; 0xffffffec
4890: e51b3034 ldr r3, [fp, #-52] ; 0xffffffcc
4894: e2633000 rsb r3, r3, #0
4898: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
489c: ea000001 b 48a8 <printint+0x5c>
48a0: e51b3034 ldr r3, [fp, #-52] ; 0xffffffcc
48a4: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
48a8: e3a03000 mov r3, #0
48ac: e50b3010 str r3, [fp, #-16]
48b0: e51b4010 ldr r4, [fp, #-16]
48b4: e2843001 add r3, r4, #1
48b8: e50b3010 str r3, [fp, #-16]
48bc: e51b3038 ldr r3, [fp, #-56] ; 0xffffffc8
48c0: e51b2018 ldr r2, [fp, #-24] ; 0xffffffe8
48c4: e1a00002 mov r0, r2
48c8: e1a01003 mov r1, r3
48cc: eb0001cd bl 5008 <__aeabi_uidivmod>
48d0: e1a03001 mov r3, r1
48d4: e1a02003 mov r2, r3
48d8: e59f3098 ldr r3, [pc, #152] ; 4978 <printint+0x12c>
48dc: e7d32002 ldrb r2, [r3, r2]
48e0: e24b300c sub r3, fp, #12
48e4: e0833004 add r3, r3, r4
48e8: e543201c strb r2, [r3, #-28] ; 0xffffffe4
48ec: e51b3038 ldr r3, [fp, #-56] ; 0xffffffc8
48f0: e51b0018 ldr r0, [fp, #-24] ; 0xffffffe8
48f4: e1a01003 mov r1, r3
48f8: eb000185 bl 4f14 <__aeabi_uidiv>
48fc: e1a03000 mov r3, r0
4900: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
4904: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4908: e3530000 cmp r3, #0
490c: 1affffe7 bne 48b0 <printint+0x64>
4910: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
4914: e3530000 cmp r3, #0
4918: 0a000006 beq 4938 <printint+0xec>
491c: e51b3010 ldr r3, [fp, #-16]
4920: e2832001 add r2, r3, #1
4924: e50b2010 str r2, [fp, #-16]
4928: e24b200c sub r2, fp, #12
492c: e0823003 add r3, r2, r3
4930: e3a0202d mov r2, #45 ; 0x2d
4934: e543201c strb r2, [r3, #-28] ; 0xffffffe4
4938: ea000006 b 4958 <printint+0x10c>
493c: e24b2028 sub r2, fp, #40 ; 0x28
4940: e51b3010 ldr r3, [fp, #-16]
4944: e0823003 add r3, r2, r3
4948: e5d33000 ldrb r3, [r3]
494c: e51b0030 ldr r0, [fp, #-48] ; 0xffffffd0
4950: e1a01003 mov r1, r3
4954: ebffffaf bl 4818 <putc>
4958: e51b3010 ldr r3, [fp, #-16]
495c: e2433001 sub r3, r3, #1
4960: e50b3010 str r3, [fp, #-16]
4964: e51b3010 ldr r3, [fp, #-16]
4968: e3530000 cmp r3, #0
496c: aafffff2 bge 493c <printint+0xf0>
4970: e24bd008 sub sp, fp, #8
4974: e8bd8810 pop {r4, fp, pc}
4978: 000068d0 .word 0x000068d0
0000497c <printf>:
497c: e92d000e push {r1, r2, r3}
4980: e92d4800 push {fp, lr}
4984: e28db004 add fp, sp, #4
4988: e24dd024 sub sp, sp, #36 ; 0x24
498c: e50b0024 str r0, [fp, #-36] ; 0xffffffdc
4990: e3a03000 mov r3, #0
4994: e50b3014 str r3, [fp, #-20] ; 0xffffffec
4998: e28b3008 add r3, fp, #8
499c: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
49a0: e3a03000 mov r3, #0
49a4: e50b3010 str r3, [fp, #-16]
49a8: ea000074 b 4b80 <printf+0x204>
49ac: e59b2004 ldr r2, [fp, #4]
49b0: e51b3010 ldr r3, [fp, #-16]
49b4: e0823003 add r3, r2, r3
49b8: e5d33000 ldrb r3, [r3]
49bc: e50b301c str r3, [fp, #-28] ; 0xffffffe4
49c0: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
49c4: e3530000 cmp r3, #0
49c8: 1a00000b bne 49fc <printf+0x80>
49cc: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
49d0: e3530025 cmp r3, #37 ; 0x25
49d4: 1a000002 bne 49e4 <printf+0x68>
49d8: e3a03025 mov r3, #37 ; 0x25
49dc: e50b3014 str r3, [fp, #-20] ; 0xffffffec
49e0: ea000063 b 4b74 <printf+0x1f8>
49e4: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
49e8: e6ef3073 uxtb r3, r3
49ec: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
49f0: e1a01003 mov r1, r3
49f4: ebffff87 bl 4818 <putc>
49f8: ea00005d b 4b74 <printf+0x1f8>
49fc: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
4a00: e3530025 cmp r3, #37 ; 0x25
4a04: 1a00005a bne 4b74 <printf+0x1f8>
4a08: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4a0c: e3530064 cmp r3, #100 ; 0x64
4a10: 1a00000a bne 4a40 <printf+0xc4>
4a14: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4a18: e5933000 ldr r3, [r3]
4a1c: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4a20: e1a01003 mov r1, r3
4a24: e3a0200a mov r2, #10
4a28: e3a03001 mov r3, #1
4a2c: ebffff86 bl 484c <printint>
4a30: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4a34: e2833004 add r3, r3, #4
4a38: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
4a3c: ea00004a b 4b6c <printf+0x1f0>
4a40: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4a44: e3530078 cmp r3, #120 ; 0x78
4a48: 0a000002 beq 4a58 <printf+0xdc>
4a4c: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4a50: e3530070 cmp r3, #112 ; 0x70
4a54: 1a00000a bne 4a84 <printf+0x108>
4a58: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4a5c: e5933000 ldr r3, [r3]
4a60: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4a64: e1a01003 mov r1, r3
4a68: e3a02010 mov r2, #16
4a6c: e3a03000 mov r3, #0
4a70: ebffff75 bl 484c <printint>
4a74: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4a78: e2833004 add r3, r3, #4
4a7c: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
4a80: ea000039 b 4b6c <printf+0x1f0>
4a84: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4a88: e3530073 cmp r3, #115 ; 0x73
4a8c: 1a000018 bne 4af4 <printf+0x178>
4a90: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4a94: e5933000 ldr r3, [r3]
4a98: e50b300c str r3, [fp, #-12]
4a9c: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4aa0: e2833004 add r3, r3, #4
4aa4: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
4aa8: e51b300c ldr r3, [fp, #-12]
4aac: e3530000 cmp r3, #0
4ab0: 1a000001 bne 4abc <printf+0x140>
4ab4: e59f30ec ldr r3, [pc, #236] ; 4ba8 <printf+0x22c>
4ab8: e50b300c str r3, [fp, #-12]
4abc: ea000007 b 4ae0 <printf+0x164>
4ac0: e51b300c ldr r3, [fp, #-12]
4ac4: e5d33000 ldrb r3, [r3]
4ac8: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4acc: e1a01003 mov r1, r3
4ad0: ebffff50 bl 4818 <putc>
4ad4: e51b300c ldr r3, [fp, #-12]
4ad8: e2833001 add r3, r3, #1
4adc: e50b300c str r3, [fp, #-12]
4ae0: e51b300c ldr r3, [fp, #-12]
4ae4: e5d33000 ldrb r3, [r3]
4ae8: e3530000 cmp r3, #0
4aec: 1afffff3 bne 4ac0 <printf+0x144>
4af0: ea00001d b 4b6c <printf+0x1f0>
4af4: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4af8: e3530063 cmp r3, #99 ; 0x63
4afc: 1a000009 bne 4b28 <printf+0x1ac>
4b00: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4b04: e5933000 ldr r3, [r3]
4b08: e6ef3073 uxtb r3, r3
4b0c: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4b10: e1a01003 mov r1, r3
4b14: ebffff3f bl 4818 <putc>
4b18: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4b1c: e2833004 add r3, r3, #4
4b20: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
4b24: ea000010 b 4b6c <printf+0x1f0>
4b28: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4b2c: e3530025 cmp r3, #37 ; 0x25
4b30: 1a000005 bne 4b4c <printf+0x1d0>
4b34: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4b38: e6ef3073 uxtb r3, r3
4b3c: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4b40: e1a01003 mov r1, r3
4b44: ebffff33 bl 4818 <putc>
4b48: ea000007 b 4b6c <printf+0x1f0>
4b4c: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4b50: e3a01025 mov r1, #37 ; 0x25
4b54: ebffff2f bl 4818 <putc>
4b58: e51b301c ldr r3, [fp, #-28] ; 0xffffffe4
4b5c: e6ef3073 uxtb r3, r3
4b60: e51b0024 ldr r0, [fp, #-36] ; 0xffffffdc
4b64: e1a01003 mov r1, r3
4b68: ebffff2a bl 4818 <putc>
4b6c: e3a03000 mov r3, #0
4b70: e50b3014 str r3, [fp, #-20] ; 0xffffffec
4b74: e51b3010 ldr r3, [fp, #-16]
4b78: e2833001 add r3, r3, #1
4b7c: e50b3010 str r3, [fp, #-16]
4b80: e59b2004 ldr r2, [fp, #4]
4b84: e51b3010 ldr r3, [fp, #-16]
4b88: e0823003 add r3, r2, r3
4b8c: e5d33000 ldrb r3, [r3]
4b90: e3530000 cmp r3, #0
4b94: 1affff84 bne 49ac <printf+0x30>
4b98: e24bd004 sub sp, fp, #4
4b9c: e8bd4800 pop {fp, lr}
4ba0: e28dd00c add sp, sp, #12
4ba4: e12fff1e bx lr
4ba8: 000068ac .word 0x000068ac
00004bac <free>:
4bac: e52db004 push {fp} ; (str fp, [sp, #-4]!)
4bb0: e28db000 add fp, sp, #0
4bb4: e24dd014 sub sp, sp, #20
4bb8: e50b0010 str r0, [fp, #-16]
4bbc: e51b3010 ldr r3, [fp, #-16]
4bc0: e2433008 sub r3, r3, #8
4bc4: e50b300c str r3, [fp, #-12]
4bc8: e59f3150 ldr r3, [pc, #336] ; 4d20 <free+0x174>
4bcc: e5933000 ldr r3, [r3]
4bd0: e50b3008 str r3, [fp, #-8]
4bd4: ea000010 b 4c1c <free+0x70>
4bd8: e51b3008 ldr r3, [fp, #-8]
4bdc: e5932000 ldr r2, [r3]
4be0: e51b3008 ldr r3, [fp, #-8]
4be4: e1520003 cmp r2, r3
4be8: 8a000008 bhi 4c10 <free+0x64>
4bec: e51b200c ldr r2, [fp, #-12]
4bf0: e51b3008 ldr r3, [fp, #-8]
4bf4: e1520003 cmp r2, r3
4bf8: 8a000010 bhi 4c40 <free+0x94>
4bfc: e51b3008 ldr r3, [fp, #-8]
4c00: e5932000 ldr r2, [r3]
4c04: e51b300c ldr r3, [fp, #-12]
4c08: e1520003 cmp r2, r3
4c0c: 8a00000b bhi 4c40 <free+0x94>
4c10: e51b3008 ldr r3, [fp, #-8]
4c14: e5933000 ldr r3, [r3]
4c18: e50b3008 str r3, [fp, #-8]
4c1c: e51b200c ldr r2, [fp, #-12]
4c20: e51b3008 ldr r3, [fp, #-8]
4c24: e1520003 cmp r2, r3
4c28: 9affffea bls 4bd8 <free+0x2c>
4c2c: e51b3008 ldr r3, [fp, #-8]
4c30: e5932000 ldr r2, [r3]
4c34: e51b300c ldr r3, [fp, #-12]
4c38: e1520003 cmp r2, r3
4c3c: 9affffe5 bls 4bd8 <free+0x2c>
4c40: e51b300c ldr r3, [fp, #-12]
4c44: e5933004 ldr r3, [r3, #4]
4c48: e1a03183 lsl r3, r3, #3
4c4c: e51b200c ldr r2, [fp, #-12]
4c50: e0822003 add r2, r2, r3
4c54: e51b3008 ldr r3, [fp, #-8]
4c58: e5933000 ldr r3, [r3]
4c5c: e1520003 cmp r2, r3
4c60: 1a00000d bne 4c9c <free+0xf0>
4c64: e51b300c ldr r3, [fp, #-12]
4c68: e5932004 ldr r2, [r3, #4]
4c6c: e51b3008 ldr r3, [fp, #-8]
4c70: e5933000 ldr r3, [r3]
4c74: e5933004 ldr r3, [r3, #4]
4c78: e0822003 add r2, r2, r3
4c7c: e51b300c ldr r3, [fp, #-12]
4c80: e5832004 str r2, [r3, #4]
4c84: e51b3008 ldr r3, [fp, #-8]
4c88: e5933000 ldr r3, [r3]
4c8c: e5932000 ldr r2, [r3]
4c90: e51b300c ldr r3, [fp, #-12]
4c94: e5832000 str r2, [r3]
4c98: ea000003 b 4cac <free+0x100>
4c9c: e51b3008 ldr r3, [fp, #-8]
4ca0: e5932000 ldr r2, [r3]
4ca4: e51b300c ldr r3, [fp, #-12]
4ca8: e5832000 str r2, [r3]
4cac: e51b3008 ldr r3, [fp, #-8]
4cb0: e5933004 ldr r3, [r3, #4]
4cb4: e1a03183 lsl r3, r3, #3
4cb8: e51b2008 ldr r2, [fp, #-8]
4cbc: e0822003 add r2, r2, r3
4cc0: e51b300c ldr r3, [fp, #-12]
4cc4: e1520003 cmp r2, r3
4cc8: 1a00000b bne 4cfc <free+0x150>
4ccc: e51b3008 ldr r3, [fp, #-8]
4cd0: e5932004 ldr r2, [r3, #4]
4cd4: e51b300c ldr r3, [fp, #-12]
4cd8: e5933004 ldr r3, [r3, #4]
4cdc: e0822003 add r2, r2, r3
4ce0: e51b3008 ldr r3, [fp, #-8]
4ce4: e5832004 str r2, [r3, #4]
4ce8: e51b300c ldr r3, [fp, #-12]
4cec: e5932000 ldr r2, [r3]
4cf0: e51b3008 ldr r3, [fp, #-8]
4cf4: e5832000 str r2, [r3]
4cf8: ea000002 b 4d08 <free+0x15c>
4cfc: e51b3008 ldr r3, [fp, #-8]
4d00: e51b200c ldr r2, [fp, #-12]
4d04: e5832000 str r2, [r3]
4d08: e59f2010 ldr r2, [pc, #16] ; 4d20 <free+0x174>
4d0c: e51b3008 ldr r3, [fp, #-8]
4d10: e5823000 str r3, [r2]
4d14: e24bd000 sub sp, fp, #0
4d18: e49db004 pop {fp} ; (ldr fp, [sp], #4)
4d1c: e12fff1e bx lr
4d20: 0000696c .word 0x0000696c
00004d24 <morecore>:
4d24: e92d4800 push {fp, lr}
4d28: e28db004 add fp, sp, #4
4d2c: e24dd010 sub sp, sp, #16
4d30: e50b0010 str r0, [fp, #-16]
4d34: e51b3010 ldr r3, [fp, #-16]
4d38: e3530a01 cmp r3, #4096 ; 0x1000
4d3c: 2a000001 bcs 4d48 <morecore+0x24>
4d40: e3a03a01 mov r3, #4096 ; 0x1000
4d44: e50b3010 str r3, [fp, #-16]
4d48: e51b3010 ldr r3, [fp, #-16]
4d4c: e1a03183 lsl r3, r3, #3
4d50: e1a00003 mov r0, r3
4d54: ebfffe94 bl 47ac <sbrk>
4d58: e50b0008 str r0, [fp, #-8]
4d5c: e51b3008 ldr r3, [fp, #-8]
4d60: e3730001 cmn r3, #1
4d64: 1a000001 bne 4d70 <morecore+0x4c>
4d68: e3a03000 mov r3, #0
4d6c: ea00000a b 4d9c <morecore+0x78>
4d70: e51b3008 ldr r3, [fp, #-8]
4d74: e50b300c str r3, [fp, #-12]
4d78: e51b300c ldr r3, [fp, #-12]
4d7c: e51b2010 ldr r2, [fp, #-16]
4d80: e5832004 str r2, [r3, #4]
4d84: e51b300c ldr r3, [fp, #-12]
4d88: e2833008 add r3, r3, #8
4d8c: e1a00003 mov r0, r3
4d90: ebffff85 bl 4bac <free>
4d94: e59f300c ldr r3, [pc, #12] ; 4da8 <morecore+0x84>
4d98: e5933000 ldr r3, [r3]
4d9c: e1a00003 mov r0, r3
4da0: e24bd004 sub sp, fp, #4
4da4: e8bd8800 pop {fp, pc}
4da8: 0000696c .word 0x0000696c
00004dac <malloc>:
4dac: e92d4800 push {fp, lr}
4db0: e28db004 add fp, sp, #4
4db4: e24dd018 sub sp, sp, #24
4db8: e50b0018 str r0, [fp, #-24] ; 0xffffffe8
4dbc: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
4dc0: e2833007 add r3, r3, #7
4dc4: e1a031a3 lsr r3, r3, #3
4dc8: e2833001 add r3, r3, #1
4dcc: e50b3010 str r3, [fp, #-16]
4dd0: e59f3134 ldr r3, [pc, #308] ; 4f0c <malloc+0x160>
4dd4: e5933000 ldr r3, [r3]
4dd8: e50b300c str r3, [fp, #-12]
4ddc: e51b300c ldr r3, [fp, #-12]
4de0: e3530000 cmp r3, #0
4de4: 1a00000b bne 4e18 <malloc+0x6c>
4de8: e59f3120 ldr r3, [pc, #288] ; 4f10 <malloc+0x164>
4dec: e50b300c str r3, [fp, #-12]
4df0: e59f2114 ldr r2, [pc, #276] ; 4f0c <malloc+0x160>
4df4: e51b300c ldr r3, [fp, #-12]
4df8: e5823000 str r3, [r2]
4dfc: e59f3108 ldr r3, [pc, #264] ; 4f0c <malloc+0x160>
4e00: e5933000 ldr r3, [r3]
4e04: e59f2104 ldr r2, [pc, #260] ; 4f10 <malloc+0x164>
4e08: e5823000 str r3, [r2]
4e0c: e59f30fc ldr r3, [pc, #252] ; 4f10 <malloc+0x164>
4e10: e3a02000 mov r2, #0
4e14: e5832004 str r2, [r3, #4]
4e18: e51b300c ldr r3, [fp, #-12]
4e1c: e5933000 ldr r3, [r3]
4e20: e50b3008 str r3, [fp, #-8]
4e24: e51b3008 ldr r3, [fp, #-8]
4e28: e5932004 ldr r2, [r3, #4]
4e2c: e51b3010 ldr r3, [fp, #-16]
4e30: e1520003 cmp r2, r3
4e34: 3a00001e bcc 4eb4 <malloc+0x108>
4e38: e51b3008 ldr r3, [fp, #-8]
4e3c: e5932004 ldr r2, [r3, #4]
4e40: e51b3010 ldr r3, [fp, #-16]
4e44: e1520003 cmp r2, r3
4e48: 1a000004 bne 4e60 <malloc+0xb4>
4e4c: e51b3008 ldr r3, [fp, #-8]
4e50: e5932000 ldr r2, [r3]
4e54: e51b300c ldr r3, [fp, #-12]
4e58: e5832000 str r2, [r3]
4e5c: ea00000e b 4e9c <malloc+0xf0>
4e60: e51b3008 ldr r3, [fp, #-8]
4e64: e5932004 ldr r2, [r3, #4]
4e68: e51b3010 ldr r3, [fp, #-16]
4e6c: e0632002 rsb r2, r3, r2
4e70: e51b3008 ldr r3, [fp, #-8]
4e74: e5832004 str r2, [r3, #4]
4e78: e51b3008 ldr r3, [fp, #-8]
4e7c: e5933004 ldr r3, [r3, #4]
4e80: e1a03183 lsl r3, r3, #3
4e84: e51b2008 ldr r2, [fp, #-8]
4e88: e0823003 add r3, r2, r3
4e8c: e50b3008 str r3, [fp, #-8]
4e90: e51b3008 ldr r3, [fp, #-8]
4e94: e51b2010 ldr r2, [fp, #-16]
4e98: e5832004 str r2, [r3, #4]
4e9c: e59f2068 ldr r2, [pc, #104] ; 4f0c <malloc+0x160>
4ea0: e51b300c ldr r3, [fp, #-12]
4ea4: e5823000 str r3, [r2]
4ea8: e51b3008 ldr r3, [fp, #-8]
4eac: e2833008 add r3, r3, #8
4eb0: ea000012 b 4f00 <malloc+0x154>
4eb4: e59f3050 ldr r3, [pc, #80] ; 4f0c <malloc+0x160>
4eb8: e5933000 ldr r3, [r3]
4ebc: e51b2008 ldr r2, [fp, #-8]
4ec0: e1520003 cmp r2, r3
4ec4: 1a000007 bne 4ee8 <malloc+0x13c>
4ec8: e51b0010 ldr r0, [fp, #-16]
4ecc: ebffff94 bl 4d24 <morecore>
4ed0: e50b0008 str r0, [fp, #-8]
4ed4: e51b3008 ldr r3, [fp, #-8]
4ed8: e3530000 cmp r3, #0
4edc: 1a000001 bne 4ee8 <malloc+0x13c>
4ee0: e3a03000 mov r3, #0
4ee4: ea000005 b 4f00 <malloc+0x154>
4ee8: e51b3008 ldr r3, [fp, #-8]
4eec: e50b300c str r3, [fp, #-12]
4ef0: e51b3008 ldr r3, [fp, #-8]
4ef4: e5933000 ldr r3, [r3]
4ef8: e50b3008 str r3, [fp, #-8]
4efc: eaffffc8 b 4e24 <malloc+0x78>
4f00: e1a00003 mov r0, r3
4f04: e24bd004 sub sp, fp, #4
4f08: e8bd8800 pop {fp, pc}
4f0c: 0000696c .word 0x0000696c
4f10: 00006964 .word 0x00006964
00004f14 <__aeabi_uidiv>:
4f14: e2512001 subs r2, r1, #1
4f18: 012fff1e bxeq lr
4f1c: 3a000036 bcc 4ffc <__aeabi_uidiv+0xe8>
4f20: e1500001 cmp r0, r1
4f24: 9a000022 bls 4fb4 <__aeabi_uidiv+0xa0>
4f28: e1110002 tst r1, r2
4f2c: 0a000023 beq 4fc0 <__aeabi_uidiv+0xac>
4f30: e311020e tst r1, #-536870912 ; 0xe0000000
4f34: 01a01181 lsleq r1, r1, #3
4f38: 03a03008 moveq r3, #8
4f3c: 13a03001 movne r3, #1
4f40: e3510201 cmp r1, #268435456 ; 0x10000000
4f44: 31510000 cmpcc r1, r0
4f48: 31a01201 lslcc r1, r1, #4
4f4c: 31a03203 lslcc r3, r3, #4
4f50: 3afffffa bcc 4f40 <__aeabi_uidiv+0x2c>
4f54: e3510102 cmp r1, #-2147483648 ; 0x80000000
4f58: 31510000 cmpcc r1, r0
4f5c: 31a01081 lslcc r1, r1, #1
4f60: 31a03083 lslcc r3, r3, #1
4f64: 3afffffa bcc 4f54 <__aeabi_uidiv+0x40>
4f68: e3a02000 mov r2, #0
4f6c: e1500001 cmp r0, r1
4f70: 20400001 subcs r0, r0, r1
4f74: 21822003 orrcs r2, r2, r3
4f78: e15000a1 cmp r0, r1, lsr #1
4f7c: 204000a1 subcs r0, r0, r1, lsr #1
4f80: 218220a3 orrcs r2, r2, r3, lsr #1
4f84: e1500121 cmp r0, r1, lsr #2
4f88: 20400121 subcs r0, r0, r1, lsr #2
4f8c: 21822123 orrcs r2, r2, r3, lsr #2
4f90: e15001a1 cmp r0, r1, lsr #3
4f94: 204001a1 subcs r0, r0, r1, lsr #3
4f98: 218221a3 orrcs r2, r2, r3, lsr #3
4f9c: e3500000 cmp r0, #0
4fa0: 11b03223 lsrsne r3, r3, #4
4fa4: 11a01221 lsrne r1, r1, #4
4fa8: 1affffef bne 4f6c <__aeabi_uidiv+0x58>
4fac: e1a00002 mov r0, r2
4fb0: e12fff1e bx lr
4fb4: 03a00001 moveq r0, #1
4fb8: 13a00000 movne r0, #0
4fbc: e12fff1e bx lr
4fc0: e3510801 cmp r1, #65536 ; 0x10000
4fc4: 21a01821 lsrcs r1, r1, #16
4fc8: 23a02010 movcs r2, #16
4fcc: 33a02000 movcc r2, #0
4fd0: e3510c01 cmp r1, #256 ; 0x100
4fd4: 21a01421 lsrcs r1, r1, #8
4fd8: 22822008 addcs r2, r2, #8
4fdc: e3510010 cmp r1, #16
4fe0: 21a01221 lsrcs r1, r1, #4
4fe4: 22822004 addcs r2, r2, #4
4fe8: e3510004 cmp r1, #4
4fec: 82822003 addhi r2, r2, #3
4ff0: 908220a1 addls r2, r2, r1, lsr #1
4ff4: e1a00230 lsr r0, r0, r2
4ff8: e12fff1e bx lr
4ffc: e3500000 cmp r0, #0
5000: 13e00000 mvnne r0, #0
5004: ea000007 b 5028 <__aeabi_idiv0>
00005008 <__aeabi_uidivmod>:
5008: e3510000 cmp r1, #0
500c: 0afffffa beq 4ffc <__aeabi_uidiv+0xe8>
5010: e92d4003 push {r0, r1, lr}
5014: ebffffbe bl 4f14 <__aeabi_uidiv>
5018: e8bd4006 pop {r1, r2, lr}
501c: e0030092 mul r3, r2, r0
5020: e0411003 sub r1, r1, r3
5024: e12fff1e bx lr
00005028 <__aeabi_idiv0>:
5028: e12fff1e bx lr
| 39.239826 | 66 | 0.605386 |
d040adf18abfc1ed909277a06c6446e64aff0eb9 | 351 | asm | Assembly | Old Programmes/8085/Multiplication/BOOTH_8.asm | illuminati-inc-2020/school | f22d640abd5505889bcfa9f7880c90a1b6e79635 | [
"CC0-1.0"
] | null | null | null | Old Programmes/8085/Multiplication/BOOTH_8.asm | illuminati-inc-2020/school | f22d640abd5505889bcfa9f7880c90a1b6e79635 | [
"CC0-1.0"
] | null | null | null | Old Programmes/8085/Multiplication/BOOTH_8.asm | illuminati-inc-2020/school | f22d640abd5505889bcfa9f7880c90a1b6e79635 | [
"CC0-1.0"
] | null | null | null | MVI B,00H ;B=0
LDA 00A1H
MOV D,A ;D=multiplicand
MVI E,08H ;E=8
LDA 00A0H
MOV C,A ;C=multiplier
LOOP: ANI 01H
MOV A,B
JZ SHIFT ;if C0=0 shift
ADD D ;else B=B+D and shift
SHIFT: RAR
MOV B,A
MOV A,C
RAR
MOV C,A ;shift right (carry,B,C)
DCR E ;E=E-1
JNZ LOOP ;loop while E<0
STA 00B0H ;B,C=solution
MOV A,B
STA 00B1H
HLT | 16.714286 | 35 | 0.62963 |
cc3ac5dfbb05649afcc0c3694ecf3043548c0d1e | 1,114 | asm | Assembly | ASMFiles/CPU Status Flags.asm | Undeadtaker/Assembly | 34d44d1869eeb27ef957e1e5f28cdf849c6bb610 | [
"Apache-2.0"
] | null | null | null | ASMFiles/CPU Status Flags.asm | Undeadtaker/Assembly | 34d44d1869eeb27ef957e1e5f28cdf849c6bb610 | [
"Apache-2.0"
] | null | null | null | ASMFiles/CPU Status Flags.asm | Undeadtaker/Assembly | 34d44d1869eeb27ef957e1e5f28cdf849c6bb610 | [
"Apache-2.0"
] | null | null | null | ; to generate an overflow of an register and activate the overflow flag (O) in the FR, we have to assign a number that is 11111111 and
; increment it by one. 11111111 = 255 + 1 = 256, which will result in an overflow
.model small
.data
.code
main proc
; mov cl, 255
; add cl, 1
; mov al, 2
; add al, 1 ; should take the Parity flag and set it to 1 since the result of add is 00000011 which is an even number of 1s
;mov al, 8
;add al, 8 ; 8 in binary is 00001000 so adding 8+8 creates a carry over bit from the lower part of the register
; 00001000 + 00001000 = 00010000 and the AC flag should be activated now
mov ax, -32768 ; Since 8086 is a 16 bit register, that means the maximum number we can work with is a range between 2^8 = 65536
add ax, -1 ; which we divide by two because its a signed int, that means 65536/2 = 32768. If we go above 32768 or bellow -32768
; the overflow flag will activate
endp
end main | 44.56 | 138 | 0.603232 |
b396db8075c06bfa0c4b5a8c781e3ac6558db323 | 6,691 | asm | Assembly | EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm | James992927108/uEFI_Edk2_Practice | 2cac7618dfee10bfa5104a2e167c85425fde0100 | [
"BSD-2-Clause"
] | 8 | 2019-06-03T10:47:48.000Z | 2021-08-21T19:11:38.000Z | EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm | James992927108/uEFI_Edk2_Practice | 2cac7618dfee10bfa5104a2e167c85425fde0100 | [
"BSD-2-Clause"
] | null | null | null | EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm | James992927108/uEFI_Edk2_Practice | 2cac7618dfee10bfa5104a2e167c85425fde0100 | [
"BSD-2-Clause"
] | 1 | 2021-04-21T06:20:00.000Z | 2021-04-21T06:20:00.000Z | ;*****************************************************************************
;*
;* Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
;* This program and the accompanying materials
;* are licensed and made available under the terms and conditions of the BSD License
;* which accompanies this distribution. The full text of the license may be found at
;* http://opensource.org/licenses/bsd-license.php
;*
;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;*
;* Module Name:
;*
;* Thunk.asm
;*
;* Abstract:
;*
;* Real mode thunk
;*
;*****************************************************************************
EXTERNDEF mCode16Size:QWORD
.const
mCode16Size DQ _Code16End - _Code16Addr
.data
NullSegSel DQ 0
_16CsSegSel LABEL QWORD
DW -1
DW 0
DB 0
DB 9bh
DB 8fh ; 16-bit segment
DB 0
_16DsSegSel LABEL QWORD
DW -1
DW 0
DB 0
DB 93h
DB 8fh ; 16-bit segment
DB 0
_16Gdtr LABEL FWORD
DW $ - offset NullSegSel - 1
DQ offset NullSegSel
.code
STACK_PARAM_SIZE EQU 16
IA32_REGS STRUC 4t
_EDI DD ?
_ESI DD ?
_EBP DD ?
_ESP DD ?
_EBX DD ?
_EDX DD ?
_ECX DD ?
_EAX DD ?
_DS DW ?
_ES DW ?
_FS DW ?
_GS DW ?
_RFLAGS DQ ?
_EIP DD ?
_CS DW ?
_SS DW ?
IA32_REGS ENDS
_STK16 STRUC 1t
RetEip DD ?
RetCs DW ?
ThunkFlags DW ?
SavedGdtr FWORD ?
Resvd1 DW ?
SavedCr0 DD ?
SavedCr4 DD ?
_STK16 ENDS
_Thunk16 PROC USES rbp rbx rsi rdi r12 r13 r14 r15
push fs
push gs
mov r12d, ds
mov r13d, es
mov r14d, ss
mov r15, rsp
mov rsi, rcx
movzx r10, (IA32_REGS ptr [rsi])._SS
xor rdi, rdi
mov edi, (IA32_REGS ptr [rsi])._ESP
add rdi, - sizeof (IA32_REGS) - sizeof (_STK16)
push rdi
imul rax, r10, 16
add rdi, rax
push sizeof (IA32_REGS) / 4
pop rcx
rep movsd
; copy eflags to stack frame
mov rax, (IA32_REGS ptr [rsi - sizeof(IA32_REGS)])._RFLAGS
mov [rdi - sizeof(IA32_REGS) - STACK_PARAM_SIZE - 8], rax
pop rbx ; rbx <- 16-bit stack offset
lea eax, @F ; return offset
stosd
mov eax, cs ; return segment
stosw
mov eax, edx ; THUNK Flags
stosw
sgdt fword ptr [rsp + 58h] ; save GDTR
mov rax, [rsp + 58h]
stosq
mov rax, cr0 ; save CR0
mov esi, eax ; esi <- CR0 to set
stosd
mov rax, cr4 ; save CR4
stosd
sidt fword ptr [rsp + 58h] ; save IDTR
and esi, 07ffffffeh ; clear PE & PG bits
mov rdi, r10 ; rdi <- 16-bit stack segment
shl r8, 16
push r8 ; far jmp address
lea eax, @16Bit
push rax
mov word ptr [rsp + 4], 8
lgdt _16Gdtr
retf
@16Bit:
DB 66h
mov ecx, 0c0000080h
mov cr0, rsi ; disable PE & PG
rdmsr
and ah, NOT 1
wrmsr ; clear LME bit
mov rax, cr4
and al, NOT 30h ; clear PAE & PSE
mov cr4, rax
retf
@@:
xor rax, rax
mov ax, ss
shl eax, 4
add eax, esp ; rax <- address of 16-bit stack
mov rsp, r15
lidt fword ptr [rsp + 58h] ; restore IDTR
mov ds, r12d
mov es, r13d
mov ss, r14d
pop gs
pop fs
ret
_Thunk16 ENDP
ALIGN 10h
_Code16Addr PROC
_Code16Addr ENDP
RealMode PROC
mov ss, edi
mov sp, bx ; set up 16-bit stack
DB 2eh, 0fh, 1, 1eh
DW _16Idtr - _Code16Addr ; lidt _16Idtr
DB 66h, 61h ; popad
DB 1fh ; pop ds
DB 7 ; pop es
pop fs
pop gs
sub esp, (sizeof(IA32_REGS) - 16) + STACK_PARAM_SIZE + 8
DB 66h, 9Dh ; popfd
add esp, 4 ; skip high part of RFLAGS
DB 67h, 0f7h, 44h, 24h ; test (_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
DB (STACK_PARAM_SIZE + sizeof(IA32_REGS) + 6)
DB 1, 0
jz @F
pushfq ; pushf, actually, when it's INT#
@@:
DB 0eh ; push cs
DB 68h ; push /iw
DW @FarCallRet - _Code16Addr
jz @F
DB 66h
jmp fword ptr [esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
@@:
DB 66h
jmp fword ptr [esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
@FarCallRet:
add esp, (sizeof(IA32_REGS) - 16) + STACK_PARAM_SIZE + 8
DB 66h
push 0 ; push a dword of zero
pushf ; pushfd, actually
push gs
push fs
DB 6 ; push es
DB 1eh ; push ds
DB 66h, 60h ; pushad
cli
DB 66h
lgdt (_STK16 ptr [esp + sizeof(IA32_REGS)]).SavedGdtr
DB 66h
mov eax, (_STK16 ptr [esp + sizeof(IA32_REGS)]).SavedCr4
mov cr4, rax
DB 66h
mov ecx, 0c0000080h
rdmsr
or ah, 1
wrmsr ; set LME
DB 66h
mov eax, (_STK16 ptr [esp + sizeof(IA32_REGS)]).SavedCr0
mov cr0, rax
DB 66h
jmp fword ptr (_STK16 ptr [esp + sizeof(IA32_REGS)]).RetEip
RealMode ENDP
_16Idtr FWORD (1 SHL 10) - 1
_Code16End:
END
| 29.218341 | 121 | 0.427888 |
9c28e93e83fcd24c7cf800af5ca3a356f63f3091 | 7,116 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_21829_1284.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_1284.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_1284.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 %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xb84b, %rsi
lea addresses_normal_ht+0x1125, %rdi
nop
nop
nop
nop
nop
sub %r11, %r11
mov $16, %rcx
rep movsb
nop
nop
nop
and $52803, %rcx
lea addresses_D_ht+0x168b, %r15
nop
nop
add %r13, %r13
movw $0x6162, (%r15)
nop
add $45931, %rdi
lea addresses_WT_ht+0x9a11, %rsi
lea addresses_D_ht+0x1554b, %rdi
nop
nop
nop
nop
dec %rbp
mov $72, %rcx
rep movsl
nop
and $5416, %rax
lea addresses_WC_ht+0xe97b, %rsi
lea addresses_D_ht+0x1a14b, %rdi
nop
sub %r15, %r15
mov $64, %rcx
rep movsq
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_UC_ht+0x876f, %rdi
xor $42833, %r11
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
mfence
lea addresses_A_ht+0x708b, %rcx
nop
nop
nop
nop
nop
add %rbp, %rbp
mov $0x6162636465666768, %rax
movq %rax, %xmm1
and $0xffffffffffffffc0, %rcx
vmovaps %ymm1, (%rcx)
nop
nop
nop
nop
sub %r15, %r15
lea addresses_WC_ht+0x1718b, %r15
nop
nop
nop
nop
cmp $18025, %rdi
movl $0x61626364, (%r15)
nop
nop
nop
nop
xor %rbp, %rbp
lea addresses_D_ht+0xf34b, %rsi
lea addresses_normal_ht+0xe34b, %rdi
nop
sub $49345, %r11
mov $111, %rcx
rep movsw
nop
nop
add %r15, %r15
lea addresses_D_ht+0x10f4b, %rax
nop
nop
nop
add $44938, %r15
movw $0x6162, (%rax)
nop
nop
xor %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %rax
push %rdx
push %rsi
// Load
lea addresses_RW+0x1e34b, %r13
cmp %r11, %r11
mov (%r13), %r10
nop
nop
nop
nop
and %r11, %r11
// Store
lea addresses_WC+0x182a3, %r14
nop
nop
cmp $7002, %rax
mov $0x5152535455565758, %rsi
movq %rsi, (%r14)
// Exception!!!
mov (0), %r14
nop
and %r14, %r14
// Load
lea addresses_normal+0x1db88, %rax
nop
nop
nop
nop
nop
xor %r13, %r13
vmovups (%rax), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r10
nop
xor %r14, %r14
// Faulty Load
lea addresses_RW+0x1334b, %rsi
and $14622, %rax
movntdqa (%rsi), %xmm1
vpextrq $0, %xmm1, %r11
lea oracles, %rax
and $0xff, %r11
shlq $12, %r11
mov (%rax,%r11,1), %r11
pop %rsi
pop %rdx
pop %rax
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, '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
*/
| 34.543689 | 2,999 | 0.657813 |
52a9d2e315f65b3fda465af208b65e3cf3284206 | 2,093 | asm | Assembly | examples/hdd_driver.asm | Commodoreprime/Command-Block-Assembly | b54c2afee3ea7bdfddfe619b9b207ce30d160e45 | [
"MIT"
] | 223 | 2017-05-10T18:27:44.000Z | 2022-03-06T22:44:18.000Z | examples/hdd_driver.asm | Commodoreprime/Command-Block-Assembly | b54c2afee3ea7bdfddfe619b9b207ce30d160e45 | [
"MIT"
] | 25 | 2017-12-07T15:37:37.000Z | 2021-02-05T14:28:59.000Z | examples/hdd_driver.asm | Commodoreprime/Command-Block-Assembly | b54c2afee3ea7bdfddfe619b9b207ce30d160e45 | [
"MIT"
] | 30 | 2017-12-07T15:16:36.000Z | 2022-03-16T03:29:59.000Z | ; Constants
.hdd_addr 0
.hdd_mul 1
.mar 2
.mbr 3
._mem_temp 4
.MEM_SIZE_X #8
.MEM_SIZE_Z #8
.WORD_SIZE #8
; Public functions
; Reads a word (WORD_SIZE) from memory
; Set mar to the address to read
; mbr will contain the value once read
read_mem:
CMD summon armor_stand 100 60 100 {Tags:["hdd_ptr"], NoGravity:1b, Marker:1b}
MOV mar, hdd_addr
MOV #0, mbr
DIV MEM_SIZE_X, hdd_addr
CALL memory_seek
MOV WORD_SIZE, hdd_addr
MOV #1, hdd_mul
; Reads a vertical word from current position
_read_loop:
CMP hdd_addr, #0
JE _finish
TEST execute at @e[tag=hdd_ptr] if block ~ ~ ~ stone
ADD hdd_mul, mbr
SUB #1, hdd_addr
MUL #2, hdd_mul
CMD execute as @e[tag=hdd_ptr] at @s run tp @s ~ ~1 ~
JMP _read_loop
_finish:
CMD kill @e[tag=hdd_ptr]
RET
; Writes a word (WORD_SIZE) to memory
; Set mar to the address to write
; set mbr to the value that will be written
write_mem:
CMD summon armor_stand 100 60 100 {Tags:["hdd_ptr"], NoGravity:1b, Marker:1b}
MOV mar, hdd_addr
DIV MEM_SIZE_X, hdd_addr
CALL memory_seek
MOV WORD_SIZE, hdd_addr
MOV mbr, hdd_mul
_write_loop:
CMP hdd_addr, #0
JE _finish
MOV hdd_mul, _mem_temp
MOD #2, _mem_temp
SUB #1, hdd_addr
DIV #2, hdd_mul
CMP _mem_temp, #0
JE _write_zero
; If not zero, write 1. note: this captures -1 and 1
CMD execute at @e[tag=hdd_ptr] run setblock ~ ~ ~ stone
JMP _continue
_write_zero: CMD execute at @e[tag=hdd_ptr] run setblock ~ ~ ~ air
_continue: CMD execute as @e[tag=hdd_ptr] at @s run tp @s ~ ~1 ~
JMP _write_loop
_finish:
CMD kill @e[tag=hdd_ptr]
RET
; Internal functions
memory_seek:
CMP hdd_addr, #0
JE _seek_z
CMD execute as @e[tag=hdd_ptr] at @s run tp @s ~1 ~ ~
SUB #1, hdd_addr
JMP memory_seek
_seek_z:
MOV mar, hdd_addr
MOD MEM_SIZE_Z, hdd_addr
_seek_z_loop:
CMP hdd_addr, #0
JE _end
SUB #1, hdd_addr
CMD execute as @e[tag=hdd_ptr] at @s run tp @s ~ ~ ~1
JMP _seek_z_loop
_end: RET
| 20.519608 | 81 | 0.648352 |
d072da5fbec5f88f70c4a3ad205c52fd1ecfc847 | 710 | asm | Assembly | oeis/283/A283369.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/283/A283369.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/283/A283369.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A283369: a(n) = Sum_{d|n} d^(4*d + 1).
; Submitted by Jon Maiga
; 1,513,1594324,17179869697,476837158203126,28430288029931296212,3219905755813179726837608,633825300114114700765531472385,202755595904452569706561330874548093,100000000000000000000000000476837158203638,72890483685103052142902866787761839379440139452,75836984583351248111063210627854747804680985471636948,109395050288514219040366056833567359441133418834382438145054,213450921303606651848590460653409581488790305151145083522375563624
add $0,1
mov $1,1
mov $2,$0
lpb $0
mov $3,$2
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
mov $4,$0
sub $0,1
mul $4,4
lpb $4
add $4,1
pow $3,$4
add $1,$3
mod $4,1
lpe
lpe
mov $0,$1
| 28.4 | 431 | 0.771831 |
9d922d375504bd70bee21c8a66e64f3d8acf90cf | 9,510 | asm | Assembly | Boot/boot2.asm | Foltik/Argon | 86aa871ce7b9de4d84db6933ee497e201da29cb9 | [
"MIT"
] | 1 | 2017-06-19T16:03:58.000Z | 2017-06-19T16:03:58.000Z | Boot/boot2.asm | Foltik/Argon | 86aa871ce7b9de4d84db6933ee497e201da29cb9 | [
"MIT"
] | null | null | null | Boot/boot2.asm | Foltik/Argon | 86aa871ce7b9de4d84db6933ee497e201da29cb9 | [
"MIT"
] | null | null | null |
bits 16
org 0x0500
start:
jmp loader;
;******** BIOS Parameter Block ********;
BytesPerSector: dw 512
SectorsPerCluster: db 1
ReservedSectors: dw 1
NumFATs: db 2
RootEntries: dw 224
TotalSectors: dw 2880
MediaDescriptor: db 0xF0
SectorsPerFAT: dw 9
SectorsPerTrack: dw 18
HeadsPerCylinder: dw 2
HiddenSectors: dd 0
LargeSectors: dd 0
DriveNumber: db 0
Unused: db 0
BootSignature: db 0x29
VolumeID: dd 0x13333337
VolumeLabel: db "ARGONFLOPPY"
FileSystem: db "FAT12 "
;******** GLOBAL DESCRIPTOR TABLE ********;
; Definition for the default GDT
gdt:
; null descriptor
dd 0
dd 0
; code
dw 0xFFFF
dw 0x0000
db 0x0
db 10011010b
db 11001111b
db 0x0
; data
dw 0xFFFF
dw 0x0000
db 0x0
db 10010010b
db 11001111b
db 0x0
gdtEnd:
gdtPtr:
dw gdtEnd - gdt - 1
dd gdt
ReadSectors:
; Read sequential sectors from disk and store them in memory
; ax = Starting sector
; es:bx = Location to write
; cx = Number of sectors to read
.begin:
mov di, 3 ; 3 Retries
.loop:
; Convert starting sector into CHS
push ax
push bx
push cx
call LBAtoCHS
; Call bios read disk function
mov ah, 0x2 ; 0x2 = Read Sectors
mov al, 1 ; Read 1 sector
mov ch, byte [absTrack]
mov cl, byte [absSector]
mov dh, byte [absHead]
mov dl, byte [DriveNumber]
int 0x13
jnc .success
; If the read failed, reset the disk and try again for di times,
; displaying a boot error message if tries run out
xor ax, ax
int 0x13
dec di
pop cx
pop bx
pop ax
jnz .loop
int 0x18
.success:
; Increase the offset of the write location and
; increment the starting sector, looping based on count
pop cx
pop bx
pop ax
add bx, word [BytesPerSector]
inc ax
loop .loop
ret
LBAtoCHS:
; Convert an LBA sector to a Cylinder, Head, and Sector
; Turns a linear track number to a multi-dimensional array indexed by Cylinder, Head, and Sector
; ax = LBA sector
push dx
; absSector = sector % SectorsPerTrack
xor dx, dx
div word [SectorsPerTrack] ; store remainder (absSector) in dl, al now contains (sector / SectorsPerTrack)
inc dl ; Sectors start counting at 1
mov byte [absSector], dl
; absHead = (sector / SectorsPerTrack) % NumberOfHeads
; absTrack = sector / (SectorsPerTrack * NumberOfHeads)
xor dx, dx
div word [HeadsPerCylinder] ; store remainder (absHead) in dl, al now contains the track
mov byte [absHead], dl
mov byte [absTrack], al
pop dx
ret
ClusterToLBA:
; Convert a FAT12 cluster number to an LBA sector as an offset from the root directory
; ax = cluster
push dx
; LBA sector = (cluster - 2) * SectorsPerCluster
sub ax, 2
xor dx, dx
mov dl, byte [SectorsPerCluster]
mul dx
add ax, word [RootDirSector]
pop dx
ret
Print:
lodsb
cmp al, 0
je .done
mov ah, 0x0E
int 10h
jmp Print
.done:
ret
startMsg: db "Beginning Stage 2 Bootloader", 0x0D, 0x0A, 0x00
gdtMsg: db "Loading Global Decsriptor Table", 0x0D, 0x0A, 0x00
a20Msg: db "Enabling A20 Gate", 0x0D, 0x0A, 0x00
realMsg: db "Entering Protected Mode", 0x0D, 0x0A, 0x00
rootMsg: db "Loading Root Dir", 0x0D, 0x0A, 0x00
fatMsg: db "Loading FAT", 0x0D, 0x0A, 0x00
searchMsg: db "Searching for KERNEL.SYS", 0x0D, 0x0A, 0x00
loadingMsg: db "Loading into memory", 0x0D, 0x0A, 0x00
successMsg: db "Success! Kernel loaded to memory!", 0x0D, 0x0A, 0x00
failMsg: db "Failed.....", 0x0D, 0x0A, 0x00
RootDirSector: db 0x0000
absTrack: db 0x0000
absHead: db 0x0000
absSector: db 0x0000
kernelName: db "KERNEL SYS"
kernelCluster: db 0x0000
kernelSize: dw 0x0000
;******** ENTRY POINT ********;
loader:
cli
xor ax, ax
mov ds, ax
mov es, ax
mov ax, 0x9000
mov ss, ax
mov sp, 0xFFFF
sti
mov si, startMsg
call Print
;******** LOAD GDT ********;
mov si, gdtMsg
call Print
cli
pusha
lgdt [gdtPtr]
sti
popa
;******** ENABLE A20 GATE ********;
mov si, a20Msg
call Print
.waitIn
in al, 0x64
test al, 10b
jnz .waitIn
; Send 0xD0 to command register
mov al, 0xD0 ; 0xD0 = Read Output Port
out 0x64, al ; Send ^
.waitOut:
in al, 0x64 ; Read Status Register
test al, 1b ; Check output buffer status bit
jnz .waitOut
; Read data port and save
in al, 0x60 ; Read data port
push eax
.waitIn1:
in al, 0x64 ; Read Status Register
test al, 10b ; Check input buffer status bit
jnz .waitIn1
; Send 0xD1 to command register
mov al, 0xD1 ; 0xD1 = Write Output Port
out 0x64, al ; Send ^
.waitIn2:
in al, 0x64 ; Read Status Register
test al, 10b ; Check output buffer status bit
jnz .waitIn2
; Write modified data to data port
pop eax
or al, 10b ; Toggle A20 enable bit
out 0x60, al ; Write to data port
;******** LOAD ROOT DIRECTORY ********;
mov si, rootMsg
call Print
; size = (RootEntries * 32 bytes) / BytesPerSector
mov ax, 32
mul word [RootEntries]
div word [BytesPerSector]
mov cx, ax
xor ax, ax
mov al, byte [NumFATs]
mul word [SectorsPerFAT]
add ax, word [ReservedSectors]
mov word [RootDirSector], ax
add word [RootDirSector], cx
mov bx, 0x7E00
call ReadSectors
;******** LOCATE KERNEL ********;
mov si, searchMsg
call Print
mov cx, word [RootEntries]
mov di, 0x7E00
.loop:
push cx
mov cx, 11 ; filenames are 11 bytes
mov si, kernelName
push di
repe cmpsb
pop di
je LoadFAT
pop cx
add di, 32 ; Increment offset to the next root entry
loop .loop
jmp failure
;******** LOAD FAT ********;
LoadFAT:
mov si, fatMsg
call Print
mov dx, word [di + 0x001C]
mov word [kernelSize], dx ; Store kernel size
mov dx, word [di + 0x001A]
mov word [kernelCluster], dx ; Store kernel first cluster
xor ax, ax
mov al, byte [NumFATs]
mul word [SectorsPerFAT]
mov cx, ax
mov ax, word [ReservedSectors]
mov bx, 0x7C00
call ReadSectors
;******** LOAD KERNEL INTO MEMORY ********;
mov bx, 0x3000
push bx
LoadKernel:
mov si, loadingMsg
call Print
mov ax, word [kernelCluster]
pop bx
call ClusterToLBA
xor cx, cx
mov cl, byte [SectorsPerCluster]
call ReadSectors
push bx
mov ax, word [kernelCluster]
mov cx, ax
mov dx, ax
shr dx, 1
add cx, dx
mov bx, 0x7C00
add bx, cx
mov dx, word [bx]
test ax, 1
jnz .odd
.even:
and dx, 0x0FFF
jmp .done
.odd:
shr dx, 0x4
.done:
mov word [kernelCluster], dx
cmp dx, 0x0FF0
jb LoadKernel
mov si, successMsg
call Print
jmp EnterProtected
failure:
mov si, failMsg
call Print
cli
hlt
;******** ENTER PROTECTED MODE ********;
EnterProtected:
mov esi, realMsg
call Print
cli
mov eax, cr0
or eax, 1 ; Set bit 1 of cr0 to enable protected mode
mov cr0, eax
;jmp 0x8:0x3000 ; Fix CS
;******** COPY KERNEL ********;
CopyKernel:
mov ax, 0x10
mov ds, ax
mov ss, ax
mov es, ax
mov esp, 0x90000
push es
mov eax, dword [kernelSize]
mov ecx, eax
xor ebx, ebx
mov es, ebx
mov esi, 0x3000
mov edi, 0x100000
rep movsb
pop es
jmp 0x8:0x100000
;*********************************** BEGIN 32 BITS ****************************************;
bits 32
posY: db 0x10
posX: db 0x00
kMsg: db "Loading Kernel", 0x0A, 0x00
KernelLoader:
mov ax, 0x10 ; 0x10 = Data Selector
mov ds, ax
mov ss, ax
mov es, ax
mov esp, 0x90000 ; Base of stac
mov si, kMsg
call printstring
cli
hlt
printstring:
.loop:
mov bl, byte [si]
cmp bl, 0
je .done
call printchar
inc si
jmp .loop
.done:
ret
printchar:
; Print char in bl
pusha
;calculate location in memory based on coordinates
mov edi, 0xB8000 ; Address of Video Memory
xor eax, eax
mov ecx, 0xA0 ; 80 columns * 2 bytes
mov al, byte [posY] ; Load Y pos
mul ecx ; y * cols
push eax
mov al, byte [posX] ; Load X pos
mov cl, 0x2
mul cl ; x * 2 bytes
pop ecx ; load y * cols into ecx
add eax, ecx ; add x
xor ecx, ecx
add edi, eax
cmp bl, 0x0A
je .lf
; print the character
mov dl, bl
mov dh, 0x07 ; light gray text on black background attribute
mov word [edi], dx
; update position
inc byte [posX]
cmp byte [posX], 80 ; Check if posX is at the end of the line
je .lf
jmp .cursor
.lf:
inc byte [posY]
mov byte [posX], 0
.cursor:
xor eax, eax
mov ecx, 80
mov al, byte [posY]
mul ecx
add al, byte [posX]
mov ebx, eax
mov dx, 0x03D4
mov al, 0x0F
out dx, al
mov dx, 0x03D5
mov al, bl
out dx, al
xor eax, eax
mov dx, 0x03D4
mov al, 0x0E
out dx, al
mov al, bh
mov dx, 0x03D5
out dx, al
.done:
popa
ret
| 19.608247 | 118 | 0.581388 |
33066f6b1905c408c24dda53a23b0520d5e3a386 | 5,625 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_1665.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_1665.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_1665.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 %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x5184, %rbp
nop
nop
mfence
movw $0x6162, (%rbp)
dec %rdx
lea addresses_WT_ht+0xa767, %rsi
lea addresses_UC_ht+0xad64, %rdi
nop
nop
add $22094, %r10
mov $123, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %r10
lea addresses_WT_ht+0x339c, %rcx
clflush (%rcx)
nop
nop
nop
cmp %rbp, %rbp
movw $0x6162, (%rcx)
nop
nop
nop
nop
nop
dec %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r8
push %r9
push %rbp
push %rdx
// Load
lea addresses_WC+0x12d84, %r9
nop
nop
cmp $60373, %r10
mov (%r9), %rdx
nop
nop
nop
add %r14, %r14
// Store
lea addresses_WC+0x1dd84, %r15
nop
nop
nop
sub $31343, %r8
movl $0x51525354, (%r15)
nop
nop
nop
nop
nop
sub %r14, %r14
// Store
lea addresses_UC+0x5984, %rdx
cmp $57848, %r8
mov $0x5152535455565758, %r14
movq %r14, %xmm3
movaps %xmm3, (%rdx)
nop
nop
xor %r8, %r8
// Store
lea addresses_PSE+0xd2c0, %r15
nop
nop
and %r8, %r8
movw $0x5152, (%r15)
nop
nop
nop
nop
nop
inc %r8
// Faulty Load
mov $0x1d82f60000000584, %rbp
nop
nop
xor $51545, %r14
vmovups (%rbp), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r15
lea oracles, %r9
and $0xff, %r15
shlq $12, %r15
mov (%r9,%r15,1), %r15
pop %rdx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC', 'AVXalign': True, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 2}}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}}
{'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.265306 | 2,999 | 0.656178 |
8a715c99c01e9533c64d2eca0a47c92a8f4ddbed | 123 | asm | Assembly | src/arch/i686/enable_paging.asm | miklhh/os4 | 8fb7d926bb44a498ac50a4fd0dc2c1c8e0941d74 | [
"MIT"
] | 3 | 2017-08-23T12:56:09.000Z | 2017-10-30T13:42:16.000Z | src/arch/i686/enable_paging.asm | miklhh/os4 | 8fb7d926bb44a498ac50a4fd0dc2c1c8e0941d74 | [
"MIT"
] | null | null | null | src/arch/i686/enable_paging.asm | miklhh/os4 | 8fb7d926bb44a498ac50a4fd0dc2c1c8e0941d74 | [
"MIT"
] | null | null | null | global enable_paging
enable_paging:
push ebp
mov ebp, esp
mov eax, cr0
or eax, 0x80000000
mov cr0, eax
pop ebp
ret
| 12.3 | 20 | 0.731707 |
b236ea92600374b63d4f688bad0895fb6175adea | 552 | asm | Assembly | oeis/010/A010993.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/010/A010993.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/010/A010993.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A010993: Binomial coefficient C(n,40).
; 1,41,861,12341,135751,1221759,9366819,62891499,377348994,2054455634,10272278170,47626016970,206379406870,841392966470,3245372870670,11899700525790,41648951840265,139646485582065,449972009097765,1397281501935165,4191844505805495,12176310231149295,34315056105966195,93993414551124795,250649105469666120,651687674221131912,1654284096099796392,4105075349580976232,9969468706125227992,23720460024918645912,55347740058143507128,126764178842844806648,285219402396400814958,630939890149613923998
add $0,40
bin $0,40
| 92 | 489 | 0.898551 |
f1185022a87ca6a6683ea08e07f36dc8f0bc0683 | 7,561 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_918.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_918.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_918.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 %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x15aef, %r10
clflush (%r10)
dec %rbx
mov (%r10), %r14
nop
nop
nop
nop
and $5237, %rcx
lea addresses_normal_ht+0xad5, %r11
nop
xor %r9, %r9
movb (%r11), %r12b
nop
nop
nop
and $8328, %r9
lea addresses_WC_ht+0x8a5b, %rsi
lea addresses_WT_ht+0x1307, %rdi
nop
add %r11, %r11
mov $24, %rcx
rep movsb
nop
xor %r10, %r10
lea addresses_WT_ht+0x11f47, %r12
nop
nop
nop
nop
sub %r11, %r11
movb (%r12), %r9b
nop
and %r14, %r14
lea addresses_A_ht+0x10007, %r11
nop
sub %r12, %r12
mov (%r11), %ecx
nop
nop
nop
inc %r14
lea addresses_WC_ht+0x5347, %r14
sub %r11, %r11
mov $0x6162636465666768, %r9
movq %r9, %xmm6
movups %xmm6, (%r14)
nop
nop
nop
nop
sub %r10, %r10
lea addresses_D_ht+0x3a47, %rsi
lea addresses_A_ht+0xab67, %rdi
nop
nop
nop
add $1013, %rbx
mov $25, %rcx
rep movsw
dec %rdi
lea addresses_D_ht+0x17347, %rsi
nop
nop
cmp $34561, %r11
vmovups (%rsi), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rcx
nop
nop
xor $7120, %r11
lea addresses_A_ht+0x188c7, %r10
nop
sub $43599, %rcx
movw $0x6162, (%r10)
nop
nop
nop
dec %r9
lea addresses_WC_ht+0x1e9af, %rcx
nop
add $25092, %rbx
movups (%rcx), %xmm5
vpextrq $0, %xmm5, %r9
nop
nop
nop
nop
add $63007, %rdi
lea addresses_WC_ht+0x6f87, %rdi
nop
nop
dec %r14
mov (%rdi), %ecx
nop
nop
xor $14815, %r9
lea addresses_WT_ht+0x173ed, %rsi
lea addresses_D_ht+0x12947, %rdi
nop
nop
nop
nop
xor %rbx, %rbx
mov $94, %rcx
rep movsw
nop
nop
nop
nop
cmp $17877, %r11
lea addresses_D_ht+0xc7, %r11
nop
nop
nop
nop
nop
dec %rcx
movl $0x61626364, (%r11)
nop
cmp %r12, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r14
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r9
push %rbp
push %rbx
push %rdx
// Load
lea addresses_WC+0x10107, %rdx
nop
nop
nop
nop
nop
sub %r9, %r9
mov (%rdx), %r10
sub $27169, %rbp
// Store
lea addresses_WC+0x2b47, %r9
nop
nop
add %r13, %r13
movb $0x51, (%r9)
nop
nop
nop
nop
inc %r11
// Faulty Load
lea addresses_normal+0x4f47, %r10
add $6182, %r13
mov (%r10), %r11w
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rdx
pop %rbx
pop %rbp
pop %r9
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 34.525114 | 2,999 | 0.652427 |
6c75477d46d0ea01fca0bde7b068863d26fe8830 | 646 | asm | Assembly | oeis/007/A007339.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/007/A007339.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/007/A007339.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A007339: a(n) = n! - n^3.
; 1,0,-6,-21,-40,-5,504,4697,39808,362151,3627800,39915469,478999872,6227018603,87178288456,1307674364625,20922789883904,355687428091087,6402373705722168,121645100408825141,2432902008176632000,51090942171709430739,1124000727777607669352,25852016738884976627833,620448401733239439346176,15511210043330985983984375,403291461126605635583982424,10888869450418352160767980317,304888344611713860501503978048,8841761993739701954543615975611,265252859812191058636308479973000
mov $1,$0
seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
pow $1,3
sub $0,$1
| 80.75 | 467 | 0.837461 |
d58634a213f049675755e8c6d7c5d61365267f53 | 1,233 | asm | Assembly | programs/oeis/076/A076627.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/076/A076627.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/076/A076627.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A076627: a(n) = tau(n)*(n-tau(n)), where tau(n) = number of divisors of n (A000005).
; 0,0,2,3,6,8,10,16,18,24,18,36,22,40,44,55,30,72,34,84,68,72,42,128,66,88,92,132,54,176,58,156,116,120,124,243,70,136,140,256,78,272,82,228,234,168,90,380,138,264,188,276,102,368,204,384,212,216,114,576,118,232,342,399,244,464,130,372,260,496,138,720,142,280,414,420,292,560,154,700,380,312,162,864,324,328,332,640,174,936,348,516,356,360,364,1008,190,552,558,819,198,752,202,768,776,408,210,1152,214,816,428,1020,222,848,444,660,666,456,460,1664,354,472,476,708,484,1368,250,960,500,976,258,1440,516,520,1016,1024,270,1040,274,1536,548,552,556,1935,564,568,846,852,294,1656,298,1152,882,1168,604,1728,310,616,620,1776,628,1520,322,948,1256,648,330,2432,498,1296,990,996,342,1328,1014,1660,692,696,354,2916,358,1392,716,1408,724,1424,732,1092,1448,1456,378,2492,382,760,1496,1683,390,2232,394,2256,788,792,796,2304,804,808,1206,1980,820,3104,418,1236,836,840,844,3200,852,856,860,2496,868,1712,442,2544,1944,888,450,2592,454,1776,1784,1792,462,2664,924,1380,932,1840,474,4400,478,1416,1422,1428,1434,1904,972,1920,980,1936
mov $1,$0
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
sub $1,$0
mul $1,$0
add $1,$0
| 137 | 1,023 | 0.728305 |
d73ee6b3442afa4ea1bd30f59c591dbfbf856c04 | 231 | asm | Assembly | libsrc/_DEVELOPMENT/z180/c/sdcc/z180_delay_tstate.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/z180/c/sdcc/z180_delay_tstate.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/z180/c/sdcc/z180_delay_tstate.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void z180_delay_tstate(uint tstates)
SECTION code_clib
SECTION code_z180
PUBLIC _z180_delay_tstate
EXTERN asm_z180_delay_tstate
_z180_delay_tstate:
pop af
pop hl
push hl
push af
jp asm_z180_delay_tstate
| 11.55 | 38 | 0.770563 |
c48a960748bc142130f3af624b1b9b0fe5ae1251 | 2,158 | asm | Assembly | dino/lcs/base/740.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/base/740.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/base/740.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
004D20 move.l D0, (A4)+
004D22 move.l D0, (A4)+
020402 clr.l ($740,A5)
020406 clr.l ($744,A5) [base+740, base+742]
0206DA move.b ($4,A6), D0
0206DE move.w ($6,PC,D0.w), D1 [base+740]
0206EA addq.b #2, ($4,A6)
0206EE move.b #$1, ($71,A6) [base+740]
02239E move.b ($4,A6), D0
0223A2 move.w ($6,PC,D0.w), D1 [base+740]
0223AE addq.b #2, ($4,A6)
0223B2 jsr $8a44.l [base+740]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 71.933333 | 350 | 0.65431 |
f79f5540b829abd26d5c5cbbfa65732644e5bef8 | 430 | asm | Assembly | programs/oeis/216/A216114.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/216/A216114.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/216/A216114.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A216114: The Wiener index of a link of n fullerenes C_{20} (see the Ghorbani and Hosseinzadeh reference).
; 500,3400,9900,21200,38500,63000,95900,138400,191700,257000,335500,428400,536900,662200,805500,968000,1150900,1355400,1582700,1834000,2110500,2413400,2743900,3103200,3492500,3913000,4365900,4852400,5373700,5931000
add $0,3
mov $1,2
sub $1,$0
bin $0,3
mul $0,2
add $0,$1
mov $2,$0
mul $2,6
add $1,$2
mul $1,100
mov $0,$1
| 28.666667 | 214 | 0.751163 |
4b33d25e382e0614f33470861d1809a9fc307783 | 191 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_1.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_1.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_1.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_1
_bfx_1:
; Shot_2
defb 2 ;noise
defw 20,50,257
defb 0
| 11.235294 | 30 | 0.717277 |
f1490c370b4e6104f42faeda6b4ab37768869b93 | 402 | asm | Assembly | Asm4Kids/19indexingloop.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | 17 | 2017-04-18T14:00:14.000Z | 2021-06-07T18:57:02.000Z | Asm4Kids/19indexingloop.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | null | null | null | Asm4Kids/19indexingloop.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | 3 | 2018-04-09T14:34:40.000Z | 2021-04-06T17:02:28.000Z | ; example of indexed addressing and a loop
; 10 SYS (49152)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $34, $39, $31, $35, $32, $29, $00, $00, $00
*=$c000
jsr $e544
ldx #0
ldy #1
start tya
sta 55296,x
txa
sta 1024,x
inx
cpx #255
bne start
rts
| 19.142857 | 96 | 0.375622 |
2851f52fc64d3c571dbc94f7de357560e8be3c93 | 1,205 | asm | Assembly | Assembly/keyboard/monster_search_toUpper.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 14 | 2015-01-15T19:08:06.000Z | 2021-09-27T17:27:22.000Z | Assembly/keyboard/monster_search_toUpper.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 5 | 2015-01-13T21:19:45.000Z | 2015-04-12T15:51:18.000Z | Assembly/keyboard/monster_search_toUpper.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 7 | 2015-02-02T20:14:00.000Z | 2017-05-14T07:58:12.000Z | ;;----------------------------------------------------------------------------;;
;; Char to upper case for familar wiki search function.
;; Copyright 2015 Benito Palacios (aka pleonex)
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
;;----------------------------------------------------------------------------;;
.org 0x020CBE78
.area 0x64
@toUpper:
; Alphabet
CMP R1, 'z'
BGT @accents
CMP R1, 'a'
SUBGE R1, #0x20
; Accents
@accents:
CMP R1, #0xAC ; 'ú'
BGT @specialChars
CMP R1, #0xA8 ; 'á'
SUBGE R1, #0x05
@specialChars:
CMP R1, #0xAD ; 'ñ'
ADDEQ R1, #1
CMP R1, #0xAF ; 'ü'
ADDEQ R1, #1
@end:
BX LR
.endarea
| 27.386364 | 80 | 0.570124 |
d67d4d9649cbd8690ca2278f9f6796eb6c688afa | 565 | asm | Assembly | oeis/241/A241888.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/241/A241888.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/241/A241888.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A241888: a(n) = 2^(4*n + 1) - 1.
; 1,31,511,8191,131071,2097151,33554431,536870911,8589934591,137438953471,2199023255551,35184372088831,562949953421311,9007199254740991,144115188075855871,2305843009213693951,36893488147419103231,590295810358705651711,9444732965739290427391,151115727451828646838271,2417851639229258349412351,38685626227668133590597631,618970019642690137449562111,9903520314283042199192993791,158456325028528675187087900671,2535301200456458802993406410751,40564819207303340847894502572031
mov $1,16
pow $1,$0
sub $1,1
mul $1,2
add $1,1
mov $0,$1
| 56.5 | 471 | 0.863717 |
c653e92bc9042551f7b7fbf35bb872558eadd40a | 860 | asm | Assembly | programs/oeis/140/A140833.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/140/A140833.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/140/A140833.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A140833: Sum of Fibonacci numbers between F(-n)....F(n), inclusive.
; 0,2,2,6,6,16,16,42,42,110,110,288,288,754,754,1974,1974,5168,5168,13530,13530,35422,35422,92736,92736,242786,242786,635622,635622,1664080,1664080,4356618,4356618,11405774,11405774,29860704,29860704,78176338,78176338,204668310,204668310,535828592,535828592,1402817466,1402817466,3672623806,3672623806,9615053952,9615053952,25172538050,25172538050,65902560198,65902560198,172535142544,172535142544,451702867434,451702867434,1182573459758,1182573459758,3096017511840,3096017511840,8105479075762,8105479075762,21220419715446,21220419715446,55555780070576,55555780070576,145446920496282,145446920496282,380784981418270,380784981418270,996908023758528,996908023758528,2609939089857314,2609939089857314,6832909245813414,6832909245813414
mov $2,2
lpb $0,1
trn $0,2
add $1,$2
add $2,$1
lpe
| 86 | 731 | 0.847674 |
758202090de98161e7e3b08409f8d7a534bdaa35 | 810 | asm | Assembly | programs/oeis/231/A231688.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/231/A231688.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/231/A231688.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A231688: a(n) = Sum_{i=0..n} digsum(i)^3, where digsum(i) = A007953(i).
; 0,1,9,36,100,225,441,784,1296,2025,2026,2034,2061,2125,2250,2466,2809,3321,4050,5050,5058,5085,5149,5274,5490,5833,6345,7074,8074,9405,9432,9496,9621,9837,10180,10692,11421,12421,13752,15480,15544,15669,15885,16228,16740,17469,18469,19800,21528,23725,23850,24066,24409,24921,25650,26650,27981,29709,31906,34650,34866,35209,35721,36450,37450,38781,40509,42706,45450,48825,49168,49680,50409,51409,52740,54468,56665,59409,62784,66880,67392,68121,69121,70452,72180,74377,77121,80496,84592,89505,90234,91234,92565,94293,96490,99234,102609,106705,111618,117450
mov $2,$0
mov $3,$0
lpb $3
mov $0,$2
sub $3,1
sub $0,$3
seq $0,7953 ; Digital sum (i.e., sum of digits) of n; also called digsum(n).
pow $0,3
add $1,$0
lpe
mov $0,$1
| 54 | 556 | 0.737037 |
2195e9700a7d408ae67dae6ec51702102f16e5ac | 61 | asm | Assembly | data/maps/headers/SSAnneBow.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/headers/SSAnneBow.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/headers/SSAnneBow.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null |
map_header SSAnneBow, SS_ANNE_BOW, SHIP, 0
end_map_header
| 15.25 | 43 | 0.803279 |
868556bdd1667c93d68bf46ac2fa06b16dacda14 | 646 | asm | Assembly | mobile/news/news.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | mobile/news/news.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | mobile/news/news.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | ; http://forums.glitchcity.info/index.php?topic=7509.msg206449#msg206449
db $cc, $6b, $1e ; unused
Unreferenced_Function1f4003:
ld a, $6
call GetSRAMBank
ld hl, .news_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.news_data
INCBIN "mobile/news/news_1.bin"
Unreferenced_Function1f4dbe:
ld a, $6
call GetSRAMBank
ld hl, .news_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.news_data
INCBIN "mobile/news/news_2.bin"
Function1f5d9f:
ld a, $6
call GetSRAMBank
ld hl, .news_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.news_data
INCBIN "mobile/news/news_3.bin"
| 15.023256 | 72 | 0.733746 |
f002dfacb6715ec266738f7849175bc4754df234 | 1,662 | asm | Assembly | stackman/platforms/switch_arm_msvc.asm | kristjanvalur/stackman | fa40e7ec7cda3ad0b2d78557368f712dbd89fd64 | [
"Apache-2.0"
] | 4 | 2020-01-05T05:15:02.000Z | 2020-06-26T22:21:27.000Z | stackman/platforms/switch_arm_msvc.asm | stackless-dev/stackman | dbc72fe5207a2055e658c819fdeab9731dee78b9 | [
"Apache-2.0"
] | 3 | 2021-04-05T11:21:01.000Z | 2021-07-25T20:59:17.000Z | stackman/platforms/switch_arm_msvc.asm | kristjanvalur/stackman | fa40e7ec7cda3ad0b2d78557368f712dbd89fd64 | [
"Apache-2.0"
] | 1 | 2021-02-22T17:09:33.000Z | 2021-02-22T17:09:33.000Z |
; this code is adopted from the switch_arm_gcc.S
; which again was generated from switch_arm_gcc.h
THUMB
EXPORT |stackman_switch|
ALIGN
|stackman_switch| PROC
push {r4 - r10, fp, lr} ;9 x 4bytes
add fp, sp, #28 ; (4x7) fp must point to the previous fp on the stack
; also push floating point registers and fpscr (status&control register)
vpush {q4-q7}
vmrs r2,fpscr
push {r2} ;5 x 4bytes
; total of 14 words pushed, satisfying 8 byte stack alignment.
; args are r0=callback, r1=context
; shuffle calling arguments into r0, r1 and r2
; for the call to the callback.
mov r3, r0
mov r0, r1 ;context
mov r2, sp ;stack pointer
mov r1, #0 ;operation
mov r5, r0 ;store these a bit
mov r4, r3
blx r3 ;first callback
mov r2, r0 ;store new stackpointer in register, for next cb,
; switch stack pointer, maintaing fp offset
sub r1, sp, r0
mov sp, r0 ;switch stack pointer
sub fp, fp, r1
mov r1, #1 ;operation
mov r0, r5 ;context
blx r4 ;second callback
; pop and return
pop {r2}
vmsr fpscr, r2
vpop {q4, q5, q6, q7}
pop {r4-r9, r10, fp, pc}
ENDP
EXPORT |stackman_call|
ALIGN
|stackman_call| PROC
; args are r0 = callback, r1 = context, r2=stack
push {r4, fp, lr}
add fp, sp, #4 ;fp must always point to the last fp (r11)
mov r3, r0
mov r0, r1 ;context
mov r1, r2 ;stack
; store current sp in nv register
mov r4, sp
mov r2, sp ; old stack
; change stack if non-zero
cmp r1, #0
beq nullptr
mov sp, r1
nullptr
mov r1, #2 ; callback opcode
blx r3 ; call callback, with context, opcode, old stack
; restore stack (could do: sub sp, fp #12)
mov sp, r4
; return
pop {r4, fp, pc}
ENDP
END
| 22.767123 | 73 | 0.679904 |
60d587413b89d4ebf0a976b8731bf101b2657e52 | 714 | asm | Assembly | oeis/231/A231530.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/231/A231530.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/231/A231530.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A231530: Real part of Product_{k=1..n} (k+i), where i is the imaginary unit.
; Submitted by Jon Maiga
; 1,1,1,0,-10,-90,-730,-6160,-55900,-549900,-5864300,-67610400,-839594600,-11186357000,-159300557000,-2416003824000,-38894192662000,-662595375078000,-11911522255750000,-225382826562400000,-4477959179352100000,-93217812901913700000,-2029107997508660900000,-46099220630461596000000,-1091236130952104735000000,-26871320112876791123000000,-687323507780698783163000000,-18236262195959447917368000000,-501248260097859523746250000000,-14255685001749826238402370000000,-419034380100842029071397330000000
mov $2,1
lpb $0
mov $1,$0
sub $0,1
mov $4,$3
mul $3,$1
add $3,$2
mul $2,$1
sub $2,$4
lpe
mov $0,$2
| 44.625 | 495 | 0.785714 |
53e2cbd81dd55133f53a0aecfe45c5515fa5e38e | 896 | asm | Assembly | book-01/Assembly/asm/core/array/core_array_reverse.asm | gfurtadoalmeida/study-assembly-x64 | 4acdefb015d44706c60bd7ea5d94f726c4dbcbb4 | [
"MIT"
] | 2 | 2021-02-27T04:50:26.000Z | 2022-03-15T23:27:12.000Z | book-01/Assembly/asm/core/array/core_array_reverse.asm | gfurtadoalmeida/study-assembly-x64 | 4acdefb015d44706c60bd7ea5d94f726c4dbcbb4 | [
"MIT"
] | null | null | null | book-01/Assembly/asm/core/array/core_array_reverse.asm | gfurtadoalmeida/study-assembly-x64 | 4acdefb015d44706c60bd7ea5d94f726c4dbcbb4 | [
"MIT"
] | null | null | null | .code
; void Core_Array_Reverse_(const int* source, const int* destination, int arrayLength)
Core_Array_Reverse_ proc frame
; Prolog
push rsi
.pushreg rsi
push rdi
.pushreg rdi
.endprolog
test r8d, r8d
jle InvalidLength
mov rsi, rcx ; Source
mov rdi, rdx ; Destination
mov ecx, r8d ; Array length
lea rsi, [rsi+rcx*type dword-type dword] ; rsi = rsi[length-1]
pushfq ; Save eflags registers on stack
std ; Set direction flag (EFLAGS.DT) to 1 (decrement/down)
; Copy the source array to destination array in reverse order
@@:
lodsd ; eax = source address, rsi = rsi + sizeof(int)
mov dword ptr [rdi], eax ; Destination address value = eax
add rdi, type dword ; Destination address = destination address + sizeof(int)
dec rcx
jnz @B ; While rcx > 0
; Restore EFLAGS
popfq
InvalidLength:
; epilog
pop rdi
pop rsi
ret
Core_Array_Reverse_ endp
end | 19.911111 | 86 | 0.709821 |
34ba0a61a086d0ec88913f0f3c95633eed0f9807 | 5,615 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_84_325.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_84_325.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_84_325.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 %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0xaa3a, %rsi
lea addresses_UC_ht+0xaf52, %rdi
nop
nop
nop
nop
xor $24000, %r9
mov $61, %rcx
rep movsb
inc %rax
lea addresses_WT_ht+0x19940, %r15
nop
nop
nop
add $32556, %rbp
movw $0x6162, (%r15)
nop
nop
cmp $28761, %r15
lea addresses_D_ht+0x9c7a, %rax
nop
nop
nop
dec %rsi
movups (%rax), %xmm2
vpextrq $1, %xmm2, %rcx
nop
nop
nop
xor $312, %rsi
lea addresses_D_ht+0x927a, %rbp
nop
nop
nop
add $46665, %rdi
mov $0x6162636465666768, %r9
movq %r9, (%rbp)
nop
cmp $62871, %rdi
lea addresses_normal_ht+0x4c7a, %rax
nop
add $52028, %rdi
mov $0x6162636465666768, %r9
movq %r9, (%rax)
nop
nop
nop
nop
and $12769, %rbp
lea addresses_A_ht+0x17c62, %rsi
lea addresses_WT_ht+0x1a87a, %rdi
nop
nop
nop
nop
dec %r15
mov $108, %rcx
rep movsq
nop
nop
nop
nop
nop
add $7396, %rax
lea addresses_normal_ht+0x13e7a, %rsi
lea addresses_A_ht+0x1947a, %rdi
nop
nop
nop
nop
and $27703, %r12
mov $20, %rcx
rep movsw
nop
nop
nop
nop
and $37242, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %rax
push %rbp
push %rcx
// Store
lea addresses_normal+0x1fc7a, %rax
nop
xor %r8, %r8
mov $0x5152535455565758, %r13
movq %r13, (%rax)
nop
nop
nop
nop
add %rcx, %rcx
// Store
lea addresses_UC+0x1b0ea, %r8
nop
nop
dec %r14
mov $0x5152535455565758, %r13
movq %r13, (%r8)
// Exception!!!
nop
nop
nop
nop
nop
mov (0), %r14
nop
nop
nop
nop
add $15512, %rax
// Store
lea addresses_UC+0x1ba1a, %r15
nop
nop
nop
nop
nop
xor $4309, %r8
movl $0x51525354, (%r15)
nop
nop
xor %rbp, %rbp
// Store
lea addresses_normal+0x1407a, %rax
nop
nop
nop
xor $23348, %r15
movl $0x51525354, (%rax)
nop
nop
and $19310, %r15
// Store
lea addresses_US+0x16c5a, %r13
nop
and $36659, %rcx
mov $0x5152535455565758, %rax
movq %rax, (%r13)
nop
nop
dec %rax
// Store
lea addresses_RW+0x1f8ae, %r8
nop
nop
and $58659, %rax
movl $0x51525354, (%r8)
nop
nop
nop
nop
and %rbp, %rbp
// Store
lea addresses_UC+0x1102e, %r13
nop
cmp $34977, %rcx
mov $0x5152535455565758, %r8
movq %r8, %xmm4
movups %xmm4, (%r13)
nop
nop
nop
cmp $25924, %rbp
// Store
mov $0x3ea, %r13
nop
nop
cmp %rcx, %rcx
mov $0x5152535455565758, %rax
movq %rax, (%r13)
nop
nop
nop
nop
nop
and %rbp, %rbp
// Store
lea addresses_A+0x12da2, %r14
nop
nop
and $63056, %r8
movb $0x51, (%r14)
and $49729, %r14
// Store
lea addresses_A+0xee3a, %r13
nop
nop
add $39212, %r15
movl $0x51525354, (%r13)
sub $47642, %r8
// Faulty Load
lea addresses_normal+0x1fc7a, %r14
add %r8, %r8
vmovups (%r14), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rbp
lea oracles, %r13
and $0xff, %rbp
shlq $12, %rbp
mov (%r13,%rbp,1), %rbp
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}}
{'34': 84}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 20.344203 | 251 | 0.647195 |
214a8364dcd651ef7a8ab1829b4a0bfb75515760 | 8,400 | asm | Assembly | untested/ARM/arith64.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/ARM/arith64.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/ARM/arith64.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null |
code32
format ELF
public _add64
public _sub64
public _mul64
public _isEqual64
public _isGreater64
public _divide64
public _modulo64
public _getVal64
public _getOpposite64
public _getComplement64
public _shiftLeft64
public _shiftRight64
public _rol64
public _ror64
section '.text' executable align 16
_add64:
adds r0, r2
adc r1, r3
bx lr
_sub64:
subs r0, r2
sbc r1, r3
bx lr
_mul64:
push {r4, r5, r6, r7, r8, lr}
mov r6, #0x10000
sub r6, #1
and lr, r0, r6
and r4, r2, r6
mul ip, r4, lr
lsr r8, r0, #16
mul r5, r8, r4
add r5, ip, lsr #16
and ip, r6
add ip, r5, lsl #16
lsr r7, r2, #16
mul r4, r7, lr
add r4, ip, lsr #16
and ip, r6
mul lr, r7, r8
add lr, r5, lsr #16
add lr, r4, lsr #16
mla r5, r0, r3, lr
add r0, ip, r4, lsl #16
mla r1, r2, r1, r5
pop {r4, r5, r6, r7, r8, pc}
_isEqual64:
cmp r1, r3
cmpeq r0, r2
moveq r0, #1
movne r0, #0
bx lr
_isGreater64:
cmp r2, r0
sbcs r3, r1
movlt r0, #1
movge r0, #0
bx lr
ctz32:
lsl r3, r0, #16
lsr r3, r3, #16
cmp r3, #0
lsreq r0, #16
moveq r3, #24
moveq r1, #16
movne r3, #8
movne r1, #0
tst r0, #255
lsreq r0, #8
moveq r1, r3
tst r0, #15
lsreq r0, #4
addeq r1, #4
tst r0, #3
lsreq r0, #2
addeq r1, #2
lsr r2, r0, #1
and r2, #1
rsb r2, #2
mvn r3, r0
ands r3, #1
mvnne r3, #0
and r3, r2
add r0, r3, r1
bx lr
clz32:
lsr r3, r0, #16
lsl r3, #16
cmp r3, #0
lsrne r0, #16
movne r2, #8
movne r3, #0
moveq r2, #24
moveq r3, #16
tst r0, #0xFF00
lsrne r0, #8
movne r2, r3
tst r0, #0xF0
lsrne r0, #4
addeq r2, #4
tst r0, #0xC
lsrne r0, #2
addeq r2, #2
lsr r3, r0, #1
eor r3, #1
ands r3, #1
mvnne r3, #0
rsb r0, #2
and r0, r3
add r0, r2
bx lr
udiv32:
push {r4, r5, r6, r7, r8, lr}
rsbs r5, r1, #1
movcc r5, #0
cmp r0, #0
moveq r5, #1
cmp r5, #0
beq .nAndDNot0
.ret0:
mov r0, #0
pop {r4, r5, r6, r7, r8, pc}
.nAndDNot0:
mov r6, r1
mov r4, r0
mov r0, r1
bl clz32
mov r7, r0
mov r0, r4
bl clz32
sub r0, r7, r0
cmp r0, #31
bhi .ret0
beq .retN
add ip, r0, #1
rsb r0, ip, #32
lsl r1, r4, r0
lsr r3, r4, ip
sub lr, r6, #1
mov r0, r5
.loop:
lsr r2, r1, #31
orr r3, r2, r3, lsl #1
orr r1, r0, r1, lsl #1
sub r2, lr, r3
asr r2, #31
and r0, r2, #1
and r2, r6
sub r3, r2
subs ip, #1
bne .loop
orr r0, r1, lsl #1
pop {r4, r5, r6, r7, r8, pc}
.retN:
mov r0, r4
pop {r4, r5, r6, r7, r8, pc}
_divide64: ; requires ARMv7ve
push {r4, r5, r6, r7, r8, r9, lr}
asr lr, r1, #31
asr ip, r3, #31
eor r0, lr
subs r6, r0, lr
eor r1, lr
eor r2, ip
sbc r1, lr
eor r3, ip
subs r2, ip
eor r0, lr, ip
sbc r4, r3, ip
cmp r1, #0
mov r5, r1
mov lr, r0
bne .nHighNot0
cmp r4, #0
movne r3, r1
udiveq r3, r6, r2
.divRet:
eor r3, r0
eor r1, lr, r5
subs r0, r3, r0
sbc r1, lr
pop {r4, r5, r6, r7, r8, r9, pc}
.nHighNot0:
cmp r2, #0
mov r7, r2
bne .dLowNot0
cmp r4, #0
beq .undef
cmp r6, #0
beq .nLow0
sub r5, r4, #1
ands r5, r4
beq .dHighNotPowOf2
clz r8, r4
clz r3, r1
sub r8, r3
cmp r8, #30
bhi .divRet0
add r8, #1
rsb r3, r8, #32
lsr ip, r6, r8
lsl r5, r6, r3
orr ip, r1, lsl r3
lsr r9, r1, r8
b .startLoopOne0
.dLowNot0:
cmp r4, #0
mov ip, r1
beq .dHighNot0
clz r8, r4
clz r3, r1
sub r8, r3
cmp r8, #31
bhi .divRet0
add r8, #1
cmp r8, #32
moveq r9, #0
moveq r5, r6
moveq r7, r9
beq .startLoopOne0
.srBelow31:
rsb ip, r8, #32
lsr r3, r6, r8
lsl r5, r6, ip
lsr r9, r1, r8
orr ip, r3, r1, lsl ip
.startLoopBoth0:
mov r7, #0
.startLoopOne0:
mov r3, #0
.loop:
lsr r6, r5, #31
lsr r1, ip, #31
orr ip, r6, ip, lsl #1
orr r9, r1, r9, lsl #1
lsr r1, r7, #31
orr r7, r3, r7, lsl #1
mvn r3, ip
adds r3, r2
mvn r3, r9
adc r3, r4
orr r5, r1, r5, lsl #1
asr r3, #31
and r1, r3, r2
and r6, r3, r4
subs ip, r1
and r3, r3, #1
sbc r9, r6
subs r8, #1
bne .loop
adds r7, r7
adc r5, r5
orr r3, r7, r3
b .divRet
.dHighNot0:
sub r7, r2, #1
tst r7, r2
bne .dLowNotPowOf2
cmp r2, #1
mov r3, r6
beq .divRet
rbit r5, r2
clz r5, r5
lsr r3, r6, r5
rsb r2, r5, #32
orr r3, r1, lsl r2
lsr r5, r1, r5
b .divRet
.undef:
dw 0xE7F0DEF0 ; make invalid instruction exception
.divRet0:
mov r3, #0
mov r5, r3
b .divRet
.dLowNotPowOf2:
clz r5, r1
clz r3, r2
sub r3, r5
mov r9, r4
add r8, r3, #33
mov r5, r6
cmp r8, #32
beq .startLoopBoth0
cmp r8, #31
bls .srBelow31
add ip, r3, #1
rsb r7, r8, #64
lsr r5, r6, ip
lsr ip, r1, ip
orr r5, r1, lsl r7
lsl r7, r6, r7
b .startLoopOne0
.nLow0:
udiv r3, r1, r4
mov r5, r6
b .divRet
.dHighNotPowOf2:
rbit r3, r4
clz r3, r3
lsr r3, r1, r3
b .divRet
_modulo64: ; requires ARMv7ve
asr ip, r1, #31
push {r4, r5, r6, r7, r8, r9, r10, fp, lr}
asr lr, r3, #31
eor fp, r0, ip
eor r6, r2, lr
subs fp, ip
eor r10, r1, ip
sbc r10, ip
eor r7, r3, lr
subs r6, lr
sub sp, #12
sbc r7, lr
cmp r10, #0
eor r4, ip, lr
mov lr, r10
str r4, [sp]
str r4, [sp, #4]
bne .nHighNot0
cmp r7, #0
movne ip, r10
udiveq ip, fp, r6
.divRet:
ldr r7, [sp]
ldr r4, [sp, #4]
eor ip, r7
subs ip, r7
eor lr, r4
sbc lr, r4
mul r3, ip, r3
mla lr, r2, lr, r3
umull r2, r3, ip, r2
subs r0, r2
add r3, lr, r3
sbc r1, r3
add sp, #12
pop {r4, r5, r6, r7, r8, r9, r10, fp, pc}
.nHighNot0:
cmp r6, #0
mov r8, r6
bne .dLowNot0
cmp r7, #0
beq .undef
cmp fp, #0
beq .nLowNot0
sub lr, r7, #1
ands lr, r7
beq .dHighNotPowOf2
clz r9, r7
clz ip, r10
sub r9, ip
cmp r9, #30
bhi .divRet0
add r9, #1
rsb ip, r9, #32
lsr r4, fp, r9
lsl lr, fp, ip
orr r4, r10, lsl ip
lsr r5, r10, r9
b .startLoopOne0
.dLowNot0:
cmp r7, #0
mov r4, r10
beq .dHighNot0
clz r9, r7
clz ip, r10
sub r9, ip
cmp r9, #31
bhi .divRet0
add r9, #1
cmp r9, #32
moveq r5, #0
moveq lr, fp
moveq r8, r5
beq .startLoopOne0
.srBelow31:
rsb r4, r9, #32
lsr ip, fp, r9
lsl lr, fp, r4
lsr r5, r10, r9
orr r4, ip, r10, lsl r4
.startLoopBoth0:
mov r8, #0
.startLoopOne0:
mov ip, #0
.loop:
lsr fp, lr, #31
lsr r10, r4, #31
orr r4, fp, r4, lsl #1
orr r5, r10, r5, lsl #1
lsr r10, r8, #31
orr r8, ip, r8, lsl #1
mvn ip, r4
adds ip, r6
mvn ip, r5
adc ip, r7
orr lr, r10, lr, lsl #1
asr ip, #31
and fp, ip, r6
and r10, ip, r7
subs r4, fp
and ip, #1
sbc r5, r10
subs r9, #1
bne .loop
adds r8, r8
adc lr, lr
orr ip, r8, ip
b .divRet
.dHighNot0:
sub r8, r6, #1
tst r8, r6
bne .dLowNotPowOf2
cmp r6, #1
mov ip, fp
beq .divRet
rbit lr, r6
clz lr, lr
lsr ip, fp, lr
rsb fp, lr, #32
orr ip, r10, lsl fp
lsr lr, r10, lr
b .divRet
.undef:
dw 0xE7F0DEF0 ; make invalid instruction exception
.divRet0:
mov ip, #0
mov lr, ip
b .divRet
.dLowNotPowOf2:
clz lr, r10
clz ip, r6
sub ip, lr
mov r5, r7
add r9, ip, #33
mov lr, fp
cmp r9, #32
beq .startLoopBoth0
cmp r9, #31
bls .srBelow31
add r4, ip, #1
rsb r8, r9, #64
lsr lr, fp, r4
lsr r4, r10, r4
orr lr, r10, lsl r8
lsl r8, fp, r8
b .startLoopOne0
.nLowNot0:
udiv ip, r10, r7
mov lr, fp
b .divRet
.dHighNotPowOf2:
rbit ip, r7
clz ip, ip
lsr ip, r10, ip
b .divRet
_getVal64:
bx lr
_getOpposite64:
rsbs r0, #0
rsc r1, #0
bx lr
_getComplement64:
mvn r0, r0
mvn r1, r1
bx lr
_shiftLeft64:
mov r3, r0
sub r0, r2, #32
rsb ip, r2, #32
lsl r1, r2
orr r1, r3, lsl r0
lsl r0, r3, r2
orr r1, r3, lsr ip
bx lr
_shiftRight64:
rsb r3, r2, #32
subs ip, r2, #32
lsr r0, r2
orr r0, r1, lsl r3
orrpl r0, r1, asr ip
asr r1, r2
bx lr
_rol64:
push {r4, r5, lr}
and r2, #0x3F
sub lr, r2, #32
rsb r3, r2, #32
lsl ip, r1, r2
orr ip, r0, lsl lr
orr ip, r0, lsr r3
rsb r3, r2, #0
and r3, #63
rsb r5, r3, #32
sub r4, r3, #32
lsr lr, r0, r3
orr lr, r1, lsl r5
orr lr, r1, lsr r4
orr r0, lr, r0, lsl r2
orr r1, ip, r1, lsr r3
pop {r4, r5, pc}
_ror64:
push {r4, r5, lr}
and r2, #63
rsb ip, r2, #32
sub r3, r2, #32
lsr lr, r0, r2
orr lr, r1, lsl ip
orr lr, r1, lsr r3
rsb r3, r2, #0
and r3, #63
sub r5, r3, #32
rsb r4, r3, #32
lsl ip, r1, r3
orr ip, r0, lsl r5
orr ip, r0, lsr r4
orr r0, lr, r0, lsl r3
orr r1, ip, r1, lsr r2
pop {r4, r5, pc} | 11.290323 | 51 | 0.569048 |
08d5f48fea1b8bf444f7b3edf03d3ea1ad8311d1 | 241 | asm | Assembly | libsrc/alloc/balloc/ba_BestFit_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/alloc/balloc/ba_BestFit_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/alloc/balloc/ba_BestFit_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
MODULE ba_BestFit_callee
SECTION code_alloc_balloc
PUBLIC ba_BestFit_callee
PUBLIC _ba_BestFit_callee
EXTERN balloc_firstfit_callee
defc ba_BestFit_callee = balloc_firstfit_callee
defc _ba_BestFit_callee = balloc_firstfit_callee
| 20.083333 | 48 | 0.86722 |
8a465a45518458f252879c46f93bdf7186a8d3c1 | 322 | asm | Assembly | programs/oeis/040/A040195.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040195.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040195.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040195: Continued fraction for sqrt(210).
; 14,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28,2,28
mov $1,$0
cmp $0,0
sub $1,$0
gcd $1,2
add $1,5
add $0,$1
mul $0,$1
sub $0,35
mul $0,2
| 24.769231 | 189 | 0.599379 |
7b947cea60c2702291fad363af9b973991a3bbb3 | 2,287 | asm | Assembly | libsrc/stdio/vg5k/fputc_cons.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/vg5k/fputc_cons.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/vg5k/fputc_cons.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z | ;
; Philips VG5000 Routines
;
; Print character to the screen
;
; Jun. 2014 -Joaopa, Stefano Bodrato
;
;
; $Id: fputc_cons.asm,v 1.7 2016/06/16 19:40:21 dom Exp $
;
SECTION code_clib
PUBLIC fputc_cons_native
;
; Entry: char to print
;
DEFC ROWS=25
DEFC COLUMNS=40
defc ROW = $4805
defc COLUMN = $4806
.fputc_cons_native
ld ix,$47FA
ld hl,2
add hl,sp
ld a,(hl)
ld (charput+1),a
cp 12 ; CLS
jr nz,nocls
ld hl,0
ld (ROW),hl
ld bc,ROWS*COLUMNS
.cls
push hl
ld a,32
ld (charput+1),a
.clsloop
push bc
call charput
pop bc
dec bc
ld a,b
or c
jr nz,clsloop
pop hl
ld (ROW),hl
ret
.nocls
.doput
cp 13 ; CR?
jr z,isLF
cp 10 ; LF?
jr nz,NoLF
.isLF
xor a
ld (COLUMN),a ; automatic CR
ld a,(ROW)
inc a
ld (ROW),a
cp ROWS ; Out of screen?
ret nz ; no, return
ld a,ROWS-1
ld (ROW),a
jp scrolluptxt
.NoLF
cp 8 ; BackSpace
jr nz,NoBS
ld hl,COLUMN
cp (hl)
jr z,firstc ; are we in the first column?
dec (hl)
push hl
ld a,32
call charput+2
pop hl
dec (hl)
ret
.firstc
ld a,(ROW)
and a
ret z
dec a
ld (ROW),a
ld a,COLUMNS-1
ld (COLUMN),a
ret
.NoBS
.charput
ld a,0
push af
ld a,(COLUMN)
cp COLUMNS ; top-right column ? In this way we wait..
call z,isLF ; .. to have a char to print before issuing a CR
pop af
ld d,a
ld e,7 ; white on black
ld a,(COLUMN)
ld l,a
ld a,(ROW)
ld h,a
push hl
and a
jr z,zrow
add 7 ; bias the default scroll register settings and so on..
.zrow
ld h,a
push de
ld a,64+128
or e
ld e,a
call $92 ; direct video access
pop de
pop hl
push de
call $a7 ; video buffer access (keep a copy to scroll)
pop de
ld a,d
ld (hl),a
ld a,(COLUMN)
inc a
ld (COLUMN),a
cp COLUMNS ; last column ?
ret nz ; no, return
jp isLF
scrolluptxt:
ld hl,0
ld (ROW),hl
ld bc,ROWS*COLUMNS-COLUMNS
.scloop
ld a,(COLUMN)
ld l,a
ld a,(ROW)
inc a
ld h,a
push bc
call $a7
ld a,(hl)
ld (charput+1),a
call charput
pop bc
dec bc
ld a,b
or c
jr nz,scloop
ld bc,COLUMNS-1
ld hl,(ROW)
jp cls
; cp 12 ; CLS
; jp z,$9e
; ld hl,charput
; call $36aa
;sync:
; ei
; rst 38h
; rst 38h
; rst 38h
; rst 38h
; rst 38h
; rst 38h
; rst 38h
; rst 38h
; di
; ret
| 11.973822 | 65 | 0.596852 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.