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
sequencelengths 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
sequencelengths 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
sequencelengths 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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35c4c9828a5cdf3a73cc116c1f38f66eec11b9fb | 11,711 | asm | Assembly | Source/HBIOS/eastaegg.asm | davidknoll/RomWBW | 8a7bc97fea27bf10a23c61ee508522a60e2909c6 | [
"DOC",
"MIT"
] | 194 | 2015-08-20T03:18:01.000Z | 2022-03-27T02:25:00.000Z | Source/HBIOS/eastaegg.asm | davidknoll/RomWBW | 8a7bc97fea27bf10a23c61ee508522a60e2909c6 | [
"DOC",
"MIT"
] | 234 | 2017-03-30T10:59:54.000Z | 2022-03-26T20:05:52.000Z | Source/HBIOS/eastaegg.asm | davidknoll/RomWBW | 8a7bc97fea27bf10a23c61ee508522a60e2909c6 | [
"DOC",
"MIT"
] | 68 | 2016-12-18T18:20:12.000Z | 2022-03-20T16:02:40.000Z | ; Adapted from https://rosettacode.org/wiki/Mandelbrot_set#Z80_Assembly
; by Phillip Summers difficultylevelhigh@gmail.com
;
; WBWROM SBV V2 Easteregg
;
; Compute a Mandelbrot set on a simple Z80 computer.
;
; Porting this program to another Z80 platform should be easy and straight-
; forward: The only dependencies on my homebrew machine are the system-calls
; used to print strings and characters. These calls are performed by loading
; IX with the number of the system-call and performing an RST 08. To port this
; program to another operating system just replace these system-calls with
; the appropriate versions. Only three system-calls are used in the following:
; _crlf: Prints a CR/LF, _puts: Prints a 0-terminated string (the adress of
; which is expected in HL), and _putc: Print a single character which is
; expected in A. RST 0 give control back to the monitor.
;
#include "std.asm"
cr .equ 0dh
lf .equ 0ah
eos .equ 00h
.org EGG_LOC
scale .equ 256 ; Do NOT change this - the
; arithmetic routines rely on
; this scaling factor! :-)
divergent .equ scale * 4
ld sp,HBX_LOC
ld hl, welcome ; Print a welcome message
call _puts
; for (y = <initial_value> ; y <= y_end; y += y_step)
; {
outer_loop ld hl, (y_end) ; Is y <= y_end?
ld de, (y)
and a ; Clear carry
sbc hl, de ; Perform the comparison
jp m, mandel_end ; End of outer loop reached
; for (x = x_start; x <= x_end; x += x_step)
; {
ld hl, (x_start) ; x = x_start
ld (x), hl
inner_loop ld hl, (x_end) ; Is x <= x_end?
ld de, (x)
and a
sbc hl, de
jp m, inner_loop_end ; End of inner loop reached
; z_0 = z_1 = 0;
ld hl, 0
ld (z_0), hl
ld (z_1), hl
; for (iteration = iteration_max; iteration; iteration--)
; {
ld a, (iteration_max)
ld b, a
iteration_loop push bc ; iteration -> stack
; z2 = (z_0 * z_0 - z_1 * z_1) / SCALE;
ld de, (z_1) ; Compute DE HL = z_1 * z_1
ld b,d
ld c,e
call mul_16
ld (z_0_square_low), hl ; z_0 ** 2 is needed later again
ld (z_0_square_high), de
ld de, (z_0) ; Compute DE HL = z_0 * z_0
ld b,d
ld c,e
call mul_16
ld (z_1_square_low), hl ; z_1 ** 2 will be also needed
ld (z_1_square_high), de
and a ; Compute subtraction
ld bc, (z_0_square_low)
sbc hl, bc
ld (scratch_0), hl ; Save lower 16 bit of result
ld h,d
ld l,e
ld bc, (z_0_square_high)
sbc hl, bc
ld bc, (scratch_0) ; HL BC = z_0 ** 2 - z_1 ** 2
ld c, b ; Divide by scale = 256
ld b, l ; Discard the rest
push bc ; We need BC later
; z3 = 2 * z0 * z1 / SCALE;
ld hl, (z_0) ; Compute DE HL = 2 * z_0 * z_1
add hl, hl
ld d,h
ld e,l
ld bc, (z_1)
call mul_16
ld b, e ; Divide by scale (= 256)
ld c, h ; BC contains now z_3
; z1 = z3 + y;
ld hl, (y)
add hl, bc
ld (z_1), hl
; z_0 = z_2 + x;
pop bc ; Here BC is needed again :-)
ld hl, (x)
add hl, bc
ld (z_0), hl
; if (z0 * z0 / SCALE + z1 * z1 / SCALE > 4 * SCALE)
ld hl, (z_0_square_low) ; Use the squares computed
ld de, (z_1_square_low) ; above
add hl, de
ld b,h ; BC contains lower word of sum
ld c,l
ld hl, (z_0_square_high)
ld de, (z_1_square_high)
adc hl, de
ld h, l ; HL now contains (z_0 ** 2 +
ld l, b ; z_1 ** 2) / scale
ld bc, divergent
and a
sbc hl, bc
; break;
jp c, iteration_dec ; No break
pop bc ; Get latest iteration counter
jr iteration_end ; Exit loop
; iteration++;
iteration_dec pop bc ; Get iteration counter
djnz iteration_loop ; We might fall through!
; }
iteration_end
; printf("%c", display[iteration % 7]);
ld a, b
and $7 ; lower three bits only (c = 0)
sbc hl, hl
ld l, a
ld de, display ; Get start of character array
add hl, de ; address and load the
ld a, (hl) ; character to be printed
call _putc ; Print the character
ld de, (x_step) ; x += x_step
ld hl, (x)
add hl, de
ld (x), hl
jp inner_loop
; }
; printf("\n");
inner_loop_end call _putcrlf ; Print a CR/LF pair
ld de, (y_step) ; y += y_step
ld hl, (y)
add hl, de
ld (y), hl ; Store new y-value
jp outer_loop
; }
mandel_end ld hl, finished ; Print finished-message
call _puts
; GET CONSOLE INPUT STATUS VIA HBIOS
waitch
#IF (BIOS == BIOS_WBW)
LD C,CIO_CONSOLE ; CONSOLE UNIT TO C
LD B,BF_CIOIN ; HBIOS FUNC: INPUT CHAR
RST 08 ; DO IT
; RETURN TO THE LOADER
LD A,BID_BOOT ; BOOT BANK
LD HL,0 ; ADDRESS ZERO
CALL HB_BNKCALL ; DOES NOT RETURN
HALT
#ENDIF
#IF (BIOS == BIOS_UNA)
LD B,0 ; CONSOLE UNIT TO B
LD C,BF_CIOIN ; UBIOS FUNC: INPUT CHAR
CALL $FFFD ; DO IT
; RETURN TO THE LOADER
LD BC,$01FB ; UNA FUNC = SET BANK
LD DE,0 ; ROM BANK 0
CALL $FFFD ; DO IT
JP 0 ; JUMP TO RESTART ADDRESS
#ENDIF
_putcrlf ld hl, crlf
_puts push af
puts0 ld a,(hl)
cp eos
jr z,puts1
call _putc
inc hl
jr puts0
puts1 pop af
ret
_putc
#IF (BIOS == BIOS_WBW)
PUSH AF
PUSH BC
PUSH DE
PUSH HL
LD E,A ; OUTPUT CHAR TO E
LD C,CIO_CONSOLE ; CONSOLE UNIT TO C
LD B,BF_CIOOUT ; HBIOS FUNC: OUTPUT CHAR
RST 08 ; HBIOS OUTPUTS CHARACTDR
POP HL
POP DE
POP BC
POP AF
RET
#ENDIF
#IF (BIOS == BIOS_UNA)
PUSH AF
PUSH BC
PUSH DE
PUSH HL
LD E,A ; OUTPUT CHAR TO E
LD B,0 ; CONSOLE UNIT TO B
LD C,BF_CIOOUT ; UBIOS FUNC: OUTPUT CHAR
CALL $FFFD ; UBIOS OUTPUTS CHARACTDR
POP HL
POP DE
POP BC
POP AF
RET
#ENDIF
welcome .db "Generating a Mandelbrot set..."
.db cr, lf, cr, lf, eos
finished .db "Computation finished."
crlf .db cr, lf, eos
iteration_max .db 10 ; How many iterations
x .dw 0 ; x-coordinate
x_start .dw -2 * scale ; Minimum x-coordinate
x_end .dw 5 * scale / 10 ; Maximum x-coordinate
x_step .dw 4 * scale / 100 ; x-coordinate step-width
y .dw -1 * scale ; Minimum y-coordinate
y_end .dw 1 * scale ; Maximum y-coordinate
y_step .dw 1 * scale / 10 ; y-coordinate step-width
z_0 .dw 0 ;0
z_1 .dw 0 ;0
scratch_0 .dw 0
z_0_square_high .dw 0
z_0_square_low .dw 0
z_1_square_high .dw 0
z_1_square_low .dw 0
display .db " .-+*=#@" ; 8 characters for the display
;
; Compute DEHL = BC * DE (signed): This routine is not too clever but it
; works. It is based on a standard 16-by-16 multiplication routine for unsigned
; integers. At the beginning the sign of the result is determined based on the
; signs of the operands which are negated if necessary. Then the unsigned
; multiplication takes place, followed by negating the result if necessary.
;
mul_16 xor a ; Clear carry and A (-> +)
bit 7, b ; Is BC negative?
jr z, bc_positive ; No
sub c ; A is still zero, complement
ld c, a
ld a, 0
sbc a, b
ld b, a
scf ; Set carry (-> -)
bc_positive bit 7, D ; Is DE negative?
jr z, de_positive ; No
push af ; Remember carry for later!
xor a
sub e
ld e, a
ld a, 0
sbc a, d
ld d, a
pop af ; Restore carry for complement
ccf ; Complement Carry (-> +/-?)
de_positive push af ; Remember state of carry
and a ; Start multiplication
sbc hl, hl
ld a, 16 ; 16 rounds
mul_16_loop add hl, hl
rl e
rl d
jr nc, mul_16_exit
add hl, bc
jr nc, mul_16_exit
inc de
mul_16_exit dec a
jr nz, mul_16_loop
pop af ; Restore carry from beginning
ret nc ; No sign inversion necessary
xor a ; Complement DE HL
sub l
ld l, a
ld a, 0
sbc a, h
ld h, a
ld a, 0
sbc a, e
ld e, a
ld a, 0
sbc a, d
ld d, a
ret
lastbyte .equ $
SLACK .EQU (EGG_END - lastbyte)
.FILL SLACK,'e'
;
.ECHO "EASTEREGG space remaining: "
.ECHO SLACK
.ECHO " bytes.\n"
.end
| 35.274096 | 81 | 0.413543 |
1a8e68b29515d13cffbd57e41b376fa49856996e | 54 | asm | Assembly | src/tiles05.asm | fjpena/sword-of-ianna-msx2 | f104f46a677e4b21f42fbed478307a0bb1d372f3 | [
"Apache-2.0"
] | 43 | 2017-10-21T23:01:25.000Z | 2022-02-21T17:45:11.000Z | src/tiles05.asm | fjpena/sword-of-ianna-msx2 | f104f46a677e4b21f42fbed478307a0bb1d372f3 | [
"Apache-2.0"
] | null | null | null | src/tiles05.asm | fjpena/sword-of-ianna-msx2 | f104f46a677e4b21f42fbed478307a0bb1d372f3 | [
"Apache-2.0"
] | 6 | 2017-10-23T05:48:50.000Z | 2022-01-06T03:11:49.000Z | org $8000
tilestest: INCBIN "tiles_nivel05.SR5.plet1"
| 18 | 43 | 0.796296 |
f436175aa7dd1a048c0c7255541f8ba0dbdd3c10 | 1,281 | nasm | Assembly | Microprocessor lab/bubbleSort/bubbleSort.nasm | IamVaibhavsar/Second_Year_Lab_Assignments | dec3a0d4e71bc30820948d40d4e073b1d3e1da98 | [
"MIT"
] | 34 | 2020-02-09T08:42:49.000Z | 2022-03-01T09:04:53.000Z | Microprocessor lab/bubbleSort/bubbleSort.nasm | MXNXV/Second_Year_Lab_Assignments | dec3a0d4e71bc30820948d40d4e073b1d3e1da98 | [
"MIT"
] | 1 | 2020-10-16T15:41:43.000Z | 2020-10-16T16:03:50.000Z | Microprocessor lab/bubbleSort/bubbleSort.nasm | MXNXV/Second_Year_Lab_Assignments | dec3a0d4e71bc30820948d40d4e073b1d3e1da98 | [
"MIT"
] | 34 | 2020-01-07T08:47:42.000Z | 2022-03-29T16:45:56.000Z | %include"macro.nasm"
;Write X86 program to sort the list of integers in ascending/descending order. Read the input
;from the text file and write the sorted data back to the same text file using bubble sort
global _start
_start:
section .text
pop rcx ;3
pop rcx ;assg8.asm
pop rcx ;t3.txt
mov [filename],rcx
fopen [filename]
cmp rax,-1H
je error
mov [filehandle],rax
fread [filehandle],buffer,buf_len
dec rax
mov [ac_buf_len],rax
display buffer,[ac_buf_len]
call bubble_sort
fwrite [filehandle],buffer,[ac_buf_len]
fclose [filehandle]
jmp exit
error:
display msg2,len2
exit:
mov rax,60
mov rdi,0
syscall
bubble_sort:
mov cl,byte[ac_buf_len]
mov [cnt1],cl ;cnt1=total no. of elements
ol:
mov cl,byte[ac_buf_len]
dec cl ;no of passes
mov [cnt2],cl ;cnt2=number of elements-1
mov rsi,buffer
mov rdi,buffer
inc rdi
il:
mov al,[rsi]
mov bl,[rdi]
cmp al,bl
jbe l1
mov [rsi],bl ;swapping
mov [rdi],al
l1:
inc rsi
inc rdi
dec byte[cnt2]
jnz il
dec byte[cnt1]
jnz ol
ret
section .data
msg2 db 10,"file opening is unsuccessful"
len2 equ $-msg2
section .bss
filename resb 100
buffer resb 100
buf_len resb 100
ac_buf_len resb 100
filehandle resb 100
cnt1 resb 50
cnt2 resb 50
| 14.724138 | 93 | 0.696331 |
e4844515e4377932c9ca3562279a67dce89866cc | 1,766 | asm | Assembly | sort/bubblesort.asm | MrRaffo/c64routines | 30cbef07dab66360ba83dd8d98c6ff4c6ca92d28 | [
"MIT"
] | null | null | null | sort/bubblesort.asm | MrRaffo/c64routines | 30cbef07dab66360ba83dd8d98c6ff4c6ca92d28 | [
"MIT"
] | null | null | null | sort/bubblesort.asm | MrRaffo/c64routines | 30cbef07dab66360ba83dd8d98c6ff4c6ca92d28 | [
"MIT"
] | null | null | null | ;==================
; BUBBLE SORT
;==================
;SORT_Bubble8Bit
; sorts a list of unsigned bytes in place, not entirely useless for C64
; as sprite multiplexors use 'almost' sorted lists and so bubble sort can
; exit early when handling them
; PARAM1 - low byte of address of first item in list
; PARAM2 - high byte of address of first item in list
; PARAM3 - length of list, number of items to sort
; RETVAL1 - number of passes to sort
!zone SORT_Bubble8Bit
SORT_Bubble8Bit
lda PARAM1
sta ZEROPAGE_POINTER_1
lda PARAM2
sta ZEROPAGE_POINTER_1 + 1
dec PARAM3 ; size of list
ldx #$00 ; did a swap happen?
ldy #$00 ; zeropage addressing offset
sty RETVAL1 ; number of passes
.BubbleLoop
lda (ZEROPAGE_POINTER_1),y
iny
cmp (ZEROPAGE_POINTER_1),y
; carry is set if number in accumulator is larger than one encountered
bcc .NoSwapNeeded
beq .NoSwapNeeded
.SwapValues
; make the swap, this could probably be more efficient
inx ; register that a swap happened
sta PARAM4
lda (ZEROPAGE_POINTER_1),y
dey
sta (ZEROPAGE_POINTER_1),y
iny
lda PARAM4
sta (ZEROPAGE_POINTER_1),y
.NoSwapNeeded
cpy PARAM3 ; check if we've hit the end of the list
bne .BubbleLoop
.CheckEndOfLoop
; this should be hit at the end of every pass
inc RETVAL1
cpx #$00 ; check if no exchanges were needed and exit early
beq .BubbleDone
ldy #$00 ; prepare for another pass
ldx #$00
jmp .BubbleLoop
.BubbleDone
| 27.169231 | 79 | 0.589468 |
22c05b6b15282e3823a7df0b72d628fcdea5c1e9 | 3,999 | asm | Assembly | x86-methods2.asm | mfleming/uarch-bench | a87790f76e02913fdafa2723fb0c99c485c93822 | [
"MIT"
] | 501 | 2017-06-01T23:20:31.000Z | 2022-03-22T06:52:09.000Z | x86-methods2.asm | mfleming/uarch-bench | a87790f76e02913fdafa2723fb0c99c485c93822 | [
"MIT"
] | 90 | 2017-06-01T23:54:34.000Z | 2021-10-30T00:31:02.000Z | x86-methods2.asm | mfleming/uarch-bench | a87790f76e02913fdafa2723fb0c99c485c93822 | [
"MIT"
] | 42 | 2018-01-22T12:58:53.000Z | 2022-02-16T06:45:41.000Z |
%include "x86-helpers.asm"
nasm_util_assert_boilerplate
thunk_boilerplate
; segregate some particular benchamrk here if you want to repeatedly compile different versions of it quickly
%ifndef UNROLLB
;%warning 'UNROLLB' defined to default of 1
%define UNROLLB 1
%endif
%ifndef UNROLLX
;%warning UNROLLX defined to default of 1
%define UNROLLX 1
%else
;%warning 'UNROLLX' defined externally to UNROLLX
%endif
;; do a loop over the first half of all the cache linnes, then loop
;; over the second half
;; performance is crap
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
define_bench bandwidth_test256_2loops
mov rdx, [rsi + region.size]
mov rsi, [rsi + region.start]
.top:
mov rax, rdx
mov rcx, rsi
lfence
vpxor ymm0, ymm0, ymm0
vpxor ymm1, ymm1, ymm1
vpxor ymm2, ymm2, ymm2
.inner:
mov r9, rcx
lea r8, [rcx + UNROLLB * 64]
.firsttop:
vpaddb ymm0, ymm0, [rcx]
add rcx, 64
cmp rcx, r8
jb .firsttop
lea rcx, [r9 + 32]
lea r8, [rcx + UNROLLB * 64]
.secondtop:
vpaddb ymm1, ymm1, [rcx]
vpaddb ymm2, ymm2, [rcx + 64]
add rcx, 128
cmp rcx, r8
jb .secondtop
mov rcx, r9
add rcx, UNROLLB * 64
sub rax, UNROLLB * 64
jge .inner
dec rdi
jnz .top
ret
;; Interleaved 2-pass
;; the main loop does UNROLLB first half reads
;; then does UNROLLB second half reads hopefully finding the line in L1
;; OK but very jaggy performance
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
define_bench bandwidth_test256_2pass
mov rdx, [rsi + region.size]
mov rsi, [rsi + region.start]
.top:
mov rax, rdx
mov rcx, rsi
lfence
vpxor ymm0, ymm0, ymm0
vpxor ymm1, ymm1, ymm1
.inner:
%assign offset 0
%rep UNROLLB
vpaddb ymm0, ymm0, [rcx + offset]
%assign offset (offset + 64)
%endrep
%assign offset 32
%rep UNROLLB/2
vpaddb ymm0, ymm0, [rcx + offset]
vpaddb ymm1, ymm1, [rcx + offset + 64]
%assign offset (offset + 128)
%endrep
%if (UNROLLB % 2 == 1)
vpaddb ymm0, ymm0, [rcx + offset]
%endif
add rcx, UNROLLB * 64
sub rax, UNROLLB * 64
jge .inner
dec rdi
jnz .top
ret
;; the main loop interleaves in a fine-grained way an initial access
;; to a cache line, and then the second access to the cache line with
;; the former running UNROLLB lines ahead of the latter (once UNROLLB
;; gets to about 5 or 6 it seems the second access hits in L1 and max
;; speed is achieved) - good and very flat performance approaching
;; exactly 1.5 cycles/line
;;
;; UNROLLX must be even for it to work properly (to "pair up" the reads hitting L1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
define_bench bandwidth_test256i
mov rdx, [rsi + region.size]
mov rsi, [rsi + region.start]
.top:
mov rax, rdx
sub rax, UNROLLB * 64 ; reduce main loop iterations since the intro/outro parts handle this
mov rcx, rsi
lfence
vpxor ymm0, ymm0, ymm0
vpxor ymm1, ymm1, ymm1
vpxor ymm2, ymm1, ymm1
; lead-in loop which reads the first half of the first UNROLLB cache lines
%assign offset 0
%rep UNROLLB
vpaddb ymm0, ymm0, [rcx + offset]
%assign offset (offset + 64)
%endrep
.inner:
%assign offset 0
%rep UNROLLX
vpaddb ymm0, ymm0, [rcx + offset + UNROLLB * 64]
%assign offset (offset + 64)
%endrep
%assign offset 0
%rep UNROLLX
vpaddb ymm1, ymm1, [rcx + offset + 32]
%assign offset (offset + 64)
%endrep
add rcx, UNROLLX * 64
sub rax, UNROLLX * 64
jge .inner
; lead out loop to read the remaining lines
%assign offset 0
%rep UNROLLB
vpaddb ymm0, ymm0, [rcx + offset]
%assign offset (offset + 64)
%endrep
dec rdi
jnz .top
ret
define_bench movd_xmm
vzeroall
.top:
%rep 100
vpor xmm0, xmm0, xmm0
movd eax, xmm0
movd xmm0, eax
%endrep
dec rdi
jnz .top
ret
define_bench movd_ymm
vzeroupper
vpor ymm0, ymm0, ymm0
.top:
%rep 100
vpor ymm0, ymm0, ymm0
movd eax, xmm0
movd xmm0, eax
%endrep
dec rdi
jnz .top
ret
define_bench rep_movsb
sub rsp, 1024
mov r8, rdi
.top:
%rep 100
mov ecx, 1024
mov rdi, rsp
rep stosb
%endrep
dec r8
jnz .top
add rsp, 1024
ret
| 18.686916 | 109 | 0.669167 |
d9381247dd0c51764ac89c6d76bd7e84673a9134 | 375 | asm | Assembly | programs/oeis/159/A159699.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/159/A159699.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/159/A159699.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A159699: Replace 2^k in binary expansion of n with A045623(k+1).
; 0,2,5,7,12,14,17,19,28,30,33,35,40,42,45,47,64,66,69,71,76,78,81,83,92,94,97,99,104,106,109,111,144,146,149,151,156,158,161,163,172,174,177,179,184,186,189,191,208,210,213,215,220,222,225,227,236,238,241,243
mov $2,$0
mul $2,2
mov $1,$2
seq $1,6520 ; Partial sums of A006519.
add $1,$0
mov $0,$1
div $0,2
| 34.090909 | 209 | 0.68 |
09264b66690ff36cbaa90e2a273f6cf5cb76b0b0 | 49,437 | asm | Assembly | user/ls.asm | Hasnain62/xv6-Procject | 93162ef8e9be42a4b506a1f97bcd7e054bc35ffe | [
"MIT-0"
] | null | null | null | user/ls.asm | Hasnain62/xv6-Procject | 93162ef8e9be42a4b506a1f97bcd7e054bc35ffe | [
"MIT-0"
] | null | null | null | user/ls.asm | Hasnain62/xv6-Procject | 93162ef8e9be42a4b506a1f97bcd7e054bc35ffe | [
"MIT-0"
] | null | null | null |
user/_ls: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <fmtname>:
#include "user/user.h"
#include "kernel/fs.h"
char*
fmtname(char *path)
{
0: 7179 addi sp,sp,-48
2: f406 sd ra,40(sp)
4: f022 sd s0,32(sp)
6: ec26 sd s1,24(sp)
8: e84a sd s2,16(sp)
a: e44e sd s3,8(sp)
c: 1800 addi s0,sp,48
e: 84aa mv s1,a0
static char buf[DIRSIZ+1];
char *p;
// Find first character after last slash.
for(p=path+strlen(path); p >= path && *p != '/'; p--)
10: 00000097 auipc ra,0x0
14: 30a080e7 jalr 778(ra) # 31a <strlen>
18: 02051793 slli a5,a0,0x20
1c: 9381 srli a5,a5,0x20
1e: 97a6 add a5,a5,s1
20: 02f00693 li a3,47
24: 0097e963 bltu a5,s1,36 <fmtname+0x36>
28: 0007c703 lbu a4,0(a5)
2c: 00d70563 beq a4,a3,36 <fmtname+0x36>
30: 17fd addi a5,a5,-1
32: fe97fbe3 bgeu a5,s1,28 <fmtname+0x28>
;
p++;
36: 00178493 addi s1,a5,1
// Return blank-padded name.
if(strlen(p) >= DIRSIZ)
3a: 8526 mv a0,s1
3c: 00000097 auipc ra,0x0
40: 2de080e7 jalr 734(ra) # 31a <strlen>
44: 2501 sext.w a0,a0
46: 47b5 li a5,13
48: 00a7fa63 bgeu a5,a0,5c <fmtname+0x5c>
return p;
memmove(buf, p, strlen(p));
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
return buf;
}
4c: 8526 mv a0,s1
4e: 70a2 ld ra,40(sp)
50: 7402 ld s0,32(sp)
52: 64e2 ld s1,24(sp)
54: 6942 ld s2,16(sp)
56: 69a2 ld s3,8(sp)
58: 6145 addi sp,sp,48
5a: 8082 ret
memmove(buf, p, strlen(p));
5c: 8526 mv a0,s1
5e: 00000097 auipc ra,0x0
62: 2bc080e7 jalr 700(ra) # 31a <strlen>
66: 00001997 auipc s3,0x1
6a: b0a98993 addi s3,s3,-1270 # b70 <buf.0>
6e: 0005061b sext.w a2,a0
72: 85a6 mv a1,s1
74: 854e mv a0,s3
76: 00000097 auipc ra,0x0
7a: 416080e7 jalr 1046(ra) # 48c <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
7e: 8526 mv a0,s1
80: 00000097 auipc ra,0x0
84: 29a080e7 jalr 666(ra) # 31a <strlen>
88: 0005091b sext.w s2,a0
8c: 8526 mv a0,s1
8e: 00000097 auipc ra,0x0
92: 28c080e7 jalr 652(ra) # 31a <strlen>
96: 1902 slli s2,s2,0x20
98: 02095913 srli s2,s2,0x20
9c: 4639 li a2,14
9e: 9e09 subw a2,a2,a0
a0: 02000593 li a1,32
a4: 01298533 add a0,s3,s2
a8: 00000097 auipc ra,0x0
ac: 29c080e7 jalr 668(ra) # 344 <memset>
return buf;
b0: 84ce mv s1,s3
b2: bf69 j 4c <fmtname+0x4c>
00000000000000b4 <ls>:
void
ls(char *path)
{
b4: d9010113 addi sp,sp,-624
b8: 26113423 sd ra,616(sp)
bc: 26813023 sd s0,608(sp)
c0: 24913c23 sd s1,600(sp)
c4: 25213823 sd s2,592(sp)
c8: 25313423 sd s3,584(sp)
cc: 25413023 sd s4,576(sp)
d0: 23513c23 sd s5,568(sp)
d4: 1c80 addi s0,sp,624
d6: 892a mv s2,a0
char buf[512], *p;
int fd;
struct dirent de;
struct stat st;
if((fd = open(path, 0)) < 0){
d8: 4581 li a1,0
da: 00000097 auipc ra,0x0
de: 4a4080e7 jalr 1188(ra) # 57e <open>
e2: 06054f63 bltz a0,160 <ls+0xac>
e6: 84aa mv s1,a0
fprintf(2, "ls: cannot open %s\n", path);
return;
}
if(fstat(fd, &st) < 0){
e8: d9840593 addi a1,s0,-616
ec: 00000097 auipc ra,0x0
f0: 4aa080e7 jalr 1194(ra) # 596 <fstat>
f4: 08054163 bltz a0,176 <ls+0xc2>
fprintf(2, "ls: cannot stat %s\n", path);
close(fd);
return;
}
switch(st.type){
f8: da041783 lh a5,-608(s0)
fc: 0007869b sext.w a3,a5
100: 4705 li a4,1
102: 08e68a63 beq a3,a4,196 <ls+0xe2>
106: 4709 li a4,2
108: 02e69663 bne a3,a4,134 <ls+0x80>
case T_FILE:
printf("%s %d %d %l\n", fmtname(path), st.type, st.ino, st.size);
10c: 854a mv a0,s2
10e: 00000097 auipc ra,0x0
112: ef2080e7 jalr -270(ra) # 0 <fmtname>
116: 85aa mv a1,a0
118: da843703 ld a4,-600(s0)
11c: d9c42683 lw a3,-612(s0)
120: da041603 lh a2,-608(s0)
124: 00001517 auipc a0,0x1
128: 98c50513 addi a0,a0,-1652 # ab0 <malloc+0x118>
12c: 00000097 auipc ra,0x0
130: 7b4080e7 jalr 1972(ra) # 8e0 <printf>
}
printf("%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
}
break;
}
close(fd);
134: 8526 mv a0,s1
136: 00000097 auipc ra,0x0
13a: 430080e7 jalr 1072(ra) # 566 <close>
}
13e: 26813083 ld ra,616(sp)
142: 26013403 ld s0,608(sp)
146: 25813483 ld s1,600(sp)
14a: 25013903 ld s2,592(sp)
14e: 24813983 ld s3,584(sp)
152: 24013a03 ld s4,576(sp)
156: 23813a83 ld s5,568(sp)
15a: 27010113 addi sp,sp,624
15e: 8082 ret
fprintf(2, "ls: cannot open %s\n", path);
160: 864a mv a2,s2
162: 00001597 auipc a1,0x1
166: 91e58593 addi a1,a1,-1762 # a80 <malloc+0xe8>
16a: 4509 li a0,2
16c: 00000097 auipc ra,0x0
170: 746080e7 jalr 1862(ra) # 8b2 <fprintf>
return;
174: b7e9 j 13e <ls+0x8a>
fprintf(2, "ls: cannot stat %s\n", path);
176: 864a mv a2,s2
178: 00001597 auipc a1,0x1
17c: 92058593 addi a1,a1,-1760 # a98 <malloc+0x100>
180: 4509 li a0,2
182: 00000097 auipc ra,0x0
186: 730080e7 jalr 1840(ra) # 8b2 <fprintf>
close(fd);
18a: 8526 mv a0,s1
18c: 00000097 auipc ra,0x0
190: 3da080e7 jalr 986(ra) # 566 <close>
return;
194: b76d j 13e <ls+0x8a>
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
196: 854a mv a0,s2
198: 00000097 auipc ra,0x0
19c: 182080e7 jalr 386(ra) # 31a <strlen>
1a0: 2541 addiw a0,a0,16
1a2: 20000793 li a5,512
1a6: 00a7fb63 bgeu a5,a0,1bc <ls+0x108>
printf("ls: path too long\n");
1aa: 00001517 auipc a0,0x1
1ae: 91650513 addi a0,a0,-1770 # ac0 <malloc+0x128>
1b2: 00000097 auipc ra,0x0
1b6: 72e080e7 jalr 1838(ra) # 8e0 <printf>
break;
1ba: bfad j 134 <ls+0x80>
strcpy(buf, path);
1bc: 85ca mv a1,s2
1be: dc040513 addi a0,s0,-576
1c2: 00000097 auipc ra,0x0
1c6: 110080e7 jalr 272(ra) # 2d2 <strcpy>
p = buf+strlen(buf);
1ca: dc040513 addi a0,s0,-576
1ce: 00000097 auipc ra,0x0
1d2: 14c080e7 jalr 332(ra) # 31a <strlen>
1d6: 1502 slli a0,a0,0x20
1d8: 9101 srli a0,a0,0x20
1da: dc040793 addi a5,s0,-576
1de: 00a78933 add s2,a5,a0
*p++ = '/';
1e2: 00190993 addi s3,s2,1
1e6: 02f00793 li a5,47
1ea: 00f90023 sb a5,0(s2)
printf("%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
1ee: 00001a17 auipc s4,0x1
1f2: 8eaa0a13 addi s4,s4,-1814 # ad8 <malloc+0x140>
printf("ls: cannot stat %s\n", buf);
1f6: 00001a97 auipc s5,0x1
1fa: 8a2a8a93 addi s5,s5,-1886 # a98 <malloc+0x100>
while(read(fd, &de, sizeof(de)) == sizeof(de)){
1fe: a801 j 20e <ls+0x15a>
printf("ls: cannot stat %s\n", buf);
200: dc040593 addi a1,s0,-576
204: 8556 mv a0,s5
206: 00000097 auipc ra,0x0
20a: 6da080e7 jalr 1754(ra) # 8e0 <printf>
while(read(fd, &de, sizeof(de)) == sizeof(de)){
20e: 4641 li a2,16
210: db040593 addi a1,s0,-592
214: 8526 mv a0,s1
216: 00000097 auipc ra,0x0
21a: 340080e7 jalr 832(ra) # 556 <read>
21e: 47c1 li a5,16
220: f0f51ae3 bne a0,a5,134 <ls+0x80>
if(de.inum == 0)
224: db045783 lhu a5,-592(s0)
228: d3fd beqz a5,20e <ls+0x15a>
memmove(p, de.name, DIRSIZ);
22a: 4639 li a2,14
22c: db240593 addi a1,s0,-590
230: 854e mv a0,s3
232: 00000097 auipc ra,0x0
236: 25a080e7 jalr 602(ra) # 48c <memmove>
p[DIRSIZ] = 0;
23a: 000907a3 sb zero,15(s2)
if(stat(buf, &st) < 0){
23e: d9840593 addi a1,s0,-616
242: dc040513 addi a0,s0,-576
246: 00000097 auipc ra,0x0
24a: 1b8080e7 jalr 440(ra) # 3fe <stat>
24e: fa0549e3 bltz a0,200 <ls+0x14c>
printf("%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
252: dc040513 addi a0,s0,-576
256: 00000097 auipc ra,0x0
25a: daa080e7 jalr -598(ra) # 0 <fmtname>
25e: 85aa mv a1,a0
260: da843703 ld a4,-600(s0)
264: d9c42683 lw a3,-612(s0)
268: da041603 lh a2,-608(s0)
26c: 8552 mv a0,s4
26e: 00000097 auipc ra,0x0
272: 672080e7 jalr 1650(ra) # 8e0 <printf>
276: bf61 j 20e <ls+0x15a>
0000000000000278 <main>:
int
main(int argc, char *argv[])
{
278: 1101 addi sp,sp,-32
27a: ec06 sd ra,24(sp)
27c: e822 sd s0,16(sp)
27e: e426 sd s1,8(sp)
280: e04a sd s2,0(sp)
282: 1000 addi s0,sp,32
int i;
if(argc < 2){
284: 4785 li a5,1
286: 02a7d963 bge a5,a0,2b8 <main+0x40>
28a: 00858493 addi s1,a1,8
28e: ffe5091b addiw s2,a0,-2
292: 02091793 slli a5,s2,0x20
296: 01d7d913 srli s2,a5,0x1d
29a: 05c1 addi a1,a1,16
29c: 992e add s2,s2,a1
ls(".");
exit(0);
}
for(i=1; i<argc; i++)
ls(argv[i]);
29e: 6088 ld a0,0(s1)
2a0: 00000097 auipc ra,0x0
2a4: e14080e7 jalr -492(ra) # b4 <ls>
for(i=1; i<argc; i++)
2a8: 04a1 addi s1,s1,8
2aa: ff249ae3 bne s1,s2,29e <main+0x26>
exit(0);
2ae: 4501 li a0,0
2b0: 00000097 auipc ra,0x0
2b4: 28e080e7 jalr 654(ra) # 53e <exit>
ls(".");
2b8: 00001517 auipc a0,0x1
2bc: 83050513 addi a0,a0,-2000 # ae8 <malloc+0x150>
2c0: 00000097 auipc ra,0x0
2c4: df4080e7 jalr -524(ra) # b4 <ls>
exit(0);
2c8: 4501 li a0,0
2ca: 00000097 auipc ra,0x0
2ce: 274080e7 jalr 628(ra) # 53e <exit>
00000000000002d2 <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
2d2: 1141 addi sp,sp,-16
2d4: e422 sd s0,8(sp)
2d6: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
2d8: 87aa mv a5,a0
2da: 0585 addi a1,a1,1
2dc: 0785 addi a5,a5,1
2de: fff5c703 lbu a4,-1(a1)
2e2: fee78fa3 sb a4,-1(a5)
2e6: fb75 bnez a4,2da <strcpy+0x8>
;
return os;
}
2e8: 6422 ld s0,8(sp)
2ea: 0141 addi sp,sp,16
2ec: 8082 ret
00000000000002ee <strcmp>:
int
strcmp(const char *p, const char *q)
{
2ee: 1141 addi sp,sp,-16
2f0: e422 sd s0,8(sp)
2f2: 0800 addi s0,sp,16
while(*p && *p == *q)
2f4: 00054783 lbu a5,0(a0)
2f8: cb91 beqz a5,30c <strcmp+0x1e>
2fa: 0005c703 lbu a4,0(a1)
2fe: 00f71763 bne a4,a5,30c <strcmp+0x1e>
p++, q++;
302: 0505 addi a0,a0,1
304: 0585 addi a1,a1,1
while(*p && *p == *q)
306: 00054783 lbu a5,0(a0)
30a: fbe5 bnez a5,2fa <strcmp+0xc>
return (uchar)*p - (uchar)*q;
30c: 0005c503 lbu a0,0(a1)
}
310: 40a7853b subw a0,a5,a0
314: 6422 ld s0,8(sp)
316: 0141 addi sp,sp,16
318: 8082 ret
000000000000031a <strlen>:
uint
strlen(const char *s)
{
31a: 1141 addi sp,sp,-16
31c: e422 sd s0,8(sp)
31e: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
320: 00054783 lbu a5,0(a0)
324: cf91 beqz a5,340 <strlen+0x26>
326: 0505 addi a0,a0,1
328: 87aa mv a5,a0
32a: 4685 li a3,1
32c: 9e89 subw a3,a3,a0
32e: 00f6853b addw a0,a3,a5
332: 0785 addi a5,a5,1
334: fff7c703 lbu a4,-1(a5)
338: fb7d bnez a4,32e <strlen+0x14>
;
return n;
}
33a: 6422 ld s0,8(sp)
33c: 0141 addi sp,sp,16
33e: 8082 ret
for(n = 0; s[n]; n++)
340: 4501 li a0,0
342: bfe5 j 33a <strlen+0x20>
0000000000000344 <memset>:
void*
memset(void *dst, int c, uint n)
{
344: 1141 addi sp,sp,-16
346: e422 sd s0,8(sp)
348: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
34a: ca19 beqz a2,360 <memset+0x1c>
34c: 87aa mv a5,a0
34e: 1602 slli a2,a2,0x20
350: 9201 srli a2,a2,0x20
352: 00a60733 add a4,a2,a0
cdst[i] = c;
356: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
35a: 0785 addi a5,a5,1
35c: fee79de3 bne a5,a4,356 <memset+0x12>
}
return dst;
}
360: 6422 ld s0,8(sp)
362: 0141 addi sp,sp,16
364: 8082 ret
0000000000000366 <strchr>:
char*
strchr(const char *s, char c)
{
366: 1141 addi sp,sp,-16
368: e422 sd s0,8(sp)
36a: 0800 addi s0,sp,16
for(; *s; s++)
36c: 00054783 lbu a5,0(a0)
370: cb99 beqz a5,386 <strchr+0x20>
if(*s == c)
372: 00f58763 beq a1,a5,380 <strchr+0x1a>
for(; *s; s++)
376: 0505 addi a0,a0,1
378: 00054783 lbu a5,0(a0)
37c: fbfd bnez a5,372 <strchr+0xc>
return (char*)s;
return 0;
37e: 4501 li a0,0
}
380: 6422 ld s0,8(sp)
382: 0141 addi sp,sp,16
384: 8082 ret
return 0;
386: 4501 li a0,0
388: bfe5 j 380 <strchr+0x1a>
000000000000038a <gets>:
char*
gets(char *buf, int max)
{
38a: 711d addi sp,sp,-96
38c: ec86 sd ra,88(sp)
38e: e8a2 sd s0,80(sp)
390: e4a6 sd s1,72(sp)
392: e0ca sd s2,64(sp)
394: fc4e sd s3,56(sp)
396: f852 sd s4,48(sp)
398: f456 sd s5,40(sp)
39a: f05a sd s6,32(sp)
39c: ec5e sd s7,24(sp)
39e: 1080 addi s0,sp,96
3a0: 8baa mv s7,a0
3a2: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
3a4: 892a mv s2,a0
3a6: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
3a8: 4aa9 li s5,10
3aa: 4b35 li s6,13
for(i=0; i+1 < max; ){
3ac: 89a6 mv s3,s1
3ae: 2485 addiw s1,s1,1
3b0: 0344d863 bge s1,s4,3e0 <gets+0x56>
cc = read(0, &c, 1);
3b4: 4605 li a2,1
3b6: faf40593 addi a1,s0,-81
3ba: 4501 li a0,0
3bc: 00000097 auipc ra,0x0
3c0: 19a080e7 jalr 410(ra) # 556 <read>
if(cc < 1)
3c4: 00a05e63 blez a0,3e0 <gets+0x56>
buf[i++] = c;
3c8: faf44783 lbu a5,-81(s0)
3cc: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
3d0: 01578763 beq a5,s5,3de <gets+0x54>
3d4: 0905 addi s2,s2,1
3d6: fd679be3 bne a5,s6,3ac <gets+0x22>
for(i=0; i+1 < max; ){
3da: 89a6 mv s3,s1
3dc: a011 j 3e0 <gets+0x56>
3de: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
3e0: 99de add s3,s3,s7
3e2: 00098023 sb zero,0(s3)
return buf;
}
3e6: 855e mv a0,s7
3e8: 60e6 ld ra,88(sp)
3ea: 6446 ld s0,80(sp)
3ec: 64a6 ld s1,72(sp)
3ee: 6906 ld s2,64(sp)
3f0: 79e2 ld s3,56(sp)
3f2: 7a42 ld s4,48(sp)
3f4: 7aa2 ld s5,40(sp)
3f6: 7b02 ld s6,32(sp)
3f8: 6be2 ld s7,24(sp)
3fa: 6125 addi sp,sp,96
3fc: 8082 ret
00000000000003fe <stat>:
int
stat(const char *n, struct stat *st)
{
3fe: 1101 addi sp,sp,-32
400: ec06 sd ra,24(sp)
402: e822 sd s0,16(sp)
404: e426 sd s1,8(sp)
406: e04a sd s2,0(sp)
408: 1000 addi s0,sp,32
40a: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
40c: 4581 li a1,0
40e: 00000097 auipc ra,0x0
412: 170080e7 jalr 368(ra) # 57e <open>
if(fd < 0)
416: 02054563 bltz a0,440 <stat+0x42>
41a: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
41c: 85ca mv a1,s2
41e: 00000097 auipc ra,0x0
422: 178080e7 jalr 376(ra) # 596 <fstat>
426: 892a mv s2,a0
close(fd);
428: 8526 mv a0,s1
42a: 00000097 auipc ra,0x0
42e: 13c080e7 jalr 316(ra) # 566 <close>
return r;
}
432: 854a mv a0,s2
434: 60e2 ld ra,24(sp)
436: 6442 ld s0,16(sp)
438: 64a2 ld s1,8(sp)
43a: 6902 ld s2,0(sp)
43c: 6105 addi sp,sp,32
43e: 8082 ret
return -1;
440: 597d li s2,-1
442: bfc5 j 432 <stat+0x34>
0000000000000444 <atoi>:
int
atoi(const char *s)
{
444: 1141 addi sp,sp,-16
446: e422 sd s0,8(sp)
448: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
44a: 00054683 lbu a3,0(a0)
44e: fd06879b addiw a5,a3,-48
452: 0ff7f793 zext.b a5,a5
456: 4625 li a2,9
458: 02f66863 bltu a2,a5,488 <atoi+0x44>
45c: 872a mv a4,a0
n = 0;
45e: 4501 li a0,0
n = n*10 + *s++ - '0';
460: 0705 addi a4,a4,1
462: 0025179b slliw a5,a0,0x2
466: 9fa9 addw a5,a5,a0
468: 0017979b slliw a5,a5,0x1
46c: 9fb5 addw a5,a5,a3
46e: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
472: 00074683 lbu a3,0(a4)
476: fd06879b addiw a5,a3,-48
47a: 0ff7f793 zext.b a5,a5
47e: fef671e3 bgeu a2,a5,460 <atoi+0x1c>
return n;
}
482: 6422 ld s0,8(sp)
484: 0141 addi sp,sp,16
486: 8082 ret
n = 0;
488: 4501 li a0,0
48a: bfe5 j 482 <atoi+0x3e>
000000000000048c <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
48c: 1141 addi sp,sp,-16
48e: e422 sd s0,8(sp)
490: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
492: 02b57463 bgeu a0,a1,4ba <memmove+0x2e>
while(n-- > 0)
496: 00c05f63 blez a2,4b4 <memmove+0x28>
49a: 1602 slli a2,a2,0x20
49c: 9201 srli a2,a2,0x20
49e: 00c507b3 add a5,a0,a2
dst = vdst;
4a2: 872a mv a4,a0
*dst++ = *src++;
4a4: 0585 addi a1,a1,1
4a6: 0705 addi a4,a4,1
4a8: fff5c683 lbu a3,-1(a1)
4ac: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
4b0: fee79ae3 bne a5,a4,4a4 <memmove+0x18>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
4b4: 6422 ld s0,8(sp)
4b6: 0141 addi sp,sp,16
4b8: 8082 ret
dst += n;
4ba: 00c50733 add a4,a0,a2
src += n;
4be: 95b2 add a1,a1,a2
while(n-- > 0)
4c0: fec05ae3 blez a2,4b4 <memmove+0x28>
4c4: fff6079b addiw a5,a2,-1
4c8: 1782 slli a5,a5,0x20
4ca: 9381 srli a5,a5,0x20
4cc: fff7c793 not a5,a5
4d0: 97ba add a5,a5,a4
*--dst = *--src;
4d2: 15fd addi a1,a1,-1
4d4: 177d addi a4,a4,-1
4d6: 0005c683 lbu a3,0(a1)
4da: 00d70023 sb a3,0(a4)
while(n-- > 0)
4de: fee79ae3 bne a5,a4,4d2 <memmove+0x46>
4e2: bfc9 j 4b4 <memmove+0x28>
00000000000004e4 <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
4e4: 1141 addi sp,sp,-16
4e6: e422 sd s0,8(sp)
4e8: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
4ea: ca05 beqz a2,51a <memcmp+0x36>
4ec: fff6069b addiw a3,a2,-1
4f0: 1682 slli a3,a3,0x20
4f2: 9281 srli a3,a3,0x20
4f4: 0685 addi a3,a3,1
4f6: 96aa add a3,a3,a0
if (*p1 != *p2) {
4f8: 00054783 lbu a5,0(a0)
4fc: 0005c703 lbu a4,0(a1)
500: 00e79863 bne a5,a4,510 <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
504: 0505 addi a0,a0,1
p2++;
506: 0585 addi a1,a1,1
while (n-- > 0) {
508: fed518e3 bne a0,a3,4f8 <memcmp+0x14>
}
return 0;
50c: 4501 li a0,0
50e: a019 j 514 <memcmp+0x30>
return *p1 - *p2;
510: 40e7853b subw a0,a5,a4
}
514: 6422 ld s0,8(sp)
516: 0141 addi sp,sp,16
518: 8082 ret
return 0;
51a: 4501 li a0,0
51c: bfe5 j 514 <memcmp+0x30>
000000000000051e <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
51e: 1141 addi sp,sp,-16
520: e406 sd ra,8(sp)
522: e022 sd s0,0(sp)
524: 0800 addi s0,sp,16
return memmove(dst, src, n);
526: 00000097 auipc ra,0x0
52a: f66080e7 jalr -154(ra) # 48c <memmove>
}
52e: 60a2 ld ra,8(sp)
530: 6402 ld s0,0(sp)
532: 0141 addi sp,sp,16
534: 8082 ret
0000000000000536 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
536: 4885 li a7,1
ecall
538: 00000073 ecall
ret
53c: 8082 ret
000000000000053e <exit>:
.global exit
exit:
li a7, SYS_exit
53e: 4889 li a7,2
ecall
540: 00000073 ecall
ret
544: 8082 ret
0000000000000546 <wait>:
.global wait
wait:
li a7, SYS_wait
546: 488d li a7,3
ecall
548: 00000073 ecall
ret
54c: 8082 ret
000000000000054e <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
54e: 4891 li a7,4
ecall
550: 00000073 ecall
ret
554: 8082 ret
0000000000000556 <read>:
.global read
read:
li a7, SYS_read
556: 4895 li a7,5
ecall
558: 00000073 ecall
ret
55c: 8082 ret
000000000000055e <write>:
.global write
write:
li a7, SYS_write
55e: 48c1 li a7,16
ecall
560: 00000073 ecall
ret
564: 8082 ret
0000000000000566 <close>:
.global close
close:
li a7, SYS_close
566: 48d5 li a7,21
ecall
568: 00000073 ecall
ret
56c: 8082 ret
000000000000056e <kill>:
.global kill
kill:
li a7, SYS_kill
56e: 4899 li a7,6
ecall
570: 00000073 ecall
ret
574: 8082 ret
0000000000000576 <exec>:
.global exec
exec:
li a7, SYS_exec
576: 489d li a7,7
ecall
578: 00000073 ecall
ret
57c: 8082 ret
000000000000057e <open>:
.global open
open:
li a7, SYS_open
57e: 48bd li a7,15
ecall
580: 00000073 ecall
ret
584: 8082 ret
0000000000000586 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
586: 48c5 li a7,17
ecall
588: 00000073 ecall
ret
58c: 8082 ret
000000000000058e <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
58e: 48c9 li a7,18
ecall
590: 00000073 ecall
ret
594: 8082 ret
0000000000000596 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
596: 48a1 li a7,8
ecall
598: 00000073 ecall
ret
59c: 8082 ret
000000000000059e <link>:
.global link
link:
li a7, SYS_link
59e: 48cd li a7,19
ecall
5a0: 00000073 ecall
ret
5a4: 8082 ret
00000000000005a6 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
5a6: 48d1 li a7,20
ecall
5a8: 00000073 ecall
ret
5ac: 8082 ret
00000000000005ae <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
5ae: 48a5 li a7,9
ecall
5b0: 00000073 ecall
ret
5b4: 8082 ret
00000000000005b6 <dup>:
.global dup
dup:
li a7, SYS_dup
5b6: 48a9 li a7,10
ecall
5b8: 00000073 ecall
ret
5bc: 8082 ret
00000000000005be <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
5be: 48ad li a7,11
ecall
5c0: 00000073 ecall
ret
5c4: 8082 ret
00000000000005c6 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
5c6: 48b1 li a7,12
ecall
5c8: 00000073 ecall
ret
5cc: 8082 ret
00000000000005ce <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
5ce: 48b5 li a7,13
ecall
5d0: 00000073 ecall
ret
5d4: 8082 ret
00000000000005d6 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
5d6: 48b9 li a7,14
ecall
5d8: 00000073 ecall
ret
5dc: 8082 ret
00000000000005de <waitstat>:
.global waitstat
waitstat:
li a7, SYS_waitstat
5de: 48d9 li a7,22
ecall
5e0: 00000073 ecall
ret
5e4: 8082 ret
00000000000005e6 <btput>:
.global btput
btput:
li a7, SYS_btput
5e6: 48dd li a7,23
ecall
5e8: 00000073 ecall
ret
5ec: 8082 ret
00000000000005ee <tput>:
.global tput
tput:
li a7, SYS_tput
5ee: 48e1 li a7,24
ecall
5f0: 00000073 ecall
ret
5f4: 8082 ret
00000000000005f6 <btget>:
.global btget
btget:
li a7, SYS_btget
5f6: 48e5 li a7,25
ecall
5f8: 00000073 ecall
ret
5fc: 8082 ret
00000000000005fe <tget>:
.global tget
tget:
li a7, SYS_tget
5fe: 48e9 li a7,26
ecall
600: 00000073 ecall
ret
604: 8082 ret
0000000000000606 <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
606: 1101 addi sp,sp,-32
608: ec06 sd ra,24(sp)
60a: e822 sd s0,16(sp)
60c: 1000 addi s0,sp,32
60e: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
612: 4605 li a2,1
614: fef40593 addi a1,s0,-17
618: 00000097 auipc ra,0x0
61c: f46080e7 jalr -186(ra) # 55e <write>
}
620: 60e2 ld ra,24(sp)
622: 6442 ld s0,16(sp)
624: 6105 addi sp,sp,32
626: 8082 ret
0000000000000628 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
628: 7139 addi sp,sp,-64
62a: fc06 sd ra,56(sp)
62c: f822 sd s0,48(sp)
62e: f426 sd s1,40(sp)
630: f04a sd s2,32(sp)
632: ec4e sd s3,24(sp)
634: 0080 addi s0,sp,64
636: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
638: c299 beqz a3,63e <printint+0x16>
63a: 0805c963 bltz a1,6cc <printint+0xa4>
neg = 1;
x = -xx;
} else {
x = xx;
63e: 2581 sext.w a1,a1
neg = 0;
640: 4881 li a7,0
642: fc040693 addi a3,s0,-64
}
i = 0;
646: 4701 li a4,0
do{
buf[i++] = digits[x % base];
648: 2601 sext.w a2,a2
64a: 00000517 auipc a0,0x0
64e: 50650513 addi a0,a0,1286 # b50 <digits>
652: 883a mv a6,a4
654: 2705 addiw a4,a4,1
656: 02c5f7bb remuw a5,a1,a2
65a: 1782 slli a5,a5,0x20
65c: 9381 srli a5,a5,0x20
65e: 97aa add a5,a5,a0
660: 0007c783 lbu a5,0(a5)
664: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
668: 0005879b sext.w a5,a1
66c: 02c5d5bb divuw a1,a1,a2
670: 0685 addi a3,a3,1
672: fec7f0e3 bgeu a5,a2,652 <printint+0x2a>
if(neg)
676: 00088c63 beqz a7,68e <printint+0x66>
buf[i++] = '-';
67a: fd070793 addi a5,a4,-48
67e: 00878733 add a4,a5,s0
682: 02d00793 li a5,45
686: fef70823 sb a5,-16(a4)
68a: 0028071b addiw a4,a6,2
while(--i >= 0)
68e: 02e05863 blez a4,6be <printint+0x96>
692: fc040793 addi a5,s0,-64
696: 00e78933 add s2,a5,a4
69a: fff78993 addi s3,a5,-1
69e: 99ba add s3,s3,a4
6a0: 377d addiw a4,a4,-1
6a2: 1702 slli a4,a4,0x20
6a4: 9301 srli a4,a4,0x20
6a6: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
6aa: fff94583 lbu a1,-1(s2)
6ae: 8526 mv a0,s1
6b0: 00000097 auipc ra,0x0
6b4: f56080e7 jalr -170(ra) # 606 <putc>
while(--i >= 0)
6b8: 197d addi s2,s2,-1
6ba: ff3918e3 bne s2,s3,6aa <printint+0x82>
}
6be: 70e2 ld ra,56(sp)
6c0: 7442 ld s0,48(sp)
6c2: 74a2 ld s1,40(sp)
6c4: 7902 ld s2,32(sp)
6c6: 69e2 ld s3,24(sp)
6c8: 6121 addi sp,sp,64
6ca: 8082 ret
x = -xx;
6cc: 40b005bb negw a1,a1
neg = 1;
6d0: 4885 li a7,1
x = -xx;
6d2: bf85 j 642 <printint+0x1a>
00000000000006d4 <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
6d4: 7119 addi sp,sp,-128
6d6: fc86 sd ra,120(sp)
6d8: f8a2 sd s0,112(sp)
6da: f4a6 sd s1,104(sp)
6dc: f0ca sd s2,96(sp)
6de: ecce sd s3,88(sp)
6e0: e8d2 sd s4,80(sp)
6e2: e4d6 sd s5,72(sp)
6e4: e0da sd s6,64(sp)
6e6: fc5e sd s7,56(sp)
6e8: f862 sd s8,48(sp)
6ea: f466 sd s9,40(sp)
6ec: f06a sd s10,32(sp)
6ee: ec6e sd s11,24(sp)
6f0: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
6f2: 0005c903 lbu s2,0(a1)
6f6: 18090f63 beqz s2,894 <vprintf+0x1c0>
6fa: 8aaa mv s5,a0
6fc: 8b32 mv s6,a2
6fe: 00158493 addi s1,a1,1
state = 0;
702: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
704: 02500a13 li s4,37
708: 4c55 li s8,21
70a: 00000c97 auipc s9,0x0
70e: 3eec8c93 addi s9,s9,1006 # af8 <malloc+0x160>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
s = va_arg(ap, char*);
if(s == 0)
s = "(null)";
while(*s != 0){
712: 02800d93 li s11,40
putc(fd, 'x');
716: 4d41 li s10,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
718: 00000b97 auipc s7,0x0
71c: 438b8b93 addi s7,s7,1080 # b50 <digits>
720: a839 j 73e <vprintf+0x6a>
putc(fd, c);
722: 85ca mv a1,s2
724: 8556 mv a0,s5
726: 00000097 auipc ra,0x0
72a: ee0080e7 jalr -288(ra) # 606 <putc>
72e: a019 j 734 <vprintf+0x60>
} else if(state == '%'){
730: 01498d63 beq s3,s4,74a <vprintf+0x76>
for(i = 0; fmt[i]; i++){
734: 0485 addi s1,s1,1
736: fff4c903 lbu s2,-1(s1)
73a: 14090d63 beqz s2,894 <vprintf+0x1c0>
if(state == 0){
73e: fe0999e3 bnez s3,730 <vprintf+0x5c>
if(c == '%'){
742: ff4910e3 bne s2,s4,722 <vprintf+0x4e>
state = '%';
746: 89d2 mv s3,s4
748: b7f5 j 734 <vprintf+0x60>
if(c == 'd'){
74a: 11490c63 beq s2,s4,862 <vprintf+0x18e>
74e: f9d9079b addiw a5,s2,-99
752: 0ff7f793 zext.b a5,a5
756: 10fc6e63 bltu s8,a5,872 <vprintf+0x19e>
75a: f9d9079b addiw a5,s2,-99
75e: 0ff7f713 zext.b a4,a5
762: 10ec6863 bltu s8,a4,872 <vprintf+0x19e>
766: 00271793 slli a5,a4,0x2
76a: 97e6 add a5,a5,s9
76c: 439c lw a5,0(a5)
76e: 97e6 add a5,a5,s9
770: 8782 jr a5
printint(fd, va_arg(ap, int), 10, 1);
772: 008b0913 addi s2,s6,8
776: 4685 li a3,1
778: 4629 li a2,10
77a: 000b2583 lw a1,0(s6)
77e: 8556 mv a0,s5
780: 00000097 auipc ra,0x0
784: ea8080e7 jalr -344(ra) # 628 <printint>
788: 8b4a mv s6,s2
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
78a: 4981 li s3,0
78c: b765 j 734 <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
78e: 008b0913 addi s2,s6,8
792: 4681 li a3,0
794: 4629 li a2,10
796: 000b2583 lw a1,0(s6)
79a: 8556 mv a0,s5
79c: 00000097 auipc ra,0x0
7a0: e8c080e7 jalr -372(ra) # 628 <printint>
7a4: 8b4a mv s6,s2
state = 0;
7a6: 4981 li s3,0
7a8: b771 j 734 <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
7aa: 008b0913 addi s2,s6,8
7ae: 4681 li a3,0
7b0: 866a mv a2,s10
7b2: 000b2583 lw a1,0(s6)
7b6: 8556 mv a0,s5
7b8: 00000097 auipc ra,0x0
7bc: e70080e7 jalr -400(ra) # 628 <printint>
7c0: 8b4a mv s6,s2
state = 0;
7c2: 4981 li s3,0
7c4: bf85 j 734 <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
7c6: 008b0793 addi a5,s6,8
7ca: f8f43423 sd a5,-120(s0)
7ce: 000b3983 ld s3,0(s6)
putc(fd, '0');
7d2: 03000593 li a1,48
7d6: 8556 mv a0,s5
7d8: 00000097 auipc ra,0x0
7dc: e2e080e7 jalr -466(ra) # 606 <putc>
putc(fd, 'x');
7e0: 07800593 li a1,120
7e4: 8556 mv a0,s5
7e6: 00000097 auipc ra,0x0
7ea: e20080e7 jalr -480(ra) # 606 <putc>
7ee: 896a mv s2,s10
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
7f0: 03c9d793 srli a5,s3,0x3c
7f4: 97de add a5,a5,s7
7f6: 0007c583 lbu a1,0(a5)
7fa: 8556 mv a0,s5
7fc: 00000097 auipc ra,0x0
800: e0a080e7 jalr -502(ra) # 606 <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
804: 0992 slli s3,s3,0x4
806: 397d addiw s2,s2,-1
808: fe0914e3 bnez s2,7f0 <vprintf+0x11c>
printptr(fd, va_arg(ap, uint64));
80c: f8843b03 ld s6,-120(s0)
state = 0;
810: 4981 li s3,0
812: b70d j 734 <vprintf+0x60>
s = va_arg(ap, char*);
814: 008b0913 addi s2,s6,8
818: 000b3983 ld s3,0(s6)
if(s == 0)
81c: 02098163 beqz s3,83e <vprintf+0x16a>
while(*s != 0){
820: 0009c583 lbu a1,0(s3)
824: c5ad beqz a1,88e <vprintf+0x1ba>
putc(fd, *s);
826: 8556 mv a0,s5
828: 00000097 auipc ra,0x0
82c: dde080e7 jalr -546(ra) # 606 <putc>
s++;
830: 0985 addi s3,s3,1
while(*s != 0){
832: 0009c583 lbu a1,0(s3)
836: f9e5 bnez a1,826 <vprintf+0x152>
s = va_arg(ap, char*);
838: 8b4a mv s6,s2
state = 0;
83a: 4981 li s3,0
83c: bde5 j 734 <vprintf+0x60>
s = "(null)";
83e: 00000997 auipc s3,0x0
842: 2b298993 addi s3,s3,690 # af0 <malloc+0x158>
while(*s != 0){
846: 85ee mv a1,s11
848: bff9 j 826 <vprintf+0x152>
putc(fd, va_arg(ap, uint));
84a: 008b0913 addi s2,s6,8
84e: 000b4583 lbu a1,0(s6)
852: 8556 mv a0,s5
854: 00000097 auipc ra,0x0
858: db2080e7 jalr -590(ra) # 606 <putc>
85c: 8b4a mv s6,s2
state = 0;
85e: 4981 li s3,0
860: bdd1 j 734 <vprintf+0x60>
putc(fd, c);
862: 85d2 mv a1,s4
864: 8556 mv a0,s5
866: 00000097 auipc ra,0x0
86a: da0080e7 jalr -608(ra) # 606 <putc>
state = 0;
86e: 4981 li s3,0
870: b5d1 j 734 <vprintf+0x60>
putc(fd, '%');
872: 85d2 mv a1,s4
874: 8556 mv a0,s5
876: 00000097 auipc ra,0x0
87a: d90080e7 jalr -624(ra) # 606 <putc>
putc(fd, c);
87e: 85ca mv a1,s2
880: 8556 mv a0,s5
882: 00000097 auipc ra,0x0
886: d84080e7 jalr -636(ra) # 606 <putc>
state = 0;
88a: 4981 li s3,0
88c: b565 j 734 <vprintf+0x60>
s = va_arg(ap, char*);
88e: 8b4a mv s6,s2
state = 0;
890: 4981 li s3,0
892: b54d j 734 <vprintf+0x60>
}
}
}
894: 70e6 ld ra,120(sp)
896: 7446 ld s0,112(sp)
898: 74a6 ld s1,104(sp)
89a: 7906 ld s2,96(sp)
89c: 69e6 ld s3,88(sp)
89e: 6a46 ld s4,80(sp)
8a0: 6aa6 ld s5,72(sp)
8a2: 6b06 ld s6,64(sp)
8a4: 7be2 ld s7,56(sp)
8a6: 7c42 ld s8,48(sp)
8a8: 7ca2 ld s9,40(sp)
8aa: 7d02 ld s10,32(sp)
8ac: 6de2 ld s11,24(sp)
8ae: 6109 addi sp,sp,128
8b0: 8082 ret
00000000000008b2 <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
8b2: 715d addi sp,sp,-80
8b4: ec06 sd ra,24(sp)
8b6: e822 sd s0,16(sp)
8b8: 1000 addi s0,sp,32
8ba: e010 sd a2,0(s0)
8bc: e414 sd a3,8(s0)
8be: e818 sd a4,16(s0)
8c0: ec1c sd a5,24(s0)
8c2: 03043023 sd a6,32(s0)
8c6: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
8ca: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
8ce: 8622 mv a2,s0
8d0: 00000097 auipc ra,0x0
8d4: e04080e7 jalr -508(ra) # 6d4 <vprintf>
}
8d8: 60e2 ld ra,24(sp)
8da: 6442 ld s0,16(sp)
8dc: 6161 addi sp,sp,80
8de: 8082 ret
00000000000008e0 <printf>:
void
printf(const char *fmt, ...)
{
8e0: 711d addi sp,sp,-96
8e2: ec06 sd ra,24(sp)
8e4: e822 sd s0,16(sp)
8e6: 1000 addi s0,sp,32
8e8: e40c sd a1,8(s0)
8ea: e810 sd a2,16(s0)
8ec: ec14 sd a3,24(s0)
8ee: f018 sd a4,32(s0)
8f0: f41c sd a5,40(s0)
8f2: 03043823 sd a6,48(s0)
8f6: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
8fa: 00840613 addi a2,s0,8
8fe: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
902: 85aa mv a1,a0
904: 4505 li a0,1
906: 00000097 auipc ra,0x0
90a: dce080e7 jalr -562(ra) # 6d4 <vprintf>
}
90e: 60e2 ld ra,24(sp)
910: 6442 ld s0,16(sp)
912: 6125 addi sp,sp,96
914: 8082 ret
0000000000000916 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
916: 1141 addi sp,sp,-16
918: e422 sd s0,8(sp)
91a: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
91c: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
920: 00000797 auipc a5,0x0
924: 2487b783 ld a5,584(a5) # b68 <freep>
928: a02d j 952 <free+0x3c>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
92a: 4618 lw a4,8(a2)
92c: 9f2d addw a4,a4,a1
92e: fee52c23 sw a4,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
932: 6398 ld a4,0(a5)
934: 6310 ld a2,0(a4)
936: a83d j 974 <free+0x5e>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
938: ff852703 lw a4,-8(a0)
93c: 9f31 addw a4,a4,a2
93e: c798 sw a4,8(a5)
p->s.ptr = bp->s.ptr;
940: ff053683 ld a3,-16(a0)
944: a091 j 988 <free+0x72>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
946: 6398 ld a4,0(a5)
948: 00e7e463 bltu a5,a4,950 <free+0x3a>
94c: 00e6ea63 bltu a3,a4,960 <free+0x4a>
{
950: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
952: fed7fae3 bgeu a5,a3,946 <free+0x30>
956: 6398 ld a4,0(a5)
958: 00e6e463 bltu a3,a4,960 <free+0x4a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
95c: fee7eae3 bltu a5,a4,950 <free+0x3a>
if(bp + bp->s.size == p->s.ptr){
960: ff852583 lw a1,-8(a0)
964: 6390 ld a2,0(a5)
966: 02059813 slli a6,a1,0x20
96a: 01c85713 srli a4,a6,0x1c
96e: 9736 add a4,a4,a3
970: fae60de3 beq a2,a4,92a <free+0x14>
bp->s.ptr = p->s.ptr->s.ptr;
974: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
978: 4790 lw a2,8(a5)
97a: 02061593 slli a1,a2,0x20
97e: 01c5d713 srli a4,a1,0x1c
982: 973e add a4,a4,a5
984: fae68ae3 beq a3,a4,938 <free+0x22>
p->s.ptr = bp->s.ptr;
988: e394 sd a3,0(a5)
} else
p->s.ptr = bp;
freep = p;
98a: 00000717 auipc a4,0x0
98e: 1cf73f23 sd a5,478(a4) # b68 <freep>
}
992: 6422 ld s0,8(sp)
994: 0141 addi sp,sp,16
996: 8082 ret
0000000000000998 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
998: 7139 addi sp,sp,-64
99a: fc06 sd ra,56(sp)
99c: f822 sd s0,48(sp)
99e: f426 sd s1,40(sp)
9a0: f04a sd s2,32(sp)
9a2: ec4e sd s3,24(sp)
9a4: e852 sd s4,16(sp)
9a6: e456 sd s5,8(sp)
9a8: e05a sd s6,0(sp)
9aa: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
9ac: 02051493 slli s1,a0,0x20
9b0: 9081 srli s1,s1,0x20
9b2: 04bd addi s1,s1,15
9b4: 8091 srli s1,s1,0x4
9b6: 0014899b addiw s3,s1,1
9ba: 0485 addi s1,s1,1
if((prevp = freep) == 0){
9bc: 00000517 auipc a0,0x0
9c0: 1ac53503 ld a0,428(a0) # b68 <freep>
9c4: c515 beqz a0,9f0 <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
9c6: 611c ld a5,0(a0)
if(p->s.size >= nunits){
9c8: 4798 lw a4,8(a5)
9ca: 02977f63 bgeu a4,s1,a08 <malloc+0x70>
9ce: 8a4e mv s4,s3
9d0: 0009871b sext.w a4,s3
9d4: 6685 lui a3,0x1
9d6: 00d77363 bgeu a4,a3,9dc <malloc+0x44>
9da: 6a05 lui s4,0x1
9dc: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
9e0: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
9e4: 00000917 auipc s2,0x0
9e8: 18490913 addi s2,s2,388 # b68 <freep>
if(p == (char*)-1)
9ec: 5afd li s5,-1
9ee: a895 j a62 <malloc+0xca>
base.s.ptr = freep = prevp = &base;
9f0: 00000797 auipc a5,0x0
9f4: 19078793 addi a5,a5,400 # b80 <base>
9f8: 00000717 auipc a4,0x0
9fc: 16f73823 sd a5,368(a4) # b68 <freep>
a00: e39c sd a5,0(a5)
base.s.size = 0;
a02: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
a06: b7e1 j 9ce <malloc+0x36>
if(p->s.size == nunits)
a08: 02e48c63 beq s1,a4,a40 <malloc+0xa8>
p->s.size -= nunits;
a0c: 4137073b subw a4,a4,s3
a10: c798 sw a4,8(a5)
p += p->s.size;
a12: 02071693 slli a3,a4,0x20
a16: 01c6d713 srli a4,a3,0x1c
a1a: 97ba add a5,a5,a4
p->s.size = nunits;
a1c: 0137a423 sw s3,8(a5)
freep = prevp;
a20: 00000717 auipc a4,0x0
a24: 14a73423 sd a0,328(a4) # b68 <freep>
return (void*)(p + 1);
a28: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
a2c: 70e2 ld ra,56(sp)
a2e: 7442 ld s0,48(sp)
a30: 74a2 ld s1,40(sp)
a32: 7902 ld s2,32(sp)
a34: 69e2 ld s3,24(sp)
a36: 6a42 ld s4,16(sp)
a38: 6aa2 ld s5,8(sp)
a3a: 6b02 ld s6,0(sp)
a3c: 6121 addi sp,sp,64
a3e: 8082 ret
prevp->s.ptr = p->s.ptr;
a40: 6398 ld a4,0(a5)
a42: e118 sd a4,0(a0)
a44: bff1 j a20 <malloc+0x88>
hp->s.size = nu;
a46: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
a4a: 0541 addi a0,a0,16
a4c: 00000097 auipc ra,0x0
a50: eca080e7 jalr -310(ra) # 916 <free>
return freep;
a54: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
a58: d971 beqz a0,a2c <malloc+0x94>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a5a: 611c ld a5,0(a0)
if(p->s.size >= nunits){
a5c: 4798 lw a4,8(a5)
a5e: fa9775e3 bgeu a4,s1,a08 <malloc+0x70>
if(p == freep)
a62: 00093703 ld a4,0(s2)
a66: 853e mv a0,a5
a68: fef719e3 bne a4,a5,a5a <malloc+0xc2>
p = sbrk(nu * sizeof(Header));
a6c: 8552 mv a0,s4
a6e: 00000097 auipc ra,0x0
a72: b58080e7 jalr -1192(ra) # 5c6 <sbrk>
if(p == (char*)-1)
a76: fd5518e3 bne a0,s5,a46 <malloc+0xae>
return 0;
a7a: 4501 li a0,0
a7c: bf45 j a2c <malloc+0x94>
| 30.255202 | 70 | 0.469871 |
e0996506a7ab23696fa81dc1e0a8d3f36ef81eaf | 864 | asm | Assembly | MSDOS/Virus.MSDOS.Unknown.rnd.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | MSDOS/Virus.MSDOS.Unknown.rnd.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | MSDOS/Virus.MSDOS.Unknown.rnd.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z |
; A pseudo random numbers generator
; for use with the MuTation Engine <tm>
; Version 1.01 (26-10-91)
; (C) 1991 CrazySoft, Inc.
.model tiny
.code
public rnd_init, rnd_get, rnd_buf, data_top
rnd_init:
push ds si dx cx bx
xor ah,ah
int 1ah
in al,[40h]
mov ah,al
in al,[40h]
xor ax,cx
xor dx,ax
push cs
pop ds
mov si,offset rnd_buf
xor bh,bh
jmp short rnd_put
rnd_get:
push ds si dx cx bx
push cs
pop ds
mov si,offset rnd_buf
mov bl,[si]
xor bh,bh
mov ax,[bx+si+2]
mov dx,[bx+si+4]
add byte ptr [si],4
mov cx,7
rnd_lup:
shl ax,1
rcl dx,1
mov bl,al
xor bl,dh
jns nxt_bit
inc al
nxt_bit:
loop rnd_lup
rnd_put:
mov bl,[si+1]
mov [bx+si+2],ax
mov [bx+si+4],dx
add bl,4
mov [si+1],bl
mov al,dl
cmp bl,[si]
jnz rnd_done
add byte ptr [si],4
rnd_done:
pop bx cx dx si ds
ret
.data
rnd_buf dw 129 dup(?)
data_top:
end
| 12.705882 | 44 | 0.66088 |
51b0b33d7f5e1d3d84b15d2c37e3ba9d3ae966aa | 7,750 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1303.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1303.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1303.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x9021, %rcx
nop
nop
add $64051, %r10
mov $0x6162636465666768, %rdx
movq %rdx, %xmm1
and $0xffffffffffffffc0, %rcx
vmovaps %ymm1, (%rcx)
nop
nop
nop
nop
nop
xor $59046, %rdx
lea addresses_A_ht+0x7081, %rbp
clflush (%rbp)
nop
dec %rbx
movl $0x61626364, (%rbp)
nop
add $60020, %rcx
lea addresses_normal_ht+0x16691, %rsi
lea addresses_A_ht+0x19901, %rdi
nop
and $27034, %r12
mov $120, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $24993, %r10
lea addresses_UC_ht+0x10a81, %rbp
clflush (%rbp)
nop
nop
nop
nop
nop
add %rdi, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
and $0xffffffffffffffc0, %rbp
movntdq %xmm2, (%rbp)
nop
nop
nop
nop
nop
add $19665, %rdi
lea addresses_normal_ht+0x5ba1, %rsi
lea addresses_D_ht+0x9181, %rdi
nop
nop
nop
add %r10, %r10
mov $95, %rcx
rep movsw
nop
nop
nop
nop
nop
add $36189, %rdx
lea addresses_WT_ht+0xe181, %r10
nop
nop
nop
nop
cmp %rdx, %rdx
mov $0x6162636465666768, %rsi
movq %rsi, (%r10)
nop
nop
nop
nop
inc %rbp
lea addresses_WT_ht+0x111a8, %rdi
sub %rbx, %rbx
movw $0x6162, (%rdi)
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_WC_ht+0x19e29, %rsi
lea addresses_normal_ht+0x9f61, %rdi
clflush (%rdi)
nop
nop
nop
sub $52274, %r12
mov $92, %rcx
rep movsb
nop
nop
and %rbx, %rbx
lea addresses_UC_ht+0x121d9, %r10
nop
nop
nop
add $30020, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, (%r10)
nop
inc %r12
lea addresses_WC_ht+0x1c58d, %rsi
clflush (%rsi)
nop
nop
nop
sub %rbp, %rbp
movw $0x6162, (%rsi)
nop
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0x108c9, %r12
nop
nop
nop
nop
and $1038, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%r12)
nop
nop
and %r10, %r10
lea addresses_WC_ht+0x18ec1, %rcx
nop
nop
nop
dec %rbx
mov $0x6162636465666768, %r10
movq %r10, %xmm0
movups %xmm0, (%rcx)
nop
nop
nop
nop
nop
cmp $57338, %rbx
lea addresses_WT_ht+0x10681, %rdx
nop
nop
nop
nop
add %r12, %r12
mov $0x6162636465666768, %rcx
movq %rcx, (%rdx)
nop
nop
dec %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %rbp
push %rcx
push %rsi
// Store
lea addresses_PSE+0x5e81, %r13
nop
nop
inc %rsi
movw $0x5152, (%r13)
nop
nop
nop
nop
nop
and %r13, %r13
// Faulty Load
lea addresses_PSE+0xef81, %r15
nop
nop
nop
nop
cmp %rbp, %rbp
movups (%r15), %xmm5
vpextrq $1, %xmm5, %r13
lea oracles, %rbp
and $0xff, %r13
shlq $12, %r13
mov (%rbp,%r13,1), %r13
pop %rsi
pop %rcx
pop %rbp
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 8, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 32, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 31.632653 | 2,999 | 0.661935 |
0eac53f020748e3e7a470e716d95fe3adbb24027 | 3,368 | asm | Assembly | source/entity/spider.asm | evanbowman/Red | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | 5 | 2021-08-30T16:18:55.000Z | 2021-10-30T20:23:32.000Z | source/entity/spider.asm | evanbowman/gbc-project | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | null | null | null | source/entity/spider.asm | evanbowman/gbc-project | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | null | null | null | ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;;;
;;; ASM Source code for Red GBC, by Evan Bowman, 2021
;;;
;;;
;;; The following licence covers the source code included in this file. The
;;; game's characters and artwork belong to Evan Bowman, and should not be used
;;; without permission.
;;;
;;;
;;; 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 HOLDER OR CONTRIBUTORS BE
;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;;; SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;;; POSSIBILITY OF SUCH DAMAGE.
;;;
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
SPIDER_VAR_COLOR_COUNTER EQU 0
SPIDER_VAR_COUNTER EQU 1
SPIDER_VAR_STAMINA EQU 2 ; \
SPIDER_VAR_STAMINA2 EQU 3 ; | Fixnum
SPIDER_VAR_STAMINA3 EQU 4 ; /
SPIDER_VAR_SLAB EQU 5
SPIDER_VAR_X_DEST EQU 6
;;; ----------------------------------------------------------------------------
SpiderUpdate:
LONG_CALL r9_SpiderUpdateImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
SpiderUpdateAttacking:
LONG_CALL r9_SpiderUpdateAttackingImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
SpiderUpdateSeekX:
LONG_CALL r9_SpiderUpdateSeekXImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
SpiderUpdateSeekY:
LONG_CALL r9_SpiderUpdateSeekYImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
SpiderUpdateDead:
LONG_CALL r9_SpiderUpdateDeadImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
SpiderUpdateAfterAttack:
LONG_CALL r9_SpiderUpdateAfterAttackImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
SpiderUpdatePrepSeekX:
LONG_CALL r9_SpiderUpdatePrepSeekXImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
| 35.452632 | 80 | 0.559679 |
1eb7de03ae2e21f65655147b6b13cd1f8ee55116 | 1,174 | asm | Assembly | code/6502/lib/ut/bcd.asm | visrealm/hbc-56 | 9c082946e247e79edc12867299b5b0fda3b6c873 | [
"MIT"
] | 65 | 2021-07-22T10:32:02.000Z | 2022-03-30T04:42:45.000Z | code/6502/lib/ut/bcd.asm | visrealm/hbc-56 | 9c082946e247e79edc12867299b5b0fda3b6c873 | [
"MIT"
] | 5 | 2022-03-29T20:23:57.000Z | 2022-03-30T23:12:42.000Z | code/6502/lib/ut/bcd.asm | visrealm/hbc-56 | 9c082946e247e79edc12867299b5b0fda3b6c873 | [
"MIT"
] | 4 | 2021-12-30T17:13:23.000Z | 2022-03-05T09:07:22.000Z | ; 6502 - BCD subroutines
;
; Copyright (c) 2020 Troy Schrapel
;
; This code is licensed under the MIT license
;
; https://github.com/visrealm/hbc-56
;
;
!ifndef BCD_RAM_START { BCD_RAM_START = $10
!warn "BCD_RAM_START not provided. Defaulting to ", BCD_RAM_START
}
; -------------------------
; High RAM
; -------------------------
BCD_TMP1 = BCD_RAM_START
BCD_TMP2 = BCD_RAM_START + 1
BCD_TMP3 = BCD_RAM_START + 2
BCD_RAM_SIZE = 3
!if BCD_RAM_END < (BCD_RAM_START + BCD_RAM_SIZE) {
!error "BCD_RAM requires ",BCD_RAM_SIZE," bytes. Allocated ",BCD_RAM_END - BCD_RAM_START
}
; -----------------------------------------------------------------------------
; bin2bcd8: convert an unsigned byte to a 2-digit bcd value
; -----------------------------------------------------------------------------
; Inputs:
; A: value
; Outputs:
; BCD value in R8
; -----------------------------------------------------------------------------
bin2bcd8:
sta BCD_TMP1
lda #0
sta BCD_TMP2
sta BCD_TMP3
ldx #8
sed
.loop:
asl BCD_TMP1
lda BCD_TMP2
adc BCD_TMP2
sta BCD_TMP2
lda BCD_TMP3
adc BCD_TMP3
sta BCD_TMP3
dex
bne .loop
cld
rts
| 20.241379 | 89 | 0.522147 |
3fd026c5e5c6b30cc7df69df24cc1b8e247012b5 | 7,181 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_sm_/i7-7700_9_0x48.log_21829_2147.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_sm_/i7-7700_9_0x48.log_21829_2147.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_sm_/i7-7700_9_0x48.log_21829_2147.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 %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x13dd9, %rdi
nop
nop
nop
add $62501, %r9
vmovups (%rdi), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %r12
nop
nop
nop
nop
nop
xor $41290, %r11
lea addresses_UC_ht+0x161d9, %rsi
lea addresses_D_ht+0x12e0d, %rdi
cmp $55283, %r11
mov $15, %rcx
rep movsq
nop
xor %rsi, %rsi
lea addresses_WC_ht+0xa699, %rsi
lea addresses_A_ht+0x17dd9, %rdi
nop
and $8820, %r11
mov $6, %rcx
rep movsb
nop
nop
nop
nop
cmp $53736, %r12
lea addresses_D_ht+0x8af1, %rcx
nop
nop
nop
nop
nop
cmp $38094, %rbp
mov (%rcx), %rdi
nop
cmp $16814, %r9
lea addresses_A_ht+0x7fe1, %rbp
nop
nop
nop
nop
nop
add %rdi, %rdi
movb $0x61, (%rbp)
nop
nop
nop
add $53283, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r8
push %rbp
push %rdi
push %rdx
// Store
lea addresses_RW+0x1b559, %r14
nop
add %rdx, %rdx
movl $0x51525354, (%r14)
nop
nop
nop
inc %rdi
// Store
lea addresses_D+0x1e5d9, %rbp
nop
nop
nop
nop
nop
and %r8, %r8
movl $0x51525354, (%rbp)
// Exception!!!
mov (0), %r14
add $94, %r15
// Store
lea addresses_A+0x9fd9, %rdx
sub %r14, %r14
movb $0x51, (%rdx)
nop
nop
nop
nop
nop
add $49654, %rdx
// Store
lea addresses_D+0x1e5d9, %rdi
nop
sub $38945, %rbp
mov $0x5152535455565758, %r8
movq %r8, (%rdi)
xor %r8, %r8
// Load
lea addresses_D+0xd3f9, %rbp
cmp %r12, %r12
movb (%rbp), %dl
nop
sub %r14, %r14
// Faulty Load
lea addresses_D+0x1e5d9, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
cmp $25745, %rdx
vmovntdqa (%rdi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rbp
lea oracles, %rdx
and $0xff, %rbp
shlq $12, %rbp
mov (%rdx,%rbp,1), %rbp
pop %rdx
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': True, 'NT': False}}
{'ef': 2, 'ae': 1, '83': 2, '1f': 2, '9e': 1590, '03': 2286, '8c': 1, 'a0': 1, 'e2': 2, 'c5': 3, '2b': 3, '35': 1, '65': 1, '37': 134, '72': 3270, '86': 2, '46': 1, '20': 351, '3e': 3, 'ca': 481, 'f4': 1, 'bb': 7, 'd2': 3, 'c3': 279, '53': 1, '89': 2, '57': 1, '06': 1, 'cb': 1, '31': 2, 'ad': 152, 'e4': 1, 'e8': 202, '87': 2, 'eb': 1, '4d': 1, '61': 3, '2f': 40, '33': 1, '4b': 20, '0f': 255, '4f': 1, 'f6': 1, 'b7': 2, '1e': 6, 'f0': 6, '08': 1, 'b6': 1, '55': 1751, 'a2': 4, 'd7': 3, '6f': 1, '0b': 4, 'dd': 2, '4a': 1, 'e3': 217, '3b': 6949, '00': 920, 'c7': 1, 'cf': 1, '8b': 1, '9d': 1, '3d': 8, '4e': 1, '56': 2211, '26': 1, 'be': 1, 'b3': 2, '48': 11, 'bf': 1, 'ff': 2, '9f': 580, '17': 2, 'f3': 1, '77': 1, '0d': 4, '75': 12, 'a7': 1, '96': 1, 'aa': 2}
06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3b 56 56 56 56 56 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 83 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 9e 00 00 00 00 00 00 00 00 00 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 00 00 00 00 00 00 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 56 03 00 00 56 03 9e 03 9e 03 9e 56 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 56 03 56 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 00 33 72 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 56 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 83 72 03 9e 03 9e 56 56 03 9e 03 9e 03 9e 56 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 56 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 03 9e 56 72 03 37 56 03 37 03 37 03 56 56 03 37 03 37 03 37 03 37 03 37 03 37 03 37 00 3b 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 03 37 56 03 37 03 00 56 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 56 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3
*/
| 40.342697 | 2,999 | 0.622197 |
28ba1d1dc5f2c2a8d3f34ff94f005fc557d736a3 | 280 | asm | Assembly | Documentation/boot.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | null | null | null | Documentation/boot.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | null | null | null | Documentation/boot.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | 1 | 2020-07-15T04:09:05.000Z | 2020-07-15T04:09:05.000Z | # $Id$
#
# boot.asm:
#
1. Initialize sp, fp, ra.
2. Initialize leh.
3. Jump to the base of the real code.
4. Code for exception handling stuff.
# Standard memory map:
#
# 1 meg of physical RAM.
# boot.asm lives in last page.
# stack starts and end of second-to-last page.
| 15.555556 | 46 | 0.671429 |
4b00ca6fbccc081a39d55dd98dc4284e1e2e2eb1 | 867 | asm | Assembly | programs/oeis/083/A083553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/083/A083553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/083/A083553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A083553: Product of prime(n+1)-1 and prime(n)-1.
; 2,8,24,60,120,192,288,396,616,840,1080,1440,1680,1932,2392,3016,3480,3960,4620,5040,5616,6396,7216,8448,9600,10200,10812,11448,12096,14112,16380,17680,18768,20424,22200,23400,25272,26892,28552,30616,32040,34200,36480,37632,38808,41580,46620,50172,51528,52896,55216,57120,60000,64000,67072,70216,72360,74520,77280,78960,82344,89352,94860,96720,98592,104280,110880,116256,120408,122496,126016,131028,136152,140616,144396,148216,153648,158400,163200,170544,175560,180600,185760,189216,193596,198016,204288,209760,212520,215292,222748,232308,238140,244020,249996,255016,264160,271440,281880,294840
seq $0,40 ; The prime numbers.
seq $0,13636 ; n*nextprime(n).
mov $1,$0
seq $1,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
sub $0,$1
div $0,2
mul $0,2
add $0,2
| 72.25 | 595 | 0.748558 |
0879d327ab247d86de0c2e82d4ab2b2e650a6b7e | 1,740 | asm | Assembly | EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | ;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; SupportItpDebug.asm
;
; Abstract:
;
; This is the code for debuging IA32, to add a break hook at loading every module
;
;------------------------------------------------------------------------------
; PROC:PRIVATE
.686P
.MMX
.MODEL SMALL
.CODE
AsmEfiSetBreakSupport PROTO C LoadAddr:DWORD
;------------------------------------------------------------------------------
; VOID
; AsmEfiSetBreakSupport (
; IN UINTN LoadAddr
; )
;------------------------------------------------------------------------------
AsmEfiSetBreakSupport PROC C LoadAddr:DWORD
mov eax, LoadAddr
mov dx, 60000
out dx, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
ret
AsmEfiSetBreakSupport ENDP
END
| 24.857143 | 93 | 0.43908 |
ce0aa73debea59729868df855144bf6e33c02831 | 404 | asm | Assembly | programs/oeis/052/A052909.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/052/A052909.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/052/A052909.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A052909: Expansion of (1+x-x^2)/((1-x)*(1-3*x)).
; 1,5,16,49,148,445,1336,4009,12028,36085,108256,324769,974308,2922925,8768776,26306329,78918988,236756965,710270896,2130812689,6392438068,19177314205,57531942616,172595827849,517787483548,1553362450645,4660087351936,13980262055809,41940786167428,125822358502285,377467075506856,1132401226520569,3397203679561708
mov $1,3
pow $1,$0
mul $1,22
div $1,12
| 50.5 | 312 | 0.809406 |
5d0aba25c5b5391bcb206138d2e5c29e4eac4a46 | 2,094 | asm | Assembly | code/Forec/t12.asm | KongoHuster/assembly-exercise | 1c4a44c60c0e93a1350ed4f887aeaf1414702a51 | [
"0BSD"
] | 1 | 2021-08-20T03:57:29.000Z | 2021-08-20T03:57:29.000Z | code/Forec/t12.asm | KongoHuster/assembly-exercise | 1c4a44c60c0e93a1350ed4f887aeaf1414702a51 | [
"0BSD"
] | null | null | null | code/Forec/t12.asm | KongoHuster/assembly-exercise | 1c4a44c60c0e93a1350ed4f887aeaf1414702a51 | [
"0BSD"
] | null | null | null | ;; last edit date: 2016/10/24
;; author: Forec
;; LICENSE
;; Copyright (c) 2015-2017, Forec <forec@bupt.edu.cn>
;; Permission to use, copy, modify, and/or distribute this code for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission notice appear in all copies.
;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
;; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
;; ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
;; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
;; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
title forec_t12
.model small
.data
output db 'ANS: $'
matchinfo db 'MATCH$'
nomatchinfo db 'NO MATCH$'
warninginfo db 0dh, 0ah, 'You can input at most 100 chars!', 0dh, 0ah, '$'
inputinfo db 'input str$'
str1 db 100 dup(?)
str2 db 100 dup(?)
.code
start:
mov ax, @data
mov ds, ax
mov dx, offset inputinfo ;; 显示帮助信息
mov ah, 9h
int 21h
mov dl, '1'
mov ah, 2h
int 21h
mov dl, ':'
int 21h
;; 输入str1
mov si, 0h
mov ah, 1h
input1:
int 21h
mov str1[si], al
inc si
cmp al, 0dh
jz pre2
cmp si, 100
jl input1
mov dx, offset warninginfo ;; 超过100字符,提示警告
mov ah, 9h
int 21h
pre2:
mov dx, offset inputinfo ;; 显示帮助信息
mov ah, 9h
int 21h
mov dl, '2'
mov ah, 2h
int 21h
mov dl, ':'
int 21h
mov di, 0h
mov ah, 1h
input2:
int 21h
mov str2[di], al
inc di
cmp al, 0dh
jz compare
cmp di, 100
jl input2
mov dx, offset warninginfo ;; 超过100字符,提示警告
mov ah, 9h
int 21h
compare:
mov dx, offset output ;; 显示 "ANS: "
mov ah, 9h
int 21h
cmp si, di
jnz unmatch
dec si
cmpchar:
cmp si, 0h
jz match
mov bh, str1[si]
mov bl, str2[si]
cmp bh, bl
jnz unmatch
dec si
jmp cmpchar
unmatch:
mov dx, offset nomatchinfo
jmp quit
match:
mov dx, offset matchinfo
quit:
int 21h
mov ah, 4ch
int 21h
end start | 19.942857 | 75 | 0.692932 |
30284b5d16883caae2c533acbeeae2b415ce826d | 9,978 | asm | Assembly | dos/search.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | dos/search.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | dos/search.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | TITLE SEARCH - Directory scan system calls
NAME SEARCH
;
; Microsoft Confidential
; Copyright (C) Microsoft Corporation 1991
; All Rights Reserved.
;
;** Search.asm
;
; Directory search system calls. These will be passed direct text of the
; pathname from the user. They will need to be passed through the macro
; expander prior to being sent through the low-level stuff. I/O specs are
; defined in DISPATCH. The system calls are:
;
;
; $Dir_Search_First written
; $Dir_Search_Next written
; $Find_First written
; $Find_Next written
; PackName written
;
; Modification history:
;
; Created: ARR 4 April 1983
.xlist
.xcref
include version.inc
include dosseg.inc
INCLUDE DOSSYM.INC
INCLUDE DEVSYM.INC
INCLUDE fastopen.inc
INCLUDE fastxxxx.inc
.cref
.list
i_need SEARCHBUF,53
i_need SATTRIB,BYTE
I_Need OpenBuf,128
I_need DMAAdd,DWORD
I_need THISFCB,DWORD
I_need CurDrv,BYTE
I_need EXTFCB,BYTE
I_need Fastopenflg,BYTE
I_need DOS34_FLAG,WORD
DOSCODE SEGMENT
ASSUME SS:DOSDATA,CS:DOSCODE
EXTRN DOS_SEARCH_FIRST:NEAR
EXTRN DOS_SEARCH_NEXT:NEAR
EXTRN TransFCB:NEAR
EXTRN TransPathSet:NEAR
;----------------------------------------------------------------------------
; Procedure Name : $DIR_SEARCH_FIRST
;
; Inputs:
; DS:DX Points to unopenned FCB
; Function:
; Directory is searched for first matching entry and the directory
; entry is loaded at the disk transfer address
; Returns:
; AL = -1 if no entries matched, otherwise 0
;----------------------------------------------------------------------------
procedure $DIR_SEARCH_FIRST,NEAR
ASSUME CS:DOSCODE,SS:DOSDATA
;hkn; SS override
MOV WORD PTR THISFCB,DX
MOV WORD PTR THISFCB+2,DS
MOV SI,DX
CMP BYTE PTR [SI],0FFH
JNZ NORMFCB4
ADD SI,7 ; Point to drive select byte
NORMFCB4:
SAVE <[SI]> ; Save original drive byte for later
;hkn; SS is DOSDATA
Context ES ; get es to address DOSGroup
;hkn; OpenBuf is in DOSDATA
MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
call TransFCB ; convert the FCB, set SATTRIB EXTFCB
JNC SearchIt ; no error, go and look
RESTORE <BX> ; Clean stack
;
; Error code is in AX
;
transfer FCB_Ret_Err ; error
SearchIt:
;hkn; SS is DOSDATA
Context DS ; get ready for search
SAVE <<WORD PTR DMAAdd>, <WORD PTR DMAAdd+2>>
;hkn; Searchbuf is in DOSDATA
MOV WORD PTR DMAAdd,OFFSET DOSDATA:SEARCHBUF
MOV WORD PTR DMAAdd+2,DS
call GET_FAST_SEARCH ; search
RESTORE <<WORD PTR DMAAdd+2>, <WORD PTR DMAAdd>>
JNC SearchSet ; no error, transfer info
RESTORE <BX> ; Clean stack
;
; Error code is in AX
;
transfer FCB_Ret_Err
;
; The search was successful (or the search-next). We store the information
; into the user's FCB for continuation.
;
SearchSet:
;hkn; Searchbuf is in DOSDATA
MOV SI,OFFSET DOSDATA:SEARCHBUF
LES DI,THISFCB ; point to the FCB
TEST EXTFCB,0FFH ;
JZ NORMFCB1
ADD DI,7 ; Point past the extension
NORMFCB1:
RESTORE <BX> ; Get original drive byte
OR BL,BL
JNZ SearchDrv
MOV BL,CurDrv
INC BL
SearchDrv:
LODSB ; Get correct search contin drive byte
XCHG AL,BL ; Search byte to BL, user byte to AL
INC DI
; STOSB ; Store the correct "user" drive byte
; at the start of the search info
MOV CX,20/2
REP MOVSW ; Rest of search cont info, SI -> entry
XCHG AL,BL ; User drive byte back to BL, search
; byte to AL
STOSB ; Search contin drive byte at end of
; contin info
LES DI,DMAAdd
TEST EXTFCB,0FFH
JZ NORMFCB2
MOV AL,0FFH
STOSB
INC AL
MOV CX,5
REP STOSB
MOV AL,SATTRIB
STOSB
NORMFCB2:
MOV AL,BL ; User Drive byte
STOSB
IFDEF DBCS ;AN000;
MOVSW ; 2/13/KK ;AN000;
CMP BYTE PTR ES:[DI-2],5 ; 2/13/KK ;AN000;
JNZ NOTKTRAN ; 2/13/KK ;AN000;
MOV BYTE PTR ES:[DI-2],0E5H ; 2/13/KK ;AN000;
NOTKTRAN: ; 2/13/KK ;AN000;
MOV CX,15 ; 2/13/KK ;AN000;
ELSE ;AN000;
MOV CX,16 ; 32 / 2 words of dir entry ;AN000;
ENDIF ;AN000;
REP MOVSW
transfer FCB_Ret_OK
EndProc $DIR_SEARCH_FIRST, NoCheck
;----------------------------------------------------------------------------
;
; Procedure Name : $DIR_SEARCH_NEXT
;
; Inputs:
; DS:DX points to unopenned FCB returned by $DIR_SEARCH_FIRST
; Function:
; Directory is searched for the next matching entry and the directory
; entry is loaded at the disk transfer address
; Returns:
; AL = -1 if no entries matched, otherwise 0
;----------------------------------------------------------------------------
procedure $DIR_SEARCH_NEXT,NEAR
ASSUME CS:DOSCODE,SS:DOSDATA
;hkn; SS override
MOV WORD PTR THISFCB,DX
MOV WORD PTR THISFCB+2,DS
MOV SATTRIB,0
MOV EXTFCB,0
;hkn; SS is DOSDATA
Context ES
;hknl SEARCHBUF is in DOSDATA
MOV DI,OFFSET DOSDATA:SEARCHBUF
MOV SI,DX
CMP BYTE PTR [SI],0FFH
JNZ NORMFCB6
ADD SI,6
LODSB
;hkn; ss override
MOV SATTRIB,AL
DEC EXTFCB
NORMFCB6:
LODSB ; Get original user drive byte
SAVE <AX> ; Put it on stack
MOV AL,[SI+20] ; Get correct search contin drive byte
STOSB ; Put in correct place
MOV CX,20/2
REP MOVSW ; Transfer in rest of search contin info
;hkn; SS is DOSDATA
Context DS
SAVE <<WORD PTR DMAAdd>, <WORD PTR DMAAdd+2>>
;hkn; SEARCHBUF is in DOSDATA
MOV WORD PTR DMAAdd,OFFSET DOSDATA:SEARCHBUF
MOV WORD PTR DMAAdd+2,DS
call DOS_SEARCH_NEXT ; Find it
RESTORE <<WORD PTR DMAAdd+2>, <WORD PTR DMAAdd>>
JC SearchNoMore
JMP SearchSet ; Ok set return
SearchNoMore:
LES DI,THISFCB
TEST EXTFCB,0FFH
JZ NORMFCB8
ADD DI,7 ; Point past the extension
NORMFCB8:
RESTORE <BX> ; Get original drive byte
MOV ES:[DI],BL ; Store the correct "user" drive byte
; at the right spot
;
; error code is in AX
;
transfer FCB_Ret_Err
EndProc $DIR_SEARCH_NEXT
;---------------------------------------------------------------------------
;
; Procedure Name : $FIND_FIRST
;
; Assembler usage:
; MOV AH, FindFirst
; LDS DX, name
; MOV CX, attr
; INT 21h
; ; DMA address has datablock
;
; Error Returns:
; AX = error_path_not_found
; = error_no_more_files
;---------------------------------------------------------------------------
procedure $FIND_FIRST,NEAR
ASSUME CS:DOSCODE,SS:DOSDATA
MOV SI,DX ; get name in appropriate place
;hkn; SS override
MOV SATTRIB,CL ; Search attribute to correct loc
;hkn; OpenBuf is in DOSDATA
MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
call TransPathSet ; convert the path
JNC Find_it ; no error, go and look
FindError:
error error_path_not_found ; error and map into one.
Find_it:
;hkn; SS is DOSDATA
Context DS
SAVE <<WORD PTR DMAAdd>, <WORD PTR DMAAdd+2>>
;hkn; SEARCHBUF is in DOSDATA
MOV WORD PTR DMAAdd,OFFSET DOSDATA:SEARCHBUF
MOV WORD PTR DMAAdd+2,DS
call GET_FAST_SEARCH ; search
RESTORE <<WORD PTR DMAAdd+2>, <WORD PTR DMAAdd>>
JNC FindSet ; no error, transfer info
transfer Sys_Ret_Err
FindSet:
;hkn; SEARCHBUF is in DOSDATA
MOV SI,OFFSET DOSDATA:SEARCHBUF
LES DI,DMAAdd
MOV CX,21
REP MOVSB
PUSH SI ; Save pointer to start of entry
MOV AL,[SI.dir_attr]
STOSB
ADD SI,dir_time
MOVSW ; dir_time
MOVSW ; dir_date
INC SI
INC SI ; Skip dir_first
MOVSW ; dir_size (2 words)
MOVSW
POP SI ; Point back to dir_name
IFDEF DBCS ;AN000;
PUSH DI ; XXXX save dest name 2/13/KK ;AN000;
CALL PackName ;AN000;
POP DI ; XXXX Recover dest name 2/13/KK ;AN000;
CMP BYTE PTR ES:[DI],05H ; XXXX Need fix? 2/13/KK ;AN000;
JNZ FNXXX ; XXXX No 2/13/KK ;AN000;
MOV BYTE PTR ES:[DI],0E5H ; XXXX Yes, Fix 2/13/KK ;AN000;
FNXXX: ; 2/13/KK ;AN000;
ELSE ;AN000;
CALL PackName
ENDIF
transfer Sys_Ret_OK ; bye with no errors
EndProc $FIND_FIRST
;---------------------------------------------------------------------------
;
; Procedure Name : $FIND_NEXT
;
; Assembler usage:
; ; dma points at area returned by find_first
; MOV AH, findnext
; INT 21h
; ; next entry is at dma
;
; Error Returns:
; AX = error_no_more_files
;---------------------------------------------------------------------------
procedure $FIND_NEXT,NEAR
ASSUME CS:DOSCODE,SS:DOSDATA
;hkn; SS is DOSDATA
Context ES
;hkn; SEARCHBUF is in DOSDATA
MOV DI,OFFSET DOSDATA:SEARCHBUF
;hkn; SS override
LDS SI,DMAAdd
MOV CX,21
REP MOVSB ; Put the search continuation info
; in the right place
;hkn; SS is DOSDATA
Context DS ; get ready for search
SAVE <<WORD PTR DMAAdd>, <WORD PTR DMAAdd+2>>
;hkn; SEARCHBUF is in DOSDATA
MOV WORD PTR DMAAdd,OFFSET DOSDATA:SEARCHBUF
MOV WORD PTR DMAAdd+2,DS
call DOS_SEARCH_NEXT ; Find it
RESTORE <<WORD PTR DMAAdd+2>, <WORD PTR DMAAdd>>
JNC FindSet ; No error, set info
transfer Sys_Ret_Err
EndProc $FIND_NEXT
Break <PackName - convert file names from FCB to ASCIZ>
;** PackName - Convert name to ASCIZ format.
;
; PackName transfers a file name from DS:SI to ES:DI and converts it to
; the ASCIZ format.
;
; ENTRY (DS:SI) = 11 character FCB or dir entry name
; (ES:DI) = destination area (13 bytes)
; EXIT (ds:SI) and (es:DI) advancedn
; USES al, CX, SI, DI, Flags (BUGBUG - not verified - jgl)
Procedure PackName,NEAR
ASSUME CS:DOSCODE,SS:DOSDATA
; Move over 8 characters to cover the name component, then trim it's
; trailing blanks.
MOV CX,8 ; Pack the name
REP MOVSB ; Move all of it
main_kill_tail:
CMP BYTE PTR ES:[DI-1]," "
JNZ find_check_dot
DEC DI ; Back up over trailing space
INC CX
CMP CX,8
JB main_kill_tail
find_check_dot:
CMP WORD PTR [SI],(" " SHL 8) OR " "
JNZ got_ext ; Some chars in extension
CMP BYTE PTR [SI+2]," "
JZ find_done ; No extension
got_ext:
MOV AL,"."
STOSB
MOV CX,3
REP MOVSB
ext_kill_tail:
CMP BYTE PTR ES:[DI-1]," "
JNZ find_done
DEC DI ; Back up over trailing space
JMP ext_kill_tail
find_done:
XOR AX,AX
STOSB ; NUL terminate
return
EndProc PackName
procedure GET_FAST_SEARCH,NEAR
;hkn; SS override
OR DOS34_FLAG,SEARCH_FASTOPEN ;FO.trigger fastopen ;AN000;
call DOS_SEARCH_FIRST
return
EndProc GET_FAST_SEARCH
DOSCODE ENDS
END
| 22.990783 | 77 | 0.664261 |
e9e93dd0159c3b14a0d553e394cbea60bb1cf619 | 4,647 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1053.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_1053.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_1053.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x1e547, %rsi
lea addresses_A_ht+0x8f47, %rdi
nop
nop
nop
nop
nop
cmp %rbx, %rbx
mov $80, %rcx
rep movsw
and %rdx, %rdx
lea addresses_A_ht+0xb107, %rbp
nop
nop
nop
nop
nop
dec %r14
mov (%rbp), %rcx
nop
nop
sub %rdi, %rdi
lea addresses_WC_ht+0x11707, %rsi
lea addresses_D_ht+0x1d8a7, %rdi
nop
nop
nop
nop
nop
inc %r15
mov $94, %rcx
rep movsl
nop
nop
xor %rsi, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r14
push %r9
push %rbp
// Faulty Load
lea addresses_D+0x10e87, %r10
nop
nop
nop
xor $18410, %r9
mov (%r10), %r11
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 5, '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
*/
| 47.907216 | 2,999 | 0.662363 |
900d4dfeaf0ff713844cc737f4df32deccef997a | 978 | asm | Assembly | programs/oeis/056/A056926.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/056/A056926.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/056/A056926.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A056926: a(n) = sqrt(n) if n is a square, otherwise 1.
; 0,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,6,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,10,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,11,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,14,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,15,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
mov $13,$0
mov $15,2
lpb $15,1
clr $0,13
mov $0,$13
sub $15,1
add $0,$15
sub $0,1
mov $2,$0
lpb $2,1
mov $2,$1
mov $5,$0
lpb $5,1
add $0,$2
mov $1,$0
sub $5,2
sub $5,$2
add $2,1
trn $5,$2
lpe
sub $2,1
lpe
mul $1,7
mov $16,$15
lpb $16,1
mov $14,$1
sub $16,1
lpe
lpe
lpb $13,1
mov $13,0
sub $14,$1
lpe
mov $1,$14
div $1,7
| 25.076923 | 507 | 0.48364 |
eff9b4093e6de18309ef7a6acf3de2e33c86a24f | 34 | asm | Assembly | tests/jump/jump_address.asm | UPB-FILS-ALF/devoir-1-tests | 75ad3698f506329c609cdfe66e9fbeffe2ae03ad | [
"Apache-2.0"
] | null | null | null | tests/jump/jump_address.asm | UPB-FILS-ALF/devoir-1-tests | 75ad3698f506329c609cdfe66e9fbeffe2ae03ad | [
"Apache-2.0"
] | null | null | null | tests/jump/jump_address.asm | UPB-FILS-ALF/devoir-1-tests | 75ad3698f506329c609cdfe66e9fbeffe2ae03ad | [
"Apache-2.0"
] | 1 | 2021-03-25T10:58:49.000Z | 2021-03-25T10:58:49.000Z | push 1
push 2
jump 5
push 3
stack
| 5.666667 | 6 | 0.735294 |
23a8ba7fa6ffd0497751ff44543007aaf760ec83 | 504 | asm | Assembly | programs/oeis/076/A076049.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/076/A076049.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/076/A076049.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A076049: Numbers k such that the sum of the k-th triangular number and (k+2)-nd triangular number is a triangular number.
; 0,3,8,25,54,153,322,899,1884,5247,10988,30589,64050,178293,373318,1039175,2175864,6056763,12681872,35301409,73915374,205751697,430810378,1199208779,2510946900,6989500983,14634871028,40737797125
add $0,1
lpb $0
mov $2,$0
sub $0,1
seq $2,79496 ; a(0) = a(1) = 1; thereafter a(2*n+1) = 2*a(2*n) - a(2*n-1), a(2*n) = 4*a(2*n-1) - a(2*n-2).
add $1,$2
lpe
sub $1,1
mov $0,$1
| 38.769231 | 195 | 0.686508 |
ba0c91014293ebc76a2abbba9656fbe74e14ea67 | 734 | asm | Assembly | test/jzas/sintactic/valid/success12.asm | scoffey/jz80sim | 0de07a5ef51a1e7131b27056744459f29cd11d39 | [
"MIT"
] | 1 | 2015-03-27T15:58:50.000Z | 2015-03-27T15:58:50.000Z | test/jzas/sintactic/valid/success12.asm | scoffey/jz80sim | 0de07a5ef51a1e7131b27056744459f29cd11d39 | [
"MIT"
] | null | null | null | test/jzas/sintactic/valid/success12.asm | scoffey/jz80sim | 0de07a5ef51a1e7131b27056744459f29cd11d39 | [
"MIT"
] | null | null | null | aseg
org 100h
;n1, n2 y mayor son direcciones de 16 bits tanto n1 como n2 no pueden ser bc pudiendo ser rotulos o registros al igualq ue mayor.
maximo macro n1, n2, mayor
local backup, carga
ld (backup), a
ld a, b
ld (backup + 1), a
ld a, (n1)
ld b, a
ld a, (n2)
cp b
jp p, carga
ld a, (n1)
carga ld (mayor), a
ld a, (backup + 1)
ld b, a
ld a, (backup)
jp backup + 2
backup ds 2
endm
inicio ld ix, vector
ld b, cardinalidad + 1
ld a, -128
ld (max), a
jr chequeo
ciclo maximo max, ix, max
inc ix
chequeo djnz ciclo
rst 38h
vector db 1,2,3,4,5,4,3,2,18,7
cardinalidad equ $ - vector
max ds 1
end inicio | 18.35 | 130 | 0.56267 |
b8d41de3d1a149a4792a8b7b5adae08cf3eb2c8e | 1,051 | asm | Assembly | libsrc/strings/strnicmp_callee.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/strings/strnicmp_callee.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/strings/strnicmp_callee.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ; int __CALLEE__ strnicmp_callee(char *s1, char *s2, uint n)
; caseless compare
; 12.2006 aralbrec
XLIB strnicmp_callee
XDEF ASMDISP_STRNICMP_CALLEE
LIB asm_tolower
.strnicmp_callee
pop hl
pop bc
pop de
ex (sp),hl
; enter : bc = uint n
; de = char *s2
; hl = char *s1
; exit : if s1==s2 : hl = 0, Z flag set
; if s1<<s2 : hl < 0, NC+NZ flag set
; if s1>>s2 : hl > 0, C+NZ flag set
; uses : af, bc, de, hl
.asmentry
.strnicmp1
ld a,b
or c
jr z, equal
push bc
ld a,(hl)
call asm_tolower
ld c,a
ld a,(de)
call asm_tolower
cp c
pop bc
jr nz, different
dec bc
inc de
inc hl
or a
jp nz, strnicmp1
; here strings are equal
.equal
ld l,a
ld h,a
ret
.different
ld a,(de) ; redo mismatch compare without tolower modification
cp (hl)
; effectively performed *s2 - *s1
ld h,$80
ret nc
dec h
ret
DEFC ASMDISP_STRNICMP_CALLEE = asmentry - strnicmp_callee
| 14.39726 | 83 | 0.564225 |
c7c360e9d2eb3b2daa25cf6ecd72a8c39196ee4f | 436 | asm | Assembly | unittests/32Bit_ASM/PrimaryGroup/5_FF_02.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 628 | 2020-03-06T14:01:32.000Z | 2022-03-31T06:35:14.000Z | unittests/32Bit_ASM/PrimaryGroup/5_FF_02.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 576 | 2020-03-06T08:25:12.000Z | 2022-03-30T04:05:29.000Z | unittests/32Bit_ASM/PrimaryGroup/5_FF_02.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 38 | 2020-03-07T06:10:00.000Z | 2022-03-29T09:27:36.000Z | %ifdef CONFIG
{
"RegData": {
"RAX": "0x41424344"
},
"Mode": "32BIT"
}
%endif
mov edi, 0xe0000000
lea esp, [edi + 8 * 4]
mov eax, 0x41424344
mov [edi + 8 * 0], eax
mov eax, 0x51525354
mov [edi + 8 * 1], eax
lea ebx, [rel .call_tgt]
mov [edi + 8 * 2], ebx
mov eax, 0
call dword [edi + 8 * 2]
jmp .end
.call_tgt:
mov eax, [edi + 8 * 0]
ret
; Couple things that could catch failure
mov eax, 0
jmp .end
mov eax, 0
.end:
hlt
| 12.111111 | 40 | 0.600917 |
d29cafab87132226e868b00b0386bc296672b626 | 7,208 | asm | Assembly | Transynther/x86/_processed/NONE/_st_zr_/i7-8650U_0xd2_notsx.log_922_73.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_st_zr_/i7-8650U_0xd2_notsx.log_922_73.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_st_zr_/i7-8650U_0xd2_notsx.log_922_73.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xd3a6, %rsi
lea addresses_WC_ht+0xbfa6, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
inc %rax
mov $80, %rcx
rep movsb
nop
nop
nop
mfence
lea addresses_normal_ht+0xcda6, %rsi
lea addresses_WT_ht+0x1ec2c, %rdi
clflush (%rdi)
xor %rbp, %rbp
mov $95, %rcx
rep movsb
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_WT_ht+0x12a6, %r10
nop
nop
sub %rax, %rax
mov (%r10), %edi
nop
nop
nop
nop
dec %rdi
lea addresses_D_ht+0x13306, %r10
nop
xor %rax, %rax
movb (%r10), %cl
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0x8a86, %r10
nop
nop
nop
nop
nop
and $30792, %r12
movb (%r10), %cl
nop
nop
nop
add $10564, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_RW+0xb3a6, %rsi
lea addresses_WC+0x9aae, %rdi
nop
nop
nop
nop
cmp $64600, %r9
mov $116, %rcx
rep movsb
nop
nop
nop
cmp %rsi, %rsi
// Store
lea addresses_D+0x18e46, %rbx
nop
nop
nop
nop
nop
and %rcx, %rcx
movl $0x51525354, (%rbx)
nop
add %r8, %r8
// Store
lea addresses_RW+0x2da6, %r9
dec %r8
movb $0x51, (%r9)
nop
sub %rdi, %rdi
// Store
lea addresses_PSE+0x1e5a6, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
xor $15849, %rdi
movb $0x51, (%rcx)
nop
nop
nop
nop
nop
and %rcx, %rcx
// Store
lea addresses_WT+0x9a26, %r8
nop
nop
nop
nop
nop
xor %rsi, %rsi
movb $0x51, (%r8)
add %r8, %r8
// Store
lea addresses_D+0x1d716, %rdi
nop
nop
cmp %r9, %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm1
movups %xmm1, (%rdi)
nop
nop
add $55940, %rcx
// Store
lea addresses_RW+0x16166, %rdi
nop
nop
nop
nop
sub $21676, %r13
movw $0x5152, (%rdi)
and %rsi, %rsi
// Load
lea addresses_US+0x63a6, %rsi
nop
and %r13, %r13
mov (%rsi), %r8
nop
nop
dec %r9
// Store
lea addresses_normal+0x19936, %rbx
nop
nop
nop
and $17, %r9
mov $0x5152535455565758, %rsi
movq %rsi, %xmm1
vmovups %ymm1, (%rbx)
nop
nop
add %rsi, %rsi
// Faulty Load
lea addresses_A+0x163a6, %r13
nop
sub %rsi, %rsi
vmovups (%r13), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r8
lea oracles, %r13
and $0xff, %r8
shlq $12, %r8
mov (%r13,%r8,1), %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_RW', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'32': 880, '00': 42}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 00 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 00 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 00 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 00 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 00 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 00 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 30.542373 | 2,765 | 0.649556 |
d8d5c83559e103066e7ed3093709324ba9f3e4ec | 722 | asm | Assembly | oeis/023/A023539.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/023/A023539.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/023/A023539.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A023539: Convolution of natural numbers with composite numbers.
; 4,14,32,59,96,145,208,286,380,492,624,777,952,1151,1375,1625,1902,2207,2542,2909,3309,3743,4212,4717,5260,5842,6464,7128,7836,8589,9388,10235,11131,12077,13074,14123,15226,16384,17598,18869,20198,21587,23038,24552,26130,27773,29482,31259,33105,35021,37009,39071,41208,43421,45711,48079,50527,53056,55667,58362,61142,64008,66961,70002,73133,76355,79669,83076,86577,90173,93865,97655,101544,105533,109624,113819,118119,122525,127039,131663,136398,141245,146206,151282,156474,161783,167210,172756
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
add $0,1
seq $0,53767 ; Sum of first n composite numbers.
add $1,$0
lpe
mov $0,$1
| 45.125 | 495 | 0.759003 |
36b57c34f04917c995df49c6307c42bd3785cc83 | 4,324 | asm | Assembly | covid.asm | oxypomme/CallOfVid-19 | a1a9d8b79a2d96c1e85b3fdf7faf066911ec0a90 | [
"MIT"
] | 1 | 2021-12-15T14:55:37.000Z | 2021-12-15T14:55:37.000Z | covid.asm | oxypomme/CallOfVid-19 | a1a9d8b79a2d96c1e85b3fdf7faf066911ec0a90 | [
"MIT"
] | null | null | null | covid.asm | oxypomme/CallOfVid-19 | a1a9d8b79a2d96c1e85b3fdf7faf066911ec0a90 | [
"MIT"
] | null | null | null | .286
SSEG SEGMENT STACK
DB 32 DUP("STACK---")
SSEG ENDS
; Data Segment
DSEG SEGMENT
DSEG ENDS
; Code Segment
CSEG SEGMENT 'CODE'
ASSUME CS:CSEG, DS:DSEG, SS:SSEG
%include game.asm
MAIN PROC FAR
; Sauver l'adresse de retour
push DS
push 0
; Registre
mov AX, DSEG
mov DS, AX
; Mode Video
; 320*200 avec 256 couleurs
call oxgSETUPGRAPHICS
push AX
init_menu:
call g_MENU
menu:
pop AX
mov oxj_framerate, 60
call oxj_FRM
push AX
push BX
push CX
push DX
cmp g_cursY, _PLAYy_
jne clearQuitCursor
mov DX, _QUITy_
jmp drawCursor
clearQuitCursor:
mov DX, _PLAYy_
drawCursor:
sub DX, _g_virSize
CLEARVIRUS 122, DX
mov DX, g_cursY
sub DX, _g_virSize
CLEARVIRUS 122, DX
cmp g_virusAnimFrames, 30
ja drawAltMenuVirus
DRAWVIRUSo 122, DX
jmp finallyMenu
drawAltMenuVirus:
DRAWVIRao 122, DX
finallyMenu:
pop DX
pop CX
pop BX
pop AX
call g_ANIMATEVIRUSES
push AX
call oxj_GETKEYPRESS
jz menu
; on récupère la touche appuyée dans AH
call oxj_GETKEY
; si c'est Z
cmp AH, _Zkey_
je menu_up
; si c'est HAUT
cmp AH, _Upkey_
je menu_up
; si c'est S
cmp AH, _Skey_
je menu_down
; si c'est BAS
cmp AH, _Downkey_
je menu_down
; si c'est ENTER
cmp AH, _ENTERkey_
je menu_next
; sinon
jmp menu
menu_down:
cmp g_cursY, _PLAYy_
jne menu
mov g_cursY, _QUITy_
oxsPLAYSOUND _F_, 1
jmp menu
menu_up:
cmp g_cursY, _QUITy_
jne menu
mov g_cursY, _PLAYy_
oxsPLAYSOUND _F_, 1
jmp menu
menu_next:
oxsPLAYSOUND _B_, 1
cmp g_cursY, _PLAYy_
je init_draw
jmp endprog
init_draw:
oxgCLEAR
call g_INIT
draw:
pop AX
mov oxj_framerate, 25
call g_DRAWPLAYER
call oxj_FRM
call g_ANIMATEPLAYER
call g_ANIMATEVIRUSES
call g_PLAYERCOLLIDEMOB
call g_CHECKWIN
; oxgCLEAR
cmp g_playerWin, 2
je skipEndGame
push AX
oxDELAY 14F0h
jmp init_menu
skipEndGame:
cmp g_projShow, 0
jz ndrawProj
call g_DRAWBULLET
ndrawProj:
call g_DRAWMOBS
; call g_DRAWPLAYER
push AX
call oxj_GETKEYPRESS
jz draw
; on récupère la touche appuyée dans AH
call oxj_GETKEY
; Si c'est Z ou Haut
cmp AH, _Zkey_
je Zpressed
cmp AH, _Upkey_
je Zpressed
; Si c'est Q ou Gauche
cmp AH, _Qkey_
je Qpressed
cmp AH, _Leftkey_
je Qpressed
; Si c'est S ou Bas
cmp AH, _Skey_
je Spressed
cmp AH, _Downkey_
je Spressed
; Si c'est D ou Droite
cmp AH, _Dkey_
je Dpressed
cmp AH, _Rightkey_
je Dpressed
; Si c'est espace
cmp AH, _SPACEkey_
je SPACEpressed
; Si c'est ECHAP
cmp AH, _ESCkey_
je init_menu
; Sinon
jmp draw
Zpressed:
call g_PFORWARD
jmp draw
Qpressed:
call g_PLEFTWARD
jmp draw
Spressed:
call g_PBACKWARD
jmp draw
Dpressed:
call g_PRIGHTWARD
jmp draw
SPACEpressed:
call g_SHOOT
jmp draw
endprog:
oxgCLEAR
mov AX, 4c00h
int 21h
; Retour
ret
MAIN ENDP
CSEG ENDS
END MAIN
| 21.405941 | 48 | 0.470398 |
5160ad4611fc10e2c92d73c7bbb5375a0d2e432f | 8,885 | asm | Assembly | asm/tasm32/pcmail10/src/pcmail.asm | dindoliboon/archive | a5b54367dbb57260f9230375ac81e86c5fce0d7d | [
"MIT"
] | 4 | 2020-10-02T15:24:20.000Z | 2021-11-02T04:20:38.000Z | asm/tasm32/pcmail10/src/pcmail.asm | dindoliboon/archive | a5b54367dbb57260f9230375ac81e86c5fce0d7d | [
"MIT"
] | null | null | null | asm/tasm32/pcmail10/src/pcmail.asm | dindoliboon/archive | a5b54367dbb57260f9230375ac81e86c5fce0d7d | [
"MIT"
] | 2 | 2019-10-28T01:20:07.000Z | 2020-10-02T15:25:13.000Z | ;
; PCMail v1.00
;
; synopsis:
; This win32asm program demonstrates use of simple MAPI to send
; an email message with file attachments,etc. This is not one
; of my greater achievements but anyone interested in using
; MAPI32.DLL might be interested.
;
; info and usage:
; -self explanitory really. Multiple file attachments are
; seperated by a semicolon. Maximum of 10 file attachments
; allowed.
; -your last typed from box will be saved in pcmail.ini, and
; restored on next load. Note that this field may not be
; effective and will not allow you to send anonymous emails.
;
; latez..
; Virogen
;
;
extrn ExitProcess:PROC
extrn GetProcAddress:PROC
extrn LoadLibraryA:PROC
extrn MessageBoxA:PROC
extrn FreeLibrary:PROC
extrn GetModuleHandleA:PROC
extrn DialogBoxParamA:PROC
extrn LoadIconA:PROC
extrn DispatchMessageA:PROC
extrn PostQuitMessage:PROC
extrn GetDlgItemTextA:PROC
extrn SetDlgItemTextA:PROC
extrn GlobalAlloc:PROC
extrn GlobalFree:PROC
extrn GetOpenFileNameA:PROC
extrn lstrlen:PROC
extrn lstrcat:PROC
extrn SetFocus:PROC
extrn SendDlgItemMessageA:PROC
extrn SendMessageA:PROC
extrn LoadIconA:PROC
extrn GetPrivateProfileStringA:PROC
extrn WritePrivateProfileStringA:PROC
MAX_TXT equ 1000h
MAX_SUBJECT equ 100h
MAX_SINGLEFNAME equ 100h
MAX_ATTACH equ 10
MAX_FNAME equ MAX_SINGLEFNAME*MAX_ATTACH
.386p
locals
jumps
.model flat,STDCALL
include vgres.inc
include mywin.inc
include mapi32.inc
; whoop, all our dynamic variables
dynvars STRUCT
mapihnd dd 0
MAPISendMail dd 0
PCMapiMessage MapiMessage <0>
Originator MapiRecipDesc <0>
Recips MapiRecipDesc <0>
Attachments MapiFileDesc MAX_ATTACH dup (<0>)
wc WNDCLASSEX <0>
msg MSG <0>
ofn OFN <0>
DateReceived db 10 dup (0)
MessageText db MAX_TXT dup(0)
Subject db MAX_SUBJECT dup(0)
OriginatorAddress db 200 dup(0)
RecipName db 200 dup(0)
RecipAddress db 200 dup(0)
r_wparam dd 0
hInst dd 0
hMain dd 0
fname dd MAX_FNAME dup(0)
singlefname dd MAX_SINGLEFNAME dup(0)
dynvars ENDS
.code
start:
call GlobalAlloc,64,size dynvars
or eax,eax
jnz good_alloc
call MessageBoxA,0,offset memerr_txt,offset caption,MB_ICONSTOP
call ExitProcess,-1
good_alloc:
xchg edi,eax
mov pdynvars,edi
call GetModuleHandleA,0
mov [dynvars.hInst+edi],eax
call DialogBoxParamA, eax, IDD_PCSMAIL, 0, offset WndProc, 0
call GlobalFree,edi
call ExitProcess,0
WndProc PROC hwnd:DWORD, wmsg:DWORD, wparam:DWORD, lparam:DWORD
USES ebx, edi, esi
mov edi,pdynvars
mov eax,wparam
mov [dynvars.r_wparam+edi],eax
mov eax,hwnd
mov [dynvars.hMain+edi],eax
mov eax,wmsg
cmp ax,WM_INITDIALOG
jz init
cmp ax,WM_DESTROY
jz destroy
cmp ax,WM_COMMAND
jz cmd
xor eax,eax
ret
init:
call LoadIconA,[dynvars.hInst+edi],IDI_ICON1
push eax
call SendMessageA,[dynvars.hMain+edi],WM_SETICON,ICON_SMALL,eax
pop eax
call SendMessageA,[dynvars.hMain+edi],WM_SETICON,ICON_BIG,eax
lea ebx,[dynvars.OriginatorAddress+edi]
call GetPrivateProfileStringA,offset AppName,offset KeyName,offset Default,ebx,200,offset FileName
call SetDlgItemTextA, [dynvars.hMain+edi], IDC_FROMBOX, ebx
xor eax,eax
ret
destroy:
call PostQuitMessage,0
xor eax,eax
ret
cmd:
mov eax,[dynvars.r_wparam+edi]
cmp ax,IDCANCEL
jz destroy
cmp ax,IDOK
jz sendmail
cmp ax,IDC_BROWSE
jz getfile
xor eax,eax
ret
getfile:
mov eax,[dynvars.hMain+edi]
mov [dynvars.ofn.hWndOwner+edi],eax
mov [dynvars.ofn.lpstrFilter+edi],offset filter
lea eax,[dynvars.singlefname+edi]
mov [dynvars.ofn.lpstrFile+edi],eax
mov [dynvars.ofn.lStructSize+edi],size ofn
mov [dynvars.ofn.nMaxFile+edi],MAX_SINGLEFNAME
mov [dynvars.ofn.ofn_Flags+edi],OFN_HIDEREADONLY
lea eax,[dynvars.ofn+edi]
call GetOpenFileNameA, eax
or eax,eax
jz no_file
lea ebx,[dynvars.fname+edi]
call GetDlgItemTextA, [dynvars.hMain+edi], IDC_ATTACH, ebx
or eax,eax
jz no_semi
call lstrcat,ebx,offset semicolon
no_semi:
lea eax,[dynvars.singlefname+edi]
lea ebx,[dynvars.fname+edi]
call lstrcat,ebx,eax
lea eax,[dynvars.fname+edi]
call SetDlgItemTextA, [dynvars.hMain+edi], IDC_ATTACH, eax
xor eax,eax
no_file:
ret
sendmail:
lea eax,[dynvars.RecipAddress+5+edi]
call GetDlgItemTextA,[dynvars.hMain+edi],IDC_TOBOX,eax,200
or eax,eax
jz no_recip
mov dword ptr [dynvars.RecipAddress+edi],'ptms'
mov [dynvars.RecipAddress+4+edi],':'
lea ebx,[dynvars.OriginatorAddress+edi]
call GetDlgItemTextA,[dynvars.hMain+edi],IDC_FROMBOX,ebx,200
call WritePrivateProfileStringA,offset AppName,offset KeyName,ebx,offset FileName
lea eax,[dynvars.MessageText+edi]
call GetDlgItemTextA,[dynvars.hMain+edi],IDC_MSGTEXT,eax,MAX_TXT
lea eax,[dynvars.Subject+edi]
call GetDlgItemTextA,[dynvars.hMain+edi],IDC_SUBJECT,eax,MAX_SUBJECT
lea eax,[dynvars.fname+edi]
call GetDlgItemTextA,[dynvars.hMain+edi],IDC_ATTACH,eax,MAX_FNAME
call domapi
xor eax,eax
ret
no_recip:
call MessageBoxA,[dynvars.hMain+edi],offset norecip_txt,offset caption,MB_ICONHAND
xor eax,eax
ret
WndProc endp
domapi:
call LoadLibraryA,offset mapi32
mov [dynvars.mapihnd+edi],eax
or eax,eax
jz no_mapi
call GetProcAddress,[dynvars.mapihnd+edi],offset MSendMail
mov [dynvars.MAPISendMail+edi],eax
or eax,eax
jz no_mapi_unload
mov [dynvars.Recips.ulRecipClass+edi],1 ; primar recip
lea eax,[dynvars.RecipAddress+edi]
mov [dynvars.Recips.lpszName+edi],eax
mov [dynvars.Recips.lpszAddress+edi],eax
; originator defaults 0
lea eax,[dynvars.OriginatorAddress+edi]
mov [dynvars.Originator.lpszName+edi],eax
mov [dynvars.Originator.lpszAddress+edi],eax
lea eax,[dynvars.Subject+edi]
mov [dynvars.PCMapiMessage.lpszSubject+edi],eax
lea eax,[dynvars.MessageText+edi]
mov [dynvars.PCMapiMessage.lpszNoteText+edi],eax
mov [dynvars.PCMapiMessage.lpszMessageType+edi],0
lea eax,[dynvars.DateReceived+edi]
mov [dynvars.PCMapiMessage.lpszDateReceived+edi],eax
mov [dynvars.PCMapiMessage.flags+edi],MAPI_RECEIPT_REQUESTED
lea eax,[dynvars.Originator+edi]
mov [dynvars.PCMapiMessage.lpOriginator+edi],eax
mov [dynvars.PCMapiMessage.nRecipCount+edi],1
lea eax,[dynvars.Recips+edi]
mov [dynvars.PCMapiMessage.lpRecips+edi],eax
cmp byte ptr [dynvars.fname+edi],0
jnz are_attachments
mov [dynvars.PCMapiMessage.nFileCount+edi],0
jmp no_attach
are_attachments:
lea esi,[dynvars.fname+edi]
call parse_files
mov [dynvars.PCMapiMessage.nFileCount+edi],eax
lea eax,[dynvars.Attachments+edi]
mov [dynvars.PCMapiMessage.lpFiles+edi],eax
no_attach:
lea eax,[dynvars.PCMapiMessage+edi]
call [dynvars.MAPISendMail+edi],0,[dynvars.hMain+edi],eax,0,0
or eax,eax
jz good_send
call MessageBoxA,[dynvars.hMain+edi],offset senderr_txt,offset caption,0
jmp all_good
good_send:
call MessageBoxA,[dynvars.hMain+edi],offset good_txt,offset caption,0
jmp all_good
no_mapi_unload:
call MessageBoxA,[dynvars.hMain+edi],offset bad_txt,offset caption,MB_ICONEXCLAMATION
all_good:
call FreeLibrary,[dynvars.mapihnd+edi]
ret
no_mapi:
call MessageBoxA,[dynvars.hMain+edi],offset bad_txt,offset caption,MB_ICONEXCLAMATION
ret
; entry esi->fnames
parse_files:
push edi ebp
mov ebx,edi
lea edx,[dynvars.Attachments.lpszPathName+edi]
mov edi,esi
xor ebp,ebp
ploop0:
inc ebp
mov [edx],esi
mov ecx,MAX_FNAME
ploop:
lodsb
or al,al
jz over_files
cmp al,';'
jz afile
stosb
loop ploop
afile:
add edx,size MapiFileDesc
xor eax,eax
stosb
cmp ebp,MAX_ATTACH
jnz ploop0
over_files:
stosb
xchg eax,ebp
pop ebp edi
ret
.data
semicolon db ';',0
caption db 'PCMAIL v1.00',0
bad_txt db 'Could not load MAPI32.DLL and/or import necessary APIs',0
senderr_txt db 'Error sending message!',0
norecip_txt db 'You must specify a recipient first!',0
memerr_txt db 'Error allocating memory!',0
MSendMail db 'MAPISendMail',0
good_txt db 'Message Sent!',0
mapi32 db 'MAPI32.DLL',0
szClass db 'PCSMAIL',0
filter db 'All files',0,'*.*',0
AppName db 'PCMAIL',0
KeyName db 'Originator',0
Default db 'Default',0
FileName db 'PCMAIL.INI',0
pdynvars dd 0
end start
ends
| 27.940252 | 104 | 0.693979 |
0cd94ca91083a9e4cef405ec3faf2c2f7a546b57 | 305 | asm | Assembly | programs/oeis/089/A089143.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/089/A089143.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089143.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A089143: a(n) = 9*2^n - 6.
; 3,12,30,66,138,282,570,1146,2298,4602,9210,18426,36858,73722,147450,294906,589818,1179642,2359290,4718586,9437178,18874362,37748730,75497466,150994938,301989882,603979770,1207959546,2415919098,4831838202,9663676410,19327352826
mov $1,2
pow $1,$0
sub $1,1
mul $1,9
add $1,3
| 33.888889 | 228 | 0.763934 |
9ed836d8bdf71d3639b2b054747a600820e9b69d | 1,992 | asm | Assembly | src/interrupt.asm | fjpena/sword-of-ianna-msx2 | f104f46a677e4b21f42fbed478307a0bb1d372f3 | [
"Apache-2.0"
] | 43 | 2017-10-21T23:01:25.000Z | 2022-02-21T17:45:11.000Z | src/interrupt.asm | fjpena/sword-of-ianna-msx2 | f104f46a677e4b21f42fbed478307a0bb1d372f3 | [
"Apache-2.0"
] | null | null | null | src/interrupt.asm | fjpena/sword-of-ianna-msx2 | f104f46a677e4b21f42fbed478307a0bb1d372f3 | [
"Apache-2.0"
] | 6 | 2017-10-23T05:48:50.000Z | 2022-01-06T03:11:49.000Z | ; Interrupt-related routines
; Initialize ISR hook, set frame counter
init_ISR:
; Initialize variables
ld hl, 0
ld (FrameCounter), hl
ld (UserISR), hl
ld (msx2ISR), hl
; Initialize ISR
; first, copy the old hook, so that it can be called
ld de, InterruptBuffer
ld hl, $fd9a
ld bc, 5
ldir
; now, set up the new one
ld a, $c3 ; opcode for JP
ld hl, MSX_ISR ; the ISR will call this function
di
ld ($fd9a), a
ld ($fd9b), hl
ei
ret
; Run a user-defined ISR
; Executed every frame, through the $fd9a hook
MSX_ISR:
; CALL InterruptBuffer
ld a,($2d) ; read MSX version
or a ; is it MSX1?
jp z, MSXISR_msx1
; if this is a MSX2, check if we have been interrupted by a horizontal line interrupt
; not in use right now...
ld a,1
out ($99),a
ld a,15+128
out ($99),a
ld a,(de) ;wait 7 t-states
in a,($99)
ex af,af'
xor a ;ld a,0
out ($99),a
ld a,15+128
out (#99),a
ex af,af'
; A has the value of the VDP status register 1. If bit 0 is 1, we hit the horizontal retrace
and 1
jp z, MSXISR_msx1
callmsx2_ISR:
LD HL, (msx2ISR)
ld a, h
or l ; if h | l is zero, that is because both h and l are zero
ret z
jp (hl)
ret
MSXISR_msx1:
in a,($99) ; Reseteamos el bit de interrupcion
bit 7,a ; Si la interrupcion no fue provocada por el VDP
ret z ; Volvemos
LD HL, (FrameCounter)
INC HL
LD (FrameCounter), HL
LD HL, (UserISR)
; if the value of UserISR is 0, we should return
ld a, h
or l ; if h | l is zero, that is because both h and l are zero
ret z
JP (HL)
RET
; Install a user-defined ISR
;
; INPUT
; HL: pointer to the user-defined ISR
INSTALL_ISR:
ld (UserISR), HL
ret
; Install a user-defined ISR for horizontal retrace IRQs (MSX2 and later only)
;
; INPUT
; HL: pointer to the user-defined ISR
INSTALL_HORISR:
ld (msx2ISR), HL
ret
| 20.968421 | 104 | 0.606928 |
be1b619ccb9be492a99ea22972d887a04f8fa592 | 315 | asm | Assembly | programs/oeis/040/A040649.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040649.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040649.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040649: Continued fraction for sqrt(675).
; 25,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50
mov $1,$0
cmp $0,0
sub $1,$0
gcd $1,2
add $1,23
add $0,$1
mul $0,$1
sub $0,575
| 26.25 | 189 | 0.603175 |
77737a837e3432e848f6209a92129ccb72d881ab | 1,618 | asm | Assembly | programs/Music.asm | TheLogicMaster/lm8 | 8f75c0c0b269f699fc3ba574b20ceb1ff86a1b61 | [
"MIT"
] | 10 | 2021-08-29T10:31:45.000Z | 2022-02-26T14:20:54.000Z | programs/Music.asm | TheLogicMaster/lm8 | 8f75c0c0b269f699fc3ba574b20ceb1ff86a1b61 | [
"MIT"
] | null | null | null | programs/Music.asm | TheLogicMaster/lm8 | 8f75c0c0b269f699fc3ba574b20ceb1ff86a1b61 | [
"MIT"
] | null | null | null | ; Music player --- Run the fetch_songs.sh script to generate the song binaries before assembling
; Set buzzer pin (Arduino 2) to output mode
ldr $2,B
out {arduino_output},B
; Setup timer 0 for note duration
ldr {centiseconds},A
out {timer_unit_0},A
; Load song address
lda song
str [index_high],H
str [index_low],L
loop:
; Load current note address
ldr [index_high],H
ldr [index_low],L
; Load note length and check for end of song
ldr [HL],A
cmp $FF
jr done,Z
ina
; Start note length timer
out {timer_count_0},A
out {timer_0},A
; Load note
ldr [HL],A
push A
ina
ldr [HL],B
ina
; Store new note address
str [index_high],H
str [index_low],L
pop H
; Set A to 0 to enable the buzzer if the note isn't a rest
or B
jr rest,Z
ldr $0,A
jr play_note
rest:
ldr $2,A ; Disable buzzer
play_note:
ldr {milliseconds},L
out {timer_unit_1},L
out {timer_count_1},H
out {timer_1},L
note_millis:
in {timer_1},L
jr note_millis,Z
ldr {centimilliseconds},L
out {timer_unit_1},L
out {timer_count_1},B
out {timer_1},L
note_centimillis:
in {timer_1},L
jr note_centimillis,Z
; Toggle buzzer pin
xor $1
out {arduino_2},A
; Check if note ended
in {timer_0},L
jr play_note,Z
; Short note separation
ldr $1,L
out {timer_count_0},L
out {timer_0},L
separation:
in {timer_0},L
jr separation,Z
jmp loop
done:
ldr $1,A
out {led_0},A
halt
song: bin "songs/cannonind.bin"
data
index_high: var
index_low: var
| 16.680412 | 96 | 0.628554 |
c7451f799ada8b5f7cd68b8aba53d036ebbe8d28 | 7,539 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_284.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_284.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_284.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xf95a, %rsi
lea addresses_D_ht+0x1e972, %rdi
nop
nop
nop
nop
nop
inc %r15
mov $80, %rcx
rep movsw
and %rax, %rax
lea addresses_D_ht+0x1cffa, %rdx
clflush (%rdx)
nop
nop
nop
xor %r15, %r15
mov (%rdx), %edi
nop
nop
nop
nop
mfence
lea addresses_D_ht+0x185a, %rsi
lea addresses_WT_ht+0xf25a, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
cmp %r9, %r9
mov $33, %rcx
rep movsb
nop
xor $54666, %rdx
lea addresses_D_ht+0x1229a, %rsi
lea addresses_A_ht+0x1345a, %rdi
nop
nop
sub %r13, %r13
mov $89, %rcx
rep movsl
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_WC_ht+0x1ce5a, %rdi
nop
nop
nop
nop
cmp $61915, %rsi
movw $0x6162, (%rdi)
nop
nop
nop
and $58596, %rdx
lea addresses_A_ht+0xffb, %rsi
lea addresses_UC_ht+0x1b05a, %rdi
and $19266, %r15
mov $93, %rcx
rep movsl
nop
nop
nop
nop
and $34069, %rdx
lea addresses_WC_ht+0x14a4, %rsi
lea addresses_D_ht+0x13766, %rdi
xor %r13, %r13
mov $102, %rcx
rep movsq
nop
nop
sub %r9, %r9
lea addresses_normal_ht+0xddd2, %rsi
lea addresses_D_ht+0x9dfa, %rdi
nop
nop
xor %r13, %r13
mov $43, %rcx
rep movsb
cmp %rsi, %rsi
lea addresses_WC_ht+0xc25a, %rsi
lea addresses_A_ht+0x1bdda, %rdi
nop
nop
nop
nop
nop
sub $10227, %rax
mov $12, %rcx
rep movsw
nop
cmp %rsi, %rsi
lea addresses_A_ht+0x10f5a, %rsi
lea addresses_WC_ht+0x1d576, %rdi
nop
nop
xor %rax, %rax
mov $102, %rcx
rep movsw
nop
nop
add $55113, %rcx
lea addresses_A_ht+0xebba, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
inc %rdi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm6
movups %xmm6, (%rcx)
nop
nop
cmp $62348, %r15
lea addresses_WC_ht+0x1995a, %rsi
lea addresses_WT_ht+0x205a, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
nop
and $52373, %rax
mov $63, %rcx
rep movsw
nop
add $6330, %rsi
lea addresses_WC_ht+0x1e51a, %r9
clflush (%r9)
nop
add %rdx, %rdx
and $0xffffffffffffffc0, %r9
movntdqa (%r9), %xmm4
vpextrq $0, %xmm4, %r13
nop
xor $65289, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %rax
push %rsi
// Faulty Load
lea addresses_US+0x105a, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
dec %r11
mov (%rsi), %r13d
lea oracles, %rsi
and $0xff, %r13
shlq $12, %r13
mov (%rsi,%r13,1), %r13
pop %rsi
pop %rax
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': True}}
{'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.741935 | 2,999 | 0.661494 |
3777204dc6518f160eb71db741d5f98e0ef2da84 | 341 | asm | Assembly | libsrc/_DEVELOPMENT/stdlib/c/sdcc_ix/ultoa_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdlib/c/sdcc_ix/ultoa_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdlib/c/sdcc_ix/ultoa_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; char *ultoa_callee(unsigned long num, char *buf, int radix)
SECTION code_stdlib
PUBLIC _ultoa_callee, l0_ultoa_callee
EXTERN asm_ultoa
_ultoa_callee:
pop af
pop hl
pop de
exx
pop bc
exx
pop bc
push af
l0_ultoa_callee:
exx
push bc
exx
ex (sp),ix
call asm_ultoa
pop ix
ret
| 10.333333 | 61 | 0.636364 |
95a6853a16d57c37ab81ea69373438728bb66c4e | 6,887 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1838.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1838.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1838.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x4e60, %rbx
nop
nop
cmp %rax, %rax
mov (%rbx), %r13
nop
nop
nop
nop
add $55058, %r9
lea addresses_A_ht+0x10ce0, %rax
nop
nop
nop
nop
nop
xor %r8, %r8
mov (%rax), %r13
nop
add %r9, %r9
lea addresses_WC_ht+0x26e0, %rsi
lea addresses_D_ht+0xb180, %rdi
nop
sub $28866, %r13
mov $112, %rcx
rep movsb
nop
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x16fe0, %rsi
lea addresses_WT_ht+0x44c6, %rdi
nop
nop
nop
nop
add %r13, %r13
mov $118, %rcx
rep movsw
cmp $30439, %r8
lea addresses_UC_ht+0x7278, %rcx
nop
nop
nop
nop
add $47609, %r9
movups (%rcx), %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
nop
sub $26696, %rax
lea addresses_D_ht+0x3660, %rsi
lea addresses_D_ht+0x15660, %rdi
nop
inc %r13
mov $47, %rcx
rep movsl
nop
cmp %r8, %r8
lea addresses_WT_ht+0x13e60, %r13
nop
xor %rcx, %rcx
mov $0x6162636465666768, %r9
movq %r9, %xmm7
movups %xmm7, (%r13)
nop
nop
nop
sub %rdi, %rdi
lea addresses_A_ht+0xcc60, %rcx
nop
nop
nop
nop
cmp %r13, %r13
and $0xffffffffffffffc0, %rcx
movaps (%rcx), %xmm7
vpextrq $1, %xmm7, %r8
nop
nop
nop
nop
xor %r8, %r8
lea addresses_WC_ht+0xfe60, %r13
nop
nop
nop
nop
sub $20342, %rcx
movw $0x6162, (%r13)
nop
dec %r8
lea addresses_normal_ht+0x101e0, %r8
nop
cmp $38253, %rdi
movl $0x61626364, (%r8)
cmp %rax, %rax
lea addresses_D_ht+0x12760, %r13
nop
nop
nop
nop
xor $49281, %rbx
mov $0x6162636465666768, %rax
movq %rax, (%r13)
xor $6053, %r13
lea addresses_WT_ht+0x4a60, %rcx
clflush (%rcx)
nop
add $25709, %r9
movb (%rcx), %r13b
nop
add %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %rax
push %rbp
push %rbx
// Faulty Load
lea addresses_UC+0x1e660, %rbx
dec %rbp
mov (%rbx), %r14d
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 7}}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 3}}
{'dst': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 6}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 8}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 11}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 7}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 9}}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 37.429348 | 2,999 | 0.655728 |
a9d1b16a894251ef0e000d9e699ba6e012848820 | 74 | asm | Assembly | gfx/pokemon/dewgong/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | gfx/pokemon/dewgong/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | gfx/pokemon/dewgong/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | frame 1, 09
frame 2, 09
frame 3, 09
frame 4, 09
frame 5, 14
endanim
| 10.571429 | 12 | 0.635135 |
0b3893627812c9bc33fb777da35715c2eb67acdd | 2,521 | asm | Assembly | dspx/vbe/tools/vbefix.asm | lpproj/dspxvbe | 5ca073927c231487e56ee2c27c281f029c6fe5c2 | [
"MIT"
] | null | null | null | dspx/vbe/tools/vbefix.asm | lpproj/dspxvbe | 5ca073927c231487e56ee2c27c281f029c6fe5c2 | [
"MIT"
] | null | null | null | dspx/vbe/tools/vbefix.asm | lpproj/dspxvbe | 5ca073927c231487e56ee2c27c281f029c6fe5c2 | [
"MIT"
] | null | null | null | COMMENT #
===============================================================================
vbefix.asm
===============================================================================
#
MAJOR EQU 0
MINOR EQU 00h
CR EQU 13
LF EQU 10
eos EQU '$'
jmps MACRO p1
jmp short p1
ENDM
pushm MACRO p1
IRP p2,<p1>
push p2
ENDM
ENDM
popm MACRO p1
IRP p2,<p1>
pop p2
ENDM
ENDM
_TEXT SEGMENT BYTE
_TEXT ENDS
IFDEF ??version
NOWARN RES
ENDIF
STACK SEGMENT PARA STACK 'STACK'
STACK ENDS
IFDEF ??version
WARN RES
ENDIF
STACK SEGMENT
dw 128 dup (?)
STACK ENDS
ASSUME cs:_TEXT, ds:_TEXT
_TEXT SEGMENT
ORG 0
dd -1
dw 8000h
dw Strategy
pCommands dw Init_Commands
sName db '$VBEFIX$'
db 'LPPROJ$$'
cName = ($ - sName)
MySeg dw 0
Org10 dd ?
reqhdr dd ?
New10 PROC FAR
cmp ax,4f01h
je new10_v
new10_org:
jmp cs:[Org10]
;
new10_v:
push bp
push ax ;[bp+10]
push cx ;[bp+8]
push ds ;[bp+6]
push si ;[bp+4]
push es ;[bp+2]
push di ;[bp]
cld
mov bp,sp
mov ax,cs
mov ds,ax
mov es,ax
mov di,offset VbeInfo
mov word ptr [di],0
mov ax,4f00h
pushf
call [Org10]
cld
mov cx,word ptr ss:[bp+8]
mov ax,cs
mov es,ax
mov di,offset VbeInfo
mov si,di
mov ax,4f01h
pushf
call [Org10]
mov word ptr ss:[bp+10],ax
cld
mov si,offset VbeInfo
les di,dword ptr ss:[bp]
mov cx,128
rep movsw
pop di
pop es
pop si
pop ds
pop cx
pop ax
pop bp
iret
New10 ENDP
Strategy PROC FAR
mov word ptr cs:[reqhdr],bx
mov word ptr cs:[reqhdr+2],es
ret
Strategy ENDP
Commands PROC FAR
pushm <bx,ds>
lds bx,cs:[reqhdr]
mov word ptr [bx+3],8103h
popm <ds,bx>
ret
Commands ENDP
ExeEntry PROC FAR
mov ax,4c00h
int 21h
ExeEntry ENDP
VbeInfo db 256 dup (?)
Dev_Bottom LABEL NEAR
;------------------------------------------------------------------------------
pmsg PROC NEAR
push ax
mov ah,9
int 21h
pop ax
ret
pmsg ENDP
Init_Commands PROC FAR
pushf
pushm <ax,bx,dx,ds,es>
mov ax,cs
mov ds,ax
mov ax,3510h
int 21h
mov word ptr [Org10],bx
mov word ptr [Org10+2],es
mov dx,offset New10
mov ax,2510h
int 21h
lds bx,[reqhdr]
mov byte ptr [bx+13],1
mov word ptr [bx+14],offset Dev_Bottom
mov word ptr [bx+16],cs
mov word ptr [bx+3],0100h
mov cs:[pCommands],offset Commands
popm <es,ds,dx,bx,ax>
popf
ret
Init_Commands ENDP
_TEXT ENDS
END ExeEntry
| 13.928177 | 80 | 0.558905 |
5044fb28ac1b85b1f16f22b3d84ce53794396667 | 437 | asm | Assembly | libsrc/graphics/px4/swapgfxbk.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/px4/swapgfxbk.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/px4/swapgfxbk.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | ;
; Z88 Graphics Functions - Small C+ stubs
;
; Written around the Interlogic Standard Library
;
; Stubs Written by D Morris - 15/10/98
;
;
; Page the graphics bank in/out - used by all gfx functions
; Simply does a swap...
;
;
; $Id: swapgfxbk.asm,v 1.2 2015/11/05 16:08:04 stefano Exp $
;
PUBLIC swapgfxbk
PUBLIC swapgfxbk1
.swapgfxbk
ret
.swapgfxbk1
ret
| 13.65625 | 65 | 0.585812 |
505d345c8d02e69db9109308ecd3eaa403681fc0 | 743 | asm | Assembly | oeis/068/A068764.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/068/A068764.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/068/A068764.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A068764: Generalized Catalan numbers.
; Submitted by Christian Krause
; 1,1,4,18,88,456,2464,13736,78432,456416,2697088,16141120,97632000,595912960,3665728512,22703097472,141448381952,885934151168,5575020435456,35230798994432,223485795258368,1422572226146304,9083682419818496,58169612565614592,373486362257899520,2403850703479816192,15506524516902436864,100236180603119763456,649193194247263485952,4212167775936740196352,27375881277731731144704,178202878367163083554816,1161724661874832775184384,7583944066247061083127808,49574157037550147995172864
mul $0,2
mov $1,3
mov $2,1
mov $3,$0
mov $4,2
mov $5,-2
lpb $3
mul $1,2
sub $4,1
mul $1,$4
mul $1,2
mul $2,4
sub $3,2
sub $5,2
div $1,$5
add $2,$1
add $1,$2
lpe
mov $0,$2
| 30.958333 | 478 | 0.79677 |
0212d72d16c1fdc69b2e643b42240513d14e5f96 | 597 | asm | Assembly | oeis/158/A158129.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/158/A158129.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/158/A158129.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A158129: 100n^2 - 2n.
; 98,396,894,1592,2490,3588,4886,6384,8082,9980,12078,14376,16874,19572,22470,25568,28866,32364,36062,39960,44058,48356,52854,57552,62450,67548,72846,78344,84042,89940,96038,102336,108834,115532,122430,129528,136826,144324,152022,159920,168018,176316,184814,193512,202410,211508,220806,230304,240002,249900,259998,270296,280794,291492,302390,313488,324786,336284,347982,359880,371978,384276,396774,409472,422370,435468,448766,462264,475962,489860,503958,518256,532754,547452,562350,577448,592746
mov $1,5
mov $2,$0
add $2,1
mul $2,2
mul $1,$2
pow $1,2
sub $1,$2
mov $0,$1
| 49.75 | 495 | 0.788945 |
c3cacaef2f41d20d38dc9cff4083d3b6eea3b55b | 204 | asm | Assembly | libsrc/_DEVELOPMENT/z80/c/sdcc/z80_delay_tstate_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/z80/c/sdcc/z80_delay_tstate_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/z80/c/sdcc/z80_delay_tstate_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void z80_delay_tstate_fastcall(uint tstates)
SECTION code_clib
SECTION code_z80
PUBLIC _z80_delay_tstate_fastcall
EXTERN asm_z80_delay_tstate
defc _z80_delay_tstate_fastcall = asm_z80_delay_tstate
| 17 | 54 | 0.877451 |
7fb42a201405cc664b890fa71ad07dcbfe71f55f | 6,681 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_21829_182.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_182.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_182.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 %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x18959, %rcx
nop
nop
nop
nop
nop
dec %r13
movups (%rcx), %xmm2
vpextrq $0, %xmm2, %r15
nop
nop
nop
add %r11, %r11
lea addresses_WC_ht+0xe79, %rsi
lea addresses_UC_ht+0xc0d9, %rdi
nop
nop
nop
cmp $17692, %rbp
mov $83, %rcx
rep movsw
nop
nop
nop
nop
cmp $49176, %rcx
lea addresses_WT_ht+0x18f59, %rbp
nop
nop
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %r13
movq %r13, %xmm0
movups %xmm0, (%rbp)
nop
nop
nop
nop
sub %r15, %r15
lea addresses_D_ht+0x8759, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub %r11, %r11
movb $0x61, (%rdi)
and %r13, %r13
lea addresses_WT_ht+0x3b69, %r13
xor $24217, %rbp
mov (%r13), %r15d
nop
nop
nop
cmp %r15, %r15
lea addresses_D_ht+0x17359, %rcx
nop
sub $50261, %r13
movb $0x61, (%rcx)
nop
nop
nop
nop
nop
dec %rdi
lea addresses_D_ht+0x7c59, %rcx
nop
nop
and $22860, %rsi
movw $0x6162, (%rcx)
nop
nop
nop
add %rdi, %rdi
lea addresses_normal_ht+0x7fd9, %r15
nop
nop
nop
xor $57237, %r13
movups (%r15), %xmm2
vpextrq $1, %xmm2, %rdi
nop
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_UC_ht+0xc899, %rsi
lea addresses_D_ht+0x19169, %rdi
clflush (%rsi)
nop
and %rax, %rax
mov $104, %rcx
rep movsq
nop
nop
sub $48273, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rax
push %rdx
// Store
lea addresses_WC+0x1f59, %rax
nop
sub $24369, %rdx
movb $0x51, (%rax)
nop
nop
sub %r11, %r11
// Store
lea addresses_normal+0x1bb99, %r10
nop
nop
cmp %r14, %r14
movw $0x5152, (%r10)
nop
inc %rax
// Faulty Load
lea addresses_WC+0x1f59, %r10
nop
nop
nop
nop
nop
cmp %rax, %rax
movups (%r10), %xmm2
vpextrq $0, %xmm2, %r8
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rdx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 6}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}, 'dst': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': True, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 4}}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
| 34.796875 | 2,999 | 0.654992 |
898383e30f0c9d16b052ad22aad49d471cc5fd53 | 255 | asm | Assembly | src/src/c/borlandc/dpmi32/bdosptr.asm | amindlost/wdosx | 1e256d22c1547e7b1f1ccd23e400f5b81b8bd013 | [
"Unlicense"
] | 7 | 2022-01-20T08:27:54.000Z | 2022-03-17T10:15:31.000Z | src/src/c/borlandc/dpmi32/bdosptr.asm | amindlost/wdosx | 1e256d22c1547e7b1f1ccd23e400f5b81b8bd013 | [
"Unlicense"
] | null | null | null | src/src/c/borlandc/dpmi32/bdosptr.asm | amindlost/wdosx | 1e256d22c1547e7b1f1ccd23e400f5b81b8bd013 | [
"Unlicense"
] | null | null | null | .386
.model flat,C
EXTRN __IOerror:NEAR
PUBLIC bdosptr
.code
bdosptr proc near
sub eax,eax
mov ah,[esp+4]
mov edx,[esp+8]
mov al,[esp+12]
clc
int 21h
jc short BdosErr
ret
BdosErr:
push eax
call __IOerror
pop eax
ret
bdosptr endp
end
| 8.5 | 21 | 0.694118 |
7263064f685e98a6a90d9511986f5032aef78890 | 1,160 | asm | Assembly | programs/oeis/164/A164096.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/164/A164096.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/164/A164096.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A164096: Partial sums of A164095.
; 5,11,21,33,53,77,117,165,245,341,501,693,1013,1397,2037,2805,4085,5621,8181,11253,16373,22517,32757,45045,65525,90101,131061,180213,262133,360437,524277,720885,1048565,1441781,2097141,2883573,4194293,5767157,8388597,11534325,16777205,23068661,33554421,46137333,67108853,92274677,134217717,184549365,268435445,369098741,536870901,738197493,1073741813,1476394997,2147483637,2952790005,4294967285,5905580021,8589934581,11811160053,17179869173,23622320117,34359738357,47244640245,68719476725,94489280501,137438953461,188978561013,274877906933,377957122037,549755813877,755914244085,1099511627765,1511828488181,2199023255541,3023656976373,4398046511093,6047313952757,8796093022197,12094627905525,17592186044405,24189255811061,35184372088821,48378511622133,70368744177653,96757023244277,140737488355317,193514046488565,281474976710645,387028092977141,562949953421301,774056185954293,1125899906842613,1548112371908597,2251799813685237,3096224743817205,4503599627370485,6192449487634421,9007199254740981,12384898975268853
lpb $0
mov $2,$0
sub $0,1
add $1,2
gcd $2,2
mul $1,$2
add $1,1
lpe
mul $1,2
add $1,5
mov $0,$1
| 77.333333 | 1,015 | 0.856034 |
056ff596103d50684161dc1e4fd99c5bc8fbd69a | 410 | asm | Assembly | oeis/242/A242124.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/242/A242124.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/242/A242124.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A242124: Primes modulo 26.
; Submitted by Jon Maiga
; 2,3,5,7,11,13,17,19,23,3,5,11,15,17,21,1,7,9,15,19,21,1,5,11,19,23,25,3,5,9,23,1,7,9,19,21,1,7,11,17,23,25,9,11,15,17,3,15,19,21,25,5,7,17,23,3,9,11,17,21,23,7,21,25,1,5,19,25,9,11,15,21,3,9,15,19,25,7,11,19,3,5,15,17,23,1,7,15,19,21,25,11,19,23,5,9,15,1,3,21
mul $0,2
max $0,1
seq $0,173919 ; Numbers that are prime or one less than a prime.
mod $0,26
| 45.555556 | 261 | 0.643902 |
e450f8b03df412794abef42eb5a04a73e5c6da2e | 739 | asm | Assembly | pcl/edsger_lib/stdio/writer.asm | johnp41/Compiler-Uni | 4f653180d4f3f98316b15e566e57443041ef6faa | [
"MIT"
] | null | null | null | pcl/edsger_lib/stdio/writer.asm | johnp41/Compiler-Uni | 4f653180d4f3f98316b15e566e57443041ef6faa | [
"MIT"
] | null | null | null | pcl/edsger_lib/stdio/writer.asm | johnp41/Compiler-Uni | 4f653180d4f3f98316b15e566e57443041ef6faa | [
"MIT"
] | null | null | null | ; void writeReal (double d);
; --------------------------
; This function prints a real number to the standard output.
section .code
global _writeReal
extern _formatReal
extern _writeString
_writeReal:
push rbp
mov rbp, rsp
push rdi
push rsi
movupd xmm0, [rbp+16]
mov r8, 0x00050000
lea rdi, [buffer]
call _formatReal
lea rdi, [buffer]
call _writeString
pop rsi
pop rdi
pop rbp
ret
section .bss
buffer resb 32
| 22.393939 | 61 | 0.403248 |
7bbc47f1ab412a1538bac6f985ef47b50db193c4 | 1,515 | asm | Assembly | programs/oeis/054/A054622.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/054/A054622.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/054/A054622.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A054622: Number of ways to color vertices of an octagon using <= n colors, allowing only rotations.
; 0,1,36,834,8230,48915,210126,720916,2097684,5381685,12501280,26796726,53750346,101969959,184478490,320367720,536879176,871980201,1377508284,2122961770,3200020110,4727881851,6859513606,9788908284,13759455900,19073535325,26103440376,35303758686,47225326834,62530890255,82012601490,106611495376,137439084816,175801225809,223224405460,281484611730,352638948726,439060166371,543474278334,669001447140,819200320420,998116007301,1210331888976,1461025462534,1756028422170,2101891186935,2505952089226,2976411443256,3522410717784,4154117042425,4882813281900,5720993917626,6682466981086,7782462288459,9037746231030,10466743380940,12089665176876,13928645959341,16007886630184,18353806216110,20995201620930,23963415856351,27292515046146,31019474503584,35184374187040,39830603843745,45005078156676,50758462214626,57145407630534,64224799638195,72060015502510,80719194583476,90275520399156,100807515037909,112399346275200,125141147755350,139129352603626,154467040839111,171264300963834,189638606108680,209715205121640,231627528989001,255517612985116,281536534951434,309844870110510,340613162825755,374022415722726,410264596592796,449543163505084,492073608557565,538084020703320,587815668092926,641523600379026,699477271434159,761961182937970,829275549294960,901736984348976,979679210365681,1063453789759284,1153430880044850
mov $1,$0
pow $0,2
mul $1,2
add $1,4
add $1,$0
pow $0,2
add $0,1
bin $0,2
add $0,$1
sub $0,4
div $0,4
| 101 | 1,309 | 0.885149 |
5d34e10eb164b342bc763f63106174fcf52419c5 | 241 | asm | Assembly | src/howard16.asm | JoshRodd/HOWARD | 838b511abafbaf085a68d51a9d5c6b6759e6c92a | [
"MIT"
] | null | null | null | src/howard16.asm | JoshRodd/HOWARD | 838b511abafbaf085a68d51a9d5c6b6759e6c92a | [
"MIT"
] | null | null | null | src/howard16.asm | JoshRodd/HOWARD | 838b511abafbaf085a68d51a9d5c6b6759e6c92a | [
"MIT"
] | null | null | null | _TEXT segment para public 'CODE'
org 0
assume cs:_TEXT
assume es:nothing, ss:nothing, ds:nothing
howard16:
include howard16.inc
_TEXT ends
end howard16
| 18.538462 | 57 | 0.506224 |
a888ce0db4619776b83e0203909c70fec054e949 | 4,925 | asm | Assembly | libsrc/games/bit_fx4_mwr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/games/bit_fx4_mwr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/games/bit_fx4_mwr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z | ; $Id: bit_fx4_mwr.asm,v 1.4 2016-04-23 21:06:32 dom Exp $
;
; 1 bit sound library - version for "memory write" I/O architectures
; sound effects module.
;
; Library #4 by Stefano Bodrato
;
SECTION code_clib
PUBLIC bit_fx4
PUBLIC _bit_fx4
INCLUDE "games/games.inc"
EXTERN beeper
EXTERN bit_open
EXTERN bit_open_di
EXTERN bit_close
EXTERN bit_close_ei
EXTERN bit_click
;Sound routine..enter in with e holding the desired effect!
.bit_fx4
._bit_fx4
pop bc
pop de
push de
push bc
ld a,e
cp 8
ret nc
add a,a
ld e,a
ld d,0
ld hl,table
add hl,de
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
jp (hl)
.table defw fx1 ; effect #0
defw fx2
defw fx3
defw fx4
defw fx5
defw fx6
defw fx7
defw fx8
; Strange squeak
.fx1 ld b,1
.fx1_1 push bc
ld hl,600
ld de,2
.fx1_2 push hl
push de
call beeper
pop de
pop hl
push hl
push de
ld bc,400
sbc hl,bc
ld l,c
ld h,b
call beeper
pop de
pop hl
ld bc,40
and a
sbc hl,bc
jr nc,fx1_2
pop bc
djnz fx1_1
ret
; Sort of "audio tape rewind" effect
.fx2
ld hl,1024
.fx2_1
ld de,1
push hl
push de
ld a,55
xor l
ld l,a
call beeper
pop de
pop hl
dec hl
ld a,h
or l
jr nz,fx2_1
ret
; FX3 effect
.fx3
ld hl,30
ld de,1
.fx3_1
push hl
push de
call beeper
ld hl,600
ld de,1
call beeper
pop de
pop hl
dec hl
inc de
ld a,h
or l
jr nz,fx3_1
ret
; FX4 effect
.fx4
ld hl,1124
ld de,1
.fx4_1
push hl
push de
call beeper
pop de
pop hl
push hl
push de
ld bc,900
sbc hl,bc
call beeper
pop de
pop hl
inc hl
ld a,l
and a
jr nz,fx4_1
ret
; Strange descending squeak
; FX5 effect
.fx5
ld hl,200
ld de,1
.fx5_1
push hl
push de
call beeper
pop de
pop hl
push hl
push de
ld bc,180
sbc hl,bc
call beeper
pop de
pop hl
push hl
push de
call beeper
pop de
pop hl
inc hl
inc de
ld a,l
and a
jr nz,fx5_1
ret
; FX6 effect
.fx6
ld hl,300
ld de,1
.fx6_1
push hl
push de
call beeper
pop de
pop hl
push hl
push de
ld bc,200
sbc hl,bc
call beeper
pop de
pop hl
inc hl
inc de
ld a,l
and 50
jr nz,fx6_1
ret
; FX7 effect
.fx7
ld hl,1000
ld de,1
.fx7_1
push hl
push de
call beeper
pop de
pop hl
push hl
push de
ld bc,200
sbc hl,bc
call beeper
pop de
pop hl
dec hl
ld a,l
and 50
jr nz,fx7_1
ret
; FX8 effect
.fx8 ld b,1
.fx8_1 push bc
ld hl,2600
ld de,2
.fx8_2 push hl
push de
call beeper
inc hl
pop de
pop hl
push hl
push de
ld bc,400
sbc hl,bc
ld l,c
ld h,b
call beeper
pop de
pop hl
ld bc,40
and a
sbc hl,bc
jr nc,fx8_2
pop bc
djnz fx8_1
ret
ld hl,100
ld de,1
ret
| 18.040293 | 68 | 0.344975 |
eb3b992fbc09aa3a0f5c43d6ecbe267481b1ac71 | 2,637 | asm | Assembly | mcu_tests.asm | jwestfall69/ddragon-diag | 847c8cb4a447196eec895e7d608e412602c6fbc2 | [
"Unlicense"
] | null | null | null | mcu_tests.asm | jwestfall69/ddragon-diag | 847c8cb4a447196eec895e7d608e412602c6fbc2 | [
"Unlicense"
] | null | null | null | mcu_tests.asm | jwestfall69/ddragon-diag | 847c8cb4a447196eec895e7d608e412602c6fbc2 | [
"Unlicense"
] | null | null | null | include "ddragon.inc"
include "ddragon_diag.inc"
include "error_codes.inc"
include "macros.inc"
global manual_mcu_tests
global STR_MCU_TESTS
section text
manual_mcu_tests:
jsr fg_clear_with_header
FG_XY 12,4
ldy #STR_MCU_TESTS
JRU fg_print_string
FG_XY 5,25
ldy #STR_A_RE_RUN
JRU fg_print_string
FG_XY 5,26
ldy #STR_C_MAIN_MENU
JRU fg_print_string
FG_XY 4,8
ldy #STR_IRQ_TEST
JRU fg_print_string
FG_XY 4,9
ldy #STR_CHECKSUM
JRU fg_print_string
JRU mcu_reset
JRU mcu_run
ldy #STR_PASS
jsr mcu_irq_test
tsta
beq .print_irq_test
ldy #STR_FAIL
.print_irq_test:
FG_XY 15,8
JRU fg_print_string
ldy #STR_PASS
jsr mcu_checksum_test
tsta
beq .print_checksum_test
cmpa #1
beq .checksum_bad
FG_XY 20,9
ldy #STR_CHECKSUM_NO_BA
JRU fg_print_string
jmp .checksum_test_failed
.checksum_bad:
FG_XY 20,9
tfr b,a
JRU fg_print_hex_byte
.checksum_test_failed:
ldy #STR_FAIL
.print_checksum_test:
FG_XY 15,9
JRU fg_print_string
.loop_input:
jsr input_update
lda g_p1_input_edge
bita #A_BUTTON
beq .a_not_pressed
jmp manual_mcu_tests
.a_not_pressed:
lda g_extra_input_edge
bita #P1_C_BUTTON
beq .loop_input
rts
; by sending the mcu an nmi it should send us
; and irq
; return
; a = (0 = pass, 1 = fail)
mcu_irq_test:
ldd #0
std g_irq_count
lda #$0
sta REG_MCU
ldb #$ff ; don't wait forever
.wait_irq:
lda g_irq_count+1 ; we only care about the lower byte changing
bne .test_passed
ldw #$ff
JRU delay
decb
bne .wait_irq
lda #1
rts
.test_passed:
clra
rts
; When the mcu boots it will create a checksum
; by summing up all the bytes in its internal eprom
; and store the results at $2000 of the shared ram.
; The value should be #$84
; returns
; a = (0 = pass, 1 = bad checksum, 2 = bus available fail)
; b = read checksum
mcu_checksum_test:
JRU mcu_halt
; we need to wait for the bus to be available
; before reading from shared ram, but don't
; wait too long
ldb #$ff
.wait_bus_available:
lda REG_EXTRA_INPUT
anda #$10
beq .bus_available
ldw #$ff
JRU delay
decb
bne .wait_bus_available
; bus never became available
lda #2
jmp .cleanup
.bus_available:
ldb MCU_CHECKSUM_LOCATION
clr MCU_CHECKSUM_LOCATION
cmpb #MCU_CHECKSUM
beq .test_passed
lda #1
jmp .cleanup
.test_passed:
clra
.cleanup:
pshs a,b
JRU mcu_run
puls b,a
rts
STR_MCU_TESTS: string "MCU TESTS"
STR_A_RE_RUN: string "A - RE-RUN TESTS"
STR_IRQ_TEST: string "NMI/IRQ"
STR_CHECKSUM: string "CHECKSUM"
STR_CHECKSUM_NO_BA: string "NO BA"
| 15.421053 | 65 | 0.712931 |
2aec5aa0a28f9d90d270436810be2c21399fce42 | 12,018 | asm | Assembly | 3/3-1a.asm | winderica/GoodbyeASM | 6836c0e954f6295e92b9f4619195238bb6ad2f7d | [
"MIT"
] | null | null | null | 3/3-1a.asm | winderica/GoodbyeASM | 6836c0e954f6295e92b9f4619195238bb6ad2f7d | [
"MIT"
] | null | null | null | 3/3-1a.asm | winderica/GoodbyeASM | 6836c0e954f6295e92b9f4619195238bb6ad2f7d | [
"MIT"
] | null | null | null | extern print_number:far, calc_all:far, calc_rank:far, print_all:far, calc_suggestion_level:far
print_newline macro
push ax
push dx
mov ah, 02h
mov dl, 13
int 21h
mov ah, 02h
mov dl, 10
int 21h
pop dx
pop ax
endm
print macro string
push ax
push dx
mov dx, offset string
mov ah, 09h
int 21h
pop dx
pop ax
endm
print_address macro address
push ax
push dx
mov dx, address
mov ah, 09h
int 21h
pop dx
pop ax
endm
print_char macro char
push ax
push dx
mov ah, 02h
mov dl, char
int 21h
pop dx
pop ax
endm
input macro string
push ax
push dx
mov dx, offset string
mov ah, 0Ah
int 21h
print_newline
pop dx
pop ax
endm
.386
stack segment use16 stack
db 500 dup(0)
stack ends
data segment use16
item_number equ 30
username_hint db 'Input your username:', 13, 10, '$'
password_hint db 'Input your password:', 13, 10, '$'
succeeded_hint db 'Login succeeded', 13, 10, '$'
failed_hint db 'Login failed, please input again', 13, 10, '$'
not_found_hint db 'Item not found, please input again', 13, 10, '$'
item_hint db 'Input item name:', 13, 10, '$'
level_hint db 'Suggestion level is:', 13, 10, '$'
; calc_fail_hint db 'Error: Divide by zero!', 13, 10, '$'
func1_hint db '1. Query Item', 13, 10, '$'
func2_hint db '2. Modify Item', 13, 10, '$'
func3_hint db '3. Calculate Suggestion Rate', 13, 10, '$'
func4_hint db '4. Calculate Suggestion Rank', 13, 10, '$'
func5_hint db '5. Print All Goods', 13, 10, '$'
func6_hint db '6. Exit', 13, 10, '$'
select_hint db 'Please input your selection:', 13, 10, '$'
select_error_hint db 'Error: invalid selection!', 13, 10, '$'
calced_all_hint db 'Calced suggestion level of all items successfully!', 13, 10, '$'
ranked_all_hint db 'Ranked suggestion level of all items successfully!', 13, 10, '$'
invalid_value_hint db 'Invalid value! Input again.', 13, 10, '$'
info_header_1 db 'name', 9, 'discnt', 9, 'price', 9, 'inNum', 9, 'outNum', 9, 'suggestion', 13, 10, '$'
; info_header_2 db 'name', 9, 'discnt', 9, 'inPrice', 9, 'price', 9, 'inNum', 9, 'outNum', 9, 'suggestion', 9, 'rank', 13, 10, '$'
info_name db 'name: ', '$'
info_discount db 'discount: ', '$'
info_in_price db 'inPrice: ', '$'
info_price db 'price: ', '$'
info_in_num db 'inNum: ', '$'
info_out_num db 'outNum: ', '$'
boss_username db 'zcr', 0
boss_password db 'test', 0
input_username db 20
db 0
input_username_value db 20 dup(0)
input_password db 20
db 0
input_password_value db 20 dup(0)
input_item db 20
db 0
input_item_value db 20 dup(0)
input_selection db 2
db 0
input_selection_value db 2 dup(0)
input_discount db 3
db 0
input_discount_value db 3 dup(0)
input_in_price db 5
db 0
input_in_price_value db 5 dup(0)
input_price db 5
db 0
input_price_value db 5 dup(0)
input_in_num db 5
db 0
input_in_num_value db 5 dup(0)
input_out_num db 5
db 0
input_out_num_value db 5 dup(0)
shop_name db 'shop', 13, 10, '$'
items db item_number - 3 dup('temp', 0, '$', 4 dup(0), 8, 15, 0, 30, 0, 30, 0, 2, 0, ?, ?)
db 'pen', 0, '$', 5 dup(0), 10
dw 35, 56, 70, 25, ?
db 'book', 0, '$', 4 dup(0), 9
dw 12, 30, 25, 5, ?
db 'bag', 0, '$', 5 dup(0), 9
dw 40, 100, 45, 5, ?
to_sort dw item_number dup(0)
rank db item_number dup(0)
auth db 0
data ends
code segment use16
assume cs:code, ds:data, ss:stack
start:
mov ax, data
mov ds, ax
jmp login
login:
print shop_name
print username_hint
input input_username
mov bx, offset input_username + 2
cmp byte ptr[bx], 'q'
je exit
cmp byte ptr[bx], 13
je shop_main
print password_hint
input input_password
jmp verify_username
login_failed:
print failed_hint
jmp login
verify_username:
mov si, offset boss_username
mov bx, offset input_username_value
check_username:
mov al, [bx]
cmp byte ptr[si], al
jne login_failed
inc si
inc bx
cmp byte ptr[bx], 13
jne check_username
cmp byte ptr[si], 0
jne check_username
jmp verify_password
verify_password:
mov si, offset boss_password
mov bx, offset input_password_value
check_password:
mov al, [bx]
cmp byte ptr[si], al
jne login_failed
inc si
inc bx
cmp byte ptr[bx], 13
jne check_password
cmp byte ptr[si], 0
jne check_password
jmp login_succeed
login_succeed:
print succeeded_hint
mov auth, 1
jmp shop_main
shop_main:
call show_menu
jmp shop_main
show_menu proc
cmp auth, 1
je show_full_menu
jmp show_partial_menu
show_full_menu:
print func1_hint
print func2_hint
print func3_hint
print func4_hint
print func5_hint
print func6_hint
print select_hint
input input_selection
cmp input_selection_value, 31h
je call_func1
cmp input_selection_value, 32h
je call_func2
cmp input_selection_value, 33h
je call_func3
cmp input_selection_value, 34h
je call_func4
cmp input_selection_value, 35h
je call_func5
cmp input_selection_value, 36h
je call_func6
print select_error_hint
ret
show_partial_menu:
print func1_hint
print func6_hint
print select_hint
input input_selection
cmp input_selection_value, 31h
je call_func1
cmp input_selection_value, 36h
je call_func6
print select_error_hint
ret
call_func1:
call query_item
ret
call_func2:
call set_item
ret
call_func3:
mov dx, offset items
call calc_all
print calced_all_hint
ret
call_func4:
mov dx, offset items
mov di, offset to_sort
mov cx, offset rank
call calc_rank
print ranked_all_hint
ret
call_func5:
mov dx, offset items
mov di, offset to_sort
mov cx, offset rank
call print_all
ret
call_func6:
call exit
show_menu endp
find proc
print item_hint
input input_item
mov bx, offset input_item_value
cmp byte ptr[bx], 13
je return_enter
query:
mov si, offset items
mov bx, offset input_item_value
mov cx, 0
loop_item:
mov dx, si
check_item:
mov al, [bx]
cmp byte ptr[si], al
jne next_item
inc si
inc bx
cmp byte ptr[bx], 13
je return_found
jmp check_item
next_item:
add dx, 21
mov si, dx
mov bx, offset input_item_value
add cx, 1
cmp cx, item_number
je return_not_found
jmp loop_item
return_enter:
mov ax, 0
ret
return_found:
mov ax, 1
ret
return_not_found:
mov ax, 2
ret
find endp
query_item proc
pusha
call find
cmp ax, 0
je return
cmp ax, 1
je item_found
jmp item_not_found
item_not_found:
print not_found_hint
call query_item
jmp return
item_found:
call calc_suggestion_level
print info_header_1
mov si, dx
print_address si
print_char 9
movzx ax, byte ptr[si + 10]
call print_number
mov ax, [si + 13]
call print_number
mov ax, [si + 15]
call print_number
mov ax, [si + 17]
call print_number
mov ax, [si + 19]
call print_number
print_newline
jmp return
query_item endp
set_item proc
pusha
call find
cmp ax, 0
je return
cmp ax, 1
je set_item_found
jmp set_item_not_found
set_item_not_found:
print not_found_hint
call set_item
jmp return
set_item_found:
call calc_suggestion_level
print info_name
mov si, dx
print_address si
print_newline
add si, 10
set_discount:
print info_discount
movzx ax, byte ptr[si]
call print_number
input input_discount
mov ax, offset input_discount_value
mov bx, si
mov cl, 0 ; is byte ptr
mov ch, 0 ; can be zero
call set_value
cmp dx, 0
je set_discount
print_newline
add si, 1
set_in_price:
print info_in_price
mov ax, [si]
call print_number
input input_in_price
mov ax, offset input_in_price_value
mov bx, si
mov cl, 1 ; is byte ptr
mov ch, 0 ; can be zero
call set_value
cmp dx, 0
je set_in_price
print_newline
add si, 2
set_price:
print info_price
mov ax, [si]
call print_number
input input_price
mov ax, offset input_price_value
mov bx, si
mov cl, 1 ; is byte ptr
mov ch, 0 ; can be zero
call set_value
cmp dx, 0
je set_price
print_newline
add si, 2
set_in_num:
print info_in_num
mov ax, [si]
call print_number
input input_in_num
mov ax, offset input_in_num_value
mov bx, si
mov cl, 1 ; is byte ptr
mov ch, 0 ; can be zero
call set_value
cmp dx, 0
je set_in_num
print_newline
add si, 2
set_out_num:
print info_out_num
mov ax, [si]
call print_number
input input_out_num
mov ax, offset input_out_num_value
mov bx, si
mov cl, 1 ; is byte ptr
mov ch, 1 ; can be zero
call set_value
cmp dx, 0
je set_out_num
print_newline
jmp return
set_item endp
set_value proc
pusha
mov si, ax
mov dx, 0
cmp byte ptr[si], 13
je empty_value
loop_set_value:
cmp byte ptr[si], 13
je valid_value
cmp byte ptr[si], '0'
jl invalid_value
cmp byte ptr[si], '9'
jg invalid_value
imul dx, 10
add dl, byte ptr[si]
sub dx, '0'
inc si
jmp loop_set_value
invalid_value:
popa
print invalid_value_hint
mov dx, 0
ret
valid_value:
cmp dx, 0
jne set_valid_value
cmp ch, 1
jne invalid_value
set_valid_value:
cmp cl, 0
je set_byte_value
jmp set_word_value
set_byte_value:
mov byte ptr[bx], dl
jmp empty_value
set_word_value:
mov [bx], dx
empty_value:
popa
mov dx, 1
ret
set_value endp
exit proc
mov ah, 4ch
int 21h
exit endp
return:
popa
ret
code ends
end start
| 25.08977 | 145 | 0.536778 |
fb99449bd8f0cf0fedb3f86f25b6383e57680a0f | 4,068 | asm | Assembly | src/vbl/vbl_seq.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 90 | 2015-06-19T14:26:19.000Z | 2022-01-05T08:19:41.000Z | src/vbl/vbl_seq.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 2 | 2015-06-21T20:55:40.000Z | 2022-02-09T08:02:04.000Z | src/vbl/vbl_seq.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 10 | 2015-06-21T20:43:11.000Z | 2020-12-08T13:24:16.000Z | vbl_seq:
call RAMtoOAM
call refresh_seq
ld hl,FRAME
inc (hl)
call readinput
call input_seq
ld a,(HWOK_ADC)
or a
call nz,readpots
ld hl,OAMCOPY
ld bc,$40
call clear
call changescreen ;Always do this at end of VBL
ret
redrawnote_seq:
ld a,(NOTEIDX)
ld b,TXT_INVERT
redrawnote_seq_a:
push bc
push af
call getnotename
pop af
ld hl,$9800+(32*1)+1
ld bc,32
inc a
-:
add hl,bc
dec a
jr nz,-
pop bc
call maptext
ret
redrawaccent_seq:
ld a,(NOTEIDX)
ld b,TXT_INVERT
redrawaccent_seq_a:
push bc
push af
ld hl,$9800+(32*1)+5
ld bc,32
inc a
-:
add hl,bc
dec a
jr nz,-
pop af
push hl
call getnoteattrl
pop hl
bit 0,a
ld a,'.' ;Checkmark
jr nz,+
ld a,'-'
+:
pop bc
sub b
call wait_write
ld (hl),a
ret
redrawslide_seq:
ld a,(NOTEIDX)
ld b,TXT_INVERT
redrawslide_seq_a:
push bc
push af
ld hl,$9800+(32*1)+7
call getline
pop af
push hl
call getnoteattrl
pop hl
bit 1,a
ld a,'.' ;Checkmark
jr nz,+
ld a,'-'
+:
pop bc
sub b
call wait_write
ld (hl),a
ret
redrawosc_seq:
ld a,(NOTEIDX)
ld b,TXT_INVERT
redrawosc_seq_a:
push bc
push af
ld hl,$9800+(32*1)+9
call getline
pop af
push hl
call getnoteattrl
pop hl
bit 2,a
ld a,'&' ;Oscillator icons
jr nz,+
ld a,'$'
+:
pop bc
sub b
call wait_write
ld (hl),a
ret
redrawarp_seq:
ld a,(NOTEIDX)
ld b,TXT_INVERT
redrawarp_seq_a:
push bc
push af
ld hl,$9800+(32*1)+11
call getline
pop af
push hl
call getnoteattrh
pop hl
pop bc
call writeAhex
ret
redrawdrum_seq:
ld a,(NOTEIDX)
ld b,TXT_INVERT
redrawdrum_seq_a:
push bc
push af
ld hl,$9800+(32*1)+14
call getline
pop af
push hl
call getnoteattrl
srl a
srl a
srl a
and $1F
sla a
ld b,a
sla a
add b ;*6
ld hl,text_drums
ld d,0
ld e,a
add hl,de
ld d,h
ld e,l
pop hl
pop bc
call maptext
ret
refresh_seq:
ld hl,SEQ_CURX
ld a,(SEQ_PREVX)
cp (hl)
jr nz,+
ld hl,SEQ_PREVY ;VARIABLE MESS ! Bugged while playing
ld a,(NOTEIDX)
cp (hl)
ret z
+:
ld a,(SEQ_PREVX)
jr ++
+:
ld a,(SEQ_CURX)
++:
ld (SEQ_TOERASEX),a
ld a,(SEQ_CURX)
ld (SEQ_PREVX),a
ld a,(NOTEIDX)
ld a,(SEQ_PREVY)
ld b,a
ld a,(NOTEIDX)
ld (SEQ_PREVY),a
ld a,b
;Set previous as normal
ld hl,$9800+(32*1)
call getline
push hl
ld hl,lut_seqlayout
ld a,(SEQ_TOERASEX)
sla a
ld d,0
ld e,a
add hl,de
ldi a,(hl)
ld b,a
ldi a,(hl)
ld c,a
pop hl
ld a,l
add b
jr nc,+
inc h
+:
ld l,a
-:
di
call wait_write
ld a,(hl)
ei
and %10111111 ;Clear inverted
di
call wait_write
ldi (hl),a
ei
dec c
jr nz,-
;Set current as inverted
showcur_seq: ;Called just here by seq init
ld a,(NOTEIDX)
ld hl,$9800+(32*1)
call getline
push hl
ld hl,lut_seqlayout
ld a,(SEQ_CURX)
sla a
ld d,0
ld e,a
add hl,de
ldi a,(hl)
ld b,a
ldi a,(hl)
ld c,a
pop hl
ld a,l
add b
jr nc,+
inc h
+:
ld l,a
-:
di
call wait_write
ld a,(hl)
ei
or %01000000 ;Set inverted
di
call wait_write
ldi (hl),a
ei
dec c
jr nz,-
ret
| 15.526718 | 62 | 0.470501 |
48c53cefcfe1c5d2dcdfb721c7428f9aa27f57e9 | 489 | asm | Assembly | libsrc/alloc/farz88/lp_gchar.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/alloc/farz88/lp_gchar.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/alloc/farz88/lp_gchar.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; Internal routine to read char at far pointer
; 31/3/00 GWL
; Entry: EHL=far pointer
; Exit: A=byte
;
; $Id: lp_gchar.asm,v 1.4 2016-06-10 22:42:22 dom Exp $
;
SECTION code_clib
PUBLIC lp_gchar
EXTERN farseg1
.lp_gchar
ld a,($04d1)
ex af,af'
ld b,h
ld c,l
call farseg1
ld a,(hl)
ld l,a
ld h,0
ex af,af'
ld ($04d1),a
out ($d1),a
ex af,af'
ret
| 15.28125 | 55 | 0.474438 |
080018c2a426c1ab141467a0a64a5ede337cdd5a | 1,297 | asm | Assembly | programs/oeis/179/A179942 (2 cal).asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/179/A179942 (2 cal).asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/179/A179942 (2 cal).asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A179942: Number of times n appears in a 1000 x 1000 multiplication table.
; 1,2,2,3,2,4,2,4,3,4,2,6,2,4,4,5,2,6,2,6,4,4,2,8,3,4,4,6,2,8,2,6,4,4,4,9,2,4,4,8,2,8,2,6,6,4,2,10,3,6,4,6,2,8,4,8,4,4,2,12,2,4,6,7,4,8,2,6,4,8,2,12,2,4,6,6,4,8,2,10,5,4,2,12,4,4,4,8,2,12,4,6,4,4,4,12,2,6,6,9,2,8,2,8,8,4,2,12,2,8,4,10,2,8,4,6,6,4,4,16,3,4,4,6,4,12,2,8,4,8,2,12,4,4,8,8,2,8,2,12,4,4,4,15,4,4,6,6,2,12,2,8,6,8,4,12,2,4,4,12,4,10,2,6,8,4,2,16,3,8,6,6,2,8,6,10,4,4,2,18,2,8,4,8,4,8,4,6,8,8,2,14,2,4,8,9,2,12,2,12,4,4,4,12,4,4,6,10,4,16,2,6,4,4,4,16,4,4,4,12,4,8,2,12,9,4,2,12,2,8,8,8,2,12,4,6,4,8,2,20,2,6,6,6,6,8,4,8,4,8
mov $1,3
mov $1,$0
mov $2,$0
sub $2,1
mul $2,$0
mov $3,1
mov $3,$0
mov $4,$0
add $4,2
mov $4,$2
sub $2,1
mov $4,1
mov $5,$0
sub $5,$0
mov $9,0
mov $9,$5
cmp $9,0
add $5,$9
mov $8,$0
div $0,$5
sub $0,$1
mov $2,7
mov $4,$3
add $4,$1
trn $1,$0
div $1,7
mov $2,7
mov $5,0
mov $6,$3
bin $6,$4
mov $9,0
cal $1,179070 ; a(1)=a(2)=a(3)=1, a(4)=3; thereafter a(n) = a(n-1) + a(n-3).
mul $2,$6
mod $6,2
cal $3,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
sub $1,11
mov $2,$3
mov $5,1
mul $6,2
trn $2,$6
sub $3,2
add $2,$3
mov $4,9
mov $5,$1
mul $6,2
add $6,$0
mul $4,$6
add $4,6
add $4,$6
add $5,4
mul $5,2
mov $5,$1
mov $1,$3
add $1,2
mov $7,$8
mul $7,$8
mul $7,$8
| 21.262295 | 534 | 0.546646 |
17a87af5e7c7f87cdc5082fc6b05e6dff8657b3a | 496 | asm | Assembly | oeis/074/A074712.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/074/A074712.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/074/A074712.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A074712: Number of (interiors of) cells touched by a diagonal in a regular m X n grid (enumerated antidiagonally).
; Submitted by Christian Krause
; 1,2,2,3,2,3,4,4,4,4,5,4,3,4,5,6,6,6,6,6,6,7,6,7,4,7,6,7,8,8,6,8,8,6,8,8,9,8,9,8,5,8,9,8,9,10,10,10,10,10,10,10,10,10,10,11,10,9,8,11,6,11,8,9,10,11,12,12,12,12,12,12,12,12,12,12,12,12,13,12,13,12,13,12,7,12,13,12,13,12,13,14,14,12,14,10,12,14,14,12
lpb $0
add $2,1
sub $0,$2
lpe
add $0,1
add $2,2
lpb $0
gcd $0,$2
lpe
sub $2,$0
mov $0,$2
| 31 | 250 | 0.633065 |
8c2436b44efb658a32a85cb991c4023c6557948d | 17,694 | asm | Assembly | 3rdparty/ffmpeg/libavcodec/x86/hevc_sao.asm | jjzhang166/zzilla_opencvr | b8914d59908fbb449c1d0359ebcb4788ab1d7c8e | [
"MIT"
] | 2 | 2017-09-16T13:59:15.000Z | 2019-04-24T03:25:36.000Z | 3rdparty/ffmpeg/libavcodec/x86/hevc_sao.asm | jjzhang166/opencvr | b8914d59908fbb449c1d0359ebcb4788ab1d7c8e | [
"MIT"
] | null | null | null | 3rdparty/ffmpeg/libavcodec/x86/hevc_sao.asm | jjzhang166/opencvr | b8914d59908fbb449c1d0359ebcb4788ab1d7c8e | [
"MIT"
] | 1 | 2019-04-24T03:25:40.000Z | 2019-04-24T03:25:40.000Z | ;******************************************************************************
;* SIMD optimized SAO functions for HEVC decoding
;*
;* Copyright (c) 2013 Pierre-Edouard LEPERE
;* Copyright (c) 2014 James Almer
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA 32
pw_mask10: times 16 dw 0x03FF
pw_mask12: times 16 dw 0x0FFF
pw_m2: times 16 dw -2
pb_edge_shuffle: times 2 db 1, 2, 0, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
pb_eo: db -1, 0, 1, 0, 0, -1, 0, 1, -1, -1, 1, 1, 1, -1, -1, 1
cextern pw_m1
cextern pw_1
cextern pw_2
cextern pb_1
cextern pb_2
SECTION_TEXT
%define MAX_PB_SIZE 64
%define PADDING_SIZE 32 ; FF_INPUT_BUFFER_PADDING_SIZE
;******************************************************************************
;SAO Band Filter
;******************************************************************************
%macro HEVC_SAO_BAND_FILTER_INIT 1
and leftq, 31
movd xm0, leftd
add leftq, 1
and leftq, 31
movd xm1, leftd
add leftq, 1
and leftq, 31
movd xm2, leftd
add leftq, 1
and leftq, 31
movd xm3, leftd
SPLATW m0, xm0
SPLATW m1, xm1
SPLATW m2, xm2
SPLATW m3, xm3
%if mmsize > 16
SPLATW m4, [offsetq + 2]
SPLATW m5, [offsetq + 4]
SPLATW m6, [offsetq + 6]
SPLATW m7, [offsetq + 8]
%else
movq m7, [offsetq + 2]
SPLATW m4, m7, 0
SPLATW m5, m7, 1
SPLATW m6, m7, 2
SPLATW m7, m7, 3
%endif
%if ARCH_X86_64
%if %1 > 8
mova m13, [pw_mask %+ %1]
%endif
pxor m14, m14
%else ; ARCH_X86_32
mova [rsp+mmsize*0], m0
mova [rsp+mmsize*1], m1
mova [rsp+mmsize*2], m2
mova [rsp+mmsize*3], m3
mova [rsp+mmsize*4], m4
mova [rsp+mmsize*5], m5
mova [rsp+mmsize*6], m6
pxor m0, m0
%if %1 > 8
mova m1, [pw_mask %+ %1]
%endif
%assign MMSIZE mmsize
%define m14 m0
%define m13 m1
%define m9 m2
%define m8 m3
%endif ; ARCH
DEFINE_ARGS dst, src, dststride, srcstride, offset, height
mov heightd, r7m
%endmacro
%macro HEVC_SAO_BAND_FILTER_COMPUTE 3
psraw %2, %3, %1-5
%if ARCH_X86_64
pcmpeqw m10, %2, m0
pcmpeqw m11, %2, m1
pcmpeqw m12, %2, m2
pcmpeqw %2, m3
pand m10, m4
pand m11, m5
pand m12, m6
pand %2, m7
por m10, m11
por m12, %2
por m10, m12
paddw %3, m10
%else ; ARCH_X86_32
pcmpeqw m4, %2, [rsp+MMSIZE*0]
pcmpeqw m5, %2, [rsp+MMSIZE*1]
pcmpeqw m6, %2, [rsp+MMSIZE*2]
pcmpeqw %2, [rsp+MMSIZE*3]
pand m4, [rsp+MMSIZE*4]
pand m5, [rsp+MMSIZE*5]
pand m6, [rsp+MMSIZE*6]
pand %2, m7
por m4, m5
por m6, %2
por m4, m6
paddw %3, m4
%endif ; ARCH
%endmacro
;void ff_hevc_sao_band_filter_<width>_8_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
; int16_t *sao_offset_val, int sao_left_class, int width, int height);
%macro HEVC_SAO_BAND_FILTER_8 2
cglobal hevc_sao_band_filter_%1_8, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dststride, srcstride, offset, left
HEVC_SAO_BAND_FILTER_INIT 8
align 16
.loop
%if %1 == 8
movq m8, [srcq]
punpcklbw m8, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m8
packuswb m8, m14
movq [dstq], m8
%endif ; %1 == 8
%assign i 0
%rep %2
mova m13, [srcq + i]
punpcklbw m8, m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m8
punpckhbw m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m13
packuswb m8, m13
mova [dstq + i], m8
%assign i i+mmsize
%endrep
%if %1 == 48
INIT_XMM cpuname
mova m13, [srcq + i]
punpcklbw m8, m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m8
punpckhbw m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m13
packuswb m8, m13
mova [dstq + i], m8
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif ; %1 == 48
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
REP_RET
%endmacro
;void ff_hevc_sao_band_filter_<width>_<depth>_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
; int16_t *sao_offset_val, int sao_left_class, int width, int height);
%macro HEVC_SAO_BAND_FILTER_16 3
cglobal hevc_sao_band_filter_%2_%1, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dststride, srcstride, offset, left
HEVC_SAO_BAND_FILTER_INIT %1
align 16
.loop
%if %2 == 8
mova m8, [srcq]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
CLIPW m8, m14, m13
mova [dstq], m8
%endif
%assign i 0
%rep %3
mova m8, [srcq + i]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
CLIPW m8, m14, m13
mova [dstq + i], m8
mova m9, [srcq + i + mmsize]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m8, m9
CLIPW m9, m14, m13
mova [dstq + i + mmsize], m9
%assign i i+mmsize*2
%endrep
%if %2 == 48
INIT_XMM cpuname
mova m8, [srcq + i]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
CLIPW m8, m14, m13
mova [dstq + i], m8
mova m9, [srcq + i + mmsize]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m8, m9
CLIPW m9, m14, m13
mova [dstq + i + mmsize], m9
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif ; %1 == 48
add dstq, dststrideq
add srcq, srcstrideq
dec heightd
jg .loop
REP_RET
%endmacro
%macro HEVC_SAO_BAND_FILTER_FUNCS 0
HEVC_SAO_BAND_FILTER_8 8, 0
HEVC_SAO_BAND_FILTER_8 16, 1
HEVC_SAO_BAND_FILTER_8 32, 2
HEVC_SAO_BAND_FILTER_8 48, 2
HEVC_SAO_BAND_FILTER_8 64, 4
HEVC_SAO_BAND_FILTER_16 10, 8, 0
HEVC_SAO_BAND_FILTER_16 10, 16, 1
HEVC_SAO_BAND_FILTER_16 10, 32, 2
HEVC_SAO_BAND_FILTER_16 10, 48, 2
HEVC_SAO_BAND_FILTER_16 10, 64, 4
HEVC_SAO_BAND_FILTER_16 12, 8, 0
HEVC_SAO_BAND_FILTER_16 12, 16, 1
HEVC_SAO_BAND_FILTER_16 12, 32, 2
HEVC_SAO_BAND_FILTER_16 12, 48, 2
HEVC_SAO_BAND_FILTER_16 12, 64, 4
%endmacro
INIT_XMM sse2
HEVC_SAO_BAND_FILTER_FUNCS
INIT_XMM avx
HEVC_SAO_BAND_FILTER_FUNCS
%if HAVE_AVX2_EXTERNAL
INIT_XMM avx2
HEVC_SAO_BAND_FILTER_8 8, 0
HEVC_SAO_BAND_FILTER_8 16, 1
INIT_YMM avx2
HEVC_SAO_BAND_FILTER_8 32, 1
HEVC_SAO_BAND_FILTER_8 48, 1
HEVC_SAO_BAND_FILTER_8 64, 2
INIT_XMM avx2
HEVC_SAO_BAND_FILTER_16 10, 8, 0
HEVC_SAO_BAND_FILTER_16 10, 16, 1
INIT_YMM avx2
HEVC_SAO_BAND_FILTER_16 10, 32, 1
HEVC_SAO_BAND_FILTER_16 10, 48, 1
HEVC_SAO_BAND_FILTER_16 10, 64, 2
INIT_XMM avx2
HEVC_SAO_BAND_FILTER_16 12, 8, 0
HEVC_SAO_BAND_FILTER_16 12, 16, 1
INIT_YMM avx2
HEVC_SAO_BAND_FILTER_16 12, 32, 1
HEVC_SAO_BAND_FILTER_16 12, 48, 1
HEVC_SAO_BAND_FILTER_16 12, 64, 2
%endif
;******************************************************************************
;SAO Edge Filter
;******************************************************************************
%define EDGE_SRCSTRIDE 2 * MAX_PB_SIZE + PADDING_SIZE
%macro HEVC_SAO_EDGE_FILTER_INIT 1
%if WIN64
movsxd eoq, dword eom
%elif ARCH_X86_64
movsxd eoq, eod
%else
mov eoq, r4m
%endif
lea tmp2q, [pb_eo]
movsx a_strideq, byte [tmp2q+eoq*4+1]
movsx b_strideq, byte [tmp2q+eoq*4+3]
imul a_strideq, EDGE_SRCSTRIDE>>%1
imul b_strideq, EDGE_SRCSTRIDE>>%1
movsx tmpq, byte [tmp2q+eoq*4]
add a_strideq, tmpq
movsx tmpq, byte [tmp2q+eoq*4+2]
add b_strideq, tmpq
%endmacro
%macro HEVC_SAO_EDGE_FILTER_COMPUTE_8 1
pminub m4, m1, m2
pminub m5, m1, m3
pcmpeqb m2, m4
pcmpeqb m3, m5
pcmpeqb m4, m1
pcmpeqb m5, m1
psubb m4, m2
psubb m5, m3
paddb m4, m6
paddb m4, m5
pshufb m2, m0, m4
%if %1 > 8
punpckhbw m5, m7, m1
punpckhbw m4, m2, m7
punpcklbw m3, m7, m1
punpcklbw m2, m7
pmaddubsw m5, m4
pmaddubsw m3, m2
packuswb m3, m5
%else
punpcklbw m3, m7, m1
punpcklbw m2, m7
pmaddubsw m3, m2
packuswb m3, m3
%endif
%endmacro
;void ff_hevc_sao_edge_filter_<width>_8_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val,
; int eo, int width, int height);
%macro HEVC_SAO_EDGE_FILTER_8 2-3
%if ARCH_X86_64
cglobal hevc_sao_edge_filter_%1_8, 4, 9, 8, dst, src, dststride, offset, eo, a_stride, b_stride, height, tmp
%define tmp2q heightq
HEVC_SAO_EDGE_FILTER_INIT 0
mov heightd, r6m
%else ; ARCH_X86_32
cglobal hevc_sao_edge_filter_%1_8, 1, 6, 8, dst, src, dststride, a_stride, b_stride, height
%define eoq srcq
%define tmpq heightq
%define tmp2q dststrideq
%define offsetq heightq
HEVC_SAO_EDGE_FILTER_INIT 0
mov srcq, srcm
mov offsetq, r3m
mov dststrideq, dststridem
%endif ; ARCH
%if mmsize > 16
vbroadcasti128 m0, [offsetq]
%else
movu m0, [offsetq]
%endif
mova m1, [pb_edge_shuffle]
packsswb m0, m0
mova m7, [pb_1]
pshufb m0, m1
mova m6, [pb_2]
%if ARCH_X86_32
mov heightd, r6m
%endif
align 16
.loop:
%if %1 == 8
movq m1, [srcq]
movq m2, [srcq + a_strideq]
movq m3, [srcq + b_strideq]
HEVC_SAO_EDGE_FILTER_COMPUTE_8 %1
movq [dstq], m3
%endif
%assign i 0
%rep %2
mova m1, [srcq + i]
movu m2, [srcq + a_strideq + i]
movu m3, [srcq + b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_8 %1
mov%3 [dstq + i], m3
%assign i i+mmsize
%endrep
%if %1 == 48
INIT_XMM cpuname
mova m1, [srcq + i]
movu m2, [srcq + a_strideq + i]
movu m3, [srcq + b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_8 %1
mova [dstq + i], m3
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif
add dstq, dststrideq
add srcq, EDGE_SRCSTRIDE
dec heightd
jg .loop
RET
%endmacro
%macro PMINUW 4
%if cpuflag(sse4)
pminuw %1, %2, %3
%else
psubusw %4, %2, %3
psubw %1, %2, %4
%endif
%endmacro
%macro HEVC_SAO_EDGE_FILTER_COMPUTE_10 0
PMINUW m4, m1, m2, m6
PMINUW m5, m1, m3, m7
pcmpeqw m2, m4
pcmpeqw m3, m5
pcmpeqw m4, m1
pcmpeqw m5, m1
psubw m4, m2
psubw m5, m3
paddw m4, m5
pcmpeqw m2, m4, [pw_m2]
%if ARCH_X86_64
pcmpeqw m3, m4, m13
pcmpeqw m5, m4, m0
pcmpeqw m6, m4, m14
pcmpeqw m7, m4, m15
pand m2, m8
pand m3, m9
pand m5, m10
pand m6, m11
pand m7, m12
%else
pcmpeqw m3, m4, [pw_m1]
pcmpeqw m5, m4, m0
pcmpeqw m6, m4, [pw_1]
pcmpeqw m7, m4, [pw_2]
pand m2, [rsp+MMSIZE*0]
pand m3, [rsp+MMSIZE*1]
pand m5, [rsp+MMSIZE*2]
pand m6, [rsp+MMSIZE*3]
pand m7, [rsp+MMSIZE*4]
%endif
paddw m2, m3
paddw m5, m6
paddw m2, m7
paddw m2, m1
paddw m2, m5
%endmacro
;void ff_hevc_sao_edge_filter_<width>_<depth>_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val,
; int eo, int width, int height);
%macro HEVC_SAO_EDGE_FILTER_16 3
%if ARCH_X86_64
cglobal hevc_sao_edge_filter_%2_%1, 4, 9, 16, dst, src, dststride, offset, eo, a_stride, b_stride, height, tmp
%define tmp2q heightq
HEVC_SAO_EDGE_FILTER_INIT 1
mov heightd, r6m
add a_strideq, a_strideq
add b_strideq, b_strideq
%else ; ARCH_X86_32
cglobal hevc_sao_edge_filter_%2_%1, 1, 6, 8, 5*mmsize, dst, src, dststride, a_stride, b_stride, height
%assign MMSIZE mmsize
%define eoq srcq
%define tmpq heightq
%define tmp2q dststrideq
%define offsetq heightq
%define m8 m1
%define m9 m2
%define m10 m3
%define m11 m4
%define m12 m5
HEVC_SAO_EDGE_FILTER_INIT 1
mov srcq, srcm
mov offsetq, r3m
mov dststrideq, dststridem
add a_strideq, a_strideq
add b_strideq, b_strideq
%endif ; ARCH
%if cpuflag(avx2)
SPLATW m8, [offsetq+2]
SPLATW m9, [offsetq+4]
SPLATW m10, [offsetq+0]
SPLATW m11, [offsetq+6]
SPLATW m12, [offsetq+8]
%else
movq m10, [offsetq+0]
movd m12, [offsetq+6]
SPLATW m8, xm10, 1
SPLATW m9, xm10, 2
SPLATW m10, xm10, 0
SPLATW m11, xm12, 0
SPLATW m12, xm12, 1
%endif
pxor m0, m0
%if ARCH_X86_64
mova m13, [pw_m1]
mova m14, [pw_1]
mova m15, [pw_2]
%else
mov heightd, r6m
mova [rsp+mmsize*0], m8
mova [rsp+mmsize*1], m9
mova [rsp+mmsize*2], m10
mova [rsp+mmsize*3], m11
mova [rsp+mmsize*4], m12
%endif
align 16
.loop
%if %2 == 8
mova m1, [srcq]
movu m2, [srcq+a_strideq]
movu m3, [srcq+b_strideq]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq], m2
%endif
%assign i 0
%rep %3
mova m1, [srcq + i]
movu m2, [srcq+a_strideq + i]
movu m3, [srcq+b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i], m2
mova m1, [srcq + i + mmsize]
movu m2, [srcq+a_strideq + i + mmsize]
movu m3, [srcq+b_strideq + i + mmsize]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i + mmsize], m2
%assign i i+mmsize*2
%endrep
%if %2 == 48
INIT_XMM cpuname
mova m1, [srcq + i]
movu m2, [srcq+a_strideq + i]
movu m3, [srcq+b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i], m2
mova m1, [srcq + i + mmsize]
movu m2, [srcq+a_strideq + i + mmsize]
movu m3, [srcq+b_strideq + i + mmsize]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i + mmsize], m2
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif
add dstq, dststrideq
add srcq, EDGE_SRCSTRIDE
dec heightd
jg .loop
RET
%endmacro
INIT_XMM ssse3
HEVC_SAO_EDGE_FILTER_8 8, 0
HEVC_SAO_EDGE_FILTER_8 16, 1, a
HEVC_SAO_EDGE_FILTER_8 32, 2, a
HEVC_SAO_EDGE_FILTER_8 48, 2, a
HEVC_SAO_EDGE_FILTER_8 64, 4, a
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2
HEVC_SAO_EDGE_FILTER_8 32, 1, a
HEVC_SAO_EDGE_FILTER_8 48, 1, u
HEVC_SAO_EDGE_FILTER_8 64, 2, a
%endif
INIT_XMM sse2
HEVC_SAO_EDGE_FILTER_16 10, 8, 0
HEVC_SAO_EDGE_FILTER_16 10, 16, 1
HEVC_SAO_EDGE_FILTER_16 10, 32, 2
HEVC_SAO_EDGE_FILTER_16 10, 48, 2
HEVC_SAO_EDGE_FILTER_16 10, 64, 4
HEVC_SAO_EDGE_FILTER_16 12, 8, 0
HEVC_SAO_EDGE_FILTER_16 12, 16, 1
HEVC_SAO_EDGE_FILTER_16 12, 32, 2
HEVC_SAO_EDGE_FILTER_16 12, 48, 2
HEVC_SAO_EDGE_FILTER_16 12, 64, 4
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2
HEVC_SAO_EDGE_FILTER_16 10, 32, 1
HEVC_SAO_EDGE_FILTER_16 10, 48, 1
HEVC_SAO_EDGE_FILTER_16 10, 64, 2
HEVC_SAO_EDGE_FILTER_16 12, 32, 1
HEVC_SAO_EDGE_FILTER_16 12, 48, 1
HEVC_SAO_EDGE_FILTER_16 12, 64, 2
%endif
| 28.3104 | 128 | 0.54883 |
41fbf6c155b2813944de8cc86ba41bb1afa2bbf5 | 396 | asm | Assembly | programs/oeis/141/A141125.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/141/A141125.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/141/A141125.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A141125: Hankel transform of a transform of Fibonacci numbers.
; 1,4,-4,-16,16,64,-64,-256,256,1024,-1024,-4096,4096,16384,-16384,-65536,65536,262144,-262144,-1048576,1048576,4194304,-4194304,-16777216,16777216,67108864,-67108864,-268435456,268435456
mov $1,2
mov $2,6
lpb $0
sub $0,1
mul $1,2
sub $2,$1
mul $2,2
add $1,$2
lpe
add $1,1
add $1,$2
sub $1,$2
sub $1,3
div $1,2
add $1,1
| 20.842105 | 187 | 0.674242 |
a4af6f264c6e7dd112f69ca4807251d0455ef455 | 5,671 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1848.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1848.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1848.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 %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xdb1c, %rbp
nop
nop
nop
inc %r10
mov (%rbp), %bx
nop
nop
nop
xor $1690, %r14
lea addresses_D_ht+0x11ffc, %rsi
lea addresses_A_ht+0x19675, %rdi
nop
xor %rbp, %rbp
mov $74, %rcx
rep movsq
and $11985, %r14
lea addresses_normal_ht+0x17f1c, %rsi
nop
nop
nop
nop
and $22800, %rdi
movl $0x61626364, (%rsi)
nop
nop
nop
nop
nop
dec %rbp
lea addresses_A_ht+0x1b3cc, %r10
nop
nop
xor %rsi, %rsi
mov (%r10), %r14w
nop
nop
nop
and %r14, %r14
lea addresses_normal_ht+0x331c, %rdi
nop
nop
sub %r10, %r10
mov $0x6162636465666768, %rbp
movq %rbp, (%rdi)
nop
nop
nop
nop
xor %rbp, %rbp
lea addresses_WC_ht+0x158dc, %rcx
nop
nop
sub $38946, %rsi
and $0xffffffffffffffc0, %rcx
movaps (%rcx), %xmm6
vpextrq $0, %xmm6, %rbp
nop
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r9
push %rax
push %rdi
push %rsi
// Store
lea addresses_A+0x6d9c, %rdi
nop
nop
nop
nop
nop
add %rax, %rax
mov $0x5152535455565758, %r14
movq %r14, %xmm5
vmovups %ymm5, (%rdi)
nop
nop
dec %rdi
// Faulty Load
lea addresses_PSE+0x9b1c, %r11
nop
nop
nop
nop
nop
and $61006, %rsi
movb (%r11), %r14b
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdi
pop %rax
pop %r9
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 4}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 39.381944 | 2,999 | 0.660025 |
64a2322ad7f4ea6b1f40362a37f66b98cdda7881 | 252 | asm | Assembly | programs/oeis/109/A109008.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/109/A109008.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/109/A109008.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A109008: a(n) = gcd(n,4).
; 4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4
mov $1,$0
gcd $1,4
| 42 | 203 | 0.496032 |
0598c1b4393e84cdcfa4b72fed16339f7aec38d7 | 628 | asm | Assembly | programs/oeis/247/A247903.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/247/A247903.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/247/A247903.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A247903: Start with a single square; at n-th generation add a square at each expandable vertex (this is the "vertex to side" version); a(n) is the sum of all label values at n-th generation. (See comment for construction rules.)
; 1,5,13,29,53,93,149,237,357,541,789,1165,1669,2429,3445,4973,7013,10077,14165,20301,28485,40765,57141,81709,114469,163613,229141,327437,458501,655101,917237,1310445,1834725,2621149,3669717,5242573,7339717,10485437
lpb $0,1
sub $0,1
add $1,1
add $2,2
mul $2,2
add $4,3
trn $4,$1
trn $1,4
add $4,$1
mov $1,$2
add $1,5
add $3,$2
mov $2,0
add $2,$4
lpe
mov $1,1
add $1,$3
| 29.904762 | 230 | 0.691083 |
654798d38092e9c834d4d6bc07ac730a3a4adc0d | 187 | asm | Assembly | programs/oeis/088/A088741.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/088/A088741.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/088/A088741.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A088741: Number of connected strongly regular simple graphs on n nodes.
; 1,1,1,2,2,3,1,3,3,5
sub $0,1
mov $2,$0
div $0,2
sub $2,4
lpb $2
sub $0,2
mul $0,2
trn $2,8
lpe
add $0,1
| 13.357143 | 73 | 0.620321 |
c53b9f82317d188c3a154a017650000536634ff4 | 684 | asm | Assembly | programs/oeis/186/A186539.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/186/A186539.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/186/A186539.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A186539: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) before g(j) when f(i)=g(j), where f(i)=i^2 and g(j)=-2+3j^2. Complement of A186540.
; 1,3,4,6,7,9,11,12,14,15,17,18,20,22,23,25,26,28,29,31,33,34,36,37,39,41,42,44,45,47,48,50,52,53,55,56,58,59,61,63,64,66,67,69,70,72,74,75,77,78,80,82,83,85,86,88,89,91,93,94,96,97,99,100,102,104,105,107,108,110,111,113,115,116,118,119,121,123,124,126,127,129,130,132,134,135,137,138,140,141,143,145,146,148,149,151,153,154,156,157
mov $4,$0
add $0,1
pow $0,2
mov $3,1
mov $5,60
lpb $0,1
sub $0,1
sub $0,$3
trn $0,1
mov $1,1
add $3,6
add $5,2
lpe
mul $1,$5
sub $1,61
mov $2,$4
mul $2,2
add $1,$2
div $1,2
add $1,1
| 28.5 | 332 | 0.630117 |
9a15e5b785d20975db2bd757f7edcbdd3e71791b | 1,205 | asm | Assembly | PRG/levels/Airship/W8A.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/levels/Airship/W8A.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/levels/Airship/W8A.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | ; Original address was $B617
; World 8 Airship
.word W8Airship_BossL ; Alternate level layout
.word W8Airship_BossO ; Alternate object layout
.byte LEVEL1_SIZE_12 | LEVEL1_YSTART_140
.byte LEVEL2_BGPAL_06 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_70
.byte LEVEL3_TILESET_10 | LEVEL3_VSCROLL_LOCKLOW | LEVEL3_PIPENOTEXIT
.byte LEVEL4_BGBANK_INDEX(10) | LEVEL4_INITACT_AIRSHIPB
.byte LEVEL5_BGM_AIRSHIP | LEVEL5_TIME_300
.byte $75, $06, $01, $76, $0C, $01, $19, $12, $15, $19, $12, $03, $18, $17, $01, $78
.byte $14, $00, $17, $16, $41, $78, $1E, $70, $07, $17, $20, $15, $57, $20, $0F, $14
.byte $24, $42, $16, $25, $01, $76, $2C, $01, $76, $22, $00, $14, $34, $15, $14, $34
.byte $03, $73, $35, $00, $12, $37, $41, $13, $39, $01, $74, $40, $02, $75, $47, $02
.byte $76, $4E, $02, $18, $56, $12, $18, $56, $03, $79, $57, $70, $0C, $75, $5C, $53
.byte $18, $61, $12, $16, $63, $01, $17, $63, $01, $71, $65, $02, $78, $6F, $01, $76
.byte $7A, $01, $71, $82, $01, $78, $8D, $01, $73, $94, $01, $75, $A1, $01, $17, $AD
.byte $13, $17, $AD, $03, $78, $AE, $70, $0E, $17, $BC, $72, $17, $BA, $12, $14, $B3
.byte $14, $15, $B3, $14, $16, $B3, $14, $17, $B3, $14, $32, $B4, $91, $EB, $42, $10
.byte $FF
| 57.380952 | 85 | 0.560996 |
0ce2960806ca6da771087010cfb5c8f7ab515df5 | 1,843 | asm | Assembly | chap15/ex21/mul_cpx_mem.asm | jamesreinders/optimization-manual | 1d370df8ee5bdd1427ea8757514f1048cd394ef1 | [
"0BSD"
] | 374 | 2021-06-08T10:42:01.000Z | 2022-03-29T14:21:45.000Z | chap15/ex21/mul_cpx_mem.asm | jamesreinders/optimization-manual | 1d370df8ee5bdd1427ea8757514f1048cd394ef1 | [
"0BSD"
] | 1 | 2021-06-11T20:24:02.000Z | 2021-06-11T20:24:02.000Z | chap15/ex21/mul_cpx_mem.asm | jamesreinders/optimization-manual | 1d370df8ee5bdd1427ea8757514f1048cd394ef1 | [
"0BSD"
] | 39 | 2021-06-08T11:25:29.000Z | 2022-03-05T05:14:17.000Z | ;
; Copyright (C) 2021 by Intel Corporation
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
;
; .globl mul_cpx_mem
; void mul_cpx_mem(complex_num *in1, complex_num *in2, complex_num *out, size_t len);
; On entry:
; rcx = in1
; rdx = in2
; r8 = out
; r9 = len
.code
mul_cpx_mem PROC public
push rbx
sub rsp, 32
vmovaps xmmword ptr[rsp], xmm6
vmovaps xmmword ptr[rsp+16], xmm7
mov rax, rcx ; mov rax, inPtr1
mov rbx, rdx ; mov rbx, inPtr2
; mov rdx, outPtr (rdx already contains the out array)
mov r10, r9 ; mov r8, len
xor r9, r9
loop1:
vmovaps ymm0, [rax +8*r9]
vmovaps ymm4, [rax +8*r9 +32]
vmovsldup ymm2, ymmword ptr[rbx +8*r9]
vmulps ymm2, ymm2, ymm0
vshufps ymm0, ymm0, ymm0, 177
vmovshdup ymm1, ymmword ptr[rbx +8*r9]
vmulps ymm1, ymm1, ymm0
vmovsldup ymm6, ymmword ptr[rbx +8*r9 +32]
vmulps ymm6, ymm6, ymm4
vaddsubps ymm3, ymm2, ymm1
vmovshdup ymm5, ymmword ptr[rbx +8*r9 +32]
vmovaps [r8 +8*r9], ymm3
vshufps ymm4, ymm4, ymm4, 177
vmulps ymm5, ymm5, ymm4
vaddsubps ymm7, ymm6, ymm5
vmovaps [r8 +8*r9 +32], ymm7
add r9, 8
cmp r9, r10
jl loop1
vzeroupper
vmovaps xmmword ptr[rsp+16], xmm7
vmovaps xmmword ptr[rsp], xmm6
add rsp, 32
pop rbx
ret
mul_cpx_mem ENDP
end | 26.710145 | 86 | 0.705914 |
30684f7490397dde334af356fbe19383080747f8 | 7,940 | asm | Assembly | assembly/cronometroRegressivo/cronometroRegressivo.asm | cardosorrenan/micros | 0e58625a043dcdf69053dc76d6e2babc31a139ab | [
"MIT"
] | null | null | null | assembly/cronometroRegressivo/cronometroRegressivo.asm | cardosorrenan/micros | 0e58625a043dcdf69053dc76d6e2babc31a139ab | [
"MIT"
] | null | null | null | assembly/cronometroRegressivo/cronometroRegressivo.asm | cardosorrenan/micros | 0e58625a043dcdf69053dc76d6e2babc31a139ab | [
"MIT"
] | null | null | null | ; PIC18F4550 Configuration Bit Settings
; Assembly source line config statements
#include "p18f4550.inc"
; CONFIG1L
CONFIG PLLDIV = 1 ; PLL Prescaler Selection bits (No prescale (4 MHz oscillator input drives PLL directly))
CONFIG CPUDIV = OSC1_PLL2 ; System Clock Postscaler Selection bits ([Primary Oscillator Src: /1][96 MHz PLL Src: /2])
CONFIG USBDIV = 1 ; USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) (USB clock source comes directly from the primary oscillator block with no postscale)
; CONFIG1H
CONFIG FOSC = INTOSC_HS ; Oscillator Selection bits (Internal oscillator, HS oscillator used by USB (INTHS))
CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
CONFIG IESO = OFF ; Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)
; CONFIG2L
CONFIG PWRT = OFF ; Power-up Timer Enable bit (PWRT disabled)
CONFIG BOR = ON ; Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled))
CONFIG BORV = 3 ; Brown-out Reset Voltage bits (Minimum setting 2.05V)
CONFIG VREGEN = OFF ; USB Voltage Regulator Enable bit (USB voltage regulator disabled)
; CONFIG2H
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
CONFIG WDTPS = 32768 ; Watchdog Timer Postscale Select bits (1:32768)
; CONFIG3H
CONFIG CCP2MX = ON ; CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
CONFIG LPT1OSC = OFF ; Low-Power Timer 1 Oscillator Enable bit (Timer1 configured for higher power operation)
CONFIG MCLRE = OFF ; MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
; CONFIG4L
CONFIG STVREN = ON ; Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
CONFIG ICPRT = OFF ; Dedicated In-Circuit Debug/Programming Port (ICPORT) Enable bit (ICPORT disabled)
CONFIG XINST = OFF ; Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))
; CONFIG5L
CONFIG CP0 = OFF ; Code Protection bit (Block 0 (000800-001FFFh) is not code-protected)
CONFIG CP1 = OFF ; Code Protection bit (Block 1 (002000-003FFFh) is not code-protected)
CONFIG CP2 = OFF ; Code Protection bit (Block 2 (004000-005FFFh) is not code-protected)
CONFIG CP3 = OFF ; Code Protection bit (Block 3 (006000-007FFFh) is not code-protected)
; CONFIG5H
CONFIG CPB = OFF ; Boot Block Code Protection bit (Boot block (000000-0007FFh) is not code-protected)
CONFIG CPD = OFF ; Data EEPROM Code Protection bit (Data EEPROM is not code-protected)
; CONFIG6L
CONFIG WRT0 = OFF ; Write Protection bit (Block 0 (000800-001FFFh) is not write-protected)
CONFIG WRT1 = OFF ; Write Protection bit (Block 1 (002000-003FFFh) is not write-protected)
CONFIG WRT2 = OFF ; Write Protection bit (Block 2 (004000-005FFFh) is not write-protected)
CONFIG WRT3 = OFF ; Write Protection bit (Block 3 (006000-007FFFh) is not write-protected)
; CONFIG6H
CONFIG WRTC = OFF ; Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) are not write-protected)
CONFIG WRTB = OFF ; Boot Block Write Protection bit (Boot block (000000-0007FFh) is not write-protected)
CONFIG WRTD = OFF ; Data EEPROM Write Protection bit (Data EEPROM is not write-protected)
; CONFIG7L
CONFIG EBTR0 = OFF ; Table Read Protection bit (Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks)
CONFIG EBTR1 = OFF ; Table Read Protection bit (Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks)
CONFIG EBTR2 = OFF ; Table Read Protection bit (Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks)
CONFIG EBTR3 = OFF ; Table Read Protection bit (Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks)
; CONFIG7H
CONFIG EBTRB = OFF ; Boot Block Table Read Protection bit (Boot block (000000-0007FFh) is not protected from table reads executed in other blocks)
i EQU 0
j EQU 1
k EQU 2
contador EQU 3
RES_VECT CODE 0x0000
GOTO START
START
NOP
MOVLW b'00000011'
MOVWF TRISD
MOVLW b'00000000'
MOVWF TRISB
MOVLW b'01100000' ; inicia contagem em 60 minutos
MOVWF PORTB
; Loop principal do programa
LOOP
BTFSC PORTD,0 ; botao responsável por definir o tempo de contagem
CALL INCREASE_10
BTFSC PORTD,1 ; botao responsável por iniciar a contagem
CALL START_COUNT
BRA LOOP
; Decrementa 10 minutos, -1 na casa das dezenas.
; Para realizar a subtraçao, os nibbles são trocados, pois o valor que queremos
; decrementar são os mais significativos.
INCREASE_10
SWAPF PORTB
DECF PORTB
SWAPF PORTB
CALL FIT_MSB_REG_CRO
; volta ao programa principal somente quando o botão for despressionado
LOCK
BTFSC PORTD,0
BRA LOCK
RETURN
; O botão de iniciar a contagem foi pressionado
START_COUNT
MOVLW .60
MOVWF contador
DECF PORTB
CALL FIT_LSB_REG
CALL FIT_MSB_REG
ATRASO_1min ; realiza 60 vezes o atraso de 1 segundo
CALL ATRASO_1s
BTG PORTD,3
DECFSZ contador
BRA ATRASO_1min
MOVLW .0 ; variavel contador de segundos iniciado em 60 chegou em 0
CPFSEQ PORTB
BRA START_COUNT
BRA ALARM
; contagem chegou em 0, dispara o alarme e espera que um botao seja pressionado
; para reiniciar o cronometro
ALARM
BTFSC PORTD,0
BRA RESTART
BTFSC PORTD,1
BRA RESTART
BTG PORTD,2
CALL ATRASO_25ms
BRA ALARM
; volta ao programa principal somente quando o botão for despressionado
RESTART
BTFSC PORTD,0
BRA RESTART
BTFSC PORTD,1
BRA RESTART
BRA START
; Faz com que o display das dezenas exiba de 1 à 6.
; Se os bits mais significativos chegarem em FF na contagem regressiva do cro-
; nometro, ou seja, quando houve o estouro, será desviado para o valor 6.
FIT_MSB_REG_CRO
BTFSC PORTB,7
RETURN
BTFSC PORTB,6
RETURN
BTFSC PORTB,5
RETURN
BTFSC PORTB,4
RETURN
BSF PORTB,6
BSF PORTB,5
RETURN
; Faz com que o display das unidades exiba de 0 à 9.
; Se os bits menos significativos chegarem em FF na contagem regressiva, ou
; seja, quando houve o estouro, o valor será desviado para 9.
FIT_LSB_REG
BTFSS PORTB,3
RETURN
BTFSS PORTB,2
RETURN
BTFSS PORTB,1
RETURN
BSF PORTB,3
BCF PORTB,2
BCF PORTB,1
RETURN
; Faz com que o display das dezenas exiba de 0 à 6.
; Se os bits mais significativos chegarem em FF na contagem regressiva, ou
; seja, quando houve o estouro, o valor será desviado para 6.
FIT_MSB_REG
BTFSS PORTB,7
RETURN
BTFSS PORTB,6
RETURN
BTFSS PORTB,5
RETURN
BTFSS PORTB,4
RETURN
BCF PORTB,7
BSF PORTB,6
BCF PORTB,5
BSF PORTB,4
RETURN
; Atraso de 1ms.
ATRASO_1ms
MOVLW .30
MOVWF i
LOOP_1ms
NOP
NOP
NOP
NOP
NOP
DECFSZ i
BRA LOOP_1ms
RETURN
; Atraso de 25ms
ATRASO_25ms
MOVLW .25
MOVWF j
LOOP_25ms
RCALL ATRASO_1ms
DECFSZ j
BRA LOOP_25ms
RETURN
; Atraso de 1s
ATRASO_1s
MOVLW .40
MOVWF k
LOOP_1s
RCALL ATRASO_25ms
DECFSZ k
BRA LOOP_1s
RETURN
END
| 34.977974 | 193 | 0.678463 |
52ce4dc438ddac434c253449ac6ed5c88bd402b8 | 531 | asm | Assembly | programs/oeis/153/A153285.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/153/A153285.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/153/A153285.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A153285: a(1)=1; for n > 1, a(n) = n^2 + Sum_{j=1..n-1} (-1)^j*a(j).
; 1,3,11,7,23,11,35,15,47,19,59,23,71,27,83,31,95,35,107,39,119,43,131,47,143,51,155,55,167,59,179,63,191,67,203,71,215,75,227,79,239,83,251,87,263,91,275,95,287,99,299,103,311,107,323,111,335,115,347,119,359,123,371,127,383,131,395,135,407,139,419,143,431,147,443,151,455,155,467,159,479,163,491,167,503,171,515,175,527,179,539,183,551,187,563,191,575,195,587,199
mov $1,$0
mul $0,2
add $0,$1
mov $2,$1
add $2,3
mod $2,2
trn $0,$2
dif $0,3
mul $0,2
add $0,1
| 37.928571 | 364 | 0.647834 |
87fc8e659e39a165fca61179d1f4b38445b713c9 | 572 | asm | Assembly | programs/oeis/066/A066798.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/066/A066798.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/066/A066798.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A066798: a(n) = Sum_{i=1..n} binomial(6*i,3*i).
; 20,944,49564,2753720,157871240,9233006540,547490880980,32795094564080,1979734520212192,120244316085073616,7339672750101339356,449852213026938118560,27666867082225970134160,1706577353294117060381480,105533998640847528430052600,6540601012507146436851655700,406149455879251598468854095812,25263933947416692528087377114132,1573919199640358102974310190048644,98188828040003680706867449711421300
mov $1,3
lpb $0
mov $2,$0
sub $0,1
add $2,1
seq $2,66802 ; a(n) = binomial(6*n,3*n).
add $1,$2
lpe
add $1,17
mov $0,$1
| 40.857143 | 391 | 0.811189 |
fff5932bdd4a84c7732ba032fcd2ceb7a35bf5a4 | 432 | asm | Assembly | programs/oeis/100/A100691.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/100/A100691.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/100/A100691.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A100691: Number of self-avoiding paths with n steps on a triangular lattice in the strip Z x {0,1}.
; 1,4,12,30,70,158,352,780,1724,3806,8398,18526,40864,90132,198796,438462,967062,2132926,4704320,10375708,22884348,50473022,111321758,245527870,541528768,1194379300,2634286476,5810101726,12814582758
seq $0,77852 ; Expansion of (1-x)^(-1)/(1-2*x-x^3).
mov $1,$0
add $2,$0
bin $2,$0
mul $2,2
trn $0,$2
add $1,$2
add $0,$1
sub $0,2
| 33.230769 | 198 | 0.722222 |
e9b532a6a4eec677f7c6f4b7a7b4dd12147eb8fb | 297 | asm | Assembly | programs/oeis/008/A008954.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/008/A008954.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/008/A008954.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A008954: Final digit of triangular number n*(n+1)/2.
; 0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0
sub $1,$0
bin $1,2
mod $1,10
mov $0,$1
| 37.125 | 201 | 0.538721 |
b2e914404f59a6c8db548022f79d41b276c74988 | 4,660 | asm | Assembly | Library/Trans/Graphics/Vector/EPS/Export/exportType3Fonts.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Trans/Graphics/Vector/EPS/Export/exportType3Fonts.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Trans/Graphics/Vector/EPS/Export/exportType3Fonts.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 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: PostScript Translation Library
FILE: exportType3Fonts.asm
AUTHOR: Jim DeFrisco, 21 Feb 1991
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 6/91 Initial revision
DESCRIPTION:
This file contains the template for a type 3 downloaded font program
$Id: exportType3Fonts.asm,v 1.1 97/04/07 11:25:22 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;-----------------------------------------------------------------------
; An abbreviated function header has been adopted for use here.
; There are three parts to the header:
; SYNOPSIS: As before, this contains a brief description
; of the function
; STACK USAGE: As PostScript is a stack-based language,
; this field effectively describes what is
; passed and what is returned. The form of
; this line is
; <arg> <arg> .. FUNCTION <retvalue>..
; So, the items to the left of the FUNCTION
; name are items passed on the stack, the
; rightmost item in the list is the item on
; the top of the stack. The FUNCTION is the
; actual function name, and the items to the
; right are the items left on the stack when
; the operation is completed. Again, the right-
; most item is the topmost item on the stack.
; If there are no arguments or return values,
; a dash is used instead. As an example, the
; PostScript operator "moveto", which consumes
; two integers on the stack would be represented
; as
; <x> <y> moveto -
;
; SIDE EFFECTS: This section describes any other effects the
; procedure might have, such as altering other
; variables defined in this prolog.
;
;
; A few coding conventions:
; Procedure Names - all uppercase, no more than 3 characters
; Variable Names - all lowercase, no more than 3 characters
;
; The reason that the names are so short is to decrease the
; amount of data sent to the printer.
;-----------------------------------------------------------------------
PSType3 segment resource
;-----------------------------------------------------------------------
; Procedure Definitions
;-----------------------------------------------------------------------
; emitVMtest char "vmstatus exch sub exch pop "
beginType3Header label byte
; char "000 ge { /fsaved false def}", NL
; char "{/fsaved true def /fsave save def}ifelse", NL
char "12 dict begin", NL
char "/FontType 3 def", NL
char "/LanguageLevel 1 def", NL
char "/PaintType 0 def", NL
; the character procedures are encoded into hex ascii strings, to
; save on space. It's not the hex ascii that saves the space, it's
; not using procedures. For hex strings, the VM usage is one byte
; per character. For procedures, which are actually just executable
; arrays, the storage requirement is 8 bytes per element. yikes.
;
; The way we break up the 256 values in a byte are as follows.
; 0x00-0x0d - opcode space.
; 0x0e-0xea - -110 thru 110 (0 = 7c)
; 0xeb-0xff - -1100 thru 1100 (0 = f5)
;
char "/fops [{moveto}{rmoveto}{lineto}{rlineto}{0 rlineto}", NL
char "{0 exch rlineto}{curveto}{rcurveto}{closepath fill}", NL
char "{setcachedevice 0 0 moveto}] def", NL
char "/BuildGlyph {1 index begin exch /CharProcs get exch 2 copy known not", NL
char "{pop /.notdef}if get {dup 13 le { fops exch get exec}", NL
char "{dup 234 le {124 sub}{245 sub 110 mul add}ifelse}ifelse}", NL
char "forall end} bind def", NL
char "/BuildChar {1 index /Encoding get exch get", NL
char "1 index /BuildGlyph get exec} bind def", NL
endType3Header label byte
emitCPstart char "/CharProcs "
beginCPdefine label byte
char " dict def", NL
char "CharProcs begin", NL
char "/.notdef <> def", NL
char "end", NL
endCPdefine label byte
beginEVdefine label byte
char "/Encoding 256 array def", NL
char "0 1 255 {Encoding exch /.notdef put}for", NL
endEVdefine label byte
emitFontBBox char "end",NL,"/FontBBox [ "
emitFMDef char " def", NL
emitBBDef char " ] def", NL
cpstart char "CharProcs begin", NL
cpend char "currentdict end", NL
emitFontMatrix char "/FontMatrix "
emitDefineFont char " exch definefont pop",NL
;emitEndFont label char
char " MFC}ifelse", NL
emitEAend char ">",NL,"{Encoding exch dup 3 string cvs /es 2 index 100 ge",NL,\
"{(c )}{(c )}ifelse def es exch 1 exch putinterval es cvn put}forall", NL
PSType3 ends
| 34.264706 | 81 | 0.616953 |
8092471a2262b985d84ea19806172eb86bcb214e | 5,264 | asm | Assembly | src/foundation/MundosPerdidosAO/Foundation.asm | Dunkansdk/AoW | 59dfc984c510f1e98fe46d221d01c4a36e4a527f | [
"Apache-2.0"
] | 2 | 2016-02-05T15:57:30.000Z | 2018-05-25T06:09:43.000Z | src/foundation/MundosPerdidosAO/Foundation.asm | Drexlor/AoW | 59dfc984c510f1e98fe46d221d01c4a36e4a527f | [
"Apache-2.0"
] | null | null | null | src/foundation/MundosPerdidosAO/Foundation.asm | Drexlor/AoW | 59dfc984c510f1e98fe46d221d01c4a36e4a527f | [
"Apache-2.0"
] | 1 | 2021-11-15T15:24:03.000Z | 2021-11-15T15:24:03.000Z | ;//////////////////////////////////////////////////////////////////////
;/// This file is subject to the terms and conditions defined in ///
;/// file 'LICENSE.txt', which is part of this source code package. ///
;//////////////////////////////////////////////////////////////////////
[SEGMENT .text]
;////////////////////////////////////////////////////
;///!< The original SendData callback
;////////////////////////////////////////////////////
__fRealSendData DD 0x00000000
__fSendDataMask DB 0x89, 0x5D, 0xDC
DB 0x89, 0x5D, 0xD8
DB 0x89, 0x5D, 0xD4
DB 0x89, 0x5D, 0xD0
DB 0x89, 0x5D, 0xCC
DB 0x89, 0x5D, 0xC8
DB 0x89, 0x5D, 0xC4
DB 0x89, 0x5D, 0xC0
DB 0x89, 0x5D, 0xB0
DB 0x89, 0x5D, 0xA0
DB 0x89, 0x5D, 0x90
DB 0x89, 0x5D, 0x80
DB 0x00
__fSendDataPattern DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB "xxx"
DB 0x00
;////////////////////////////////////////////////////
;///!< The original HandleData callback
;////////////////////////////////////////////////////
__fRealHandleData DD 0x00000000
__fHandleDataMask DB 0x51
DB 0x68, 0x90, 0x90, 0x90, 0x90
DB 0xFF, 0x15, 0x90, 0x90, 0x90, 0x90
DB 0x85, 0xC0
DB 0x0F, 0x85, 0x90, 0x90, 0x90, 0x90
DB 0xC7, 0x45, 0xFC, 0x90, 0x90, 0x90, 0x90
DB 0x6A, 0x01
DB 0xE8, 0x90, 0x90, 0x90, 0x90
DB 0x00
__fHandleDataPattern DB "x"
DB "x????"
DB "xx????"
DB "xx"
DB "xx????"
DB "xxx????"
DB "xx"
DB "x????"
DB 0x00
;////////////////////////////////////////////////////
;/// \brief Initialize foundation enviroment
;////////////////////////////////////////////////////
InitializeFoundation:
PUSH EBP
MOV EBP, ESP
;////////////////////////////////////////////////
;/// Redirect "SendData" for our function
;////////////////////////////////////////////////
PUSH __fSendDataMask
PUSH __fSendDataPattern
PUSH 0x00200000
PUSH 0x00500000
CALL FindMemory
PUSH EAX
CALL BacktraceFunction
PUSH BridgeSendData
PUSH EAX
CALL WriteDetour
MOV DWORD [__fRealSendData], EAX
;////////////////////////////////////////////////
;/// Redirect "HandleData" for our function
;////////////////////////////////////////////////
PUSH __fHandleDataMask
PUSH __fHandleDataPattern
PUSH 0x00200000
PUSH 0x00500000
CALL FindMemory
PUSH EAX
CALL BacktraceFunction
PUSH BridgeHandleData
PUSH EAX
CALL WriteDetour
MOV DWORD [__fRealHandleData], EAX
MOV ESP, EBP
POP EBP
RET
;////////////////////////////////////////////////////
;/// \brief Send data to the server
;///
;/// \param ????
;/// \param ????
;////////////////////////////////////////////////////
BridgeSendData:
PUSH EBP
MOV EBP, ESP
PUSHAD
;////////////////////////////////////////////////////
;/// Execute engine dispatcher
;////////////////////////////////////////////////////
PUSH DWORD [EBP + 0x08]
CALL ConvertUnicodeToString
MOV ESI, EAX
PUSH EAX
CALL HandleOutgoingData
PUSH ESI
CALL DWORD [LocalFree]
;////////////////////////////////////////////////////
;/// Execute client dispatcher
;////////////////////////////////////////////////////
PUSH DWORD [EBP + 0x0C]
PUSH DWORD [EBP + 0x08]
CALL DWORD [__fRealSendData]
POPAD
MOV ESP, EBP
POP EBP
RET 0x08
;////////////////////////////////////////////////////
;/// \brief Handle data from the server
;///
;/// \param ????
;////////////////////////////////////////////////////
BridgeHandleData:
PUSH EBP
MOV EBP, ESP
PUSHAD
;////////////////////////////////////////////////////
;/// Execute engine dispatcher
;////////////////////////////////////////////////////
PUSH DWORD [EBP + 0x08]
CALL ConvertUnicodeToString
MOV ESI, EAX
PUSH EAX
CALL HandleIncommingData
PUSH ESI
CALL DWORD [LocalFree]
;////////////////////////////////////////////////////
;/// Execute client dispatcher
;////////////////////////////////////////////////////
PUSH DWORD [EBP + 0x08]
CALL DWORD [__fRealHandleData]
POPAD
MOV ESP, EBP
POP EBP
RET 0x04
| 29.244444 | 71 | 0.348214 |
36e29b34c81b602f1dde8c3fdb6a6ad33f112eb1 | 528 | asm | Assembly | oeis/066/A066342.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/066/A066342.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/066/A066342.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A066342: Number of triangulations of the cyclic polytope C(n, n-4).
; Submitted by Jon Maiga
; 1,2,4,8,14,25,40,67,102,165,244,387,562,881,1264,1967,2798,4333,6124,9451,13290,20457,28648,44007,61414,94181,131044,200675,278498,425953,589792,901087,1245150,1900509,2621404,3997659,5504986,8388569
add $0,1
mov $1,1
mov $3,$0
lpb $0
sub $0,1
mov $2,$1
mov $1,1
add $1,$3
mul $2,2
sub $4,2
sub $3,$4
add $3,$5
mov $4,$2
mov $2,$3
mov $3,$4
mov $5,$4
mov $4,3
add $5,$2
lpe
mov $0,$5
div $0,8
add $0,1
| 19.555556 | 201 | 0.643939 |
9659e0f99b0ab1fdd4c113bb80cd18aca270f763 | 2,629 | asm | Assembly | Examples/system/elf64header/elf64header.asm | agguro/linux-nasm | 3e72083c3db6d7118eb2aa430b73e0d20e88456b | [
"Unlicense"
] | 6 | 2020-07-19T18:34:43.000Z | 2022-03-26T10:21:09.000Z | Examples/system/elf64header/elf64header.asm | NrdyBhu1/linux-nasm | 3e72083c3db6d7118eb2aa430b73e0d20e88456b | [
"Unlicense"
] | null | null | null | Examples/system/elf64header/elf64header.asm | NrdyBhu1/linux-nasm | 3e72083c3db6d7118eb2aa430b73e0d20e88456b | [
"Unlicense"
] | 3 | 2020-07-19T18:35:10.000Z | 2021-07-25T17:34:50.000Z | ;name: elf64header.asm
;
;build: nasm -fbin -o elf64header elf64header.asm && chmod +x elf64header
;
;description: Small, self-contained 64-bit ELF executable for NASM
;
;adapted from: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
;http://blog.markloiseau.com/2012/05/tiny-64-bit-elf-executables/
bits 64
[list -]
%include "unistd.inc"
[list +]
org 0x00400000 ;Program load offset
;64-bit ELF header
ehdr:
;ELF Magic + 2 (64-bit), 1 (LSB), 1 (ELF ver. 1), 0 (ABI ver.)
db 0x7F, "ELF", 2, 1, 1, 0 ;e_ident
times 8 db 0 ;reserved (zeroes)
dw 2 ;e_type: Executable file
dw 0x3e ;e_machine: AMD64
dd 1 ;e_version: current version
dq _start ;e_entry: program entry address (0x78)
dq phdr - $$ ;e_phoff program header offset (0x40)
dq 0 ;e_shoff no section headers
dd 0 ;e_flags no flags
dw ehdrsize ;e_ehsize: ELF header size (0x40)
dw phdrsize ;e_phentsize: program header size (0x38)
dw 1 ;e_phnum: one program header
dw 0 ;e_shentsize
dw 0 ;e_shnum
dw 0 ;e_shstrndx
ehdrsize equ $ - ehdr
;64-bit ELF program header
phdr:
dd 1 ;p_type: loadable segment
dd 5 ;p_flags read and execute
dq 0 ;p_offset
dq $$ ;p_vaddr: start of the current section
dq $$ ;p_paddr:
dq filesize ;p_filesz
dq filesize ;p_memsz
dq 0x200000 ;p_align: 2^11=200000=11 bit boundaries
;program header size
phdrsize equ $ - phdr
;Hello World!/your program here
_start:
xor rax,rax ;3 bytes
mov edi,1 ;5 bytes
mov esi,message ;5 bytes
mov edx,message.len ;5 bytes
inc rax ;3 bytes
syscll:
syscall ;2 bytes
xor rdi,rdi ;3 bytes
mov al,0x3c ;2 bytes
jmp syscll ;2 bytes
;----------
;30 bytes
message: db 'Hello, world!',0x0a ;message and newline
.len: equ $-message ;message length calculation
; File size calculation
filesize equ $ - $$
| 35.527027 | 76 | 0.478889 |
6efc3b2c526246a3f808bc602f70df5d3e2e6eca | 8,580 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_226.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_226.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_226.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 %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x922f, %rdi
nop
nop
nop
dec %r8
mov $0x6162636465666768, %r14
movq %r14, %xmm5
vmovups %ymm5, (%rdi)
nop
sub $59248, %rax
lea addresses_A_ht+0x311f, %rdx
nop
nop
sub $45944, %r10
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
movups %xmm1, (%rdx)
nop
nop
nop
nop
and %rax, %rax
lea addresses_UC_ht+0x4a97, %rsi
nop
nop
nop
nop
inc %rdx
mov (%rsi), %r10d
nop
nop
nop
nop
add $51212, %r10
lea addresses_normal_ht+0x2117, %rdx
nop
nop
add %rdi, %rdi
vmovups (%rdx), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %r8
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0xd563, %rsi
lea addresses_normal_ht+0x5a6f, %rdi
nop
xor %r8, %r8
mov $29, %rcx
rep movsq
cmp $18736, %rcx
lea addresses_UC_ht+0x1a58f, %r14
nop
nop
nop
xor $43923, %rcx
movw $0x6162, (%r14)
and $58294, %rax
lea addresses_WC_ht+0xc30f, %r10
nop
nop
nop
add %rsi, %rsi
mov (%r10), %ecx
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_D_ht+0x8ef, %rdi
nop
cmp $21660, %r14
movl $0x61626364, (%rdi)
nop
nop
add %r10, %r10
lea addresses_UC_ht+0xc42f, %rsi
lea addresses_D_ht+0x4def, %rdi
nop
and $58070, %r8
mov $54, %rcx
rep movsb
nop
nop
nop
nop
and %r10, %r10
lea addresses_A_ht+0x196ef, %rsi
lea addresses_WC_ht+0xb0c5, %rdi
nop
nop
nop
nop
xor %r10, %r10
mov $14, %rcx
rep movsb
dec %rcx
lea addresses_normal_ht+0x1cef, %rdx
nop
nop
nop
nop
nop
inc %r14
movw $0x6162, (%rdx)
nop
sub %rdx, %rdx
lea addresses_normal_ht+0x4cef, %rcx
nop
sub $23821, %rdi
mov (%rcx), %dx
nop
nop
xor $38427, %r14
lea addresses_D_ht+0x148af, %rsi
lea addresses_A_ht+0xd4ef, %rdi
nop
nop
nop
nop
nop
and %rax, %rax
mov $99, %rcx
rep movsw
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_D_ht+0xc40f, %rsi
nop
nop
nop
nop
sub $13444, %r14
vmovups (%rsi), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdi
nop
nop
add %rax, %rax
lea addresses_normal_ht+0x14cef, %r14
nop
nop
nop
dec %rax
movups (%r14), %xmm7
vpextrq $0, %xmm7, %r10
nop
nop
xor %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
// Store
lea addresses_RW+0x67ef, %rdx
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x5152535455565758, %r8
movq %r8, %xmm4
vmovaps %ymm4, (%rdx)
nop
sub $61907, %r14
// Load
lea addresses_normal+0x22fb, %r12
nop
and %rbx, %rbx
movups (%r12), %xmm4
vpextrq $0, %xmm4, %rcx
nop
nop
nop
nop
add $12271, %rdx
// Store
lea addresses_UC+0x174ef, %r12
nop
nop
nop
add %rbx, %rbx
mov $0x5152535455565758, %r14
movq %r14, (%r12)
nop
nop
sub %r12, %r12
// Faulty Load
lea addresses_US+0x10cef, %rdx
cmp %rcx, %rcx
mov (%rdx), %r12d
lea oracles, %rbx
and $0xff, %r12
shlq $12, %r12
mov (%rbx,%r12,1), %r12
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_RW'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 32.255639 | 2,999 | 0.655128 |
0a3a1cc4098455d1085b64ce9060dac2992eda00 | 616 | asm | Assembly | oeis/027/A027658.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/027/A027658.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/027/A027658.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A027658: C(n+2,2)+C(n+4,5).
; 1,4,12,31,71,147,280,498,837,1342,2068,3081,4459,6293,8688,11764,15657,20520,26524,33859,42735,53383,66056,81030,98605,119106,142884,170317,201811,237801,278752,325160,377553,436492,502572,576423,658711,750139,851448,963418,1086869,1222662,1371700,1534929,1713339,1907965,2119888,2350236,2600185,2870960,3163836,3480139,3821247,4188591,4583656,5007982,5463165,5950858,6472772,7030677,7626403,8261841,8938944,9659728,10426273,11240724,12105292,13022255,13993959,15022819,16111320,17262018,18477541
mov $1,$0
add $0,2
add $1,4
mov $2,$0
sub $0,3
bin $1,$0
bin $2,2
add $1,$2
mov $0,$1
| 47.384615 | 498 | 0.785714 |
41ec19c1bce64b61d59aa828fd8357488ef1ba9e | 527 | asm | Assembly | oeis/111/A111224.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/111/A111224.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/111/A111224.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A111224: Numbers n such that 5*n + 7 is prime.
; Submitted by Jamie Morken(s4)
; 0,2,6,8,12,18,20,24,26,30,32,38,44,50,54,60,62,66,68,72,78,90,92,96,108,110,114,116,120,122,128,134,144,150,156,158,164,170,174,176,180,186,188,192,194,198,216,218,222,236,242,246,254,258,260,264,272,284
mov $1,6
mov $2,$0
pow $2,2
lpb $2
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,10
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
div $0,10
mul $0,2
| 23.954545 | 205 | 0.639469 |
5e311e0a3f9b83ebf8f72633347b92ac76391200 | 1,491 | asm | Assembly | programs/oeis/166/A166481.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/166/A166481.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/166/A166481.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A166481: a(n) = 3*a(n-2) for n > 2; a(1) = 1; a(2) = 7.
; 1,7,3,21,9,63,27,189,81,567,243,1701,729,5103,2187,15309,6561,45927,19683,137781,59049,413343,177147,1240029,531441,3720087,1594323,11160261,4782969,33480783,14348907,100442349,43046721,301327047,129140163,903981141,387420489,2711943423,1162261467,8135830269,3486784401,24407490807,10460353203,73222472421,31381059609,219667417263,94143178827,659002251789,282429536481,1977006755367,847288609443,5931020266101,2541865828329,17793060798303,7625597484987,53379182394909,22876792454961,160137547184727,68630377364883,480412641554181,205891132094649,1441237924662543,617673396283947,4323713773987629,1853020188851841,12971141321962887,5559060566555523,38913423965888661,16677181699666569,116740271897665983,50031545098999707,350220815692997949,150094635296999121,1050662447078993847,450283905890997363,3151987341236981541,1350851717672992089,9455962023710944623,4052555153018976267,28367886071132833869,12157665459056928801,85103658213398501607,36472996377170786403,255310974640195504821,109418989131512359209,765932923920586514463,328256967394537077627,2297798771761759543389,984770902183611232881,6893396315285278630167,2954312706550833698643,20680188945855835890501,8862938119652501095929,62040566837567507671503,26588814358957503287787,186121700512702523014509,79766443076872509863361,558365101538107569043527,239299329230617529590083,1675095304614322707130581
seq $0,228879 ; a(n+2) = 3*a(n), starting 4,7.
lpb $0
dif $0,4
lpe
| 186.375 | 1,362 | 0.887324 |
56f37fc1dab933424e58f973c169fded26c4f842 | 1,026 | asm | Assembly | programs/oeis/301/A301977.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/301/A301977.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/301/A301977.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A301977: a(n) is the number of distinct positive numbers whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.
; 1,2,2,3,4,4,3,4,6,7,6,6,7,6,4,5,8,10,9,10,12,11,8,8,11,12,10,9,10,8,5,6,10,13,12,14,17,16,12,13,18,20,17,16,18,15,10,10,15,18,16,17,20,18,13,12,16,17,14,12,13,10,6,7,12,16,15,18,22,21,16,18,25,28,24,23,26,22,15,16,24,29,26,28,33,30,22,21,28,30,25,22,24,19,12,12,19,24,22,25,30,28,21,22,30,33,28,26,29,24,16,15,22,26,23,24,28,25,18,16,21,22,18,15,16,12,7,8,14,19,18,22,27,26,20,23,32,36,31,30,34,29,20,22,33,40,36,39,46,42,31,30,40,43,36,32,35,28,18,19,30,38,35,40,48,45,34,36,49,54,46,43,48,40,27,26,38,45,40,42,49,44,32,29,38,40,33,28,30,23,14,14,23,30,28,33,40,38,29,32,44,49,42,40,45,38,26,27,40,48,43,46,54,49,36,34,45,48,40,35,38,30,19,18,28,35,32,36,43,40,30,31,42,46,39,36,40,33,22,20,29,34,30,31,36,32,23,20,26,27
mul $0,2
mov $1,$0
add $1,3
cal $1,126606 ; Fixed point of transformation of the seed sequence {0,2}.
sub $1,4
div $1,2
add $1,1
| 93.272727 | 723 | 0.678363 |
2520c3b7798fe0a84194fd26a226b5c7526ae2f3 | 460 | asm | Assembly | oeis/290/A290564.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/290/A290564.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/290/A290564.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A290564: Number of primes between n^2 and 2*n^2.
; Submitted by Christian Krause
; 1,2,3,5,6,9,10,13,15,21,23,27,29,33,39,43,45,52,56,61,67,71,78,85,90,95,102,110,117,124,131,137,145,153,163,167,180,190,196,201,211,218,233,241,252,261,271,281,290,302,314,320,329,344,355,371,385,393,407,416,423,443
mov $2,2
add $2,$0
mul $0,$2
mov $3,$0
seq $0,108954 ; a(n) = pi(2*n) - pi(n). Number of primes in the interval (n,2n].
sub $2,1
gcd $3,$2
add $0,$3
sub $0,1
| 32.857143 | 217 | 0.663043 |
d175b02f3fa58c3dd3c287e1505a3222f6476750 | 1,102 | asm | Assembly | programs/oeis/083/A083065.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/083/A083065.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/083/A083065.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A083065: 4th row of number array A083064.
; 1,4,19,94,469,2344,11719,58594,292969,1464844,7324219,36621094,183105469,915527344,4577636719,22888183594,114440917969,572204589844,2861022949219,14305114746094,71525573730469,357627868652344,1788139343261719,8940696716308594,44703483581542969,223517417907714844,1117587089538574219,5587935447692871094,27939677238464355469,139698386192321777344,698491930961608886719,3492459654808044433594,17462298274040222167969,87311491370201110839844,436557456851005554199219,2182787284255027770996094,10913936421275138854980469,54569682106375694274902344,272848410531878471374511719,1364242052659392356872558594,6821210263296961784362792969,34106051316484808921813964844,170530256582424044609069824219,852651282912120223045349121094,4263256414560601115226745605469,21316282072803005576133728027344,106581410364015027880668640136719,532907051820075139403343200683594,2664535259100375697016716003417969,13322676295501878485083580017089844,66613381477509392425417900085449219,333066907387546962127089500427246094
mov $1,5
pow $1,$0
div $1,4
mul $1,3
add $1,1
mov $0,$1
| 110.2 | 1,000 | 0.916515 |
83fcb4dc96a024e4d6e18585d9b41efdd42d8c79 | 6,435 | asm | Assembly | Examples/template_80.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 43 | 2019-12-06T23:46:40.000Z | 2022-03-31T15:34:44.000Z | Examples/template_80.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 21 | 2019-12-27T01:49:08.000Z | 2022-03-31T15:38:42.000Z | Examples/template_80.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 13 | 2019-12-27T00:38:46.000Z | 2022-03-15T08:34:51.000Z | ; ================================================================
; Example source with target 'o' or '80'
; ZX80 tape file / snapshot
; Copyright (c) Günter Woigk 1994 - 2017
; mailto:kio@little-bat.de
; ================================================================
; "o" and "80" files are the same and used for saving ZX80 programs.
; The file consists of the raw ram data as saved by the ZX80 tape saving routine.
; The data is save from and loaded back to address $4000++.
; The file can only store one program, not a whole tape with multiple programs.
;
; ---------------------------------------------------------------
; Notes:
; ZX80 files do not have filenames
; ZX80 files cannot be autostarted.
; The data is loaded to address $4000++
; The data contains the whole system area, Basic program, and VARS.
; Video memory is NOT included in ZX80 files.
; the last byte of a (clean) file should be $80 (the last byte of VARS)
; The system area should contain proper data.
; $400A (2 bytes) defines the data end address (used to calculate the file length).
; $4028++ may be misused for whatever purpose.
;
; While loading, the data at address $400A/400B is overwritten. After this they contain
; the real data end address of the data loaded and define when loading will stop. :-)
;
; Files should usually not exceed 16 kBytes.
; The memory detection procedure in both ZX80 and ZX81 stops after 16 kBytes (at $8000),
;
;
; ---------------------------------------------------------------
; The Character Set
; ---------------------------------------------------------------
;
; $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F
; spc " gra gra gra gra gra gra gra gra gra gra £ $ : ?
;
; $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $1A $1B $1C $1D $1E $1F
; ( ) - + * / = > < ; , . 0 1 2 3
;
; $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $2A $2B $2C $2D $2E $2F
; 4 5 6 7 8 9 A B C D E F G H I J
;
; $30 $31 $32 $33 $34 $35 $36 $37 $38 $39 $3A $3B $3C $3D $3E $3F
; K L M N O P Q R S T U V W X Y Z
;
; ---------------------------------------------------------------
#target o ; output file is saved with filename extension ".o"
;#target 80 ; output file is saved with filename extension ".80"
#charset ZX80 ; enable character set translation for strings and character literals
; ---------------------------------------------------------------
; THE SYSTEM VARIABLES
; ---------------------------------------------------------------
;
; Note: the names of the system variables are taken from the original Nine Tiles Assembly Listing.
; Example values are taken AS AN EXAMPLE ONLY from Breakout (Macronics, 1980)
;
#code SYSVARS, 0x4000, 0x28
ERR_NR db $FF ; 1 16384 $4000 IY+$00 One less than report code.
FLAGS db $04 ; X1 16385 $4001 IY+$01 Various Flags to control BASIC System:
; 7 1-Syntax off 0-Syntax on
; 6 1-Numeric result 0-String result
; 5 1-Evaluating function (not used)
; 3 1-K cursor 0-L cursor
; 2 1-K mode 0-L mode.
; 0 1-No leading space 0-Leading space.
PPC dw $FFFE ; 2 16386 $4002 IY+$02 Line number of current line.
P_PTR dw $434A ; N2 16388 $4004 IY+$04 Position in RAM of [K] or [L] cursor.
E_PPC dw 0 ; 2 16390 $4006 IY+$06 Number of current line with [>] cursor.
VARS dw _VARS ; $4349 ; X2 16392 $4008 IY+$08 Address of start of variables area.
E_LINE dw end_of_file ; $434A ; X2 16394 $400A IY+$0A Address of start of Edit Line.
D_FILE dw end_of_file+2 ; $434C ; X2 16396 $400C IY+$0C Start of Display File.
DF_EA dw end_of_file+$242 ; $458C ; X2 16398 $400E IY+$0E Address of the start of lower screen.
DF_END dw end_of_file+$245 ; $458F ; X2 16400 $4010 IY+$10 Display File End.
DF_SZ db 2 ; X1 16402 $4012 IY+$12 Number of lines in lower screen.
S_TOP dw 0 ; 2 16403 $4013 IY+$13 The number of first line on screen.
X_PTR dw 0 ; 2 16405 $4015 IY+$15 Address of the character preceding the [S] marker.
OLDPPC dw 0 ; 2 16407 $4017 IY+$17 Line number to which continue jumps.
FLAGX db 0 ; N1 16409 $4019 IY+$19 More flags:
; 7 1-K mode 0-L mode.
; 6 1-Numeric result 0-String result
; 5 1-Inputting 0-Editing
T_ADDR dw $07A2 ; N2 16410 $401A IY+$1A Address of next item in syntax table.
SEED dw 0 ; U2 16412 $401C IY+$1C The seed for the random number.
FRAMES dw $7484 ; U2 16414 $401E IY+$1E Count of frames shown since start-up.
DEST dw $4733 ; N2 16416 $4020 IY+$20 Address of variable in statement.
RESULT dw $3800 ; N2 16418 $4022 IY+$22 Value of the last expression.
S_POSN_X db $21 ; X1 16420 $4024 IY+$24 Column number for print position.
S_POSN_Y db $17 ; X1 16421 $4025 IY+$25 Line number for print position.
CH_ADD dw $FFFF ; X2 16422 $4026 IY+$26 Address of next character to be interpreted.
#assert $ == $4028
; --------------------------------------
; BASIC code and variables, Machine code
; --------------------------------------
;
#code _BASIC
#code _VARS
;#code _DFILE
; The ZX80 stopped writing to tape at E_LINE (the edit line).
; So neither the edit line nor the display file are stored in the tape file.
#code _BASIC
; add code for Basic starter here
; add basic program and/or machine code here
; The machine code must be hidden somehow in the basic program or in the variables
#code _VARS
; add basic variables and/or machine code here
db 0x80 ; end marker for basic variables
end_of_file:
#end
| 46.630435 | 106 | 0.512199 |
325e59cd25963619d22a1dc5cb3b6bc61f314672 | 657 | asm | Assembly | programs/oeis/081/A081609.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/081/A081609.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/081/A081609.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A081609: Number of numbers <= n having at least one 1 in their ternary representation.
; 0,1,1,2,3,4,4,5,5,6,7,8,9,10,11,12,13,14,14,15,15,16,17,18,18,19,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,46,47,47,48,49,50,50,51,51,52,53,54,55,56,57,58,59,60,60,61
mov $18,$0
mov $20,$0
lpb $20,1
mov $0,$18
sub $20,1
sub $0,$20
mov $6,5
mov $10,8
lpb $10,1
lpb $0,1
lpb $8,10
gcd $0,8
mul $6,10
bin $6,2
mov $8,$0
sub $8,1
pow $10,$4
lpe
div $0,3
lpe
lpe
mov $0,$6
mul $0,5
mov $1,$0
div $1,6100
add $19,$1
lpe
mov $1,$19
| 20.53125 | 210 | 0.534247 |
e7e1f4dec9786ed7e9202eaf47a131c09564dae4 | 1,568 | asm | Assembly | programs/oeis/140/A140689.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/140/A140689.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/140/A140689.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A140689: a(n) = n*(3*n + 20).
; 0,23,52,87,128,175,228,287,352,423,500,583,672,767,868,975,1088,1207,1332,1463,1600,1743,1892,2047,2208,2375,2548,2727,2912,3103,3300,3503,3712,3927,4148,4375,4608,4847,5092,5343,5600,5863,6132,6407,6688,6975,7268,7567,7872,8183,8500,8823,9152,9487,9828,10175,10528,10887,11252,11623,12000,12383,12772,13167,13568,13975,14388,14807,15232,15663,16100,16543,16992,17447,17908,18375,18848,19327,19812,20303,20800,21303,21812,22327,22848,23375,23908,24447,24992,25543,26100,26663,27232,27807,28388,28975,29568,30167,30772,31383,32000,32623,33252,33887,34528,35175,35828,36487,37152,37823,38500,39183,39872,40567,41268,41975,42688,43407,44132,44863,45600,46343,47092,47847,48608,49375,50148,50927,51712,52503,53300,54103,54912,55727,56548,57375,58208,59047,59892,60743,61600,62463,63332,64207,65088,65975,66868,67767,68672,69583,70500,71423,72352,73287,74228,75175,76128,77087,78052,79023,80000,80983,81972,82967,83968,84975,85988,87007,88032,89063,90100,91143,92192,93247,94308,95375,96448,97527,98612,99703,100800,101903,103012,104127,105248,106375,107508,108647,109792,110943,112100,113263,114432,115607,116788,117975,119168,120367,121572,122783,124000,125223,126452,127687,128928,130175,131428,132687,133952,135223,136500,137783,139072,140367,141668,142975,144288,145607,146932,148263,149600,150943,152292,153647,155008,156375,157748,159127,160512,161903,163300,164703,166112,167527,168948,170375,171808,173247,174692,176143,177600,179063,180532,182007,183488,184975,186468,187967,189472,190983
mov $1,3
mul $1,$0
add $1,20
mul $1,$0
| 196 | 1,495 | 0.815689 |
99ff5716ae4a3de0ca2726d7a2a2160f6b3b2903 | 363 | asm | Assembly | programs/oeis/173/A173711.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/173/A173711.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/173/A173711.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A173711: Nonnegative integers, six even followed by two odd.
; 0,0,0,0,0,0,1,1,2,2,2,2,2,2,3,3,4,4,4,4,4,4,5,5,6,6,6,6,6,6,7,7,8,8,8,8,8,8,9,9,10,10,10,10,10,10,11,11,12,12,12,12,12,12,13,13,14,14,14,14,14,14,15,15,16,16,16,16,16,16,17,17,18,18,18,18,18,18,19,19,20,20,20,20,20,20,21,21,22,22,22,22,22,22,23,23,24,24,24,24
mul $0,6
div $0,16
mul $0,6
div $0,9
| 45.375 | 261 | 0.633609 |
a92dbe181d59b43b5d4c7d5a0538d1fe696d684b | 689 | asm | Assembly | oeis/046/A046175.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/046/A046175.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/046/A046175.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A046175: Indices of triangular numbers which are also pentagonal.
; Submitted by Jamie Morken(w2)
; 0,1,20,285,3976,55385,771420,10744501,149651600,2084377905,29031639076,404358569165,5631988329240,78443478040201,1092576704233580,15217630381229925,211954248632985376,2952141850480565345,41118031658094929460,572700301362848447101,7976686187421783329960,111100906322542118172345,1547436002328167871082876,21553003126271808076987925,300194607765477145206748080,4181171505590408224817485201,58236206470500238002238044740,811125719081412923806515141165,11297523860669280695288973931576
mul $0,2
sub $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
add $2,$3
add $3,$2
lpe
mov $0,$3
div $0,2
| 43.0625 | 483 | 0.847605 |
373af89a225b9049edbbafd3c582b86754fc798b | 1,806 | asm | Assembly | libsrc/graphics/generic_console/pixel6.asm | bahmanrafatjoo/z88dk | 001b7eab7fa2e94ee7210ff483c789e15e8d6a40 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/generic_console/pixel6.asm | bahmanrafatjoo/z88dk | 001b7eab7fa2e94ee7210ff483c789e15e8d6a40 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/generic_console/pixel6.asm | bahmanrafatjoo/z88dk | 001b7eab7fa2e94ee7210ff483c789e15e8d6a40 | [
"ClArtistic"
] | null | null | null | ;
; Generic pseudo graphics routines for text-only platforms
; Version for the 2x3 graphics symbols using generic console
;
INCLUDE "graphics/grafix.inc"
EXTERN textpixl
EXTERN div3
EXTERN generic_console_printc
EXTERN generic_console_vpeek
EXTERN generic_console_plotc
EXTERN generic_console_pointxy
ld a,h
cp maxx
ret nc
ld a,l
cp maxy
ret nc ; y0 out of range
push ix
push bc ;Save entry bc
ld ix,-4 ;ix + 0 = orig x
;ix + 1 = orig y
;ix + 2 = reduced x
;ix + 3 = reduced y
add ix,sp
ld sp,ix
ld (ix+0),h
ld (ix+1),l
ld c,h ; x
ld de,div3
ld h,0 ;l = y
add hl,de
ld b,(hl) ; y / 3
srl c ; x / 2
ld (ix+2),c
ld (ix+3),b
IF USEplotc
call generic_console_pointxy
ELSE
ld e,1 ;raw mode
call generic_console_vpeek
ENDIF
ld hl,textpixl
ld e,0
ld b,64 ; whole symbol table size
.ckmap cp (hl) ; compare symbol with the one in map
jr z,chfound
inc hl
inc e
djnz ckmap
ld e,0
chfound:
;Find the modulus of orig y /3
ld l,(ix+3)
ld a,(ix+1)
sub l
sub l
sub l
ld l,a
ld a,1 ;Pixel we want to draw
jr z,iszero
; Now values 1 or 2
bit 0,l
jr nz,is1
add a
add a
is1:
add a
add a
iszero:
bit 0,(ix+0) ;original x
jr z, evencol
add a
evencol:
IF NEEDplot
or e
ENDIF
IF NEEDunplot
cpl
and e
ENDIF
IF NEEDxor
xor e
ENDIF
IF NEEDpoint
and e
ELSE
ld hl,textpixl
ld d,0
ld e,a
add hl,de
ld a,(hl)
ld c,(ix+2)
ld b,(ix+3)
IF USEplotc
ld d,a
ld e,1 ;pixel6 mode
call generic_console_plotc
ELSE
ld d,a
ld e,1 ;raw mode
call generic_console_printc
ENDIF
ENDIF
pop bc ;dump buffer
pop bc
pop bc ;restore callers
pop ix ;restore callers
ret
| 15.176471 | 64 | 0.609081 |
55ce928fd06c1471d84be44bd72b75d05ac8b448 | 1,910 | asm | Assembly | programs/oeis/017/A017246.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/017/A017246.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/017/A017246.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A017246: a(n) = (9*n + 7)^2.
; 49,256,625,1156,1849,2704,3721,4900,6241,7744,9409,11236,13225,15376,17689,20164,22801,25600,28561,31684,34969,38416,42025,45796,49729,53824,58081,62500,67081,71824,76729,81796,87025,92416,97969,103684,109561,115600,121801,128164,134689,141376,148225,155236,162409,169744,177241,184900,192721,200704,208849,217156,225625,234256,243049,252004,261121,270400,279841,289444,299209,309136,319225,329476,339889,350464,361201,372100,383161,394384,405769,417316,429025,440896,452929,465124,477481,490000,502681,515524,528529,541696,555025,568516,582169,595984,609961,624100,638401,652864,667489,682276,697225,712336,727609,743044,758641,774400,790321,806404,822649,839056,855625,872356,889249,906304,923521,940900,958441,976144,994009,1012036,1030225,1048576,1067089,1085764,1104601,1123600,1142761,1162084,1181569,1201216,1221025,1240996,1261129,1281424,1301881,1322500,1343281,1364224,1385329,1406596,1428025,1449616,1471369,1493284,1515361,1537600,1560001,1582564,1605289,1628176,1651225,1674436,1697809,1721344,1745041,1768900,1792921,1817104,1841449,1865956,1890625,1915456,1940449,1965604,1990921,2016400,2042041,2067844,2093809,2119936,2146225,2172676,2199289,2226064,2253001,2280100,2307361,2334784,2362369,2390116,2418025,2446096,2474329,2502724,2531281,2560000,2588881,2617924,2647129,2676496,2706025,2735716,2765569,2795584,2825761,2856100,2886601,2917264,2948089,2979076,3010225,3041536,3073009,3104644,3136441,3168400,3200521,3232804,3265249,3297856,3330625,3363556,3396649,3429904,3463321,3496900,3530641,3564544,3598609,3632836,3667225,3701776,3736489,3771364,3806401,3841600,3876961,3912484,3948169,3984016,4020025,4056196,4092529,4129024,4165681,4202500,4239481,4276624,4313929,4351396,4389025,4426816,4464769,4502884,4541161,4579600,4618201,4656964,4695889,4734976,4774225,4813636,4853209,4892944,4932841,4972900,5013121,5053504
mul $0,9
add $0,7
pow $0,2
mov $1,$0
| 238.75 | 1,840 | 0.849215 |
68ed2be093686f7e1472f85c1fb5671f4dd4b35a | 294 | asm | Assembly | programs/oeis/173/A173512.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/173/A173512.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/173/A173512.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A173512: a(n) = 8*n + 4 + n mod 2.
; 4,13,20,29,36,45,52,61,68,77,84,93,100,109,116,125,132,141,148,157,164,173,180,189,196,205,212,221,228,237,244,253,260,269,276,285,292,301,308,317,324,333,340,349,356,365,372,381,388,397,404,413,420,429,436
mov $1,$0
mul $0,8
mod $1,2
add $0,$1
add $0,4
| 32.666667 | 208 | 0.659864 |
57b11aaec267c0cb65a318439afd3100ea50c646 | 450 | asm | Assembly | programs/oeis/138/A138330.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/138/A138330.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/138/A138330.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A138330: Beatty discrepancy (defined in A138253) giving the closeness of the pair (A136497,A136498) to the Beatty pair (A001951,A001952).
; 1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,2,1,1,1,1
mul $0,2
seq $0,289001 ; Fixed point of the mapping 00->0010, 01->001, 10->010, starting with 00.
add $0,1
| 64.285714 | 201 | 0.626667 |
f4d87063651ccb86c2dfec4e9bb44c27fbcf9fcf | 3,121 | asm | Assembly | WS3_ASM/Task_6.asm | OlegMalchenko/ACOS_WS_3 | a0a6d02b6dcd54b1a103a3da24de17251d934605 | [
"MIT"
] | null | null | null | WS3_ASM/Task_6.asm | OlegMalchenko/ACOS_WS_3 | a0a6d02b6dcd54b1a103a3da24de17251d934605 | [
"MIT"
] | null | null | null | WS3_ASM/Task_6.asm | OlegMalchenko/ACOS_WS_3 | a0a6d02b6dcd54b1a103a3da24de17251d934605 | [
"MIT"
] | null | null | null | #
# all *,/,%
# almost all these operations can be done without multiplication,
# division and remainder instructions, just by bit-shifts and bit addition (but that may be hard to implement).
# That is what I'm exactly going to implement (if possible).
# Output format: binary
#
.data
please:
.string "Please, input integer x: "
resulting:
.string "\nResults:"
valm_2:
.string "\nx * 2 : "
valm_3:
.string "\nx * 3 : "
valm_4:
.string "\nx * 4 : "
valm_5:
.string "\nx * 5 : "
valm_8:
.string "\nx * 8 : "
valm_31:
.string "\nx * 31: "
vald_2:
.string "\nx / 2 : "
vald_3:
.string "\nx / 3 : "
vald_5:
.string "\nx / 5 : "
vald_8:
.string "\nx / 8 : "
vald_31:
.string "\nx / 31: "
valr_2:
.string "\nx % 2 : "
valr_3:
.string "\nx % 3 : "
valr_5:
.string "\nx % 5 : "
valr_8:
.string "\nx % 8 : "
valr_31:
.string "\nx % 31: "
.text
main:
li a7, 4
la a0, please
ecall
#x.input()
li a7, 5
ecall
add t0, zero, a0
li a7, 4
la a0, resulting
ecall
## multiplication ##
li a7, 4
la a0, valm_2
ecall #decomposed: x * 2 = x * 010_2 = x * (2^1) = x << 1;
slli a0, t0, 1
li a7, 35
ecall
li a7, 4
la a0, valm_3
ecall #decomposed: x * 3 = x * 011_2 = x * (2^1 + 2^0) = x << 1 + x << 0;
slli t1, t0, 1
slli t2, t0, 0
add a0, t1, t2
li a7, 35
ecall
li a7, 4
la a0, valm_4
ecall #decomposed: x * 4 = x * 100_2 = x * (2^2) = x << 2;
slli a0, t0, 2
li a7, 35
ecall
li a7, 4
la a0, valm_5
ecall #decomposed: x * 5 = x * 101_2 = x * (2^2 + 2^0) = x << 2 + x << 0;
slli t1, t0, 2
slli t2, t0, 0
add a0, t1, t2
li a7, 35
ecall
li a7, 4
la a0, valm_8
ecall #decomposed: x * 8 = x * 1000_2 = x * (2^3) = x << 3;
slli a0, t0, 3
li a7, 35
ecall
li a7, 4
la a0, valm_31
ecall #decomposed: x * 31 = x * 11111_2 = x * (2^4 + 2^3 + 2^2 + 2^1 +2^0) = x << 4 + x << 3 + x << 2 + x << 1 + x << 0;
slli t1, t0, 4
slli t2, t0, 3
slli t3, t0, 2
slli t4, t0, 1
add t5, t1, t2
add t6, t3, t4
add t1, t5, t6
add a0, t1, t0
li a7, 35
ecall
## division ##
li a7, 4
la a0, vald_2
ecall #decomposed: x / 2 = x / 010_2 = x / (2^1) = x >> 1;
srli a0, t0, 1
li a7, 35
ecall
li a7, 4
la a0, vald_3
ecall
#division by non-power-of-two int is hard to implemet and too long, but we may try: 1.5 * (x/3) = x/2,
#yet we didn't consider floats, so i'd just use normal division;
li t1, 3
div a0, t0, t1
li a7, 35
ecall
li a7, 4
la a0, vald_5
ecall
li t1, 5
div a0, t0, t1
li a7, 35
ecall
li a7, 4
la a0, vald_8
ecall #decomposed: x / 8 = x >> 3;
srli a0, t0, 3
li a7, 35
ecall
li a7, 4
la a0, vald_31
ecall
li t1, 31
div a0, t0, t1
li a7, 35
ecall
## modulo ##
li a7, 4
la a0, valr_2
ecall #for such denominator y, that y = 2^n, x % y = x & (y - 1);
li t1, 1
and a0, t0, t1
li a7, 35
ecall
li a7, 4
la a0, valr_3
ecall
li t1, 3
rem a0, t0, t1
li a7, 35
ecall
li a7, 4
la a0, valr_5
ecall
li t1, 5
rem a0, t0, t1
li a7, 35
ecall
li a7, 4
la a0, valr_8
ecall
li t1, 7
and a0, t0, t1
li a7, 35
ecall
li a7, 4
la a0, valr_31
ecall
li t1, 31
rem a0, t0, t1
li a7, 35
ecall
| 15.374384 | 121 | 0.561999 |
ebe887f3b2b8145409c317af66d3614f9e74f898 | 656 | asm | Assembly | base/mvdm/dos/v86/cmd/command/envdata.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/dos/v86/cmd/command/envdata.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/dos/v86/cmd/command/envdata.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
; SCCSID = @(#)envdata.asm 1.1 85/05/14
; SCCSID = @(#)envdata.asm 1.1 85/05/14
; This file is included by command.asm and is used as the default command
; environment.
Environment Struc ; Default COMMAND environment
Env_PathString db "path="
db 0 ; Null path
Env_Comstring db "comspec="
Env_Ecomspec db "\command.com" ;AC062
db 134 dup (0)
Environment ends
ENVIRONSIZ equ SIZE Environment
ENVIRONSIZ2 equ SIZE Environment - Env_Ecomspec
| 28.521739 | 74 | 0.617378 |
362126969565a738b39d465f8146c24d0edac984 | 2,623 | asm | Assembly | data/tilesets/ice_path_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/tilesets/ice_path_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/tilesets/ice_path_collision.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 00
tilecoll WALL, WALL, WALL, WALL ; 01
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 02
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 03
tilecoll WALL, UP_WALL, WALL, FLOOR ; 04
tilecoll UP_WALL, UP_WALL, FLOOR, FLOOR ; 05
tilecoll UP_WALL, WALL, FLOOR, WALL ; 06
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 07
tilecoll WALL, FLOOR, WALL, FLOOR ; 08
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 09
tilecoll FLOOR, WALL, FLOOR, WALL ; 0a
tilecoll WALL, WALL, WALL, WALL ; 0b
tilecoll WALL, FLOOR, WALL, WALL ; 0c
tilecoll FLOOR, FLOOR, WALL, WALL ; 0d
tilecoll FLOOR, WALL, WALL, WALL ; 0e
tilecoll WALL, WALL, WALL, WALL ; 0f
tilecoll FLOOR, FLOOR, FLOOR, WALL ; 10
tilecoll FLOOR, FLOOR, WALL, FLOOR ; 11
tilecoll FLOOR, FLOOR, WALL, FLOOR ; 12
tilecoll FLOOR, FLOOR, WALL, CAVE ; 13
tilecoll WALL, WALL, WALL, FLOOR ; 14
tilecoll WALL, WALL, FLOOR, FLOOR ; 15
tilecoll WALL, WALL, FLOOR, WALL ; 16
tilecoll FLOOR, FLOOR, PIT, FLOOR ; 17
tilecoll WALL, FLOOR, WALL, FLOOR ; 18
tilecoll WALL, WALL, WALL, WALL ; 19
tilecoll FLOOR, WALL, FLOOR, WALL ; 1a
tilecoll FLOOR, PIT, FLOOR, FLOOR ; 1b
tilecoll WALL, FLOOR, WALL, WALL ; 1c
tilecoll FLOOR, FLOOR, WALL, WALL ; 1d
tilecoll FLOOR, WALL, WALL, WALL ; 1e
tilecoll ICE, ICE, ICE, ICE ; 1f
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 20
tilecoll FLOOR, FLOOR, WALL, FLOOR ; 21
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 22
tilecoll FLOOR, FLOOR, FLOOR, WALL ; 23
tilecoll WALL, HOP_DOWN_LEFT, WALL, WALL ; 24
tilecoll HOP_DOWN, HOP_DOWN, WALL, WALL ; 25
tilecoll HOP_DOWN_RIGHT, WALL, WALL, WALL ; 26
tilecoll WALL, HOP_LEFT, WALL, HOP_LEFT ; 27
tilecoll HOP_RIGHT, WALL, HOP_RIGHT, WALL ; 28
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, FLOOR ; 29
tilecoll WALL, WALL, WALL, WALL ; 2a
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 2b
tilecoll WALL, ICE, ICE, ICE ; 2c
tilecoll ICE, ICE, WALL, ICE ; 2d
tilecoll ICE, WALL, ICE, ICE ; 2e
tilecoll ICE, ICE, ICE, WALL ; 2f
tilecoll WALL, WALL, FLOOR, WALL ; 30
tilecoll WALL, WALL, WALL, WALL ; 31
tilecoll WALL, WALL, WALL, FLOOR ; 32
tilecoll WALL, WALL, FLOOR, FLOOR ; 33
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 34
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 35
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 36
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 37
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 38
tilecoll WALL, FLOOR, WALL, FLOOR ; 39
tilecoll FLOOR, WALL, FLOOR, WALL ; 3a
tilecoll WALL, WALL, WALL, WALL ; 3b
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 3c
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 3d
tilecoll FLOOR, FLOOR, WALL, WALL ; 3e
tilecoll ICE, ICE, ICE, LADDER ; 3f
| 40.353846 | 63 | 0.707205 |
66547bfaceafa75d3849a612e70a468e21b5c355 | 1,049 | asm | Assembly | programs/oeis/140/A140341.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/140/A140341.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/140/A140341.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A140341: The number of bits needed to write the universal code for an Elias delta coding, the simplest asymptotically optimal code.
; 1,4,4,5,5,5,5,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14
add $0,2
mul $0,4
sub $0,1
log $0,2
mul $0,2
mov $3,1
mov $4,$0
lpb $0
div $0,2
add $0,1
add $1,$4
mov $2,$3
sub $2,1
add $1,$2
mov $3,4
mov $4,1
lpe
sub $1,8
div $1,2
add $1,1
| 43.708333 | 720 | 0.642517 |
f744a1de22dfa6da781355fd0b9233301f39252e | 767 | asm | Assembly | xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.asm | danyalson-py/cryptoanalyst-mining | 3a0e52b329a1a80fbc7d8ad404144aafec44b722 | [
"Unlicense"
] | null | null | null | xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.asm | danyalson-py/cryptoanalyst-mining | 3a0e52b329a1a80fbc7d8ad404144aafec44b722 | [
"Unlicense"
] | null | null | null | xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.asm | danyalson-py/cryptoanalyst-mining | 3a0e52b329a1a80fbc7d8ad404144aafec44b722 | [
"Unlicense"
] | null | null | null | _TEXT_CNV8_MAINLOOP SEGMENT PAGE READ EXECUTE
PUBLIC cryptonight_v8_mainloop_ivybridge_asm
PUBLIC cryptonight_v8_mainloop_ryzen_asm
PUBLIC cryptonight_v8_double_mainloop_sandybridge_asm
ALIGN(64)
cryptonight_v8_mainloop_ivybridge_asm PROC
INCLUDE cryptonight_v8_main_loop_ivybridge_win64.inc
ret 0
mov eax, 3735929054
cryptonight_v8_mainloop_ivybridge_asm ENDP
ALIGN(64)
cryptonight_v8_mainloop_ryzen_asm PROC
INCLUDE cryptonight_v8_main_loop_ryzen_win64.inc
ret 0
mov eax, 3735929054
cryptonight_v8_mainloop_ryzen_asm ENDP
ALIGN(64)
cryptonight_v8_double_mainloop_sandybridge_asm PROC
INCLUDE cryptonight_v8_double_main_loop_sandybridge_win64.inc
ret 0
mov eax, 3735929054
cryptonight_v8_double_mainloop_sandybridge_asm ENDP
_TEXT_CNV8_MAINLOOP ENDS
END | 27.392857 | 62 | 0.90352 |
11e20ea118e7ef2c7e7e0365f01ef47843d060b3 | 623 | asm | Assembly | oeis/173/A173764.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/173/A173764.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/173/A173764.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A173764: (3*10^n+51)/9 for n>0.
; Submitted by Jon Maiga
; 9,39,339,3339,33339,333339,3333339,33333339,333333339,3333333339,33333333339,333333333339,3333333333339,33333333333339,333333333333339,3333333333333339,33333333333333339,333333333333333339,3333333333333333339,33333333333333333339,333333333333333333339,3333333333333333333339,33333333333333333333339,333333333333333333333339,3333333333333333333333339,33333333333333333333333339,333333333333333333333333339,3333333333333333333333333339,33333333333333333333333333339,333333333333333333333333333339
add $0,1
mov $2,10
pow $2,$0
mov $0,$2
div $0,9
add $0,2
mul $0,3
| 51.916667 | 496 | 0.865169 |
9938ccce5e8485682f8391d84817960581a3aa1f | 792 | asm | Assembly | oeis/248/A248533.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/248/A248533.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/248/A248533.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A248533: Number of length n+3 0..4 arrays with every four consecutive terms having the sum of some three elements equal to three times the fourth.
; 101,113,125,137,149,173,197,221,245,293,341,389,437,533,629,725,821,1013,1205,1397,1589,1973,2357,2741,3125,3893,4661,5429,6197,7733,9269,10805,12341,15413,18485,21557,24629,30773,36917,43061,49205,61493,73781,86069,98357,122933,147509,172085,196661,245813,294965,344117,393269,491573,589877,688181,786485,983093,1179701,1376309,1572917,1966133,2359349,2752565,3145781,3932213,4718645,5505077,6291509,7864373,9437237,11010101,12582965,15728693,18874421,22020149,25165877,31457333,37748789,44040245
lpb $0
mov $2,$0
lpb $2
sub $0,2
add $1,1
mod $2,4
lpe
sub $0,$2
add $1,$2
mul $1,2
lpe
mul $1,6
add $1,101
mov $0,$1
| 44 | 499 | 0.758838 |
40fcaebf40f615c94b363f2f93e0be5bee4c13c4 | 4,576 | asm | Assembly | third-party/gmp/gmp-src/mpn/x86_64/mod_1_2.asm | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | third-party/gmp/gmp-src/mpn/x86_64/mod_1_2.asm | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | third-party/gmp/gmp-src/mpn/x86_64/mod_1_2.asm | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl AMD64 mpn_mod_1s_2p
dnl Contributed to the GNU project by Torbjorn Granlund.
dnl Copyright 2009-2012, 2014 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
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 General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C AMD K8,K9 4
C AMD K10 4
C Intel P4 19
C Intel core2 8
C Intel NHM 6.5
C Intel SBR 4.5
C Intel atom 28
C VIA nano 8
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_mod_1s_2p)
FUNC_ENTRY(4)
push %r14
test $1, R8(%rsi)
mov %rdx, %r14
push %r13
mov %rcx, %r13
push %r12
push %rbp
push %rbx
mov 16(%rcx), %r10
mov 24(%rcx), %rbx
mov 32(%rcx), %rbp
je L(b0)
dec %rsi
je L(one)
mov -8(%rdi,%rsi,8), %rax
mul %r10
mov %rax, %r9
mov %rdx, %r8
mov (%rdi,%rsi,8), %rax
add -16(%rdi,%rsi,8), %r9
adc $0, %r8
mul %rbx
add %rax, %r9
adc %rdx, %r8
jmp L(11)
L(b0): mov -8(%rdi,%rsi,8), %r8
mov -16(%rdi,%rsi,8), %r9
L(11): sub $4, %rsi
jb L(ed2)
lea 40(%rdi,%rsi,8), %rdi
mov -40(%rdi), %r11
mov -32(%rdi), %rax
jmp L(m0)
ALIGN(16)
L(top): mov -24(%rdi), %r9
add %rax, %r11
mov -16(%rdi), %rax
adc %rdx, %r12
mul %r10
add %rax, %r9
mov %r11, %rax
mov %rdx, %r8
adc $0, %r8
mul %rbx
add %rax, %r9
mov %r12, %rax
adc %rdx, %r8
mul %rbp
sub $2, %rsi
jb L(ed1)
mov -40(%rdi), %r11
add %rax, %r9
mov -32(%rdi), %rax
adc %rdx, %r8
L(m0): mul %r10
add %rax, %r11
mov %r9, %rax
mov %rdx, %r12
adc $0, %r12
mul %rbx
add %rax, %r11
lea -32(%rdi), %rdi C ap -= 4
mov %r8, %rax
adc %rdx, %r12
mul %rbp
sub $2, %rsi
jae L(top)
L(ed0): mov %r11, %r9
mov %r12, %r8
L(ed1): add %rax, %r9
adc %rdx, %r8
L(ed2): mov 8(%r13), R32(%rdi) C cnt
mov %r8, %rax
mov %r9, %r8
mul %r10
add %rax, %r8
adc $0, %rdx
L(1): xor R32(%rcx), R32(%rcx)
mov %r8, %r9
sub R32(%rdi), R32(%rcx)
shr R8(%rcx), %r9
mov R32(%rdi), R32(%rcx)
sal R8(%rcx), %rdx
or %rdx, %r9
sal R8(%rcx), %r8
mov %r9, %rax
mulq (%r13)
mov %rax, %rsi
inc %r9
add %r8, %rsi
adc %r9, %rdx
imul %r14, %rdx
sub %rdx, %r8
lea (%r8,%r14), %rax
cmp %r8, %rsi
cmovc %rax, %r8
mov %r8, %rax
sub %r14, %rax
cmovc %r8, %rax
mov R32(%rdi), R32(%rcx)
shr R8(%rcx), %rax
pop %rbx
pop %rbp
pop %r12
pop %r13
pop %r14
FUNC_EXIT()
ret
L(one):
mov (%rdi), %r8
mov 8(%rcx), R32(%rdi)
xor %rdx, %rdx
jmp L(1)
EPILOGUE()
ALIGN(16)
PROLOGUE(mpn_mod_1s_2p_cps)
FUNC_ENTRY(2)
push %rbp
bsr %rsi, %rcx
push %rbx
mov %rdi, %rbx
push %r12
xor $63, R32(%rcx)
mov %rsi, %r12
mov R32(%rcx), R32(%rbp) C preserve cnt over call
sal R8(%rcx), %r12 C b << cnt
IFSTD(` mov %r12, %rdi ') C pass parameter
IFDOS(` mov %r12, %rcx ') C pass parameter
IFDOS(` sub $32, %rsp ')
ASSERT(nz, `test $15, %rsp')
CALL( mpn_invert_limb)
IFDOS(` add $32, %rsp ')
mov %r12, %r8
mov %rax, %r11
mov %rax, (%rbx) C store bi
mov %rbp, 8(%rbx) C store cnt
neg %r8
mov R32(%rbp), R32(%rcx)
mov $1, R32(%rsi)
ifdef(`SHLD_SLOW',`
shl R8(%rcx), %rsi
neg R32(%rcx)
mov %rax, %rbp
shr R8(%rcx), %rax
or %rax, %rsi
mov %rbp, %rax
neg R32(%rcx)
',`
shld R8(%rcx), %rax, %rsi C FIXME: Slow on Atom and Nano
')
imul %r8, %rsi
mul %rsi
add %rsi, %rdx
shr R8(%rcx), %rsi
mov %rsi, 16(%rbx) C store B1modb
not %rdx
imul %r12, %rdx
lea (%rdx,%r12), %rsi
cmp %rdx, %rax
cmovnc %rdx, %rsi
mov %r11, %rax
mul %rsi
add %rsi, %rdx
shr R8(%rcx), %rsi
mov %rsi, 24(%rbx) C store B2modb
not %rdx
imul %r12, %rdx
add %rdx, %r12
cmp %rdx, %rax
cmovnc %rdx, %r12
shr R8(%rcx), %r12
mov %r12, 32(%rbx) C store B3modb
pop %r12
pop %rbx
pop %rbp
FUNC_EXIT()
ret
EPILOGUE()
| 18.909091 | 79 | 0.626311 |
7e9b99bcc4d8eddcaa1eb41f284ba15f3c120e0d | 940 | asm | Assembly | PIC/FILO.asm | StxGuy/EmbeddedSystems | 6d9bc8b295724d361ea1d82e701e6530f74e2300 | [
"MIT"
] | null | null | null | PIC/FILO.asm | StxGuy/EmbeddedSystems | 6d9bc8b295724d361ea1d82e701e6530f74e2300 | [
"MIT"
] | null | null | null | PIC/FILO.asm | StxGuy/EmbeddedSystems | 6d9bc8b295724d361ea1d82e701e6530f74e2300 | [
"MIT"
] | null | null | null | ;-----------------------------;
; STACK/FILO FOR PIC ;
; ;
; Por: Prof. Carlo Requiao ;
; 03/Sep/2020 ;
;-----------------------------;
list p = 16f877a ; Specify processor
include <p16f877a.inc> ; Include mapping
tmp equ 0x20 ; byte to be tested
stack equ 0x21 ; counter
org 0x00 ; Program starts at 0x00
goto INICIO
INICIO: movlw 0x22 ; Initialize the stack
movwf stack
movlw 0x1A ; Push 0x1A and 0x1B
call PUSH
movlw 0x1B
call PUSH
nop
call POP
movwf tmp ; Store it in tmp for visualization
call POP
movwf tmp
goto FIM
PUSH: movwf tmp ; Store W
movf stack,0 ; Pointer to the stack
movwf FSR
movf tmp,0 ; Recover data to be stored
movwf INDF ; push data into stack
incf stack,1 ; stack ++
return
POP: decf stack,1 ; stack --
movf stack,0 ; Pointer to the stack
movwf FSR
movf INDF,0
return
FIM: nop
END
| 18.076923 | 47 | 0.582979 |
240df1c5de583e455bd29af02960f746ac5e7fef | 16,290 | asm | Assembly | fiat-amd64/90.44_ratio11062_seed2001410703584519_square_p521.asm | gares/fiat-crypto | edba07de3c424cb4d584044d3231afcaca67edd5 | [
"BSD-1-Clause",
"Apache-2.0",
"MIT-0",
"MIT"
] | 491 | 2015-11-25T23:44:39.000Z | 2022-03-29T17:31:21.000Z | fiat-amd64/90.44_ratio11062_seed2001410703584519_square_p521.asm | gares/fiat-crypto | edba07de3c424cb4d584044d3231afcaca67edd5 | [
"BSD-1-Clause",
"Apache-2.0",
"MIT-0",
"MIT"
] | 755 | 2016-02-02T14:03:05.000Z | 2022-03-31T16:47:23.000Z | fiat-amd64/90.44_ratio11062_seed2001410703584519_square_p521.asm | MaxMood96/fiat-crypto | 4fb49e91e5d50df4f6969ad5ae59dacdbd2ec8bb | [
"BSD-1-Clause",
"Apache-2.0",
"MIT-0",
"MIT"
] | 117 | 2015-10-25T16:28:15.000Z | 2022-02-08T23:01:09.000Z | SECTION .text
GLOBAL square_p521
square_p521:
sub rsp, 0x138 ; last 0x30 (6) for Caller - save regs
mov [ rsp + 0x108 ], rbx; saving to stack
mov [ rsp + 0x110 ], rbp; saving to stack
mov [ rsp + 0x118 ], r12; saving to stack
mov [ rsp + 0x120 ], r13; saving to stack
mov [ rsp + 0x128 ], r14; saving to stack
mov [ rsp + 0x130 ], r15; saving to stack
mov rax, [ rsi + 0x40 ]; load m64 x1 to register64
imul r10, rax, 0x2; x2 <- x1 * 0x2
mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx
mulx r11, rbx, [ rsi + 0x0 ]; x106, x105<- arg1[0] * arg1[0]
mov rbp, [ rsi + 0x30 ]; load m64 x7 to register64
imul r12, rbp, 0x2; x8 <- x7 * 0x2
imul r10, r10, 0x2; x10001 <- x2 * 0x2
imul r12, r12, 0x2; x10005 <- x8 * 0x2
mov r13, [ rsi + 0x28 ]; load m64 x10 to register64
imul r14, r13, 0x2; x11 <- x10 * 0x2
imul r14, r14, 0x2; x10007 <- x11 * 0x2
mov r15, [ rsi + 0x38 ]; load m64 x4 to register64
mov rdx, r10; x10001 to rdx
mulx r10, rcx, [ rsi + 0x8 ]; x74, x73<- arg1[1] * x10001
mov r8, rdx; preserving value of x10001 into a new reg
mov rdx, [ rsi + 0x18 ]; saving arg1[3] in rdx.
mov [ rsp + 0x0 ], rdi; spilling out1 to mem
mulx r9, rdi, r12; x52, x51<- arg1[3] * x10005
imul rdx, r15, 0x2; x5 <- x4 * 0x2
xchg rdx, r14; x10007, swapping with x5, which is currently in rdx
mov [ rsp + 0x8 ], rax; spilling x1 to mem
mulx rdx, rax, [ rsi + 0x20 ]; x44, x43<- arg1[4] * x10007
imul r14, r14, 0x2; x10003 <- x5 * 0x2
add rax, rdi; could be done better, if r0 has been u8 as well
adcx r9, rdx
mov rdx, r14; x10003 to rdx
mulx r14, rdi, [ rsi + 0x10 ]; x62, x61<- arg1[2] * x10003
add rax, rdi; could be done better, if r0 has been u8 as well
mov rdi, -0x2 ; moving imm to reg
inc rdi; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1)
adox rax, rcx
adcx r14, r9
seto cl; spill OF x116 to reg (rcx)
imul r9, [ rsi + 0x8 ], 0x2; x16 <- arg1[1] * 0x2
sar cl, 1
adcx r10, r14
xchg rdx, r8; x10001, swapping with x10003, which is currently in rdx
mulx rcx, r14, [ rsi + 0x10 ]; x60, x59<- arg1[2] * x10001
xchg rdx, r8; x10003, swapping with x10001, which is currently in rdx
mov [ rsp + 0x10 ], rbp; spilling x7 to mem
mulx rdi, rbp, [ rsi + 0x18 ]; x50, x49<- arg1[3] * x10003
mov [ rsp + 0x18 ], rcx; spilling x60 to mem
mov rcx, rdx; preserving value of x10003 into a new reg
mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx.
mov [ rsp + 0x20 ], rdi; spilling x50 to mem
mulx r9, rdi, r9; x104, x103<- arg1[0] * x16
adox rax, rbx
adox r11, r10
imul r13, r13, 0x2; x10006 <- x10 * 0x2
mov rdx, r12; x10005 to rdx
mulx r12, rbx, [ rsi + 0x20 ]; x42, x41<- arg1[4] * x10005
mov r10, rdx; preserving value of x10005 into a new reg
mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx.
mov [ rsp + 0x28 ], r15; spilling x4 to mem
mulx r13, r15, r13; x36, x35<- arg1[5] * x10006
mov rdx, rax; x123, copying x119 here, cause x119 is needed in a reg for other than x123, namely all: , x123, x125, size: 2
shrd rdx, r11, 58; x123 <- x121||x119 >> 58
test al, al
adox r15, rbx
adcx r15, rbp
adox r12, r13
mov rbp, -0x2 ; moving imm to reg
inc rbp; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1)
adox r15, r14
seto r14b; spill OF x247 to reg (r14)
inc rbp; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
adox r15, rdi
adcx r12, [ rsp + 0x20 ]
movzx r14, r14b
lea r12, [ r14 + r12 ]
mov r14, [ rsp + 0x18 ]
lea r12, [r14+r12]
clc;
adcx r15, rdx
adox r9, r12
mov rdx, [ rsi + 0x28 ]; arg1[5] to rdx
mulx r10, rdi, r10; x34, x33<- arg1[5] * x10005
mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx
mulx rbx, r13, r8; x48, x47<- arg1[3] * x10001
setc dl; spill CF x255 to reg (rdx)
shr r11, 58; x124 <- x121>> 58
sar dl, 1
adcx r11, r9
mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx
mulx r14, r12, [ rsi + 0x8 ]; x88, x87<- arg1[1] * arg1[1]
mov rdx, r15; x258, copying x254 here, cause x254 is needed in a reg for other than x258, namely all: , x260, x258, size: 2
shrd rdx, r11, 58; x258 <- x256||x254 >> 58
mov r9, rdx; preserving value of x258 into a new reg
mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx.
mov [ rsp + 0x30 ], r14; spilling x88 to mem
mulx rbp, r14, rcx; x40, x39<- arg1[4] * x10003
shr r11, 58; x259 <- x256>> 58
imul rdx, [ rsi + 0x10 ], 0x2; x15 <- arg1[2] * 0x2
test al, al
adox rdi, r14
adcx rdi, r13
mulx r13, r14, [ rsi + 0x0 ]; x102, x101<- arg1[0] * x15
xchg rdx, r8; x10001, swapping with x15, which is currently in rdx
mov [ rsp + 0x38 ], r11; spilling x259 to mem
mov [ rsp + 0x40 ], r13; spilling x102 to mem
mulx r11, r13, [ rsi + 0x20 ]; x38, x37<- arg1[4] * x10001
adox rbp, r10
adcx rbx, rbp
xor r10, r10
adox rdi, r12
xchg rdx, r8; x15, swapping with x10001, which is currently in rdx
mulx rdx, r12, [ rsi + 0x8 ]; x86, x85<- arg1[1] * x15
adox rbx, [ rsp + 0x30 ]
imul rbp, [ rsp + 0x10 ], 0x2; x10004 <- x7 * 0x2
mov [ rsp + 0x48 ], rdx; spilling x86 to mem
xor rdx, rdx
adox rdi, r14
adcx rdi, r9
mov r10, rdx; preserving value of 0x0 into a new reg
mov rdx, [ rsi + 0x30 ]; saving arg1[6] in rdx.
mulx rbp, r9, rbp; x28, x27<- arg1[6] * x10004
mov rdx, [ rsi + 0x28 ]; arg1[5] to rdx
mulx r14, r10, rcx; x32, x31<- arg1[5] * x10003
adox rbx, [ rsp + 0x40 ]
adcx rbx, [ rsp + 0x38 ]
add r9, r10; could be done better, if r0 has been u8 as well
adcx r14, rbp
imul rdx, [ rsi + 0x18 ], 0x2; x14 <- arg1[3] * 0x2
xor rbp, rbp
adox r9, r13
adox r11, r14
mov r13, rdi; x265, copying x261 here, cause x261 is needed in a reg for other than x265, namely all: , x265, x267, size: 2
shrd r13, rbx, 58; x265 <- x263||x261 >> 58
xor r10, r10
adox r9, r12
mulx rbp, r12, [ rsi + 0x0 ]; x100, x99<- arg1[0] * x14
adox r11, [ rsp + 0x48 ]
adcx r9, r12
adcx rbp, r11
mulx r14, r12, [ rsi + 0x8 ]; x84, x83<- arg1[1] * x14
shr rbx, 58; x266 <- x263>> 58
xchg rdx, r8; x10001, swapping with x14, which is currently in rdx
mulx r11, r10, [ rsi + 0x28 ]; x30, x29<- arg1[5] * x10001
test al, al
adox r9, r13
seto r13b; spill OF x269 to reg (r13)
mov [ rsp + 0x50 ], r14; spilling x84 to mem
imul r14, [ rsi + 0x20 ], 0x2; x13 <- arg1[4] * 0x2
sar r13b, 1
adcx rbx, rbp
mov rbp, rbx; x273, copying x270 here, cause x270 is needed in a reg for other than x273, namely all: , x273, x272, size: 2
shr rbp, 58; x273 <- x270>> 58
mov r13, rdx; preserving value of x10001 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mov [ rsp + 0x58 ], rax; spilling x119 to mem
mov [ rsp + 0x60 ], rbp; spilling x273 to mem
mulx rax, rbp, r14; x82, x81<- arg1[1] * x13
mov rdx, [ rsi + 0x30 ]; arg1[6] to rdx
mov [ rsp + 0x68 ], rax; spilling x82 to mem
mulx rcx, rax, rcx; x26, x25<- arg1[6] * x10003
mov rdx, r14; x13 to rdx
mov [ rsp + 0x70 ], rbp; spilling x81 to mem
mulx r14, rbp, [ rsi + 0x0 ]; x98, x97<- arg1[0] * x13
add rax, r10; could be done better, if r0 has been u8 as well
adcx r11, rcx
imul r10, [ rsi + 0x28 ], 0x2; x12 <- arg1[5] * 0x2
mov rcx, rdx; preserving value of x13 into a new reg
mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx.
mov [ rsp + 0x78 ], r14; spilling x98 to mem
mov [ rsp + 0x80 ], rbp; spilling x97 to mem
mulx r14, rbp, [ rsi + 0x10 ]; x72, x71<- arg1[2] * arg1[2]
mov rdx, r9; x272, copying x268 here, cause x268 is needed in a reg for other than x272, namely all: , x272, x274, size: 2
shrd rdx, rbx, 58; x272 <- x270||x268 >> 58
add rax, rbp; could be done better, if r0 has been u8 as well
xchg rdx, r8; x14, swapping with x272, which is currently in rdx
mulx rdx, rbx, [ rsi + 0x10 ]; x70, x69<- arg1[2] * x14
mov rbp, -0x2 ; moving imm to reg
inc rbp; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1)
adox rax, r12
adcx r14, r11
xchg rdx, r10; x12, swapping with x70, which is currently in rdx
mulx r12, r11, [ rsi + 0x0 ]; x96, x95<- arg1[0] * x12
clc;
adcx rax, [ rsp + 0x80 ]
adox r14, [ rsp + 0x50 ]
adcx r14, [ rsp + 0x78 ]
imul rbp, [ rsp + 0x28 ], 0x2; x10002 <- x4 * 0x2
mov [ rsp + 0x88 ], r12; spilling x96 to mem
xor r12, r12
adox rax, r8
mov r8, rdx; preserving value of x12 into a new reg
mov rdx, [ rsi + 0x30 ]; saving arg1[6] in rdx.
mov [ rsp + 0x90 ], r11; spilling x95 to mem
mulx r12, r11, r13; x24, x23<- arg1[6] * x10001
mov rdx, rbp; x10002 to rdx
mulx rdx, rbp, [ rsi + 0x38 ]; x22, x21<- arg1[7] * x10002
adox r14, [ rsp + 0x60 ]
mov [ rsp + 0x98 ], r10; spilling x70 to mem
mov r10, r14; x280, copying x277 here, cause x277 is needed in a reg for other than x280, namely all: , x279, x280, size: 2
shr r10, 58; x280 <- x277>> 58
add rbp, r11; could be done better, if r0 has been u8 as well
setc r11b; spill CF x175 to reg (r11)
mov [ rsp + 0xa0 ], r10; spilling x280 to mem
mov r10, rax; x279, copying x275 here, cause x275 is needed in a reg for other than x279, namely all: , x281, x279, size: 2
shrd r10, r14, 58; x279 <- x277||x275 >> 58
xor r14, r14
adox rbp, rbx
adcx rbp, [ rsp + 0x70 ]
movzx r11, r11b
lea r12, [ r12 + rdx ]
lea r12, [ r12 + r11 ]
adox r12, [ rsp + 0x98 ]
adcx r12, [ rsp + 0x68 ]
imul rbx, [ rsi + 0x30 ], 0x2; x9 <- arg1[6] * 0x2
mov rdx, r13; x10001 to rdx
mulx rdx, r13, [ rsi + 0x38 ]; x20, x19<- arg1[7] * x10001
xor r11, r11
adox rbp, [ rsp + 0x90 ]
adcx rbp, r10
adox r12, [ rsp + 0x88 ]
xchg rdx, rbx; x9, swapping with x20, which is currently in rdx
mulx r14, r10, [ rsi + 0x0 ]; x94, x93<- arg1[0] * x9
mov r11, rdx; preserving value of x9 into a new reg
mov rdx, [ rsi + 0x18 ]; saving arg1[3] in rdx.
mov [ rsp + 0xa8 ], r14; spilling x94 to mem
mov [ rsp + 0xb0 ], r10; spilling x93 to mem
mulx r14, r10, [ rsi + 0x18 ]; x58, x57<- arg1[3] * arg1[3]
mov rdx, -0x2 ; moving imm to reg
inc rdx; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1)
adox r13, r10
mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx
mov [ rsp + 0xb8 ], rbp; spilling x282 to mem
mulx r10, rbp, rcx; x68, x67<- arg1[2] * x13
setc dl; spill CF x283 to reg (rdx)
clc;
adcx r13, rbp
movzx rdx, dl
lea r12, [ rdx + r12 ]
mov rdx, [ rsp + 0xa0 ]
lea r12, [rdx+r12]
adox r14, rbx
mov rdx, r11; x9 to rdx
mulx r11, rbx, [ rsi + 0x8 ]; x78, x77<- arg1[1] * x9
adcx r10, r14
mov rbp, [ rsp + 0xb8 ]; load m64 x282 to register64
mov r14, rbp; x286, copying x282 here, cause x282 is needed in a reg for other than x286, namely all: , x288, x286, size: 2
shrd r14, r12, 58; x286 <- x284||x282 >> 58
mov [ rsp + 0xc0 ], r11; spilling x78 to mem
mov r11, 0x3ffffffffffffff ; moving imm to reg
and rdi, r11; x267 <- x261&0x3ffffffffffffff
mov r11, rdx; preserving value of x9 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mov [ rsp + 0xc8 ], rdi; spilling x267 to mem
mov [ rsp + 0xd0 ], r15; spilling x254 to mem
mulx rdi, r15, r8; x80, x79<- arg1[1] * x12
adox r13, r15
mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx
mov [ rsp + 0xd8 ], rbx; spilling x77 to mem
mulx r15, rbx, r8; x66, x65<- arg1[2] * x12
seto dl; spill OF x167 to reg (rdx)
shr r12, 58; x287 <- x284>> 58
sar dl, 1
adcx rdi, r10
imul r10, [ rsi + 0x38 ], 0x2; x6 <- arg1[7] * 0x2
add r13, [ rsp + 0xb0 ]; could be done better, if r0 has been u8 as well
setc dl; spill CF x171 to reg (rdx)
mov [ rsp + 0xe0 ], r15; spilling x66 to mem
imul r15, [ rsp + 0x8 ], 0x2; x10000 <- x1 * 0x2
sar dl, 1
adcx rdi, [ rsp + 0xa8 ]
mov rdx, [ rsi + 0x40 ]; arg1[8] to rdx
mov [ rsp + 0xe8 ], rbx; spilling x65 to mem
mulx r15, rbx, r15; x18, x17<- arg1[8] * x10000
mov rdx, rcx; x13 to rdx
mulx rdx, rcx, [ rsi + 0x18 ]; x56, x55<- arg1[3] * x13
adox rbx, rcx
clc;
adcx r13, r14
adcx r12, rdi
mov r14, rdx; preserving value of x56 into a new reg
mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx.
mulx rdi, rcx, r10; x92, x91<- arg1[0] * x6
clc;
adcx rbx, [ rsp + 0xe8 ]
adox r14, r15
setc dl; spill CF x147 to reg (rdx)
mov r15, r13; x293, copying x289 here, cause x289 is needed in a reg for other than x293, namely all: , x293, x295, size: 2
shrd r15, r12, 58; x293 <- x291||x289 >> 58
add rbx, [ rsp + 0xd8 ]; could be done better, if r0 has been u8 as well
movzx rdx, dl
lea r14, [ rdx + r14 ]
mov rdx, [ rsp + 0xe0 ]
lea r14, [rdx+r14]
adcx r14, [ rsp + 0xc0 ]
add rbx, rcx; could be done better, if r0 has been u8 as well
mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx
mulx r11, rcx, r11; x64, x63<- arg1[2] * x9
mov rdx, [ rsi + 0x20 ]; arg1[4] to rdx
mov [ rsp + 0xf0 ], r11; spilling x64 to mem
mov [ rsp + 0xf8 ], rcx; spilling x63 to mem
mulx r11, rcx, [ rsi + 0x20 ]; x46, x45<- arg1[4] * arg1[4]
adcx rdi, r14
shr r12, 58; x294 <- x291>> 58
add rbx, r15; could be done better, if r0 has been u8 as well
adcx r12, rdi
mov rdx, 0x3ffffffffffffff ; moving imm to reg
mov r15, rbx; x302, copying x296 here, cause x296 is needed in a reg for other than x302, namely all: , x300, x302, size: 2
and r15, rdx; x302 <- x296&0x3ffffffffffffff
xchg rdx, r8; x12, swapping with 0x3ffffffffffffff, which is currently in rdx
mulx rdx, r14, [ rsi + 0x18 ]; x54, x53<- arg1[3] * x12
imul rdi, [ rsi + 0x40 ], 0x2; x3 <- arg1[8] * 0x2
shrd rbx, r12, 58; x300 <- x298||x296 >> 58
test al, al
adox rcx, r14
mov r14, rdx; preserving value of x54 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mulx r10, r8, r10; x76, x75<- arg1[1] * x6
adcx rcx, [ rsp + 0xf8 ]
adox r14, r11
adcx r14, [ rsp + 0xf0 ]
mov rdx, rdi; x3 to rdx
mulx rdx, r11, [ rsi + 0x0 ]; x90, x89<- arg1[0] * x3
add rcx, r8; could be done better, if r0 has been u8 as well
mov r8, 0x3ffffffffffffff ; moving imm to reg
mov [ rsp + 0x100 ], r15; spilling x302 to mem
setc r15b; spill CF x135 to reg (r15)
and rbp, r8; x288 <- x282&0x3ffffffffffffff
adox rcx, r11
adcx rcx, rbx
movzx r15, r15b
lea r10, [ r10 + r14 ]
lea r10, [ r10 + r15 ]
setc bl; spill CF x304 to reg (rbx)
seto r14b; spill OF x139 to reg (r14)
shr r12, 58; x301 <- x298>> 58
sar r14b, 1
adcx rdx, r10
mov r11, [ rsp + 0x0 ]; load m64 out1 to register64
mov r15, [ rsp + 0x100 ]; TMP = x302
mov [ r11 + 0x38 ], r15; out1[7] = TMP
sar bl, 1
adcx r12, rdx
mov r15, [ rsp + 0xd0 ]; x260, copying x254 here, cause x254 is needed in a reg for other than x260, namely all: , x260, size: 1
and r15, r8; x260 <- x254&0x3ffffffffffffff
mov r14, r12; x308, copying x305 here, cause x305 is needed in a reg for other than x308, namely all: , x308, x307, size: 2
shr r14, 57; x308 <- x305>> 57
mov rbx, rcx; x307, copying x303 here, cause x303 is needed in a reg for other than x307, namely all: , x309, x307, size: 2
shrd rbx, r12, 57; x307 <- x305||x303 >> 57
mov r10, [ rsp + 0x58 ]; x125, copying x119 here, cause x119 is needed in a reg for other than x125, namely all: , x125, size: 1
and r10, r8; x125 <- x119&0x3ffffffffffffff
mov rdx, 0x1ffffffffffffff ; moving imm to reg
and rcx, rdx; x309 <- x303&0x1ffffffffffffff
adox rbx, r10
mov r12, 0x0 ; moving imm to reg
adox r14, r12
mov r10, rbx; x313, copying x310 here, cause x310 is needed in a reg for other than x313, namely all: , x313, x314, size: 2
shrd r10, r14, 58; x313 <- x312||x310 >> 58
mov [ r11 + 0x40 ], rcx; out1[8] = x309
and rbx, r8; x314 <- x310&0x3ffffffffffffff
lea r10, [ r10 + r15 ]
mov r15, r10; x317, copying x315 here, cause x315 is needed in a reg for other than x317, namely all: , x316, x317, size: 2
and r15, r8; x317 <- x315&0x3ffffffffffffff
shr r10, 58; x316 <- x315>> 58
and r13, r8; x295 <- x289&0x3ffffffffffffff
add r10, [ rsp + 0xc8 ]
and r9, r8; x274 <- x268&0x3ffffffffffffff
mov [ r11 + 0x30 ], r13; out1[6] = x295
mov [ r11 + 0x8 ], r15; out1[1] = x317
mov [ r11 + 0x18 ], r9; out1[3] = x274
and rax, r8; x281 <- x275&0x3ffffffffffffff
mov [ r11 + 0x10 ], r10; out1[2] = x318
mov [ r11 + 0x28 ], rbp; out1[5] = x288
mov [ r11 + 0x20 ], rax; out1[4] = x281
mov [ r11 + 0x0 ], rbx; out1[0] = x314
mov rbx, [ rsp + 0x108 ]; restoring from stack
mov rbp, [ rsp + 0x110 ]; restoring from stack
mov r12, [ rsp + 0x118 ]; restoring from stack
mov r13, [ rsp + 0x120 ]; restoring from stack
mov r14, [ rsp + 0x128 ]; restoring from stack
mov r15, [ rsp + 0x130 ]; restoring from stack
add rsp, 0x138
ret
; cpu AMD Ryzen 7 5800X 8-Core Processor
; clocked at 2200 MHz
; first cyclecount 121.41, best 87.78, lastGood 90.44
; seed 2001410703584519
; CC / CFLAGS clang / -march=native -mtune=native -O3
; time needed: 1224091 ms / 60000 runs=> 20.401516666666666ms/run
; Time spent for assembling and measureing (initial batch_size=97, initial num_batches=101): 142079 ms
; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.11606898506728666
; number reverted permutation/ tried permutation: 23138 / 29945 =77.268%
; number reverted decision/ tried decision: 21176 / 30056 =70.455% | 41.032746 | 128 | 0.654819 |