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
188f97d59a3d62a51c8a5b6f060374180a4f61ff
6,517
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1562.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_1562.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_1562.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 %r8 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x4c3d, %rsi lea addresses_WT_ht+0x763d, %rdi nop nop nop nop nop cmp $35138, %rdx mov $48, %rcx rep movsw nop nop nop nop nop inc %r11 lea addresses_WT_ht+0xbffd, %rsi lea addresses_A_ht+0xe29d, %rdi nop nop nop nop dec %r8 mov $53, %rcx rep movsl cmp %rdx, %rdx lea addresses_A_ht+0xfa3d, %rdi nop nop nop nop cmp $4736, %r10 mov $0x6162636465666768, %rdx movq %rdx, (%rdi) nop nop xor $35030, %rcx lea addresses_WT_ht+0x1be3d, %rsi lea addresses_A_ht+0x18e3d, %rdi nop nop sub $50511, %r9 mov $69, %rcx rep movsw nop nop nop nop inc %rdi lea addresses_normal_ht+0x1b63d, %rsi lea addresses_D_ht+0x1557d, %rdi nop nop nop nop and %rdx, %rdx mov $21, %rcx rep movsl nop nop and %r11, %r11 lea addresses_WC_ht+0x8a1a, %r8 nop nop nop cmp %rcx, %rcx mov (%r8), %r11 nop and %r8, %r8 lea addresses_WT_ht+0xe331, %rsi nop xor $46665, %r9 vmovups (%rsi), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %rdi add %r9, %r9 lea addresses_D_ht+0x18d3d, %rsi nop nop xor %rcx, %rcx mov (%rsi), %r9w nop sub $46528, %r9 lea addresses_A_ht+0x171c1, %rsi sub $63857, %r11 movb (%rsi), %dl nop nop nop nop nop sub $29456, %rsi lea addresses_normal_ht+0xe05, %rsi lea addresses_normal_ht+0x7dae, %rdi nop nop nop nop nop and %r11, %r11 mov $42, %rcx rep movsw nop nop nop nop and $60953, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r15 push %rdi push %rdx // Faulty Load lea addresses_D+0x1e63d, %r12 nop nop dec %r13 movb (%r12), %r15b lea oracles, %rdx and $0xff, %r15 shlq $12, %r15 mov (%rdx,%r15,1), %r15 pop %rdx pop %rdi pop %r15 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
37.24
2,999
0.659966
c258c054c52e324910bf7f9d5d7bb0b73d338963
4,535
asm
Assembly
maincomsave e pa.asm
Potolski/OAC_2018_2_LAB_1
7d1eb0c4999649230bf6cede38abb4a0b7560e5d
[ "MIT" ]
1
2018-09-18T13:32:36.000Z
2018-09-18T13:32:36.000Z
maincomsave e pa.asm
Potolski/OAC_2018_2_LAB_1
7d1eb0c4999649230bf6cede38abb4a0b7560e5d
[ "MIT" ]
null
null
null
maincomsave e pa.asm
Potolski/OAC_2018_2_LAB_1
7d1eb0c4999649230bf6cede38abb4a0b7560e5d
[ "MIT" ]
1
2018-10-16T13:51:28.000Z
2018-10-16T13:51:28.000Z
.globl exitMessage .include "macros.asm" .include "fileops.asm" .data image: .space 1048576 # (4 * words amount) imageRows: .word 512 imageCols: .word 512 inFilename: .asciiz "img.bmp" #defines filename for opening exitMessage: .asciiz "Something went wrong" backtomain: .asciiz "back to main" mainmenu: .asciiz "selecione uma operacao:\n1)blur\n2)edge extractor\n3)binarizacao\n4)exit\n5)save\n" errormain: .asciiz "opcao invalida, selecione uma opcao listada." kernelmenu: .asciiz "selecione o tamanho do kernel:\n1)3x3\n2)5x5\n3) 7x7\n" binamenu: .asciiz "escolha uma intensidade de 1 a 10:\n" filename: .asciiz "saida.bmp" buffer: .space 786486 bufferend: .space 2 .macro menu(%image_pointer,%size) move $t0, %image_pointer start: addi $v0, $zero, 4 #loads v0 for print syscall la $a0, mainmenu #printcontent adress syscall addi $v0, $zero, 5 #loads v0 for read int syscall syscall #saves value to v0 #all read syscalls request int numbers.Any other input will trigger coproc0. beq $v0, 1, blurm #if 1 is chosen, go to blur menu beq $v0, 2, edgem #if 2 is chosen, go to edge extractor menu beq $v0, 3, binam #if 3 is chosen, go to binary threshold menu beq $v0, 4, exit #if 4 is chosen, exit program beq $v0, 5, save #if 5 is chose, save file #if the user types any other value, a error message is printed addi $v0, $zero, 4 #loads v0 for print syscall la $a0, errormain #error message adress syscall j start blurm: #blur menu addi $v0, $zero, 4 #loads v0 for print syscall la $a0, kernelmenu #print content adress syscall blurread: addi $v0, $zero, 5 #loads v0 for read syscall syscall #saves value to v0 #from bge to contblur, checks if the typed value is beetween 1 and 3. if it isn't, requests another value bge $v0,1,condblur1 j blurread condblur1: ble $v0,3,contblur j blurread contblur: move $a0, $t0 beq $v0,1,blur3b beq $v0,2,blur5b beq $v0,3,blur7b blur3b: Blur3 ($a0, $v0) move $t0, $a0 j start #returns to main menu blur5b: Blur5 ($a0, $v0) move $t0, $a0 j start #returns to main menu blur7b: Blur7 ($a0, $v0) move $t0, $a0 j start #returns to main menu edgem: #edge extractor menu addi $v0, $zero, 4 #loads v0 for print syscall la $a0, kernelmenu #print content adress syscall edgeread: addi $v0, $zero, 5 #loads v0 for read syscall syscall #saves value to v0 ##from bge to contedge, checks if the typed value is beetween 1 and 3. if it isn't, requests another value bge $v0,1,condedge1 j edgeread condedge1: ble $v0,3,contedge j edgeread contedge: j start #returns to main menu binam: #binary threshold menu addi $v0, $zero, 4 #loads v0 for print syscall la $a0, binamenu #print content adress syscall binaread: addi $v0, $zero, 5 #loads v0 for read int syscall syscall #saves value to v0 ##from bge to contbina, checks if the typed value is beetween 1 and 10. if it isn't, requests another value bge $v0,1,condbina1 j binaread condbina1: ble $v0,10,contbina j binaread contbina: move $a0, $t0 showBlackWhite ($a0, %size,$v0) #bitrfgoojapsodODS JOSJD move $t0, $a0 j start save: la $a0,image la $a1,buffer addi $a1,$a1,54 org_buffer($a0,$a1) file_open: li $v0, 13 la $a0, filename li $a1, 1 li $a2, 0 syscall # File descriptor gets returned in $v0 file_write: # Syscall 15 requieres file descriptor in $a0 move $a0, $v0 li $v0, 15 la $a1, buffer la $a2, bufferend la $a3, buffer subu $a2, $a2, $a3 # computes the length of the string, this is really a constant syscall file_close: li $v0, 16 # $a0 already has the file descriptor j start exit: .end_macro .text main: la $a0, inFilename openFile($a0) move $s0, $v0 la $a1, buffer readFile($s0, $a1) move $s4, $v0 la $s6, buffer closeFile($s0) # At this point the register values are: # $s0: file descriptor # $s4: nchars read by readFile # $s6: buffer pointer # prepare loadImage args # a0: pointer to buffer start # a1: image pointer # a2: iterator (starts at 0) # adds 0 to word, once bit map saves in 3-3bytes groups (RGB) la $a0, image move $s2, $s4 addi $s2,$s2,-54 li $t0,3 divu $s2,$s2,$t0 sll $s2,$s2,2 loadImage($s6, $a0, $s4) # prepares showImage args # a0: pointer to buffer start # a1: rowXcols value (once buffer is a memory array) la $a0,image menu($a0,$s2) li $v0, 4 la $a0, backtomain syscall li $v0, 10 syscall
25.055249
109
0.675413
c83d4dbe5715339fab1c71abe97174c4c8045c4b
671
asm
Assembly
oeis/219/A219394.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/219/A219394.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/219/A219394.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A219394: Numbers k such that 17*k+1 is a square. ; 0,15,19,64,72,147,159,264,280,415,435,600,624,819,847,1072,1104,1359,1395,1680,1720,2035,2079,2424,2472,2847,2899,3304,3360,3795,3855,4320,4384,4879,4947,5472,5544,6099,6175,6760,6840,7455,7539,8184,8272,8947,9039,9744,9840,10575,10675,11440,11544,12339,12447,13272,13384,14239,14355,15240,15360,16275,16399,17344,17472,18447,18579,19584,19720,20755,20895,21960,22104,23199,23347,24472,24624,25779,25935,27120,27280,28495,28659,29904,30072,31347,31519,32824,33000,34335,34515,35880,36064,37459,37647 mov $2,13 mov $3,$0 add $3,1 div $3,2 pow $3,2 mul $2,$3 mov $1,$2 add $1,$0 mov $4,$0 mul $4,$0 add $1,$4 mov $0,$1
41.9375
501
0.748137
ecc0b91e16fa28a705b07a9f20a176e513cd044e
7,929
asm
Assembly
tools/asmx2/test/1802.asm
retro16/blastsdk
572bd8489e6a2c1cc638120aa62241c99badc2e5
[ "MIT" ]
10
2017-01-14T16:22:58.000Z
2021-02-16T21:41:48.000Z
tools/asmx2/test/1802.asm
retro16/blastsdk
572bd8489e6a2c1cc638120aa62241c99badc2e5
[ "MIT" ]
3
2016-09-15T21:45:34.000Z
2016-09-17T08:06:06.000Z
tools/asmx2/test/1802.asm
retro16/blastsdk
572bd8489e6a2c1cc638120aa62241c99badc2e5
[ "MIT" ]
2
2016-09-15T22:09:38.000Z
2018-05-21T15:26:30.000Z
; all 1802 opcodes IDL ; 00 wait for interrupt or DMA LDN R1 ; 01 D = M(R1) LDN R2 ; 02 D = M(R2) LDN R3 ; 03 D = M(R3) LDN R4 ; 04 D = M(R4) LDN R5 ; 05 D = M(R5) LDN R6 ; 06 D = M(R6) LDN R7 ; 07 D = M(R7) LDN R8 ; 08 D = M(R8) LDN R9 ; 09 D = M(R9) LDN RA ; 0A D = M(RA) LDN RB ; 0B D = M(RB) LDN RC ; 0C D = M(RC) LDN RD ; 0D D = M(RD) LDN RE ; 0E D = M(RE) LDN RF ; 0F D = M(RF) INC R0 ; 10 R0 = R0 + 1 INC R1 ; 11 R1 = R1 + 1 INC R2 ; 12 R2 = R2 + 1 INC R3 ; 13 R3 = R3 + 1 INC R4 ; 14 R4 = R4 + 1 INC R5 ; 15 R5 = R5 + 1 INC R6 ; 16 R6 = R6 + 1 INC R7 ; 17 R7 = R7 + 1 INC R8 ; 18 R8 = R8 + 1 INC R9 ; 19 R9 = R9 + 1 INC RA ; 1A RA = RA + 1 INC RB ; 1B RB = RB + 1 INC RC ; 1C RC = RC + 1 INC RD ; 1D RD = RD + 1 INC RE ; 1E RE = RE + 1 INC RF ; 1F RF = RF + 1 DEC R0 ; 20 R0 = R0 - 1 DEC R1 ; 21 R1 = R1 - 1 DEC R2 ; 22 R2 = R2 - 1 DEC R3 ; 23 R3 = R3 - 1 DEC R4 ; 24 R4 = R4 - 1 DEC R5 ; 25 R5 = R5 - 1 DEC R6 ; 26 R6 = R6 - 1 DEC R7 ; 27 R7 = R7 - 1 DEC R8 ; 28 R8 = R8 - 1 DEC R9 ; 29 R9 = R9 - 1 DEC RA ; 2A RA = RA - 1 DEC RB ; 2B RB = RB - 1 DEC RC ; 2C RC = RC - 1 DEC RD ; 2D RD = RD - 1 DEC RE ; 2E RE = RE - 1 DEC RF ; 2F RF = RF - 1 BR .+1 ; 30 nn - branch always BQ .+1 ; 31 nn - branch if Q=1 BZ .+1 ; 32 nn - branch if D=0 BDF .+1 ; 33 nn - branch if DF=1 (aka BPZ BGE) B1 .+1 ; 34 nn - branch if EF1=1 B2 .+1 ; 35 nn - branch if EF2=1 B3 .+1 ; 36 nn - branch if EF3=1 B4 .+1 ; 37 nn - branch if EF4=1 SKP ; 38 RP = RP + 1 (skip next byte) (aka NBR nn) BNQ .+1 ; 39 nn - branch if Q=0 BNZ .+1 ; 3A nn - branch if D!=0 BNF .+1 ; 3B nn - branch if DF=0 (aka BM BL) BN1 .+1 ; 3C nn - branch if EF1=0 BN2 .+1 ; 3D nn - branch if EF2=0 BN3 .+1 ; 3E nn - branch if EF3=0 BN4 .+1 ; 3F nn - branch if EF4=0 LDA R0 ; 40 D = M(R0); R0 = R0 + 1 LDA R1 ; 41 D = M(R1); R1 = R1 + 1 LDA R2 ; 42 D = M(R2); R2 = R2 + 1 LDA R3 ; 43 D = M(R3); R3 = R3 + 1 LDA R4 ; 44 D = M(R4); R4 = R4 + 1 LDA R5 ; 45 D = M(R5); R5 = R5 + 1 LDA R6 ; 46 D = M(R6); R6 = R6 + 1 LDA R7 ; 47 D = M(R7); R7 = R7 + 1 LDA R8 ; 48 D = M(R8); R8 = R8 + 1 LDA R9 ; 49 D = M(R9); R9 = R9 + 1 LDA RA ; 4A D = M(RA); RA = RA + 1 LDA RB ; 4B D = M(RB); RB = RB + 1 LDA RC ; 4C D = M(RC); RC = RC + 1 LDA RD ; 4D D = M(RD); RD = RD + 1 LDA RE ; 4E D = M(RE); RE = RE + 1 LDA RF ; 4F D = M(RF); RF = RF + 1 STR R0 ; 50 M(R0) = D STR R1 ; 51 M(R1) = D STR R2 ; 52 M(R2) = D STR R3 ; 53 M(R3) = D STR R4 ; 54 M(R4) = D STR R5 ; 55 M(R5) = D STR R6 ; 56 M(R6) = D STR R7 ; 57 M(R7) = D STR R8 ; 58 M(R8) = D STR R9 ; 59 M(R9) = D STR RA ; 5A M(RA) = D STR RB ; 5B M(RB) = D STR RC ; 5C M(RC) = D STR RD ; 5D M(RD) = D STR RE ; 5E M(RE) = D STR RF ; 5F M(RF) = D IRX ; 60 X = X + 1 OUT 1 ; 61 bus = M(RX); RX = RX + 1 OUT 2 ; 62 bus = M(RX); RX = RX + 1 OUT 3 ; 63 bus = M(RX); RX = RX + 1 OUT 4 ; 64 bus = M(RX); RX = RX + 1 OUT 5 ; 65 bus = M(RX); RX = RX + 1 OUT 6 ; 66 bus = M(RX); RX = RX + 1 OUT 7 ; 67 bus = M(RX); RX = RX + 1 DB 68H ; 68 undefined opcode? INP 1 ; 69 M(RX) = bus; D = bus INP 2 ; 6A M(RX) = bus; D = bus INP 3 ; 6B M(RX) = bus; D = bus INP 4 ; 6C M(RX) = bus; D = bus INP 5 ; 6D M(RX) = bus; D = bus INP 6 ; 6E M(RX) = bus; D = bus INP 7 ; 6F M(RX) = bus; D = bus RET ; 70 X,P = M(RX); RX = RX + 1; IE = 1 DIS ; 71 X,P = M(RX); RX = RX + 1; IE = 0 LDXA ; 72 D = M(RX); RX = RX + 1 STXD ; 73 M(RX) = D; RX = RX - 1 ADC ; 74 DF,D = M(RX) + D + DF SDB ; 75 DF,D = M(RX) - D - !DF SHRC ; 76 D = D >> 1; DF = LSB(D); MSB(D) = DF (aka RSHR) SMB ; 77 DF,D = D - M(RX) - !DF SAV ; 78 M(RX) = T MARK ; 79 T = X,P; M(R2) = X,P; X = P; R2 = R2 - 1 REQ ; 7A Q = 0 SEQ ; 7B Q = 1 ADCI 00H ; 7C nn D,DF = M(RP) + D + DF; RP = RP + 1 SDBI 00H ; 7D nn D,DF = M(RP) - D - !DF; RP = RP + 1 SHLC ; 7E D = D << 1; DF = MSB(D); LSB(D) = DF (aka RSHL) SMBI 00H ; 7F nn DF,D = D - M(RP) - !DF; RP = RP + 1 GLO R0 ; 80 D = R0.lo GLO R1 ; 81 D = R.lo GLO R2 ; 82 D = R.lo GLO R3 ; 83 D = R.lo GLO R4 ; 84 D = R.lo GLO R5 ; 85 D = R.lo GLO R6 ; 86 D = R.lo GLO R7 ; 87 D = R.lo GLO R8 ; 88 D = R.lo GLO R9 ; 89 D = R.lo GLO RA ; 8A D = R.lo GLO RB ; 8B D = R.lo GLO RC ; 8C D = R.lo GLO RD ; 8D D = R.lo GLO RE ; 8E D = R.lo GLO RF ; 8F D = R.lo GHI R0 ; 90 D = R0.hi GHI R1 ; 91 D = R.hi GHI R2 ; 92 D = R.hi GHI R3 ; 93 D = R.hi GHI R4 ; 94 D = R.hi GHI R5 ; 95 D = R.hi GHI R6 ; 96 D = R.hi GHI R7 ; 97 D = R.hi GHI R8 ; 98 D = R.hi GHI R9 ; 99 D = R.hi GHI RA ; 9A D = R.hi GHI RB ; 9B D = R.hi GHI RC ; 9C D = R.hi GHI RD ; 9D D = R.hi GHI RE ; 9E D = R.hi GHI RF ; 9F D = R.hi PLO R0 ; A0 R0.lo = D PLO R1 ; A1 R.lo = D PLO R2 ; A2 R.lo = D PLO R3 ; A3 R.lo = D PLO R4 ; A4 R.lo = D PLO R5 ; A5 R.lo = D PLO R6 ; A6 R.lo = D PLO R7 ; A7 R.lo = D PLO R8 ; A8 R.lo = D PLO R9 ; A9 R.lo = D PLO RA ; AA R.lo = D PLO RB ; AB R.lo = D PLO RC ; AC R.lo = D PLO RD ; AD R.lo = D PLO RE ; AE R.lo = D PLO RF ; AF R.lo = D PHI R0 ; B0 R0.hi = D PHI R1 ; B1 R.hi = D PHI R2 ; B2 R.hi = D PHI R3 ; B3 R.hi = D PHI R4 ; B4 R.hi = D PHI R5 ; B5 R.hi = D PHI R6 ; B6 R.hi = D PHI R7 ; B7 R.hi = D PHI R8 ; B8 R.hi = D PHI R9 ; B9 R.hi = D PHI RA ; BA R.hi = D PHI RB ; BB R.hi = D PHI RC ; BC R.hi = D PHI RD ; BD R.hi = D PHI RE ; BE R.hi = D PHI RF ; BF R.hi = D LBR . ; C0 nnnn - long branch always LBQ . ; C1 nnnn - long branch if Q=1 LBZ . ; C2 nnnn - long branch if D=0 LBDF . ; C3 nnnn - long branch if DF=1 NOP ; C4 no-operation LSNQ ; C5 skip 2 bytes if Q=0 LSNZ ; C6 skip 2 bytes if D!=0 LSNF ; C7 skip 2 bytes if DF=0 LSKP ; C8 RP = RP + 2 (skip 2 bytes) (aka NLBR nnnn) LBNQ . ; C9 nnnn - long branch if Q=0 LBNZ . ; CA nnnn - long branch if D!=0 LBNF . ; CB nnnn - long branch if DF=0 LSIE ; CC skip 2 bytes if IE=1 LSQ ; CD skip 2 bytes if Q=1 LSZ ; CE skip 2 bytes if D=0 LSDF ; CF skip 2 bytes if DF=1 SEP R0 ; D0 P = 0 SEP R1 ; D1 P = 1 SEP R2 ; D2 P = 2 SEP R3 ; D3 P = 3 SEP R4 ; D4 P = 4 SEP R5 ; D5 P = 5 SEP R6 ; D6 P = 6 SEP R7 ; D7 P = 7 SEP R8 ; D8 P = 8 SEP R9 ; D9 P = 9 SEP RA ; DA P = A SEP RB ; DB P = B SEP RC ; DC P = C SEP RD ; DD P = D SEP RE ; DE P = E SEP RF ; DF P = F SEX R0 ; E0 X = 0 SEX R1 ; E1 X = 1 SEX R2 ; E2 X = 2 SEX R3 ; E3 X = 3 SEX R4 ; E4 X = 4 SEX R5 ; E5 X = 5 SEX R6 ; E6 X = 6 SEX R7 ; E7 X = 7 SEX R8 ; E8 X = 8 SEX R9 ; E9 X = 9 SEX RA ; EA X = A SEX RB ; EB X = B SEX RC ; EC X = C SEX RD ; ED X = D SEX RE ; EE X = E SEX RF ; EF X = F LDX ; F0 D = M(RX) OR ; F1 D = D | M(RX) AND ; F2 D = D & M(RX) XOR ; F3 D = D ^ M(RX) ADD ; F4 DF,D = M(RX) + D SD ; F5 DF,D = M(RX) - D SHR ; F6 D = D >> 1; DF = LSB(D); MSB(D) = 0 SM ; F7 DF,D = D - M(RX) LDI 00H ; F8 nn D = M(RP); RP = RP + 1 ORI 00H ; F9 nn D = D | M(RP); RP = RP + 1 ANI 00H ; FA nn D = D & M(RP); RP = RP + 1 XRI 00H ; FB nn D = D ^ M(RP); RP = RP + 1 ADI 00H ; FC nn DF,D = M(RP) + D; RP = RP + 1 SDI 00H ; FD nn DF,D = M(RP) - D; RP = RP + 1 SHL ; FE D = D >> 1; DF = MSB(D); LSB(D) = 0 SMI 00H ; FF nn DF,D = D - M(RP) - !DF; RP = RP + 1 ; duplicate opcodes NBR .+1 ; 38 nn - never branch BPZ .+1 ; 33 nn - branch if positive or zero BGE .+1 ; 33 nn - branch if greater-than or equal BM .+1 ; 3B nn - branch if minus BL .+1 ; 3B nn - branch if less-than NLBR . ; C8 nnnn - never long branch RSHR ; 76 ring shift right RSHL ; 7E ring shift left IF 0 ; addressing modes NOP ; C4 no operands INC 0 ; 10 register without "R" INC R0 ; 10 register INC RF ; 1F register 15 INC R15 ; 1F register 15 LDI 00H ; F8 00 immediate BR .+1 ; 30 nn short branch LBR . ; C0 nnnn - long branch OUT 7 ; 67 IN/OUT instruction INC 16 ; bad INC -1 ; bad LDN R0 ; bad OUT 0 ; bad OUT 8 ; bad ; branch test ORG 10FCH BR .+2 ; good BR .+2 ; bad ORG 11FFH BR .+2 ; good ORG 12FEH BR .+1 ; good ORG 13FFH BR . ; bad ENDIF
24.700935
59
0.505738
513a792ed5a90c969785593a2e3d834804713a3d
2,917
asm
Assembly
playflx/esxdos.asm
ped7g/specnext
7c2a735a9dfde5fc3f7da705c8243371238d1ee3
[ "Unlicense" ]
null
null
null
playflx/esxdos.asm
ped7g/specnext
7c2a735a9dfde5fc3f7da705c8243371238d1ee3
[ "Unlicense" ]
null
null
null
playflx/esxdos.asm
ped7g/specnext
7c2a735a9dfde5fc3f7da705c8243371238d1ee3
[ "Unlicense" ]
null
null
null
;extern unsigned char allocpage() ; output e = page, nc = fail allocpage: ld hl, 0x0001 ; alloc zx memory exx ; place parameters in alternates ld de, 0x01bd ; IDE_BANK ld c, 7 ; "usually 7, but 0 for some calls" rst 0x8 .db 0x94 ; +3dos call ret ;extern unsigned char reservepage(unsigned char page) ; e = page, nc = fail reservepage: ld hl, 0x0002 ; reserve zx memory exx ; place parameters in alternates ld de, 0x01bd ; IDE_BANK ld c, 7 ; "usually 7, but 0 for some calls" rst 0x8 .db 0x94 ; +3dos call ret ;extern void freepage(unsigned char page) ; e = page freepage: ld hl, 0x0003 ; free zx memory exx ; place parameters in alternates ld de, 0x01bd ; IDE_BANK ld c, 7 ; "usually 7, but 0 for some calls" rst 0x8 .db 0x94 ; +3dos call ret ; hl = filename ; b = mode ; esx_mode_read $01 request read access ; esx_mode_write $02 request write access ; esx_mode_use_header $40 read/write +3DOS header ; plus one of: ; esx_mode_open_exist $00 only open existing file ; esx_mode_open_creat $08 open existing or create file ; esx_mode_creat_noexist $04 create new file, error if exists ; esx_mode_creat_trunc $0c create new file, delete existing ; output: a = handle, carry = failure fopen: ld a, '*' rst 0x8 .db 0x9a ret ;extern void fclose(unsigned char handle); ; a = handle fclose: rst 0x8 .db 0x9b ret ;extern unsigned short fread(unsigned char handle, unsigned char* buf, unsigned short bytes); ; a = handle ; hl = buf ; bc = bytes ; output: bc = bytes fread: rst 0x8 .db 0x9d ret ;extern void fwrite(unsigned char handle, unsigned char* buf, unsigned short bytes); ; a = handle ; bc = bytes ; hl = buf fwrite: rst 0x8 .db 0x9e ret ;extern void fseek(unsigned char handle, unsigned long ofs); ; a = handle ; offset = BCDE ; mode = l (0 = set, 1 = fwd, 2 = bwd) fseek: rst 0x8 .db 0x9f ret ;IN: B=0 for standard variable, B=1 for array ; C=variable number (0=A,1=B...25=Z) ; L=array index (0..63) if B=1 ; H=0 to get variable, 1 to set variable ; DE=value (if H=1) ;OUT(s): Fc=1 ; DE=value (if H=0) ;OUT(f): Fc=0 ;A=error intvar: exx ; place parameters in alternates ld de, 0x01c9 ; IDE_INTEGER_VAR ld c, 7 ; "usually 7, but 0 for some calls" rst 0x8 .db 0x94 ; +3dos call ret
28.598039
93
0.531711
cc604911a4c130342c66c64edeb3300b0e872f6f
613
asm
Assembly
programs/oeis/155/A155067.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/155/A155067.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/155/A155067.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A155067: First differences of A031368. ; 3,6,6,6,8,10,6,12,8,6,10,14,6,6,18,10,12,8,10,12,12,6,14,16,6,8,16,12,8,6,24,6,18,16,6,14,12,10,12,18,12,8,10,12,6,20,12,10,14,24,16,8,16,12,8,10,14,12,10,8,16,14,18,18,12,12,10,12,24,14,12,6,24,6,18,6,24,12,18,10 mov $4,$0 mov $6,2 lpb $6 clr $0,4 mov $0,$4 sub $6,1 add $0,$6 sub $0,1 mov $1,$0 max $0,0 cal $0,317108 ; Numbers missing from A317106. max $0,0 mov $1,2 mov $3,2 cal $0,40 ; The prime numbers. sub $0,2 mov $1,$0 mov $2,2 mov $3,1 mov $7,$6 cmp $7,1 mul $7,$0 add $5,$7 lpe min $4,1 mul $4,$1 mov $1,$5 sub $1,$4
19.15625
215
0.569331
75f1c69f1666c05e16e8f074fd8579704c8864fa
557
asm
Assembly
oeis/029/A029146.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/029/A029146.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/029/A029146.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A029146: Expansion of 1/((1-x^2)(1-x^3)(1-x^5)(1-x^9)). ; Submitted by Jon Maiga ; 1,0,1,1,1,2,2,2,3,4,4,5,6,6,8,9,9,11,13,13,16,17,18,21,23,24,27,30,31,35,38,39,44,47,49,54,58,60,66,70,73,79,84,87,94,100,103,111,117,121,130,136,141,150,158,163,173,181,187,198,207,213,225,235,242,255,265,273,287,298,307,321,334,343,359,372,382,399,413,424,442,457,469,488,504,517,537,554,568,589,608,622,645,664,680,704,724,741,766,788 add $0,3 lpb $0 sub $0,3 mov $2,$0 max $2,0 seq $2,25809 ; Expansion of 1/((1-x^2)(1-x^5)(1-x^9)). add $1,$2 lpe mov $0,$1
39.785714
339
0.637343
ee4645115a807f93d1417837ace64a8a43f13c70
1,600
asm
Assembly
externals/mpir-3.0.0/mpn/powerpc64/mode64/mul_1.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
12
2021-09-29T14:50:06.000Z
2022-03-31T15:01:21.000Z
externals/mpir-3.0.0/mpn/powerpc64/mode64/mul_1.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
15
2021-12-24T22:53:49.000Z
2021-12-25T10:03:13.000Z
LibSource/mpir/mpn/powerpc64/mode64/mul_1.asm
ekzyis/CrypTool-2
1af234b4f74486fbfeb3b3c49228cc36533a8c89
[ "Apache-2.0" ]
10
2021-10-17T19:46:51.000Z
2022-03-18T02:57:57.000Z
dnl PowerPC-64 mpn_mul_1 -- Multiply a limb vector with a limb and store dnl the result in a second limb vector. dnl Copyright 1999, 2000, 2001 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of the GNU Lesser General Public License as published by dnl the Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl You should have received a copy of the GNU Lesser General Public License dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, dnl Boston, MA 02110-1301, USA. include(`../config.m4') C INPUT PARAMETERS C res_ptr r3 C s1_ptr r4 C size r5 C s2_limb r6 C cy_limb r7 C PPC630: 6 to 18 cycles/limb, depending on multiplier. This cannot be C improved unless floating-point operations are used instead of the slow C mulld/mulhdu. ASM_START() PROLOGUE(mpn_mul_1) li r7,0 C cy_limb = 0 PROLOGUE(mpn_mul_1c) mtctr r5 addic r0,r0,0 addi r3, r3, -8 addi r4, r4, -8 L(top): ldu r0,8(r4) mulld r9,r0,r6 adde r9,r9,r7 mulhdu r7,r0,r6 stdu r9,8(r3) bdnz L(top) addze r3,r7 blr EPILOGUE(mpn_mul_1) EPILOGUE(mpn_mul_1c)
28.571429
81
0.755
fecc0cab3e886c4dc452c86d65b72096b969544c
682
asm
Assembly
oeis/017/A017161.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017161.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017161.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017161: Expansion of 1/((1-3x)(1-4x)(1-12x)). ; Submitted by Jon Maiga ; 1,19,265,3355,41041,495859,5964505,71633035,859838881,10319056099,123832690345,1486008529915,17832167873521,213986278134739,2567836397009785,30814041016037995,369768509243184961,4437222179250275779,53246666424718954825,638959998192652301275,7667519982699413773201,92010239809953770263219,1104122877789719844157465,13249474533757830677063755,158993694406219020742998241,1907924332879129306677521059,22895091994567558453042249705,274741103934882736153752469435,3296893247218880995590803980081 mov $1,3 pow $1,$0 mul $0,2 div $1,2 mov $2,2 pow $2,$0 mul $2,$1 add $1,$2 add $2,$1 mov $0,$2 mul $0,2 add $0,1
40.117647
492
0.835777
ed01e3ac0ac9228154bde5b369863eb6acdcadc4
470
asm
Assembly
oeis/084/A084519.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/084/A084519.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/084/A084519.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A084519: Number of indecomposable ground-state 3-ball juggling sequences of period n. ; Submitted by Jamie Morken(s4) ; 1,1,3,13,47,173,639,2357,8695,32077,118335,436549,1610471,5941181,21917583,80856053,298285687,1100404333,4059496479,14975869477,55247410055,203812962077,751885445295,2773777080149,10232728055191 mov $1,1 mov $2,1 lpb $0 sub $0,1 mul $1,3 add $4,3 add $1,$4 add $1,$3 mul $2,2 mov $4,$3 mov $3,$2 mov $2,$1 lpe mov $0,$4 add $0,1
23.5
196
0.717021
b0758a42117c2a12bd2594997db00d5dbe455102
7,725
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2470.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2470.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2470.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 %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x19e7e, %r11 nop cmp $57016, %rdx vmovups (%r11), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $1, %xmm7, %r13 nop nop sub %rsi, %rsi lea addresses_A_ht+0x4fa2, %rcx nop nop nop nop add $62327, %r12 movb (%rcx), %bl nop nop nop nop nop and $45076, %rsi lea addresses_UC_ht+0x1c7a2, %r11 nop nop xor %r13, %r13 movb (%r11), %r12b nop nop nop nop nop add %rsi, %rsi lea addresses_normal_ht+0x3352, %r13 sub $13632, %r11 and $0xffffffffffffffc0, %r13 vmovntdqa (%r13), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rbx nop add $10636, %r12 lea addresses_D_ht+0xf972, %rcx nop nop sub $23513, %rbx movups (%rcx), %xmm4 vpextrq $1, %xmm4, %r12 nop nop nop inc %rdx lea addresses_WC_ht+0x18862, %rbx nop nop nop nop nop and %r11, %r11 mov $0x6162636465666768, %r12 movq %r12, %xmm7 vmovups %ymm7, (%rbx) xor $30220, %rsi lea addresses_D_ht+0x108b1, %rcx nop add $40802, %rdx movw $0x6162, (%rcx) add $16941, %r13 lea addresses_WC_ht+0x16562, %r12 nop nop nop xor $61040, %rbx movb $0x61, (%r12) nop nop nop nop nop and %rbx, %rbx lea addresses_A_ht+0x15de2, %r13 sub %rsi, %rsi and $0xffffffffffffffc0, %r13 movaps (%r13), %xmm2 vpextrq $1, %xmm2, %rdx add $26609, %r13 lea addresses_A_ht+0x3422, %rsi nop nop nop nop nop and %rbx, %rbx mov $0x6162636465666768, %rcx movq %rcx, (%rsi) nop nop nop sub $61787, %rsi lea addresses_D_ht+0xd0e2, %rsi lea addresses_A_ht+0x1a4eb, %rdi nop nop nop nop inc %rdx mov $80, %rcx rep movsb nop and $48928, %rdx lea addresses_WC_ht+0x1bc92, %r11 nop nop nop xor %rbx, %rbx mov (%r11), %r12w nop nop nop nop cmp $61470, %rcx lea addresses_WC_ht+0x1dfa2, %rsi lea addresses_UC_ht+0xa9a2, %rdi nop nop nop dec %r11 mov $88, %rcx rep movsl nop nop and %r11, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %rax push %rbx push %rcx push %rdi push %rsi // Store lea addresses_normal+0x137a2, %rcx nop sub $8776, %rdi movb $0x51, (%rcx) inc %rsi // Store mov $0x222a6c0000000456, %rbx clflush (%rbx) nop nop nop nop add $47854, %rsi movl $0x51525354, (%rbx) add %rsi, %rsi // Faulty Load lea addresses_A+0x9fa2, %rbx nop cmp %r10, %r10 mov (%rbx), %ecx lea oracles, %rbx and $0xff, %rcx shlq $12, %rcx mov (%rbx,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
34.641256
2,999
0.655146
a6d9470b67eab44f95c1ab5ff9e769e071f6567b
2,224
asm
Assembly
dino/lcs/base/6B64.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
dino/lcs/base/6B64.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
dino/lcs/base/6B64.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 004A5E clr.w ($6b64,A5) 004A62 lea ($6b98,A5), A0 004C14 addq.w #1, ($6b64,A5) [base+6B66] 004C18 rts [base+6B64] 010632 move.w D0, ($6b64,A5) [base+6724] 010636 lea ($6b98,A5), A0 011346 move.w ($6b64,A5), D7 01134A beq $11384 [base+6B64] 011AD8 move.w ($6b64,A5), D7 011ADC beq $11b24 [base+6B64] 011CEC move.w ($6b64,A5), D7 011CF0 beq $11d30 [base+6B64] 011E56 move.w ($6b64,A5), D7 011E5A beq $11e9a [base+6B64] 0AAACA move.l (A0), D2 0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 0AAAD8 move.l D2, (A0)+ 0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAE6 move.l (A0), D2 0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAF4 move.l D2, (A0)+ 0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] copyright zengfr site:http://github.com/zengfr/romhack
69.5
351
0.660072
ab977048a1263c5c6e5f4b5e045b02e0ff365d21
800
asm
Assembly
Tasks/Get_Value_From_Stack.asm
BenSokol/EECS690-Project2
2f9788c91b2ab814413b64db7a9a3b411b24a54a
[ "Unlicense" ]
null
null
null
Tasks/Get_Value_From_Stack.asm
BenSokol/EECS690-Project2
2f9788c91b2ab814413b64db7a9a3b411b24a54a
[ "Unlicense" ]
null
null
null
Tasks/Get_Value_From_Stack.asm
BenSokol/EECS690-Project2
2f9788c91b2ab814413b64db7a9a3b411b24a54a
[ "Unlicense" ]
null
null
null
;;***************************************************************************** ;; ;; Get_Value_From_Stack.asm ;; ;; Author: Kaiser Mittenburg, Ben Sokol ;; Organization: KU/EECS/EECS 690 ;; Date: 2018-09-11 ;; Version: 1.0 ;; ;; Purpose: Return the value from the stack given an offset ;; ;; Notes: ;; ;;***************************************************************************** ;; Declare sections and external references .global Get_Value_From_Stack ; Declare entry point as a global symbol ;; No constant data ;; No variable allocation ;; Program instructions .text ; Program section Get_Value_From_Stack: ; Entry point LDR R0,[SP,R0] ; Load value from Stack Pointer given an offset, into R0 BX LR ; Branch back to Link Register .end
24.242424
79
0.53625
af5e2e37671ce079e23b44e4832c9c8851a7af9f
609
asm
Assembly
programs/oeis/183/A183905.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/183/A183905.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/183/A183905.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A183905: Number of nondecreasing arrangements of n+2 numbers in 0..2 with each number being the sum mod 3 of two others. ; 1,4,10,17,25,34,44,55,67,80,94,109,125,142,160,179,199,220,242,265,289,314,340,367,395,424,454,485,517,550,584,619,655,692,730,769,809,850,892,935,979,1024,1070,1117,1165,1214,1264,1315,1367,1420,1474,1529,1585,1642,1700,1759,1819,1880,1942,2005,2069,2134,2200,2267,2335,2404,2474,2545,2617,2690,2764,2839,2915,2992,3070,3149,3229,3310,3392,3475,3559,3644,3730,3817,3905,3994,4084,4175,4267,4360,4454,4549,4645,4742,4840,4939,5039,5140,5242,5345 add $0,5 bin $0,2 trn $0,12 add $0,1
76.125
447
0.758621
b59c6d461027ecd8f8c23488d1f191d16c1bfaf3
295
asm
Assembly
programs/oeis/040/A040281.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/040/A040281.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/040/A040281.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A040281: Continued fraction for sqrt(299). ; 17,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3,34,3,2,3 seq $0,40282 ; Continued fraction for sqrt(300). dif $0,4
49.166667
190
0.610169
71603ae9cc8f4664bfe8a1671fecec21e105b352
5,186
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_un_/i9-9900K_12_0xa0.log_21829_65.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_un_/i9-9900K_12_0xa0.log_21829_65.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_un_/i9-9900K_12_0xa0.log_21829_65.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r14 push %r15 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x23d5, %rdx sub $29204, %r14 and $0xffffffffffffffc0, %rdx movaps (%rdx), %xmm5 vpextrq $0, %xmm5, %r15 nop add $23552, %r11 lea addresses_UC_ht+0x1d66d, %r13 clflush (%r13) xor %r8, %r8 movb $0x61, (%r13) nop nop add $21115, %r15 lea addresses_D_ht+0x13bd5, %rsi lea addresses_D_ht+0x176e5, %rdi nop nop nop nop nop cmp %rdx, %rdx mov $80, %rcx rep movsq cmp %r8, %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r15 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r9 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_A+0x8795, %rsi lea addresses_WT+0x1cfd5, %rdi nop nop and %rbx, %rbx mov $25, %rcx rep movsb nop cmp %rbp, %rbp // Store lea addresses_UC+0x1d7d5, %rcx nop nop nop nop cmp %r9, %r9 movl $0x51525354, (%rcx) nop nop nop sub %rdx, %rdx // Faulty Load lea addresses_WT+0x1cfd5, %rsi cmp $57534, %rdi mov (%rsi), %ecx lea oracles, %rsi and $0xff, %rcx shlq $12, %rcx mov (%rsi,%rcx,1), %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 5, 'type': 'addresses_A'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 0, 'type': 'addresses_WT'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_UC', 'AVXalign': True, 'size': 4}} [Faulty Load] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'5f': 21824, '00': 5} 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f */
45.491228
2,999
0.657347
51be56236cc007a22f04cc0e926dbb47cc3c3fdd
688
asm
Assembly
oeis/159/A159485.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/159/A159485.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/159/A159485.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A159485: Numerator of Hermite(n, 7/12). ; Submitted by Christian Krause ; 1,7,-23,-1169,-3215,314167,3356569,-112224161,-2477279903,47300157415,1936378479049,-20501463985457,-1677122003305007,5973410860299799,1611600071115585145,5260002350626898623,-1703708060350443666239,-17985479130375292877369,1959440311956315997334953,37025263136660591550414895,-2421337504799616143501311439,-70265741450388564837106628873,3169202117104299655114236493657,133485349277145584287776555590431,-4313801260984701138854739744362975,-260859292377800477621261066270805593 add $0,1 mov $3,1 lpb $0 sub $0,1 mul $2,7 add $2,$3 mov $3,$1 mov $1,$2 mul $3,-36 mul $3,$0 mul $3,2 lpe mov $0,$1
38.222222
479
0.809593
488f4df7faa307d480a4f47233d1e8ba642bbc18
219
asm
Assembly
BigNum/Mod/Monty/bnMulpow2.asm
FloydZ/Crypto-Hash
2635450fb16d4d8dc4578d6539cc25ce599f7e21
[ "MIT" ]
11
2015-03-17T10:31:23.000Z
2022-01-21T17:42:43.000Z
BigNum/Mod/Monty/bnMulpow2.asm
0xFF1E071F/Crypto-Hash
2635450fb16d4d8dc4578d6539cc25ce599f7e21
[ "MIT" ]
null
null
null
BigNum/Mod/Monty/bnMulpow2.asm
0xFF1E071F/Crypto-Hash
2635450fb16d4d8dc4578d6539cc25ce599f7e21
[ "MIT" ]
6
2018-01-29T16:06:36.000Z
2021-05-08T19:22:24.000Z
.686 .model flat,stdcall option casemap:none include .\bnlib.inc include .\bignum.inc .code bnMulpow2 proc bnX:DWORD,bitsY:DWORD,bnProd:DWORD invoke bnMov,bnProd,bnX invoke bnShl,bnProd,bitsY ret bnMulpow2 endp end
15.642857
49
0.794521
9e98ecb8c684b110db523117fb24e41d25358001
875
asm
Assembly
sw/552tests/rand_simple/t_3_srli.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
1
2022-02-15T16:03:25.000Z
2022-02-15T16:03:25.000Z
sw/552tests/rand_simple/t_3_srli.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
null
null
null
sw/552tests/rand_simple/t_3_srli.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
null
null
null
// seed 3 lbi r0, 135 // icount 0 slbi r0, 233 // icount 1 lbi r1, 198 // icount 2 slbi r1, 79 // icount 3 lbi r2, 112 // icount 4 slbi r2, 89 // icount 5 lbi r3, 34 // icount 6 slbi r3, 176 // icount 7 lbi r4, 189 // icount 8 slbi r4, 107 // icount 9 lbi r5, 160 // icount 10 slbi r5, 174 // icount 11 lbi r6, 36 // icount 12 slbi r6, 47 // icount 13 lbi r7, 245 // icount 14 slbi r7, 174 // icount 15 srli r2, r6, 10 // icount 16 srli r3, r3, 1 // icount 17 srli r7, r0, 8 // icount 18 srli r6, r6, 1 // icount 19 srli r4, r1, 9 // icount 20 srli r1, r7, 4 // icount 21 srli r4, r1, 15 // icount 22 srli r1, r3, 4 // icount 23 srli r1, r1, 15 // icount 24 srli r1, r3, 13 // icount 25 srli r1, r6, 8 // icount 26 srli r1, r3, 0 // icount 27 srli r5, r4, 13 // icount 28 srli r7, r3, 11 // icount 29 srli r4, r6, 1 // icount 30 srli r1, r5, 9 // icount 31 halt // icount 32
25
28
0.621714
1549c3b344310dc36ea7d5a47d6d26e7f79eeb37
338
asm
Assembly
programs/oeis/059/A059144.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/059/A059144.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/059/A059144.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A059144: A hierarchical sequence (W3{2,2}*cc - see A059126). ; 15,24,15,33,15,24,15,42,15,24,15,33,15,24,15,51,15,24,15,33,15,24,15,42,15,24,15,33,15,24,15,60,15,24,15,33,15,24,15,42,15,24,15,33,15,24,15,51,15,24,15,33,15,24,15,42,15,24,15,33,15,24,15,69,15,24,15,33,15 add $0,1 gcd $0,1073741824 log $0,2 mov $1,$0 mul $1,9 add $1,15
33.8
208
0.656805
90d06403f673f9bf14ef3d106b25bc4c6da500b1
447
asm
Assembly
programs/oeis/208/A208079.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/208/A208079.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/208/A208079.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A208079: Number of 4 X n 0..1 arrays avoiding 0 0 0 and 0 0 1 horizontally and 0 0 0 and 0 1 0 vertically. ; 9,81,441,2601,15129,88209,514089,2996361,17464041,101787921,593263449,3457792809,20153493369,117463167441,684625511241,3990289900041,23257113888969,135552393433809,790057246713849,4604791086849321 mov $1,1 mov $2,1 lpb $0,1 sub $0,1 mov $3,$2 add $2,$1 mov $1,$3 add $1,$2 lpe mul $1,4 pow $1,2 div $1,128 mul $1,72 add $1,9
24.833333
198
0.727069
8e319f09a4121c77f9312de6078f3ffd75fb459f
19,204
asm
Assembly
Appl/FileMgrs/CommonDesktop/CDeskDisplay/cdeskdisplayDriveTool.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/FileMgrs/CommonDesktop/CDeskDisplay/cdeskdisplayDriveTool.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/FileMgrs/CommonDesktop/CDeskDisplay/cdeskdisplayDriveTool.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: deskdisplayDriveTool.asm AUTHOR: Adam de Boor, Jan 30, 1992 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Adam 1/30/92 Initial revision DESCRIPTION: Implementation of DriveToolClass $Id: cdeskdisplayDriveTool.asm,v 1.4 98/08/20 05:10:33 joon Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if not _GMGR PrintMessage <Only GeoManager should include this file> endif PseudoResident segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolTrigger %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: handle click on drive icon CALLED BY: MSG_GEN_TRIGGER_SEND_ACTION (button release) PASS: usual object stuff RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 12/15/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DriveToolTrigger method DriveToolClass, MSG_GEN_TRIGGER_SEND_ACTION mov di, offset DriveToolClass call ObjCallSuperNoLock ; call superclass to flash icon jc error ; button not enabled, etc. ; ; start input ignore ; mov ax, MSG_GEN_APPLICATION_MARK_BUSY call GenCallApplication ; ; call desktop process to do all the work ; mov di, ds:[si] add di, ds:[di].Gen_offset mov cl, ds:[di].DT_driveNumber mov bx, handle 0 ; bx = desktop process mov ax, MSG_DRIVETOOL_INTERNAL mov di, mask MF_FIXUP_DS call ObjMessage ; ; turn off input ignore, indirectly ; mov ax, MSG_GEN_APPLICATION_MARK_NOT_BUSY call GenSendToApplicationViaProcess error: ret DriveToolTrigger endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolPtr %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: provide feedback during direct-manipulation CALLED BY: MSG_META_PTR PASS: *ds:si - DriveTool ds:di = DriveTool instance data es - segment of DriveToolClass bp - UIFA flags UIFA_IN - set mouse pointer if in bounds of this object RETURN: ax = MouseReturnFlags DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 3/11/91 Initial version for 2.0 quick-transfer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DriveToolPtr method DriveToolClass, MSG_META_PTR add di, offset DvT_flags ; ds:di = flags mov bx, offset Callback_DriveToolPtr mov ax, offset DriveToolClass call ToolPtrCommon ret DriveToolPtr endm DriveToolLostGadgetExcl method DriveToolClass, MSG_VIS_LOST_GADGET_EXCL add di, offset DvT_flags call ToolLostGadgetExclCommon ret DriveToolLostGadgetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Callback_DriveToolPtr %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: callback for DriveToolPtr that determines the quick transfer default for move/copy. CALLED BY: ToolPtrCommon PASS: *ds:si - DriveTool object RETURN: ax = CQTF_MOVE, CQTF_COPY or CQTF_CLEAR DESTROYED: ??? PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: NOTE: All we can do here is check if it is the same drive number as we may not have a disk handle for the disk in the drive REVISION HISTORY: Name Date Description ---- ---- ----------- dlitwin 01/17/93 Added this header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ Callback_DriveToolPtr proc near class DriveToolClass uses bx, si .enter call CheckQuickTransferType ; check if TIF_FILES supported jnc supported mov ax, CQTF_CLEAR ; nope, just clear cursor jmp done supported: tst bx mov bx, ax ; put diskhandle in bx mov ax, CQTF_COPY ; copy if source is remote jnz done ; bx = true disk handle call DiskGetDrive ; al = drive number mov si, ds:[si] add si, ds:[si].Gen_offset cmp al, ds:[si].DT_driveNumber ; check drive number mov ax, CQTF_MOVE ; assume same je done ; yes, indicate move mov ax, CQTF_COPY ; else, indicate copy done: .leave ret Callback_DriveToolPtr endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolEndMoveCopy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: handle direct-manipulation CALLED BY: MSG_META_END_MOVE_COPY PASS: usual object stuff es - segment of DriveToolClass bp - UIFA flags RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 12/18/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DriveToolEndMoveCopy method DriveToolClass, \ MSG_META_END_MOVE_COPY uses ax, cx, dx, bp, si .enter call DriveToolLostGadgetExcl ; release mouse, if needed mov di, MSG_DRIVETOOL_QT_INTERNAL call ToolQuickTransfer .leave mov di, offset DriveToolClass call ObjCallSuperNoLock ret DriveToolEndMoveCopy endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolEndSelect %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: handle direct-manipulation for ZMGR CALLED BY: MSG_META_END_SELECT PASS: usual object stuff es - segment of DriveToolClass bp - UIFA flags RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 2/19/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _PEN_BASED DriveToolEndSelect method DriveToolClass, MSG_META_END_SELECT uses ax, cx, dx, bp, si .enter push es NOFXIP< segmov es, dgroup, bx ; es = dgroup > FXIP < GetResourceSegmentNS dgroup, es, TRASH_BX > test es:[fileDragging], mask FDF_MOVECOPY pop es jz done call DriveToolLostGadgetExcl ; release mouse, if needed mov di, MSG_DRIVETOOL_QT_INTERNAL call ToolQuickTransfer done: .leave mov di, offset DriveToolClass call ObjCallSuperNoLock ret DriveToolEndSelect endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolSetDrive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: set drive number and letter for this drive CALLED BY: MSG_DRIVE_TOOL_SET_DRIVE PASS: usual object stuff bp - drive nubmer RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 12/19/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DriveToolSetDrive method dynamic DriveToolClass, MSG_DRIVE_TOOL_SET_DRIVE mov ax, bp ; al = drive number mov ds:[di].DT_driveNumber, al ret DriveToolSetDrive endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolSpecBuild %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Build the passed drive tool visually, setting the moniker to hold the proper drive name and cached size. CALLED BY: MSG_SPEC_BUILD PASS: *ds:si = DriveTool object, with drive number set ds:di = DriveToolInstance es = segment of DriveToolClass bp = SpecBuildFlags RETURN: nothing DESTROYED: ax, cx, dx, bp all possible PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 1/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _TINY TinyMonoBitmaps optr \ FiveInchDiskYMBitmap, ThreeInchDiskYMBitmap, HardDiskYMBitmap, RamDiskYMBitmap, CDRomYMBitmap, NetDiskYMBitmap, PCMCIAYMBitmap .assert (length TinyMonoBitmaps eq DriveToolType) endif if _CGA CGABitmaps optr \ FiveInchDiskSCGABitmap, ThreeInchDiskSCGABitmap, HardDiskSCGABitmap, RamDiskSCGABitmap, CDRomSCGABitmap, NetDiskSCGABitmap, PCMCIASCGABitmap, RemovableDiskSCGABitmap .assert (length CGABitmaps eq DriveToolType) endif if _STANDARD_MONO StandardMonoBitmaps optr \ FiveInchDiskSMBitmap, ThreeInchDiskSMBitmap, HardDiskSMBitmap, RamDiskSMBitmap, CDRomSMBitmap, NetDiskSMBitmap, PCMCIASMBitmap, RemovableDiskSMBitmap .assert (length StandardMonoBitmaps eq DriveToolType) endif if _STANDARD_COLOR if _DOCMGR StandardColorBitmaps optr \ FiveInchDiskSCBitmap, DMThreeInchDiskSCMoniker, DMHardDriveSCMoniker, RamDiskSCBitmap, CDRomSCBitmap, NetDiskSCBitmap, PCMCIASCBitmap, RemovableDiskSCBitmap else StandardColorBitmaps optr \ FiveInchDiskSCBitmap, ThreeInchDiskSCBitmap, HardDiskSCBitmap, RamDiskSCBitmap, CDRomSCBitmap, NetDiskSCBitmap, PCMCIASCBitmap, RemovableDiskSCBitmap endif .assert (length StandardColorBitmaps eq DriveToolType) endif if _DOCMGR DRIVETOOL_MONIKER_FIXED_SIZE equ size OpDrawText + \ size OpDrawBitmapOptr DRIVETOOL_NAME_START equ offset VM_data + offset VMGS_gstring + \ size OpDrawText else DRIVETOOL_MONIKER_FIXED_SIZE equ size OpSetFont + \ size OpDrawTextAtCP + \ size OpDrawBitmapOptr DRIVETOOL_NAME_START equ offset VM_data + offset VMGS_gstring + \ size OpSetFont + size OpDrawTextAtCP endif ifndef GEOLAUNCHER DRIVETOOL_MIN_HEIGHT equ 30 DRIVETOOL_MIN_TINY_HEIGHT equ 20 DRIVETOOL_MIN_CGA_HEIGHT equ 14 else DRIVETOOL_MIN_HEIGHT equ 42 DRIVETOOL_MIN_TINY_HEIGHT equ 32 DRIVETOOL_MIN_CGA_HEIGHT equ 26 endif DriveToolSpecBuild method dynamic DriveToolClass, MSG_SPEC_BUILD .enter ; ; Let our superclass deal with resolving the moniker list. ; mov di, offset DriveToolClass CallSuper MSG_SPEC_BUILD mov di, ds:[si] add di, ds:[di].DriveTool_offset mov bx, ds:[di].GI_visMoniker ChunkSizeHandle ds, bx, ax ; ; check if it is empty, or just a VisMoniker with a gstring that ; immediately ends ; cmp ax, size VisMoniker + size VisMonikerGString + \ size OpEndGString LONG jne exit ; if already built, exit ; ; Figure the number of bytes needed by the drive name ; mov al, ds:[di].DT_driveNumber EC < cmp al, -1 > EC < ERROR_E DRIVE_TOOL_BUILT_BEFORE_DRIVE_NUMBER_SET > if _DOCMGR tst al jnz notALen push ax, ds, si mov bx, handle IconAreaResource mov si, offset FloppyIconName call ObjLockObjBlock mov ds, ax ChunkSizeHandle ds, si, cx ; cx = length call MemUnlock pop ax, ds, si jmp short haveNameLen notALen: endif clr cx ; give buffer size of 0 so we get length ; of name back always call DriveGetName haveNameLen:: tst cx ;If the drive is going away for some LONG jz exit ; reason, don't bother making a moniker ; for it ; ; Adjust the moniker to make room for the real gstring elements: if _DOCMGR ; GSDrawText <drive_name> else ; GSSetFont DRIVETOOL_LABEL_FONT, DRIVETOOL_LABEL_POINTSIZE ; GSDrawTextAtCP <drive_name> endif ; GSDrawBitmapOptr <drive_name_width, 0, drive_type_bitmap> ; mov ah, ds:[di].DT_driveType ; get and save drive push ax ; type while we've got ; the object in ds:di SBCS < add cx, DRIVETOOL_MONIKER_FIXED_SIZE-1 ; -1 b/c we > DBCS < add cx, DRIVETOOL_MONIKER_FIXED_SIZE-2 ; -1 b/c we > ; don't need ; null-term in ; drive name mov ax, ds:[di].GI_visMoniker ; moniker must be real gstring moniker for this to work... EC < mov bx, ax > EC < mov bx, ds:[bx] > EC < test ds:[bx].VM_type, mask VMT_MONIKER_LIST > EC < ERROR_NZ DESKTOP_FATAL_ERROR > EC < test ds:[bx].VM_type, mask VMT_GSTRING > EC < ERROR_Z DESKTOP_FATAL_ERROR > mov bx, offset VM_data + offset VMGS_gstring call LMemInsertAt ; ; Point to the start of the gstring. ; mov_tr di, ax mov di, ds:[di] pop ax ; recover drive # & type push di ; save start of moniker for other fun ; things add di, bx ; ds:di <- start of gstring ; ; Setup the OpSetFont ; if not _DOCMGR mov ds:[di].OSF_opcode, GR_SET_FONT mov ds:[di].OSF_size.WBF_int, DRIVETOOL_LABEL_POINTSIZE mov ds:[di].OSF_size.WBF_frac, 0 mov ds:[di].OSF_id, DRIVETOOL_LABEL_FONT add di, size OpSetFont endif ; ; Setup the OpDrawTextAtCP ; if _DOCMGR mov ds:[di].ODT_opcode, GR_DRAW_TEXT else mov ds:[di].ODTCP_opcode, GR_DRAW_TEXT_CP endif sub cx, DRIVETOOL_MONIKER_FIXED_SIZE DBCS < shr cx, 1 > if _DOCMGR mov ds:[di].ODT_len, cx else mov ds:[di].ODTCP_len, cx endif DBCS < shl cx, 1 > if _DOCMGR add di, size OpDrawText else add di, size OpDrawTextAtCP endif push es segmov es, ds if _DOCMGR tst al jnz notACopy push ax, ds, si mov bx, handle IconAreaResource mov si, offset FloppyIconName call ObjLockObjBlock mov ds, ax mov si, ds:[si] LocalCopyNString call MemUnlock pop ax, ds, si jmp short haveNameCopy notACopy: endif call DriveGetName haveNameCopy:: pop es ; ; Setup the OpDrawBitmapOptr. ODBOP_x will be filled in when we ; know how wide the text is. ; mov ds:[di].ODBOP_opcode, GR_DRAW_BITMAP_OPTR mov ds:[di].ODBOP_y, 0 ; ; Figure which bitmap to use based on the info in the VisMoniker that ; our superclass decided to use and on the current display type. ; mov bl, ah clr bh pop si push si ; save again for setting cached width ; and height... mov al, ds:[si].VM_type mov ah, al ; EC code to make sure we choose a bitmap! EC < mov si, -1 > if _CGA ; ; If aspect ratio is verySquished, use standard CGA ; andnf al, mask VMT_GS_ASPECT_RATIO mov si, offset CGABitmaps mov dx, DRIVETOOL_MIN_CGA_HEIGHT cmp al, DAR_VERY_SQUISHED shl offset VMT_GS_ASPECT_RATIO je haveBMOffset endif ; _CGA if _TINY ; ; If application is compiled to run on a "tiny" screen (ie, ; Zoomer), then always use the tiny bitmaps, regardless of ; the screen size ; mov dx, DRIVETOOL_MIN_TINY_HEIGHT mov si, offset TinyMonoBitmaps jmp short haveBMOffset endif ; _TINY if _STANDARD_MONO ; ; If size is standard and display class is gray1, use standard Mono ; mov dx, DRIVETOOL_MIN_HEIGHT mov si, offset StandardMonoBitmaps andnf ah, mask VMT_GS_COLOR cmp ah, DC_GRAY_1 shl offset VMT_GS_COLOR je haveBMOffset endif if _STANDARD_COLOR ; ; Else use standard Color ; mov si, offset StandardColorBitmaps endif haveBMOffset: EC < cmp si, -1 > EC < ERROR_E DESKTOP_FATAL_ERROR > EC < cmp bx, DriveToolType > EC < ERROR_AE NO_BITMAP_AVAILABLE_FOR_DRIVE_TYPE > ; ; Convert drive type to optr offset ; shl bx ; *2 shl bx ; *4 mov ax, ({optr}cs:[bx][si]).chunk mov ds:[di].ODBOP_optr.chunk, ax mov bx, ({optr}cs:[bx][si]).handle mov ds:[di].ODBOP_optr.handle, bx ; ; Now lock down the bitmap and get its dimensions. ; mov_tr si, ax call ObjLockObjBlock mov es, ax mov si, es:[si] mov ax, es:[si].B_height mov cx, es:[si].B_width call MemUnlock pop si if not _DOCMGR cmp ax, dx ; bitmap taller than min? jae setWidthAndHeight xchg ax, dx ; ax <- min height, dx <- bm ; height sub dx, ax ; now center the bitmap neg dx ; in the minimum height shr dx mov ds:[di].ODBOP_y, dx setWidthAndHeight: endif ; ; Set them as the current cached width and height for the moniker. We ; assume the bitmap is taller than the text, so the cached height ; will remain the height of the bitmap. The width we'll adjust in a ; moment. ; mov ds:[si].VM_data+VMGS_height, ax mov ds:[si].VM_width, cx ; ; Figure the width of the drive-name label. ; push di clr di call GrCreateState ; get us a calculation gstate open to ; no window if not _DOCMGR mov cx, DRIVETOOL_LABEL_FONT mov dx, DRIVETOOL_LABEL_POINTSIZE clr ah call GrSetFont endif add si, DRIVETOOL_NAME_START ; ds:si <- text if _DOCMGR push si mov si, GFMI_HEIGHT or GFMI_ROUNDED call GrFontMetrics ; dx = height mov ax, dx ; ax = height pop si mov cx, ds:[si-size OpDrawText].ODT_len else mov cx, ds:[si-size OpDrawTextAtCP].ODTCP_len endif call GrTextWidth ; dx <- width, in points call GrDestroyState pop di ; ds:di <- OpDrawBitmapOptr if _DOCMGR ; ; text Y = icon height ; total height = icon height + text height ; mov cx, ds:[si-DRIVETOOL_NAME_START].VM_data+VMGS_height mov ds:[si-size OpDrawText].ODT_y1, cx add ds:[si-DRIVETOOL_NAME_START].VM_data+VMGS_height, ax ; ; inset narrower of icon and bitmap ; cmp dx, ds:[si-DRIVETOOL_NAME_START].VM_width jae nameWider mov cx, ds:[si-DRIVETOOL_NAME_START].VM_width sub cx, dx shr cx, 1 mov ds:[si-size OpDrawText].ODT_x1, cx mov ds:[di].ODBOP_x, 0 jmp short haveTextLoc nameWider: mov cx, dx sub cx, ds:[si-DRIVETOOL_NAME_START].VM_width shr cx, 1 mov ds:[si-DRIVETOOL_NAME_START].VM_width, dx mov ds:[di].ODBOP_x, cx mov ds:[si-size OpDrawText].ODT_x1, 0 haveTextLoc: else ; ; Set that, plus the gutter between the two, as the X coordinate ; for drawing the bitmap. ; add dx, DRIVETOOL_LABEL_GUTTER mov ds:[di].ODBOP_x, dx ; ; Add the same amount into the cached width, too. ; add ds:[si-DRIVETOOL_NAME_START].VM_width, dx endif exit: .leave ret DriveToolSpecBuild endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriveToolGetDrive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: get drive number for this drive CALLED BY: MSG_DRIVE_TOOL_GET_DRIVE PASS: usual object stuff RETURN: bp - drive nubmer dx - disk handle DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 1/11/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DriveToolGetDrive method dynamic DriveToolClass, MSG_DRIVE_TOOL_GET_DRIVE mov al, ds:[di].DT_driveNumber ; get drive number clr ah mov bp, ax ; bp = drive number mov dx, ds:[di].DT_disk ; dx = disk handle ret DriveToolGetDrive endm PseudoResident ends
23.534314
79
0.62487
dbcdec52511edfa1debfc8307a4eeb8b9ece77dd
827
asm
Assembly
C/Mips(Assembly)_C/Lab2/lab2_1c.asm
paulolima18/ProgrammingMesh
2b91085fa5010e73a3bc1f3d9f02c20ce46eb8df
[ "MIT" ]
3
2021-02-15T11:36:52.000Z
2021-06-27T14:21:01.000Z
C/Mips(Assembly)_C/Lab2/lab2_1c.asm
paulolima18/ProgrammingMesh
2b91085fa5010e73a3bc1f3d9f02c20ce46eb8df
[ "MIT" ]
null
null
null
C/Mips(Assembly)_C/Lab2/lab2_1c.asm
paulolima18/ProgrammingMesh
2b91085fa5010e73a3bc1f3d9f02c20ce46eb8df
[ "MIT" ]
null
null
null
.data ind: .word 0x10010000 .text la $t0,ind #pointer li $t1,0x000000ff #blue color li $t2,0x00ff00ff #fuchsia color li $t3,0 #counter cols li $t4,0 #counter rows li $s0,64 #row size li $s1,32 #col size li $s2,28 #min bloack width li $s3,12 #min block height li $s4,36 #max block width li $s5,20 #max block height very: slt $t7,$t3,$s2 # want 0 slt $t6,$t3,$s4 # want 1 slt $t8,$t7,$t6 #will be 1 slt $t5,$t4,$s3 #want 0 slt $t6,$t4,$s5 #want 1 slt $t9,$t5,$t6 #will be 1 #bne $t8,$0,next and $t8,$t8,$t9 beq $t8,1,colf #bne $t9,$0,colf colb: sw $t1,0($t0) addi $t3,$t3,1 addi $t0,$t0,4 slt $t7,$t3,$s0 bne $t7,$0,very row: li $t3,0 addi $t4,$t4,1 slt $t7,$t4,$s1 bne $t7,$0,very colf: sw $t2,0($t0) addi $t3,$t3,1 addi $t0,$t0,4 slt $t7,$t3,$s4 bne $t7,$0,colf beq $t7,$0,colb
15.903846
33
0.602177
c499b19807919347fb7823dd4247b265381d3882
341
asm
Assembly
programs/oeis/081/A081072.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/081/A081072.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/081/A081072.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A081072: Fibonacci(4n) + 3, or Fibonacci(2n+2)*Lucas(2n-2). ; 3,6,24,147,990,6768,46371,317814,2178312,14930355,102334158,701408736,4807526979,32951280102,225851433720,1548008755923,10610209857726,72723460248144,498454011879267,3416454622906710,23416728348467688 mul $0,2 mov $2,1 lpb $0,1 sub $0,1 add $1,$2 add $2,$1 lpe add $1,3
28.416667
202
0.759531
3807a3743c64f081401a1a60002e3fe52a5fbb6c
689
asm
Assembly
programs/oeis/010/A010003.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/010/A010003.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/010/A010003.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A010003: a(0) = 1, a(n) = 11*n^2 + 2 for n>0. ; 1,13,46,101,178,277,398,541,706,893,1102,1333,1586,1861,2158,2477,2818,3181,3566,3973,4402,4853,5326,5821,6338,6877,7438,8021,8626,9253,9902,10573,11266,11981,12718,13477,14258,15061,15886,16733,17602,18493,19406,20341,21298,22277,23278,24301,25346,26413,27502,28613,29746,30901,32078,33277,34498,35741,37006,38293,39602,40933,42286,43661,45058,46477,47918,49381,50866,52373,53902,55453,57026,58621,60238,61877,63538,65221,66926,68653,70402,72173,73966,75781,77618,79477,81358,83261,85186,87133,89102,91093,93106,95141,97198,99277,101378,103501,105646,107813 pow $1,$0 gcd $1,2 mov $3,$0 mul $3,$0 mov $2,$3 mul $2,11 add $1,$2 mov $0,$1
57.416667
560
0.75762
8e9cc9e42fe037271b77dd000981acc0c9abf102
719
asm
Assembly
PRG/levels/Under/PipeJcCR.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Under/PipeJcCR.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Under/PipeJcCR.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
; Original address was $AF39 ; Pipe junction C1 .word $0000 ; Alternate level layout .word $0000 ; Alternate object layout .byte LEVEL1_SIZE_01 | LEVEL1_YSTART_140 .byte LEVEL2_BGPAL_04 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_D8 .byte LEVEL3_TILESET_03 | LEVEL3_VSCROLL_LOCKED .byte LEVEL4_BGBANK_INDEX(3) | LEVEL4_INITACT_PIPE_B .byte LEVEL5_BGM_UNDERGROUND | LEVEL5_TIME_300 .byte $40, $00, $0E, $99, $00, $51, $0F, $6F, $00, $E9, $99, $01, $81, $0D, $0F, $0F .byte $E9, $8F, $03, $B4, $09, $8F, $06, $54, $04, $0F, $03, $E3, $13, $03, $07, $6F .byte $0C, $E3, $13, $0C, $0A, $14, $06, $71, $14, $0A, $80, $94, $08, $B2, $01, $16 .byte $08, $07, $75, $09, $E0, $16, $09, $0A, $2F, $01, $C6, $2F, $0D, $C6, $FF
47.933333
85
0.624478
09f5417571dee6e17c53df3541ff06b830508fa9
392
asm
Assembly
programs/oeis/115/A115099.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/115/A115099.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/115/A115099.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A115099: a(0)=4, a(n) = 3*a(n-1) - 4. ; 4,8,20,56,164,488,1460,4376,13124,39368,118100,354296,1062884,3188648,9565940,28697816,86093444,258280328,774840980,2324522936,6973568804,20920706408,62762119220,188286357656,564859072964,1694577218888,5083731656660,15251194969976,45753584909924,137260754729768,411782264189300,1235346792567896,3706040377703684 mov $1,3 pow $1,$0 mul $1,2 add $1,2
49
313
0.806122
ab1344f1e702b101d2783cf79e50b75df04f60c2
776
asm
Assembly
programs/oeis/023/A023601.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/023/A023601.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/023/A023601.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A023601: Convolution of A023532 and odd numbers. ; 1,3,6,11,17,24,33,44,56,69,84,101,120,140,161,184,209,236,265,295,326,359,394,431,470,511,553,596,641,688,737,788,841,896,952,1009,1068,1129,1192,1257,1324,1393,1464,1536,1609,1684,1761,1840,1921 mov $12,$0 mov $14,$0 add $14,1 lpb $14 clr $0,12 mov $0,$12 sub $14,1 sub $0,$14 mov $9,$0 mov $11,$0 add $11,1 lpb $11 clr $0,9 mov $0,$9 sub $11,1 sub $0,$11 mov $2,$0 lpb $2 mov $7,1 lpb $5 mov $5,$2 sub $5,1 mov $6,6 lpe add $5,$7 lpb $6 mov $4,4 sub $6,$1 lpe add $1,1 sub $2,$5 trn $2,1 lpe mov $1,$4 div $1,4 add $1,1 add $10,$1 lpe add $13,$10 lpe mov $1,$13
17.244444
197
0.507732
8ff8fa421381a4ca557931d4bc5e24cb141d6a28
5,155
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1400.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1400.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1400.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r15 push %rax push %rbp push %rsi // Store lea addresses_WT+0x10afb, %rax nop nop nop xor %r10, %r10 mov $0x5152535455565758, %rsi movq %rsi, %xmm5 movups %xmm5, (%rax) sub %rsi, %rsi // Load lea addresses_D+0xa1d3, %r10 clflush (%r10) nop inc %r15 mov (%r10), %rax nop nop nop nop add $49297, %rax // Store lea addresses_PSE+0x16dfb, %r10 nop nop add $30220, %r12 movb $0x51, (%r10) nop dec %r11 // Store lea addresses_WT+0x9efb, %r11 add %rbp, %rbp movb $0x51, (%r11) nop xor $49010, %rbp // Store lea addresses_WC+0xfbc7, %rsi nop dec %r12 movb $0x51, (%rsi) nop nop nop nop cmp $23522, %rax // Store lea addresses_D+0x1a2fb, %rax nop nop nop nop nop add %r12, %r12 movb $0x51, (%rax) nop nop and %rsi, %rsi // Faulty Load lea addresses_WT+0x9efb, %rax nop nop add $7054, %rbp movups (%rax), %xmm4 vpextrq $1, %xmm4, %r15 lea oracles, %rax and $0xff, %r15 shlq $12, %r15 mov (%rax,%r15,1), %r15 pop %rsi pop %rbp pop %rax pop %r15 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': True, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'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 */
45.219298
2,999
0.652182
953743a0fadafb33d00e25f8dbed00a88a903970
6,050
asm
Assembly
Driver/Printer/PrintCom/Text/textPrintStyleRun.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Printer/PrintCom/Text/textPrintStyleRun.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Printer/PrintCom/Text/textPrintStyleRun.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: laserjet print driver FILE: textPrintStyleRun.asm AUTHOR: Dave Durran ROUTINES: Name Description ---- ----------- PrintText Print a text string REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 7/19/92 Initial revision DESCRIPTION: This file contains most of the code to implement the print driver ascii text support $Id: textPrintStyleRun.asm,v 1.1 97/04/18 11:50:01 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrintStyleRun %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: PrintText prints a text string pointed at by es:si CALLED BY: GLOBAL PASS: bp - Segment of PSTATE ax - X offset into paper to print for this tile. cx - Y offset into paper to print for this tile. dx:si - structure holding the style run info. RETURN: carry - set if some error sending string to printer DESTROYED: nothing PSEUDO CODE/STRATEGY: take the position, style, font info, and set it at the printer, then print a string. KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 02/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrintStyleRun proc far uses ax,bx,cx,dx,si,ds,es,di .enter mov es,bp ;PState in es...... mov ds,dx ;get the style run info segment into ds. ;set the cursor position first..... sub ax,es:[PS_currentMargins].PM_left ;fix up the X tile pos. neg ax add ax,ds:[si].SRI_xPosition ;integer x pos. mov dx,ds:[si].SRI_yPosition ;integer y pos. test es:[PS_paperInput],mask PIO_TRACTOR ;check paper type.... jnz tiled ;if tractor, then skip correction. sub cx,es:[PS_currentMargins].PM_top ;add the top margin to correct ;for the tile value passed in ax sub dx,cx ;get rid of tile offset. tiled: mov cx,ax ;transfer the X pos. clr ax push si mov si,ax ;clear fractions for now. call PrintSetCursor ;set the cursor position. pop si jc exit ;pass erros out. mov ax,ds:[si].SRI_attributes ;number of attribute element ifndef SET_CURSOR_MODIFIES_FONT cmp ax,es:PS_previousAttribute ;see if the attribute number is the ;same for this run. jne getStringMetrics ;if so, skip setting the font, etc.... ;we only need to set what ever the ;PrintSetCursor routine nuked. push si ;save the address of the StyleRunInfo jmp setStyles getStringMetrics: endif push ax ;save element # mov dx,ds:[si].SRI_stringWidth.WBF_int if PZ_PCGEOS ; ; count full-width characters as double ; XXX: fix this check when we know which chars a full-width in the ; printer font ; ; fixed. though this way is SJIS spesific, I think. ; sigh :-( C_PARAGRAPH_SIGN U+0xb6, SJIS 0x81f7 mov bx,ds:[si].SRI_numChars ;get average char width. mov cx, bx push si add si, offset SRI_text doubleLoop: lodsw cmp ax, C_DELETE jbe halfWidth ; cmp ax, C_HIRAGANA_LETTER_SMALL_A ; jb halfWidth cmp ax, C_HALFWIDTH_IDEOGRAPHIC_PERIOD jb fullWidth cmp ax, C_FULLWIDTH_CENT_SIGN jb halfWidth fullWidth: inc bx halfWidth: loop doubleLoop pop si clr ax mov ch,ds:[si].SRI_stringWidth.WBF_frac clr cl else mov ch,ds:[si].SRI_stringWidth.WBF_frac clr cl clr ax mov bx,ds:[si].SRI_numChars ;get average char width. endif call GrUDivWWFixed ;do division pop ax ;get back the element # push si ;save the address of the StyleRunInfo mov si,ds:TS_textAttributeInfo ;get handle of element array call ChunkArrayElementToPtr ;get address. mov bx,dx ;get in the divisor registers mov ax,cx if 0 ;---------------------------------------------------------------------- ;REMOVED THIS TEST DJD 12-6-92 ;OK when we have screen equivalent fonts for proportional ;ASCII printing. ;here we need to detect whether we have a proportional font or ;not, and set the pitch to 0 if proportional. mov cx,ds:[di].TAI_font ;get FontID mov dx,(mask FEF_FAMILY or mask FEF_OUTLINES or (FF_MONO shl 8)) call GrCheckFontAvail cmp cx,FID_INVALID ;if proportional... jne finishSettingPitch clr bl jmp setFont ;ALL FONTS ARE FIXED PITCH DJD 12-6-92 ;if here, then the font is fixed pitch. get the char widths. ;and then convert to a pitch x 10 value. ;set the font for this run. ;bx.ax = average char width for this run. finishSettingPitch: ;---------------------------------------------------------------------- endif clr cx mov dx,720 call GrUDivWWFixed ;do division mov bx,dx ;bx.ax is now the Pitch.... test cx,8000h ;see if round ness. jz rounded inc bx rounded: test bh,bh ;see if the pitch is out of range. jz setFont mov bl,255 ;just suggest max range. ;now we have all the info to set a printer font. ;cx = FontID ;dx = point size ;bl = pitch x 10 cpi (0 if proportional) setFont: mov cx,ds:[di].TAI_font ;get FontID mov dx,ds:[di].TAI_size.WBF_int ;get Font size. call PrintSetFont ;set up the font. jc beforePop ;pass any error out. ;set up the color of the text. mov al,ds:[di].TAI_color.RGB_red mov dl,ds:[di].TAI_color.RGB_green mov dh,ds:[di].TAI_color.RGB_blue call PrintSetColor jc beforePop ;pass any error out. ;set the style bits for this style run. setStyles: mov dx,ds:[di].TAI_style call PrintSetStyles beforePop: pop si ;get back the SRI address. jc exit mov cx,ds:[si].SRI_numChars add si,SRI_text ;set up offset mov dx,ds ;set up segment ;bp should still be the PState call PrintText ;send out the buffer. exit: .leave ret PrintStyleRun endp
27.5
79
0.631405
f26d009e5de8491658995faa6e0225d47606c292
6,272
asm
Assembly
documents/manuals/intel/80386/ops/LOADALL/loadfns.386.asm
jriwanek-forks/pcjs
868047405c383e2b05848e771e89e2bd4558ee96
[ "MIT" ]
711
2015-01-12T21:43:49.000Z
2022-03-31T15:04:16.000Z
documents/manuals/intel/80386/ops/LOADALL/loadfns.386.asm
jriwanek-forks/pcjs
868047405c383e2b05848e771e89e2bd4558ee96
[ "MIT" ]
98
2015-01-06T11:52:01.000Z
2022-03-28T18:14:28.000Z
documents/manuals/intel/80386/ops/LOADALL/loadfns.386.asm
jriwanek-forks/pcjs
868047405c383e2b05848e771e89e2bd4558ee96
[ "MIT" ]
152
2015-02-01T20:23:27.000Z
2022-03-30T21:58:48.000Z
;----------------------------------------------------------------------------- ; ; LOADFNS.386 ; ; Copyright (c) 1991, 1995-Present Robert Collins ; ; You have my permission to copy and distribute this software for ; non-commercial purposes. Any commercial use of this software or ; source code is allowed, so long as the appropriate copyright ; attributions (to me) are intact, *AND* my email address is properly ; displayed. ; ; Basically, give me credit, where credit is due, and show my email ; address. ; ;----------------------------------------------------------------------------- ; ; Robert R. Collins email: rcollins@x86.org ; ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- INT01: ; Int1 trap routine ;----------------------------------------------------------------------------- ; Interprets breakpoint type, and sets a flag ;----------------------------------------------------------------------------- inc dx push bp mov bp,sp mov buffer2[bx],cx add bx,2 push eax push ebx push ecx mov eax,dr6 mov ecx,eax mov ebx,dr7 shr ebx,10h ; get length encodings test ah,20h ; debug register access attempt? jnz @DR_Attempt ; yep shr al,1 ; DR0? jc @DR0 shr al,1 ; DR1? jc @DR1 shr al,1 ; DR2? jc @DR2 @DR3: or si,8 and cl,not 8 test bh,30h ; code, or data? jz @Fault jmp short @Trap @DR2: or si,4 and cl,not 4 test bh,03h ; code, or data? jz @Fault jmp short @Trap @DR1: or si,2 and cl,not 2 test bl,30h ; code, or data? jz @Fault jmp short @Trap @DR0: or si,1 and cl,not 1 test bl,03h ; code, or data? jz @Fault jmp short @Trap @Fault: add word ptr [bp][2],1 mov dr6,ecx @Trap: pop ecx pop ebx pop eax pop bp iret @Dr_Attempt: push bp add word ptr [bp][2],3 pop bp iret ;----------------------------------------------------------------------------- Save_state proc near ; Save the machine state before LOADALL ;----------------------------------------------------------------------------- push eax push ds mov si,0 mov di,offset Machine_State.GS_Desc mov ax,5000h ; GS descriptor mov ds,ax mov ebx,05050505h movsd mov dword ptr [si-4],ebx sub ax,1000h ; FS descriptor sub ebx,01010101h mov si,0 add di,8 mov ds,ax movsd mov dword ptr [si-4],ebx sub ax,2000h ; DS descriptor sub ebx,02020202h mov si,0 add di,8 mov ds,ax movsd mov dword ptr [si-4],ebx add ax,4000h ; SS descriptor add ebx,04040404h mov si,0 add di,8 mov ds,ax movsd mov dword ptr [si-4],ebx sub ax,3000h ; ES descriptor sub ebx,03030303h mov si,0 add di,14h mov ds,ax movsd mov dword ptr [si-4],ebx pop ds mov eax,cr0 mov Machine_State._CR0,eax pushfd pop eax mov Machine_State._Eflags,eax pop eax mov Machine_State._EDI,edi mov Machine_State._ESI,esi mov Machine_State._EBP,ebp mov Machine_State._EBX,ebx mov Machine_State._EDX,edx mov Machine_State._ECX,ecx mov Machine_State._EAX,eax mov ax,gs movzx eax,ax mov Machine_State._GS,eax mov ax,fs mov Machine_State._FS,eax mov ax,ds mov Machine_State._DS,eax mov ax,es mov Machine_State._ES,eax ret Save_state endp ;----------------------------------------------------------------------------- Restore_state proc near ; Restore the machine state after LOADALL ;----------------------------------------------------------------------------- mov ax,_data mov ds,ax mov ax,5000h ; GS mov es,ax mov si,offset Machine_State.GS_Desc mov di,0 movsd sub ax,1000h ; FS add si,8 mov di,0 mov es,ax movsd sub ax,2000h ; DS add si,8 mov di,0 mov es,ax movsd add ax,4000h ; SS add si,8 mov di,0 mov es,ax movsd sub ax,3000h ; ES add si,14h mov di,0 mov es,ax movsd mov eax,Machine_State._ES mov es,ax mov eax,Machine_State._DS mov ds,ax mov eax,Machine_State._FS mov fs,ax mov eax,Machine_State._GS mov gs,ax mov eax,Machine_State._Eflags push eax popfd mov eax,Machine_State._CR0 mov cr0,eax mov eax,Machine_State._EAX mov ecx,Machine_State._ECX mov edx,Machine_State._EDX mov ebx,Machine_State._EBX mov ebp,Machine_State._EBP mov esi,Machine_State._ESI mov edi,Machine_State._EDI ret Restore_State endp
30.446602
78
0.390147
abedb2fb54bcf7cdee1785f18c19b64859146603
433
asm
Assembly
oeis/301/A301895.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/301/A301895.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/301/A301895.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A301895: a(n) = (number of 1's in binary expansion of n)^(number of 0's in binary expansion of n). ; Submitted by Jamie Morken(s2) ; 0,1,1,1,1,2,2,1,1,4,4,3,4,3,3,1,1,8,8,9,8,9,9,4,8,9,9,4,9,4,4,1,1,16,16,27,16,27,27,16,16,27,27,16,27,16,16,5,16,27,27,16,27,16,16,5,27,16,16,5,16,5,5,1,1,32,32,81,32,81,81,64,32,81,81,64,81,64,64,25,32 mov $1,$0 mov $2,1 lpb $1 div $0,2 sub $1,$0 add $2,1 lpe sub $2,$1 pow $1,$2 mov $0,$1
28.866667
204
0.605081
39a97e7684c00243987e2dd38e75f22a615d270f
787
asm
Assembly
src/mappers/mapper71.asm
DigiDwrf/neon64v2-easybuild
94fa46fbc8ddb2af593cb42162df58f65a03ebc4
[ "0BSD" ]
36
2020-07-08T11:27:17.000Z
2022-03-15T08:38:52.000Z
src/mappers/mapper71.asm
DigiDwrf/neon64v2-easybuild
94fa46fbc8ddb2af593cb42162df58f65a03ebc4
[ "0BSD" ]
19
2020-07-12T23:14:03.000Z
2021-12-14T07:57:40.000Z
src/mappers/mapper71.asm
DigiDwrf/neon64v2-easybuild
94fa46fbc8ddb2af593cb42162df58f65a03ebc4
[ "0BSD" ]
6
2021-07-17T09:57:46.000Z
2022-03-13T07:50:25.000Z
// Mapper 71: Codemasters scope Mapper71: { Init: addi sp, 8 sw ra, -8 (sp) jal InitUxPRGROM la_gp(a0, WriteHigh) // Update write handler for 0x8000-0xc000 lli t2, 0 lli t3, 0x40 la_gp(t1, WriteLow) - sw t1, cpu_write_map + 0x80 * 4 (t2) addi t3, -1 bnez t3,- addi t2, 4 // Tail call lw ra, -8 (sp) addi sp, -8 j WriteHigh lli cpu_t0, 0 WriteLow: // TODO, single-screen mirroring for Fire Hawk jr ra nop WriteHigh: ls_gp(sb cpu_t0, uxrom_prgrom_bank) ls_gp(lw t2, prgrom_start_phys) ls_gp(lwu t0, prgrom_mask) sll t1, cpu_t0, prgrom_page_shift and t1, t0 add a1, t2, t1 ls_gp(lw a2, prgrom_last_page_phys) ls_gp(lbu t0, uxrom_prgrom_tlb_index) ls_gp(lw a0, uxrom_prgrom_vaddr) // Tail call j TLB.Map16K_2 mtc0 t0, Index }
16.061224
46
0.674714
5af1da4d39d504683acbe3a1d20b9484e6a17cfc
79,200
asm
Assembly
Library/User/Proc/procClass.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/User/Proc/procClass.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/User/Proc/procClass.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @----------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: UserInterface/Proc FILE: procClass.asm ROUTINES: Name Description ---- ----------- GLB GenProcessClass Superclass of all processes REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version Doug 11/89 Added Application, Restore & Engine invocation DESCRIPTION: This file contains routines to implement the UI_ class $Id: procClass.asm,v 1.1 97/04/07 11:44:16 newdeal Exp $ -------------------------------------------------------------------------------@ COMMENT @CLASS DESCRIPTION----------------------------------------------------- GenProcessClass Synopsis -------- GenProcessClass is the superclass of all processes that use the user interface. This class defines methods for standard user interface interaction. NOTE: The section between "Declaration" and "Methods declared" is copied into ui.def by "pmake def" Additional documentation ------------------------ From the perspective of the ProcessClass: MSG_META_ATTACH calls: MSG_PROCESS_STARTUP_UI_THREAD, which checks to see if there are any resources of the application which are marked as "ui-object", that is, to be run by a UI thread. If so, it then calls MSG_PROCESS_CREATE_UI_THREAD to create that thread, then marks the "ui-object" blocks as being run by that thread. Then, MSG_GEN_PROCESS_ATTACH_TO_PASSED_STATE_FILE, if MSG_META_ATTACH was called called with an appMode of MSG_GEN_PROCESS_RESTORE_FROM_STATE. MSG_META_ATTACH then calls MSG_META_APP_STARTUP on the application object. Any document passed in the AppLaunchBlock is opened by the document control at this point. MSG_META_ATTACH then calls ONE, & ONLY ONE, of: MSG_GEN_PROCESS_OPEN_APPLICATION, to cause the application to come up on screen. This is implemented in the default handler by setting the application object USABLE. MSG_GEN_PROCESS_OPEN_ENGINE, which does nothing but mark the application as being in engine mode (Non-visual). Currently, the only thing that ever happens in engine mode is that the desktop sends the process a MSG_GEN_PROCESS_INSTALL_TOKEN, which has a default handler which installs the application's moniker into the Token database. MSG_GEN_PROCESS_RESTORE_FROM_STATE, which gets whatever the app mode was the last time it was run, and restarts it. The process, in either case, receives a MSG_META_DETACH when it is to be shut down and exited. MSG_META_DETACH calls: MSG_GEN_PROCESS_CLOSE_APPLICATION, to fetch any additional state that the application wants to save away (This block of data is returned to the application the next time it is loaded with the state file, in MSG_GEN_PROCESS_OPEN_APPLICATION), or MSG_GEN_PROCESS_CLOSE_ENGINE if opened in ENGINE mode. If the detach was *not* initiated by a MSG_META_QUIT, it then creates/attaches to a state file if none was passed earlier, then shuts down to state. If it was done by MSG_META_QUIT, we do not attach to a state file, but instead just exit. If we had already attached to a state file, we call ObjDisassocVMFile, and then delete the state file. ------------------------------------------------------------------------------@ UserClassStructures segment resource GenProcessClass mask CLASSF_NEVER_SAVED UserClassStructures ends ;--------------------------------------------------- AppAttach segment resource COMMENT @----------------------------------------------------------------------- FUNCTION: UI_Attach -- MSG_META_ATTACH for GenProcessClass DESCRIPTION: Attach the process. Also called directly by a process to do default initialization PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_META_ATTACH Pass: dx - Block handle to block of structure AppLaunchBlock Return: Nothing RETURN: DESTROYED: ax, bx, cx, dx, bp, si, di REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: 1) The default MSG_META_ATTACH will associate the process with any state file passed. If a state file is not passed, it will not create a state file unless/until it receives a MSG_META_DETACH later. 2) The AppObj will be sent a MSG_META_ATTACH. This method is NOT processed by the GenActiveList, but instead is processed by merely adding the application object into the generic tree. (Nothing is sent to the active list until the application is set USABLE) 3) The application mode method passed will be sent to the process, passed along with the AppLaunchBlock, any extra state block returned from the ObjAssocVMFile (if the app mode method is RESTORE_FROM_STATE), & AppAttachFlags. 4) Finally, any AppLaunchBlock passed, & any extra state block that was brought out of any state file passed, is freed. KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version Doug 11/89 Added Application, Restore & Engine invocation -------------------------------------------------------------------------------@ UI_Attach method static GenProcessClass, MSG_META_ATTACH push dx mov ax, MSG_GEN_SYSTEM_MARK_BUSY call UserCallSystem pop dx ; Update Field w/what geode handle we turned out to be, so it can ; put up our icon as progress indication, if an "Activate" dialog ; is on-screen for us. ; push ds push dx mov bx, dx ; dx = AppLaunchBlock call MemLock mov ds, ax call GeodeGetProcessHandle mov cx, bx ; get cx = geode mov bx, ds:[ALB_genParent].handle ; get ^lbx:si = GenField mov si, ds:[ALB_genParent].chunk mov ax, MSG_GEN_FIELD_ACTIVATE_UPDATE mov di, mask MF_CALL call ObjMessage pop dx mov bx, dx call MemUnlock pop ds ;Do this after setting the initial path specified in the AppLaunchBlock, ;as the UI thread will inherit our path. The problem was that if you ;have an app on a PCMCIA card, its UI thread's path will be on the card ;and when hard icon apps are started on that UI thread, the hard icon apps ;will inherit that card path, a bad thing when the card is removed ;-brianc 7/15/93 ; ; Startup UI thread for application, if it needs one. ; ; ; push dx ; Preserve AppLaunchBlock ; mov ax, MSG_PROCESS_STARTUP_UI_THREAD ; call GeodeGetProcessHandle ; mov di, mask MF_CALL or mask MF_FIXUP_DS ; call ObjMessage ; pop dx push es mov bx, handle dgroup call MemDerefES mov bx, dx EC < tst bx ; See if AppLaunchBlock passed > EC < ERROR_Z NO_APP_LAUNCH_BLOCK_PASSED_TO_APPLICATION > ; Set path for new application, if specified push ds call MemLock mov ds, ax push bx cmp ds:[ALB_appMode], 0 ; see if default mode should be used jne haveMode ;Branch if not mov ds:[ALB_appMode], MSG_GEN_PROCESS_OPEN_APPLICATION haveMode: ; ; If we are running in UILM_TRANSPARENT mode and doing a ; OPEN_APPLICATION, then stuff in the transparent state file name ; for this geode and set RESTORE_FROM_STATE mode. If there is no ; such state file yet (the very first time the application is run, ; or after a reset-after-crash), then ; MSG_GEN_PROCESS_ATTACH_TO_PASSED_STATE_FILE will just behave ; as if we are in OPEN_APPLICATION mode. ; ; NOTE: If the application is running in desk accessory mode, then we ; don't mess with it, as desk accessories are not affected by ; UILM_TRANSPARENT mode. ; ; ; NOTE: We leave an existing state file alone. This can only ; ; happen if this app is the single app that the field is currently ; ; saving in it's instance data. In this case, we didn't use the ; ; transparent state file name when detaching. ; The above NOTE has been changed because we actually always save the state ; file with the transparent state file name, so in any case, we have the ; correct state file name if we have MSG_GEN_PROCESS_RESTORE_FROM_STATE ; - brianc 6/16/93 ; ; ds - AppLaunchBlock ; es - dgroup ; cmp es:[uiLaunchModel], UILM_TRANSPARENT jne afterTransparent ; Desk accessories are now transparently detachable just like other apps ; (only the user can choose to detach them before the system would) ; ; test ds:[ALB_launchFlags], mask ALF_DESK_ACCESSORY ; jnz afterTransparent cmp ds:[ALB_appMode], MSG_GEN_PROCESS_OPEN_APPLICATION jne afterTransparent ; ; If we are passed a datafile, then we don't want to restore from ; state. The existing state file will be truncate when we save to ; state. - brianc 6/10/93 ; ; ds - AppLaunchBlock ; SBCS < cmp {byte} ds:[ALB_dataFile], 0 > DBCS < cmp {wchar}ds:[ALB_dataFile], 0 > jne afterTransparent ; have datafile ; force restore from state mov ds:[ALB_appMode], MSG_GEN_PROCESS_RESTORE_FROM_STATE push es segmov es, ds ; es:di = state file name buffer mov di, offset ALB_appRef.AIR_stateFile .assert (size AIR_stateFile ge FILE_LONGNAME_BUFFER_SIZE) call GetTransparentStateFileName pop es afterTransparent: mov cx, ds:[ALB_appMode] ; cx = app mode ; cmp byte ptr ds:[ALB_path], 0 ; jz AfterSet ;Branch if not path passed ; ; Set the new current path for application ; mov bx, ds:[ALB_diskHandle] ; mov dx, offset ALB_path ; call FileSetCurrentPath ; ;AfterSet: ;To prevent problems with threads being stuck on a PCMCIA card when the card ;is removed, just use SP_TOP here. Apps will manually have to deal with ;setting up the right directory to access datafiles passed through the ALB. ;The document control correctly does this. Always set SP_TOP, regardless of ;existance of passed path. - brianc 7/19/93 mov ax, SP_TOP call FileSetStandardPath ; If a state file was passed, set flag ; in AppAttachFlags (for application's ; sake) clr ax ;Assume no state block EC < cmp byte ptr ds:[ALB_appRef.AIR_stateFile], 0 > EC < jz 10$ > EC < cmp ds:[ALB_appMode], MSG_GEN_PROCESS_RESTORE_FROM_STATE > EC < ERROR_NZ STATE_FILE_PASSED_BUT_MODE_WAS_NOT_RESTORE_FROM_STATE > EC <10$: > pop bx ;Unlock the passed AppLaunchBlock call MemUnlock pop ds ;moved here from above - brianc 7/15/93 ; Startup UI thread for application, if it needs one. ; push ax, bx, cx mov ax, MSG_PROCESS_STARTUP_UI_THREAD call GeodeGetProcessHandle mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage pop ax, bx, cx ; Associate with a VM file ; If a state file has been passed in, attach to it, else, just ; continue onward without a state file. cmp cx, MSG_GEN_PROCESS_RESTORE_FROM_STATE jnz noStateFile ; If no statefile passed, branch push bx ; Preserve AppLaunchBlock handle push cx mov dx, bx ; pass handle in dx call GeodeGetProcessHandle mov di, mask MF_CALL or mask MF_FIXUP_DS mov ax, MSG_GEN_PROCESS_ATTACH_TO_PASSED_STATE_FILE call ObjMessage ; Returns ax = extra state block, if any pop cx pop bx noStateFile: push bx ;Save AppLaunchBlock mov dx, bx ; pass AppLaunchBlock in dx push ax ; Save extra state block returned from ; MSG_GEN_PROCESS_ATTACH_TO_PASSED_STATE_FILE ; (if no state file, AX is 0 here, so it will ; be as if no extra state was saved off). ; Ask the application object to attach itself into system generic tree. Also ; copies app filename & state file name into local instance data. If document ; was passed, it is opened by the document control during this call (for ; dual-threaded apps, it is actually only opened after this method is ; complete, since the META_APP_STARTUP message will be queued for the ; GenDocumentGroup until we return). mov ax, MSG_META_APP_STARTUP call GenCallApplication pop bp ;Restore extra state block pop bx ;Restore handle of AppLaunchBlock push ds ; call MemLock ;Lock AppLaunchBlock (again!) mov ds, ax ; mov ax, ds:[ALB_appMode] ; fetch app attach mode to use ; Set up AppAttachFlags in CX for the method handler we're about to call clr cx cmp ax, MSG_GEN_PROCESS_RESTORE_FROM_STATE jnz UI_AfterStateTest ornf cx, mask AAF_STATE_FILE_PASSED UI_AfterStateTest: ; If a data file was passed, set flag ; in AppAttachFlags (for application's ; sake) SBCS < cmp byte ptr ds:[ALB_dataFile], 0 > DBCS < cmp {wchar}ds:[ALB_dataFile], 0 > jz UI_AfterDataTest ornf cx, mask AAF_DATA_FILE_PASSED UI_AfterDataTest: call MemUnlock ; Unlock the AppLaunchBlock pop ds push bx ; Save handle of AppLaunchBlock mov dx, bx ; pass AppLaunchBlock in dx push bp ; Save extra state block call GeodeGetProcessHandle ; Here, AX is either MSG_GEN_PROCESS_RESTORE_FROM_STATE or ; MSG_GEN_PROCESS_OPEN_APPLICATION or MSG_GEN_PROCESS_OPEN_ENGINE ; mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage pop bx ; NUKE the extra state block, unless it's ; saved away for later use tst bx jz UI_AfterStateBlockNuked call RetrieveTempGenAppExtraStateBlock cmp bx, cx je UI_AfterStateBlockNuked call MemFree UI_AfterStateBlockNuked: pop bx ; NUKE the passed AppLaunchBlock EC < tst bx > EC < ERROR_Z NO_APP_LAUNCH_BLOCK_PASSED_TO_APPLICATION > call MemFree pop es ; Notify whoever is listening that the app was started. ; NOTE: This msg has existed for a long time but was never ; sent by anybody until now. --JimG 9/13/99 mov ax, MSG_NOTIFY_APP_STARTED call GeodeGetProcessHandle mov dx, bx clr bx, si ; bx:si == everyone! mov di, mask MF_RECORD call ObjMessage ; ^hdi = recorded event mov cx, di clr dx mov bx, MANUFACTURER_ID_GEOWORKS mov ax, GCNSLT_APPLICATION mov bp, mask GCNLSF_FORCE_QUEUE ; GCNListSendFlags call GCNListSend mov ax, MSG_GEN_SYSTEM_MARK_NOT_BUSY call UserCallSystem ret UI_Attach endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetTransparentStateFileName %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Build state file name for application detached for UILM_TRANSPARENT mode. CALLED BY: PASS: es:di - buffer for transparent state file name (must be at least FILE_LONGNAME_BUFFER_LENGTH) RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 11/20/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SBCS < LocalDefNLString transparentStateFilePostfix <" (transparent)",0>> DBCS < LocalDefNLString transparentStateFilePostfix <" (t)",0> > TRANSPARENT_STATE_FILE_POSTFIX_LENGTH = (length transparentStateFilePostfix) GetTransparentStateFileName proc far uses ax, bx, cx, ds, si, di .enter .assert (FILE_LONGNAME_BUFFER_SIZE ge ((GEODE_NAME_SIZE + GEODE_NAME_EXT_SIZE) + TRANSPARENT_STATE_FILE_POSTFIX_LENGTH)) SBCS < mov ax, GGIT_PERM_NAME_AND_EXT > DBCS < mov ax, GGIT_PERM_NAME_AND_EXT_DBCS > clr bx ; for current geode call GeodeGetInfo SBCS < add di, GEODE_NAME_SIZE + GEODE_NAME_EXT_SIZE > DBCS < add di, (GEODE_NAME_SIZE + GEODE_NAME_EXT_SIZE)*(size wchar)> segmov ds, cs mov si, offset transparentStateFilePostfix mov cx, TRANSPARENT_STATE_FILE_POSTFIX_LENGTH LocalCopyNString ;rep movsb/movsw .leave ret GetTransparentStateFileName endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GenProcessCreateUIThread %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercept message to create a new UI thread, for the purpose of altering the default stack size -- specifically, up it to allow for the recursive nature of UI trees (if the app hasn't itself specified a size to use) CALLED BY: MSG_PROCESS_CREATE_UI_THREAD PASS: es = kdata RETURN: carry clear if thread created DESTROYED: cx, dx, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- doug 8/25/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GenProcessCreateUIThread method GenProcessClass, MSG_PROCESS_CREATE_UI_THREAD tst bp jnz haveStackSize mov bp, INTERFACE_THREAD_DEF_STACK_SIZE haveStackSize: mov di, offset GenProcessClass CallSuper MSG_PROCESS_CREATE_UI_THREAD ret GenProcessCreateUIThread endm COMMENT @---------------------------------------------------------------------- METHOD: UI_AttachToPassedStateFile DESCRIPTION: Attaches the process to the passed state file, if possible PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_GEN_PROCESS_ATTACH_TO_PASSED_STATE_FILE cx - AppAttachMode dx - Block handle to block of structure AppLaunchBlock Return: ax - handle of extra block of state data (0 for none) carry - set if error DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: AttachToFile { Push cur directory Change to state file dir Loop IF state file passed in AppLaunchBlock try to open the VM file IF error opening VM file { create new VM file } Pop cur directory Associate the VM file with the process } KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 11/89 Moved here from UI_Attach atw 9/90 Now don't create new state files until end ------------------------------------------------------------------------------@ UI_AttachToPassedStateFile method static GenProcessClass, MSG_GEN_PROCESS_ATTACH_TO_PASSED_STATE_FILE call FilePushDir ; save current dir mov ax, SP_STATE ;Go to the hot&juicy state directory call FileSetStandardPath EC < cmp cx, MSG_GEN_PROCESS_RESTORE_FROM_STATE > EC < ERROR_NZ STATE_FILE_PASSED_BUT_MODE_WAS_NOT_RESTORE_FROM_STATE > ;This should only be called if we are ; restoring from state push cx ; Save AppAttachBlock, mode for later push dx ; push ds ; ; Try & open any passed state file mov bx, dx ; Get handle of AppLaunchBlock call MemLock ; mov ds, ax ; ; Setup ds:dx as filename to open mov dx, offset ALB_appRef.AIR_stateFile ; Open existing VM file mov ax, (VMO_OPEN shl 8) or \ mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \ mask VMAF_FORCE_DENY_WRITE clr cx ; use standard compaction threshhold call VMOpen ; Go ahead, open it! call FilePopDir pop ds mov dx, bx ;Save VM handle pop bx pop cx call MemUnlock ;Unlock the AppLaunchBlock xchg bx, dx ;BX <- VM handle, DX <- AppLaunchBlock jc error ; Branch if error ; bx = VM file handle ; Call the kernel to associate the state file with the current process ; passing the VM handle in bx call ObjAssocVMFile jnc exit clr al call VMClose ;Close file call FileDelete ;Delete file error: mov bx, dx call MemLock mov ds, ax mov ds:[ALB_appMode], MSG_GEN_PROCESS_OPEN_APPLICATION clr ax ;No extra state SBCS < mov ds:[ALB_appRef.AIR_stateFile], al ;Nuke statefile name > DBCS < mov ds:[ALB_appRef.AIR_stateFile], ax ;Nuke statefile name > call MemUnlock stc exit: ret UI_AttachToPassedStateFile endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SaveTempGenAppExtraStateBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Saves a state block in temp var data in the app object. Set the temp var data regardless of whether there is a state block, as this is also a flag that we're coming back with state. CALLED BY: INTERNAL PASS: cx - state block, if any RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 5/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SaveTempGenAppExtraStateBlock proc far uses ax, bx, cx, dx, si, di varDataParams local AddVarDataParams varDataData local hptr .enter mov varDataData, cx mov varDataParams.AVDP_dataType, TEMP_GEN_APPLICATION_EXTRA_STATE_BLOCK mov varDataParams.AVDP_dataSize, size hptr mov ax, ss mov varDataParams.AVDP_data.segment, ax lea ax, varDataData mov varDataParams.AVDP_data.offset, ax mov dx, size AddVarDataParams push bp lea bp, varDataParams clr bx call GeodeGetAppObject mov ax, MSG_META_ADD_VAR_DATA mov di, mask MF_STACK or mask MF_CALL or mask MF_FIXUP_DS call ObjMessage pop bp .leave ret SaveTempGenAppExtraStateBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RetrieveTempGenAppExtraStateBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Retrieves a state block from temp var data in the app object, if any. CALLED BY: INTERNAL PASS: nothing RETURN: cx - state block, if any carry - set if VarData entry found DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 5/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RetrieveTempGenAppExtraStateBlock proc far uses ax, bx, dx, si, di varDataParams local GetVarDataParams varDataData local hptr .enter mov varDataParams.GVDP_dataType, TEMP_GEN_APPLICATION_EXTRA_STATE_BLOCK mov varDataParams.GVDP_bufferSize, size hptr mov ax, ss mov varDataParams.GVDP_buffer.segment, ax lea ax, varDataData mov varDataParams.GVDP_buffer.offset, ax mov dx, size AddVarDataParams push bp lea bp, varDataParams clr bx call GeodeGetAppObject mov ax, MSG_META_GET_VAR_DATA mov di, mask MF_STACK or mask MF_CALL or mask MF_FIXUP_DS call ObjMessage pop bp mov cx, varDataData cmp ax, -1 ; Test to see if vardata was found je notFound stc ; found exit: RTGAESB_exit label near ; Needed for showcalls -a ForceRef RTGAESB_exit .leave ret notFound: clr cx ; return 0 for state block if not found clc ; not found jmp short exit RetrieveTempGenAppExtraStateBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DestroyTempGenAppExtraStateBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Destroys state block temp var data in the app object, if present. CALLED BY: INTERNAL PASS: nothing RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 5/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DestroyTempGenAppExtraStateBlock proc far uses ax, cx, dx, bp .enter mov ax, MSG_META_DELETE_VAR_DATA mov cx, TEMP_GEN_APPLICATION_EXTRA_STATE_BLOCK call UserCallApplication .leave ret DestroyTempGenAppExtraStateBlock endp COMMENT @----------------------------------------------------------------------- METHOD: UI_CreateNewStateFile DESCRIPTION: Either creates a new state file for the process to use, or finds one which can/should be used instead of a new one. PASS: ds - dgroup of the current process es - segment of GenProcessClass (not dgroup) ax - MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE dx - Block handle to block of structure AppLaunchBlock CurPath - Set to state directory Return: ax - VM file handle (0 if we don't want a state file/couldn't create one). DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: CreateNewStateFile { Loop Make up a new file name for a state file (8.3, using app's name) Try to create a NEW VM file with that name } until we have a VM file } KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 11/89 Moved here from UI_Attach -------------------------------------------------------------------------------@ UI_CreateNewStateFile method static GenProcessClass, \ MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE segmov es, dgroup, ax PSem es, uiAttachSem ; Create state files just one at a ; time, to avoid problems w/multiple ; instances of apps trying to do ; this at the same time. sub sp, FILE_LONGNAME_BUFFER_SIZE mov di, sp ;ds:si = buffer segmov es, ss push dx ; Save AppLaunchBlock handle for later ; If doing a transparent detach, use transparent state file name ; es:di = buffer for state file name ; ; NOTE: we should not check UILM_TRANSPARENT here as we may be ; running another field by the time this app is exiting mov ax, MSG_GEN_APPLICATION_GET_STATE call GenCallApplication ; ax = ApplicationStates ; test ax, mask AS_TRANSPARENT_DETACHING ;instead of check AS_TRANSPARENT_DETACHING, check the new AS_TRANSPARENT as ;we want to use transparent state file even if running DOS app or exiting to ;DOS - brianc 6/16/93 test ax, mask AS_TRANSPARENT jz normalStateFile call GetTransparentStateFileName segmov ds, es ; ds:dx = name mov dx, di mov si, di ; ds:si = name ; create new or truncate existing mov ax, (VMO_CREATE_TRUNCATE shl 8) or \ mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \ mask VMAF_FORCE_DENY_WRITE clr cx ; Use standard compaction threshhold call VMOpen LONG jnc ATSF_creationOK ; success ; If out of disk space, we're ; completely hosed. Crash & burn. ; (GeodeLoad is supposed to try & make ; sure this doesn't happen) mov si, offset outOfDiskSpaceStr1 mov di, offset outOfDiskSpaceStr2 cmp ax, VM_UPDATE_INSUFFICIENT_DISK_SPACE LONG je exitWithError jmp generalFileError normalStateFile: ; Get the file's permanent name and use that as the starting source ; of the state file, by changing the last 2 positions to be a #, ; & then adding '.sta' to the end. clr bx ; Get name for current process SBCS < mov ax, GGIT_PERM_NAME_AND_EXT > DBCS < mov ax, GGIT_PERM_NAME_AND_EXT_DBCS > call GeodeGetInfo segmov ds, es mov si, di push si mov cx, GEODE_NAME_SIZE FindEnd: LocalGetChar ax, dssi LocalCmpChar ax, ' ' je EndFound LocalCmpChar ax, '.' je EndFound LocalCmpChar ax, '0' je EndFound loop FindEnd jmp short ValidName EndFound: LocalPrevChar dssi extendLoop: SBCS < mov byte ptr ds:[si],'_' ; legitimize char, to stretch name > DBCS < mov {wchar}ds:[si],'_' ; legitimize char, to stretch name > LocalNextChar dssi loop extendLoop ; for each char left in core length, ; make it valid ValidName: pop si ; Start with ending chars of "00.sta" if DBCS_PCGEOS mov {wchar}ds:[si+GEODE_NAME_SIZE*2], '.' mov {wchar}ds:[si+GEODE_NAME_SIZE*2+2], 's' mov {wchar}ds:[si+GEODE_NAME_SIZE*2+4], 't' mov {wchar}ds:[si+GEODE_NAME_SIZE*2+6], 'a' mov {wchar}ds:[si+GEODE_NAME_SIZE*2-4], '0' ATSF_TryCreateNextDecade: mov {wchar}ds:[si+GEODE_NAME_SIZE*2-2], '0' ATSF_TryCreate: ; Null terminate this sucker. mov {wchar}ds:[si+GEODE_NAME_SIZE*2+8], 0 else mov word ptr ds:[si+GEODE_NAME_SIZE], '.' or ('s' shl 8) mov word ptr ds:[si+GEODE_NAME_SIZE+2], 't' or ('a' shl 8) mov byte ptr ds:[si+GEODE_NAME_SIZE-2], '0' ATSF_TryCreateNextDecade: mov byte ptr ds:[si+GEODE_NAME_SIZE-1], '0' ATSF_TryCreate: ; Null terminate this sucker. mov byte ptr ds:[si+GEODE_NAME_SIZE+4], 0 endif mov ax, (VMO_CREATE_ONLY shl 8) or \ mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \ mask VMAF_FORCE_DENY_WRITE clr cx ; Use standard compaction threshhold mov dx,si ; Setup ds:dx as pointer call VMOpen ; Go ahead, open it! jnc ATSF_creationOK cmp ax, VM_SHARING_DENIED ; If somebody else using, try again je ATSF_TryNext cmp ax, VM_FILE_EXISTS ; See if because file already exists je fileExists ; if so, branch & try another name ; If out of disk space, we're ; completely hosed. Crash & burn. ; (GeodeLoad is supposed to try & make ; sure this doesn't happen) mov si, offset outOfDiskSpaceStr1 mov di, offset outOfDiskSpaceStr2 cmp ax, VM_UPDATE_INSUFFICIENT_DISK_SPACE je exitWithError jmp generalFileError fileExists: call DeleteIfBadStateFile ; Let's do a little cleanup work here. ; We can't use this file, because ; it already exists. However, ; we can see whether it is a valid ; state file or not, & if not, ; trash it, to clean up the state ; directory. ATSF_TryNext: ; INC tail end # of filename if DBCS_PCGEOS inc {wchar}ds:[si+GEODE_NAME_SIZE*2-2] cmp {wchar}ds:[si+GEODE_NAME_SIZE*2-2], '9'+1 jb ATSF_TryCreate inc {wchar}ds:[si+GEODE_NAME_SIZE*2-4] cmp {wchar}ds:[si+GEODE_NAME_SIZE*2-4], '9'+1 jb ATSF_TryCreateNextDecade else inc byte ptr ds:[si+GEODE_NAME_SIZE-1] cmp byte ptr ds:[si+GEODE_NAME_SIZE-1], '9'+1 jb ATSF_TryCreate inc byte ptr ds:[si+GEODE_NAME_SIZE-2] cmp byte ptr ds:[si+GEODE_NAME_SIZE-2], '9'+1 jb ATSF_TryCreateNextDecade endif ; ACK! 100 attempts & no file! generalFileError: ; If other error, also crash & burn, ; but w/general error message mov si, offset cannotCreateFileStr1 mov di, offset cannotCreateFileStr2 ;No second string call UserCheckIfPDA jnc exitWithError ; not PDA, use this error mov di, offset cannotCreateFileStr2PDA ; else, this one exitWithError: mov bx, handle outOfDiskSpaceStr1 call MemLock ;Lock the strings resource mov ds, ax ;DS:SI <- string to display mov si, ds:[si] mov di, ds:[di] mov ax, mask SNF_CONTINUE call SysNotify call MemUnlock ;Unlock the strings resource skipStateFile:: pop dx ;Restore handle of AppInstanceReference add sp, FILE_LONGNAME_BUFFER_SIZE clr ax ;No state file jmp short done ATSF_creationOK: mov dx, bx ; Keep VM file handle in dx for a moment ; Copy state file name into AppLaunchBlock pop bx ; Get handle of AppLaunchBlock call MemLock push bx mov es, ax ; ds:si is file created ; Set es:di to state file name stored ; in AppInstanceReference mov di, offset AIR_stateFile mov cx, length AIR_stateFile LocalCopyNString ; rep movsb/movsw pop bx call MemUnlock ; Fix stack add sp, FILE_LONGNAME_BUFFER_SIZE xchg ax, dx ; return VM file handle in ax done: mov bx, seg idata mov es, bx VSem es, uiAttachSem ; & release semaphore -- let others create ; state files. ret UI_CreateNewStateFile endm COMMENT @---------------------------------------------------------------------- FUNCTION: DeleteIfBadStateFile DESCRIPTION: Delete the file passed if it is not a good state file CALLED BY: INTERNAL PASS: ds:si - pointer to null-terminated filename string (ds:si *cannot* be pointing into the movable XIP resource.) RETURN: Nothing DESTROYED: ax, bx, cx, dx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 11/89 Initial version ------------------------------------------------------------------------------@ DeleteIfBadStateFile proc near if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < push bx > EC < mov bx, ds > EC < call ECAssertValidFarPointerXIP > EC < pop bx > endif mov dx, si ; Setup ds:dx as pointer to filename mov ax, (VMO_OPEN shl 8) or \ mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \ mask VMAF_FORCE_DENY_WRITE clr cx ; Use standard compaction threshhold call VMOpen ; Go ahead, open it! jnc OpenedOK ; branch if successful, file is OK ; If file not found, just quit cmp ax, VM_FILE_NOT_FOUND je Quit call FileDelete ; If any error in opening delete the file, ; it is not good as a state file ; (Includes invalid VM file error) ; & Ignore any error flags returned from ; FileDelete - what do we care? jmp short Quit OpenedOK: clr al call VMClose ; just close it & return Quit: ret DeleteIfBadStateFile endp COMMENT @----------------------------------------------------------------------- FUNCTION: UI_LarusApplication DESCRIPTION: This is sent to the process itself from the application object, when it has determined that the app should lazarus, i.e. return to app mode. PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_GEN_PROCESS_TRANSITION_FROM_ENGINE_TO_APPLICATION_MODE cx - AppAttachFlags dx - Handle of AppLaunchBlock, or 0 if none. This block contains the name of any document file passed into the application on invocation. RETURN: Nothing AppLaunchBlock - preserved REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 5/93 Initial version -------------------------------------------------------------------------------@ UI_LazarusApplication method GenProcessClass, MSG_GEN_PROCESS_TRANSITION_FROM_ENGINE_TO_APPLICATION_MODE ; Fetch extra state block, which at this point is just stored at the ; app object. ; push cx call RetrieveTempGenAppExtraStateBlock pushf call DestroyTempGenAppExtraStateBlock popf mov bp, cx ; bp <- extra state block pop cx jnc afterState ; carry clear if vardata entry not ; found, meaning there's no state. ; If it is found, set "restoring from state flag" because we're coming ; back with state, so to speak. This keeps the app as much ; like it was as possible, keeping it from re-loading options, & ; re-starting windows, etc. ; ornf cx, mask AAF_RESTORING_FROM_STATE afterState: ; Find out if we were in the process of quitting before this happened. ; push cx, dx, bp mov ax, MSG_GEN_APPLICATION_GET_STATE call UserCallApplication pop cx, dx, bp test ax, mask AS_QUITTING jz afterQuitting ; If we're coming back from a quit, record this fact by setting ; AAF_RESTORING_FROM_QUIT -- despite coming back with the UI in ; whatever state it happens to be in, the act of QUITTING itself ; reverts some UI to is virgin state -- such as is the case with ; document control & open documents -- after a QUIT, there are no ; open documents. The document control therefore responds to this ; bit being set by starting up documents just as it would were ; this a fresh launch. ; ornf cx, mask AAF_RESTORING_FROM_QUIT afterQuitting: mov ax, MSG_GEN_PROCESS_OPEN_APPLICATION call GeodeGetProcessHandle mov di, mask MF_CALL push bp call ObjMessage pop bx ; NUKE the extra state block tst bx jz afterStateBlockNuked call MemFree afterStateBlockNuked: ret UI_LazarusApplication endm COMMENT @----------------------------------------------------------------------- FUNCTION: UI_OpenApplication DESCRIPTION: This is sent to the process itself from MSG_META_ATTACH, whenever the application is being restored to mode APPLICATION, or whenever it is being invoked as in APPLICATION mode. Data passed is the same as that in MSG_META_ATTACH. The default handler sets the application object USABLE. This method may be intercepted to open up any data file passed, before the UI for the application is actually set USABLE. Note that the blocks passed need not be freed, as this is done by the caller upon return of this routine. PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_GEN_PROCESS_OPEN_APPLICATION cx - AppAttachFlags dx - Handle of AppLaunchBlock, or 0 if none. This block contains the name of any document file passed into the application on invocation. bp - Handle of extra state block, or 0 if none. This is the same block as returned from MSG_GET_STATE_TO_SAVE, in some previous MSG_META_DETACH RETURN: Nothing AppLaunchBlock - preserved extra stae block - preserved REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 11/89 Initial version -------------------------------------------------------------------------------@ UI_OpenApplication method GenProcessClass, MSG_GEN_PROCESS_OPEN_APPLICATION push cx push dx push bp ; Get OD of app object in ^lbx:si clr bx call GeodeGetAppObject ; Store application mode in use in app obj mov cx, MSG_GEN_PROCESS_OPEN_APPLICATION mov ax, MSG_GEN_APPLICATION_SET_APP_MODE_MESSAGE mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage pop bp pop dx pop cx ; ATTACH application object mov ax, MSG_META_ATTACH mov di, mask MF_CALL or mask MF_FIXUP_DS GOTO ObjMessage UI_OpenApplication endm COMMENT @----------------------------------------------------------------------- FUNCTION: UI_RestoreFromState DESCRIPTION: This is sent to the process itself from MSG_META_ATTACH, whenever the application is being restored to mode RESTORE_FROM_STATE Data passed is the same as that in MSG_META_ATTACH. The default handler fetches the app state mode method stored in the application object & sends it to the process PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_GEN_PROCESS_RESTORE_FROM_STATE cx - AppAttachFlags dx - Handle of AppLaunchBlock, or 0 if none. This block contains the name of any document file passed into the application on invocation. bp - Handle of extra state block, or 0 if none. This is the same block as returned from MSG_GEN_PROCESS_CLOSE_APPLICATION in some previous MSG_META_DETACH RETURN: Nothing AppLaunchBlock - preserved extra stae block - preserved REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 11/89 Initial version -------------------------------------------------------------------------------@ UI_RestoreFromState method GenProcessClass, MSG_GEN_PROCESS_RESTORE_FROM_STATE push dx, bp, cx ; Fetch method from app object clr bx call GeodeGetAppObject mov ax, MSG_GEN_APPLICATION_GET_APP_MODE_MESSAGE mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage jcxz stateFileWasBad haveMessage: ;Set bit in app object to say that we are ; attached to a state file. push cx mov ax, MSG_GEN_APPLICATION_SET_ATTACHED_TO_STATE_FILE clr di call ObjMessage pop ax ; put the mode method in ax pop dx, bp, cx ;Restore AppAttachFlags ; The extra state block is now the realm of OPEN_APPLICATION only. ; If we're about to call anything else, save off the extra state ; block & pass 0 here. -- Doug 5/14/93 ; cmp ax, MSG_GEN_PROCESS_OPEN_APPLICATION je goAhead push cx mov cx, bp call SaveTempGenAppExtraStateBlock ; Save it in app obj clr bp ; Pass NULL here, just in ; case old code looks at it. pop cx goAhead: ; Change AppAttachFlags to show what is ; going on. ornf cx, mask AAF_RESTORING_FROM_STATE ; Send the attach mode method to the process call GeodeGetProcessHandle mov di, mask MF_CALL or mask MF_FIXUP_DS GOTO ObjMessage stateFileWasBad: ; ; App mode saved in app object is 0, meaning we may have attached to ; a state file, but for some reason it didn't have state for the ; app object (user may have rebooted inopportunely), so assume ; OPEN_APPLICATION ; mov cx, MSG_GEN_PROCESS_OPEN_APPLICATION jmp haveMessage UI_RestoreFromState endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UI_GetParentField %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Returns the parent field of the associated app object CALLED BY: GLOBAL PASS: nada RETURN: CX:DX <- optr of parent field DESTROYED: ax, bx, bp, di, si PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 7/10/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UI_GetParentField method GenProcessClass, MSG_GEN_PROCESS_GET_PARENT_FIELD clr bx call GeodeGetAppObject ;^lBX:SI <- app object mov ax, MSG_GEN_FIND_PARENT ;Get the parent of the app obj mov di, mask MF_CALL ; GOTO ObjMessage ; UI_GetParentField endm AppAttach ends TokenUncommon segment resource COMMENT @----------------------------------------------------------------------- FUNCTION: UI_OpenEngine DESCRIPTION: This is sent to the process itself from MSG_META_ATTACH, whenever the application is being restored to mode ENGINE, or whenever it is being invoked as in ENGINE mode. Data passed is the same as that in MSG_META_ATTACH. The default handler only stores the ENGINE mode in the app object. This method may be intercepted to open up any data file passed, before engine operations commence. Note that the blocks passed need not be freed, as this is done by the caller upon return of this routine. PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_GEN_PROCESS_OPEN_ENGINE cx - AppAttachFlags: dx - Handle of AppLaunchBlock, or 0 if none. This block contains the name of any document file passed into the application on invocation. RETURN: Nothing AppLaunchBlock - preserved extra stae block - preserved REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 11/89 Initial version -------------------------------------------------------------------------------@ UI_OpenEngine method GenProcessClass, MSG_GEN_PROCESS_OPEN_ENGINE ; Get OD of app object in ^lbx:si clr bx call GeodeGetAppObject ; Store application mode in use in app obj mov cx, MSG_GEN_PROCESS_OPEN_ENGINE mov ax, MSG_GEN_APPLICATION_SET_APP_MODE_MESSAGE mov di, mask MF_CALL or mask MF_FIXUP_DS GOTO ObjMessage UI_OpenEngine endm COMMENT @----------------------------------------------------------------------- FUNCTION: UI_InstallToken -- MSG_GEN_PROCESS_INSTALL_TOKEN for GenProcessClass DESCRIPTION: Add token and moniker list to token database PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - method cx - ? dx - ? bp - ? si - ? RETURN: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 12/19/89 Initial version -------------------------------------------------------------------------------@ UI_InstallToken method GenProcessClass, MSG_GEN_PROCESS_INSTALL_TOKEN ; Get OD of app object in ^lbx:si clr bx call GeodeGetAppObject ; just do it mov ax, MSG_GEN_APPLICATION_INSTALL_TOKEN mov di, mask MF_CALL or mask MF_FIXUP_DS GOTO ObjMessage UI_InstallToken endm TokenUncommon ends AppDetach segment resource COMMENT @----------------------------------------------------------------------- FUNCTION: UI_Detach -- MSG_META_DETACH for GenProcessClass DESCRIPTION: Detach the process PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - method cx - ? (MSG_META_ACK sent to caller will have cx = error code) dx:bp - ackOD (May be the GenField, or possibly the app itself, or who knows?) si - ? REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version Doug 12/89 Revised detach methodology -------------------------------------------------------------------------------@ UI_Detach method GenProcessClass, MSG_META_DETACH ; Add ourselves to the list of detaching processes, so the kernel ; can speed up our demise if necessary, by changing thread priorities. ; segmov es, dgroup, bx cmp es:[uiLaunchModel], UILM_TRANSPARENT jne afterTransparentDetachStuff push ax, dx, bp call GeodeGetProcessHandle mov cx, bx clr dx mov bx, MANUFACTURER_ID_GEOWORKS mov ax, GCNSLT_TRANSPARENT_DETACH_IN_PROGRESS call GCNListAdd pop ax, dx, bp afterTransparentDetachStuff: mov cx, dx ; Keep original app-killer's OD ; in cx:bp, so that we will have it ; in MSG_META_ACK later ; Detach the object world, & wait for ; an ACK call GeodeGetProcessHandle mov dx, bx ; dx = process handle ; for ACK, cx:bp ; actually contains OD ; of original app-killer ; We lose its word of ; data, though. clr bx call GeodeGetAppObject ; Pass MSG_META_DETACH on to application object. We'll continue our ; detach when receive MSG_META_ACK back from the application object. ; mov di, mask MF_CALL GOTO ObjMessage ;send it to the UI UI_Detach endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GenProcessCreateStateFileIfAppropriate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Create and attach to a state file for the process if we need one. CALLED BY: UI_Ack PASS: nothing RETURN: nothing DESTROYED: nothing SIDE EFFECTS: state file created and associated with the process if not quitting and didn't have a state file already. pre-existing state file closed and deleted if quitting. PSEUDO CODE/STRATEGY: since there are two bits (quitting and attached-to-state-file) there are four cases: 1) quitting, but already attached to a state file 2) not quitting, and already attached to a state file 3) quitting, and have no state file 4) not quitting, and have no state file only cases 1 and 4 require any work here: fetch application state if quitting && attached to state file (case 1): - close state file - delete it else if !quitting && !attached to state file (case 4): - create state file - if actually created, associate with it and set the attached_to_state_file state of the app obj REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 10/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GenProcessCreateStateFileIfAppropriate proc near uses ax, bx, cx, dx, si, di, bp .enter clr bx call GeodeGetAppObject mov ax, MSG_GEN_APPLICATION_GET_STATE mov di, mask MF_CALL call ObjMessage ; ax <- ApplicationStates test al, mask AS_QUITTING or mask AS_ATTACHED_TO_STATE_FILE jz createStateFile ; => neither CheckHack <offset AS_QUITTING lt 8 and \ offset AS_ATTACHED_TO_STATE_FILE lt 8> jpe nukeExistingStateFile ; => both ; ; else either quitting and not attached (no need for state file), or ; not quitting and attached (no need to nuke or create state file), ; so we have nothing else to do. ; done: .leave ret ;-------------------- ; ; Not quitting and don't have a state file yet: create one and attach ; to it. ; createStateFile: ; ; Get handle of current AppInstanceReference ; mov ax, MSG_GEN_APPLICATION_GET_APP_INSTANCE_REFERENCE mov di, mask MF_CALL call ObjMessage ; ; Call ourselves to create a new state file, storing its name in the ; AppInstanceReference structure. ; call FilePushDir mov ax, SP_STATE call FileSetStandardPath call GeodeGetProcessHandle mov ax, MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE mov di, mask MF_CALL push dx ; save AppRef handle call ObjMessage ; ax <- file handle or 0 pop dx call FilePopDir tst ax jz freeAppRef ;=> wants no state file ; ; Associate the state file with this process. ; mov_tr bx, ax call ObjAssocVMFile jc closeFileFreeAppRef ; => error during assoc mov cx, ax ; Extra block in cx (0) call SaveTempGenAppExtraStateBlock ; Save it in app obj ; ; Set the modified AppInstanceReference, now with state file name, as ; the one the app object should send to the field when instructed. ; clr bx call GeodeGetAppObject mov ax, MSG_GEN_APPLICATION_SET_APP_INSTANCE_REFERENCE mov di, mask MF_CALL call ObjMessage ; ; Tell the application object it's now attached to a state file. ; mov ax, MSG_GEN_APPLICATION_SET_ATTACHED_TO_STATE_FILE clr di call ObjMessage jmp done closeFileFreeAppRef: clr al call VMClose freeAppRef: mov bx, dx call MemFree jmp done ;-------------------- ; ; Quitting and are attached to state file: close it and nuke it. ; nukeExistingStateFile: mov ax, MSG_GEN_APPLICATION_GET_APP_INSTANCE_REFERENCE mov di, mask MF_CALL call ObjMessage ; dx <- AIR block call ObjCloseVMFile push bx, ds mov bx, dx call MemLock mov ds, ax ; ; Push to SP_STATE, where the state file must be ; call FilePushDir mov ax, SP_STATE call FileSetStandardPath ; ; Nuke it. ; mov dx, offset AIR_stateFile call FileDelete call FilePopDir ; ; Clear AIR_stateFile[0] and set as new AIR, just to be safe (frees AIR ; block, too). ; mov ds:[AIR_stateFile][0], 0 call MemUnlock pop bx, ds mov ax, MSG_GEN_APPLICATION_GET_APP_INSTANCE_REFERENCE clr di call ObjMessage ; ; Make sure app obj knows we're not attached to a state file any more. ; mov ax, MSG_GEN_APPLICATION_SET_NOT_ATTACHED_TO_STATE_FILE mov di, mask MF_CALL call ObjMessage jmp done GenProcessCreateStateFileIfAppropriate endp COMMENT @----------------------------------------------------------------------- FUNCTION: UI_Ack -- MSG_META_ACK for GenProcessClass DESCRIPTION: Handle acknowledge that the object world for this application has been shut down. PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - method cx:si - OD of original ackOD sent to MSG_META_DETACH dx:bp - object from with the MSG_META_ACK is coming from (app object) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version Doug 12/89 Revised detach methodology -------------------------------------------------------------------------------@ UI_Ack method GenProcessClass, MSG_META_ACK ; Check to see if ACK coming from App object ; push si clr bx call GeodeGetAppObject cmp bp, si pop si jne notAppObject cmp dx, bx je ackFromAppObject ; branch if so notAppObject: ; Otherwise, we must assume it was UI thread notifying us of its demise. ; (It is dangerous to compare free handles, & in any case, we don't ; have any copy around to compare with) ; ; Do FINAL_DETACH again, but this time ; w/ui thread dead, so it will continue. mov dx, cx ; get Ack OD into dx:bp mov bp, si call GeodeGetProcessHandle mov ax, MSG_GEN_PROCESS_FINAL_DETACH mov di, mask MF_FORCE_QUEUE GOTO ObjMessage ackFromAppObject: ; If we get here, then the it means we've just finished a ; MSG_META_DETACH sequence on the GenApplication object, meaning the ; entire UI tree has now been detached. We respond to this by ; continuing the detach, first sending the appropriate CLOSE message ; to the process, both as notification & to get any extra state ; block, then by letting the app know that the whole CLOSE sequence ; is complete, & we're back in engine mode (if we weren't already ; there). In any case, it is then free to start a REAL_DETACH the ; moment there isn't some other IACP reason to hang around. ; push cx ; preserve OD to send ack to push si ; create and attach to a state file *now* so the close method can ; use ObjMapSavedToState to keep track of duplicated blocks if it ; needs to. call GenProcessCreateStateFileIfAppropriate ; Send MSG_GEN_PROCESS_CLOSE_APPLICATION now, if in app mode. (If in ; engine or custom mode, the CLOSE message is sent in REAL_DETACH) ; ; Test to see if closing from app mode (need to deal w/extra state block ; in that case, but not others) ; clr bx call GeodeGetAppObject mov ax, MSG_GEN_APPLICATION_GET_APP_MODE_MESSAGE mov di, mask MF_CALL call ObjMessage ;returns cx = mode method cmp cx, MSG_GEN_PROCESS_OPEN_APPLICATION jne afterAppMode ; Get application process's state to save ; mov ax, MSG_GEN_PROCESS_CLOSE_APPLICATION call GeodeGetProcessHandle mov di, mask MF_CALL call ObjMessage ; Returns cx = extra state block ; Save it away where we can get at it later ; call SaveTempGenAppExtraStateBlock afterAppMode: pop bp ; Restore OD of original app-killer pop dx ; into dx:bp ; We're done closing. Send CLOSE_COMPLETE notification back to ; application, which will fix up bits to indicate we're no longer in ; app mode, then call MSG_GEN_APPLICATION_APP_MODE_COMPLETE to figure ; out where to go from there. ; mov ax, MSG_GEN_APPLICATION_CLOSE_COMPLETE clr bx call GeodeGetAppObject mov di, mask MF_CALL GOTO ObjMessage UI_Ack endm COMMENT @----------------------------------------------------------------------- FUNCTION: UI_GetStateToSave DESCRIPTION: Default handler for methods requesting block to save with state file. Returns 0 for none. Actually, state may now only be returned from MSG_GEN_PROCESS_CLOSE_APPLICATION. We continue to handle all these & return 0, just for backwards compatibility. PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - MSG_GEN_PROCESS_CLOSE_APPLICATION, MSG_GEN_PROCESS_CLOSE_ENGINE or MSG_GEN_PROCESS_CLOSE_CUSTOM RETURN: cx - handle REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version Doug 1/90 Switched to be handler for CLOSE_APP -------------------------------------------------------------------------------@ UI_GetStateToSave method GenProcessClass, MSG_GEN_PROCESS_CLOSE_APPLICATION, MSG_GEN_PROCESS_CLOSE_ENGINE, MSG_GEN_PROCESS_CLOSE_CUSTOM clr cx ret UI_GetStateToSave endm COMMENT @----------------------------------------------------------------------- FUNCTION: UI_UIRealDetach -- MSG_GEN_PROCESS_REAL_DETACH for GenProcessClass DESCRIPTION: Really detach the process PASS: ds - dgroup of the current process es - segment of GenProcessClass (UI's dgroup) ax - method dx:bp - original ackOD sent to MSG_META_DETACH si - ? REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/89 Initial version -------------------------------------------------------------------------------@ UI_UIRealDetach method GenProcessClass, MSG_GEN_PROCESS_REAL_DETACH push dx,bp ;Save ACK OD ; ; If running in ENGINE mode or CUSTOM mode, send the CLOSE_ENGINE or ; CLOSE_CUSTOM. (CLOSE_APPLICATION is handled back in our MSG_META_ACK ; handler, not here, as the CLOSE needs to happen even if hanging ; around for iacp or if lazarusing, neither of which result in ; this message being called, as the process isn't really going way) ; mov ax, MSG_GEN_APPLICATION_GET_APP_MODE_MESSAGE call GenCallApplication ;cx = mode message cmp cx, MSG_GEN_PROCESS_OPEN_APPLICATION je noCloseMethod ;app mode, CLOSE_APP already sent mov ax, MSG_GEN_PROCESS_CLOSE_ENGINE cmp cx, MSG_GEN_PROCESS_OPEN_ENGINE je haveCloseMethod mov ax, MSG_GEN_PROCESS_CLOSE_CUSTOM haveCloseMethod: call GeodeGetProcessHandle mov di, mask MF_CALL call ObjMessage noCloseMethod: ; ; Find out if we're quitting. ; mov ax, MSG_GEN_APPLICATION_GET_STATE call GenCallApplication ;Returns ax <- app mode bits ; ; If not quitting and if not doing a transparent detach, send info ; about ourselves and our state file to the field on which we sit, ; so it can restart us. ; test ax, mask AS_QUITTING or mask AS_TRANSPARENT_DETACHING jnz shutdownApp mov ax, MSG_GEN_APPLICATION_SEND_APP_INSTANCE_REFERENCE_TO_FIELD call GenCallApplication shutdownApp: ; ; Tell the app object to shut itself down, disconnecting from the ; field, etc. This will send us a MSG_META_SHUTDOWN_ACK when it's ; done, and we'll take it from there... ; mov ax, MSG_META_APP_SHUTDOWN call GeodeGetProcessHandle mov dx, bx pop cx, bp ;send ^lcx:si back to us in SHUTDOWN_ACK ; as ACK od for our own detach GOTO GenCallApplication UI_UIRealDetach endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GenProcessShutdownAck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Field acknowledgement that the application object has shut down (and unlinked itself from the field) and use it to continue our own exit. CALLED BY: MSG_META_SHUTDOWN_ACK PASS: ds = dgroup ^lcx:si = ack OD ^ldx:bp = object send ack back to us RETURN: nothing DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 10/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GenProcessShutdownAck method dynamic GenProcessClass, MSG_META_SHUTDOWN_ACK push cx, si ; ; Get application state before we shunt the beast into a state file. ; mov ax, MSG_GEN_APPLICATION_GET_STATE call GenCallApplication ; ax <- ApplicationStates push ax ; ; Detach from any state file to which we're attached. ; call RetrieveTempGenAppExtraStateBlock ; First get state block call DestroyTempGenAppExtraStateBlock call ObjSaveExtraStateBlock ; & save it call ObjDisassocVMFile ; ; Now that we've sent the app object to the state file, we can't ; flush through it anymore, so set the input object to be the ; process. ; call GeodeGetProcessHandle mov cx, bx ; bx = cx = process handle clr dx call WinGeodeSetInputObj pop dx ; dx = ApplicationStates pop cx,si ;CX:SI <- ack OD ; ; If quitting, sequencing is being handled by MSG_META_QUIT_ACK ; mechanism, so just "ACK" the completion of UI DETACH at this ; time. It will shortly thereafter call MSG_GEN_PROCESS_FINAL_DETACH ; itself. ; test dx, mask AS_QUITTING ;Are we quitting? mov dx, QL_DETACH ;Ack this level of quit mov ax, MSG_META_QUIT_ACK ; jne common ; Otherwise, do FINAL_DETACH directly ; from here. mov dx, cx ; get Ack OD into dx:bp mov bp, si mov ax, MSG_GEN_PROCESS_FINAL_DETACH common: ; Flush full input queue before starting to nuke things. ; call GeodeGetProcessHandle ;Get bx = handle of this process obj mov di, mask MF_RECORD call ObjMessage mov cx, di ; Pass Event in cx mov dx, bx ; handle of block in dx clr bp ; Init next stop mov ax, MSG_META_OBJ_FLUSH_INPUT_QUEUE clr di GOTO ObjMessage ; Call self to start flush GenProcessShutdownAck endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CleanupUndo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Cleanup the undo blocks, etc. CALLED BY: GLOBAL PASS: es - dgroup RETURN: nada DESTROYED: ax, cx, si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 6/ 8/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CleanupUndo proc near uses ds,dx,bp, bx .enter EC < push ax, bx > EC < mov bx, es > EC < mov ax, segment dgroup > EC < cmp ax, bx > EC < ERROR_NZ 0 > EC < pop ax, bx > ; Get the handle of the undo block clr bx mov di, es:[undoOffset] mov cx, 1 sub sp, 2 mov si, sp ;DS:SI <- ptr to place to read segmov ds, ss ; handle of undo block call GeodePrivRead pop bx ;BX <- value read tst bx ;If no undo block, just exit jz exit EC < call MemLock > EC < mov ds, ax > EC < tst ds:[ULMBH_startCount] > EC < ERROR_NZ UNDO_START_COUNT_NON_ZERO_WHEN_PROCESS_EXITED > EC < tst ds:[ULMBH_ignoreCount] > EC < ERROR_NZ UNDO_IGNORE_COUNT_NON_ZERO_WHEN_PROCESS_EXITED > call MemFree ;Free up the undo block exit: .leave ret CleanupUndo endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UI_UIFinalDetach %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Finishes up the detach process. CALLED BY: GLOBAL PASS: DX:BP <- ACK OD RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UI_UIFinalDetach method GenProcessClass, MSG_GEN_PROCESS_FINAL_DETACH ; If we still have a UI thread, embark on a detour to DESTROY it now. ; We'll get a MSG_META_ACK once that has occured, at which point we'll ; resume our own destruction. ; call GeodeGetProcessHandle push ds call MemLock mov ds, ax mov ax, ds:[PH_uiThread] call MemUnlock pop ds tst ax jz afterUIThreadDetached ; dx = process handle ; for ACK, cx:bp ; actually contains OD ; of original app-killer push dx, bp mov cx, dx ; pass CX:BP = orig ACK OD, as ; expected by our ACK handler mov dx, bx ; setup DX ACK OD = this proc mov bx, ax ; send message to uiThread clr si ; nothing interesting in si mov ax, MSG_META_DETACH clr di call ObjMessage pop dx, bp jmp short done afterUIThreadDetached: push es segmov es, dgroup, cx ; SH call CleanupUndo pop es clr cx ; set exit code = 0 clr si ; This is the point where we finally ask ProcessClass to nuke the ; process. There's one exception to the desire to do this: If the ; process under the gun just happens to be the UI library's process. ; In this case only, ACK the detach as being complete, but don't ; actually nuke the process; this is taken care of only after the ; whole system as a whole has been completely shut down. (See ; UserClass for details) ; cmp bx, handle 0 jne notUIProcess mov ax, MSG_META_ACK xchg bx, dx ; get ^lbx:si = OD to send ACK to, xchg si, bp ; dx = process which is ACK'ing, bp=0 mov di, mask MF_FORCE_QUEUE call ObjMessage jmp short done notUIProcess: ; OK, at the very last moment that we can, take ourselves off the ; "detaching" GCN list, before the geode itself is nuked from memory ; & the GCN list points at garbage. ; call TakeOffTransparentDetachInProgressList ; DO NOT send MSG_META_ACK to the superclass, since MetaClass will ; try & handle this as if we'd called ObjInitDetach, which we HAVE NOT. ; Instead, send MSG_META_DETACH to our superclass, "ProcessClass," ; which we didn't do earlier. ProcessClass will send the ; MSG_META_ACK for us. mov di, offset GenProcessClass mov ax, MSG_META_DETACH ;pass method CallSuper MSG_META_DETACH done: ret UI_UIFinalDetach endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TakeOffTransparentDetachInProgressList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Take geode off the GCNSLT_TRANSPARENT_DETACH_IN_PROGRESS if we're still on it. CALLED BY: INTERNAL UI_UIFinalDetach PASS: nothing RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 5/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TakeOffTransparentDetachInProgressList proc near uses ax, bx, cx, dx, es .enter ; ; If on a system using transparent detach, we need to take the ; geode off the GCN list being kept for this person. ; segmov es, dgroup, ax cmp es:[uiLaunchModel], UILM_TRANSPARENT jne exit call GeodeGetProcessHandle mov cx, bx clr dx mov bx, MANUFACTURER_ID_GEOWORKS mov ax, GCNSLT_TRANSPARENT_DETACH_IN_PROGRESS call GCNListRemove exit: .leave ret TakeOffTransparentDetachInProgressList endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UI_Quit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This method handler gets the appropriate QuitLevel enum passed in DX. The method handler for each level of quit should then send MSG_META_QUIT_ACK with the same QuitLevel when it is done. See the declaration of QuitLevel for more info CALLED BY: GLOBAL PASS: dx - QuitLevel bp - data (possibly?) RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UI_Quit method GenProcessClass, MSG_META_QUIT EC < cmp dx, QuitLevel > EC < ERROR_AE UI_PROCESS_INVALID_QUIT_LEVEL > mov di,dx shl di,1 call cs:[QuitRoutines][di] ret UI_Quit endm QuitRoutines nptr QuitAck ; QL_BEFORE_UI -> Just ack the method nptr QuitUI ; QL_UI -> Send quit off to the UI nptr QuitAfterUI ; QL_AFTER_UI -> Check w/app obj nptr QuitDetach ; QL_DETACH -> Detach process nptr QuitAfterDetach ; QL_AFTER_DETACH -> Finish your ack COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UI_QuitAck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sends the next level of MSG_META_QUIT off to the process. CALLED BY: GLOBAL PASS: cx - abort flag (non-zero if aborting) - or (if quit level is QL_DETACH or later - cx:si - OD for detach ack later bp - data to pass to next level of quit dx - current quit level RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UI_QuitAck method GenProcessClass, MSG_META_QUIT_ACK call GeodeGetProcessHandle ; inc dx ;Go to next UI level cmp dx, QuitLevel ;Is this the highest level? je detach ;Branch if so... cmp dx, QL_DETACH+1 ;If ack of DETACH, have OD in ; CX:SI je 10$ tst cx ;Check abort flag jne abort ;Branch if aborting... 10$: ;If DX != QL_AFTER_DETACH, ; CX MUST = 0! mov ax, MSG_META_QUIT ;Else, just send next level of mov di, mask MF_FORCE_QUEUE ; quit. GOTO ObjMessage ; detach: ; mov dx,cx ;DX:BP <- ack OD mov bp,si ; mov ax, MSG_GEN_PROCESS_FINAL_DETACH ;Finish up the detach mov di, mask MF_FORCE_QUEUE ; GOTO ObjMessage ; abort: ; ;Clear out the quit state mov ax, MSG_GEN_APPLICATION_SET_NOT_QUITTING GOTO GenCallApplication ;Clear out the quit state UI_QuitAck endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% QuitAck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Just sends a MSG_META_QUIT_ACK to the process CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ QuitAck proc near call GeodeGetProcessHandle clr cx ;No abort mov ax, MSG_META_QUIT_ACK ;Send MSG_META_QUIT_ACK off to mov di, mask MF_FORCE_QUEUE ; the process call ObjMessage ret QuitAck endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% QuitUI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Start QUIT sequence for the UI in this application CALLED BY: GLOBAL PASS: DX - quit level RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ QuitUI proc near clr cx ;No aborting... mov ax, MSG_GEN_APPLICATION_INITIATE_UI_QUIT ;Send MSG_META_QUIT off to all call GenCallApplication ; items on the active lists ret ; under the application. QuitUI endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% QuitAfterUI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Give app object one last chance to abort QUIT, or OK process for detach. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- doug 2/26/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ QuitAfterUI proc near mov ax, MSG_GEN_APPLICATION_QUIT_AFTER_UI call GenCallApplication ret QuitAfterUI endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% QuitDetach %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sends a MSG_META_DETACH to ourself, to start a DETACH of this application (with no ACK OD) CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ QuitDetach proc near call GeodeGetProcessHandle clr si clr dx ; no ack OD clr bp mov ax, MSG_META_DETACH ;Send MSG_META_DETACH off to mov di, mask MF_FORCE_QUEUE ;ourselves call ObjMessage ret QuitDetach endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% QuitAfterDetach %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Acks the last quit level. CALLED BY: GLOBAL PASS: bp - handle of AppInstanceReference CX:SI - ack OD to be passed on to MSG_META_QUIT_ACK RETURN: nada DESTROYED: various important but undocumented things PSEUDO CODE/STRATEGY: This page intentionally left blank KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ QuitAfterDetach proc near mov dx, QL_AFTER_DETACH ;Ack the quit level call GeodeGetProcessHandle ; mov ax, MSG_META_QUIT_ACK ;Send MSG_META_QUIT_ACK off to mov di, mask MF_FORCE_QUEUE ; the process call ObjMessage ret QuitAfterDetach endp AppDetach ends LessCommon segment resource COMMENT @---------------------------------------------------------------------- MESSAGE: UI_VMFileDirty -- MSG_META_VM_FILE_DIRTY for GenProcessClass DESCRIPTION: ... PASS: *ds:si - instance data es - segment of GenProcessClass ax - The message cx - file handle RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 10/30/91 Initial version ------------------------------------------------------------------------------@ UI_VMFileDirty method dynamic GenProcessClass, MSG_META_VM_FILE_DIRTY mov di, 500 call ThreadBorrowStackSpace push di mov ax, MSG_GEN_DOCUMENT_GROUP_MARK_DIRTY_BY_FILE mov bx, segment GenDocumentGroupClass mov si, offset GenDocumentGroupClass mov di, mask MF_RECORD call ObjMessage mov cx, di ;cx = message mov ax, MSG_META_SEND_CLASSED_EVENT mov dx, TO_MODEL call GenCallApplication pop di call ThreadReturnStackSpace ret UI_VMFileDirty endm COMMENT @---------------------------------------------------------------------- FUNCTION: UI_FinalBlockFree DESCRIPTION: free the block PASS: ds - core block of geode ax - MSG_PROCESS_FINAL_BLOCK_FREE cx - block handle RETURN: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 12/91 Initial version ------------------------------------------------------------------------------@ ; This function is currently never called, as the UI thread ends up performing ; the MSG_PROCESS_FINAL_BLOCK_FREE. As soon as applications have their own UI thread, ; this code should be moved to that class. -- Doug ; if (0) if ERROR_CHECK UI_FinalBlockFree method dynamic GenProcessClass, MSG_PROCESS_FINAL_BLOCK_FREE push cx mov ax, MSG_VIS_VUP_EC_ENSURE_OBJ_BLOCK_NOT_REFERENCED call GenCallApplication pop cx mov di, offset GenProcessClass GOTO ObjCallSuperNoLock UI_FinalBlockFree endm endif endif LessCommon ends Common segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: UI_SendToAppGCNList DESCRIPTION: Relays request to GenApplication object as MSG_META_GCN_LIST_SEND. See method declaration for detailed info on why we do this. PASS: ds - core block of geode ax - MSG_GEN_PROCESS_SEND_TO_APP_GCN_LIST dx - size GCNListMessageParams ss:bp - ptr to GCNListMessageParams RETURN: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 12/91 Initial version ------------------------------------------------------------------------------@ UI_SendToAppGCNList method dynamic GenProcessClass, MSG_GEN_PROCESS_SEND_TO_APP_GCN_LIST mov ax, MSG_META_GCN_LIST_SEND clr bx call GeodeGetAppObject tst bx jz eatUpdate mov di, mask MF_STACK GOTO ObjMessage eatUpdate: ; free up reference to block, if any ; mov bx, ss:[bp].GCNLMP_block call MemDecRefCount ; & nuke the unused status event. ; mov bx, ss:[bp].GCNLMP_event call ObjFreeMessage ret UI_SendToAppGCNList endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UI_VMFileAutoSave %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Records and queues a message to autosave a particular document. This is used by the VM temp-async mechanism. CALLED BY: MSG_META_VM_FILE_AUTO_SAVE PASS: cx = file handle RETURN: nothing DESTROYED: ax, bx, cx, dx, si, di (message handler) SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- RG 10/ 9/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UI_VMFileAutoSave method dynamic GenProcessClass, MSG_META_VM_FILE_AUTO_SAVE mov ax, MSG_GEN_DOCUMENT_GROUP_AUTO_SAVE_BY_FILE mov bx, segment GenDocumentGroupClass mov si, offset GenDocumentGroupClass mov di, mask MF_RECORD call ObjMessage mov cx, di ;cx = message mov ax, MSG_META_SEND_CLASSED_EVENT mov dx, TO_MODEL call GenCallApplication ret UI_VMFileAutoSave endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UI_VMFileSetInitialDirtyLimit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Provides a hook which subclassed apps can use to set an app-specific VM dirty limit. CALLED BY: MSG_META_VM_FILE_SET_INITIAL_DIRTY_LIMIT PASS: cx = file handle RETURN: nothing DESTROYED: ax, bx, cx, dx, si, di (message handler) SIDE EFFECTS: may cause file to be saved and update modes changed PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- RG 11/30/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UI_VMFileSetInitialDirtyLimit method dynamic GenProcessClass, MSG_META_VM_FILE_SET_INITIAL_DIRTY_LIMIT .enter mov ax, MSG_GEN_DOCUMENT_GROUP_SET_DIRTY_LIMIT_BY_FILE mov bx, segment GenDocumentGroupClass mov si, offset GenDocumentGroupClass mov di, mask MF_RECORD call ObjMessage mov cx, di mov ax, MSG_META_SEND_CLASSED_EVENT mov dx, TO_MODEL call GenCallApplication .leave ret UI_VMFileSetInitialDirtyLimit endm Common ends
27.926657
136
0.650492
ffec760ecbc00ca56d3cee0450ece2df4f53ff7e
5,907
asm
Assembly
util/gut/home.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
util/gut/home.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
util/gut/home.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; Home directory functions v1.00  2005 Wolfgang Lenerz ; Marcel Kilgus ; ; 2005-11-17 1.00 reset correct job ID when freeing home thing (mk) section gen_util xdef gu_shome xdef gu_shomeover xdef gu_shomecurr xdef gu_shomedef xdef gu_ghome xdef gu_ghomefile xdef gu_ghomecurr xdef gu_homever xref gu_thjmp include 'dev8_keys_qdos_sms' include 'dev8_keys_thg' homereg reg a0-a4/d1-d3 d1stak equ 0 ; where D1 is on stack d2stak equ 4 ; same for D2 ;+++ ; Set home directory for the given job in the home thing. ; ; Registers: ; Entry Exit ; D0 error code ; D1 Job-ID preserved ; A1 Pointer to file name preserved ;--- gu_shome movem.l homereg,-(sp) ; keep my regs move.l #'SETH',d2 ; extension in thing to use bra.s sh_common ;+++ ; Like "set home directory", but overwrites it. ; ; Registers: ; Entry Exit ; D0 error code ; D1 Job-ID preserved ; A1 Pointer to file name preserved ;--- gu_shomeover movem.l homereg,-(sp) ; keep my regs move.l #'OVER',d2 ; extension in thing to use bra.s sh_common ;+++ ; Set current directory for the given job in the home thing. ; ; Registers: ; Entry Exit ; D0 error code ; D1 Job-ID preserved ; A1 Pointer to file name preserved ;--- gu_shomecurr movem.l homereg,-(sp) ; keep my regs move.l #'SETC',d2 ; extension in thing to use sh_common move.l a1,a4 ; save filename lea home_name,a0 ; point to name of thing moveq #-1,d3 ; wait forever moveq #-1,d1 ; I will use the thing moveq #sms.uthg,d0 ; use thing jsr gu_thjmp ; on return A2= ptr thg header, a1 to thg tst.l d0 ; ok? bne.s sh_exit ; no! move.l a1,a0 ; pointer to thing (!!!) move.l d1stak(sp),d1 ; get job ID back sub.l #12,sp ; get some space move.l sp,a1 ; and point to it move.l d1,(a1) ; insert ID of job move.l #$c1000000,4(a1) ; thp.call+thp.str move.l a4,8(a1) ; set pointer to this string jsr thh_code(a0) ; call extn thing add.l #12,sp ; reset stack move.l d0,-(sp) ; remember error lea home_name,a0 ; free thing moveq #sms.fthg,d0 moveq #-1,d1 jsr gu_thjmp move.l (sp)+,d0 ; restore error sh_exit movem.l (sp)+,homereg rts ;+++ ; Get home directory for the given job. ; ; Registers: ; Entry Exit ; D0 error code ; D1 Job-ID preserved ; D2 Buffer size Buffer size needed (err.orng) ; A1 Pointer to buffer preserved ;--- gu_ghome movem.l homereg,-(sp) ; keep my regs move.l #'GETH',d2 ; extension in thing to use bra.s gh_common ;+++ ; Get home file for the given job. ; ; Registers: ; Entry Exit ; D0 error code ; D1 Job-ID preserved ; D2 Buffer size Buffer size needed (err.orng) ; A1 Pointer to buffer preserved ;--- gu_ghomefile movem.l homereg,-(sp) ; keep my regs move.l #'GETF',d2 ; extension in thing to use bra.s gh_common ;+++ ; Get current directory for the given job. ; ; Registers: ; Entry Exit ; D0 error code ; D1 Job-ID preserved ; D2 Buffer size Buffer size needed (err.orng) ; A1 Pointer to buffer preserved ;--- gu_ghomecurr movem.l homereg,-(sp) ; keep my regs move.l #'GETC',d2 ; extension in thing to use gh_common move.l a1,a4 ; save buffer pointer lea home_name,a0 ; point to name of thing moveq #-1,d3 ; wait forever moveq #-1,d1 ; I will use the thing moveq #sms.uthg,d0 ; use thing jsr gu_thjmp ; on return A2= ptr thg header, a1 to thg tst.l d0 ; ok? bne.s gh_exit ; no! move.l a1,a0 ; pointer to thing (!!!) move.l d1stak(sp),d1 ; get job ID back move.l d2stak(sp),d2 ; same for buffer size sub.l #12,sp ; get some space move.l sp,a1 ; and point to it move.l d1,(a1) ; insert ID of job move.w #$a100,4(a1) ; thp.str+thp.ret move.w d2,6(a1) ; buffer size move.l a4,8(a1) ; set pointer to this string jsr thh_code(a0) ; call extn thing add.l #12,sp ; reset stack move.l d2,d2stak(sp) ; return d2 from call move.l d0,-(sp) ; remember error lea home_name,a0 ; free thing moveq #sms.fthg,d0 moveq #-1,d1 jsr gu_thjmp move.l (sp)+,d0 ; restore error gh_exit movem.l (sp)+,homereg rts ;+++ ; Get home thing version. ; ; Registers: ; Entry Exit ; D0 error code ; D1 thing version ;--- gu_homever movem.l homereg,-(sp) ; keep my regs move.l #'GETH',d2 ; extension in thing to use lea home_name,a0 ; point to name of thing moveq #-1,d3 ; wait forever moveq #-1,d1 ; I will use the thing moveq #sms.uthg,d0 ; use thing jsr gu_thjmp ; on return A2= ptr thg header, a1 to thg tst.l d0 ; ok? bne.s ghv_exit ; no! move.l d3,d1stak(sp) ; overwrite stack d1 with version lea home_name,a0 ; free thing moveq #sms.fthg,d0 moveq #-1,d1 jsr gu_thjmp moveq #0,d0 ; ignore possible error ghv_exit movem.l (sp)+,homereg rts ;+++ ; Set default directory for a given job name. ; ; Registers: ; Entry Exit ; D0 error code ; A1 Pointer to job-name preserved ; A2 Pointer to directory preserved ;--- gu_shomedef movem.l homereg,-(sp) ; keep my regs move.l a1,a3 ; save pointers move.l a2,a4 lea home_name,a0 ; point to name of thing move.l #'SETD',d2 ; extension in thing to use moveq #-1,d3 ; wait forever moveq #-1,d1 ; I will use the thing moveq #sms.uthg,d0 ; use thing jsr gu_thjmp ; on return A2= ptr thg header, a1 to thg tst.l d0 ; ok? bne.s gh_exit ; no! move.l a1,a0 ; pointer to thing (!!!) move.l d1stak(sp),d1 ; get job ID back move.l d2stak(sp),d2 ; same for buffer size sub.l #16,sp ; get some space move.l sp,a1 ; and point to it move.l #$C1000000,(a1) ; thp.str+thp.call move.l a3,4(a1) ; job name move.l #$C1000000,8(a1) ; thp.str+thp.call move.l a4,12(a1) ; directory jsr thh_code(a0) ; call extn thing add.l #16,sp ; reset stack move.l d0,-(sp) ; remember error lea home_name,a0 ; free thing moveq #sms.fthg,d0 moveq #-1,d1 jsr gu_thjmp move.l (sp)+,d0 ; restore error movem.l (sp)+,homereg rts home_name dc.w 4,'HOME' end
24.409091
67
0.664127
b5867b75d34c86b29c7156d324a567018945cc6e
653
asm
Assembly
oeis/215/A215553.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/215/A215553.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/215/A215553.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A215553: a(n) = binomial(9*n,n)*(7*n+1)/(8*n+1). ; Submitted by Jon Maiga ; 1,8,135,2574,51765,1072764,22664655,485325150,10495906641,228723580800,5014392953273,110471247622008,2443644577217025,54238301397083592,1207358254510786125,26943600312354592800,602594302548520646793,13502992968597378745800,303092963755189839631890,6813698388155942497594380,153385322521245384905175555,3457171811895519494099420460,78009013759056008085155282220,1762025772666650090219878555080,39836925604079659166197929221925,901430983401971977515632510222784,20413766244061019036016643058039682 mov $2,9 mul $2,$0 mov $1,$2 bin $1,$0 sub $0,1 bin $2,$0 sub $1,$2 mov $0,$1
50.230769
497
0.848392
0ac411bb19d850d87a706e28560672fb336e2ee8
4,897
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1581.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_1581.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_1581.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_UC_ht+0x17703, %rcx clflush (%rcx) nop nop nop nop nop inc %r9 mov (%rcx), %edi nop nop nop nop cmp %r10, %r10 lea addresses_WT_ht+0x3303, %r8 nop nop nop sub $4125, %rax movl $0x61626364, (%r8) nop nop nop nop nop and $18960, %rcx lea addresses_D_ht+0x14583, %rsi lea addresses_UC_ht+0x14d53, %rdi xor $15514, %r14 mov $38, %rcx rep movsq and $36604, %r10 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r9 push %rcx push %rdi push %rdx push %rsi // REPMOV mov $0xb03, %rsi lea addresses_WC+0x1642d, %rdi add %r14, %r14 mov $103, %rcx rep movsw nop nop nop and $56512, %r12 // Faulty Load lea addresses_WT+0x6b03, %r9 nop nop cmp $22782, %r14 movb (%r9), %dl lea oracles, %rsi and $0xff, %rdx shlq $12, %rdx mov (%rsi,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_P'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC'}, 'OP': 'REPM'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, '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 */
45.766355
2,999
0.659588
9cd0e7982e6f395e974348d67d0ac050c7e96a5a
366
asm
Assembly
programs/oeis/169/A169721.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/169/A169721.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/169/A169721.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A169721: a(n) = (2*(3*2^(n-1)-1))^2. ; 1,16,100,484,2116,8836,36100,145924,586756,2353156,9424900,37724164,150945796,603881476,2415722500,9663283204,38653919236,154617249796,618472144900,2473894871044,9895592067076,39582393434116,158329624068100,633318596935684,2533274589069316 mov $1,2 pow $1,$0 sub $1,1 mul $1,6 mov $2,$1 add $1,4 mul $1,$2 add $1,4 div $1,4
28.153846
241
0.754098
2f1570460914ea9e6187c0d3aa5eb9368f631ebc
664
asm
Assembly
oeis/096/A096727.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/096/A096727.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/096/A096727.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A096727: Expansion of eta(q)^8 / eta(q^2)^4 in powers of q. ; Submitted by Stefano Spezia ; 1,-8,24,-32,24,-48,96,-64,24,-104,144,-96,96,-112,192,-192,24,-144,312,-160,144,-256,288,-192,96,-248,336,-320,192,-240,576,-256,24,-384,432,-384,312,-304,480,-448,144,-336,768,-352,288,-624,576,-384,96,-456,744,-576,336,-432,960,-576,192,-640,720,-480,576,-496,768,-832,24,-672,1152,-544,432,-768,1152,-576,312,-592,912,-992,480,-768,1344,-640,144,-968,1008,-672,768,-864,1056,-960,288,-720,1872,-896,576,-1024,1152,-960,96,-784,1368,-1248 mov $2,-1 pow $2,$0 seq $0,118 ; Number of ways of writing n as a sum of 4 squares; also theta series of lattice Z^4. mul $0,$2
73.777778
442
0.664157
a5ef06466ee1499dd8e6676c0aad27c1acc5a862
663
asm
Assembly
oeis/130/A130054.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/130/A130054.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/130/A130054.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A130054: Inverse Moebius transform of A023900. ; Submitted by Jon Maiga ; 1,0,-1,-1,-3,0,-5,-2,-3,0,-9,1,-11,0,3,-3,-15,0,-17,3,5,0,-21,2,-7,0,-5,5,-27,0,-29,-4,9,0,15,3,-35,0,11,6,-39,0,-41,9,9,0,-45,3,-11,0,15,11,-51,0,27,10,17,0,-57,-3,-59,0,15,-5,33,0,-65,15,21,0,-69,6,-71,0,7,17,45,0,-77,9,-7,0,-81,-5,45,0,27,18,-87,0,55,21,29,0,51,4,-95,0,27,7 add $0,1 mov $1,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 mov $5,1 lpb $0 dif $0,$2 sub $5,$2 add $5,1 lpe mul $1,$5 lpe mov $0,$1
20.71875
279
0.491704
c1d2245f1edc08be310e36a16bda102019cb1358
1,867
asm
Assembly
RE/Mutant/build/encrypt.asm
roytu/challs2
c087d802961451fce21ccaf9b4d908711233dda8
[ "MIT" ]
null
null
null
RE/Mutant/build/encrypt.asm
roytu/challs2
c087d802961451fce21ccaf9b4d908711233dda8
[ "MIT" ]
null
null
null
RE/Mutant/build/encrypt.asm
roytu/challs2
c087d802961451fce21ccaf9b4d908711233dda8
[ "MIT" ]
null
null
null
; make the check function visible to the linker global encrypt section .data k dd 0x4c05,0x4f35,0x4c2d,0x2d05,0x4935,0x542d,0x5305,0x2d35,0x412d,0x2d05,0x4b35,0x452d,0x5905 l dd 13 section .text extern mprotect ; prototype: int __cdecl check(int a, int B)/> ; desc: checks two integers and returns the result _get: mov rax,[rsp] ret ; encrypt: push rbp ; mov rbp, rsp; sub rsp,24 call _get; mov [rbp-8], rdi ; load rdi into local veriable mov [rbp-16], rax mov QWORD[rbp-24], 0 ; we need an index to keep track of where we are in the k mov eax, [rbp-16] ; mptotect all of the code from here down to be writeable cdq ; doing modulous to become page aligned shr edx,20 add eax,edx and eax, 4095 sub eax, edx ; result of modulous is stored in eax mov edi, DWORD[rbp-16] sub edi, eax ; we are now page aligned mov rsi,4096 ; page size mov rdx, 7 ; read write execute call mprotect .L1: mov rax,[rbp-8]; moving character pointer into rax movzx eax,BYTE[rax]; cmp eax, 0 ; checking if the char is null je .R1 ; if it is null, we have reached the end of the string add eax,0xff ; adding one to the current character mov edx,eax ; copying the new character into edx mov rax, [rbp-8] ; putiting the current character into rax mov [rax] ,dl ; updtating the character ; here we are going to get the current position of the k mov rbx,k; int ptr to key is going in rbx mov rcx,[rbp-24] ; current position of k goes in rcx imul ecx,4 ;j add rbx,rcx mov ebx,DWORD[rbx] ; this is where we are modifying our code mov rax,[rbp-16] add rax, 64 mov DWORD[rax],ebx add QWORD[rbp-8], 1; moving to the next character ;; i = (i+1)%21 mov eax,[rbp-24] ; add eax, 1 ; mod the key index with the key length xor edx,edx mov ecx,[l] idiv ecx mov DWORD[rbp-24], edx jmp .L1 .R1: sub rsp, 24 leave ret ; return
27.057971
95
0.69684
a92375bd78660f349225664a26badf70682f6f2c
6,680
asm
Assembly
Labs/Lab6/lab06_ex3.asm
ptr2578/CS61
682dccd6b986f383120a4612eb7e7a2d1e3cfa3f
[ "BSD-3-Clause" ]
1
2019-01-01T23:31:22.000Z
2019-01-01T23:31:22.000Z
Labs/Lab6/lab06_ex3.asm
ptr2578/CS61
682dccd6b986f383120a4612eb7e7a2d1e3cfa3f
[ "BSD-3-Clause" ]
null
null
null
Labs/Lab6/lab06_ex3.asm
ptr2578/CS61
682dccd6b986f383120a4612eb7e7a2d1e3cfa3f
[ "BSD-3-Clause" ]
null
null
null
;================================================= ; Name: Sungho Ahn ; Email: sahn025@ucr.edu ; GitHub username: ptr2578 ; ; Lab: lab 6 ; Lab section: B21 ; TA: Jason Goulding ; ;================================================= .ORIG x3000 ;-------------- ; Instructions ;-------------- AND R1, R1, #0 ; Initialize R1 ADD R1, R1, #1 ; Store #1 in R1 for comparison purpose AND R2 ,R2, #0 ; Stores the result AND R3, R3, #0 ; R3 used for loop counter LD R5, NEG48 ; Stores #-48 ;------------- ; CODE BEGINS ;------------- CheckInitialInput ; BRANCH CheckInitialInput LD R4, Printb ; Load R4 with ASCII b value NOT R4, R4 ; Negate the value ADD R4, R4, #1 ; Add 1 to make it 2's comp. GETC ; Prompt the user for initial input ADD R4, R4, R0 ; Check if it is 'b' character BRnp InitialErrorMSG ; Go to print Error message if not LD R0, Printb ; Load character b into R0 OUT ; Prints out 'b' AND R4, R4, #0 ; Reset R4 for next use BR InputLoop ; Jump to main loop InitialErrorMSG ; BRANCH InitialErrorMSG LEA R0, InitialError ; Load R0 with error message PUTS ; Prints out the message BR CheckInitialInput ; Restart from the beginning ValidErrorMSG ; BRANCH ValidErrorMSG LEA R0, ValidError ; Load R0 with error message PUTS ; Prints out the message InputLoop ; BRANCH InputLoop LD R4, PrintSpace ; Load R4 with ASCII space character NOT R4, R4 ; Negate the value ADD R4, R4, #1 ; Add 1 to make it 2's comp. GETC ; Prompt the user for input ADD R6, R4, R0 ; Check if inupt is space BRnp CheckZero ; Jump branch if not EchoSpace ; BRANCH EchoSpace OUT ; Prints space BR InputLoop ; Back to the loop CheckZero ; BRANCH CheckZero ADD R6, R0, R5 ; Sub #48 to make it real number ADD R6, R6, #0 ; Check if the input is 0 BRz ValidInput ; Skip the branch if true CheckOne ; BRANCH CheckOne ADD R6, R0, R5 ; Sub #48 to make it real number ADD R6, R6, #-1 ; Check if the input is 1 BRz ValidInput ; Skip the branch if true BR ValidErrorMSG ; Go print error message otherwise ValidInput JSR SUB_TO_SINGLE_VALUE ; Jump to subroutine SUB_TO_SINGLE_VALUE JSR SUB_PRINT_16BINARY ; Jump to subroutine SUB_PRINT_16BINARY ADD R3, R3, #1 ; Increment the loop counter ADD R4, R3, #-16 ; Check if the counter is 0 BRz InputLoopEnd ; If counter becomes 0, out the loop BR InputLoop ; Back to top of the loop InputLoopEnd ; BRANCH InputLoopEnd LEA R0, NEWLINE ; Load new line in R0 PUTS ; Prints new line FinalOutput ADD R1, R2, #0 ADD R5, R2, #0 AND R2, R2, #0 ADD R2, R2, #1 ; R2 holds number 1 for comparison purpose AND R3, R3, #0 ; R3 is OuterLoop counter LD R0, Printb OUT OuterLoop ; OuterLoop Begins ADD R3, R3, #1 ; Increment loop counter by 1 every loop AND R0, R0, #0 ; Clear R0 for next use ADD R0, R1, #0 ; Compare MSB with 1 BRn isOne2 ; If MSB is 1, go to branch isOne isZero2 ; BRANCH isZero AND R0, R0, #0 ; Clear R0 for next use LD R0, PrintZero_0 ; Load R0 with 0 OUT ; Prints zero ADD R1, R1, R1 ; Shift bits left BR InnerLoop ; Skip to InnerLoop isOne2 ; BRANCH isOne AND R0, R0, #0 ; Clear R0 for next use LD R0, PrintOne_0 ; Load R0 with 1 OUT ; Prints one ADD R1, R1, R1 ; Shift bits left InnerLoop ; BRANCH InnerLoop AND R4, R4, #0 ; Clear R4 for next use ADD R4, R3, #-4 ; Check to see if the loop is 4th count BRz isSpace ; Go to BRANCH isSpace if the sum is 0 ADD R4, R3, #-8 ; Check to see if the loop is 8th cotunt BRz isSpace ; Go to BRANCH isSpace if the sum is 0 ADD R4, R3, #-12 ; Check to see if the loop is 12th count BRz isSpace ; Go to BRANCH isSpace if the sum is 0 BR LoopCheck ; Skip to BRANCH LoopCheck isSpace ; BRANCH isSpace AND R0, R0, #0 ; Clear R0 for next use LD R0, PrintSpace ; Load space character in R0 OUT ; Prints space LoopCheck ; BRANCH LoopCheck AND R0, R0, #0 ; Clear R0 for next use ADD R0, R3, #-16 ; Loop continues until counter becomes zero BRz LoopEnd ; Out the loop, if zero. BR OuterLoop ; Back to the top of the loop LoopEnd ; BRANCH LoopEnd AND R0, R0, #0 ; Clear R0 for next use LEA R0, NEWLINE ; Load new line in R0 PUTS ; Prints new line HALT ;------ ; Data ;------ NEG48 .FILL xFFD0 ; Decimal -48 Printb .FILL x0062 ; ASCII character b PrintSpace .FILL x0020 ; Space InitialError .STRINGZ "Initial input must be a character 'b'\n" ValidError .STRINGZ "\nPlease enter a valid character\n" NEWLINE .STRINGZ "\n" ; New line PrintZero_0 .FILL x0030 ; ASCII character 0 PrintOne_0 .FILL x0031 ; ASCII character 1 ;--------------------------------------------------------- ; Subroutine: TO_SINGLE_VALUE ; Parameter: R0, R2 ; Postcondition: The subroutine will take input and ; transform it into a signle 16-bit value ; Return value: None ;--------------------------------------------------------- .ORIG x3200 SUB_TO_SINGLE_VALUE ; BRANCH SUB_TO_SINGLE_VALUE ST R7, BACKUP_R7_3200 ; Backup R7 ADD R0, R0, R5 ; Input character to real value ADD R2, R2, R2 ; Multiply the value in R2 by 2 (2^n) ADD R2, R2, R0 ; Sum up into R2 END_SINGLE_VALUE ; BRANCH End_SINGLE_VALUE LD R7, BACKUP_R7_3200 ; Restore R7 RET ; Return to address R7 ;----------------- ; Subroutine Data ;----------------- BACKUP_R7_3200 .BLKW #1 ;--------------------------------------------------------- ; Subroutine: PRINT_16BINARY ; Parameter: R0, R2 ; Postcondition: The subroutine will take MSB and compare ; with 1 and print its bin value. 0 or 1 ; Return value: None ;--------------------------------------------------------- .ORIG x3400 SUB_PRINT_16BINARY ; BRANCH SUB_PRINT_16BINARY ST R7, BACKUP_R7_3400 ; Backup R7 AND R0, R2, R1 ; Compare MSB with 0 BRnp isOne ; If MSB is 1, go to branch isOne isZero ; BRANCH isZero LD R0, PrintZero ; Load R0 with 0 OUT ; Prints zero BR END_PRINT_16BINARY ; Skip to SpaceLoop isOne ; BRANCH isOne LD R0, PrintOne ; Load R0 with 1 OUT ; Prints one END_PRINT_16BINARY ; BRANCH END_PRINT_16BINARY LD R7, BACKUP_R7_3400 ; Restore R7 RET ; Retrun to address R7 ;----------------- ; Subroutine Data ;----------------- BACKUP_R7_3400 .BLKW #1 PrintZero .FILL x0030 ; ASCII character 0 PrintOne .FILL x0031 ; ASCII character 1 ;---------------- ; END of Program ;---------------- .END
30.925926
66
0.609431
43093a8ccd76e35adf14fe23b0aede3e7dc8ceba
741
asm
Assembly
programs/oeis/122/A122756.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/122/A122756.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/122/A122756.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A122756: Odd-indexed terms, a(n) = 2^n. Even-indexed terms, a(n) = floor(2^n+2^(n-1)). ; 1,2,6,8,24,32,96,128,384,512,1536,2048,6144,8192,24576,32768,98304,131072,393216,524288,1572864,2097152,6291456,8388608,25165824,33554432,100663296,134217728,402653184,536870912,1610612736,2147483648,6442450944,8589934592,25769803776,34359738368,103079215104,137438953472,412316860416,549755813888,1649267441664,2199023255552,6597069766656,8796093022208,26388279066624,35184372088832,105553116266496,140737488355328,422212465065984,562949953421312,1688849860263936,2251799813685248,6755399441055744,9007199254740992 mov $1,1 mov $2,$0 lpb $2,1 mov $4,$0 mov $0,$1 lpb $4,1 mov $0,$3 mov $4,$3 lpe mul $1,2 sub $2,1 lpe add $1,$0
43.588235
517
0.778677
96bb5a02798dbb50916342aeff8f12933f69ab42
369
asm
Assembly
libsrc/_DEVELOPMENT/arch/zxn/memory/c/sccz80/zxn_read_sysvar_bank_state.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zxn/memory/c/sccz80/zxn_read_sysvar_bank_state.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zxn/memory/c/sccz80/zxn_read_sysvar_bank_state.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; unsigned int zxn_read_sysvar_bank_state(void) SECTION code_clib SECTION code_arch PUBLIC zxn_read_sysvar_bank_state EXTERN asm_zxn_read_sysvar_bank_state defc zxn_read_sysvar_bank_state = asm_zxn_read_sysvar_bank_state ; SDCC bridge for Classic IF __CLASSIC PUBLIC _zxn_read_sysvar_bank_state defc _zxn_read_sysvar_bank_state = zxn_read_sysvar_bank_state ENDIF
20.5
64
0.886179
7e34c23ce55fc9e4b4b9d60e87c00cf4b5b6f609
452
asm
Assembly
programs/oeis/339/A339240.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/339/A339240.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/339/A339240.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A339240: a(n) = n*2^(2*n-2) + n*binomial(2*n,n)/2. ; 0,2,14,78,396,1910,8916,40684,182552,808614,3545220,15414212,66556584,285707708,1220340296,5189913240,21988512304,92850096902,390913863012,1641450064084,6876023427080,28741451864916,119902111845208,499304732388968,2075821104461136,8617006998238300 mov $1,$0 mov $2,$0 cal $2,114121 ; Expansion of (sqrt(1 - 4*x) + (1 - 2*x))/(2*(1 - 4*x)). mul $1,$2 add $1,8 mul $1,3 sub $1,24 div $1,6 mul $1,2
34.769231
249
0.719027
34848e8bd31c84a1dd6398baf89bf02060c88f85
1,572
asm
Assembly
programs/oeis/051/A051679.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/051/A051679.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/051/A051679.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A051679: Total number of even entries in first n rows of Pascal's triangle (the zeroth and first rows being 1; 1,1). ; 0,0,1,1,4,6,9,9,16,22,29,33,42,48,55,55,70,84,99,111,128,142,157,165,186,204,223,235,256,270,285,285,316,346,377,405,438,468,499,523,560,594,629,657,694,724,755,771,816,858,901,937,982,1020,1059,1083,1132,1174,1217,1245,1290,1320,1351,1351,1414,1476,1539,1599,1664,1726,1789,1845,1914,1980,2047,2107,2176,2238,2301,2349,2426,2500,2575,2643,2720,2790,2861,2917,2998,3072,3147,3207,3284,3346,3409,3441,3534,3624,3715,3799,3892,3978,4065,4137,4234,4324,4415,4491,4584,4662,4741,4789,4894,4992,5091,5175,5276,5362,5449,5505,5610,5700,5791,5851,5944,6006,6069,6069,6196,6322,6449,6573,6702,6828,6955,7075,7208,7338,7469,7593,7726,7852,7979,8091,8232,8370,8509,8641,8782,8916,9051,9171,9316,9454,9593,9717,9858,9984,10111,10207,10364,10518,10673,10821,10978,11128,11279,11415,11576,11730,11885,12025,12182,12324,12467,12579,12748,12910,13073,13221,13386,13536,13687,13807,13976,14130,14285,14409,14566,14692,14819,14883,15072,15258,15445,15625,15814,15996,16179,16347,16540,16726,16913,17085,17274,17448,17623,17767,17968,18162,18357,18537,18734,18916,19099,19251,19452,19638,19825,19981,20170,20328,20487,20583,20800,21010,21221,21417,21630,21828,22027,22195,22412,22614,22817,22989,23194,23368,23543,23655,23880,24090,24301,24481,24694,24876,25059,25179,25396,25582 mov $2,$0 mov $5,$0 lpb $2,1 mov $0,$5 sub $2,1 sub $0,$2 mul $0,2 mov $4,$0 cal $0,142242 ; Row sums of A143200. add $4,$0 sub $4,1 mov $3,$4 div $3,2 add $1,$3 lpe
82.736842
1,263
0.760178
846cf2ca345e0e1e5996b528f9524f892d9b464f
899
asm
Assembly
programs/oeis/253/A253580.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/253/A253580.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/253/A253580.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A253580: A fractal tree, read by rows: for n > 1: T(n,0) = T(n-1,0)+2, T(n,2*n) = T(n-1,0)+3, and for k=1..2*n-1: T(n,k) = T(n-1,k-1). ; 0,1,0,2,3,1,0,2,4,5,3,1,0,2,4,6,7,5,3,1,0,2,4,6,8,9,7,5,3,1,0,2,4,6,8,10,11,9,7,5,3,1,0,2,4,6,8,10,12,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,26,27,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,29,27,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18 mul $0,2 mov $3,3 lpb $0,1 mov $1,$3 trn $1,$0 sub $0,$3 trn $0,1 add $0,$1 trn $2,4 add $2,4 add $3,$2 lpe trn $1,$3 add $1,$0
49.944444
616
0.559511
d072a1d5b260400efb909caa1718ab22eea7a400
4,054
asm
Assembly
FunStuff/mandelbrot.asm
Martin-H1/6502
e57e4b71d44e8cccfb5ba7e1d31db8d59e3e02a6
[ "MIT" ]
3
2020-05-10T02:45:52.000Z
2020-08-27T19:30:21.000Z
FunStuff/mandelbrot.asm
Martin-H1/6502
e57e4b71d44e8cccfb5ba7e1d31db8d59e3e02a6
[ "MIT" ]
null
null
null
FunStuff/mandelbrot.asm
Martin-H1/6502
e57e4b71d44e8cccfb5ba7e1d31db8d59e3e02a6
[ "MIT" ]
null
null
null
; ----------------------------------------------------------------------------- ; Mandelbrot in ASCI art. It uses 8.8 fixed point mathematics in a 16 bit cell ; instead of floating point. It depends upon the stack, math, and I/O functions ; defined in the other modules. ; Martin Heermance <mheermance@gmail.com> ; ----------------------------------------------------------------------------- ; establish module level scope to hide module locals. .scope ; ; Aliases ; ; Setup constants to remove magic numbers to allow ; for greater zoom with different scale factors. .alias MAXITER 20 .alias IMAXVAL $0170 .alias IMINVAL $FE90 .alias ISTEP $0010 .alias RMINVAL $FE00 .alias RMAXVAL $0110 .alias RSTEP $000A .alias ESCAPE $0400 ; Alternate constanst for 4.12 fixed point. ; .alias MINVAL $E000 ; .alias MAXVAL $2000 ; .alias ISTEP $01A0 ; .alias RSTEP $00D0 ; .alias ESCAPE $4000 ; ; Data segments ; .data BSS .space CREAL 2 ; These variables hold values during the .space CIMAG 2 ; escape calculation. .space ZREAL 2 .space ZIMAG 2 .space COUNT 1 ; current escape count .text ; ; Macros ; .macro rescale lda NOS_MSB,x sta NOS_LSB,x lda TOS_LSB,x sta NOS_MSB,x `drop .macend ; ; Functions ; ; Main entry point mandelbrot: .scope `printcr `pushi IMAXVAL ; Start iteration at max imaginary _do: jsr doRow ; For each row in the set. `printcr `pushi ISTEP jsr sub16 `dup `pushi IMINVAL jsr compare16 bmi _do `drop rts .scend ; For each cell in a row. doRow: .scope `pushi RMINVAL ; Start iteration at max imaginary _do: jsr doCell ; For each row in the set. `pushi RSTEP jsr add16 `dup `pushi RMAXVAL jsr compare16 bpl _do `drop rts .scend ; Iterates on a single cell to compute its escape factor. ; input - row and column on stack. ; output - none doCell: jsr initVars `pushZero ; set the loop up for repeating _while: `drop ; drop status from last iteration. jsr doEscape `tosZero? beq _while `drop lda COUNT jsr toChar rts ; stores the row column values from the stack for the escape calculation. ; input - two cells on stack ; output - none initVars: `over `over `pop CREAL `pop CIMAG `pushzero `peek ZREAL `pop ZIMAG lda #$01 sta COUNT rts ; Performs a single iteration of the escape calculation. ; input - implicit from memory. ; ouput - true or false. doEscape: .scope jsr zrSq jsr ziSq `over `over jsr add16 `pushi ESCAPE ; Numbers >= 4 will always escape jsr compare16 beq + bpl _else * `drop ; cleanup the stack and return. `drop `pushTrue rts _else: jsr sub16 ; Squared i yeilds negative, so subtract `push CREAL jsr add16 ; add real components and leave result on stack `push ZREAL ; 2 * ZREAL * ZIMAG `push ZIMAG jsr mstar `rescale `pushi 1 jsr lshift16 `push CIMAG jsr add16 `pop ZIMAG ; Store stack item into ZIMAG and ZREAL `pop ZREAL jmp countAndTest .scend ; Compute squares, but rescale to remove extra scaling factor. ; input - implicit from memory ; output - value on stack zrSq: `push ZREAL `dup jsr mstar ; rescale by shifting one byte `rescale rts ; Compute squares, but rescale to remove extra scaling factor. ; input - implicit from memory ; output - value on stack ziSq: `push ZIMAG `dup jsr mstar ; rescale by shifting one byte `rescale rts ; Translate escape count to ascii greyscale. ; input - value in accumulator ; output - character to console. toChar: phy tay lda _charVals,y jsr putch ply rts _charVals: .byte " ..,'~!^:;[/<&?oxOX# " ; Increment count and compare to max iterations. ; input - implicit from memory ; output - true or false on stack countAndTest: .scope inc COUNT lda COUNT `pushA `pushi MAXITER `if_greater16 `pushTrue rts _else: `pushZero rts .scend ; Rescales the 32 bit value into a 16 bit 4.12 fixed point number. _rescale: phy ldy #$04 ; Right shift 4 bits * lda TOS_MSB,x asl ror TOS_MSB,x ror TOS_LSB,x ror NOS_MSB,x ror NOS_LSB,x dey bne - lda NOS_MSB,x ; right shift one byte sta NOS_LSB,x lda TOS_LSB,x sta NOS_MSB,x `drop ply rts .scend
17.780702
79
0.688949
db2c6a0cfbbbe49feaff56b0da6147ea370d064c
572
asm
Assembly
Lab Work/5th-semester/assembly-language/book/CH-04/9.asm
akazad13/bsc-academic-work
c9a1df5948ed93ce54822bb0a3f1972a9201e9f9
[ "MIT" ]
null
null
null
Lab Work/5th-semester/assembly-language/book/CH-04/9.asm
akazad13/bsc-academic-work
c9a1df5948ed93ce54822bb0a3f1972a9201e9f9
[ "MIT" ]
null
null
null
Lab Work/5th-semester/assembly-language/book/CH-04/9.asm
akazad13/bsc-academic-work
c9a1df5948ed93ce54822bb0a3f1972a9201e9f9
[ "MIT" ]
null
null
null
.MODEL SMALL .STACK 100H .DATA A DB ? B DB ? C DB ? MSG DB 'ENTER THREE INITIALS: $' .CODE MAIN PROC ;initialize data segment MOV AX,@DATA MOV DS,AX ;printing user promt message LEA DX,MSG MOV AH,9 INT 21H ;user input MOV AH,1 INT 21H MOV A,AL INT 21H MOV B,AL INT 21H MOV C,AL ;output MOV AH,2 ; line feed MOV DL,0AH INT 21H ; print 1st initail MOV DL,A INT 21H ; line feed MOV DL,0AH INT 21H ; print second initial MOV DL,B INT 21H ; line feed MOV DL,0AH INT 21H ; print third initial MOV DL,C INT 21H ;exit DOS MOV AH,4CH INT 21H MAIN ENDP END MAIN
9.079365
32
0.697552
c0af0a3ea19e0bddad040bcf62d7f0fee4ef7bbe
420
asm
Assembly
oeis/194/A194119.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/194/A194119.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/194/A194119.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A194119: Triangular array: T(n,k)=C(n+3,k)+C(n+3,k+3), 0<=k<=n. ; Submitted by Christian Krause ; 2,5,5,11,10,11,21,21,21,21,36,42,42,42,36,57,78,84,84,78,57,85,135,162,168,162,135,85,121,220,297,330,330,297,220,121,166,341,517,627,660,627,517,341,166,221,507,858,1144,1287,1287,1144,858,507,221 lpb $0 add $2,1 sub $0,$2 lpe add $2,3 mov $1,$2 bin $1,$0 add $0,3 add $1,1 bin $2,$0 add $1,$2 mov $0,$1 sub $0,1
23.333333
199
0.638095
5cd39e9b5d4e01825d03150347d76660208b9fc4
3,014
asm
Assembly
Working Disassembly/Levels/DEZ/Misc Object Data/Map - Conveyor Pad.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
5
2021-07-09T08:17:56.000Z
2022-02-27T19:57:47.000Z
Working Disassembly/Levels/DEZ/Misc Object Data/Map - Conveyor Pad.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Working Disassembly/Levels/DEZ/Misc Object Data/Map - Conveyor Pad.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Map_DEZConveyorPad_:dc.w word_47C12-Map_DEZConveyorPad_ dc.w word_47C12-Map_DEZConveyorPad_ dc.w word_47C44-Map_DEZConveyorPad_ dc.w word_47C76-Map_DEZConveyorPad_ dc.w word_47CB0-Map_DEZConveyorPad_ word_47C12: dc.w 8 dc.b $F0, $D, 0, $68, $FF, $C0 dc.b $F0, $D, 0, $70, $FF, $E0 dc.b $F0, $D, 8, $70, 0, 0 dc.b $F0, $D, 8, $68, 0, $20 dc.b 0, $D, $18, $18, $FF, $C0 dc.b 0, $D, $18, $10, $FF, $E0 dc.b 0, $D, $18, 8, 0, 0 dc.b 0, $D, $18, 0, 0, $20 word_47C44: dc.w 8 dc.b $F0, $D, 0, $68, $FF, $C0 dc.b $F0, $D, 0, $70, $FF, $E0 dc.b $F0, $D, 8, $70, 0, 0 dc.b $F0, $D, 8, $68, 0, $20 dc.b 0, $D, $18, $38, $FF, $C0 dc.b 0, $D, $18, $30, $FF, $E0 dc.b 0, $D, $18, $28, 0, 0 dc.b 0, $D, $18, $20, 0, $20 word_47C76: dc.w 8 dc.b $F0, $D, 0, $68, $FF, $C0 dc.b $F0, $D, 0, $70, $FF, $E0 dc.b $F0, $D, 8, $70, 0, 0 dc.b $F0, $D, 8, $68, 0, $20 dc.b 0, $D, $18, $60, $FF, $C0 dc.b 0, $D, $18, $58, $FF, $E0 dc.b 0, $D, $18, $48, 0, 0 dc.b 0, $D, $18, $40, 0, $20 Map_DEZConveyorPad2: Map_47CA8: dc.w word_47CB0-Map_47CA8 dc.w word_47CB0-Map_47CA8 dc.w word_47D12-Map_47CA8 dc.w word_47D74-Map_47CA8 word_47CB0: dc.w $10 dc.b $F0, $D, 0, 0, $FF, $80 dc.b $F0, $D, 0, 8, $FF, $A0 dc.b $F0, $D, 0, $10, $FF, $C0 dc.b $F0, $D, 0, 8, $FF, $E0 dc.b $F0, $D, 0, $10, 0, 0 dc.b $F0, $D, 0, 8, 0, $20 dc.b $F0, $D, 0, $10, 0, $40 dc.b $F0, $D, 0, $18, 0, $60 dc.b 0, $D, $18, $18, $FF, $80 dc.b 0, $D, $18, $10, $FF, $A0 dc.b 0, $D, $18, 8, $FF, $C0 dc.b 0, $D, $18, $10, $FF, $E0 dc.b 0, $D, $18, 8, 0, 0 dc.b 0, $D, $18, $10, 0, $20 dc.b 0, $D, $18, 8, 0, $40 dc.b 0, $D, $18, 0, 0, $60 word_47D12: dc.w $10 dc.b $F0, $D, 0, $20, $FF, $80 dc.b $F0, $D, 0, $28, $FF, $A0 dc.b $F0, $D, 0, $30, $FF, $C0 dc.b $F0, $D, 0, $28, $FF, $E0 dc.b $F0, $D, 0, $30, 0, 0 dc.b $F0, $D, 0, $28, 0, $20 dc.b $F0, $D, 0, $30, 0, $40 dc.b $F0, $D, 0, $38, 0, $60 dc.b 0, $D, $18, $38, $FF, $80 dc.b 0, $D, $18, $30, $FF, $A0 dc.b 0, $D, $18, $28, $FF, $C0 dc.b 0, $D, $18, $30, $FF, $E0 dc.b 0, $D, $18, $28, 0, 0 dc.b 0, $D, $18, $30, 0, $20 dc.b 0, $D, $18, $28, 0, $40 dc.b 0, $D, $18, $20, 0, $60 word_47D74: dc.w $10 dc.b $F0, $D, 0, $40, $FF, $80 dc.b $F0, $D, 0, $48, $FF, $A0 dc.b $F0, $D, 0, $50, $FF, $C0 dc.b $F0, $D, 0, $48, $FF, $E0 dc.b $F0, $D, 0, $50, 0, 0 dc.b $F0, $D, 0, $48, 0, $20 dc.b $F0, $D, 0, $58, 0, $40 dc.b $F0, $D, 0, $60, 0, $60 dc.b 0, $D, $18, $60, $FF, $80 dc.b 0, $D, $18, $58, $FF, $A0 dc.b 0, $D, $18, $48, $FF, $C0 dc.b 0, $D, $18, $50, $FF, $E0 dc.b 0, $D, $18, $48, 0, 0 dc.b 0, $D, $18, $50, 0, $20 dc.b 0, $D, $18, $48, 0, $40 dc.b 0, $D, $18, $40, 0, $60
33.865169
55
0.418049
b870c99e9d28041c1e9a9c00882a8e33fa469c41
550
asm
Assembly
scripts/safarizonenorth.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
scripts/safarizonenorth.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
5
2019-04-03T19:53:11.000Z
2022-03-11T22:49:34.000Z
scripts/safarizonenorth.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
SafariZoneNorthScript: jp EnableAutoTextBoxDrawing SafariZoneNorthTextPointers: dw PickUpItemText dw PickUpItemText dw SafariZoneNorthText3 dw SafariZoneNorthText4 dw SafariZoneNorthText5 dw SafariZoneNorthText6 dw SafariZoneNorthText7 SafariZoneNorthText3: TX_FAR _SafariZoneNorthText3 db "@" SafariZoneNorthText4: TX_FAR _SafariZoneNorthText4 db "@" SafariZoneNorthText5: TX_FAR _SafariZoneNorthText5 db "@" SafariZoneNorthText6: TX_FAR _SafariZoneNorthText6 db "@" SafariZoneNorthText7: TX_FAR _SafariZoneNorthText7 db "@"
17.1875
29
0.838182
5fc67da8b02aa47a61b18033f519cd22d9ee3605
618
asm
Assembly
programs/oeis/097/A097075.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/097/A097075.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/097/A097075.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A097075: Expansion of (1-x-x^2)/(1-x-3*x^2-x^3). ; 1,0,2,3,9,20,50,119,289,696,1682,4059,9801,23660,57122,137903,332929,803760,1940450,4684659,11309769,27304196,65918162,159140519,384199201,927538920,2239277042,5406093003,13051463049,31509019100,76069501250 mov $4,2 mov $6,$0 lpb $4,1 mov $0,$6 sub $4,1 add $0,$4 sub $0,1 cal $0,52937 ; Expansion of (2-3*x-x^2)/((1-x)*(1-2*x-x^2)). add $0,2 mov $5,$0 div $5,2 mul $5,4 sub $5,9 mov $2,$5 add $2,9 mov $3,$4 mov $5,$2 sub $5,7 div $5,4 add $5,1 lpb $3,1 mov $1,$5 sub $3,1 lpe lpe lpb $6,1 sub $1,$5 mov $6,0 lpe
18.727273
208
0.600324
9cd6674b404d01ab9a11211a0ab7298a475ee2c7
396
asm
Assembly
programs/oeis/087/A087298.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/087/A087298.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/087/A087298.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A087298: Exponent of 2 in factorization of (3n)!. ; 1,4,7,10,11,16,18,22,23,26,31,34,35,39,41,46,47,50,53,56,57,64,66,70,71,74,78,81,82,86,88,94,95,98,101,104,105,110,112,116,117,120,127,130,131,135,137,142,143,146,149,152,153,159,161,165,166 add $0,1 mul $0,3 mov $3,$0 mov $4,1 lpb $0 sub $0,1 mov $2,$4 div $3,2 add $4,$3 lpe mov $1,1 add $2,$4 add $1,$2 sub $1,5 div $1,2 add $1,1
19.8
192
0.626263
d3ea83b614a055da77cb791a919ede4c7e2ebeeb
358
asm
Assembly
programs/oeis/195/A195986.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/195/A195986.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/195/A195986.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A195986: Exponent of the largest power of 2 that divides 5^n - 3^n. ; 1,4,1,5,1,4,1,6,1,4,1,5,1,4,1,7,1,4,1,5,1,4,1,6,1,4,1,5,1,4,1,8,1,4,1,5,1,4,1,6,1,4,1,5,1,4,1,7,1,4,1,5,1,4,1,6,1,4,1,5,1,4,1,9,1,4,1,5,1,4,1,6,1,4,1,5,1,4,1,7,1,4,1,5,1,4,1,6,1,4,1,5,1,4,1,8,1,4,1,5 lpb $0 sub $0,1 mul $0,4 dif $0,8 add $1,1 max $1,3 lpe add $1,1 mov $0,$1
27.538462
201
0.536313
55445cf593687f5d94319cb336f66db4ee23f230
65,762
asm
Assembly
src/x86/filmgrain_avx2.asm
feiwei9696/dav1d
87f9a81cd770e49394a45deca7a3df41243de00b
[ "BSD-2-Clause" ]
null
null
null
src/x86/filmgrain_avx2.asm
feiwei9696/dav1d
87f9a81cd770e49394a45deca7a3df41243de00b
[ "BSD-2-Clause" ]
null
null
null
src/x86/filmgrain_avx2.asm
feiwei9696/dav1d
87f9a81cd770e49394a45deca7a3df41243de00b
[ "BSD-2-Clause" ]
null
null
null
; Copyright © 2019-2022, VideoLAN and dav1d authors ; Copyright © 2019-2022, Two Orioles, LLC ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are met: ; ; 1. Redistributions of source code must retain the above copyright notice, this ; list of conditions and the following disclaimer. ; ; 2. 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 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. %include "config.asm" %include "ext/x86/x86inc.asm" %include "x86/filmgrain_common.asm" %if ARCH_X86_64 SECTION_RODATA 32 pb_mask: db 0,128,128, 0,128, 0, 0,128,128, 0, 0,128, 0,128,128, 0 gen_shufE: db 0, 1, 8, 9, 2, 3, 10, 11, 4, 5, 12, 13, 6, 7, 14, 15 gen_shufA: db 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9 gen_shufB: db 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11 gen_shufC: db 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13 gen_shufD: db 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15 ; note: the order of (some of) the following constants matter pb_27_17: times 2 db 27, 17 byte_blend: db 0, 0, 0, -1 pb_27_17_17_27: db 27, 17, 17, 27, 0, 32, 0, 32 pb_17_27: times 2 db 17, 27 pb_1: times 4 db 1 pb_23_22: db 23, 22, 0, 32, 0, 32, 0, 32 next_upperbit_mask: dw 0x100B, 0x2016, 0x402C, 0x8058 pw_seed_xor: times 2 dw 0xb524 times 2 dw 0x49d8 fg_min: times 4 db 0 times 4 db 16 fg_max: times 4 db 255 times 4 db 240 times 4 db 235 pd_m65536: dd -65536 pw_8: times 2 dw 8 pw_1024: times 2 dw 1024 hmul_bits: dw 32768, 16384, 8192, 4096 round: dw 2048, 1024, 512 mul_bits: dw 256, 128, 64, 32, 16 round_vals: dw 32, 64, 128, 256, 512 pw_1: dw 1 %macro JMP_TABLE 2-* %1_8bpc_%2_table: %xdefine %%base %1_8bpc_%2_table %xdefine %%prefix mangle(private_prefix %+ _%1_8bpc_%2) %rep %0 - 2 dd %%prefix %+ .ar%3 - %%base %rotate 1 %endrep %endmacro JMP_TABLE generate_grain_y, avx2, 0, 1, 2, 3 JMP_TABLE generate_grain_uv_420, avx2, 0, 1, 2, 3 JMP_TABLE generate_grain_uv_422, avx2, 0, 1, 2, 3 JMP_TABLE generate_grain_uv_444, avx2, 0, 1, 2, 3 SECTION .text INIT_YMM avx2 cglobal generate_grain_y_8bpc, 2, 9, 8, buf, fg_data %define base r4-generate_grain_y_8bpc_avx2_table lea r4, [generate_grain_y_8bpc_avx2_table] vpbroadcastw xm0, [fg_dataq+FGData.seed] mov r6d, [fg_dataq+FGData.grain_scale_shift] movq xm1, [base+next_upperbit_mask] movsxd r5, [fg_dataq+FGData.ar_coeff_lag] movq xm4, [base+mul_bits] movq xm5, [base+hmul_bits] mov r7, -73*82 mova xm6, [base+pb_mask] sub bufq, r7 vpbroadcastw xm7, [base+round+r6*2] lea r6, [gaussian_sequence] movsxd r5, [r4+r5*4] .loop: pand xm2, xm0, xm1 psrlw xm3, xm2, 10 por xm2, xm3 ; bits 0xf, 0x1e, 0x3c and 0x78 are set pmullw xm2, xm4 ; bits 0x0f00 are set pmulhuw xm0, xm5 pshufb xm3, xm6, xm2 ; set 15th bit for next 4 seeds psllq xm2, xm3, 30 por xm2, xm3 psllq xm3, xm2, 15 por xm2, xm0 ; aggregate each bit into next seed's high bit por xm3, xm2 ; 4 next output seeds pshuflw xm0, xm3, q3333 psrlw xm3, 5 pand xm2, xm0, xm1 movq r2, xm3 psrlw xm3, xm2, 10 por xm2, xm3 pmullw xm2, xm4 pmulhuw xm0, xm5 movzx r3d, r2w pshufb xm3, xm6, xm2 psllq xm2, xm3, 30 por xm2, xm3 psllq xm3, xm2, 15 por xm0, xm2 movd xm2, [r6+r3*2] rorx r3, r2, 32 por xm3, xm0 shr r2d, 16 pinsrw xm2, [r6+r2*2], 1 pshuflw xm0, xm3, q3333 movzx r2d, r3w psrlw xm3, 5 pinsrw xm2, [r6+r2*2], 2 shr r3d, 16 movq r2, xm3 pinsrw xm2, [r6+r3*2], 3 movzx r3d, r2w pinsrw xm2, [r6+r3*2], 4 rorx r3, r2, 32 shr r2d, 16 pinsrw xm2, [r6+r2*2], 5 movzx r2d, r3w pinsrw xm2, [r6+r2*2], 6 shr r3d, 16 pinsrw xm2, [r6+r3*2], 7 pmulhrsw xm2, xm7 packsswb xm2, xm2 movq [bufq+r7], xm2 add r7, 8 jl .loop ; auto-regression code add r5, r4 jmp r5 .ar1: DEFINE_ARGS buf, fg_data, cf3, shift, val3, min, max, x, val0 mov shiftd, [fg_dataq+FGData.ar_coeff_shift] movsx cf3d, byte [fg_dataq+FGData.ar_coeffs_y+3] movd xm5, [fg_dataq+FGData.ar_coeffs_y] mova xm2, [base+gen_shufC] DEFINE_ARGS buf, h, cf3, shift, val3, min, max, x, val0 pinsrb xm5, [base+pb_1], 3 vpbroadcastw xm3, [base+round_vals+shiftq*2-12] ; rnd pmovsxbw xm5, xm5 pshufd xm4, xm5, q0000 pshufd xm5, xm5, q1111 sub bufq, 82*73-(82*3+79) mov hd, 70 mov mind, -128 mov maxd, 127 .y_loop_ar1: mov xq, -76 movsx val3d, byte [bufq+xq-1] .x_loop_ar1: pmovsxbw xm1, [bufq+xq-82-3] pshufb xm0, xm1, xm2 punpckhwd xm1, xm3 pmaddwd xm0, xm4 pmaddwd xm1, xm5 paddd xm0, xm1 .x_loop_ar1_inner: movd val0d, xm0 psrldq xm0, 4 imul val3d, cf3d add val3d, val0d movsx val0d, byte [bufq+xq] sarx val3d, val3d, shiftd add val3d, val0d cmp val3d, maxd cmovns val3d, maxd cmp val3d, mind cmovs val3d, mind mov [bufq+xq], val3b ; keep val3d in-place as left for next x iteration inc xq jz .x_loop_ar1_end test xb, 3 jnz .x_loop_ar1_inner jmp .x_loop_ar1 .x_loop_ar1_end: add bufq, 82 dec hd jg .y_loop_ar1 .ar0: RET .ar2: %if WIN64 ; xmm6 and xmm7 already saved %assign xmm_regs_used 16 %assign stack_size_padded 168 SUB rsp, stack_size_padded movaps [rsp+16*2], xmm8 movaps [rsp+16*3], xmm9 movaps [rsp+16*4], xmm10 movaps [rsp+16*5], xmm11 movaps [rsp+16*6], xmm12 movaps [rsp+16*7], xmm13 movaps [rsp+16*8], xmm14 movaps [rsp+16*9], xmm15 %endif DEFINE_ARGS buf, fg_data, h, x mov r6d, [fg_dataq+FGData.ar_coeff_shift] pmovsxbw xm7, [fg_dataq+FGData.ar_coeffs_y+0] ; cf0-7 movd xm9, [fg_dataq+FGData.ar_coeffs_y+8] ; cf8-11 vpbroadcastd xm10, [base+round_vals-14+r6*2] movd xm11, [base+byte_blend+1] pmovsxbw xm9, xm9 pshufd xm4, xm7, q0000 mova xm12, [base+gen_shufA] pshufd xm5, xm7, q3333 mova xm13, [base+gen_shufB] pshufd xm6, xm7, q1111 mova xm14, [base+gen_shufC] pshufd xm7, xm7, q2222 mova xm15, [base+gen_shufD] pshufd xm8, xm9, q0000 psrld xm10, 16 pshufd xm9, xm9, q1111 sub bufq, 82*73-(82*3+79) mov hd, 70 .y_loop_ar2: mov xq, -76 .x_loop_ar2: pmovsxbw xm0, [bufq+xq-82*2-2] ; y=-2,x=[-2,+5] pmovsxbw xm1, [bufq+xq-82*1-2] ; y=-1,x=[-2,+5] pshufb xm2, xm0, xm12 pmaddwd xm2, xm4 pshufb xm3, xm1, xm13 pmaddwd xm3, xm5 paddd xm2, xm3 pshufb xm3, xm0, xm14 pmaddwd xm3, xm6 punpckhqdq xm0, xm0 punpcklwd xm0, xm1 pmaddwd xm0, xm7 pshufb xm1, xm15 pmaddwd xm1, xm8 paddd xm2, xm10 paddd xm2, xm3 paddd xm0, xm1 paddd xm2, xm0 movq xm0, [bufq+xq-2] ; y=0,x=[-2,+5] .x_loop_ar2_inner: pmovsxbw xm1, xm0 pmaddwd xm3, xm9, xm1 psrldq xm1, 4 ; y=0,x=0 paddd xm3, xm2 psrldq xm2, 4 ; shift top to next pixel psrad xm3, [fg_dataq+FGData.ar_coeff_shift] ; don't packssdw since we only care about one value paddw xm3, xm1 packsswb xm3, xm3 pextrb [bufq+xq], xm3, 0 pslldq xm3, 2 vpblendvb xm0, xm3, xm11 psrldq xm0, 1 inc xq jz .x_loop_ar2_end test xb, 3 jnz .x_loop_ar2_inner jmp .x_loop_ar2 .x_loop_ar2_end: add bufq, 82 dec hd jg .y_loop_ar2 RET INIT_YMM avx2 .ar3: %if WIN64 ; xmm6 and xmm7 already saved %assign stack_offset 16 ALLOC_STACK 16*14 %assign stack_size stack_size - 16*4 %assign xmm_regs_used 12 movaps [rsp+16*12], xmm8 movaps [rsp+16*13], xmm9 movaps [rsp+16*14], xmm10 movaps [rsp+16*15], xmm11 %else ALLOC_STACK 16*12 %endif mov r6d, [fg_dataq+FGData.ar_coeff_shift] movd xm11, [base+byte_blend] pmovsxbw m1, [fg_dataq+FGData.ar_coeffs_y+ 0] ; cf0-15 pmovsxbw xm2, [fg_dataq+FGData.ar_coeffs_y+16] ; cf16-23 pshufd m0, m1, q0000 mova [rsp+16* 0], m0 pshufd m0, m1, q1111 mova [rsp+16* 2], m0 pshufd m0, m1, q2222 mova [rsp+16* 4], m0 pshufd m1, m1, q3333 mova [rsp+16* 6], m1 pshufd xm0, xm2, q0000 mova [rsp+16* 8], xm0 pshufd xm0, xm2, q1111 mova [rsp+16* 9], xm0 psrldq xm7, xm2, 10 mova m8, [base+gen_shufA] pinsrw xm2, [base+pw_1], 5 mova m9, [base+gen_shufC] pshufd xm2, xm2, q2222 movu m10, [base+gen_shufE] vpbroadcastw xm6, [base+round_vals-12+r6*2] pinsrw xm7, [base+round_vals+r6*2-10], 3 mova [rsp+16*10], xm2 DEFINE_ARGS buf, fg_data, h, x sub bufq, 82*73-(82*3+79) mov hd, 70 .y_loop_ar3: mov xq, -76 .x_loop_ar3: movu xm5, [bufq+xq-82*3-3] ; y=-3,x=[-3,+12] vinserti128 m5, [bufq+xq-82*2-3], 1 ; y=-2,x=[-3,+12] movu xm4, [bufq+xq-82*1-3] ; y=-1,x=[-3,+12] punpcklbw m3, m5, m5 punpckhwd m5, m4 psraw m3, 8 punpcklbw m5, m5 psraw m5, 8 punpcklbw xm4, xm4 psraw xm4, 8 pshufb m0, m3, m8 pmaddwd m0, [rsp+16*0] pshufb m1, m3, m9 pmaddwd m1, [rsp+16*2] shufps m2, m3, m5, q1032 paddd m0, m1 pshufb m1, m2, m8 vperm2i128 m3, m4, 0x21 pmaddwd m1, [rsp+16*4] shufps xm2, xm3, q1021 vpblendd m2, m3, 0xf0 pshufb m2, m10 paddd m0, m1 pmaddwd m2, [rsp+16*6] pshufb xm1, xm4, xm9 pmaddwd xm1, [rsp+16*8] shufps xm4, xm5, q1132 paddd m0, m2 pshufb xm2, xm4, xm8 pshufd xm4, xm4, q2121 pmaddwd xm2, [rsp+16*9] punpcklwd xm4, xm6 pmaddwd xm4, [rsp+16*10] vextracti128 xm3, m0, 1 paddd xm0, xm1 movq xm1, [bufq+xq-3] ; y=0,x=[-3,+4] paddd xm2, xm4 paddd xm0, xm2 paddd xm0, xm3 .x_loop_ar3_inner: pmovsxbw xm2, xm1 pmaddwd xm2, xm7 pshufd xm3, xm2, q1111 paddd xm2, xm0 ; add top paddd xm2, xm3 ; left+cur psrldq xm0, 4 psrad xm2, [fg_dataq+FGData.ar_coeff_shift] ; don't packssdw since we only care about one value packsswb xm2, xm2 pextrb [bufq+xq], xm2, 0 pslldq xm2, 3 vpblendvb xm1, xm2, xm11 psrldq xm1, 1 inc xq jz .x_loop_ar3_end test xb, 3 jnz .x_loop_ar3_inner jmp .x_loop_ar3 .x_loop_ar3_end: add bufq, 82 dec hd jg .y_loop_ar3 RET %macro GEN_GRAIN_UV_FN 3 ; ss_name, ss_x, ss_y INIT_XMM avx2 cglobal generate_grain_uv_%1_8bpc, 4, 10, 16, buf, bufy, fg_data, uv %define base r4-generate_grain_uv_%1_8bpc_avx2_table lea r4, [generate_grain_uv_%1_8bpc_avx2_table] vpbroadcastw xm0, [fg_dataq+FGData.seed] mov r6d, [fg_dataq+FGData.grain_scale_shift] movq xm1, [base+next_upperbit_mask] movq xm4, [base+mul_bits] movq xm5, [base+hmul_bits] mova xm6, [base+pb_mask] vpbroadcastw xm7, [base+round+r6*2] vpbroadcastd xm2, [base+pw_seed_xor+uvq*4] pxor xm0, xm2 lea r6, [gaussian_sequence] %if %2 mov r7d, 73-35*%3 add bufq, 44 .loop_y: mov r5, -44 %else mov r5, -73*82 sub bufq, r5 %endif .loop: pand xm2, xm0, xm1 psrlw xm3, xm2, 10 por xm2, xm3 ; bits 0xf, 0x1e, 0x3c and 0x78 are set pmullw xm2, xm4 ; bits 0x0f00 are set pmulhuw xm0, xm5 pshufb xm3, xm6, xm2 ; set 15th bit for next 4 seeds psllq xm2, xm3, 30 por xm2, xm3 psllq xm3, xm2, 15 por xm2, xm0 ; aggregate each bit into next seed's high bit por xm2, xm3 ; 4 next output seeds pshuflw xm0, xm2, q3333 psrlw xm2, 5 movq r8, xm2 movzx r9d, r8w movd xm2, [r6+r9*2] rorx r9, r8, 32 shr r8d, 16 pinsrw xm2, [r6+r8*2], 1 movzx r8d, r9w pinsrw xm2, [r6+r8*2], 2 shr r9d, 16 pinsrw xm2, [r6+r9*2], 3 pmulhrsw xm2, xm7 packsswb xm2, xm2 movd [bufq+r5], xm2 add r5, 4 jl .loop %if %2 add bufq, 82 dec r7d jg .loop_y %endif ; auto-regression code movsxd r6, [fg_dataq+FGData.ar_coeff_lag] movsxd r6, [base+generate_grain_uv_%1_8bpc_avx2_table+r6*4] add r6, r4 jmp r6 INIT_YMM avx2 .ar0: DEFINE_ARGS buf, bufy, fg_data, uv, unused, shift imul uvd, 28 mov shiftd, [fg_dataq+FGData.ar_coeff_shift] movd xm2, [fg_dataq+FGData.ar_coeffs_uv+uvq] movd xm3, [base+hmul_bits+shiftq*2] DEFINE_ARGS buf, bufy, h pmovsxbw xm2, xm2 %if %2 vpbroadcastd m7, [base+pb_1] vpbroadcastw m6, [base+hmul_bits+2+%3*2] %endif vpbroadcastw m2, xm2 vpbroadcastw m3, xm3 pxor m12, m12 %if %2 sub bufq, 82*(73-35*%3)+82-(82*3+41) %else sub bufq, 82*70-3 %endif add bufyq, 3+82*3 mov hd, 70-35*%3 .y_loop_ar0: %if %2 ; first 32 pixels movu xm4, [bufyq] vinserti128 m4, [bufyq+32], 1 %if %3 movu xm0, [bufyq+82] vinserti128 m0, [bufyq+82+32], 1 %endif movu xm5, [bufyq+16] vinserti128 m5, [bufyq+48], 1 %if %3 movu xm1, [bufyq+82+16] vinserti128 m1, [bufyq+82+48], 1 %endif pmaddubsw m4, m7, m4 %if %3 pmaddubsw m0, m7, m0 %endif pmaddubsw m5, m7, m5 %if %3 pmaddubsw m1, m7, m1 paddw m4, m0 paddw m5, m1 %endif pmulhrsw m4, m6 pmulhrsw m5, m6 %else xor r3d, r3d ; first 32x2 pixels .x_loop_ar0: movu m4, [bufyq+r3] pcmpgtb m0, m12, m4 punpckhbw m5, m4, m0 punpcklbw m4, m0 %endif pmullw m4, m2 pmullw m5, m2 pmulhrsw m4, m3 pmulhrsw m5, m3 %if %2 movu m1, [bufq] %else movu m1, [bufq+r3] %endif pcmpgtb m8, m12, m1 punpcklbw m0, m1, m8 punpckhbw m1, m8 paddw m0, m4 paddw m1, m5 packsswb m0, m1 %if %2 movu [bufq], m0 %else movu [bufq+r3], m0 add r3d, 32 cmp r3d, 64 jl .x_loop_ar0 %endif ; last 6/12 pixels movu xm4, [bufyq+32*2] %if %2 %if %3 movu xm5, [bufyq+32*2+82] %endif pmaddubsw xm4, xm7, xm4 %if %3 pmaddubsw xm5, xm7, xm5 paddw xm4, xm5 %endif movq xm0, [bufq+32] pmulhrsw xm4, xm6 pmullw xm4, xm2 pmulhrsw xm4, xm3 pcmpgtb xm5, xm12, xm0 punpcklbw xm5, xm0, xm5 paddw xm4, xm5 packsswb xm4, xm4 pblendw xm0, xm4, xm0, 1000b movq [bufq+32], xm0 %else movu xm0, [bufq+64] pcmpgtb xm1, xm12, xm4 punpckhbw xm5, xm4, xm1 punpcklbw xm4, xm1 pmullw xm5, xm2 pmullw xm4, xm2 vpblendd xm1, xm3, xm12, 0x0c pmulhrsw xm5, xm1 pmulhrsw xm4, xm3 pcmpgtb xm1, xm12, xm0 punpckhbw xm8, xm0, xm1 punpcklbw xm0, xm1 paddw xm5, xm8 paddw xm0, xm4 packsswb xm0, xm5 movu [bufq+64], xm0 %endif add bufq, 82 add bufyq, 82<<%3 dec hd jg .y_loop_ar0 RET INIT_XMM avx2 .ar1: DEFINE_ARGS buf, bufy, fg_data, uv, val3, cf3, min, max, x, shift imul uvd, 28 mov shiftd, [fg_dataq+FGData.ar_coeff_shift] movsx cf3d, byte [fg_dataq+FGData.ar_coeffs_uv+uvq+3] movd xm4, [fg_dataq+FGData.ar_coeffs_uv+uvq] pinsrb xm4, [fg_dataq+FGData.ar_coeffs_uv+uvq+4], 3 DEFINE_ARGS buf, bufy, h, val0, val3, cf3, min, max, x, shift pmovsxbw xm4, xm4 pshufd xm5, xm4, q1111 pshufd xm4, xm4, q0000 pmovsxwd xm3, [base+round_vals+shiftq*2-12] ; rnd %if %2 vpbroadcastd xm7, [base+pb_1] vpbroadcastw xm6, [base+hmul_bits+2+%3*2] %endif vpbroadcastd xm3, xm3 %if %2 sub bufq, 82*(73-35*%3)+44-(82*3+41) %else sub bufq, 82*70-(82-3) %endif add bufyq, 79+82*3 mov hd, 70-35*%3 mov mind, -128 mov maxd, 127 .y_loop_ar1: mov xq, -(76>>%2) movsx val3d, byte [bufq+xq-1] .x_loop_ar1: pmovsxbw xm0, [bufq+xq-82-1] ; top/left %if %2 movq xm8, [bufyq+xq*2] %if %3 movq xm9, [bufyq+xq*2+82] %endif %endif psrldq xm2, xm0, 2 ; top psrldq xm1, xm0, 4 ; top/right %if %2 pmaddubsw xm8, xm7, xm8 %if %3 pmaddubsw xm9, xm7, xm9 paddw xm8, xm9 %endif pmulhrsw xm8, xm6 %else pmovsxbw xm8, [bufyq+xq] %endif punpcklwd xm0, xm2 punpcklwd xm1, xm8 pmaddwd xm0, xm4 pmaddwd xm1, xm5 paddd xm0, xm1 paddd xm0, xm3 .x_loop_ar1_inner: movd val0d, xm0 psrldq xm0, 4 imul val3d, cf3d add val3d, val0d sarx val3d, val3d, shiftd movsx val0d, byte [bufq+xq] add val3d, val0d cmp val3d, maxd cmovns val3d, maxd cmp val3d, mind cmovs val3d, mind mov byte [bufq+xq], val3b ; keep val3d in-place as left for next x iteration inc xq jz .x_loop_ar1_end test xq, 3 jnz .x_loop_ar1_inner jmp .x_loop_ar1 .x_loop_ar1_end: add bufq, 82 add bufyq, 82<<%3 dec hd jg .y_loop_ar1 RET .ar2: DEFINE_ARGS buf, bufy, fg_data, uv, unused, shift mov shiftd, [fg_dataq+FGData.ar_coeff_shift] imul uvd, 28 vpbroadcastw xm13, [base+round_vals-12+shiftq*2] pmovsxbw xm7, [fg_dataq+FGData.ar_coeffs_uv+uvq+0] ; cf0-7 pmovsxbw xm0, [fg_dataq+FGData.ar_coeffs_uv+uvq+8] ; cf8-12 pinsrw xm0, [base+pw_1], 5 %if %2 vpbroadcastw xm12, [base+hmul_bits+2+%3*2] vpbroadcastd xm11, [base+pb_1] %endif DEFINE_ARGS buf, bufy, fg_data, h, unused, x pshufd xm4, xm7, q0000 pshufd xm5, xm7, q3333 pshufd xm6, xm7, q1111 pshufd xm7, xm7, q2222 pshufd xm8, xm0, q0000 pshufd xm9, xm0, q1111 pshufd xm10, xm0, q2222 %if %2 sub bufq, 82*(73-35*%3)+44-(82*3+41) %else sub bufq, 82*70-(82-3) %endif add bufyq, 79+82*3 mov hd, 70-35*%3 .y_loop_ar2: mov xq, -(76>>%2) .x_loop_ar2: pmovsxbw xm0, [bufq+xq-82*2-2] ; y=-2,x=[-2,+5] pmovsxbw xm1, [bufq+xq-82*1-2] ; y=-1,x=[-2,+5] pshufb xm2, xm0, [base+gen_shufA] pmaddwd xm2, xm4 pshufb xm3, xm1, [base+gen_shufB] pmaddwd xm3, xm5 paddd xm2, xm3 pshufb xm3, xm0, [base+gen_shufC] pmaddwd xm3, xm6 punpckhqdq xm0, xm0 ; y=-2,x=[+2,+5] punpcklwd xm0, xm1 pmaddwd xm0, xm7 pshufb xm1, [gen_shufD] pmaddwd xm1, xm8 paddd xm2, xm3 paddd xm0, xm1 paddd xm2, xm0 %if %2 movq xm0, [bufyq+xq*2] %if %3 movq xm3, [bufyq+xq*2+82] %endif pmaddubsw xm0, xm11, xm0 %if %3 pmaddubsw xm3, xm11, xm3 paddw xm0, xm3 %endif pmulhrsw xm0, xm12 %else pmovsxbw xm0, [bufyq+xq] %endif punpcklwd xm0, xm13 pmaddwd xm0, xm10 paddd xm2, xm0 movq xm0, [bufq+xq-2] ; y=0,x=[-2,+5] .x_loop_ar2_inner: pmovsxbw xm0, xm0 pmaddwd xm3, xm0, xm9 psrldq xm0, 2 paddd xm3, xm2 psrldq xm2, 4 ; shift top to next pixel psrad xm3, [fg_dataq+FGData.ar_coeff_shift] pslldq xm3, 2 paddw xm3, xm0 pblendw xm0, xm3, 00000010b packsswb xm0, xm0 pextrb [bufq+xq], xm0, 1 inc xq jz .x_loop_ar2_end test xb, 3 jnz .x_loop_ar2_inner jmp .x_loop_ar2 .x_loop_ar2_end: add bufq, 82 add bufyq, 82<<%3 dec hd jg .y_loop_ar2 RET INIT_YMM avx2 .ar3: DEFINE_ARGS buf, bufy, fg_data, uv, unused, shift mov shiftd, [fg_dataq+FGData.ar_coeff_shift] imul uvd, 28 pmovsxbw m0, [fg_dataq+FGData.ar_coeffs_uv+uvq+ 0] ; cf0-15 pmovsxbw xm1, [fg_dataq+FGData.ar_coeffs_uv+uvq+16] ; cf16-23 vpbroadcastb xm2, [fg_dataq+FGData.ar_coeffs_uv+uvq+24] ; cf24 [luma] movd xm13, [base+round_vals-10+shiftq*2] vpbroadcastd xm14, [base+round_vals-14+shiftq*2] pshufd m6, m0, q0000 pshufd m7, m0, q1111 pshufd m8, m0, q2222 pshufd m9, m0, q3333 pshufd xm10, xm1, q0000 pshufd xm11, xm1, q1111 pshufhw xm12, xm1, q0000 psraw xm2, 8 palignr xm13, xm1, 10 punpckhwd xm12, xm2 ; interleave luma cf psrld xm14, 16 DEFINE_ARGS buf, bufy, fg_data, h, unused, x %if %2 vpbroadcastw xm15, [base+hmul_bits+2+%3*2] sub bufq, 82*(73-35*%3)+44-(82*3+41) %else sub bufq, 82*70-(82-3) %endif add bufyq, 79+82*3 mov hd, 70-35*%3 .y_loop_ar3: mov xq, -(76>>%2) .x_loop_ar3: vbroadcasti128 m3, [bufq+xq-82*2-3] ; y=-2,x=[-3,+12 palignr xm1, xm3, [bufq+xq-82*3-9], 6 ; y=-3,x=[-3,+12] vbroadcasti128 m4, [bufq+xq-82*1-3] ; y=-1,x=[-3,+12] vpblendd m3, m1, 0x0f pxor m0, m0 pcmpgtb m2, m0, m3 pcmpgtb m0, m4 punpcklbw m1, m3, m2 punpckhbw m3, m2 punpcklbw m2, m4, m0 punpckhbw xm4, xm0 pshufb m0, m1, [base+gen_shufA] pmaddwd m0, m6 pshufb m5, m1, [base+gen_shufC] pmaddwd m5, m7 shufps m1, m3, q1032 paddd m0, m5 pshufb m5, m1, [base+gen_shufA] pmaddwd m5, m8 shufps xm1, xm3, q2121 vpblendd m1, m2, 0xf0 pshufb m1, [base+gen_shufE] pmaddwd m1, m9 paddd m0, m5 pshufb xm3, xm2, [base+gen_shufC] paddd m0, m1 pmaddwd xm3, xm10 palignr xm1, xm4, xm2, 2 punpckhwd xm1, xm2, xm1 pmaddwd xm1, xm11 palignr xm4, xm2, 12 paddd xm3, xm1 %if %2 vpbroadcastd xm5, [base+pb_1] movq xm1, [bufyq+xq*2] pmaddubsw xm1, xm5, xm1 %if %3 movq xm2, [bufyq+xq*2+82] pmaddubsw xm5, xm2 paddw xm1, xm5 %endif pmulhrsw xm1, xm15 %else pmovsxbw xm1, [bufyq+xq] %endif punpcklwd xm4, xm1 pmaddwd xm4, xm12 movq xm1, [bufq+xq-3] ; y=0,x=[-3,+4] vextracti128 xm2, m0, 1 paddd xm0, xm14 paddd xm3, xm4 paddd xm0, xm3 paddd xm0, xm2 .x_loop_ar3_inner: pmovsxbw xm1, xm1 pmaddwd xm2, xm13, xm1 pshuflw xm3, xm2, q1032 paddd xm2, xm0 ; add top paddd xm2, xm3 ; left+cur psrldq xm0, 4 psrad xm2, [fg_dataq+FGData.ar_coeff_shift] psrldq xm1, 2 ; don't packssdw, we only care about one value punpckldq xm2, xm2 pblendw xm1, xm2, 0100b packsswb xm1, xm1 pextrb [bufq+xq], xm1, 2 inc xq jz .x_loop_ar3_end test xb, 3 jnz .x_loop_ar3_inner jmp .x_loop_ar3 .x_loop_ar3_end: add bufq, 82 add bufyq, 82<<%3 dec hd jg .y_loop_ar3 RET %endmacro INIT_YMM avx2 cglobal fgy_32x32xn_8bpc, 6, 13, 15, dst, src, stride, fg_data, w, scaling, \ grain_lut, h, sby, see, overlap %define base r9-pd_m65536 lea r9, [pd_m65536] mov r6d, [fg_dataq+FGData.scaling_shift] mov r7d, [fg_dataq+FGData.clip_to_restricted_range] mov sbyd, sbym mov overlapd, [fg_dataq+FGData.overlap_flag] vpbroadcastd m8, [base+pd_m65536] vpbroadcastw m9, [base+mul_bits+r6*2-14] vpbroadcastd m10, [base+fg_min+r7*4] vpbroadcastd m11, [base+fg_max+r7*8] vpbroadcastd m12, [base+pw_1024] movq xm13, [base+pb_27_17_17_27] test sbyd, sbyd setnz r7b pxor m7, m7 test r7b, overlapb jnz .vertical_overlap imul seed, sbyd, (173 << 24) | 37 add seed, (105 << 24) | 178 rorx seed, seed, 24 movzx seed, seew xor seed, [fg_dataq+FGData.seed] DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ offx, offy, see, overlap lea src_bakq, [srcq+wq] neg wq sub dstq, srcq .loop_x: rorx r6, seeq, 1 or seed, 0xEFF4 test seeb, seeh lea seed, [r6+0x8000] cmovp seed, r6d ; updated seed rorx offyd, seed, 8 rorx offxq, seeq, 12 and offyd, 0xf imul offyd, 164 lea offyd, [offyq+offxq*2+747] ; offy*stride+offx DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ h, offxy, see, overlap mov hd, hm mov grain_lutq, grain_lutmp .loop_y: ; src mova m2, [srcq] punpcklbw m0, m2, m7 punpckhbw m1, m2, m7 ; scaling[src] pandn m4, m8, m0 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, m0, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m1 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 pblendw m2, m4, 0xaa psrld m4, m1, 16 mova m8, m6 vpgatherdd m5, [scalingq+m4-2], m6 pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] movu m5, [grain_lutq+offxyq] punpcklbw m4, m5, m7 punpckhbw m5, m7 ; noise = round2(scaling[src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 mova [dstq+srcq], m0 add srcq, strideq add grain_lutq, 82 dec hd jg .loop_y add wq, 32 jge .end lea srcq, [src_bakq+wq] test overlapd, overlapd jz .loop_x ; r8m = sbym cmp dword r8m, 0 jne .loop_x_hv_overlap ; horizontal overlap (without vertical overlap) .loop_x_h_overlap: rorx r6, seeq, 1 or seed, 0xEFF4 test seeb, seeh lea seed, [r6+0x8000] cmovp seed, r6d ; updated seed DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ offx, offy, see, left_offxy lea left_offxyd, [offyq+32] ; previous column's offy*stride+offx rorx offyd, seed, 8 rorx offxq, seeq, 12 and offyd, 0xf imul offyd, 164 lea offyd, [offyq+offxq*2+747] ; offy*stride+offx DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ h, offxy, see, left_offxy mov grain_lutq, grain_lutmp mov hd, hm .loop_y_h_overlap: ; src mova m2, [srcq] punpcklbw m0, m2, m7 punpckhbw m1, m2, m7 ; scaling[src] pandn m4, m8, m0 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, m0, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m1 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 pblendw m2, m4, 0xaa psrld m4, m1, 16 mova m8, m6 vpgatherdd m5, [scalingq+m4-2], m6 pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] movu m5, [grain_lutq+offxyq] movd xm4, [grain_lutq+left_offxyq] punpcklbw xm4, xm5 pmaddubsw xm4, xm13, xm4 pmulhrsw xm4, xm12 packsswb xm4, xm4 vpblendd m4, m5, 0xfe punpckhbw m5, m7 punpcklbw m4, m7 ; noise = round2(scaling[src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 mova [dstq+srcq], m0 add srcq, strideq add grain_lutq, 82 dec hd jg .loop_y_h_overlap add wq, 32 jge .end lea srcq, [src_bakq+wq] ; r8m = sbym cmp dword r8m, 0 jne .loop_x_hv_overlap jmp .loop_x_h_overlap .vertical_overlap: DEFINE_ARGS dst, src, stride, fg_data, w, scaling, grain_lut, \ unused, sby, see, overlap movzx sbyd, sbyb imul seed, [fg_dataq+FGData.seed], 0x00010001 imul r7d, sbyd, 173 * 0x00010001 imul sbyd, 37 * 0x01000100 add r7d, (105 << 16) | 188 add sbyd, (178 << 24) | (141 << 8) and r7d, 0x00ff00ff and sbyd, 0xff00ff00 xor seed, r7d xor seed, sbyd ; (cur_seed << 16) | top_seed DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ offx, offy, see, overlap lea src_bakq, [srcq+wq] neg wq sub dstq, srcq .loop_x_v_overlap: vpbroadcastd m14, [pb_27_17] ; we assume from the block above that bits 8-15 of r7d are zero'ed mov r6d, seed or seed, 0xeff4eff4 test seeb, seeh setp r7b ; parity of top_seed shr seed, 16 shl r7d, 16 test seeb, seeh setp r7b ; parity of cur_seed or r6d, 0x00010001 xor r7d, r6d rorx seed, r7d, 1 ; updated (cur_seed << 16) | top_seed rorx offyd, seed, 8 rorx offxd, seed, 12 and offyd, 0xf000f and offxd, 0xf000f imul offyd, 164 ; offxy=offy*stride+offx, (cur_offxy << 16) | top_offxy lea offyd, [offyq+offxq*2+0x10001*747+32*82] DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ h, offxy, see, overlap, top_offxy mov grain_lutq, grain_lutmp mov hd, hm movzx top_offxyd, offxyw shr offxyd, 16 .loop_y_v_overlap: ; src mova m2, [srcq] punpcklbw m0, m2, m7 punpckhbw m1, m2, m7 ; scaling[src] pandn m4, m8, m0 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, m0, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m1 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 pblendw m2, m4, 0xaa psrld m4, m1, 16 mova m8, m6 vpgatherdd m5, [scalingq+m4-2], m6 pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] movu m6, [grain_lutq+offxyq] movu m4, [grain_lutq+top_offxyq] punpcklbw m5, m4, m6 punpckhbw m4, m6 pmaddubsw m5, m14, m5 pmaddubsw m4, m14, m4 pmulhrsw m5, m12 pmulhrsw m4, m12 packsswb m5, m4 punpcklbw m4, m5, m7 punpckhbw m5, m7 ; noise = round2(scaling[src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 mova [dstq+srcq], m0 add srcq, strideq add grain_lutq, 82 dec hb jz .end_y_v_overlap vpbroadcastd m14, [pb_17_27] ; swap weights for second v-overlap line ; 2 lines get vertical overlap, then fall back to non-overlap code for ; remaining (up to) 30 lines add hd, 0x80000000 jnc .loop_y_v_overlap jmp .loop_y .end_y_v_overlap: add wq, 32 jge .end lea srcq, [src_bakq+wq] ; since fg_dataq.overlap is guaranteed to be set, we never jump ; back to .loop_x_v_overlap, and instead always fall-through to ; h+v overlap .loop_x_hv_overlap: vpbroadcastd m14, [pb_27_17] ; we assume from the block above that bits 8-15 of r7d are zero'ed mov r6d, seed or seed, 0xeff4eff4 test seeb, seeh setp r7b ; parity of top_seed shr seed, 16 shl r7d, 16 test seeb, seeh setp r7b ; parity of cur_seed or r6d, 0x00010001 xor r7d, r6d rorx seed, r7d, 1 ; updated (cur_seed << 16) | top_seed DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ offx, offy, see, left_offxy, top_offxy, topleft_offxy lea topleft_offxyd, [top_offxyq+32] lea left_offxyd, [offyq+32] rorx offyd, seed, 8 rorx offxd, seed, 12 and offyd, 0xf000f and offxd, 0xf000f imul offyd, 164 ; offxy=offy*stride+offx, (cur_offxy << 16) | top_offxy lea offyd, [offyq+offxq*2+0x10001*747+32*82] DEFINE_ARGS dst, src, stride, src_bak, w, scaling, grain_lut, \ h, offxy, see, left_offxy, top_offxy, topleft_offxy mov grain_lutq, grain_lutmp mov hd, hm movzx top_offxyd, offxyw shr offxyd, 16 .loop_y_hv_overlap: ; src mova m2, [srcq] punpcklbw m0, m2, m7 punpckhbw m1, m2, m7 ; scaling[src] pandn m4, m8, m0 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, m0, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m1 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 pblendw m2, m4, 0xaa psrld m4, m1, 16 mova m8, m6 vpgatherdd m5, [scalingq+m4-2], m6 pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] movu m6, [grain_lutq+offxyq] movd xm7, [grain_lutq+left_offxyq] movu m4, [grain_lutq+top_offxyq] movd xm5, [grain_lutq+topleft_offxyq] ; do h interpolation first (so top | top/left -> top, left | cur -> cur) punpcklbw xm7, xm6 punpcklbw xm5, xm4 pmaddubsw xm7, xm13, xm7 pmaddubsw xm5, xm13, xm5 pmulhrsw xm7, xm12 pmulhrsw xm5, xm12 packsswb xm7, xm7 packsswb xm5, xm5 vpblendd m7, m6, 0xfe vpblendd m5, m4, 0xfe ; followed by v interpolation (top | cur -> cur) punpckhbw m4, m6 punpcklbw m5, m7 pmaddubsw m4, m14, m4 pmaddubsw m5, m14, m5 pmulhrsw m4, m12 pmulhrsw m5, m12 pxor m7, m7 packsswb m5, m4 punpcklbw m4, m5, m7 punpckhbw m5, m7 ; noise = round2(scaling[src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 mova [dstq+srcq], m0 add srcq, strideq add grain_lutq, 82 dec hb jz .end_y_hv_overlap vpbroadcastd m14, [pb_17_27] ; swap weights for second v-overlap line ; 2 lines get vertical overlap, then fall back to non-overlap code for ; remaining (up to) 30 lines add hd, 0x80000000 jnc .loop_y_hv_overlap jmp .loop_y_h_overlap .end_y_hv_overlap: add wq, 32 lea srcq, [src_bakq+wq] jl .loop_x_hv_overlap .end: RET %macro FGUV_FN 3 ; name, ss_hor, ss_ver cglobal fguv_32x32xn_i%1_8bpc, 6, 15, 16, dst, src, stride, fg_data, w, scaling, \ grain_lut, h, sby, luma, overlap, uv_pl, is_id %define base r11-pd_m65536 lea r11, [pd_m65536] mov r6d, [fg_dataq+FGData.scaling_shift] mov r7d, [fg_dataq+FGData.clip_to_restricted_range] mov r9d, is_idm mov sbyd, sbym mov overlapd, [fg_dataq+FGData.overlap_flag] vpbroadcastd m8, [base+pd_m65536] vpbroadcastw m9, [base+mul_bits+r6*2-14] vpbroadcastd m10, [base+fg_min+r7*4] shlx r7d, r7d, r9d vpbroadcastd m11, [base+fg_max+r7*4] vpbroadcastd m12, [base+pw_1024] pxor m7, m7 test sbyd, sbyd setnz r7b cmp byte [fg_dataq+FGData.chroma_scaling_from_luma], 0 jne .csfl %macro %%FGUV_32x32xN_LOOP 3 ; not-csfl, ss_hor, ss_ver DEFINE_ARGS dst, src, stride, fg_data, w, scaling, grain_lut, \ h, sby, see, overlap, uv_pl %if %1 mov r6d, uv_plm vpbroadcastd m0, [base+pw_8] vbroadcasti128 m14, [fg_dataq+FGData.uv_mult+r6*4] vpbroadcastw m15, [fg_dataq+FGData.uv_offset+r6*4] pshufb m14, m0 ; uv_luma_mult, uv_mult %elif %2 vpbroadcastq m15, [base+pb_23_22] %else vpbroadcastq xm15, [base+pb_27_17_17_27] %endif %if %3 vpbroadcastw m13, [base+pb_23_22] %elif %2 pshufd m13, [base+pb_27_17], q0000 ; 8x27_17, 8x17_27 %endif test r7b, overlapb jnz %%vertical_overlap imul seed, sbyd, (173 << 24) | 37 add seed, (105 << 24) | 178 rorx seed, seed, 24 movzx seed, seew xor seed, [fg_dataq+FGData.seed] DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ unused2, unused3, see, overlap, unused4, unused5, lstride mov lumaq, r9mp lea r12, [srcq+wq] lea r13, [dstq+wq] lea r14, [lumaq+wq*(1+%2)] mov r11mp, r12 mov r12mp, r13 mov lstrideq, r10mp neg wq %%loop_x: rorx r6, seeq, 1 or seed, 0xEFF4 test seeb, seeh lea seed, [r6+0x8000] cmovp seed, r6d ; updated seed DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ offx, offy, see, overlap, unused1, unused2, lstride rorx offyd, seed, 8 rorx offxq, seeq, 12 and offyd, 0xf imul offyd, 164>>%3 lea offyd, [offyq+offxq*(2-%2)+(3+(6>>%3))*82+3+(6>>%2)] ; offy*stride+offx DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ h, offxy, see, overlap, unused1, unused2, lstride mov grain_lutq, grain_lutmp mov hd, hm %%loop_y: ; src %if %2 mova xm3, [lumaq+lstrideq*0+ 0] vinserti128 m3, [lumaq+lstrideq*(1+%3) +0], 1 vpbroadcastd m2, [pb_1] mova xm0, [lumaq+lstrideq*0+16] vinserti128 m0, [lumaq+lstrideq*(1+%3)+16], 1 mova xm1, [srcq] vinserti128 m1, [srcq+strideq], 1 pmaddubsw m3, m2 pmaddubsw m0, m2 pavgw m3, m7 pavgw m0, m7 %else mova m2, [lumaq] mova m1, [srcq] %endif %if %1 %if %2 packuswb m2, m3, m0 ; luma %endif punpckhbw m3, m2, m1 punpcklbw m2, m1 ; { luma, chroma } pmaddubsw m3, m14 pmaddubsw m2, m14 psraw m3, 6 psraw m2, 6 paddw m3, m15 paddw m2, m15 packuswb m2, m3 ; pack+unpack = clip %endif %if %1 || %2 == 0 punpcklbw m3, m2, m7 punpckhbw m0, m2, m7 %endif ; scaling[luma_src] pandn m4, m8, m3 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m0 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 psrld m0, 16 mova m8, m6 vpgatherdd m5, [scalingq+m0-2], m6 pblendw m2, m4, 0xaa pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] %if %2 movu xm5, [grain_lutq+offxyq+ 0] vinserti128 m5, [grain_lutq+offxyq+82], 1 %else movu m5, [grain_lutq+offxyq] %endif punpcklbw m4, m5, m7 punpckhbw m5, m7 ; noise = round2(scaling[luma_src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; unpack chroma_source punpcklbw m0, m1, m7 punpckhbw m1, m7 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 %if %2 mova [dstq], xm0 vextracti128 [dstq+strideq], m0, 1 %else mova [dstq], m0 %endif %if %2 lea srcq, [srcq+strideq*2] lea dstq, [dstq+strideq*2] lea lumaq, [lumaq+lstrideq*(2<<%3)] %else add srcq, strideq add dstq, strideq add lumaq, lstrideq %endif add grain_lutq, 82<<%2 sub hb, 1+%2 jg %%loop_y add wq, 32>>%2 jge .end mov srcq, r11mp mov dstq, r12mp lea lumaq, [r14+wq*(1+%2)] add srcq, wq add dstq, wq test overlapd, overlapd jz %%loop_x ; r8m = sbym cmp dword r8m, 0 jne %%loop_x_hv_overlap ; horizontal overlap (without vertical overlap) %%loop_x_h_overlap: rorx r6, seeq, 1 or seed, 0xEFF4 test seeb, seeh lea seed, [r6+0x8000] cmovp seed, r6d ; updated seed DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ offx, offy, see, left_offxy, unused1, unused2, lstride lea left_offxyd, [offyq+(32>>%2)] ; previous column's offy*stride+offx rorx offyd, seed, 8 rorx offxq, seeq, 12 and offyd, 0xf imul offyd, 164>>%3 lea offyd, [offyq+offxq*(2-%2)+(3+(6>>%3))*82+3+(6>>%2)] ; offy*stride+offx DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ h, offxy, see, left_offxy, unused1, unused2, lstride mov grain_lutq, grain_lutmp mov hd, hm %%loop_y_h_overlap: ; src %if %2 mova xm3, [lumaq+lstrideq*0+ 0] vinserti128 m3, [lumaq+lstrideq*(1+%3)+ 0], 1 vpbroadcastd m2, [pb_1] mova xm0, [lumaq+lstrideq*0+16] vinserti128 m0, [lumaq+lstrideq*(1+%3)+16], 1 mova xm1, [srcq] vinserti128 m1, [srcq+strideq], 1 pmaddubsw m3, m2 pmaddubsw m0, m2 pavgw m3, m7 pavgw m0, m7 %else mova m2, [lumaq] mova m1, [srcq] %endif %if %1 %if %2 packuswb m2, m3, m0 ; luma %endif punpckhbw m3, m2, m1 punpcklbw m2, m1 ; { luma, chroma } pmaddubsw m3, m14 pmaddubsw m2, m14 psraw m3, 6 psraw m2, 6 paddw m3, m15 paddw m2, m15 packuswb m2, m3 ; pack+unpack = clip %endif %if %1 || %2 == 0 punpcklbw m3, m2, m7 punpckhbw m0, m2, m7 %endif ; scaling[luma_src] pandn m4, m8, m3 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m0 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 psrld m0, 16 mova m8, m6 vpgatherdd m5, [scalingq+m0-2], m6 pblendw m2, m4, 0xaa pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] %if %2 movu xm5, [grain_lutq+offxyq+ 0] vinserti128 m5, [grain_lutq+offxyq+82], 1 movd xm4, [grain_lutq+left_offxyq+ 0] vinserti128 m4, [grain_lutq+left_offxyq+82], 1 punpcklbw m4, m5 %if %1 vpbroadcastq m0, [pb_23_22] pmaddubsw m4, m0, m4 %else pmaddubsw m4, m15, m4 %endif pmulhrsw m4, m12 packsswb m4, m4 vpblendd m4, m5, 0xee %else movu m5, [grain_lutq+offxyq] movd xm4, [grain_lutq+left_offxyq] punpcklbw xm4, xm5 %if %1 movq xm0, [pb_27_17_17_27] pmaddubsw xm4, xm0, xm4 %else pmaddubsw xm4, xm15, xm4 %endif pmulhrsw xm4, xm12 packsswb xm4, xm4 vpblendd m4, m5, 0xfe %endif punpckhbw m5, m7 punpcklbw m4, m7 ; noise = round2(scaling[luma_src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; unpack chroma_source punpcklbw m0, m1, m7 punpckhbw m1, m7 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 %if %2 mova [dstq], xm0 vextracti128 [dstq+strideq], m0, 1 %else mova [dstq], m0 %endif %if %2 lea srcq, [srcq+strideq*2] lea dstq, [dstq+strideq*2] lea lumaq, [lumaq+lstrideq*(2<<%3)] %else add srcq, strideq add dstq, strideq add lumaq, lstrideq %endif add grain_lutq, 82*(1+%2) sub hb, 1+%2 jg %%loop_y_h_overlap add wq, 32>>%2 jge .end mov srcq, r11mp mov dstq, r12mp lea lumaq, [r14+wq*(1+%2)] add srcq, wq add dstq, wq ; r8m = sbym cmp dword r8m, 0 jne %%loop_x_hv_overlap jmp %%loop_x_h_overlap %%vertical_overlap: DEFINE_ARGS dst, src, stride, fg_data, w, scaling, grain_lut, unused, \ sby, see, overlap, unused1, unused2, lstride movzx sbyd, sbyb imul seed, [fg_dataq+FGData.seed], 0x00010001 imul r7d, sbyd, 173 * 0x00010001 imul sbyd, 37 * 0x01000100 add r7d, (105 << 16) | 188 add sbyd, (178 << 24) | (141 << 8) and r7d, 0x00ff00ff and sbyd, 0xff00ff00 xor seed, r7d xor seed, sbyd ; (cur_seed << 16) | top_seed DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ unused1, unused2, see, overlap, unused3, unused4, lstride mov lumaq, r9mp lea r12, [srcq+wq] lea r13, [dstq+wq] lea r14, [lumaq+wq*(1+%2)] mov r11mp, r12 mov r12mp, r13 mov lstrideq, r10mp neg wq %%loop_x_v_overlap: ; we assume from the block above that bits 8-15 of r7d are zero'ed mov r6d, seed or seed, 0xeff4eff4 test seeb, seeh setp r7b ; parity of top_seed shr seed, 16 shl r7d, 16 test seeb, seeh setp r7b ; parity of cur_seed or r6d, 0x00010001 xor r7d, r6d rorx seed, r7d, 1 ; updated (cur_seed << 16) | top_seed DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ offx, offy, see, overlap, top_offxy, unused, lstride rorx offyd, seed, 8 rorx offxd, seed, 12 and offyd, 0xf000f and offxd, 0xf000f imul offyd, 164>>%3 ; offxy=offy*stride+offx, (cur_offxy << 16) | top_offxy lea offyd, [offyq+offxq*(2-%2)+0x10001*((3+(6>>%3))*82+3+(6>>%2))+(32>>%3)*82] DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ h, offxy, see, overlap, top_offxy, unused, lstride mov grain_lutq, grain_lutmp mov hd, hm movzx top_offxyd, offxyw shr offxyd, 16 %if %2 == 0 vpbroadcastd m13, [pb_27_17] %endif %%loop_y_v_overlap: ; src %if %2 mova xm3, [lumaq+lstrideq*0+ 0] vinserti128 m3, [lumaq+lstrideq*(1+%3)+ 0], 1 vpbroadcastd m2, [pb_1] mova xm0, [lumaq+lstrideq*0+16] vinserti128 m0, [lumaq+lstrideq*(1+%3)+16], 1 mova xm1, [srcq] vinserti128 m1, [srcq+strideq], 1 pmaddubsw m3, m2 pmaddubsw m0, m2 pavgw m3, m7 pavgw m0, m7 %else mova m2, [lumaq] mova m1, [srcq] %endif %if %1 %if %2 packuswb m2, m3, m0 ; luma %endif punpckhbw m3, m2, m1 punpcklbw m2, m1 ; { luma, chroma } pmaddubsw m3, m14 pmaddubsw m2, m14 psraw m3, 6 psraw m2, 6 paddw m3, m15 paddw m2, m15 packuswb m2, m3 ; pack+unpack = clip %endif %if %1 || %2 == 0 punpcklbw m3, m2, m7 punpckhbw m0, m2, m7 %endif ; scaling[luma_src] pandn m4, m8, m3 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m0 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 psrld m0, 16 mova m8, m6 vpgatherdd m5, [scalingq+m0-2], m6 pblendw m2, m4, 0xaa pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] %if %3 == 0 %if %2 movu xm0, [grain_lutq+offxyq] vinserti128 m0, [grain_lutq+offxyq+82], 1 movu xm4, [grain_lutq+top_offxyq] vinserti128 m4, [grain_lutq+top_offxyq+82], 1 %else movu m0, [grain_lutq+offxyq] movu m4, [grain_lutq+top_offxyq] %endif punpcklbw m5, m4, m0 punpckhbw m4, m0 pmaddubsw m5, m13, m5 pmaddubsw m4, m13, m4 pmulhrsw m5, m12 pmulhrsw m4, m12 packsswb m5, m4 %else movq xm4, [grain_lutq+offxyq] vinserti128 m4, [grain_lutq+offxyq+8], 1 movq xm5, [grain_lutq+top_offxyq] vinserti128 m5, [grain_lutq+top_offxyq+8], 1 punpcklbw m5, m4 pmaddubsw m5, m13, m5 pmulhrsw m5, m12 vextracti128 xm4, m5, 1 packsswb xm5, xm4 ; only interpolate first line, insert second line unmodified vinserti128 m5, [grain_lutq+offxyq+82], 1 %endif punpcklbw m4, m5, m7 punpckhbw m5, m7 ; noise = round2(scaling[luma_src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; unpack chroma_source punpcklbw m0, m1, m7 punpckhbw m1, m7 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 %if %2 mova [dstq], xm0 vextracti128 [dstq+strideq], m0, 1 %else mova [dstq], m0 %endif sub hb, 1+%2 jle %%end_y_v_overlap %if %2 lea srcq, [srcq+strideq*2] lea dstq, [dstq+strideq*2] lea lumaq, [lumaq+lstrideq*(2<<%3)] %else add srcq, strideq add dstq, strideq add lumaq, lstrideq %endif add grain_lutq, 82<<%2 %if %2 == 0 vpbroadcastd m13, [pb_17_27] add hd, 0x80000000 jnc %%loop_y_v_overlap %endif jmp %%loop_y %%end_y_v_overlap: add wq, 32>>%2 jge .end mov srcq, r11mp mov dstq, r12mp lea lumaq, [r14+wq*(1+%2)] add srcq, wq add dstq, wq ; since fg_dataq.overlap is guaranteed to be set, we never jump ; back to .loop_x_v_overlap, and instead always fall-through to ; h+v overlap %%loop_x_hv_overlap: ; we assume from the block above that bits 8-15 of r7d are zero'ed mov r6d, seed or seed, 0xeff4eff4 test seeb, seeh setp r7b ; parity of top_seed shr seed, 16 shl r7d, 16 test seeb, seeh setp r7b ; parity of cur_seed or r6d, 0x00010001 xor r7d, r6d rorx seed, r7d, 1 ; updated (cur_seed << 16) | top_seed DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ offx, offy, see, left_offxy, top_offxy, topleft_offxy, lstride lea topleft_offxyd, [top_offxyq+(32>>%2)] lea left_offxyd, [offyq+(32>>%2)] rorx offyd, seed, 8 rorx offxd, seed, 12 and offyd, 0xf000f and offxd, 0xf000f imul offyd, 164>>%3 ; offxy=offy*stride+offx, (cur_offxy << 16) | top_offxy lea offyd, [offyq+offxq*(2-%2)+0x10001*((3+(6>>%3))*82+3+(6>>%2))+(32>>%3)*82] DEFINE_ARGS dst, src, stride, luma, w, scaling, grain_lut, \ h, offxy, see, left_offxy, top_offxy, topleft_offxy, lstride mov grain_lutq, grain_lutmp mov hd, hm movzx top_offxyd, offxyw shr offxyd, 16 %if %2 == 0 vpbroadcastd m13, [pb_27_17] %endif %%loop_y_hv_overlap: ; src %if %2 mova xm3, [lumaq+lstrideq*0+ 0] vinserti128 m3, [lumaq+lstrideq*(1+%3)+ 0], 1 vpbroadcastd m2, [pb_1] mova xm0, [lumaq+lstrideq*0+16] vinserti128 m0, [lumaq+lstrideq*(1+%3)+16], 1 mova xm1, [srcq] vinserti128 m1, [srcq+strideq], 1 pmaddubsw m3, m2 pmaddubsw m0, m2 pavgw m3, m7 pavgw m0, m7 %else mova m2, [lumaq] mova m1, [srcq] %endif %if %1 %if %2 packuswb m2, m3, m0 ; luma %endif punpckhbw m3, m2, m1 punpcklbw m2, m1 ; { luma, chroma } pmaddubsw m3, m14 pmaddubsw m2, m14 psraw m3, 6 psraw m2, 6 paddw m3, m15 paddw m2, m15 packuswb m2, m3 ; pack+unpack = clip %endif %if %1 || %2 == 0 punpcklbw m3, m2, m7 punpckhbw m0, m2, m7 %endif ; scaling[luma_src] pandn m4, m8, m3 mova m6, m8 vpgatherdd m2, [scalingq+m4-0], m8 psrld m3, 16 mova m8, m6 vpgatherdd m4, [scalingq+m3-2], m6 pandn m5, m8, m0 mova m6, m8 vpgatherdd m3, [scalingq+m5-0], m8 psrld m0, 16 mova m8, m6 vpgatherdd m5, [scalingq+m0-2], m6 pblendw m2, m4, 0xaa pblendw m3, m5, 0xaa ; grain = grain_lut[offy+y][offx+x] %if %2 movu xm4, [grain_lutq+offxyq] vinserti128 m4, [grain_lutq+offxyq+82], 1 movd xm0, [grain_lutq+left_offxyq] vinserti128 m0, [grain_lutq+left_offxyq+82], 1 movd xm6, [grain_lutq+topleft_offxyq] %if %3 movq xm5, [grain_lutq+top_offxyq] vinserti128 m5, [grain_lutq+top_offxyq+8], 1 %else vinserti128 m6, [grain_lutq+topleft_offxyq+82], 1 movu xm5, [grain_lutq+top_offxyq] vinserti128 m5, [grain_lutq+top_offxyq+82], 1 %endif ; do h interpolation first (so top | top/left -> top, left | cur -> cur) punpcklbw m0, m4 %if %3 punpcklbw xm6, xm5 %else punpcklbw m6, m5 %endif punpcklqdq m0, m6 %if %1 vpbroadcastq m6, [pb_23_22] pmaddubsw m0, m6, m0 %else pmaddubsw m0, m15, m0 %endif pmulhrsw m0, m12 packsswb m0, m0 vpblendd m4, m0, 0x11 %if %3 pshuflw xm0, xm0, q1032 vpblendd m5, m0, 0x01 %else pshuflw m0, m0, q1032 vpblendd m5, m0, 0x11 %endif %else movu m4, [grain_lutq+offxyq] movd xm0, [grain_lutq+left_offxyq] movu m5, [grain_lutq+top_offxyq] movd xm6, [grain_lutq+topleft_offxyq] punpcklbw xm0, xm4 punpcklbw xm6, xm5 punpcklqdq xm0, xm6 %if %1 vpbroadcastq xm6, [pb_27_17_17_27] pmaddubsw xm0, xm6, xm0 %else pmaddubsw xm0, xm15, xm0 %endif pmulhrsw xm0, xm12 packsswb xm0, xm0 vpblendd m4, m0, 0x01 pshuflw xm0, xm0, q1032 vpblendd m5, m0, 0x01 %endif ; followed by v interpolation (top | cur -> cur) %if %3 vpermq m0, m4, q3120 punpcklbw m5, m0 pmaddubsw m5, m13, m5 pmulhrsw m5, m12 vextracti128 xm0, m5, 1 packsswb xm5, xm0 vpblendd m5, m4, 0xf0 %else punpckhbw m0, m5, m4 punpcklbw m5, m4 pmaddubsw m4, m13, m0 pmaddubsw m5, m13, m5 pmulhrsw m4, m12 pmulhrsw m5, m12 packsswb m5, m4 %endif punpcklbw m4, m5, m7 punpckhbw m5, m7 ; noise = round2(scaling[src] * grain, scaling_shift) pmaddubsw m2, m4 pmaddubsw m3, m5 pmulhrsw m2, m9 pmulhrsw m3, m9 ; unpack chroma source punpcklbw m0, m1, m7 punpckhbw m1, m7 ; dst = clip_pixel(src, noise) paddw m0, m2 paddw m1, m3 packuswb m0, m1 pmaxub m0, m10 pminub m0, m11 %if %2 mova [dstq], xm0 vextracti128 [dstq+strideq], m0, 1 %else mova [dstq], m0 %endif %if %2 lea srcq, [srcq+strideq*2] lea dstq, [dstq+strideq*2] lea lumaq, [lumaq+lstrideq*(2<<%3)] %else add srcq, strideq add dstq, strideq add lumaq, lstrideq %endif add grain_lutq, 82<<%2 sub hb, 1+%2 %if %2 jg %%loop_y_h_overlap %else je %%end_y_hv_overlap vpbroadcastd m13, [pb_17_27] add hd, 0x80000000 jnc %%loop_y_hv_overlap jmp %%loop_y_h_overlap %endif %%end_y_hv_overlap: add wq, 32>>%2 jge .end mov srcq, r11mp mov dstq, r12mp lea lumaq, [r14+wq*(1+%2)] add srcq, wq add dstq, wq jmp %%loop_x_hv_overlap %endmacro %%FGUV_32x32xN_LOOP 1, %2, %3 .csfl: %%FGUV_32x32xN_LOOP 0, %2, %3 .end: RET %endmacro GEN_GRAIN_UV_FN 420, 1, 1 FGUV_FN 420, 1, 1 GEN_GRAIN_UV_FN 422, 1, 0 FGUV_FN 422, 1, 0 GEN_GRAIN_UV_FN 444, 0, 0 FGUV_FN 444, 0, 0 %endif ; ARCH_X86_64
31.196395
92
0.495986
47560c4ce0e5ad89d5cc9fcf4bb5cad2a2878096
1,791
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_9_119.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_0x48.log_9_119.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_0x48.log_9_119.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r8 push %r9 push %rbx push %rcx push %rdx // Load lea addresses_WC+0x22f2, %r8 nop nop nop nop nop dec %r10 movups (%r8), %xmm5 vpextrq $0, %xmm5, %r14 nop nop nop add %rbx, %rbx // Store mov $0x2a1, %rbx nop nop nop nop nop and $43894, %r14 mov $0x5152535455565758, %rdx movq %rdx, %xmm6 movups %xmm6, (%rbx) nop nop nop and %r9, %r9 // Store lea addresses_US+0x12cb2, %r10 nop cmp $52601, %rcx movb $0x51, (%r10) nop xor $15866, %r8 // Store lea addresses_WC+0x22f2, %rcx nop nop nop dec %r9 mov $0x5152535455565758, %r8 movq %r8, %xmm5 vmovups %ymm5, (%rcx) nop nop nop nop xor $8111, %r9 // Faulty Load lea addresses_WC+0x22f2, %r10 clflush (%r10) nop nop nop nop sub %rbx, %rbx movb (%r10), %r8b lea oracles, %rdx and $0xff, %r8 shlq $12, %r8 mov (%rdx,%r8,1), %r8 pop %rdx pop %rcx pop %rbx pop %r9 pop %r8 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'58': 9} 58 58 58 58 58 58 58 58 58 */
17.057143
121
0.635958
3e9824f1320be541e5015a3dc312400df638c907
487
asm
Assembly
bootloader/boot.asm
llGuy/lGkn
a4ae1bafa50b73b7dc497094287e0939c9c29afc
[ "MIT" ]
1
2021-04-04T22:36:32.000Z
2021-04-04T22:36:32.000Z
bootloader/boot.asm
llGuy/lGkn
a4ae1bafa50b73b7dc497094287e0939c9c29afc
[ "MIT" ]
null
null
null
bootloader/boot.asm
llGuy/lGkn
a4ae1bafa50b73b7dc497094287e0939c9c29afc
[ "MIT" ]
null
null
null
;; Tell NASM this is 16-bit mode bits 16 ;; Load at address 0x7c00 org 0x7c00 boot: ;; Point si to hello label mov si, hello ;; 0x0e = Write Character in TTY mode mov ah, 0x0e .loop: mov al, byte [si] or al, al jz halt int 0x10 inc si jmp .loop halt: ;; Clear interrupts cli ;; Halt hlt hello: db "Hello World!", 0 ;; Pad remaining 510 bytes with zeroes times 510 - ($-$$) db 0 ;; Magic bootloader - marks this 512 byte sector as bootable dw 0xaa55
15.709677
60
0.646817
a87416c9397d5bcec07274fa481e4c47011ec9ce
226
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_acos.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_acos.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_acos.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; float acos(float x) SECTION code_fp_math48 PUBLIC cm48_sdcciy_acos EXTERN cm48_sdcciy_acos_fastcall cm48_sdcciy_acos: pop af pop hl pop de push de push hl push af jp cm48_sdcciy_acos_fastcall
10.761905
32
0.730088
40506682b88eb468b7a4bba259340ada0328cbb7
2,537
asm
Assembly
scripts/SilphCo10F.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
scripts/SilphCo10F.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
scripts/SilphCo10F.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
SilphCo10F_Script: call SilphCo10Script_5a14f call EnableAutoTextBoxDrawing ld hl, SilphCo10TrainerHeader0 ld de, SilphCo10F_ScriptPointers ld a, [wSilphCo10FCurScript] call ExecuteCurMapScriptInTable ld [wSilphCo10FCurScript], a ret SilphCo10Script_5a14f: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] ret z ld hl, SilphCo10GateCoords call SilphCo2Script_59d43 call SilphCo10Text_5a176 CheckEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret nz ld a, $54 ld [wNewTileBlockID], a lb bc, 4, 5 predef_jump ReplaceTileBlock SilphCo10GateCoords: db $04,$05 db $FF SilphCo10Text_5a176: ld a, [$ffe0] and a ret z SetEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret SilphCo10F_ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle SilphCo10F_TextPointers: dw SilphCo10Text1 dw SilphCo10Text2 dw SilphCo10Text3 dw PickUpItemText dw PickUpItemText dw PickUpItemText SilphCo10TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_0 dw SilphCo10BattleText1 ; TextBeforeBattle dw SilphCo10AfterBattleText1 ; TextAfterBattle dw SilphCo10EndBattleText1 ; TextEndBattle dw SilphCo10EndBattleText1 ; TextEndBattle SilphCo10TrainerHeader1: dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_1 dw SilphCo10BattleText2 ; TextBeforeBattle dw SilphCo10AfterBattleText2 ; TextAfterBattle dw SilphCo10EndBattleText2 ; TextEndBattle dw SilphCo10EndBattleText2 ; TextEndBattle db $ff SilphCo10Text1: TX_ASM ld hl, SilphCo10TrainerHeader0 call TalkToTrainer jp TextScriptEnd SilphCo10Text2: TX_ASM ld hl, SilphCo10TrainerHeader1 call TalkToTrainer jp TextScriptEnd SilphCo10Text3: TX_ASM CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo10Text_5a1d8 jr nz, .asm_cf85f ld hl, SilphCo10Text_5a1d3 .asm_cf85f call PrintText jp TextScriptEnd SilphCo10Text_5a1d3: TX_FAR _SilphCo10Text_5a1d3 db "@" SilphCo10Text_5a1d8: TX_FAR _SilphCo10Text_5a1d8 db "@" SilphCo10BattleText1: TX_FAR _SilphCo10BattleText1 db "@" SilphCo10EndBattleText1: TX_FAR _SilphCo10EndBattleText1 db "@" SilphCo10AfterBattleText1: TX_FAR _SilphCo10AfterBattleText1 db "@" SilphCo10BattleText2: TX_FAR _SilphCo10BattleText2 db "@" SilphCo10EndBattleText2: TX_FAR _SilphCo10EndBattleText2 db "@" SilphCo10AfterBattleText2: TX_FAR _SilphCo10AfterBattleText2 db "@"
20.626016
53
0.829326
2ea772ca12527b336285d5e08ab06ce1c8e18c9c
2,638
asm
Assembly
src/ppu/palette.asm
freem/nes_corelib
a890aa3c436e931a765866265f24ccf3c432f71d
[ "0BSD" ]
16
2015-06-23T03:17:40.000Z
2021-10-05T23:40:28.000Z
nes_corelib/src/ppu/palette.asm
master-g/childhood
7cd2a6a13f7e862df6d239e78371df6222b30a53
[ "Apache-2.0" ]
null
null
null
nes_corelib/src/ppu/palette.asm
master-g/childhood
7cd2a6a13f7e862df6d239e78371df6222b30a53
[ "Apache-2.0" ]
3
2015-11-12T01:29:55.000Z
2020-07-06T05:15:06.000Z
; File: ppu/palette.asm ; PPU functionality, focusing specifically on Palettes. ;==============================================================================; ; [Quick Overview] ; > Palette Register Routines ; (uses $3F00 writes; rendering should|must be off) ; - ppu_clearPal Resets entire palette to black ($0f). ; - ppu_XferFullPalToPPU Transfers 32 bytes into PPU palette. ; > Palette Buffer Routines ; (uses the space at $03E0-$03FF; transferred to PPU in vblank) ; - ppu_palBufToPPU Transfers data from the Palette Buffer to the PPU. ;==[Palette Register Routines]=================================================; ; Routine: ppu_clearPal ; Resets the entire palette to black ($0F) using the PPU addresses. ; ; *RENDERING MUST BE OFF FOR THIS TO HAVE A CHANCE AT WORKING!* ; ; (usually only used at boot, but useful if you need to blank all pals) ppu_clearPal: ldy #$3f ldx #$00 jsr ppu_setAddr lda #$0f ldx #$20 @loop: sta PPU_DATA dex bne @loop rts ;------------------------------------------------------------------------------; ; Routine: ppu_XferFullPalToPPU ; Transfers 32 bytes of palette data to the PPU via $3F00. ; ; *RENDERING MUST BE OFF FOR THIS TO HAVE A CHANCE AT WORKING!* ; ; Parameters: ; - *tmp00* - Address low byte ; - *tmp01* - Address high byte ppu_XferFullPalToPPU: ldx #$3f ldy #$00 stx PPU_ADDR sty PPU_ADDR ; set PPUADDR to $3F00 (palettes) ldy #$00 @loop: lda (tmp00),y ; load pal data byte sta PPU_DATA ; store in pal data iny cpy #$20 ; 32 bytes bne @loop rts ;==[Palette Buffer Routines]===================================================; ; Routine: ppu_palBufToPPU ; Transfers data from the Palette Buffer to the PPU. ; Clobbers A,X,Y. Best used during VBlank. ppu_palBufToPPU: lda #$3F ldx #$00 sta PPU_ADDR stx PPU_ADDR ldy #0 @loop: lda palBufData,y sta PPU_DATA iny cpy #$20 bne @loop rts ;------------------------------------------------------------------------------; ; Routine: ppu_dataToPalBuf ; Transfer a set of bytes to the palette buffer. ; ; Parameters: ; - *A* - number of bytes to transfer ; - *X* - position in palette buffer to begin writing at ; - *tmp00* - data location hi ; - *tmp01* - data location lo ppu_dataToPalBuf: sta tmp02 ldy #0 @loop: lda (tmp00),y sta palBufData,x inx ; next position in pal buffer iny ; next position in pal data cpy tmp02 ; check if we've reached the end bne @loop rts ;------------------------------------------------------------------------------;
23.553571
81
0.559136
4f5ae3d5f2d7d3e9bdd8596424aff27418993fde
1,799
asm
Assembly
programs/oeis/282/A282464.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/282/A282464.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/282/A282464.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A282464: a(n) = Sum_{i=0..n} i*Fibonacci(i)^2. ; 0,1,3,15,51,176,560,1743,5271,15675,45925,133056,381888,1087645,3077451,8658951,24245655,67602608,187789616,519924075,1435228575,3951341811,10852291273,29740435200,81340229376,222058995001,605201766675,1646862596223,4474969884411,12143482353200,32912199201200,89097846032391,240938809215783,650886261792555,1756665546374701,4736779407792576,12761734198173120,34354938719776213,92414567039133531,248416702098509175,667307873281070175,1791395980117845296,4806074920167221168,12886524277294940835,34533389549356213551,92493623786778414051,247607528421354558865,662529121892407139328,1771920271890856958976,4736852837270012160625,12657561235753734691875,33808978714005008999151,90269895442468188388803,240929121378006427333040,642802189449164811024176,1714403195477722286815551,4570899921751091175236535,12182848395568584335260443,32460808217566671993829621,86464513289174429039716800,230244379793473597142500800,612938633489754311045837581,1631269894727796199951987563,4340296165451146932023000295,11545195571846175661798662951,30702596345991460607205062576,81628933883619916755631096880,216975920761439340893299870683,576607634352919549029288870591,1531981684697412584276016165075,4069432720987376594938087540825,10807467679608799095874780782336,28696328620623207987556529864448,76180441889269304856069099661225,202198409865425959253603366611251,536576102454723850934324501798751,1423660428923650174965168046171275,3776635463843225140178989857248048,10016806269762116062809434279785136,26563233987384397033744401024211575,70430687311058806177671400164949575,186712752159853940931517605544833291,494901550192021043774377203320038333 lpb $0 mov $2,$0 sub $0,1 seq $2,169630 ; a(n) = n times the square of Fibonacci(n). add $1,$2 lpe mov $0,$1
163.545455
1,631
0.912173
4189736445a439c66e7d1e1fdb2910150309b257
707
asm
Assembly
tests/assembly/INC.asm
danecreekphotography/6502ts
85716cf12f879d7c16c297de3251888c32abba6a
[ "MIT" ]
null
null
null
tests/assembly/INC.asm
danecreekphotography/6502ts
85716cf12f879d7c16c297de3251888c32abba6a
[ "MIT" ]
null
null
null
tests/assembly/INC.asm
danecreekphotography/6502ts
85716cf12f879d7c16c297de3251888c32abba6a
[ "MIT" ]
null
null
null
; Verifies INC .segment "VECTORS" .word $eaea .word init .word $eaea .segment "ZEROPAGE" ; Used for zero page address mode testing zp: .byte %00000000 .byte $FF .byte %01111111 zpx: .byte $00 ; Padding .byte %00000000 .byte $FF .byte %01111111 .code init: inc zp inc zp + 1 inc zp + 2 inc zpx,x ; x will be $01 inc zpx,x ; x will be $02 inc zpx,x ; x will be $03 inc data inc data + 1 inc data + 2 inc datax,x ; x will be $01 inc datax,x ; x will be $02 inc datax,x ; x will be $03 .segment "DATA" data: .byte %00000000 .byte $FF .byte %01111111 datax: .byte $00 ; Padding .byte %00000000 .byte $FF .byte %01111111
13.092593
41
0.591231
52583ec203703475a74641131c98481fd85eb8e9
1,310
asm
Assembly
sysinfo/vxd/Ctrl.asm
XULPlayer/XULPlayer-legacy
1ab0ad2a196373d81d350bf45c03f690a0bfb8a2
[ "MIT" ]
3
2017-11-29T07:11:24.000Z
2020-03-03T19:23:33.000Z
sysinfo/vxd/Ctrl.asm
XULPlayer/XULPlayer-legacy
1ab0ad2a196373d81d350bf45c03f690a0bfb8a2
[ "MIT" ]
null
null
null
sysinfo/vxd/Ctrl.asm
XULPlayer/XULPlayer-legacy
1ab0ad2a196373d81d350bf45c03f690a0bfb8a2
[ "MIT" ]
1
2018-07-12T12:48:52.000Z
2018-07-12T12:48:52.000Z
;============================================================================ ; ;PCI BIOS, Memory , Interrupt handle VxD ; for windows 95/98 ; ; ver 1.0 kashiwano masahiro ;============================================================================ WIN40COMPAT EQU 1 PAGE 58,132 .386p .xlist include vmm.inc .list ;============================================================================ ; V I R T U A L D E V I C E D E C L A R A T I O N ;============================================================================ DECLARE_VIRTUAL_DEVICE SysInfo, 1, 0, PCIDBG_Control, Undefined_Device_ID, UNDEFINED_INIT_ORDER, 0 ,0 ;============================================================================ ; PCIDBG_Control ;============================================================================ VxD_LOCKED_CODE_SEG BeginProc PCIDBG_Control Control_Dispatch SYS_DYNAMIC_DEVICE_INIT, Dynamic_Init, sCall Control_Dispatch SYS_DYNAMIC_DEVICE_EXIT, Dynamic_Exit, sCall Control_Dispatch W32_DEVICEIOCONTROL, W32_DeviceIOControl, sCall, <ecx, ebx, edx, esi> clc ret EndProc PCIDBG_Control public C Exec_VxD_Int_rap Exec_VxD_Int_rap proc push dword ptr 1ah VmmCall Exec_VxD_Int ret Exec_VxD_Int_rap endp VxD_LOCKED_CODE_ENDS end
25.192308
101
0.470229
f17e33a4d63c5c7a5d3b3cc43d2723f60361c7b8
15,120
asm
Assembly
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/cifft32_scale.asm
HeroSizy/Sizy
89bc29940dc7666591259730b5112efd0a626043
[ "Unlicense" ]
null
null
null
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/cifft32_scale.asm
HeroSizy/Sizy
89bc29940dc7666591259730b5112efd0a626043
[ "Unlicense" ]
null
null
null
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/cifft32_scale.asm
HeroSizy/Sizy
89bc29940dc7666591259730b5112efd0a626043
[ "Unlicense" ]
null
null
null
;*********************************************************** ; Version 2.40.00 ;*********************************************************** ; Processor: C55xx ; Description: 32-bit radix-2 DIT complex iFFT using normal input data ; and bit-reversed twiddle table (length N/2, cosine/sine format) ; First two stages are separately implmented for MIPS optimization. ; Usage: void cifft32_SCALE (DATA *xy, ushort nx); ; Copyright Texas instruments Inc, 2002 ; History: ; 08/19/2002 Li Yuan ; - Changed || to :: in several dual MAC instructions ;**************************************************************** ;----------------------------------------------------------------------- ; Arguments passed to _ifft ; ; ar0 -> ifftdata pointer ; t0 -> ifft size ; ;----------------------------------------------------------------------- ;//----------------------------------------------------------------------------- ;// Array declarations ;//----------------------------------------------------------------------------- ; .include "twiddle32.inc" .ref twiddle32 .def _cifft32_SCALE ; make function visible to other fnct .cpl_on .arms_off ; disable assembler for arms mode .mmregs .noremark 5579, 5573 ; Stack frame ; ----------- RET_ADDR_SZ .set 1 ;return address REG_SAVE_SZ .set 0 ;save-on-entry registers saved FRAME_SZ .set 2 ;local variables ARG_BLK_SZ .set 0 ;argument block PARAM_OFFSET .set ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ + RET_ADDR_SZ ; Local variables ; -------------- .asg 0, data_ptr .asg 1, data_sz .text _cifft32_SCALE ;---------------------------------------------------------------- ; Conditional compile ;---------------------------------------------------------------- SCALED .set 1 ; SCALED = 0 - not scaled version ; SCALED = 1 - scaled version ;---------------------------------------------------------------- ; Save any save-on-entry registers that are used ;---------------------------------------------------------------- PSH mmap(ST0_55) PSH mmap(ST1_55) PSH mmap(ST2_55) PSH mmap(ST3_55) PSH T2 PSH T3 PSHBOTH XAR5 PSHBOTH XAR6 PSHBOTH XAR7 ;---------------------------------------------------------------- ; Allocate the local frame and argument block ;---------------------------------------------------------------- AADD #-(ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ), SP ;---------------------------------------------------------------- ; Save entry values for later ;---------------------------------------------------------------- MOV AR0, *sp(data_ptr) ; MOV T0, *sp(data_sz) ; ;----------------------------------------------------------------------- ; iFFT implementation ; ; The iFFT is implemented in 5 different steps: ; ; 1) - a radix-2 stage without any multiplications. ; 2) - a radix-2 stage with two groups, only the 2nd group has ; multiplications with 0x7FFFFFFH and 0x00000000 ; 3) - a group of log2(iFFT_SIZE)-3 radix-2 stages ; 4) - a radix-2 stage without scaling. ; 5) - on out-of-place bit-reversal ;----------------------------------------------------------------------- ;----------------------------------------------------------------------- ; Modification of status registers ;----------------------------------------------------------------------- BSET #FRCT, ST1_55 BCLR #ARMS, ST2_55 BCLR #C54CM, ST1_55 BSET SXMD BCLR SATD BSET M40 ; Define CSR for scaling loop SUB #1, T0, T1 MOV T1, BRC0 ; BRC0 = ifftsize - 1 MOV XAR0,XAR1 ;----------------------------------------------------------------------- ; Scaling loop: Data scaled by 2 before first stage ;----------------------------------------------------------------------- RPTBLOCAL scaling MOV dbl(*AR1+), AC0 MOV dbl(*AR1-), AC1 || SFTS AC0,#-1 SFTS AC1,#-1 || MOV AC0, dbl(*AR1+) scaling:MOV AC1, dbl(*AR1+) ;----------------------------------------------------------------------- ; Radix-2 stage 1 ;----------------------------------------------------------------------- MOV AR0,AR1 ; AR0->ifft_data (a) ADD T0,AR1 ; AR1->ifft_data+n2 (b) MOV XAR1,XAR2 ADD T0,AR2 ; AR2->ifft_data+2*n2(c) MOV XAR2,XAR3 ADD T0,AR3 ; AR3->ifft_data+3*n2(d) MOV XAR2,XAR7 SFTS T0,#-1 ; T0=ifft-size/2 SUB #1,T0,T1 ; T1=ifft_size/2-1 MOV T1,BRC0 ;----------------------------------------------------------------------- ; Benchmark: 10 cycles for this loop ;----------------------------------------------------------------------- RPTBLOCAL stage1 MOV dbl(*AR0+),AC0 ADD dbl(*AR7),AC0,AC1 ; AC1=AR+CR SUB dbl(*AR7+),AC0 ; AC0=AR-CR MOV dbl(*AR0-),AC2 || SFTS AC1,#-1 ADD dbl(*AR7),AC2,AC3 ; AC3=AI+CI SUB dbl(*AR7-),AC2 ; AC2=AI-CI SFTS AC0,#-1 || MOV AC1,dbl(*AR0+) ;(AR+CR)>>1->AR SFTS AC2,#-1 || MOV AC0,dbl(*AR7+) ;(AR-CR)>>1->CR SFTS AC3,#-1 || MOV AC2,dbl(*AR7+) ;(AI-CI)>>1->CI stage1: MOV AC3,dbl(*AR0+) ;(AI+CI)>>1->AI ;----------------------------------------------------------------------- ; Radix-2 stage2 ;----------------------------------------------------------------------- MOV *sp(data_ptr), AR0 || SFTS T0,#-1 SUB #1,T0,T1 ;T0=ifft_size/4 MOV T1,BRC0 ;T1=ifft_size/4-1 ;----------------------------------------------------------------------- ; Benchmark: 10 cycles for group1 ;----------------------------------------------------------------------- RPTBLOCAL group1 MOV dbl(*AR0+),AC0 ADD dbl(*AR1),AC0,AC1 ; AC1=AR+BR SUB dbl(*AR1+),AC0 ; AC0=AR-BR SFTS AC1,#-1 || MOV dbl(*AR0-),AC2 ADD dbl(*AR1),AC2,AC3 ; AC3=AI+BI SUB dbl(*AR1-),AC2 ; AC2=AI-BI SFTS AC0,#-1 || MOV AC1,dbl(*AR0+) ; AR+BR->AR SFTS AC2,#-1 || MOV AC0,dbl(*AR1+) ; AR-BR->BR SFTS AC3,#-1 || MOV AC2,dbl(*AR1+) ; AI-BI->BI group1: MOV AC3,dbl(*AR0+) ; AI+BI->AI ;----------------------------------------------------------------------- ; Benchmark: 13 cycles for group2 ;----------------------------------------------------------------------- MOV T1,BRC0 AMOV #twiddle32, XCDP MOV XAR3, XAR4 ADD #3,AR4 ; AR4->DI_LOW RPTBLOCAL group2 AMAR *AR3+ ; AR3->DR_LOW MPY uns(*AR3-),*CDP+,AC0 ;DR_LOW * 7FFF AR3->DR_HI CDP->FFFF :: MPY uns(*AR4-),*CDP+,AC1 ;DI_LOW * 7FFF AR4->DI_HI MAC *AR3,uns(*CDP-),AC0 ;DR_HI*FFFF+DR_LOW*7FFF, AR3->DR_HI CDP->7FFF :: MAC *AR4,uns(*CDP-),AC1 ;DI_HI*FFFF+DI_LOW*7FFF, AR4->DI_HI MAC *AR3,*CDP,AC0>>#16 ;DR_HI*7FFF+AC0>>16 AR3->DR_HI CDP_>7FFF :: MAC *AR4,*CDP,AC1>>#16 ;DI_HI*7FFF+AC1>>16 AR4->DI_HI CDP_>7FFF SUB AC1,dbl(*AR2),AC2 ;AC2=CR-AC1 ADD dbl(*AR2+),AC1 ;AC1=CR+AC1 AR2->CI SUB AC0,dbl(*AR2),AC3 ;AC3=CI-AC0 ADD dbl(*AR2-),AC0 ;AC0=CI+AC0 AR2->CR SFTS AC1,#-1 || ADD #5, AR4 ; AR4->DI(next) SFTS AC3,#-1 || MOV AC1,dbl(*AR3+) ;AC1->DR AR3->DI SFTS AC2,#-1 || MOV AC3,dbl(*AR3+) ;AC3->DI AR3->DR(next) SFTS AC0,#-1 || MOV AC2,dbl(*AR2+) ;AC2->CR AR2->CI group2: MOV AC0,dbl(*AR2+) ;AC0->CI AR2->CR(next) ;----------------------------------------------------------------------- ; End of stage 1 and 2 ;----------------------------------------------------------------------- SFTS T0,#-1 BCC end_benchmark, T0==#0 ;----------------------------------------------------------------------- ; radix-2 stages (stages 3->log2(iFFT_SIZE) ) ; register usage ; ar0->Pr, ar1->Qr, ar3->twiddle32 ; ar4=Re distance of butterfly ; ar6=group count, t1=butterfly count, ar5= stage count ;----------------------------------------------------------------------- ; main initialization ; modify ST2 to select linear or circular addressing modes OR #0x3 , mmap(ST2_55) ; circular ar0,ar1 MOV *sp(data_ptr), AR1 ; ar1 = #ifftdata ; circular buffer starting addresses MOV mmap(@AR1),bsa01 ; circular buffer start address ; circular buffer sizes MPYMK *sp(data_sz),#2,AC0 ; because FRCT==1, it actually x4 MOV mmap(@AC0_L), bk03 ; bk03 = (4*iFFT_SIZE-4), ar0-ar3 MOV *sp(data_sz), T2 SFTS T2,#-1 ; T2 = iFFT_SIZE/2 || MOV #4, AR6 ; AR6 = group MOV T2,AR4 ; AR4 = iFFT_SIZE/2(Re distance between p q) MOV T0,T1 ; T1 = iFFT_SIZE/8, nbfly SFTS T0,#-1 ; T0=size/16 || MOV #-2, T2 MOV T0, AR5 ; AR5 is stage count MOV #2,T0 AMOV #twiddle32, XAR3 BCC last_stage, AR5==#0 ;----------------------------------------------------------------------- ; Beginning of the stage loop ; stage iniac1alizaac1on ;----------------------------------------------------------------------- stage: ; stage loop counter updates SFTS AR5,#-1 ; shift right stage count MOV #0,AR0 || MOV AR3, CDP ADD #1,AR4,AR1 ;AR1->QR_LOW ; butterfly counter update SUB #1,T1,T3 MOV T3, BRC1 ; group counter update SUB #1,AR6,T3 MOV T3, BRC0 RPTB group ;----------------------------------------------------------------------- ; Benchmark: 15 cycles for butterfly loop ;----------------------------------------------------------------------- rptb BFly ; (ar1,cdp) mpy uns(*ar1), *(cdp+t0), ac0 ; ac0 = yrl*crh (1,0) :: mpy uns(*ar1(t0)), *(cdp+t0), ac1 ; ac1 = yil*crh (3,0) mas uns(*ar1(t0)), *cdp+, ac0 ; ac0 -= yil*cih (3,2) :: mac uns(*ar1+), *cdp+, ac1 ; ac1 += yrl*cih (1,2) || swap t0, t2 ; t0=-2 mas *ar1, uns(*(cdp+t0)), ac0 ; ac0 -= yih*cil (2,3) :: mac *ar1(t0), uns(*(cdp+t0)), ac1 ; ac1 += yrh*cil (0,3) mac *ar1(t0), uns(*cdp-), ac0 ; ac0 += yrh*crl (0,1) :: mac *(ar1+t0), uns(*cdp-), ac1 ; ac1 += yih*crl (2,1) || swap t0, t2 ; t0=2 mac *ar1, *(cdp+t0), ac0>>#16 ; ac0 += yrh*crh (0,0) :: mac *ar1(t0), *(cdp+t0), ac1>>#16 ; ac1 += yih*crh (2,0) mas *ar1(t0), *(cdp+t0), ac0 ; ac0 -= yih*cih (2,2) :: mac *ar1, *(cdp+t0), ac1 ; ac1 += yrh*cih (0,2) add dbl(*ar0), ac0,ac2 sfts ac2, #-1 || mar *cdp- mov ac2,dbl(*ar0) ; new xr=ac0+xr (0,4) || sub ac0,dbl(*ar0+),ac3 ; (0,4) sfts ac3, #-1 || mar *cdp- mov ac3, dbl(*ar1+) ; new yr=xr-ac0 (2,4) || sub ac1,dbl(*ar0), ac2 sfts ac2, #-1 || mar *cdp- mov ac2, dbl(*ar1+) ; new yi=xi-ac1 (2,4) || add dbl(*ar0),ac1,ac3 ; (4,4) sfts ac3, #-1 || mar *cdp- BFly: mov ac3, dbl(*ar0+) ; new xi=xi+ac1 || add #1, ar1 ; (4,4) ADD AR4, AR0 ;jump to next group ADD AR4, AR1 group: AMAR *+CDP(4) ;CDP+4 SFTS AR6,#1 ;group<<1 SFTS T1,#-1 ;butterfly>>1 SFTS AR4,#-1 ;P Q distance>>1 BCC stage,AR5!=#0 ;----------------------------------------------------------------------- ; END radix-2 stages (stages 3->log2(iFFT_SIZE) ) ;----------------------------------------------------------------------- ;----------------------------------------------------------------------- ; Last stage ;----------------------------------------------------------------------- last_stage: ; stage initialization MOV #0,AR0 MOV AR3, CDP MOV #5,AR1 ;AR1->QR_LOW ; group counter update SUB #1,AR6,T3 MOV T3, BRC0 RPTB lgroup mpy uns(*ar1), *(cdp+t0), ac0 ; ac0 = yrl*crh (1,0) :: mpy uns(*ar1(t0)), *(cdp+t0), ac1 ; ac1 = yil*crh (3,0) mas uns(*ar1(t0)), *cdp+, ac0 ; ac0 -= yil*cih (3,2) :: mac uns(*ar1+), *cdp+, ac1 ; ac1 += yrl*cih (1,2) || swap t0, t2 ; t0=-2 mas *ar1, uns(*(cdp+t0)), ac0 ; ac0 -= yih*cil (2,3) :: mac *ar1(t0), uns(*(cdp+t0)), ac1 ; ac1 += yrh*cil (0,3) mac *ar1(t0), uns(*cdp-), ac0 ; ac0 += yrh*crl (0,1) :: mac *(ar1+t0), uns(*cdp-), ac1 ; ac1 += yih*crl (2,1) || swap t0, t2 ; t0=2 mac *ar1, *(cdp+t0), ac0>>#16 ; ac0 += yrh*crh (0,0) :: mac *ar1(t0), *(cdp+t0), ac1>>#16 ; ac1 += yih*crh (2,0) mas *ar1(t0), *(cdp+t0), ac0 ; ac0 -= yih*cih (2,2) :: mac *ar1, *(cdp+t0), ac1 ; ac1 += yrh*cih (0,2) add dbl(*ar0), ac0,ac2 mov ac2,dbl(*ar0) ; new xr=ac0+xr (0,4) || sub ac0,dbl(*ar0+),ac3 ; (0,4) mov ac3, dbl(*ar1+) ; new yr=xr-ac0 (2,4) || sub ac1,dbl(*ar0), ac2 mov ac2, dbl(*ar1+) ; new yi=xi-ac1 (2,4) || add dbl(*ar0),ac1,ac3 ; (4,4) mov ac3, dbl(*ar0+) ; new xi=xi+ac1 || add #5, ar1 ; (4,4) lgroup: add #4, ar0 ; jump to next group ;----------------------------------------------------------------------- ; END last stage ;----------------------------------------------------------------------- end_benchmark: ;----------------------------------------------------------------------- ; Allocate the local frame and argument block ;---------------------------------------------------------------- AADD #(ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ), SP ;Context restore POPBOTH XAR7 POPBOTH XAR6 POPBOTH XAR5 POP T3 POP T2 POP mmap(ST3_55) POP mmap(ST2_55) POP mmap(ST1_55) POP mmap(ST0_55) RET .end
37.425743
97
0.368452
6b1e2dff18bcb52c895a9583439862dc75287101
3,346
asm
Assembly
src/thunk_amd64_gcc.asm
fengjixuchui/protolesshooks
7cb9aeeef7e36939663b015dfa7977809fbaa566
[ "MIT" ]
112
2020-05-07T09:54:13.000Z
2022-03-22T10:01:00.000Z
src/thunk_amd64_gcc.asm
fengjixuchui/protolesshooks
7cb9aeeef7e36939663b015dfa7977809fbaa566
[ "MIT" ]
3
2019-04-19T19:20:59.000Z
2021-07-16T10:08:05.000Z
src/thunk_amd64_gcc.asm
vovkos/protolesshooks
19145c1e9428d29b35c1e3dcda66309eb72c7c0f
[ "MIT" ]
28
2020-05-09T18:55:26.000Z
2022-02-18T01:58:56.000Z
section .text ; reg-ret-block: 2 gp regs + 2 xmm reg ; reg-arg-block: 6 gp regs + 8 xmm regs RegRetBlockSize equ 2 * 8 + 2 * 16 RegArgBlockSize equ 6 * 8 + 8 * 16 StackFrameSize equ RegRetBlockSize + RegArgBlockSize HookAction_Return equ 1 HookAction_JumpTarget equ 2 extern targetFunc extern hook extern hookEnter extern hookLeave extern hookRet thunk_entry: ; standard prologue (leaves rsp & rpb 16-byte aligned) push rbp mov rbp, rsp sub rsp, StackFrameSize ; save all arg registers (xmm must be 16-byte aligned) movdqa [rbp - 16 * 1], xmm7 movdqa [rbp - 16 * 2], xmm6 movdqa [rbp - 16 * 3], xmm5 movdqa [rbp - 16 * 4], xmm4 movdqa [rbp - 16 * 5], xmm3 movdqa [rbp - 16 * 6], xmm2 movdqa [rbp - 16 * 7], xmm1 movdqa [rbp - 16 * 8], xmm0 mov [rbp - 16 * 8 - 8 * 1], r9 mov [rbp - 16 * 8 - 8 * 2], r8 mov [rbp - 16 * 8 - 8 * 3], rcx mov [rbp - 16 * 8 - 8 * 4], rdx mov [rbp - 16 * 8 - 8 * 5], rsi mov [rbp - 16 * 8 - 8 * 6], rdi ; call the hook-enter function mov rdi, hook mov rsi, rbp mov rdx, [rbp + 8] mov rax, hookEnter call rax ; rax now holds hook action test rax, HookAction_Return jnz ret_now ; restore all arg registers movdqa xmm7, [rbp - 16 * 1] movdqa xmm6, [rbp - 16 * 2] movdqa xmm5, [rbp - 16 * 3] movdqa xmm4, [rbp - 16 * 4] movdqa xmm3, [rbp - 16 * 5] movdqa xmm2, [rbp - 16 * 6] movdqa xmm1, [rbp - 16 * 7] movdqa xmm0, [rbp - 16 * 8] mov r9, [rbp - 16 * 8 - 8 * 1] mov r8, [rbp - 16 * 8 - 8 * 2] mov rcx, [rbp - 16 * 8 - 8 * 3] mov rdx, [rbp - 16 * 8 - 8 * 4] mov rsi, [rbp - 16 * 8 - 8 * 5] mov rdi, [rbp - 16 * 8 - 8 * 6] ; undo prologue add rsp, StackFrameSize pop rbp ; skip the exit hook? test rax, HookAction_JumpTarget jnz jump_target ; replace return pointer mov rax, hookRet mov [rsp], rax jump_target: ; jump to target function mov rax, targetFunc jmp rax ret_now: ; grab retval regs from the reg-ret-block movdqa xmm1, [rbp - RegArgBlockSize - 16 * 1] movdqa xmm0, [rbp - RegArgBlockSize - 16 * 2] mov rdx, [rbp - RegArgBlockSize - 16 * 2 - 8 * 1] mov rax, [rbp - RegArgBlockSize - 16 * 2 - 8 * 2] ; standard epilogue add rsp, StackFrameSize pop rbp ret hook_ret: ; rax now holds the original retval ; re-create our stack frame (compensating ret from targetFunc) sub rsp, 8 ; <<< hookRet push rbp mov rbp, rsp sub rsp, StackFrameSize ; save the original retval movdqa [rbp - RegArgBlockSize - 16 * 1], xmm1 movdqa [rbp - RegArgBlockSize - 16 * 2], xmm0 mov [rbp - RegArgBlockSize - 16 * 2 - 8 * 1], rdx mov [rbp - RegArgBlockSize - 16 * 2 - 8 * 2], rax ; call the hook-leave function mov rdi, hook mov rsi, rbp mov rdx, rax mov rax, hookLeave call rax ; rax now holds the original return pointer ; restore the original return pointer and retval regs mov [rbp + 8], rax movdqa xmm1, [rbp - RegArgBlockSize - 16 * 1] movdqa xmm0, [rbp - RegArgBlockSize - 16 * 2] mov rdx, [rbp - RegArgBlockSize - 16 * 2 - 8 * 1] mov rax, [rbp - RegArgBlockSize - 16 * 2 - 8 * 2] ; standard epilogue add rsp, StackFrameSize pop rbp ret
21.869281
63
0.588763
a28f4b9f79f01a196c2643a3eb5f3c8935d009f8
928
asm
Assembly
proj/2018-2019/run/linux.asm
Keyaku/ist-comp-projects
2ab0edec6d6766aa9e7fec58e442b4321408401d
[ "MIT" ]
null
null
null
proj/2018-2019/run/linux.asm
Keyaku/ist-comp-projects
2ab0edec6d6766aa9e7fec58e442b4321408401d
[ "MIT" ]
null
null
null
proj/2018-2019/run/linux.asm
Keyaku/ist-comp-projects
2ab0edec6d6766aa9e7fec58e442b4321408401d
[ "MIT" ]
null
null
null
section .bss $buf2 resb 2 section .text global _prints, _readb, _exit, _start extern _env, _strlen, _entry _prints: push dword [esp+4] ; pushd 'prints' first argument call _strlen mov edx, eax pop ecx ; pop-it back, instead of 'add esp,4' and 'mov ecx, [esp+4]' mov eax, 4 mov ebx, 1 int 0x80 ret _readb: push ebx push ecx push edx mov edx, 1 mov ecx, $buf2 mov ebx, 0 mov eax, 3 int 0x80 cmp eax, 1 jne .Lret xor eax, eax mov al, [$buf2] .Lret: pop edx pop ecx pop ebx ret _start: mov [$_env], esp mov eax, [esp] ; argc lea ebx, [esp+4] ; argv lea edx, [ebx+eax*4]; &(argv[argc]) add edx, 4 ; envp push dword 0 mov ebp, esp ; init frame pointer push edx push ebx push eax ; truncate real to integer conversions fstcw word [buf2] or word [buf2], 0x0C00 fldcw word [buf2] ; start program call _entry push eax call _exit _exit: mov ebx, [esp+4] .L0: mov eax, 1 int 0x80 jmp .L0
15.466667
70
0.663793
994aaee6443deb6bb70596427b259ce39e1aa3a7
207
asm
Assembly
new_bbc_bringup/flasher/flash_rom.asm
cclauss/myelin-acorn-electron-hardware
8df28d4fb7a39567fdee5a3b765ecdecacbc276e
[ "Apache-2.0" ]
42
2017-04-22T06:37:00.000Z
2022-03-30T07:23:13.000Z
new_bbc_bringup/flasher/flash_rom.asm
cclauss/myelin-acorn-electron-hardware
8df28d4fb7a39567fdee5a3b765ecdecacbc276e
[ "Apache-2.0" ]
6
2018-01-05T16:28:29.000Z
2019-01-15T05:57:49.000Z
new_bbc_bringup/flasher/flash_rom.asm
cclauss/myelin-acorn-electron-hardware
8df28d4fb7a39567fdee5a3b765ecdecacbc276e
[ "Apache-2.0" ]
20
2017-04-24T01:35:12.000Z
2022-01-06T13:49:09.000Z
; Actually program something into the flash PROGRAM_ROM = 1 ; Read bank ID from here (written by Makefile) INCLUDE "bank_to_program.inc" INCLUDE "common.asm" SAVE "flash_rom.bin", entry_point, end_of_code
23
46
0.782609
5e058c668f2fe5f36c6167d5b085a55bc748ea3d
560
asm
Assembly
oeis/017/A017726.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017726.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017726.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017726: Binomial coefficients C(n,62). ; 1,63,2016,43680,720720,9657648,109453344,1078897248,9440350920,74473879480,536211932256,3558497368608,21944067106416,126600387152400,687259244541600,3527930788646880,17198662594653540,79923196763389980,355214207837288800,1514334254464231200,6208770443303347920,24539426037817994160,93695990326214159520,346267790336008850400,1240792915370698380600,4317959345490030364488,14614631630889333541344,48174156116635210562208,154845501803470319664240,485894505659165485842960,1490076484021440823251744 add $0,62 bin $0,62
93.333333
496
0.905357
b5507ed76921930db8da21d056151ae88e14b629
114
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/isgreater.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/isgreater.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/isgreater.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math48 PUBLIC _isgreater EXTERN cm48_sdcciy_isgreater defc _isgreater = cm48_sdcciy_isgreater
12.666667
39
0.868421
18db0460a68f785a615af4d71ae54525a3aa2b4f
360
asm
Assembly
oeis/112/A112332.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/112/A112332.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/112/A112332.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A112332: a(n)=Product{k=0..n-1, k!*binomial(2k,k)}. ; Submitted by Jon Maiga ; 1,1,2,24,2880,4838400,146313216000,97339256340480000,1683704371913057894400000,873705178746128941669416960000000,15414977576506278044562764045746176000000000 mov $1,1 mov $2,1 lpb $0 sub $0,1 add $2,1 mov $3,$2 pow $2,$0 mul $1,$2 mov $2,3 add $2,$3 lpe mov $0,$1
21.176471
159
0.708333
39e11c1fe50ac9a3c3ea5b183e99d4ff70823c1e
1,777
asm
Assembly
programs/oeis/028/A028399.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/028/A028399.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/028/A028399.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A028399: a(n) = 2^n - 4. ; 0,4,12,28,60,124,252,508,1020,2044,4092,8188,16380,32764,65532,131068,262140,524284,1048572,2097148,4194300,8388604,16777212,33554428,67108860,134217724,268435452,536870908,1073741820,2147483644,4294967292,8589934588,17179869180,34359738364,68719476732,137438953468,274877906940,549755813884,1099511627772,2199023255548,4398046511100,8796093022204,17592186044412,35184372088828,70368744177660,140737488355324,281474976710652,562949953421308,1125899906842620,2251799813685244,4503599627370492,9007199254740988,18014398509481980,36028797018963964,72057594037927932,144115188075855868,288230376151711740,576460752303423484,1152921504606846972,2305843009213693948,4611686018427387900,9223372036854775804,18446744073709551612,36893488147419103228,73786976294838206460,147573952589676412924,295147905179352825852,590295810358705651708,1180591620717411303420,2361183241434822606844,4722366482869645213692,9444732965739290427388,18889465931478580854780,37778931862957161709564,75557863725914323419132,151115727451828646838268,302231454903657293676540,604462909807314587353084,1208925819614629174706172,2417851639229258349412348,4835703278458516698824700,9671406556917033397649404,19342813113834066795298812,38685626227668133590597628,77371252455336267181195260,154742504910672534362390524,309485009821345068724781052,618970019642690137449562108,1237940039285380274899124220,2475880078570760549798248444,4951760157141521099596496892,9903520314283042199192993788,19807040628566084398385987580,39614081257132168796771975164,79228162514264337593543950332,158456325028528675187087900668,316912650057057350374175801340,633825300114114700748351602684,1267650600228229401496703205372,2535301200456458802993406410748 mov $1,2 pow $1,$0 sub $1,1 mul $1,4 mov $0,$1
197.444444
1,701
0.921216
2d666b4c4ec447177b50694539dbaa703f17751b
736
asm
Assembly
oeis/108/A108232.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/108/A108232.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/108/A108232.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A108232: Numbers n such that 11*n - 7 is prime. ; Submitted by Jon Maiga ; 4,6,10,18,24,34,36,40,46,48,54,58,60,66,76,90,96,100,108,118,130,136,138,148,156,160,174,178,180,184,186,190,204,208,214,240,244,246,264,270,298,306,316,318,324,330,340,348,358,366,376,384,388,390,394,396,408,414,418,424,426,430,436,444,450,454,456,466,480,496,498,508,514,516,526,528,534,550,558,564,570,576,580,598,604,606,610,618,624,634,648,654,660,664,678,684,688,690,696,706 mov $1,14 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,22 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 mul $1,2 mov $0,$1 sub $0,36 div $0,11 add $0,4
28.307692
382
0.665761
e109754b932e0ebc49833f2830b322a52be385bb
979
asm
Assembly
programs/oeis/190/A190975.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/190/A190975.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/190/A190975.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A190975: a(n) = 8*a(n-1) - 2*a(n-2), with a(0)=0, a(1)=1. ; 0,1,8,62,480,3716,28768,222712,1724160,13347856,103334528,799980512,6193175040,47945439296,371177164288,2873526435712,22245857157120,172219804385536,1333266720770048,10321694157389312,79907019817574400,618612770225816576,4789088122171383808,37075479436919437312,287025659251012730880,2222054315134262972416,17202383202572078317568,133174956990308100595712,1030994889517320648130560,7981609202157948983853056,61790883838228950574563328,478363852301515706628800512,3703329050735667751881277440,28669904701282310601792618496,221952579508787149310578393088,1718280826667732573281041907712,13302341454324286287627178475520,102982169981258825154455343988736,797252676941422028660388394958848,6172057075568858578974196471693312,47781951250668024574472794983628800,369911495854206479437833966925643776 mul $0,4 lpb $0 sub $0,4 add $1,$2 add $1,$2 add $2,$1 add $1,$2 add $1,1 mul $2,2 add $2,1 lpe mov $0,$1
61.1875
795
0.853933
e177d78c5d1be576e0291dec1041ffd6e1de0aac
8,381
asm
Assembly
code/6502/lib/gfx/tilemap.asm
visrealm/hbc-56
9c082946e247e79edc12867299b5b0fda3b6c873
[ "MIT" ]
65
2021-07-22T10:32:02.000Z
2022-03-30T04:42:45.000Z
code/6502/lib/gfx/tilemap.asm
visrealm/hbc-56
9c082946e247e79edc12867299b5b0fda3b6c873
[ "MIT" ]
5
2022-03-29T20:23:57.000Z
2022-03-30T23:12:42.000Z
code/6502/lib/gfx/tilemap.asm
visrealm/hbc-56
9c082946e247e79edc12867299b5b0fda3b6c873
[ "MIT" ]
4
2021-12-30T17:13:23.000Z
2022-03-05T09:07:22.000Z
; 6502 - Tilemap ; ; Copyright (c) 2021 Troy Schrapel ; ; This code is licensed under the MIT license ; ; https://github.com/visrealm/hbc-56 ; ; ; Tilemap structure ; --------------------- ; BufferAddressH (Page-aligned buffer - MSB) ; Size ; TilesetAddressH (Page-aligned tilset - MSB) ; InvertAddressH (Page-aligned invert flags - MSB) (optional) ; DirtyAddressH (Page-aligned dirty flags - MSB) (optional) !src "gfx/tilemap.inc" HAVE_TILEMAP = 1 !ifndef TILEMAP_ZP_START { TILEMAP_ZP_START = $f0 !warn "TILEMAP_ZP_START not provided. Defaulting to ", TILEMAP_ZP_START } !ifndef TILEMAP_RAM_START { TILEMAP_RAM_START = $7d00 !warn "TILEMAP_RAM_START not provided. Defaulting to ", TILEMAP_RAM_START } !if (TILEMAP_RAM_START & $ff) != 0 { !error "TILEMAP_RAM_START must be on a page boundary" } ; ------------------------- ; Tilemap structure ; ------------------------- TILEMAP_BUFFER_ADDR = 0 ; High byte of page-aligned buffer TILEMAP_SIZE = 1 ; Size flags TILEMAP_TILES_ADDR = 2 TILEMAP_INVERT_ADDR = 3 ; High byte of tilemap TILEMAP_DIRTY_ADDR = 4 TILEMAP_WIDTH_TILES = 5 TILEMAP_HEIGHT_TILES = 6 TILEMAP_TILE_SIZE_PX = 7 TILEMAP_STRUCTURE_SIZE = TILEMAP_TILE_SIZE_PX ; ------------------------- ; Zero page ; ------------------------- TILEMAP_ADDR = TILEMAP_ZP_START TILEMAP_TMP_BUFFER_ADDR = TILEMAP_ZP_START + 2 TILEMAP_TMP_TILES_ADDR = TILEMAP_ZP_START + 4 TILEMAP_ZP_SIZE = 6 ; ----------------------------------------------------------------------------- ; High RAM ; ----------------------------------------------------------------------------- TILEMAP_DEFAULT_BUFFER_ADDRESS = TILEMAP_RAM_START TILEMAP_TMP_BUF_ROW = TILEMAP_RAM_START + $80 TILEMAP_TMP_BUF_COL = TILEMAP_RAM_START + $81 TILEMAP_TMP_TILE_ROW = TILEMAP_RAM_START + $82 TILEMAP_TMP_OUTPUT_ROW = TILEMAP_RAM_START + $83 TILEMAP_TMP_1 = TILEMAP_RAM_START + $84 TILEMAP_TMP_2 = TILEMAP_RAM_START + $85 TILEMAP_TMP_TILES_W = TILEMAP_RAM_START + $86 TILEMAP_TMP_TILES_H = TILEMAP_RAM_START + $87 TILEMAP_TMP_TILE_SIZE = TILEMAP_RAM_START + $88 TILEMAP_FIXED_ADDRESS = TILEMAP_RAM_START + $100 TILEMAP_RAM_SIZE = TILEMAP_RAM_START - (TILEMAP_FIXED_ADDRESS + TILEMAP_STRUCTURE_SIZE) !if TILEMAP_ZP_END < (TILEMAP_ZP_START + TILEMAP_ZP_SIZE) { !error "TILEMAP_ZP requires ",TILEMAP_ZP_SIZE," bytes. Allocated ",TILEMAP_ZP_END - TILEMAP_ZP_START } !if TILEMAP_RAM_END < (TILEMAP_RAM_START + TILEMAP_RAM_SIZE) { !error "TILEMAP_RAM requires ",TILEMAP_RAM_SIZE," bytes. Allocated ",TILEMAP_RAM_END - TILEMAP_RAM_START } ; ------------------------- ; Contants ; ------------------------- TILEMAP_SIZE_X_16 = %00000000 TILEMAP_SIZE_X_32 = %00000001 TILEMAP_SIZE_X_64 = %00000010 TILEMAP_SIZE_Y_8 = %00000000 TILEMAP_SIZE_Y_16 = %00000100 TILEMAP_SIZE_Y_32 = %00001000 TILE_SIZE = 8 ; size of each tile (in px) ; ----------------------------------------------------------------------------- ; tilemapInit: Initialise a tilemap ; ----------------------------------------------------------------------------- ; Inputs: ; TILEMAP_ADDR: Address of tilemap structure ; ----------------------------------------------------------------------------- tilemapInit: ldy #0 sty MEM_LEN sty MEM_LEN + 1 sty MEM_DST lda (TILEMAP_ADDR), y ; buffer address H sta MEM_DST + 1 sta TILEMAP_TMP_BUFFER_ADDR + 1 ldy #TILEMAP_SIZE @MIN_WIDTH=16 @MIN_HEIGHT=8 lda #@MIN_WIDTH ; minimum width sta TILEMAP_TMP_BUF_COL ; temporary storage for x tiles lda #@MIN_HEIGHT ; minimum height sta TILEMAP_TMP_BUF_ROW ; temporary storage for y tiles lda #0 sta MEM_LEN + 1 lda #(@MIN_WIDTH * @MIN_HEIGHT) ; base size (16 x 8) sta MEM_LEN ; size in bytes lda (TILEMAP_ADDR), y ; size flags sta TILEMAP_TMP_1 beq ++ ; check size flags, multiple size lda #TILEMAP_SIZE_X_32 | TILEMAP_SIZE_X_64 bit TILEMAP_TMP_1 beq + asl MEM_LEN rol MEM_LEN + 1 asl TILEMAP_TMP_BUF_COL lda #TILEMAP_SIZE_X_64 bit TILEMAP_TMP_1 beq + asl MEM_LEN rol MEM_LEN + 1 asl TILEMAP_TMP_BUF_COL + lda #TILEMAP_SIZE_Y_16 | TILEMAP_SIZE_Y_32 bit TILEMAP_TMP_1 beq ++ asl MEM_LEN rol MEM_LEN + 1 asl TILEMAP_TMP_BUF_ROW lda #TILEMAP_SIZE_Y_32 bit TILEMAP_TMP_1 beq ++ asl MEM_LEN rol MEM_LEN + 1 asl TILEMAP_TMP_BUF_ROW ++ ; MEM_DST and MEM_LEN are set. clear the buffer. lda #$00 jsr memsetMultiPage lda TILEMAP_TMP_BUF_COL ldy #TILEMAP_WIDTH_TILES sta (TILEMAP_ADDR), y lda TILEMAP_TMP_BUF_ROW ldy #TILEMAP_HEIGHT_TILES sta (TILEMAP_ADDR), y ; todo: invert & dirty jsr tilemapSetActive rts ; ----------------------------------------------------------------------------- ; tilemapSetActive: Set the current/active tilemap ; ----------------------------------------------------------------------------- ; Inputs: ; TILEMAP_ADDR: Address of tilemap structure ; ----------------------------------------------------------------------------- tilemapSetActive: ldy #TILEMAP_WIDTH_TILES lda (TILEMAP_ADDR), y sta TILEMAP_TMP_TILES_W ldy #TILEMAP_HEIGHT_TILES lda (TILEMAP_ADDR), y sta TILEMAP_TMP_TILES_H ldy #TILEMAP_TILE_SIZE_PX lda (TILEMAP_ADDR), y sta TILEMAP_TMP_TILE_SIZE rts !if LCD_GRAPHICS=1 { ; ----------------------------------------------------------------------------- ; tilemapRenderRowToLcd: Render a row of the current/active tilemap ; ----------------------------------------------------------------------------- ; Prerequisites: ; tilemapSetActive called for the tilemap ; Inputs: ; y: Row to render (0-7) ; ----------------------------------------------------------------------------- tilemapRenderRowToLcd: tya and #$07 sta TILEMAP_TMP_BUF_ROW sta TILEMAP_TMP_2 asl asl asl sta TILEMAP_TMP_OUTPUT_ROW inc TILEMAP_TMP_2 ; set the working tilemap buffer address ldy #TILEMAP_BUFFER_ADDR lda (TILEMAP_ADDR), y sta TILEMAP_TMP_BUFFER_ADDR + 1 ; reset temp variables to zero lda #0 sta TILEMAP_TMP_BUFFER_ADDR ; LSB sta TILEMAP_TMP_TILES_ADDR ; LSB sta TILEMAP_TMP_BUF_COL sta TILEMAP_TMP_TILE_ROW jmp .tilemapRenderFrom ; ----------------------------------------------------------------------------- ; tilemapRenderToLcd: Render the current/active tilemap ; ----------------------------------------------------------------------------- ; Prerequisites: ; tilemapSetActive called for the tilemap ; ----------------------------------------------------------------------------- tilemapRenderToLcd: lda TILEMAP_TMP_TILES_H sta TILEMAP_TMP_2 ; set the working tilemap buffer address ldy #TILEMAP_BUFFER_ADDR lda (TILEMAP_ADDR), y sta TILEMAP_TMP_BUFFER_ADDR + 1 ; reset temp variables to zero lda #0 sta TILEMAP_TMP_BUFFER_ADDR ; LSB sta TILEMAP_TMP_TILES_ADDR ; LSB sta TILEMAP_TMP_BUF_ROW sta TILEMAP_TMP_BUF_COL sta TILEMAP_TMP_TILE_ROW sta TILEMAP_TMP_OUTPUT_ROW .tilemapRenderFrom ldy TILEMAP_TMP_OUTPUT_ROW jsr lcdGraphicsSetRow ; iterate over the buffer rows and columns @renderRow ;!byte $db lda #0 sta TILEMAP_TMP_1 ; set the working tileset address ldy #TILEMAP_TILES_ADDR lda (TILEMAP_ADDR), y sta TILEMAP_TMP_TILES_ADDR + 1 ; get tile offset lda TILEMAP_TMP_BUF_ROW asl asl asl asl clc adc TILEMAP_TMP_BUF_COL tay ; load the tile index lda (TILEMAP_TMP_BUFFER_ADDR), y ; multiply by 8 to get an offset into the tileset buffer ; storing overflow in TILEMAP_TMP_1 asl rol TILEMAP_TMP_1 asl rol TILEMAP_TMP_1 asl rol TILEMAP_TMP_1 ; add the tile row offset (the row of the current tile) ; and set as y index ora TILEMAP_TMP_TILE_ROW tay ; load the overflow and add to the MSB of the tileset address lda TILEMAP_TMP_1 clc adc TILEMAP_TMP_TILES_ADDR + 1 sta TILEMAP_TMP_TILES_ADDR + 1 jsr lcdWait ; load the byte from the tile lda (TILEMAP_TMP_TILES_ADDR), y ; output the byte sta LCD_DATA ; increment column and check against # columns inc TILEMAP_TMP_BUF_COL lda TILEMAP_TMP_TILES_W cmp TILEMAP_TMP_BUF_COL bne @renderRow ; increment tile row (row within tile) and check against tile size lda #0 sta TILEMAP_TMP_BUF_COL inc TILEMAP_TMP_TILE_ROW inc TILEMAP_TMP_OUTPUT_ROW ldy TILEMAP_TMP_OUTPUT_ROW jsr lcdGraphicsSetRow lda TILEMAP_TMP_TILE_SIZE cmp TILEMAP_TMP_TILE_ROW bne @renderRow ; increment row and check against # rows lda #0 sta TILEMAP_TMP_TILE_ROW inc TILEMAP_TMP_BUF_ROW lda TILEMAP_TMP_2 cmp TILEMAP_TMP_BUF_ROW bne @renderRow rts }
23.945714
105
0.652189
48a294382a837a447f71136828e32ee42298b727
698
asm
Assembly
oeis/058/A058799.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/058/A058799.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/058/A058799.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A058799: Column 2 of A007754. ; Submitted by Christian Krause ; 1,3,11,52,301,2055,16139,143196,1415821,15430835,183754199,2373373752,33043478329,493278801183,7859417340599,133116815989000,2388243270461401,45243505322777619,902481863185090979,18906875621564132940,415048781811225833701,9527215106036630042183,228238113763067895178691,5696425628970660749425092,147878828239474111589873701,3987031936836830352177164835,111489015403191775749370741679,3229194414755724666379574343856,96764343427268548215637859574001,2996465451830569270018394072450175 lpb $0 sub $0,1 add $3,1 mov $1,$3 mul $1,2 add $2,$1 mov $1,$3 mul $1,$0 add $2,$1 sub $2,$3 add $3,$2 lpe mov $0,$3 add $0,1
36.736842
485
0.816619
21d4a9ecdd837076de3502983bb7ad350eca2300
652
asm
Assembly
oeis/315/A315731.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/315/A315731.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/315/A315731.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A315731: Coordination sequence Gal.5.301.5 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by Simon Strandgaard ; 1,6,12,18,22,28,32,38,44,50,56,62,68,72,78,82,88,94,100,106,112,118,122,128,132,138,144,150,156,162,168,172,178,182,188,194,200,206,212,218,222,228,232,238,244,250,256,262,268,272 mov $1,$0 seq $1,311612 ; Coordination sequence Gal.5.98.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. mov $2,$0 mul $0,6 sub $0,1 mod $0,$1 add $0,1 mul $2,4 add $0,$2
46.571429
181
0.734663
abbe8902e1eef8eeae50c87bf147519235048578
559
asm
Assembly
programs/oeis/230/A230276.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/230/A230276.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/230/A230276.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A230276: Voids left after packing 5-curves coins patterns into fountain of coins with base n. ; 0,1,1,6,10,16,24,34,43,57,70,85,102,121,139,162,184,208,234,262,289,321,352,385,420,457,493,534,574,616,660,706,751,801,850,901,954,1009,1063,1122,1180,1240,1302,1366,1429 mov $4,$0 mov $6,$0 lpb $4 mov $0,$6 mov $2,0 mov $3,0 sub $4,1 sub $0,$4 add $3,$0 mov $5,$0 lpb $0 lpb $5 mod $5,3 lpe mov $0,0 sub $3,1 add $2,$3 seq $2,168236 ; a(n) = (6*n - 3*(-1)^n - 1)/4. sub $2,$5 lpe add $1,$2 lpe mov $0,$1
20.703704
173
0.577818
c664516fa99b8c8010c37e1cc873f48e317a0819
1,926
asm
Assembly
gfx/icons.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
gfx/icons.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
gfx/icons.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
Icons: ; used only for BANK(Icons) NullIcon: PoliwagIcon: INCBIN "gfx/icons/poliwag.2bpp" JigglypuffIcon: INCBIN "gfx/icons/jigglypuff.2bpp" DiglettIcon: INCBIN "gfx/icons/diglett.2bpp" PikachuIcon: INCBIN "gfx/icons/pikachu.2bpp" StaryuIcon: INCBIN "gfx/icons/staryu.2bpp" FishIcon: INCBIN "gfx/icons/fish.2bpp" BirdIcon: INCBIN "gfx/icons/bird.2bpp" MonsterIcon: INCBIN "gfx/icons/monster.2bpp" ClefairyIcon: INCBIN "gfx/icons/clefairy.2bpp" OddishIcon: INCBIN "gfx/icons/oddish.2bpp" BugIcon: INCBIN "gfx/icons/bug.2bpp" GhostIcon: INCBIN "gfx/icons/ghost.2bpp" LaprasIcon: INCBIN "gfx/icons/lapras.2bpp" HumanshapeIcon: INCBIN "gfx/icons/humanshape.2bpp" FoxIcon: INCBIN "gfx/icons/fox.2bpp" EquineIcon: INCBIN "gfx/icons/equine.2bpp" ShellIcon: INCBIN "gfx/icons/shell.2bpp" BlobIcon: INCBIN "gfx/icons/blob.2bpp" SerpentIcon: INCBIN "gfx/icons/serpent.2bpp" VoltorbIcon: INCBIN "gfx/icons/voltorb.2bpp" SquirtleIcon: INCBIN "gfx/icons/squirtle.2bpp" BulbasaurIcon: INCBIN "gfx/icons/bulbasaur.2bpp" CharmanderIcon: INCBIN "gfx/icons/charmander.2bpp" CaterpillarIcon: INCBIN "gfx/icons/caterpillar.2bpp" UnownIcon: INCBIN "gfx/icons/unown.2bpp" GeodudeIcon: INCBIN "gfx/icons/geodude.2bpp" FighterIcon: INCBIN "gfx/icons/fighter.2bpp" EggIcon: INCBIN "gfx/icons/egg.2bpp" JellyfishIcon: INCBIN "gfx/icons/jellyfish.2bpp" MothIcon: INCBIN "gfx/icons/moth.2bpp" BatIcon: INCBIN "gfx/icons/bat.2bpp" SnorlaxIcon: INCBIN "gfx/icons/snorlax.2bpp" HoOhIcon: INCBIN "gfx/icons/ho_oh.2bpp" LugiaIcon: INCBIN "gfx/icons/lugia.2bpp" GyaradosIcon: INCBIN "gfx/icons/gyarados.2bpp" SlowpokeIcon: INCBIN "gfx/icons/slowpoke.2bpp" SudowoodoIcon: INCBIN "gfx/icons/sudowoodo.2bpp" BigmonIcon: INCBIN "gfx/icons/bigmon.2bpp"
45.857143
53
0.706127
e6f20cda781b9ab6e23337d5a98b7bd7b559b2c3
757
asm
Assembly
oeis/075/A075730.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/075/A075730.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/075/A075730.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A075730: Squares of odd semiprimes A046315, odd numbers divisible by exactly 2 primes (counted with multiplicity). ; Submitted by Christian Krause ; 81,225,441,625,1089,1225,1521,2401,2601,3025,3249,4225,4761,5929,7225,7569,8281,8649,9025,12321,13225,14161,14641,15129,16641,17689,19881,20449,21025,24025,25281,25921,28561,31329,33489,34225,34969,40401,41209,42025,43681,45369,46225,47089,47961,48841,55225,56169,61009,62001,64009,67081,70225,71289,82369,83521,84681,87025,89401,90601,91809,93025,95481,101761,103041,104329,106929,108241,112225,114921,116281,126025,130321,133225,137641,142129,145161,152881,154449,156025,162409,165649,168921 seq $0,46315 ; Odd semiprimes: odd numbers divisible by exactly 2 primes (counted with multiplicity). pow $0,2
108.142857
495
0.813738
d44d4b73d18b97d1a4ac3f204a66ba1e9f2522b7
8,799
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_4838_1592.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_4838_1592.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_4838_1592.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r8 push %rbp push %rdi push %rdx lea addresses_normal_ht+0x1bb61, %rbp dec %r8 movb $0x61, (%rbp) nop nop nop nop sub $30377, %rdi lea addresses_A_ht+0x1f61, %r14 nop nop nop and $3533, %r10 movb (%r14), %dl nop nop nop nop nop add %rdx, %rdx lea addresses_D_ht+0x1ed61, %r10 nop nop nop nop cmp %r13, %r13 mov $0x6162636465666768, %r14 movq %r14, (%r10) nop add $32422, %r14 lea addresses_WT_ht+0xab61, %rdi nop nop nop nop nop sub %r13, %r13 mov (%rdi), %r14 nop nop nop and %rbp, %rbp lea addresses_WT_ht+0x18661, %r8 nop nop sub $299, %rdi movups (%r8), %xmm3 vpextrq $1, %xmm3, %r10 nop nop sub $30631, %r8 lea addresses_WT_ht+0x6b61, %r14 nop xor $12802, %rdi mov (%r14), %r10 nop nop nop nop dec %r13 lea addresses_A_ht+0x3bb9, %rdi nop nop nop and $56929, %rdx mov (%rdi), %r13d nop nop nop add $57222, %rbp lea addresses_WC_ht+0x1a3e1, %rdi nop and %r10, %r10 mov $0x6162636465666768, %r13 movq %r13, (%rdi) nop nop inc %rbp lea addresses_normal_ht+0x4f61, %rdx nop nop nop nop and %rbp, %rbp mov $0x6162636465666768, %r14 movq %r14, %xmm0 movups %xmm0, (%rdx) nop and $5617, %r13 lea addresses_D_ht+0x16561, %r8 nop nop nop and %rdx, %rdx mov (%r8), %r10d nop nop nop inc %r10 lea addresses_normal_ht+0x6849, %r8 clflush (%r8) nop cmp $30413, %rbp and $0xffffffffffffffc0, %r8 vmovaps (%r8), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %r10 nop nop nop nop inc %r13 lea addresses_WC_ht+0x84c9, %rbp nop nop add $7364, %r8 movl $0x61626364, (%rbp) nop nop nop inc %rbp lea addresses_UC_ht+0x186c5, %r10 nop and %rdx, %rdx mov (%r10), %r8 nop nop nop sub %rbp, %rbp pop %rdx pop %rdi pop %rbp pop %r8 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r8 push %rcx push %rdi push %rsi // Load lea addresses_US+0x1eb61, %rsi nop nop xor $43976, %rdi movb (%rsi), %r13b xor %rsi, %rsi // Store lea addresses_UC+0x10161, %rdi nop cmp $41152, %r15 movl $0x51525354, (%rdi) nop nop nop nop nop and %r15, %r15 // Store lea addresses_normal+0x17d61, %r13 nop nop nop nop nop and $57991, %r8 movw $0x5152, (%r13) cmp $1414, %r13 // Store lea addresses_WT+0x15b61, %r8 nop nop inc %r12 mov $0x5152535455565758, %rsi movq %rsi, %xmm3 vmovups %ymm3, (%r8) nop nop nop nop inc %rsi // Load lea addresses_RW+0x1a361, %r13 clflush (%r13) and %r12, %r12 mov (%r13), %r15w nop nop xor %rcx, %rcx // Load lea addresses_D+0x141a1, %rdi add $59222, %rsi movb (%rdi), %r15b nop nop nop nop nop and $38918, %r13 // Store lea addresses_US+0xdad1, %r12 nop nop nop nop nop sub $49283, %rdi movb $0x51, (%r12) nop nop nop nop nop cmp %r12, %r12 // Faulty Load lea addresses_RW+0x1a361, %rcx clflush (%rcx) nop nop xor $24482, %r12 vmovups (%rcx), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %rsi lea oracles, %r8 and $0xff, %rsi shlq $12, %rsi mov (%r8,%rsi,1), %rsi pop %rsi pop %rdi pop %rcx pop %r8 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': True}} {'32': 4838} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
30.237113
2,999
0.649165
e5f60c60f57b79e9ccd89de5002bc264bcd00037
147
asm
Assembly
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/sfc/yst_edit.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/sfc/yst_edit.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/sfc/yst_edit.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: yst_edit.asm Type: file Size: 108067 Last-Modified: '2016-05-13T04:52:56Z' SHA-1: 8CD7513DB5591D1AFB4B72B23185D10D9446ED1A Description: null
21
47
0.816327
c440d60cbd85137ec194f024ad5255bbf4bb66d0
203
asm
Assembly
libsrc/_DEVELOPMENT/adt/p_queue/c/sdcc_iy/p_queue_front_fastcall.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/adt/p_queue/c/sdcc_iy/p_queue_front_fastcall.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/adt/p_queue/c/sdcc_iy/p_queue_front_fastcall.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; void *p_queue_front_fastcall(p_queue_t *q) SECTION code_adt_p_queue PUBLIC _p_queue_front_fastcall defc _p_queue_front_fastcall = asm_p_queue_front INCLUDE "adt/p_queue/z80/asm_p_queue_front.asm"
18.454545
48
0.847291
7b969d055ffd2358c19e002df7d7d5d9dac2c500
6,020
asm
Assembly
Library/Kernel/IM/imInit.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Kernel/IM/imInit.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Kernel/IM/imInit.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Kernel Input Manager FILE: imInit.asm AUTHOR: Adam de Boor, Jan 28, 1991 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Adam 1/28/91 Initial revision DESCRIPTION: Initialization code for the Input Manager $Id: imInit.asm,v 1.1 97/04/05 01:17:24 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ObscureInitExit segment resource inputCategoryStr char 'input', 0 ifdef SYSTEM_SHUTDOWN_CHAR rebootOnResetStr char 'rebootOnReset', 0 quickShutdownStr char 'quickShutdownOnReset', 0 endif ; SYSTEM_SHUTDOWN_CHAR leftHandedMouseStr char "leftHanded", 0 doubleClickTimeStr char "doubleClickTime", 0 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IMAttach IMDetach IMEntry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle Init/Exit of Input Manager thread CALLED BY: MSG_META_ATTACH/MSG_META_DETACH PASS: ax - event type cx, dx, bp, si - event data ds, es - dgroup RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: lofty pseudo code here; KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 10/88 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ IMAttach method IMClass, MSG_META_ATTACH ; GET STRATEGY ROUTINE FOR KEYBOARD DRIVER push ds mov ax, GDDT_KEYBOARD call GeodeGetDefaultDriver ;puts keboard driver handle in ax mov bx, ax call GeodeInfoDriver ;puts structure in ds:si mov ax, ds:[si][DIS_strategy.segment] mov bx, ds:[si][DIS_strategy.offset] pop ds mov ds:[kbdStrategy.segment],ax mov ds:[kbdStrategy.offset],bx call InitIMMonitors ; Initialize our own monitors call InitScreenSaver ; Initialize screen saver mov cx, cs ; cx = init key seg mov si, offset inputCategoryStr ifdef SYSTEM_SHUTDOWN_CHAR ; ; Fetch the input::rebootOnReset key and set our rebootOnReset ; variable appropriately. It defaults to FALSE unless overridden by ; the ini file. ; push ds segmov ds, cs mov dx, offset rebootOnResetStr call InitFileReadBoolean pop ds jc checkLefty ; => absent mov ds:[rebootOnReset], al push ds segmov ds, cs mov dx, offset quickShutdownStr call InitFileReadBoolean pop ds jc checkLefty mov ds:[alreadyReset], al checkLefty: endif ; SYSTEM_SHUTDOWN_CHAR push ds segmov ds, cs mov dx, offset leftHandedMouseStr call InitFileReadBoolean pop ds jc checkDoubleClickTime ; => absent mov ds:[leftHanded], al checkDoubleClickTime: push ds segmov ds, cs mov dx, offset doubleClickTimeStr call InitFileReadInteger pop ds jc done mov ds:[doubleClickTime], ax done: ret IMAttach endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InitIMMonitors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets default user input characteristics CALLED BY: EXTERNAL PASS: ds - dgroup RETURN: DESTROYED: PSEUDO CODE/STRATEGY: lofty pseudo code here; KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 9/9/88 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitIMMonitors proc near ; SETUP STANDARD INPUT PROCESSING MONITORS ; CombineInput Monitor mov bx, offset combineMonitor mov cx, segment CombineInputMonitor mov dx, offset CombineInputMonitor mov al, ML_COMBINE ; processing LEVEL 40 call ImAddMonitor ; Add it. ; Output Monitor mov bx, offset outputMonitor mov cx, segment OutputMonitor mov dx, offset OutputMonitor mov al, ML_OUTPUT ; processing LEVEL 100 call ImAddMonitor ; Add it. if SINGLE_STEP_PROFILING ; Profile log dump monitor mov bx, offset profileMonitor mov cx, segment ProfileMonitor mov dx, offset ProfileMonitor mov al, ML_DRIVER ; processing LEVEL 20 call ImAddMonitor ; Add it. endif ; SINGLE_STEP_PROFILING ret InitIMMonitors endp ObscureInitExit ends kinit segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InitIM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Initialize the Input Manager thread CALLED BY: InitGeos PASS: ds = dgroup es = dgroup RETURN: nothing DESTROYED: ax, bx, cx, dx, si, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 1/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitIM proc near .enter ; ; Display log entry ; push ds segmov ds, cs mov si, offset imLogString call LogWriteInitEntry pop ds ; ; Get the class for the new beast to create us a thread. ; mov cx, segment IMClass ; cx:dx <- class for thread mov dx, offset IMClass mov bp, IM_STACK_SIZE ; bp <- stack size call SysGetPenMode tst ax jz 10$ mov bp, IM_PEN_MODE_STACK_SIZE 10$: mov es, cx ; es:di <- class to call mov di, dx mov ax, MSG_PROCESS_CREATE_EVENT_THREAD call ObjCallClassNoLock EC < ERROR_C CANNOT_START_INPUT_MANAGER > mov ds:[imThread], ax ; record the thread handle ; for return by ; ImInfoInputProcess ; ; Raise the priority of the new thread to be major. ; mov_trash bx, ax mov ax, (mask TMF_BASE_PRIO shl 8) or PRIORITY_HIGH call ThreadModify .leave ret InitIM endp imLogString char "IM Thread", 0 kinit ends
21.811594
79
0.597841
851dac99547770f6e830113af6a9dbc51db8ef2e
309
asm
Assembly
programs/oeis/166/A166731.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/166/A166731.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/166/A166731.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A166731: Positive integers with English names ending in "d". ; 100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400 mov $1,$0 mul $1,100 add $1,100
44.142857
212
0.757282
98ade2fc8b5fd6ff26ef70f9685dca069eecf55e
1,034
asm
Assembly
programs/oeis/047/A047287.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/047/A047287.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/047/A047287.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A047287: Numbers that are congruent to {0, 1, 2, 3, 6} mod 7. ; 0,1,2,3,6,7,8,9,10,13,14,15,16,17,20,21,22,23,24,27,28,29,30,31,34,35,36,37,38,41,42,43,44,45,48,49,50,51,52,55,56,57,58,59,62,63,64,65,66,69,70,71,72,73,76,77,78,79,80,83,84,85,86,87,90,91,92,93,94,97,98,99,100,101,104,105,106,107,108,111,112,113,114,115,118,119,120,121,122,125,126,127,128,129,132,133,134,135,136,139,140,141,142,143,146,147,148,149,150,153,154,155,156,157,160,161,162,163,164,167,168,169,170,171,174,175,176,177,178,181,182,183,184,185,188,189,190,191,192,195,196,197,198,199,202,203,204,205,206,209,210,211,212,213,216,217,218,219,220,223,224,225,226,227,230,231,232,233,234,237,238,239,240,241,244,245,246,247,248,251,252,253,254,255,258,259,260,261,262,265,266,267,268,269,272,273,274,275,276,279,280,281,282,283,286,287,288,289,290,293,294,295,296,297,300,301,302,303,304,307,308,309,310,311,314,315,316,317,318,321,322,323,324,325,328,329,330,331,332,335,336,337,338,339,342,343,344,345,346,349 mov $1,$0 add $1,1 div $1,5 mul $1,2 add $1,$0
114.888889
921
0.711799
7ea0b8313f1a7b61a9c6e3b104ea9bca870391dc
440
asm
Assembly
programs/oeis/132/A132349.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/132/A132349.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/132/A132349.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A132349: If n is a k-th power with k >= 2 then a(n) = k, otherwise a(n) = 0. ; 0,0,0,2,0,0,0,3,2,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,2,0,3,0,0,0,0,5,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 seq $0,52409 ; a(n) = largest integer power m for which a representation of the form n = k^m exists (for some k). lpb $0 mov $1,$0 mod $0,2 lpe mov $0,$1
44
201
0.563636
cd95abcd87f6891c6cdb81113dc08d35b6a2579e
6,376
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_21829_1774.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_21829_1774.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_21829_1774.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x14551, %rdi nop nop nop cmp $15355, %r15 mov $0x6162636465666768, %rbx movq %rbx, (%rdi) nop nop nop and $38031, %rbp lea addresses_WC_ht+0x1487d, %rsi lea addresses_WT_ht+0xb315, %rdi xor %r10, %r10 mov $120, %rcx rep movsw nop nop nop dec %rsi lea addresses_WT_ht+0x1d27d, %rsi lea addresses_A_ht+0xc50b, %rdi nop nop nop nop xor $34911, %r14 mov $40, %rcx rep movsw nop nop inc %r10 lea addresses_WT_ht+0x1ea7d, %rsi lea addresses_normal_ht+0x547d, %rdi nop sub %r15, %r15 mov $55, %rcx rep movsl nop nop sub %rbx, %rbx lea addresses_A_ht+0x19bfd, %rsi lea addresses_WC_ht+0x1907d, %rdi clflush (%rsi) nop nop nop nop nop cmp %r14, %r14 mov $72, %rcx rep movsq nop nop sub $51568, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r8 push %r9 push %rbp push %rbx push %rdi // Store lea addresses_PSE+0x1c87d, %rdi nop nop nop nop nop dec %r10 mov $0x5152535455565758, %r8 movq %r8, %xmm6 vmovups %ymm6, (%rdi) // Exception!!! mov (0), %r11 nop add %rdi, %rdi // Store lea addresses_A+0x207d, %rdi nop nop cmp $23418, %r9 movb $0x51, (%rdi) nop nop nop nop inc %r9 // Load lea addresses_WT+0xf989, %r8 nop nop nop nop nop sub $1048, %rdi movups (%r8), %xmm2 vpextrq $0, %xmm2, %rbp cmp %r9, %r9 // Store lea addresses_normal+0x12275, %rdi nop nop nop nop and $11347, %r11 mov $0x5152535455565758, %rbx movq %rbx, (%rdi) nop and $24144, %r8 // Faulty Load lea addresses_PSE+0x1c87d, %r11 nop nop nop nop nop and $924, %r10 mov (%r11), %r8 lea oracles, %r10 and $0xff, %r8 shlq $12, %r8 mov (%r10,%r8,1), %r8 pop %rdi pop %rbx pop %rbp pop %r9 pop %r8 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': True, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 3}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_A_ht', 'congruent': 7}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 11}} {'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 */
35.422222
2,999
0.659034
3df53ad480fca32ef583a7ceaa2cba7e721265ee
40
asm
Assembly
tests/test0.asm
felix-hoenikker/masm
8966f660d3895ba5c39ffdea42f0b66da9b1d89e
[ "MIT" ]
25
2016-04-12T04:23:49.000Z
2016-04-12T04:24:41.000Z
tests/test0.asm
felix-hoenikker/masm
8966f660d3895ba5c39ffdea42f0b66da9b1d89e
[ "MIT" ]
null
null
null
tests/test0.asm
felix-hoenikker/masm
8966f660d3895ba5c39ffdea42f0b66da9b1d89e
[ "MIT" ]
null
null
null
addi $10, $10, 10 ori $zero, $10, 0xf
13.333333
20
0.55
1e7fd2e9d7692069eccf808e1685b641e531bef7
1,779
asm
Assembly
programs/oeis/036/A036295.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/036/A036295.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/036/A036295.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A036295: Numerator of Sum i/2^i, i=1..n. ; 0,1,1,11,13,57,15,247,251,1013,509,4083,4089,16369,2047,65519,65527,262125,131067,1048555,1048565,4194281,1048573,16777191,16777203,67108837,33554425,268435427,268435441,1073741793,67108863,4294967263,4294967279,17179869149,8589934583,68719476699,68719476717,274877906905,68719476731,1099511627735,1099511627755,4398046511061,2199023255541,17592186044371,17592186044393,70368744177617,8796093022205,281474976710607,281474976710631,1125899906842573,562949953421299,4503599627370443,4503599627370469,18014398509481929,4503599627370489,72057594037927879,72057594037927907,288230376151711685,144115188075855857,1152921504606846915,1152921504606846945,4611686018427387841,144115188075855871,18446744073709551551,18446744073709551583,73786976294838206397,36893488147419103215,295147905179352825787,295147905179352825821,1180591620717411303353,295147905179352825847,4722366482869645213623,4722366482869645213659,18889465931478580854709,9444732965739290427373,75557863725914323419059,75557863725914323419097,302231454903657293676465,37778931862957161709563,1208925819614629174706095,1208925819614629174706135,4835703278458516698824621,2417851639229258349412331,19342813113834066795298731,19342813113834066795298773,77371252455336267181195177,19342813113834066795298805,309485009821345068724780967,309485009821345068724781011,1237940039285380274899124133,618970019642690137449562089,4951760157141521099596496803,4951760157141521099596496849,19807040628566084398385987489,1237940039285380274899124221,79228162514264337593543950239,79228162514264337593543950287,316912650057057350374175801245,158456325028528675187087900647,1267650600228229401496703205275 lpb $0 sub $0,1 add $2,1 add $1,$2 mul $1,2 lpe lpb $1 dif $1,2 lpe mov $0,$1
127.071429
1,646
0.908375
d56304acf4fedd7e01a5c2c530577f1d80d29c94
172
asm
Assembly
data/pokemon/dex_entries/dustox.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/dex_entries/dustox.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/dex_entries/dustox.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db "POISON MOTH@" ; species name db "It scatters its" next "fine dust all over" next "when is has been" page "attacked. This" next "#MON is " next "nocturnal.@"
17.2
33
0.651163
c07999f04cb8ecb89959d95dff15c5b8348caa4c
2,970
asm
Assembly
libsrc/_DEVELOPMENT/l/sccz80/8-gbz80/i32/l_long_mult.asm
z88dk/z88dk
65da9648d5f51fb45ebc975af3af07196884edc9
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/l/sccz80/8-gbz80/i32/l_long_mult.asm
z88dk/z88dk
65da9648d5f51fb45ebc975af3af07196884edc9
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/l/sccz80/8-gbz80/i32/l_long_mult.asm
z88dk/z88dk
65da9648d5f51fb45ebc975af3af07196884edc9
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
;Copyright (c) 1987, 1990, 1993, 2005 Vrije Universiteit, Amsterdam, The Netherlands. ;All rights reserved. ; ;Redistribution and use of the Amsterdam Compiler Kit 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 Vrije Universiteit nor the names of the ; software authors or 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, AUTHORS, 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 VRIJE UNIVERSITEIT OR ANY AUTHORS 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. SECTION code_clib SECTION code_l_sccz80 PUBLIC l_long_mult EXTERN __retloc, __math_rhs, __math_lhs, __math_result ; 32 bits signed and unsigned integer multiply routine ; Liberated from ack + rejigged for gbz80 l_long_mult: ld c,l ld b,h ld hl,__math_rhs ;store multipler ld (hl),c inc hl ld (hl),b inc hl ld (hl),e inc hl ld (hl),d POP bc ld hl,__retloc ld (hl),c inc hl ld (hl),b ld hl,__math_lhs pop bc ld (hl),c inc hl ld (hl),b inc hl pop bc ld (hl),c inc hl ld (hl),b ld hl,__math_result xor a ld (hl+),a ld (hl+),a ld (hl+),a ld (hl+),a ld bc,0 lp1: LD HL,__math_rhs ADD HL,BC LD a,(HL) ; get next byte of multiplier LD b,8 lp2: RRA JP NC,dont_add push af ; Add multiplicand to product ld de,__math_result ld hl,__math_lhs ld a,(de) add (hl) ld (de),a inc de inc hl ld a,(de) adc (hl) ld (de),a inc de inc hl ld a,(de) adc (hl) ld (de),a inc de inc hl ld a,(de) adc (hl) ld (de),a pop af dont_add: ; Shift multiplicand left ld hl,__math_lhs sla (hl) inc hl rl (hl) inc hl rl (hl) inc hl rl (hl) dec b jr nz,lp2 INC c LD a,c CP 4 JP NZ,lp1 ld hl,__retloc ld a,(hl+) ld h,(hl) ld l,a push hl ld hl,__math_result+3 ld d,(hl) dec hl ld e,(hl) dec hl ld a,(hl-) ld l,(hl) ld h,a ret
20.915493
85
0.715825
d4607b0743b10d1e0c674a54151f0d49d1549109
19
asm
Assembly
src/main/fragment/mos6502-common/vbuaa=vwum1_band_vbuc1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/vbuaa=vwum1_band_vbuc1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/vbuaa=vwum1_band_vbuc1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
lda {m1} and #{c1}
6.333333
9
0.526316
553ee3513bde265f662d8ea3dedd8915b87db053
46,453
asm
Assembly
wc.asm
briansrls/xv6
a239977076a9bd2ede261e8d8bffd09a25d43598
[ "MIT-0" ]
null
null
null
wc.asm
briansrls/xv6
a239977076a9bd2ede261e8d8bffd09a25d43598
[ "MIT-0" ]
null
null
null
wc.asm
briansrls/xv6
a239977076a9bd2ede261e8d8bffd09a25d43598
[ "MIT-0" ]
null
null
null
_wc: file format elf32-i386 Disassembly of section .text: 00000000 <wc>: char buf[512]; void wc(int fd, char *name) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 48 sub $0x48,%esp int i, n; int l, w, c, inword; l = w = c = 0; 6: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp) d: 8b 45 e8 mov -0x18(%ebp),%eax 10: 89 45 ec mov %eax,-0x14(%ebp) 13: 8b 45 ec mov -0x14(%ebp),%eax 16: 89 45 f0 mov %eax,-0x10(%ebp) inword = 0; 19: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) while((n = read(fd, buf, sizeof(buf))) > 0){ 20: eb 62 jmp 84 <wc+0x84> for(i=0; i<n; i++){ 22: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 29: eb 51 jmp 7c <wc+0x7c> c++; 2b: ff 45 e8 incl -0x18(%ebp) if(buf[i] == '\n') 2e: 8b 45 f4 mov -0xc(%ebp),%eax 31: 05 a0 0c 00 00 add $0xca0,%eax 36: 8a 00 mov (%eax),%al 38: 3c 0a cmp $0xa,%al 3a: 75 03 jne 3f <wc+0x3f> l++; 3c: ff 45 f0 incl -0x10(%ebp) if(strchr(" \r\t\n\v", buf[i])) 3f: 8b 45 f4 mov -0xc(%ebp),%eax 42: 05 a0 0c 00 00 add $0xca0,%eax 47: 8a 00 mov (%eax),%al 49: 0f be c0 movsbl %al,%eax 4c: 89 44 24 04 mov %eax,0x4(%esp) 50: c7 04 24 a7 09 00 00 movl $0x9a7,(%esp) 57: e8 50 02 00 00 call 2ac <strchr> 5c: 85 c0 test %eax,%eax 5e: 74 09 je 69 <wc+0x69> inword = 0; 60: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 67: eb 10 jmp 79 <wc+0x79> else if(!inword){ 69: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 6d: 75 0a jne 79 <wc+0x79> w++; 6f: ff 45 ec incl -0x14(%ebp) inword = 1; 72: c7 45 e4 01 00 00 00 movl $0x1,-0x1c(%ebp) int l, w, c, inword; l = w = c = 0; inword = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ for(i=0; i<n; i++){ 79: ff 45 f4 incl -0xc(%ebp) 7c: 8b 45 f4 mov -0xc(%ebp),%eax 7f: 3b 45 e0 cmp -0x20(%ebp),%eax 82: 7c a7 jl 2b <wc+0x2b> int i, n; int l, w, c, inword; l = w = c = 0; inword = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ 84: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 8b: 00 8c: c7 44 24 04 a0 0c 00 movl $0xca0,0x4(%esp) 93: 00 94: 8b 45 08 mov 0x8(%ebp),%eax 97: 89 04 24 mov %eax,(%esp) 9a: e8 c9 03 00 00 call 468 <read> 9f: 89 45 e0 mov %eax,-0x20(%ebp) a2: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) a6: 0f 8f 76 ff ff ff jg 22 <wc+0x22> w++; inword = 1; } } } if(n < 0){ ac: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) b0: 79 19 jns cb <wc+0xcb> printf(1, "wc: read error\n"); b2: c7 44 24 04 ad 09 00 movl $0x9ad,0x4(%esp) b9: 00 ba: c7 04 24 01 00 00 00 movl $0x1,(%esp) c1: e8 1a 05 00 00 call 5e0 <printf> exit(); c6: e8 85 03 00 00 call 450 <exit> } printf(1, "%d %d %d %s\n", l, w, c, name); cb: 8b 45 0c mov 0xc(%ebp),%eax ce: 89 44 24 14 mov %eax,0x14(%esp) d2: 8b 45 e8 mov -0x18(%ebp),%eax d5: 89 44 24 10 mov %eax,0x10(%esp) d9: 8b 45 ec mov -0x14(%ebp),%eax dc: 89 44 24 0c mov %eax,0xc(%esp) e0: 8b 45 f0 mov -0x10(%ebp),%eax e3: 89 44 24 08 mov %eax,0x8(%esp) e7: c7 44 24 04 bd 09 00 movl $0x9bd,0x4(%esp) ee: 00 ef: c7 04 24 01 00 00 00 movl $0x1,(%esp) f6: e8 e5 04 00 00 call 5e0 <printf> } fb: c9 leave fc: c3 ret 000000fd <main>: int main(int argc, char *argv[]) { fd: 55 push %ebp fe: 89 e5 mov %esp,%ebp 100: 83 e4 f0 and $0xfffffff0,%esp 103: 83 ec 20 sub $0x20,%esp int fd, i; if(argc <= 1){ 106: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 10a: 7f 19 jg 125 <main+0x28> wc(0, ""); 10c: c7 44 24 04 ca 09 00 movl $0x9ca,0x4(%esp) 113: 00 114: c7 04 24 00 00 00 00 movl $0x0,(%esp) 11b: e8 e0 fe ff ff call 0 <wc> exit(); 120: e8 2b 03 00 00 call 450 <exit> } for(i = 1; i < argc; i++){ 125: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp) 12c: 00 12d: e9 8e 00 00 00 jmp 1c0 <main+0xc3> if((fd = open(argv[i], 0)) < 0){ 132: 8b 44 24 1c mov 0x1c(%esp),%eax 136: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 13d: 8b 45 0c mov 0xc(%ebp),%eax 140: 01 d0 add %edx,%eax 142: 8b 00 mov (%eax),%eax 144: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 14b: 00 14c: 89 04 24 mov %eax,(%esp) 14f: e8 3c 03 00 00 call 490 <open> 154: 89 44 24 18 mov %eax,0x18(%esp) 158: 83 7c 24 18 00 cmpl $0x0,0x18(%esp) 15d: 79 2f jns 18e <main+0x91> printf(1, "wc: cannot open %s\n", argv[i]); 15f: 8b 44 24 1c mov 0x1c(%esp),%eax 163: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 16a: 8b 45 0c mov 0xc(%ebp),%eax 16d: 01 d0 add %edx,%eax 16f: 8b 00 mov (%eax),%eax 171: 89 44 24 08 mov %eax,0x8(%esp) 175: c7 44 24 04 cb 09 00 movl $0x9cb,0x4(%esp) 17c: 00 17d: c7 04 24 01 00 00 00 movl $0x1,(%esp) 184: e8 57 04 00 00 call 5e0 <printf> exit(); 189: e8 c2 02 00 00 call 450 <exit> } wc(fd, argv[i]); 18e: 8b 44 24 1c mov 0x1c(%esp),%eax 192: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 199: 8b 45 0c mov 0xc(%ebp),%eax 19c: 01 d0 add %edx,%eax 19e: 8b 00 mov (%eax),%eax 1a0: 89 44 24 04 mov %eax,0x4(%esp) 1a4: 8b 44 24 18 mov 0x18(%esp),%eax 1a8: 89 04 24 mov %eax,(%esp) 1ab: e8 50 fe ff ff call 0 <wc> close(fd); 1b0: 8b 44 24 18 mov 0x18(%esp),%eax 1b4: 89 04 24 mov %eax,(%esp) 1b7: e8 bc 02 00 00 call 478 <close> if(argc <= 1){ wc(0, ""); exit(); } for(i = 1; i < argc; i++){ 1bc: ff 44 24 1c incl 0x1c(%esp) 1c0: 8b 44 24 1c mov 0x1c(%esp),%eax 1c4: 3b 45 08 cmp 0x8(%ebp),%eax 1c7: 0f 8c 65 ff ff ff jl 132 <main+0x35> exit(); } wc(fd, argv[i]); close(fd); } exit(); 1cd: e8 7e 02 00 00 call 450 <exit> 1d2: 66 90 xchg %ax,%ax 000001d4 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 1d4: 55 push %ebp 1d5: 89 e5 mov %esp,%ebp 1d7: 57 push %edi 1d8: 53 push %ebx asm volatile("cld; rep stosb" : 1d9: 8b 4d 08 mov 0x8(%ebp),%ecx 1dc: 8b 55 10 mov 0x10(%ebp),%edx 1df: 8b 45 0c mov 0xc(%ebp),%eax 1e2: 89 cb mov %ecx,%ebx 1e4: 89 df mov %ebx,%edi 1e6: 89 d1 mov %edx,%ecx 1e8: fc cld 1e9: f3 aa rep stos %al,%es:(%edi) 1eb: 89 ca mov %ecx,%edx 1ed: 89 fb mov %edi,%ebx 1ef: 89 5d 08 mov %ebx,0x8(%ebp) 1f2: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 1f5: 5b pop %ebx 1f6: 5f pop %edi 1f7: 5d pop %ebp 1f8: c3 ret 000001f9 <strcpy>: #include "x86.h" #include "signal.h" char* strcpy(char *s, char *t) { 1f9: 55 push %ebp 1fa: 89 e5 mov %esp,%ebp 1fc: 83 ec 10 sub $0x10,%esp char *os; os = s; 1ff: 8b 45 08 mov 0x8(%ebp),%eax 202: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 205: 90 nop 206: 8b 45 0c mov 0xc(%ebp),%eax 209: 8a 10 mov (%eax),%dl 20b: 8b 45 08 mov 0x8(%ebp),%eax 20e: 88 10 mov %dl,(%eax) 210: 8b 45 08 mov 0x8(%ebp),%eax 213: 8a 00 mov (%eax),%al 215: 84 c0 test %al,%al 217: 0f 95 c0 setne %al 21a: ff 45 08 incl 0x8(%ebp) 21d: ff 45 0c incl 0xc(%ebp) 220: 84 c0 test %al,%al 222: 75 e2 jne 206 <strcpy+0xd> ; return os; 224: 8b 45 fc mov -0x4(%ebp),%eax } 227: c9 leave 228: c3 ret 00000229 <strcmp>: int strcmp(const char *p, const char *q) { 229: 55 push %ebp 22a: 89 e5 mov %esp,%ebp while(*p && *p == *q) 22c: eb 06 jmp 234 <strcmp+0xb> p++, q++; 22e: ff 45 08 incl 0x8(%ebp) 231: ff 45 0c incl 0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 234: 8b 45 08 mov 0x8(%ebp),%eax 237: 8a 00 mov (%eax),%al 239: 84 c0 test %al,%al 23b: 74 0e je 24b <strcmp+0x22> 23d: 8b 45 08 mov 0x8(%ebp),%eax 240: 8a 10 mov (%eax),%dl 242: 8b 45 0c mov 0xc(%ebp),%eax 245: 8a 00 mov (%eax),%al 247: 38 c2 cmp %al,%dl 249: 74 e3 je 22e <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 24b: 8b 45 08 mov 0x8(%ebp),%eax 24e: 8a 00 mov (%eax),%al 250: 0f b6 d0 movzbl %al,%edx 253: 8b 45 0c mov 0xc(%ebp),%eax 256: 8a 00 mov (%eax),%al 258: 0f b6 c0 movzbl %al,%eax 25b: 89 d1 mov %edx,%ecx 25d: 29 c1 sub %eax,%ecx 25f: 89 c8 mov %ecx,%eax } 261: 5d pop %ebp 262: c3 ret 00000263 <strlen>: uint strlen(char *s) { 263: 55 push %ebp 264: 89 e5 mov %esp,%ebp 266: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 269: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 270: eb 03 jmp 275 <strlen+0x12> 272: ff 45 fc incl -0x4(%ebp) 275: 8b 55 fc mov -0x4(%ebp),%edx 278: 8b 45 08 mov 0x8(%ebp),%eax 27b: 01 d0 add %edx,%eax 27d: 8a 00 mov (%eax),%al 27f: 84 c0 test %al,%al 281: 75 ef jne 272 <strlen+0xf> ; return n; 283: 8b 45 fc mov -0x4(%ebp),%eax } 286: c9 leave 287: c3 ret 00000288 <memset>: void* memset(void *dst, int c, uint n) { 288: 55 push %ebp 289: 89 e5 mov %esp,%ebp 28b: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 28e: 8b 45 10 mov 0x10(%ebp),%eax 291: 89 44 24 08 mov %eax,0x8(%esp) 295: 8b 45 0c mov 0xc(%ebp),%eax 298: 89 44 24 04 mov %eax,0x4(%esp) 29c: 8b 45 08 mov 0x8(%ebp),%eax 29f: 89 04 24 mov %eax,(%esp) 2a2: e8 2d ff ff ff call 1d4 <stosb> return dst; 2a7: 8b 45 08 mov 0x8(%ebp),%eax } 2aa: c9 leave 2ab: c3 ret 000002ac <strchr>: char* strchr(const char *s, char c) { 2ac: 55 push %ebp 2ad: 89 e5 mov %esp,%ebp 2af: 83 ec 04 sub $0x4,%esp 2b2: 8b 45 0c mov 0xc(%ebp),%eax 2b5: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 2b8: eb 12 jmp 2cc <strchr+0x20> if(*s == c) 2ba: 8b 45 08 mov 0x8(%ebp),%eax 2bd: 8a 00 mov (%eax),%al 2bf: 3a 45 fc cmp -0x4(%ebp),%al 2c2: 75 05 jne 2c9 <strchr+0x1d> return (char*)s; 2c4: 8b 45 08 mov 0x8(%ebp),%eax 2c7: eb 11 jmp 2da <strchr+0x2e> } char* strchr(const char *s, char c) { for(; *s; s++) 2c9: ff 45 08 incl 0x8(%ebp) 2cc: 8b 45 08 mov 0x8(%ebp),%eax 2cf: 8a 00 mov (%eax),%al 2d1: 84 c0 test %al,%al 2d3: 75 e5 jne 2ba <strchr+0xe> if(*s == c) return (char*)s; return 0; 2d5: b8 00 00 00 00 mov $0x0,%eax } 2da: c9 leave 2db: c3 ret 000002dc <gets>: char* gets(char *buf, int max) { 2dc: 55 push %ebp 2dd: 89 e5 mov %esp,%ebp 2df: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 2e2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 2e9: eb 42 jmp 32d <gets+0x51> cc = read(0, &c, 1); 2eb: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 2f2: 00 2f3: 8d 45 ef lea -0x11(%ebp),%eax 2f6: 89 44 24 04 mov %eax,0x4(%esp) 2fa: c7 04 24 00 00 00 00 movl $0x0,(%esp) 301: e8 62 01 00 00 call 468 <read> 306: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 309: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 30d: 7e 29 jle 338 <gets+0x5c> break; buf[i++] = c; 30f: 8b 55 f4 mov -0xc(%ebp),%edx 312: 8b 45 08 mov 0x8(%ebp),%eax 315: 01 c2 add %eax,%edx 317: 8a 45 ef mov -0x11(%ebp),%al 31a: 88 02 mov %al,(%edx) 31c: ff 45 f4 incl -0xc(%ebp) if(c == '\n' || c == '\r') 31f: 8a 45 ef mov -0x11(%ebp),%al 322: 3c 0a cmp $0xa,%al 324: 74 13 je 339 <gets+0x5d> 326: 8a 45 ef mov -0x11(%ebp),%al 329: 3c 0d cmp $0xd,%al 32b: 74 0c je 339 <gets+0x5d> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 32d: 8b 45 f4 mov -0xc(%ebp),%eax 330: 40 inc %eax 331: 3b 45 0c cmp 0xc(%ebp),%eax 334: 7c b5 jl 2eb <gets+0xf> 336: eb 01 jmp 339 <gets+0x5d> cc = read(0, &c, 1); if(cc < 1) break; 338: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 339: 8b 55 f4 mov -0xc(%ebp),%edx 33c: 8b 45 08 mov 0x8(%ebp),%eax 33f: 01 d0 add %edx,%eax 341: c6 00 00 movb $0x0,(%eax) return buf; 344: 8b 45 08 mov 0x8(%ebp),%eax } 347: c9 leave 348: c3 ret 00000349 <stat>: int stat(char *n, struct stat *st) { 349: 55 push %ebp 34a: 89 e5 mov %esp,%ebp 34c: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 34f: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 356: 00 357: 8b 45 08 mov 0x8(%ebp),%eax 35a: 89 04 24 mov %eax,(%esp) 35d: e8 2e 01 00 00 call 490 <open> 362: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 365: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 369: 79 07 jns 372 <stat+0x29> return -1; 36b: b8 ff ff ff ff mov $0xffffffff,%eax 370: eb 23 jmp 395 <stat+0x4c> r = fstat(fd, st); 372: 8b 45 0c mov 0xc(%ebp),%eax 375: 89 44 24 04 mov %eax,0x4(%esp) 379: 8b 45 f4 mov -0xc(%ebp),%eax 37c: 89 04 24 mov %eax,(%esp) 37f: e8 24 01 00 00 call 4a8 <fstat> 384: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 387: 8b 45 f4 mov -0xc(%ebp),%eax 38a: 89 04 24 mov %eax,(%esp) 38d: e8 e6 00 00 00 call 478 <close> return r; 392: 8b 45 f0 mov -0x10(%ebp),%eax } 395: c9 leave 396: c3 ret 00000397 <atoi>: int atoi(const char *s) { 397: 55 push %ebp 398: 89 e5 mov %esp,%ebp 39a: 83 ec 10 sub $0x10,%esp int n; n = 0; 39d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 3a4: eb 21 jmp 3c7 <atoi+0x30> n = n*10 + *s++ - '0'; 3a6: 8b 55 fc mov -0x4(%ebp),%edx 3a9: 89 d0 mov %edx,%eax 3ab: c1 e0 02 shl $0x2,%eax 3ae: 01 d0 add %edx,%eax 3b0: d1 e0 shl %eax 3b2: 89 c2 mov %eax,%edx 3b4: 8b 45 08 mov 0x8(%ebp),%eax 3b7: 8a 00 mov (%eax),%al 3b9: 0f be c0 movsbl %al,%eax 3bc: 01 d0 add %edx,%eax 3be: 83 e8 30 sub $0x30,%eax 3c1: 89 45 fc mov %eax,-0x4(%ebp) 3c4: ff 45 08 incl 0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 3c7: 8b 45 08 mov 0x8(%ebp),%eax 3ca: 8a 00 mov (%eax),%al 3cc: 3c 2f cmp $0x2f,%al 3ce: 7e 09 jle 3d9 <atoi+0x42> 3d0: 8b 45 08 mov 0x8(%ebp),%eax 3d3: 8a 00 mov (%eax),%al 3d5: 3c 39 cmp $0x39,%al 3d7: 7e cd jle 3a6 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 3d9: 8b 45 fc mov -0x4(%ebp),%eax } 3dc: c9 leave 3dd: c3 ret 000003de <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 3de: 55 push %ebp 3df: 89 e5 mov %esp,%ebp 3e1: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 3e4: 8b 45 08 mov 0x8(%ebp),%eax 3e7: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 3ea: 8b 45 0c mov 0xc(%ebp),%eax 3ed: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 3f0: eb 10 jmp 402 <memmove+0x24> *dst++ = *src++; 3f2: 8b 45 f8 mov -0x8(%ebp),%eax 3f5: 8a 10 mov (%eax),%dl 3f7: 8b 45 fc mov -0x4(%ebp),%eax 3fa: 88 10 mov %dl,(%eax) 3fc: ff 45 fc incl -0x4(%ebp) 3ff: ff 45 f8 incl -0x8(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 402: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 406: 0f 9f c0 setg %al 409: ff 4d 10 decl 0x10(%ebp) 40c: 84 c0 test %al,%al 40e: 75 e2 jne 3f2 <memmove+0x14> *dst++ = *src++; return vdst; 410: 8b 45 08 mov 0x8(%ebp),%eax } 413: c9 leave 414: c3 ret 00000415 <trampoline>: 415: 5a pop %edx 416: 59 pop %ecx 417: 58 pop %eax 418: 03 25 04 00 00 00 add 0x4,%esp 41e: c9 leave 41f: c3 ret 00000420 <signal>: "addl 4, %esp\n\t" "leave\n\t" "ret\n\t" ); int signal(int signum, sighandler_t handler) { 420: 55 push %ebp 421: 89 e5 mov %esp,%ebp 423: 83 ec 18 sub $0x18,%esp register_signal_handler(signum, handler, trampoline); 426: c7 44 24 08 15 04 00 movl $0x415,0x8(%esp) 42d: 00 42e: 8b 45 0c mov 0xc(%ebp),%eax 431: 89 44 24 04 mov %eax,0x4(%esp) 435: 8b 45 08 mov 0x8(%ebp),%eax 438: 89 04 24 mov %eax,(%esp) 43b: e8 b8 00 00 00 call 4f8 <register_signal_handler> return 0; 440: b8 00 00 00 00 mov $0x0,%eax } 445: c9 leave 446: c3 ret 447: 90 nop 00000448 <fork>: 448: b8 01 00 00 00 mov $0x1,%eax 44d: cd 40 int $0x40 44f: c3 ret 00000450 <exit>: 450: b8 02 00 00 00 mov $0x2,%eax 455: cd 40 int $0x40 457: c3 ret 00000458 <wait>: 458: b8 03 00 00 00 mov $0x3,%eax 45d: cd 40 int $0x40 45f: c3 ret 00000460 <pipe>: 460: b8 04 00 00 00 mov $0x4,%eax 465: cd 40 int $0x40 467: c3 ret 00000468 <read>: 468: b8 05 00 00 00 mov $0x5,%eax 46d: cd 40 int $0x40 46f: c3 ret 00000470 <write>: 470: b8 10 00 00 00 mov $0x10,%eax 475: cd 40 int $0x40 477: c3 ret 00000478 <close>: 478: b8 15 00 00 00 mov $0x15,%eax 47d: cd 40 int $0x40 47f: c3 ret 00000480 <kill>: 480: b8 06 00 00 00 mov $0x6,%eax 485: cd 40 int $0x40 487: c3 ret 00000488 <exec>: 488: b8 07 00 00 00 mov $0x7,%eax 48d: cd 40 int $0x40 48f: c3 ret 00000490 <open>: 490: b8 0f 00 00 00 mov $0xf,%eax 495: cd 40 int $0x40 497: c3 ret 00000498 <mknod>: 498: b8 11 00 00 00 mov $0x11,%eax 49d: cd 40 int $0x40 49f: c3 ret 000004a0 <unlink>: 4a0: b8 12 00 00 00 mov $0x12,%eax 4a5: cd 40 int $0x40 4a7: c3 ret 000004a8 <fstat>: 4a8: b8 08 00 00 00 mov $0x8,%eax 4ad: cd 40 int $0x40 4af: c3 ret 000004b0 <link>: 4b0: b8 13 00 00 00 mov $0x13,%eax 4b5: cd 40 int $0x40 4b7: c3 ret 000004b8 <mkdir>: 4b8: b8 14 00 00 00 mov $0x14,%eax 4bd: cd 40 int $0x40 4bf: c3 ret 000004c0 <chdir>: 4c0: b8 09 00 00 00 mov $0x9,%eax 4c5: cd 40 int $0x40 4c7: c3 ret 000004c8 <dup>: 4c8: b8 0a 00 00 00 mov $0xa,%eax 4cd: cd 40 int $0x40 4cf: c3 ret 000004d0 <getpid>: 4d0: b8 0b 00 00 00 mov $0xb,%eax 4d5: cd 40 int $0x40 4d7: c3 ret 000004d8 <sbrk>: 4d8: b8 0c 00 00 00 mov $0xc,%eax 4dd: cd 40 int $0x40 4df: c3 ret 000004e0 <sleep>: 4e0: b8 0d 00 00 00 mov $0xd,%eax 4e5: cd 40 int $0x40 4e7: c3 ret 000004e8 <uptime>: 4e8: b8 0e 00 00 00 mov $0xe,%eax 4ed: cd 40 int $0x40 4ef: c3 ret 000004f0 <halt>: 4f0: b8 16 00 00 00 mov $0x16,%eax 4f5: cd 40 int $0x40 4f7: c3 ret 000004f8 <register_signal_handler>: 4f8: b8 17 00 00 00 mov $0x17,%eax 4fd: cd 40 int $0x40 4ff: c3 ret 00000500 <alarm>: 500: b8 18 00 00 00 mov $0x18,%eax 505: cd 40 int $0x40 507: c3 ret 00000508 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 508: 55 push %ebp 509: 89 e5 mov %esp,%ebp 50b: 83 ec 28 sub $0x28,%esp 50e: 8b 45 0c mov 0xc(%ebp),%eax 511: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 514: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 51b: 00 51c: 8d 45 f4 lea -0xc(%ebp),%eax 51f: 89 44 24 04 mov %eax,0x4(%esp) 523: 8b 45 08 mov 0x8(%ebp),%eax 526: 89 04 24 mov %eax,(%esp) 529: e8 42 ff ff ff call 470 <write> } 52e: c9 leave 52f: c3 ret 00000530 <printint>: static void printint(int fd, int xx, int base, int sgn) { 530: 55 push %ebp 531: 89 e5 mov %esp,%ebp 533: 83 ec 48 sub $0x48,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 536: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 53d: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 541: 74 17 je 55a <printint+0x2a> 543: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 547: 79 11 jns 55a <printint+0x2a> neg = 1; 549: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 550: 8b 45 0c mov 0xc(%ebp),%eax 553: f7 d8 neg %eax 555: 89 45 ec mov %eax,-0x14(%ebp) 558: eb 06 jmp 560 <printint+0x30> } else { x = xx; 55a: 8b 45 0c mov 0xc(%ebp),%eax 55d: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 560: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 567: 8b 4d 10 mov 0x10(%ebp),%ecx 56a: 8b 45 ec mov -0x14(%ebp),%eax 56d: ba 00 00 00 00 mov $0x0,%edx 572: f7 f1 div %ecx 574: 89 d0 mov %edx,%eax 576: 8a 80 64 0c 00 00 mov 0xc64(%eax),%al 57c: 8d 4d dc lea -0x24(%ebp),%ecx 57f: 8b 55 f4 mov -0xc(%ebp),%edx 582: 01 ca add %ecx,%edx 584: 88 02 mov %al,(%edx) 586: ff 45 f4 incl -0xc(%ebp) }while((x /= base) != 0); 589: 8b 55 10 mov 0x10(%ebp),%edx 58c: 89 55 d4 mov %edx,-0x2c(%ebp) 58f: 8b 45 ec mov -0x14(%ebp),%eax 592: ba 00 00 00 00 mov $0x0,%edx 597: f7 75 d4 divl -0x2c(%ebp) 59a: 89 45 ec mov %eax,-0x14(%ebp) 59d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 5a1: 75 c4 jne 567 <printint+0x37> if(neg) 5a3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 5a7: 74 2c je 5d5 <printint+0xa5> buf[i++] = '-'; 5a9: 8d 55 dc lea -0x24(%ebp),%edx 5ac: 8b 45 f4 mov -0xc(%ebp),%eax 5af: 01 d0 add %edx,%eax 5b1: c6 00 2d movb $0x2d,(%eax) 5b4: ff 45 f4 incl -0xc(%ebp) while(--i >= 0) 5b7: eb 1c jmp 5d5 <printint+0xa5> putc(fd, buf[i]); 5b9: 8d 55 dc lea -0x24(%ebp),%edx 5bc: 8b 45 f4 mov -0xc(%ebp),%eax 5bf: 01 d0 add %edx,%eax 5c1: 8a 00 mov (%eax),%al 5c3: 0f be c0 movsbl %al,%eax 5c6: 89 44 24 04 mov %eax,0x4(%esp) 5ca: 8b 45 08 mov 0x8(%ebp),%eax 5cd: 89 04 24 mov %eax,(%esp) 5d0: e8 33 ff ff ff call 508 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 5d5: ff 4d f4 decl -0xc(%ebp) 5d8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 5dc: 79 db jns 5b9 <printint+0x89> putc(fd, buf[i]); } 5de: c9 leave 5df: c3 ret 000005e0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 5e0: 55 push %ebp 5e1: 89 e5 mov %esp,%ebp 5e3: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 5e6: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 5ed: 8d 45 0c lea 0xc(%ebp),%eax 5f0: 83 c0 04 add $0x4,%eax 5f3: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 5f6: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 5fd: e9 78 01 00 00 jmp 77a <printf+0x19a> c = fmt[i] & 0xff; 602: 8b 55 0c mov 0xc(%ebp),%edx 605: 8b 45 f0 mov -0x10(%ebp),%eax 608: 01 d0 add %edx,%eax 60a: 8a 00 mov (%eax),%al 60c: 0f be c0 movsbl %al,%eax 60f: 25 ff 00 00 00 and $0xff,%eax 614: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 617: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 61b: 75 2c jne 649 <printf+0x69> if(c == '%'){ 61d: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 621: 75 0c jne 62f <printf+0x4f> state = '%'; 623: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 62a: e9 48 01 00 00 jmp 777 <printf+0x197> } else { putc(fd, c); 62f: 8b 45 e4 mov -0x1c(%ebp),%eax 632: 0f be c0 movsbl %al,%eax 635: 89 44 24 04 mov %eax,0x4(%esp) 639: 8b 45 08 mov 0x8(%ebp),%eax 63c: 89 04 24 mov %eax,(%esp) 63f: e8 c4 fe ff ff call 508 <putc> 644: e9 2e 01 00 00 jmp 777 <printf+0x197> } } else if(state == '%'){ 649: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 64d: 0f 85 24 01 00 00 jne 777 <printf+0x197> if(c == 'd'){ 653: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 657: 75 2d jne 686 <printf+0xa6> printint(fd, *ap, 10, 1); 659: 8b 45 e8 mov -0x18(%ebp),%eax 65c: 8b 00 mov (%eax),%eax 65e: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 665: 00 666: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 66d: 00 66e: 89 44 24 04 mov %eax,0x4(%esp) 672: 8b 45 08 mov 0x8(%ebp),%eax 675: 89 04 24 mov %eax,(%esp) 678: e8 b3 fe ff ff call 530 <printint> ap++; 67d: 83 45 e8 04 addl $0x4,-0x18(%ebp) 681: e9 ea 00 00 00 jmp 770 <printf+0x190> } else if(c == 'x' || c == 'p'){ 686: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 68a: 74 06 je 692 <printf+0xb2> 68c: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 690: 75 2d jne 6bf <printf+0xdf> printint(fd, *ap, 16, 0); 692: 8b 45 e8 mov -0x18(%ebp),%eax 695: 8b 00 mov (%eax),%eax 697: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 69e: 00 69f: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 6a6: 00 6a7: 89 44 24 04 mov %eax,0x4(%esp) 6ab: 8b 45 08 mov 0x8(%ebp),%eax 6ae: 89 04 24 mov %eax,(%esp) 6b1: e8 7a fe ff ff call 530 <printint> ap++; 6b6: 83 45 e8 04 addl $0x4,-0x18(%ebp) 6ba: e9 b1 00 00 00 jmp 770 <printf+0x190> } else if(c == 's'){ 6bf: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 6c3: 75 43 jne 708 <printf+0x128> s = (char*)*ap; 6c5: 8b 45 e8 mov -0x18(%ebp),%eax 6c8: 8b 00 mov (%eax),%eax 6ca: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 6cd: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 6d1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 6d5: 75 25 jne 6fc <printf+0x11c> s = "(null)"; 6d7: c7 45 f4 df 09 00 00 movl $0x9df,-0xc(%ebp) while(*s != 0){ 6de: eb 1c jmp 6fc <printf+0x11c> putc(fd, *s); 6e0: 8b 45 f4 mov -0xc(%ebp),%eax 6e3: 8a 00 mov (%eax),%al 6e5: 0f be c0 movsbl %al,%eax 6e8: 89 44 24 04 mov %eax,0x4(%esp) 6ec: 8b 45 08 mov 0x8(%ebp),%eax 6ef: 89 04 24 mov %eax,(%esp) 6f2: e8 11 fe ff ff call 508 <putc> s++; 6f7: ff 45 f4 incl -0xc(%ebp) 6fa: eb 01 jmp 6fd <printf+0x11d> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 6fc: 90 nop 6fd: 8b 45 f4 mov -0xc(%ebp),%eax 700: 8a 00 mov (%eax),%al 702: 84 c0 test %al,%al 704: 75 da jne 6e0 <printf+0x100> 706: eb 68 jmp 770 <printf+0x190> putc(fd, *s); s++; } } else if(c == 'c'){ 708: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 70c: 75 1d jne 72b <printf+0x14b> putc(fd, *ap); 70e: 8b 45 e8 mov -0x18(%ebp),%eax 711: 8b 00 mov (%eax),%eax 713: 0f be c0 movsbl %al,%eax 716: 89 44 24 04 mov %eax,0x4(%esp) 71a: 8b 45 08 mov 0x8(%ebp),%eax 71d: 89 04 24 mov %eax,(%esp) 720: e8 e3 fd ff ff call 508 <putc> ap++; 725: 83 45 e8 04 addl $0x4,-0x18(%ebp) 729: eb 45 jmp 770 <printf+0x190> } else if(c == '%'){ 72b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 72f: 75 17 jne 748 <printf+0x168> putc(fd, c); 731: 8b 45 e4 mov -0x1c(%ebp),%eax 734: 0f be c0 movsbl %al,%eax 737: 89 44 24 04 mov %eax,0x4(%esp) 73b: 8b 45 08 mov 0x8(%ebp),%eax 73e: 89 04 24 mov %eax,(%esp) 741: e8 c2 fd ff ff call 508 <putc> 746: eb 28 jmp 770 <printf+0x190> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 748: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 74f: 00 750: 8b 45 08 mov 0x8(%ebp),%eax 753: 89 04 24 mov %eax,(%esp) 756: e8 ad fd ff ff call 508 <putc> putc(fd, c); 75b: 8b 45 e4 mov -0x1c(%ebp),%eax 75e: 0f be c0 movsbl %al,%eax 761: 89 44 24 04 mov %eax,0x4(%esp) 765: 8b 45 08 mov 0x8(%ebp),%eax 768: 89 04 24 mov %eax,(%esp) 76b: e8 98 fd ff ff call 508 <putc> } state = 0; 770: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 777: ff 45 f0 incl -0x10(%ebp) 77a: 8b 55 0c mov 0xc(%ebp),%edx 77d: 8b 45 f0 mov -0x10(%ebp),%eax 780: 01 d0 add %edx,%eax 782: 8a 00 mov (%eax),%al 784: 84 c0 test %al,%al 786: 0f 85 76 fe ff ff jne 602 <printf+0x22> putc(fd, c); } state = 0; } } } 78c: c9 leave 78d: c3 ret 78e: 66 90 xchg %ax,%ax 00000790 <free>: static Header base; static Header *freep; void free(void *ap) { 790: 55 push %ebp 791: 89 e5 mov %esp,%ebp 793: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 796: 8b 45 08 mov 0x8(%ebp),%eax 799: 83 e8 08 sub $0x8,%eax 79c: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 79f: a1 88 0c 00 00 mov 0xc88,%eax 7a4: 89 45 fc mov %eax,-0x4(%ebp) 7a7: eb 24 jmp 7cd <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 7a9: 8b 45 fc mov -0x4(%ebp),%eax 7ac: 8b 00 mov (%eax),%eax 7ae: 3b 45 fc cmp -0x4(%ebp),%eax 7b1: 77 12 ja 7c5 <free+0x35> 7b3: 8b 45 f8 mov -0x8(%ebp),%eax 7b6: 3b 45 fc cmp -0x4(%ebp),%eax 7b9: 77 24 ja 7df <free+0x4f> 7bb: 8b 45 fc mov -0x4(%ebp),%eax 7be: 8b 00 mov (%eax),%eax 7c0: 3b 45 f8 cmp -0x8(%ebp),%eax 7c3: 77 1a ja 7df <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7c5: 8b 45 fc mov -0x4(%ebp),%eax 7c8: 8b 00 mov (%eax),%eax 7ca: 89 45 fc mov %eax,-0x4(%ebp) 7cd: 8b 45 f8 mov -0x8(%ebp),%eax 7d0: 3b 45 fc cmp -0x4(%ebp),%eax 7d3: 76 d4 jbe 7a9 <free+0x19> 7d5: 8b 45 fc mov -0x4(%ebp),%eax 7d8: 8b 00 mov (%eax),%eax 7da: 3b 45 f8 cmp -0x8(%ebp),%eax 7dd: 76 ca jbe 7a9 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 7df: 8b 45 f8 mov -0x8(%ebp),%eax 7e2: 8b 40 04 mov 0x4(%eax),%eax 7e5: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 7ec: 8b 45 f8 mov -0x8(%ebp),%eax 7ef: 01 c2 add %eax,%edx 7f1: 8b 45 fc mov -0x4(%ebp),%eax 7f4: 8b 00 mov (%eax),%eax 7f6: 39 c2 cmp %eax,%edx 7f8: 75 24 jne 81e <free+0x8e> bp->s.size += p->s.ptr->s.size; 7fa: 8b 45 f8 mov -0x8(%ebp),%eax 7fd: 8b 50 04 mov 0x4(%eax),%edx 800: 8b 45 fc mov -0x4(%ebp),%eax 803: 8b 00 mov (%eax),%eax 805: 8b 40 04 mov 0x4(%eax),%eax 808: 01 c2 add %eax,%edx 80a: 8b 45 f8 mov -0x8(%ebp),%eax 80d: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 810: 8b 45 fc mov -0x4(%ebp),%eax 813: 8b 00 mov (%eax),%eax 815: 8b 10 mov (%eax),%edx 817: 8b 45 f8 mov -0x8(%ebp),%eax 81a: 89 10 mov %edx,(%eax) 81c: eb 0a jmp 828 <free+0x98> } else bp->s.ptr = p->s.ptr; 81e: 8b 45 fc mov -0x4(%ebp),%eax 821: 8b 10 mov (%eax),%edx 823: 8b 45 f8 mov -0x8(%ebp),%eax 826: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 828: 8b 45 fc mov -0x4(%ebp),%eax 82b: 8b 40 04 mov 0x4(%eax),%eax 82e: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 835: 8b 45 fc mov -0x4(%ebp),%eax 838: 01 d0 add %edx,%eax 83a: 3b 45 f8 cmp -0x8(%ebp),%eax 83d: 75 20 jne 85f <free+0xcf> p->s.size += bp->s.size; 83f: 8b 45 fc mov -0x4(%ebp),%eax 842: 8b 50 04 mov 0x4(%eax),%edx 845: 8b 45 f8 mov -0x8(%ebp),%eax 848: 8b 40 04 mov 0x4(%eax),%eax 84b: 01 c2 add %eax,%edx 84d: 8b 45 fc mov -0x4(%ebp),%eax 850: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 853: 8b 45 f8 mov -0x8(%ebp),%eax 856: 8b 10 mov (%eax),%edx 858: 8b 45 fc mov -0x4(%ebp),%eax 85b: 89 10 mov %edx,(%eax) 85d: eb 08 jmp 867 <free+0xd7> } else p->s.ptr = bp; 85f: 8b 45 fc mov -0x4(%ebp),%eax 862: 8b 55 f8 mov -0x8(%ebp),%edx 865: 89 10 mov %edx,(%eax) freep = p; 867: 8b 45 fc mov -0x4(%ebp),%eax 86a: a3 88 0c 00 00 mov %eax,0xc88 } 86f: c9 leave 870: c3 ret 00000871 <morecore>: static Header* morecore(uint nu) { 871: 55 push %ebp 872: 89 e5 mov %esp,%ebp 874: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 877: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 87e: 77 07 ja 887 <morecore+0x16> nu = 4096; 880: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 887: 8b 45 08 mov 0x8(%ebp),%eax 88a: c1 e0 03 shl $0x3,%eax 88d: 89 04 24 mov %eax,(%esp) 890: e8 43 fc ff ff call 4d8 <sbrk> 895: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 898: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 89c: 75 07 jne 8a5 <morecore+0x34> return 0; 89e: b8 00 00 00 00 mov $0x0,%eax 8a3: eb 22 jmp 8c7 <morecore+0x56> hp = (Header*)p; 8a5: 8b 45 f4 mov -0xc(%ebp),%eax 8a8: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 8ab: 8b 45 f0 mov -0x10(%ebp),%eax 8ae: 8b 55 08 mov 0x8(%ebp),%edx 8b1: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 8b4: 8b 45 f0 mov -0x10(%ebp),%eax 8b7: 83 c0 08 add $0x8,%eax 8ba: 89 04 24 mov %eax,(%esp) 8bd: e8 ce fe ff ff call 790 <free> return freep; 8c2: a1 88 0c 00 00 mov 0xc88,%eax } 8c7: c9 leave 8c8: c3 ret 000008c9 <malloc>: void* malloc(uint nbytes) { 8c9: 55 push %ebp 8ca: 89 e5 mov %esp,%ebp 8cc: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 8cf: 8b 45 08 mov 0x8(%ebp),%eax 8d2: 83 c0 07 add $0x7,%eax 8d5: c1 e8 03 shr $0x3,%eax 8d8: 40 inc %eax 8d9: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 8dc: a1 88 0c 00 00 mov 0xc88,%eax 8e1: 89 45 f0 mov %eax,-0x10(%ebp) 8e4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 8e8: 75 23 jne 90d <malloc+0x44> base.s.ptr = freep = prevp = &base; 8ea: c7 45 f0 80 0c 00 00 movl $0xc80,-0x10(%ebp) 8f1: 8b 45 f0 mov -0x10(%ebp),%eax 8f4: a3 88 0c 00 00 mov %eax,0xc88 8f9: a1 88 0c 00 00 mov 0xc88,%eax 8fe: a3 80 0c 00 00 mov %eax,0xc80 base.s.size = 0; 903: c7 05 84 0c 00 00 00 movl $0x0,0xc84 90a: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 90d: 8b 45 f0 mov -0x10(%ebp),%eax 910: 8b 00 mov (%eax),%eax 912: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 915: 8b 45 f4 mov -0xc(%ebp),%eax 918: 8b 40 04 mov 0x4(%eax),%eax 91b: 3b 45 ec cmp -0x14(%ebp),%eax 91e: 72 4d jb 96d <malloc+0xa4> if(p->s.size == nunits) 920: 8b 45 f4 mov -0xc(%ebp),%eax 923: 8b 40 04 mov 0x4(%eax),%eax 926: 3b 45 ec cmp -0x14(%ebp),%eax 929: 75 0c jne 937 <malloc+0x6e> prevp->s.ptr = p->s.ptr; 92b: 8b 45 f4 mov -0xc(%ebp),%eax 92e: 8b 10 mov (%eax),%edx 930: 8b 45 f0 mov -0x10(%ebp),%eax 933: 89 10 mov %edx,(%eax) 935: eb 26 jmp 95d <malloc+0x94> else { p->s.size -= nunits; 937: 8b 45 f4 mov -0xc(%ebp),%eax 93a: 8b 40 04 mov 0x4(%eax),%eax 93d: 89 c2 mov %eax,%edx 93f: 2b 55 ec sub -0x14(%ebp),%edx 942: 8b 45 f4 mov -0xc(%ebp),%eax 945: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 948: 8b 45 f4 mov -0xc(%ebp),%eax 94b: 8b 40 04 mov 0x4(%eax),%eax 94e: c1 e0 03 shl $0x3,%eax 951: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 954: 8b 45 f4 mov -0xc(%ebp),%eax 957: 8b 55 ec mov -0x14(%ebp),%edx 95a: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 95d: 8b 45 f0 mov -0x10(%ebp),%eax 960: a3 88 0c 00 00 mov %eax,0xc88 return (void*)(p + 1); 965: 8b 45 f4 mov -0xc(%ebp),%eax 968: 83 c0 08 add $0x8,%eax 96b: eb 38 jmp 9a5 <malloc+0xdc> } if(p == freep) 96d: a1 88 0c 00 00 mov 0xc88,%eax 972: 39 45 f4 cmp %eax,-0xc(%ebp) 975: 75 1b jne 992 <malloc+0xc9> if((p = morecore(nunits)) == 0) 977: 8b 45 ec mov -0x14(%ebp),%eax 97a: 89 04 24 mov %eax,(%esp) 97d: e8 ef fe ff ff call 871 <morecore> 982: 89 45 f4 mov %eax,-0xc(%ebp) 985: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 989: 75 07 jne 992 <malloc+0xc9> return 0; 98b: b8 00 00 00 00 mov $0x0,%eax 990: eb 13 jmp 9a5 <malloc+0xdc> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 992: 8b 45 f4 mov -0xc(%ebp),%eax 995: 89 45 f0 mov %eax,-0x10(%ebp) 998: 8b 45 f4 mov -0xc(%ebp),%eax 99b: 8b 00 mov (%eax),%eax 99d: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 9a0: e9 70 ff ff ff jmp 915 <malloc+0x4c> } 9a5: c9 leave 9a6: c3 ret
34.333333
64
0.423848
1389036df5329842e6468403fab6877f61a7d203
6,325
asm
Assembly
Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48_notsx.log_2025_445.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48_notsx.log_2025_445.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48_notsx.log_2025_445.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 %r8 push %r9 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x11c2, %r12 nop nop nop nop nop add $2492, %rdi mov $0x6162636465666768, %rbp movq %rbp, %xmm6 vmovups %ymm6, (%r12) nop nop sub $154, %r8 lea addresses_WC_ht+0xa28a, %r9 inc %rdx mov (%r9), %r8w nop nop nop nop nop xor %r12, %r12 lea addresses_A_ht+0xb86a, %rbp nop nop nop nop nop sub %rbx, %rbx vmovups (%rbp), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %r8 nop nop nop and $63758, %rbx lea addresses_D_ht+0x1b2b0, %rsi lea addresses_WT_ht+0xcb9e, %rdi nop nop and $38499, %rbp mov $20, %rcx rep movsw add $43529, %r12 lea addresses_normal_ht+0xa22a, %rsi nop nop nop mfence mov (%rsi), %r12d nop dec %r8 lea addresses_WC_ht+0x3dea, %r12 nop nop sub %rcx, %rcx mov (%r12), %rsi nop nop nop sub $54557, %rbp lea addresses_WC_ht+0x11e6a, %rdx nop xor $28125, %rcx mov (%rdx), %r9 nop inc %rcx lea addresses_WT_ht+0x10915, %rdi nop nop nop nop sub %r9, %r9 mov $0x6162636465666768, %rbx movq %rbx, %xmm4 vmovups %ymm4, (%rdi) nop nop nop nop dec %r9 lea addresses_D_ht+0xd034, %rbx nop nop nop nop nop add $52965, %rdi mov (%rbx), %r9 cmp %r12, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %rax push %rbp push %rbx push %rcx // Load lea addresses_normal+0x206a, %rbx nop nop nop add %rcx, %rcx movb (%rbx), %al nop nop nop nop cmp %rax, %rax // Faulty Load mov $0x86a, %r13 dec %r10 mov (%r13), %rcx lea oracles, %rax and $0xff, %rcx shlq $12, %rcx mov (%rax,%rcx,1), %rcx pop %rcx pop %rbx pop %rbp pop %rax pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_P', 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_normal', 'congruent': 11}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_P', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 1}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 2}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 11}} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 9}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 0}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 0}} {'00': 2025} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
36.560694
2,999
0.654704
7fb39017ff12c062a3f128806d02e046edd0f291
1,924
asm
Assembly
test/sk.asm
kspalaiologos/asmbf
c98a51d61724a46855de291a27d68a49a034810b
[ "MIT" ]
67
2020-08-03T06:26:35.000Z
2022-03-24T19:50:51.000Z
test/sk.asm
pyautogui/asmbf
37c54a8a62df2fc4bab28bdeb43237b4905cbecd
[ "MIT" ]
55
2019-10-02T19:37:08.000Z
2020-06-12T19:40:53.000Z
test/sk.asm
pyautogui/asmbf
37c54a8a62df2fc4bab28bdeb43237b4905cbecd
[ "MIT" ]
9
2019-05-18T11:59:41.000Z
2020-06-21T20:40:25.000Z
[bits 8] stk 38 org 0 &heap db 2 &changed db 0 #call("read") @loop #call("eval") rcl r2, *changed vxcall sto *changed, 0 jnz r2, %loop push 0 @P push r2 add r1, 2 rcl r2, r1 sub r1, 2 jz r2, %PS dec r2 jz r2, %PK out .( mov r2, r1 rcl r1, r2 #call("P") inc r2 rcl r1, r2 #call("P") out .) pop r2 ret @PS out .S pop r2 ret @PK out .K pop r2 ret @A rcl f3, *heap add f3, 2 sto f3, r1 inc f3 ots f3, *heap sub f3, 3 mov r1, f3 ret @read push r2 in r2 ceq r2, .S cjnz %RS ceq r2, .K cjnz %RK mov r1, 2 #call("A") mov r2, r1 #call("read") sto r2, r1 #call("read") inc r2 sto r2, r1 dec r2 mov r1, r2 in r2 pop r2 ret @RS mov r1, 0 #call("A") pop r2 ret @RK mov r1, 1 #call("A") pop r2 ret @eval push r2 push r3 rcl r2, r1 jz r2, %skip rcl r3, r2 jz r3, %skip add r3, 2 rcl r4, r3 cne r4, 1 cjnz %skip inc r2 rcl r3, r2 mov r1, r3 vxcall sto *changed, 1 jmp %not_bi @skip rcl r2, r1 jz r2, %notS rcl r3, r2 jz r3, %notS rcl r4, r3 jz r4, %notS add r4, 2 rcl r2, r4 jnz r2, %notS inc r1 rcl r6, r1 dec r1 rcl r2, r1 rcl r3, r2 inc r2 inc r3 rcl r5, r2 rcl r4, r3 mov r1, 2 #call("A") mov r2, r1 mov r1, 2 #call("A") sto r2, r1 sto r1, r4 inc r1 sto r1, r6 mov r1, 2 #call("A") inc r2 sto r2, r1 dec r2 sto r1, r5 inc r1 sto r1, r6 mov r1, r2 vxcall sto *changed, 1 jmp %not_bi @notS rcl r2, r1 cge r2, 2 cjz %not_bi mov r3, r1 rcl r1, r3 #call("eval") sto r3, r1 inc r3 rcl r1, r3 #call("eval") sto r3, r1 dec r3 mov r1, r3 @not_bi pop r3 pop r2 ret
12.177215
26
0.476611
5f9193d3bf0e980f4f40f1850e25937bbc766ff2
518
asm
Assembly
programs/oeis/139/A139609.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/139/A139609.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/139/A139609.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A139609: a(n) = 36*n + 9. ; 9,45,81,117,153,189,225,261,297,333,369,405,441,477,513,549,585,621,657,693,729,765,801,837,873,909,945,981,1017,1053,1089,1125,1161,1197,1233,1269,1305,1341,1377,1413,1449,1485,1521,1557,1593,1629,1665,1701,1737,1773,1809,1845,1881,1917,1953,1989,2025,2061,2097,2133,2169,2205,2241,2277,2313,2349,2385,2421,2457,2493,2529,2565,2601,2637,2673,2709,2745,2781,2817,2853,2889,2925,2961,2997,3033,3069,3105,3141,3177,3213,3249,3285,3321,3357,3393,3429,3465,3501,3537,3573 mul $0,36 add $0,9
86.333333
469
0.756757
d2e8eb38bae3fd5a5268daa164a26d01f08d8d63
542
asm
Assembly
programs/oeis/176/A176100.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/176/A176100.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/176/A176100.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A176100: Even numbers that are not semiprimes, or, twice the nonprimes. ; 0,2,8,12,16,18,20,24,28,30,32,36,40,42,44,48,50,52,54,56,60,64,66,68,70,72,76,78,80,84,88,90,92,96,98,100,102,104,108,110,112,114,116,120,124,126,128,130,132,136,138,140,144,148,150,152,154,156,160,162,164 add $0,1 mov $1,100 lpb $1,36 mov $2,$0 mov $3,130665 lpb $3 cal $0,230980 ; Number of primes <= n, starting at n=0. sub $0,$2 mov $1,6 div $3,5 mov $5,1 lpe lpb $5 add $0,1 div $5,3 lpe lpe mov $1,$0 sub $1,1 mul $1,2
22.583333
207
0.616236
d7261aa213a11c1d99cf4a2aa69cfcd60ab4d688
1,075
asm
Assembly
Joypad.asm
sleepingburrito/BackIsle
546b4ac35136144c9103e0266bfa8d02a2834e17
[ "MIT" ]
1
2019-07-23T15:43:01.000Z
2019-07-23T15:43:01.000Z
Joypad.asm
sleepingburrito/BackIsle
546b4ac35136144c9103e0266bfa8d02a2834e17
[ "MIT" ]
null
null
null
Joypad.asm
sleepingburrito/BackIsle
546b4ac35136144c9103e0266bfa8d02a2834e17
[ "MIT" ]
null
null
null
SECTION "MAIN", ROM0[$0150] ;pull joypad state ;================= ;saves to joyPad in wram and A with flags set cp 0 (used to test if any key press) ReadJoypad: push HL ;http://gbdev.gg8.se/wiki/articles/Joypad_Input ld HL, joyPad ;set to buttons ld A, %00100000 ld [JOY_PAD_REG], A ;read button ld A, [JOY_PAD_REG] ;read to stabilize ld A, [JOY_PAD_REG] ;filter buttons and swap it, then save it and A, %00001111 swap A ld [HL], A ;switch to dpad ld A, %00010000 ld [JOY_PAD_REG], A ;read dpad ld A, [JOY_PAD_REG] ;read to stabilize ld A, [JOY_PAD_REG] ;combining with buttons and save and A, %00001111 or A, [HL] xor a, %11111111 ld [HL], a ;exit pop HL CCTZ ret z ld [joyPadLast], A ;save last key press if not zero ret ;Pause game till user presses a key ;================================== ;clobbers A PauseAnyKey: HaltCounter call ReadJoypad CCTZ jp z, PauseAnyKey ret
21.078431
83
0.56186
4d11c67c360a5850fb3ca991e5701f38d8140b75
429
asm
Assembly
programs/oeis/122/A122670.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/122/A122670.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/122/A122670.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A122670: If n mod 4 = 2 or n mod 4 = 3 then a(n) = 0 else let m=floor(n/4), then a(n) = (2*m)!/m!. ; 1,1,0,0,2,2,0,0,12,12,0,0,120,120,0,0,1680,1680,0,0,30240,30240,0,0,665280,665280,0,0,17297280,17297280,0,0,518918400,518918400,0,0,17643225600,17643225600,0,0,670442572800,670442572800,0,0,28158588057600,28158588057600,0,0,1295295050649600 div $0,2 mov $1,1 lpb $0 sub $0,1 mul $1,2 mul $1,$0 trn $0,1 lpe mov $0,$1
33
242
0.671329