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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a55dd8f3ee2157dc8ca1ec9f4984502f676a2f63
| 6,393
|
asm
|
Assembly
|
modules/core/Symbols.asm
|
vladikcomper/md-modules
|
24f652a036dc63f295173369dddfffb3be89bdd7
|
[
"MIT"
] | 9
|
2018-01-22T06:44:43.000Z
|
2022-03-26T18:57:40.000Z
|
modules/core/Symbols.asm
|
vladikcomper/md-modules
|
24f652a036dc63f295173369dddfffb3be89bdd7
|
[
"MIT"
] | null | null | null |
modules/core/Symbols.asm
|
vladikcomper/md-modules
|
24f652a036dc63f295173369dddfffb3be89bdd7
|
[
"MIT"
] | null | null | null |
_ValidHeader = $DEB2
; ===============================================================
; ---------------------------------------------------------------
; Subroutine to find nearest symbol for given offset
; ---------------------------------------------------------------
; INPUT:
; d1 .l Offset
;
; OUTPUT:
; d0 .w Status (0 = ok, -1 = error)
; d1 .l Offset displacement
; a1 Pointer to compressed symbol text
;
; USES:
; a1-a3 / d0-d3
; ---------------------------------------------------------------
GetSymbolByOffset:
lea SymbolData(pc), a1
cmp.w #_ValidHeader, (a1)+ ; verify header
bne.s @return_error
moveq #-2, d0
add.w (a1)+, d0 ; d0 = (lastBlock+1)*4
moveq #-4, d2 ; d2 will be 4-byte boundary mask
moveq #0, d3 ; d3 will be gain value
swap d1 ; d1 = block
and.w #$FF, d1 ; mask higher 8-bits of block id, since MD has 24-bit address bus anyways ...
add.w d1, d1 ; d1 = block*2
add.w d1, d1 ; d1 = block*4
cmp.w d0, d1 ; is the offset's block within [0..lastBlock+1]?
bhi.s @return_error ; if not, branch
beq.s @load_prev_block ; if strictly lastBlock+1, fetch the previous one ...
@load_block:
move.l (a1,d1), d0 ; d0 = relative offset
beq.s @load_prev_block ; if block is empty, branch
lea (a1,d0.l), a3 ; a3 = Block structure
swap d1 ; d1 = offset
moveq #0, d0
move.w (a3)+, d0 ; d0 = symbols heap relative offset
cmp.w (a3), d1 ; compare the requested offset with the lowest in the block
blo.s @load_prev_block_2 ; if even lower, find nearest offset in the previous block
; WARNING: The following instruction assumes blocks will not be reloaded anymore
lea -2(a3,d0.l), a1 ; a1 = symbols heap
; d0 = (high - low)
lea -4(a1), a2 ; a2 = high
; a3 = low
@search_loop:
lsr.w #1, d0 ; 8 ; d0 = (high - low) / 2
and.w d2, d0 ; 4 ; find nearest 4-byte struct for the displacement
cmp.w (a3,d0), d1 ; 14 ; compare the requested offset with the guessed entry
blo.s @search_lower_half ; 8/10
bhi.s @search_higher_half ; 8/10
adda.w d0, a3
bra.s @load_symbol
; -----------------------------------------------------------
@search_higher_half:
lea 4(a3,d0), a3 ; 12 ; limit "low" to "middle"+1 of previously observed area
move.l a2, d0 ; 4
sub.l a3, d0 ; 8 ; d0 = (high - low)
bpl.s @search_loop ; 8/10 ; if (low >= high), branch
subq.w #4, a3
bra.s @load_symbol
; -----------------------------------------------------------
@search_lower_half:
lea -4(a3,d0), a2 ; 12 ; limit "high" to "middle"-1 of previously observed area
move.l a2, d0 ; 4 ;
sub.l a3, d0 ; 8 ; d0 = (high - low)
bpl.s @search_loop ; 8/10 ; if (low >= high), branch
lea (a2), a3
@load_symbol:
sub.w (a3)+, d1 ; d1 = displacement
moveq #0, d2
move.w (a3)+, d2 ; d2 = symbol pointer, relative to the heap
adda.l d2, a1
swap d1 ; ''
; NOTICE: You should be able to access SymbolData+4(pc,d1) now ...
clr.w d1 ; ''
swap d1 ; andi.l #$FFFF, d1
add.l d3, d1
moveq #0, d0 ; return success
rts
; ---------------------------------------------------------------
@return_error:
moveq #-1, d0 ; return -1
rts
; ---------------------------------------------------------------
@load_prev_block:
swap d1
@load_prev_block_2:
moveq #0, d0
move.w d1, d0
add.l d0, d3 ; increase offset gain by the offset within the previous block
addq.l #1, d3 ; also increase offset gain by 1 to compensate for ...
move.w #$FFFF, d1 ; ... setting offset to $FFFF instead of $10000
swap d1
subq.w #4, d1 ; decrease block number
bpl.s @load_block ; if block is positive, branch
moveq #-1, d0 ; return -1
rts
; ===============================================================
; ---------------------------------------------------------------
; Subroutine to decode compressed symbol name to string buffer
; ---------------------------------------------------------------
; INPUT:
; a0 String buffer pointer
; a1 Pointer to the compressed symbol data
;
; d7 .w Number of bytes left in buffer, minus one
; a0 String buffer
; a4 Buffer flush function
;
; OUTPUT:
; (a0)++ ASCII characters for the converted value
;
; USES:
; a1-a3, d1-d4
; ---------------------------------------------------------------
DecodeSymbol:
lea SymbolData(pc), a3
cmp.w #_ValidHeader, (a3)+ ; verify the header
bne.s @return_cc
add.w (a3), a3 ; a3 = Huffman code table
moveq #0,d4 ; d4 will handle byte feeding from bitstream
; ---------------------------------------------------------------
@decode_new_node:
moveq #0, d1 ; d1 will hold code
moveq #0, d2 ; d2 will hold code length (in bits)
lea (a3), a2 ; a2 will hold current position in the decode table
; ---------------------------------------------------------------
@code_extend:
dbf d4, @stream_ok ; if bits remain in byte, branch
move.b (a1)+, d3
moveq #7, d4
@stream_ok:
add.b d3, d3 ; get a bit from the bitstream ...
addx.w d1, d1 ; ... add it to current code
addq.w #1, d2 ; count this bit
@code_check_loop:
cmp.w (a2), d1 ; does this node has the same code?
bhi.s @code_check_next ; if not, check next
blo.s @code_extend ; if no nodes are found, branch
cmp.b 2(a2), d2 ; is this code of the same length?
beq.s @code_found ; if not, branch
blo.s @code_extend ; if length is lower, append code
@code_check_next:
addq.w #4, a2
cmp.w (a2), d1 ; does this node has the same code?
bhi.s @code_check_next ; if not, check next
blo.s @code_extend ; if no nodes are found, branch
cmp.b 2(a2), d2 ; is this code of the same length?
blo.s @code_extend ; if length is lower, append code
bne.s @code_check_next
@code_found:
move.b 3(a2), (a0)+ ; get decoded character
beq.s @decode_done ; if it's null character, branch
dbf d7, @decode_new_node
jsr (a4)
bcc.s @decode_new_node
rts
; ---------------------------------------------------------------
@decode_done:
subq.w #1, a0 ; put the last character back
rts
; ---------------------------------------------------------------
@return_cc: ; return with Carry clear (cc)
moveq #0,d0
rts
| 32.125628
| 96
| 0.51572
|
acc7978c50c2a0ed2670ac241394bd2c49c8efa4
| 525
|
asm
|
Assembly
|
oeis/156/A156164.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/156/A156164.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/156/A156164.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A156164: Decimal expansion of 17 + 12*sqrt(2).
; Submitted by Jon Maiga
; 3,3,9,7,0,5,6,2,7,4,8,4,7,7,1,4,0,5,8,5,6,2,0,2,6,4,6,9,0,5,1,6,3,7,6,9,4,2,8,3,6,0,6,2,5,0,4,5,2,3,3,7,6,8,7,8,1,2,0,1,5,6,8,5,5,8,8,8,7,8,9,7,4,1,5,4,5,2,8,4,4,6,6,2,0,4,6,5,0,4,1,1,9,3,1,6,9,8,8,7
mov $2,7
mov $3,$0
mul $3,3
lpb $3
add $6,$2
add $1,$6
add $1,$6
mov $2,$6
mul $2,3
add $2,$1
mul $1,2
sub $3,1
lpe
sub $0,1
mov $4,10
pow $4,$0
mov $5,$4
cmp $5,0
add $4,$5
div $2,$4
div $1,$2
trn $1,3
mov $0,$1
add $0,3
mod $0,10
| 17.5
| 201
| 0.527619
|
a62820e6e757a84b902e840bce5f12356365b2f0
| 5,892
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_935_1600.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_935_1600.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_935_1600.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 %r9
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x8af7, %rcx
nop
nop
nop
nop
nop
xor $5816, %r13
and $0xffffffffffffffc0, %rcx
movaps (%rcx), %xmm6
vpextrq $0, %xmm6, %rax
nop
nop
add $57639, %r9
lea addresses_WT_ht+0xb0e1, %rbp
clflush (%rbp)
nop
dec %r9
movb $0x61, (%rbp)
nop
nop
sub $15965, %rbp
lea addresses_UC_ht+0x33b7, %rcx
nop
nop
nop
nop
xor $60166, %rdi
mov $0x6162636465666768, %r9
movq %r9, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
nop
sub %rax, %rax
lea addresses_WC_ht+0x4e77, %r13
nop
nop
nop
nop
sub $11913, %rbp
vmovups (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rbx
nop
add %r9, %r9
lea addresses_normal_ht+0xb31f, %rsi
lea addresses_WC_ht+0x8037, %rdi
xor $63720, %r13
mov $41, %rcx
rep movsq
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x10237, %rsi
nop
nop
nop
and $64480, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%rsi)
add %r13, %r13
lea addresses_D_ht+0xe5b7, %rsi
lea addresses_A_ht+0x19b7, %rdi
nop
nop
sub $18855, %rbp
mov $117, %rcx
rep movsw
nop
nop
and $2977, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %r9
push %rbx
// Store
mov $0x2ced250000000a47, %r8
nop
nop
cmp $20394, %r11
mov $0x5152535455565758, %r9
movq %r9, %xmm6
movaps %xmm6, (%r8)
nop
add $39498, %r8
// Faulty Load
lea addresses_PSE+0x99b7, %r11
clflush (%r11)
nop
nop
nop
nop
nop
and %r8, %r8
mov (%r11), %r15w
lea oracles, %rbx
and $0xff, %r15
shlq $12, %r15
mov (%rbx,%r15,1), %r15
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 5}}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'33': 935}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 37.769231
| 2,804
| 0.659538
|
1e806364efec9d010b08b1d536535b1b00592309
| 51
|
asm
|
Assembly
|
PRG/maps/World7OX.asm
|
narfman0/smb3_pp1
|
38a58adafff67a403591e38875e9fae943a5fe76
|
[
"Unlicense"
] | null | null | null |
PRG/maps/World7OX.asm
|
narfman0/smb3_pp1
|
38a58adafff67a403591e38875e9fae943a5fe76
|
[
"Unlicense"
] | null | null | null |
PRG/maps/World7OX.asm
|
narfman0/smb3_pp1
|
38a58adafff67a403591e38875e9fae943a5fe76
|
[
"Unlicense"
] | null | null | null |
.byte $90, $80, $D0, $C0, $00, $00, $00, $00, $00
| 25.5
| 50
| 0.431373
|
b5871f9a10bd692f28639f8e73967554d90f3540
| 13,522
|
asm
|
Assembly
|
AtlasBase/kernel/JulianRuhe/ATL_dJIK30x30x30TN30x30x0_a1_bX.asm
|
kevleyski/math-atlas
|
cc36aa7e0362c577739ac507378068882834825e
|
[
"BSD-3-Clause-Clear"
] | 135
|
2015-01-08T20:35:35.000Z
|
2022-03-31T02:26:28.000Z
|
AtlasBase/kernel/JulianRuhe/ATL_dJIK30x30x30TN30x30x0_a1_bX.asm
|
kevleyski/math-atlas
|
cc36aa7e0362c577739ac507378068882834825e
|
[
"BSD-3-Clause-Clear"
] | 25
|
2015-01-13T15:19:26.000Z
|
2021-06-05T20:00:27.000Z
|
AtlasBase/kernel/JulianRuhe/ATL_dJIK30x30x30TN30x30x0_a1_bX.asm
|
kevleyski/math-atlas
|
cc36aa7e0362c577739ac507378068882834825e
|
[
"BSD-3-Clause-Clear"
] | 34
|
2015-01-11T01:24:51.000Z
|
2021-04-19T17:44:02.000Z
|
;
; ATL_dJIK30x30x30TN30x30x0_a1_bX.asm
;
; ATLAS "Speed of Light" DGEMM() kernel for AMD Athlon
; Code author: Julian Ruhe (ruheejih@linux.zrz.tu-berlin.de | Julian.Ruhe@t-online.de)
;
; void ATL_dJIK30x30x30TN30x30x0_a1_bX(const int M, const int N, const int K, const double alpha,
; const double *A, const int lda, const double *B, const int ldb,
; const double beta, double *C, const int ldc)
;
; Compile with "nasmw -f win32 -DWIN32 ATL_dJIK30x30x30TN30x30x0_a1_bX.asm" (Windows)
; Compile with "nasm -f elf -DELF ATL_dJIK30x30x30TN30x30x0_a1_bX.asm" (LINUX)
;
; See config file (ATL_dJIK30x30x30TN30x30x0_a1.cfg) for important macro definitions
;
%include "ATL_dJIK30x30x30TN30x30x0_a1.cfg"
%include "ATL_dJIK30x30x30TN30x30x0_a1.mcr"
%ifdef WIN32
global _ATL_dJIK30x30x30TN30x30x0_a1_bX
section .text
_ATL_dJIK30x30x30TN30x30x0_a1_bX:
%endif
%ifdef ELF
global ATL_dJIK30x30x30TN30x30x0_a1_bX
section .text
ATL_dJIK30x30x30TN30x30x0_a1_bX:
%endif
push ebp
mov ebp,esp
and esp,-8 ;align8 stack
sub esp,8
fld qword [ebp+44] ;beta->st0
fstp qword [esp] ;st0->stack
push ebx
push esi
push edi
femms
mov eax,0 ;temporary variable t1
push eax ;t1->stack
mov eax,[ebp+28] ;&A->eax
add eax,NB*NB*8 ;&(A+1)->eax
mov ebx,[ebp+36] ;&B->ebx
sub eax,ebx ;calculate offset
push eax ;&A+1+offset->stack
mov eax,[ebp+56] ;ldc->eax
lea eax,[8*eax]
push eax ;8*ldc->stack
mov eax,NB
push eax ;loop counter->stack
mov eax,[ebp+28] ;&A->eax
mov ebx,[ebp+36] ;&B->ebx
mov ecx,[ebp+52] ;&C->ecx
add ecx,byte 15*8 ;calculate offsets
add ebx,byte 15*8
add eax,5*NB*8+15*8
push eax ;&A+offset->stack
push ebp ;ebp->stack
mov edi,-1*NB*8 ;calculate offsets for dot products
mov esi,-3*NB*8
mov ebp,-5*NB*8
mov edx,6*NB*8 ;offset for the next 6 dot products
;stack dump
;[esp+36]: beta
;[esp+32]: ebx
;[esp+28]: esi
;[esp+24]: edi
;[esp+20]: t1 (temp)
;[esp+16]: &(A+1)+offset
;[esp+12]: ldc*8
;[esp+08]: loop counter
;[esp+04]: &A+offset
;[esp+00]: ebp
align 16
loopj_
fld qword [esp+36]
fld qword [ecx+ELM2]
nop
rep
fmul st0,st1
fld qword [ecx+ELM3]
fmul st0,st2
rep
fld qword [ecx+ELM1]
fmul st0,st3
fxch st0,st3
fld qword [ecx+ELM5]
fmul st0,st1
fld qword [ecx+ELM6]
fmul st0,st2
fld qword [ebx+ELM1]
fld qword [ecx+ELM4]
rep
fmulp st4,st0
rep
mov edx,edx
fnop
OPERATION 1,2 ;01+1
OPERATION 2,3 ;02+1
OPERATION 3,4 ;03+1
OPERATION 4,5 ;04+1
OPERATION 5,6 ;05+1
OPERATION 6,7 ;06+1
OPERATION 7,8 ;07+1
OPERATION 8,9 ;08+1
OPERATION 9,10 ;09+1
OPERATION 10,11 ;10+1
OPERATION 11,12 ;11+1
OPERATION 12,13 ;12+1
OPERATION 13,14 ;13+1
OPERATION 14,15 ;14+1
OPERATION 15,16 ;15+1
OPERATION 16,17 ;16+1
OPERATION 17,18 ;17+1
OPERATION 18,19 ;18+1
OPERATION 19,20 ;19+1
OPERATION 20,21 ;20+1
OPERATION 21,22 ;21+1
OPERATION 22,23 ;22+1
OPERATION 23,24 ;23+1
OPERATION 24,25 ;24+1
OPERATION 25,26 ;25+1
OPERATION 26,27 ;26+1
OPERATION 27,28 ;27+1
OPERATION 28,29 ;28+1
OPERATION 29,30 ;29+1
fld qword [eax+DOTP1+ELM30] ;30+1
fmul st0,st1
faddp st7
fld qword [eax+DOTP2+ELM30]
fmul st0,st1
faddp st6
fld qword [eax+DOTP3+ELM30]
fmul st0,st1
faddp st5
fld qword [eax+DOTP4+ELM30]
fmul st0,st1
faddp st4
fld qword [eax+DOTP5+ELM30]
fmul st0,st1
faddp st3
rep
fmul qword [eax+DOTP6+ELM30]
faddp st1
fxch st5
%ifdef PREC_DST4
mov [esp+20],ecx
add ecx,[esp+12]
prefetchw [ecx-2*64]
prefetchw [ecx-1*64]
prefetchw [ecx+0*64]
prefetchw [ecx+1*64]
nop
prefetchw [ecx+2*64-1]
mov ecx,[esp+20]
%endif
%ifdef PREB_DST4
prefetch [ebx+30*8-2*64]
fnop
mov edx,edx
prefetch [ebx+30*8-1*64]
nop
prefetch [ebx+30*8+0*64]
nop
prefetch [ebx+30*8+1*64]
nop
prefetch [ebx+30*8+2*64]
nop
%endif
fstp qword [ecx+ELM1]
fxch st3
fstp qword [ecx+ELM2]
fxch st1
fstp qword [ecx+ELM3]
fstp qword [ecx+ELM4]
fstp qword [ecx+ELM5]
fstp qword [ecx+ELM6]
add eax,edx
fld qword [esp+36]
fld qword [ecx+ELM8]
nop
rep
fmul st0,st1
fld qword [ecx+ELM9]
fmul st0,st2
rep
fld qword [ecx+ELM7]
fmul st0,st3
fxch st0,st3
fld qword [ecx+ELM11]
fmul st0,st1
fld qword [ecx+ELM12]
fmul st0,st2
fld qword [ebx+ELM1]
fld qword [ecx+ELM10]
rep
fmulp st4,st0
rep
mov edx,edx
fnop
OPERATION 1,2 ;01+2
OPERATION 2,3 ;02+2
OPERATION 3,4 ;03+2
OPERATION 4,5 ;04+2
OPERATION 5,6 ;05+2
OPERATION 6,7 ;06+2
OPERATION 7,8 ;07+2
OPERATION 8,9 ;08+2
OPERATION 9,10 ;09+2
OPERATION 10,11 ;10+2
OPERATION 11,12 ;11+2
OPERATION 12,13 ;12+2
OPERATION 13,14 ;13+2
OPERATION 14,15 ;14+2
OPERATION 15,16 ;15+2
OPERATION 16,17 ;16+2
OPERATION 17,18 ;17+2
OPERATION 18,19 ;18+2
OPERATION 19,20 ;19+2
OPERATION 20,21 ;20+2
OPERATION 21,22 ;21+2
OPERATION 22,23 ;22+2
OPERATION 23,24 ;23+2
OPERATION 24,25 ;24+2
OPERATION 25,26 ;25+2
OPERATION 26,27 ;26+2
OPERATION 27,28 ;27+2
OPERATION 28,29 ;28+2
OPERATION 29,30 ;29+2
fld qword [eax+DOTP1+ELM30] ;30+2
fmul st0,st1
faddp st7
fld qword [eax+DOTP2+ELM30]
fmul st0,st1
faddp st6
fld qword [eax+DOTP3+ELM30]
fmul st0,st1
faddp st5
fld qword [eax+DOTP4+ELM30]
fmul st0,st1
faddp st4
fld qword [eax+DOTP5+ELM30]
fmul st0,st1
faddp st3
rep
fmul qword [eax+DOTP6+ELM30]
faddp st1
fxch st5
%ifdef PREC_DST3
mov [esp+20],ecx
add ecx,[esp+12]
prefetchw [ecx-2*64]
prefetchw [ecx-1*64]
prefetchw [ecx+0*64]
prefetchw [ecx+1*64]
nop
prefetchw [ecx+2*64-1]
mov ecx,[esp+20]
%endif
%ifdef PREB_DST3
prefetch [ebx+30*8-2*64]
fnop
mov edx,edx
prefetch [ebx+30*8-1*64]
nop
prefetch [ebx+30*8+0*64]
nop
prefetch [ebx+30*8+1*64]
nop
prefetch [ebx+30*8+2*64]
nop
%endif
fstp qword [ecx+ELM7]
fxch st3
fstp qword [ecx+ELM8]
fxch st1
fstp qword [ecx+ELM9]
fstp qword [ecx+ELM10]
fstp qword [ecx+ELM11]
fstp qword [ecx+ELM12]
add eax,edx
fld qword [esp+36]
fld qword [ecx+ELM14]
nop
rep
fmul st0,st1
fld qword [ecx+ELM15]
fmul st0,st2
rep
fld qword [ecx+ELM13]
fmul st0,st3
fxch st0,st3
fld qword [ecx+ELM17]
fmul st0,st1
fld qword [ecx+ELM18]
rep
fmul st0,st2
fld qword [ebx+ELM1]
fld qword [ecx+ELM16]
rep
fmulp st4,st0
rep
mov edx,edx
fnop
OPERATION 1,2 ;01+3
OPERATION 2,3 ;02+3
OPERATION 3,4 ;03+3
OPERATION 4,5 ;04+3
OPERATION 5,6 ;05+3
OPERATION 6,7 ;06+3
OPERATION 7,8 ;07+3
OPERATION 8,9 ;08+3
OPERATION 9,10 ;09+3
OPERATION 10,11 ;10+3
OPERATION 11,12 ;11+3
OPERATION 12,13 ;12+3
OPERATION 13,14 ;13+3
OPERATION 14,15 ;14+3
OPERATION 15,16 ;15+3
OPERATION 16,17 ;16+3
OPERATION 17,18 ;17+3
OPERATION 18,19 ;18+3
OPERATION 19,20 ;19+3
OPERATION 20,21 ;20+3
OPERATION 21,22 ;21+3
OPERATION 22,23 ;22+3
OPERATION 23,24 ;23+3
OPERATION 24,25 ;24+3
OPERATION 25,26 ;25+3
OPERATION 26,27 ;26+3
OPERATION 27,28 ;27+3
OPERATION 28,29 ;28+3
OPERATION 29,30 ;29+3
fld qword [eax+DOTP1+ELM30] ;30+3
fmul st0,st1
faddp st7
fld qword [eax+DOTP2+ELM30]
fmul st0,st1
faddp st6
fld qword [eax+DOTP3+ELM30]
fmul st0,st1
faddp st5
fld qword [eax+DOTP4+ELM30]
fmul st0,st1
faddp st4
fld qword [eax+DOTP5+ELM30]
fmul st0,st1
faddp st3
rep
fmul qword [eax+DOTP6+ELM30]
faddp st1
fxch st5
%ifdef PREC_DST2
mov [esp+20],ecx
add ecx,[esp+12]
prefetchw [ecx-2*64]
prefetchw [ecx-1*64]
prefetchw [ecx+0*64]
prefetchw [ecx+1*64]
nop
prefetchw [ecx+2*64-1]
mov ecx,[esp+20]
%endif
%ifdef PREB_DST2
prefetch [ebx+30*8-2*64]
fnop
mov edx,edx
prefetch [ebx+30*8-1*64]
nop
prefetch [ebx+30*8+0*64]
nop
prefetch [ebx+30*8+1*64]
nop
prefetch [ebx+30*8+2*64]
nop
%endif
fstp qword [ecx+ELM13]
fxch st3
fstp qword [ecx+ELM14]
rep
fxch st1
fstp qword [ecx+ELM15]
fstp qword [ecx+ELM16]
fstp qword [ecx+ELM17]
fstp qword [ecx+ELM18]
add eax,edx
fld qword [esp+36]
fld qword [ecx+ELM20]
nop
rep
fmul st0,st1
fld qword [ecx+ELM21]
fmul st0,st2
rep
fld qword [ecx+ELM19]
fmul st0,st3
fxch st0,st3
fld qword [ecx+ELM23]
fmul st0,st1
fld qword [ecx+ELM24]
fmul st0,st2
fld qword [ebx+ELM1]
fld qword [ecx+ELM22]
rep
fmulp st4,st0
rep
mov edx,edx
fnop
OPERATION 1,2 ;01+4
OPERATION 2,3 ;02+4
OPERATION 3,4 ;03+4
OPERATION 4,5 ;04+4
OPERATION 5,6 ;05+4
OPERATION 6,7 ;06+4
OPERATION 7,8 ;07+4
OPERATION 8,9 ;08+4
OPERATION 9,10 ;09+4
OPERATION 10,11 ;10+4
OPERATION 11,12 ;11+4
OPERATION 12,13 ;12+4
OPERATION 13,14 ;13+4
OPERATION 14,15 ;14+4
OPERATION 15,16 ;15+4
OPERATION 16,17 ;16+4
OPERATION 17,18 ;17+4
OPERATION 18,19 ;18+4
OPERATION 19,20 ;19+4
OPERATION 20,21 ;20+4
OPERATION 21,22 ;21+4
OPERATION 22,23 ;22+4
OPERATION 23,24 ;23+4
OPERATION 24,25 ;24+4
OPERATION 25,26 ;25+4
OPERATION 26,27 ;26+4
OPERATION 27,28 ;27+4
OPERATION 28,29 ;28+4
OPERATION 29,30 ;29+4
fld qword [eax+DOTP1+ELM30] ;30+4
fmul st0,st1
faddp st7
fld qword [eax+DOTP2+ELM30]
fmul st0,st1
faddp st6
fld qword [eax+DOTP3+ELM30]
fmul st0,st1
faddp st5
fld qword [eax+DOTP4+ELM30]
fmul st0,st1
faddp st4
fld qword [eax+DOTP5+ELM30]
fmul st0,st1
faddp st3
rep
fmul qword [eax+DOTP6+ELM30]
faddp st1
fxch st5
%ifdef PREC_DST1
mov [esp+20],ecx
add ecx,[esp+12]
prefetchw [ecx-2*64]
prefetchw [ecx-1*64]
prefetchw [ecx+0*64]
prefetchw [ecx+1*64]
nop
prefetchw [ecx+2*64-1]
mov ecx,[esp+20]
%endif
%ifdef PREB_DST1
prefetch [ebx+30*8-2*64]
fnop
mov edx,edx
prefetch [ebx+30*8-1*64]
nop
prefetch [ebx+30*8+0*64]
nop
prefetch [ebx+30*8+1*64]
nop
prefetch [ebx+30*8+2*64]
nop
%endif
fstp qword [ecx+ELM19]
fxch st3
fstp qword [ecx+ELM20]
fxch st1
fstp qword [ecx+ELM21]
fstp qword [ecx+ELM22]
fstp qword [ecx+ELM23]
fstp qword [ecx+ELM24]
add eax,edx
fld qword [esp+36]
fld qword [ecx+ELM26]
nop
rep
fmul st0,st1
fld qword [ecx+ELM27]
fmul st0,st2
rep
fld qword [ecx+ELM25]
fmul st0,st3
fxch st0,st3
fld qword [ecx+ELM29]
fmul st0,st1
fld qword [ecx+ELM30]
fmul st0,st2
fld qword [ebx+ELM1]
fld qword [ecx+ELM28]
rep
fmulp st4,st0
rep
mov edx,edx
fnop
OPERATION 1,2 ;01+5
OPERATION 2,3 ;02+5
OPERATION 3,4 ;03+5
OPERATION 4,5 ;04+5
OPERATION 5,6 ;05+5
OPERATION 6,7 ;06+5
OPERATION 7,8 ;07+5
OPERATION 8,9 ;08+5
OPERATION 9,10 ;09+5
OPERATION 10,11 ;10+5
OPERATION 11,12 ;11+5
OPERATION 12,13 ;12+5
OPERATION 13,14 ;13+5
OPERATION 14,15 ;14+5
OPERATION 15,16 ;15+5
OPERATION 16,17 ;16+5
OPERATION 17,18 ;17+5
OPERATION 18,19 ;18+5
OPERATION 19,20 ;19+5
OPERATION 20,21 ;20+5
OPERATION 21,22 ;21+5
OPERATION 22,23 ;22+5
OPERATION 23,24 ;23+5
OPERATION 24,25 ;24+5
OPERATION 25,26 ;25+5
OPERATION 26,27 ;26+5
OPERATION 27,28 ;27+5
OPERATION 28,29 ;28+5
OPERATION 29,30 ;29+5
fld qword [eax+DOTP1+ELM30] ;30+5
fmul st0,st1
faddp st7
fld qword [eax+DOTP2+ELM30]
fmul st0,st1
faddp st6
fld qword [eax+DOTP3+ELM30]
fmul st0,st1
faddp st5
fld qword [eax+DOTP4+ELM30]
fmul st0,st1
faddp st4
fld qword [eax+DOTP5+ELM30]
fmul st0,st1
faddp st3
rep
fmul qword [eax+DOTP6+ELM30]
faddp st1
fxch st5
%ifdef PREA_EN
mov [esp+20],edx ;save edx in t1
mov edx,[esp+16] ;&A+1->edx
lea edx,[edx+ebx]
prefetch [edx-2*64]
nop
prefetch [edx-1*64]
prefetch [edx+0*64]
nop
prefetch [edx+1*64]
prefetch [edx+2*64-8]
mov edx,[esp+20] ;restore edx
mov eax,eax
fnop
%endif
fstp qword [ecx+ELM25]
fxch st3
fstp qword [ecx+ELM26]
fxch st1
fstp qword [ecx+ELM27]
fstp qword [ecx+ELM28]
fstp qword [ecx+ELM29]
fstp qword [ecx+ELM30]
sub ebx,edi ;next column of B
mov eax,[esp+4] ;reset eax
add ecx,[esp+12] ;next column of C (+ldc*8)
dec dword [esp+8] ;dec counter
jnz near loopj_
end_
femms
pop ebp
add esp,byte 5*4 ;remove local variables
pop edi ;restore registers
pop esi
pop ebx
eend_ leave ;mov esp,ebp / pop ebp
ret
| 17.269476
| 98
| 0.591924
|
28938b46dbc804b1a3ff04eba29317c38ac32628
| 6,088
|
asm
|
Assembly
|
erasure_code/gf_vect_dot_prod_avx.asm
|
leo-project/isa_l
|
9e7aad28f35265a80c9d4ef8f58380e00546e3e2
|
[
"BSD-3-Clause"
] | 1
|
2018-03-22T07:20:18.000Z
|
2018-03-22T07:20:18.000Z
|
erasure_code/gf_vect_dot_prod_avx.asm
|
leo-project/isa_l
|
9e7aad28f35265a80c9d4ef8f58380e00546e3e2
|
[
"BSD-3-Clause"
] | null | null | null |
erasure_code/gf_vect_dot_prod_avx.asm
|
leo-project/isa_l
|
9e7aad28f35265a80c9d4ef8f58380e00546e3e2
|
[
"BSD-3-Clause"
] | null | null | null |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2015 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; gf_vect_dot_prod_avx(len, vec, *g_tbls, **buffs, *dest);
;;;
%include "reg_sizes.asm"
%ifidn __OUTPUT_FORMAT__, elf64
%define arg0 rdi
%define arg1 rsi
%define arg2 rdx
%define arg3 rcx
%define arg4 r8
%define tmp r11
%define tmp2 r10
%define tmp3 r9
%define return rax
%macro SLDR 2
%endmacro
%define SSTR SLDR
%define PS 8
%define func(x) x:
%define FUNC_SAVE
%define FUNC_RESTORE
%endif
%ifidn __OUTPUT_FORMAT__, win64
%define arg0 rcx
%define arg1 rdx
%define arg2 r8
%define arg3 r9
%define arg4 r12 ; must be saved and loaded
%define tmp r11
%define tmp2 r10
%define tmp3 rdi ; must be saved and loaded
%define return rax
%macro SLDR 2
%endmacro
%define SSTR SLDR
%define PS 8
%define frame_size 2*8
%define arg(x) [rsp + frame_size + PS + PS*x]
%define func(x) proc_frame x
%macro FUNC_SAVE 0
rex_push_reg r12
push_reg rdi
end_prolog
mov arg4, arg(4)
%endmacro
%macro FUNC_RESTORE 0
pop rdi
pop r12
%endmacro
%endif
%ifidn __OUTPUT_FORMAT__, elf32
;;;================== High Address;
;;; arg4
;;; arg3
;;; arg2
;;; arg1
;;; arg0
;;; return
;;;<================= esp of caller
;;; ebp
;;;<================= ebp = esp
;;; esi
;;; edi
;;; ebx
;;;<================= esp of callee
;;;
;;;================== Low Address;
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define arg(x) [ebp + PS*2 + PS*x]
%define trans ecx ;trans is for the variables in stack
%define arg0 trans
%define arg0_m arg(0)
%define arg1 trans
%define arg1_m arg(1)
%define arg2 arg2_m
%define arg2_m arg(2)
%define arg3 ebx
%define arg4 trans
%define arg4_m arg(4)
%define tmp edx
%define tmp2 edi
%define tmp3 esi
%define return eax
%macro SLDR 2 ;; stack load/restore
mov %1, %2
%endmacro
%define SSTR SLDR
%macro FUNC_SAVE 0
push ebp
mov ebp, esp
push esi
push edi
push ebx
mov arg3, arg(3)
%endmacro
%macro FUNC_RESTORE 0
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
%endmacro
%endif ; output formats
%define len arg0
%define vec arg1
%define mul_array arg2
%define src arg3
%define dest arg4
%define vec_i tmp2
%define ptr tmp3
%define pos return
%ifidn PS,4 ;32-bit code
%define vec_m arg1_m
%define len_m arg0_m
%define dest_m arg4_m
%endif
%ifndef EC_ALIGNED_ADDR
;;; Use Un-aligned load/store
%define XLDR vmovdqu
%define XSTR vmovdqu
%else
;;; Use Non-temporal load/stor
%ifdef NO_NT_LDST
%define XLDR vmovdqa
%define XSTR vmovdqa
%else
%define XLDR vmovntdqa
%define XSTR vmovntdq
%endif
%endif
%ifidn PS,8 ; 64-bit code
default rel
[bits 64]
%endif
section .text
%define xmask0f xmm5
%define xgft_lo xmm4
%define xgft_hi xmm3
%define x0 xmm0
%define xtmpa xmm1
%define xp xmm2
align 16
global gf_vect_dot_prod_avx:function
func(gf_vect_dot_prod_avx)
FUNC_SAVE
SLDR len, len_m
sub len, 16
SSTR len_m, len
jl .return_fail
xor pos, pos
vmovdqa xmask0f, [mask0f] ;Load mask of lower nibble in each byte
.loop16:
vpxor xp, xp
mov tmp, mul_array
xor vec_i, vec_i
.next_vect:
mov ptr, [src+vec_i*PS]
vmovdqu xgft_lo, [tmp] ;Load array Cx{00}, Cx{01}, ..., Cx{0f}
vmovdqu xgft_hi, [tmp+16] ; " Cx{00}, Cx{10}, ..., Cx{f0}
XLDR x0, [ptr+pos] ;Get next source vector
add tmp, 32
add vec_i, 1
vpand xtmpa, x0, xmask0f ;Mask low src nibble in bits 4-0
vpsraw x0, x0, 4 ;Shift to put high nibble into bits 4-0
vpand x0, x0, xmask0f ;Mask high src nibble in bits 4-0
vpshufb xgft_hi, xgft_hi, x0 ;Lookup mul table of high nibble
vpshufb xgft_lo, xgft_lo, xtmpa ;Lookup mul table of low nibble
vpxor xgft_hi, xgft_hi, xgft_lo ;GF add high and low partials
vpxor xp, xp, xgft_hi ;xp += partial
SLDR vec, vec_m
cmp vec_i, vec
jl .next_vect
SLDR dest, dest_m
XSTR [dest+pos], xp
add pos, 16 ;Loop on 16 bytes at a time
SLDR len, len_m
cmp pos, len
jle .loop16
lea tmp, [len + 16]
cmp pos, tmp
je .return_pass
;; Tail len
mov pos, len ;Overlapped offset length-16
jmp .loop16 ;Do one more overlap pass
.return_pass:
mov return, 0
FUNC_RESTORE
ret
.return_fail:
mov return, 1
FUNC_RESTORE
ret
endproc_frame
section .data
align 16
mask0f:
ddq 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
;;; func core, ver, snum
slversion gf_vect_dot_prod_avx, 02, 05, 0061
| 22.382353
| 72
| 0.678055
|
171a2373fa0d19b037a65d617daeed14ea14a4d6
| 357
|
asm
|
Assembly
|
Lab2/Lab2/lab2.asm
|
ConstantinCezB/Computer-Architecture-assembly
|
24ddc05c96d2be019c77e914a3b1146352b4088e
|
[
"Apache-2.0"
] | null | null | null |
Lab2/Lab2/lab2.asm
|
ConstantinCezB/Computer-Architecture-assembly
|
24ddc05c96d2be019c77e914a3b1146352b4088e
|
[
"Apache-2.0"
] | null | null | null |
Lab2/Lab2/lab2.asm
|
ConstantinCezB/Computer-Architecture-assembly
|
24ddc05c96d2be019c77e914a3b1146352b4088e
|
[
"Apache-2.0"
] | null | null | null |
TITLE Lab2
INCLUDE Irvine32.inc
.data
val1 dword 4040h
val2 dword 1555h
val3 byte "Hello World"
.code
main PROC
mov EDX, offset val3
call WriteString
call crlf
mov EAX, val1
add EAX, val2
mov ECX, val2
sub ECX, 500h
mov EBX, 3000h
add EAX, EBX
sub EAX, ECX
add val2, ECX
mov EAX, 1111h
add val1, EAX
call DumpRegs
exit
main ENDP
END main
| 12.310345
| 23
| 0.72549
|
94b447a468cf9d420a56836fab3c97f2c18d3a45
| 447
|
asm
|
Assembly
|
oeis/064/A064917.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/064/A064917.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/064/A064917.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A064917: a(n) is the result of beginning with n and iterating k -> A064916(k) until a prime is reached.
; 2,3,3,5,3,7,5,5,3,11,7,13,5,7,5,17,3,19,11,5,7,23,13,5,5,11,7,29,5,31,17,13,3,11,19,37,11,7,5,41,7,43,23,17,13,47,5,13,5,19,11,53,7,7,29,5,5,59,31,61,17,23,13,17,3,67,11,5,19,71,37,73,11,11,7,17,5,79,41,29,7,83,43,5,23,31,17,89,13,19,47,13,5,23,13,97,5,11,19,101
lpb $0
add $0,1
add $2,1
dif $2,$0
sub $0,2
lpe
mov $0,$2
add $0,2
| 37.25
| 264
| 0.619687
|
89c85354bf9e94a8bb3bec6d9b63c53eca916744
| 993
|
asm
|
Assembly
|
oeis/286/A286771.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/286/A286771.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/286/A286771.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A286771: Binary representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 221", based on the 5-celled von Neumann neighborhood.
; Submitted by Jon Maiga
; 1,1,0,111,10000,11111,1000000,1111111,100000000,111111111,10000000000,11111111111,1000000000000,1111111111111,100000000000000,111111111111111,10000000000000000,11111111111111111,1000000000000000000,1111111111111111111,100000000000000000000,111111111111111111111,10000000000000000000000,11111111111111111111111,1000000000000000000000000,1111111111111111111111111,100000000000000000000000000,111111111111111111111111111,10000000000000000000000000000,11111111111111111111111111111
mov $1,$0
seq $0,280411 ; Binary representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 261", based on the 5-celled von Neumann neighborhood.
cmp $1,2
cmp $1,0
mul $0,$1
| 99.3
| 479
| 0.847936
|
b27c0b8dd63160cb976db26e9ef745d3f98fa000
| 66
|
asm
|
Assembly
|
src/test/resources/data/generationtests/sjasm-sjasmplus-abyte-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 36
|
2020-06-29T06:52:26.000Z
|
2022-02-10T19:41:58.000Z
|
src/test/resources/data/generationtests/sjasm-sjasmplus-abyte-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 39
|
2020-07-02T18:19:34.000Z
|
2022-03-27T18:08:54.000Z
|
src/test/resources/data/generationtests/sjasm-sjasmplus-abyte-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 7
|
2020-07-02T06:00:05.000Z
|
2021-11-28T17:31:13.000Z
|
db 0 + 1, 1 + 1, 2 + 1, 3 + 1
db "a" + 3, "b" + 3, "c" + 3
| 33
| 33
| 0.272727
|
a479bb93ac293ebb3e9a41c90bae29e5fe08c779
| 583
|
asm
|
Assembly
|
programs/oeis/231/A231504.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/231/A231504.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/231/A231504.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A231504: a(n) = Sum_{i=0..n} digsum_3(i)^3, where digsum_3(i) = A053735(i).
; 0,1,9,10,18,45,53,80,144,145,153,180,188,215,279,306,370,495,503,530,594,621,685,810,874,999,1215,1216,1224,1251,1259,1286,1350,1377,1441,1566,1574,1601,1665,1692,1756,1881,1945,2070,2286,2313,2377,2502,2566,2691,2907,3032,3248,3591,3599,3626,3690,3717,3781,3906,3970,4095,4311,4338,4402,4527,4591,4716
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,173523 ; 1+A053735(n-1), where A053735 is the sum-of-digits function in base 3.
sub $0,1
pow $0,3
add $1,$0
lpe
mov $0,$1
| 36.4375
| 304
| 0.682676
|
1658ec1d1036ec05b0af1b4ab9fceb9cfad2c2e0
| 6,456
|
asm
|
Assembly
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca_notsx.log_21829_674.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca_notsx.log_21829_674.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca_notsx.log_21829_674.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x9866, %rdx
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%rdx), %r10w
nop
nop
nop
nop
inc %r12
lea addresses_normal_ht+0x12460, %rsi
lea addresses_D_ht+0x1c4a0, %rdi
add $27390, %r11
mov $0, %rcx
rep movsw
nop
nop
nop
nop
nop
and $39610, %rdx
lea addresses_WT_ht+0x12a60, %rdi
nop
nop
nop
xor %rdx, %rdx
mov (%rdi), %r12d
nop
nop
nop
dec %rdx
lea addresses_UC_ht+0x3ae0, %rsi
dec %rdx
mov $0x6162636465666768, %r12
movq %r12, (%rsi)
nop
nop
add %rcx, %rcx
lea addresses_D_ht+0xf220, %rsi
lea addresses_WT_ht+0x52a0, %rdi
nop
nop
nop
nop
sub %r9, %r9
mov $40, %rcx
rep movsw
nop
nop
nop
xor %rdx, %rdx
lea addresses_UC_ht+0x128a0, %r11
nop
nop
nop
nop
cmp %r12, %r12
movb $0x61, (%r11)
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0xdb60, %rsi
lea addresses_WC_ht+0x1ce20, %rdi
nop
add %r10, %r10
mov $37, %rcx
rep movsl
nop
and $5624, %r12
lea addresses_A_ht+0x1caa0, %rdi
nop
nop
dec %rsi
vmovups (%rdi), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %r10
nop
nop
and $42703, %rsi
lea addresses_WC_ht+0xf4a0, %rdi
nop
sub %r9, %r9
mov (%rdi), %ecx
nop
nop
nop
add $12028, %rdi
lea addresses_normal_ht+0x18458, %rsi
lea addresses_WT_ht+0x1b0a0, %rdi
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov $101, %rcx
rep movsl
nop
nop
nop
cmp $51508, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %rax
// Faulty Load
mov $0x4e142c00000000a0, %rax
add $50166, %r13
mov (%rax), %r11
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %rax
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'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
*/
| 37.976471
| 2,999
| 0.660006
|
f95e8f2d433ee9b3ffd4223fdfd1ab4d9afad7b4
| 9,461
|
asm
|
Assembly
|
Trabalho3.asm
|
LSantos06/AssemblerRAWImages
|
dd713428d03b5cc3974dc353b3c2f454bb08f137
|
[
"MIT"
] | null | null | null |
Trabalho3.asm
|
LSantos06/AssemblerRAWImages
|
dd713428d03b5cc3974dc353b3c2f454bb08f137
|
[
"MIT"
] | null | null | null |
Trabalho3.asm
|
LSantos06/AssemblerRAWImages
|
dd713428d03b5cc3974dc353b3c2f454bb08f137
|
[
"MIT"
] | null | null | null |
## Trabalho 3 - Organizacao e Arquitetura de Computadores
## Lucas Nascimento Santos Souza - 14/0151010
## Configuracao do MARS
# Memoria: default
# Unidade de largura em pixels: 4
# Unidade de altura em pixels: 4
# Largura do display: 256
# Altura do display: 256
# Endereco base do display: 0x10040000 (heap)
.data
title: .asciiz "\n ********* RAW Images in MIPS *********\n"
load_img_menu: .asciiz "1 - Load Img\n"
get_pixel_menu: .asciiz "2 - Get Pixel\n"
set_pixel_menu: .asciiz "3 - Set Pixel\n"
grey_menu: .asciiz "4 - 255 Grey Scale\n"
exit_menu: .asciiz "5 - Exit\n"
menu_msg: .asciiz "Digite o valor correspondente a operacao desejada: "
pixel_x_msg: .asciiz "\nDigite o valor da linha x (de 0 a 63): "
pixel_y_msg: .asciiz "Digite o valor da coluna y (de 0 a 63): "
pixel_R_msg: .asciiz "\nDigite o valor de R (de 0 a 255): "
pixel_G_msg: .asciiz "Digite o valor de G (de 0 a 255): "
pixel_B_msg: .asciiz "Digite o valor de B (de 0 a 255): "
pixel_msg: .asciiz "\nValor do pixel: "
erro_pixel_msg: .asciiz "\nDigite um valor valido!"
erro_arq_msg: .asciiz "\nErro ao abrir arquivo, verifique o diretorio e o nome do mesmo!"
pixel_R: .asciiz "\nR: "
pixel_G: .asciiz "\nG: "
pixel_B: .asciiz "\nB: "
file: .asciiz "image.raw"
buffer: .word 0
.text
# Interface com o usuario
menu:
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, title
syscall
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, load_img_menu
syscall
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, get_pixel_menu
syscall
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, set_pixel_menu
syscall
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, grey_menu
syscall
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, exit_menu
syscall
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, menu_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Variaveis
la $s1, buffer # Carrega o endereco do buffer
add $s2, $zero, 0x10040000 # Endereco do heap
add $t0, $zero, $zero # Contador iniciado com 0
addi $t1, $zero, 3 # Le 1 pixel
# Menu
beq $v0, 1, read_img # -> load_img
beq $v0, 2, get_pixel # -> get_pixel
beq $v0, 3, set_pixel # -> set_pixel
beq $v0, 4, grey # -> grey
beq $v0, 5, exit # -> exit
j menu # loop
# Leitura de um arquivo binario com uma descricao de uma figura colorida no formato RGB
# Exibicao da figura no mostrador grafico
## Variaveis
# s0 => File Descriptor
# s1 => Endereco inicial do Buffer
# s2 => Endereco do heap, para display
# s7 => load_img || grey
# t0 => Contador
# t1 => 1 pixel lido
# t2 => Valor do buffer
read_img:
# Abertura do arquivo
addi $v0, $zero, 13 # Codigo para abrir um arquivo
la $a0, file
li $a1, 0 # 0 para ler, 1 para escrever
li $a2, 0 # mode
syscall
# Tratamento de erros
bltz $v0, erro_arquivo
move $s0, $v0 # Salva o file descriptor
j load_img
load_img:
# Convertendo para 4 bytes
beq $t0, 12288, close_img
# Leitura do arquivo
addi $v0, $zero, 14 # Codigo para ler um arquivo
move $a0, $s0 # File descriptor
la $a1, buffer
la $a2, 0($t1) # Le 1 pixel
syscall
# 0
sb $zero, 3($s1) # Armazena 0 no msbyte
# Armazenando no display
lw $t2, 0($s1) # Conteudo do buffer no $t2
sw $t2, 0($s2) # Armazena o conteudo do buffer no endereco do display $s2
# Incrementando as variaveis do laco
addi $t0, $t0, 3 # Incrementa o contador em 3, numero de bytes lidos
addi $s2, $s2, 4 # Proximo pixel do display
j load_img
close_img:
# Fechamento do arquivo
addi $v0, $zero, 16 # Codigo para fechar um arquivo
move $a0, $s0 # File descriptor
syscall
j menu # return
# Leitura de pixels da imagem, get_pixel(x,y), imprime os valores RGB do pixel
## Variaveis
# s3 => valor do x
# s4 => valor do y
# t3 => Endereco pixel desejado
# t4 => Pixel desejado
get_pixel:
# X
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_x_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 63, erro_pixel
blt $v0, 0, erro_pixel
add $s3, $zero, $v0 # valor do x
sll $s3, $s3, 2 # Multiplica x por 4
# Y
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_y_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 63, erro_pixel
blt $v0, 0, erro_pixel
add $s4, $zero, $v0 # valor do y
sll $s4, $s4, 8 # Multiplica y por 64*4
# Endereco do pixel desejado $t3
add $t3, $s4, $s3 # x + y
addi $t3, $t3, 0x10040000 # Endereco do heap + Endereco de deslocamento
# Pixel desejado $t4
lw $t4, 0($t3) # Endereco do pixel desejado em $t3
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_msg
syscall
addi $v0, $zero, 34 # Codigo para imprimir uma hexadecimal = 34
add $a0, $zero, $t4
syscall
# R
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_R
syscall
addi $v0, $zero, 1 # Codigo para imprimir um inteiro = 1
lbu $a0, 2($t3) # 0x00RR0000
syscall
# G
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_G
syscall
addi $v0, $zero, 1 # Codigo para imprimir um inteiro = 1
lbu $a0, 1($t3) # 0x0000GG00
syscall
# B
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_B
syscall
addi $v0, $zero, 1 # Codigo para imprimir um inteiro = 1
lbu $a0, 0($t3) # 0x000000BB
syscall
j menu # return
# Escrita de pixels da imagem, set_pixel(x,y,valor), solicita o RGB do teclado, e escreve no pixel indicado
# s3 => valor do x
# s4 => valor do y
# t2 => Endereco inicial do Buffer q contem o novo pixel
# t3 => Endereco pixel desejado
# t4 => Pixel desejado
set_pixel:
# X
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_x_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 63, erro_pixel
blt $v0, 0, erro_pixel
add $s3, $zero, $v0 # valor do x
sll $s3, $s3, 2 # Multiplica x por 4
# Y
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_y_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 63, erro_pixel
blt $v0, 0, erro_pixel
add $s4, $zero, $v0 # valor do y
sll $s4, $s4, 8 # Multiplica y por 64*4
# Buffer
la $t2, buffer
# Endereco do pixel desejado $t3
add $t3, $s4, $s3 # x + y
addi $t3, $t3, 0x10040000 # Endereco do heap + Endereco de deslocamento
# Pixel atual $t4
lw $t4, 0($t3) # Endereco do pixel desejado em $t3
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_msg
syscall
addi $v0, $zero, 34 # Codigo para imprimir uma hexadecimal = 34
add $a0, $zero, $t4
syscall
# R
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_R_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 255, erro_pixel
blt $v0, 0, erro_pixel
sb $v0, 2($t2) # Armazena o novo R
# G
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_G_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 255, erro_pixel
blt $v0, 0, erro_pixel
sb $v0, 1($t2) # Armazena o novo G
# B
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_B_msg
syscall
li $v0, 5 # Le um valor inteiro do teclado
syscall
# Tratamento de erro
bgt $v0, 255, erro_pixel
blt $v0, 0, erro_pixel
sb $v0, 0($t2) # Armazena o novo B
# 0
sb $zero, 3($t2) # Armazena o 0x00 no msbyte
# Passando o buffer para o display
lw $t4, 0($t2) # Conteudo do buffer no $t2
sw $t4, 0($t3) # Armazena o conteudo do buffer no endereco do display $s2
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, pixel_msg
syscall
addi $v0, $zero, 34 # Codigo para imprimir uma hexadecimal = 34
add $a0, $zero, $t4
syscall
j menu # return
# Conversao para cinza, para cada pixel, deve-se atribuir R=G=B=media(R,G,B)
## Variaveis
# s0 => File Descriptor
# s1 => Endereco inicial do Buffer
# s2 => Endereco do heap, para display
# t0 => Contador
# t1 => 1 pixel lido
# t2 => media(R,G,B)
# t3 => G
# t4 => R
# t5 => Buffer auxiliar
grey:
# Convertendo para 4 bytes
beq $t0, 12288, close_img
# Buffer
add $s1, $zero, $s2
# Calculando a media
lbu $t2, 0($s1) # Armazena o B, 0x000000BB => 0xBB
lbu $t3, 1($s1) # Armazena o G, 0x0000GG00 => 0xGG
lbu $t4, 2($s1) # Armazena o R, 0x00RR0000 => 0xRR
add $t2, $t2, $t3 # B+G
add $t2, $t2, $t4 # R+B+G
divu $t2, $t2, 3 # (R+G+B)/3
# Colocando a media no R,G e B no bufer
sb $t2, 0($s1)
sb $t2, 1($s1)
sb $t2, 2($s1)
sb $zero, 3($s1)
# Passando o buffer para o display
lw $t5, 0($s1)
sw $t5, 0($s2)
# Incrementando as variaveis do laco
addi $t0, $t0, 3 # Incrementa o contador em 3, numero de bytes lidos
addi $s1, $s1, 4 # Proximo pixel do heap
addi $s2, $s2, 4 # Proximo pixel do display
j grey
# Tratamento de erros
erro_pixel:
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, erro_pixel_msg
syscall
j menu
erro_arquivo:
addi $v0, $zero, 4 # Codigo para imprimir uma string = 4
la $a0, erro_arq_msg
syscall
j exit
# Termino do programa
exit:
li $v0, 10 # Codigo para terminar o programa = 10
syscall
| 22.52619
| 107
| 0.653631
|
0137f9bfe8c9e2a861119e7994fa338b7ad52345
| 11,241
|
asm
|
Assembly
|
mcc_structure_access/main.asm
|
YaMike/lnx
|
272b747e50f4d19d5de1c97b382701e30b6b0336
|
[
"MIT"
] | null | null | null |
mcc_structure_access/main.asm
|
YaMike/lnx
|
272b747e50f4d19d5de1c97b382701e30b6b0336
|
[
"MIT"
] | null | null | null |
mcc_structure_access/main.asm
|
YaMike/lnx
|
272b747e50f4d19d5de1c97b382701e30b6b0336
|
[
"MIT"
] | null | null | null |
main: file format elf32-littlearc
Disassembly of section .init:
00010264 <_init-0x4>:
10264: 00 00 00 00
00010268 <_init>:
10268: f1 c0 push_s blink
1026a: e0 78 nop_s
1026c: d2 08 00 00 bl 1033c <frame_dummy>
10270: 4a 0a 00 00 bl 104b8 <__do_global_ctors_aux>
10274: d1 c0 pop_s blink
10276: e0 7e j_s [blink]
Disassembly of section .plt:
00010278 <.plt>:
10278: 00 16 0b 70 01 00 24 26 ld r11,[0x00012624]
10280: 00 16 0a 70 01 00 28 26 ld r10,[0x00012628]
10288: 20 20 80 02 j [r10]
1028c: 20 26 01 00 j [r0]
10290: 30 27 8c 7f 00 00 9c 23 ld r12,[pcl,0x239c]
10298: 20 7c j_s.d [r12]
1029a: ef 74 mov_s r12,pcl
1029c: 30 27 8c 7f 00 00 94 23 ld r12,[pcl,0x2394]
102a4: 20 7c j_s.d [r12]
102a6: ef 74 mov_s r12,pcl
Disassembly of section .text:
000102a8 <__start>:
102a8: 4a 23 00 30 mov fp,0
102ac: 00 c1 ld_s r1,[sp,0]
102ae: b8 70 mov_s r5,r0
102b0: 81 c2 add_s r2,sp,4
102b2: cf 70 01 00 78 03 mov_s r0,0x00010378
102b8: cf 73 01 00 68 02 mov_s r3,0x00010268
102be: 0a 24 80 0f 01 00 00 05 mov r4,0x00010500
102c6: 84 24 3f 3e and sp,sp,-8
102ca: 0a 26 00 07 mov r6,sp
102ce: d2 0f cf ff bl 1029c <_init+0x34>
102d2: 07 00 00 00 b 102d6 <_exit_halt>
000102d6 <_exit_halt>:
102d6: 69 20 40 00 flag 1
102da: 4a 26 00 70 nop
102de: 4a 26 00 70 nop
102e2: 4a 26 00 70 nop
102e6: f3 07 cf ff b 102d6 <_exit_halt>
102ea: 4a 26 00 70 nop
...
000102f0 <__do_global_dtors_aux>:
102f0: f1 c0 push_s blink
102f2: fc 1c c8 b6 st.a fp,[sp,-4]
102f6: 0a 23 00 37 mov fp,sp
102fa: 00 16 82 70 01 00 34 26 ldb r2,[0x00012634]
10302: 0b ea breq_s r2,0,10316 <__do_global_dtors_aux+0x26>
10304: 29 00 00 00 b 1032c <__do_global_dtors_aux+0x3c>
10308: 44 6a add_s r2,r2,4
1030a: 00 1e 80 70 01 00 70 25 st r2,[0x00012570]
10312: 22 20 c0 00 jl [r3]
10316: 00 16 02 70 01 00 70 25 ld r2,[0x00012570]
1031e: 60 82 ld_s r3,[r2,0]
10320: f4 eb brne_s r3,0,10308 <__do_global_dtors_aux+0x18>
10322: 01 da mov_s r2,1
10324: 00 1e 82 70 01 00 34 26 stb r2,[0x00012634]
1032c: 04 14 1b 34 ld.ab fp,[sp,4]
10330: 00 14 1f 32 ld.a blink,[sp,0]
10334: e0 7f j_s.d [blink]
10336: 40 24 1c 31 add sp,sp,4
1033a: e0 78 nop_s
0001033c <frame_dummy>:
1033c: f8 1c c8 b6 st.a fp,[sp,-8]
10340: 0a 23 00 37 mov fp,sp
10344: 00 16 02 70 01 00 1c 26 ld r2,[0x0001261c]
1034c: 4b 7a tst_s r2,r2
1034e: 20 00 01 00 bz 1036c <frame_dummy+0x30>
10352: cf 72 00 00 00 00 mov_s r2,0
10358: 4b 7a tst_s r2,r2
1035a: 14 00 01 00 bz 1036c <frame_dummy+0x30>
1035e: cf 70 01 00 1c 26 mov_s r0,0x0001261c
10364: 04 14 1b 34 ld.ab fp,[sp,4]
10368: a1 c0 add_s sp,sp,4
1036a: 00 7a j_s [r2]
1036c: 04 14 1b 34 ld.ab fp,[sp,4]
10370: e0 7f j_s.d [blink]
10372: 40 24 1c 31 add sp,sp,4
10376: e0 78 nop_s
00010378 <main>:
10378: f1 c0 push_s blink
1037a: fc 1c c8 b6 st.a fp,[sp,-4]
1037e: 0a 23 00 37 mov fp,sp
10382: a6 c1 sub_s sp,sp,24
10384: f0 1b 00 b0 st r0,[fp,-16]
10388: ec 1b 40 b0 st r1,[fp,-20]
1038c: cf 72 01 00 38 26 mov_s r2,0x00012638
10392: f4 1b 80 b0 st r2,[fp,-12]
10396: f4 13 02 b0 ld r2,[fp,-12]
1039a: 40 82 ld_s r2,[r2,0]
1039c: cf 70 01 00 18 05 mov_s r0,0x00010518
103a2: 48 71 mov_s r1,r2
103a4: ee 0e cf ff bl 10290 <_init+0x28>
103a8: f4 13 03 b0 ld r3,[fp,-12]
103ac: 01 da mov_s r2,1
103ae: 40 a3 st_s r2,[r3,0]
103b0: f4 13 03 b0 ld r3,[fp,-12]
103b4: 00 da mov_s r2,0
103b6: 41 a3 st_s r2,[r3,4]
103b8: f4 13 03 b0 ld r3,[fp,-12]
103bc: 01 da mov_s r2,1
103be: 42 a3 st_s r2,[r3,8]
103c0: f4 13 03 b0 ld r3,[fp,-12]
103c4: 02 da mov_s r2,2
103c6: 43 a3 st_s r2,[r3,12]
103c8: f4 13 03 b0 ld r3,[fp,-12]
103cc: 03 da mov_s r2,3
103ce: 44 a3 st_s r2,[r3,16]
103d0: f4 13 03 b0 ld r3,[fp,-12]
103d4: 04 da mov_s r2,4
103d6: 45 a3 st_s r2,[r3,20]
103d8: f4 13 03 b0 ld r3,[fp,-12]
103dc: 05 da mov_s r2,5
103de: 46 a3 st_s r2,[r3,24]
103e0: f4 13 03 b0 ld r3,[fp,-12]
103e4: 06 da mov_s r2,6
103e6: 47 a3 st_s r2,[r3,28]
103e8: f4 13 03 b0 ld r3,[fp,-12]
103ec: 07 da mov_s r2,7
103ee: 48 a3 st_s r2,[r3,32]
103f0: f4 13 03 b0 ld r3,[fp,-12]
103f4: 08 da mov_s r2,8
103f6: 49 a3 st_s r2,[r3,36]
103f8: f4 13 03 b0 ld r3,[fp,-12]
103fc: 09 da mov_s r2,9
103fe: 4a a3 st_s r2,[r3,40]
10400: f4 13 02 b0 ld r2,[fp,-12]
10404: 40 82 ld_s r2,[r2,0]
10406: cf 70 01 00 18 05 mov_s r0,0x00010518
1040c: 48 71 mov_s r1,r2
1040e: 86 0e cf ff bl 10290 <_init+0x28>
10412: 00 da mov_s r2,0
10414: f8 1b 80 b0 st r2,[fp,-8]
10418: 2b 00 00 00 b 10442 <main+0xca>
1041c: f8 13 02 b0 ld r2,[fp,-8]
10420: f4 13 03 b0 ld r3,[fp,-12]
10424: 41 6a add_s r2,r2,1
10426: f0 23 82 00 ld.as r2,[r3,r2]
1042a: cf 70 01 00 24 05 mov_s r0,0x00010524
10430: f8 13 01 b0 ld r1,[fp,-8]
10434: 5e 0e cf ff bl 10290 <_init+0x28>
10438: f8 13 02 b0 ld r2,[fp,-8]
1043c: 41 6a add_s r2,r2,1
1043e: f8 1b 80 b0 st r2,[fp,-8]
10442: f8 13 02 b0 ld r2,[fp,-8]
10446: 89 e2 cmp_s r2,9
10448: d4 07 cc ff ble 1041c <main+0xa4>
1044c: 00 da mov_s r2,0
1044e: fc 1b 80 b0 st r2,[fp,-4]
10452: f4 13 02 b0 ld r2,[fp,-12]
10456: 40 82 ld_s r2,[r2,0]
10458: cf 70 01 00 30 05 mov_s r0,0x00010530
1045e: 48 71 mov_s r1,r2
10460: 32 0e cf ff bl 10290 <_init+0x28>
10464: cf 70 01 00 38 26 mov_s r0,0x00012638
1046a: 42 08 00 00 bl 104a8 <set_bit_test>
1046e: fc 1b 00 b0 st r0,[fp,-4]
10472: cf 70 01 00 44 05 mov_s r0,0x00010544
10478: fc 13 01 b0 ld r1,[fp,-4]
1047c: 16 0e cf ff bl 10290 <_init+0x28>
10480: f4 13 02 b0 ld r2,[fp,-12]
10484: 40 82 ld_s r2,[r2,0]
10486: cf 70 01 00 58 05 mov_s r0,0x00010558
1048c: 48 71 mov_s r1,r2
1048e: 06 0e cf ff bl 10290 <_init+0x28>
10492: 00 da mov_s r2,0
10494: 48 70 mov_s r0,r2
10496: a6 c0 add_s sp,sp,24
10498: 04 14 1b 34 ld.ab fp,[sp,4]
1049c: 00 14 1f 32 ld.a blink,[sp,0]
104a0: e0 7f j_s.d [blink]
104a2: 40 24 1c 31 add sp,sp,4
104a6: e0 78 nop_s
000104a8 <set_bit_test>:
104a8: e1 c1 push_s r1
104aa: 20 80 ld_s r1,[r0,0]
104ac: 0a d9 mov_s r1,10
104ae: 20 a0 st_s r1,[r0,0]
104b0: 28 70 mov_s r0,r1
104b2: c1 c1 pop_s r1
104b4: 20 20 c0 07 j [blink]
000104b8 <__do_global_ctors_aux>:
104b8: f1 c0 push_s blink
104ba: f8 1c 48 b3 st.a r13,[sp,-8]
104be: fc 1c c8 b6 st.a fp,[sp,-4]
104c2: 0a 23 00 37 mov fp,sp
104c6: 00 16 02 70 01 00 0c 26 ld r2,[0x0001260c]
104ce: cf 75 01 00 0c 26 mov_s r13,0x0001260c
104d4: 19 0a 80 0f ff ff ff ff breq r2,-1,104ec <__do_global_ctors_aux+0x34>
104dc: 22 20 80 00 jl [r2]
104e0: fc 15 02 92 ld.a r2,[r13,-4]
104e4: f9 0a 81 8f ff ff ff ff brne r2,-1,104dc <__do_global_ctors_aux+0x24>
104ec: 04 14 1b 34 ld.ab fp,[sp,4]
104f0: 02 14 1f 36 ld.as blink,[sp,2]
104f4: 00 c5 ld_s r13,[sp,0]
104f6: e0 7f j_s.d [blink]
104f8: 40 24 1c 33 add sp,sp,12
Disassembly of section .fini:
000104fc <_fini-0x4>:
104fc: 00 00 00 00
00010500 <_fini>:
10500: f1 c0 push_s blink
10502: e0 78 nop_s
10504: ee 0d cf ff bl 102f0 <__do_global_dtors_aux>
10508: d1 c0 pop_s blink
1050a: e0 7e j_s [blink]
| 45.881633
| 86
| 0.415177
|
19f735324b0c27834b5e41f19b795a3be8bd90a8
| 319
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/l/sccz80/crt0_long/l_long_gt.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/l/sccz80/crt0_long/l_long_gt.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/l/sccz80/crt0_long/l_long_gt.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; Z88 Small C+ Run Time Library
; Long functions
;
SECTION code_clib
SECTION code_l_sccz80
PUBLIC l_long_gt
EXTERN l_long_cmp
l_long_gt:
; PRIMARY > SECONDARY? [signed], carry if true
; HL set to 0 (false) or 1 (true)
call l_long_cmp
jr z, false
ccf
ret c
false:
dec l
ret
| 11.814815
| 49
| 0.645768
|
4148348670d99e562b4fc78e5bb34624bae19ba6
| 270
|
asm
|
Assembly
|
libsrc/target/zx/basic/zx_setint.asm
|
ahjelm/z88dk
|
c4de367f39a76b41f6390ceeab77737e148178fa
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/target/zx/basic/zx_setint.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/target/zx/basic/zx_setint.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; int zx_setint(char *variable, int value)
; CALLER linkage for function pointers
SECTION code_clib
PUBLIC zx_setint
PUBLIC _zx_setint
EXTERN asm_zx_setint
.zx_setint
._zx_setint
pop bc
pop de
pop hl
push hl
push de
push bc
jp asm_zx_setint
| 12.857143
| 42
| 0.72963
|
490d54298230bb65de41228cd85167dde5a76e33
| 1,017
|
asm
|
Assembly
|
Chapter_10/Program 10.6/Program_10.6_NASM_Linux.asm
|
chen150182055/Assembly
|
e5e76bea438a3752b59775098205a77aa7087110
|
[
"MIT"
] | 272
|
2016-12-28T02:24:21.000Z
|
2022-03-30T21:05:37.000Z
|
Chapter_10/Program 10.6/Program_10.6_NASM_Linux.asm
|
chen150182055/Assembly
|
e5e76bea438a3752b59775098205a77aa7087110
|
[
"MIT"
] | 1
|
2018-04-17T19:47:52.000Z
|
2018-04-17T19:47:52.000Z
|
Chapter_10/Program 10.6/Program_10.6_NASM_Linux.asm
|
chen150182055/Assembly
|
e5e76bea438a3752b59775098205a77aa7087110
|
[
"MIT"
] | 62
|
2017-02-02T14:39:37.000Z
|
2022-01-04T09:02:07.000Z
|
; Program 10.6
; SYSCALL on Linux (NASM 64-bit)
; Copyright (c) 2017 Hall & Slonka
section .data
output: DB "Computer Architecture",0Ah
len: DQ ($ - output)
file_name: DB "output.txt",0
file_handle: DD 0
section .text
global _main
_main:
mov rax, 1 ; system write (1)
mov rdi, 1 ; file handle STDOUT (1)
lea rsi, [rel output] ; address
mov rdx, [len] ; length
syscall
mov rax, 2 ; system open (2)
lea rdi, [rel file_name] ; path
mov rsi, 0101o ; flags (01=O_CREAT, 01=O_WRONLY)
mov rdx, 0666o ; mode (permissions)
syscall
mov [rel file_handle], rax
mov rax, 1 ; system write (1)
mov rdi, [rel file_handle] ; file handle
lea rsi, [rel output] ; address
mov rdx, [len] ; length
syscall
mov rax, 3 ; system close (3)
mov rdi, [rel file_handle] ; file handle
syscall
mov rax, 60 ; system exit
xor rdi, rdi ; return value
syscall
| 24.804878
| 61
| 0.571288
|
716bac213ed6e59e104e3c904b12a326b02cb6a8
| 1,837
|
asm
|
Assembly
|
symbolinen_konekieli/Ratol_msdos/etsi.asm
|
tkukka/VariousContent
|
f7e7ae98ff8521c6c709dabe30855104afe3fe04
|
[
"MIT"
] | null | null | null |
symbolinen_konekieli/Ratol_msdos/etsi.asm
|
tkukka/VariousContent
|
f7e7ae98ff8521c6c709dabe30855104afe3fe04
|
[
"MIT"
] | null | null | null |
symbolinen_konekieli/Ratol_msdos/etsi.asm
|
tkukka/VariousContent
|
f7e7ae98ff8521c6c709dabe30855104afe3fe04
|
[
"MIT"
] | null | null | null |
;RaTol Symbolinen konekieli: Harjoitus 3, tehtävä 1
;Tero Kukka IY96A
;Tiedosto: etsi.asm
;Luotu 15.3.1998
;Aliohjelma _Etsi
;Hakee taulukon osoitteen ja alkioiden lukumäärän PINOSTA
;Etsii pienimmän tavun ja palauttaa sen al:ssä.
;Aliohjelmien esittely:
public _Etsi
.model small ;muistimalli
.stack 00h ;pinon koko
.data ;muuttujalohko
.code ;ohjelmakoodi alkaa
_Etsi proc ;int _Etsi(int *luvut, const int TAVUJA);
push bp ;pinossa: etum., tavujen lkm, ds, &luvut, ip, bp
mov bp, sp
push si
push ds
push cx
push dx
mov si, [bp + 4] ;offset
mov ds, [bp + 6] ;ds
mov cx, [bp + 8] ;tavujen lkm
mov dx, [bp + 10] ;unsigned/signed
mov al, [si] ;1. alkio valmiiksi al:ään
inc si
dec cx
or dx, dx ;onko dx != 0?
jnz TOISTA2 ;jos on, niin signed vertailuun
;unsigned-vertailu
TOISTA1:
test al, al ;jos löytyy 0, lopetetaan
jz LOPPU
cmp al, [si]
jbe SEURAAVA1 ;al <= [si] -> hyppy
mov al, [si] ;al > [si] -> al=[si]
SEURAAVA1:
inc si
loop TOISTA1
jmp LOPPU
;signed-vertailu:
TOISTA2:
cmp al, 80h ;jos löytyy -128, lopetetaan
jz LOPPU
cmp al, [si]
jle SEURAAVA2 ;al <= [si] -> hyppy
mov al, [si] ;al > [si] -> al=[si]
SEURAAVA2:
inc si
loop TOISTA2
;loppu, pinon palautus
LOPPU:
pop dx
pop cx
pop ds
pop si
pop bp ;bp takaisin
ret 8 ;8 tavun vapautus paluussa
_Etsi endp
end
| 25.164384
| 78
| 0.49374
|
1418f4d8e23668e5558f32ce1e6de7cf29b680f2
| 761
|
asm
|
Assembly
|
src/XenobladeChroniclesX/Mods/FrontierNavProbeResourceQuantity/patch_resource_qu.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 1,002
|
2017-01-10T13:10:55.000Z
|
2020-11-20T18:34:19.000Z
|
src/XenobladeChroniclesX/Mods/FrontierNavProbeResourceQuantity/patch_resource_qu.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 347
|
2017-01-11T21:13:20.000Z
|
2020-11-27T11:33:05.000Z
|
src/XenobladeChroniclesX/Mods/FrontierNavProbeResourceQuantity/patch_resource_qu.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 850
|
2017-01-10T06:06:43.000Z
|
2020-11-06T21:16:49.000Z
|
[XCX_FN_RES_QTY_ALL] ######################################################################
moduleMatches = 0xF882D5CF, 0x30B6E091, 0xAB97DE6B ; 1.0.1E, 1.0.2U, 1.0.1U
.origin = codecave
.int $mod
; ----------------------------------------------------------------------------
; WHAT : changeTime__Q2_4fnet9CFnetTaskFUiT1
; WHY :
_multCount:
lbz r0, 6(r31)
li r3, $mod
mullw r0, r0, r3
stb r0, 6(r31)
blr
[XCX_FN_RES_QTY] ######################################################################
moduleMatches = 0xF882D5CF, 0x30B6E091 ; 1.0.1E, 1.0.2U
0x027D5428 = bla _multCount
[XCX_FN_RES_QTY_1U] ######################################################################
moduleMatches = 0xAB97DE6B ; 1.0.1U
0x027D53C8 = bla _multCount
| 27.178571
| 91
| 0.432326
|
7976959defacfa8582952adf333c9875108a07dd
| 876
|
asm
|
Assembly
|
unittests/ASM/TwoByte/0F_BC.asm
|
cobalt2727/FEX
|
13087f8425aeaad28dc81bed46a83e1d72ff0db8
|
[
"MIT"
] | 628
|
2020-03-06T14:01:32.000Z
|
2022-03-31T06:35:14.000Z
|
unittests/ASM/TwoByte/0F_BC.asm
|
cobalt2727/FEX
|
13087f8425aeaad28dc81bed46a83e1d72ff0db8
|
[
"MIT"
] | 576
|
2020-03-06T08:25:12.000Z
|
2022-03-30T04:05:29.000Z
|
unittests/ASM/TwoByte/0F_BC.asm
|
cobalt2727/FEX
|
13087f8425aeaad28dc81bed46a83e1d72ff0db8
|
[
"MIT"
] | 38
|
2020-03-07T06:10:00.000Z
|
2022-03-29T09:27:36.000Z
|
%ifdef CONFIG
{
"RegData": {
"R15": "0xFFFFFFFFFFFF0000",
"R14": "0x0",
"R13": "0x0",
"R12": "0xFFFFFFFFFFFF0004",
"R11": "0x04",
"R10": "0x04",
"R9": "0xFFFFFFFFFFFFFFFF",
"R8": "0xFFFFFFFFFFFFFFFF",
"RSI": "0xFFFFFFFFFFFFFFFF"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0xFFFFFFFFFFFFFFFF
mov [rdx + 8 * 0], rax
mov rax, 0x1010101010101010
mov [rdx + 8 * 1], rax
mov rax, 0
mov [rdx + 8 * 2], rax
mov r15, -1
mov r14, -1
mov r13, -1
mov r12, -1
mov r11, -1
mov r10, -1
mov r9, -1
mov r8, -1
mov rsi, -1
bsf r15w, word [rdx + 8 * 0]
bsf r14d, dword [rdx + 8 * 0]
bsf r13, qword [rdx + 8 * 0]
bsf r12w, word [rdx + 8 * 1]
bsf r11d, dword [rdx + 8 * 1]
bsf r10, qword [rdx + 8 * 1]
bsf r9w, word [rdx + 8 * 2]
bsf r8d, dword [rdx + 8 * 2]
bsf rsi, qword [rdx + 8 * 2]
hlt
| 16.846154
| 32
| 0.562785
|
94984ff3a85b5c8c7733a0da45c6252e9ee36084
| 427
|
asm
|
Assembly
|
oeis/028/A028051.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/028/A028051.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/028/A028051.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A028051: Expansion of 1/((1-3x)(1-4x)(1-10x)(1-12x)).
; Submitted by Jon Maiga
; 1,29,555,8905,130091,1796769,23932195,310954985,3969388731,50012943409,623962124435,7725629774265,95088465616171,1164870934296449,14216545739974275,172979498415780745
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
dif $2,26
sub $2,1
sub $0,$2
seq $0,19747 ; Expansion of 1/((1-4x)(1-10x)(1-12x)).
mul $1,3
add $1,$0
lpe
mov $0,$1
| 23.722222
| 168
| 0.686183
|
f2802c2c900729b3b3266dd265c2c743236e6056
| 1,100
|
asm
|
Assembly
|
GIOVANNI/gambatte/test/hwtests/oamdma/oamdmasrcC000_gdmasrcC000_gdmalen13_oamdumper_1.asm
|
ReallyEvilFish/1234
|
d4f77bf2177c381e07d596aa425bc1a048305c03
|
[
"MIT"
] | 9
|
2021-02-03T05:44:48.000Z
|
2022-03-19T12:42:52.000Z
|
GIOVANNI/gambatte/test/hwtests/oamdma/oamdmasrcC000_gdmasrcC000_gdmalen13_oamdumper_1.asm
|
ReallyEvilFish/1234
|
d4f77bf2177c381e07d596aa425bc1a048305c03
|
[
"MIT"
] | 5
|
2020-08-09T13:04:51.000Z
|
2022-03-25T11:41:48.000Z
|
GIOVANNI/gambatte/test/hwtests/oamdma/oamdmasrcC000_gdmasrcC000_gdmalen13_oamdumper_1.asm
|
Manurocker95/GiovanniEmulator
|
d4f77bf2177c381e07d596aa425bc1a048305c03
|
[
"MIT"
] | null | null | null |
.size 8000
.data@0
01
.text@48
jp lstatint
.data@9c
02 03 04 05
.text@100
jp lbegin
.data@143
c0 00 00 00 1a 00 03
.text@150
lbegin:
ld c, 44
ld b, 90
lbegin_waitly90:
ldff a, (c)
cmp a, b
jrnz lbegin_waitly90
ld a, 0a
ld(0000), a
ld hl, fe00
ld c, a0
ld a, a0
lbegin_fill_oam:
ld(hl++), a
dec c
jrnz lbegin_fill_oam
ld c, 44
ld b, 90
lbegin_waitly90_2:
ldff a, (c)
cmp a, b
jrnz lbegin_waitly90_2
ld hl, c1ff
ld a, 00
lbegin_set_c1xx:
ld(hl--), a
inc a
jrnz lbegin_set_c1xx
lbegin_set_c0xx:
dec a
ld(hl--), a
jrnz lbegin_set_c0xx
ld a, 90
ldff(45), a
ld a, 40
ldff(41), a
xor a, a
ldff(0f), a
ld a, 02
ldff(ff), a
ei
halt
.text@1000
lstatint:
ld a, c0
ldff(51), a
xor a, a
ldff(52), a
ldff(54), a
ld a, 80
ldff(53), a
ld c, 55
ld a, c0
ldff(46), a
ld a, 13
ldff(55), a
nop
nop
nop
nop
ld c, 44
ld b, 96
lstatint_waitly96:
ldff a, (c)
cmp a, b
jrnz lstatint_waitly96
xor a, a
ldff(40), a
ld hl, feff
ld de, a000
lstatint_dump_oam_to_sram:
ld a, (hl--)
dec e
ld(de), a
jrnz lstatint_dump_oam_to_sram
xor a, a
ld(0000), a
| 11.22449
| 31
| 0.637273
|
6840739c8d8ab62acdd97e01b0bd7042c4f75aca
| 5,481
|
asm
|
Assembly
|
src/tunnel.asm
|
BlockoS/up-captn
|
72e567327aa25e94c488359c1bee8189f96aabc5
|
[
"BSD-3-Clause"
] | 6
|
2015-01-21T18:11:58.000Z
|
2019-12-26T19:04:01.000Z
|
src/tunnel.asm
|
BlockoS/up-captn
|
72e567327aa25e94c488359c1bee8189f96aabc5
|
[
"BSD-3-Clause"
] | null | null | null |
src/tunnel.asm
|
BlockoS/up-captn
|
72e567327aa25e94c488359c1bee8189f96aabc5
|
[
"BSD-3-Clause"
] | null | null | null |
.zp
__radius_0 .ds 2
__radius_1 .ds 2
__atan2_0 .ds 2
__atan2_1 .ds 2
; TODO : find a better place
_py .ds 1
_u .ds 1
_du .ds 1
.code
; TODO add sx and sy => u = radius[pos+sx]+du ; v = atan2[pos+sy]+dv
; TODO radius/atan2 table width (atm 64, make it larger!)
;----------------------------------------------------------------------
; tunnel (2)
; TODO : atan2Table, radiusTable, du, dv
;----------------------------------------------------------------------
tunnel_init:
; set vdc control register
vreg #5
; disable bg, disable sprite, vertical blanking and scanline interrupt
stz <vdc_crl
st1 #$00
st2 #$00
; initialize tiles
lda #bank(tunnelPalette)
sta <_bl
stw #tunnelPalette, <_si
lda #11
sta <_al
stz <_dl
lda #$20
sta <_dh
lda #BGMAP_SIZE_64x64
jsr setup_tiles12
jsr vgm_update
; map data
lda #TUNNEL_DATA_BANK
tam #TUNNEL_DATA_PAGE
lda #(TUNNEL_DATA_BANK+1)
tam #(TUNNEL_DATA_PAGE+1)
jsr set_xres512
; initialize base BG coordinates
lda #low(128)
sta <_bat_x
lda #high(256)
sta <_bat_x+1
stz <_bat_y
stz <_bat_y+1
lda #$08
sta <_addr
; set scroll
stz <_x
stz <_x+1
stz <_y
stz <_y+1
; set countdown
lda #low(TUNNEL_FRAME_COUNT)
sta <_counter
lda #high(TUNNEL_FRAME_COUNT)
sta <_counter+1
; Disable interrupts
vec_off #VSYNC
vec_off #HSYNC
; set and enable vdc interrupts
set_vec #VSYNC,rotoVsyncProc
vec_on #VSYNC
set_vec #HSYNC,rotoHsyncProc
vec_on #HSYNC
lda #$06 ; 10 MHz dot clock.
sta color_ctrl
; set vdc control register
vreg #5
; enable bg, disable sprite, enable vertical blanking and scanline interrupt
lda #%10001100
sta <vdc_crl
sta video_data_l
st2 #$00
rts
tunnel_update:
; Set BAT address then swap it
stz <_bat_ptr
lda <_addr
sta <_bat_ptr+1
eor #$08
sta <_addr
; Same for scrool coordinates
inc <_du
lda #32
sta <_py
stw #(radiusTable), <__radius_0
stw #(radiusTable+128), <__radius_1
stw #(atan2Table), <__atan2_0
stw #(atan2Table+128), <__atan2_1
.tunnel_y:
vreg #$00
clc
lda <_bat_ptr
sta video_data_l
adc #64
sta <_bat_ptr
lda <_bat_ptr+1
sta video_data_h
adc #0
sta <_bat_ptr+1
cly
.tunnel_x:
; C0
lda [__radius_0], Y
clc
adc <_du
lsr A
lsr A
and #$0f
sta <_u
lda [__atan2_0], Y
clc
adc <_du
asl A
asl A
asl A
and #$f0
ora <_u
tax
;ora [__atan2_0], Y
;tax
lda tunnelTexture, X
sta <_c
; C2
lda [__radius_1], Y
clc
adc <_du
lsr A
lsr A
and #$0f
sta <_u
lda [__atan2_1], Y
clc
adc <_du
asl A
asl A
asl A
and #$f0
ora <_u
tax
;ora [__atan2_1], Y
;tax
lda tunnelTexture, X
sta <_c+2
iny
; C1
lda [__radius_0], Y
clc
adc <_du
lsr A
lsr A
and #$0f
sta <_u
lda [__atan2_0], Y
clc
adc <_du
asl A
asl A
asl A
and #$f0
ora <_u
tax
;ora [__atan2_0], Y
;tax
lda tunnelTexture, X
sta <_c+1
; C3
lda [__radius_1], Y
clc
adc <_du
lsr A
lsr A
and #$0f
sta <_u
lda [__atan2_1], Y
clc
adc <_du
asl A
asl A
asl A
and #$f0
ora <_u
tax
; ora [__atan2_1], Y
; tax
lda tunnelTexture, X
sta <_c+3
iny
; [X:A] += _c + (_c[1] * 12) + (_c[2] * 144)
vreg #$02
; TODO fix it
clc
ldx <_c+1
lda index_i1, X
adc <_c
ldx <_c+2
adc index_i2_lo, X
sta video_data_l
lda index_i2_hi, X
ldx <_c+3
adc pal_i3, X
sta video_data_h
.loop_end:
cpy #64
beq .tunnel_next_y
jmp .tunnel_x
.tunnel_next_y
inc <__radius_0+1
inc <__radius_1+1
inc <__atan2_0+1
inc <__atan2_1+1
dec <_py
beq .tunnel_loop_end
jmp .tunnel_y
.tunnel_loop_end:
; go for next "buffer"
lda <_bat_y+1
eor #1
sta <_bat_y+1
rts
tunnelTexture:
.incbin "data/tunnel.dat"
tunnelPalette:
.incbin "data/tunnel.pal"
; .db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
; .db 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2
; .db 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2
; .db 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 2, 2, 2, 2, 2, 2, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 2, 3, 0, 4, 3, 2, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 2, 3, 4, 0, 3, 2, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 2, 2, 2, 2, 2, 2, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 3, 2
; .db 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 2
; .db 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2
; .db 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2
; .db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
; for history : add 128 to a 16bits word
; lda <__atan2_0
; bpl .l2
; inc <__atan2_0+1
;.l2:
; eor #128
; sta <__atan2_0
| 18.331104
| 78
| 0.492063
|
359be01e21fddf69d3b117e91a46e6af15815d36
| 423
|
asm
|
Assembly
|
programs/oeis/188/A188257.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/188/A188257.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/188/A188257.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A188257: [nr+kr]-[nr]-[kr], where r=sqrt(5), k=2, [ ]=floor.
; 0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1
add $0,2
cal $0,188189 ; [nr]-[kr]-[nr-kr], where r=sqrt(5), k=2, [ ]=floor.
mov $1,$0
| 60.428571
| 271
| 0.50591
|
1f0e0bac0af8323ca914f16ecc4f90f8150285d6
| 9,660
|
asm
|
Assembly
|
constants/move_effect_constants.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
constants/move_effect_constants.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
constants/move_effect_constants.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 3
|
2021-01-15T18:45:40.000Z
|
2021-10-16T03:35:27.000Z
|
; MoveEffectsPointers indexes (see data/moves/effects_pointers.asm)
const_def
const EFFECT_NORMAL_HIT ; 00
const EFFECT_SLEEP ; 01
const EFFECT_POISON_HIT ; 02
const EFFECT_LEECH_HIT ; 03
const EFFECT_BURN_HIT ; 04
const EFFECT_FREEZE_HIT ; 05
const EFFECT_PARALYZE_HIT ; 06
const EFFECT_SELFDESTRUCT ; 07
const EFFECT_DREAM_EATER ; 08
const EFFECT_MIRROR_MOVE ; 09
const EFFECT_ATTACK_UP ; 0a
const EFFECT_DEFENSE_UP ; 0b
const EFFECT_ATK_DEF_DOWN ; 0c
const EFFECT_SP_ATK_UP ; 0d
const EFFECT_DEF_SP_DEF_UP ; 0e
const EFFECT_ATK_DEF_UP ; 0f
const EFFECT_EVASION_UP ; 10
const EFFECT_ALWAYS_HIT ; 11
const EFFECT_ATTACK_DOWN ; 12
const EFFECT_DEFENSE_DOWN ; 13
const EFFECT_SPEED_DOWN ; 14
const EFFECT_SP_ATK_SP_DEF_UP ; 15
const EFFECT_ATK_SPEED_UP ; 16
const EFFECT_ACCURACY_DOWN ; 17
const EFFECT_EVASION_DOWN ; 18
const EFFECT_RESET_STATS ; 19
const EFFECT_BIDE ; 1a
const EFFECT_RAMPAGE ; 1b
const EFFECT_FORCE_SWITCH ; 1c
const EFFECT_MULTI_HIT ; 1d
const EFFECT_CONVERSION ; 1e
const EFFECT_FLINCH_HIT ; 1f
const EFFECT_HEAL ; 20
const EFFECT_TOXIC ; 21
const EFFECT_PAY_DAY ; 22
const EFFECT_LIGHT_SCREEN ; 23
const EFFECT_TRI_ATTACK ; 24
const EFFECT_PARA_FLINCH_HIT ; 25
const EFFECT_OHKO ; 26
const EFFECT_RAZOR_WIND ; 27
const EFFECT_SUPER_FANG ; 28
const EFFECT_STATIC_DAMAGE ; 29
const EFFECT_TRAP_TARGET ; 2a
const EFFECT_FREEZE_FLINCH_HIT ; 2b
const EFFECT_DOUBLE_HIT ; 2c
const EFFECT_JUMP_KICK ; 2d
const EFFECT_MIST ; 2e
const EFFECT_FOCUS_ENERGY ; 2f
const EFFECT_RECOIL_HIT ; 30
const EFFECT_CONFUSE ; 31
const EFFECT_ATTACK_UP_2 ; 32
const EFFECT_DEFENSE_UP_2 ; 33
const EFFECT_SPEED_UP_2 ; 34
const EFFECT_SP_ATK_UP_2 ; 35
const EFFECT_SP_DEF_UP_2 ; 36
const EFFECT_RECOIL_1_2 ; 37
const EFFECT_RECOIL_1_4 ; 38
const EFFECT_TRANSFORM ; 39
const EFFECT_ATTACK_DOWN_2 ; 3a
const EFFECT_DEFENSE_DOWN_2 ; 3b
const EFFECT_SPEED_DOWN_2 ; 3c
const EFFECT_SP_DEF_DOWN_2_HIT ; 3d
const EFFECT_SP_DEF_DOWN_2 ; 3e
const EFFECT_SP_ATK_UP_HIT ; 3f
const EFFECT_WHIRLPOOL ; 40
const EFFECT_REFLECT ; 41
const EFFECT_POISON ; 42
const EFFECT_PARALYZE ; 43
const EFFECT_ATTACK_DOWN_HIT ; 44
const EFFECT_DEFENSE_DOWN_HIT ; 45
const EFFECT_SPEED_DOWN_HIT ; 46
const EFFECT_SP_ATK_DOWN_HIT ; 47
const EFFECT_SP_DEF_DOWN_HIT ; 48
const EFFECT_ACCURACY_DOWN_HIT ; 49
const EFFECT_SP_ATK_DOWN_2_HIT ; 4a
const EFFECT_SKY_ATTACK ; 4b
const EFFECT_CONFUSE_HIT ; 4c
const EFFECT_POISON_MULTI_HIT ; 4d
const EFFECT_BURN_FLINCH_HIT ; 4e
const EFFECT_SUBSTITUTE ; 4f
const EFFECT_HYPER_BEAM ; 50
const EFFECT_RAGE ; 51
const EFFECT_MIMIC ; 52
const EFFECT_METRONOME ; 53
const EFFECT_LEECH_SEED ; 54
const EFFECT_SPLASH ; 55
const EFFECT_DISABLE ; 56
const EFFECT_LEVEL_DAMAGE ; 57
const EFFECT_PSYWAVE ; 58
const EFFECT_COUNTER ; 59
const EFFECT_ENCORE ; 5a
const EFFECT_PAIN_SPLIT ; 5b
const EFFECT_SNORE ; 5c
const EFFECT_CONVERSION2 ; 5d
const EFFECT_LOCK_ON ; 5e
const EFFECT_SKETCH ; 5f
const EFFECT_SURF ; 60
const EFFECT_SLEEP_TALK ; 61
const EFFECT_DESTINY_BOND ; 62
const EFFECT_REVERSAL ; 63
const EFFECT_SPITE ; 64
const EFFECT_FALSE_SWIPE ; 65
const EFFECT_HEAL_BELL ; 66
const EFFECT_PRIORITY_HIT ; 67
const EFFECT_TRIPLE_KICK ; 68
const EFFECT_THIEF ; 69
const EFFECT_MEAN_LOOK ; 6a
const EFFECT_NIGHTMARE ; 6b
const EFFECT_FLAME_WHEEL ; 6c
const EFFECT_CURSE ; 6d
const EFFECT_UNUSED_6E ; 6e
const EFFECT_PROTECT ; 6f
const EFFECT_SPIKES ; 70
const EFFECT_FORESIGHT ; 71
const EFFECT_PERISH_SONG ; 72
const EFFECT_SANDSTORM ; 73
const EFFECT_ENDURE ; 74
const EFFECT_ROLLOUT ; 75
const EFFECT_SWAGGER ; 76
const EFFECT_FURY_CUTTER ; 77
const EFFECT_ATTRACT ; 78
const EFFECT_RETURN ; 79
const EFFECT_PRESENT ; 7a
const EFFECT_FRUSTRATION ; 7b
const EFFECT_SAFEGUARD ; 7c
const EFFECT_SACRED_FIRE ; 7d
const EFFECT_MAGNITUDE ; 7e
const EFFECT_BATON_PASS ; 7f
const EFFECT_PURSUIT ; 80
const EFFECT_RAPID_SPIN ; 81
const EFFECT_POT_SMASH ; 82
const EFFECT_CRUSH_GRIP ; 83
const EFFECT_MORNING_SUN ; 84
const EFFECT_SYNTHESIS ; 85
const EFFECT_MOONLIGHT ; 86
const EFFECT_HIDDEN_POWER ; 87
const EFFECT_RAIN_DANCE ; 88
const EFFECT_SUNNY_DAY ; 89
const EFFECT_DEFENSE_UP_HIT ; 8a
const EFFECT_ATTACK_UP_HIT ; 8b
const EFFECT_ALL_UP_HIT ; 8c
const EFFECT_FAKE_OUT ; 8d
const EFFECT_BELLY_DRUM ; 8e
const EFFECT_PSYCH_UP ; 8f
const EFFECT_MIRROR_COAT ; 90
const EFFECT_SKULL_BASH ; 91
const EFFECT_TWISTER ; 92
const EFFECT_EARTHQUAKE ; 93
const EFFECT_FUTURE_SIGHT ; 94
const EFFECT_GUST ; 95
const EFFECT_STOMP ; 96
const EFFECT_SOLARBEAM ; 97
const EFFECT_THUNDER ; 98
const EFFECT_TELEPORT ; 99
const EFFECT_BEAT_UP ; 9a
const EFFECT_FLY ; 9b
const EFFECT_DEFENSE_CURL ; 9c
const EFFECT_VITAL_THROW ; 9d
const EFFECT_UPROAR ; 9e
const EFFECT_STOCKPILE ; 9f
const EFFECT_SPIT_UP ; a0
const EFFECT_SWALLOW ; a1
const EFFECT_HAIL ; a2
const EFFECT_TORMENT ; a3
const EFFECT_FLATTER ; a4
const EFFECT_WILL_O_WISP ; a5
const EFFECT_MEMENTO ; a6
const EFFECT_FACADE ; a7
const EFFECT_FOCUS_PUNCH ; a8
const EFFECT_SMELLINGSALT ; a9
const EFFECT_NATURE_POWER ; aa
const EFFECT_CHARGE ; ab
const EFFECT_TAUNT ; ac
const EFFECT_TRICK ; ad
const EFFECT_UNUSED_AE ; ae
const EFFECT_WISH ; af
const EFFECT_ASSIST ; b0
const EFFECT_INGRAIN ; b1
const EFFECT_SUPERPOWER ; b2
const EFFECT_MAGIC_COAT ; b3
const EFFECT_RECYCLE ; b4
const EFFECT_REVENGE ; b5
const EFFECT_BRICK_BREAK ; b6
const EFFECT_YAWN ; b7
const EFFECT_KNOCK_OFF ; b8
const EFFECT_ENDEAVOR ; b9
const EFFECT_UNUSED_BA ; ba
const EFFECT_UNUSED_BB ; bb
const EFFECT_IMPRISON ; bc
const EFFECT_REFRESH ; bd
const EFFECT_GRUDGE ; be
const EFFECT_SNATCH ; bf
const EFFECT_SECRET_POWER ; c0
const EFFECT_CAMOUFLAGE ; c1
const EFFECT_UNUSED_C2 ; c2
const EFFECT_MUD_SPORT ; c3
const EFFECT_POISON_FANG ; c4
const EFFECT_WEATHER_BALL ; c5
const EFFECT_HP_SCALING_HIT ; c6
const EFFECT_UNUSED_C7 ; c7
const EFFECT_BOUNCE ; c8
const EFFECT_VOLT_TACKLE ; c9
const EFFECT_WATER_SPORT ; ca
const EFFECT_UNUSED_CB ; cb
const EFFECT_UNUSED_CC ; cc
const EFFECT_GRAVITY ; cd
const EFFECT_MIRACLE_EYE ; ce
const EFFECT_WAKE_UP_SLAP ; cf
const EFFECT_HAMMER_ARM ; d0
const EFFECT_GYRO_BALL ; d1
const EFFECT_HEALING_WISH ; d2
const EFFECT_BRINE ; d3
const EFFECT_NATURAL_GIFT ; d4
const EFFECT_FEINT ; d5
const EFFECT_PLUCK ; d6
const EFFECT_TAILWIND ; d7
const EFFECT_ACUPRESSURE ; d8
const EFFECT_METAL_BURST ; d9
const EFFECT_U_TURN ; da
const EFFECT_CLOSE_COMBAT ; db
const EFFECT_PAYBACK ; dc
const EFFECT_UNUSED_DD ; dd
const EFFECT_EMBARGO ; de
const EFFECT_FLING ; df
const EFFECT_PSYCHO_SHIFT ; e0
const EFFECT_TRUMP_CARD ; e1
const EFFECT_HEAL_BLOCK ; e2
const EFFECT_UNUSED_E3 ; e3
const EFFECT_POWER_TRICK ; e4
const EFFECT_UNUSED_E5 ; e5
const EFFECT_LUCKY_CHANT ; e6
const EFFECT_ME_FIRST ; e7
const EFFECT_COPYCAT ; e8
const EFFECT_POWER_SWAP ; e9
const EFFECT_GUARD_SWAP ; ea
const EFFECT_PUNISHMENT ; eb
const EFFECT_LAST_RESORT ; ec
const EFFECT_UNUSED_ED ; ed
const EFFECT_SUCKER_PUNCH ; ee
const EFFECT_TOXIC_SPIKES ; ef
const EFFECT_HEART_SWAP ; f0
const EFFECT_AQUA_RING ; f1
const EFFECT_MAGNET_RISE ; f2
const EFFECT_FLARE_BLITZ ; f3
const EFFECT_DEFOG ; f4
const EFFECT_TRICK_ROOM ; f5
const EFFECT_CAPTIVATE ; f6
const EFFECT_STEALTH_ROCK ; f7
const EFFECT_WEIGHT_DAMAGE ; f8
const EFFECT_JUDGMENT ; f9
const EFFECT_UNUSED_FA ; fa
const EFFECT_LUNAR_DANCE ; fb
EFFECT_SPEED_UP EQU $0c
EFFECT_SP_DEF_UP EQU $0e
EFFECT_ACCURACY_UP EQU $0f
EFFECT_SP_ATK_DOWN EQU $15
EFFECT_SP_DEF_DOWN EQU $16
EFFECT_ACCURACY_DOWN_2 EQU $3f
EFFECT_EVASION_DOWN_2 EQU $40
EFFECT_DEFROST_OPPONENT EQU $60
| 36.590909
| 67
| 0.637267
|
7a00b25ba7b6d8cc208d69f407ce4b34a5548937
| 1,460
|
asm
|
Assembly
|
smsq/q68/spp/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
smsq/q68/spp/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
smsq/q68/spp/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; Q68 SER PAR PRT device initialisation V2.10 1999 Tony Tebby
; V2.11 2017 W. Lenerz
section spp
xdef q68_spp_init
; xdef do_ser
xref spp_init
xref q68_pardef
xref q68_serdef
xref cpy_mmod
xref spp_rxser
xref spp_sendser
include 'dev8_mac_vecx'
include 'dev8_keys_q68'
include 'dev8_keys_qdos_sms'
;+++
; SPP driver initialisation.
;
; a1-a3 scratch
; status return standard
;---
q68_spp_init
lea q68_par,a1
lea q68_ser,a2
jsr spp_init
move.l a3,q68_ser_link
; link in the interrupt routines
spp_link
; lea spp_sndh,a0 ; do NOT make these into minimodules
; jsr cpy_mmod ; PC relative code
lea rx_xlnk,a0 ; linkage area
lea spp_rxser,a1 ; external interrupt address
move.l a1,4(a0) ; set it in linkage area
moveq #sms.lexi,d0 ; link in interrupt routine
trap #1
lnk_rx
; lea spp_rxserh,a0
; jsr cpy_mmod
lea tx_xlnk,a0 ; linkage area
lea spp_sendser,a1 ; external interrupt address
move.l a1,4(a0) ; set it in linkage area
moveq #sms.lexi,d0 ; link in interrupt routine
trap #1
rts
; the definitions
q68_par
vec q68_pardef ; PAR driver
novec
q68_ser
vec q68_serdef ; SER driver
novec
; ser interrupt routine linkage area
rx_xlnk dc.l 0 ; external interrupt linkag
rx_xiad dc.l 0 ; external interrupt service routine address
tx_xlnk dc.l 0 ; external interrupt linkag
tx_xiad dc.l 0 ; external interrupt service routine address
end
| 20.857143
| 69
| 0.715068
|
3aaa15ce330bc1d1439d39a7e9072f4a460ab468
| 20,323
|
asm
|
Assembly
|
Template/cpu_a.asm
|
EmbeddedInsights/uC-CPU
|
9733a45eb239f9a7d17dce9e9cfbebc6564ac30a
|
[
"Apache-2.0"
] | 17
|
2020-03-03T07:27:45.000Z
|
2020-11-29T01:26:06.000Z
|
Template/cpu_a.asm
|
SiliconLabs/uC-CPU
|
ae5796e2049b043f69ef4f29fc330f29217b6344
|
[
"Apache-2.0"
] | null | null | null |
Template/cpu_a.asm
|
SiliconLabs/uC-CPU
|
ae5796e2049b043f69ef4f29fc330f29217b6344
|
[
"Apache-2.0"
] | 39
|
2020-03-03T05:34:49.000Z
|
2020-12-06T12:58:57.000Z
|
;********************************************************************************************************
; uC/CPU
; CPU CONFIGURATION & PORT LAYER
;
; Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
;
; SPDX-License-Identifier: APACHE-2.0
;
; This software is subject to an open source license and is distributed by
; Silicon Laboratories Inc. pursuant to the terms of the Apache License,
; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
;
;********************************************************************************************************
;********************************************************************************************************
;
; CPU PORT FILE
;
; TEMPLATE
;
; $$$$ Insert CPU Name
; $$$$ Insert Compiler Name
;
; Filename : cpu_a.asm $$$$ Insert CPU assembly port file name
; Version : V1.32.01 $$$$ Insert CPU assembly port file version number
;********************************************************************************************************
; Note(s) : (1) To provide the required CPU port functionality, insert the appropriate CPU- &/or
; compiler-specific code to perform the stated actions wherever '$$$$' comments are
; found.
;
; #### This note MAY be entirely removed for specific CPU port files.
;********************************************************************************************************
;********************************************************************************************************
; PUBLIC FUNCTIONS
;********************************************************************************************************
; $$$$ Extern required CPU port functions :
PUBLIC CPU_IntDis
PUBLIC CPU_IntEn
PUBLIC CPU_SR_Push
PUBLIC CPU_SR_Pop
PUBLIC CPU_SR_Save
PUBLIC CPU_SR_Restore
PUBLIC CPU_CntLeadZeros
PUBLIC CPU_CntTrailZeros
PUBLIC CPU_RevBits
;********************************************************************************************************
; EQUATES
;********************************************************************************************************
; $$$$ Define possible required CPU equates :
;********************************************************************************************************
; CODE GENERATION DIRECTIVES
;********************************************************************************************************
; $$$$ Insert possible required CPU-compiler code generation directives :
;********************************************************************************************************
; DISABLE/ENABLE INTERRUPTS
;
; Description : Disable/Enable interrupts.
;
; (1) (a) For CPU_CRITICAL_METHOD_INT_DIS_EN, interrupts are enabled/disabled WITHOUT saving
; or restoring the state of the interrupt status.
;
;
; Prototypes : void CPU_IntDis(void);
; void CPU_IntEn (void);
;********************************************************************************************************
CPU_IntDis
; $$$$ Insert code to disable CPU interrupts
CPU_IntEn
; $$$$ Insert code to enable CPU interrupts
;********************************************************************************************************
; PUSH/POP CPU STATUS REGISTER
;
; Description : Push/Pop the state of CPU interrupts onto the local stack, if possible.
;
; (1) (b) For CPU_CRITICAL_METHOD_STATUS_STK, the state of the interrupt status flag is
; stored in onto the local stack & interrupts are then disabled. The previous
; interrupt status state is restored from the local stack into the CPU's status
; register.
;
;
; Prototypes : void CPU_SR_Push(void);
; void CPU_SR_Pop (void);
;********************************************************************************************************
CPU_SR_Push
; $$$$ Insert code to push CPU status onto local stack & disable interrupts
CPU_SR_Pop
; $$$$ Insert code to pop CPU status from local stack
;********************************************************************************************************
; SAVE/RESTORE CPU STATUS REGISTER
;
; Description : Save/Restore the state of CPU interrupts, if possible.
;
; (1) (c) For CPU_CRITICAL_METHOD_STATUS_LOCAL, the state of the interrupt status flag is
; stored in the local variable 'cpu_sr' & interrupts are then disabled ('cpu_sr' is
; allocated in all functions that need to disable interrupts). The previous interrupt
; status state is restored by copying 'cpu_sr' into the CPU's status register.
;
;
; Prototypes : CPU_SR CPU_SR_Save (void);
; void CPU_SR_Restore(CPU_SR cpu_sr);
;
; Note(s) : (1) These functions are used in general like this :
;
; void Task (void *p_arg)
; {
; CPU_SR_ALLOC(); /* Allocate storage for CPU status register */
; :
; :
; CPU_CRITICAL_ENTER(); /* cpu_sr = CPU_SR_Save(); */
; :
; :
; CPU_CRITICAL_EXIT(); /* CPU_SR_Restore(cpu_sr); */
; :
; }
;********************************************************************************************************
CPU_SR_Save
; $$$$ Insert code to save CPU status register(s) & disable interrupts
CPU_SR_Restore
; $$$$ Insert code to restore CPU status register(s)
;********************************************************************************************************
; CPU_CntLeadZeros()
; COUNT LEADING ZEROS
;
; Description : Counts the number of contiguous, most-significant, leading zero bits before the
; first binary one bit in a data value.
;
; Prototype : CPU_DATA CPU_CntLeadZeros(CPU_DATA val);
;
; Argument(s) : val Data value to count leading zero bits.
;
; Return(s) : Number of contiguous, most-significant, leading zero bits in 'val'.
;
; Note(s) : (1) (a) Supports up to the following data value sizes, depending on the configured
; size of 'CPU_DATA' (see 'cpu.h CPU WORD CONFIGURATION Note #1') :
;
; (1) 8-bits
; (2) 16-bits
; (3) 32-bits
; (4) 64-bits
;
; (b) (1) For 8-bit values :
;
; b07 b06 b05 b04 b03 b02 b01 b00 # Leading Zeros
; --- --- --- --- --- --- --- --- ---------------
; 1 x x x x x x x 0
; 0 1 x x x x x x 1
; 0 0 1 x x x x x 2
; 0 0 0 1 x x x x 3
; 0 0 0 0 1 x x x 4
; 0 0 0 0 0 1 x x 5
; 0 0 0 0 0 0 1 x 6
; 0 0 0 0 0 0 0 1 7
; 0 0 0 0 0 0 0 0 8
;
;
; (2) For 16-bit values :
;
; b15 b14 b13 ... b04 b03 b02 b01 b00 # Leading Zeros
; --- --- --- --- --- --- --- --- ---------------
; 1 x x x x x x x 0
; 0 1 x x x x x x 1
; 0 0 1 x x x x x 2
; : : : : : : : : :
; : : : : : : : : :
; 0 0 0 1 x x x x 11
; 0 0 0 0 1 x x x 12
; 0 0 0 0 0 1 x x 13
; 0 0 0 0 0 0 1 x 14
; 0 0 0 0 0 0 0 1 15
; 0 0 0 0 0 0 0 0 16
;
;
; (3) For 32-bit values :
;
; b31 b30 b29 ... b04 b03 b02 b01 b00 # Leading Zeros
; --- --- --- --- --- --- --- --- ---------------
; 1 x x x x x x x 0
; 0 1 x x x x x x 1
; 0 0 1 x x x x x 2
; : : : : : : : : :
; : : : : : : : : :
; 0 0 0 1 x x x x 27
; 0 0 0 0 1 x x x 28
; 0 0 0 0 0 1 x x 29
; 0 0 0 0 0 0 1 x 30
; 0 0 0 0 0 0 0 1 31
; 0 0 0 0 0 0 0 0 32
;
;
; (4) For 64-bit values :
;
; b63 b62 b61 ... b04 b03 b02 b01 b00 # Leading Zeros
; --- --- --- --- --- --- --- --- ---------------
; 1 x x x x x x x 0
; 0 1 x x x x x x 1
; 0 0 1 x x x x x 2
; : : : : : : : : :
; : : : : : : : : :
; 0 0 0 1 x x x x 59
; 0 0 0 0 1 x x x 60
; 0 0 0 0 0 1 x x 61
; 0 0 0 0 0 0 1 x 62
; 0 0 0 0 0 0 0 1 63
; 0 0 0 0 0 0 0 0 64
;
; (2) MUST be defined in 'cpu_a.asm' (or 'cpu_c.c') if CPU_CFG_LEAD_ZEROS_ASM_PRESENT
; is #define'd in 'cpu_cfg.h' or 'cpu.h'.
;********************************************************************************************************
CPU_CntLeadZeros
; $$$$ Insert code to count the number of contiguous, most-significant, ...
; ... leading zero bits in 'val' (see Note #1b)
;********************************************************************************************************
; CPU_CntTrailZeros()
; COUNT TRAILING ZEROS
;
; Description : Counts the number of contiguous, least-significant, trailing zero bits before the
; first binary one bit in a data value.
;
; Prototype : CPU_DATA CPU_CntTrailZeros(CPU_DATA val);
;
; Argument(s) : val Data value to count trailing zero bits.
;
; Return(s) : Number of contiguous, least-significant, trailing zero bits in 'val'.
;
; Note(s) : (1) (a) Supports up to the following data value sizes, depending on the configured
; size of 'CPU_DATA' (see 'cpu.h CPU WORD CONFIGURATION Note #1') :
;
; (1) 8-bits
; (2) 16-bits
; (3) 32-bits
; (4) 64-bits
;
; (b) (1) For 8-bit values :
;
; b07 b06 b05 b04 b03 b02 b01 b00 # Trailing Zeros
; --- --- --- --- --- --- --- --- ----------------
; x x x x x x x 1 0
; x x x x x x 1 0 1
; x x x x x 1 0 0 2
; x x x x 1 0 0 0 3
; x x x 1 0 0 0 0 4
; x x 1 0 0 0 0 0 5
; x 1 0 0 0 0 0 0 6
; 1 0 0 0 0 0 0 0 7
; 0 0 0 0 0 0 0 0 8
;
;
; (2) For 16-bit values :
;
; b15 b14 b13 b12 b11 ... b02 b01 b00 # Trailing Zeros
; --- --- --- --- --- --- --- --- ----------------
; x x x x x x x 1 0
; x x x x x x 1 0 1
; x x x x x 1 0 0 2
; : : : : : : : : :
; : : : : : : : : :
; x x x x 1 0 0 0 11
; x x x 1 0 0 0 0 12
; x x 1 0 0 0 0 0 13
; x 1 0 0 0 0 0 0 14
; 1 0 0 0 0 0 0 0 15
; 0 0 0 0 0 0 0 0 16
;
;
; (3) For 32-bit values :
;
; b31 b30 b29 b28 b27 ... b02 b01 b00 # Trailing Zeros
; --- --- --- --- --- --- --- --- ----------------
; x x x x x x x 1 0
; x x x x x x 1 0 1
; x x x x x 1 0 0 2
; : : : : : : : : :
; : : : : : : : : :
; x x x x 1 0 0 0 27
; x x x 1 0 0 0 0 28
; x x 1 0 0 0 0 0 29
; x 1 0 0 0 0 0 0 30
; 1 0 0 0 0 0 0 0 31
; 0 0 0 0 0 0 0 0 32
;
;
; (4) For 64-bit values :
;
; b63 b62 b61 b60 b59 ... b02 b01 b00 # Trailing Zeros
; --- --- --- --- --- --- --- --- ----------------
; x x x x x x x 1 0
; x x x x x x 1 0 1
; x x x x x 1 0 0 2
; : : : : : : : : :
; : : : : : : : : :
; x x x x 1 0 0 0 59
; x x x 1 0 0 0 0 60
; x x 1 0 0 0 0 0 61
; x 1 0 0 0 0 0 0 62
; 1 0 0 0 0 0 0 0 63
; 0 0 0 0 0 0 0 0 64
;
; (2) MUST be defined in 'cpu_a.asm' (or 'cpu_c.c') if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT
; is #define'd in 'cpu_cfg.h' or 'cpu.h'.
;********************************************************************************************************
CPU_CntTrailZeros
; $$$$ Insert code to count the number of contiguous, least-significant, ...
; ... trailing zero bits in 'val' (see Note #1b)
;********************************************************************************************************
; CPU_RevBits()
; REVERSE BITS
;
; Description : Reverses the bits in a data value.
;
; Prototypes : CPU_DATA CPU_RevBits(CPU_DATA val);
;
; Argument(s) : val Data value to reverse bits.
;
; Return(s) : Value with all bits in 'val' reversed (see Note #1).
;
; Note(s) : (1) The final, reversed data value for 'val' is such that :
;
; 'val's final bit 0 = 'val's original bit N
; 'val's final bit 1 = 'val's original bit (N - 1)
; 'val's final bit 2 = 'val's original bit (N - 2)
;
; ... ...
;
; 'val's final bit (N - 2) = 'val's original bit 2
; 'val's final bit (N - 1) = 'val's original bit 1
; 'val's final bit N = 'val's original bit 0
;********************************************************************************************************
CPU_RevBits
; $$$$ Insert code to reverse the bits in 'val' (see Note #1)
;********************************************************************************************************
; CPU ASSEMBLY PORT FILE END
;********************************************************************************************************
; $$$$ Insert assembly end-of-file directive, if any
| 53.907162
| 110
| 0.258279
|
e8d8374dee3254dcd6e4e399f66d44a06c3d9ca9
| 24,974
|
asm
|
Assembly
|
dos/cpmio.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
dos/cpmio.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
dos/cpmio.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
;** Standard device IO for MSDOS (first 12 function calls)
;
TITLE IBMCPMIO - device IO for MSDOS
NAME IBMCPMIO
;
; Microsoft Confidential
; Copyright (C) Microsoft Corporation 1991
; All Rights Reserved.
;
;** CPMIO.ASM - Standard device IO for MSDOS (first 12 function calls)
;
;
; Old style CP/M 1-12 system calls to talk to reserved devices
;
; $Std_Con_Input_No_Echo
; $Std_Con_String_Output
; $Std_Con_String_Input
; $RawConIO
; $RawConInput
; RAWOUT
; RAWOUT2
;
; Revision history:
;
; A000 version 4.00 - Jan 1988
; A002 PTM -- dir >lpt3 hangs
.xlist
.xcref
include version.inc
include dosseg.inc
INCLUDE DOSSYM.INC
include sf.inc
include vector.inc
INCLUDE DEVSYM.INC
include doscntry.inc
.list
.cref
; The following routines form the console I/O group (funcs 1,2,6,7,8,9,10,11).
; They assume ES and DS NOTHING, while not strictly correct, this forces data
; references to be SS or CS relative which is desired.
i_need CARPOS,BYTE
i_need STARTPOS,BYTE
i_need INBUF,128
i_need INSMODE,BYTE
i_need user_SP,WORD
EXTRN OUTCHA:NEAR ;AN000 char out with status check 2/11/KK
i_need Printer_Flag,BYTE
i_need SCAN_FLAG,BYTE
i_need DATE_FLAG,WORD
i_need Packet_Temp,WORD ; temporary packet used by readtime
i_need DEVCALL,DWORD
i_need InterChar,BYTE ;AN000;interim char flag ( 0 = regular char)
i_need InterCon,BYTE ;AN000;console flag ( 1 = in interim mode )
i_need SaveCurFlg,BYTE ;AN000;console out ( 1 = print and do not advance)
i_need COUNTRY_CDPG,byte ;AN000; 2/12/KK
i_need TEMP_VAR,WORD ;AN000; 2/12/KK
i_need DOS34_FLAG,WORD ;AN000; 2/12/KK
DOSCODE SEGMENT
ASSUME SS:DOSDATA,CS:DOSCODE
EXTRN Get_IO_SFT:Near
EXTRN IOFunc:near
EXTRN EscChar:BYTE ; lead byte for function keys
EXTRN CanChar:BYTE ; Cancel character
Break
IFDEF DBCS ;AN000;
;
;----------------------------------------------------------------------------
;
; Procedure : $Std_Con_Input_No_Echo
;
;----------------------------------------------------------------------------
;
;--- Start of Korean Support 2/11/KK
procedure $STD_CON_INPUT_NO_ECHO,NEAR ;System call 8 ;AN000;
StdCILop: ;AN000;
invoke INTER_CON_INPUT_NO_ECHO ;AN000;
jmp InterApRet ; go to return fuction ;AN000;
EndProc $STD_CON_INPUT_NO_ECHO ;AN000;
;
;----------------------------------------------------------------------------
;
; Procedure : Inter_Con_Input_No_Echo
;
;
;----------------------------------------------------------------------------
;
procedure INTER_CON_INPUT_NO_ECHO,NEAR ;AN000;
;--- End of Korean Support 2/11/KK
; Inputs:
; None
; Function:
; Same as $STD_CON_INPUT_NO_ECHO but uses interim character read from
; the device.
; Returns:
; AL = character
; Zero flag SET if interim character, RESET otherwise
ELSE ;AN000;
;
; Inputs:
; None
; Function:
; Input character from console, no echo
; Returns:
; AL = character
procedure $STD_CON_INPUT_NO_ECHO,NEAR ;System call 8
ENDIF
PUSH DS
PUSH SI
INTEST:
invoke STATCHK
JNZ Get
;*************************************************************************
;hkn; SS override
cmp [Printer_Flag],0 ; is printer idle?
jnz no_sys_wait
mov ah,5 ; get input status with system wait
call IOFUNC
no_sys_wait:
;**************************************************************************
MOV AH,84h
INT int_IBM
;;; 7/15/86 update the date in the idle loop
;;; Dec 19, 1986 D.C.L. changed following CMP to Byte Ptr from Word Ptr
;;;; to shorten loop in consideration of the PC Convertible
;hkn; SS override
CMP byte ptr [DATE_FLAG],-1 ; date is updated may be every
JNZ NoUpdate ; 65535 x ? ms if no one calls
PUSH AX
PUSH BX ; following is tricky,
PUSH CX ; it may be called by critical handler
PUSH DX ; at that time, DEVCALL is used by
; other's READ or WRITE
PUSH DS ; save DS = SFT's sgement
;hkn; READTIME must use ds = DOSDATA
;hkn; PUSH CS ; READTIME must use DS=CS
push ss
POP DS
MOV AX,0 ; therefore, we save DEVCALL
CALL Save_Restore_Packet ; save DEVCALL packet
invoke READTIME ; readtime
MOV AX,1
CALL Save_Restore_Packet ; restore DEVCALL packet
POP DS ; restore DS
POP DX
POP CX
POP BX
POP AX
NoUpdate:
;hkn; SS override
INC [DATE_FLAG]
;;; 7/15/86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
JMP Intest
Get:
XOR AH,AH
call IOFUNC
POP SI
POP DS
;;; 7/15/86
;hkn; SS override
MOV BYTE PTR [SCAN_FLAG],0
CMP AL,0 ; extended code ( AL )
JNZ noscan
;hkn; SS override
MOV BYTE PTR [SCAN_FLAG],1 ; set this flag for ALT_Q key
noscan:
;;; 7/15/86
IFDEF DBCS ;AN000;
;hkn; InterChar is in DOSDATA. use SS override.
cmp [InterChar],1 ;AN000; set the zero flag if the character3/31/KK ;AN000;
ENDIF ;AN000;
return
IFDEF DBCS ;AN000;
EndProc INTER_CON_INPUT_NO_ECHO ;AN000; ;2/11/KK ;AN000;
ELSE ;AN000;
EndProc $STD_CON_INPUT_NO_ECHO
ENDIF ;AN000;
BREAK <$STD_CON_STRING_OUTPUT - Console String Output>
;
;----------------------------------------------------------------------------
;
;** $STD_CON_STRING_OUTPUT - Console String Output
;
;
; ENTRY (DS:DX) Point to output string '$' terminated
; EXIT none
; USES ALL
;
;----------------------------------------------------------------------------
;
procedure $STD_CON_STRING_OUTPUT,NEAR ;System call 9
MOV SI,DX
STRING_OUT1:
LODSB
; IFDEF DBCS ;AN000;
; invoke TESTKANJ ;AN000; 2/11/KK ;AN000;
; jz SBCS00 ;AN000; 2/11/KK ;AN000;
; invoke OUTT ;AN000; 2/11/KK ;AN000;
; LODSB ;AN000; 2/11/KK ;AN000;
; JMP NEXT_STR1 ;AN000; 2/11/KK ;AN000;
;SBCS00: ;AN000; 2/11/KK ;AN000;
; ENDIF ;AN000;
CMP AL,'$'
retz
NEXT_STR1:
invoke OUTT
JMP STRING_OUT1
EndProc $STD_CON_STRING_OUTPUT
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
IFDEF DBCS
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
include kstrin.asm
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
ELSE ; Not double byte characters
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
; SCCSID = @(#)strin.asm 1.2 85/04/18
BREAK <$STD_CON_STRING_INPUT - Input Line from Console>
;** $STD_CON_STRING_INPUT - Input Line from Console
;
; $STD_CON_STRING_INPUT Fills a buffer from console input until CR
;
; ENTRY (ds:dx) = input buffer
; EXIT none
; USES ALL
ASSUME DS:NOTHING,ES:NOTHING
procedure $STD_CON_STRING_INPUT,NEAR ;System call 10
MOV AX,SS
MOV ES,AX
MOV SI,DX
XOR CH,CH
LODSW
; (AL) = the buffer length
; (AH) = the template length
OR AL,AL
retz ;Buffer is 0 length!!?
MOV BL,AH ;Init template counter
MOV BH,CH ;Init template counter
; (BL) = the number of bytes in the template
CMP AL,BL
JBE NOEDIT ;If length of buffer inconsistent with contents
CMP BYTE PTR [BX+SI],c_CR
JZ EDITON ;If CR correctly placed EDIT is OK
; The number of chars in the template is >= the number of chars in buffer or
; there is no CR at the end of the template. This is an inconsistant state
; of affairs. Pretend that the template was empty:
;
noedit: MOV BL,CH ;Reset buffer
editon: MOV DL,AL
DEC DX ;DL is # of bytes we can put in the buffer
; Top level. We begin to read a line in.
;hkn; SS override
newlin: MOV AL,[CARPOS]
MOV [STARTPOS],AL ;Remember position in raw buffer
PUSH SI
;hkn; INBUF is in DOSDATA
MOV DI,OFFSET DOSDATA:INBUF ;Build the new line here
;hkn; SS override
MOV [INSMODE],CH ;Insert mode off
MOV BH,CH ;No chars from template yet
MOV DH,CH ;No chars to new line yet
invoke $STD_CON_INPUT_NO_ECHO ;Get first char
CMP AL,c_LF ;Linefeed
JNZ GOTCH ;Filter out LF so < works
; This is the main loop of reading in a character and processing it.
;
; (BH) = the index of the next byte in the template
; (BL) = the length of the template
; (DH) = the number of bytes in the buffer
; (DL) = the length of the buffer
entry GETCH
invoke $STD_CON_INPUT_NO_ECHO
GOTCH:
;
; Brain-damaged Tim Patterson ignored ^F in case his BIOS did not flush the
; input queue.
;
CMP AL,"F"-"@"
JZ GETCH
; If the leading char is the function-key lead byte
;hkn; ESCCHAR is in TABLE seg (DOSCODE)
CMP AL,[ESCCHAR]
JZ ESCape ;change reserved keyword DBM 5-7-87
; Rubout and ^H are both destructive backspaces.
CMP AL,c_DEL
JZ BACKSPJ
CMP AL,c_BS
JZ BACKSPJ
; ^W deletes backward once and then backs up until a letter is before the
; cursor
CMP AL,"W" - "@"
; The removal of the comment characters before the jump statement will
; cause ^W to backup a word.
;*** JZ WordDel
NOP
NOP
CMP AL,"U" - "@"
; The removal of the comment characters before the jump statement will
; cause ^U to clear a line.
;*** JZ LineDel
NOP
NOP
; CR terminates the line.
CMP AL,c_CR
JZ ENDLIN
; LF goes to a new line and keeps on reading.
CMP AL,c_LF
JZ PHYCRLF
; ^X (or ESC) deletes the line and starts over
;hkn; CANCHAR is in TABLE seg (DOSCODE), so CS override
CMP AL,[CANCHAR]
JZ KILNEW
; Otherwise, we save the input character.
savch: CMP DH,DL
JAE BUFFUL ; buffer is full.
STOSB
INC DH ; increment count in buffer.
invoke BUFOUT ;Print control chars nicely
;hkn; SS override
CMP BYTE PTR [INSMODE],0
JNZ GETCH ; insertmode => don't advance template
CMP BH,BL
JAE GETCH ; no more characters in template
INC SI ; Skip to next char in template
INC BH ; remember position in template
JMP SHORT GETCH
BACKSPJ: JMP SHORT BACKSP
bufful: MOV AL,7 ; Bell to signal full buffer
invoke OUTT
JMP SHORT GETCH
ESCape: transfer OEMFunctionKey ; let the OEM's handle the key dispatch
ENDLIN:
STOSB ; Put the CR in the buffer
invoke OUTT ; Echo it
POP DI ; Get start of user buffer
MOV [DI-1],DH ; Tell user how many bytes
INC DH ; DH is length including CR
COPYNEW:
SAVE <DS,ES>
RESTORE <DS,ES> ; XCHG ES,DS
;hkn; INBUF is in DOSDATA
MOV SI,OFFSET DOSDATA:INBUF
MOV CL,DH ; set up count
REP MOVSB ; Copy final line to user buffer
return
; Output a CRLF to the user screen and do NOT store it into the buffer
PHYCRLF:
invoke CRLF
JMP GETCH
;
; Delete the previous line
;
LineDel:
OR DH,DH
JZ GetCh
Call BackSpace
JMP LineDel
;
; delete the previous word.
;
WordDel:
WordLoop:
Call BackSpace ; backspace the one spot
OR DH,DH
JZ GetChJ
MOV AL,ES:[DI-1]
cmp al,'0'
jb GetChj
cmp al,'9'
jbe WordLoop
OR AL,20h
CMP AL,'a'
JB GetChJ
CMP AL,'z'
JBE WordLoop
getchj: JMP GetCh
; The user wants to throw away what he's typed in and wants to start over. We
; print the backslash and then go to the next line and tab to the correct spot
; to begin the buffered input.
entry KILNEW
MOV AL,"\"
invoke OUTT ;Print the CANCEL indicator
POP SI ;Remember start of edit buffer
PUTNEW:
invoke CRLF ;Go to next line on screen
;hkn; SS override
MOV AL,[STARTPOS]
invoke TAB ;Tab over
JMP NEWLIN ;Start over again
; Destructively back up one character position
entry BackSp
Call BackSpace
JMP GetCh
BackSpace:
OR DH,DH
JZ OLDBAK ;No chars in line, do nothing to line
CALL BACKUP ;Do the backup
MOV AL,ES:[DI] ;Get the deleted char
CMP AL," "
JAE OLDBAK ;Was a normal char
CMP AL,c_HT
JZ BAKTAB ;Was a tab, fix up users display
;; 9/27/86 fix for ctrl-U backspace
CMP AL,"U"-"@" ; ctrl-U is a section symbol not ^U
JZ OLDBAK
CMP AL,"T"-"@" ; ctrl-T is a paragraphs symbol not ^T
JZ OLDBAK
;; 9/27/86 fix for ctrl-U backspace
CALL BACKMES ;Was a control char, zap the '^'
OLDBAK:
;hkn; SS override
CMP BYTE PTR [INSMODE],0
retnz ;In insert mode, done
OR BH,BH
retz ;Not advanced in template, stay where we are
DEC BH ;Go back in template
DEC SI
return
BAKTAB:
PUSH DI
DEC DI ;Back up one char
STD ;Go backward
MOV CL,DH ;Number of chars currently in line
MOV AL," "
PUSH BX
MOV BL,7 ;Max
JCXZ FIGTAB ;At start, do nothing
FNDPOS:
SCASB ;Look back
JNA CHKCNT
CMP BYTE PTR ES:[DI+1],9
JZ HAVTAB ;Found a tab
DEC BL ;Back one char if non tab control char
CHKCNT:
LOOP FNDPOS
FIGTAB:
;hkn; SS override
SUB BL,[STARTPOS]
HAVTAB:
SUB BL,DH
ADD CL,BL
AND CL,7 ;CX has correct number to erase
CLD ;Back to normal
POP BX
POP DI
JZ OLDBAK ;Nothing to erase
TABBAK:
invoke BACKMES
LOOP TABBAK ;Erase correct number of chars
JMP SHORT OLDBAK
BACKUP:
DEC DH ;Back up in line
DEC DI
BACKMES:
MOV AL,c_BS ;Backspace
invoke OUTT
MOV AL," " ;Erase
invoke OUTT
MOV AL,c_BS ;Backspace
JMP OUTT ;Done
;User really wants an ESC character in his line
entry TwoEsc
;hkn; ESCCHAR is in TABLE seg (DOSCODE), so CS override
MOV AL,[ESCCHAR]
JMP SAVCH
;Copy the rest of the template
entry COPYLIN
MOV CL,BL ;Total size of template
SUB CL,BH ;Minus position in template, is number to move
JMP SHORT COPYEACH
entry CopyStr
invoke FINDOLD ;Find the char
JMP SHORT COPYEACH ;Copy up to it
;Copy one char from template to line
entry COPYONE
MOV CL,1
;Copy CX chars from template to line
COPYEACH:
;hkn; SS override
MOV BYTE PTR [INSMODE],0 ;All copies turn off insert mode
CMP DH,DL
JZ GETCH2 ;At end of line, can't do anything
CMP BH,BL
JZ GETCH2 ;At end of template, can't do anything
LODSB
STOSB
invoke BUFOUT
INC BH ;Ahead in template
INC DH ;Ahead in line
LOOP COPYEACH
GETCH2:
JMP GETCH
;Skip one char in template
entry SKIPONE
CMP BH,BL
JZ GETCH2 ;At end of template
INC BH ;Ahead in template
INC SI
JMP GETCH
entry SKIPSTR
invoke FINDOLD ;Find out how far to go
ADD SI,CX ;Go there
ADD BH,CL
JMP GETCH
;Get the next user char, and look ahead in template for a match
;CX indicates how many chars to skip to get there on output
;NOTE: WARNING: If the operation cannot be done, the return
; address is popped off and a jump to GETCH is taken.
; Make sure nothing extra on stack when this routine
; is called!!! (no PUSHes before calling it).
FINDOLD:
invoke $STD_CON_INPUT_NO_ECHO
;hkn; ESCCHAR is in TABLE seg (DOSCODE), so CS override
CMP AL,[ESCCHAR] ; did he type a function key?
JNZ FindSetup ; no, set up for scan
invoke $STD_CON_INPUT_NO_ECHO ; eat next char
JMP short NotFnd ; go try again
FindSetup:
MOV CL,BL
SUB CL,BH ;CX is number of chars to end of template
JZ NOTFND ;At end of template
DEC CX ;Cannot point past end, limit search
JZ NOTFND ;If only one char in template, forget it
PUSH ES
PUSH DS
POP ES
PUSH DI
MOV DI,SI ;Template to ES:DI
INC DI
REPNE SCASB ;Look
POP DI
POP ES
JNZ NOTFND ;Didn't find the char
NOT CL ;Turn how far to go into how far we went
ADD CL,BL ;Add size of template
SUB CL,BH ;Subtract current pos, result distance to skip
return
NOTFND:
POP BP ;Chuck return address
JMP GETCH
entry REEDIT
MOV AL,"@" ;Output re-edit character
invoke OUTT
POP DI
PUSH DI
PUSH ES
PUSH DS
invoke COPYNEW ;Copy current line into template
POP DS
POP ES
POP SI
MOV BL,DH ;Size of line is new size template
JMP PUTNEW ;Start over again
entry EXITINS
entry ENTERINS
;hkn; SS override
NOT BYTE PTR [INSMODE]
JMP GETCH
;Put a real live ^Z in the buffer (embedded)
entry CTRLZ
MOV AL,"Z"-"@"
JMP SAVCH
;Output a CRLF
entry CRLF
MOV AL,c_CR
invoke OUTT
MOV AL,c_LF
JMP OUTT
EndProc $STD_CON_STRING_INPUT
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
ENDIF
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
BREAK <$RAW_CON_IO - Do Raw Console I/O>
;
;----------------------------------------------------------------------------
;
;** $RAW_CON_IO - Do Raw Console I/O
;
; Input or output raw character from console, no echo
;
; ENTRY DL = -1 if input
; = output character if output
; EXIT (AL) = input character if input
; USES all
;
;----------------------------------------------------------------------------
;
procedure $RAW_CON_IO,NEAR ; System call 6
MOV AL,DL
CMP AL,-1
LJNE RAWOUT ; is output
;hkn; SS override
LES DI,DWORD PTR [user_SP] ; Get pointer to register save area
XOR BX,BX
call GET_IO_SFT
retc
IFDEF DBCS ;AN000;
;hkn; SS override
push word ptr [Intercon] ;AN000;
mov [Intercon],0 ;AN000; disable interim characters
ENDIF ;AN000;
MOV AH,1
call IOFUNC
JNZ RESFLG
IFDEF DBCS ;AN000;
;hkn; SS override
pop word ptr [InterCon] ;AN000; restore interim flag
ENDIF ;AN000;
invoke SPOOLINT
OR BYTE PTR ES:[DI.user_F],40H ; Set user's zero flag
XOR AL,AL
return
RESFLG:
AND BYTE PTR ES:[DI.user_F],0FFH-40H ; Reset user's zero flag
IFDEF DBCS ;AN000;
XOR AH,AH ;AN000;
call IOFUNC ;AN000; get the character
;hkn; SS override
pop word ptr [InterCon] ;AN000;
return ;AN000;
ENDIF ;AN000; ;AN000;
;
;----------------------------------------------------------------------------
;
;** $Raw_CON_INPUT - Raw Console Input
;
; Input raw character from console, no echo
;
; ENTRY none
; EXIT (al) = character
; USES all
;
;----------------------------------------------------------------------------
;
rci0: invoke SPOOLINT
entry $RAW_CON_INPUT ; System call 7
PUSH BX
XOR BX,BX
call GET_IO_SFT
POP BX
retc
MOV AH,1
call IOFUNC
JNZ rci5
MOV AH,84h
INT int_IBM
JMP rci0
rci5: XOR AH,AH
call IOFUNC
IFDEF DBCS ;AN000;
;hkn; SS override
cmp [InterChar],1 ;AN000; 2/11/KK
; 2/11/KK
; Sets the application zero flag depending on the 2/11/KK
; zero flag upon entry to this routine. Then returns 2/11/KK
; from system call. 2/11/KK
; 2/11/KK
entry InterApRet ;AN000; 2/11/KK ;AN000;
pushf ;AN000; 3/16/KK
;hkn; push ds ;AN000; 3/16/KK
push bx ;AN000; 3/16/KK
;hkn; SS is DOSDATA
;hkn; Context DS ;AN000; 3/16/KK
;hkn; COUNTRY_CDPG is in DOSCODE;smr;NO in DOSDATA
MOV BX,offset DOSDATA:COUNTRY_CDPG.ccDosCodePage
cmp word ptr ss:[bx],934 ;AN000; 3/16/KK korean code page ?; bug fix. use SS
pop bx ;AN000; 3/16/KK
;hkn; pop ds ;AN000; 3/16/KK
je do_koren ;AN000; 3/16/KK
popf ;AN000; 3/16/KK
return ;AN000; 3/16/KK
do_koren: ;AN000; 3/16/KK
popf ;AN000;
;hkn; SS override
LES DI,DWORD PTR [user_SP] ;AN000; Get pointer to register save area KK
jnz sj0 ;AN000; 2/11/KK
OR BYTE PTR ES:[DI.user_F],40H ;AN000; Set user's zero flag 2/11/KK
return ;AN000; 2/11/KK
sj0: ;AN000; 2/11/KK
AND BYTE PTR ES:[DI.user_F],0FFH-40H ;AN000; Reset user's zero flag 2/KK
ENDIF ;AN000;
return ;AN000;
;
; Output the character in AL to stdout
;
entry RAWOUT
PUSH BX
MOV BX,1
call GET_IO_SFT
JC RAWRET1
MOV BX,[SI.sf_flags] ;hkn; DS set up by get_io_sft
;
; If we are a network handle OR if we are not a local device then go do the
; output the hard way.
;
AND BX,sf_isNet + devid_device
CMP BX,devid_device
JNZ RawNorm
IFDEF DBCS ;AN000;
;hkn; SS override
TEST [SaveCurFlg],01H ;AN000; print but no cursor adv?
JNZ RAWNORM ;AN000; 2/11/KK
ENDIF ;AN000;
; TEST BX,sf_isnet ; output to NET?
; JNZ RAWNORM ; if so, do normally
; TEST BX,devid_device ; output to file?
; JZ RAWNORM ; if so, do normally
PUSH DS
LDS BX,[SI.sf_devptr] ; output to special?
TEST BYTE PTR [BX+SDEVATT],ISSPEC
POP DS
JZ RAWNORM ; if not, do normally
INT int_fastcon ; quickly output the char
RAWRET:
CLC
RAWRET1:
POP BX
return
RAWNORM:
CALL RAWOUT3
JMP RAWRET
;
; Output the character in AL to handle in BX
;
entry RAWOUT2
call GET_IO_SFT
retc
RAWOUT3:
PUSH AX
JMP SHORT RAWOSTRT
ROLP:
invoke SPOOLINT
;hkn; SS override
OR [DOS34_FLAG],CTRL_BREAK_FLAG ;AN002; set control break
invoke DSKSTATCHK ;AN002; check control break
RAWOSTRT:
MOV AH,3
call IOFUNC
JZ ROLP
;SR;
; IOFUNC now returns ax = 0ffffh if there was an I24 on a status call and
;the user failed. We do not send a char if this happens. We however return
;to the caller with carry clear because this DOS call does not return any
;status.
;
inc ax ;fail on I24 if ax = -1
POP AX
jz nosend ;yes, do not send char
MOV AH,2
call IOFUNC
nosend:
CLC ; Clear carry indicating successful
return
EndProc $RAW_CON_IO
;
;----------------------------------------------------------------------------
;
; Inputs:
; AX=0 save the DEVCALL request packet
; =1 restore the DEVCALL request packet
; Function:
; save or restore the DEVCALL packet
; Returns:
; none
;
;----------------------------------------------------------------------------
;
procedure Save_Restore_Packet,NEAR
PUSH DS
PUSH ES
PUSH SI
PUSH DI
CMP AX,0 ; save packet
JZ save_packet
restore_packet:
MOV SI,OFFSET DOSDATA:Packet_Temp ;sourec
MOV DI,OFFSET DOSDATA:DEVCALL ;destination
JMP short set_seg
save_packet:
MOV DI,OFFSET DOSDATA:Packet_Temp ;destination
MOV SI,OFFSET DOSDATA:DEVCALL ;source
set_seg:
MOV AX,SS ; set DS,ES to DOSDATA
MOV DS,AX
MOV ES,AX
MOV CX,11 ; 11 words to move
REP MOVSW
POP DI
POP SI
POP ES
POP DS
return
EndProc Save_Restore_Packet
DOSCODE ENDS
END
| 26.096134
| 83
| 0.542764
|
05aa9ae7195caa4bfde481368b84f1add45177f3
| 4,693
|
asm
|
Assembly
|
reversing/matryoshka/src/gen_rot13.asm
|
cclauss/fbctf-2019-challenges
|
4353c2ce588cf097ac6ca9bcf7b943a99742ac75
|
[
"MIT"
] | 213
|
2019-06-14T18:28:40.000Z
|
2021-12-27T14:44:45.000Z
|
reversing/matryoshka/src/gen_rot13.asm
|
cclauss/fbctf-2019-challenges
|
4353c2ce588cf097ac6ca9bcf7b943a99742ac75
|
[
"MIT"
] | 2
|
2020-06-05T21:14:51.000Z
|
2021-06-10T21:34:03.000Z
|
reversing/matryoshka/src/gen_rot13.asm
|
cclauss/fbctf-2019-challenges
|
4353c2ce588cf097ac6ca9bcf7b943a99742ac75
|
[
"MIT"
] | 59
|
2019-06-17T17:35:29.000Z
|
2021-12-04T22:26:37.000Z
|
; THIS IS AN AUTOGENERATED FILE
; WARNING: FOR MACOS ONLY
; nasm -f macho64 rot13.asm -o rot13.o && ld -o rot13.macho -macosx_version_min 10.7 -e start rot13.o && ./rot13.macho
BITS 64
section .text
global start
start:
push rbp
mov rbp,rsp
; PRINT OUTPUT
push 0xa203a
mov DWORD [rsp+0x4],0x0
push 0x76207965
mov DWORD [rsp+0x4],0x65756c61
push 0x7475706e
mov DWORD [rsp+0x4],0x6b206120
push 0x61656c50
mov DWORD [rsp+0x4],0x69206573
mov rax, 0x2000004
mov rdi, 0x1
mov rsi, rsp
mov edx, 0x1b
syscall
pop rax
pop rax
pop rax
pop rax
; GET INPUT
mov rax, 0x2000003
mov rdi, 0
lea rsi, [rel key]
mov edx, 27
syscall
; START DECRYPTION
mov r12, 0 ; ; int i = 0;
mov r10w, WORD [rel key]
lea r14, [rel key]
loop1:
cmp r12, 23 ; Length of Answer
jge verify_rot13
movzx ecx, BYTE [r14 + r12] ; c = Answer[i]
cmp ecx, 0x41 ; if c >='A'
jl goto_lowercase
cmp ecx, 0x5a ; if c <='Z'
jg goto_lowercase
add ecx, 0xd ; e = c + ROT
cmp ecx, 0x5a ; if((e = c + ROT) <= 'Z')
jg greater_than
mov BYTE [r14 + r12], cl ; Answer[i] = e;
jmp goto_increment1
greater_than:
movzx ecx, BYTE [r14 + r12]
sub ecx, 0xd ; e = c - ROT
mov BYTE [r14 + r12], cl ; Answer[i] = e;
goto_increment1:
jmp increment
goto_lowercase:
movzx ecx, BYTE [r14 + r12] ; c = Answer[i]
cmp ecx, 0x61 ; 'a' ; if c >='a'
jl neither
cmp ecx, 0x7a ; if c <='z'
jg neither
mov eax, ecx
add eax, 0xd ; e = c + ROT
cmp eax, 0x7a ; if((e= c + ROT) <= 'z')
jg greater_than2
mov cl, al
mov BYTE [r14+r12], cl ; Answer[i] = e;
jmp goto_increment2
greater_than2:
movzx ecx, BYTE [r14 + r12]
sub ecx, 0xd ; e = c - ROT
mov BYTE [r14 + r12], cl ; Answer[i] = e;
goto_increment2:
jmp increment
neither: ; else
movzx ecx, BYTE [r14 + r12] ; c
mov BYTE [r14 + r12], cl ; Answer[i] = c;
increment:
inc r12
jmp loop1
verify_rot13:
xor r8, r8 ; int isSame = 0;
xor r12, r12 ; int i = 0
lea r13, [rel ROT13]
loop2:
cmp r12, 23 ; i < 23
jge exit_loop
movzx ecx, BYTE [r14 + r12] ; Answer[i]
movzx edx, BYTE [r13 + r12] ; final[i]
cmp ecx, edx ; if (final[i] == Answer[i])
jne not_equal
mov r8, 0x1 ; isSame = 1
jmp continue_loop
not_equal:
mov r8, 0x0 ; isSame = 0
jmp exit_loop ; break;
continue_loop:
inc r12
jmp loop2
exit_loop:
cmp r8d, 0x1 ; if (isSame == 1)
jne fail
mov eax, 0x2000004 ; write
mov rdi, 1 ; std out
lea rsi, [rel msg]
mov edx, 21
syscall
xor eax, eax
mov ax, 0x354c ; 0x4d34 ^ 0x354C = 0x7878 (offset of next shellcode)
xor ax, r10w
pop rbp
retn
fail:
mov rax, 0x2000004 ; write
mov rdi, 1 ; std out
lea rsi, [rel msg2]
mov edx, 230
syscall
xor eax, eax
mov rax, 0x2000001 ; exit
mov rdi, 0
syscall
section .data
ROT13: db "4ZberYriryf2TbXrrcTbvat", 10
key: times 27 db 0
msg: db "I believe in you ...", 10
msg2:
db 32,32,32,32,32,70,65,73,76,32,87,72,65,76,69,33,10,10,87,32,32,32,32,32,87,32,32,32,32,32,32,87,32,32,32,32,32,32,32,32,10,87,32,32,32,32,32,32,32,32,87,32,32,87,32,32,32,32,32,87,32,32,32,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,39,46,32,32,87,32,32,32,32,32,32,10,32,32,46,45,34,34,45,46,95,32,32,32,32,32,92,32,92,46,45,45,124,32,32,10,32,47,32,32,32,32,32,32,32,34,45,46,46,95,95,41,32,46,45,39,32,32,32,10,124,32,32,32,32,32,95,32,32,32,32,32,32,32,32,32,47,32,32,32,32,32,32,10,92,39,45,46,95,95,44,32,32,32,46,95,95,46,44,39,32,32,32,32,32,32,32,10,32,96,39,45,45,45,45,39,46,95,92,45,45,39,32,32,32,32,32,32,10,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,10
| 34.007246
| 700
| 0.48583
|
05f61f6fbc4a8c9410b8d097a4d4f40bb12400d1
| 17,644
|
asm
|
Assembly
|
Library/Pref/Prefsnd/prefsnd.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Library/Pref/Prefsnd/prefsnd.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Library/Pref/Prefsnd/prefsnd.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:
FILE: prefsnd.asm
AUTHOR: Gene Anderson, Aug 25, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Gene 8/25/92 Initial revision
DESCRIPTION:
Code for keyboard module of Preferences
$Id: prefsnd.asm,v 1.2 98/04/24 01:55:41 gene Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;------------------------------------------------------------------------------
; Common GEODE stuff
;------------------------------------------------------------------------------
include geos.def
include heap.def
include geode.def
include resource.def
include ec.def
include library.def
include object.def
include graphics.def
include gstring.def
include win.def
include char.def
include initfile.def
;-----------------------------------------------------------------------------
; Libraries used
;-----------------------------------------------------------------------------
UseLib ui.def
UseLib config.def
;-----------------------------------------------------------------------------
; DEF FILES
;-----------------------------------------------------------------------------
include prefsnd.def
include prefsnd.rdef
ifdef GPC_VERSION
include sound.def
include Internal/powerDr.def
endif
;-----------------------------------------------------------------------------
; VARIABLES
;-----------------------------------------------------------------------------
idata segment
idata ends
;-----------------------------------------------------------------------------
; CODE
;-----------------------------------------------------------------------------
PrefSndCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefSndGetPrefUITree
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the root of the UI tree for "Preferences"
CALLED BY: PrefMgr
PASS: none
RETURN: dx:ax - OD of root of tree
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/25/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefSndGetPrefUITree proc far
mov dx, handle PrefSndRoot
mov ax, offset PrefSndRoot
ret
PrefSndGetPrefUITree endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefSndGetModuleInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fill in the PrefModuleInfo buffer so that PrefMgr
can decide whether to show this button
CALLED BY: PrefMgr
PASS: ds:si - PrefModuleInfo structure to be filled in
RETURN: ds:si - buffer filled in
DESTROYED: ax,bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECSnd/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 10/26/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefSndGetModuleInfo proc far
.enter
clr ax
mov ds:[si].PMI_requiredFeatures, mask PMF_USER
mov ds:[si].PMI_prohibitedFeatures, ax
mov ds:[si].PMI_minLevel, ax
mov ds:[si].PMI_maxLevel, UIInterfaceLevel-1
mov ds:[si].PMI_monikerList.handle, handle PrefSndMonikerList
mov ds:[si].PMI_monikerList.offset, offset PrefSndMonikerList
mov {word} ds:[si].PMI_monikerToken, 'P' or ('F' shl 8)
mov {word} ds:[si].PMI_monikerToken+2, 'S' or ('N' shl 8)
mov {word} ds:[si].PMI_monikerToken+4, MANUFACTURER_ID_APP_LOCAL
.leave
ret
PrefSndGetModuleInfo endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefSndSaveOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: send message to the UI to update itself
PASS: *ds:si = PrefSndDialogClass object
ds:di = PrefSndDialogClass instance data
es = dgroup
RETURN:
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 10/ 2/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
soundCat char "sound",0
volume char "volume", 0
balance char "balance", 0
synthKey char "synthDriver",0
sampleKey char "sampleDriver",0
driverKey char "driver",0
soundDir char "sound",0
PrefSndSaveOptions method dynamic PrefSndDialogClass,
MSG_META_SAVE_OPTIONS
driverName local FileLongName
driverDOSName local DosDotFileName
.enter
push bp
mov di, offset PrefSndDialogClass
call ObjCallSuperNoLock
pop bp
push bp
mov ax, MSG_USER_UPDATE_SOUND_PARAMS
mov bx, handle ui
clr di
call ObjMessage
pop bp
;
; Save stuff that has multiple keys
;
; Get the DOS name of the driver (why DOS!?!)
;
segmov ds, cs, cx
push bp, cx
mov si, offset soundCat
mov dx, offset driverKey
segmov es, ss
lea di, ss:driverName
mov bp, InitFileReadFlags <IFCC_INTACT, 0, 0, (size driverName)>
call InitFileReadString
pop bp, cx
jc notFound
;
; Look in SYSTEM\SOUND
;
mov bx, SP_SYSTEM ;bx <- StandardPath
segmov ds, cs
mov dx, offset soundDir ;ds:dx <- path
call FileSetCurrentPath
segmov es, ss, ax
lea di, ss:driverDOSName ;es:di <- buffer
mov ds, ax
lea dx, ss:driverName ;ds:dx <- filename
mov ax, FEA_DOS_NAME ;ax <- FileExtendedAtt
mov cx, (size driverDOSName)
call FileGetPathExtAttributes
;
; Write it to the synthDriver and sampleDriver keys
;
segmov ds, cs, cx
mov si, offset soundCat
mov dx, offset synthKey
call InitFileWriteString
mov dx, offset sampleKey
call InitFileWriteString
notFound:
.leave
ret
PrefSndSaveOptions endm
ifdef GPC_VERSION
;
; Intercept the handler and turn on/off the volume gadget.
;
PrefItemGroupSelect method MyPrefItemGroupClass,
MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
uses bx
.enter
push cx
mov di, offset MyPrefItemGroupClass
call ObjCallSuperNoLock
pop cx
cmp cx, TRUE
mov ax, MSG_GEN_SET_ENABLED
je enableSound
mov ax, MSG_GEN_SET_NOT_ENABLED
enableSound:
;
; enable/disable the volume control
;
mov bx, ds:LMBH_handle
mov si, offset PrefVolume
mov dl, VUM_NOW
mov di, mask MF_CALL
push bx, ax, dx, di
call ObjMessage
pop bx, ax, dx, di
;
; enable/disable the balance control too.
;
mov si, offset PrefVolumeBalance
call ObjMessage
.leave
ret
PrefItemGroupSelect endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefSndOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Get the sound volume from the hardware device, and
set the UI gadget.
PASS:
RETURN:
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
edwin 5/14/99 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefSndOpen method dynamic ChannelVolumeClass,
MSG_VIS_OPEN
uses di
.enter
mov di, offset ChannelVolumeClass
call ObjCallSuperNoLock
;
; Read the sound volume from the ini file
;
push ds, si
segmov ds, cs, cx
mov si, offset soundCat
mov dx, offset volume
call InitFileReadInteger ; ax
jnc ok
mov ax, MIXER_LVL_MAX / 2 ; default volume
ok:
pop ds, si
;
; set UI volume slider
;
mov cx, ax
mov ax, MSG_PREF_VALUE_SET_ORIGINAL_VALUE
clr bp
call ObjCallInstanceNoLock
;
; record the original volume+balance setting.
call SoundMixerGetMasterVolume
mov di, ds:[si]
add di, ds:[di].ChannelVolume_offset
mov ds:[di].CV_originalVolumeBalance, ax
; save self optr to pass to PM driver later.
push ds:[OLMBH_header].LMBH_handle, si
;
; Read the balance from the ini file
;
push ds
segmov ds, cs, cx
mov si, offset soundCat
mov dx, offset balance
call InitFileReadInteger ; ax
jnc ok2
mov ax, SOUND_BALANCE_MAX / 2 ; default balance
ok2:
pop ds
;
; set the UI balance slider
;
mov cx, ax
mov bx, ds:LMBH_handle
mov si, offset PrefVolumeBalance
mov ax, MSG_PREF_VALUE_SET_ORIGINAL_VALUE
mov di, mask MF_CALL
call ObjMessage
;
; Connect to power driver to get volume button notifications.
;
pop dx, cx ; ^ldx:cx = self
mov ax, GDDT_POWER_MANAGEMENT
call GeodeGetDefaultDriver ; ax = driver handle
tst ax
jz afterPM ; => no PM driver
mov_tr bx, ax ; bx = driver handle
call GeodeInfoDriver ; ds:si = DriverInfoStruct
mov bx, si ; ds:bx = DriverInfoStruct
mov di, DR_POWER_ESC_COMMAND
mov si, POWER_ESC_VOL_BUTTON_NOTIF_REGISTER
mov ax, MSG_CV_VOL_UP_BUTTON_PRESSED
mov bp, MSG_CV_VOL_DOWN_BUTTON_PRESSED
call ds:[bx].DIS_strategy
EC < WARNING_C CANT_REGISTER_WITH_PM_DRIVER_VOL_BUTTON_NOTIF >
EC < tst ax >
EC < WARNING_NZ CANT_REGISTER_WITH_PM_DRIVER_VOL_BUTTON_NOTIF >
afterPM:
.leave
ret
PrefSndOpen endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CVVisClose
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Disconnect ourselves from power driver for volume button
notifications.
CALLED BY: MSG_VIS_CLOSE
PASS: *ds:si = ChannelVolumeClass object
es = segment of ChannelVolumeClass
ax = message #
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 9/07/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CVVisClose method dynamic ChannelVolumeClass,
MSG_VIS_CLOSE
mov di, offset ChannelVolumeClass
call ObjCallSuperNoLock
mov dx, ds:[OLMBH_header].LMBH_handle
mov cx, si ; ^ldx:cx = self
mov ax, GDDT_POWER_MANAGEMENT
call GeodeGetDefaultDriver ; ax = driver handle
tst ax
jz done ; => no PM driver
mov_tr bx, ax ; bx = driver handle
call GeodeInfoDriver ; ds:si = DriverInfoStruct
mov bx, si ; ds:bx = DriverInfoStruct
mov di, DR_POWER_ESC_COMMAND
mov si, POWER_ESC_VOL_BUTTON_NOTIF_UNREGISTER
call ds:[bx].DIS_strategy
EC < WARNING_C CANT_UNREGISTER_WITH_PM_DRIVER_VOL_BUTTON_NOTIF >
EC < tst ax >
EC < WARNING_NZ CANT_UNREGISTER_WITH_PM_DRIVER_VOL_BUTTON_NOTIF >
done:
ret
CVVisClose endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CVVolButtonPressed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: A front-panel volume button is pressed.
CALLED BY: MSG_CV_VOL_UP_BUTTON_PRESSED
MSG_CV_VOL_DOWN_BUTTON_PRESSED
PASS: *ds:si = ChannelVolumeClass object
ax = message #
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 9/07/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CVVolButtonPressed method dynamic ChannelVolumeClass,
MSG_CV_VOL_UP_BUTTON_PRESSED,
MSG_CV_VOL_DOWN_BUTTON_PRESSED
;
; Do nothing if the object is disabled Gen-wise.
;
mov_tr di, ax ; di = vol up/down msg
mov ax, MSG_GEN_GET_ENABLED
call ObjCallInstanceNoLock ; CF set if enabled
jnc done ; => disabled
;
; Add or subtract the increment as appropritate.
;
mov ax, MSG_GEN_VALUE_GET_VALUE
call ObjCallInstanceNoLock ; dx.cx = value
cmp di, MSG_CV_VOL_DOWN_BUTTON_PRESSED
je down
if (((MIXER_LVL_MAX - MIXER_LVL_MIN) * 65536 / SOUND_BUTTON_INC_FACTOR) \
and 0xffff) ne 0
add cx, ((MIXER_LVL_MAX - MIXER_LVL_MIN) * 65536 \
/ SOUND_BUTTON_INC_FACTOR) and 0xffff
adc dx, (MIXER_LVL_MAX - MIXER_LVL_MIN) / SOUND_BUTTON_INC_FACTOR
else
add dx, (MIXER_LVL_MAX - MIXER_LVL_MIN) / SOUND_BUTTON_INC_FACTOR
endif
jmp setValue
down:
if (((MIXER_LVL_MAX - MIXER_LVL_MIN) * 65536 / SOUND_BUTTON_INC_FACTOR) \
and 0xffff) ne 0
sub cx, ((MIXER_LVL_MAX - MIXER_LVL_MIN) * 65536 \
/ SOUND_BUTTON_INC_FACTOR) and 0xffff
sbb dx, (MIXER_LVL_MAX - MIXER_LVL_MIN) / SOUND_BUTTON_INC_FACTOR
else
sub dx, (MIXER_LVL_MAX - MIXER_LVL_MIN) / SOUND_BUTTON_INC_FACTOR
endif
setValue:
mov ax, MSG_GEN_VALUE_SET_VALUE
clr bp ; not indeterminate
call ObjCallInstanceNoLock
;
; Mark the object modified, so that it becomes applyable.
;
mov ax, MSG_GEN_VALUE_SET_MODIFIED_STATE
mov cx, ax ; cx = non-zero to mark modified
call ObjCallInstanceNoLock
;
; Force the status message to be sent.
;
mov ax, MSG_GEN_VALUE_SEND_STATUS_MSG
mov cx, ax ; cx = non-zero for modified
call ObjCallInstanceNoLock
done:
ret
CVVolButtonPressed endm
;
;
;
PrefSndApply method dynamic ChannelVolumeClass,
MSG_GEN_APPLY
.enter
mov di, offset ChannelVolumeClass
call ObjCallSuperNoLock
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov bp, ds:[di].GVLI_value.WWF_int
;
; Store the current values as the original values, because they
; have now been "applied".
;
mov dx, bp ; dx = volume
call ApplyLeftRightBalance ; al = left vol, ah = right vol
mov di, ds:[si]
add di, ds:[di].ChannelVolume_offset
mov ds:[di].CV_originalVolumeBalance, ax
segmov ds, cs, cx
mov si, offset soundCat
mov dx, offset volume
call InitFileWriteInteger ; ax
.leave
ret
PrefSndApply endm
PrefBalanceApply method dynamic ChannelBalanceClass,
MSG_GEN_APPLY
.enter
mov di, offset ChannelBalanceClass
call ObjCallSuperNoLock
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov bp, ds:[di].GVLI_value.WWF_int
segmov ds, cs, cx
mov si, offset soundCat
mov dx, offset balance
call InitFileWriteInteger ; ax
.leave
ret
PrefBalanceApply endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChannelVolumeReset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Reset the sound volume. User aborts the changes.
PASS: none
RETURN: none
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
edwin 5/14/99 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChannelVolumeReset method dynamic ChannelVolumeClass,
MSG_GEN_RESET
.enter
push di
mov di, offset ChannelVolumeClass
call ObjCallSuperNoLock
pop di
mov ax, ds:[di].CV_originalVolumeBalance
call SoundMixerSetMasterVolume
.leave
ret
ChannelVolumeReset endm
;
; It's a fake fix to the system bug that the disabled slider can
; actually react to the mouse action.
;
ChannelVolumeStartSelect method dynamic ChannelVolumeClass,
MSG_META_START_SELECT
.enter
mov di, offset ChannelVolumeClass
call SliderInteraction
.leave
ret
ChannelVolumeStartSelect endm
ChannelBalanceStartSelect method dynamic ChannelBalanceClass,
MSG_META_START_SELECT
.enter
mov di, offset ChannelBalanceClass
call SliderInteraction
.leave
ret
ChannelBalanceStartSelect endm
SliderInteraction proc far
class PrefValueClass
.enter
push di
mov di, ds:[si]
add di, ds:[di].Gen_offset
test ds:[di].GI_states, mask GS_ENABLED
pop di
jz skip
call ObjCallSuperNoLock
jmp exit
skip:
mov ax, mask MRF_PROCESSED
exit:
.leave
ret
SliderInteraction endp
;
; Play a testing sound.
;
ChannelVolumeTest method dynamic ChannelVolumeClass,
MSG_CV_TEST_VOLUME
.enter
mov ax, MSG_GEN_VALUE_GET_VALUE
call ObjCallInstanceNoLock ; dx.cx - int, frac
call ApplyLeftRightBalance ; al - left, ah - right
call SoundMixerSetMasterVolume
mov ax, SST_ALARM or SST_IGNORE_SOUND_OFF
call UserStandardSound
.leave
ret
ChannelVolumeTest endm
;
; Apply the left-right volume balance.
; Pass: dx - master volume
; Return: al - left channel volume
; ah - right channel volume
;
ApplyLeftRightBalance proc near
uses si, bx, cx, dx, bp, di
.enter
push dx ; master volume
mov bx, ds:LMBH_handle
mov si, offset PrefVolumeBalance
mov ax, MSG_GEN_VALUE_GET_VALUE
mov di, mask MF_CALL
call ObjMessage ; dx.cx - int, frac
mov_tr ax, dx ; ax - balance indication: 0 - SOUND_BALANCE_MAX
pop dx ; master volume
; Fixing channel volume strategy:
; Multiply the "other" channel volume by the balance value that
; the user selected in the balance UI gadget, divide by MAX/2.
; The selected value is between 0 and MAX/2.
; Don't bother rounding off.
cmp ax, SOUND_BALANCE_MAX / 2
ja fixLeftChannel
fixRightChannel::
mul dl ; ax = vol * bal
mov cl, SOUND_BALANCE_MAX / 2
div cl ; al = vol * (bal / (MAX/2))
mov ah, al
mov al, dl
jmp done
fixLeftChannel:
sub al, SOUND_BALANCE_MAX
neg al ; al = bal
mul dl ; ax = vol * bal
mov cl, SOUND_BALANCE_MAX / 2
div cl ; al = vol * (bal / (MAX/2))
mov ah, dl
done:
; al - left channel volume,
; ah - right channel volume.
.leave
ret
ApplyLeftRightBalance endp
endif
PrefSndCode ends
| 23.715054
| 80
| 0.607572
|
edcdeebdee86a1c97943c765e34050cc9471ba7b
| 6,028
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_118.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_118.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_118.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xaf8b, %rsi
lea addresses_A_ht+0x2ca3, %rdi
nop
nop
nop
add $17117, %r9
mov $11, %rcx
rep movsq
nop
nop
nop
nop
nop
add %r13, %r13
lea addresses_D_ht+0x1689f, %rsi
lea addresses_D_ht+0x140f, %rdi
nop
nop
nop
nop
nop
and %rbp, %rbp
mov $113, %rcx
rep movsq
cmp %rdi, %rdi
lea addresses_normal_ht+0x16c9f, %rdi
nop
nop
nop
add $53901, %r12
mov (%rdi), %r9w
nop
sub %r13, %r13
lea addresses_D_ht+0xf17f, %rsi
lea addresses_WT_ht+0x1217e, %rdi
nop
cmp $5426, %rbp
mov $23, %rcx
rep movsl
nop
nop
nop
cmp $22000, %rsi
lea addresses_normal_ht+0x6c9f, %rsi
lea addresses_WT_ht+0x9731, %rdi
clflush (%rdi)
nop
sub %r13, %r13
mov $122, %rcx
rep movsq
cmp $59623, %rcx
lea addresses_WT_ht+0x1eff, %rsi
nop
nop
nop
cmp %rcx, %rcx
movl $0x61626364, (%rsi)
nop
nop
nop
xor %rcx, %rcx
lea addresses_D_ht+0x5488, %r13
xor $47898, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm1
movups %xmm1, (%r13)
nop
nop
nop
xor $56654, %r12
lea addresses_A_ht+0x934f, %r9
sub $32579, %rsi
mov $0x6162636465666768, %r12
movq %r12, (%r9)
nop
nop
nop
nop
xor $5294, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %rbp
push %rdi
// Faulty Load
lea addresses_RW+0x6c9f, %rdi
nop
nop
nop
sub %rbp, %rbp
vmovups (%rdi), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r15
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 41.861111
| 2,999
| 0.661082
|
5e44ab66bb219b3aaadfdc34aa2d102169d1ab88
| 8,263
|
asm
|
Assembly
|
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0_notsx.log_21829_369.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_369.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_369.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0xf663, %r11
nop
nop
nop
sub %rcx, %rcx
movw $0x6162, (%r11)
nop
nop
dec %r8
lea addresses_UC_ht+0x11ae3, %rax
clflush (%rax)
nop
nop
nop
nop
nop
and %rcx, %rcx
mov $0x6162636465666768, %r8
movq %r8, %xmm0
vmovups %ymm0, (%rax)
nop
xor $13510, %r10
lea addresses_A_ht+0x5963, %rdx
nop
sub %r13, %r13
mov $0x6162636465666768, %r8
movq %r8, %xmm3
vmovups %ymm3, (%rdx)
nop
nop
dec %r11
lea addresses_D_ht+0x1a3eb, %rsi
lea addresses_normal_ht+0x14f73, %rdi
nop
nop
xor %r11, %r11
mov $70, %rcx
rep movsl
inc %r10
lea addresses_D_ht+0x1d363, %r13
nop
nop
nop
nop
nop
xor $51241, %r10
movl $0x61626364, (%r13)
nop
nop
nop
xor %r10, %r10
lea addresses_UC_ht+0x3ac3, %rsi
nop
nop
nop
nop
nop
inc %r8
movb (%rsi), %al
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x1494c, %r11
nop
nop
sub %rdi, %rdi
movb (%r11), %al
nop
nop
nop
add %rax, %rax
lea addresses_normal_ht+0x61ab, %rax
nop
nop
nop
nop
cmp $15830, %r11
movb (%rax), %dl
nop
nop
nop
nop
nop
add $19633, %rdx
lea addresses_normal_ht+0x6663, %rsi
nop
sub $26852, %r10
mov (%rsi), %r13d
nop
sub %rsi, %rsi
lea addresses_normal_ht+0xda63, %rdx
nop
nop
nop
cmp $2359, %rax
mov $0x6162636465666768, %r11
movq %r11, %xmm1
and $0xffffffffffffffc0, %rdx
vmovntdq %ymm1, (%rdx)
nop
nop
dec %r10
lea addresses_D_ht+0x8283, %rsi
nop
cmp $55191, %rdi
mov $0x6162636465666768, %r10
movq %r10, %xmm4
and $0xffffffffffffffc0, %rsi
vmovaps %ymm4, (%rsi)
nop
and %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_US+0x1a4da, %rsi
lea addresses_D+0x63, %rdi
nop
sub %r15, %r15
mov $18, %rcx
rep movsl
nop
nop
xor $46508, %rdi
// Store
lea addresses_WC+0xbe63, %r15
add %r11, %r11
movl $0x51525354, (%r15)
add %rcx, %rcx
// Store
mov $0xce3, %r13
nop
nop
nop
and $21032, %r15
mov $0x5152535455565758, %rsi
movq %rsi, (%r13)
inc %rsi
// Store
lea addresses_D+0x14f23, %r11
sub $610, %r13
mov $0x5152535455565758, %rsi
movq %rsi, %xmm4
movaps %xmm4, (%r11)
nop
nop
nop
nop
nop
dec %r13
// Store
lea addresses_normal+0x18943, %r13
nop
sub $35233, %r15
mov $0x5152535455565758, %r11
movq %r11, %xmm2
movups %xmm2, (%r13)
nop
nop
nop
nop
sub %rsi, %rsi
// Store
lea addresses_PSE+0x19ffb, %rsi
nop
xor %r11, %r11
mov $0x5152535455565758, %rcx
movq %rcx, (%rsi)
nop
nop
add $64135, %rdi
// Faulty Load
mov $0x7ede210000000663, %rdi
nop
add %rcx, %rcx
mov (%rdi), %r11w
lea oracles, %rcx
and $0xff, %r11
shlq $12, %r11
mov (%rcx,%r11,1), %r11
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_US', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 2, 'NT': True, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 6}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 5}}
{'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
*/
| 32.789683
| 2,999
| 0.654484
|
bb24dd98b1a08ff1b1bc5b7316f317a481086a19
| 2,046
|
asm
|
Assembly
|
0.helpers.asm
|
mtxr/baseConverter
|
ed24123b4a0d252244930fb70f61b783ac98e488
|
[
"MIT"
] | null | null | null |
0.helpers.asm
|
mtxr/baseConverter
|
ed24123b4a0d252244930fb70f61b783ac98e488
|
[
"MIT"
] | null | null | null |
0.helpers.asm
|
mtxr/baseConverter
|
ed24123b4a0d252244930fb70f61b783ac98e488
|
[
"MIT"
] | null | null | null |
######### HELPER FUNCTIONS ##############
printNewline: # Print string newline
la $a0, newline # load the address of newline
li $v0, 4 # print_string syscall code = 4
syscall
jr $ra # return
printString:
li $v0, 4 # print_string syscall code = 4
syscall
jr $ra # return
printError:
la $a0, invalidInputText
jal printString
j exit
readBase:
li $v0, 12 # read_string syscall code = 8
syscall
jr $ra # return
readNumber:
la $a0, inputNumberArray # load inputBase address to argument0
li $v0, 8 # read_string syscall code = 8
li $a1, 32 # space allocated for inputBase
syscall
jr $ra # return
exit:
jal printNewline
li $v0, 10 # exit
syscall
return:
jr $ra # return to last saved address
revertToOutputArray:
la $a0, outputNumberArray # load outputNumberArray address
j revertFromA1
revertToAuxiliaryArray:
la $a0, auxiliaryArray # load outputNumberArray address
j revertFromA1
revertToInputArray:
addi $a1, $a1, -1 # -- auxiliaryArray position
la $a0, inputNumberArray # load outputNumberArray address
j revertFromA1
revertFromA1: # a1 is the last position, (array to revert)
li $t0, 0 # i = 0
revertArrayLoop:
addi $a1, $a1, -1 # -- auxiliaryArray position
lb $t0, 0($a1) # load byte from auxiliaryArray
beqz $t0, return # if no char was read, return to print
sb $t0, 0($a0) # save loaded byte to ouput array
addi $a0, $a0, 1 # ++ outputNumberArray position
j revertArrayLoop # return to loop
copyToAuxiliaryArray:
la $a1, auxiliaryArray
j copyLoop
copyLoop:
lb $t9, 0($a0)
beq $t9, $zero, return
sb $t9, 0($a1)
addi $a0, $a0, 1
addi $a1, $a1, 1
j copyLoop
| 27.648649
| 72
| 0.557674
|
e2ad64a1cb8e77eb727e738bade76110e523e45e
| 3,568
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/stdio/z80/input_helpers/__stdio_recv_input_eatc.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/stdio/z80/input_helpers/__stdio_recv_input_eatc.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/stdio/z80/input_helpers/__stdio_recv_input_eatc.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_clib
SECTION code_stdio
PUBLIC __stdio_recv_input_eatc
EXTERN STDIO_MSG_EATC
EXTERN l_addu_hl_bc, l_jpix, l_jphl
; ALL INPUT FOR VFSCANF PASSES THROUGH __STDIO_RECV_INPUT_*
; DE' IS USED TO TRACK NUMBER OF CHARS READ FROM STREAM
; HL' IS USED TO TRACK NUMBER OF ITEMS ASSIGNED
;
; OTHER HIGH LEVEL STDIO SHOULD USE __STDIO_RECV_INPUT_RAW_*
__stdio_recv_input_eatc:
; Driver consumes chars from the stream, as qualified by ignore()
;
; enter : ix = FILE *
; hl'= int (*qualify)(char c)
; bc'= reserved
; de'= reserved
; bc = max_length = max number of stream chars to consume
; de = number of chars read from stream so far
; hl = number of items assigned so far
;
; exit : ix = FILE *
; hl'= unchanged
; bc'= unchanged
; de'= unchanged
; bc = number of chars consumed from stream in this operation
; de = number of chars read from stream so far (updated)
; hl = number of items assigned so far
; a = next unconsumed char (if error: 0 on stream error, -1 on eof)
;
; carry set on error or eof, stream state set appropriately
bit 3,(ix+3)
jr nz, immediate_stream_error
bit 4,(ix+3)
jr nz, immediate_eof_error
bit 0,(ix+4)
jr z, _no_ungetc_ec ; if no unget char available
; examine unget char
ld a,b
or c
jr z, _ungetc_rejected_ec ; if max_length is zero only provide peek
ld a,(ix+6) ; a = unget char
exx
call l_jphl ; qualify(a)
exx
jr c, _ungetc_rejected_ec
res 0,(ix+4) ; consume the unget char
dec bc ; max_length--
call _no_ungetc_ec
_post_ungetc:
inc de ; total num chars read from stream++
inc bc ; num chars consumed in this operation++
ret
_ungetc_rejected_ec:
ld a,(ix+6) ; a = rejected unget char
ld bc,0 ; no chars consumed in this operation
or a ; indicate no error
ret
_no_ungetc_ec:
ld a,STDIO_MSG_EATC
push hl
push de
ld l,c
ld h,b ; hl = max_length
call l_jpix
ld a,l
pop hl
; a = next unconsumed char (if error: 0 for stream error, -1 for eof)
; bc = number of bytes consumed from stream in this operation
; hl = total num chars read from stream so far
; carry set on error or eof
; stack = number of items assigned
push af
call l_addu_hl_bc
ex de,hl ; de = total num chars read from stream (updated)
pop af
pop hl ; hl = total num items assigned
jr c, error_occurred
bit 5,(ix+3)
ret nz ; if driver manages ungetc
ld (ix+6),a ; write unconsumed char to ungetc spot
set 0,(ix+4) ; indicate ungetc is present
ret
error_occurred:
; stream error or eof ?
or a
jr z, stream_error
; eof is only an error if no chars were read
set 4,(ix+3) ; set stream state to eof
ld a,b
or c
ld a,$ff
ret nz ; if at least one char was read, indicate no error
scf
ret
stream_error:
set 3,(ix+3) ; set stream state to error
scf
ret
immediate_stream_error:
xor a
jr error_exit
immediate_eof_error:
ld a,$ff
error_exit:
ld bc,0
scf
ret
| 21.756098
| 81
| 0.568946
|
4b41db52d3abe0a8caf69521bb418c56d3964413
| 878
|
asm
|
Assembly
|
programs/oeis/158/A158325.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/158/A158325.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/158/A158325.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A158325: a(n) = 484n^2 + 2n.
; 486,1940,4362,7752,12110,17436,23730,30992,39222,48420,58586,69720,81822,94892,108930,123936,139910,156852,174762,193640,213486,234300,256082,278832,302550,327236,352890,379512,407102,435660,465186,495680,527142,559572,592970,627336,662670,698972,736242,774480,813686,853860,895002,937112,980190,1024236,1069250,1115232,1162182,1210100,1258986,1308840,1359662,1411452,1464210,1517936,1572630,1628292,1684922,1742520,1801086,1860620,1921122,1982592,2045030,2108436,2172810,2238152,2304462,2371740,2439986,2509200,2579382,2650532,2722650,2795736,2869790,2944812,3020802,3097760,3175686,3254580,3334442,3415272,3497070,3579836,3663570,3748272,3833942,3920580,4008186,4096760,4186302,4276812,4368290,4460736,4554150,4648532,4743882,4840200
add $0,1
mov $1,44
mul $1,$0
mul $1,22
add $1,4
mul $1,$0
sub $1,972
div $1,4
mul $1,2
add $1,486
mov $0,$1
| 58.533333
| 737
| 0.812073
|
74fe57bfb8b53f1ff20d5d35836bb403b38f61a0
| 1,510
|
asm
|
Assembly
|
src/kernel/arch/aarch64/asm/macro-defs.asm
|
aryanmaurya1/ArvernOS
|
a8452c01cd180ffbdabf949c80329ccfcc84d2e9
|
[
"MIT"
] | 77
|
2021-11-19T15:56:32.000Z
|
2022-03-30T04:02:02.000Z
|
src/kernel/arch/aarch64/asm/macro-defs.asm
|
aryanmaurya1/ArvernOS
|
a8452c01cd180ffbdabf949c80329ccfcc84d2e9
|
[
"MIT"
] | 57
|
2021-11-19T12:38:52.000Z
|
2022-03-03T08:56:35.000Z
|
src/kernel/arch/aarch64/asm/macro-defs.asm
|
aryanmaurya1/ArvernOS
|
a8452c01cd180ffbdabf949c80329ccfcc84d2e9
|
[
"MIT"
] | 2
|
2022-03-01T06:39:25.000Z
|
2022-03-24T15:47:45.000Z
|
// The `kernel_*` macros are based on Sergey Matyukevich's work, released under
// a MIT license.
//
// See: https://github.com/s-matyukevich/raspberry-pi-os/blob/master/docs/lesson03/rpi-os.md
.macro kernel_entry, el
sub sp, sp, #272
stp x0, x1, [sp, #16 * 0]
stp x2, x3, [sp, #16 * 1]
stp x4, x5, [sp, #16 * 2]
stp x6, x7, [sp, #16 * 3]
stp x8, x9, [sp, #16 * 4]
stp x10, x11, [sp, #16 * 5]
stp x12, x13, [sp, #16 * 6]
stp x14, x15, [sp, #16 * 7]
stp x16, x17, [sp, #16 * 8]
stp x18, x19, [sp, #16 * 9]
stp x20, x21, [sp, #16 * 10]
stp x22, x23, [sp, #16 * 11]
stp x24, x25, [sp, #16 * 12]
stp x26, x27, [sp, #16 * 13]
stp x28, x29, [sp, #16 * 14]
.if \el == 0
mrs x21, sp_el0
.else
add x21, sp, #272
.endif
mrs x22, elr_el1
mrs x23, spsr_el1
stp x30, x21, [sp, #16 * 15]
stp x22, x23, [sp, #16 * 16]
.endm
.macro kernel_exit, el
ldp x22, x23, [sp, #16 * 16]
ldp x30, x21, [sp, #16 * 15]
.if \el == 0
msr sp_el0, x21
.endif
msr elr_el1, x22
msr spsr_el1, x23
ldp x0, x1, [sp, #16 * 0]
ldp x2, x3, [sp, #16 * 1]
ldp x4, x5, [sp, #16 * 2]
ldp x6, x7, [sp, #16 * 3]
ldp x8, x9, [sp, #16 * 4]
ldp x10, x11, [sp, #16 * 5]
ldp x12, x13, [sp, #16 * 6]
ldp x14, x15, [sp, #16 * 7]
ldp x16, x17, [sp, #16 * 8]
ldp x18, x19, [sp, #16 * 9]
ldp x20, x21, [sp, #16 * 10]
ldp x22, x23, [sp, #16 * 11]
ldp x24, x25, [sp, #16 * 12]
ldp x26, x27, [sp, #16 * 13]
ldp x28, x29, [sp, #16 * 14]
add sp, sp, #272
eret
.endm
| 22.878788
| 92
| 0.52649
|
e91bc46b8e46ba650479f666c210cd1231387767
| 2,244
|
asm
|
Assembly
|
DCS216 Operating System/ep6/kernel/loader.asm
|
Lan-Jing/Courses
|
540db9499b8725ca5b82a2c4e7a3da09f73c0efa
|
[
"MIT"
] | 1
|
2021-12-17T23:09:00.000Z
|
2021-12-17T23:09:00.000Z
|
DCS216 Operating System/ep6/kernel/loader.asm
|
Lan-Jing/Courses
|
540db9499b8725ca5b82a2c4e7a3da09f73c0efa
|
[
"MIT"
] | null | null | null |
DCS216 Operating System/ep6/kernel/loader.asm
|
Lan-Jing/Courses
|
540db9499b8725ca5b82a2c4e7a3da09f73c0efa
|
[
"MIT"
] | 1
|
2021-08-03T23:42:06.000Z
|
2021-08-03T23:42:06.000Z
|
; a basic loader that prints hint then jump to the monitor;
delay equ 25000
kernelSecSize equ 3
SECTION loaderCode align=16 vstart=0x7c00
;========================================
start:
.set_dataSeg:
xor ax, ax
mov ds, ax
mov es, ax ; set all basic seg pointer to 0
.set_stackSeg:
cli
mov ax, 0x7c00 ; stack goes down from 0x7c00 while code goes up
mov sp, ax
mov bp, ax
xor ax, ax
mov ss, ax ; some bios may have bugs on dealing with interupt when setting ss:sp
sti ; disable interupt brfore setting them
.set_codeSeg:
jmp set_cs_ip
; cs:ip initial value diffs between bios. Set unique values anyway
set_displaySeg:
cld
mov si, message
call print_hint ; call function to print message
.wait_for_return:
dec word[count]
jnz .wait_for_return
mov word[count], delay
dec word[count + 2]
jnz .wait_for_return
mov word[count], delay
mov word[count + 2], delay
.handle_control:
mov ax, 0x800
mov ds, ax
mov es, ax ; set cs = ds = es = 0x800
.load_monitor:
mov bl, 2 ; load the monitor into memory
call read_floppy
push ds
push 0x100
retf ; handle control to the monitor program
set_cs_ip:
push 0x00 ; cs
mov ax, set_displaySeg
push ax ; ip
retf
print_hint:
mov ah, 0x0e ; set bios function
.print_loop:
lodsb ; load chars to al one at a time
cmp al, 0x00
je .print_done
int 0x10 ; bios call
jmp .print_loop
.print_done:
ret
read_floppy:
mov ah, 0x02
mov al, kernelSecSize ; only read two sectors
mov ch, 0x00 ; cylinder zero
mov cl, bl ; get sector index from reg bx, assuming in one sector
mov dh, 0x00 ; head zero
mov dl, 0x00 ; drive number, 0 and 1 for floppy
; es is set 0x800 before
mov bx, 0x100 ; set offset of the target memory address
int 0x13 ; call interupt
ret
data:
count dw 25000, 25000
message db "Basic loader by Jing Lan is loading...", 0xD, 0xA, 0xD, 0xA, 0x00
times 510-($-$$) db 0 ; fill zeros
dw 0xaa55 ; bootable sector signature
| 25.213483
| 89
| 0.605169
|
cf643a21560a20faaa309afc31f131d4c9c944a6
| 6,603
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1371.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_1371.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_1371.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 %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1c8b, %r12
nop
nop
nop
inc %rsi
movw $0x6162, (%r12)
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_D_ht+0x1d478, %r15
nop
nop
nop
nop
dec %rdi
vmovups (%r15), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rcx
nop
nop
sub %r15, %r15
lea addresses_WC_ht+0xf578, %rsi
lea addresses_WT_ht+0x5978, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
sub $36283, %rbp
mov $31, %rcx
rep movsw
cmp %r8, %r8
lea addresses_UC_ht+0x15e45, %rsi
lea addresses_UC_ht+0xdd78, %rdi
nop
xor $30071, %rbp
mov $114, %rcx
rep movsw
nop
nop
nop
nop
add $22596, %rbp
lea addresses_D_ht+0x7178, %rsi
nop
nop
sub %rbp, %rbp
mov $0x6162636465666768, %r12
movq %r12, (%rsi)
cmp %r8, %r8
lea addresses_A_ht+0x1c918, %rbx
nop
nop
xor %rsi, %rsi
mov (%rbx), %r8
nop
nop
nop
nop
sub $15001, %rsi
lea addresses_normal_ht+0x13578, %rsi
lea addresses_normal_ht+0x7038, %rdi
nop
nop
nop
sub %r15, %r15
mov $52, %rcx
rep movsq
nop
nop
nop
nop
nop
add %r15, %r15
lea addresses_D_ht+0x6d79, %rsi
lea addresses_WT_ht+0x5ce0, %rdi
nop
nop
nop
and %rbx, %rbx
mov $81, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r8
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_WT+0xd78, %rsi
lea addresses_normal+0xc9a8, %rdi
nop
nop
add $21131, %r13
mov $51, %rcx
rep movsl
nop
nop
nop
nop
cmp $65278, %rsi
// Load
lea addresses_RW+0xf378, %rsi
nop
nop
nop
dec %r8
movups (%rsi), %xmm5
vpextrq $0, %xmm5, %r13
nop
nop
nop
dec %r13
// Faulty Load
lea addresses_WT+0xd78, %rdi
nop
nop
nop
nop
and %r13, %r13
mov (%rdi), %r8d
lea oracles, %r10
and $0xff, %r8
shlq $12, %r8
mov (%r10,%r8,1), %r8
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_normal', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_RW', 'same': False, 'size': 16, 'congruent': 8, '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>
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'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
*/
| 34.752632
| 2,999
| 0.659246
|
a2b8e67298d78e4e452eeefe8da4bc69f93f7bf5
| 187
|
asm
|
Assembly
|
mc-sema/validator/x86/tests/ADD_FrST0.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | 2
|
2021-08-07T16:21:29.000Z
|
2021-11-17T10:58:37.000Z
|
mc-sema/validator/x86/tests/ADD_FrST0.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | null | null | null |
mc-sema/validator/x86/tests/ADD_FrST0.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | null | null | null |
BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; set up st0 and st1 to be pi
FLDPI
FLDPI
;TEST_BEGIN_RECORDING
FADD st1, st0
;TEST_END_RECORDING
| 13.357143
| 29
| 0.818182
|
f43fe285a68687a29cc98ce01ab26522eb69771b
| 676
|
asm
|
Assembly
|
programs/oeis/133/A133083.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/133/A133083.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/133/A133083.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A133083: A000012 * A133080.
; 1,2,1,2,1,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2
add $0,1
mov $2,$0
lpb $2
lpb $0
sub $0,1
sub $2,1
add $3,4
trn $0,$3
mov $1,$2
lpe
add $0,1
trn $2,1
lpe
add $1,1
| 37.555556
| 501
| 0.495562
|
38ed9e4bb95bab98d18b1ee7de2230c843f454bd
| 1,907
|
asm
|
Assembly
|
programs/oeis/034/A034262.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/034/A034262.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/034/A034262.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A034262: a(n) = n^3 + n.
; 0,2,10,30,68,130,222,350,520,738,1010,1342,1740,2210,2758,3390,4112,4930,5850,6878,8020,9282,10670,12190,13848,15650,17602,19710,21980,24418,27030,29822,32800,35970,39338,42910,46692,50690,54910,59358,64040,68962,74130,79550,85228,91170,97382,103870,110640,117698,125050,132702,140660,148930,157518,166430,175672,185250,195170,205438,216060,227042,238390,250110,262208,274690,287562,300830,314500,328578,343070,357982,373320,389090,405298,421950,439052,456610,474630,493118,512080,531522,551450,571870,592788,614210,636142,658590,681560,705058,729090,753662,778780,804450,830678,857470,884832,912770,941290,970398,1000100,1030402,1061310,1092830,1124968,1157730,1191122,1225150,1259820,1295138,1331110,1367742,1405040,1443010,1481658,1520990,1561012,1601730,1643150,1685278,1728120,1771682,1815970,1860990,1906748,1953250,2000502,2048510,2097280,2146818,2197130,2248222,2300100,2352770,2406238,2460510,2515592,2571490,2628210,2685758,2744140,2803362,2863430,2924350,2986128,3048770,3112282,3176670,3241940,3308098,3375150,3443102,3511960,3581730,3652418,3724030,3796572,3870050,3944470,4019838,4096160,4173442,4251690,4330910,4411108,4492290,4574462,4657630,4741800,4826978,4913170,5000382,5088620,5177890,5268198,5359550,5451952,5545410,5639930,5735518,5832180,5929922,6028750,6128670,6229688,6331810,6435042,6539390,6644860,6751458,6859190,6968062,7078080,7189250,7301578,7415070,7529732,7645570,7762590,7880798,8000200,8120802,8242610,8365630,8489868,8615330,8742022,8869950,8999120,9129538,9261210,9394142,9528340,9663810,9800558,9938590,10077912,10218530,10360450,10503678,10648220,10794082,10941270,11089790,11239648,11390850,11543402,11697310,11852580,12009218,12167230,12326622,12487400,12649570,12813138,12978110,13144492,13312290,13481510,13652158,13824240,13997762,14172730,14349150,14527028,14706370,14887182,15069470,15253240,15438498
mov $1,$0
pow $0,3
add $1,$0
| 272.428571
| 1,849
| 0.852124
|
05e48d60ffea6bb2ceb6ed3b7ab9dd2fd27be9f6
| 5,555
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_1218.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_1218.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_1218.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rdx
lea addresses_A_ht+0x18545, %r12
nop
nop
nop
nop
nop
add %r14, %r14
movups (%r12), %xmm7
vpextrq $1, %xmm7, %rdx
nop
nop
nop
nop
nop
cmp $17428, %rdx
pop %rdx
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rax
push %rcx
push %rdi
// Store
lea addresses_PSE+0x1dbc5, %rax
cmp $55516, %r9
mov $0x5152535455565758, %r11
movq %r11, %xmm7
vmovups %ymm7, (%rax)
nop
nop
sub $44286, %r8
// Store
lea addresses_UC+0x8645, %rcx
clflush (%rcx)
nop
nop
nop
nop
xor $29650, %r11
movw $0x5152, (%rcx)
// Exception!!!
nop
nop
mov (0), %rcx
nop
nop
nop
dec %rcx
// Store
lea addresses_UC+0x1c34d, %r13
nop
nop
nop
sub $5354, %rdi
movl $0x51525354, (%r13)
nop
nop
xor $32214, %r11
// Store
lea addresses_normal+0x16a45, %r11
nop
nop
nop
add %r8, %r8
movw $0x5152, (%r11)
nop
nop
nop
nop
sub %r11, %r11
// Store
lea addresses_RW+0xb645, %rdi
nop
nop
dec %r13
mov $0x5152535455565758, %r11
movq %r11, (%rdi)
nop
and %r8, %r8
// Store
lea addresses_US+0x8e45, %r8
and %r13, %r13
movl $0x51525354, (%r8)
nop
nop
nop
sub $5844, %r8
// Faulty Load
lea addresses_RW+0xb645, %r9
cmp %rdi, %rdi
movb (%r9), %r11b
lea oracles, %r13
and $0xff, %r11
shlq $12, %r11
mov (%r13,%r11,1), %r11
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 39.119718
| 2,999
| 0.653105
|
f4e991b2e336e7f034fc5fc219ca02e168c28434
| 5,390
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_488_1082.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_488_1082.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_488_1082.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x17076, %r11
nop
nop
nop
nop
sub %rbp, %rbp
movups (%r11), %xmm6
vpextrq $1, %xmm6, %rcx
nop
nop
nop
nop
and $41104, %rdi
lea addresses_D_ht+0x1ae76, %r12
nop
nop
nop
nop
nop
cmp $54353, %rbp
mov $0x6162636465666768, %r13
movq %r13, (%r12)
nop
nop
inc %rbp
lea addresses_normal_ht+0x5011, %rsi
lea addresses_normal_ht+0x7e76, %rdi
nop
nop
nop
xor %rax, %rax
mov $51, %rcx
rep movsb
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0xf656, %r13
inc %rax
mov $0x6162636465666768, %r12
movq %r12, %xmm7
vmovups %ymm7, (%r13)
sub %rsi, %rsi
lea addresses_WC_ht+0x13a86, %rcx
nop
nop
sub $42934, %r11
mov $0x6162636465666768, %r13
movq %r13, %xmm4
and $0xffffffffffffffc0, %rcx
vmovntdq %ymm4, (%rcx)
nop
nop
nop
nop
nop
and $11492, %rcx
lea addresses_A_ht+0x43e8, %rsi
lea addresses_WC_ht+0xc3e6, %rdi
nop
cmp %r11, %r11
mov $14, %rcx
rep movsb
nop
nop
nop
nop
add $51312, %rax
lea addresses_D_ht+0x17676, %r13
clflush (%r13)
nop
nop
nop
nop
nop
xor %rsi, %rsi
movups (%r13), %xmm5
vpextrq $1, %xmm5, %rbp
nop
nop
nop
nop
nop
and $46112, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %r8
push %rbx
push %rdx
// Store
lea addresses_PSE+0x8676, %rbx
nop
nop
nop
sub $54508, %r12
movw $0x5152, (%rbx)
xor %r13, %r13
// Load
lea addresses_RW+0x8506, %r8
nop
nop
nop
nop
nop
sub %r15, %r15
mov (%r8), %r13d
xor %r12, %r12
// Store
lea addresses_D+0x2246, %rdx
nop
nop
nop
nop
nop
inc %r12
mov $0x5152535455565758, %r13
movq %r13, %xmm0
vmovups %ymm0, (%rdx)
nop
nop
nop
xor %r12, %r12
// Store
lea addresses_US+0x62e6, %r14
nop
nop
nop
nop
sub $49362, %r8
mov $0x5152535455565758, %r13
movq %r13, %xmm0
vmovntdq %ymm0, (%r14)
nop
and %r8, %r8
// Faulty Load
lea addresses_PSE+0x8676, %r15
nop
nop
xor %rbx, %rbx
vmovups (%r15), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r13
lea oracles, %rbx
and $0xff, %r13
shlq $12, %r13
mov (%rbx,%r13,1), %r13
pop %rdx
pop %rbx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 3, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'52': 488}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 26.165049
| 1,463
| 0.65603
|
934b1d35629c4484f46f5640c5549b238bb90b34
| 786
|
asm
|
Assembly
|
data/pokemon/base_stats/drowzee.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | 1
|
2022-02-15T00:19:44.000Z
|
2022-02-15T00:19:44.000Z
|
data/pokemon/base_stats/drowzee.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
data/pokemon/base_stats/drowzee.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
db DEX_DROWZEE ; pokedex id
db 60, 48, 45, 42, 90
; hp atk def spd spc
db PSYCHIC_TYPE, PSYCHIC_TYPE ; type
db 190 ; catch rate
db 102 ; base exp
INCBIN "gfx/pokemon/front/drowzee.pic", 0, 1 ; sprite dimensions
dw DrowzeePicFront, DrowzeePicBack
db POUND, HYPNOSIS, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
tmhm MEGA_PUNCH, MEGA_KICK, NIGHT_SHADE, BODY_SLAM, TAKE_DOWN, \
DOUBLE_EDGE, SUBMISSION, COUNTER, SEISMIC_TOSS, RAGE, \
PSYCHIC_M, TELEPORT, MIMIC, DOUBLE_TEAM, REFLECT, \
BIDE, METRONOME, SKULL_BASH, DREAM_EATER, REST, \
THUNDER_WAVE, PSYWAVE, TRI_ATTACK, SUBSTITUTE, FLASH
; end
db 0 ; padding
| 31.44
| 77
| 0.636132
|
52d2aaab7a7cc8da14abe38dcc97790b50d5a7da
| 8,785
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_st_un_sm_/i7-7700_9_0x48.log_21829_1126.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/US/_st_un_sm_/i7-7700_9_0x48.log_21829_1126.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/US/_st_un_sm_/i7-7700_9_0x48.log_21829_1126.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x335c, %rsi
lea addresses_normal_ht+0x947c, %rdi
nop
nop
nop
nop
nop
lfence
mov $23, %rcx
rep movsq
nop
nop
nop
cmp $52326, %rbx
lea addresses_WC_ht+0x1157c, %rcx
and %r10, %r10
mov $0x6162636465666768, %rdi
movq %rdi, %xmm4
vmovups %ymm4, (%rcx)
nop
nop
and %rdi, %rdi
lea addresses_WC_ht+0x1d47c, %r10
nop
nop
and $31747, %rdi
mov (%r10), %rcx
nop
nop
nop
sub %r8, %r8
lea addresses_A_ht+0x17b7c, %r8
clflush (%r8)
nop
add %rdi, %rdi
movw $0x6162, (%r8)
nop
and %r8, %r8
lea addresses_D_ht+0x13ffc, %rcx
nop
inc %r9
movb $0x61, (%rcx)
nop
xor %r10, %r10
lea addresses_UC_ht+0x19028, %rbx
nop
xor %rsi, %rsi
movb $0x61, (%rbx)
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_normal_ht+0x14ffc, %r10
nop
nop
nop
nop
nop
inc %r8
movw $0x6162, (%r10)
nop
nop
nop
cmp $29801, %r10
lea addresses_normal_ht+0xa6f4, %rsi
lea addresses_WC_ht+0x1cf7c, %rdi
nop
and %r9, %r9
mov $39, %rcx
rep movsq
nop
nop
nop
add $52389, %r8
lea addresses_WC_ht+0xd37c, %rbx
cmp $48732, %r9
mov (%rbx), %edi
nop
nop
nop
nop
inc %r8
lea addresses_A_ht+0x2bfc, %rsi
lea addresses_WC_ht+0x1264c, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add %r8, %r8
mov $98, %rcx
rep movsq
nop
nop
add $60994, %r8
lea addresses_WC_ht+0x71bc, %rsi
and %rcx, %rcx
mov (%rsi), %r10
nop
nop
add %r8, %r8
lea addresses_normal_ht+0x1b406, %rdi
nop
nop
nop
nop
inc %rbx
movw $0x6162, (%rdi)
sub $30842, %rdi
lea addresses_normal_ht+0x11a7c, %r9
sub %rbx, %rbx
vmovups (%r9), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rcx
nop
nop
nop
nop
nop
and %rbx, %rbx
lea addresses_UC_ht+0x1a1bc, %rdi
nop
nop
nop
nop
xor $13429, %rbx
movb (%rdi), %r10b
nop
dec %rcx
lea addresses_UC_ht+0x4f7c, %r8
nop
sub $48950, %rcx
mov (%r8), %rdi
cmp %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r15
push %rdi
push %rsi
// Load
mov $0x9ec, %rdi
dec %r11
movups (%rdi), %xmm1
vpextrq $1, %xmm1, %r15
nop
nop
sub %rdi, %rdi
// Store
mov $0xd46, %r11
cmp $38528, %r13
mov $0x5152535455565758, %r12
movq %r12, %xmm4
vmovups %ymm4, (%r11)
nop
nop
and $32160, %rdi
// Store
mov $0x79907600000001c4, %r11
nop
nop
nop
xor $34753, %rsi
mov $0x5152535455565758, %r10
movq %r10, (%r11)
nop
nop
xor %r12, %r12
// Store
lea addresses_RW+0x15216, %r15
nop
nop
nop
dec %r12
movb $0x51, (%r15)
nop
nop
add %r10, %r10
// Store
lea addresses_US+0x277c, %rsi
nop
nop
nop
nop
cmp %r10, %r10
mov $0x5152535455565758, %r15
movq %r15, %xmm3
vmovups %ymm3, (%rsi)
dec %rsi
// Faulty Load
lea addresses_US+0x277c, %r12
nop
nop
xor %r11, %r11
mov (%r12), %r13d
lea oracles, %r15
and $0xff, %r13
shlq $12, %r13
mov (%r15,%r13,1), %r13
pop %rsi
pop %rdi
pop %r15
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': True, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}}
{'5c': 1, '58': 21827, '14': 1}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 32.657993
| 2,999
| 0.649175
|
d05e11173849bcfe7123017e631ebd4ad8bde352
| 378
|
asm
|
Assembly
|
oeis/097/A097449.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/097/A097449.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/097/A097449.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A097449: If n is a cube, replace it with the cube root of n.
; 0,1,2,3,4,5,6,7,2,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,3,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,4,65,66,67,68,69,70,71,72,73,74
lpb $0
mov $2,$0
seq $2,70589 ; n^4 mod 46.
pow $2,2
add $4,$2
add $3,$4
dif $0,$3
lpe
| 31.5
| 214
| 0.608466
|
657daa2e2d8098a5a43e0fc316c714b9fca41732
| 124
|
asm
|
Assembly
|
HW05 - Machine Language/Black.asm
|
msheehan17/CS220
|
4c85df137524b4b7f71ba7d93ae35b4999293d62
|
[
"MIT"
] | null | null | null |
HW05 - Machine Language/Black.asm
|
msheehan17/CS220
|
4c85df137524b4b7f71ba7d93ae35b4999293d62
|
[
"MIT"
] | null | null | null |
HW05 - Machine Language/Black.asm
|
msheehan17/CS220
|
4c85df137524b4b7f71ba7d93ae35b4999293d62
|
[
"MIT"
] | null | null | null |
@SCREEN
D=A
@i
M=D
(LOOP)
@24576
D=A
@i
D=M-D
@ENDLOOP
D;JGT
@i
A=M+1
M=-1
@i
M=M+1
@LOOP
0;JMP
(ENDLOOP)
@ENDLOOP
0;JMP
| 4.96
| 9
| 0.58871
|
a0ee76e0796228b17ee5755183736cdef03d395e
| 4,830
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_977.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.log_21829_977.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.log_21829_977.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r13
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xe53c, %rsi
lea addresses_A_ht+0x313c, %rdi
nop
nop
nop
nop
xor %r13, %r13
mov $0, %rcx
rep movsq
nop
inc %r10
lea addresses_D_ht+0x983c, %rsi
nop
cmp $43426, %r11
movups (%rsi), %xmm6
vpextrq $0, %xmm6, %r13
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x3ac8, %rsi
nop
nop
nop
nop
nop
and $50698, %r12
movw $0x6162, (%rsi)
nop
nop
nop
and $2537, %rdi
lea addresses_normal_ht+0x13b3c, %r12
clflush (%r12)
add $45191, %rcx
movw $0x6162, (%r12)
nop
sub %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rsi
// Faulty Load
lea addresses_RW+0x17d3c, %rsi
nop
nop
nop
and %r9, %r9
mov (%rsi), %r11
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %rsi
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 49.285714
| 2,999
| 0.659834
|
3925bc09f04d40978bad3a32f51d4e1f0803decf
| 42,937
|
asm
|
Assembly
|
ugbc/src/hw/ted/mob.asm
|
Samuel-DEVULDER/ugbasic
|
61971d500d2290512fbdd3d7e487806bc34f617d
|
[
"Apache-2.0"
] | null | null | null |
ugbc/src/hw/ted/mob.asm
|
Samuel-DEVULDER/ugbasic
|
61971d500d2290512fbdd3d7e487806bc34f617d
|
[
"Apache-2.0"
] | 3
|
2021-11-27T14:19:16.000Z
|
2021-12-21T14:44:50.000Z
|
ugbc/src/hw/ted/mob.asm
|
Samuel-DEVULDER/ugbasic
|
61971d500d2290512fbdd3d7e487806bc34f617d
|
[
"Apache-2.0"
] | null | null | null |
; /*****************************************************************************
; * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
; *****************************************************************************
; * Copyright 2021 Marco Spedaletti (asimov@mclink.it)
; *
; * Licensed under the Apache License, Version 2.0 (the "License");
; * you may not use this file eXcept in compliance with the License.
; * You may obtain a copy of the License at
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Unless required by applicable law or agreed to in writing, software
; * distributed under the License is distributed on an "AS IS" BASIS,
; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either eXpress or implied.
; * See the License for the specific language governing permissions and
; * limitations under the License.
; *----------------------------------------------------------------------------
; * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
; * (la "Licenza"); è proibito usare questo file se non in conformità alla
; * Licenza. Una copia della Licenza è disponibile all'indirizzo:
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Se non richiesto dalla legislazione vigente o concordato per iscritto,
; * il software distribuito nei termini della Licenza è distribuito
; * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
; * implicite. Consultare la Licenza per il testo specifico che regola le
; * autorizzazioni e le limitazioni previste dalla medesima.
; ****************************************************************************/
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;* *
;* MOVABLE OBJECTS UNDER TED (specific algorithms) *
;* *
;* by Marco Spedaletti *
;* *
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
MOBDRAW_TMP: .byte 0
MOBDRAW_PD: .byte 0
MOBDRAW_DY: .byte 0
MOBDRAW_DY2: .byte 0
MOBDRAW_DX: .byte 0
MOBDRAW_I: .byte 0
MOBDRAW_J: .byte 0
MOBDRAW_K: .byte 0
MOBDRAW_C: .byte 0
MOBDRAW_R: .byte 0
; ---------------------------------------------------------------------------
; Chipset specific initialization
; MOBINITCS(X:index,draw)
; ---------------------------------------------------------------------------
MOBINITCS:
LDA CURRENTMODE
; BITMAP_MODE_STANDARD
CMP #2
BNE MOBINITCS2X
JMP MOBINITCS2
MOBINITCS2X:
; BITMAP_MODE_MULTICOLOR
CMP #3
BNE MOBINITCS3X
JMP MOBINITCS3
MOBINITCS3X:
; TILEMAP_MODE_STANDARD
CMP #0
BNE MOBINITCS0X
JMP MOBINITCS0
MOBINITCS0X:
; TILEMAP_MODE_MULTICOLOR
CMP #1
BNE MOBINITCS1X
JMP MOBINITCS1
MOBINITCS1X:
; TILEMAP_MODE_EXTENDED
CMP #4
BNE MOBINITCS4X
JMP MOBINITCS4
MOBINITCS4X:
RTS
; ---------------------------------------------------------------------------
; MODE 2 (BITMAP STANDARD)
; Shift the *current* draw area image of MOBI mob of MOBDRAW_DX pixel
; to the right. Additional left pixel are put to zero.
; ---------------------------------------------------------------------------
MOBDRAW2_SHIFTRIGHT:
LDX MOBI
; Load first location of draw data
LDA MOBDESCRIPTORS_DL, X
STA MOBADDR
LDA MOBDESCRIPTORS_DH, X
STA MOBADDR+1
; Load height (in pixels) = height (in rows) + 8
CLC
LDA MOBDESCRIPTORS_H, X
STA MOBH
ADC #8
STA MOBDRAW_R
STA MOBDRAW_I
; Load width (in pixels) = width (in cols) + 1
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
ASL
ASL
ASL
STA MOBW
; Load displacement = iteraction for each line
LDA MOBDRAW_DX
AND #$07
STA MOBDRAW_K
; Rows loop
MOBDRAW2_SHIFTRIGHTL1:
; j = cols
LDA MOBDRAW_C
STA MOBDRAW_J
LDY #0
CLC
; Cols loop
MOBDRAW2_SHIFTRIGHTL2:
; Rotate the content of the cell by 1 pixel to the right
; and save the last pixel on carry. The carry will be put
; on the leftmost pixel.
LDA (MOBADDR),Y
ROR
STA (MOBADDR),Y
; Move to the next cell on the same line.
; This is placed after 8 bytes from the current position.
INY
INY
INY
INY
INY
INY
INY
INY
; Repeat for each cell of the same row.
DEC MOBDRAW_J
BNE MOBDRAW2_SHIFTRIGHTL2
; Repeat for the entire size of the displacement.
LDY #0
DEC MOBDRAW_K
BNE MOBDRAW2_SHIFTRIGHTL1
; Move to the next line
; If we are at the last line of the cell,
; we must advace of an entire row.
LDA MOBDRAW_I
AND #$07
CMP #$01
BEQ MOBDRAW2_SHIFTRIGHTR8
MOBDRAW2_SHIFTRIGHTR1:
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
JMP MOBDRAW2_SHIFTRIGHTRD
MOBDRAW2_SHIFTRIGHTR8:
CLC
LDA MOBADDR
ADC MOBW
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
SEC
LDA MOBADDR
SBC #7
STA MOBADDR
LDA MOBADDR+1
SBC #0
STA MOBADDR+1
JMP MOBDRAW2_SHIFTRIGHTRD
MOBDRAW2_SHIFTRIGHTRD:
LDA MOBDRAW_DX
AND #$07
STA MOBDRAW_K
; Repeat for each row of the entire draw.
DEC MOBDRAW_I
BNE MOBDRAW2_SHIFTRIGHTL1
RTS
; ---------------------------------------------------------------------------
; MODE 2 (BITMAP STANDARD)
; Shift the *current* draw area image of MOBI mob of MOBDRAW_DX pixel
; to the left. Pixels on the right are put to zero.
; ---------------------------------------------------------------------------
MOBDRAW2_SHIFTLEFT:
LDX MOBI
; Load first location of draw data
LDA MOBDESCRIPTORS_DL, X
STA MOBADDR
LDA MOBDESCRIPTORS_DH, X
STA MOBADDR+1
LDA MOBDESCRIPTORS_SIZEL, X
STA MOBSIZE
LDA MOBDESCRIPTORS_SIZEH, X
STA MOBSIZE+1
; Load height (in pixels) = height (in rows) + 8
LDA MOBDESCRIPTORS_H, X
STA MOBH
CLC
ADC #8
STA MOBDRAW_R
STA MOBDRAW_I
; Load width (in pixels) = width (in cols) + 1
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
SEC
SBC #1
ASL
ASL
ASL
STA MOBW
; Load displacement = iteraction for each line
LDA MOBDRAW_DX
AND #$07
STA MOBDRAW_K
; Rows loop
MOBDRAW2_SHIFTLEFTL1:
; j = cols
LDA MOBDRAW_C
STA MOBDRAW_J
LDA MOBW
TAY
CLC
; Cols loop
MOBDRAW2_SHIFTLEFTL2:
; Rotate the content of the cell by 1 pixel to the left
; and save the first pixel on carry. The carry will be put
; on the rightmost pixel.
LDA (MOBADDR),Y
ROL A
STA (MOBADDR),Y
; Move to the previous cell on the same line.
; This is placed after 8 bytes from the current position.
DEY
DEY
DEY
DEY
DEY
DEY
DEY
DEY
; Repeat for each cell of the same row.
DEC MOBDRAW_J
BNE MOBDRAW2_SHIFTLEFTL2
; Repeat for the entire size of the displacement.
LDA MOBW
TAY
DEC MOBDRAW_K
BNE MOBDRAW2_SHIFTLEFTL1
; Move to the next line
; If we are at the last line of the cell,
; we must advace of an entire row.
LDA MOBDRAW_I
AND #$07
CMP #$01
BEQ MOBDRAW2_SHIFTLEFTR8
MOBDRAW2_SHIFTLEFTR1:
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
JMP MOBDRAW2_SHIFTLEFTRD
MOBDRAW2_SHIFTLEFTR8:
CLC
LDA MOBADDR
ADC MOBW
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
JMP MOBDRAW2_SHIFTLEFTRD
MOBDRAW2_SHIFTLEFTRD:
LDA MOBDRAW_DX
AND #$07
STA MOBDRAW_K
; Repeat for each row of the entire draw.
DEC MOBDRAW_I
BNE MOBDRAW2_SHIFTLEFTL1
RTS
; ---------------------------------------------------------------------------
; MODE 2 (BITMAP STANDARD)
; Shift the *current* draw area image of MOBI mob of MOBDRAW_DY pixel
; to the top. Pixels on the bottom are put to zero.
; ---------------------------------------------------------------------------
MOBDRAW2_SHIFTUP:
LDX MOBI
LDA MOBDRAW_DY
AND #$07
STA MOBDRAW_K
LDA MOBDESCRIPTORS_W, x
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
ASL
ASL
ASL
STA MOBW
LDA #0
STA MOBDRAW_J
; Load height (in pixels) = height (in rows) + 8
LDA MOBDESCRIPTORS_H, X
STA MOBH
CLC
ADC #8
LSR
LSR
LSR
STA MOBDRAW_R
STA MOBDRAW_I
MOBDRAW2_SHIFTUPL0:
; MOBSIZE = WC x WR
LDA MOBDESCRIPTORS_SIZEL, X
STA MOBSIZE
LDA MOBDESCRIPTORS_SIZEH, X
STA MOBSIZE+1
LDA MOBSIZE
; MOBSIZE => C = 8 x WC X WR = MOBSIZE
; WC1 = WC-1
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
SEC
SBC #1
; WC12 = WC1*8
ASL A
ASL A
ASL A
; MOBDRAW_TMP <= WC121 = WC12+1
CLC
ADC #1
STA MOBDRAW_TMP
MOBDRAW2_SHIFTUPLCC:
LDA MOBDESCRIPTORS_DL, X
STA MOBADDR
LDA MOBDESCRIPTORS_DH, X
STA MOBADDR+1
LDA MOBADDR
STA TMPPTR
LDA MOBADDR+1
STA TMPPTR+1
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
LDA #0
STA MOBDRAW_J
MOBDRAW2_SHIFTUPL1:
LDX MOBI
LDY #0
MOBDRAW2_SHIFTUPLA:
LDA (MOBADDR),Y
STA (TMPPTR),Y
INY
CPY #$7
BNE MOBDRAW2_SHIFTUPLA
CLC
LDA MOBADDR
ADC #7
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
LDA MOBADDR
STA TMPPTR
LDA MOBADDR+1
STA TMPPTR+1
SEC
LDA TMPPTR
SBC MOBDRAW_TMP
STA TMPPTR
LDA TMPPTR+1
SBC #0
STA TMPPTR+1
LDA MOBDRAW_I
CMP #$ff
BEQ MOBDRAW2_SHIFTUPSKIP
; sposta da [C-[((WC-1)*8)+1]] a [C]
LDY #0
LDA (MOBADDR),Y
STA (TMPPTR),Y
JMP MOBDRAW2_SHIFTUPSKIPD
MOBDRAW2_SHIFTUPSKIP:
LDY #0
LDA #0
STA (MOBADDR),Y
MOBDRAW2_SHIFTUPSKIPD:
CLC
LDA TMPPTR
ADC MOBDRAW_TMP
STA TMPPTR
LDA TMPPTR+1
ADC #0
STA TMPPTR+1
SEC
LDA MOBADDR
SBC #7
STA MOBADDR
LDA MOBADDR+1
SBC #0
STA MOBADDR+1
; C = C - 8
CLC
LDA MOBADDR
ADC #8
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
SEC
LDA MOBADDR
SBC #1
STA TMPPTR
LDA MOBADDR+1
SBC #0
STA TMPPTR+1
; se C < 0 FINE
LDY #0
INC MOBDRAW_J
LDA MOBDRAW_J
CMP MOBDRAW_C
BEQ MOBDRAW2_SHIFTUPL1X
JMP MOBDRAW2_SHIFTUPL1
MOBDRAW2_SHIFTUPL1X:
LDA #0
STA MOBDRAW_J
LDY #0
DEC MOBDRAW_I
LDA MOBDRAW_I
CMP #$0
BEQ MOBDRAW2_SHIFTUPL1X2
JMP MOBDRAW2_SHIFTUPL1
MOBDRAW2_SHIFTUPL1X2:
LDA #0
STA MOBDRAW_J
LDA MOBDRAW_R
STA MOBDRAW_I
DEC MOBDRAW_K
BEQ MOBDRAW2_SHIFTUPL1X3
JMP MOBDRAW2_SHIFTUPLCC
MOBDRAW2_SHIFTUPL1X3:
MOBDRAW2_SHIFTUPL0X:
RTS
; ---------------------------------------------------------------------------
; MODE 2 (BITMAP STANDARD)
; Shift the *current* draw area image of MOBI mob of MOBDRAW_DY pixel
; to the bottom. Pixels on the top are put to zero.
; ---------------------------------------------------------------------------
MOBDRAW2_SHIFTDOWN:
LDX MOBI
LDA MOBDRAW_DY
AND #$07
STA MOBDRAW_K
LDA MOBDESCRIPTORS_W, x
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
LDA #0
STA MOBDRAW_J
ASL
ASL
ASL
STA MOBW
; Load height (in pixels) = height (in rows) + 8
LDA MOBDESCRIPTORS_H, X
STA MOBH
CLC
ADC #8
LSR
LSR
LSR
STA MOBDRAW_R
STA MOBDRAW_I
MOBDRAW2_SHIFTDOWNL0:
; MOBSIZE = WC x WR
LDA MOBDESCRIPTORS_SIZEL, X
STA MOBSIZE
LDA MOBDESCRIPTORS_SIZEH, X
STA MOBSIZE+1
LDA MOBSIZE
; MOBSIZE => C = 8 x WC X WR = MOBSIZE
; WC1 = WC-1
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
SEC
SBC #1
; WC12 = WC1*8
ASL A
ASL A
ASL A
; MOBDRAW_TMP <= WC121 = WC12+1
CLC
ADC #1
STA MOBDRAW_TMP
MOBDRAW2_SHIFTDOWNLCC:
LDA MOBDESCRIPTORS_DL, X
STA MOBADDR
LDA MOBDESCRIPTORS_DH, X
STA MOBADDR+1
CLC
LDA MOBADDR
ADC MOBSIZE
STA MOBADDR
LDA MOBADDR+1
ADC MOBSIZE+1
STA MOBADDR+1
SEC
LDA MOBADDR
SBC #8
STA MOBADDR
LDA MOBADDR+1
SBC #0
STA MOBADDR+1
CLC
LDA MOBADDR
ADC #1
STA TMPPTR
LDA MOBADDR+1
ADC #0
STA TMPPTR+1
LDA #0
STA MOBDRAW_J
MOBDRAW2_SHIFTDOWNL1:
LDX MOBI
; se C > WC121 allora
LDY #6
MOBDRAW2_SHIFTDOWNLA:
; sposta da [C+6] a [C+7]
; ...
; sposta da [C+1] a [C+2]
; sposta da [C] a [C+1]
LDA (MOBADDR),Y
STA (TMPPTR),Y
DEY
CPY #$FF
BNE MOBDRAW2_SHIFTDOWNLA
LDA MOBDRAW_I
CMP #$1
BEQ MOBDRAW2_SHIFTDOWNSKIP
; sposta da [C-[((WC-1)*8)+1]] a [C]
CLC
LDA MOBADDR
ADC #0
STA TMPPTR
LDA MOBADDR+1
ADC #0
STA TMPPTR+1
SEC
LDA MOBADDR
SBC MOBDRAW_TMP
STA MOBADDR
LDA MOBADDR+1
SBC #0
STA MOBADDR+1
LDY #0
LDA (MOBADDR),Y
LDY #0
STA (TMPPTR),Y
CLC
LDA MOBADDR
ADC MOBDRAW_TMP
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA MOBADDR
ADC #1
STA TMPPTR
LDA MOBADDR+1
ADC #0
STA TMPPTR+1
JMP MOBDRAW2_SHIFTDOWNSKIPD
MOBDRAW2_SHIFTDOWNSKIP:
LDY #0
LDA #0
STA (MOBADDR),Y
MOBDRAW2_SHIFTDOWNSKIPD:
; C = C - 8
SEC
LDA MOBADDR
SBC #8
STA MOBADDR
LDA MOBADDR+1
SBC #0
STA MOBADDR+1
CLC
LDA MOBADDR
ADC #1
STA TMPPTR
LDA MOBADDR+1
ADC #0
STA TMPPTR+1
; se C < 0 FINE
LDY #6
INC MOBDRAW_J
LDA MOBDRAW_J
CMP MOBDRAW_C
BEQ MOBDRAW2_SHIFTDOWNL1X
JMP MOBDRAW2_SHIFTDOWNL1
MOBDRAW2_SHIFTDOWNL1X:
LDA #0
STA MOBDRAW_J
LDY #6
DEC MOBDRAW_I
LDA MOBDRAW_I
CMP #$0
BEQ MOBDRAW2_SHIFTDOWNL1X2
JMP MOBDRAW2_SHIFTDOWNL1
MOBDRAW2_SHIFTDOWNL1X2:
LDA MOBDRAW_R
STA MOBDRAW_I
DEC MOBDRAW_K
BEQ MOBDRAW2_SHIFTDOWNL1X3
JMP MOBDRAW2_SHIFTDOWNLCC
MOBDRAW2_SHIFTDOWNL1X3:
MOBDRAW2_SHIFTDOWNL0X:
RTS
; Chipset specific initialization
; (we use the data that generic initialization put on descriptor)
MOBINITCS2:
SEI
STA $FF3F
LDX MOBI
; Save the actual data into save attribute of descriptor,
; in order to avoid to lose it during allocation.
LDA MOBDESCRIPTORS_DL,X
STA MOBDESCRIPTORS_SL,X
LDA MOBDESCRIPTORS_DH,X
STA MOBDESCRIPTORS_SH,X
; Now load the actual size of the image
; (in pixel)
LDA MOBDESCRIPTORS_W, X
STA MOBW
LDA MOBDESCRIPTORS_H, X
STA MOBH
; Calculate the needed memory space for the drawing area
; that will contain the drawing. It must be 8 pixels (+ 1 cell) wider
; and 8 pixel (+ 1 cell) higher.
LDA MOBW
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_C
LDA MOBH
LSR
LSR
LSR
CLC
ADC #1
STA MOBDRAW_R
ASL
ASL
ASL
STA MOBH
; Now calculate the product MOBW x MOBH
; in MOBSIZE (bytes needed)
LDA #0
LDX #8
MOBINITCS21:
LSR MOBH
BCC MOBINITCS22
CLC
ADC MOBDRAW_C
MOBINITCS22:
ROR A
ROR MOBSIZE
DEX
BNE MOBINITCS21
STA MOBSIZE+1
LDX MOBI
LDA MOBSIZE
STA MOBDESCRIPTORS_SIZEL,X
LDA MOBSIZE+1
STA MOBDESCRIPTORS_SIZEH,X
MOBINITCS22X:
; Now we can allocate the space on the MOBSEGMENT
JSR MOBALLOC
LDX MOBI
; We now can save the address of freshly allocated
; space into the specific descriptor.
LDA MOBADDR
STA MOBDESCRIPTORS_DL,X
LDA MOBADDR+1
STA MOBDESCRIPTORS_DH,X
; Now we can copy the original data to the new space,
; at position 0,0 and assuring that is aligned to the
; new space.
XXXXXX:
; Recalculate limits (w,h)
LDA MOBDRAW_C
SEC
SBC #1
STA MOBDRAW_J
ASL
ASL
ASL
STA MOBW
LDA MOBDRAW_R
SEC
SBC #1
STA MOBDRAW_I
ASL
ASL
ASL
STA MOBH
; Move the source data to a temporary pointer,
; (the destination area is already on MOBADDR)
LDA MOBDESCRIPTORS_SL,X
STA TMPPTR
LDA MOBDESCRIPTORS_SH,X
STA TMPPTR+1
; Copy one line at a time.
MOBINITCSL1A:
LDY #0
MOBINITCSL1:
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
LDA (TMPPTR),Y
STA (MOBADDR),Y
INY
DEC MOBDRAW_J
BNE MOBINITCSL1
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
MOBINITCSL1R8:
CLC
LDA TMPPTR
ADC MOBW
STA TMPPTR
LDA TMPPTR+1
ADC #0
STA TMPPTR+1
CLC
LDA MOBADDR
ADC MOBW
ADC #8
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
; Repeat for each row of the entire draw.
LDA MOBDRAW_C
SEC
SBC #1
STA MOBDRAW_J
DEC MOBDRAW_I
BEQ MOBINITCSL1AX
JMP MOBINITCSL1A
MOBINITCSL1AX:
LDA MOBDRAW_C
STA MOBDRAW_J
MOBINITCSL1HG:
LDY #0
MOBINITCSL1H:
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
LDA #0
STA (MOBADDR),Y
INY
DEC MOBDRAW_J
BNE MOBINITCSL1H
; Now we must adjust the image inside the larger
; clip, by right and bottom shifting it, accordingly
; to the (relative) position (x,y)
LDA MOBDESCRIPTORS_XL, X
STA MOBX
LDA MOBDESCRIPTORS_YL, X
STA MOBY
; Calculate dx as x & 7: if the result is not zero,
; it means that the drawing is not aligned with the
; left border of the image.
LDA MOBX
AND #$07
STA MOBDRAW_DX
BEQ MOBINITCS2A
; If not aligned, we must shift it right by dx
JSR MOBDRAW2_SHIFTRIGHT
MOBINITCS2A:
; Calculate dy as y & 7: if the result is not zero,
; it means that the drawing is not aligned with the
; top border of the image.
LDA MOBY
AND #$07
STA MOBDRAW_DY
BEQ MOBINITCS2B
; If not aligned, we must shift it down by dy
JSR MOBDRAW2_SHIFTDOWN
MOBINITCS2B:
STA $FF3E
CLI
RTS
MOBINITCS0:
MOBINITCS1:
MOBINITCS3:
MOBINITCS4:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MOBSAVE(X:indeX) -> chipset
MOBSAVE:
LDA CURRENTMODE
; BITMAP_MODE_STANDARD
CMP #2
BNE MOBSAVE2X
JMP MOBSAVE2
MOBSAVE2X:
; BITMAP_MODE_MULTICOLOR
CMP #3
BNE MOBSAVE3X
JMP MOBSAVE3
MOBSAVE3X:
; TILEMAP_MODE_STANDARD
CMP #0
BNE MOBSAVE0X
JMP MOBSAVE0
MOBSAVE0X:
; TILEMAP_MODE_MULTICOLOR
CMP #1
BNE MOBSAVE1X
JMP MOBSAVE1
MOBSAVE1X:
; TILEMAP_MODE_EXTENDED
CMP #4
BNE MOBSAVE4X
JMP MOBSAVE4
MOBSAVE4X:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SAVE MODE 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This routine will increment the position of the operation to the
; next byte (row) of the current cell.
MOBSAVE2_INC:
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA PLOTDEST
ADC #1
STA PLOTDEST
LDA PLOTDEST+1
ADC #0
STA PLOTDEST+1
RTS
; This entry point is needed do save the screen into the reserved area,
; in standard BITMAP MODE (2).
MOBSAVE2:
SEI
STA $FF3F
LDX MOBI
LDA MOBDESCRIPTORS_SIZEL,X
STA MOBSIZE
LDA MOBDESCRIPTORS_SIZEH,X
STA MOBSIZE+1
JSR MOBALLOC
LDA MOBADDR
STA MOBDESCRIPTORS_SL, X
LDA MOBADDR+1
STA MOBDESCRIPTORS_SH, X
;-------------------------
;calc Y-cell, divide by 8
;y/8 is y-cell table index
;-------------------------
LDA MOBDESCRIPTORS_YL, X
LSR ;/ 2
LSR ;/ 4
LSR ;/ 8
TAY ;tbl_8,y index
CLC
;------------------------
;calc X-cell, divide by 8
;divide 2-byte PLOTX / 8
;------------------------
LDA MOBDESCRIPTORS_XL, X
ROR MOBDESCRIPTORS_XH, X ;rotate the high byte into carry flag
ROR ;lo byte / 2 (rotate C into low byte)
LSR ;lo byte / 4
LSR ;lo byte / 8
TAX ;tbl_8,x index
;----------------------------------
;add x & y to calc cell point is in
;----------------------------------
CLC
LDA PLOTVBASELO,Y ;table of $A000 row base addresses
ADC PLOT8LO,X ;+ (8 * Xcell)
STA PLOTDEST ;= cell address
LDA PLOTVBASEHI,Y ;do the high byte
ADC PLOT8HI,X
STA PLOTDEST+1
TXA
ADC PLOTCVBASELO,Y ;table of $8400 row base addresses
STA PLOTCDEST ;= cell address
LDA #0
ADC PLOTCVBASEHI,Y ;do the high byte
STA PLOTCDEST+1
; +---+---...---+---+
; |xxx|xxxxxxxxx|xxx|
; +---+---...---+---+
; | | | |
; . . . .
; | | | |
; +---+---...---+---+
; | | | |
; +---+---...---+---+
LDX MOBI
; Calculate how many times we have to repeat
; the row copying. If the image's height is less than
; 8 pixels, we skip this part.
LDA MOBDESCRIPTORS_H, X
LSR
LSR
LSR
BNE MOBSAVE2L3X1
JMP MOBSAVE2L3
MOBSAVE2L3X1:
CLC
ADC #1
STA MOBDRAW_I
; Calculate how many times we have to repeat
; the cell copying. If the image's width is less than
; 9 pixels, we skip this part.
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
BNE MOBSAVE2L3X2
JMP MOBSAVE2L3
MOBSAVE2L3X2:
CLC
ADC #1
STA MOBDRAW_J
STA MOBDRAW_C
; Repeate an entire cell copy for each column
MOBSAVE2L2A:
LDY #0
MOBSAVE2L2:
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
LDA (PLOTDEST),Y ; D
STA (MOBADDR),Y ; S
; LDA #$55
; STA (PLOTDEST),Y
INY
DEC MOBDRAW_J
BEQ MOBSAVE2L2X
JMP MOBSAVE2L2
MOBSAVE2L2X:
CLC
LDA PLOTDEST
ADC #$40
STA PLOTDEST
LDA PLOTDEST+1
ADC #$1
STA PLOTDEST+1
CLC
LDA MOBADDR
ADC MOBW
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA MOBADDR
ADC #8
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
LDA MOBDRAW_C
STA MOBDRAW_J
DEC MOBDRAW_I
BEQ MOBSAVE2L2AX
JMP MOBSAVE2L2A
MOBSAVE2L2AX:
MOBSAVE2L3:
STA $FF3E
CLI
RTS
MOBSAVE3:
RTS
MOBSAVE0:
MOBSAVE1:
MOBSAVE4:
RTS
; MOBRESTORE(X:indeX) -> chipset
MOBRESTORE:
LDA CURRENTMODE
; BITMAP_MODE_STANDARD
CMP #2
BNE MOBRESTORE2X
JMP MOBRESTORE2
MOBRESTORE2X:
; BITMAP_MODE_MULTICOLOR
CMP #3
BNE MOBRESTORE3X
JMP MOBRESTORE3
MOBRESTORE3X:
; TILEMAP_MODE_STANDARD
CMP #0
BNE MOBRESTORE0X
JMP MOBRESTORE0
MOBRESTORE0X:
; TILEMAP_MODE_MULTICOLOR
CMP #1
BNE MOBRESTORE1X
JMP MOBRESTORE1
MOBRESTORE1X:
; TILEMAP_MODE_EXTENDED
CMP #4
BNE MOBRESTORE4X
JMP MOBRESTORE4
MOBRESTORE4X:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; RESTORE MODE 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This routine will do a simple copy of the screen pixels over the
; save area one, replacing them.
MOBRESTORE2_COPY:
LDY #0
LDA (MOBADDR),Y ; S
; LDA #$AA
STA (PLOTDEST),Y ; D
RTS
; This routine will increment the position of the operation to the
; next byte (row) of the current cell.
MOBRESTORE2_INC:
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA PLOTDEST
ADC #1
STA PLOTDEST
LDA PLOTDEST+1
ADC #0
STA PLOTDEST+1
RTS
MOBRESTORE2_INCL:
CLC
LDA PLOTDEST
ADC #$40
STA PLOTDEST
LDA PLOTDEST+1
ADC #$1
STA PLOTDEST+1
SEC
LDA PLOTDEST
SBC MOBW
STA PLOTDEST
LDA PLOTDEST+1
SBC #$0
STA PLOTDEST+1
RTS
; This entry point is needed do save the screen into the reserved area,
; in standard BITMAP MODE (2).
MOBRESTORE2:
SEI
STA $FF3F
LDX MOBI
LDA MOBDESCRIPTORS_SL, X
STA MOBADDR
LDA MOBDESCRIPTORS_SH, X
STA MOBADDR+1
;-------------------------
;calc Y-cell, divide by 8
;y/8 is y-cell table index
;-------------------------
LDA MOBDESCRIPTORS_PYL, X
LSR ;/ 2
LSR ;/ 4
LSR ;/ 8
TAY ;tbl_8,y index
CLC
;------------------------
;calc X-cell, divide by 8
;divide 2-byte PLOTX / 8
;------------------------
LDA MOBDESCRIPTORS_PXL, X
ROR MOBDESCRIPTORS_PXH, X ;rotate the high byte into carry flag
ROR ;lo byte / 2 (rotate C into low byte)
LSR ;lo byte / 4
LSR ;lo byte / 8
TAX ;tbl_8,x index
;----------------------------------
;add x & y to calc cell point is in
;----------------------------------
CLC
LDA PLOTVBASELO,Y ;table of $A000 row base addresses
ADC PLOT8LO,X ;+ (8 * Xcell)
STA PLOTDEST ;= cell address
LDA PLOTVBASEHI,Y ;do the high byte
ADC PLOT8HI,X
STA PLOTDEST+1
TXA
ADC PLOTCVBASELO,Y ;table of $8400 row base addresses
STA PLOTCDEST ;= cell address
LDA #0
ADC PLOTCVBASEHI,Y ;do the high byte
STA PLOTCDEST+1
; +---+---...---+---+
; |xxx|xxxxxxxxx|xxx|
; +---+---...---+---+
; | | | |
; . . . .
; | | | |
; +---+---...---+---+
; | | | |
; +---+---...---+---+
LDX MOBI
; Calculate how many times we have to repeat
; the row copying. If the image's height is less than
; 8 pixels, we skip this part.
LDA MOBDESCRIPTORS_H, X
LSR
LSR
LSR
BEQ MOBRESTORE2L3
CLC
ADC #1
STA MOBDRAW_I
; Calculate how many times we have to repeat
; the cell copying. If the image's width is less than
; 9 pixels, we skip this part.
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
BEQ MOBRESTORE2L3
CLC
ADC #1
STA MOBDRAW_J
STA MOBDRAW_C
ASL
ASL
ASL
STA MOBW
LDX MOBI
LDA MOBVBL
BEQ MOBRESTORENOVBL
CLC
LDA MOBDESCRIPTORS_PYL,X
ADC #28
ADC MOBDESCRIPTORS_H,X
ADC MOBDESCRIPTORS_H,X
JSR MOBWAITLINE
MOBRESTORENOVBL:
; Repeate an entire cell copy for each column
MOBRESTORE2L2A:
MOBRESTORE2L2:
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
JSR MOBRESTORE2_COPY
JSR MOBRESTORE2_INC
DEC MOBDRAW_J
BNE MOBRESTORE2L2A
JSR MOBRESTORE2_INCL
LDA MOBDRAW_C
STA MOBDRAW_J
DEC MOBDRAW_I
BNE MOBRESTORE2L2A
MOBRESTORE2L3:
LDX MOBI
LDA MOBDESCRIPTORS_SIZEL,X
STA MOBSIZE
LDA MOBDESCRIPTORS_SIZEH,X
STA MOBSIZE+1
JSR MOBFREE
LDA #0
STA MOBDESCRIPTORS_SL, X
LDA #0
STA MOBDESCRIPTORS_SH, X
STA $FF3E
CLI
RTS
MOBRESTORE3:
RTS
MOBRESTORE0:
MOBRESTORE1:
MOBRESTORE4:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Chipset specific drawing routine
; MOBDRAW(X:indeX) -> chipset
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOBDRAW:
LDA CURRENTMODE
; BITMAP_MODE_STANDARD
CMP #2
BNE MOBDRAW2X
JMP MOBDRAW2
MOBDRAW2X:
; BITMAP_MODE_MULTICOLOR
CMP #3
BNE MOBDRAW3X
JMP MOBDRAW3
MOBDRAW3X:
; TILEMAP_MODE_STANDARD
CMP #0
BNE MOBDRAW0X
JMP MOBDRAW0
MOBDRAW0X:
; TILEMAP_MODE_MULTICOLOR
CMP #1
BNE MOBDRAW1X
JMP MOBDRAW1
MOBDRAW1X:
; TILEMAP_MODE_EXTENDED
CMP #4
BNE MOBDRAW4X
JMP MOBDRAW4
MOBDRAW4X:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DRAW MODE 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This routine will do nothing, by skipping the
; number of bytes (rows in a cell) given by
; MOBDRAW_DY parameters.
MOBDRAW2_NOP:
CLC
LDA MOBADDR
ADC MOBDRAW_DY
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA PLOTDEST
ADC MOBDRAW_DY
STA PLOTDEST
LDA PLOTDEST+1
ADC #0
STA PLOTDEST+1
RTS
; This routine will do nothing, by skipping the
; number of bytes (rows in a cell) given by
; 8-MOBDRAW_DY parameters.
MOBDRAW2_NOP2:
CLC
LDA MOBADDR
ADC #8
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
SEC
LDA MOBADDR
SBC MOBDRAW_DY
STA MOBADDR
LDA MOBADDR+1
SBC #0
STA MOBADDR+1
CLC
LDA PLOTDEST
ADC #8
STA PLOTDEST
LDA PLOTDEST+1
ADC #0
STA PLOTDEST+1
SEC
LDA PLOTDEST
SBC MOBDRAW_DY
STA PLOTDEST
LDA PLOTDEST+1
SBC #0
STA PLOTDEST+1
RTS
; This routine will do a "left mask", by taking the original pixels
; from the drawing, protecting the first MOBDRAW_DX pixels and
; replacing the others.
MOBDRAW2_LEFTMASK:
LDX MOBDRAW_DX
LDA MOBDRAW2_MASKX,X ; maskX
EOR #$FF ; ~ maskX
LDY #0
AND (PLOTDEST),Y ; B & ~ maskX
STA MOBDRAW_TMP
LDX MOBDRAW_DX
LDA MOBDRAW2_MASKX,X ; maskX
LDY #0
AND (MOBADDR),Y ; S & maskX
ORA MOBDRAW_TMP
STA (PLOTDEST),Y
RTS
; This routine will do a "right mask", by taking the original pixels
; from the drawing, protecting the last MOBDRAW_DX pixels and
; replacing the others.
MOBDRAW2_RIGHTMASK:
LDX MOBDRAW_DX
LDA MOBDRAW2_MASKX,X ; maskX
LDY #0
AND (PLOTDEST),Y ; B & maskX
STA MOBDRAW_TMP
LDX MOBDRAW_DX
LDA MOBDRAW2_MASKX,X ; maskX
EOR #$FF ; ~ maskX
LDY #0
AND (MOBADDR),Y ; S & ~ maskX
ORA MOBDRAW_TMP
STA (PLOTDEST),Y
RTS
; This routine will do a simple copy of the drawing pixels over the
; original one, replacing them.
MOBDRAW2_COPY:
LDY #0
LDA (MOBADDR),Y ; S
STA (PLOTDEST),Y ; D
RTS
; This routine will increment the position of the operation to the
; next byte (row) of the current cell.
MOBDRAW2_INC:
CLC
LDA MOBADDR
ADC #1
STA MOBADDR
LDA MOBADDR+1
ADC #0
STA MOBADDR+1
CLC
LDA PLOTDEST
ADC #1
STA PLOTDEST
LDA PLOTDEST+1
ADC #0
STA PLOTDEST+1
RTS
MOBDRAW2_INCL:
CLC
LDA PLOTDEST
ADC #$40
STA PLOTDEST
LDA PLOTDEST+1
ADC #$1
STA PLOTDEST+1
SEC
LDA PLOTDEST
SBC MOBW
STA PLOTDEST
LDA PLOTDEST+1
SBC #$0
STA PLOTDEST+1
SEC
LDA PLOTDEST
SBC #$8
STA PLOTDEST
LDA PLOTDEST+1
SBC #$0
STA PLOTDEST+1
RTS
; This entry point is needed do draw the image over the screen,
; in standard BITMAP MODE (2).
MOBDRAW2:
SEI
STA $FF3F
STX MOBI
LDA MOBDESCRIPTORS_DL, X
STA MOBADDR
LDA MOBDESCRIPTORS_DH, X
STA MOBADDR+1
;-------------------------
;calc Y-cell, divide by 8
;y/8 is y-cell table index
;-------------------------
LDA MOBDESCRIPTORS_YL, X
LSR ;/ 2
LSR ;/ 4
LSR ;/ 8
TAY ;tbl_8,y index
CLC
;------------------------
;calc X-cell, divide by 8
;divide 2-byte PLOTX / 8
;------------------------
LDA MOBDESCRIPTORS_XL, X
ROR MOBDESCRIPTORS_XH, X ;rotate the high byte into carry flag
ROR ;lo byte / 2 (rotate C into low byte)
LSR ;lo byte / 4
LSR ;lo byte / 8
TAX ;tbl_8,x index
;----------------------------------
;add x & y to calc cell point is in
;----------------------------------
CLC
LDA PLOTVBASELO,Y ;table of $A000 row base addresses
ADC PLOT8LO,X ;+ (8 * Xcell)
STA PLOTDEST ;= cell address
LDA PLOTVBASEHI,Y ;do the high byte
ADC PLOT8HI,X
STA PLOTDEST+1
TXA
ADC PLOTCVBASELO,Y ;table of $8400 row base addresses
STA PLOTCDEST ;= cell address
LDA #0
ADC PLOTCVBASEHI,Y ;do the high byte
STA PLOTCDEST+1
LDX MOBI
; Calculate the effective offset of the image,
; in order to know how many pixels we have to
; skip / mask.
LDA MOBDESCRIPTORS_YL, X
AND #$07
STA MOBDRAW_DY
STA MOBDRAW_DY2
STA MOBDRAW_I
LDA MOBDESCRIPTORS_XL, X
AND #$07
STA MOBDRAW_DX
STA MOBDRAW_J
; +---+---...---+---+
; |XXX| | |
; +---+---...---+---+
; | | | |
; . . . .
; | | | |
; +---+---...---+---+
; | | | |
; +---+---...---+---+
LDA MOBDRAW_DY2
STA MOBDRAW_DY
; Skip DY rows
JSR MOBDRAW2_NOP
; Copy (masked) 8-DY rows
SEC
LDA #8
SBC MOBDRAW_DY
STA MOBDRAW_I
MOBDRAW2L1:
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
DEC MOBDRAW_I
BNE MOBDRAW2L1
; +---+---...---+---+
; | |xxxxxxxxx| |
; +---+---...---+---+
; | | | |
; . . . .
; | | | |
; +---+---...---+---+
; | | | |
; +---+---...---+---+
LDX MOBI
; Calculate how many times we have to repeat
; the cell copying. If the image's width is less than
; 9 pixels, we skip this part.
LDA MOBDESCRIPTORS_W, X
LSR
LSR
LSR
BEQ MOBDRAW2L3
STA MOBDRAW_J
STA MOBDRAW_C
ASL
ASL
ASL
STA MOBW
DEC MOBDRAW_J
; ; Repeate an entire cell copy for each column
MOBDRAW2L2A:
LDA MOBDRAW_DY2
STA MOBDRAW_DY
; ; Skip DY rows
JSR MOBDRAW2_NOP
; ; Copy (masked) 8-DY rows
SEC
LDA #8
SBC MOBDRAW_DY
STA MOBDRAW_I
MOBDRAW2L2:
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
DEC MOBDRAW_I
BNE MOBDRAW2L2
DEC MOBDRAW_J
BNE MOBDRAW2L2A
MOBDRAW2L3:
; ; +---+---...---+---+
; ; | | |xxx|
; ; +---+---...---+---+
; ; | | | |
; ; . . . .
; ; | | | |
; ; +---+---...---+---+
; ; | | | |
; ; +---+---...---+---+
LDX MOBI
LDA MOBDRAW_DY2
STA MOBDRAW_DY
; ; Skip DY rows
JSR MOBDRAW2_NOP
; ; Copy (masked) 8-DY rows
SEC
LDA #8
SBC MOBDRAW_DY
STA MOBDRAW_I
MOBDRAW2L3B:
JSR MOBDRAW2_RIGHTMASK
DEC MOBDRAW_I
BEQ MOBDRAW2L3BX
JSR MOBDRAW2_INC
JMP MOBDRAW2L3B
MOBDRAW2L3BX:
LDX MOBI
; Calculate how many times we have to repeat
; the row copying. If the image's height is less than
; 8 pixels, we skip this part.
LDA MOBDESCRIPTORS_H, X
LSR
LSR
LSR
BNE MOBDRAW2L6X
JMP MOBDRAW2L6
MOBDRAW2L6X:
SEC
SBC #1
BNE MOBDRAW2L6X2
JMP MOBDRAW2L6
MOBDRAW2L6X2:
STA MOBDRAW_I
MOBDRAW2L4:
JSR MOBDRAW2_INCL
; +---+---...---+---+
; | | | |
; +---+---...---+---+
; |xxx| | |
; . . . .
; | | | |
; +---+---...---+---+
; | | | |
; +---+---...---+---+
; Copy "left masked" the left most cell.
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
; Calculate how many times we have to repeat
; the cell copying. If the image's width is less than
; 9 pixels, we skip this part.
LDA MOBDRAW_C
STA MOBDRAW_J
DEC MOBDRAW_J
; +---+---...---+---+
; | | | |
; +---+---...---+---+
; | |xxxxxxxxx| |
; . . . .
; | | | |
; +---+---...---+---+
; | | | |
; +---+---...---+---+
; Repeate an entire cell copy for each column
MOBDRAW2L4A:
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
DEC MOBDRAW_J
BNE MOBDRAW2L4A
; ; +---+---...---+---+
; ; | | | |
; ; +---+---...---+---+
; ; | | |xxx|
; ; . . . .
; ; | | | |
; ; +---+---...---+---+
; ; | | | |
; ; +---+---...---+---+
; ; Copy "right masked" the left most cell.
MOBDRAW2L5:
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
DEC MOBDRAW_I
BEQ MOBDRAW2L4X
JMP MOBDRAW2L4
MOBDRAW2L4X:
MOBDRAW2L6:
JSR MOBDRAW2_INCL
; +---+---...---+---+
; | | | |
; +---+---...---+---+
; | | | |
; . . . .
; | | | |
; +---+---...---+---+
; |XXX| | |
; +---+---...---+---+
LDX MOBI
; Copy (masked) DY rows
LDA MOBDRAW_DY2
STA MOBDRAW_DY
STA MOBDRAW_I
BNE MOBDRAW2L7
JMP MOBDRAW2E
MOBDRAW2L7:
JSR MOBDRAW2_LEFTMASK
JSR MOBDRAW2_INC
DEC MOBDRAW_I
BEQ MOBDRAW2L1X2
JMP MOBDRAW2L7
MOBDRAW2L1X2:
; Ignore 8-DY rows
JSR MOBDRAW2_NOP2
; +---+---...---+---+
; | | | |
; +---+---...---+---+
; | | | |
; . . . .
; | | | |
; +---+---...---+---+
; | |XXXXXXXXX| |
; +---+---...---+---+
LDX MOBI
; Calculate how many times we have to repeat
; the cell copying. If the image's width is less than
; 9 pixels, we skip this part.
LDA MOBDRAW_C
STA MOBDRAW_J
DEC MOBDRAW_J
; Repeate an entire cell copy for each column
MOBDRAW2L8A:
; Copy DY rows
LDA MOBDRAW_DY
STA MOBDRAW_I
MOBDRAW2L8:
JSR MOBDRAW2_COPY
JSR MOBDRAW2_INC
DEC MOBDRAW_I
BNE MOBDRAW2L8
; Skip 8-DY rows
JSR MOBDRAW2_NOP2
DEC MOBDRAW_J
BNE MOBDRAW2L8A
MOBDRAW2L9:
LDX MOBI
; Copy by right masking DY rows
LDA MOBDRAW_DY
STA MOBDRAW_I
MOBDRAW2L9B:
JSR MOBDRAW2_RIGHTMASK
JSR MOBDRAW2_INC
DEC MOBDRAW_I
BNE MOBDRAW2L9B
; Skip 8-DY rows
JSR MOBDRAW2_NOP2
MOBDRAW2E:
STA $FF3E
CLI
RTS
MOBDRAW3:
RTS
MOBDRAW0:
MOBDRAW1:
MOBDRAW4:
RTS
MOBATCS:
SEI
STA $FF3F
LDX MOBI
; Now we must adjust the image inside the larger
; clip, by right and bottom shifting it, accordingly
; to the (relative) position (x,y)
;
; DX for *next* position (DXn)
LDA MOBDESCRIPTORS_XL, X
STA MOBX
AND #$07
STA MOBDRAW_DX
; DX for *previous* position (DXp)
LDA MOBDESCRIPTORS_PXL, X
AND #$07
; DX = (DXp-DXn)
; So: if DX > 0 ---> DXp > DXn ---> shift left
; if DX < 0 ---> DXp < DXn ---> shift right
SEC
SBC MOBDRAW_DX
STA MOBDRAW_DX
; DY for *next* position (DYn)
LDA MOBDESCRIPTORS_YL, X
STA MOBY
AND #$07
STA MOBDRAW_DY
; DY for *previous* position (DYp)
LDA MOBDESCRIPTORS_PYL, X
AND #$07
; DY = (DYp-DYn)
; So: if DY > 0 ---> DYp > DYn ---> shift up
; if DY < 0 ---> DYp < DYn ---> shift down
SEC
SBC MOBDRAW_DY
STA MOBDRAW_DY
LDA MOBDRAW_DX
BEQ MOBATCS_VERT
AND #$80
BEQ MOBATCS_LEFT
MOBATCS_RIGHT:
LDA MOBDRAW_DX
CLC
EOR #$FF
ADC #1
STA MOBDRAW_DX
JSR MOBDRAW2_SHIFTRIGHT
JMP MOBATCS_VERT
MOBATCS_LEFT:
JSR MOBDRAW2_SHIFTLEFT
JMP MOBATCS_VERT
MOBATCS_VERT:
LDA MOBDRAW_DY
BEQ MOBATCS_DONE
AND #$80
BEQ MOBATCS_UP
MOBATCS_DOWN:
LDA MOBDRAW_DY
CLC
EOR #$FF
ADC #1
STA MOBDRAW_DY
JSR MOBDRAW2_SHIFTDOWN
JMP MOBATCS_DONE
MOBATCS_UP:
JSR MOBDRAW2_SHIFTUP
MOBATCS_DONE:
STA $FF3E
CLI
RTS
MOBWAITLINE:
CMP $FF1D
BCS MOBWAITLINE
RTS
; Mask for bit selection / unselection on a single cell
; during drawing operations.
MOBDRAW2_MASKX:
.byte %11111111
.byte %01111111
.byte %00111111
.byte %00011111
.byte %00001111
.byte %00000111
.byte %00000011
.byte %00000001
| 18.725251
| 80
| 0.54566
|
903880b5ef12a36b4fa88c21863f6df8e21829f7
| 1,094
|
asm
|
Assembly
|
programs/oeis/167/A167878.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/167/A167878.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/167/A167878.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A167878: A167877(n) + n.
; 0,2,2,6,8,8,8,8,8,18,20,20,24,26,26,26,26,26,26,26,26,26,26,26,26,26,26,54,56,56,60,62,62,62,62,62,72,74,74,78,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,162,164,164,168,170,170,170,170,170,180,182,182,186,188,188,188,188,188,188,188,188,188,188,188,188,188,188,216,218,218,222,224,224,224,224,224,234,236,236,240,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,486,488,488,492,494,494,494
lpb $0,1
mov $1,$0
cal $1,39966 ; a(0) = 1; thereafter a(3n+2) = 0, a(3n) = a(3n+1) = a(n).
sub $0,1
add $2,$1
add $0,$2
lpe
mov $1,$0
mul $1,2
| 84.153846
| 911
| 0.685558
|
ce50d1768608173094a920c00f5e8dfbdc88326b
| 163
|
asm
|
Assembly
|
RAM2.asm
|
esihaj/MIPS-Multi-Cycle
|
bc7f1751bd924783174eb9e6f7fc35a4430f56f5
|
[
"MIT"
] | null | null | null |
RAM2.asm
|
esihaj/MIPS-Multi-Cycle
|
bc7f1751bd924783174eb9e6f7fc35a4430f56f5
|
[
"MIT"
] | null | null | null |
RAM2.asm
|
esihaj/MIPS-Multi-Cycle
|
bc7f1751bd924783174eb9e6f7fc35a4430f56f5
|
[
"MIT"
] | null | null | null |
10000110 // push 6 ( 85)
11000011// JMP 3
10000011//push 3 (135 )
10000111//push 7 (170)
01000000//AND
11101000//JZ 8
01010101//AND
10101010//POP 10
01100000//NOT
| 16.3
| 24
| 0.711656
|
da6bafa42f1621595f9a6f55bf713c23020f7171
| 369
|
asm
|
Assembly
|
programs/oeis/060/A060275.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/060/A060275.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/060/A060275.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A060275: At least two unordered triples of positive numbers have sum n and equal products.
; 13,14,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83
mov $1,$0
add $1,7
mov $2,5
trn $2,$0
div $2,2
sub $1,$2
add $1,8
| 33.545455
| 208
| 0.669377
|
9cee497ece44847cc4cd93f742f47620e51fa6b7
| 484
|
asm
|
Assembly
|
oeis/331/A331954.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/331/A331954.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/331/A331954.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A331954: a(n) is the least positive k such that floor(n/k) is a prime number.
; Submitted by Jon Maiga
; 1,1,2,1,2,1,3,3,2,1,4,1,2,2,3,1,5,1,4,3,2,1,7,5,2,2,4,1,4,1,6,3,2,2,5,1,2,2,3,1,6,1,4,4,2,1,9,7,7,3,3,1,4,4,5,3,2,1,8,1,2,2,9,5,5,1,4,3,3,1,10,1,2,2,4,4,4,1,6,6,2,1,11,5,2,2,3,1,8,7,4,3,2,2,5,1,5,5,9,1
add $0,2
lpb $0
sub $0,1
add $1,1
mov $2,$0
div $2,$1
seq $2,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
add $0,$2
lpe
mov $0,$1
add $0,1
| 30.25
| 203
| 0.578512
|
b108767811b7b17b11cb972e021a08554ce792d1
| 554
|
asm
|
Assembly
|
data/baseStats_original/nidorina.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 16
|
2018-08-28T21:47:01.000Z
|
2022-02-20T20:29:59.000Z
|
data/baseStats_original/nidorina.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 5
|
2019-04-03T19:53:11.000Z
|
2022-03-11T22:49:34.000Z
|
data/baseStats_original/nidorina.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 2
|
2019-12-09T19:46:02.000Z
|
2020-12-05T21:36:30.000Z
|
db DEX_NIDORINA ; pokedex id
db 70 ; base hp
db 62 ; base attack
db 67 ; base defense
db 56 ; base speed
db 55 ; base special
db POISON ; species type 1
db POISON ; species type 2
db 120 ; catch rate
db 117 ; base exp yield
INCBIN "pic/ymon/nidorina.pic",0,1 ; 66, sprite dimensions
dw NidorinaPicFront
dw NidorinaPicBack
; attacks known at lvl 0
db GROWL
db TACKLE
db SCRATCH
db 0
db 3 ; growth rate
; learnset
tmlearn 6,7,8
tmlearn 9,10,11,12,13,14
tmlearn 20,24
tmlearn 25,31,32
tmlearn 33,34,40
tmlearn 44
tmlearn 50
db BANK(NidorinaPicFront)
| 19.103448
| 58
| 0.741877
|
b190fd8d889bbdbd483acbb6f7b3bf086f6b8e10
| 6,904
|
asm
|
Assembly
|
coverage/IN_CTS/0450-COVERAGE-nir-lower-vars-to-ssa-571/work/variant/2_spirv_opt_asm/shader.frag.asm
|
asuonpaa/ShaderTests
|
6a3672040dcfa0d164d313224446496d1775a15e
|
[
"Apache-2.0"
] | null | null | null |
coverage/IN_CTS/0450-COVERAGE-nir-lower-vars-to-ssa-571/work/variant/2_spirv_opt_asm/shader.frag.asm
|
asuonpaa/ShaderTests
|
6a3672040dcfa0d164d313224446496d1775a15e
|
[
"Apache-2.0"
] | 47
|
2021-03-11T07:42:51.000Z
|
2022-03-14T06:30:14.000Z
|
coverage/IN_CTS/0450-COVERAGE-nir-lower-vars-to-ssa-571/work/variant/2_spirv_opt_asm/shader.frag.asm
|
asuonpaa/ShaderTests
|
6a3672040dcfa0d164d313224446496d1775a15e
|
[
"Apache-2.0"
] | 4
|
2021-03-09T13:37:19.000Z
|
2022-02-25T07:32:11.000Z
|
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 137
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %116
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %10 "m43"
OpName %14 "buf1"
OpMemberName %14 0 "_GLF_uniform_float_values"
OpName %16 ""
OpName %32 "buf0"
OpMemberName %32 0 "_GLF_uniform_int_values"
OpName %34 ""
OpName %45 "sums"
OpName %54 "i"
OpName %86 "a"
OpName %116 "_GLF_color"
OpDecorate %13 ArrayStride 16
OpMemberDecorate %14 0 Offset 0
OpDecorate %14 Block
OpDecorate %16 DescriptorSet 0
OpDecorate %16 Binding 1
OpDecorate %31 ArrayStride 16
OpMemberDecorate %32 0 Offset 0
OpDecorate %32 Block
OpDecorate %34 DescriptorSet 0
OpDecorate %34 Binding 0
OpDecorate %116 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypeVector %6 3
%8 = OpTypeMatrix %7 4
%9 = OpTypePointer Function %8
%11 = OpTypeInt 32 0
%12 = OpConstant %11 3
%13 = OpTypeArray %6 %12
%14 = OpTypeStruct %13
%15 = OpTypePointer Uniform %14
%16 = OpVariable %15 Uniform
%17 = OpTypeInt 32 1
%18 = OpConstant %17 0
%19 = OpConstant %17 1
%20 = OpTypePointer Uniform %6
%23 = OpConstant %6 1
%24 = OpConstant %6 0
%30 = OpConstant %11 4
%31 = OpTypeArray %17 %30
%32 = OpTypeStruct %31
%33 = OpTypePointer Uniform %32
%34 = OpVariable %33 Uniform
%35 = OpTypePointer Uniform %17
%42 = OpTypePointer Function %6
%44 = OpTypePointer Function %13
%53 = OpTypePointer Function %17
%63 = OpConstant %17 3
%66 = OpTypeBool
%87 = OpConstant %17 4
%88 = OpConstant %17 2
%114 = OpTypeVector %6 4
%115 = OpTypePointer Output %114
%116 = OpVariable %115 Output
%136 = OpConstantComposite %7 %24 %24 %24
%4 = OpFunction %2 None %3
%5 = OpLabel
%10 = OpVariable %9 Function
%45 = OpVariable %44 Function
%54 = OpVariable %53 Function
%86 = OpVariable %53 Function
%21 = OpAccessChain %20 %16 %18 %19
%22 = OpLoad %6 %21
%25 = OpCompositeConstruct %7 %22 %24 %24
%26 = OpCompositeConstruct %7 %24 %22 %24
%27 = OpCompositeConstruct %7 %24 %24 %22
%28 = OpCompositeConstruct %7 %24 %24 %24
%29 = OpCompositeConstruct %8 %25 %26 %27 %136
OpStore %10 %29
%36 = OpAccessChain %35 %34 %18 %18
%37 = OpLoad %17 %36
%38 = OpAccessChain %35 %34 %18 %18
%39 = OpLoad %17 %38
%40 = OpAccessChain %20 %16 %18 %18
%41 = OpLoad %6 %40
%43 = OpAccessChain %42 %10 %37 %39
OpStore %43 %41
%46 = OpAccessChain %20 %16 %18 %18
%47 = OpLoad %6 %46
%48 = OpAccessChain %20 %16 %18 %18
%49 = OpLoad %6 %48
%50 = OpAccessChain %20 %16 %18 %18
%51 = OpLoad %6 %50
%52 = OpCompositeConstruct %13 %47 %49 %51
OpStore %45 %52
%55 = OpAccessChain %35 %34 %18 %18
%56 = OpLoad %17 %55
OpStore %54 %56
OpBranch %57
%57 = OpLabel
%135 = OpPhi %17 %56 %5 %80 %60
OpLoopMerge %59 %60 None
OpBranch %61
%61 = OpLabel
%64 = OpAccessChain %35 %34 %18 %63
%65 = OpLoad %17 %64
%67 = OpSLessThan %66 %135 %65
OpBranchConditional %67 %58 %59
%58 = OpLabel
%68 = OpAccessChain %35 %34 %18 %18
%69 = OpLoad %17 %68
%71 = OpAccessChain %35 %34 %18 %18
%72 = OpLoad %17 %71
%73 = OpAccessChain %42 %10 %135 %72
%74 = OpLoad %6 %73
%75 = OpAccessChain %42 %45 %69
%76 = OpLoad %6 %75
%77 = OpFAdd %6 %76 %74
%78 = OpAccessChain %42 %45 %69
OpStore %78 %77
OpBranch %60
%60 = OpLabel
%80 = OpIAdd %17 %135 %19
OpStore %54 %80
OpBranch %57
%59 = OpLabel
%81 = OpAccessChain %35 %34 %18 %19
%82 = OpLoad %17 %81
%83 = OpIEqual %66 %82 %19
OpSelectionMerge %85 None
OpBranchConditional %83 %84 %85
%84 = OpLabel
OpStore %86 %87
%89 = OpAccessChain %35 %34 %18 %88
%90 = OpLoad %17 %89
%92 = OpAccessChain %35 %34 %18 %18
%93 = OpLoad %17 %92
%94 = OpAccessChain %42 %10 %87 %93
%95 = OpLoad %6 %94
%96 = OpAccessChain %42 %45 %90
%97 = OpLoad %6 %96
%98 = OpFAdd %6 %97 %95
%99 = OpAccessChain %42 %45 %90
OpStore %99 %98
OpBranch %85
%85 = OpLabel
%100 = OpAccessChain %35 %34 %18 %19
%101 = OpLoad %17 %100
%102 = OpAccessChain %42 %45 %101
%103 = OpLoad %6 %102
%104 = OpAccessChain %35 %34 %18 %18
%105 = OpLoad %17 %104
%106 = OpAccessChain %42 %45 %105
%107 = OpLoad %6 %106
%108 = OpFAdd %6 %103 %107
%109 = OpAccessChain %20 %16 %18 %88
%110 = OpLoad %6 %109
%111 = OpFOrdEqual %66 %108 %110
OpSelectionMerge %113 None
OpBranchConditional %111 %112 %130
%112 = OpLabel
%117 = OpAccessChain %35 %34 %18 %18
%118 = OpLoad %17 %117
%119 = OpConvertSToF %6 %118
%120 = OpAccessChain %35 %34 %18 %19
%121 = OpLoad %17 %120
%122 = OpConvertSToF %6 %121
%123 = OpAccessChain %35 %34 %18 %19
%124 = OpLoad %17 %123
%125 = OpConvertSToF %6 %124
%126 = OpAccessChain %35 %34 %18 %18
%127 = OpLoad %17 %126
%128 = OpConvertSToF %6 %127
%129 = OpCompositeConstruct %114 %119 %122 %125 %128
OpStore %116 %129
OpBranch %113
%130 = OpLabel
%131 = OpAccessChain %35 %34 %18 %19
%132 = OpLoad %17 %131
%133 = OpConvertSToF %6 %132
%134 = OpCompositeConstruct %114 %133 %133 %133 %133
OpStore %116 %134
OpBranch %113
%113 = OpLabel
OpReturn
OpFunctionEnd
| 36.146597
| 61
| 0.490875
|
3b4d1f7d3b3ac1225e180d4a6ecbe0be0169811e
| 1,608
|
asm
|
Assembly
|
character_writer/main.asm
|
iamorphen/dmg-gb-tutorial
|
35ece93e2a42972c1c4b5ed08377bffd3ebfaf9b
|
[
"MIT"
] | 1
|
2019-02-04T21:37:32.000Z
|
2019-02-04T21:37:32.000Z
|
character_writer/main.asm
|
iamorphen/dmg-gb-tutorial
|
35ece93e2a42972c1c4b5ed08377bffd3ebfaf9b
|
[
"MIT"
] | null | null | null |
character_writer/main.asm
|
iamorphen/dmg-gb-tutorial
|
35ece93e2a42972c1c4b5ed08377bffd3ebfaf9b
|
[
"MIT"
] | null | null | null |
; A simple test. Write some characters to the screen.
SECTION "DUMMY",ROM0[$00] ; dummy section to allow includes to PUSHS/POPS
INCLUDE "include/cp437.asm"
INCLUDE "include/hardware.asm"
INCLUDE "include/mem_util.asm"
INCLUDE "include/vid_util.asm"
SECTION "START",ROM0[$100]
start:
nop
jp main
set_rom_header
test_string: ; $150 - $15B
DB "Hello world!"
cp437:
CP437 1,8 ; import the code page 437 character set
main:
di
call wait_vblank_begin
; turn off the display
ld a, [rLCDC]
res 7, a
ld [rLCDC], a
; load the cp437 tiles into the tile data table
ld hl, cp437
ld de, rTileDataTable8000
ld bc, 256 * 8 ; 256 tiles, 8 bytes each
call tile_copy_monochrome
; set the display position to be 0, 0
ld a, 0
ld [rSCY], a
ld [rSCX], a
; set the palette shades
ld a, vBGPBlack << 6 | vBGPDarkGray << 4 | vBGPLightGray << 2 | vBGPWhite
ld [rBGP], a
; clear the background
ld a, [rTileDataTable8000] ; the NUL character
ld l, a
ld de, rTileMapData9800
ld bc, vBGTileMapBytesPerRow * vBGTileMapBytesPerCol
call mem_set
; set the tiles to be displayed
ld hl, test_string
ld de, rTileMapData9800 + vBGTileMapBytesPerRow * 8 + 5 ; 9th row, 5th column
ld bc, 12
call mem_copy
; re-enable LCD; usually done in two commands; expanded here for shorter lines
ld a, 0
or a, fLCDDispEnable | fLCDWinTileMapSel9800 | fLCDWinDispDisable
or a, fLCDBgWinTileDataSel8000 | fLCDBgTileMapDispSel9800 | fLCDSpriteSize8x8
or a, fLCDSpriteDispDisable | fLCDBgWinDispPriorityOn
ld [rLCDC], a
call spin
; Loop forever.
spin:
nop
jr @-1
| 22.027397
| 80
| 0.709577
|
4a0954141982b0e169bd888ce531a3633dc979a4
| 10,607
|
asm
|
Assembly
|
libass/x86/be_blur.asm
|
enen92/libass
|
49f116ab1fa4386f6a5191f322ac29872279516e
|
[
"0BSD"
] | null | null | null |
libass/x86/be_blur.asm
|
enen92/libass
|
49f116ab1fa4386f6a5191f322ac29872279516e
|
[
"0BSD"
] | null | null | null |
libass/x86/be_blur.asm
|
enen92/libass
|
49f116ab1fa4386f6a5191f322ac29872279516e
|
[
"0BSD"
] | 1
|
2022-01-10T03:24:37.000Z
|
2022-01-10T03:24:37.000Z
|
;******************************************************************************
;* be_blur.asm: SSE2 \be blur
;******************************************************************************
;* Copyright (C) 2013 rcombs <rcombs@rcombs.me>
;*
;* This file is part of libass.
;*
;* Permission to use, copy, modify, and distribute this software for any
;* purpose with or without fee is hereby granted, provided that the above
;* copyright notice and this permission notice appear in all copies.
;*
;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;******************************************************************************
%include "x86/x86inc.asm"
SECTION_RODATA 32
low_word_zero: dd 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
SECTION .text
;------------------------------------------------------------------------------
; void be_blur_pass( uint8_t *buf, unsigned width,
; unsigned height, unsigned stride,
; uint16_t *tmp);
;------------------------------------------------------------------------------
INIT_XMM sse2
cglobal be_blur, 5,15,9
.skip_prologue:
mov r6, 2 ; int x = 2;
pxor xmm6, xmm6 ; __m128i temp3 = 0;
mov r7, r0 ; unsigned char *src=buf;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix;
lea r12, [r4 + r3 * 2] ; unsigned char *col_sum_buf = tmp + stride * 2;
lea r14, [r1 - 2] ; tmpreg = (w-2);
and r14, -8 ; tmpreg &= (~7);
.first_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .first_loop
mov r6, 2 ; int x = 2;
lea r7, [r0 + r3] ; unsigned char *src=buf+stride;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix
.second_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
mov word [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .second_loop
mov r5, 2 ; int y = 2;
.height_loop:
mov r10, r5; int tmpreg = y;
imul r10, r3; tmpreg *= stride;
lea r7, [r0 + r10] ; unsigned char *src=buf+y*stride;
sub r10, r3 ; tmpreg -= stride;
lea r13, [r0 + r10]; unsigned char *dst=buf+(y-1)*stride;
mov r6, 2 ; int x = 2;
movzx r10, byte [r7] ; temp1 = src[0];
movzx r11, byte [r7 + 1] ; temp2 = src[1];
add r10, r11; temp1 += temp2
movd xm0, r10d; __m128i old_pix_128 = temp2;
movd xm1, r11d; __m128i old_sum_128 = temp1;
.width_loop:
movq xmm2, [r7 + r6]; __m128i new_pix = (src+x);
punpcklbw xmm2, xmm6 ; new_pix = _mm_unpacklo_epi8(new_pix, temp3);
movdqa xmm3, xmm2 ; __m128i temp = new_pix;
pslldq xmm3, 2 ; temp = temp << 2 * 8;
paddw xmm3, xmm0 ; temp = _mm_add_epi16(temp, old_pix_128);
paddw xmm3, xmm2 ; temp = _mm_add_epi16(temp, new_pix);
movdqa xmm0, xmm2 ; old_pix_128 = new_pix;
psrldq xmm0, 14 ; old_pix_128 = old_pix_128 >> 14 * 8;
movdqa xmm2, xmm3 ; new_pix = temp;
pslldq xmm2, 2 ; new_pix = new_pix << 2 * 8;
paddw xmm2, xmm1 ; new_pix = _mm_add_epi16(new_pix, old_sum_128);
paddw xmm2, xmm3 ; new_pix = _mm_add_epi16(new_pix, temp);
movdqa xmm1, xmm3 ; old_sum_128 = temp;
psrldq xmm1, 14 ; old_sum_128 = old_sum_128 >> 14 * 8;
movdqu xmm4, [r4 + r6 * 2] ; __m128i old_col_pix = *(col_pix_buf+x);
movdqu [r4 + r6 * 2], xmm2 ; *(col_pix_buf+x) = new_pix ;
movdqu xmm5, [r12 + r6 * 2] ; __m128i old_col_sum = *(col_pix_sum+x);
movdqa xmm3, xmm2 ; temp = new_pix;
paddw xmm3, xmm4 ; temp = _mm_add_epi16(temp, old_col_pix);
movdqu [r12 + r6 * 2], xmm3 ; *(col_sum_buf+x) = temp;
paddw xmm5, xmm3 ; old_col_sum = _mm_add_epi16(old_col_sum, temp);
psrlw xmm5, 4 ; old_col_sum = old_col_sum >> 4;
packuswb xmm5, xmm5 ; old_col_sum = _mm_packus_epi16(old_col_sum, old_col_sum);
movq qword [r13 + r6 - 1], xmm5 ; *(dst+x-1) = old_col_sum;
add r6, 8; x += 8;
cmp r6, r14; x < ((w - 2) & (~7));
jl .width_loop
movzx r8, byte [r7 + r6 - 1] ; old_pix = src[x-1];
movzx r9, byte [r7 + r6 - 2] ; old_sum = old_pix + src[x-2];
add r9, r8
jmp .final_width_check
.final_width_loop:
movzx r10, byte [r7 + r6] ; temp1 = src[x];
lea r11, [r8 + r10] ; temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
movzx r10, word [r12 + r6 * 2] ; temp1 = col_sum_buf[x];
add r10, r11 ; temp1 += temp2;
shr r10, 4 ; temp1 >>= 4;
mov byte [r13 + r6 - 1], r10b ; dst[x-1] = temp1
mov [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
.final_width_check:
cmp r6, r1 ; x < w
jl .final_width_loop
inc r5 ; y++;
cmp r5, r2 ; y < h;
jl .height_loop
RET
INIT_YMM avx2
cglobal be_blur, 5,15,9
cmp r1, 32
jl be_blur_sse2.skip_prologue
mov r6, 2 ; int x = 2;
vpxor ymm6, ymm6 ; __m128i temp3 = 0;
mov r7, r0 ; unsigned char *src=buf;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix;
lea r12, [r4 + r3 * 2] ; unsigned char *col_sum_buf = tmp + stride * 2;
lea r14, [r1 - 2] ; tmpreg = (w-2);
and r14, -16 ; tmpreg &= (~15);
vmovdqa ymm7, [low_word_zero]
.first_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .first_loop
mov r6, 2 ; int x = 2;
lea r7, [r0 + r3] ; unsigned char *src=buf+stride;
movzx r8, byte [r7 + 1] ; int old_pix = src[1];
movzx r9, byte [r7] ; int old_sum = src[0];
add r9, r8 ; old_sum += old_pix
.second_loop:
movzx r10, byte [r7 + r6] ; int temp1 = src[x];
lea r11, [r8 + r10] ; int temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
mov word [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
cmp r6, r1 ; x < w
jl .second_loop
mov r5, 2 ; int y = 2;
.height_loop:
mov r10, r5; int tmpreg = y;
imul r10, r3; tmpreg *= stride;
lea r7, [r0 + r10] ; unsigned char *src=buf+y*stride;
sub r10, r3 ; tmpreg -= stride;
lea r13, [r0 + r10]; unsigned char *dst=buf+(y-1)*stride;
mov r6, 2 ; int x = 2;
movzx r10, byte [r7] ; temp1 = src[0];
movzx r11, byte [r7 + 1] ; temp2 = src[1];
add r10, r11; temp1 += temp2
vmovd xmm0, r10d; __m128i old_pix_128 = temp2;
vmovd xmm1, r11d; __m128i old_sum_128 = temp1;
.width_loop:
vpermq ymm2, [r7 + r6], 0x10
vpunpcklbw ymm2, ymm2, ymm6 ; new_pix = _mm_unpacklo_epi8(new_pix, temp3);
vpermq ymm8, ymm2, 0x4e
vpalignr ymm3, ymm2, ymm8, 14
vpand ymm3, ymm3, ymm7
vpaddw ymm3, ymm0 ; temp = _mm_add_epi16(temp, old_pix_128);
vpaddw ymm3, ymm2 ; temp = _mm_add_epi16(temp, new_pix);
vperm2i128 ymm0, ymm2, ymm6, 0x21
vpsrldq ymm0, ymm0, 14; temp = temp >> 14 * 8;
vpermq ymm8, ymm3, 0x4e
vpand ymm8, ymm8, ymm7;
vpalignr ymm2, ymm3, ymm8, 14
vpand ymm2, ymm2, ymm7
vpaddw ymm2, ymm1 ; new_pix = _mm_add_epi16(new_pix, old_sum_128);
vpaddw ymm2, ymm3 ; new_pix = _mm_add_epi16(new_pix, temp);
vperm2i128 ymm1, ymm3, ymm6, 0x21
vpsrldq ymm1, ymm1, 14; temp = temp << 2 * 8;
vmovdqu ymm4, [r4 + r6 * 2] ; __m128i old_col_pix = *(col_pix_buf+x);
vmovdqu [r4 + r6 * 2], ymm2 ; *(col_pix_buf+x) = new_pix ;
vmovdqu ymm5, [r12 + r6 * 2] ; __m128i old_col_sum = *(col_pix_sum+x);
vpaddw ymm3, ymm2, ymm4
vmovdqu [r12 + r6 * 2], ymm3 ; *(col_sum_buf+x) = temp;
vpaddw ymm5, ymm3 ; old_col_sum = _mm_add_epi16(old_col_sum, temp);
vpsrlw ymm5, 4 ; old_col_sum = old_col_sum >> 4;
vpackuswb ymm5, ymm5 ; old_col_sum = _mm_packus_epi16(old_col_sum, old_col_sum);
vpermq ymm5, ymm5, 11_01_10_00b
vmovdqu [r13 + r6 - 1], xmm5 ; *(dst+x-1) = old_col_sum;
add r6, 16; x += 16;
cmp r6, r14; x < ((w - 2) & (~15));
jl .width_loop
movzx r8, byte [r7 + r6 - 1] ; old_pix = src[x-1];
movzx r9, byte [r7 + r6 - 2] ; old_sum = old_pix + src[x-2];
add r9, r8
jmp .final_width_check
.final_width_loop:
movzx r10, byte [r7 + r6] ; temp1 = src[x];
lea r11, [r8 + r10] ; temp2 = old_pix + temp1;
mov r8, r10 ; old_pix = temp1;
lea r10, [r9 + r11] ; temp1 = old_sum + temp2;
mov r9, r11 ; old_sum = temp2;
movzx r11, word [r4 + r6 * 2] ; temp2 = col_pix_buf[x];
add r11, r10 ; temp2 += temp1;
mov word [r4 + r6 * 2], r10w ; col_pix_buf[x] = temp1;
movzx r10, word [r12 + r6 * 2] ; temp1 = col_sum_buf[x];
add r10, r11 ; temp1 += temp2;
shr r10, 4 ; temp1 >>= 4;
mov byte [r13 + r6 - 1], r10b ; dst[x-1] = temp1
mov [r12 + r6 * 2], r11w ; col_sum_buf[x] = temp2;
inc r6 ; x++
.final_width_check:
cmp r6, r1 ; x < w
jl .final_width_loop
inc r5 ; y++;
cmp r5, r2 ; y < h;
jl .height_loop
RET
| 41.596078
| 112
| 0.580183
|
4d78c60853435b06f565525c95f9e152d011cf03
| 1,021
|
asm
|
Assembly
|
software/profi/net-tools/src/pqdos/browser/gopher/render/plaintext.asm
|
andykarpov/karabas-pro
|
11d897e51a7a66fddcdfb97fc7b785ca535d48dd
|
[
"MIT"
] | 26
|
2020-07-25T15:00:32.000Z
|
2022-03-22T19:30:04.000Z
|
software/profi/net-tools/src/pqdos/browser/gopher/render/plaintext.asm
|
zxrepo/andykarpov.karabas-pro
|
ab84aa2c95c206b2384d99054eb23cbe6aeec56b
|
[
"MIT"
] | 42
|
2020-07-29T14:29:18.000Z
|
2022-03-22T11:34:28.000Z
|
software/profi/net-tools/src/pqdos/browser/gopher/render/plaintext.asm
|
zxrepo/andykarpov.karabas-pro
|
ab84aa2c95c206b2384d99054eb23cbe6aeec56b
|
[
"MIT"
] | 7
|
2020-09-07T14:21:31.000Z
|
2022-01-24T17:18:56.000Z
|
renderPlainTextScreen:
call prepareScreen
ld b, PER_PAGE
.loop
push bc
ld a, PER_PAGE : sub b
ld b, a, e, a, a, (page_offset) : add b : ld b, a : call Render.findLine
ld a, h : or l : jr z, .exit
ld a, e
add CURSOR_OFFSET : ld d, a, e, 1 : call TextMode.gotoXY
call print70Text
pop bc
djnz .loop
ret
.exit
pop bc
ret
plainTextLoop:
call Console.getC
cp Console.KEY_DN : jp z, textDown
cp Console.KEY_UP : jp z, textUp
cp 'h' : jp z, History.home
cp 'H' : jp z, History.home
cp 'b' : jp z, History.back
cp 'B' : jp z, History.back
cp BACKSPACE : jp z, History.back
cp CR : jp z, navigate
cp ESC : jp z, exit
jr plainTextLoop
textDown:
ld a, (page_offset) : add PER_PAGE : ld (page_offset), a
call renderPlainTextScreen
jp plainTextLoop
textUp:
ld hl, page_offset
ld a, (hl) : and a : jr z, plainTextLoop
sub PER_PAGE : ld (hl), a
call renderPlainTextScreen
jp plainTextLoop
| 22.195652
| 76
| 0.608227
|
09e4368319e240c8c06d31f208aec839f1c48c32
| 2,901
|
asm
|
Assembly
|
shell/shell.asm
|
leonardoruilova/xos
|
1e72d2294a7373dbbd601e6796a8a95d0d7056a8
|
[
"MIT"
] | 1
|
2021-03-21T19:49:05.000Z
|
2021-03-21T19:49:05.000Z
|
shell/shell.asm
|
leonardoruilova/xos
|
1e72d2294a7373dbbd601e6796a8a95d0d7056a8
|
[
"MIT"
] | null | null | null |
shell/shell.asm
|
leonardoruilova/xos
|
1e72d2294a7373dbbd601e6796a8a95d0d7056a8
|
[
"MIT"
] | null | null | null |
;; xOS Shell
;; Copyright (c) 2017 by Omar Mohammad.
use32
org 0x8000000
application_header:
.id db "XOS1" ; tell the kernel we are a valid application
.type dd 0 ; 32-bit application
.entry dd main ; entry point
.reserved0 dq 0
.reserved1 dq 0
title db "xOS Shell",0
include "libxwidget/src/libxwidget.asm" ; widget library ;)
include "shell/string.asm"
include "shell/menu.asm"
include "shell/shutdown.asm"
; For File Access
FILE_WRITE = 0x00000002
FILE_READ = 0x00000004
SEEK_SET = 0x00
SEEK_CUR = 0x01
SEEK_END = 0x02
; main:
; Shell entry point
main:
call xwidget_init
mov ebp, XOS_GET_SCREEN_INFO
int 0x60
mov [width], ax
mov [height], bx
; the taskbar really is a frameless unmoveable window ;)
mov ax, 0
mov bx, [height]
sub bx, 32
mov si, [width]
mov di, 32
;mov dx, WM_NO_FRAME
mov dx, WM_TRANSPARENT
mov ecx, title
call xwidget_create_window
mov [window_handle], eax
;mov eax, [window_handle]
;mov ebx, 0x222222
;call xwidget_window_set_color
mov eax, [window_handle]
mov cx, 0
mov dx, 0
mov bx, 48
mov di, 32
mov ebp, menu_button_color
mov esi, menu_text
call xwidget_create_gbutton
mov [menu_handle], eax
call update_time
mov eax, [window_handle]
mov cx, [width]
sub cx, (8*8)
sub cx, 12
mov dx, 8
mov esi, time_text
mov ebx, 0xFFFFFF
call xwidget_create_label
mov [time_handle], eax
.hang:
call xwidget_wait_event
cmp eax, XWIDGET_BUTTON
je .button
jmp .hang
.button:
cmp ebx, [menu_handle]
je open_menu
jmp .hang
; config_error:
; Error handler when the configuration file cannot be read
config_error:
mov ax, [width]
mov bx, [height]
shr ax, 1
shr bx, 1
sub ax, 320/2
sub bx, 192/2
mov si, 320
mov di, 256
mov dx, 0
mov ecx, title
call xwidget_create_window
mov cx, 16
mov dx, 16
mov ebx, 0x000000
mov esi, config_error_msg
call xwidget_create_label
.hang:
mov ebp, XOS_YIELD
int 0x60
jmp .hang
; xwidget_yield_handler:
; This is called by xwidget every time it is idle
xwidget_yield_handler:
call update_time
ret
; screen resolution
align 2
width dw 0
height dw 0
align 4
window_handle dd 0
menu_handle dd 0
time_handle dd 0
config_handle dd 0
config_buffer dd 0
config_end dd 0
config_size dd 0
shutdown_handle dd 0
shutdown_button_handle dd 0
restart_button_handle dd 0
align 4
menu_button_color:
.foreground dd 0xFFFFFF
.background dd 0x008000
shutdown_color:
.foreground dd 0xFFFFFF
.background dd 0xC00000
restart_color:
.foreground dd 0xFFFFFF
.background dd 0x008000
menu_text db "MENU",0
time_text db "00:00 AM",0
config_file db "shell.cfg",0
config_error_msg db "Unable to open file 'shell.cfg' for", 10
db "reading.",10,0
shutdown_title db "Shutdown",0
shutdown_caption db "What do you want to do with the PC?",0
shutdown_text db "Shutdown",0
restart_text db "Restart",0
| 17.267857
| 63
| 0.719407
|
46c5c6d8ed89c462e95aae79210e0f436f55f295
| 2,392
|
asm
|
Assembly
|
0x3f_TODO.asm
|
SpeedStepper/XchgRaxRax
|
24c1a47f8da2fab1e4c3ad62136b307c7fa5a6dc
|
[
"MIT"
] | 53
|
2017-09-06T02:37:25.000Z
|
2022-03-10T05:17:06.000Z
|
0x3f_TODO.asm
|
uf0o/xorpd-solutions
|
3a84172f615533ffbd40124594db6d36baa6260a
|
[
"MIT"
] | 2
|
2019-04-03T12:51:42.000Z
|
2020-12-10T13:58:14.000Z
|
0x3f_TODO.asm
|
uf0o/xorpd-solutions
|
3a84172f615533ffbd40124594db6d36baa6260a
|
[
"MIT"
] | 21
|
2017-09-06T02:37:33.000Z
|
2022-03-10T05:17:09.000Z
|
;
; $Id: 0x3f_TODO.asm,v 1.1.1.1 2016/03/27 08:40:13 raptor Exp $
;
; 0x3f explanation - from xchg rax,rax by xorpd@xorpd.net
; Copyright (c) 2016 Marco Ivaldi <raptor@0xdeadbeef.info>
;
; TODO: THIS EXPLANATION IS INCOMPLETE
;
; Whoa, this is the last snippet of the book! Thanks to
; xorpd@xorpd.net for the amazing ride!
;
; This snippet calculates the following based on the
; initial value of rax:
;
; rsi = (rax & (rax - 1)) % 3
; rdi = ((rax | (rax - 1)) % 3) + 1
; rax = position of the least-significant bit set in rax
;
; Unfortunately, so far I haven't figured out its purpose. I
; suspect the outcome of the bsf operation is important here.
; It is always 0 for odd numbers, obviously, and for even
; numbers it goes in a series like: 1, 2, 1, 3, 1, 2, 1, 4,
; 1, 2, 1, 3, 1, 2, 1, 5... See also:
;
; https://oeis.org/A001511 [The ruler function: 2^a(n) divides 2n]
; https://oeis.org/A007814 [Exponent of highest power of 2 dividing n]
;
; I've written the following C code to help with the analysis:
;
; #include <stdio.h>
; main()
; {
; int rsi, rdi, i;
; for (i = 1; i <= 100; i++) {
; rsi = (i & (i - 1)) % 3;
; rdi = ((i | (i - 1)) % 3) + 1;
; printf("rax:\t%d\t\trsi,rdi:\t%d,%d\n", i, rsi, rdi);
; }
; }
;
; Example run:
; $ ./0x3f_helper
; rax: 1 rsi,rdi: 0,2
; rax: 2 rsi,rdi: 0,1
; rax: 3 rsi,rdi: 2,1
; rax: 4 rsi,rdi: 0,2
; rax: 5 rsi,rdi: 1,3
; rax: 6 rsi,rdi: 1,2
; rax: 7 rsi,rdi: 0,2
; rax: 8 rsi,rdi: 0,1
; rax: 9 rsi,rdi: 2,1
; rax: 10 rsi,rdi: 2,3
; [...]
; rax: 96 rsi,rdi: 1,2
; rax: 97 rsi,rdi: 0,2
; rax: 98 rsi,rdi: 0,1
; rax: 99 rsi,rdi: 2,1
; rax: 100 rsi,rdi: 0,2
;
; This analysis was facilitated by the assembly REPL rappel
; by yrp604@yahoo.com:
;
; https://github.com/yrp604/rappel/
;
BITS 64
SECTION .text
global main
main:
mov rbx,3 ;
mov r8,rax ; save the original input rax in r8
mov rcx,rax ;
dec rcx ;
and rax,rcx ;
xor edx,edx ;
div rbx ;
;
mov rsi,rdx ; rsi = (rax & (rax - 1)) % 3
mov rax,r8 ;
or rax,rcx ;
xor edx,edx ;
div rbx ;
;
inc rdx ;
cmp rdx,rbx ; this is a clever hack, although useless here
sbb rdi,rdi ; if (rdx > 3) rdi = 0 // impossible
and rdi,rdx ; else rdi = ((rax | (rax - 1)) % 3) + 1
bsf rax,r8 ; load rax with the position of the LSB (from
; position 0) that is set in the original input
; rax, regardless of the other operations
| 24.916667
| 70
| 0.60786
|
f8f1c5405d90e37b2407d738fb0e907baa4201c0
| 151
|
asm
|
Assembly
|
libsrc/fcntl/dummy/open_z88.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/fcntl/dummy/open_z88.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/fcntl/dummy/open_z88.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; Dummy function to keep rest of libs happy
;
; $Id: open_z88.asm,v 1.3 2015/01/19 01:32:43 pauloscustodio Exp $
;
PUBLIC open_z88
.open_z88
ret
| 13.727273
| 66
| 0.701987
|
ab3cc9c07e46a1962148d0f6f3b938eaa8c73d13
| 379
|
asm
|
Assembly
|
programs/oeis/030/A030439.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/030/A030439.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/030/A030439.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A030439: a(n+1) = smallest number not containing any digits of a(n), working in base 3.
; 0,1,2,3,8,9,26,27,80,81,242,243,728,729,2186,2187,6560,6561,19682,19683,59048,59049,177146,177147,531440,531441,1594322,1594323,4782968,4782969,14348906,14348907,43046720,43046721,129140162,129140163,387420488,387420489
mov $1,$0
mod $0,2
div $1,2
mov $2,3
pow $2,$1
add $0,$2
sub $0,1
| 34.454545
| 221
| 0.741425
|
bf1960f88c874ee6767ec752151257c48c00f2ed
| 740
|
asm
|
Assembly
|
oeis/319/A319536.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/319/A319536.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/319/A319536.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A319536: Number of signed permutations of length n where numbers occur in consecutive order.
; Submitted by Christian Krause
; 0,2,14,122,1278,15802,225886,3670074,66843902,1349399162,29912161758,722399486074,18881553923326,531063524702778,15993786127174238,513533806880120762,17512128958240460286,632099987274779910394,24076353238897830158302,965090063564336174611962,40611148162022192128337918,1789985138821779365432288954,82469290412899573104872955486,3964244797011479290013359061818,198475307281419754425722984221438,10333343215314425146540236673780602,558631895461008853733304855097443806
mov $1,$0
add $1,1
lpb $1
sub $1,1
mov $0,$1
sub $2,2
mov $4,$2
mul $4,$3
add $0,$4
gcd $4,$3
mov $3,$0
lpe
mov $0,$4
mul $0,2
| 38.947368
| 468
| 0.824324
|
41bbd8f5adcc104a8852f70b693c660c0e4960d1
| 60,497
|
asm
|
Assembly
|
Appl/Games/CWord/cwordVictory.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Appl/Games/CWord/cwordVictory.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Appl/Games/CWord/cwordVictory.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: cwordVictory.asm
AUTHOR: Steve Scholl, Sep 26, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Steve 9/26/94 Initial revision
DESCRIPTION:
$Id: cwordVictory.asm,v 1.1 97/04/04 15:14:22 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; State for the random-number generator. This beast comes from the
; BSD random-number generator, which is supposed to be random in all 31
; bits it produces...
;
RAND_DEG equ 31
RAND_SEP equ 3
RAND_MULT equ 1103515245
RAND_ADD equ 12345
idata segment
frontPtr nptr.dword randTbl[(RAND_SEP+1)*dword]
rearPtr nptr.dword randTbl[1*dword]
endPtr nptr.dword randTbl[(RAND_DEG+1)*dword]
randTbl dword 3, ; generator type
0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb,
0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86,
0xda672e2a, 0x1588ca88, 0xe369735d, 0x904f35f7,
0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b,
0xf5ad9d0e, 0x8999220b, 0x27fb47b9
idata ends
CwordVictoryCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameSeedRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Seed the random number generator, using 128 bytes of state
CALLED BY:
PASS: dx:ax = initial seed
RETURN: nothing
DESTROYED: dx, ax
PSEUDO CODE/STRATEGY:
state[0] = seed;
for (i = 1; i < RAND_DEG; i++) {
state[i] = 1103515245*state[i-1] + 12345;
}
frontPtr = &state[RAND_SEP];
rearPtr = &state[0];
for (i = 0; i < 10*RAND_DEG; i++) {
GameRandom();
}
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameSeedRandom proc far
uses si, di, bx, cx, ds
.enter
mov bx, handle dgroup ;Do this so there is no segment
call MemDerefDS ; relocs to dgroup (so the
; dgroup resource is
; discardable on XIP platforms)
mov di, offset (randTbl[1*dword])
mov cx, RAND_DEG-1
seedLoop:
mov ({dword}ds:[di]).low, ax
mov ({dword}ds:[di]).high, dx
add di, size dword
;
; Perform a 32-bit unsigned multiply by RAND_MULT, leaving the result
; in si:bx:
;
; h mh ml l
;ax*low(RAND_MULT) x x
;dx*low(RAND_MULT) x x
;ax*high(RAND_MULT) x x
;dx*high(RAND_MULT) x x
;
; The highest two words are discarded, which means we don't even have
; to multiply dx by high(RAND_MULT).
;
push ax
push dx
mov dx, RAND_MULT AND 0xffff
mul dx
xchg bx, ax ; bx <- low(result)
mov si, dx ; si <- partial high(result)
pop ax ; ax <- original dx
mov dx, RAND_MULT AND 0xffff
mul dx
add si, ax ; high(result) += low(dx*low(RAND_MULT))
pop ax ; ax <- original ax
mov dx, RAND_MULT / 65536
mul dx
add si, ax ; high(result)+=low(high(RAND_MULT)*ax)
;
; Place result in the proper registers and add in the additive factor.
;
mov dx, si
mov ax, bx
add ax, RAND_ADD
adc dx, 0
loop seedLoop
;
; Store the final result.
;
mov ({dword}ds:[di]).low, ax
mov ({dword}ds:[di]).high, dx
;
; Initialize the pointers.
;
mov ds:[frontPtr], offset (randTbl[(RAND_SEP+1)*dword])
mov ds:[rearPtr], offset (randTbl[1*dword])
;
; Now randomize the state according to the degree of the
; polynomial we're using.
;
mov cx, 10*RAND_DEG
initLoop:
mov dx, 0xffff
call GameRandom
loop initLoop
.leave
ret
GameSeedRandom endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GameRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return a random number
CALLED BY: GLOBAL
PASS: dx = max for returned value
RETURN: dx = number between 0 and max-1
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
We assume we're using a type 3 random number generator here,
so the code looks like this:
*frontPtr += *rearPtr;
i = (*frontPtr >> 1)&0x7fffffff;
if (++frontPtr >= endPtr) {
frontPtr = state;
rearPtr += 1;
} else if (++rearPtr >= endPtr) {
rearPtr = state;
}
return(i % DL);
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 3/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GameRandom proc far
uses ds, cx, si, di, ax, bx
.enter
mov bx, handle dgroup ;Do this so there is no segment
call MemDerefDS ; relocs to dgroup (so the
; dgroup resource is
; discardable on XIP platforms)
mov si, ds:[frontPtr]
mov di, ds:[rearPtr]
mov ax, ({dword}ds:[di]).low
mov cx, ({dword}ds:[di]).high
add ax, ({dword}ds:[si]).low
adc cx, ({dword}ds:[si]).high
mov ({dword}ds:[si]).low, ax
mov ({dword}ds:[si]).high, cx
shr cx
rcr ax
add si, size dword
add di, size dword
cmp si, ds:[endPtr]
jb adjustRear
mov si, offset (randTbl[1*dword])
jmp storePtrs
adjustRear:
cmp di, ds:[endPtr]
jb storePtrs
mov di, offset (randTbl[1*dword])
storePtrs:
mov ds:[frontPtr], si
mov ds:[rearPtr], di
mov cx, dx ; ignore high word, to avoid painful
; divide. Since all the bits are
; random, we just make do with the
; low sixteen, thereby avoiding
; quotient-too-large faults
clr dx
div cx
.leave
ret
GameRandom endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardPlaySound
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play a sound.
CALLED BY: BoardVerify, BoardVerifyWord
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Call WavPlayInitSound for the sound
REVISION HISTORY:
Name Date Description
---- ---- -----------
DH 3/15/2000 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; These constants match those used in the [sound] section.
SOUND_CWORD_CHECK_OK equ 0
BoardPlaySound proc near
uses ax, bx, cx, dx, di, es
soundToken local GeodeToken
.enter
; Retrieve our GeodeToken.
segmov es, ss, ax
lea di, soundToken
mov bx, handle 0 ; bx <- app geode token
mov ax, GGIT_TOKEN_ID
call GeodeGetInfo
; Play the sound.
mov bx, SOUND_CWORD_CHECK_OK
mov cx, es
mov dx, di
call WavPlayInitSound
.leave
ret
BoardPlaySound endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardVerify
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verify all the user letters in non-empty cells and
give feedback of the results to the user.
Also reset HWR macro if in PEN mode.
CALLED BY: MSG_CWORD_BOARD_VERIFY
PASS: *ds:si = CwordBoardClass object
ds:di = CwordBoardClass instance data
ds:bx = CwordBoardClass object (same as *ds:si)
es = segment of CwordBoardClass
ax = message #
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
JL 7/25/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardVerify method dynamic CwordBoardClass,
MSG_CWORD_BOARD_VERIFY
uses ax, cx, dx, bp
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
cmp ds:[di].CBI_system, ST_PEN
jne dontReset
call BoardGestureResetMacroProcFar
dontReset:
call BoardPlaySound
mov dx,ds:[di].CBI_engine
tst dx
jz done
call EngineCheckForAllCellsCorrect
jnc success
call EngineVerifyAllCells
call BoardAnimateVerify
call EngineCheckForAllCellsFilled
jnc allFilled
enableDisable:
call CwordEnableDisableClearXSquares
done:
.leave
ret
allFilled:
; If no wrong cells on screen, then do something about it
;
call BoardDetermineIfWrongCellOnScreen
jc enableDisable
call BoardGetWrongCellOnScreen
jmp enableDisable
success:
call BoardFoolinAround
mov bx,handle CompletedInteraction
mov si,offset CompletedInteraction
mov ax,MSG_GEN_INTERACTION_INITIATE
mov di,mask MF_FIXUP_DS
call ObjMessage
jmp done
BoardVerify endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardFoolinAround
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do cool stuff to celebrate the completion of the puzzle
CALLED BY: BoardVerify
PASS: *ds:si - Board
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardFoolinAround proc near
uses ax,cx,dx,bp,es,bx
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
call TimerGetCount
call GameSeedRandom
mov bx,handle CwordStrings
call MemLock
mov es,ax
mov dx,length coolTextOffsets
call GameRandom
shl dx ;word size table
add dx,offset coolTextOffsets
mov bx,dx ;offset into table
mov bx,cs:[bx] ;chunk of text from table
mov bx,es:[bx] ;offset of text from chunk
call BoardFadeInCoolString
mov bx,handle CwordStrings
call MemUnlock
call BoardDoShootingStars
call BoardFadeOutScreen
mov ax,MSG_VIS_INVALIDATE
call ObjCallInstanceNoLock
.leave
ret
coolTextOffsets word \
offset CoolText,
offset FinisText,
offset RadText,
offset DoneText,
offset YesText
BoardFoolinAround endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardEnumerateCells
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call call back routine for each cell. Process left to right
on first row then right to left and so on.
CALLED BY: UTILITY
PASS: *ds:si - Board
di - offset to near routine in segment cs
cx,bp - data to pass to call back
PASSED to call back
*ds:si - Board
dx - engine token
bx - cell token
cx,bp - data passed to BoardEnumerateCells
RETURN:
carry clear - enumerated all cells
ax - destroyed
carry set - enumeration stopped
ax - cell number that stopped
DESTROYED:
see RETURN
PSEUDO CODE/STRATEGY:
call back routine returning carry stops enumeration
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardEnumerateCells proc near
class CwordBoardClass
uses dx,bx
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
GetInstanceDataPtrDSBX CwordBoard_offset
mov dx,ds:[bx].CBI_engine
clr bx ;initial
makeCall:
call di
mov ax,bx ;cell token
jc done
leftToRight:
call EngineGetNextCellTokenInRowFar
cmp bx,ENGINE_GRID_EDGE
je rightToLeftStart
call di
mov ax,bx ;cell token
jc done
jmp leftToRight
rightToLeftStart:
call EngineGetNextCellTokenInColumnFar
cmp bx,ENGINE_GRID_EDGE
je doneNoTermination
call di
mov ax,bx ;cell token
jc done
rightToLeft:
call EngineGetPrevCellTokenInRowFar
cmp bx,ENGINE_GRID_EDGE
je leftToRightStart
call di
mov ax,bx ;cell token
jc done
jmp rightToLeft
done:
.leave
ret
doneNoTermination:
clc
jmp done
leftToRightStart:
call EngineGetNextCellTokenInColumnFar
cmp bx,ENGINE_GRID_EDGE
je doneNoTermination
jmp makeCall
BoardEnumerateCells endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardEnumerateCellsInWord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call call back routine for each cell in the word
CALLED BY: UTILITY
PASS: *ds:si - Board
bx - Direction
ax - CellToken
di - offset to near routine in segment cs
cx,bp - data to pass to call back
PASSED to call back
*ds:si - Board
dx - engine token
bx - cell token
cx,bp - data passed to BoardEnumerateCellsInWord
RETURN:
carry clear - enumerated all cells
ax - destroyed
carry set - enumeration stopped
ax - cell number that stopped
DESTROYED:
see RETURN
PSEUDO CODE/STRATEGY:
call back routine returning carry stops enumeration
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardEnumerateCellsInWord proc near
class CwordBoardClass
uses cx,dx,bx
passedBP local word push bp
passedCX local word push cx
lastToken local word
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
mov cx,bx ;direction
GetInstanceDataPtrDSBX CwordBoard_offset
mov dx,ds:[bx].CBI_engine
call BoardMapWordToFirstNLastCellsFar
mov lastToken,bx
mov bx,ax ;first cell
makeCall:
push bp,cx ;locals, direction
mov cx,passedCX
mov bp,passedBP
call di
mov ax,bx ;current cell
pop bp,cx ;locals, direction
jc doneWithTermination
cmp ax,lastToken
je doneNoTermination
cmp cx, ACROSS
je nextRow
call EngineGetNextCellTokenInColumnFar
jmp makeCall
doneNoTermination:
clc
done:
.leave
ret
doneWithTermination:
stc
jmp done
nextRow:
call EngineGetNextCellTokenInRowFar
mov ax,bx ;next cell
jmp makeCall
BoardEnumerateCellsInWord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardGetWrongCellOnScreen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find a wrong cell and make sure it is visible and select it.
CALLED BY: BoardVerify
PASS:
*ds:si - Board
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardGetWrongCellOnScreen proc near
class CwordBoardClass
uses di,dx
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
GetInstanceDataPtrDSDI CwordBoard_offset
mov dx,ds:[di].CBI_engine
call EngineFindFirstWrongCell
jnc done
call BoardMoveSelectedSquare
done:
.leave
ret
BoardGetWrongCellOnScreen endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardGetEmptyCellOnScreen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See message defintion
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object
es - segment of CwordBoardClass
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardGetEmptyCellOnScreen method dynamic CwordBoardClass,
MSG_CWORD_BOARD_FIND_EMPTY_CELL
uses ax,dx
.enter
mov dx,ds:[di].CBI_engine
tst dx
jz done
call EngineFindFirstEmptyCell
jnc done
call BoardMoveSelectedSquare
done:
.leave
ret
BoardGetEmptyCellOnScreen endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardClearPuzzle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See message defintion
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object
es - segment of CwordBoardClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardClearPuzzle method dynamic CwordBoardClass,
MSG_CWORD_BOARD_CLEAR_PUZZLE
uses ax,dx
.enter
cmp ds:[di].CBI_system, ST_PEN
jne dontReset
call BoardGestureResetMacroProcFar
dontReset:
mov dx,ds:[di].CBI_engine
tst dx
jz done
call EngineClearAllCells
mov ax,MSG_VIS_INVALIDATE
call ObjCallInstanceNoLock
call CwordEnableDisableClearXSquares
done:
.leave
ret
BoardClearPuzzle endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardClearXCells
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See message defintion
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object
es - segment of CwordBoardClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardClearXCells method dynamic CwordBoardClass,
MSG_CWORD_BOARD_CLEAR_X_CELLS
uses ax,dx
.enter
cmp ds:[di].CBI_system, ST_PEN
jne dontReset
call BoardGestureResetMacroProcFar
dontReset:
mov dx,ds:[di].CBI_engine
tst dx
jz done
call EngineClearWrongCells
mov ax,MSG_VIS_INVALIDATE
call ObjCallInstanceNoLock
call CwordEnableDisableClearXSquares
done:
.leave
ret
BoardClearXCells endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardDetermineIfWrongCellOnScreen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enumerate through the cells and determine if any of the
wrong cells are currently visible.
CALLED BY:
PASS:
*ds:si - Board
RETURN:
stc - yes
clc - no
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardDetermineIfWrongCellOnScreen proc far
class CwordBoardClass
uses ax,di
visibleRect local Rectangle
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
GetInstanceDataPtrDSDI CwordBoard_offset
mov ax,ds:[di].CBI_cellWidth
shr ax,1
; Make sure a reasonable portion of the wrong cell
; is visible
;
call BoardGetVisibleRect
add visibleRect.R_left,ax
add visibleRect.R_top,ax
sub visibleRect.R_right,ax
sub visibleRect.R_bottom,ax
mov di,offset BoardIsWrongCellOnScreenCallback
call BoardEnumerateCells
.leave
ret
BoardDetermineIfWrongCellOnScreen endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardIsWrongCellOnScreenCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Determine if cell is wrong and on screen
CALLED BY: BoardEnumerateCells
PASS:
*ds:si - Board
dx - engine token
bx - cell token
cx,bp - data passed to BoardEnumerateCells
RETURN:
clc - if cell is not wrong or not on screen
stc - if cell is wrong and on screen
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/20/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardIsWrongCellOnScreenCallback proc near
uses ax,bx,cx,dx
visibleRect local Rectangle
.enter inherit
;;; Verify argument(s)
Assert ObjectBoard dssi
Assert CellTokenType bx
Assert EngineTokenType dx
;;;;;;;;
mov ax,bx ;cell token
call EngineGetCellFlagsFar
test cl,mask CF_WRONG
jz dontStop
mov cx,ax ;cell token
call BoardGetCellBounds
cmp ax,visibleRect.R_right
jg dontStop
cmp cx,visibleRect.R_left
jl dontStop
cmp bx,visibleRect.R_bottom
jg dontStop
cmp dx,visibleRect.R_top
jge stopIt
dontStop:
clc
done:
.leave
ret
stopIt:
stc
jmp done
BoardIsWrongCellOnScreenCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardAnimateVerify
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Highlight each cell and the verify it, drawing
the slashed if it is wrong.
CALLED BY:
PASS: *ds:si - CwordBoardClass object
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/25/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardAnimateVerify proc far
class CwordBoardClass
uses ax,cx,bx,dx,di
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
call BoardGetGStateDI
BoardEraseHiLites
GetInstanceDataPtrDSBX CwordBoard_offset
mov dx,ds:[bx].CBI_engine
call EngineFindFirstWrongCell
jc atLeastOneWrongCell
call BoardFlashOK
enumerate:
mov cx,di ;gstate
mov di,offset BoardRedrawWrongCellCallback
call BoardEnumerateCells
mov di,cx ;gstate
BoardDrawHiLites
call GrDestroyState
.leave
ret
atLeastOneWrongCell:
call GrGetWinBounds
call BoardFlashRect
jmp enumerate
BoardAnimateVerify endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardVerifyWord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See message defintion
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object
es - segment of CwordBoardClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardVerifyWord method dynamic CwordBoardClass,
MSG_CWORD_BOARD_VERIFY_WORD
uses ax,cx,dx,bp
.enter
cmp ds:[di].CBI_system, ST_PEN
jne dontReset
call BoardGestureResetMacroProcFar
dontReset:
call BoardPlaySound
call BoardGetGStateDI
BoardEraseHiLites
GetInstanceDataPtrDSBX CwordBoard_offset
mov ax,ds:[bx].CBI_cell
mov cx,ds:[bx].CBI_direction
push ax,cx ;cell, direction
call BoardMapWordToFirstNLastCellsFar
call BoardGetBoundsForFirstNLastCellsFar
call BoardFlashRect
pop ax,bx ;cell, direction
mov cx,di ;gstate
mov di,offset BoardRedrawWrongCellCallback
call BoardEnumerateCellsInWord
mov di,cx ;gstate
BoardDrawHiLites
call GrDestroyState
call CwordEnableDisableClearXSquares
.leave
ret
BoardVerifyWord endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardFlashRect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Tempoarily invert a rectangle
CALLED BY: BoardAnimateVerify
BoardVerifyWord
PASS: di - Gstate Handle
ax,bx,cx,dx - rectangle
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardFlashRect proc near
uses ax
.enter
push ax
mov al,MM_INVERT
call GrSetMixMode
pop ax
call GrFillRect
push ax
mov ax,15
call TimerSleep
pop ax
call GrFillRect
mov al,MM_COPY
call GrSetMixMode
.leave
ret
BoardFlashRect endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardRedrawWrongCellCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: If the letter is wrong then draw slashed in it.
CALLED BY: BoardEnumerateCells
PASS:
*ds:si - CwordBoardClass object
dx - engine token
bx - cell token
cx - gstate
RETURN:
ax - passed cell token
DESTROYED:
clc - to keep enumerating
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/25/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardRedrawWrongCellCallback proc near
uses ax,cx,dx,di
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
Assert gstate cx
Assert CellTokenType bx
Assert EngineTokenType dx
;;;;;;;;
mov di,cx ;gstate
mov ax,bx ;cell token
call EngineVerifyCell
jc itsWrong
done:
clc
.leave
ret
itsWrong:
call BoardRedrawCellFar
jmp done
BoardRedrawWrongCellCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardFadeInCoolString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Slowly fade out board and fade in the string
CALLED BY:
PASS:
*ds:si - Board
es:bx - null terminated cool string
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CoolStringStruc struc
CSS_stringOffset word
CSS_textPos Point
CSS_textSize Point ;width, height
CSS_scaleX WWFixed
CSS_scaleY WWFixed
CoolStringStruc ends
BoardFadeInCoolString proc far
class CwordBoardClass
uses ax,bx,cx,dx,di,si,bp,ds
coolLocals local CoolStringStruc
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
Assert nullTerminatedAscii esbx
;;;;;;;;
mov coolLocals.CSS_stringOffset, bx
call BoardCreateGStateForCoolString
GetInstanceDataPtrDSBX CwordBoard_offset
cmp ds:[bx].CBI_drawOptions, mask DO_COLOR
jz 10$
mov ax, C_BLUE or (CF_INDEX shl 8)
call GrSetTextColor
10$:
call BoardCalcCoolStringBounds
call BoardShiftCoolStringBounds
call BoardCalcCoolScaleFactor
call BoardTranslateScaleCoolString
mov si,offset FadeMask1
again:
push si ;fade offset
mov al, SDM_CUSTOM or mask SDM_INVERSE
segmov ds,cs ;segment of fades
call GrSetAreaMask
call GrSetTextMask
; Fade out board. Making sure that it is slightly larger than
; window
;
mov ax,-1
mov bx,-1
mov cx,coolLocals.CSS_textSize.P_x
inc cx
mov dx,coolLocals.CSS_textSize.P_y
inc dx
call GrFillRect
; Fade in cool
;
clr ax,bx ;position
clr cx ;null termed
segmov ds,es ;string segment
mov si,coolLocals.CSS_stringOffset
call GrDrawText
pop si
add si, (FadeMask16-FadeMask15)
cmp si, offset FadeMask16
jbe again
call GrDestroyState
.leave
ret
BoardFadeInCoolString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardFlashOK
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Flash an OK in the puzzle area
CALLED BY: BoardAnimateVerify
PASS:
*ds:si - Board
di - gstate
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/28/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardFlashOK proc near
uses ax,bx,cx,di,si,ds,es
coolLocals local CoolStringStruc
ForceRef coolLocals
.enter
Assert ObjectBoard dssi
segmov es,cs
mov bx,offset okText
mov coolLocals.CSS_stringOffset,bx
call BoardCreateGStateForCoolString
mov al,MM_INVERT
call GrSetMixMode
call BoardCalcCoolStringBounds
call BoardShiftCoolStringBounds
call BoardCalcCoolScaleFactor
call BoardTranslateScaleCoolString
call GrGetWinBounds
call GrFillRect
clr ax,bx ;position
clr cx ;null termed
segmov ds,cs
mov si,offset okText
call GrDrawText
mov ax,15
call TimerSleep
clr ax ;x pos
call GrDrawText
call GrGetWinBounds
call GrFillRect
call GrDestroyState
.leave
ret
BoardFlashOK endp
okText char "OK",0
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardFadeOutScreen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Slowly fade out screen
CALLED BY:
PASS:
*ds:si - Board
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardFadeOutScreen proc far
uses ax,bx,cx,dx,di,si,bp,ds
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
call BoardCreateGStateForCoolString
mov si,offset FadeMask1
again:
mov al, SDM_CUSTOM or mask SDM_INVERSE
segmov ds,cs ;segment of fades
call GrSetAreaMask
call GrGetWinBounds
call GrFillRect
add si, (FadeMask16-FadeMask15)
cmp si, offset FadeMask16
jbe again
call GrDestroyState
.leave
ret
BoardFadeOutScreen endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardTranslateScaleCoolString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Apply translation and scale in stack frame to gstate
CALLED BY: BoardFadeInCoolString
PASS:
di - gstate
bp - inherited stack frame
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/28/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardTranslateScaleCoolString proc near
uses dx,cx,bx,ax
.enter inherit BoardFadeInCoolString
Assert gstate di
mov dx,coolLocals.CSS_textPos.P_x
mov bx,coolLocals.CSS_textPos.P_y
clr ax,cx
call GrApplyTranslation
movwwf dxcx,coolLocals.CSS_scaleX
movwwf bxax,coolLocals.CSS_scaleY
call GrApplyScale
.leave
ret
BoardTranslateScaleCoolString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardCalcCoolStringBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate the bounds of the text string
CALLED BY: BoardFadeInCoolString
PASS:
di - gstate
bp - inherited stack frame
coolLocals.CSS_stringOffset
es - string segment
RETURN:
textPos and textSize in stack frame
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardCalcCoolStringBounds proc near
uses ax,bx,cx,dx,ds,si
.enter inherit BoardFadeInCoolString
;;; Verify argument(s)
Assert gstate di
;;;;;;;;
segmov ds,es
mov si,coolLocals.CSS_stringOffset
Assert nullTerminatedAscii dssi
clr ax,bx ;position
call GrGetTextBounds
mov coolLocals.CSS_textPos.P_x,ax
mov coolLocals.CSS_textPos.P_y,bx
sub cx,ax
mov coolLocals.CSS_textSize.P_x,cx
sub dx,bx
mov coolLocals.CSS_textSize.P_y,dx
.leave
ret
BoardCalcCoolStringBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardShiftCoolStringBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Shift textPos so that text will be drawn at upper left
of window
CALLED BY: BoardFadeInCoolString
PASS: di - Gstate
bp - inherited stack frame
textPos
RETURN:
textPos changed
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardShiftCoolStringBounds proc near
uses ax,bx,cx,dx
.enter inherit BoardFadeInCoolString
;;; Verify argument(s)
Assert gstate di
;;;;;;;;
call GrGetWinBounds
sub ax,coolLocals.CSS_textPos.P_x
mov coolLocals.CSS_textPos.P_x,ax
sub bx,coolLocals.CSS_textPos.P_y
mov coolLocals.CSS_textPos.P_y,bx
.leave
ret
BoardShiftCoolStringBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardCalcCoolScaleFactor
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calc scale factor from text size to window size
CALLED BY: BoardFadeInCoolString
PASS: di - Gstate
bp - inherited stack frame
textSize
RETURN:
scaleX, scaleY
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardCalcCoolScaleFactor proc near
uses ax,bx,cx,dx
.enter inherit BoardFadeInCoolString
;;; Verify argument(s)
Assert gstate di
;;;;;;;;
call GrGetWinBounds
sub cx,ax ;window width
mov dx,cx
mov bx,coolLocals.CSS_textSize.P_x
clr ax,cx
call GrSDivWWFixed
movwwf coolLocals.CSS_scaleX,dxcx
call GrGetWinBounds
sub dx,bx ;window height
mov bx,coolLocals.CSS_textSize.P_y
clr ax,cx
call GrSDivWWFixed
movwwf coolLocals.CSS_scaleY,dxcx
.leave
ret
BoardCalcCoolScaleFactor endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardCreateGStateForCoolString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a gstate for drawing the COOL string into
CALLED BY: BoardFadeInCoolString
PASS:
*ds:si - Board
RETURN:
di - gstate
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardCreateGStateForCoolString proc near
uses ax,cx,dx,bp
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
mov ax,MSG_VIS_VUP_CREATE_GSTATE
call ObjCallInstanceNoLock
mov di,bp
mov al,mask TM_DRAW_ACCENT
clr ah
call GrSetTextMode
mov ax, C_WHITE or (CF_INDEX shl 8)
call GrSetAreaColor
mov cx,BOARD_TEXT_FONT
clr dx,ax
call GrSetFont
mov al,mask TS_BOLD
clr ah
call GrSetTextStyle
mov al,FW_MAXIMUM
call GrSetFontWeight
.leave
ret
BoardCreateGStateForCoolString endp
FadeMask1 label byte
db 11111101b
db 11111111b
db 11011111b
db 11111111b
db 10111111b
db 11111011b
db 11111111b
db 11111111b
db 11111111b
db 11101111b
db 11111111b
db 11111110b
db 01111111b
db 11111111b
db 11011111b
db 11111111b
db 11101111b
db 11111111b
db 11110111b
db 11111111b
db 11111111b
db 01111111b
db 11111111b
db 11111101b
db 11111111b
db 11111101b
db 11111111b
db 11110111b
db 11111111b
db 11111111b
db 10111111b
db 11101111b
db 11111110b
db 11111111b
db 11111101b
db 11111111b
db 11111111b
db 10111111b
db 11111111b
db 11110111b
db 11011111b
db 11111111b
db 01111111b
db 11111111b
db 11111111b
db 11011111b
db 11111111b
db 11111011b
db 11111111b
db 11111110b
db 11111111b
db 11101111b
db 11011111b
db 11111111b
db 11111101b
db 11111111b
db 11111111b
db 01111111b
db 11111111b
db 10111111b
db 11101111b
db 11111111b
db 11110111b
db 11111111b
db 11111011b
db 10111111b
db 11111111b
db 11111111b
db 11110111b
db 11111111b
db 11101111b
db 11111111b
db 11111111b
db 11110111b
db 11111111b
db 01111111b
db 11111111b
db 11111111b
db 11111011b
db 11011111b
db 10111111b
db 11111011b
db 11111111b
db 11111101b
db 11111101b
db 11111111b
db 11111110b
db 11111111b
db 11111111b
db 11111111b
db 10111111b
db 11111111b
db 11111111b
db 11111101b
db 11111111b
db 10111111b
db 11111111b
db 11011111b
db 11111111b
db 11111011b
db 11111110b
db 11111111b
db 01111111b
db 11111110b
db 01111111b
db 11111111b
db 11111110b
db 11111111b
db 11111111b
db 11101111b
db 11111111b
db 11111111b
FadeMask15 label byte
db 11110111b
db 11111111b
db 11101111b
db 11111111b
db 11111011b
db 11111110b
db 11111111b
db 11111111b
FadeMask16 label byte
db 11111111b
db 11111111b
db 11111011b
db 11011111b
db 11111111b
db 11110111b
db 11111111b
db 01111111b
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardDoShootingStars
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY:
PASS:
RETURN:
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardDoShootingStars proc far
uses ax,cx,dx,di,si
.enter
Assert ObjectBoard dssi
call BoardGetGStateDI
mov al,MM_INVERT
call GrSetMixMode
call ParticleArrayCreate
jc destroyState
; Always start with at least one star.
;
call ShootingStarCreate
; Choose random number of stars to eventually create
;
mov dx,MAX_STARS_CREATED
mov cx,MIN_STARS_CREATED
call BoardChooseRandom
mov bx,dx
dec bx
again:
call ParticleDraw
mov ax,3
call TimerSleep
call ParticleAdvance
call ParticleCleanup
tst bx ;stars left to create
jz checkForNoParticles
; Maybe create new star, but always continue because
; there are stars left to create.
;
mov ax,PERCENT_CHANCE_OF_NEW_STAR
call BoardPercentageChance
jnc again ;jmp if don't create star
call ShootingStarCreate
dec bx
jmp again
checkForNoParticles:
call ChunkArrayGetCount
tst cx
jnz again
mov ax,si
call LMemFree
destroyState:
call GrDestroyState
.leave
ret
BoardDoShootingStars endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardPercentageChance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generate percentage chance event
CALLED BY:
PASS:
ax - 0-100 percentage chance
RETURN:
carry clear - didn't happen
carry set - happened
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardPercentageChance proc near
uses dx
.enter
mov dx,100
call GameRandom
inc dx ;100-1 range
cmp ax,dx
jge itHappened
clc
done:
.leave
ret
itHappened:
stc
jmp done
BoardPercentageChance endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleArrayCreate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create chunk array for particles
CALLED BY: BoardDoShootingStars
PASS:
ds - segment of object block
RETURN:
clc - array created
si - chunk handle of chunk array
stc - array not created
si - destroyed
DESTROYED:
see RETURN
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleArrayCreate proc near
uses cx,dx
.enter
clr al
clr cx,si
mov bx,size Particle
call ChunkArrayCreate
.leave
ret
ParticleArrayCreate endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ShootingStarCreate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a shooting start chunk array element
CALLED BY:
PASS:
*ds:si - chunk array
di - gstate to window to draw shooting stars
RETURN:
clc - particle created
ax - element
stc - particle not created
ax - destroyed
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ShootingStarCreate proc near
uses bx,cx,dx
initData local ParticleInit
.enter
Assert ChunkArray dssi
Assert gstate di
mov dx,MAX_SPARK_PROB
mov cx,MIN_SPARK_PROB
call BoardChooseRandom
mov initData.PI_sparkProb,dl
; Choose gravity.
;
mov dx,MAX_STAR_VERT_GRAVITY_INT
mov cx,MIN_STAR_VERT_GRAVITY_INT
mov bx,MAX_STAR_VERT_GRAVITY_FRAC
mov ax,MIN_STAR_VERT_GRAVITY_FRAC
call ParticleChooseVelocity
movwwf initData.PI_gravity.PF_y,dxax
clrwwf initData.PI_gravity.PF_x
; Choose vertical velocity. Always negative so stars
; start out shooting upwards.
;
mov dx,MAX_STAR_VERT_VELOCITY_INT
mov cx,MIN_STAR_VERT_VELOCITY_INT
mov bx,MAX_STAR_VERT_VELOCITY_FRAC
mov ax,MIN_STAR_VERT_VELOCITY_FRAC
call ParticleChooseVelocity
negwwf dxax ;always start up
movwwf initData.PI_velocity.PF_y,dxax
; Choose horiz velocity
;
mov dx,MAX_STAR_HORIZ_VELOCITY_INT
mov cx,MIN_STAR_HORIZ_VELOCITY_INT
mov bx,MAX_STAR_HORIZ_VELOCITY_FRAC
mov ax,MIN_STAR_HORIZ_VELOCITY_FRAC
call ParticleChooseVelocity
movwwf initData.PI_velocity.PF_x,dxax
; Choose left or right side of window and switch velocity
; direction if starting from the right side
;
call GrGetWinBounds
mov dx,2
call GameRandom
tst dx
je gotSide ;using left
mov ax,cx
negwwf initData.PI_velocity.PF_x
negwwf initData.PI_gravity.PF_x
gotSide:
mov initData.PI_position.P_x,ax
; Choose vertical position in top 75% of screen
;
call GrGetWinBounds
sub dx,bx ;win height
mov ax,dx ;win height
shr ax ;50% win height
shr ax ;25% win height
sub dx,ax ;range = 75% win height
call GameRandom
add dx,bx ;down from top
mov initData.PI_position.P_y,dx
mov initData.PI_width,STAR_WIDTH
mov initData.PI_height,STAR_HEIGHT
call ParticleCreate
.leave
ret
ShootingStarCreate endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleChooseVelocity
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calc random velocity
CALLED BY: ShootingStartCreate
PASS:
dx - max int
cx - min int
bx - max frac
ax - min frac
RETURN:
dx:ax - WWFixed velocity
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleChooseVelocity proc near
.enter
push dx,cx ;max int,min int
movdw dxcx,bxax ;max frac, min frac
call BoardChooseRandom
mov ax,dx ;frac
pop dx,cx ;max int, min int
call BoardChooseRandom
.leave
ret
ParticleChooseVelocity endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoardChooseRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Choose random number in range
CALLED BY:
PASS:
dx - max
cx - min
RETURN:
dx
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoardChooseRandom proc near
.enter
EC< cmp dx,cx >
EC< ERROR_B 255 >
sub dx,cx ;sub min to get range
inc dx
call GameRandom
add dx,cx ;add min
.leave
ret
BoardChooseRandom endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleCreate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a new particle in the chunk array
CALLED BY: ShootingStarCreate
PASS:
*ds:si - chunk array
bp - inherited stack frame
RETURN:
clc - particle created
ax - element
stc - particle not created
ax - destroyed
DESTROYED:
see RETURN
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleCreate proc near
uses cx,dx,di
initData local ParticleInit
.enter inherit
call ChunkArrayAppend
jc done
clr dx
mov cx, initData.PI_position.P_x
movdw ds:[di].P_curPosition.PF_x,cxdx
mov cx, initData.PI_position.P_y
movdw ds:[di].P_curPosition.PF_y,cxdx
movdw cxdx, initData.PI_velocity.PF_x
movdw ds:[di].P_velocity.PF_x,cxdx
movdw cxdx, initData.PI_velocity.PF_y
movdw ds:[di].P_velocity.PF_y,cxdx
movdw cxdx, initData.PI_gravity.PF_x
movdw ds:[di].P_gravity.PF_x,cxdx
movdw cxdx, initData.PI_gravity.PF_y
movdw ds:[di].P_gravity.PF_y,cxdx
mov cl, initData.PI_sparkProb
mov ds:[di].P_sparkProb,cl
mov cl, initData.PI_width
mov ds:[di].P_width,cl
mov cl, initData.PI_height
mov ds:[di].P_height,cl
clr ds:[di].P_info
clc
done:
.leave
ret
ParticleCreate endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw all particles in the passed particle array
CALLED BY:
PASS:
*ds:si - particle chunk array
di - gstate
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleDraw proc near
uses bx,di,bp
.enter
Assert gstate di
Assert ChunkArray dssi
mov bp,di ;gstate
mov bx,cs
mov di,offset ParticleDrawCallback
call ChunkArrayEnum
.leave
ret
ParticleDraw endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleDrawCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw the particle if not already drawn
CALLED BY: ChunkArrayEnum
PASS: ds:di - particle
bp - gstate
RETURN:
carry clear
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleDrawCallback proc far
uses di,ax,bx,cx,dx,bp
.enter
Assert gstate bp
; Draw at new position
;
BitSet ds:[di].P_info, PI_DRAWN
movwwf axcx,ds:[di].P_curPosition.PF_x
rndwwf axcx
movwwf bxcx,ds:[di].P_curPosition.PF_y
rndwwf bxcx
cmp ax,ds:[bp].P_lastDrawnPosition.P_x
je checkNoChange
drawNew:
mov cl,ds:[di].P_width
mov ch,ds:[di].P_height
xchg di,bp ;gstate,offset
call DrawAParticle
; Save just drawn position and Erase at old position if initialized
;
xchg ax,ds:[bp].P_lastDrawnPosition.P_x
xchg bx,ds:[bp].P_lastDrawnPosition.P_y
test ds:[bp].P_info, mask PI_LAST_DRAWN_INITIALIZED
jz initLastDrawn
call DrawAParticle
initLastDrawn:
BitSet ds:[bp].P_info, PI_LAST_DRAWN_INITIALIZED
done:
clc
.leave
ret
checkNoChange:
cmp bx,ds:[bp].P_lastDrawnPosition.P_y
jne drawNew
jmp done
ParticleDrawCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawAParticle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY:
PASS:
di - gstate
ax - x
bx - y
cl - width
ch - height
RETURN:
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawAParticle proc near
uses cx,dx
.enter
mov dl,ch ;height
clr ch,dh ;high byte of width and height
add cx,ax
add dx,bx
call GrFillRect
.leave
ret
DrawAParticle endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleEraseCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Erase the particle if it is drawn
CALLED BY: ChunkArrayEnum
PASS: ds:di - particle
bp - gstate
RETURN:
carry clear
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleEraseCallback proc far
uses di,ax,bx,cx
.enter
Assert gstate bp
test ds:[di].P_info,mask PI_DRAWN
jz done
test ds:[di].P_info,mask PI_LAST_DRAWN_INITIALIZED
jz done
BitClr ds:[di].P_info,PI_DRAWN
mov ax,ds:[di].P_lastDrawnPosition.P_x
mov bx,ds:[di].P_lastDrawnPosition.P_y
mov cl,ds:[di].P_width
mov ch,ds:[di].P_height
mov di,bp
call DrawAParticle
done:
clc
.leave
ret
ParticleEraseCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleAdvance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Advance all particles in the passed particle array
CALLED BY:
PASS:
*ds:si - particle chunk array
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleAdvance proc near
uses bx,di,bp
.enter
Assert ChunkArray dssi
mov bx,cs
mov di,offset ParticleAdvanceCallback
call ChunkArrayEnum
.leave
ret
ParticleAdvance endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleAdvanceCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Advance the particle
CALLED BY: ChunkArrayEnum
PASS: ds:di - particle
RETURN:
carry clear
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleAdvanceCallback proc far
uses di,bx,ax
.enter
; Treat x gravity as drag in opposite direction of
; velocity
;
movwwf bxax,ds:[di].P_velocity.PF_x
addwwf ds:[di].P_curPosition.PF_x,bxax
tst bx
movwwf bxax,ds:[di].P_gravity.PF_x
js 10$
negwwf bxax
10$:
addwwf ds:[di].P_velocity.PF_x,bxax
; Treat y gravity as gravity, increasing downward velocity
;
movwwf bxax,ds:[di].P_velocity.PF_y
addwwf ds:[di].P_curPosition.PF_y,bxax
movwwf bxax,ds:[di].P_gravity.PF_y
addwwf ds:[di].P_velocity.PF_y,bxax
clr ah
mov al,ds:[di].P_sparkProb
call BoardPercentageChance
jc makeSpark
done:
clc
.leave
ret
makeSpark:
call SparkCreate
jmp done
ParticleAdvanceCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SparkCreate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a spark chunk array element. Append it so that
it will have moved away from the original before the
next drawing operation
CALLED BY:
PASS:
*ds:si - chunk array
ds:di - source particle
RETURN:
clc - particle created
ax - element
stc - particle not created
ax - destroyed
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SparkCreate proc near
uses ax,bx,cx,dx
initData local ParticleInit
.enter
Assert ChunkArray dssi
; Spark gets same position
;
movwwf cxdx,ds:[di].P_curPosition.PF_x
rndwwf cxdx
mov initData.PI_position.P_x,cx
movwwf cxdx,ds:[di].P_curPosition.PF_y
rndwwf cxdx
mov initData.PI_position.P_y,cx
; no babies
;
clr initData.PI_sparkProb
; Give spark random y gravity bigger than source and
; a small x gravity opposite in direction to velocity
;
mov dx,MAX_STAR_TO_SPARK_GRAVITY_INCREASE_INT
mov bx,MAX_STAR_TO_SPARK_GRAVITY_INCREASE_FRAC
mov cx,MIN_STAR_TO_SPARK_GRAVITY_INCREASE_INT
mov ax,MIN_STAR_TO_SPARK_GRAVITY_INCREASE_FRAC
call ParticleChooseVelocity
addwwf dxax,ds:[di].P_gravity.PF_y
movwwf initData.PI_gravity.PF_y,dxax
mov dx,MAX_SPARK_HORIZ_DRAG_INT
mov cx,MIN_SPARK_HORIZ_DRAG_INT
mov bx,MAX_SPARK_HORIZ_DRAG_FRAC
mov ax,MIN_SPARK_HORIZ_DRAG_FRAC
call ParticleChooseVelocity
movwwf initData.PI_gravity.PF_x,dxax
; Modify the velocity half of the max increase either up
; or down.
;
mov bx,MAX_STAR_TO_SPARK_VERT_VELOCITY_INCREASE_FRAC
mov dx,MAX_STAR_TO_SPARK_VERT_VELOCITY_INCREASE_INT
clr ax,cx
call ParticleChooseVelocity
sub dx,MAX_STAR_TO_SPARK_VERT_VELOCITY_INCREASE_HALF; sub half from
addwwf dxax,ds:[di].P_velocity.PF_y
movwwf initData.PI_velocity.PF_y,dxax
; Give small horiz velocity in same direction
;
mov dx,MAX_SPARK_HORIZ_VELOCITY_INT
mov cx,MIN_SPARK_HORIZ_VELOCITY_INT
mov bx,MAX_SPARK_HORIZ_VELOCITY_FRAC
mov ax,MIN_SPARK_HORIZ_VELOCITY_FRAC
call ParticleChooseVelocity
tst ds:[di].P_velocity.PF_x.WWF_int
jns 20$
negwwf dxax
20$:
movwwf initData.PI_velocity.PF_x,dxax
mov dx,SPARK_MAX_WIDTH
mov cx,SPARK_MIN_WIDTH
call BoardChooseRandom
mov initData.PI_width,dl
mov dx,SPARK_MAX_HEIGHT
mov cx,SPARK_MIN_HEIGHT
call BoardChooseRandom
mov initData.PI_height,dl
call ParticleCreate
.leave
ret
SparkCreate endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleCleanup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Delete all particles no longer on the screen
CALLED BY:
PASS:
*ds:si - particle chunk array
di - gstate
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleCleanup proc near
uses bx,di,bp
.enter
Assert ChunkArray dssi
Assert gstate di
call GrGetWinBounds
mov bp,di ;gstate
mov bx,cs
mov di,offset ParticleCleanupCallback
call ChunkArrayEnum
.leave
ret
ParticleCleanup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ParticleCleanupCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Erase and delete this particle if it has gone off the
left, right or bottom of screen
CALLED BY: ChunkArrayEnum
PASS: ds:di - particle
ax - left
cx - right
dx - bottom
bp - gstate
RETURN:
carry clear
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParticleCleanupCallback proc far
uses di
.enter
Assert gstate bp
cmp ax,ds:[di].P_curPosition.PF_x.WWF_int
jg cleanup
cmp cx,ds:[di].P_curPosition.PF_x.WWF_int
jl cleanup
cmp dx,ds:[di].P_curPosition.PF_y.WWF_int
jl cleanup
done:
clc
.leave
ret
cleanup:
call ParticleEraseCallback
call ChunkArrayDelete
jmp done
ParticleCleanupCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CwordEnableDisableClearXSquares
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: If there are any wrong squares in the puzzle then
enable Clear X Squares
CALLED BY: UTILITY
PASS: *ds:si - Board
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 11/ 8/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CwordEnableDisableClearXSquares proc far
class CwordBoardClass
uses ax,bx,cx,dx,si,di,bp
.enter
;;; Verify argument(s)
Assert ObjectBoard dssi
;;;;;;;;
GetInstanceDataPtrDSBX CwordBoard_offset
mov dx,ds:[bx].CBI_engine
tst dx
jz notEnabled
call EngineFindFirstWrongCell
jnc notEnabled
mov ax,MSG_GEN_SET_ENABLED
sendMessage:
mov bx,handle ClearXButton
mov si,offset ClearXButton
mov di,mask MF_FIXUP_DS
mov dl, VUM_NOW
call ObjMessage
.leave
ret
notEnabled:
mov ax,MSG_GEN_SET_NOT_ENABLED
jmp sendMessage
CwordEnableDisableClearXSquares endp
CwordVictoryCode ends
| 19.266561
| 79
| 0.577268
|
352a50d83ce067257e4de037e18ef1fcad548966
| 1,060
|
asm
|
Assembly
|
libsrc/cpc/sprites/cpc_PutSp0.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/cpc/sprites/cpc_PutSp0.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/cpc/sprites/cpc_PutSp0.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
;
; Amstrad CPC library
;
; ******************************************************
; ** Librería de rutinas para Amstrad CPC **
; ** Raúl Simarro, Artaburu 2009 **
; ******************************************************
;
;
; $Id: cpc_PutSp0.asm $
;
SECTION code_clib
PUBLIC cpc_PutSp0
PUBLIC ancho0
PUBLIC PutSp0_xormode
PUBLIC suma_siguiente_linea0
.cpc_PutSp0
ld ixh,a
;defb $fD
;LD H,a ;ALTO, SE PUEDE TRABAJAR CON HX DIRECTAMENTE
ld b,7
.ancho0
.loop_alto_2
ld c,4 ; << PARAMETRO ANCHO
.loop_ancho_2
ld A,(DE)
.PutSp0_xormode
;XOR (HL)
NOP ; << SMC
ld (hl),a
inc de
inc hl
dec c
jp nz,loop_ancho_2
dec ixh
; defb $fD
; dec H
ret z
.salto_linea
.suma_siguiente_linea0
LD C,$ff ;<< PARAMETRO salto linea menos ancho
ADD HL,BC
jp nc,loop_alto_2 ;sig_linea_2zz ;si no desborda va a la siguiente linea
ld bc,$c050
add HL,BC
ld b,7 ;sólo se daría una de cada 8 veces en un sprite
jp loop_alto_2
| 18.596491
| 75
| 0.542453
|
0e1b1aea97ea266817ef7d81c6db3d63ff3c5d88
| 18,378
|
asm
|
Assembly
|
src/Smith_Waterman/SW_AVX512.asm
|
kugelblitz1235/TPOrga_Final
|
320e30f165be9c4ee0b57535c9db8d09d42ad389
|
[
"MIT"
] | null | null | null |
src/Smith_Waterman/SW_AVX512.asm
|
kugelblitz1235/TPOrga_Final
|
320e30f165be9c4ee0b57535c9db8d09d42ad389
|
[
"MIT"
] | null | null | null |
src/Smith_Waterman/SW_AVX512.asm
|
kugelblitz1235/TPOrga_Final
|
320e30f165be9c4ee0b57535c9db8d09d42ad389
|
[
"MIT"
] | 2
|
2021-04-29T15:02:41.000Z
|
2021-06-15T17:31:36.000Z
|
global SW_ASM_AVX512
extern malloc
extern free
extern printf
extern backtracking_C
extern new_alignment_matrix
extern get_score_SSE
section .rodata
malloc_error_str : db `No se pudo reservar memoria suficiente.\nMalloc: %d\nIntente reservar: %d bytes\n`,0
; Máscara utilizada para invertir el string almacenado en un registro
str_reverse_mask: Dw 0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0xF,0xE,0xD,0xC,0xB,0xA,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0
; Máscara utilizada para desempaquetar los caracteres a nivel word
str_512_unpacklo_epi8_mask: DQ 0x0,0xFF,0x1,0xFF,0x2,0xFF,0x3,0xFF
; Mascara para rotar a derecha a nivel word un zmm
score_512_rot_right_word_mask: DW 0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x0
; Registros globales utilizados
%define constant_gap_zmm zmm0
%define constant_gap_ymm ymm0
%define constant_gap_xmm xmm0
%define constant_missmatch_zmm zmm1
%define constant_missmatch_ymm ymm1
%define constant_missmatch_xmm xmm1
%define constant_match_zmm zmm2
%define constant_match_ymm ymm2
%define constant_match_xmm xmm2
%define zeroes_zmm zmm3
%define zeroes_ymm ymm3
%define zeroes_xmm xmm3
%define str_row_zmm zmm4
%define str_row_ymm ymm4
%define str_row_xmm xmm4
%define str_col_zmm zmm5
%define str_col_ymm ymm5
%define str_col_xmm xmm5
%define left_score_zmm zmm6
%define left_score_ymm ymm6
%define left_score_xmm xmm6
%define up_score_zmm zmm7
%define up_score_ymm ymm7
%define up_score_xmm xmm7
%define diag_score_zmm zmm8
%define diag_score_ymm ymm8
%define diag_score_xmm xmm8
%define diag1_zmm zmm9
%define diag1_ymm ymm9
%define diag1_xmm xmm9
%define diag2_zmm zmm10
%define diag2_ymm ymm10
%define diag2_xmm xmm10
%define str_reverse_mask_zmm zmm11
%define str_reverse_mask_ymm ymm11
%define str_reverse_mask_xmm xmm11
%define str_512_unpacklo_epi8_mask_zmm zmm12
%define str_512_unpacklo_epi8_mask_ymm ymm12
%define str_512_unpacklo_epi8_mask_xmm xmm12
%define score_512_rot_right_word_mask_zmm zmm13
%define score_512_rot_right_word_mask_ymm ymm13
%define score_512_rot_right_word_mask_xmm xmm13
; ------- best position and best global score ----------
; | x | y | g | 0 |
%define best_x_y_global xmm14
%define best_x_xmm_pos 0b00
%define best_y_xmm_pos 0b01
%define best_global_xmm_pos 0b10
; -----------------------------------------------------
%define height r8
%define width r9
%define score_matrix r10
%define v_aux r11
%define seq1 r12
%define seq2 r13
%define seq1_len r14
%define seq2_len r15
; Alignment offsets
; struct Alignment{
; Sequence* sequence_1;
; Sequence* sequence_2;
; Parameters* parameters;
; Result* result;
; short* matrix;
; };
%define alignment_offset_sequence_1 0
%define alignment_offset_sequence_2 8
%define alignment_offset_parameters 16
%define alignment_offset_result 24
%define alignment_offset_matrix 32
; Sequence offsets
; struct Sequence{
; unsigned int length;
; char* sequence; //data
; };
%define sequence_offset_length 0
%define sequence_offset_sequence 8
; Parameters offsets
; struct Parameters{
; char* algorithm;
; short match;
; short missmatch;
; short gap;
; };
%define parameters_offset_algorithm 0
%define parameters_offset_match 8
%define parameters_offset_missmatch 10
%define parameters_offset_gap 12
; Result offsets
;struct Result{
; Sequence* sequence_1;
; Sequence* sequence_2;
; short score;
;};
%define result_offset_sequence_1 0
%define result_offset_sequence_2 8
%define result_offset_score 16
; Este valor se usa para calcular el tamanio de la matriz
; y poder navegarla.
; El tamaño del vector auxiliar se corresponde con la cantidad de caracteres que vamos a procesar simultáneamente
%define vector_len 32
%define vector_len_log 5
section .text
; Funciones auxiliares
inicializar_casos_base:
%define offset_y rbx
%define diag_zmm zmm15
%define diag_ymm ymm15
%define diag_xmm xmm15
%define temp_zmm zmm16
%define temp_ymm ymm16
%define temp_xmm xmm16
mov rdi, [rdi + alignment_offset_parameters]
mov di, [rdi + parameters_offset_gap]
; Inicializamos los valores del vector auxiliar y la matriz de puntajes
mov rsi, 0
mov rax, width
dec rax
.loop:
mov word [v_aux + rsi*2], -32768 ; SHRT_MIN
inc rsi
cmp rax, rsi
jne .loop
; Inicializar por cada franja las primeras 2 diagonales.
; Se pone en cada posicion un cero para no afectar los calculos posteriores
mov rsi, 0
.loop1:
mov rax, rsi
mul width
shl rax, vector_len_log
mov offset_y, rax ;offset_y = i * width * vector_len;
vmovdqu16 [score_matrix + 2*offset_y], zeroes_zmm
vmovdqu16 [score_matrix + 2*offset_y + 2*vector_len], zeroes_zmm
inc rsi
mov rax, height
cmp rsi, rax
jne .loop1
ret
; Lee de memoria y almacena correctamente en los registros los caracteres de la secuencia columna a utilizar en la comparación
leer_secuencia_columna:
; rdi = i
%define str_col_temp_zmm zmm15
%define str_col_temp_ymm ymm15
%define str_col_temp_xmm xmm15
;es el mismo registro pero lo usamos una vez que dejamos de usar el otro
%define shift_right_mask k1
%define i_index rdi
mov rcx, i_index
inc rcx
shl rcx, vector_len_log ; rdx = (i+1) * vector_len
cmp rcx, seq2_len
jl .else ; Caso de desborde por abajo
sub rcx, seq2_len ; rdx = offset_str_col
; Shiftear a derecha shift_right_mask una cantidad de posiciones equivalente a caracteres invalidos,
; para evitar levantar memoria invalida
mov edx, 0xFFFFFFFF
shr edx, cl
kmovd shift_right_mask, edx
add rcx, seq2_len
vpcmpeqw str_col_ymm, str_col_ymm, str_col_ymm
; Seleccionar los caracteres validos a derecha con el offset adecuado para que queden cargados correctamente para la comparación mas adelante
; A su vez poner en los lugares de posiciones invalidas todos 1s, para evitar que coincida con algun caracter de la secuencia columna
vmovdqu8 str_col_ymm{shift_right_mask}, [seq2 + rcx - vector_len]
jmp .end
.else:; Caso sin desborde
shl i_index, vector_len_log
vmovdqu str_col_ymm, [seq2 + i_index]
; Desempaquetar los caracteres almacenados en str_col_xmm para trabajar con words
jmp .end
.end:
vpermq str_col_zmm, str_512_unpacklo_epi8_mask_zmm, str_col_zmm
vpunpcklbw str_col_zmm, str_col_zmm, zeroes_zmm
; Invertir el string almacenado en str_col_xmm
vpermw str_col_zmm, str_reverse_mask_zmm, str_col_zmm
ret
leer_secuencia_fila:
; rdi = j
%define shift_left_mask k1
%define shift_right_mask k2
%define offset_str_row_zmm zmm15
%define offset_str_row_ymm ymm15
%define offset_str_row_xmm xmm15
%define str_row_hi_zmm zmm16
%define str_row_hi_ymm ymm16
%define str_row_hi_xmm xmm16
%define str_row_lo_zmm zmm17
%define str_row_lo_ymm ymm17
%define str_row_lo_xmm xmm17
%define j_index rdi
mov rdx, j_index
sub rdx, vector_len ; rdx = j - vector_len
cmp rdx, 0
jge .elseif ; j-vector_len < 0
mov rcx, vector_len
sub rcx, j_index ; rcx = offset_str_row
; Shiftear a izquierda shift_left_mask una cantidad de posiciones equivalente a caracteres invalidos,
; para evitar levantar memoria invalida
mov edx, 0xFFFFFFFF
shl edx, cl
kmovd shift_left_mask, edx
mov rdx, seq1
sub rdx, rcx
; Seleccionar los caracteres validos a izquierda con el offset adecuado para que queden cargados correctamente para la comparación mas adelante
; A su vez poner en los lugares de posiciones invalidas todos 0s, para evitar que coincida con algun caracter de la secuencia columna
vmovdqu8 str_row_ymm{shift_left_mask}{z}, [rdx]
jmp .end
.elseif:
mov rdx, width
sub rdx, vector_len
cmp j_index, rdx ; j > width-vector_len
jle .else
mov rcx, j_index
sub rcx, rdx ; rcx = offset_str_row
; Shiftear a derecha shift_right_mask una cantidad de posiciones equivalente a caracteres invalidos,
; para evitar levantar memoria invalida
mov edx, 0xFFFFFFFF
shr edx, cl
kmovd shift_right_mask, edx
; Seleccionar los caracteres validos a derecha con el offset adecuado para que queden cargados correctamente para la comparación mas adelante
; A su vez poner en los lugares de posiciones invalidas todos 0s, para evitar que coincida con algun caracter de la secuencia columna
vmovdqu8 str_row_ymm{shift_right_mask}{z}, [seq1 + j_index - vector_len]
jmp .end
.else:
vmovdqu str_row_ymm, [seq1 + j_index - vector_len]
jmp .end
.end:
; Desempaquetamr los caracteres en str_row_ymm para trabajar a nivel word
vpermq str_row_zmm, str_512_unpacklo_epi8_mask_zmm, str_row_zmm
vpunpcklbw str_row_zmm, str_row_zmm, zeroes_zmm
ret
; Calcula los puntajes resultantes de las comparaciones entre caracteres
calcular_scores:
; rdi = j
%define cmp_match_zmm zmm15
%define cmp_match_ymm ymm15
%define cmp_match_xmm xmm15
%define cmp_mask k1
; Calcular los scores viniendo por izquierda, sumandole a cada posicion la penalidad del gap
vmovdqu16 left_score_zmm, diag2_zmm
vpaddsw left_score_zmm, left_score_zmm, constant_gap_zmm
; Calcular los scores viniendo por arriba, sumandole a cada posicion la penalidad del gap
vmovdqu16 up_score_zmm, diag2_zmm
mov bx, word [v_aux + 2*rdi - 2*1]
pinsrw up_score_xmm, ebx, 0b0
vpermw up_score_zmm, score_512_rot_right_word_mask_zmm, up_score_zmm
vpaddsw up_score_zmm, up_score_zmm, constant_gap_zmm
; Calcular los scores viniendo diagonalmente, sumando en cada caso el puntaje de match o missmatch
; si coinciden o no los caracteres de la fila y columna correspondientes
vmovdqu16 diag_score_zmm, diag1_zmm
mov bx, word [v_aux + 2*rdi - 2*2]
pinsrw diag_score_xmm, ebx, 0b0
vpermw diag_score_zmm, score_512_rot_right_word_mask_zmm, diag_score_zmm
; Comparar los dos strings y colocar según corresponda el puntaje correcto (match o missmatch) en cada posición
vpcmpw cmp_mask, str_col_zmm, str_row_zmm, 0
vpblendmw cmp_match_zmm{cmp_mask}, constant_missmatch_zmm, constant_match_zmm
vpaddsw diag_score_zmm, diag_score_zmm, cmp_match_zmm
ret
actualizar_posicion_maxima:
; rdi : i
; rsi : j
; best_x_y_global = | x | y | g | - |
%define nums_zmm zmm15
%define nums_ymm ymm15
%define nums_xmm xmm15
%define nums_s_zmm zmm16
%define nums_s_ymm ymm16
%define nums_s_xmm xmm16
%define index_zmm zmm17
%define index_ymm ymm17
%define index_xmm xmm17
%define index_mask k1
%define max_index eax
; Encontrar el índice del máximo word en el registro zmm
vmovdqu16 nums_zmm, diag_score_zmm ; nums_mm = |WWWWWWWW|WWWWWWWW|WWWWWWWW|WWWWWWWW|
vpsrldq nums_s_zmm, nums_zmm, 1*2
vpmaxsw nums_zmm, nums_zmm, nums_s_zmm ; nums_mm = | W W W W| W W W W| W W W W| W W W W|
vpsrldq nums_s_zmm, nums_zmm, 2*2
vpmaxsw nums_zmm, nums_zmm, nums_s_zmm ; nums_mm = | W W| W W| W W| W W|
vpsrldq nums_s_zmm, nums_zmm, 4*2
vpmaxsw nums_zmm, nums_zmm, nums_s_zmm ; nums_mm = | W| W| W| W|
mov bx, 0x1111
kmovw index_mask, ebx
vpcompressd nums_zmm {index_mask}, nums_zmm ; nums_mm = | | | | W W W W|
vpsrldq nums_s_zmm, nums_zmm, 2*2
vpmaxsw nums_zmm, nums_zmm, nums_s_zmm ; nums_mm = | | | | W W|
vpsrldq nums_s_zmm, nums_zmm, 4*2
vpmaxsw nums_zmm, nums_zmm, nums_s_zmm ; nums_mm = | | | | W|
vpbroadcastw nums_zmm, nums_xmm
; Obtener el índice del valor máximo en el registro
vpcmpw index_mask, nums_zmm, diag_score_zmm, 0
kmovd max_index, index_mask
bsf max_index, max_index ; Obtener la posicion del word de valor máximo entre todos los de la diagonal
vpextrw edx, nums_xmm, 0b0000
vpextrd ecx, best_x_y_global, best_global_xmm_pos
cmp ecx, edx
jge .menor_a_best
vpinsrd best_x_y_global, edx, best_global_xmm_pos ; best_global = max_local_score
mov rdx, rdi
shl rdx, vector_len_log
add rdx, vector_len
dec rdx
sub rdx, rax ; rdx = vector_len * i + (vector_len-1) - max_index
vpinsrd best_x_y_global, edx, best_y_xmm_pos
mov rdx, rsi
sub rdx, vector_len
add rdx, rax ; rdx = j - vector_len + max_index
vpinsrd best_x_y_global, edx, best_x_xmm_pos
.menor_a_best:
ret
; Funcion principal (global)
SW_ASM_AVX512:
; struct Alignment{
; Sequence* sequence_1;
; Sequence* sequence_2;
; Parameters* parameters;
; Result* result;
; AlignmentMatrix* matrix;
; };
; rdi = *alignment, rsi = debug
; prologo ----------------------------------------------------------
push rbp
mov rbp, rsp
push rbx ;save current rbx
push r12 ;save current r12
push r13 ;save current r13
push r14 ;save current r14
push r15 ;save current r15
; preservo debug --------------------------------------------------
push rsi
; acceso a las subestructuras de alignment ------------------------
mov rax, [rdi + alignment_offset_sequence_1]
mov seq1, [rax + sequence_offset_sequence]
xor seq1_len, seq1_len
mov r14d, [rax + sequence_offset_length]
mov rax, [rdi + alignment_offset_sequence_2]
mov seq2, [rax + sequence_offset_sequence]
xor seq2_len, seq2_len
mov r15d, [rax + sequence_offset_length]
;------------------------------------------------------------------
; Calculo height, width y score_matrix. Malloc matrix y v_aux -----
mov rax, seq2_len
add rax, vector_len
dec rax
shr rax, vector_len_log
mov height,rax
mov rax, seq1_len
add rax, vector_len
mov width, rax
mov rax, height
mul width
shl rax, vector_len_log
; -----------------------------------------------------------------
; Reservar memoria para la matriz de puntajes y el vector auxiliar, luego inicializamos sus valores
push rdi ; conserva *alignment
push r8
push r9
mov rdi, rax
shl rdi, 1 ; score_matrix_sz*sizeof(short)
sub rsp, 8
call malloc
add rsp, 8
mov rsi, 0
cmp rax, 0
je .malloc_error
pop r9
pop r8
mov score_matrix, rax
push r8
push r9
push r10
mov rdi, width
dec rdi
shl rdi,1
call malloc
mov rsi, 1
cmp rax, 0
je .malloc_error
pop r10
pop r9
pop r8
pop rdi
mov v_aux, rax
;------------------------------------------------------------------
; asignacion de datos en los registros xmm nombrados --------------
; Broadcastear el valor de gap, a nivel word, en el registro
mov rax, [rdi + alignment_offset_parameters]
mov ax, [rax + parameters_offset_gap]
vpbroadcastw constant_gap_zmm, eax
; Broadcastear el valor de missmatch, a nivel word, en el registro
mov rax, [rdi + alignment_offset_parameters]
mov ax, [rax + parameters_offset_missmatch]
vpbroadcastw constant_missmatch_zmm, eax
; Broadcastear el valor de match, a nivel word, en el registro
mov rax, [rdi + alignment_offset_parameters]
mov ax, [rax + parameters_offset_match]
vpbroadcastw constant_match_zmm, eax
; Máscara de ceros
vpxorq zeroes_zmm, zeroes_zmm, zeroes_zmm
;------------------------------------------------------------------
; Carga de las mascaras -------------------------------------------
; Máscara utilizada para invertir el string almacenado en un registro
vmovdqu16 str_reverse_mask_zmm, [str_reverse_mask]
vmovdqu8 str_512_unpacklo_epi8_mask_zmm, [str_512_unpacklo_epi8_mask]
vmovdqu16 score_512_rot_right_word_mask_zmm, [score_512_rot_right_word_mask]
;------------------------------------------------------------------
; Casos base ------------------------------------------------------
push rdi
call inicializar_casos_base
; Loop principal --------------------------------------------------
vpxorq best_x_y_global, best_x_y_global
mov rbx, 0 ; i
.loop_i:
; Calcular offset_y
mov rax, rbx
mul width
shl rax, vector_len_log
mov rsi, rax ; rsi = offset_y
mov rdi, rbx ; rdi = i
call leer_secuencia_columna
vmovdqu16 diag1_zmm, [score_matrix + 2*rsi]
vmovdqu16 diag2_zmm, [score_matrix + 2*rsi + 2*vector_len]
mov rcx, 2 ; j
.loop_j:
push rbx
push rcx
mov rdi, rcx
call leer_secuencia_fila
pop rcx
mov rdx, rcx
shl rdx, vector_len_log ; rdx = offset_x
push rsi
push rcx
mov rdi, rcx ; rdi = j
call calcular_scores
pop rcx
pop rsi
pop rbx
; Guardar en cada posicion de la diagonal el maximo entre los puntajes de venir por izquierda, arriba ,diagonalmente y cero
vpmaxsw diag_score_zmm, diag_score_zmm, up_score_zmm
vpmaxsw diag_score_zmm, diag_score_zmm, left_score_zmm
vpmaxsw diag_score_zmm, diag_score_zmm, zeroes_zmm
; Almacenamos el puntaje máximo en la posición correcta de la matriz
mov rax, rsi
add rax, rdx
vmovdqu16 [score_matrix + 2*rax], diag_score_zmm
cmp rcx, vector_len
jl .menor
pextrw eax, diag_score_xmm, 0b0000
mov [v_aux + 2*rcx - 2*vector_len], ax
.menor:
push rdx
push rsi
push rbx
push rcx
mov rdi, rbx ; rdi = i
mov rsi, rcx ; rsi = j
call actualizar_posicion_maxima
pop rcx
pop rbx
pop rsi
pop rdx
vmovdqu16 diag1_zmm, diag2_zmm
vmovdqu16 diag2_zmm, diag_score_zmm
inc rcx
cmp rcx, width
jne .loop_j
inc rbx
cmp rbx, height
jne .loop_i
; Restaurar *alignment luego de que el algoritmo termina
pop rdi
.debug:
pop rsi
cmp rsi, 0
je .no_debug
mov [rdi + alignment_offset_matrix], score_matrix
.no_debug:
push rsi
push score_matrix
mov rsi, rdi
mov rdi, score_matrix
mov rdx, vector_len
vpextrd ecx, best_x_y_global, best_x_xmm_pos
vpextrd r8d, best_x_y_global, best_y_xmm_pos
mov r9, 1 ; true
push 1 ; false
push get_score_SSE
call backtracking_C
add rsp, 0x10
pop score_matrix
pop rsi
cmp rsi, 0
jne .epilogo
mov rdi, score_matrix
call free
;------------------------------------------------------------------
; epilogo
.epilogo:
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
ret
.malloc_error:
mov rdi, malloc_error_str
mov rax, 0
call printf
jmp .epilogo
| 30.17734
| 177
| 0.700511
|
625d586992d92eabdd893e23e1b095d14ef694c7
| 7,164
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_ht_/i9-9900K_12_0xca.log_21829_225.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/US/_ht_/i9-9900K_12_0xca.log_21829_225.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/US/_ht_/i9-9900K_12_0xca.log_21829_225.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x9268, %rdi
nop
nop
nop
cmp %r8, %r8
vmovups (%rdi), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %r9
nop
nop
add %r12, %r12
lea addresses_A_ht+0xd7e8, %rax
clflush (%rax)
nop
nop
nop
add $36758, %r13
movl $0x61626364, (%rax)
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0x8268, %r13
nop
nop
nop
add %rdi, %rdi
mov $0x6162636465666768, %r11
movq %r11, %xmm2
and $0xffffffffffffffc0, %r13
vmovaps %ymm2, (%r13)
nop
nop
dec %r8
lea addresses_A_ht+0x6028, %rdi
nop
nop
xor %r8, %r8
mov $0x6162636465666768, %r9
movq %r9, %xmm7
movups %xmm7, (%rdi)
nop
nop
nop
xor %r12, %r12
lea addresses_normal_ht+0x1b4f8, %rsi
lea addresses_A_ht+0x29e8, %rdi
nop
nop
nop
nop
nop
mfence
mov $75, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %r9
lea addresses_WT_ht+0x13728, %rsi
lea addresses_WT_ht+0xb0e8, %rdi
clflush (%rsi)
and %r11, %r11
mov $14, %rcx
rep movsq
nop
nop
nop
nop
inc %rsi
lea addresses_WT_ht+0x17be8, %rsi
lea addresses_A_ht+0x4be8, %rdi
nop
nop
nop
add %r11, %r11
mov $19, %rcx
rep movsl
nop
nop
nop
nop
and $53341, %r8
lea addresses_WT_ht+0x14ff8, %rsi
lea addresses_D_ht+0x65e8, %rdi
nop
nop
sub %r11, %r11
mov $17, %rcx
rep movsl
nop
nop
nop
add $62373, %r13
lea addresses_WT_ht+0x1eedf, %rcx
xor %rax, %rax
mov $0x6162636465666768, %r8
movq %r8, %xmm2
movups %xmm2, (%rcx)
xor %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r8
push %r9
push %rdi
push %rdx
// Store
lea addresses_RW+0x12ce8, %r8
nop
nop
nop
nop
nop
add $35059, %r9
mov $0x5152535455565758, %r10
movq %r10, (%r8)
nop
sub $7744, %r12
// Load
lea addresses_US+0x176c8, %r8
nop
xor %r11, %r11
mov (%r8), %r9w
nop
nop
nop
and %r10, %r10
// Load
lea addresses_D+0xbe8, %rdx
nop
nop
xor $26958, %r11
mov (%rdx), %r10d
nop
nop
inc %r12
// Faulty Load
lea addresses_US+0x161e8, %r9
and %r10, %r10
movups (%r9), %xmm1
vpextrq $1, %xmm1, %r12
lea oracles, %rdx
and $0xff, %r12
shlq $12, %r12
mov (%rdx,%r12,1), %r12
pop %rdx
pop %rdi
pop %r9
pop %r8
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': True, 'congruent': 6}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'44': 18278, '45': 1982, '49': 1569}
44 44 45 44 49 44 45 44 44 44 45 44 49 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 49 44 49 44 44 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 45 44 49 44 44 44 44 45 44 44 49 44 44 44 49 44 44 44 44 44 44 44 49 44 44 44 45 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 49 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 44 45 44 44 44 44 44 44 44 49 44 44 44 44 45 44 44 44 44 49 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 45 44 49 44 44 44 44 44 49 44 45 44 45 44 45 44 44 44 44 44 45 44 45 44 44 45 44 44 49 44 49 44 49 44 45 44 49 44 44 44 44 44 44 49 44 44 44 45 44 44 44 45 44 44 44 44 44 44 45 44 44 44 44 45 44 44 44 44 49 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 45 44 45 44 44 44 44 44 44 44 44 44 45 44 45 44 44 44 44 44 44 44 45 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 49 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 49 44 44 44 44 44 44 45 44 44 44 44 45 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 49 44 44 44 44 44 45 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 49 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 49 44 44 49 44 44 44 44 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 45 44 44 45 44 45 44 45 44 45 44 44 44 45 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 44 45 44 44 44 45 44 44 44 44 44 45 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 44 45 44 44 44 45 44 44 44 45 44 45 44 44 45 44 44 44 45 44 44 44 49 44 44 44 44 44 45 44 45 44 44 44 45 44 44 44 44 44 49 44 49 44 45 44 49 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 45 44 45 44 49 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 49 44 49 44 44 44 44 44 44 44 49 44 44 49 44 44 44 44 44 45 44 44 44 44 44 45 44 44 44 44 44 49 44 45 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 49 44 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 49 44 44 44 49 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 49 44 49 44 44 44 44 44 44 44 44 44 45 44 45 44 45 44 49 44 44 44 44 44 45 44 44 44 44 44 44 45 44 44 44 44 45 44 49 44 44 44 45 44 49 44 44 44 45 44 44 44 44 44 49 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 45 44 49 44 44 44 44 45 44 45 44 44 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 45 44 44 44 44 44 44
*/
| 34.442308
| 2,999
| 0.656616
|
93c31d2ce9a8b76e8c4a015be058fa762b702045
| 252
|
asm
|
Assembly
|
programs/oeis/152/A152467.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/152/A152467.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/152/A152467.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A152467: a(n) = floor(n/6).
; 0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14
div $0,6
| 50.4
| 211
| 0.559524
|
8d191ac7d3b941fedff1267ba9d5e8b8e54582f0
| 3,271
|
asm
|
Assembly
|
timers/timer_timing/main.asm
|
AntonioND/gbc-hw-tests
|
631e60000c885154a8526df0b148847f9c34ce42
|
[
"MIT"
] | 6
|
2018-07-21T12:11:21.000Z
|
2021-07-23T16:32:47.000Z
|
timers/timer_timing/main.asm
|
PMArkive/gbc-hw-tests
|
631e60000c885154a8526df0b148847f9c34ce42
|
[
"MIT"
] | null | null | null |
timers/timer_timing/main.asm
|
PMArkive/gbc-hw-tests
|
631e60000c885154a8526df0b148847f9c34ce42
|
[
"MIT"
] | 3
|
2016-04-26T07:45:34.000Z
|
2018-12-30T05:45:14.000Z
|
INCLUDE "hardware.inc"
INCLUDE "header.inc"
SECTION "var",BSS
ram_ptr: DS 2
repeat_loop: DS 1
SECTION "Main",HOME
;--------------------------------------------------------------------------
;- Main() -
;--------------------------------------------------------------------------
Main:
ld hl,$A000
ld a,[Init_Reg_A]
cp a,$11
jr nz,.skipchange1
ld a,0
ld [repeat_loop],a
call CPU_slow
.skipchange1:
.repeat_all:
; -------------------------------------------------------
ld a,$0A
ld [$0000],a ; enable ram
; -------------------------------------------------------
ld a,0
ld [rTMA],a
ld [rDIV],a
; -----------------------
ld de,rDIV
ld c,rTIMA&$FF
REPETITIONS_1 SET 0 ; 4 nops
REPT 8
ld a,TACF_START|TACF_262KHZ
ld [rTAC],a
xor a,a
ld [de],a ; DIV
ld [$FF00+c],a ; TIMA
REPT REPETITIONS_1
nop
ENDR
ld a,[rTIMA]
ld [hl+],a
REPETITIONS_1 SET REPETITIONS_1+1
ENDR
; -----------------------
REPETITIONS_1 SET 0 ; 16 nops
REPT 8
ld a,TACF_START|TACF_65KHZ
ld [rTAC],a
xor a,a
ld [de],a ; DIV
ld [$FF00+c],a ; TIMA
push de ; |
pop de ; | 8 nops
nop ; |
REPT REPETITIONS_1
nop
ENDR
ld a,[rTIMA]
ld [hl+],a
REPETITIONS_1 SET REPETITIONS_1+1
ENDR
; -----------------------
REPETITIONS_1 SET 0 ; 64 nops
REPT 8
ld a,TACF_START|TACF_16KHZ
ld [rTAC],a
xor a,a
ld [de],a ; DIV
ld [$FF00+c],a ; TIMA
push de ; |
pop de ; | 7 nops
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de ; 56 nops
REPT REPETITIONS_1
nop
ENDR
ld a,[rTIMA]
ld [hl+],a
REPETITIONS_1 SET REPETITIONS_1+1
ENDR
; -----------------------
REPETITIONS_1 SET 0 ; 256 nops
REPT 8
ld a,TACF_START|TACF_4KHZ
ld [rTAC],a
xor a,a
ld [de],a ; DIV
ld [$FF00+c],a ; TIMA
push de ; |
pop de ; | 7 nops
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de ; 56 nops
push de ; |
pop de ; | 7 nops
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de ; 56 nops
push de ; |
pop de ; | 7 nops
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de ; 112 nops
push de ; |
pop de ; | 7 nops
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de
push de
pop de ; 168 nops
push de
pop de
push de
pop de ; 182 nops
push de
pop de
nop ; 190
REPT REPETITIONS_1
nop
ENDR
ld a,[rTIMA]
ld [hl+],a
REPETITIONS_1 SET REPETITIONS_1+1
ENDR
; -------------------------------------------------------
push hl ; magic number
ld [hl],$12
inc hl
ld [hl],$34
inc hl
ld [hl],$56
inc hl
ld [hl],$78
pop hl
ld a,$00
ld [$0000],a ; disable ram
; -------------------------------------------------------
ld a,[Init_Reg_A]
cp a,$11
jr nz,.skipchange2
ld a,[repeat_loop]
and a,a
jr nz,.endloop
; -------------------------------------------------------
call CPU_fast
ld a,1
ld [repeat_loop],a
jp .repeat_all
.skipchange2:
.endloop:
halt
jr .endloop
| 13.031873
| 75
| 0.501376
|
6821d7cb5e76c6103972c458567cb9d81d7e9afc
| 1,014
|
asm
|
Assembly
|
programs/oeis/165/A165351.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/165/A165351.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/165/A165351.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A165351: Numerator of 3n/2.
; 0,3,3,9,6,15,9,21,12,27,15,33,18,39,21,45,24,51,27,57,30,63,33,69,36,75,39,81,42,87,45,93,48,99,51,105,54,111,57,117,60,123,63,129,66,135,69,141,72,147,75,153,78,159,81,165,84,171,87,177,90,183,93,189,96,195,99,201,102,207,105,213,108,219,111,225,114,231,117,237,120,243,123,249,126,255,129,261,132,267,135,273,138,279,141,285,144,291,147,297,150,303,153,309,156,315,159,321,162,327,165,333,168,339,171,345,174,351,177,357,180,363,183,369,186,375,189,381,192,387,195,393,198,399,201,405,204,411,207,417,210,423,213,429,216,435,219,441,222,447,225,453,228,459,231,465,234,471,237,477,240,483,243,489,246,495,249,501,252,507,255,513,258,519,261,525,264,531,267,537,270,543,273,549,276,555,279,561,282,567,285,573,288,579,291,585,294,591,297,597,300,603,303,609,306,615,309,621,312,627,315,633,318,639,321,645,324,651,327,657,330,663,333,669,336,675,339,681,342,687,345,693,348,699,351,705,354,711,357,717,360,723,363,729,366,735,369,741,372,747
mov $1,$0
gcd $0,2
div $1,$0
mul $1,3
| 126.75
| 944
| 0.723866
|
a4f2a23bc79b28f7586ea8c29f3a65977e055119
| 545
|
asm
|
Assembly
|
programs/oeis/154/A154287.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/154/A154287.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/154/A154287.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A154287: (L)-sieve transform of {1,4,9,16,...,n^2,...}=A000290.
; 1,3,6,9,13,18,23,29,35,42,49,57,66,75,85,95,106,117,129,141,154,167,181,195,210,225,241,258,275,293,311,330,349,369,389,410,431,453,475,498,521,545,569
mov $6,$0
mov $8,$0
add $8,1
lpb $8,1
clr $0,6
mov $0,$6
sub $8,1
sub $0,$8
mov $3,$0
mov $5,$0
add $5,1
lpb $5,1
mov $0,$3
sub $5,1
sub $0,$5
mov $1,$0
lpb $0,1
mul $0,2
add $1,1
trn $0,$1
lpe
gcd $1,2
sub $1,1
add $4,$1
lpe
add $7,$4
lpe
mov $1,$7
| 17.03125
| 153
| 0.515596
|
ef34556c3460d19eb3b10772d99a0182a6dbeae4
| 781
|
asm
|
Assembly
|
oeis/183/A183690.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/183/A183690.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/183/A183690.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A183690: Number of (n+1) X 2 0..2 arrays with every 2 X 2 subblock nonsingular.
; Submitted by Jamie Morken(s4)
; 50,314,1970,12362,77570,486746,3054290,19165418,120261410,754630394,4735243250,29713259402,186448243010,1169947290266,7341322395410,46066190299178,289061530659170,1813837175689274,11381678123719730,71419088024112842,448148865110322050,2812097029744512986,17645676069605141330,110725156585981810538,694791191486750183330,4359757210121605400954,27357115582502028471410,171663635593482985564682,1077175102627431155594690,6759184597885019662490906,42413323810444547557212050,266140095835302895085987498
mov $1,1
lpb $0
sub $0,1
mov $2,$1
mul $2,2
add $3,2
mov $1,$3
mul $1,4
add $2,$3
mov $3,$2
sub $3,1
add $3,$1
lpe
mov $0,$3
mul $0,24
add $0,50
| 37.190476
| 500
| 0.804097
|
b9bcbcf6ec1b9bec9f3a7a0689a39aad7aaa9b0e
| 8,504
|
asm
|
Assembly
|
lib/asm/log.asm
|
zhouyan/MCKL
|
1d03eb5a879e47e268efc73b1d433611e64307b3
|
[
"BSD-2-Clause"
] | 12
|
2016-08-02T17:01:13.000Z
|
2021-03-04T12:11:33.000Z
|
lib/asm/log.asm
|
zhouyan/MCKL
|
1d03eb5a879e47e268efc73b1d433611e64307b3
|
[
"BSD-2-Clause"
] | 5
|
2017-05-09T12:05:06.000Z
|
2021-03-16T10:39:23.000Z
|
lib/asm/log.asm
|
zhouyan/MCKL
|
1d03eb5a879e47e268efc73b1d433611e64307b3
|
[
"BSD-2-Clause"
] | 2
|
2016-08-25T13:10:29.000Z
|
2019-05-01T01:54:29.000Z
|
;;============================================================================
;; MCKL/lib/asm/log.asm
;;----------------------------------------------------------------------------
;; MCKL: Monte Carlo Kernel Library
;;----------------------------------------------------------------------------
;; Copyright (c) 2013-2018, Yan Zhou
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;; Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;;
;; Redistributions in binary form must reproduce the above copyright notice,
;; this list of conditions and the following disclaimer in the documentation
;; and/or other materials provided with the distribution.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;; POSSIBILITY OF SUCH DAMAGE.
;;============================================================================
%include "/math.asm"
global mckl_vd_log
global mckl_vd_log2
global mckl_vd_log10
global mckl_vd_log1p
default rel
; register used as constants: ymm6, ymm8-10, ymm12
; register used as variables: ymm1-5, ymm7, ymm11, ymm13-15
%macro log1pf_constants 0
vmovapd ymm6, [rel sqrt2by2]
vmovapd ymm8, [rel one]
vmovapd ymm9, [rel two]
%endmacro
; log(1 + f) * (f + 2) / f - 2 = c15 * x^14 + ... + c5 * x^4 + c3 * x^2
%macro log1pf 3 ; implicity input ymm1, output ymm15
vcmpltpd ymm11, ymm0, %1
vcmpgtpd ymm15, ymm0, %2
vxorpd ymm13, ymm13, ymm13 ; k = 0
%if %3 == 0
vaddpd ymm1, ymm0, ymm8 ; b = a + 1
vmovapd ymm14, ymm0 ; f = a;
%elif %3 == 1
vmovapd ymm1, ymm0 ; b = a
vsubpd ymm14, ymm0, ymm8 ; f = a - 1;
%else
%error
%endif
vorpd ymm11, ymm11, ymm15
vtestpd ymm11, ymm11
jz %%skip
; k = exponent(b)
vpsrlq ymm2, ymm1, 52
vorpd ymm2, ymm2, [emask0]
vsubpd ymm3, ymm2, [emask1] ; exponent(b)
; fraction(b) / 2
vandpd ymm1, ymm1, [fmask0]
vorpd ymm4, ymm1, [fmask1] ; fraction(b) / 2
; fraction(b) > sqrt(2)
vcmpgtpd ymm1, ymm4, ymm6
vandpd ymm5, ymm1, ymm8
vandnpd ymm7, ymm1, ymm4
vaddpd ymm3, ymm3, ymm5
vaddpd ymm4, ymm4, ymm7
; f = fraction(b) - 1
vsubpd ymm4, ymm4, ymm8
; skip reduction if ymm0 in range
vblendvpd ymm13, ymm13, ymm3, ymm11
vblendvpd ymm14, ymm14, ymm4, ymm11
%%skip:
; x = f / (f + 2)
vaddpd ymm1, ymm14, ymm9
vdivpd ymm1, ymm14, ymm1
vmovapd ymm15, [c15]
vmovapd ymm11, [c11]
vmovapd ymm7, [c7]
vmulpd ymm2, ymm1, ymm1 ; x^2
vmulpd ymm3, ymm2, [c3] ; u3 = c3 * x^2
vmulpd ymm4, ymm2, ymm2 ; x^4
vfmadd213pd ymm15, ymm2, [c13] ; u15 = c15 * x^2 + c13
vfmadd213pd ymm11, ymm2, [c9] ; u11 = c11 * x^2 + c9
vfmadd213pd ymm7, ymm2, [c5] ; u7 = c7 * x^2 + c5
vfmadd213pd ymm15, ymm4, ymm11 ; v15 = u15 * x^4 + u11
vfmadd213pd ymm7, ymm4, ymm3 ; v7 = u7 * x^4 + u3
vmulpd ymm4, ymm4, ymm4
vfmadd213pd ymm15, ymm4, ymm7 ; z15 = v15 * x^8 + v7
%endmacro
%macro select 1 ; implicit input ymm0, ymm15, output ymm15
vcmpltpd ymm1, ymm0, [%{1}_min_a] ; a < min_a
vcmpgtpd ymm2, ymm0, [%{1}_max_a] ; a > max_a
vcmpltpd ymm3, ymm0, [%{1}_nan_a] ; a < nan_a
vcmpneqpd ymm4, ymm0, ymm0 ; a != a
vorpd ymm5, ymm1, ymm2
vorpd ymm5, ymm5, ymm3
vorpd ymm5, ymm5, ymm4
vtestpd ymm5, ymm5
jz %%skip
vblendvpd ymm15, ymm15, [%{1}_min_y], ymm1 ; min_y
vblendvpd ymm15, ymm15, [%{1}_max_y], ymm2 ; max_y
vblendvpd ymm15, ymm15, [%{1}_nan_y], ymm3 ; nan_y
vblendvpd ymm15, ymm15, ymm0, ymm4 ; a
%%skip:
%endmacro
%macro log_constants 0
log1pf_constants
vmovapd ymm10, [ln2]
%endmacro
%macro log 2
vmovupd ymm0, %2
log1pf ymm6, [sqrt2], 1 ; log(1 + f) = f - x * (f - R)
; log(a) = k * log(2) + log(1 + f)
vsubpd ymm15, ymm14, ymm15
vfnmadd213pd ymm15, ymm1, ymm14
vfmadd231pd ymm15, ymm13, ymm10
select log
vmovupd %1, ymm15
%endmacro
%macro log2_constants 0
log1pf_constants
vmovapd ymm10, [ln2inv]
%endmacro
%macro log2 2
vmovupd ymm0, %2
log1pf ymm6, [sqrt2], 1 ; log(1 + f) = f - x * (f - R)
; log2(a) = k + log(1 + f) / log(2)
vsubpd ymm15, ymm14, ymm15
vfnmadd213pd ymm15, ymm1, ymm14
vfmadd213pd ymm15, ymm10, ymm13
select log2
vmovupd %1, ymm15
%endmacro
%macro log10_constants 0
log1pf_constants
vmovapd ymm10, [ln10_2]
vmovapd ymm12, [ln10inv]
%endmacro
%macro log10 2
vmovupd ymm0, %2
log1pf ymm6, [sqrt2], 1 ; log(1 + f) = f - x * (f - R)
; log10(a) = k * log(10) / log(2) + log(1 + f) / log(10)
vsubpd ymm15, ymm14, ymm15
vfnmadd213pd ymm15, ymm1, ymm14
vmulpd ymm13, ymm13, ymm10
vfmadd213pd ymm15, ymm12, ymm13
select log
vmovupd %1, ymm15
%endmacro
%macro log1p_constants 0
log1pf_constants
vmovapd ymm10, [ln2]
%endmacro
%macro log1p 2
vmovupd ymm0, %2
log1pf [sqrt2m2], [sqrt2m1], 0 ; log(1 + f) = f - x * (f - R)
; log(1 + a) = k * log2 + log(1 + f)
vsubpd ymm15, ymm14, ymm15
vfnmadd213pd ymm15, ymm1, ymm14
vfmadd231pd ymm15, ymm13, ymm10
select log1p
vmovupd %1, ymm15
%endmacro
section .rodata
align 32
log_min_a: times 4 dq 0x0010000000000000 ; DBL_MIN
log_max_a: times 4 dq 0x7FEFFFFFFFFFFFFF ; DBL_MAX
log_nan_a: times 4 dq 0x0000000000000000 ; 0.0
log_min_y: times 4 dq 0xFFF0000000000000 ; -HUGE_VAL
log_max_y: times 4 dq 0x7FF0000000000000 ; HUGE_VAL
log_nan_y: times 4 dq 0x7FF8000000000000 ; NaN
log2_min_a: times 4 dq 0x0010000000000000 ; DBL_MIN
log2_max_a: times 4 dq 0x7FEFFFFFFFFFFFFF ; DBL_MAX
log2_nan_a: times 4 dq 0x0000000000000000 ; 0.0
log2_min_y: times 4 dq 0xFFF0000000000000 ; -HUGE_VAL
log2_max_y: times 4 dq 0x7FF0000000000000 ; HUGE_VAL
log2_nan_y: times 4 dq 0x7FF8000000000000 ; NaN
log10_min_a: times 4 dq 0x0010000000000000 ; DBL_MIN
log10_max_a: times 4 dq 0x7FEFFFFFFFFFFFFF ; DBL_MAX
log10_nan_a: times 4 dq 0x0000000000000000 ; 0.0
log10_min_y: times 4 dq 0xFFF0000000000000 ; -HUGE_VAL
log10_max_y: times 4 dq 0x7FF0000000000000 ; HUGE_VAL
log10_nan_y: times 4 dq 0x7FF8000000000000 ; NaN
log1p_min_a: times 4 dq 0xBFEFFFFFFFFFFFFF ; nextafter(-1.0, 0.0)
log1p_max_a: times 4 dq 0x7FEFFFFFFFFFFFFF ; DBL_MAX
log1p_nan_a: times 4 dq 0xBFF0000000000000 ; -1.0
log1p_min_y: times 4 dq 0xFFF0000000000000 ; -HUGE_VAL
log1p_max_y: times 4 dq 0x7FF0000000000000 ; HUGE_VAL
log1p_nan_y: times 4 dq 0x7FF8000000000000 ; NaN
c3: times 4 dq 0x3FE5555555555593
c5: times 4 dq 0x3FD999999997FA04
c7: times 4 dq 0x3FD2492494229359
c9: times 4 dq 0x3FCC71C51D8E78AF
c11: times 4 dq 0x3FC7466496CB03DE
c13: times 4 dq 0x3FC39A09D078C69F
c15: times 4 dq 0x3FC2F112DF3E5244
emask0: times 4 dq 0x4330000000000000 ; 2^52
emask1: times 4 dq 0x43300000000003FF ; 2^52 + 1023
fmask0: times 4 dq 0x000FFFFFFFFFFFFF ; fraction mask
fmask1: times 4 dq 0x3FE0000000000000 ; fraction(a) / 2
one: times 4 dq 0x3FF0000000000000 ; 1.0
two: times 4 dq 0x4000000000000000 ; 2.0
ln2: times 4 dq 0x3FE62E42FEFA39EF ; log(2.0l)
ln2inv: times 4 dq 0x3FF71547652B82FE ; 1.0l / log(2.0l)
ln10_2: times 4 dq 0x3FD34413509F79FF ; log10(2.0l)
ln10inv: times 4 dq 0x3FDBCB7B1526E50E ; 1.0l / log(10.0l)
sqrt2: times 4 dq 0x3FF6A09E667F3BCD ; sqrt(2.0l)
sqrt2by2: times 4 dq 0x3FE6A09E667F3BCD ; sqrt(2.0l) / 2.0l
sqrt2m1: times 4 dq 0x3FDA827999FCEF32 ; sqrt(2.0l) - 1.0l
sqrt2m2: times 4 dq 0xBFD2BEC333018867 ; sqrt(2.0l) / 2.0l - 1.0l
section .text
mckl_vd_log: math_kernel_a1r1 8, log
mckl_vd_log2: math_kernel_a1r1 8, log2
mckl_vd_log10: math_kernel_a1r1 8, log10
mckl_vd_log1p: math_kernel_a1r1 8, log1p
; vim:ft=nasm
| 30.923636
| 78
| 0.661689
|
e9cc3dc990a42497208b6d7a218e815384757324
| 3,355
|
asm
|
Assembly
|
cpu/arch/x86/i386.asm
|
ifest1/osdev
|
3d90375ae703d82ee80e112dc2fb922ca7bb3c20
|
[
"MIT"
] | null | null | null |
cpu/arch/x86/i386.asm
|
ifest1/osdev
|
3d90375ae703d82ee80e112dc2fb922ca7bb3c20
|
[
"MIT"
] | null | null | null |
cpu/arch/x86/i386.asm
|
ifest1/osdev
|
3d90375ae703d82ee80e112dc2fb922ca7bb3c20
|
[
"MIT"
] | null | null | null |
[BITS 32]
[extern irq_handler]
[extern syscall_handler]
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
section .multiboot
align 4
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd CHECKSUM
section .bss
align 8
stack_bottom:
resb 16384
stack_top:
section .text:
global start:function (start.end - start)
start:
mov esp, stack_top
push eax
push ebx
extern main
call main
sti
.hang:
hlt
jmp .hang
.end:
GLOBAL gdt_flush
EXTERN gdt_p
gdt_flush:
lgdt[gdt_p]
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
ret
GLOBAL call_sys
call_sys:
push ebp
mov ebp, esp
mov eax, [ebp + 28]
push eax
mov eax, [ebp + 24]
push eax
mov eax, [ebp + 20]
push eax
mov eax, [ebp + 16]
push eax
mov eax, [ebp + 12]
push eax
mov eax, [ebp + 8]
call eax
add esp, 20
pop ebp
ret
GLOBAL _syscall0, _syscall1, _syscall2, _syscall3, _syscall4, _syscall5
_syscall0:
mov eax, [esp + 4]
int 0x80
ret
_syscall1:
push ebx
mov eax, [esp + 4 + 4]
mov ebx, [esp + 4 + 8]
int 0x80
pop ebx
ret
_syscall2:
push ebx
push ecx
mov eax, [esp + 8 + 4]
mov ebx, [esp + 8 + 8]
mov ecx, [esp + 8 + 12]
int 0x80
pop ecx
pop ebx
ret
_syscall3:
push ebx
push ecx
mov eax, [esp + 8 + 4]
mov ebx, [esp + 8 + 8]
mov ecx, [esp + 8 + 12]
mov edx, [esp + 8 + 16]
int 0x80
pop ecx
pop ebx
ret
iret
%macro ISR_NOERRCODE 1
[GLOBAL isr%1]
isr%1:
push byte 0
push byte %1
jmp 0x08:isr_common_stub
%endmacro
%macro ISR_ERRCODE 1
[GLOBAL isr%1]
isr%1:
push byte %1
jmp 0x08:isr_common_stub
%endmacro
%macro ISR_DEVICES 2
[GLOBAL isr%2]
isr%2:
push byte %1
push byte %2
jmp 0x08:isr_common_stub
%endmacro
isr_common_stub:
pusha
mov ax, ds
push eax
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
call irq_handler
pop eax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
popa
add esp, 8
sti
iret
GLOBAL irq_128_handler
irq_128_handler:
pusha
mov ax, ds
push eax
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
call syscall_handler
pop eax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
popa
add esp, 8
sti
iret
ISR_NOERRCODE 0
ISR_NOERRCODE 1
ISR_NOERRCODE 2
ISR_NOERRCODE 3
ISR_NOERRCODE 4
ISR_NOERRCODE 5
ISR_NOERRCODE 6
ISR_NOERRCODE 7
ISR_ERRCODE 8
ISR_NOERRCODE 9
ISR_ERRCODE 10
ISR_ERRCODE 11
ISR_ERRCODE 12
ISR_ERRCODE 13
ISR_ERRCODE 14
ISR_NOERRCODE 15
ISR_NOERRCODE 16
ISR_NOERRCODE 17
ISR_NOERRCODE 18
ISR_NOERRCODE 19
ISR_NOERRCODE 20
ISR_NOERRCODE 21
ISR_NOERRCODE 22
ISR_NOERRCODE 23
ISR_NOERRCODE 24
ISR_NOERRCODE 25
ISR_NOERRCODE 26
ISR_NOERRCODE 27
ISR_NOERRCODE 28
ISR_NOERRCODE 29
ISR_NOERRCODE 30
ISR_NOERRCODE 31
ISR_DEVICES 0, 32
ISR_DEVICES 1, 33
ISR_DEVICES 2, 34
ISR_DEVICES 3, 35
ISR_DEVICES 4, 36
ISR_DEVICES 5, 37
ISR_DEVICES 6, 38
ISR_DEVICES 7, 39
ISR_DEVICES 8, 40
ISR_DEVICES 9, 41
ISR_DEVICES 10, 42
ISR_DEVICES 11, 43
ISR_DEVICES 12, 44
ISR_DEVICES 13, 45
ISR_DEVICES 14, 46
ISR_DEVICES 15, 47
| 13.979167
| 82
| 0.679881
|
c22c846fea46341473f9bda779c7ac44a1125e5b
| 33
|
asm
|
Assembly
|
pwn/b-64-b-tuff/solution/shellcode/shellcode.asm
|
BSidesSF/ctf-2017-release
|
6ee9f99764e096dc2d30499c531925897facc561
|
[
"MIT"
] | 130
|
2017-02-22T18:59:21.000Z
|
2022-01-16T13:05:40.000Z
|
pwn/b-64-b-tuff/solution/shellcode/shellcode.asm
|
BSidesSF/ctf-2017-release
|
6ee9f99764e096dc2d30499c531925897facc561
|
[
"MIT"
] | 3
|
2017-03-01T12:50:39.000Z
|
2019-12-20T04:55:28.000Z
|
pwn/b-64-b-tuff/solution/shellcode/shellcode.asm
|
BSidesSF/ctf-2017-release
|
6ee9f99764e096dc2d30499c531925897facc561
|
[
"MIT"
] | 27
|
2017-02-23T06:01:01.000Z
|
2022-01-16T13:05:44.000Z
|
bits 32
push 0x41414141
pop ebx
| 6.6
| 15
| 0.787879
|
e613272934bc020f7666f56cadf3fedb49edb7c0
| 1,647
|
asm
|
Assembly
|
src/Device.asm
|
sharksym/vgmplay-sharksym
|
d7763b87a379da4e6dadcc55026969d310957952
|
[
"BSD-2-Clause"
] | 6
|
2020-04-21T17:26:27.000Z
|
2021-09-25T18:41:01.000Z
|
src/Device.asm
|
sharksym/vgmplay-sharksym
|
d7763b87a379da4e6dadcc55026969d310957952
|
[
"BSD-2-Clause"
] | null | null | null |
src/Device.asm
|
sharksym/vgmplay-sharksym
|
d7763b87a379da4e6dadcc55026969d310957952
|
[
"BSD-2-Clause"
] | null | null | null |
;
; Sound device
;
Device: MACRO ?name, ?clock = 0
name:
dw ?name
clock:
dd ?clock
ENDM
; ix = this
Device_Construct:
res 6,(ix + Device.clock + 3)
res 7,(ix + Device.clock + 3)
ret
; ix = this
; dehl <- clock (Hz)
; a <- 0: clock is zero
; f <- z: clock is zero
Device_GetClock:
ld de,Device.clock
call Utils_GetDoubleWordIXOffset
res 7,d ; clear flag bits
res 6,d
ret
; ix = this
; dehl <- clock (Hz)
Device_SetClock:
ld (ix + Device.clock),l
ld (ix + Device.clock + 1),h
ld (ix + Device.clock + 2),e
ld (ix + Device.clock + 3),d
ret
; ix = this
; f <- nz: set
Device_GetFlagBit6:
bit 6,(ix + Device.clock + 3)
ret
; ix = this
; f <- nz: set
Device_GetFlagBit7:
bit 7,(ix + Device.clock + 3)
ret
; ix = this
Device_SetFlagBit6:
set 6,(ix + Device.clock + 3)
ret
; ix = this
Device_SetFlagBit7:
set 7,(ix + Device.clock + 3)
ret
; ix = this
; hl <- name
Device_GetName:
ld l,(ix + Device.name)
ld h,(ix + Device.name + 1)
ret
; hl = name
; ix = this
Device_SetName:
ld (ix + Device.name),l
ld (ix + Device.name + 1),h
ret
; ix = this
Device_PrintInfo:
call Device_GetName
call System_Print
ld hl,Device_infix
call System_Print
call Device_GetClock
call System_PrintDecDEHL
ld hl,Device_hz
jp System_Print
; ix = this
; bc = offset
; de = other device
; hl = interface
; hl <- next interface
Device_ConnectInterfaceAgain:
dec hl
dec hl
Device_ConnectInterface:
push hl
push ix
add ix,bc
call Interface_GetAddress
call Utils_DereferenceJump
ld (ix),l
ld (ix + 1),h
pop ix
pop hl
inc hl
inc hl
ret
;
Device_infix:
db ": ",0
Device_hz:
db " Hz",13,10 ;,0
Device_noName:
db 0
| 14.321739
| 33
| 0.658774
|
d5fb841e448af8556e582d40b3245d4399fd6e56
| 1,822
|
asm
|
Assembly
|
c65toc64wrapper.asm
|
gardners/raycaster
|
f0f2c5e2c3fb44fe391af0a736e6f850910e2760
|
[
"MIT"
] | 1
|
2020-06-29T15:09:55.000Z
|
2020-06-29T15:09:55.000Z
|
c65toc64wrapper.asm
|
gardners/raycaster
|
f0f2c5e2c3fb44fe391af0a736e6f850910e2760
|
[
"MIT"
] | null | null | null |
c65toc64wrapper.asm
|
gardners/raycaster
|
f0f2c5e2c3fb44fe391af0a736e6f850910e2760
|
[
"MIT"
] | null | null | null |
basic_header
;; Auto-detect C64/C65 mode and either way jump into the assembly
!byte 0x1f,0x20,0xe4,0x07,0x8b,0xc2,0x28,0x34,0x34,0x29,0xb2
!byte 0x38,0xa7,0x9e
!pet "2081"
!byte 0x3a,0xd5,0xfe,0x02,0x30,0x3a,0x9e
!pet "8225"
!byte 0x00,0x00,0x00
program_start
;; Set the memory mode to that of the C64
sei
lda #$37
sta $01
lda #0
tax
tay
taz
map
eom
;; Enable fast CPU for quick depack
lda #65
sta 0
;; Enable IO for DMA
lda #$47
sta $d02f
lda #$53
sta $d02f
;; Copy a helper routine to $0380 that DMAs the
;; memory down.
lda 44
cmp #$08
beq in_c64_mode
in_c65_mode:
ldx #$7f
- lda transfer_routine,x
sta $0380,x
dex
bpl -
jmp $0380
in_c64_mode:
ldx #$7f
- lda transfer_routine-$1800,x
sta $0380,x
dex
bpl -
jmp $0380
transfer_routine
!pseudopc $0380 {
;; Work out amount of shift for job, based on C64/C65 mode
lda 44
asl
asl
sec
sbc 44
sta $fd
lda #$20
sec
sbc $fd
sta dmalist_dst_msb
;; Set 45/46 for C64 mode from C65 mode end of BASIC marker
lda 44
bne +
lda $82
sta 45
lda $83
sta 46
lda #$01
sta 43
lda #$08
sta 44
+
;; Do transfer
lda #0
sta $0800 ; and clear $0800 if coming from C65 mode
sta $d702
lda #>dmalist
sta $d701
lda #<dmalist
sta $d705
;; Reset C64 mode KERNAL stuff
jsr $fda3 ; init I/O
jsr $fd15 ; set I/O vectors
jsr $ff5b ; more init
jsr $f7a9 ; C65 DOS reinit
;; Enter programme
jmp 2061
- inc $d020
jmp -
dmalist
;; F011A job, source and dest in 1st MB
!byte $0A,$80,$00,$81,$00,$00
;; Single copy of $DFFF bytes
!byte $00,$FF,$DF
;; From 2 bytes past end of the wrapper, to skip wrapper and load address
;; of the relocated programme
!byte 2+<end_of_wrapper
dmalist_dst_msb
!byte $20,$00
;; To $0801
!byte $01,$08,$00
;; No modulo
!byte 0,0
}
end_of_wrapper
| 14.693548
| 74
| 0.660263
|
f29c2346a1d58f6129c2ccac9e7043e659424e3d
| 328
|
asm
|
Assembly
|
programs/oeis/082/A082042.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/082/A082042.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/082/A082042.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | null | null | null |
; A082042: (n^2+1)n!.
; 1,2,10,60,408,3120,26640,252000,2620800,29756160,366508800,4869849600,69455232000,1058593536000,17174123366400,295534407168000,5377157001216000,103149354147840000,2080771454361600000
mov $1,$0
pow $1,2
lpb $0
mul $1,$0
mov $2,$3
cmp $2,0
add $3,$2
sub $0,$3
add $1,$0
lpe
mov $0,$1
add $0,1
| 20.5
| 184
| 0.707317
|
69ca9ea525cd72ad29303524a2f1213d0442f444
| 745
|
asm
|
Assembly
|
programs/oeis/040/A040032.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/040/A040032.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/040/A040032.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A040032: Continued fraction for sqrt(39).
; 6,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4
mul $0,-3
add $0,2
mod $0,6
div $0,2
pow $0,2
mov $1,$0
mul $1,2
add $1,4
| 62.083333
| 625
| 0.6
|
1d6727250e7cd76bde97e0ef404d1fd302d362fe
| 477
|
asm
|
Assembly
|
programs/oeis/047/A047470.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/047/A047470.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/047/A047470.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A047470: Numbers that are congruent to {0, 3} mod 8.
; 0,3,8,11,16,19,24,27,32,35,40,43,48,51,56,59,64,67,72,75,80,83,88,91,96,99,104,107,112,115,120,123,128,131,136,139,144,147,152,155,160,163,168,171,176,179,184,187,192,195,200,203,208,211,216,219,224,227,232,235,240,243,248,251,256,259,264,267,272,275,280,283,288,291,296,299,304,307,312,315,320,323,328,331,336,339,344,347,352,355,360,363,368,371,376,379,384,387,392,395
mov $1,4
mul $1,$0
mod $0,2
sub $1,$0
mov $0,$1
| 53
| 372
| 0.70021
|
28526c8faafe3bf76dbeb45bd2bfb8b37c6fdaa4
| 149
|
asm
|
Assembly
|
add42.asm
|
JLJL0308/x86_Assembly
|
7df1e30d236339d244c44f8a41879ad45b2e4912
|
[
"MIT"
] | null | null | null |
add42.asm
|
JLJL0308/x86_Assembly
|
7df1e30d236339d244c44f8a41879ad45b2e4912
|
[
"MIT"
] | null | null | null |
add42.asm
|
JLJL0308/x86_Assembly
|
7df1e30d236339d244c44f8a41879ad45b2e4912
|
[
"MIT"
] | null | null | null |
;Write a C function using Assembly.
global add42
add42:
push ebp
mov ebp, esp
mov eax, [ebp+8]
add eax, 42
mov esp, ebp
pop ebp
ret
| 13.545455
| 35
| 0.644295
|
e9965996158bdb20d158638b1dc7141b38261815
| 940
|
asm
|
Assembly
|
libsrc/rect/r_IntersectRect8.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/rect/r_IntersectRect8.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/rect/r_IntersectRect8.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; Rectangle, Intervals and Points
; 05.2006 aralbrec
SECTION code_clib
PUBLIC r_IntersectRect8
PUBLIC _r_IntersectRect8
EXTERN RIntersectRect8
; int r_IntersectRect8(struct r_Rect8 *r1, struct r_Rect8 *r2, struct r_Rect8 *result)
.r_IntersectRect8
._r_IntersectRect8
ld hl,7
add hl,sp
ld d,(hl)
dec hl
ld e,(hl)
dec hl
push hl
ex de,hl
ld b,(hl)
inc hl
ld c,(hl)
inc hl
ld d,(hl)
inc hl
ld e,(hl)
pop hl
push de
ld d,(hl)
dec hl
ld e,(hl)
dec hl
push hl
ex de,hl
ld d,(hl)
inc hl
ld e,(hl)
inc hl
push hl
exx
pop hl
ld d,(hl)
inc hl
ld e,(hl)
pop hl
pop bc
push hl
exx
call RIntersectRect8
pop hl
jr nc, no
ld d,(hl)
dec hl
ld e,(hl)
ex de,hl
ld (hl),b
inc hl
ld (hl),c
inc hl
push hl
exx
pop hl
ld (hl),b
inc hl
ld (hl),c
ld hl,1
ret
.no
ld hl,0
ret
| 12.051282
| 86
| 0.565957
|
f8c174bd105df9100f0bf197eca38d7229738848
| 6,108
|
asm
|
Assembly
|
non_regression/other_x86_linux_25.o.asm
|
LRGH/plasmasm
|
4cd50546c3dc895763d72dd60b7c46179c1916bc
|
[
"Apache-2.0"
] | 1
|
2021-02-28T21:31:18.000Z
|
2021-02-28T21:31:18.000Z
|
non_regression/other_x86_linux_25.o.asm
|
LRGH/plasmasm
|
4cd50546c3dc895763d72dd60b7c46179c1916bc
|
[
"Apache-2.0"
] | null | null | null |
non_regression/other_x86_linux_25.o.asm
|
LRGH/plasmasm
|
4cd50546c3dc895763d72dd60b7c46179c1916bc
|
[
"Apache-2.0"
] | null | null | null |
.file "(extract)pyexpat.c"
.section .rodata.str1.1,"a",@progbits
.LC00000000.str1.1:
.string "(NO&)"
.LC00000006.str1.1:
.string "ProcessingInstruction"
# ----------------------
.text
.local my_ProcessingInstructionHandler
.type my_ProcessingInstructionHandler, @function
my_ProcessingInstructionHandler:
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $44, %esp
movl 64(%esp), %esi
call __x86.get_pc_thunk.bx
.L00000010:
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 48(%esi), %eax
movl 8(%eax), %eax
testl %eax, %eax
je .L0000011C
.L00000024:
movl 32(%esi), %edx
testl %edx, %edx
je .L00000036
.L0000002B:
movl 40(%esi), %eax
testl %eax, %eax
jne .L00000128
.L00000036:
movl 12(%esi), %ebp
leal conv_string_to_unicode@GOTOFF(%ebx), %eax
leal conv_string_to_utf8@GOTOFF(%ebx), %edi
testl %ebp, %ebp
cmovne %eax, %edi
movl 68(%esp), %eax
movl %eax, (%esp)
call *%edi
.L00000053:
testl %eax, %eax
movl %eax, %ecx
je .L000001B0
.L0000005D:
movl 44(%esi), %eax
movl %ecx, %ebp
movl %ecx, 28(%esp)
testl %eax, %eax
je .L0000009A
.L0000006A:
movl %ecx, 4(%esp)
movl %eax, (%esp)
call PyDict_GetItem@PLT
.L00000076:
movl 28(%esp), %ecx
testl %eax, %eax
movl %eax, %edx
je .L0000018E
.L00000084:
addl $1, (%eax)
movl (%ebp), %eax
subl $1, %eax
testl %eax, %eax
movl %eax, (%ebp)
movl %edx, %ebp
je .L00000180
.L0000009A:
movl 72(%esp), %eax
movl %edi, 8(%esp)
movl %ebp, 4(%esp)
movl %eax, 12(%esp)
leal .LC00000000.str1.1@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call Py_BuildValue@PLT
.L000000B8:
testl %eax, %eax
movl %eax, %edi
je .L000001B8
.L000000C2:
movl 48(%esi), %eax
leal .LC00000006.str1.1@GOTOFF(%ebx), %edx
movl $1, 24(%esi)
movl 8(%eax), %ebp
movl $2, %eax
movl $645, (%esp)
call getcode
.L000000E6:
leal 8(%esi), %edx
movl %edx, 4(%esp)
movl %edi, (%esp)
movl %ebp, %edx
call call_with_frame.isra.9
.L000000F7:
movl $0, 24(%esi)
movl (%edi), %ecx
leal -1(%ecx), %edx
testl %edx, %edx
movl %edx, (%edi)
je .L00000168
.L00000109:
testl %eax, %eax
je .L0000023A
.L00000111:
movl (%eax), %ecx
leal -1(%ecx), %edx
testl %edx, %edx
movl %edx, (%eax)
je .L00000150
.L0000011C:
addl $44, %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.L00000124:
.p2align 3
.L00000128:
movl %eax, (%esp)
movl %esi, %eax
call call_character_handler
.L00000132:
movl $0, 40(%esi)
testl %eax, %eax
jns .L00000036
.L00000141:
addl $44, %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.L00000149:
.p2align 4
.L00000150:
movl 4(%eax), %edx
movl %eax, (%esp)
call *24(%edx)
.L00000159:
addl $44, %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.L00000161:
.p2align 3
.L00000168:
movl 4(%edi), %edx
movl %eax, 28(%esp)
movl %edi, (%esp)
call *24(%edx)
.L00000175:
movl 28(%esp), %eax
jmp .L00000109
.L0000017B:
.p2align 3
.L00000180:
movl 4(%ecx), %eax
movl %ecx, (%esp)
call *24(%eax)
.L00000189:
jmp .L0000009A
.L0000018E:
movl %ebp, 8(%esp)
movl %ebp, 4(%esp)
movl 44(%esi), %eax
movl %eax, (%esp)
call PyDict_SetItem@PLT
.L000001A1:
testl %eax, %eax
je .L0000009A
.L000001A9:
.p2align 4
.L000001B0:
xorl %ebp, %ebp
jmp .L0000009A
.L000001B7:
.p2align 3
.L000001B8:
movl handler_info@GOTOFF(%ebx), %edi
testl %edi, %edi
je .L00000220
.L000001C2:
leal handler_info@GOTOFF+4(%ebx), %edi
xorl %ebp, %ebp
jmp .L000001F5
.L000001CC:
.p2align 3
.L000001D0:
movl $0, 4(%esp)
movl 8(%esi), %edx
addl $4, %ebp
movl %edi, 28(%esp)
movl %edx, (%esp)
call *(%edi)
.L000001E7:
movl 28(%esp), %eax
addl $20, %edi
movl 16(%eax), %ecx
testl %ecx, %ecx
je .L00000220
.L000001F5:
movl 48(%esi), %edx
addl %ebp, %edx
movl (%edx), %eax
movl $0, (%edx)
testl %eax, %eax
je .L000001D0
.L00000206:
movl (%eax), %ecx
leal -1(%ecx), %edx
testl %edx, %edx
movl %edx, (%eax)
jne .L000001D0
.L00000211:
movl 4(%eax), %edx
movl %eax, (%esp)
call *24(%edx)
.L0000021A:
jmp .L000001D0
.L0000021C:
.p2align 3
.L00000220:
leal error_external_entity_ref_handler@GOTOFF(%ebx), %eax
movl %eax, 4(%esp)
movl 8(%esi), %eax
movl %eax, (%esp)
call XML_SetExternalEntityRefHandler@PLT
.L00000235:
jmp .L0000011C
.L0000023A:
movl handler_info@GOTOFF(%ebx), %edx
testl %edx, %edx
je .L00000220
.L00000244:
leal handler_info@GOTOFF+4(%ebx), %edi
xorl %ebp, %ebp
jmp .L00000275
.L0000024E:
.p2align 3
.L00000250:
movl $0, 4(%esp)
movl 8(%esi), %edx
addl $4, %ebp
movl %edi, 28(%esp)
movl %edx, (%esp)
call *(%edi)
.L00000267:
movl 28(%esp), %eax
addl $20, %edi
movl 16(%eax), %eax
testl %eax, %eax
je .L00000220
.L00000275:
movl 48(%esi), %edx
addl %ebp, %edx
movl (%edx), %eax
movl $0, (%edx)
testl %eax, %eax
je .L00000250
.L00000286:
movl (%eax), %ecx
leal -1(%ecx), %edx
testl %edx, %edx
movl %edx, (%eax)
jne .L00000250
.L00000291:
movl 4(%eax), %edx
movl %eax, (%esp)
call *24(%edx)
.L0000029A:
jmp .L00000250
.size my_ProcessingInstructionHandler, .-my_ProcessingInstructionHandler
# ----------------------
.hidden __stack_chk_fail_local
.ident "GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4"
.section .note.GNU-stack,"",@progbits
| 21.736655
| 73
| 0.541421
|
ce4dbc4f7ee655601db161e2a3591f7bf2c2d9d4
| 837
|
asm
|
Assembly
|
tests/relocate/relocation_multi_blocks.asm
|
fengjixuchui/sjasmplus
|
df0fabd2411bf89e23637fce46d273f52dafbe16
|
[
"BSD-3-Clause"
] | 220
|
2016-10-22T19:44:39.000Z
|
2022-03-29T20:57:04.000Z
|
tests/relocate/relocation_multi_blocks.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 153
|
2018-05-07T10:31:23.000Z
|
2022-03-30T04:35:59.000Z
|
tests/relocate/relocation_multi_blocks.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 51
|
2016-05-12T21:27:36.000Z
|
2022-03-27T15:16:16.000Z
|
; first relocation block
RELOCATE_START
ORG $1000
ASSERT 2 * relocate_count == relocate_size
ASSERT 4 == relocate_count
dw relocate_count
dw relocate_size
reloc1:
ld hl,reloc1 ; to be relocated
ld de,reloc2 ; to be relocated
ld bc,reloc2-reloc1
ld sp,absolute1
RELOCATE_END
; no relocation area
ORG $17DC
absolute1:
ld hl,reloc1
ld de,reloc2
ld bc,reloc2-reloc1
ld sp,absolute1
; second relocation block
RELOCATE_START
ORG $2000
ld hl,reloc1 ; to be relocated
ld de,reloc2 ; to be relocated
ld bc,reloc2-reloc1
ld sp,absolute1
reloc2:
RELOCATE_TABLE
RELOCATE_END
ASSERT 0 == __ERRORS__
ASSERT 0 == __WARNINGS__
| 18.6
| 49
| 0.580645
|
8eea18d38c34194afd082fb2c2fb2fe52a2e0d8e
| 1,144
|
asm
|
Assembly
|
libsrc/stdio/_vsnprintf.asm
|
Frodevan/z88dk
|
f27af9fe840ff995c63c80a73673ba7ee33fffac
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/stdio/_vsnprintf.asm
|
Frodevan/z88dk
|
f27af9fe840ff995c63c80a73673ba7ee33fffac
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/stdio/_vsnprintf.asm
|
Frodevan/z88dk
|
f27af9fe840ff995c63c80a73673ba7ee33fffac
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
MODULE _vsnprintf
SECTION code_clib
PUBLIC _vsnprintf
EXTERN asm_printf
EXTERN sprintf_outc
;void vsnprintf(char *buf, size_t, char *fmt,va_list ap)
; int vfprintf1(FILE *fp, void __CALLEE__ (*output_fn)(int c,FILE *fp), int sccz80, unsigned char *fmt,void *ap)
_vsnprintf:
ld hl,2
add hl,sp ;&buf
IF !__CPU_INTEL__ && !__CPU_GBZ80__
push ix
ENDIF
ld c,(hl) ;buf
inc hl
ld b,(hl)
inc hl
ld e,(hl) ;len
inc hl
ld d,(hl)
inc hl
push de
push bc
ex de,hl
ld hl,0
add hl,sp
push hl ;save fp
ld bc,sprintf_outc
push bc
ld bc,0 ;sdcc
push bc
ex de,hl
ld c,(hl)
inc hl
ld b,(hl)
inc hl
push bc ;fmt
ld c,(hl)
inc hl
ld b,(hl)
push bc ;ap
call asm_printf
ex de,hl
ld hl,10+4
add hl,sp
ld sp,hl
ex de,hl
IF !__CPU_INTEL__ && !__CPU_GBZ80__
pop ix
ENDIF
ret
| 18.451613
| 112
| 0.471154
|
7bdf65901d1f629bd2a2b812282a0735f0a7608d
| 1,604
|
asm
|
Assembly
|
programs/oeis/175/A175848.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/175/A175848.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/175/A175848.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A175848: Partial sums of ceiling(n^2/16).
; 0,1,2,3,4,6,9,13,17,23,30,38,47,58,71,86,102,121,142,165,190,218,249,283,319,359,402,448,497,550,607,668,732,801,874,951,1032,1118,1209,1305,1405,1511,1622,1738,1859,1986,2119,2258,2402,2553,2710,2873,3042,3218,3401,3591,3787,3991,4202,4420,4645,4878,5119,5368,5624,5889,6162,6443,6732,7030,7337,7653,7977,8311,8654,9006,9367,9738,10119,10510,10910,11321,11742,12173,12614,13066,13529,14003,14487,14983,15490,16008,16537,17078,17631,18196,18772,19361,19962,20575,21200,21838,22489,23153,23829,24519,25222,25938,26667,27410,28167,28938,29722,30521,31334,32161,33002,33858,34729,35615,36515,37431,38362,39308,40269,41246,42239,43248,44272,45313,46370,47443,48532,49638,50761,51901,53057,54231,55422,56630,57855,59098,60359,61638,62934,64249,65582,66933,68302,69690,71097,72523,73967,75431,76914,78416,79937,81478,83039,84620,86220,87841,89482,91143,92824,94526,96249,97993,99757,101543,103350,105178,107027,108898,110791,112706,114642,116601,118582,120585,122610,124658,126729,128823,130939,133079,135242,137428,139637,141870,144127,146408,148712,151041,153394,155771,158172,160598,163049,165525,168025,170551,173102,175678,178279,180906,183559,186238,188942,191673,194430,197213,200022,202858,205721,208611,211527,214471,217442,220440,223465,226518,229599,232708,235844,239009,242202,245423,248672,251950,255257,258593,261957,265351,268774,272226,275707,279218,282759,286330,289930,293561,297222,300913,304634,308386,312169,315983,319827,323703
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
pow $0,2
add $0,15
div $0,16
add $1,$0
lpe
| 106.933333
| 1,445
| 0.797382
|
c2d4ba753d102b6a90210134098bd6589e8a3a74
| 479
|
asm
|
Assembly
|
oeis/344/A344131.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/344/A344131.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/344/A344131.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A344131: a(n+1) = (8*n^2+8*n+3)*a(n) - 16*n^4*a(n-1), with a(0)=0, a(1)=1.
; Submitted by Jamie Morken(s4)
; 0,1,19,713,45963,4571521,651249603,125978555961,31797923989563,10154867346496881,4003950222788879475,1910709271283079616425,1085491754899149563498475,724022706189621081117571425,560305448143863386421257597475,497969168730434344111574554745625
mov $2,1
lpb $0
mov $1,$0
add $1,$0
sub $0,1
pow $1,2
mul $3,$1
add $3,$2
mul $2,$1
sub $2,$3
lpe
mov $0,$3
| 28.176471
| 244
| 0.716075
|
67c06b7c7927f81967eb3526b248712c0874a806
| 730
|
asm
|
Assembly
|
programs/oeis/064/A064264.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/064/A064264.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/064/A064264.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A064264: a(n) = 19*n mod 30.
; 0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21,10,29,18,7,26,15,4,23,12,1,20,9,28,17,6,25,14,3,22,11,0,19,8,27,16,5,24,13,2,21
mul $0,49
mod $0,30
mov $1,$0
| 104.285714
| 667
| 0.616438
|
fb5febe61bc63767975b482bd1cf5f835776cd14
| 535
|
asm
|
Assembly
|
programs/oeis/055/A055679.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/055/A055679.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/055/A055679.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A055679: Number of distinct prime factors of phi(n!).
; 0,0,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15
mov $2,$0
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
mov $3,$0
div $0,2
seq $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
add $3,1
mul $3,$0
div $3,2
mod $3,2
add $1,$3
lpe
mov $0,$1
| 26.75
| 244
| 0.581308
|
086be79af858ef5c6721ca17403d2496ae3dfd6e
| 372
|
asm
|
Assembly
|
programs/oeis/179/A179020.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/179/A179020.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/179/A179020.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A179020: Doubled Thue-Morse sequence: the A010059 sequence replacing 0 with 0,0 and 1 with 1,1.
; 1,1,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0,0,0,1,1,0
div $0,2
lpb $0
add $1,$0
div $0,2
lpe
gcd $1,2
sub $1,1
| 33.818182
| 211
| 0.569892
|
e5816a07d1c5970475ef4a7a52b996233a461fde
| 476
|
asm
|
Assembly
|
oeis/133/A133730.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/133/A133730.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/133/A133730.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A133730: Alternating sign sequence A033999 interleaved with Jacobsthal sequence A001045.
; Submitted by Jon Maiga
; 1,0,-1,1,1,1,-1,3,1,5,-1,11,1,21,-1,43,1,85,-1,171,1,341,-1,683,1,1365,-1,2731,1,5461,-1,10923,1,21845,-1,43691,1,87381,-1,174763,1,349525,-1,699051,1,1398101,-1,2796203,1,5592405,-1,11184811,1,22369621,-1,44739243,1
mov $2,1
lpb $0
sub $0,2
mul $1,2
add $1,$2
div $2,-1
lpe
mul $2,2
lpb $0
div $0,4
mov $2,$1
add $2,$1
lpe
mov $0,$2
div $0,2
| 23.8
| 218
| 0.653361
|
b556097fb32e296643b782d631e5d0715eeb6753
| 820
|
asm
|
Assembly
|
libsrc/gfx/narrow/bksave2.asm
|
ahjelm/z88dk
|
c4de367f39a76b41f6390ceeab77737e148178fa
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/gfx/narrow/bksave2.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/gfx/narrow/bksave2.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
;
; Fast background save
;
; Generic version (just a bit slow)
;
; $Id: bksave2.asm $
;
IF !__CPU_INTEL__ & !__CPU_GBZ80__
SECTION code_clib
PUBLIC bksave
PUBLIC _bksave
EXTERN getsprite_sub
.bksave
._bksave
push ix
ld hl,4
add hl,sp
ld e,(hl)
inc hl
ld d,(hl)
inc hl
push de ;sprite address
pop ix
ld e,(hl)
inc hl
inc hl
ld d,(hl) ; x and y __gfx_coords
ld b,(ix+0) ; x sz
ld c,(ix+1) ; y sx
inc ix
inc ix
ld (ix+0),d ; x pos
ld (ix+1),e ; y pos
inc ix
inc ix
; now we create the sprite struct
ld (ix+0),b ; x sz
ld (ix+1),c ; y sz
jp getsprite_sub
ENDIF
| 15.471698
| 42
| 0.460976
|
c857f021a9bf343f17642f04a78afa020c658b4c
| 1,937
|
asm
|
Assembly
|
src/test/resources/data/generationtests/sjasm-pletter-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 36
|
2020-06-29T06:52:26.000Z
|
2022-02-10T19:41:58.000Z
|
src/test/resources/data/generationtests/sjasm-pletter-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 39
|
2020-07-02T18:19:34.000Z
|
2022-03-27T18:08:54.000Z
|
src/test/resources/data/generationtests/sjasm-pletter-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 7
|
2020-07-02T06:00:05.000Z
|
2021-11-28T17:31:13.000Z
|
__sjasm_page_0_start:
pletter._unpack:
ld a, (hl)
inc hl
exx
ld de, 0
add a, a
inc a
rl e
add a, a
rl e
add a, a
rl e
rl e
ld hl, pletter._modes
add hl, de
ld e, (hl)
db #dd, #6b ; ld ixl,e
inc hl
ld e, (hl)
db #dd, #63 ; ld ixh,e
ld e, 1
exx
ld iy, pletter.loop
pletter.literal:
ldi
pletter.loop:
add a, a
call z, pletter.getbit
jr nc, pletter.literal
exx
ld h, d
ld l, e
pletter.getlen:
add a, a
call z, pletter.getbitexx
jr nc, pletter._lenok
pletter._lus:
add a, a
call z, pletter.getbitexx
adc hl, hl
ret c
add a, a
call z, pletter.getbitexx
jr nc, pletter._lenok
add a, a
call z, pletter.getbitexx
adc hl, hl
ret c
add a, a
call z, pletter.getbitexx
jp c, pletter._lus
pletter._lenok:
inc hl
exx
ld c, (hl)
inc hl
ld b, 0
bit 7, c
jp z, pletter._offsok
jp (ix)
pletter.mode7:
add a, a
call z, pletter.getbit
rl b
pletter.mode6:
add a, a
call z, pletter.getbit
rl b
pletter.mode5:
add a, a
call z, pletter.getbit
rl b
pletter.mode4:
add a, a
call z, pletter.getbit
rl b
pletter.mode3:
add a, a
call z, pletter.getbit
rl b
pletter.mode2:
add a, a
call z, pletter.getbit
rl b
add a, a
call z, pletter.getbit
jr nc, pletter._offsok
or a
inc b
res 7, c
pletter._offsok:
inc bc
push hl
exx
push hl
exx
ld l, e
ld h, d
sbc hl, bc
pop bc
ldir
pop hl
jp (iy)
pletter.getbit:
ld a, (hl)
inc hl
rla
ret
pletter.getbitexx:
exx
ld a, (hl)
inc hl
exx
rla
ret
pletter._modes:
dw pletter._offsok
dw pletter.mode2
dw pletter.mode3
dw pletter.mode4
dw pletter.mode5
dw pletter.mode6
dw pletter.mode7
__sjasm_page_0_end:
| 15.496
| 29
| 0.558596
|
93909e21f4a6c0e6e72757f2aa8618cdc3439f44
| 601
|
asm
|
Assembly
|
oeis/054/A054880.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/054/A054880.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/054/A054880.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A054880: a(n) = 3*(9^n - 1)/4.
; Submitted by Christian Krause
; 0,6,60,546,4920,44286,398580,3587226,32285040,290565366,2615088300,23535794706,211822152360,1906399371246,17157594341220,154418349070986,1389765141638880,12507886274749926,112570976472749340,1013138788254744066,9118249094292696600,82064241848634269406,738578176637708424660,6647203589739375821946,59824832307654382397520,538423490768889441577686,4845811416920004974199180,43612302752280044767792626,392510724770520402910133640,3532596522934683626191202766,31793368706412152635720824900
mov $1,9
pow $1,$0
mov $0,$1
div $0,8
mul $0,6
| 60.1
| 487
| 0.865225
|
8ead6b5528c6fb645d9b863860fa178bd4f916a9
| 411
|
asm
|
Assembly
|
oeis/086/A086406.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/086/A086406.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/086/A086406.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A086406: Main diagonal of number array A086404.
; Submitted by Christian Krause
; 1,2,11,84,857,10984,169803,3076688,63968273,1501465248,39277112843,1133193163840,35748951528681,1224258310112384,45233097633685643,1793524939926112512,75966131556225961121,3423203234058532082176
mov $1,$0
mov $2,1
mov $3,1
lpb $0
sub $0,1
mov $4,$3
mul $3,$1
add $3,$2
mul $2,$1
mul $4,3
add $2,$4
lpe
mov $0,$3
| 22.833333
| 196
| 0.739659
|
d0d65b99ed78c41fe5e62b0716b1b8f1add5ec09
| 653
|
asm
|
Assembly
|
oeis/037/A037916.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/037/A037916.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/037/A037916.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A037916: Concatenate exponents in prime factorization of n.
; Submitted by Christian Krause
; 0,1,1,2,1,11,1,3,2,11,1,21,1,11,11,4,1,12,1,21,11,11,1,31,2,11,3,21,1,111,1,5,11,11,11,22,1,11,11,31,1,111,1,21,21,11,1,41,2,12,11,21,1,13,11,31,11,11,1,211,1,11,21,6,11,111,1,21,11,111,1,32,1,11,12,21,11,111,1,41,4,11,1,211,11,11,11,31,1,121,11,21,11,11,11,51,1,12,21,22
add $0,1
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mov $6,$2
cmp $6,0
add $2,$6
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
lpe
lpb $0
dif $0,$2
add $7,2
lpe
mul $7,10
lpe
mov $0,$7
div $0,20
| 21.766667
| 273
| 0.56049
|
6647e184a1d4c5d3b45a7a1003d140c1fc098167
| 1,255
|
asm
|
Assembly
|
SourceCode/cubeOfElementsInAnArrayWithOutputInASCII.asm
|
Nuthi-Sriram/Assembly-Level-Code-for-8086
|
616b651c913863d6151ae49f409762fe5d707b74
|
[
"MIT"
] | null | null | null |
SourceCode/cubeOfElementsInAnArrayWithOutputInASCII.asm
|
Nuthi-Sriram/Assembly-Level-Code-for-8086
|
616b651c913863d6151ae49f409762fe5d707b74
|
[
"MIT"
] | null | null | null |
SourceCode/cubeOfElementsInAnArrayWithOutputInASCII.asm
|
Nuthi-Sriram/Assembly-Level-Code-for-8086
|
616b651c913863d6151ae49f409762fe5d707b74
|
[
"MIT"
] | null | null | null |
.model small
.stack
.data
arr dw 50 dup (?)
n db ?
.code
.startup
mov ah,01h
int 21h
sub al,30h
mov n,al
mov bl,al
add bl,1
mov cx,0
mov cl,n
mov ah,01h
;Taking the input into array
input:
mov ah,01h
int 21h
aaa
cbw
mov arr[si],ax
inc si
inc si
loop input
;Finding the cube
mov si,0
mov cx,0
mov cl,n
cubeArray:
mov cx,0
mov cl,2
mov ax,arr[si]
cube:
mul arr[si]
loop cube:
mov arr[si],ax
inc si
inc si
dec bl
mov cl,bl
loop cubeArray
mov si,0
mov cx,0
mov cl,n
output:
mov ax,arr[si]
;convert into ascii values
cmp ah,'A'
jz late
cmp ah,'B'
jz late
cmp ah,'C'
jz late
cmp ah,'D'
jz late
cmp ah,'E'
jz late
cmp ah,'F'
jz late
jnz early
clamp:
cmp al,'A'
jz late1
cmp al,'B'
jz late1
cmp al,'C'
jz late1
cmp al,'D'
jz late1
cmp al,'E'
jz late1
cmp al,'F'
jz late1
jnz early1
late:
;output(units digit)
mov bh,ah
add bh,57h
mov dl,bh
mov ah,02h
int 21h
jmp clamp
early:
;output(units digit)
mov bh,ah
add ah,30h
mov dl,bh
mov ah,02h
int 21h
jmp clamp
late1:
;output(tens digit)
mov bl,al
add al,57h
mov dl,bl
mov ah,02h
int 21h
jmp revisit
early1:
;output(tens digit)
mov bl,al
add al,30h
mov dl,bl
mov ah,02h
int 21h
revisit:
inc si
loop output
end
| 10.286885
| 37
| 0.648606
|
61c293382c63a7db5dacf8430a2ea9601c3a5371
| 6,189
|
asm
|
Assembly
|
Driver/Printer/HP/Test/testUI.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Driver/Printer/HP/Test/testUI.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Driver/Printer/HP/Test/testUI.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: Test Printer Driver
FILE: testUI.asm
AUTHOR: Don Reeves, Jul 10, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
don 7/10/94 Initial revision
DESCRIPTION:
Contains code to implement the UI displayed by the test
printer driver.
$Id: testUI.asm,v 1.1 97/04/18 11:52:33 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
idata segment
TestTextClass
TestControlClass
idata ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintEvalUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Looks in the device info for the appropriate routine to call
to evaluate the data passed in the object tree.
CALLED BY: EXTERNAL
PASS: AX = Handle of JobParameters block
BX = Handle of the duplicated generic tree
displayed in the main print dialog box.
DX = Handle of the duplicated generic tree
displayed in the options dialog box
ES:SI = JobParameters structure
BP = PState segment
RETURN: Carry = clear
- or -
Carry = set
CX = handle of block holding error message
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 7/10/94 Initial revision
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrintEvalUI proc far
.enter
clc
.leave
ret
PrintEvalUI endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintStuffUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Stuffs the info stored in JobParameters back into the
generic tree.
CALLED BY: EXTERNAL
PASS: BP = PState segment
CX = Handle of the duplicated generic tree
displayed in the main print dialog box.
DX = Handle of the duplicated generic tree
displayed in the options dialog box
ES:SI = JobParameters structure
AX = Handle of JobParameters block
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 7/10/94 Initial revision
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrintStuffUI proc far
.enter
clc
.leave
ret
PrintStuffUI endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TestControlGetInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get information about the PageSize controller
CALLED BY: GLOBAL (MSG_GEN_CONTROL_GET_INFO)
PASS: DS:*SI = TestControlClass object
DS:DI = TestControlClassInstance
CX:DX = GenControlBuildInfo structure to fill
RETURN: Nothing
DESTROYED: AX, BX, CX, DI, SI, BP, DS, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/24/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TestControlGetInfo method dynamic TestControlClass,
MSG_GEN_CONTROL_GET_INFO
.enter
; Copy the data into the structure
;
mov ax, ds
mov bx, di ; PageSizeCtrlInstance => AX:BX
mov bp, dx
mov es, cx
mov di, dx ; buffer to fill => ES:DI
segmov ds, cs
mov si, offset TC_dupInfo
mov cx, size GenControlBuildInfo
rep movsb
.leave
ret
TestControlGetInfo endm
TC_dupInfo GenControlBuildInfo <
mask GCBF_NOT_REQUIRED_TO_BE_ON_SELF_LOAD_OPTIONS_LIST,
; GCBI_flags
TC_iniKey, ; GCBI_initFileKey
TC_gcnList, ; GCBI_gcnList
length TC_gcnList, ; GCBI_gcnCount
TC_notifyList, ; GCBI_notificationList
length TC_notifyList, ; GCBI_notificationCount
0, ; GCBI_controllerName
handle TestControlUI, ; GCBI_dupBlock
TC_childList, ; GCBI_childList
length TC_childList, ; GCBI_childCount
TC_featuresList, ; GCBI_featuresList
length TC_featuresList, ; GCBI_featuresCount
TC_DEFAULT_FEATURES, ; GCBI_features
0, ; GCBI_toolBlock
0, ; GCBI_toolList
0, ; GCBI_toolCount
0, ; GCBI_toolFeaturesList
0, ; GCBI_toolFeaturesCount
0, ; GCBI_toolFeatures
TC_helpContext, ; GCBI_helpContext
0> ; GCBI_reserved
TC_iniKey char "testControl", 0
TC_gcnList GCNListType \
<MANUFACTURER_ID_GEOWORKS, \
GAGCNLT_APP_NOTIFY_DOC_SIZE_CHANGE>
TC_notifyList NotificationType \
<MANUFACTURER_ID_GEOWORKS, GWNT_SPOOL_DOC_OR_PAPER_SIZE>
TC_childList GenControlChildInfo \
<offset PageTypeList,
mask TCF_PAGE_TYPE,
mask GCCF_IS_DIRECTLY_A_FEATURE>
TC_featuresList GenControlFeaturesInfo \
<offset PageTypeList, 0, 0>
TC_helpContext char "dbPageSize", 0
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TestControlDetach
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Detach the object
CALLED BY: GLOBAL (MSG_META_DETACH)
PASS: *DS:SI = TestControlClass object
DS:DI = TestControlClassInstance
RETURN: Nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 7/10/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TestControlDetach method dynamic TestControlClass, MSG_META_DETACH
; Verify our class is valid, and then call superclass
;
mov di, offset TestControlClass
EC < call ECCheckClass >
GOTO ObjCallSuperNoLock
TestControlDetach endm
| 24.657371
| 79
| 0.55631
|
5f2ec3702876410a8d8bac73afe155ed053e6865
| 787
|
asm
|
Assembly
|
dv3/q40/fd/wait.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
dv3/q40/fd/wait.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
dv3/q40/fd/wait.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; DV3 Q40 Wait for Ticks 1994 Tony Tebby
section fd
xdef fd_wait
include 'dev8_keys_sys'
include 'dev8_keys_q40'
;+++
; Wait for ticks
;
; d0 c r number of ticks / 0
;
;---
fd_wait
move.l d1,-(sp)
move.w sr,d1 ; are interrupts disabled?
and.w #$0700,d1
beq.s fdw_mpoll ; ... no, count missing polls
fdw_wframe
btst #Q40..frame,q40_ir ; frame interrupt?
beq.s fdw_wframe ; ... no
st q40_fack ; clear interrupt flag
subq.w #1,d0 ; one gone
bpl.s fdw_wframe
bra.s fdw_exit
fdw_mpoll
add.w sys_pict(a6),d0
bvc.s fdw_mploop ; ok
sub.w sys_pict(a6),d0 ; ... bad
sub.w d0,sys_pict(a6) ; ... backspace the counter a bit
bra.s fdw_mpoll
fdw_mploop
cmp.w sys_pict(a6),d0
bhi.s fdw_mploop
fdw_exit
move.l (sp)+,d1
moveq #0,d0
rts
end
| 17.108696
| 58
| 0.659466
|
d1b90fd0b024afccc3f6efd3a33d9de8ffac60d3
| 2,498
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_206_1648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_206_1648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_206_1648.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 %r14
push %r8
push %rbx
push %rdi
lea addresses_normal_ht+0x10772, %r12
nop
xor $17279, %r10
movb (%r12), %r14b
nop
nop
nop
inc %r10
lea addresses_WC_ht+0xfa0, %r8
clflush (%r8)
nop
nop
nop
nop
dec %rdi
mov $0x6162636465666768, %rbx
movq %rbx, (%r8)
nop
nop
nop
and %r8, %r8
pop %rdi
pop %rbx
pop %r8
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %r15
push %r8
push %r9
// Store
lea addresses_normal+0x8cca, %r10
nop
add %r15, %r15
mov $0x5152535455565758, %r8
movq %r8, %xmm5
vmovups %ymm5, (%r10)
inc %r14
// Store
lea addresses_WC+0x158ca, %r10
nop
nop
cmp %r13, %r13
mov $0x5152535455565758, %r14
movq %r14, %xmm1
movups %xmm1, (%r10)
nop
nop
nop
cmp %r10, %r10
// Faulty Load
lea addresses_normal+0x8cca, %r8
nop
nop
nop
nop
cmp $64453, %r14
mov (%r8), %r11w
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'58': 206}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 23.790476
| 617
| 0.655324
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.