hexsha
stringlengths 40
40
| size
int64 6
1.05M
| ext
stringclasses 3
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 4
232
| max_stars_repo_name
stringlengths 7
106
| max_stars_repo_head_hexsha
stringlengths 40
40
| max_stars_repo_licenses
listlengths 1
7
| max_stars_count
int64 1
33.5k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 4
232
| max_issues_repo_name
stringlengths 7
106
| max_issues_repo_head_hexsha
stringlengths 40
40
| max_issues_repo_licenses
listlengths 1
7
| max_issues_count
int64 1
37.5k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 4
232
| max_forks_repo_name
stringlengths 7
106
| max_forks_repo_head_hexsha
stringlengths 40
40
| max_forks_repo_licenses
listlengths 1
7
| max_forks_count
int64 1
12.6k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 6
1.05M
| avg_line_length
float64 1.16
19.7k
| max_line_length
int64 2
938k
| alphanum_fraction
float64 0
1
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38186a1cc11a17f3c59db747a094c4ad29b07310
| 709
|
asm
|
Assembly
|
oeis/227/A227016.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/227/A227016.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/227/A227016.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A227016: Floor(M(g(n-1)+1,..,g(n))), where M = harmonic mean and g(n) = n(n + 1)(n + 2)/6.
; Submitted by Jamie Morken(s3.)
; 1,2,7,14,27,45,69,101,141,191,252,323,408,506,618,746,890,1052,1233,1432,1653,1895,2159,2447,2759,3097,3462,3853,4274,4724,5204,5716,6260,6838,7451,8098,8783,9505,10265,11065,11905,12787,13712,14679,15692,16750,17854,19006,20206,21456,22757,24108,25513,26971,28483,30051,31675,33357,35098,36897,38758,40680,42664,44712,46824,49002,51247,53558,55939,58389,60909,63501,66165,68903,71716,74603,77568,80610,83730,86930,90210,93572,97017,100544,104157,107855,111639,115511,119471,123521,127662,131893
mov $1,$0
add $0,2
mul $0,2
bin $0,3
sub $0,2
add $1,12
sub $0,$1
div $0,8
add $0,2
| 50.642857
| 497
| 0.736248
|
48b66b2dd6e89e9eaccc567ca69f75f70dfc083f
| 280
|
asm
|
Assembly
|
Working Disassembly/General/Title/Map - S3 ANDKnuckles.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
|
7e8a2c5df02271615ff4cae529521e6b1560d6b1
|
[
"Apache-2.0"
] | 5
|
2021-07-09T08:17:56.000Z
|
2022-02-27T19:57:47.000Z
|
Working Disassembly/General/Title/Map - S3 ANDKnuckles.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
|
7e8a2c5df02271615ff4cae529521e6b1560d6b1
|
[
"Apache-2.0"
] | null | null | null |
Working Disassembly/General/Title/Map - S3 ANDKnuckles.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
|
7e8a2c5df02271615ff4cae529521e6b1560d6b1
|
[
"Apache-2.0"
] | null | null | null |
dc.w word_49B0-Map_TitleANDKnuckles
word_49B0: dc.w 6
dc.b $F4, $E, 0, 0, $FF, $AC
dc.b $F4, $E, 0, $C, $FF, $CC
dc.b $F4, $E, 0, $18, $FF, $EC
dc.b $F4, $E, 0, $24, 0, $C
dc.b $F4, $E, 0, $30, 0, $2C
dc.b $F4, 2, 0, $3C, 0, $4C
| 31.111111
| 37
| 0.417857
|
575a3384a5b2548f0eeff0797a98d164cf60a7ad
| 14,270
|
asm
|
Assembly
|
source/features/string.asm
|
feliposz/FelipOS
|
9d50454d187a5a74a711c4b23a1653b5ece3df17
|
[
"MIT"
] | null | null | null |
source/features/string.asm
|
feliposz/FelipOS
|
9d50454d187a5a74a711c4b23a1653b5ece3df17
|
[
"MIT"
] | null | null | null |
source/features/string.asm
|
feliposz/FelipOS
|
9d50454d187a5a74a711c4b23a1653b5ece3df17
|
[
"MIT"
] | null | null | null |
; ==========================================================
; os_string_strincmp -- See if two strings match up to set number of chars
; IN: SI = string one, DI = string two, CL = chars to check
; OUT: carry set if same, clear if different
os_string_strincmp:
pusha
cld
.loop:
jz .equal
mov al, [si]
cmpsb
jne .not_equal
or al, al
jz .equal
loop .loop
.equal:
popa
stc
ret
.not_equal:
popa
clc
ret
; ==========================================================
; os_string_compare -- See if two strings match
; IN: SI = string one, DI = string two
; OUT: carry set if same, clear if different
os_string_compare:
pusha
cld
.loop:
mov al, [si]
cmpsb
jne .not_equal
or al, al
jnz .loop
.equal:
popa
stc
ret
.not_equal:
popa
clc
ret
; ==========================================================
; os_string_uppercase -- Convert zero-terminated string to upper case
; IN/OUT: AX = string location
os_string_uppercase:
pusha
mov si, ax
.loop:
mov al, [si]
or al, al
jz .done
cmp al, 'a'
jl .skip
cmp al, 'z'
jg .skip
sub ax, 'a' - 'A'
mov [si], al
.skip:
inc si
jmp .loop
.done:
popa
ret
; ==========================================================
; os_string_lowercase -- Convert zero-terminated string to lower case
; IN/OUT: AX = string location
os_string_lowercase:
pusha
mov si, ax
.loop:
mov al, [si]
or al, al
jz .done
cmp al, 'A'
jl .skip
cmp al, 'Z'
jg .skip
add al, 'a' - 'A'
mov [si], al
.skip:
inc si
jmp .loop
.done:
popa
ret
; ==========================================================
; os_string_chomp -- Strip leading and trailing spaces from a string
; IN: AX = string location
os_string_chomp:
pusha
cld
mov bx, ax
mov si, ax
mov di, ax
.scan_lead: ; skip all leading spaces
mov al, [si]
or al, al
jz .cut_trail
cmp al, ' '
jne .shift_left
inc si
jmp .scan_lead
.shift_left: ; move string to the left
mov al, [si]
or al, al
jz .done_shift
movsb
jmp .shift_left
.done_shift:
mov byte [di], 0 ; restore terminator
mov si, bx
mov di, bx
.scan_trail: ; scan for first space after non-space character
mov al, [si]
or al, al
jz .cut_trail
cmp al, ' '
je .is_space
mov di, si
inc di
.is_space:
inc si
jmp .scan_trail
.cut_trail:
mov byte [di], 0 ; place terminator after last non-space
.done:
popa
ret
; ==========================================================
; os_string_tokenize -- Reads tokens separated by specified char from a string. Returns pointer to next token, or 0 if none left
; IN: AL = separator char, SI = beginning
; OUT: DI = next token or 0 if none
os_string_tokenize:
push ax
push bx
push si
mov di, 0
.next:
mov bl, [si]
or bl, bl
jz .done
inc si
cmp bl, al
jne .next
.found:
mov di, si
.done:
pop si
pop bx
pop ax
ret
; ==========================================================
; os_set_time_fmt -- Set time reporting format (eg '10:25 AM' or '2300 hours')
; IN: AL = format flag, 0 = 12-hr format
os_set_time_fmt:
mov [time_fmt], al
ret
; ==========================================================
; os_set_date_fmt -- Set date reporting format (M/D/Y, D/M/Y or Y/M/D - 0, 1, 2)
; IN: AX = format flag, 0-2
; If AX bit 7 = 1 = use name for months
; If AX bit 7 = 0, high byte = separator character
os_set_date_fmt:
push ax
test ax, 1<<7
jnz .no_sep
mov byte [date_mon], 0
mov [date_sep], ah
jmp .sep
.no_sep:
mov byte [date_mon], 1
mov byte [date_sep], ' '
.sep:
and al, 3
mov [date_fmt], al
pop ax
ret
; ==========================================================
; os_get_time_string -- Get current time in a string (eg '10:25')
; IN/OUT: BX = string location
os_get_time_string:
pusha
.retry:
mov ah, 2
int 1ah
jc .retry
; CH = hours in BCD
; CL = minutes in BCD
; DH = seconds in BCD
; DL = 1 if daylight savings time option
mov al, [time_fmt]
or al, al
jz .12hour_fmt
jmp .24hour_fmt
.12hour_fmt:
mov ah, 0
cmp ch, 0
je .midnight
cmp ch, 24h
je .midnight
cmp ch, 12h
je .noon
ja .pm
jmp .12hour_out
.noon:
mov ah, 1
.midnight:
mov ch, 12h
jmp .12hour_out
.pm:
mov ah, 1
mov al, ch
sub al, 12h
das
mov ch, al
.12hour_out:
mov al, ch
shr al, 4
add al, '0'
mov [bx], al
mov al, ch
and al, 0fh
add al, '0'
mov [bx+1], al
mov byte [bx+2], ':'
mov al, cl
shr al, 4
add al, '0'
mov [bx+3], al
mov al, cl
and al, 0fh
add al, '0'
mov [bx+4], al
mov byte [bx+5], ' '
mov byte [bx+6], 'a'
mov byte [bx+7], 'm'
or ah, ah
jz .am
mov byte [bx+6], 'p'
.am:
mov byte [bx+8], 0
popa
ret
.24hour_fmt:
mov al, ch
shr al, 4
add al, '0'
mov [bx], al
mov al, ch
and al, 0fh
add al, '0'
mov [bx+1], al
mov al, cl
shr al, 4
add al, '0'
mov [bx+2], al
mov al, cl
and al, 0fh
add al, '0'
mov [bx+3], al
mov byte [bx+4], ' '
mov byte [bx+5], 'h'
mov byte [bx+6], 'o'
mov byte [bx+7], 'u'
mov byte [bx+8], 'r'
mov byte [bx+9], 's'
mov byte [bx+10], 0
popa
ret
; ==========================================================
; os_get_date_string -- Get current date in a string (eg '12/31/2007')
; IN/OUT: BX = string location
os_get_date_string:
pusha
mov di, bx
.retry:
mov ah, 4
int 1ah
jc .retry
; CH century, in BCD (19H ... 20H)
; CL year, in BCD (00H ... 99H)
; DH month, in BCD (i.e., 01H=Jan ... 12H=Dec)
; DL day, in BCD (00H ... 31H)
cmp byte [date_fmt], 0
jne .not0
call .month
call .sep
call .day
call .sep
call .year
jmp .done
.not0:
cmp byte [date_fmt], 1
jne .not1
call .day
call .sep
call .month
call .sep
call .year
jmp .done
.not1:
call .year
call .sep
call .month
call .sep
call .day
.done:
mov byte [di], 0
popa
ret
.sep:
mov al, [date_sep]
stosb
ret
.year:
mov al, ch
shr al, 4
add al, '0'
stosb
mov al, ch
and al, 0fh
add al, '0'
stosb
mov al, cl
shr al, 4
add al, '0'
stosb
mov al, cl
and al, 0fh
add al, '0'
stosb
ret
.month:
mov al, [date_mon]
or al, al
jnz .month_name
mov al, dh
shr al, 4
or al, al
add al, '0'
stosb
mov al, dh
and al, 0fh
add al, '0'
stosb
ret
.month_name:
push cx
push dx
mov al, dh
call os_bcd_to_int
dec ax
mov cx, 3
mul cx
mov si, month_name
add si, ax
rep movsb
pop dx
pop cx
ret
.day:
mov al, dl
shr al, 4
add al, '0'
stosb
mov al, dl
and al, 0fh
add al, '0'
stosb
ret
; ==========================================================
; os_int_to_string -- Convert unsigned integer to string
; IN: AX = unsigned int
; OUT: AX = string location
os_int_to_string:
pusha
mov di, int_string
or ax, ax
jnz .not_zero
mov dx, '0'
mov cx, 1
push dx
jmp .pop_digits
.not_zero:
mov bx, 10
mov cx, 0
.push_digits:
xor dx, dx
or ax, ax
jz .pop_digits
div bx
add dl, '0'
push dx
inc cx
jmp .push_digits
.pop_digits:
pop dx
mov [di], dl
inc di
dec cx
or cx, cx
jnz .pop_digits
.done:
mov byte [di], 0
popa
mov ax, int_string
ret
; ==========================================================
; os_sint_to_string -- Convert signed integer to string
; IN: AX = signed int
; OUT: AX = string location
os_sint_to_string:
cmp ax, 0
jl .negative
call os_int_to_string
ret
.negative:
neg ax
call os_int_to_string
mov ax, neg_string
ret
; ==========================================================
; os_long_int_to_string -- Convert value in DX:AX to string
; IN: DX:AX = long unsigned integer, BX = number base, DI = string location
; OUT: DI = location of converted string
os_long_int_to_string:
pusha
mov bp, di
mov byte [di], 0
cmp bx, 37
ja .done
cmp bx, 0
je .done
.conversion: ; divide dx:ax (32-bit) by bx (base)
mov cx, 0
xchg ax, cx
xchg ax, dx
div bx
xchg ax, cx
div bx
xchg cx, dx ; cx = remainder, dx:ax = quotient
; digits will be added in reverse order
cmp cx, 9
jle .is_digit
add cx, 'A'-10
jmp .not_digit
.is_digit:
add cx, '0'
.not_digit:
mov [di], cl
inc di
mov cx, dx
or cx, ax
jnz .conversion
mov al, 0 ; add nul terminator
stosb
mov si, bp
call os_string_reverse
.done:
popa
ret
; ==========================================================
; os_string_reverse -- Reverse the characters in a string
; IN: SI = string location
os_string_reverse:
pusha
; point DI to last char
mov di, si
.advance:
cmp byte [di], 0
jz .end_reached
inc di
jmp .advance
.end_reached:
dec di
; swap SI and DI, move SI left and DI right
.reverse_loop:
cmp si, di
jae .done
mov al, [si]
mov bl, [di]
mov [si], bl
mov [di], al
inc si
dec di
jmp .reverse_loop
.done:
popa
ret
; ==========================================================
; os_string_copy -- Copy one string into another
; IN/OUT: SI = source, DI = destination (programmer ensure sufficient room)
os_string_copy:
cld
push ax
push si
push di
.loop:
mov al, [si]
movsb
or al, al
jnz .loop
pop di
pop si
pop ax
ret
; os_string_join -- Join two strings into a third string
; IN/OUT: AX = string one, BX = string two, CX = destination string
os_string_join:
cld
push ax
push si
push di
mov si, ax
mov di, cx
.loop_a:
mov al, [si]
movsb
or al, al
jnz .loop_a
dec di
mov si, bx
.loop_b:
mov al, [si]
movsb
or al, al
jnz .loop_b
pop di
pop si
pop ax
ret
; ==========================================================
; os_string_length -- Return length of a string
; IN: AX = string location
; OUT AX = length (other regs preserved)
os_string_length:
cld
push cx
push si
mov si, ax
xor cx, cx
.loop:
lodsb
or al, al
jz .end
inc cx
jmp .loop
.end:
mov ax, cx
pop si
pop cx
ret
; ==========================================================
; os_find_char_in_string -- Find location of character in a string
; IN: SI = string location, AL = character to find
; OUT: AX = location in string, or 0 if char not present
os_find_char_in_string:
push cx
push dx
push si
mov dl, al
xor cx, cx
.loop:
lodsb
or al, al
jz .not_found
inc cx
cmp al, dl
je .found
jmp .loop
.not_found:
xor cx, cx
.found:
mov ax, cx
pop si
pop dx
pop cx
ret
; ==========================================================
; os_string_charchange -- Change instances of character in a string
; IN: SI = string, AL = char to find, BL = char to replace with
os_string_charchange:
push dx
push si
.loop:
mov dl, [si]
or dl, dl
jz .done
cmp dl, al
jne .next
mov [si], bl
.next:
inc si
jmp .loop
.done:
pop si
pop dx
ret
; ==========================================================
; os_string_truncate -- Chop string down to specified number of characters
; IN: SI = string location, AX = number of characters
; OUT: String modified, registers preserved
os_string_truncate:
push ax
push bx
push si
mov bx, ax
mov ax, si
call os_string_length
cmp bx, ax
jge .done
mov byte [si+bx], 0
.done:
pop si
pop bx
pop ax
ret
; ==========================================================
; os_string_strip -- Removes specified character from a string (max 255 chars)
; IN: SI = string location, AL = character to remove
os_string_strip:
push si
push di
push bx
mov di, si
.loop:
mov bl, [si]
mov [di], bl
cmp bl, al
je .skip
inc di
.skip:
inc si
cmp bl, 0
jne .loop
.done:
pop bx
pop di
pop si
ret
; ==========================================================
; os_string_parse -- Take string (eg "run foo bar baz") and return pointers to zero-terminated strings (eg AX = "run", BX = "foo" etc.)
; IN: SI = string
; OUT: AX, BX, CX, DX = individual strings
os_string_parse:
push si
mov ax, si
mov bx, 0
mov cx, 0
mov dx, 0
.loop_bx:
cmp byte [si], 0
jz .done
cmp byte [si], ' '
je .end_bx
inc si
jmp .loop_bx
.end_bx:
mov byte [si], 0
inc si
mov bx, si
.loop_cx:
cmp byte [si], 0
jz .done
cmp byte [si], ' '
je .end_cx
inc si
jmp .loop_cx
.end_cx:
mov byte [si], 0
inc si
mov cx, si
.loop_dx:
cmp byte [si], 0
jz .done
cmp byte [si], ' '
je .end_dx
inc si
jmp .loop_dx
.end_dx:
mov byte [si], 0
inc si
mov dx, si
.done:
pop si
ret
; ==========================================================
; os_string_to_int -- Convert decimal string to integer value
; IN: SI = string location (max 5 chars, up to '65536')
; OUT: AX = number
os_string_to_int:
push bx
push cx
push dx
push si
push di
mov cx, 5
mov bx, 10
xor di, di
.next_digit:
xor ax, ax
lodsb
cmp al, '0'
jb .done
cmp al, '9'
ja .done
sub al, '0'
xchg ax, di
mul bx
add ax, di
xchg ax, di
loop .next_digit
.done:
xchg ax, di
pop di
pop si
pop dx
pop cx
pop bx
ret
time_fmt db 0
date_fmt db 0
date_mon db 0
date_sep db '/'
month_name db 'JanFebMarAprMayJunJulAugSepOctNovDec'
neg_string db '-'
int_string times 7 db 0
long_string times 33 db 0
| 17.904642
| 135
| 0.513945
|
266617bfdf933fd0fba777f5195fe7bab1eed5ee
| 483
|
asm
|
Assembly
|
oeis/145/A145603.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/145/A145603.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/145/A145603.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A145603: a(n) is the number of walks from (0,0) to (0,4) that remain in the upper half-plane y >= 0 using 2*n +2 unit steps either up (U), down (D), left (L) or right (R).
; Submitted by Jon Maiga
; 1,35,720,12375,196625,3006003,45048640,668144880,9859090500,145173803500,2136958387520,31479019635375,464342770607625,6861343701121875,101583106970400000,1507019252941540800
mov $1,$0
mov $2,5
add $2,$0
add $0,$2
bin $0,$1
mul $0,10
pow $0,2
add $2,$1
div $0,$2
mul $0,2
div $0,40
| 30.1875
| 175
| 0.716356
|
e0e1d6ee7598b0698f63d1e7293460779f4e8b21
| 445
|
asm
|
Assembly
|
programs/oeis/090/A090390.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/090/A090390.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/090/A090390.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A090390: Repeatedly multiply (1,0,0) by ([1,2,2],[2,1,2],[2,2,3]); sequence gives leading entry.
; 1,1,9,49,289,1681,9801,57121,332929,1940449,11309769,65918161,384199201,2239277041,13051463049,76069501249,443365544449,2584123765441,15061377048201,87784138523761,511643454094369,2982076586042449,17380816062160329
mov $1,1
lpb $0,1
sub $0,1
mov $3,$2
add $2,$1
mov $1,$3
add $1,$2
lpe
mul $1,4
pow $1,2
div $1,128
mul $1,8
add $1,1
| 26.176471
| 216
| 0.721348
|
dac6dbaac0f1739bff1960431f89bc717a99aa52
| 414
|
asm
|
Assembly
|
Source/Common/Header.asm
|
xragey/qsmw
|
522c661ccc874ab7b58230ee4dfb3160cf5028d9
|
[
"MIT"
] | null | null | null |
Source/Common/Header.asm
|
xragey/qsmw
|
522c661ccc874ab7b58230ee4dfb3160cf5028d9
|
[
"MIT"
] | null | null | null |
Source/Common/Header.asm
|
xragey/qsmw
|
522c661ccc874ab7b58230ee4dfb3160cf5028d9
|
[
"MIT"
] | 1
|
2020-09-20T15:36:48.000Z
|
2020-09-20T15:36:48.000Z
|
;-------------------------------------------------------------------------------
;
; qSMW - Common/Header.asm
;
;-------------------------------------------------------------------------------
@asar 1.71
if read1($00FFD5) == $23
sa1rom
!sa1 = 1
!fast = 0
!dptr = $3000
!addr = $6000
!bank = $00
!long = $000000
else
!sa1 = 0
!fast = 1
!dptr = $0000
!addr = $0000
!bank = $80
!long = $800000
endif
| 16.56
| 80
| 0.333333
|
f1019284bb86b57f96a47ed32d55ca4a295824f3
| 510
|
asm
|
Assembly
|
oeis/143/A143370.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/143/A143370.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/143/A143370.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A143370: Triangle read by rows: T(n,k) is the number of unordered pairs of vertices at distance k in the grid P_2 x P_n (1 <= k <= n). P_m is the path graph on m vertices.
; Submitted by Christian Krause
; 1,4,2,7,6,2,10,10,6,2,13,14,10,6,2,16,18,14,10,6,2,19,22,18,14,10,6,2,22,26,22,18,14,10,6,2,25,30,26,22,18,14,10,6,2,28,34,30,26,22,18,14,10,6,2,31,38,34,30,26,22,18,14,10,6,2,34,42,38,34,30,26,22,18,14,10,6,2
lpb $0
add $1,1
sub $0,$1
lpe
sub $1,$0
min $0,1
add $0,3
mul $1,$0
add $0,$1
sub $0,2
| 34
| 211
| 0.643137
|
5b967c6ad55d19257f3be52cdd1192f79bf7e1bf
| 743
|
asm
|
Assembly
|
examples/draw.asm
|
goakes007/zx-spectrum-utils
|
aa6abcd8cecfeff8ebb2419e872e77410a56f6e3
|
[
"MIT"
] | 5
|
2022-02-14T10:37:35.000Z
|
2022-03-07T07:23:36.000Z
|
examples/draw.asm
|
goakes007/zx-spectrum-utils
|
aa6abcd8cecfeff8ebb2419e872e77410a56f6e3
|
[
"MIT"
] | 1
|
2022-02-20T19:08:18.000Z
|
2022-02-20T19:08:18.000Z
|
examples/draw.asm
|
goakes007/zx-spectrum-utils
|
aa6abcd8cecfeff8ebb2419e872e77410a56f6e3
|
[
"MIT"
] | null | null | null |
DEVICE ZXSPECTRUM48 ; Select 48k spectrum as output device
ORG $8000 ; Start the output to $8000 memory address
main: ; Just a label - so that the savesna works
SCREEN_COLOUR equ BgYellow + FgBlue
include helper.asm
include colour.asm
SET_SCREEN_COLOUR SCREEN_COLOUR
SET_BORDER_COLOUR SCREEN_COLOUR/8
DRAW2 $8080, $9090
DRAW1 120,120,140,150
PLOT1 190,30
PLOT1 190,31
PLOT1 190,33
MAX equ 190
STEP equ 10
ld h,160
ld l,0
ld d,0
_FOR e, 0,MAX+STEP,STEP
ld a,MAX
sub e
ld h,a
DRAW2 hl, de
_END_FOR e
.l1 jr .l1
SAVESNA "draw.sna", main
| 21.228571
| 82
| 0.554509
|
b607d01134fc38b5aa63c9b1c8e0556ec76efab2
| 703
|
asm
|
Assembly
|
oeis/035/A035101.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/035/A035101.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/035/A035101.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A035101: E.g.f. x*(c(x/2)-1)/(1-2*x), where c(x) = g.f. for Catalan numbers A000108.
; Submitted by Jamie Morken(s1)
; 0,1,9,87,975,12645,187425,3133935,58437855,1203216525,27125492625,664761133575,17600023616175,500706514833525,15234653491682625,493699195087473375,16977671416936605375,617528830880480644125,23687738668934964248625,955710341290036461504375,40459665320954409153999375,1793338344579681991379413125,83057425880345955113400950625,4012130233592232103390903239375,201799079872386039293085069609375,10551987994810021315293879094078125,572787579633484461900595700274140625
mov $1,1
mov $2,1
lpb $0
sub $0,1
add $2,1
mul $1,$2
add $2,1
mul $3,$2
add $3,$1
lpe
mov $0,$3
div $0,2
| 41.352941
| 465
| 0.809388
|
28f6d056ba7eec17782aabb8518f8e90c82ff63c
| 1,163
|
asm
|
Assembly
|
scripts/FuchsiaGoodRodHouse.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | 1
|
2022-02-15T00:19:44.000Z
|
2022-02-15T00:19:44.000Z
|
scripts/FuchsiaGoodRodHouse.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
scripts/FuchsiaGoodRodHouse.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
FuchsiaGoodRodHouse_Script:
jp EnableAutoTextBoxDrawing
FuchsiaGoodRodHouse_TextPointers:
dw FuchsiaHouse3Text1
FuchsiaHouse3Text1:
text_asm
ld a, [wd728]
bit 4, a ; got good rod?
jr nz, .got_item
ld hl, FuchsiaHouse3Text_561bd
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jr nz, .refused
lb bc, GOOD_ROD, 1
call GiveItem
jr nc, .bag_full
ld hl, wd728
set 4, [hl] ; got good rod
ld hl, FuchsiaHouse3Text_561c2
jr .done
.bag_full
ld hl, FuchsiaHouse3Text_5621c
jr .done
.refused
ld hl, FuchsiaHouse3Text_56212
jr .done
.got_item
ld hl, FuchsiaHouse3Text_56217
.done
call PrintText
jp TextScriptEnd
FuchsiaHouse3Text_561bd:
text_far _FuchsiaHouse3Text_561bd
text_end
FuchsiaHouse3Text_561c2:
text_far _FuchsiaHouse3Text_561c2
sound_get_item_1
text_end
UnusedText_561c8:
para "つり こそ"
line "おとこの ロマン だ!"
para "へぼいつりざおは"
line "コイキングしか つれ なんだが"
line "この いいつりざおなら"
line "もっと いいもんが つれるんじゃ!"
done
FuchsiaHouse3Text_56212:
text_far _FuchsiaHouse3Text_56212
text_end
FuchsiaHouse3Text_56217:
text_far _FuchsiaHouse3Text_56217
text_end
FuchsiaHouse3Text_5621c:
text_far _FuchsiaHouse3Text_5621c
text_end
| 17.358209
| 34
| 0.798796
|
46ba920c22e426099bfcc14dd2737e6a80bb1a15
| 2,890
|
asm
|
Assembly
|
src/prime.asm
|
Platinum-Phoenix/assembly
|
c0e647f46b6998af8b8e1ea81778b19a8001abb5
|
[
"MIT"
] | 6
|
2021-04-07T18:11:46.000Z
|
2021-06-12T19:27:46.000Z
|
src/prime.asm
|
plat-phoenix/assembly
|
c0e647f46b6998af8b8e1ea81778b19a8001abb5
|
[
"MIT"
] | null | null | null |
src/prime.asm
|
plat-phoenix/assembly
|
c0e647f46b6998af8b8e1ea81778b19a8001abb5
|
[
"MIT"
] | 1
|
2021-04-07T18:11:53.000Z
|
2021-04-07T18:11:53.000Z
|
;-----------------------------------------------------------
; src/prime.asm
; Usage: prime <n>
; Generates the <n>th prime number and all previous
; prime numbers
; TODO: Create an output buffer
%include "lib.inc"
%include "io.inc"
global _start
default rel
section .data
begin_text: db "Generating ", 0
end_text: db " prime(s)", 0
usage_text: db "Usage: prime <n>", 0
section .text
;----------------------
; bool is_prime(i64 num)
; using 6k+/-1 method
is_prime:
push r8
push r9
; if (num <= 3 && num != 1) return true
cmp rdi, 3 ; all numbers less than 3 (except one) are prime
jg .gt3
cmp rdi, 1 ; one is not a prime number
je .not_prime
jmp .is_a_prime
.gt3:
; num/2
xor rdx, rdx
mov rax, rdi
mov rsi, 2
div rsi
cmp rdx, 0 ; rdx contains the remainder
jz .not_prime
; num/3
xor rdx, rdx
mov rax, rdi
mov rsi, 3
div rsi
cmp rdx, 0 ; rdx contains the remainder
jz .not_prime
mov r8, 5
.loop:
; r8 * r8
mov rax, r8
mul r8
cmp rax, rdi
jge .is_a_prime
xor rdx, rdx
mov rax, rdi
div r8
cmp rdx, 0
jz .not_prime
xor rdx, rdx
mov r9, r8
add r9, 2
mov rax, rdi
div r9
cmp rdx, 0
jz .not_prime
add r8, 6
jmp .loop
.is_a_prime:
xor eax, eax
pop r9
pop r8
ret
.not_prime:
mov rax, 1
pop r9
pop r8
ret
_start:
; if rcx != 2 { usage() }
pop rcx
cmp rcx, 2
jne .usage
pop rdx ; discard program name
; max_primes (r8) = argv[1]
pop rdi
call atoi
cmp rax, 0 ; don't generate 0 primes
jz .usage
mov r8, rax
; printf("Generating %d primes", atoi(argv[1]))
lea rdi, [begin_text]
call print
mov rdi, r8 ; primes to generate
call iprint
lea rdi, [end_text]
call println
; candidate
xor r9, r9
; primes_found
xor r10, r10
.loop:
; next prime candidate
inc r9
; if(is_prime(candidate)) ...
mov rdi, r9
call is_prime
cmp rax, 0
jnz .loop
; primes_found += 1
inc r10
; if(primes_found > max_primes)
cmp r10, r8
jg .exit
; else
mov rdi, r9
call iprintln
jmp .loop
.usage:
lea rdi, [usage_text]
call println
mov edi, 1 ; unsuccessful
call exit
.exit:
xor edi, edi
call exit
| 19.395973
| 77
| 0.453287
|
b6c77ba625e16f3b12396367c0a147ee5532dd8b
| 531
|
asm
|
Assembly
|
oeis/261/A261766.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/261/A261766.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/261/A261766.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A261766: a(n) is the number of partial derangements of an n-set with at least one orbit of size exactly n.
; 1,0,3,8,30,144,840,5760,45360,403200,3991680,43545600,518918400,6706022400,93405312000,1394852659200,22230464256000,376610217984000,6758061133824000,128047474114560000,2554547108585472000,53523844179886080000,1175091669949317120000
add $0,1
mov $2,$0
lpb $0
sub $0,2
mov $3,$2
lpb $3
mul $2,$0
mov $4,$0
cmp $4,0
add $0,$4
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
lpe
lpe
mov $0,$2
| 25.285714
| 233
| 0.696798
|
173e515f3489d9f30c0b57de2fff33267655ef25
| 23,716
|
asm
|
Assembly
|
sort.asm
|
GkHabib/OS_Lab_project3
|
3b9b0fe7129ad0153f0636700269a36b2d2f5316
|
[
"MIT-0"
] | null | null | null |
sort.asm
|
GkHabib/OS_Lab_project3
|
3b9b0fe7129ad0153f0636700269a36b2d2f5316
|
[
"MIT-0"
] | null | null | null |
sort.asm
|
GkHabib/OS_Lab_project3
|
3b9b0fe7129ad0153f0636700269a36b2d2f5316
|
[
"MIT-0"
] | 1
|
2020-02-22T21:27:08.000Z
|
2020-02-22T21:27:08.000Z
|
_sort: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
return str;
}
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 51 push %ecx
e: 83 ec 04 sub $0x4,%esp
// sort_syscalls(2);
// invoked_syscalls(2);
// get_count(2, 16);
// log_syscalls();
ticketlockinit();
11: e8 2c 04 00 00 call 442 <ticketlockinit>
ticketlocktest();
16: e8 2f 04 00 00 call 44a <ticketlocktest>
ticketlocktest();
1b: e8 2a 04 00 00 call 44a <ticketlocktest>
ticketlocktest();
20: e8 25 04 00 00 call 44a <ticketlocktest>
ticketlocktest();
25: e8 20 04 00 00 call 44a <ticketlocktest>
exit();
2a: e8 53 03 00 00 call 382 <exit>
2f: 90 nop
00000030 <reverse>:
{
30: 55 push %ebp
31: 89 e5 mov %esp,%ebp
33: 56 push %esi
34: 53 push %ebx
int end = length -1;
35: 8b 45 0c mov 0xc(%ebp),%eax
{
38: 8b 4d 08 mov 0x8(%ebp),%ecx
int end = length -1;
3b: 83 e8 01 sub $0x1,%eax
while (start < end)
3e: 85 c0 test %eax,%eax
40: 7e 20 jle 62 <reverse+0x32>
int start = 0;
42: 31 d2 xor %edx,%edx
44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
char a = *(str+start);
48: 0f b6 34 11 movzbl (%ecx,%edx,1),%esi
*(str+start) = *(str+end);
4c: 0f b6 1c 01 movzbl (%ecx,%eax,1),%ebx
50: 88 1c 11 mov %bl,(%ecx,%edx,1)
*(str+end) = a;
53: 89 f3 mov %esi,%ebx
start++;
55: 83 c2 01 add $0x1,%edx
*(str+end) = a;
58: 88 1c 01 mov %bl,(%ecx,%eax,1)
end--;
5b: 83 e8 01 sub $0x1,%eax
while (start < end)
5e: 39 c2 cmp %eax,%edx
60: 7c e6 jl 48 <reverse+0x18>
}
62: 5b pop %ebx
63: 5e pop %esi
64: 5d pop %ebp
65: c3 ret
66: 8d 76 00 lea 0x0(%esi),%esi
69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000070 <itoa>:
{
70: 55 push %ebp
71: 89 e5 mov %esp,%ebp
73: 57 push %edi
74: 56 push %esi
75: 53 push %ebx
76: 83 ec 04 sub $0x4,%esp
79: 8b 45 08 mov 0x8(%ebp),%eax
7c: 8b 4d 0c mov 0xc(%ebp),%ecx
if (num == 0)
7f: 85 c0 test %eax,%eax
81: 0f 84 91 00 00 00 je 118 <itoa+0xa8>
if (num < 0 && base == 10)
87: 85 c0 test %eax,%eax
89: 79 7d jns 108 <itoa+0x98>
8b: 83 7d 10 0a cmpl $0xa,0x10(%ebp)
8f: 75 77 jne 108 <itoa+0x98>
num = -num;
91: f7 d8 neg %eax
isNegative = 1;
93: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0';
9a: 31 db xor %ebx,%ebx
9c: eb 04 jmp a2 <itoa+0x32>
9e: 66 90 xchg %ax,%ax
a0: 89 fb mov %edi,%ebx
a2: 99 cltd
a3: f7 7d 10 idivl 0x10(%ebp)
a6: 8d 7a 57 lea 0x57(%edx),%edi
a9: 8d 72 30 lea 0x30(%edx),%esi
ac: 83 fa 0a cmp $0xa,%edx
af: 89 fa mov %edi,%edx
b1: 8d 7b 01 lea 0x1(%ebx),%edi
b4: 0f 4c d6 cmovl %esi,%edx
while (num != 0)
b7: 85 c0 test %eax,%eax
str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0';
b9: 88 54 39 ff mov %dl,-0x1(%ecx,%edi,1)
while (num != 0)
bd: 75 e1 jne a0 <itoa+0x30>
if (isNegative)
bf: 8b 75 f0 mov -0x10(%ebp),%esi
c2: 8d 14 39 lea (%ecx,%edi,1),%edx
c5: 85 f6 test %esi,%esi
c7: 74 09 je d2 <itoa+0x62>
str[i++] = '-';
c9: 8d 7b 02 lea 0x2(%ebx),%edi
cc: c6 02 2d movb $0x2d,(%edx)
cf: 8d 14 39 lea (%ecx,%edi,1),%edx
while (start < end)
d2: 83 ef 01 sub $0x1,%edi
str[i] = '\0';
d5: c6 02 00 movb $0x0,(%edx)
while (start < end)
d8: 74 1e je f8 <itoa+0x88>
da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
char a = *(str+start);
e0: 0f b6 1c 01 movzbl (%ecx,%eax,1),%ebx
*(str+start) = *(str+end);
e4: 0f b6 14 39 movzbl (%ecx,%edi,1),%edx
e8: 88 14 01 mov %dl,(%ecx,%eax,1)
*(str+end) = a;
eb: 88 1c 39 mov %bl,(%ecx,%edi,1)
start++;
ee: 83 c0 01 add $0x1,%eax
end--;
f1: 83 ef 01 sub $0x1,%edi
while (start < end)
f4: 39 f8 cmp %edi,%eax
f6: 7c e8 jl e0 <itoa+0x70>
}
f8: 83 c4 04 add $0x4,%esp
fb: 89 c8 mov %ecx,%eax
fd: 5b pop %ebx
fe: 5e pop %esi
ff: 5f pop %edi
100: 5d pop %ebp
101: c3 ret
102: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int isNegative = 0;
108: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
10f: eb 89 jmp 9a <itoa+0x2a>
111: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
str[i++] = '0';
118: bf 30 00 00 00 mov $0x30,%edi
}
11d: 89 c8 mov %ecx,%eax
str[i++] = '0';
11f: 66 89 39 mov %di,(%ecx)
}
122: 83 c4 04 add $0x4,%esp
125: 5b pop %ebx
126: 5e pop %esi
127: 5f pop %edi
128: 5d pop %ebp
129: c3 ret
12a: 66 90 xchg %ax,%ax
12c: 66 90 xchg %ax,%ax
12e: 66 90 xchg %ax,%ax
00000130 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
130: 55 push %ebp
131: 89 e5 mov %esp,%ebp
133: 53 push %ebx
134: 8b 45 08 mov 0x8(%ebp),%eax
137: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
13a: 89 c2 mov %eax,%edx
13c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
140: 83 c1 01 add $0x1,%ecx
143: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
147: 83 c2 01 add $0x1,%edx
14a: 84 db test %bl,%bl
14c: 88 5a ff mov %bl,-0x1(%edx)
14f: 75 ef jne 140 <strcpy+0x10>
;
return os;
}
151: 5b pop %ebx
152: 5d pop %ebp
153: c3 ret
154: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
15a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000160 <strcmp>:
int
strcmp(const char *p, const char *q)
{
160: 55 push %ebp
161: 89 e5 mov %esp,%ebp
163: 53 push %ebx
164: 8b 55 08 mov 0x8(%ebp),%edx
167: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
16a: 0f b6 02 movzbl (%edx),%eax
16d: 0f b6 19 movzbl (%ecx),%ebx
170: 84 c0 test %al,%al
172: 75 1c jne 190 <strcmp+0x30>
174: eb 2a jmp 1a0 <strcmp+0x40>
176: 8d 76 00 lea 0x0(%esi),%esi
179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
180: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
183: 0f b6 02 movzbl (%edx),%eax
p++, q++;
186: 83 c1 01 add $0x1,%ecx
189: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
18c: 84 c0 test %al,%al
18e: 74 10 je 1a0 <strcmp+0x40>
190: 38 d8 cmp %bl,%al
192: 74 ec je 180 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
194: 29 d8 sub %ebx,%eax
}
196: 5b pop %ebx
197: 5d pop %ebp
198: c3 ret
199: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1a0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
1a2: 29 d8 sub %ebx,%eax
}
1a4: 5b pop %ebx
1a5: 5d pop %ebp
1a6: c3 ret
1a7: 89 f6 mov %esi,%esi
1a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001b0 <strlen>:
uint
strlen(const char *s)
{
1b0: 55 push %ebp
1b1: 89 e5 mov %esp,%ebp
1b3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
1b6: 80 39 00 cmpb $0x0,(%ecx)
1b9: 74 15 je 1d0 <strlen+0x20>
1bb: 31 d2 xor %edx,%edx
1bd: 8d 76 00 lea 0x0(%esi),%esi
1c0: 83 c2 01 add $0x1,%edx
1c3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
1c7: 89 d0 mov %edx,%eax
1c9: 75 f5 jne 1c0 <strlen+0x10>
;
return n;
}
1cb: 5d pop %ebp
1cc: c3 ret
1cd: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
1d0: 31 c0 xor %eax,%eax
}
1d2: 5d pop %ebp
1d3: c3 ret
1d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000001e0 <memset>:
void*
memset(void *dst, int c, uint n)
{
1e0: 55 push %ebp
1e1: 89 e5 mov %esp,%ebp
1e3: 57 push %edi
1e4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1e7: 8b 4d 10 mov 0x10(%ebp),%ecx
1ea: 8b 45 0c mov 0xc(%ebp),%eax
1ed: 89 d7 mov %edx,%edi
1ef: fc cld
1f0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1f2: 89 d0 mov %edx,%eax
1f4: 5f pop %edi
1f5: 5d pop %ebp
1f6: c3 ret
1f7: 89 f6 mov %esi,%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <strchr>:
char*
strchr(const char *s, char c)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 53 push %ebx
204: 8b 45 08 mov 0x8(%ebp),%eax
207: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
20a: 0f b6 10 movzbl (%eax),%edx
20d: 84 d2 test %dl,%dl
20f: 74 1d je 22e <strchr+0x2e>
if(*s == c)
211: 38 d3 cmp %dl,%bl
213: 89 d9 mov %ebx,%ecx
215: 75 0d jne 224 <strchr+0x24>
217: eb 17 jmp 230 <strchr+0x30>
219: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
220: 38 ca cmp %cl,%dl
222: 74 0c je 230 <strchr+0x30>
for(; *s; s++)
224: 83 c0 01 add $0x1,%eax
227: 0f b6 10 movzbl (%eax),%edx
22a: 84 d2 test %dl,%dl
22c: 75 f2 jne 220 <strchr+0x20>
return (char*)s;
return 0;
22e: 31 c0 xor %eax,%eax
}
230: 5b pop %ebx
231: 5d pop %ebp
232: c3 ret
233: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
239: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000240 <gets>:
char*
gets(char *buf, int max)
{
240: 55 push %ebp
241: 89 e5 mov %esp,%ebp
243: 57 push %edi
244: 56 push %esi
245: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
246: 31 f6 xor %esi,%esi
248: 89 f3 mov %esi,%ebx
{
24a: 83 ec 1c sub $0x1c,%esp
24d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
250: eb 2f jmp 281 <gets+0x41>
252: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
258: 8d 45 e7 lea -0x19(%ebp),%eax
25b: 83 ec 04 sub $0x4,%esp
25e: 6a 01 push $0x1
260: 50 push %eax
261: 6a 00 push $0x0
263: e8 32 01 00 00 call 39a <read>
if(cc < 1)
268: 83 c4 10 add $0x10,%esp
26b: 85 c0 test %eax,%eax
26d: 7e 1c jle 28b <gets+0x4b>
break;
buf[i++] = c;
26f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
273: 83 c7 01 add $0x1,%edi
276: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
279: 3c 0a cmp $0xa,%al
27b: 74 23 je 2a0 <gets+0x60>
27d: 3c 0d cmp $0xd,%al
27f: 74 1f je 2a0 <gets+0x60>
for(i=0; i+1 < max; ){
281: 83 c3 01 add $0x1,%ebx
284: 3b 5d 0c cmp 0xc(%ebp),%ebx
287: 89 fe mov %edi,%esi
289: 7c cd jl 258 <gets+0x18>
28b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
28d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
290: c6 03 00 movb $0x0,(%ebx)
}
293: 8d 65 f4 lea -0xc(%ebp),%esp
296: 5b pop %ebx
297: 5e pop %esi
298: 5f pop %edi
299: 5d pop %ebp
29a: c3 ret
29b: 90 nop
29c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
2a0: 8b 75 08 mov 0x8(%ebp),%esi
2a3: 8b 45 08 mov 0x8(%ebp),%eax
2a6: 01 de add %ebx,%esi
2a8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
2aa: c6 03 00 movb $0x0,(%ebx)
}
2ad: 8d 65 f4 lea -0xc(%ebp),%esp
2b0: 5b pop %ebx
2b1: 5e pop %esi
2b2: 5f pop %edi
2b3: 5d pop %ebp
2b4: c3 ret
2b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
2b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002c0 <stat>:
int
stat(const char *n, struct stat *st)
{
2c0: 55 push %ebp
2c1: 89 e5 mov %esp,%ebp
2c3: 56 push %esi
2c4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
2c5: 83 ec 08 sub $0x8,%esp
2c8: 6a 00 push $0x0
2ca: ff 75 08 pushl 0x8(%ebp)
2cd: e8 f0 00 00 00 call 3c2 <open>
if(fd < 0)
2d2: 83 c4 10 add $0x10,%esp
2d5: 85 c0 test %eax,%eax
2d7: 78 27 js 300 <stat+0x40>
return -1;
r = fstat(fd, st);
2d9: 83 ec 08 sub $0x8,%esp
2dc: ff 75 0c pushl 0xc(%ebp)
2df: 89 c3 mov %eax,%ebx
2e1: 50 push %eax
2e2: e8 f3 00 00 00 call 3da <fstat>
close(fd);
2e7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
2ea: 89 c6 mov %eax,%esi
close(fd);
2ec: e8 b9 00 00 00 call 3aa <close>
return r;
2f1: 83 c4 10 add $0x10,%esp
}
2f4: 8d 65 f8 lea -0x8(%ebp),%esp
2f7: 89 f0 mov %esi,%eax
2f9: 5b pop %ebx
2fa: 5e pop %esi
2fb: 5d pop %ebp
2fc: c3 ret
2fd: 8d 76 00 lea 0x0(%esi),%esi
return -1;
300: be ff ff ff ff mov $0xffffffff,%esi
305: eb ed jmp 2f4 <stat+0x34>
307: 89 f6 mov %esi,%esi
309: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000310 <atoi>:
int
atoi(const char *s)
{
310: 55 push %ebp
311: 89 e5 mov %esp,%ebp
313: 53 push %ebx
314: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
317: 0f be 11 movsbl (%ecx),%edx
31a: 8d 42 d0 lea -0x30(%edx),%eax
31d: 3c 09 cmp $0x9,%al
n = 0;
31f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
324: 77 1f ja 345 <atoi+0x35>
326: 8d 76 00 lea 0x0(%esi),%esi
329: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
330: 8d 04 80 lea (%eax,%eax,4),%eax
333: 83 c1 01 add $0x1,%ecx
336: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
33a: 0f be 11 movsbl (%ecx),%edx
33d: 8d 5a d0 lea -0x30(%edx),%ebx
340: 80 fb 09 cmp $0x9,%bl
343: 76 eb jbe 330 <atoi+0x20>
return n;
}
345: 5b pop %ebx
346: 5d pop %ebp
347: c3 ret
348: 90 nop
349: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000350 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
350: 55 push %ebp
351: 89 e5 mov %esp,%ebp
353: 56 push %esi
354: 53 push %ebx
355: 8b 5d 10 mov 0x10(%ebp),%ebx
358: 8b 45 08 mov 0x8(%ebp),%eax
35b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
35e: 85 db test %ebx,%ebx
360: 7e 14 jle 376 <memmove+0x26>
362: 31 d2 xor %edx,%edx
364: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
368: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
36c: 88 0c 10 mov %cl,(%eax,%edx,1)
36f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
372: 39 d3 cmp %edx,%ebx
374: 75 f2 jne 368 <memmove+0x18>
return vdst;
}
376: 5b pop %ebx
377: 5e pop %esi
378: 5d pop %ebp
379: c3 ret
0000037a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
37a: b8 01 00 00 00 mov $0x1,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <exit>:
SYSCALL(exit)
382: b8 02 00 00 00 mov $0x2,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <wait>:
SYSCALL(wait)
38a: b8 03 00 00 00 mov $0x3,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <pipe>:
SYSCALL(pipe)
392: b8 04 00 00 00 mov $0x4,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <read>:
SYSCALL(read)
39a: b8 05 00 00 00 mov $0x5,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <write>:
SYSCALL(write)
3a2: b8 10 00 00 00 mov $0x10,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <close>:
SYSCALL(close)
3aa: b8 15 00 00 00 mov $0x15,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <kill>:
SYSCALL(kill)
3b2: b8 06 00 00 00 mov $0x6,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <exec>:
SYSCALL(exec)
3ba: b8 07 00 00 00 mov $0x7,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <open>:
SYSCALL(open)
3c2: b8 0f 00 00 00 mov $0xf,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <mknod>:
SYSCALL(mknod)
3ca: b8 11 00 00 00 mov $0x11,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <unlink>:
SYSCALL(unlink)
3d2: b8 12 00 00 00 mov $0x12,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <fstat>:
SYSCALL(fstat)
3da: b8 08 00 00 00 mov $0x8,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <link>:
SYSCALL(link)
3e2: b8 13 00 00 00 mov $0x13,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <mkdir>:
SYSCALL(mkdir)
3ea: b8 14 00 00 00 mov $0x14,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <chdir>:
SYSCALL(chdir)
3f2: b8 09 00 00 00 mov $0x9,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <dup>:
SYSCALL(dup)
3fa: b8 0a 00 00 00 mov $0xa,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <getpid>:
SYSCALL(getpid)
402: b8 0b 00 00 00 mov $0xb,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <sbrk>:
SYSCALL(sbrk)
40a: b8 0c 00 00 00 mov $0xc,%eax
40f: cd 40 int $0x40
411: c3 ret
00000412 <sleep>:
SYSCALL(sleep)
412: b8 0d 00 00 00 mov $0xd,%eax
417: cd 40 int $0x40
419: c3 ret
0000041a <uptime>:
SYSCALL(uptime)
41a: b8 0e 00 00 00 mov $0xe,%eax
41f: cd 40 int $0x40
421: c3 ret
00000422 <invoked_syscalls>:
SYSCALL(invoked_syscalls)
422: b8 16 00 00 00 mov $0x16,%eax
427: cd 40 int $0x40
429: c3 ret
0000042a <sort_syscalls>:
SYSCALL(sort_syscalls)
42a: b8 17 00 00 00 mov $0x17,%eax
42f: cd 40 int $0x40
431: c3 ret
00000432 <get_count>:
SYSCALL(get_count)
432: b8 18 00 00 00 mov $0x18,%eax
437: cd 40 int $0x40
439: c3 ret
0000043a <log_syscalls>:
SYSCALL(log_syscalls)
43a: b8 19 00 00 00 mov $0x19,%eax
43f: cd 40 int $0x40
441: c3 ret
00000442 <ticketlockinit>:
SYSCALL(ticketlockinit)
442: b8 1a 00 00 00 mov $0x1a,%eax
447: cd 40 int $0x40
449: c3 ret
0000044a <ticketlocktest>:
SYSCALL(ticketlocktest)
44a: b8 1b 00 00 00 mov $0x1b,%eax
44f: cd 40 int $0x40
451: c3 ret
| 32.222826
| 58
| 0.410398
|
a25519e8e6e462a0790e5dc10ff5a9e5807e195c
| 2,185
|
asm
|
Assembly
|
objects/objects_freespace.asm
|
StraDaMa/mmbn6-pikachu-boss-battle
|
0bc38a6a83c3971541bf20ed55583df3ab357a90
|
[
"MIT"
] | 7
|
2021-04-04T13:38:05.000Z
|
2022-03-31T01:33:46.000Z
|
objects/objects_freespace.asm
|
StraDaMa/mmbn6-pikachu-boss-battle
|
0bc38a6a83c3971541bf20ed55583df3ab357a90
|
[
"MIT"
] | null | null | null |
objects/objects_freespace.asm
|
StraDaMa/mmbn6-pikachu-boss-battle
|
0bc38a6a83c3971541bf20ed55583df3ab357a90
|
[
"MIT"
] | 1
|
2021-10-02T23:15:01.000Z
|
2021-10-02T23:15:01.000Z
|
temp_attack_object_list:
.byte 0x0C,0x01,0x00,0x00,0x07;0x00
.byte 0x0C,0x01,0x01,0x00,0x07;0x01
.byte 0x0C,0x01,0x02,0x00,0x07;0x02
.byte 0x0C,0x00,0x00,0x00,0x00;0x03
.byte 0x0C,0x02,0x00,0x00,0x00;0x04
.byte 0x0C,0x06,0x00,0x00,0x10;0x05
.byte 0x0C,0x03,0x00,0x00,0x00;0x06
.byte 0x0C,0x3B,0x00,0x00,0x0D;0x07
.byte 0x0C,0x3B,0x03,0x00,0x0D;0x08
.byte 0x0C,0x3B,0x06,0x00,0x0D;0x09
.byte 0x0C,0x3B,0x09,0x00,0x0D;0x0A
.byte 0x0C,0x00,0x00,0x00,0x00;0x0B
.byte 0x0C,0x00,0x00,0x01,0x00;0x0C
.byte 0x0C,0x1D,0x00,0x00,0x0E;0x0D
.byte 0x0C,0x0C,0x00,0x00,0x0F;0x0E
.byte 0x0C,0x4F,0x00,0x00,0x00;0x0F
.byte 0x0C,0x00,0x00,0x00,0x00;0x10
.byte 0x0C,0x00,0x00,0x00,0x00;0x11
.byte 0x0C,0x50,0x00,0x00,0x00;0x12
.byte 0x0C,0x18,0x00,0x00,0x0A;0x13
.byte 0x0C,0x08,0x00,0x00,0x08;0x14
.byte 0x0C,0x19,0x00,0x00,0x0B;0x15
.byte 0x0C,0x29,0x00,0x00,0x14;0x16
.byte 0x0C,0x2A,0x00,0x00,0x17;0x17
.byte 0x0C,0x2B,0x00,0x00,0x19;0x18
.byte 0x0C,0x36,0x00,0x00,0x00;0x19
.byte 0x0C,0x37,0x00,0x00,0x00;0x1A
.byte 0x0C,0x38,0x00,0x00,0x00;0x1B
.byte 0x0C,0x00,0x02,0x00,0x00;0x1C
.byte 0x0C,0x40,0x00,0x00,0x1A;0x1D
.byte 0x0C,0x1F,0x00,0x00,0x16;0x1E
.byte 0x10,0x5A,0x00,0x00,0x00;0x1F
.byte 0x0C,0x58,0x00,0x00,0x13;0x20
.byte 0x0C,0x16,0x00,0x00,0x09;0x21
.byte 0x0C,0x16,0x01,0x00,0x09;0x22
.byte 0x0C,0x59,0x00,0x00,0x0C;0x23
.byte 0x0C,0x02,0x03,0x00,0x00;0x24
.byte 0x0C,0x02,0x01,0x00,0x00;0x25
.byte 0x0C,0x02,0x02,0x00,0x00;0x26
.byte 0x0C,0x5D,0x00,0x00,0x0E;0x27
.byte 0x0C,0x5E,0x00,0x00,0x0E;0x28
.byte 0x0C,0x60,0x00,0x00,0x0E;0x29
.byte 0x0C,0x27,0x00,0x00,0x00;0x2A
.byte 0x0C,0x5F,0x00,0x00,0x0E;0x2B
.byte 0x0C,0x61,0x00,0x00,0x0E;0x2C
.byte 0x0C,0x02,0x04,0x00,0x00;0x2D
.byte 0x10,0x52,0x00,0x00,0x00;0x2E
.byte 0x0C,0x10,0x00,0x00,0x19;0x2F
.byte 0x0C,0x08,0x00,0xFF,0x08;0x30
.byte 0x08,0x13,0x00,0x00,0x00;0x31
.byte 0x0C,0x43,0x00,0x00,0x18;0x32
.byte 0x0C,0x5C,0x00,0x00,0x00;0x33
;0x34 surfboard / balloon
.byte PIKACHU_SPRITE_CATEGORY;sprite category
.byte PIKACHU_SPRITE_INDEX;sprite index
.byte 0x00;
.byte 0x01;
.byte 0x00;position offset
;0x35 thunder wave
.byte 0x10;sprite category
.byte 0x1A;sprite index
.byte 0x01;
.byte 0x01;
.byte 0x00;position offset
;eof
| 33.106061
| 45
| 0.782609
|
2860eda4e36b414f21f2102bd6a7d6b43352ec10
| 6,538
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1406.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_1406.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_1406.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x181a5, %rsi
nop
cmp $47877, %r13
mov $0x6162636465666768, %rax
movq %rax, (%rsi)
nop
nop
nop
nop
nop
sub $24603, %rax
lea addresses_normal_ht+0x13e3c, %rsi
lea addresses_UC_ht+0xabf0, %rdi
nop
nop
nop
nop
nop
dec %r12
mov $31, %rcx
rep movsb
nop
nop
nop
nop
and $58004, %r12
lea addresses_WC_ht+0x1b0f0, %r13
sub $59330, %rbp
movb $0x61, (%r13)
nop
nop
nop
nop
nop
inc %r12
lea addresses_normal_ht+0xfeb0, %rsi
lea addresses_A_ht+0x22f0, %rdi
nop
cmp %r14, %r14
mov $81, %rcx
rep movsw
nop
nop
add %r12, %r12
lea addresses_A_ht+0xb360, %rsi
lea addresses_WC_ht+0x15414, %rdi
clflush (%rdi)
nop
nop
xor $38811, %r13
mov $46, %rcx
rep movsb
nop
nop
nop
nop
add $34541, %r14
lea addresses_A_ht+0x181df, %rax
nop
nop
nop
nop
add %rdi, %rdi
mov $0x6162636465666768, %r13
movq %r13, %xmm0
movups %xmm0, (%rax)
nop
nop
nop
add $64045, %r14
lea addresses_UC_ht+0x155f0, %rax
add $34447, %rsi
movb $0x61, (%rax)
add $48267, %rbp
lea addresses_UC_ht+0xbfd8, %rbp
nop
nop
nop
nop
inc %rax
mov $0x6162636465666768, %r12
movq %r12, %xmm7
vmovups %ymm7, (%rbp)
nop
sub %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdx
// Store
lea addresses_UC+0xada, %r11
nop
nop
inc %rbp
movw $0x5152, (%r11)
nop
nop
nop
nop
nop
cmp $6152, %r13
// Store
lea addresses_PSE+0x3530, %rbp
nop
nop
nop
nop
nop
and $46373, %rdx
movb $0x51, (%rbp)
nop
nop
nop
nop
nop
add %r11, %r11
// Faulty Load
lea addresses_WT+0xc8f0, %rcx
and $40998, %rbp
movups (%rcx), %xmm5
vpextrq $1, %xmm5, %rax
lea oracles, %r13
and $0xff, %rax
shlq $12, %rax
mov (%r13,%rax,1), %rax
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 35.726776
| 2,999
| 0.659529
|
edb531239cf5eacfcc23be60a7262989d772d4ae
| 1,375
|
asm
|
Assembly
|
libsrc/graphics/vg5k/textpixl6.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/graphics/vg5k/textpixl6.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/graphics/vg5k/textpixl6.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION rodata_clib
PUBLIC textpixl
EXTERN base_graphics
; 32 16
; 8 4
; 2 1
; If pixel > 32 then 191 - value
textpixl:
;
;
; .. X. .X XX
; .. .. .. ..
; .. .. .. ..
defb 192, 193, 194, 195
; .. X. .X XX
; X. X. X. X.
; .. .. .. ..
defb 196, 197, 198, 199
; .. X. .X XX
; .X .X .X .X
; .. .. .. ..
defb 200, 201, 202, 203
; .. X. .X XX
; XX XX XX XX
; .. .. .. ..
defb 204, 205, 206, 207
; .. X. .X XX
; .. .. .. ..
; X. X. X. X.
defb 208, 209, 210, 211
; .. X. .X XX
; X. X. X. X.
; X. X. X. X.
defb 212, 213, 214, 215
; .. X. .X XX
; .X .X .X .X
; X. X. X X.
defb 216, 217, 218, 219
; .. X. .X XX
; XX XX XX XX
; X. X. X. X.
defb 220, 221, 222, 223
; .. X. .X XX
; .. .. .. ..
; .X .X .X .X
defb 224, 225, 226, 227
; .. X. .X XX
; X. X. X. X.
; .X .X .X .X
defb 228, 229, 230, 231
; .. X. .X XX
; .X .X .X .X
; .X .X .X .X
defb 232, 233, 234, 235
; .. X. .X XX
; XX XX XX XX
; .X .X .X .X
defb 236, 237, 238, 239
; .. X. .X XX
; .. .. .. ..
; XX XX XX XX
defb 240, 241, 242, 243
; .. X. .X XX
; X. X. X. X.
; XX XX XX XX
defb 244, 245, 246, 247
; .. X. .X XX
; .X .X .X .X
; XX XX XX XX
defb 248, 249, 250, 251
; .. X. .X XX
; XX XX XX XX
; XX XX XX XX
defb 252, 253, 254, 255
| 12.276786
| 33
| 0.389818
|
90533d416e72a54ee0d330091a9d4bb0ab48c6a0
| 2,422
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_8_710.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_8_710.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_8_710.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %rax
push %rbx
push %rcx
lea addresses_D_ht+0xbc1, %rbx
nop
nop
nop
nop
sub %r14, %r14
movups (%rbx), %xmm3
vpextrq $0, %xmm3, %rcx
nop
nop
nop
and %r15, %r15
lea addresses_UC_ht+0x1369, %r14
nop
xor $11661, %r12
movl $0x61626364, (%r14)
nop
nop
nop
nop
and $4339, %rcx
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r8
push %rbx
push %rdx
push %rsi
// Store
lea addresses_RW+0x19209, %r13
nop
nop
nop
nop
nop
and $14998, %rbx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm6
movups %xmm6, (%r13)
nop
nop
inc %r10
// Store
lea addresses_RW+0x1b889, %rbx
nop
nop
nop
and $18263, %r12
mov $0x5152535455565758, %r8
movq %r8, %xmm7
vmovups %ymm7, (%rbx)
add $53326, %r13
// Store
lea addresses_PSE+0xd24d, %r8
nop
nop
nop
dec %rbx
mov $0x5152535455565758, %r13
movq %r13, (%r8)
sub $26337, %r8
// Store
mov $0xf09, %rdx
nop
nop
sub $65370, %r10
mov $0x5152535455565758, %r8
movq %r8, (%rdx)
nop
nop
sub %r13, %r13
// Faulty Load
lea addresses_WT+0x13089, %r13
nop
nop
nop
and %rsi, %rsi
movups (%r13), %xmm7
vpextrq $0, %xmm7, %r12
lea oracles, %rsi
and $0xff, %r12
shlq $12, %r12
mov (%rsi,%r12,1), %r12
pop %rsi
pop %rdx
pop %rbx
pop %r8
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': True, 'NT': False}}
{'00': 8}
00 00 00 00 00 00 00 00
*/
| 18.348485
| 124
| 0.64327
|
c104e44377d1fd416628ce7168523c9389aeef5e
| 319
|
asm
|
Assembly
|
Source/Macro/Free.asm
|
xragey/qsmw
|
522c661ccc874ab7b58230ee4dfb3160cf5028d9
|
[
"MIT"
] | null | null | null |
Source/Macro/Free.asm
|
xragey/qsmw
|
522c661ccc874ab7b58230ee4dfb3160cf5028d9
|
[
"MIT"
] | null | null | null |
Source/Macro/Free.asm
|
xragey/qsmw
|
522c661ccc874ab7b58230ee4dfb3160cf5028d9
|
[
"MIT"
] | 1
|
2020-09-20T15:36:48.000Z
|
2020-09-20T15:36:48.000Z
|
;-------------------------------------------------------------------------------
;
; qSMW - Macro/Free.asm
;
;-------------------------------------------------------------------------------
macro Free(addressStart, addressEnd)
pushpc
org <addressStart>
rep (<addressEnd>)-(<addressStart>) : db $FF
pullpc
endmacro
| 24.538462
| 80
| 0.347962
|
c4effa0f2b6edc828715078941dca0f91a172330
| 43,082
|
asm
|
Assembly
|
init.asm
|
avivo23/os_ass3
|
9616ffbc3f422b5c8fa872f557b8d4a1eff7f2f3
|
[
"MIT-0"
] | null | null | null |
init.asm
|
avivo23/os_ass3
|
9616ffbc3f422b5c8fa872f557b8d4a1eff7f2f3
|
[
"MIT-0"
] | null | null | null |
init.asm
|
avivo23/os_ass3
|
9616ffbc3f422b5c8fa872f557b8d4a1eff7f2f3
|
[
"MIT-0"
] | null | null | null |
_init: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
char *argv[] = { "sh", 0 };
int
main(void)
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 51 push %ecx
e: 83 ec 14 sub $0x14,%esp
int pid, wpid;
if(open("console", O_RDWR) < 0){
11: 83 ec 08 sub $0x8,%esp
14: 6a 02 push $0x2
16: 68 88 08 00 00 push $0x888
1b: e8 78 03 00 00 call 398 <open>
20: 83 c4 10 add $0x10,%esp
23: 85 c0 test %eax,%eax
25: 79 26 jns 4d <main+0x4d>
mknod("console", 1, 1);
27: 83 ec 04 sub $0x4,%esp
2a: 6a 01 push $0x1
2c: 6a 01 push $0x1
2e: 68 88 08 00 00 push $0x888
33: e8 68 03 00 00 call 3a0 <mknod>
38: 83 c4 10 add $0x10,%esp
open("console", O_RDWR);
3b: 83 ec 08 sub $0x8,%esp
3e: 6a 02 push $0x2
40: 68 88 08 00 00 push $0x888
45: e8 4e 03 00 00 call 398 <open>
4a: 83 c4 10 add $0x10,%esp
}
dup(0); // stdout
4d: 83 ec 0c sub $0xc,%esp
50: 6a 00 push $0x0
52: e8 79 03 00 00 call 3d0 <dup>
57: 83 c4 10 add $0x10,%esp
dup(0); // stderr
5a: 83 ec 0c sub $0xc,%esp
5d: 6a 00 push $0x0
5f: e8 6c 03 00 00 call 3d0 <dup>
64: 83 c4 10 add $0x10,%esp
for(;;){
printf(1, "init: starting sh\n");
67: 83 ec 08 sub $0x8,%esp
6a: 68 90 08 00 00 push $0x890
6f: 6a 01 push $0x1
71: e8 59 04 00 00 call 4cf <printf>
76: 83 c4 10 add $0x10,%esp
pid = fork();
79: e8 d2 02 00 00 call 350 <fork>
7e: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid < 0){
81: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
85: 79 17 jns 9e <main+0x9e>
printf(1, "init: fork failed\n");
87: 83 ec 08 sub $0x8,%esp
8a: 68 a3 08 00 00 push $0x8a3
8f: 6a 01 push $0x1
91: e8 39 04 00 00 call 4cf <printf>
96: 83 c4 10 add $0x10,%esp
exit();
99: e8 ba 02 00 00 call 358 <exit>
}
if(pid == 0){
9e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
a2: 75 3e jne e2 <main+0xe2>
exec("sh", argv);
a4: 83 ec 08 sub $0x8,%esp
a7: 68 24 0b 00 00 push $0xb24
ac: 68 85 08 00 00 push $0x885
b1: e8 da 02 00 00 call 390 <exec>
b6: 83 c4 10 add $0x10,%esp
printf(1, "init: exec sh failed\n");
b9: 83 ec 08 sub $0x8,%esp
bc: 68 b6 08 00 00 push $0x8b6
c1: 6a 01 push $0x1
c3: e8 07 04 00 00 call 4cf <printf>
c8: 83 c4 10 add $0x10,%esp
exit();
cb: e8 88 02 00 00 call 358 <exit>
}
while((wpid=wait()) >= 0 && wpid != pid)
printf(1, "zombie!\n");
d0: 83 ec 08 sub $0x8,%esp
d3: 68 cc 08 00 00 push $0x8cc
d8: 6a 01 push $0x1
da: e8 f0 03 00 00 call 4cf <printf>
df: 83 c4 10 add $0x10,%esp
if(pid == 0){
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while((wpid=wait()) >= 0 && wpid != pid)
e2: e8 79 02 00 00 call 360 <wait>
e7: 89 45 f0 mov %eax,-0x10(%ebp)
ea: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
ee: 0f 88 73 ff ff ff js 67 <main+0x67>
f4: 8b 45 f0 mov -0x10(%ebp),%eax
f7: 3b 45 f4 cmp -0xc(%ebp),%eax
fa: 75 d4 jne d0 <main+0xd0>
printf(1, "zombie!\n");
}
fc: e9 66 ff ff ff jmp 67 <main+0x67>
00000101 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
101: 55 push %ebp
102: 89 e5 mov %esp,%ebp
104: 57 push %edi
105: 53 push %ebx
asm volatile("cld; rep stosb" :
106: 8b 4d 08 mov 0x8(%ebp),%ecx
109: 8b 55 10 mov 0x10(%ebp),%edx
10c: 8b 45 0c mov 0xc(%ebp),%eax
10f: 89 cb mov %ecx,%ebx
111: 89 df mov %ebx,%edi
113: 89 d1 mov %edx,%ecx
115: fc cld
116: f3 aa rep stos %al,%es:(%edi)
118: 89 ca mov %ecx,%edx
11a: 89 fb mov %edi,%ebx
11c: 89 5d 08 mov %ebx,0x8(%ebp)
11f: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
122: 90 nop
123: 5b pop %ebx
124: 5f pop %edi
125: 5d pop %ebp
126: c3 ret
00000127 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
127: 55 push %ebp
128: 89 e5 mov %esp,%ebp
12a: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
12d: 8b 45 08 mov 0x8(%ebp),%eax
130: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
133: 90 nop
134: 8b 45 08 mov 0x8(%ebp),%eax
137: 8d 50 01 lea 0x1(%eax),%edx
13a: 89 55 08 mov %edx,0x8(%ebp)
13d: 8b 55 0c mov 0xc(%ebp),%edx
140: 8d 4a 01 lea 0x1(%edx),%ecx
143: 89 4d 0c mov %ecx,0xc(%ebp)
146: 0f b6 12 movzbl (%edx),%edx
149: 88 10 mov %dl,(%eax)
14b: 0f b6 00 movzbl (%eax),%eax
14e: 84 c0 test %al,%al
150: 75 e2 jne 134 <strcpy+0xd>
;
return os;
152: 8b 45 fc mov -0x4(%ebp),%eax
}
155: c9 leave
156: c3 ret
00000157 <strcmp>:
int
strcmp(const char *p, const char *q)
{
157: 55 push %ebp
158: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
15a: eb 08 jmp 164 <strcmp+0xd>
p++, q++;
15c: 83 45 08 01 addl $0x1,0x8(%ebp)
160: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
164: 8b 45 08 mov 0x8(%ebp),%eax
167: 0f b6 00 movzbl (%eax),%eax
16a: 84 c0 test %al,%al
16c: 74 10 je 17e <strcmp+0x27>
16e: 8b 45 08 mov 0x8(%ebp),%eax
171: 0f b6 10 movzbl (%eax),%edx
174: 8b 45 0c mov 0xc(%ebp),%eax
177: 0f b6 00 movzbl (%eax),%eax
17a: 38 c2 cmp %al,%dl
17c: 74 de je 15c <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
17e: 8b 45 08 mov 0x8(%ebp),%eax
181: 0f b6 00 movzbl (%eax),%eax
184: 0f b6 d0 movzbl %al,%edx
187: 8b 45 0c mov 0xc(%ebp),%eax
18a: 0f b6 00 movzbl (%eax),%eax
18d: 0f b6 c0 movzbl %al,%eax
190: 29 c2 sub %eax,%edx
192: 89 d0 mov %edx,%eax
}
194: 5d pop %ebp
195: c3 ret
00000196 <strlen>:
uint
strlen(char *s)
{
196: 55 push %ebp
197: 89 e5 mov %esp,%ebp
199: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
19c: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1a3: eb 04 jmp 1a9 <strlen+0x13>
1a5: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1a9: 8b 55 fc mov -0x4(%ebp),%edx
1ac: 8b 45 08 mov 0x8(%ebp),%eax
1af: 01 d0 add %edx,%eax
1b1: 0f b6 00 movzbl (%eax),%eax
1b4: 84 c0 test %al,%al
1b6: 75 ed jne 1a5 <strlen+0xf>
;
return n;
1b8: 8b 45 fc mov -0x4(%ebp),%eax
}
1bb: c9 leave
1bc: c3 ret
000001bd <memset>:
void*
memset(void *dst, int c, uint n)
{
1bd: 55 push %ebp
1be: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
1c0: 8b 45 10 mov 0x10(%ebp),%eax
1c3: 50 push %eax
1c4: ff 75 0c pushl 0xc(%ebp)
1c7: ff 75 08 pushl 0x8(%ebp)
1ca: e8 32 ff ff ff call 101 <stosb>
1cf: 83 c4 0c add $0xc,%esp
return dst;
1d2: 8b 45 08 mov 0x8(%ebp),%eax
}
1d5: c9 leave
1d6: c3 ret
000001d7 <strchr>:
char*
strchr(const char *s, char c)
{
1d7: 55 push %ebp
1d8: 89 e5 mov %esp,%ebp
1da: 83 ec 04 sub $0x4,%esp
1dd: 8b 45 0c mov 0xc(%ebp),%eax
1e0: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1e3: eb 14 jmp 1f9 <strchr+0x22>
if(*s == c)
1e5: 8b 45 08 mov 0x8(%ebp),%eax
1e8: 0f b6 00 movzbl (%eax),%eax
1eb: 3a 45 fc cmp -0x4(%ebp),%al
1ee: 75 05 jne 1f5 <strchr+0x1e>
return (char*)s;
1f0: 8b 45 08 mov 0x8(%ebp),%eax
1f3: eb 13 jmp 208 <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
1f5: 83 45 08 01 addl $0x1,0x8(%ebp)
1f9: 8b 45 08 mov 0x8(%ebp),%eax
1fc: 0f b6 00 movzbl (%eax),%eax
1ff: 84 c0 test %al,%al
201: 75 e2 jne 1e5 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
203: b8 00 00 00 00 mov $0x0,%eax
}
208: c9 leave
209: c3 ret
0000020a <gets>:
char*
gets(char *buf, int max)
{
20a: 55 push %ebp
20b: 89 e5 mov %esp,%ebp
20d: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
210: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
217: eb 42 jmp 25b <gets+0x51>
cc = read(0, &c, 1);
219: 83 ec 04 sub $0x4,%esp
21c: 6a 01 push $0x1
21e: 8d 45 ef lea -0x11(%ebp),%eax
221: 50 push %eax
222: 6a 00 push $0x0
224: e8 47 01 00 00 call 370 <read>
229: 83 c4 10 add $0x10,%esp
22c: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
22f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
233: 7e 33 jle 268 <gets+0x5e>
break;
buf[i++] = c;
235: 8b 45 f4 mov -0xc(%ebp),%eax
238: 8d 50 01 lea 0x1(%eax),%edx
23b: 89 55 f4 mov %edx,-0xc(%ebp)
23e: 89 c2 mov %eax,%edx
240: 8b 45 08 mov 0x8(%ebp),%eax
243: 01 c2 add %eax,%edx
245: 0f b6 45 ef movzbl -0x11(%ebp),%eax
249: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
24b: 0f b6 45 ef movzbl -0x11(%ebp),%eax
24f: 3c 0a cmp $0xa,%al
251: 74 16 je 269 <gets+0x5f>
253: 0f b6 45 ef movzbl -0x11(%ebp),%eax
257: 3c 0d cmp $0xd,%al
259: 74 0e je 269 <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
25b: 8b 45 f4 mov -0xc(%ebp),%eax
25e: 83 c0 01 add $0x1,%eax
261: 3b 45 0c cmp 0xc(%ebp),%eax
264: 7c b3 jl 219 <gets+0xf>
266: eb 01 jmp 269 <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
268: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
269: 8b 55 f4 mov -0xc(%ebp),%edx
26c: 8b 45 08 mov 0x8(%ebp),%eax
26f: 01 d0 add %edx,%eax
271: c6 00 00 movb $0x0,(%eax)
return buf;
274: 8b 45 08 mov 0x8(%ebp),%eax
}
277: c9 leave
278: c3 ret
00000279 <stat>:
int
stat(char *n, struct stat *st)
{
279: 55 push %ebp
27a: 89 e5 mov %esp,%ebp
27c: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
27f: 83 ec 08 sub $0x8,%esp
282: 6a 00 push $0x0
284: ff 75 08 pushl 0x8(%ebp)
287: e8 0c 01 00 00 call 398 <open>
28c: 83 c4 10 add $0x10,%esp
28f: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
292: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
296: 79 07 jns 29f <stat+0x26>
return -1;
298: b8 ff ff ff ff mov $0xffffffff,%eax
29d: eb 25 jmp 2c4 <stat+0x4b>
r = fstat(fd, st);
29f: 83 ec 08 sub $0x8,%esp
2a2: ff 75 0c pushl 0xc(%ebp)
2a5: ff 75 f4 pushl -0xc(%ebp)
2a8: e8 03 01 00 00 call 3b0 <fstat>
2ad: 83 c4 10 add $0x10,%esp
2b0: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2b3: 83 ec 0c sub $0xc,%esp
2b6: ff 75 f4 pushl -0xc(%ebp)
2b9: e8 c2 00 00 00 call 380 <close>
2be: 83 c4 10 add $0x10,%esp
return r;
2c1: 8b 45 f0 mov -0x10(%ebp),%eax
}
2c4: c9 leave
2c5: c3 ret
000002c6 <atoi>:
int
atoi(const char *s)
{
2c6: 55 push %ebp
2c7: 89 e5 mov %esp,%ebp
2c9: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
2cc: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
2d3: eb 25 jmp 2fa <atoi+0x34>
n = n*10 + *s++ - '0';
2d5: 8b 55 fc mov -0x4(%ebp),%edx
2d8: 89 d0 mov %edx,%eax
2da: c1 e0 02 shl $0x2,%eax
2dd: 01 d0 add %edx,%eax
2df: 01 c0 add %eax,%eax
2e1: 89 c1 mov %eax,%ecx
2e3: 8b 45 08 mov 0x8(%ebp),%eax
2e6: 8d 50 01 lea 0x1(%eax),%edx
2e9: 89 55 08 mov %edx,0x8(%ebp)
2ec: 0f b6 00 movzbl (%eax),%eax
2ef: 0f be c0 movsbl %al,%eax
2f2: 01 c8 add %ecx,%eax
2f4: 83 e8 30 sub $0x30,%eax
2f7: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
2fa: 8b 45 08 mov 0x8(%ebp),%eax
2fd: 0f b6 00 movzbl (%eax),%eax
300: 3c 2f cmp $0x2f,%al
302: 7e 0a jle 30e <atoi+0x48>
304: 8b 45 08 mov 0x8(%ebp),%eax
307: 0f b6 00 movzbl (%eax),%eax
30a: 3c 39 cmp $0x39,%al
30c: 7e c7 jle 2d5 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
30e: 8b 45 fc mov -0x4(%ebp),%eax
}
311: c9 leave
312: c3 ret
00000313 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
313: 55 push %ebp
314: 89 e5 mov %esp,%ebp
316: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
319: 8b 45 08 mov 0x8(%ebp),%eax
31c: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
31f: 8b 45 0c mov 0xc(%ebp),%eax
322: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
325: eb 17 jmp 33e <memmove+0x2b>
*dst++ = *src++;
327: 8b 45 fc mov -0x4(%ebp),%eax
32a: 8d 50 01 lea 0x1(%eax),%edx
32d: 89 55 fc mov %edx,-0x4(%ebp)
330: 8b 55 f8 mov -0x8(%ebp),%edx
333: 8d 4a 01 lea 0x1(%edx),%ecx
336: 89 4d f8 mov %ecx,-0x8(%ebp)
339: 0f b6 12 movzbl (%edx),%edx
33c: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
33e: 8b 45 10 mov 0x10(%ebp),%eax
341: 8d 50 ff lea -0x1(%eax),%edx
344: 89 55 10 mov %edx,0x10(%ebp)
347: 85 c0 test %eax,%eax
349: 7f dc jg 327 <memmove+0x14>
*dst++ = *src++;
return vdst;
34b: 8b 45 08 mov 0x8(%ebp),%eax
}
34e: c9 leave
34f: c3 ret
00000350 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
350: b8 01 00 00 00 mov $0x1,%eax
355: cd 40 int $0x40
357: c3 ret
00000358 <exit>:
SYSCALL(exit)
358: b8 02 00 00 00 mov $0x2,%eax
35d: cd 40 int $0x40
35f: c3 ret
00000360 <wait>:
SYSCALL(wait)
360: b8 03 00 00 00 mov $0x3,%eax
365: cd 40 int $0x40
367: c3 ret
00000368 <pipe>:
SYSCALL(pipe)
368: b8 04 00 00 00 mov $0x4,%eax
36d: cd 40 int $0x40
36f: c3 ret
00000370 <read>:
SYSCALL(read)
370: b8 05 00 00 00 mov $0x5,%eax
375: cd 40 int $0x40
377: c3 ret
00000378 <write>:
SYSCALL(write)
378: b8 10 00 00 00 mov $0x10,%eax
37d: cd 40 int $0x40
37f: c3 ret
00000380 <close>:
SYSCALL(close)
380: b8 15 00 00 00 mov $0x15,%eax
385: cd 40 int $0x40
387: c3 ret
00000388 <kill>:
SYSCALL(kill)
388: b8 06 00 00 00 mov $0x6,%eax
38d: cd 40 int $0x40
38f: c3 ret
00000390 <exec>:
SYSCALL(exec)
390: b8 07 00 00 00 mov $0x7,%eax
395: cd 40 int $0x40
397: c3 ret
00000398 <open>:
SYSCALL(open)
398: b8 0f 00 00 00 mov $0xf,%eax
39d: cd 40 int $0x40
39f: c3 ret
000003a0 <mknod>:
SYSCALL(mknod)
3a0: b8 11 00 00 00 mov $0x11,%eax
3a5: cd 40 int $0x40
3a7: c3 ret
000003a8 <unlink>:
SYSCALL(unlink)
3a8: b8 12 00 00 00 mov $0x12,%eax
3ad: cd 40 int $0x40
3af: c3 ret
000003b0 <fstat>:
SYSCALL(fstat)
3b0: b8 08 00 00 00 mov $0x8,%eax
3b5: cd 40 int $0x40
3b7: c3 ret
000003b8 <link>:
SYSCALL(link)
3b8: b8 13 00 00 00 mov $0x13,%eax
3bd: cd 40 int $0x40
3bf: c3 ret
000003c0 <mkdir>:
SYSCALL(mkdir)
3c0: b8 14 00 00 00 mov $0x14,%eax
3c5: cd 40 int $0x40
3c7: c3 ret
000003c8 <chdir>:
SYSCALL(chdir)
3c8: b8 09 00 00 00 mov $0x9,%eax
3cd: cd 40 int $0x40
3cf: c3 ret
000003d0 <dup>:
SYSCALL(dup)
3d0: b8 0a 00 00 00 mov $0xa,%eax
3d5: cd 40 int $0x40
3d7: c3 ret
000003d8 <getpid>:
SYSCALL(getpid)
3d8: b8 0b 00 00 00 mov $0xb,%eax
3dd: cd 40 int $0x40
3df: c3 ret
000003e0 <sbrk>:
SYSCALL(sbrk)
3e0: b8 0c 00 00 00 mov $0xc,%eax
3e5: cd 40 int $0x40
3e7: c3 ret
000003e8 <sleep>:
SYSCALL(sleep)
3e8: b8 0d 00 00 00 mov $0xd,%eax
3ed: cd 40 int $0x40
3ef: c3 ret
000003f0 <uptime>:
SYSCALL(uptime)
3f0: b8 0e 00 00 00 mov $0xe,%eax
3f5: cd 40 int $0x40
3f7: c3 ret
000003f8 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
3f8: 55 push %ebp
3f9: 89 e5 mov %esp,%ebp
3fb: 83 ec 18 sub $0x18,%esp
3fe: 8b 45 0c mov 0xc(%ebp),%eax
401: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
404: 83 ec 04 sub $0x4,%esp
407: 6a 01 push $0x1
409: 8d 45 f4 lea -0xc(%ebp),%eax
40c: 50 push %eax
40d: ff 75 08 pushl 0x8(%ebp)
410: e8 63 ff ff ff call 378 <write>
415: 83 c4 10 add $0x10,%esp
}
418: 90 nop
419: c9 leave
41a: c3 ret
0000041b <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
41b: 55 push %ebp
41c: 89 e5 mov %esp,%ebp
41e: 53 push %ebx
41f: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
422: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
429: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
42d: 74 17 je 446 <printint+0x2b>
42f: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
433: 79 11 jns 446 <printint+0x2b>
neg = 1;
435: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
43c: 8b 45 0c mov 0xc(%ebp),%eax
43f: f7 d8 neg %eax
441: 89 45 ec mov %eax,-0x14(%ebp)
444: eb 06 jmp 44c <printint+0x31>
} else {
x = xx;
446: 8b 45 0c mov 0xc(%ebp),%eax
449: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
44c: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
453: 8b 4d f4 mov -0xc(%ebp),%ecx
456: 8d 41 01 lea 0x1(%ecx),%eax
459: 89 45 f4 mov %eax,-0xc(%ebp)
45c: 8b 5d 10 mov 0x10(%ebp),%ebx
45f: 8b 45 ec mov -0x14(%ebp),%eax
462: ba 00 00 00 00 mov $0x0,%edx
467: f7 f3 div %ebx
469: 89 d0 mov %edx,%eax
46b: 0f b6 80 2c 0b 00 00 movzbl 0xb2c(%eax),%eax
472: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
476: 8b 5d 10 mov 0x10(%ebp),%ebx
479: 8b 45 ec mov -0x14(%ebp),%eax
47c: ba 00 00 00 00 mov $0x0,%edx
481: f7 f3 div %ebx
483: 89 45 ec mov %eax,-0x14(%ebp)
486: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
48a: 75 c7 jne 453 <printint+0x38>
if(neg)
48c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
490: 74 2d je 4bf <printint+0xa4>
buf[i++] = '-';
492: 8b 45 f4 mov -0xc(%ebp),%eax
495: 8d 50 01 lea 0x1(%eax),%edx
498: 89 55 f4 mov %edx,-0xc(%ebp)
49b: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4a0: eb 1d jmp 4bf <printint+0xa4>
putc(fd, buf[i]);
4a2: 8d 55 dc lea -0x24(%ebp),%edx
4a5: 8b 45 f4 mov -0xc(%ebp),%eax
4a8: 01 d0 add %edx,%eax
4aa: 0f b6 00 movzbl (%eax),%eax
4ad: 0f be c0 movsbl %al,%eax
4b0: 83 ec 08 sub $0x8,%esp
4b3: 50 push %eax
4b4: ff 75 08 pushl 0x8(%ebp)
4b7: e8 3c ff ff ff call 3f8 <putc>
4bc: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
4bf: 83 6d f4 01 subl $0x1,-0xc(%ebp)
4c3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4c7: 79 d9 jns 4a2 <printint+0x87>
putc(fd, buf[i]);
}
4c9: 90 nop
4ca: 8b 5d fc mov -0x4(%ebp),%ebx
4cd: c9 leave
4ce: c3 ret
000004cf <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4cf: 55 push %ebp
4d0: 89 e5 mov %esp,%ebp
4d2: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4d5: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
4dc: 8d 45 0c lea 0xc(%ebp),%eax
4df: 83 c0 04 add $0x4,%eax
4e2: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
4e5: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
4ec: e9 59 01 00 00 jmp 64a <printf+0x17b>
c = fmt[i] & 0xff;
4f1: 8b 55 0c mov 0xc(%ebp),%edx
4f4: 8b 45 f0 mov -0x10(%ebp),%eax
4f7: 01 d0 add %edx,%eax
4f9: 0f b6 00 movzbl (%eax),%eax
4fc: 0f be c0 movsbl %al,%eax
4ff: 25 ff 00 00 00 and $0xff,%eax
504: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
507: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
50b: 75 2c jne 539 <printf+0x6a>
if(c == '%'){
50d: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
511: 75 0c jne 51f <printf+0x50>
state = '%';
513: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
51a: e9 27 01 00 00 jmp 646 <printf+0x177>
} else {
putc(fd, c);
51f: 8b 45 e4 mov -0x1c(%ebp),%eax
522: 0f be c0 movsbl %al,%eax
525: 83 ec 08 sub $0x8,%esp
528: 50 push %eax
529: ff 75 08 pushl 0x8(%ebp)
52c: e8 c7 fe ff ff call 3f8 <putc>
531: 83 c4 10 add $0x10,%esp
534: e9 0d 01 00 00 jmp 646 <printf+0x177>
}
} else if(state == '%'){
539: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
53d: 0f 85 03 01 00 00 jne 646 <printf+0x177>
if(c == 'd'){
543: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
547: 75 1e jne 567 <printf+0x98>
printint(fd, *ap, 10, 1);
549: 8b 45 e8 mov -0x18(%ebp),%eax
54c: 8b 00 mov (%eax),%eax
54e: 6a 01 push $0x1
550: 6a 0a push $0xa
552: 50 push %eax
553: ff 75 08 pushl 0x8(%ebp)
556: e8 c0 fe ff ff call 41b <printint>
55b: 83 c4 10 add $0x10,%esp
ap++;
55e: 83 45 e8 04 addl $0x4,-0x18(%ebp)
562: e9 d8 00 00 00 jmp 63f <printf+0x170>
} else if(c == 'x' || c == 'p'){
567: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
56b: 74 06 je 573 <printf+0xa4>
56d: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
571: 75 1e jne 591 <printf+0xc2>
printint(fd, *ap, 16, 0);
573: 8b 45 e8 mov -0x18(%ebp),%eax
576: 8b 00 mov (%eax),%eax
578: 6a 00 push $0x0
57a: 6a 10 push $0x10
57c: 50 push %eax
57d: ff 75 08 pushl 0x8(%ebp)
580: e8 96 fe ff ff call 41b <printint>
585: 83 c4 10 add $0x10,%esp
ap++;
588: 83 45 e8 04 addl $0x4,-0x18(%ebp)
58c: e9 ae 00 00 00 jmp 63f <printf+0x170>
} else if(c == 's'){
591: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
595: 75 43 jne 5da <printf+0x10b>
s = (char*)*ap;
597: 8b 45 e8 mov -0x18(%ebp),%eax
59a: 8b 00 mov (%eax),%eax
59c: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
59f: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5a3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5a7: 75 25 jne 5ce <printf+0xff>
s = "(null)";
5a9: c7 45 f4 d5 08 00 00 movl $0x8d5,-0xc(%ebp)
while(*s != 0){
5b0: eb 1c jmp 5ce <printf+0xff>
putc(fd, *s);
5b2: 8b 45 f4 mov -0xc(%ebp),%eax
5b5: 0f b6 00 movzbl (%eax),%eax
5b8: 0f be c0 movsbl %al,%eax
5bb: 83 ec 08 sub $0x8,%esp
5be: 50 push %eax
5bf: ff 75 08 pushl 0x8(%ebp)
5c2: e8 31 fe ff ff call 3f8 <putc>
5c7: 83 c4 10 add $0x10,%esp
s++;
5ca: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
5ce: 8b 45 f4 mov -0xc(%ebp),%eax
5d1: 0f b6 00 movzbl (%eax),%eax
5d4: 84 c0 test %al,%al
5d6: 75 da jne 5b2 <printf+0xe3>
5d8: eb 65 jmp 63f <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5da: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
5de: 75 1d jne 5fd <printf+0x12e>
putc(fd, *ap);
5e0: 8b 45 e8 mov -0x18(%ebp),%eax
5e3: 8b 00 mov (%eax),%eax
5e5: 0f be c0 movsbl %al,%eax
5e8: 83 ec 08 sub $0x8,%esp
5eb: 50 push %eax
5ec: ff 75 08 pushl 0x8(%ebp)
5ef: e8 04 fe ff ff call 3f8 <putc>
5f4: 83 c4 10 add $0x10,%esp
ap++;
5f7: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5fb: eb 42 jmp 63f <printf+0x170>
} else if(c == '%'){
5fd: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
601: 75 17 jne 61a <printf+0x14b>
putc(fd, c);
603: 8b 45 e4 mov -0x1c(%ebp),%eax
606: 0f be c0 movsbl %al,%eax
609: 83 ec 08 sub $0x8,%esp
60c: 50 push %eax
60d: ff 75 08 pushl 0x8(%ebp)
610: e8 e3 fd ff ff call 3f8 <putc>
615: 83 c4 10 add $0x10,%esp
618: eb 25 jmp 63f <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
61a: 83 ec 08 sub $0x8,%esp
61d: 6a 25 push $0x25
61f: ff 75 08 pushl 0x8(%ebp)
622: e8 d1 fd ff ff call 3f8 <putc>
627: 83 c4 10 add $0x10,%esp
putc(fd, c);
62a: 8b 45 e4 mov -0x1c(%ebp),%eax
62d: 0f be c0 movsbl %al,%eax
630: 83 ec 08 sub $0x8,%esp
633: 50 push %eax
634: ff 75 08 pushl 0x8(%ebp)
637: e8 bc fd ff ff call 3f8 <putc>
63c: 83 c4 10 add $0x10,%esp
}
state = 0;
63f: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
646: 83 45 f0 01 addl $0x1,-0x10(%ebp)
64a: 8b 55 0c mov 0xc(%ebp),%edx
64d: 8b 45 f0 mov -0x10(%ebp),%eax
650: 01 d0 add %edx,%eax
652: 0f b6 00 movzbl (%eax),%eax
655: 84 c0 test %al,%al
657: 0f 85 94 fe ff ff jne 4f1 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
65d: 90 nop
65e: c9 leave
65f: c3 ret
00000660 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
660: 55 push %ebp
661: 89 e5 mov %esp,%ebp
663: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
666: 8b 45 08 mov 0x8(%ebp),%eax
669: 83 e8 08 sub $0x8,%eax
66c: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
66f: a1 48 0b 00 00 mov 0xb48,%eax
674: 89 45 fc mov %eax,-0x4(%ebp)
677: eb 24 jmp 69d <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
679: 8b 45 fc mov -0x4(%ebp),%eax
67c: 8b 00 mov (%eax),%eax
67e: 3b 45 fc cmp -0x4(%ebp),%eax
681: 77 12 ja 695 <free+0x35>
683: 8b 45 f8 mov -0x8(%ebp),%eax
686: 3b 45 fc cmp -0x4(%ebp),%eax
689: 77 24 ja 6af <free+0x4f>
68b: 8b 45 fc mov -0x4(%ebp),%eax
68e: 8b 00 mov (%eax),%eax
690: 3b 45 f8 cmp -0x8(%ebp),%eax
693: 77 1a ja 6af <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
695: 8b 45 fc mov -0x4(%ebp),%eax
698: 8b 00 mov (%eax),%eax
69a: 89 45 fc mov %eax,-0x4(%ebp)
69d: 8b 45 f8 mov -0x8(%ebp),%eax
6a0: 3b 45 fc cmp -0x4(%ebp),%eax
6a3: 76 d4 jbe 679 <free+0x19>
6a5: 8b 45 fc mov -0x4(%ebp),%eax
6a8: 8b 00 mov (%eax),%eax
6aa: 3b 45 f8 cmp -0x8(%ebp),%eax
6ad: 76 ca jbe 679 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
6af: 8b 45 f8 mov -0x8(%ebp),%eax
6b2: 8b 40 04 mov 0x4(%eax),%eax
6b5: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6bc: 8b 45 f8 mov -0x8(%ebp),%eax
6bf: 01 c2 add %eax,%edx
6c1: 8b 45 fc mov -0x4(%ebp),%eax
6c4: 8b 00 mov (%eax),%eax
6c6: 39 c2 cmp %eax,%edx
6c8: 75 24 jne 6ee <free+0x8e>
bp->s.size += p->s.ptr->s.size;
6ca: 8b 45 f8 mov -0x8(%ebp),%eax
6cd: 8b 50 04 mov 0x4(%eax),%edx
6d0: 8b 45 fc mov -0x4(%ebp),%eax
6d3: 8b 00 mov (%eax),%eax
6d5: 8b 40 04 mov 0x4(%eax),%eax
6d8: 01 c2 add %eax,%edx
6da: 8b 45 f8 mov -0x8(%ebp),%eax
6dd: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
6e0: 8b 45 fc mov -0x4(%ebp),%eax
6e3: 8b 00 mov (%eax),%eax
6e5: 8b 10 mov (%eax),%edx
6e7: 8b 45 f8 mov -0x8(%ebp),%eax
6ea: 89 10 mov %edx,(%eax)
6ec: eb 0a jmp 6f8 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
6ee: 8b 45 fc mov -0x4(%ebp),%eax
6f1: 8b 10 mov (%eax),%edx
6f3: 8b 45 f8 mov -0x8(%ebp),%eax
6f6: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
6f8: 8b 45 fc mov -0x4(%ebp),%eax
6fb: 8b 40 04 mov 0x4(%eax),%eax
6fe: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
705: 8b 45 fc mov -0x4(%ebp),%eax
708: 01 d0 add %edx,%eax
70a: 3b 45 f8 cmp -0x8(%ebp),%eax
70d: 75 20 jne 72f <free+0xcf>
p->s.size += bp->s.size;
70f: 8b 45 fc mov -0x4(%ebp),%eax
712: 8b 50 04 mov 0x4(%eax),%edx
715: 8b 45 f8 mov -0x8(%ebp),%eax
718: 8b 40 04 mov 0x4(%eax),%eax
71b: 01 c2 add %eax,%edx
71d: 8b 45 fc mov -0x4(%ebp),%eax
720: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
723: 8b 45 f8 mov -0x8(%ebp),%eax
726: 8b 10 mov (%eax),%edx
728: 8b 45 fc mov -0x4(%ebp),%eax
72b: 89 10 mov %edx,(%eax)
72d: eb 08 jmp 737 <free+0xd7>
} else
p->s.ptr = bp;
72f: 8b 45 fc mov -0x4(%ebp),%eax
732: 8b 55 f8 mov -0x8(%ebp),%edx
735: 89 10 mov %edx,(%eax)
freep = p;
737: 8b 45 fc mov -0x4(%ebp),%eax
73a: a3 48 0b 00 00 mov %eax,0xb48
}
73f: 90 nop
740: c9 leave
741: c3 ret
00000742 <morecore>:
static Header*
morecore(uint nu)
{
742: 55 push %ebp
743: 89 e5 mov %esp,%ebp
745: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
748: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
74f: 77 07 ja 758 <morecore+0x16>
nu = 4096;
751: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
758: 8b 45 08 mov 0x8(%ebp),%eax
75b: c1 e0 03 shl $0x3,%eax
75e: 83 ec 0c sub $0xc,%esp
761: 50 push %eax
762: e8 79 fc ff ff call 3e0 <sbrk>
767: 83 c4 10 add $0x10,%esp
76a: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
76d: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
771: 75 07 jne 77a <morecore+0x38>
return 0;
773: b8 00 00 00 00 mov $0x0,%eax
778: eb 26 jmp 7a0 <morecore+0x5e>
hp = (Header*)p;
77a: 8b 45 f4 mov -0xc(%ebp),%eax
77d: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
780: 8b 45 f0 mov -0x10(%ebp),%eax
783: 8b 55 08 mov 0x8(%ebp),%edx
786: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
789: 8b 45 f0 mov -0x10(%ebp),%eax
78c: 83 c0 08 add $0x8,%eax
78f: 83 ec 0c sub $0xc,%esp
792: 50 push %eax
793: e8 c8 fe ff ff call 660 <free>
798: 83 c4 10 add $0x10,%esp
return freep;
79b: a1 48 0b 00 00 mov 0xb48,%eax
}
7a0: c9 leave
7a1: c3 ret
000007a2 <malloc>:
void*
malloc(uint nbytes)
{
7a2: 55 push %ebp
7a3: 89 e5 mov %esp,%ebp
7a5: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7a8: 8b 45 08 mov 0x8(%ebp),%eax
7ab: 83 c0 07 add $0x7,%eax
7ae: c1 e8 03 shr $0x3,%eax
7b1: 83 c0 01 add $0x1,%eax
7b4: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
7b7: a1 48 0b 00 00 mov 0xb48,%eax
7bc: 89 45 f0 mov %eax,-0x10(%ebp)
7bf: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7c3: 75 23 jne 7e8 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
7c5: c7 45 f0 40 0b 00 00 movl $0xb40,-0x10(%ebp)
7cc: 8b 45 f0 mov -0x10(%ebp),%eax
7cf: a3 48 0b 00 00 mov %eax,0xb48
7d4: a1 48 0b 00 00 mov 0xb48,%eax
7d9: a3 40 0b 00 00 mov %eax,0xb40
base.s.size = 0;
7de: c7 05 44 0b 00 00 00 movl $0x0,0xb44
7e5: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7e8: 8b 45 f0 mov -0x10(%ebp),%eax
7eb: 8b 00 mov (%eax),%eax
7ed: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7f0: 8b 45 f4 mov -0xc(%ebp),%eax
7f3: 8b 40 04 mov 0x4(%eax),%eax
7f6: 3b 45 ec cmp -0x14(%ebp),%eax
7f9: 72 4d jb 848 <malloc+0xa6>
if(p->s.size == nunits)
7fb: 8b 45 f4 mov -0xc(%ebp),%eax
7fe: 8b 40 04 mov 0x4(%eax),%eax
801: 3b 45 ec cmp -0x14(%ebp),%eax
804: 75 0c jne 812 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
806: 8b 45 f4 mov -0xc(%ebp),%eax
809: 8b 10 mov (%eax),%edx
80b: 8b 45 f0 mov -0x10(%ebp),%eax
80e: 89 10 mov %edx,(%eax)
810: eb 26 jmp 838 <malloc+0x96>
else {
p->s.size -= nunits;
812: 8b 45 f4 mov -0xc(%ebp),%eax
815: 8b 40 04 mov 0x4(%eax),%eax
818: 2b 45 ec sub -0x14(%ebp),%eax
81b: 89 c2 mov %eax,%edx
81d: 8b 45 f4 mov -0xc(%ebp),%eax
820: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
823: 8b 45 f4 mov -0xc(%ebp),%eax
826: 8b 40 04 mov 0x4(%eax),%eax
829: c1 e0 03 shl $0x3,%eax
82c: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
82f: 8b 45 f4 mov -0xc(%ebp),%eax
832: 8b 55 ec mov -0x14(%ebp),%edx
835: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
838: 8b 45 f0 mov -0x10(%ebp),%eax
83b: a3 48 0b 00 00 mov %eax,0xb48
return (void*)(p + 1);
840: 8b 45 f4 mov -0xc(%ebp),%eax
843: 83 c0 08 add $0x8,%eax
846: eb 3b jmp 883 <malloc+0xe1>
}
if(p == freep)
848: a1 48 0b 00 00 mov 0xb48,%eax
84d: 39 45 f4 cmp %eax,-0xc(%ebp)
850: 75 1e jne 870 <malloc+0xce>
if((p = morecore(nunits)) == 0)
852: 83 ec 0c sub $0xc,%esp
855: ff 75 ec pushl -0x14(%ebp)
858: e8 e5 fe ff ff call 742 <morecore>
85d: 83 c4 10 add $0x10,%esp
860: 89 45 f4 mov %eax,-0xc(%ebp)
863: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
867: 75 07 jne 870 <malloc+0xce>
return 0;
869: b8 00 00 00 00 mov $0x0,%eax
86e: eb 13 jmp 883 <malloc+0xe1>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
870: 8b 45 f4 mov -0xc(%ebp),%eax
873: 89 45 f0 mov %eax,-0x10(%ebp)
876: 8b 45 f4 mov -0xc(%ebp),%eax
879: 8b 00 mov (%eax),%eax
87b: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
87e: e9 6d ff ff ff jmp 7f0 <malloc+0x4e>
}
883: c9 leave
884: c3 ret
| 34.383081
| 60
| 0.422404
|
8a8193c89d95bda04dcd1fd00755cbd2680002b3
| 380
|
asm
|
Assembly
|
programs/oeis/343/A343842.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/343/A343842.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/343/A343842.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A343842: Series expansion of 1/sqrt(8*x^2 + 1), even powers only.
; 1,-4,24,-160,1120,-8064,59136,-439296,3294720,-24893440,189190144,-1444724736,11076222976,-85201715200,657270374400,-5082890895360,39392404439040,-305870434467840,2378992268083200,-18531097667174400,144542561803960320,-1128808577897594880
mov $1,-2
pow $1,$0
mov $2,$0
add $2,$0
bin $2,$0
mul $1,$2
mov $0,$1
| 34.545455
| 240
| 0.757895
|
bba94f509624368fc1c54f098bb1ebddb600c3eb
| 151
|
asm
|
Assembly
|
tests/asm/add.asm
|
benjaminselfridge/lc3b
|
12d2cf93799d98ae6b927d93456b0939ba25a6d6
|
[
"BSD-3-Clause"
] | 5
|
2019-11-27T06:50:14.000Z
|
2021-08-30T23:51:45.000Z
|
tests/asm/add.asm
|
benjaminselfridge/lc3b
|
12d2cf93799d98ae6b927d93456b0939ba25a6d6
|
[
"BSD-3-Clause"
] | null | null | null |
tests/asm/add.asm
|
benjaminselfridge/lc3b
|
12d2cf93799d98ae6b927d93456b0939ba25a6d6
|
[
"BSD-3-Clause"
] | null | null | null |
0x3000
ADD R0 R0 0x9
ADD R1 R0 R0
ADD R2 R1 R0
ADD R3 R2 -1
ADD R4 R2 0x0f
TRAP 0x0
| 16.777778
| 24
| 0.397351
|
194a6cbb9456ce4155f1b8477014f4182deefb43
| 231
|
asm
|
Assembly
|
Codigos exemplos/ex_printf.asm
|
LFMP/ARQ1
|
0f675e2e7c68a8e7ac97332e186170e5e4cfda45
|
[
"MIT"
] | 2
|
2018-09-08T18:14:41.000Z
|
2018-09-24T16:14:27.000Z
|
Codigos exemplos/ex_printf.asm
|
LFMP/ARQ1
|
0f675e2e7c68a8e7ac97332e186170e5e4cfda45
|
[
"MIT"
] | null | null | null |
Codigos exemplos/ex_printf.asm
|
LFMP/ARQ1
|
0f675e2e7c68a8e7ac97332e186170e5e4cfda45
|
[
"MIT"
] | null | null | null |
BITS 64
extern printf
section .data
fmt1 db "Valor = %d", 10, 0 ; -> "fmt1"=nome de uma variável, "10" = ENTER, "0" = "\0"
section .text
global main
main:
mov rax, 10
mov rsi, rax
mov rdi, fmt1
xor rax, rax
call printf
ret
| 15.4
| 87
| 0.640693
|
46c15365e1710ee3df6fc2dc68240cd32290cc1c
| 702
|
asm
|
Assembly
|
ch12/LoadAndStore.asm
|
William0Friend/my_masm
|
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
|
[
"Apache-2.0"
] | null | null | null |
ch12/LoadAndStore.asm
|
William0Friend/my_masm
|
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
|
[
"Apache-2.0"
] | null | null | null |
ch12/LoadAndStore.asm
|
William0Friend/my_masm
|
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
|
[
"Apache-2.0"
] | null | null | null |
; Load and Store (floats) (LoadAndStore.asm)
; This program demonstrates the use of Load and Store
; instructions in the FPU instruction set.
INCLUDE Irvine32.inc
.code
main PROC
.data
dblOne REAL8 1234.56
dblTwo REAL8 10.1
dblThree REAL8 ?
dblFour REAL8 ?
bigVal REAL10 1.0123456789012345E+864
.code
finit
; Load a large value onto the stack, pop it
; back into the same variable.
fld bigVal
fstp bigVal
; Load two operands onto the stack
fld dblOne
fld dblTwo
call ShowFPUStack
; Store operands into memory, pop from stack
fstp dblThree
call ShowFPUStack
fstp dblFour
call ShowFPUStack
exit
main ENDP
END main
| 16.325581
| 55
| 0.692308
|
14268c96ed081dba94354e37853e9b1bd42f133e
| 381
|
asm
|
Assembly
|
oeis/103/A103974.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/103/A103974.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/103/A103974.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A103974: Smaller sides (a) in (a,a,a+1)-integer triangle with integer area.
; Submitted by Jamie Morken(s3)
; 1,5,65,901,12545,174725,2433601,33895685,472105985,6575588101,91586127425,1275630195845,17767236614401,247465682405765,3446752317066305,48007066756522501,668652182274248705
mov $2,1
lpb $0
sub $0,1
add $2,$1
add $1,$2
add $1,$2
lpe
pow $1,2
mov $0,$1
add $0,1
| 25.4
| 174
| 0.742782
|
9571d27770eb606fff0835e6e9a67035d51b319d
| 3,370
|
asm
|
Assembly
|
adamova.asm
|
hajzer/asm-basic-examples
|
e8a32746ea5e20eb3c769d4a859337aa1dbc4f57
|
[
"MIT"
] | null | null | null |
adamova.asm
|
hajzer/asm-basic-examples
|
e8a32746ea5e20eb3c769d4a859337aa1dbc4f57
|
[
"MIT"
] | null | null | null |
adamova.asm
|
hajzer/asm-basic-examples
|
e8a32746ea5e20eb3c769d4a859337aa1dbc4f57
|
[
"MIT"
] | null | null | null |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Nacitajte z klavesnice retazec znakov ukonceny znakom "noveho
; riadku".Nech slovo je postupnost znakov medzi dvoma
; znakmi"medzera".Urcte pocet slov, v ktorych sucet ASCII kodov
; znakov je vacsi ako 100.Pocet vytlacte desiatkovo.
;
; Autor: LALA -> lala (at) linuxor (dot) sk
; Datum: 20.1.2003
;
; Subor: adamova.asm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.model small
.stack 100
.data
sucet dw 0
pocet dw 0
vypis db "Pocet slov ktorych sucet ASCII kodov je vacsi ako 100 je:$"
.code
jmp Start ; skok na Start
; Procedura umoznuje vypis cisel v nasle-
; dovnych ciselnych sustavach 2,8,10,16.
;
; Vstup: register AX = cislo
; register BX = zaklad sustavy
;
; Vystup: cez INT 21h na obrazovku
premen proc near
push ax
xor cx, cx
wn0:
xor dx, dx
div bx
push dx
inc cx
test ax, ax
jnz wn0
wn2:
pop dx
or dl, '0'
cmp dl, '9'
jbe wn3
add dl, 7
wn3:
mov ah, 2
int 21h
loop wn2
pop ax
ret
premen endp
Start:
mov ax,@data ; zistime kde su data
mov ds,ax ; a ulozime si ich do segmentoveho registra
citaj:
mov ah,1 ; sluzba nacita a zaroven vypise znak
int 21h ; volanie prerusenia
cmp al,' ' ; nacitany znak porovname zo znakom medzera
je space ; ak sa zhoduje skok na navestie space
cmp al,13 ; nacitany znak porovname zo znakom "novy riadok"
je last ; ak sa zhoduje skok na navestie last
mov ah,0 ; do subregistra ah dame 0
add sucet,ax ; pripocitame ASCII hodnotu znaku k celkovemu suctu slova
jmp citaj ; skok na citaj
space:
cmp sucet,100 ; porovnaj sucet ASCII kodov slova a 100
jg pripocitaj ; ak sucet je vacsi tak skok na _pripocitaj
mov sucet,0 ; vynuluj sucet
jmp citaj ; skok na _citaj_znak
last:
cmp sucet,100 ; porovnaj sucet ASCII kodov slova a 100
jg pripocitaj_last ; ak sucet je vacsi tak skok na _pripocitaj_EOF
jmp vypis_text ; skok na vypis_text
pripocitaj:
inc pocet ; zvys pocet o 1
mov sucet,0 ; vynuluj sucet
jmp citaj ; skok
pripocitaj_last:
inc pocet ; zvys pocet o 1
vypis_text: ; vypise hlasku
mov dx,OFFSET vypis ; do registra dx dame offset retazca ktory chceme vypisat
mov ah,09h ; sluzba 09 = vypis retazca na STDOUT
int 21h ; volanie prerusenia
mov ax,pocet ; vypise pocet slov, ktorych sucet ASCII ...
mov bx,10 ; vypise to desiatkovo
call premen ; pouziva sa pri tom procedura premen
koniec:
mov ax,4c00h ; exit do DOS-u
int 21h ; volanie prerusenia
end Start
| 31.792453
| 90
| 0.504451
|
c24077f4e6126cc044de0677666c682492869459
| 869
|
asm
|
Assembly
|
src/data/interrupts.asm
|
Hacktix/gb-tictactoe
|
d20409c58e4fa4a25ce5f07dbfd51de64d864c3c
|
[
"MIT"
] | 8
|
2020-09-06T15:50:46.000Z
|
2021-09-24T21:54:27.000Z
|
src/data/interrupts.asm
|
Hacktix/gb-tictactoe
|
d20409c58e4fa4a25ce5f07dbfd51de64d864c3c
|
[
"MIT"
] | null | null | null |
src/data/interrupts.asm
|
Hacktix/gb-tictactoe
|
d20409c58e4fa4a25ce5f07dbfd51de64d864c3c
|
[
"MIT"
] | 1
|
2021-07-23T14:51:01.000Z
|
2021-07-23T14:51:01.000Z
|
SECTION "VBlank Handler", ROM0
VBlankHandler::
; Do OAM DMA if requested
ldh a, [hStartAddrOAM]
and a
jr z, .noOAMDMA
call hOAMDMA
xor a
ldh [hStartAddrOAM], a
.noOAMDMA
; Print string if requested
ldh a, [hStringDrawFlag]
and a
jr z, .noStringDraw
ld a, [hStringLocationAddr]
ld h, a
ld a, [hStringLocationAddr+1]
ld l, a
ld a, [hStringPointerAddr]
ld d, a
ld a, [hStringPointerAddr+1]
ld e, a
rst CopyString
xor a
ldh [hStringDrawFlag], a
.noStringDraw
; Fetch inputs
ld c, LOW(rP1)
ld a, $20
ldh [c], a
rept 6
ldh a, [c]
endr
or $F0
ld b, a
swap b
ld a, $10
ldh [c], a
rept 6
ldh a, [c]
endr
and $0F
or $F0
xor b
ld b, a
ld a, $30
ldh [c], a
ldh a, [hHeldButtons]
cpl
and b
ldh [hPressedButtons], a
ld a, b
ldh [hHeldButtons], a
reti
| 15.245614
| 33
| 0.591484
|
efcef0b91404f5299de8c6d73804c34ffb3c1d6d
| 1,035
|
asm
|
Assembly
|
programs/oeis/230/A230547.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/230/A230547.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/230/A230547.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A230547: a(n) = 3*binomial(3*n+9, n)/(n+3).
; 1,9,63,408,2565,15939,98670,610740,3786588,23535820,146710476,917263152,5752004349,36174046743,228124619100,1442387942520,9142452842985,58083251802345,369816259792035,2359448984037600,15082416490309740,96586612269316884,619586741695427928,3980919644709754320,25616569392963143400,165073712149258672968,1065172995041307225192,6882022302376458651744,44518081768497716903469,288306287745595446834495,1869148897738878306979512,12130602861355905881409840,78803913508288951363736355,512412605166019083093569547,3334874606376811502751824805,21722470464282685714516657464,141609500099719380689336214013,923875714778019262041601276731,6031956347436143452568827088502,39410567503502448585399724618500,257670235420243588258862673481200,1685779832894578551291722926503600,11035986442273391048965870098097200,72291042521886262593517623831729600,473817139350191152348972265619223500
mov $1,$0
mov $2,$0
cmp $2,0
add $1,$2
mov $3,$0
div $0,$1
add $0,2
add $1,$0
mul $0,$1
bin $0,$3
mul $0,3
div $0,$1
| 64.6875
| 870
| 0.877295
|
ecc39a827dedc10be3b4fd010ad3bcb3dbb9dc01
| 3,604
|
asm
|
Assembly
|
simple_io.asm
|
everbird/coursera_assignments
|
37c9087f41386a0226473e813668370afdd4704c
|
[
"MIT"
] | null | null | null |
simple_io.asm
|
everbird/coursera_assignments
|
37c9087f41386a0226473e813668370afdd4704c
|
[
"MIT"
] | null | null | null |
simple_io.asm
|
everbird/coursera_assignments
|
37c9087f41386a0226473e813668370afdd4704c
|
[
"MIT"
] | null | null | null |
# simple_io.asm
#
# Simple i/o using syscall
# Ref: Coursera | PKU | Computer Organization | Peer Assessments 1
#
# 利用系统功能调用从键盘输入,转换后在屏幕上显示,具体要求如下:
#
# (1) 如果输入的是字母(A~Z,区分大小写)或数字(0~9),则将其转换成对应的英文单词后在屏幕上显示,对应关系见下表
#
# (2) 若输入的不是字母或数字,则在屏幕上输出字符“*”,
#
# (3) 每输入一个字符,即时转换并在屏幕上显示,
#
# (4) 支持反复输入,直到按“?”键结束程序。
#
# :copyright: (c) 2015 by Stephen Zhuang.
#
.data
_A: .asciiz "Alpha\n"
_B: .asciiz "Bravo\n"
_C: .asciiz "China\n"
_D: .asciiz "Delta\n"
_E: .asciiz "Echo\n"
_F: .asciiz "Foxtrot\n"
_G: .asciiz "Golf\n"
_H: .asciiz "Hotel\n"
_I: .asciiz "India\n"
_J: .asciiz "Juliet\n"
_K: .asciiz "Kilo\n"
_L: .asciiz "Lima\n"
_M: .asciiz "Mary\n"
_N: .asciiz "November\n"
_O: .asciiz "Oscar\n"
_P: .asciiz "Paper\n"
_Q: .asciiz "Quebec\n"
_R: .asciiz "Research\n"
_S: .asciiz "Sierra\n"
_T: .asciiz "Tango\n"
_U: .asciiz "Uniform\n"
_V: .asciiz "Victor\n"
_W: .asciiz "Whisky\n"
_X: .asciiz "X-ray\n"
_Y: .asciiz "Yankee\n"
_Z: .asciiz "Zulu\n"
_a: .asciiz "alpha\n"
_b: .asciiz "bravo\n"
_c: .asciiz "china\n"
_d: .asciiz "delta\n"
_e: .asciiz "echo\n"
_f: .asciiz "foxtrot\n"
_g: .asciiz "golf\n"
_h: .asciiz "hotel\n"
_i: .asciiz "india\n"
_j: .asciiz "juliet\n"
_k: .asciiz "kilo\n"
_l: .asciiz "lima\n"
_m: .asciiz "mary\n"
_n: .asciiz "november\n"
_o: .asciiz "oscar\n"
_p: .asciiz "paper\n"
_q: .asciiz "quebec\n"
_r: .asciiz "research\n"
_s: .asciiz "sierra\n"
_t: .asciiz "tango\n"
_u: .asciiz "uniform\n"
_v: .asciiz "victor\n"
_w: .asciiz "whisky\n"
_x: .asciiz "x-ray\n"
_y: .asciiz "yankee\n"
_z: .asciiz "zulu\n"
_0: .asciiz "zero\n"
_1: .asciiz "First\n"
_2: .asciiz "Second\n"
_3: .asciiz "Third\n"
_4: .asciiz "Fourth\n"
_5: .asciiz "Fifth\n"
_6: .asciiz "Sixth\n"
_7: .asciiz "Seventh\n"
_8: .asciiz "Eighth\n"
_9: .asciiz "Ninth\n"
star: .asciiz "*\n"
capitals: .word _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z
lowers: .word _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
numbers: .word _0, _1, _2, _3, _4, _5, _6, _7, _8, _9
.text
.globl main
main:
li $v0, 12
syscall
beq $v0, '?', end
# Ref: http://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart
bgt $v0, 'z', print_default # ascii[z:]
bge $v0, 'a', find_lower # ascii[a:z]
bgt $v0, 'Z', print_default # ascii[Z:a]
bge $v0, 'A', find_capitals # ascii[A:Z]
bgt $v0, '9', print_default # ascii[9:A]
blt $v0, '0', print_default # ascii[:0]
# ascii[0:9]
find_numbers:
la $s0, numbers
li $t3, '0'
j print
find_capitals:
la $s0, capitals
li $t3, 'A'
j print
find_lower:
la $s0, lowers
li $t3, 'a'
j print
print:
sub $t1, $v0, $t3 # Caculate index
mul $t0, $t1, 4 # Caculate address offset for string array
la $t3, ($s0)
add $t1, $t0, $t3 # Find address in string array for symbolic address
lw $t2, ($t1) # Load symbolic address as content from found address
la $a0, ($t2) # Output the found symbloic address content
li $v0, 4
syscall
j main
print_default:
la $a0, star
li $v0, 4
syscall
j main
end:
| 25.928058
| 122
| 0.536626
|
8fea38a7c237a63a04523bbc45bbc3f90d75d708
| 314
|
asm
|
Assembly
|
programs/oeis/103/A103204.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/103/A103204.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/103/A103204.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A103204: a(1) = 2, a(2) = 4; a(n) = 2*a(n-1) - 1.
; 2,4,7,13,25,49,97,193,385,769,1537,3073,6145,12289,24577,49153,98305,196609,393217,786433,1572865,3145729,6291457,12582913,25165825,50331649,100663297,201326593,402653185,805306369,1610612737,3221225473
mov $1,2
pow $1,$0
mul $1,9
div $1,6
add $1,1
mov $0,$1
| 31.4
| 204
| 0.703822
|
d0d7c139f60961fbbbcaeb3db98f10401ea69372
| 2,179
|
asm
|
Assembly
|
basic/src/variables/complex/index.asm
|
paulscottrobson/eris
|
cf102530334ed86360deb20f0e41af1e10f5d584
|
[
"MIT"
] | 13
|
2020-03-31T08:21:22.000Z
|
2021-07-28T20:03:29.000Z
|
basic/src/variables/complex/index.asm
|
paulscottrobson/eris
|
cf102530334ed86360deb20f0e41af1e10f5d584
|
[
"MIT"
] | 37
|
2020-03-31T06:35:37.000Z
|
2020-09-17T08:56:48.000Z
|
basic/src/variables/complex/index.asm
|
paulscottrobson/eris
|
cf102530334ed86360deb20f0e41af1e10f5d584
|
[
"MIT"
] | 5
|
2020-05-10T10:23:06.000Z
|
2022-01-14T02:21:02.000Z
|
; *****************************************************************************
; *****************************************************************************
;
; Name: index.asm
; Purpose: Array Indexing
; Created: 9th March 2020
; Reviewed: 17th March 2020
; Author: Paul Robson (paul@robsons.org.uk)
;
; *****************************************************************************
; *****************************************************************************
; *****************************************************************************
;
; Index the array at R0, with the indices at R11.
;
; *****************************************************************************
.IndexArray
push r1,r2,r3,r4,link
mov r3,r0,#0 ; put the base in R3
jsr #EvaluateInteger ; get the first index
;
; Get the first index
;
ldm r2,r3,#2 ; get the first largest index (e.g. R0 must be 0<=R2<=n)
sub r2,r0,#0 ; compare vs request index
skge ; if largest >= requested ok
jmp #BadIndexError
;
ldm r1,r11,#0 ; get next token
xor r1,#TOK_COMMA ; 2nd index ?
sknz r1
jmp #_IADimension2 ; yes, go do that code.
;
ldm r2,r3,#3 ; check it's a single element array
skz r2
jmp #MissingCommaError ; if there is a non zero 2nd dimension then thereshould be a,b
;
._IADone
add r0,r3,#4 ; point to the correct element
jsr #CheckRightBracket ; check closing parenthesis and exit
pop r1,r2,r3,r4,link
ret
;
; Handle the second index
;
._IADimension2
inc r11 ; step over comma.
mov r4,r0,#0 ; R4 is index 1. R0 is index 2
jsr #EvaluateInteger ; get the second index.
;
ldm r2,r3,#3 ; get the second dimension maximum index.
sknz r2 ; must be non zero
jmp #MissingBracketError
sub r2,r0,#0 ; compare vs request index
skge ; if largest >= requested ok
jmp #BadIndexError
;
ldm r2,r3,#2 ; get the max index of the first index
mult r0,r2,#1 ; add 1 and multiply into second index
add r0,r4,#0 ; add to first, e.g. i1 + i2 * dimension(1)
jmp #_IADone ; and complete
| 34.046875
| 91
| 0.479119
|
6fd41bc64db9d81a1bec280d2fc3df8006121005
| 742
|
asm
|
Assembly
|
nes-test-roms/mmc3_irq_tests/source/5.MMC3_rev_A.asm
|
joebentley/ones
|
d2c7d21bd94dda9d312c56a197cddec164035d4f
|
[
"BSD-2-Clause"
] | 1,461
|
2022-02-25T17:44:34.000Z
|
2022-03-30T06:18:29.000Z
|
rustnes-dev/test_roms/mmc3_irq_tests/source/5.MMC3_rev_A.asm
|
w1n5t0n99/rustnes
|
2d03cc0c5dcc33d6f4ca35a009b2aee9c0d096d4
|
[
"MIT"
] | 17
|
2016-10-30T12:46:35.000Z
|
2020-01-31T11:34:38.000Z
|
rustnes-dev/test_roms/mmc3_irq_tests/source/5.MMC3_rev_A.asm
|
w1n5t0n99/rustnes
|
2d03cc0c5dcc33d6f4ca35a009b2aee9c0d096d4
|
[
"MIT"
] | 47
|
2016-10-24T00:30:56.000Z
|
2022-02-10T15:19:41.000Z
|
; Tests MMC3 revision A differences
.include "prefix_mmc3_validation.a"
test_name:
.db "MMC3 IRQ COUNTER REVISION A",0
reset:
jsr begin_mmc3_tests
lda #2;) IRQ should be set when reloading to 0 after clear
ldx #0
jsr begin_counter_test
jsr clock_counter ; 0
jsr should_be_set
lda #3;) IRQ shouldn't occur when reloading after counter normally reaches 0
ldx #1
jsr begin_counter_test
jsr clock_counter ; 1
lda #0
jsr set_reload
jsr clock_counter ; 0
jsr clear_irq
jsr clock_counter ; 0
jsr should_be_clear
ldx #255
jmp tests_passed
| 23.935484
| 84
| 0.572776
|
31535dcae7eaf4d311f0292f1c439681c2bc7378
| 3,424
|
asm
|
Assembly
|
Maths/Utilities/MoveShip5-MVS5.asm
|
ped7g/EliteNext
|
6e930f9b9924b295d7281ee6acb879600d7e597f
|
[
"Unlicense"
] | 9
|
2021-09-29T22:08:15.000Z
|
2022-03-23T05:35:43.000Z
|
Maths/Utilities/MoveShip5-MVS5.asm
|
ped7g/EliteNext
|
6e930f9b9924b295d7281ee6acb879600d7e597f
|
[
"Unlicense"
] | 1
|
2022-01-21T12:35:42.000Z
|
2022-01-21T17:47:24.000Z
|
Maths/Utilities/MoveShip5-MVS5.asm
|
ped7g/EliteNext
|
6e930f9b9924b295d7281ee6acb879600d7e597f
|
[
"Unlicense"
] | 1
|
2022-01-15T10:13:49.000Z
|
2022-01-15T10:13:49.000Z
|
; T = x hi usigned /2
; RS = inwkx (strip sign)
; so RS -= (xhi /2)
;PA = unkxhi[y] (strip sign)
; T = sign bit inkxhy[y]
MoveShip5:
ld bc,(regX) ; b = regY, c = regX
MoveShip5regBC:
MVS5: ; Moveship5, small rotation in matrix (1-1/2/256 = cos 1/16 = sine)
ld hl,UBnKxhi ; hl - INWK1
.IndexX:
ld a,c ;
add hl,a ;
ld a,(hl) ; INWK+1,X
ld e,a ; save a copy in e for later
and SignMask8Bit ; hi7
srl a ; hi7/2
ld d,a ; repurpose d as var
; ld (varT),a ; T repuposed d to hold sign bit
dec hl
push hl ; we will want this again right at the end
ld a,(hl) ; INWK+0,X
scf ; lo
sbc a,d ; a = a - (varT + carry bit)
ld (varR),a ; R \ Xindex one is 1-1/512
ld a,e ; restore copy of INWK+1,X
sbc a,0 ; hi
ld (varS),a ; S, TODO could we simplify this by loading xlohi into hl and subtracting 1?
ld hl,UBnKxlo ; hl = INWK+0
.IndexY:
ld a,b ;
add hl,a ;
ld a,(hl) ; INWK+0,Y
ld d,a ; use d as a working copy of p
inc hl ;
ld a,(hl) ; INWK+1,Y
ld e,a ; save a copy in e for later
and $80 ; sign bit
ld (varT),a ; T
ld a,e ; restore copy of INWK+1,Y
and SignMask8Bit ; hi7 bits
srl a ; hui7/2
rr d ; P local copy
srl a ; hui7/2
rr d ; P local copy
srl a ; hui7/2
rr d ; P local copy
ld (varP),a ; P is Yindex one divided by 16
or e ; or a with copy of T from e
ld e,a ; now we have done with T so can junk it
ld a,(RAT2)
ld d,a
ld a,e ; bit of juggling so a = varP or T d = RAT2
xor d ; a = varP or T xor RAT2
push hl ; save hl as INWK+1[y]
push bc ; save X and Y (we wont use Q) \ protect Xindex
call XAequPAaddRSfast ; ADD \ X.A = P.A + R.S
ld (varK),de ; as fast add also returns result in de we can just 16 bit load
pop bc ; restore Xindex (also Y index)
pop hl ; restore hl as INWK+1[y]
ld a,(hl) ; INWK+1,Y
and SignMask8Bit ;
srl a ; hi7/2
ld e,a ; use e as varT
dec hl
ld a,(hl) ; INWK+0,Y
scf
sbc a,e ; a = a -t + 1 (t == reg e)
ld (varR),a ; R \ Yindex one is 1-1/512
dec hl
ld a,(hl) ; INWK+1,Y
sbc a,0 ; subtract carry flag
ld (varS),a ; S
pop hl ; get back INWK+0[x]
ld a,(hl) ; INWK+0,X
push bc ; we may need BC later
ld b,a ; save P to work with in b rather than memory for now
inc hl
ld a,(hl) ; INWK+1,X
ld e,a ; save it for a bit
and $80 ; sign bit
ld d,a ; use d as varT
ld a,e ; restore INWK+1,X
and SignMask8Bit ; hi7
srl a
rr b
srl a
rr b
srl a
rr b
ex af,af'
ld a,b
ld (varP),a ; now commit P as p /16
ex af,af'
or e ; T \ sign bit
xor $80 ; flip sign
ld hl,RAT2
xor (hl) ;RAT2 \ rot sign
call XAequPAaddRSfast ; ADD \ X.A = P.A + R.S, note we still have bc on stack
pop bc ; now we have x and y restored
ld hl,UBnKxhi ;
ld a,b
add hl,a ; hl = UBnKxhi[y]
ld (hl),d
dec hl ; hl = UBnKxhi[y]
ld (hl),e ; as XA is in DE also we can just write that Yindex one now updated by 1/16th of a radian rotation
ld hl,UBnKxhi
ld a,c
add hl,a ; hl = INKW+1[X]
ld de,varKp1 ; de = variable k hi
ex de,hl ; swap
ldi
ldi ; load 2 bytes
ret
| 29.016949
| 114
| 0.532418
|
c58398e19b1c83848cd93e168ff8204b41262f4c
| 719
|
asm
|
Assembly
|
oeis/246/A246923.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/246/A246923.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/246/A246923.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A246923: G.f.: 1 / AGM(1-9*x, sqrt((1-x)*(1-81*x))).
; Submitted by Christian Krause
; 1,25,1089,60025,3690241,241025625,16359689025,1140463805625,81081830657025,5852177325225625,427465780890020929,31528177440967935225,2344153069158724611841,175473167541934734763225,13211212029033949825064769,999630716942846408773325625,75966992310311576135500673025,5795247077241777131651666105625,443600966249763118969430099369025,34058741734634371280316203278325625,2622083368452607811311290777079842561,202363321362667198691611594960676360025,15652581628007796094483554530069904972609
seq $0,84771 ; Coefficients of expansion of 1/sqrt(1 - 10*x + 9*x^2); also, a(n) is the central coefficient of (1 + 5*x + 4*x^2)^n.
pow $0,2
| 102.714286
| 488
| 0.841446
|
b1594c5fcf5dd3c9971662c75512db532effe075
| 432
|
asm
|
Assembly
|
oeis/349/A349339.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/349/A349339.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/349/A349339.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A349339: Odd bisection of the Möbius transform of A126760.
; Submitted by Jamie Morken(s3)
; 1,0,1,2,0,3,4,0,5,6,0,7,7,0,9,10,0,8,12,0,13,14,0,15,14,0,17,14,0,19,20,0,16,22,0,23,24,0,20,26,0,27,22,0,29,24,0,24,32,0,33,34,0,35,36,0,37,30,0,32,37,0,33,42,0,43,36,0,45,46,0,40,38,0,49,50,0,40,52,0,44,54,0,55,52,0,57,40,0,59
mul $0,2
add $0,1
mov $2,$0
lpb $2
mov $3,$2
gcd $3,$0
cmp $3,1
add $1,$3
trn $2,3
lpe
mov $0,$1
| 27
| 230
| 0.608796
|
113cbc98fef2428842b10c16858fc49c7c9c6c2a
| 7,132
|
asm
|
Assembly
|
src/main.asm
|
tsoding/wassm
|
7c07639b67ac2e2f1cf816bc57489c14030f07cb
|
[
"MIT"
] | 86
|
2017-09-28T08:15:56.000Z
|
2022-03-18T12:38:39.000Z
|
src/main.asm
|
tsoding/wassm
|
7c07639b67ac2e2f1cf816bc57489c14030f07cb
|
[
"MIT"
] | 33
|
2017-09-23T23:06:44.000Z
|
2018-08-08T16:10:56.000Z
|
src/main.asm
|
tsoding/wassm
|
7c07639b67ac2e2f1cf816bc57489c14030f07cb
|
[
"MIT"
] | 10
|
2017-09-28T10:48:15.000Z
|
2020-10-26T13:30:25.000Z
|
%include "c.inc"
%include "http.inc"
%define REQUEST_BUFFER_CAPACITY 8192
SECTION .data
printf_string:
db "%s", 10, 0
printf_int:
db "%d", 10, 0
signal_handler_message:
db "The application was interrupted by a user...", 10, 0
client_socket_error:
db "Error during reading from the client socket", 10, 0
socket_result_error:
db "Could not create a server socket", 10, 0
inet_aton_result_error:
db "Internet address is not correct: %s", 10, 0
bind_result_error:
db "Could not bind address %s:%d", 10, 0
listen_result_error:
db "Could not listen on the socket", 10, 0
server_started_message:
db "The server was started on port %d", 10, 0
html_served_message:
db "Served Cyka Blyat to %s", 10, 0
usage:
db "Usage: webapp <port>", 10, 0
ip_address:
db "0.0.0.0", 0
server_addr:
istruc sockaddr_in
at sockaddr_in.sin_family, dw AF_INET
at sockaddr_in.sin_port, dw 0
at sockaddr_in.sin_addr, dd 0
at sockaddr_in.sin_zero, dq 0
iend
client_addr:
istruc sockaddr_in
at sockaddr_in.sin_family, dw 0
at sockaddr_in.sin_port, dw 0
at sockaddr_in.sin_addr, dd 0
at sockaddr_in.sin_zero, dq 0
iend
client_addr_size:
dd 16
html_content_type:
db "text/html", 0
css_content_type:
db "text/css", 0
;;; TODO(#55): Serve 404 response from a file instead of hardcoded content
http_404:
db "HTTP/1.1 404 Not found", 13, 10
db "Content-Type: text/plain", 13, 10
db "Content-Length: 9", 13, 10
db 13, 10
db "NOT FOUND", 0
index_route: db "/", 0
css_route: db "/main.css", 0
reuseaddr_enabled:
dd 1
index_html_file:
db "./static/index.html", 0
main_css_file:
db "./static/main.css", 0
SECTION .php
SECTION .bss
argc:
resq 1
argv:
resq 1
port:
resq 1
server_socket:
resq 1
client_socket:
resq 1
current_route:
resq 1
request_buffer:
resb REQUEST_BUFFER_CAPACITY
request_buffer_size:
resq 1
request_parsing_ptr:
resq 1
request_uri_end:
resq 1
prev_byte:
resb 1
interrupted:
resb 1
SECTION .text
global main
main:
push rbp
mov [argc], rdi
mov [argv], rsi
mov rdi, SIGINT
mov rsi, signal_handler
call signal
cmp qword [argc], 2
jge .args_check
;; if argc < 2 then
;; begin
mov rdi, 2
mov rsi, usage
mov rax, 0
call dprintf
pop rbp
mov rax, 1
ret
;; end
.args_check:
mov rdi, [argv]
mov rdi, [rdi + 8]
call atoi
mov [port], rax
;;; server_socket = socket(AF_INET, SOCK_STREAM, 0)
mov rdi, AF_INET
mov rsi, SOCK_STREAM
or rsi, SOCK_NONBLOCK
mov rdx, 0
call socket
mov [server_socket], rax
;;; ---
;;; setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &reuseaddr_enabled, 4)
mov rdi, [server_socket],
mov rsi, SOL_SOCKET
mov rdx, SO_REUSEADDR
mov rcx, reuseaddr_enabled
mov r8, 4
call setsockopt
;;; --
cmp rax, 0
jge .socket_result_check
mov rdi, 2
mov rsi, socket_result_error
call dprintf
jmp .end
.socket_result_check:
;;; port = htons(server_addr.sin_port)
mov rdi, [port]
call htons
mov [server_addr + sockaddr_in.sin_port], rax
;;; ---
;;; inet_aton(ip_address, &server_addr.sin_addr)
mov rdi, ip_address
mov rsi, server_addr + sockaddr_in.sin_addr
call inet_aton
;;; ---
cmp rax, 0
jne .inet_aton_result_check
mov rdi, 2
mov rsi, inet_aton_result_error
mov rdx, ip_address
call dprintf
jmp .end
.inet_aton_result_check:
;;; bind(server_socket, &server_addr, 16)
mov rdi, [server_socket]
mov rsi, server_addr
mov rdx, 16
call bind
;;; ---
cmp rax, 0
je .bind_result_check
mov rdi, 2
mov rsi, bind_result_error
mov rdx, ip_address
mov rcx, [port]
call dprintf
jmp .end
.bind_result_check:
;;; listen(server_socket, 50)
mov rdi, [server_socket]
mov rsi, 50
call listen
;;; ---
cmp rax, 0
je .listen_result_check
mov rdi, 2
mov rsi, listen_result_error
call dprintf
jmp .end
.listen_result_check:
mov rdi, server_started_message
mov rsi, [port]
mov rax, 0
call printf
;; TODO(#9): safely quit on SIGINT
.loop:
mov rdi, [server_socket]
mov rsi, client_addr
mov rdx, client_addr_size
call accept
cmp rax, 0
jl .loop_end
mov [client_socket], rax
;;; printf(html_served_message, inet_ntoa(client_addr.sin_addr))
mov rdi, [client_addr + sockaddr_in.sin_addr]
call inet_ntoa
mov rdi, html_served_message
mov rsi, rax
mov rax, 0
call printf
;;; --
;;; request_buffer_size = read(client_socket, request_buffer, REQUEST_BUFFER_CAPACITY)
mov rdi, [client_socket]
mov rsi, request_buffer
mov rdx, REQUEST_BUFFER_CAPACITY
call read
mov [request_buffer_size], rax
;;; --
;;; request_buffer[request_buffer_size] = 0
mov rax, [request_buffer_size]
mov byte [request_buffer + rax], 0
;;; --
;;; request_parsing_ptr = request_buffer
mov qword [request_parsing_ptr], request_buffer
;;; --
;;; request_parsing_ptr = drop_sp(request_parsing_ptr)
mov rdi, [request_parsing_ptr]
call drop_sp
mov [request_parsing_ptr], rax
;;; --
;;; request_parsing_ptr = parse_method(request_parsing_ptr)
mov rdi, [request_parsing_ptr]
call parse_method
mov [request_parsing_ptr], rax
;;; --
;;; request_parsing_ptr = drop_sp(request_parsing_ptr)
mov rdi, [request_parsing_ptr]
call drop_sp
mov [request_parsing_ptr], rax
;;; --
;;; request_uri_end = parse_request_uri(request_parsing_ptr)
mov rdi, [request_parsing_ptr]
call parse_request_uri
mov [request_uri_end], rax
;;; --
;;; prev_byte = *request_uri_end
mov rax, [request_uri_end]
mov al, [rax]
mov byte [prev_byte], al
;;; --
;;; *request_uri_end = 0
mov rax, [request_uri_end]
mov byte [rax], 0
;;; ---
mov rdi, [request_parsing_ptr]
mov rsi, index_route
call strcmp
cmp rax, 0
jne .check_css_route
;;; http_serve_file(client_socket, html_content_type, index_html_file)
mov rdi, [client_socket]
mov rsi, html_content_type
mov rdx, index_html_file
call http_serve_file
;;; ---
jmp .close_socket
.check_css_route:
mov rdi, [request_parsing_ptr]
mov rsi, css_route
call strcmp
cmp rax, 0
jne .not_found
;;; http_serve_file(client_socket, css_content_type, main_css_file)
mov rdi, [client_socket]
mov rsi, css_content_type
mov rdx, main_css_file
call http_serve_file
;;; ---
jmp .close_socket
.not_found:
;;; dprintf(client_socket, http, css_size, css)
mov rdi, [client_socket],
mov rsi, http_404
mov rax, 0
call dprintf
;;; --
.close_socket:
mov rdi, [client_socket]
call close
.loop_end:
mov rdi, 10
call usleep
cmp byte [interrupted], 0
je .loop
mov rdi, [server_socket]
call close
.end:
pop rbp
mov rax, 0
ret
signal_handler:
push rbp
mov rdi, signal_handler_message
call printf
mov byte [interrupted], 1
pop rbp
ret
| 19.593407
| 86
| 0.660264
|
a56b45785082978cbf381c354b33ccc45d61998a
| 582
|
asm
|
Assembly
|
oeis/216/A216886.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/216/A216886.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/216/A216886.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A216886: Primes p such that x^59 = 2 has a solution mod p.
; Submitted by Jon Maiga
; 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541
lpb $0
mov $2,$0
sub $0,1
seq $2,54541 ; Sum of first n terms equals n-th prime.
add $1,$2
lpe
mov $0,$1
add $0,2
| 44.769231
| 372
| 0.69244
|
0a99ebac093f959350d70a4d4bad1608738d593b
| 1,563
|
asm
|
Assembly
|
programs/oeis/301/A301696.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/301/A301696.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/301/A301696.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A301696: Partial sums of A219529.
; 1,6,17,33,54,81,113,150,193,241,294,353,417,486,561,641,726,817,913,1014,1121,1233,1350,1473,1601,1734,1873,2017,2166,2321,2481,2646,2817,2993,3174,3361,3553,3750,3953,4161,4374,4593,4817,5046,5281,5521,5766,6017,6273,6534,6801,7073,7350,7633,7921,8214,8513,8817,9126,9441,9761,10086,10417,10753,11094,11441,11793,12150,12513,12881,13254,13633,14017,14406,14801,15201,15606,16017,16433,16854,17281,17713,18150,18593,19041,19494,19953,20417,20886,21361,21841,22326,22817,23313,23814,24321,24833,25350,25873,26401,26934,27473,28017,28566,29121,29681,30246,30817,31393,31974,32561,33153,33750,34353,34961,35574,36193,36817,37446,38081,38721,39366,40017,40673,41334,42001,42673,43350,44033,44721,45414,46113,46817,47526,48241,48961,49686,50417,51153,51894,52641,53393,54150,54913,55681,56454,57233,58017,58806,59601,60401,61206,62017,62833,63654,64481,65313,66150,66993,67841,68694,69553,70417,71286,72161,73041,73926,74817,75713,76614,77521,78433,79350,80273,81201,82134,83073,84017,84966,85921,86881,87846,88817,89793,90774,91761,92753,93750,94753,95761,96774,97793,98817,99846,100881,101921,102966,104017,105073,106134,107201,108273,109350,110433,111521,112614,113713,114817,115926,117041,118161,119286,120417,121553,122694,123841,124993,126150,127313,128481,129654,130833,132017,133206,134401,135601,136806,138017,139233,140454,141681,142913,144150,145393,146641,147894,149153,150417,151686,152961,154241,155526,156817,158113,159414,160721,162033,163350,164673,166001
add $0,1
bin $0,2
mul $0,16
div $0,3
mov $1,$0
add $1,1
| 156.3
| 1,469
| 0.816379
|
3a72c6018e6002bb064105ebc6b0ea036823e881
| 10,721
|
asm
|
Assembly
|
msp430/core/fr2476-xt1/interrupts.asm
|
dmrq70/forth-mecrisp
|
50ed8de458ff83f3549f602364ca05c9fe66f8a0
|
[
"Unlicense"
] | 2
|
2019-10-24T19:12:05.000Z
|
2021-02-05T09:26:34.000Z
|
msp430/core/fr2476/interrupts.asm
|
dmrq70/forth-mecrisp
|
50ed8de458ff83f3549f602364ca05c9fe66f8a0
|
[
"Unlicense"
] | null | null | null |
msp430/core/fr2476/interrupts.asm
|
dmrq70/forth-mecrisp
|
50ed8de458ff83f3549f602364ca05c9fe66f8a0
|
[
"Unlicense"
] | null | null | null |
;
; Mecrisp - A native code Forth implementation for MSP430 microcontrollers
; Copyright (C) 2011 Matthias Koch
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program 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 General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
; Interrupt vectors and handlers that can be exchanged on the fly.
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-port1"
CoreVariable irq_hook_port1
;------------------------------------------------------------------------------
pushda #irq_hook_port1
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_port1:
push r7
call &irq_hook_port1
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-port2"
CoreVariable irq_hook_port2
;------------------------------------------------------------------------------
pushda #irq_hook_port2
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_port2:
push r7
call &irq_hook_port2
pop r7
reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-port3"
; CoreVariable irq_hook_port3
;;------------------------------------------------------------------------------
; pushda #irq_hook_port3
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_port3:
; push r7
; call &irq_hook_port3
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-port4"
; CoreVariable irq_hook_port4
;;------------------------------------------------------------------------------
; pushda #irq_hook_port4
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_port4:
; push r7
; call &irq_hook_port4
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-port5"
; CoreVariable irq_hook_port5
;;------------------------------------------------------------------------------
; pushda #irq_hook_port5
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_port5:
; push r7
; call &irq_hook_port5
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-port6"
; CoreVariable irq_hook_port6
;;------------------------------------------------------------------------------
; pushda #irq_hook_port6
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_port6:
; push r7
; call &irq_hook_port6
; pop r7
; reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-adc"
CoreVariable irq_hook_adc
;------------------------------------------------------------------------------
pushda #irq_hook_adc
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_adc:
push r7
call &irq_hook_adc
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-watchdog"
CoreVariable irq_hook_watchdog
;------------------------------------------------------------------------------
pushda #irq_hook_watchdog
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_watchdog:
push r7
call &irq_hook_watchdog
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-rtc"
CoreVariable irq_hook_rtc
;------------------------------------------------------------------------------
pushda #irq_hook_rtc
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_rtc:
push r7
call &irq_hook_rtc
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-uscia0"
CoreVariable irq_hook_uscia0
;------------------------------------------------------------------------------
pushda #irq_hook_uscia0
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_uscia0:
push r7
call &irq_hook_uscia0
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-uscia1"
CoreVariable irq_hook_uscia1
;------------------------------------------------------------------------------
pushda #irq_hook_uscia1
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_uscia1:
push r7
call &irq_hook_uscia1
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-uscib0"
CoreVariable irq_hook_uscib0
;------------------------------------------------------------------------------
pushda #irq_hook_uscib0
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_uscib0:
push r7
call &irq_hook_uscib0
pop r7
reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-uscib1"
; CoreVariable irq_hook_uscib1
;;------------------------------------------------------------------------------
; pushda #irq_hook_uscib1
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_uscib1:
; push r7
; call &irq_hook_uscib1
; pop r7
; reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-timera1"
CoreVariable irq_hook_timera1
;------------------------------------------------------------------------------
pushda #irq_hook_timera1
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_timera1:
push r7
call &irq_hook_timera1
pop r7
reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-timera0"
CoreVariable irq_hook_timera0
;------------------------------------------------------------------------------
pushda #irq_hook_timera0
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_timera0:
push r7
call &irq_hook_timera0
pop r7
reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timerb1"
; CoreVariable irq_hook_timerb1
;;------------------------------------------------------------------------------
; pushda #irq_hook_timerb1
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timerb1:
; push r7
; call &irq_hook_timerb1
; pop r7
; reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-timerb0"
CoreVariable irq_hook_timerb0
;------------------------------------------------------------------------------
pushda #irq_hook_timerb0
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_timerb0:
push r7
call &irq_hook_timerb0
pop r7
reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timerc1"
; CoreVariable irq_hook_timerc1
;;------------------------------------------------------------------------------
; pushda #irq_hook_timerc1
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timerc1:
; push r7
; call &irq_hook_timerc1
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timerc0"
; CoreVariable irq_hook_timerc0
;;------------------------------------------------------------------------------
; pushda #irq_hook_timerc0
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timerc0:
; push r7
; call &irq_hook_timerc0
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timerd1"
; CoreVariable irq_hook_timerd1
;;------------------------------------------------------------------------------
; pushda #irq_hook_timerd1
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timerd1:
; push r7
; call &irq_hook_timerd1
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timerd0"
; CoreVariable irq_hook_timerd0
;;------------------------------------------------------------------------------
; pushda #irq_hook_timerd0
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timerd0:
; push r7
; call &irq_hook_timerd0
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timere1"
; CoreVariable irq_hook_timere1
;;------------------------------------------------------------------------------
; pushda #irq_hook_timere1
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timere1:
; push r7
; call &irq_hook_timere1
; pop r7
; reti
;;------------------------------------------------------------------------------
; Wortbirne Flag_visible|Flag_Variable, "irq-timere0"
; CoreVariable irq_hook_timere0
;;------------------------------------------------------------------------------
; pushda #irq_hook_timere0
; ret
; .word nop_vektor ; Initial value for unused interrupts
;
;irq_vektor_timere0:
; push r7
; call &irq_hook_timere0
; pop r7
; reti
;------------------------------------------------------------------------------
Wortbirne Flag_visible|Flag_Variable, "irq-comp"
CoreVariable irq_hook_comp
;------------------------------------------------------------------------------
pushda #irq_hook_comp
ret
.word nop_vektor ; Initial value for unused interrupts
irq_vektor_comp:
push r7
call &irq_hook_comp
pop r7
reti
| 30.115169
| 80
| 0.482884
|
48008e34c722acabae03a1fe711d1c3699c23fc9
| 471
|
asm
|
Assembly
|
programs/oeis/214/A214067.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/214/A214067.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/214/A214067.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A214067: [(5/2)*[(5/2)*n]], where [ ] = floor.
; 0,5,12,17,25,30,37,42,50,55,62,67,75,80,87,92,100,105,112,117,125,130,137,142,150,155,162,167,175,180,187,192,200,205,212,217,225,230,237,242,250,255,262,267,275,280,287,292,300,305,312,317,325,330,337,342,350,355,362,367,375,380,387,392,400,405,412,417,425,430,437,442,450,455,462,467,475,480,487,492,500,505,512,517,525,530,537,542,550,555,562,567,575,580,587,592,600,605,612,617
mul $0,10
div $0,4
mul $0,5
div $0,2
| 58.875
| 383
| 0.690021
|
c000e58e393acb5ac0ad48041658fd1120b27d93
| 248
|
asm
|
Assembly
|
pkgs/tools/yasm/src/modules/arch/x86/tests/movdq32.asm
|
manggoguy/parsec-modified
|
d14edfb62795805c84a4280d67b50cca175b95af
|
[
"BSD-3-Clause"
] | 2,151
|
2020-04-18T07:31:17.000Z
|
2022-03-31T08:39:18.000Z
|
pkgs/tools/yasm/src/modules/arch/x86/tests/movdq32.asm
|
manggoguy/parsec-modified
|
d14edfb62795805c84a4280d67b50cca175b95af
|
[
"BSD-3-Clause"
] | 395
|
2020-04-18T08:22:18.000Z
|
2021-12-08T13:04:49.000Z
|
pkgs/tools/yasm/src/modules/arch/x86/tests/movdq32.asm
|
manggoguy/parsec-modified
|
d14edfb62795805c84a4280d67b50cca175b95af
|
[
"BSD-3-Clause"
] | 338
|
2020-04-18T08:03:10.000Z
|
2022-03-29T12:33:22.000Z
|
[bits 32]
movd eax, mm0
movd mm0, eax
movd [0], mm0
movd mm0, [0]
movd eax, xmm0
movd xmm0, eax
movd [0], xmm0
movd xmm0, [0]
movq [0], xmm0
movq xmm0, [0]
movq xmm0, xmm1
movq xmm1, xmm0
movq [0], mm0
movq mm0, [0]
movq mm0, mm1
movq mm1, mm0
| 11.272727
| 15
| 0.645161
|
564368c62b90f871e56bc804998d3f8ac4458a86
| 1,640
|
asm
|
Assembly
|
Examples/ch08/ArrySum.asm
|
satadriver/LiunuxOS
|
693174ac2b3e503d72782fc7a14f18c8a4f2756c
|
[
"Apache-2.0"
] | null | null | null |
Examples/ch08/ArrySum.asm
|
satadriver/LiunuxOS
|
693174ac2b3e503d72782fc7a14f18c8a4f2756c
|
[
"Apache-2.0"
] | null | null | null |
Examples/ch08/ArrySum.asm
|
satadriver/LiunuxOS
|
693174ac2b3e503d72782fc7a14f18c8a4f2756c
|
[
"Apache-2.0"
] | null | null | null |
TITLE ArraySum Optimization (ArrySum.asm)
INCLUDE Irvine32.inc
Optimized = 1
.data
Array DWORD 50 DUP(5)
.code
main PROC
push LENGTHOF Array
push OFFSET Array
call ArraySum
add sp,8
call WriteDec ; display the sum
call Crlf
exit
main ENDP
Comment !
IMPLEMENTING THE FOLLOWING C++ FUNCTION:
int ArraySum( int array[], int count )
{
int sum = 0;
for(int i = 0; i < count; i++)
sum += array[i];
return sum;
}
!
sum EQU <[ebp-4]>
pArray EQU <[ebp+8]>
count EQU <[ebp+12]>
IF Optimized
;---------------------------------------------------------
ArraySum PROC
; Optimized version
;---------------------------------------------------------
push ebp
mov ebp,esp ; set frame pointer
push esi ; save ESI
mov eax,0 ; sum = 0
mov esi,pArray ; array pointer
mov ecx,count ; count
L1:
add eax,[esi] ; add value to sum
add esi,4 ; next array position
loopd L1
pop esi ; restore ESI
pop ebp
ret ; return sum (EAX)
ArraySum ENDP
ELSE
;---------------------------------------------------------
ArraySum PROC
; Non-optimized version
;---------------------------------------------------------
push ebp
mov ebp,esp ; set frame pointer
sub esp,4 ; create the sum variable
push esi ; save ESI
mov DWORD PTR sum,0
mov esi,pArray
mov ecx,count
L1:
mov eax,[esi] ; get array value
add sum,eax ; add to sum
add esi,4 ; next array position
loopd L1
pop esi ; restore ESI
mov eax,sum ; put return value in EAX
mov esp,ebp ; remove local variables
pop ebp
ret
ArraySum ENDP
ENDIF
END main
| 17.634409
| 65
| 0.545732
|
ba43aeac08f068887ad0f01f93c17a067fb2da23
| 1,281
|
asm
|
Assembly
|
programs/oeis/169/A169598.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/169/A169598.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/169/A169598.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A169598: Numbers that are congruent to {3,18} mod 23.
; 3,18,26,41,49,64,72,87,95,110,118,133,141,156,164,179,187,202,210,225,233,248,256,271,279,294,302,317,325,340,348,363,371,386,394,409,417,432,440,455,463,478,486,501,509,524,532,547,555,570,578,593,601,616,624,639,647,662,670,685,693,708,716,731,739,754,762,777,785,800,808,823,831,846,854,869,877,892,900,915,923,938,946,961,969,984,992,1007,1015,1030,1038,1053,1061,1076,1084,1099,1107,1122,1130,1145,1153,1168,1176,1191,1199,1214,1222,1237,1245,1260,1268,1283,1291,1306,1314,1329,1337,1352,1360,1375,1383,1398,1406,1421,1429,1444,1452,1467,1475,1490,1498,1513,1521,1536,1544,1559,1567,1582,1590,1605,1613,1628,1636,1651,1659,1674,1682,1697,1705,1720,1728,1743,1751,1766,1774,1789,1797,1812,1820,1835,1843,1858,1866,1881,1889,1904,1912,1927,1935,1950,1958,1973,1981,1996,2004,2019,2027,2042,2050,2065,2073,2088,2096,2111,2119,2134,2142,2157,2165,2180,2188,2203,2211,2226,2234,2249,2257,2272,2280,2295,2303,2318,2326,2341,2349,2364,2372,2387,2395,2410,2418,2433,2441,2456,2464,2479,2487,2502,2510,2525,2533,2548,2556,2571,2579,2594,2602,2617,2625,2640,2648,2663,2671,2686,2694,2709,2717,2732,2740,2755,2763,2778,2786,2801,2809,2824,2832,2847,2855,2870
mov $1,32
add $1,$0
div $0,2
mul $0,7
mul $1,15
sub $1,$0
sub $1,477
| 116.454545
| 1,154
| 0.766589
|
8c367f02de63ec5ba156a5ac629ceddcf67b1470
| 789
|
asm
|
Assembly
|
libsrc/video/tms9918/gen_setrd.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/video/tms9918/gen_setrd.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/video/tms9918/gen_setrd.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
;
; z88dk library: Generic VDP support code
;
; $Id: gen_setrd.asm,v 1.3 2016-06-16 19:30:25 dom Exp $
;
SECTION code_clib
PUBLIC SETRD
PUBLIC _SETRD
EXTERN l_tms9918_disable_interrupts
EXTERN l_tms9918_enable_interrupts
INCLUDE "video/tms9918/vdp.inc"
;==============================================================
; VRAM to HL
;==============================================================
; Sets VRAM read address to hl
;
; CORRUPTS bc
;==============================================================
.SETRD
._SETRD
call l_tms9918_disable_interrupts
ld a,l
IF VDP_CMD < 0
ld (-VDP_CMD),a
ELSE
ld bc,VDP_CMD
out (c),a
ENDIF
ld a,h
and $3F
IF VDP_CMD < 0
ld (-VDP_CMD),a
ELSE
out (c),a
ENDIF
call l_tms9918_enable_interrupts
ret
| 18.785714
| 63
| 0.520913
|
e4f57aec36df58f8f47c5dc2a02808dca65657af
| 10,652
|
asm
|
Assembly
|
P6/data_P6_2/MDTest99.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | 1
|
2022-01-23T09:24:47.000Z
|
2022-01-23T09:24:47.000Z
|
P6/data_P6_2/MDTest99.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | null | null | null |
P6/data_P6_2/MDTest99.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | null | null | null |
ori $ra,$ra,0xf
mthi $4
addu $1,$4,$1
addiu $6,$6,-9230
srav $5,$0,$5
sb $1,6($0)
mflo $6
srav $5,$1,$5
lb $1,9($0)
mthi $4
ori $1,$1,45069
lb $5,0($0)
lui $4,48825
addu $2,$2,$4
srav $2,$2,$2
divu $6,$ra
sll $0,$0,14
mtlo $6
divu $1,$ra
multu $4,$3
div $5,$ra
mthi $5
mfhi $0
lui $1,54142
sll $2,$2,29
mthi $5
mtlo $1
mult $5,$5
lui $1,34221
addu $1,$2,$1
lui $1,52757
mfhi $4
multu $1,$4
div $4,$ra
mfhi $3
divu $1,$ra
mthi $4
lb $1,0($0)
div $3,$ra
mflo $4
sll $2,$2,16
addu $1,$5,$5
addiu $5,$4,-17436
sll $4,$4,16
ori $4,$4,39245
lb $5,16($0)
mfhi $1
addiu $5,$2,8144
mflo $4
addiu $4,$5,10421
mfhi $3
lui $5,17439
mtlo $4
mthi $5
mtlo $4
srav $4,$2,$2
lui $1,96
lui $4,7836
sll $4,$4,27
mtlo $2
mflo $4
lb $4,14($0)
lui $4,25837
mfhi $0
addu $1,$1,$1
mfhi $5
mtlo $4
mthi $6
srav $6,$5,$3
addu $1,$1,$0
ori $1,$2,36808
addiu $6,$5,9279
mfhi $0
lui $0,13829
divu $2,$ra
divu $4,$ra
addu $2,$1,$2
mthi $5
lb $4,12($0)
sll $2,$2,4
mfhi $1
addiu $4,$6,10432
mflo $1
lui $5,22347
mthi $0
divu $1,$ra
sll $1,$6,12
mthi $4
sll $4,$4,26
lb $5,11($0)
addu $6,$6,$1
lui $4,7894
mflo $1
mflo $3
mult $0,$5
ori $2,$2,8563
mthi $3
mfhi $6
sll $4,$5,29
div $3,$ra
addiu $5,$2,3329
divu $1,$ra
mtlo $0
srav $5,$4,$5
mult $6,$6
addu $1,$1,$4
addu $5,$4,$5
mthi $5
mthi $4
lb $3,7($0)
multu $1,$1
lb $3,11($0)
sll $4,$2,2
mfhi $5
div $1,$ra
srav $4,$5,$2
mflo $4
mtlo $2
multu $6,$4
sll $4,$4,12
mthi $3
addiu $4,$6,19255
srav $3,$5,$3
mthi $5
multu $6,$1
ori $5,$5,21373
div $5,$ra
div $4,$ra
lui $4,34556
addu $1,$1,$1
addu $1,$0,$1
addu $6,$5,$5
sll $2,$2,23
sb $4,9($0)
addiu $1,$2,2048
addiu $6,$6,28099
sb $0,14($0)
ori $4,$4,34858
lui $2,56764
div $4,$ra
mfhi $3
lb $4,12($0)
sll $6,$6,9
lb $5,7($0)
div $0,$ra
srav $4,$2,$4
srav $4,$6,$4
mfhi $1
divu $5,$ra
addu $1,$2,$1
mfhi $4
lui $6,16940
addiu $1,$1,-32585
addu $6,$6,$6
mflo $4
mfhi $6
addiu $6,$3,9081
sll $4,$2,22
multu $4,$4
mtlo $3
ori $3,$2,7276
mult $3,$6
mflo $4
addiu $1,$5,-18040
lui $3,57256
addu $5,$1,$3
divu $2,$ra
sb $3,12($0)
divu $6,$ra
ori $5,$5,41522
mfhi $6
lui $5,34230
srav $5,$5,$2
multu $1,$1
ori $6,$4,1845
addu $2,$2,$5
div $1,$ra
lui $1,50601
div $4,$ra
mtlo $0
addu $5,$4,$3
divu $1,$ra
mult $4,$4
mfhi $1
sb $4,0($0)
addu $0,$2,$5
multu $4,$5
srav $4,$4,$4
multu $2,$2
mfhi $2
ori $4,$1,61810
mult $4,$2
addu $4,$6,$5
sb $1,14($0)
lui $1,20692
srav $1,$5,$5
addu $0,$5,$2
ori $1,$5,24496
addu $1,$5,$1
sb $3,16($0)
lb $1,1($0)
div $1,$ra
mthi $5
mult $2,$2
ori $2,$2,24279
sb $4,12($0)
mfhi $6
addiu $6,$1,24736
mfhi $4
sb $1,6($0)
mthi $0
addiu $2,$2,24325
sll $1,$2,28
sll $4,$0,0
multu $4,$2
mtlo $0
ori $1,$5,65103
lui $0,52251
multu $2,$2
sb $0,1($0)
mult $2,$2
sll $4,$2,10
mflo $0
div $1,$ra
srav $3,$3,$3
addiu $1,$1,-17150
ori $4,$4,14096
addu $5,$1,$5
srav $1,$1,$1
sll $1,$2,5
addu $1,$1,$2
mthi $5
mthi $1
sll $4,$1,3
srav $2,$5,$2
sb $6,6($0)
div $2,$ra
addu $1,$3,$3
multu $1,$4
lui $2,58161
divu $1,$ra
divu $1,$ra
mflo $0
mult $4,$5
ori $5,$1,24064
mult $5,$4
mult $0,$4
sll $0,$2,18
mthi $6
addiu $4,$4,17404
mult $3,$3
lb $6,15($0)
ori $4,$0,38431
srav $1,$5,$2
mtlo $1
mthi $3
ori $5,$4,41383
mult $5,$5
sll $1,$3,19
lb $4,1($0)
multu $4,$3
sll $4,$2,15
div $4,$ra
lui $0,31873
srav $1,$4,$4
mflo $4
srav $6,$4,$3
mflo $1
mult $6,$2
mult $4,$6
sll $1,$2,26
addu $4,$4,$4
ori $4,$4,38551
addu $0,$3,$3
mtlo $0
mult $6,$0
lb $4,12($0)
sb $4,11($0)
mflo $1
sll $2,$2,10
lb $4,10($0)
lui $5,37016
mfhi $4
addu $1,$4,$1
lui $3,11965
mult $4,$4
mtlo $4
mtlo $1
divu $5,$ra
addu $4,$2,$3
divu $4,$ra
mthi $6
addu $5,$2,$4
lui $0,57000
mtlo $1
lui $5,57934
lb $1,6($0)
lb $2,9($0)
ori $2,$2,33037
addiu $1,$1,-10547
divu $3,$ra
lui $0,17502
lb $5,16($0)
mtlo $0
lui $4,2495
addiu $4,$2,-4108
mfhi $6
mflo $2
mflo $0
mult $4,$2
div $6,$ra
ori $5,$2,14866
mfhi $4
addiu $4,$5,-24887
divu $0,$ra
sb $2,5($0)
lui $4,59853
sll $3,$3,21
ori $3,$1,46203
mflo $5
addiu $4,$0,15230
mtlo $4
mflo $5
ori $5,$4,20240
srav $4,$3,$3
mult $1,$2
mfhi $5
divu $4,$ra
divu $4,$ra
lb $5,6($0)
mfhi $0
addu $4,$2,$2
divu $2,$ra
addiu $6,$6,-32063
multu $4,$1
multu $6,$2
mult $4,$5
mflo $1
srav $3,$3,$3
mflo $2
ori $0,$0,64405
mult $5,$6
sb $4,9($0)
addiu $5,$2,-16864
lb $6,6($0)
ori $5,$2,1630
srav $4,$2,$2
mthi $6
lui $1,8321
sll $4,$5,11
divu $0,$ra
div $1,$ra
ori $3,$5,50607
mfhi $4
div $2,$ra
mflo $2
div $1,$ra
addiu $5,$5,29466
addiu $3,$6,-1414
mflo $2
mthi $4
ori $0,$4,49717
mult $5,$4
sb $1,0($0)
lui $0,15425
addu $4,$2,$6
mtlo $4
mthi $1
addiu $2,$2,10467
mult $0,$2
sll $4,$1,31
mfhi $1
lb $5,6($0)
mthi $4
mflo $5
mult $3,$2
div $4,$ra
mflo $0
srav $5,$1,$1
mflo $1
lb $2,14($0)
mflo $1
addiu $5,$2,-9573
addu $1,$5,$5
ori $0,$2,57621
srav $3,$0,$3
sb $6,2($0)
addu $3,$3,$3
mult $1,$2
srav $3,$2,$3
mflo $1
sll $4,$2,24
addu $5,$2,$2
ori $4,$4,17152
div $5,$ra
mflo $4
mult $3,$1
mult $1,$1
lb $3,13($0)
divu $4,$ra
srav $2,$2,$3
mult $6,$5
sb $5,11($0)
mfhi $0
div $0,$ra
sb $5,16($0)
multu $5,$4
addu $5,$2,$6
mthi $3
srav $4,$4,$3
lb $4,6($0)
lui $2,15778
mthi $6
lb $0,7($0)
addu $4,$4,$4
addu $0,$0,$2
mtlo $2
mthi $4
mtlo $0
sll $4,$1,26
mthi $2
div $4,$ra
mtlo $2
mult $6,$6
mthi $1
ori $6,$6,20617
mult $4,$2
multu $0,$2
mflo $5
srav $4,$1,$5
ori $5,$5,1657
sll $2,$5,28
divu $0,$ra
addiu $0,$5,754
multu $6,$6
div $3,$ra
mtlo $4
sb $6,7($0)
sll $5,$5,1
mfhi $4
div $5,$ra
mflo $1
addiu $4,$2,16287
mflo $1
addiu $6,$2,30813
mult $5,$4
multu $4,$5
div $0,$ra
sb $4,2($0)
lui $6,26768
divu $5,$ra
divu $1,$ra
mfhi $3
divu $2,$ra
addiu $1,$0,-13542
srav $3,$3,$3
lui $4,45811
mult $1,$1
mtlo $3
mult $4,$0
div $3,$ra
lb $6,4($0)
addiu $1,$2,-28612
sll $5,$2,7
mflo $4
addiu $4,$2,-5289
sll $4,$2,4
lui $3,4395
lui $5,18913
mtlo $5
lui $3,12482
addu $6,$1,$3
srav $0,$0,$0
divu $1,$ra
divu $2,$ra
div $4,$ra
addiu $1,$1,-28329
mult $3,$3
mfhi $5
ori $4,$2,843
divu $4,$ra
lb $5,11($0)
addu $3,$3,$3
mflo $1
div $4,$ra
sll $2,$2,17
mult $3,$5
mult $4,$1
multu $2,$2
mfhi $4
sb $6,9($0)
ori $0,$6,44172
multu $1,$1
mult $2,$2
lb $0,0($0)
multu $1,$5
mult $5,$5
lui $2,27061
addu $2,$2,$4
mult $4,$4
mthi $6
mthi $2
sb $4,1($0)
mult $1,$1
sb $6,0($0)
lb $6,15($0)
srav $6,$1,$3
mtlo $5
divu $6,$ra
mfhi $1
mfhi $5
lb $4,3($0)
divu $2,$ra
ori $1,$1,63881
mtlo $6
multu $2,$6
div $4,$ra
mtlo $2
ori $6,$6,57669
div $4,$ra
mult $4,$4
mult $0,$0
lui $1,25854
sb $5,6($0)
multu $5,$5
lui $4,12429
divu $5,$ra
mthi $1
multu $0,$4
addiu $4,$1,-32684
addu $6,$4,$0
sll $1,$0,28
mfhi $4
addu $4,$2,$4
lb $3,12($0)
mflo $5
ori $4,$4,38968
srav $1,$4,$1
mflo $6
ori $5,$4,44170
lb $5,12($0)
mtlo $0
divu $4,$ra
mtlo $4
addiu $5,$0,29865
mtlo $4
sll $2,$4,12
lui $1,27231
addiu $3,$0,-10002
divu $2,$ra
mflo $4
mflo $6
lui $6,32413
sb $5,15($0)
lui $2,28795
lb $4,3($0)
sll $1,$2,11
div $4,$ra
lb $6,5($0)
addiu $4,$2,32037
lui $3,40
addiu $4,$2,30800
multu $1,$1
sll $2,$2,26
div $5,$ra
addiu $4,$0,-13622
divu $3,$ra
ori $5,$1,17889
divu $5,$ra
mflo $0
lui $4,2868
srav $5,$1,$2
mflo $4
lui $1,56395
sb $1,7($0)
mfhi $1
addiu $0,$5,-4863
multu $4,$2
addu $4,$5,$4
mtlo $3
mflo $1
ori $4,$5,33703
mthi $4
lb $4,15($0)
sll $3,$3,0
divu $6,$ra
srav $4,$2,$2
sll $3,$6,12
divu $3,$ra
mflo $4
mult $4,$4
div $4,$ra
mthi $5
mult $4,$4
sll $3,$1,17
addu $0,$2,$5
sll $0,$6,19
multu $3,$4
sb $3,7($0)
ori $1,$3,22012
mfhi $5
mfhi $5
srav $5,$5,$5
sb $4,1($0)
lui $0,18613
lb $4,5($0)
lb $5,9($0)
multu $5,$2
addiu $3,$3,-10465
lui $4,2503
multu $1,$1
mthi $4
lui $4,21924
lui $5,2381
sll $2,$2,20
mult $2,$1
mult $1,$2
mflo $2
ori $1,$4,6812
addu $4,$1,$5
sb $2,9($0)
ori $4,$5,21515
srav $4,$4,$4
lui $5,11242
div $0,$ra
mthi $4
ori $5,$4,48326
sb $5,16($0)
divu $1,$ra
mthi $6
mtlo $5
mthi $4
sb $4,9($0)
lui $1,3321
sll $6,$2,26
sll $5,$1,30
srav $4,$0,$2
mflo $5
sll $1,$1,22
mthi $6
mfhi $4
sb $4,11($0)
sb $5,10($0)
ori $2,$5,22447
addu $2,$2,$0
sb $1,16($0)
divu $1,$ra
mult $5,$5
sll $6,$4,0
multu $4,$5
mult $3,$3
sll $1,$2,17
div $6,$ra
mthi $1
lb $4,11($0)
addiu $0,$0,-7332
addu $4,$0,$2
addu $4,$3,$3
sb $5,7($0)
multu $4,$2
divu $2,$ra
sll $0,$0,2
srav $2,$4,$2
ori $3,$1,15054
lb $2,13($0)
mflo $5
lb $6,4($0)
lui $4,34918
lui $1,13806
mflo $4
mflo $5
ori $4,$4,13011
sb $2,11($0)
div $2,$ra
srav $0,$4,$4
lui $4,44169
lui $4,32278
lui $2,56892
div $2,$ra
divu $1,$ra
sll $3,$1,1
mfhi $3
srav $4,$4,$4
addiu $4,$3,25243
addiu $1,$4,-629
mult $4,$3
sb $0,1($0)
mfhi $4
divu $0,$ra
ori $4,$4,17003
multu $1,$1
addiu $2,$2,-25578
mtlo $2
sll $4,$5,9
mthi $6
srav $1,$2,$3
addiu $5,$2,-11629
mtlo $4
div $6,$ra
divu $2,$ra
mult $5,$4
sb $1,4($0)
div $1,$ra
mthi $1
multu $4,$6
sb $4,13($0)
div $4,$ra
sb $0,1($0)
mfhi $6
addiu $4,$4,-22686
sb $6,0($0)
divu $1,$ra
div $1,$ra
ori $4,$6,33996
sll $1,$1,27
ori $6,$4,11556
mflo $5
addu $1,$1,$1
srav $5,$5,$0
sll $5,$1,11
mthi $2
mflo $5
mtlo $3
div $4,$ra
mflo $4
lb $1,2($0)
div $4,$ra
ori $4,$4,60637
sll $5,$0,7
addu $1,$2,$1
mflo $5
mult $5,$5
multu $0,$5
srav $4,$4,$4
multu $4,$2
lb $2,12($0)
sb $3,10($0)
ori $1,$5,35050
lb $5,16($0)
div $4,$ra
sll $1,$1,19
mflo $1
addu $6,$6,$2
addiu $1,$4,5154
addiu $5,$5,7482
divu $4,$ra
lui $5,51367
mthi $1
lb $4,5($0)
multu $1,$5
multu $4,$6
srav $4,$1,$5
divu $5,$ra
mfhi $1
mult $5,$4
lb $1,15($0)
mult $6,$4
mthi $6
multu $4,$1
ori $2,$2,25021
mflo $0
divu $5,$ra
mfhi $1
mult $4,$2
addu $3,$3,$3
ori $4,$2,31931
mflo $0
lb $1,5($0)
lb $2,7($0)
lb $6,12($0)
ori $1,$0,11536
addu $0,$0,$5
lb $1,11($0)
multu $4,$3
addu $4,$4,$4
ori $4,$0,58106
addu $4,$0,$4
mult $4,$1
multu $5,$1
lui $6,60072
mflo $6
multu $4,$1
mult $4,$4
sb $5,2($0)
mflo $0
mflo $5
mflo $4
ori $3,$3,48206
mult $2,$5
divu $6,$ra
lb $2,5($0)
divu $0,$ra
sll $0,$6,0
mfhi $0
srav $3,$1,$3
mthi $1
addiu $5,$5,13733
multu $1,$5
multu $5,$5
addiu $5,$5,-6330
div $5,$ra
mfhi $5
lb $5,14($0)
lui $5,51562
srav $0,$0,$4
addu $4,$1,$3
srav $1,$2,$6
mfhi $5
addiu $4,$1,-25803
mfhi $4
divu $4,$ra
sb $2,3($0)
div $4,$ra
divu $0,$ra
mthi $3
sb $0,2($0)
mult $1,$1
lb $6,3($0)
addu $4,$5,$4
divu $4,$ra
divu $4,$ra
sb $1,7($0)
mtlo $5
sb $5,0($0)
divu $1,$ra
multu $2,$2
srav $3,$3,$3
div $5,$ra
ori $4,$4,30235
mthi $0
mthi $5
mthi $4
lui $4,15242
srav $2,$4,$2
sb $2,5($0)
addiu $6,$6,-25506
mflo $2
mtlo $6
mfhi $3
mfhi $4
div $1,$ra
mthi $4
div $1,$ra
mfhi $0
lb $5,1($0)
addu $1,$1,$1
divu $6,$ra
srav $4,$6,$1
sll $5,$5,21
divu $4,$ra
sb $4,7($0)
div $2,$ra
mult $4,$0
srav $5,$5,$5
mfhi $1
div $0,$ra
lb $5,15($0)
lb $4,9($0)
div $1,$ra
sll $0,$2,17
multu $1,$3
mfhi $1
lui $0,60449
mflo $4
addiu $1,$2,-1868
mfhi $1
lb $3,6($0)
addu $1,$3,$3
mtlo $4
ori $3,$1,53057
mfhi $6
lb $4,9($0)
div $4,$ra
multu $5,$0
addu $3,$3,$3
ori $2,$2,18638
sb $4,12($0)
multu $6,$4
addu $2,$2,$1
mtlo $4
addiu $5,$3,15951
mthi $5
divu $1,$ra
srav $4,$4,$6
addu $5,$4,$4
mflo $5
multu $4,$3
lui $1,30412
sll $6,$2,21
| 11.968539
| 18
| 0.566936
|
3a286cb22696affa8f7155ae37158da6299d0100
| 148
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/stdio/c/sccz80/flockfile.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/stdio/c/sccz80/flockfile.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/stdio/c/sccz80/flockfile.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; void flockfile(FILE *file)
SECTION code_stdio
PUBLIC flockfile
EXTERN asm_flockfile
flockfile:
push hl
pop ix
jp asm_flockfile
| 9.25
| 28
| 0.722973
|
a46526ccd6ea72b27b63b75365906e1c5632bd53
| 349
|
asm
|
Assembly
|
programs/oeis/074/A074506.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/074/A074506.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/074/A074506.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A074506: a(n) = 1^n + 3^n + 4^n.
; 3,8,26,92,338,1268,4826,18572,72098,281828,1107626,4371452,17308658,68703188,273218426,1088090732,4338014018,17309009348,69106897226,276040168412,1102998412178,4408506864308,17623567104026,70462887356492,281757406247138,1126747195452068,4506141493198826
mov $1,4
pow $1,$0
add $1,1
mov $2,3
pow $2,$0
add $1,$2
| 34.9
| 255
| 0.77937
|
696096af25f6b05a8c80259c122101025cad8bdf
| 299
|
asm
|
Assembly
|
programs/oeis/000/A000655.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/000/A000655.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/000/A000655.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A000655: a(n) = number of letters in a(n-1), a(1) = 1 (in English).
; 1,3,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
mov $2,$0
sub $0,1
mul $2,2
sub $2,3
clr $1,$0
add $2,4
mov $1,$2
| 27.181818
| 161
| 0.521739
|
52e627b89032d746c30cb47a0dd0e8efc2ebdc1c
| 735
|
asm
|
Assembly
|
smsq/qxl/spp/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
smsq/qxl/spp/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
smsq/qxl/spp/init.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; QXL SER PAR PRT device initialisation V2.10 1999 Tony Tebby
section spp
xdef qxl_spp_init
xdef qxl_spp_inits
xref spp_init
xref qxl_pardef
xref qxl_serdef
include 'dev8_smsq_qxl_keys'
include 'dev8_mac_vecx'
;+++
; SPP driver initialisation.
;
; a1-a3 scratch
; status return standard
;---
qxl_spp_init
lea qxl_par,a1
lea qxl_ser,a2
jmp spp_init ; set up serial and parallel ports
qxl_par
vec qxl_pardef ; PAR driver
novec
qxl_ser
vec qxl_serdef ; SER driver
novec
;+++
; SPP driver initialisation in supervisor mode
;
; a1-a3 scratch
; status return standard
;---
qxl_spp_inits
move.l a3,qxl_spp_link
move.l qxl_message,a5
move.l qxl_ms_pcset(a5),spd_qxlflow(a3) ; set startup flow
rts
end
| 15.638298
| 66
| 0.741497
|
71d5d9fec6427904ebfe0e304e6ba2a0d913b19c
| 258
|
asm
|
Assembly
|
src/code/video/copy.asm
|
gb-archive/waveform-gb
|
016c923745620d2166bd24e6e9afc6bd35a89a4b
|
[
"MIT"
] | null | null | null |
src/code/video/copy.asm
|
gb-archive/waveform-gb
|
016c923745620d2166bd24e6e9afc6bd35a89a4b
|
[
"MIT"
] | null | null | null |
src/code/video/copy.asm
|
gb-archive/waveform-gb
|
016c923745620d2166bd24e6e9afc6bd35a89a4b
|
[
"MIT"
] | null | null | null |
SECTION "Video Copy", ROM0
DrawTilemapRect::
; Fill a cxb rectangle at bg map address hl with a++.
push af
ld a, BG_WIDTH
sub c
ld e, a
ld d, 0
pop af
.y
push bc
.x
ld [hli], a
inc a
dec c
jr nz, .x
pop bc
add hl, de
dec b
jr nz, .y
ret
| 9.555556
| 53
| 0.612403
|
ed87a72ef2f2e7c4726eac8d12c19cd2dd1d787f
| 598
|
asm
|
Assembly
|
oeis/067/A067707.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/067/A067707.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/067/A067707.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A067707: a(n) = 3*n^2 + 12*n.
; Submitted by Christian Krause
; 15,36,63,96,135,180,231,288,351,420,495,576,663,756,855,960,1071,1188,1311,1440,1575,1716,1863,2016,2175,2340,2511,2688,2871,3060,3255,3456,3663,3876,4095,4320,4551,4788,5031,5280,5535,5796,6063,6336,6615,6900,7191,7488,7791,8100,8415,8736,9063,9396,9735,10080,10431,10788,11151,11520,11895,12276,12663,13056,13455,13860,14271,14688,15111,15540,15975,16416,16863,17316,17775,18240,18711,19188,19671,20160,20655,21156,21663,22176,22695,23220,23751,24288,24831,25380,25935,26496,27063,27636,28215
add $0,3
pow $0,2
sub $0,4
mul $0,3
| 66.444444
| 496
| 0.770903
|
245b931ab43530c8f47796561c4c274adccb64ca
| 5,188
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_533.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_533.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_533.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rbx
push %rdi
push %rsi
lea addresses_D_ht+0x1414d, %r10
nop
nop
nop
nop
sub $40105, %r9
mov (%r10), %rdi
dec %r14
lea addresses_normal_ht+0x1afc1, %rsi
nop
nop
sub $35721, %rbx
movl $0x61626364, (%rsi)
nop
cmp %r9, %r9
lea addresses_UC_ht+0x6b0d, %rdi
nop
nop
nop
nop
sub $64416, %r13
mov $0x6162636465666768, %rbx
movq %rbx, %xmm5
vmovups %ymm5, (%rdi)
nop
nop
nop
nop
nop
sub %r10, %r10
pop %rsi
pop %rdi
pop %rbx
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %r15
push %rax
push %rdi
// Store
lea addresses_PSE+0xcdad, %r15
nop
nop
xor %r10, %r10
mov $0x5152535455565758, %r14
movq %r14, %xmm2
movups %xmm2, (%r15)
nop
nop
nop
xor %r15, %r15
// Store
mov $0x5199fb0000000ac9, %r11
nop
nop
xor %rax, %rax
mov $0x5152535455565758, %r13
movq %r13, %xmm4
vmovups %ymm4, (%r11)
nop
nop
sub %r11, %r11
// Faulty Load
lea addresses_normal+0x1330d, %r11
nop
and $53300, %r10
movups (%r11), %xmm7
vpextrq $0, %xmm7, %rax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdi
pop %rax
pop %r15
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_NC', 'AVXalign': False, 'size': 32}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 43.966102
| 2,999
| 0.660563
|
ea17e0e989da2be1c8f7bb976b75d9b5fd44d51b
| 993
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_10_1014.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_10_1014.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_10_1014.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rax
push %rbp
push %rdx
// Store
lea addresses_WT+0x1f33a, %r11
nop
nop
nop
nop
xor $57020, %rax
mov $0x5152535455565758, %r9
movq %r9, %xmm6
vmovups %ymm6, (%r11)
nop
nop
xor $12642, %rax
// Faulty Load
lea addresses_US+0x57ea, %rbp
nop
nop
nop
nop
add %r9, %r9
mov (%rbp), %edx
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 10}
00 00 00 00 00 00 00 00 00 00
*/
| 17.421053
| 122
| 0.647533
|
59404923c0dab7e19e751167fde7bdaaa4c5775a
| 262
|
asm
|
Assembly
|
Practice/Assignments assembly class/9.asm
|
WardunIslam/CSE331L_Section_7_Summer_2020_NSU
|
4f36bf223c44afd2233a243a2f8ba92df18f5545
|
[
"MIT"
] | null | null | null |
Practice/Assignments assembly class/9.asm
|
WardunIslam/CSE331L_Section_7_Summer_2020_NSU
|
4f36bf223c44afd2233a243a2f8ba92df18f5545
|
[
"MIT"
] | null | null | null |
Practice/Assignments assembly class/9.asm
|
WardunIslam/CSE331L_Section_7_Summer_2020_NSU
|
4f36bf223c44afd2233a243a2f8ba92df18f5545
|
[
"MIT"
] | null | null | null |
org 100h
L1: NOP
L2: MOV AX, 0000H
MOV DS, AX
MOV BX, 0000H
MOV AL, BYTE PTR DS:[BX]
L3: SHL AL, 01H
L4: JC NEGETIVE
POSITIVE: MOV AH, 02
MOV DL, 'P'
INT 21H
JMP L5
NEGETIVE: MOV AH, 02
MOV DL, 'N'
INT 21H
L5: HLT
ret
| 10.48
| 28
| 0.557252
|
285b63797244f469bc18f0294ae4eec310848b1b
| 694
|
asm
|
Assembly
|
oeis/020/A020976.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/020/A020976.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/020/A020976.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A020976: Expansion of 1/((1-8*x)*(1-9*x)*(1-10*x)).
; Submitted by Jamie Morken(s2)
; 1,27,487,7335,99631,1265607,15341887,179688375,2050086511,22913907687,251930201887,2733012078615,29322230800591,311701053949767,3287717299503487,34448718207176055,358912563957741871,3721205876364935847,38418795293246494687,395192696886915028695,4052122585963807870351,41432209785526851729927,422594740164562312743487,4300991478239625992084535,43690033838225155347906031,443059188816574569484316007,4486323773529556496184137887,45367242555209091432259591575,458227811744426486623155128911
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
add $1,$2
mul $1,8
mul $2,10
mul $3,9
lpe
mov $0,$1
div $0,8
| 40.823529
| 489
| 0.821326
|
d6f8fda49a4faca40e743dea9a1e17b0f7aeaee6
| 419
|
asm
|
Assembly
|
oeis/107/A107385.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/107/A107385.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/107/A107385.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A107385: a(n) = a(n-1)+4*a(n-2)-4*a(n-4).
; Submitted by Jamie Morken(s4)
; 0,1,1,2,6,10,30,62,158,366,878,2094,4974,11886,28270,67438,160622,382830,912238,2173806,5180270,12344174,29416302,70097774,167041902,398056302,948558702,2260392814,5386460014,12835806062,30587411310
mov $2,1
mov $4,3
lpb $0
sub $0,1
mov $3,$1
mov $1,$2
mul $1,4
add $4,$3
sub $4,2
mov $2,$4
mov $4,$3
lpe
mov $0,$1
div $0,4
| 22.052632
| 200
| 0.665871
|
01caa56618afa977bef1d2a280b3fef60c0689fd
| 14,101
|
asm
|
Assembly
|
third_party/codecs/xvidcore/src/motion/x86_asm/sad_mmx.asm
|
Narflex/sagetv
|
76cb5755e54fd3b01d2bb708a8a72af0aa1533f1
|
[
"Apache-2.0"
] | 292
|
2015-08-10T18:34:55.000Z
|
2022-01-26T00:38:45.000Z
|
third_party/codecs/xvidcore/src/motion/x86_asm/sad_mmx.asm
|
Narflex/sagetv
|
76cb5755e54fd3b01d2bb708a8a72af0aa1533f1
|
[
"Apache-2.0"
] | 366
|
2015-08-10T18:21:02.000Z
|
2022-01-22T20:03:41.000Z
|
third_party/codecs/xvidcore/src/motion/x86_asm/sad_mmx.asm
|
Narflex/sagetv
|
76cb5755e54fd3b01d2bb708a8a72af0aa1533f1
|
[
"Apache-2.0"
] | 227
|
2015-08-10T22:24:29.000Z
|
2022-02-25T19:16:21.000Z
|
;/****************************************************************************
; *
; * XVID MPEG-4 VIDEO CODEC
; * - K7 optimized SAD operators -
; *
; * Copyright(C) 2001 Peter Ross <pross@xvid.org>
; * 2002 Pascal Massimino <skal@planet-d.net>
; *
; * This program is free software; you can redistribute it and/or modify it
; * under the terms of the GNU General Public License as published by
; * the Free Software Foundation; either version 2 of the License, or
; * (at your option) any later version.
; *
; * This program 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 General Public License for more details.
; *
; * You should have received a copy of the GNU General Public License
; * along with this program; if not, write to the Free Software
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
; *
; * $Id: sad_mmx.asm,v 1.22 2009-09-16 17:07:58 Isibaar Exp $
; *
; ***************************************************************************/
%include "nasm.inc"
;=============================================================================
; Read only data
;=============================================================================
DATA
ALIGN SECTION_ALIGN
mmx_one:
times 4 dw 1
;=============================================================================
; Helper macros
;=============================================================================
%macro SAD_16x16_MMX 0
movq mm0, [_EAX]
movq mm1, [TMP1]
movq mm2, [_EAX+8]
movq mm3, [TMP1+8]
movq mm4, mm0
psubusb mm0, mm1
lea _EAX, [_EAX+TMP0]
movq mm5, mm2
psubusb mm2, mm3
psubusb mm1, mm4
psubusb mm3, mm5
por mm0, mm1
por mm2, mm3
movq mm1, mm0
punpcklbw mm0,mm7
movq mm3, mm2
punpckhbw mm1,mm7
lea TMP1, [TMP1+TMP0]
punpcklbw mm2,mm7
paddusw mm0, mm1
punpckhbw mm3,mm7
paddusw mm6, mm0
paddusw mm2, mm3
paddusw mm6, mm2
%endmacro
%macro SAD_8x8_MMX 0
movq mm0, [_EAX]
movq mm1, [TMP1]
movq mm2, [_EAX+TMP0]
movq mm3, [TMP1+TMP0]
lea _EAX,[_EAX+2*TMP0]
lea TMP1,[TMP1+2*TMP0]
movq mm4, mm0
psubusb mm0, mm1
movq mm5, mm2
psubusb mm2, mm3
psubusb mm1, mm4
psubusb mm3, mm5
por mm0, mm1
por mm2, mm3
movq mm1,mm0
punpcklbw mm0,mm7
movq mm3,mm2
punpckhbw mm1,mm7
punpcklbw mm2,mm7
paddusw mm0,mm1
punpckhbw mm3,mm7
paddusw mm6,mm0
paddusw mm2,mm3
paddusw mm6,mm2
%endmacro
%macro SADV_16x16_MMX 0
movq mm0, [_EAX]
movq mm1, [TMP1]
movq mm2, [_EAX+8]
movq mm4, mm0
movq mm3, [TMP1+8]
psubusb mm0, mm1
psubusb mm1, mm4
lea _EAX,[_EAX+TMP0]
por mm0, mm1
movq mm4, mm2
psubusb mm2, mm3
psubusb mm3, mm4
por mm2, mm3
movq mm1,mm0
punpcklbw mm0,mm7
movq mm3,mm2
punpckhbw mm1,mm7
punpcklbw mm2,mm7
paddusw mm0,mm1
punpckhbw mm3,mm7
paddusw mm5, mm0
paddusw mm2,mm3
lea TMP1,[TMP1+TMP0]
paddusw mm6, mm2
%endmacro
%macro SADBI_16x16_MMX 2 ; SADBI_16x16_MMX( int_ptr_offset, bool_increment_ptr );
movq mm0, [TMP1+%1]
movq mm2, [_EBX+%1]
movq mm1, mm0
movq mm3, mm2
%if %2 != 0
add TMP1, TMP0
%endif
punpcklbw mm0, mm7
punpckhbw mm1, mm7
punpcklbw mm2, mm7
punpckhbw mm3, mm7
%if %2 != 0
add _EBX, TMP0
%endif
paddusw mm0, mm2 ; mm01 = ref1 + ref2
paddusw mm1, mm3
paddusw mm0, [mmx_one] ; mm01 += 1
paddusw mm1, [mmx_one]
psrlw mm0, 1 ; mm01 >>= 1
psrlw mm1, 1
movq mm2, [_EAX+%1]
movq mm3, mm2
punpcklbw mm2, mm7 ; mm23 = src
punpckhbw mm3, mm7
%if %2 != 0
add _EAX, TMP0
%endif
movq mm4, mm0
movq mm5, mm1
psubusw mm0, mm2
psubusw mm1, mm3
psubusw mm2, mm4
psubusw mm3, mm5
por mm0, mm2 ; mm01 = ABS(mm01 - mm23)
por mm1, mm3
paddusw mm6, mm0 ; mm6 += mm01
paddusw mm6, mm1
%endmacro
%macro MEAN_16x16_MMX 0
movq mm0, [_EAX]
movq mm2, [_EAX+8]
lea _EAX, [_EAX+TMP0]
movq mm1, mm0
punpcklbw mm0, mm7
movq mm3, mm2
punpckhbw mm1, mm7
paddw mm5, mm0
punpcklbw mm2, mm7
paddw mm6, mm1
punpckhbw mm3, mm7
paddw mm5, mm2
paddw mm6, mm3
%endmacro
%macro ABS_16x16_MMX 0
movq mm0, [_EAX]
movq mm2, [_EAX+8]
lea _EAX, [_EAX+TMP0]
movq mm1, mm0
movq mm3, mm2
punpcklbw mm0, mm7
punpcklbw mm2, mm7
punpckhbw mm1, mm7
punpckhbw mm3, mm7
movq mm4, mm6
psubusw mm4, mm0
psubusw mm0, mm6
por mm0, mm4
movq mm4, mm6
psubusw mm4, mm1
psubusw mm1, mm6
por mm1, mm4
movq mm4, mm6
psubusw mm4, mm2
psubusw mm2, mm6
por mm2, mm4
movq mm4, mm6
psubusw mm4, mm3
psubusw mm3, mm6
por mm3, mm4
paddw mm0, mm1
paddw mm2, mm3
paddw mm5, mm0
paddw mm5, mm2
%endmacro
;=============================================================================
; Code
;=============================================================================
TEXT
cglobal sad16_mmx
cglobal sad16v_mmx
cglobal sad8_mmx
cglobal sad16bi_mmx
cglobal sad8bi_mmx
cglobal dev16_mmx
cglobal sse8_16bit_mmx
cglobal sse8_8bit_mmx
;-----------------------------------------------------------------------------
;
; uint32_t sad16_mmx(const uint8_t * const cur,
; const uint8_t * const ref,
; const uint32_t stride,
; const uint32_t best_sad);
;
; (early termination ignore; slows this down)
;
;-----------------------------------------------------------------------------
ALIGN SECTION_ALIGN
sad16_mmx:
mov _EAX, prm1 ; Src1
mov TMP1, prm2 ; Src2
mov TMP0, prm3 ; Stride
pxor mm6, mm6 ; accum
pxor mm7, mm7 ; zero
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
SAD_16x16_MMX
pmaddwd mm6, [mmx_one] ; collapse
movq mm7, mm6
psrlq mm7, 32
paddd mm6, mm7
movd eax, mm6
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t sad8_mmx(const uint8_t * const cur,
; const uint8_t * const ref,
; const uint32_t stride);
;
;-----------------------------------------------------------------------------
ALIGN SECTION_ALIGN
sad8_mmx:
mov _EAX, prm1 ; Src1
mov TMP1, prm2 ; Src2
mov TMP0, prm3 ; Stride
pxor mm6, mm6 ; accum
pxor mm7, mm7 ; zero
SAD_8x8_MMX
SAD_8x8_MMX
SAD_8x8_MMX
SAD_8x8_MMX
pmaddwd mm6, [mmx_one] ; collapse
movq mm7, mm6
psrlq mm7, 32
paddd mm6, mm7
movd eax, mm6
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t sad16v_mmx(const uint8_t * const cur,
; const uint8_t * const ref,
; const uint32_t stride,
; int32_t *sad);
;
;-----------------------------------------------------------------------------
ALIGN SECTION_ALIGN
sad16v_mmx:
mov _EAX, prm1 ; Src1
mov TMP1, prm2 ; Src2
mov TMP0, prm3 ; Stride
push _EBX
push _EDI
%ifdef ARCH_IS_X86_64
mov _EBX, prm4
%else
mov _EBX, [_ESP + 8 + 16] ; sad ptr
%endif
pxor mm5, mm5 ; accum
pxor mm6, mm6 ; accum
pxor mm7, mm7 ; zero
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
pmaddwd mm5, [mmx_one] ; collapse
pmaddwd mm6, [mmx_one] ; collapse
movq mm2, mm5
movq mm3, mm6
psrlq mm2, 32
psrlq mm3, 32
paddd mm5, mm2
paddd mm6, mm3
movd [_EBX], mm5
movd [_EBX + 4], mm6
paddd mm5, mm6
movd edi, mm5
pxor mm5, mm5
pxor mm6, mm6
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
SADV_16x16_MMX
pmaddwd mm5, [mmx_one] ; collapse
pmaddwd mm6, [mmx_one] ; collapse
movq mm2, mm5
movq mm3, mm6
psrlq mm2, 32
psrlq mm3, 32
paddd mm5, mm2
paddd mm6, mm3
movd [_EBX + 8], mm5
movd [_EBX + 12], mm6
paddd mm5, mm6
movd eax, mm5
add _EAX, _EDI
pop _EDI
pop _EBX
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t sad16bi_mmx(const uint8_t * const cur,
; const uint8_t * const ref1,
; const uint8_t * const ref2,
; const uint32_t stride);
;
;-----------------------------------------------------------------------------
ALIGN SECTION_ALIGN
sad16bi_mmx:
mov _EAX, prm1 ; Src
mov TMP1, prm2 ; Ref1
mov TMP0, prm4 ; Stride
push _EBX
%ifdef ARCH_IS_X86_64
mov _EBX, prm3 ; Ref2
%else
mov _EBX, [_ESP+4+12] ; Ref2
%endif
pxor mm6, mm6 ; accum2
pxor mm7, mm7
.Loop:
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
SADBI_16x16_MMX 0, 0
SADBI_16x16_MMX 8, 1
pmaddwd mm6, [mmx_one] ; collapse
movq mm7, mm6
psrlq mm7, 32
paddd mm6, mm7
movd eax, mm6
pop _EBX
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t sad8bi_mmx(const uint8_t * const cur,
; const uint8_t * const ref1,
; const uint8_t * const ref2,
; const uint32_t stride);
;
;-----------------------------------------------------------------------------
ALIGN SECTION_ALIGN
sad8bi_mmx:
mov _EAX, prm1 ; Src
mov TMP1, prm2 ; Ref1
mov TMP0, prm4 ; Stride
push _EBX
%ifdef ARCH_IS_X86_64
mov _EBX, prm3
%else
mov _EBX, [_ESP+4+12] ; Ref2
%endif
pxor mm6, mm6 ; accum2
pxor mm7, mm7
.Loop:
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
SADBI_16x16_MMX 0, 1
pmaddwd mm6, [mmx_one] ; collapse
movq mm7, mm6
psrlq mm7, 32
paddd mm6, mm7
movd eax, mm6
pop _EBX
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t dev16_mmx(const uint8_t * const cur,
; const uint32_t stride);
;
;-----------------------------------------------------------------------------
ALIGN SECTION_ALIGN
dev16_mmx:
mov _EAX, prm1 ; Src
mov TMP0, prm2 ; Stride
pxor mm7, mm7 ; zero
pxor mm5, mm5 ; accum1
pxor mm6, mm6 ; accum2
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
MEAN_16x16_MMX
paddusw mm6, mm5
pmaddwd mm6, [mmx_one] ; collapse
movq mm5, mm6
psrlq mm5, 32
paddd mm6, mm5
psllq mm6, 32 ; blank upper dword
psrlq mm6, 32 + 8 ; /= (16*16)
punpckldq mm6, mm6
packssdw mm6, mm6
; mm6 contains the mean
; mm5 is the new accum
pxor mm5, mm5
mov _EAX, prm1 ; Src
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
ABS_16x16_MMX
pmaddwd mm5, [mmx_one] ; collapse
movq mm6, mm5
psrlq mm6, 32
paddd mm6, mm5
movd eax, mm6
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t sse8_16bit_mmx(const int16_t *b1,
; const int16_t *b2,
; const uint32_t stride);
;
;-----------------------------------------------------------------------------
%macro ROW_SSE_16bit_MMX 2
movq mm0, [%1]
movq mm1, [%1+8]
psubw mm0, [%2]
psubw mm1, [%2+8]
pmaddwd mm0, mm0
pmaddwd mm1, mm1
paddd mm2, mm0
paddd mm2, mm1
%endmacro
sse8_16bit_mmx:
;; Load the function params
mov _EAX, prm1
mov TMP0, prm2
mov TMP1, prm3
;; Reset the sse accumulator
pxor mm2, mm2
;; Let's go
%rep 8
ROW_SSE_16bit_MMX _EAX, TMP0
lea _EAX, [_EAX+TMP1]
lea TMP0, [TMP0+TMP1]
%endrep
;; Finish adding each dword of the accumulator
movq mm3, mm2
psrlq mm2, 32
paddd mm2, mm3
movd eax, mm2
;; All done
ret
ENDFUNC
;-----------------------------------------------------------------------------
;
; uint32_t sse8_8bit_mmx(const int8_t *b1,
; const int8_t *b2,
; const uint32_t stride);
;
;-----------------------------------------------------------------------------
%macro ROW_SSE_8bit_MMX 2
movq mm0, [%1] ; load a row
movq mm2, [%2] ; load a row
movq mm1, mm0 ; copy row
movq mm3, mm2 ; copy row
punpcklbw mm0, mm7 ; turn the 4low elements into 16bit
punpckhbw mm1, mm7 ; turn the 4high elements into 16bit
punpcklbw mm2, mm7 ; turn the 4low elements into 16bit
punpckhbw mm3, mm7 ; turn the 4high elements into 16bit
psubw mm0, mm2 ; low part of src-dst
psubw mm1, mm3 ; high part of src-dst
pmaddwd mm0, mm0 ; compute the square sum
pmaddwd mm1, mm1 ; compute the square sum
paddd mm6, mm0 ; add to the accumulator
paddd mm6, mm1 ; add to the accumulator
%endmacro
sse8_8bit_mmx:
;; Load the function params
mov _EAX, prm1
mov TMP0, prm2
mov TMP1, prm3
;; Reset the sse accumulator
pxor mm6, mm6
;; Used to interleave 8bit data with 0x00 values
pxor mm7, mm7
;; Let's go
%rep 8
ROW_SSE_8bit_MMX _EAX, TMP0
lea _EAX, [_EAX+TMP1]
lea TMP0, [TMP0+TMP1]
%endrep
;; Finish adding each dword of the accumulator
movq mm7, mm6
psrlq mm6, 32
paddd mm6, mm7
movd eax, mm6
;; All done
ret
ENDFUNC
NON_EXEC_STACK
| 19.185034
| 84
| 0.583008
|
b7413de0f220bb14435c94df9144e917b2669a92
| 2,144
|
asm
|
Assembly
|
SLIDE_Video.asm
|
XlogicX/CactusCon2017
|
d4cc716169dc8c6c2956c57079eb64342d5432bf
|
[
"BSD-2-Clause"
] | 2
|
2018-12-23T17:19:34.000Z
|
2019-08-23T16:15:57.000Z
|
SLIDE_Video.asm
|
XlogicX/CactusCon2017
|
d4cc716169dc8c6c2956c57079eb64342d5432bf
|
[
"BSD-2-Clause"
] | null | null | null |
SLIDE_Video.asm
|
XlogicX/CactusCon2017
|
d4cc716169dc8c6c2956c57079eb64342d5432bf
|
[
"BSD-2-Clause"
] | null | null | null |
%include 'textmode.h'
call draw_border
mov di, 160 * 2 + 8 ;where to place cursor
mov si, line01 ;fetch the text
mov ah, 0x0A ;color
call slide_line
mov di, 160 * 4 + 16 ;where to place cursor
mov si, line02 ;fetch the text
mov ah, 0x0E
call slide_line
mov di, 160 * 6 + 16 ;where to place cursor
mov si, line03 ;fetch the text
call slide_line
mov di, 160 * 8 + 16 ;where to place cursor
mov si, line04 ;fetch the text
call slide_line
mov di, 160 * 10 + 16 ;where to place cursor
mov si, line05 ;fetch the text
call slide_line
mov di, 160 * 12 + 16 ;where to place cursor
mov si, line06 ;fetch the text
call slide_line
mov di, 160 * 14 + 16 ;where to place cursor
mov si, line07 ;fetch the text
call slide_line
mov di, 160 * 16 + 16 ;where to place cursor
mov si, line05 ;fetch the text
call slide_line
mov di, 160 * 4 + 48 ;where to place cursor
mov si, line08 ;fetch the text
mov ah, 0x07
call slide_line
mov di, 160 * 6 + 48 ;where to place cursor
mov si, line09 ;fetch the text
call slide_line
mov di, 160 * 8 + 48 ;where to place cursor
mov si, line0A ;fetch the text
call slide_line
mov di, 160 * 10 + 48 ;where to place cursor
mov si, line0B ;fetch the text
call slide_line
mov di, 160 * 12 + 48 ;where to place cursor
mov si, line0C ;fetch the text
call slide_line
mov di, 160 * 14 + 48 ;where to place cursor
mov si, line0D ;fetch the text
call slide_line
mov di, 160 * 16 + 48 ;where to place cursor
mov si, line0E ;fetch the text
call slide_line
jmp endloop
endloop:
jmp endloop
%include 'slide_frame.h'
%include 'pause.h'
line01 db 0x14, 0x07, ' Basic Video Setup:'
line02 db 0x0C, 'mov ah, 0xb8'
line03 db 0x0A, 'mov es, ax'
line04 db 0x0C, 'mov al, 0x03'
line05 db 0x08, 'int 0x10'
line06 db 0x09, 'mov ah, 1'
line07 db 0x0C, 'mov ch, 0x26'
line08 db 0x12, ';text video memory'
line09 db 0x0A, ';ES=0xB800'
line0A db 0x0A, ';Text Mode'
line0B db 0x0A, ';BIOS Call'
line0C db 0x10, '; I hear this is'
line0D db 0x0C, '; good to do'
line0E db 0x0A, ';BIOS Call'
titlemessage db 0x05, 'Video'
;BIOS sig and padding
times 510-($-$$) db 0
dw 0xAA55
| 22.333333
| 45
| 0.689366
|
e6c4639441ed91c2feecbb44c4764a84b307df0a
| 465
|
asm
|
Assembly
|
programs/oeis/023/A023542.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/023/A023542.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/023/A023542.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A023542: Convolution of natural numbers with Beatty sequence for tau^2 A001950.
; 2,9,23,47,84,136,206,296,409,548,715,913,1145,1413,1720,2068,2460,2899,3387,3927,4521,5172,5883,6656,7494,8400,9376,10425,11549,12751,14034,15400,16852,18393,20025,21751,23573,25494,27517,29644
mov $2,$0
mov $3,$0
add $3,1
lpb $3
mov $0,$2
sub $3,1
sub $0,$3
add $0,1
seq $0,88207 ; a(n) = Sum_{k=0..n} floor(k*phi^2)) where phi=(1+sqrt(5))/2.
add $1,$0
lpe
mov $0,$1
| 29.0625
| 195
| 0.677419
|
399d8ec2445e61e2b2a9a9b3f3e1632ad1cf89e7
| 175
|
asm
|
Assembly
|
src/test/resources/data/reorganizertests/test7-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 36
|
2020-06-29T06:52:26.000Z
|
2022-02-10T19:41:58.000Z
|
src/test/resources/data/reorganizertests/test7-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 39
|
2020-07-02T18:19:34.000Z
|
2022-03-27T18:08:54.000Z
|
src/test/resources/data/reorganizertests/test7-expected.asm
|
cpcitor/mdlz80optimizer
|
75070d984e1f08474e6d397c7e0eb66d8be0c432
|
[
"Apache-2.0"
] | 7
|
2020-07-02T06:00:05.000Z
|
2021-11-28T17:31:13.000Z
|
; Making sure the optimizer respects the "mdl:no-opt" directive
ld a, 1
jp label1 ; mdl:no-opt
label1:
add a, b
; jp label2 ; -mdl
label2:
ld (hl), a
label3:
jr label3
| 17.5
| 63
| 0.668571
|
5d0e23873887bd24aff4aebd6aca8e296e7dc379
| 10,657
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x711b, %r10
nop
nop
nop
nop
nop
xor %rdi, %rdi
movb (%r10), %r11b
nop
nop
nop
nop
and $22236, %r13
lea addresses_normal_ht+0x17159, %rbx
nop
nop
cmp $25087, %rax
mov $0x6162636465666768, %r14
movq %r14, (%rbx)
nop
and $8494, %rdi
lea addresses_D_ht+0x1a4f5, %r11
nop
nop
nop
and %r13, %r13
movw $0x6162, (%r11)
nop
nop
nop
nop
add %rbx, %rbx
lea addresses_WT_ht+0x18af5, %rsi
lea addresses_normal_ht+0x50f5, %rdi
clflush (%rsi)
nop
add %r10, %r10
mov $123, %rcx
rep movsw
add $36163, %rbx
lea addresses_A_ht+0x1035, %rsi
nop
nop
nop
nop
and $23719, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm5
movups %xmm5, (%rsi)
nop
add $40132, %r13
lea addresses_D_ht+0x774c, %rbx
nop
nop
nop
and $3279, %r13
mov $0x6162636465666768, %r11
movq %r11, %xmm2
movups %xmm2, (%rbx)
nop
nop
nop
nop
dec %rdi
lea addresses_UC_ht+0x12a75, %rsi
lea addresses_A_ht+0xfb55, %rdi
clflush (%rsi)
nop
and $19556, %r13
mov $26, %rcx
rep movsw
sub $36217, %r14
lea addresses_A_ht+0x11f07, %rsi
lea addresses_UC_ht+0x78f5, %rdi
clflush (%rdi)
nop
sub %rax, %rax
mov $77, %rcx
rep movsb
nop
nop
nop
nop
cmp $55580, %rax
lea addresses_WC_ht+0x139f5, %r13
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %rax
movq %rax, %xmm0
movups %xmm0, (%r13)
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x8b5, %rsi
cmp $25268, %r14
movl $0x61626364, (%rsi)
inc %rcx
lea addresses_A_ht+0x11395, %rax
nop
nop
nop
and %r10, %r10
movups (%rax), %xmm5
vpextrq $0, %xmm5, %rbx
nop
inc %r10
lea addresses_D_ht+0x1d3ed, %rdi
nop
nop
nop
nop
nop
sub $5382, %r13
movb (%rdi), %cl
nop
nop
sub %rdi, %rdi
lea addresses_A_ht+0xa325, %rcx
nop
nop
add $33979, %rsi
vmovups (%rcx), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %rbx
nop
sub $19650, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_WC+0x10db5, %rsi
lea addresses_WC+0x1a0f5, %rdi
add %rdx, %rdx
mov $2, %rcx
rep movsb
nop
nop
nop
nop
cmp %rdi, %rdi
// Store
lea addresses_normal+0x4df5, %r10
and %rax, %rax
mov $0x5152535455565758, %rcx
movq %rcx, (%r10)
nop
nop
nop
nop
sub $57312, %rcx
// Store
lea addresses_WT+0x12925, %r10
nop
nop
lfence
movb $0x51, (%r10)
nop
nop
and $10296, %r10
// Store
lea addresses_WC+0x1ae6d, %rdx
clflush (%rdx)
nop
nop
dec %rsi
mov $0x5152535455565758, %rcx
movq %rcx, (%rdx)
nop
add %rdx, %rdx
// Load
lea addresses_WT+0x11f93, %r8
nop
nop
nop
nop
add %rax, %rax
movups (%r8), %xmm7
vpextrq $1, %xmm7, %r10
nop
nop
and $2011, %rdi
// Store
lea addresses_WT+0x1f0f5, %r10
nop
add %rdx, %rdx
mov $0x5152535455565758, %r8
movq %r8, %xmm0
movups %xmm0, (%r10)
nop
add $45991, %rcx
// REPMOV
lea addresses_PSE+0x8e6e, %rsi
lea addresses_D+0x198f5, %rdi
nop
nop
nop
nop
nop
inc %r14
mov $31, %rcx
rep movsq
nop
dec %rdi
// Store
lea addresses_D+0x198f5, %r10
sub %rax, %rax
movl $0x51525354, (%r10)
nop
nop
nop
nop
nop
add %rcx, %rcx
// Load
lea addresses_D+0x198f5, %r14
inc %rdi
movups (%r14), %xmm0
vpextrq $1, %xmm0, %r8
nop
nop
nop
nop
nop
dec %r10
// Store
lea addresses_PSE+0x1fe2d, %rdx
clflush (%rdx)
nop
add $18557, %rax
mov $0x5152535455565758, %r8
movq %r8, (%rdx)
nop
nop
nop
xor $14442, %rcx
// Load
mov $0x1339ab000000048d, %rdx
nop
nop
nop
nop
dec %r10
movb (%rdx), %r8b
sub $62341, %r10
// Store
lea addresses_D+0x198f5, %r14
clflush (%r14)
nop
nop
cmp %rdx, %rdx
movw $0x5152, (%r14)
nop
nop
nop
nop
sub $47491, %r14
// Store
lea addresses_D+0x198f5, %rcx
nop
add $43256, %rdx
mov $0x5152535455565758, %rax
movq %rax, %xmm3
movups %xmm3, (%rcx)
cmp $10969, %rdx
// Faulty Load
lea addresses_D+0x198f5, %rax
xor $10483, %rdi
mov (%rax), %edx
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WC'}, 'dst': {'same': True, 'congruent': 10, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_PSE'}, 'dst': {'same': True, 'congruent': 0, 'type': 'addresses_D'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 29.358127
| 2,999
| 0.649808
|
179472e6569414a74fb3cc7c29ebcb3a18008cf6
| 503
|
asm
|
Assembly
|
programs/oeis/256/A256008.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/256/A256008.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/256/A256008.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A256008: Self-inverse permutation of positive integers: 4k+1 is swapped with 4k+3, and 4k+2 with 4k+4.
; 3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,35,36,33,34,39,40,37,38,43,44,41,42,47,48,45,46,51,52,49,50,55,56,53,54,59,60,57,58,63,64,61,62,67,68,65,66,71,72,69,70,75,76,73,74,79,80,77,78,83,84,81,82,87,88,85,86,91,92,89,90,95,96,93,94,99,100,97,98
mov $2,$0
div $0,2
mod $0,2
add $0,2
mul $0,4
mov $1,8
sub $1,$0
sub $1,2
add $2,5
add $1,$2
mov $0,$1
| 33.533333
| 293
| 0.648111
|
defab4d226ea04081c96178fa361fbd55d319446
| 435
|
asm
|
Assembly
|
programs/oeis/246/A246127.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/246/A246127.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/246/A246127.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A246127: Limiting block extension of the (2,1)-version of the infinite Fibonacci word A014675 with first term as initial block.
; 2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1
add $0,4086
seq $0,14675 ; The infinite Fibonacci word (start with 1, apply 1->2, 2->21, take limit).
| 72.5
| 201
| 0.627586
|
9378bd281e3174cf99c9225b4e3e7e90e3bcd7af
| 3,263
|
asm
|
Assembly
|
src/kernel/bootloader.asm
|
thpertic/LostOS
|
e3a8ad1f31002620c401484e7cfd9e7a6462a2d9
|
[
"MIT"
] | 8
|
2019-06-03T14:08:33.000Z
|
2020-04-06T21:41:43.000Z
|
src/kernel/bootloader.asm
|
thpertic/LostOS
|
e3a8ad1f31002620c401484e7cfd9e7a6462a2d9
|
[
"MIT"
] | null | null | null |
src/kernel/bootloader.asm
|
thpertic/LostOS
|
e3a8ad1f31002620c401484e7cfd9e7a6462a2d9
|
[
"MIT"
] | null | null | null |
; multiboot headers constants
MBALIGN equ 1<<0 ; align loaded modules on page boundaries
MEMINFO equ 1<<1 ; provide memory map
FLAGS equ MBALIGN | MEMINFO ; this is the Multiboot 'flag' field
MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header
CHECKSUM equ -(MAGIC + FLAGS) ; checksum of above, to prove we are multiboot
; Some constants to load the higher half kernel
KERNEL_VIRTUAL_BASE equ 0xC0000000
PDE_INDEX equ (KERNEL_VIRTUAL_BASE >> 22)
; Paging bits
PSE_BIT equ 0x00000010
PG_BIT equ 0x80000000
section .lowerhalf.data
align 4
dd MAGIC
dd FLAGS
dd CHECKSUM
align 0x1000
global BootPageDirectory
BootPageDirectory:
; This page directory entry identity-maps the first 4MB of the 32-bit physical address space.
; All bits are clear except the following:
; - bit 7: PS The kernel page is 4MB.
; - bit 1: RW The kernel page is read/write.
; - bit 0: P The kernel page is present (in RAM).
; This entry must be here -- otherwise the kernel will crash immediately after paging is enabled because it can't fetch the next instruction!
; It's not ok to unmap this page as it is used in the Physical Memory Manager before setting up the real Page Directory!
dd 0x00000083
times(PDE_INDEX - 1) dd 0
; This page directory defines a 4MB page containing the kernel
dd 0x00000083
times(1024 - PDE_INDEX - 1) dd 0
section .lowerhalf.text progbits alloc exec nowrite align=16
global setup
setup:
; Setting the last entry as recursive
mov ecx, BootPageDirectory
or ecx, 0x3
mov [BootPageDirectory + 4092], ecx
; Load PDBR (CR3), it must contains the physical address of the Page Directory
mov ecx, BootPageDirectory
mov cr3, ecx
; Set PSE bit in CR4 to enable 4MB pages
mov ecx, cr4
or ecx, PSE_BIT
mov cr4, ecx
; Set PG bit in CR0 to enable paging
mov ecx, cr0
or ecx, PG_BIT
mov cr0, ecx
; Start fetching instructions in kernel space.
; Since 'eip' at this point holds physical address of this command (approximately 0x00100000)
; we need to do a long jump to the correct virtual address of
; startInHigherHalf which is approximately in 0xC0100000.
; lea ecx, [BootPageDirectory]
jmp startInHigherHalf
section .text
startInHigherHalf:
; Unmap the first 4MB physical memory, we don't need it anymore. Flush the tlb, too
;mov dword[BootPageDirectory], 0
;invlpg[0]
; Set the stack
mov esp, start_stack
; Map the multiboot structure to higher half
add ebx, KERNEL_VIRTUAL_BASE
; Remember the address of the first Page Directory
mov ecx, BootPageDirectory
; Pass the Multiboot magic number and the Multiboot info structure
push eax
push ebx
push ecx
; Call the C++ global constructor
; call _init
extern kmain
call kmain
; Hang if kmain unexpectedly returns
cli
l: hlt
jmp l
section .bss nobits
align 4
end_stack:
; 1024 * 1024 * 4 = 104856 (4MB)
resb 419424
start_stack:
| 31.375
| 146
| 0.663193
|
06005195a7328a36e6fdfff27943f64727bc6873
| 1,073
|
nasm
|
Assembly
|
SLAE_assignments/assignment3/egg_hunter.nasm
|
RomainLanglois/SLAE_x86
|
e5620b74499c53a25f6d0537f9a86fbbd4c335d1
|
[
"MIT"
] | null | null | null |
SLAE_assignments/assignment3/egg_hunter.nasm
|
RomainLanglois/SLAE_x86
|
e5620b74499c53a25f6d0537f9a86fbbd4c335d1
|
[
"MIT"
] | null | null | null |
SLAE_assignments/assignment3/egg_hunter.nasm
|
RomainLanglois/SLAE_x86
|
e5620b74499c53a25f6d0537f9a86fbbd4c335d1
|
[
"MIT"
] | null | null | null |
global _start
_start:
xor ecx, ecx ;Initialize ecx to NULL
mul ecx ;Initilize eax and edx to NULL
_firstStep:
or dx, 0xfff ;Do a OR on dx register, dx == 0xFFF
_secondStep:
inc edx ;Add 1 to edx, edx == 0x1000
lea ebx, [edx+0x4] ;Ebx now holds the value of edx + 0x4
push byte +0x21 ;Push 0x21 on the stack
pop eax ;Pop 0x21 which is the systemcall value of access
int 0x80 ;Execute systemcall
cmp al, 0xf2 ;Compare the systemcall return value to 0x2f
jz _firstStep ;If zero, the program will jump to '_firstStep'. Which means the return value is not a valid memory address
mov eax, 0x50905090 ;This instruction will move our egg value inside eax
mov edi, edx ;Move the address stores in edx to edi
scasd ;This instruction will compare the value inside eax and edi
jnz _secondStep ;Jump back to '_secondStep' if the comparaison is false
scasd ;We check a second time the presence of our egg before executing the shellcode
jnz _secondStep ;Jump back to '_secondStep' if the comparaison is false
jmp edi ;Jump to our payload
| 42.92
| 123
| 0.739981
|
78d8a453fd9e9eb9bec309529f30e4da36a65dd9
| 6,493
|
asm
|
Assembly
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_213.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_213.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_213.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x4ea7, %r12
clflush (%r12)
nop
nop
cmp %rdi, %rdi
mov (%r12), %rsi
nop
nop
nop
add %rbx, %rbx
lea addresses_D_ht+0x19ba7, %rbp
nop
nop
nop
nop
inc %r12
mov $0x6162636465666768, %rdx
movq %rdx, %xmm7
vmovups %ymm7, (%rbp)
nop
and %rbx, %rbx
lea addresses_UC_ht+0xaea7, %rsi
lea addresses_A_ht+0x82a7, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
xor %rdx, %rdx
mov $14, %rcx
rep movsb
nop
nop
cmp %rdx, %rdx
lea addresses_D_ht+0x156a7, %rdi
xor $63029, %rbx
mov (%rdi), %rsi
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_WC_ht+0x56a7, %rsi
lea addresses_WC_ht+0x6227, %rdi
nop
nop
nop
nop
xor %r14, %r14
mov $100, %rcx
rep movsb
nop
nop
cmp %rbp, %rbp
lea addresses_UC_ht+0x164fb, %rsi
lea addresses_WT_ht+0x186a7, %rdi
nop
nop
nop
nop
xor $2447, %r14
mov $113, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $41243, %rdi
lea addresses_normal_ht+0x122a7, %rbx
nop
nop
nop
inc %rdi
vmovups (%rbx), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %rdx
nop
nop
nop
nop
nop
dec %rcx
lea addresses_WC_ht+0x12907, %rcx
clflush (%rcx)
sub %rdi, %rdi
mov (%rcx), %ebp
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x65f3, %r12
nop
nop
nop
nop
nop
sub %rdx, %rdx
movl $0x61626364, (%r12)
nop
nop
inc %rbx
lea addresses_WT_ht+0x1df27, %rdx
nop
add $12026, %rbx
movb $0x61, (%rdx)
nop
nop
sub %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %rbp
push %rdi
push %rdx
// Faulty Load
mov $0x45894100000006a7, %r12
clflush (%r12)
nop
xor %r10, %r10
movaps (%r12), %xmm3
vpextrq $0, %xmm3, %rbp
lea oracles, %rdi
and $0xff, %rbp
shlq $12, %rbp
mov (%rdi,%rbp,1), %rbp
pop %rdx
pop %rdi
pop %rbp
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': True, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.683616
| 2,999
| 0.658247
|
5401d28ad849a1c82cd63cd818ca91bb1eadf7eb
| 63,609
|
asm
|
Assembly
|
Build/Interpreters/beebOzmoo/asm/acorn.asm
|
polluks/Puddle-BuildTools
|
c1762d53a33002b62d8cffe3db129505a387bec3
|
[
"BSD-2-Clause"
] | 38
|
2021-06-18T12:56:15.000Z
|
2022-03-12T20:38:40.000Z
|
Build/Interpreters/beebOzmoo/asm/acorn.asm
|
polluks/Puddle-BuildTools
|
c1762d53a33002b62d8cffe3db129505a387bec3
|
[
"BSD-2-Clause"
] | 2
|
2021-06-20T16:28:12.000Z
|
2021-11-17T21:33:56.000Z
|
Build/Interpreters/beebOzmoo/asm/acorn.asm
|
polluks/Puddle-BuildTools
|
c1762d53a33002b62d8cffe3db129505a387bec3
|
[
"BSD-2-Clause"
] | 6
|
2021-06-18T18:18:36.000Z
|
2021-12-22T08:01:32.000Z
|
; Acorn-specific code factored out into its own file for readability.
; Note that the code macros defined in here have the suffix "_inline" if control
; flows straight through them or "_subroutine" if they end by executing rts (or
; equivalent).
; A note on Acorn memory models - this affects code in many places, but I have
; to write this somewhere.
;
; The second processor build (ifndef ACORN_SWR) has a simple flat memory model
; with user RAM from $0400-$f7ff inclusive. It's rather like the C64 but without
; even the complication of paging the kernal ROM in and out, so it doesn't need
; the cache which the C64 code uses when ALLMEM is defined. SFTODO: SAY SOMETHING ABOUT ACORN_TURBO_SUPPORTED
;
; The sideways RAM build (ifdef ACORN_SWR) is a bit more involved. The hardware
; situation here is that we have main RAM (not paged) from $0000-$7fff
; inclusive, with user RAM starting at OSHWM/PAGE, which varies between machines
; but will typically be in the range $e00-$1f00. Some builds hard-code a certain
; address, others use acorn-relocate.asm to accommodate this variation. We also
; have up to 16 different 16K banks of "sideways" RAM paged in at $8000-$bfff
; inclusive. (The BBC series and Electron have different ways to control paging;
; see the acorn_page_in_bank_* macros.) The OS is not paged and lives
; permanently at $c000-$ffff inclusive. The loader will have located any
; available sideways RAM banks, verified there's at least one and put the count
; and a list of bank numbers at ram_bank_{count,list} for us. SFTODO: MINOR QUIBBLE - LOADER WILL HAVE VERIFIED WE HAVE ENOUGH SWR BANKS, THERE MAY BE NONE IF WE CAN GET BY WITHOUT ANY
;
; Acorn Ozmoo uses two slightly different sideways RAM models. Both of them
; allow static/high memory to be spread over approximately 9 sideways RAM banks
; (indexed in 512-byte chunks with indexes from 0-254, with chunk 0 starting
; at story_start+nonstored_blocks). The standard Ozmoo mempointer (data) and
; z_pc_mempointer (Z-machine PC) pointers are extended to each have an associated
; RAM bank (mempointer_ram_bank and z_pc_mempointer_ram_bank respectively). (If
; the relevant byte of Z-machine memory lives in main RAM, the bank number is
; irrelevant as main RAM is not affected by paging.)
;
; The "big dynamic RAM" model (ifndef ACORN_SWR_SMALL_DYNMEM) allows the game's
; dynamic memory (which starts in main RAM at story_start, as on any Ozmoo build)
; to be larger than main RAM and overflow into the first 16K sideways RAM bank.
; The first 16K sideways RAM bank therefore has to be paged in by default, so
; that miscellaneous Ozmoo code which might try to access dynamic memory can do
; so without any trouble. In this model, accesses to memory via read_next_byte
; and read_next_byte_at_z_pc temporarily page in the relevant bank to read the
; byte and then page the first 16K sideways RAM bank back in. (As an
; optimisation, read_next_byte_at_z_pc_unsafe* and friends are used during
; instruction decoding to avoid flipping back and forth excessively while
; reading a multi-byte instruction. This is possible because only a very limited
; set of cases can cause accesses to dynamic memory during instruction decoding.)
;
; The "small dynamic RAM" model (ifdef ACORN_SWR_SMALL_DYNMEM) requires the game's
; dynamic memory to fit in main RAM. Since dynamic memory can then be accessed
; regardless of the currently paged in bank, Ozmoo instead keeps the bank
; containing the Z-machine's PC paged in by default, temporarily paging it out
; only when reading a data byte.
;
; On a second processor or BBC series machine with shadow RAM, screen RAM is
; separate from user RAM and doesn't get in the way. On a BBC B with no shadow
; RAM, we use a trick (see ACORN_NO_SHADOW) to relocate the 1K screen RAM to
; $3c00, leave a gap in the Ozmoo binary to accommodate that and we can then
; mostly forget about screen RAM. Dynamic memory starts at story_start just
; after the Ozmoo stack (as on the C64) and is followed (with suitable paging
; for ACORN_SWR) directly by the virtual memory cache.
;
; On the Electron shadow RAM is rare and we can't use the ACORN_NO_SHADOW trick
; to get the screen memory (8K, from $6000-$8000) out of the way. Ozmoo really
; wants dynamic memory to be contiguous, and there isn't really enough RAM free
; between the Ozmoo stack and the screen memory to run all the games we'd like
; to. We therefore compromise by forcing the use of the big dynamic RAM model
; and making dynamic RAM start at $8000 instead of following the Ozmoo stack.
; This limits us to 16K of dynamic memory, which isn't too bad (and is more than
; we'd have free below screen RAM). We use the main RAM between the Ozmoo stack
; and the screen RAM as additional virtual memory cache so it isn't wasted. An
; Electron is therefore about 7K worse off than a BBC B with the same amount of
; sideways RAM as a result of its larger screen memory, in addition to not
; supporting games needing more than 16K of dynamic memory. The Electron save/
; restore code has to be slightly different because the data we need to save/
; restore is no longer contiguous in memory.
; To improve readability of code and avoid double-nesting so we can test for
; ACORN_SWR and !ACORN_SWR_SMALL_DYNMEM in a single !ifdef, we define
; ACORN_SWR_BIG_DYNMEM internally - the build script should never set this.
!ifdef ACORN_SWR {
!ifndef ACORN_SWR_SMALL_DYNMEM {
ACORN_SWR_BIG_DYNMEM = 1
} else { ; ACORN_SWR_SMALL_DYNMEM
!ifdef ACORN_ELECTRON_SWR {
!error "ACORN_ELECTRON_SWR is not compatible with ACORN_SWR_SMALL_DYNMEM"
}
}
}
!zone {
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Sideways RAM paging
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!ifdef ACORN_SWR {
; SF: ENHANCEMENT: It would probably be possible (even easy) to use an AQR
; cartridge for all sideways RAM on a Master or Electron; it has its own special
; paging register though, so we'd need a separate build to support it, and auto-
; detecting it in a way that doesn't interfere with the user's other use of it
; may be tricky. There's also some sort of unlock stuff to contend with, I think.
; These macros must leave the selected bank number in A or Y as appropriate.
!ifndef ACORN_ELECTRON_SWR {
!macro acorn_page_in_bank_using_a .operand {
lda .operand
sta romsel_copy
sta bbc_romsel
}
!macro acorn_page_in_bank_using_a_comma_x .operand {
lda .operand,x
sta romsel_copy
sta bbc_romsel
}
!macro acorn_page_in_bank_using_a_comma_y .operand {
lda .operand,y
sta romsel_copy
sta bbc_romsel
}
!macro acorn_page_in_bank_using_y .operand {
ldy .operand
sty romsel_copy
sty bbc_romsel
}
} else { ; ACORN_ELECTRON_SWR
!macro acorn_page_in_bank_using_a .operand {
lda #12
sta romsel_copy
sta electron_romsel
lda .operand
sta romsel_copy
sta electron_romsel
}
!macro acorn_page_in_bank_using_a_comma_x .operand {
lda #12
sta romsel_copy
sta electron_romsel
lda .operand,x
sta romsel_copy
sta electron_romsel
}
!macro acorn_page_in_bank_using_a_comma_y .operand {
lda #12
sta romsel_copy
sta electron_romsel
lda .operand,y
sta romsel_copy
sta electron_romsel
}
!macro acorn_page_in_bank_using_y .operand {
ldy #12
sty romsel_copy
sty electron_romsel
ldy .operand
sty romsel_copy
sty electron_romsel
}
}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialization and finalization
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialization code which may be placed after the end of the Z-machine stack;
; this means it will be overwritten as soon as anything is loaded at
; story_start.
!macro acorn_init_code_overlapping_game_data {
; Initialization performed very early during startup.
deletable_init_start
ldx #1
jsr do_osbyte_rw_escape_key
!ifdef ACORN_NO_SHADOW {
+set_up_mode_7_3c00_inline
}
jsr screenkernal_init
; Now screenkernal_init has been executed, it's safe to call s_printchar, so
; install our own error handler which will use s_printchar by default. No
; error should be able to occur before this point. If an error occurs during
; a restart, which will re-run the executable, there's not much we can do
; but it's probably OK because the load will just replace the code with an
; identical copy.
lda #<error_handler
sta brkv
lda #>error_handler
sta brkv + 1
!ifdef ACORN_CURSOR_PASS_THROUGH {
ldx #1
jsr do_osbyte_set_cursor_editing
}
!ifdef ACORN_FUNCTION_KEY_PASS_THROUGH {
; We're going to generate ZSCII codes for the unshifted function keys. We
; choose a base of 133 (=ZSCII f1) for f0 because if we set a base of 132 so
; Acorn f1=ZSCII f1, Acorn f0 would act like cursor right. If we want Acorn
; f1=ZSCII f1 we'll fix that up in the translation table. SFTODO: I HAVEN'T ADDED THIS OPTION TO THE TRANSLATION TABLE YET
lda #osbyte_rw_function_key_status
ldx #133
jsr do_osbyte_y_0
; In order to allow the use of *KEY expansions, we'll make the shifted
; function keys generate those.
lda #osbyte_rw_shift_function_key_status
ldx #1 ; expand as normal soft key
jsr do_osbyte_y_0
}
; Patch re_enter_language to enter the current language; reading it here
; saves a few bytes of non-deletable code.
lda #osbyte_read_language
ldx #0
ldy #$ff
jsr osbyte
stx re_enter_language_ldx_imm + 1
!ifndef ACORN_SWR {
; On a second processor, a soft break will transfer control back to our
; execution address. We will have thrown away our initialization code by
; that point and can't restart properly. In order to avoid random behaviour
; and probably a crash, we patch the jmp at the start of the executable to
; transfer control to re_enter_language. This means that although the
; language name gets printed twice, a soft break otherwise gives a clean
; result similar to that on a non-second processor. This code is harmless
; if we're not running on a second processor, but it's not necessary either.
lda #<re_enter_language
sta initial_jmp + 1
lda #>re_enter_language
sta initial_jmp + 2
}
!ifdef ACORN_TURBO_SUPPORTED {
; This executable doesn't have a ROM header indicating we want the turbo
; mode enabled, so it will have been disabled when were were executed. Turn
; it back on if we do want it.
bit is_turbo
bpl .dont_enable_turbo
lda #$80
sta turbo_control
.dont_enable_turbo
}
+init_readtime_inline
jmp init_cursor_control
; SFTODO: Don't forget more code can go here if it can be executed before we
; start to put data at story_start.
} ; End of acorn_init_code_overlapping_game_data_inline
; Initialization subroutines which will be placed inside the Z-machine stack.
!macro acorn_init_code_in_stack {
screenkernal_init
+screenkernal_init_inline
rts
}
; Initialization performed shortly after startup, just after
; acorn_deletable_init_start. (The distinction is not that important on Acorn
; as the Ozmoo executable itself doesn't generate a splash screen.)
!macro acorn_deletable_init_inline {
!ifdef TRACE_FLOPPY {
; Call streams_init so the tracing is able to show the readblocks calls
; performed here.
jsr streams_init
}
.dir_ptr = zp_temp ; 2 bytes
.game_blocks = zp_temp + 2 ; 2 bytes
; We can't always use story_start to store the catalogue sectors because on an
; ACORN_ELECTRON_SWR build that's in sideways RAM, and we can't always use
; scratch_double_page because second processor builds don't have it.
!ifdef scratch_double_page {
.catalogue = scratch_double_page
} else {
.catalogue = story_start
}
!ifndef ACORN_ADFS {
; Examine the disc catalogue and determine the first sector occupied by the
; DATA file containing the game.
; Because this is initialisation code, we know the following variables are
; already set to predictable values. This optimisation was useful at one
; point but it's not really important right now; it isn't too confusing so
; let's keep it anyway now it's been tested.
!if 0 {
lda #2
sta readblocks_numblocks
lda #0
sta readblocks_currentblock
sta readblocks_currentblock + 1
sta readblocks_mempos ; .catalogue is page-aligned
!ifdef ACORN_TURBO_SUPPORTED {
; In reality this is redundant but let's play it safe.
sta readblocks_mempos + 2
}
}
lda #>.catalogue
sta .dir_ptr + 1
sta readblocks_mempos + 1
lda #0
sta readblocks_base
!ifndef ACORN_DSD {
sta readblocks_base + 1
}
; Note that because we're reading the first few sectors, this works
; correctly whether this is an ACORN_DSD build or not.
jsr readblocks
lda #8
sta .dir_ptr
.find_file_loop
ldy #0
ldx #(-8 & $ff)
.name_compare_loop
lda (.dir_ptr),y
; The directory name will have the top bit set iff the file is locked; we
; don't care about that here, so we need to strip it off. It's harmless to
; just do this for all characters.
and #$7f
cmp .data_filename-(-8 & $ff),x
bne .file_not_found
iny
inx
beq .file_found
bne .name_compare_loop
.data_filename
!text "DATA $"
.file_not_found
clc
lda .dir_ptr
adc #8
sta .dir_ptr
bne .find_file_loop
brk
!byte 0
!text "DATA not found"
!byte 0
.file_found
; We found the file's name using sector 0, we now want to look at the
; corresponding part of sector 1. Adjust .dir_ptr for convenience.
inc .dir_ptr + 1
; Determine the start sector of the DATA file and set readblocks_base.
ldy #6
lda (.dir_ptr),y
and #$3
!ifndef ACORN_DSD {
sta readblocks_base + 1
iny
lda (.dir_ptr),y
sta readblocks_base
} else {
sta dividend + 1
iny
lda (.dir_ptr),y
sta dividend
lda #0
sta divisor + 1
lda #10
sta divisor
jsr divide16
lda division_result
sta readblocks_base
}
; Determine the length of the DATA file in blocks.
ldy #6
lda (.dir_ptr),y
and #%110000
lsr
lsr
lsr
lsr
sta .game_blocks + 1 ; high byte of length in blocks
dey
lda (.dir_ptr),y
sta .game_blocks ; low byte of length in blocks
dey
lda (.dir_ptr),y ; low byte of length in bytes
beq +
inc .game_blocks
bne +
inc .game_blocks + 1
+
!ifdef ACORN_DSD {
; If this is a double-sided game, there will be *approximately* (definitely
; no more, possibly a track's worth of data less) the same amount of data
; on the second side. We don't look up :2.$.DATA and determine its length,
; we just double .game_blocks. The absolute worst case here is we read a
; track's worth of junk which won't be accessed because it's past the end
; of the game.
asl .game_blocks
rol .game_blocks + 1
!ifndef VMEM {
; If we don't have virtual memory, the logic below to cap .game_blocks at
; .ram_blocks won't kick in. Since we don't have virtual memory, we know the
; game will fit in RAM - but due to the doubling of .game_blocks we just did,
; it might be larger than RAM, causing us to read too much and corrupt
; things. TODO: If we simply passed in the game size as a build parameter
; this sort of thing would go away.
lda #0
sta .game_blocks + 1
lda #>(flat_ramtop - story_start)
cmp .game_blocks
bcs +
sta .game_blocks
+
}
}
} else { ; ACORN_ADFS
lda #<game_data_filename
sta scratch_page
lda #>game_data_filename
sta scratch_page + 1
lda #osfile_read_catalogue_information
ldx #<scratch_page
ldy #>scratch_page
jsr osfile
bne +
; The wording of this error is technically incorrect - we're trying to read
; information about the file, not open it - but I don't think it's a big
; deal. It shouldn't be happening at all, of course.
jmp cant_open_data_error
+ lda scratch_page + $a
beq +
inc scratch_page + $b
bne +
inc scratch_page + $c
+ lda scratch_page + $b
sta .game_blocks
lda scratch_page + $c
sta .game_blocks + 1
}
; If .game_blocks is odd, increment it by one so the game data is always
; considered to be a multiple of 512 bytes. This avoids having to worry
; about some corner cases and doesn't cause any problems; on DFS we're doing
; raw sector reads and the extra sector will always exist, on ADFS we may try
; to do a 512-byte read when only 256 bytes are available but that's fine.
lda .game_blocks
and #1
beq +
inc .game_blocks
bne +
inc .game_blocks + 1
+
!ifdef VMEM {
.ram_blocks = .dir_ptr ; 2 bytes
; How much RAM do we have available for game data?
; We have 64 (2^6) 256-byte blocks per sideways RAM bank, if we have any.
lda #0
sta .ram_blocks + 1
!ifdef ACORN_SWR {
lda ram_bank_count
ldx #6
- asl
rol .ram_blocks + 1
dex
bne -
}
sta .ram_blocks
!ifdef ACORN_TUBE_CACHE {
; We have some blocks of cache in the host, which aren't directly accessible
; but are almost as good as our own RAM and which will benefit from
; preloading if we're on a normal second processor. We count them for now so
; we process more of the initial vmap and fix up the inflated value of
; vmap_max_entries later.
.host_cache_size = memory_buffer
lda screen_mode
ora #128 ; force shadow mode on
tax
lda #osbyte_initialise_cache
jsr osbyte
stx .host_cache_size
!ifdef ACORN_TURBO_SUPPORTED {
; A turbo second processor has enough RAM to preload everything in vmap
; without touching the host cache. The host cache will still work, but we
; don't have anything to preload into it, so having initialised it there's
; nothing else to do.
bit is_turbo
bmi .host_cache_initialised
}
; X is cache size in 512-byte blocks, but we want to count 256-byte blocks here.
txa
asl
rol .ram_blocks + 1
sta .ram_blocks
.host_cache_initialised
SFTODOLABELX1
}
!ifdef ACORN_TURBO_SUPPORTED {
; On a turbo second processor, we will use all 128K in banks 1 and 2 as
; virtual memory cache.
bit is_turbo
bpl .dont_count_turbo_ram
inc .ram_blocks + 1
inc .ram_blocks + 1
.dont_count_turbo_ram
}
; We also have some blocks between flat_ramtop and story_start.
; SF: We're doing a constant subtraction in code here, but a) this is
; deletable init code so it doesn't really cost anything b) if we don't,
; the relocation code fails because we have a variation which doesn't follow
; the simple fixed relationship we expect.
lda #>flat_ramtop
sec
sbc #>story_start
clc
adc .ram_blocks
sta .ram_blocks
bcc +
inc .ram_blocks + 1
+
!ifdef ACORN_ELECTRON_SWR {
; We also have some blocks free between extra_vmem_start and the screen RAM.
lda #osbyte_read_screen_address
jsr osbyte
tya
dey
sty screen_ram_start_minus_1
sec
sbc #>extra_vmem_start
tax
clc
adc .ram_blocks
sta .ram_blocks
bcc +
inc .ram_blocks + 1
+ txa
lsr
sta vmem_blocks_in_main_ram
} else {
!ifdef ACORN_SWR {
; This value might be changed below.
lda #0
sta vmem_blocks_in_main_ram
}
}
; .ram_blocks now contains the number of 256-byte blocks of RAM we have
; available, including RAM which will be used for dynamic memory. The build
; system and the loader will have worked together to guarantee that:
; - .ram_blocks >= ACORN_INITIAL_NONSTORED_BLOCKS + 2*vmem_block_pagecount,
; i.e. that we have enough RAM for the game's dynamic memory and two
; 512-byte blocks of virtual memory cache.
; - the game always has at least one block of non-dynamic memory.
; In order to avoid accessing nonexistent game data in an attempt to use all
; that RAM, set .ram_blocks = min(.ram_blocks, .game_blocks).
ldx .game_blocks + 1
lda .game_blocks
cpx .ram_blocks + 1
bne +
cmp .ram_blocks
+ bcs +
stx .ram_blocks + 1
sta .ram_blocks
+
; Set nonstored_blocks to the number of 256-byte blocks of RAM we are going
; to treat as dynamic memory. This is normally the game's actual dynamic
; memory rounded up to a 512-byte boundary, i.e.
; ACORN_INITIAL_NONSTORED_BLOCKS.
lda #ACORN_INITIAL_NONSTORED_BLOCKS
sta nonstored_blocks
!ifdef VMEM {
!ifndef ACORN_NO_DYNMEM_ADJUST {
!ifdef ACORN_TURBO_SUPPORTED {
; SFTODO: REVIEW THIS FRESH
; On a turbo second processor, we can increase nonstored_blocks to promote
; some additional data into dynamic memory and make full use of bank 0. We
; don't need to keep any of bank 0 free for virtual memory cache because we
; have banks 1 and 2 for that. So we set nonstored_blocks = min(game_blocks
; - vmem_block_pagecount, available blocks in bank 0); see below for why we
; subtract vmem_block_pagecount. This subtraction can't cause
; nonstored_blocks < ACORN_INITIAL_NONSTORED_BLOCKS because the build system
; guarantees the game has at least one block of non-dynamic memory. The
; subtraction is otherwise harmless; it just means that for small games one
; 512-byte block of RAM will have to be accessed via the slower virtual
; memory code when it could maybe have been promoted to be dynamic memory.
;
; This adjustment will make it faster to access the part of the game which
; has been promoted into dynamic memory, so we do it even if this is a small
; game and we could address enough RAM for the entire game without it.
bit is_turbo
bpl .no_turbo_dynmem_adjust
SFTODOLABEL1
lda .game_blocks
sec
sbc #vmem_block_pagecount
tax
lda .game_blocks + 1
sbc #0
bne .available_blocks_is_smaller
cpx #>(flat_ramtop - story_start)
bcc .game_blocks_is_smaller
.available_blocks_is_smaller
ldx #>(flat_ramtop - story_start)
.game_blocks_is_smaller
stx nonstored_blocks
.no_turbo_dynmem_adjust
}
!ifdef ACORN_SWR {
; It may be useful to increase nonstored_blocks to promote some additional
; data into dynamic memory, either for performance or to make use of more
; sideways RAM. We must not make it too large for the memory model we're
; using. (This optimisation has relatively limited scope in the small model,
; but it's trivial to support it anyway. It's just conceivable some games
; and/or machines might benefit from --force-big-dynmem to give this
; optimisation more headroom, but of course the big model has its own
; performance drawbacks so it's probably best not using it unless we're
; forced to.)
.max_dynmem = zp_temp + 4 ; 1 byte
!ifdef ACORN_SWR_BIG_DYNMEM {
lda #>swr_ramtop
} else {
lda #>flat_ramtop
}
sec
sbc #>story_start
sta .max_dynmem
; If .game_blocks == .ram_blocks, we want to set nonstored_blocks as high as
; possible; there's no downside as we have enough RAM for the entire game
; and this will allow as much of the game as possible to be accessed via the
; faster dynamic memory code path. Set nonstored_blocks = min(.game_blocks -
; vmem_block_pagecount, .max_dynmem).
ldy .ram_blocks + 1
lda .ram_blocks
cpy .game_blocks + 1
bne .game_blocks_ne_ram_blocks
cmp .game_blocks
bne .game_blocks_ne_ram_blocks
sec
sbc #vmem_block_pagecount
tax
tya
sbc #0
bne .max_dynmem_is_smaller
cpx .max_dynmem
bcc .game_blocks_is_smaller
.max_dynmem_is_smaller
ldx .max_dynmem
.game_blocks_is_smaller
bne .dynmem_adjust_done ; Always branch
.game_blocks_ne_ram_blocks
; Note that we can't have .game_blocks < .ram_blocks because we reduced
; .ram_blocks to match earlier, so .game_blocks > .ram_blocks. We don't want
; to reduce flexibility by locking parts of the game into RAM instead of
; allowing the virtual memory system to choose what lives in RAM. It's only
; a clear win to increase nonstored_blocks if it brings otherwise unusable
; RAM into play. Set nonstored_blocks =
; max(min(.ram_blocks - vmap_max_size * vmem_block_pagecount, .max_dynmem),
; ACORN_INITIAL_NONSTORED_BLOCKS)
.min_lhs_sub = vmap_max_size * vmem_block_pagecount
sec
sbc #<.min_lhs_sub
tax
tya
sbc #>.min_lhs_sub
bmi .use_acorn_initial_nonstored_blocks
bne .use_min_rhs
cpx .max_dynmem
bcc .use_min_lhs
.use_min_rhs
ldx .max_dynmem
.use_min_lhs
cpx #ACORN_INITIAL_NONSTORED_BLOCKS
bcs .use_max_lhs
.use_acorn_initial_nonstored_blocks
ldx #ACORN_INITIAL_NONSTORED_BLOCKS
.use_max_lhs
.dynmem_adjust_done
stx nonstored_blocks
}
}
; Set .ram_blocks -= nonstored_blocks, i.e. set .ram_blocks to the number of
; RAM blocks we have available as virtual memory cache.
lda .ram_blocks
sec
sbc nonstored_blocks
sta .ram_blocks
bcs +
dec .ram_blocks + 1
+
; SFTODO: REVIEW ALL THE FOLLOWING FRESH, ESP "NEW" SWR CASE
; It's important .ram_blocks >= vmem_block_pagecount now so that we will set
; vmap_max_entries >= 1 below. Conceptually it makes sense for
; vmap_max_entries to be 0 but in practice lots of code assumes it isn't.
;
; The build system and loader work together to guarantee (initial)
; .ram_blocks >= ACORN_INITIAL_NONSTORED_BLOCKS + 2 * vmem_block_pagecount.
; If nonstored_blocks has not been adjusted, there are two cases:
; a) If we didn't set .ram_blocks = .game_blocks above, the build system and
; loader guarantee means we now have .ram_blocks >= 2 *
; vmem_block_pagecount. QED.
; b) If we did set .ram_blocks = .game_blocks above, we know that the
; game has at least one block of non-dynamic memory, so before the
; subtraction we had .ram_blocks = .game_blocks >=
; ACORN_INITIAL_NONSTORED_BLOCKS + vmem_block_pagecount. QED.
;
; On a turbo second processor, we may have adjusted nonstored_blocks. There are
; two cases:
; a) If we didn't set .ram_blocks = .game_blocks above, as nonstored_blocks
; lives in bank 0 and we also have banks 1 and 2 for virtual memory
; cache, after the subtraction we have .ram_blocks ~= 128K >=
; vmem_block_pagecount. QED.
; b) If we did set .ram_blocks = .game_blocks above, combine that with the
; fact the adjustment to nonstored_blocks left nonstored_blocks <=
; .game_blocks - vmem_block_pagecount. QED.
;
; On a sideways RAM build, we may have adjusted nonstored_blocks. There are
; two cases:
; a) If we didn't set .ram_blocks = .game_blocks above, we either:
; 1) set nonstored_blocks = ACORN_INITIAL_NONSTORED_BLOCKS; see the "not
; been adjusted" case above.
; 2) set nonstored_blocks <= .ram_blocks - vmap_max_size *
; vmem_block_pagecount, so after the subtraction we have .ram_blocks
; >= vmap_max_size * vmem_block_pagecount. QED
; b) exactly the same as for the turbo second processor
}
!ifndef ACORN_SWR {
; vmap_first_ram_page is set at build time to suit a normal second processor
; and it's not used on a turbo second processor, so we don't need any code
; to initialise it.
}
; Now set vmap_max_entries = min(.ram_blocks / vmem_block_pagecount,
; vmap_max_size), i.e. the number of vmap entries we have RAM to support.
; (If we're in the ACORN_TUBE_CACHE case on a normal second processor, we
; have that much RAM in total but the number of vmap entries we can support
; is lower. It's convenient to work with this larger value while we do the
; initial load, then vmap_max_entries is fixed up later.)
ldx #vmap_max_size
lda .ram_blocks
lsr .ram_blocks + 1
bne .cap_at_vmap_max_size
ror
cmp #vmap_max_size
bcs .cap_at_vmap_max_size
tax
.cap_at_vmap_max_size
stx vmap_max_entries
; SFTODO: Probably not, but can the existence of vmap_sort_entries help simplify the normal tube+cache case?
vmap_sort_entries = vmem_temp ; 1 byte
SFTODOLABEL5
!ifndef ACORN_NO_DYNMEM_ADJUST {
; If we've adjusted nonstored_blocks, we may need to sort more than
; vmap_max_entries elements of vmap and it's definitely safe to sort all
; vmap_max_size entries, because we either have enough RAM for vmap_max_size
; blocks of virtual memory cache or we have enough RAM for the entire game.
lda nonstored_blocks
cmp #ACORN_INITIAL_NONSTORED_BLOCKS
beq +
ldx #vmap_max_size
+
}
stx vmap_sort_entries
}
; Load the nonstored blocks, or all the blocks if we're not using virtual
; memory. We don't need to worry about reading past the end of the game data
; here, because at worst we will read a final 512-byte block when we don't
; have a full block and that's fine.
.blocks_to_read = zp_temp + 4 ; 1 byte
; Because this is initialisation code, we know the following variables are
; already set to predictable values. This optimisation was useful at one
; point but it's not really important right now; it isn't too confusing so
; let's keep it anyway now it's been tested.
!if 0 {
lda #2
sta readblocks_numblocks
lda #0
sta readblocks_currentblock
sta readblocks_currentblock + 1
sta readblocks_mempos ; story_start is page-aligned
!ifdef ACORN_TURBO_SUPPORTED {
; On a turbo second processor readblocks_mempos + 2 is significant and will
; vary; it's probably still zero at this point but play it safe. On a normal
; second processor readblocks_mempos + 2 will always be 0 so this is
; redundant but harmless.
sta readblocks_mempos + 2
}
} else {
; If we're on DFS the earlier read of the catalogue will have bumped
; readblocks_currentblock and readblocks_mempos, so they have to be set
; explicitly.
lda #0
sta readblocks_currentblock
}
lda #>story_start
sta readblocks_mempos + 1
!ifdef VMEM {
lda nonstored_blocks
} else {
lda .game_blocks
}
sta .blocks_to_read
!ifdef ACORN_SWR_BIG_DYNMEM {
; Page in the first bank as dynamic memory may overflow into it.
+acorn_page_in_bank_using_a ram_bank_list
}
.dynmem_load_loop
jsr readblocks
lda .blocks_to_read
sec
sbc readblocks_numblocks
sta .blocks_to_read
bne .dynmem_load_loop
!ifdef ACORN_SWR {
; Calculate vmem_blocks_in_main_ram and vmem_blocks_stolen_in_first_bank.
lda nonstored_blocks
clc
adc #>story_start
ldx #0
stx vmem_blocks_stolen_in_first_bank
sec
sbc #>flat_ramtop
bcc .some_vmem_in_main_ram
lsr
sta vmem_blocks_stolen_in_first_bank
bpl + ; Always branch
.some_vmem_in_main_ram
; Carry is clear; negate A
eor #$ff
adc #1
lsr
sta vmem_blocks_in_main_ram
+
}
!ifdef VMEM {
!ifndef PREOPT {
; Sort vmap into ascending order, preserving the timestamps but using just the
; addresses as keys. This avoids the drive head jumping around during the
; initial load. The build system can't do this sort, because we're sorting
; the truncated list with just vmap_sort_entries not the full list of
; vmap_max_size entries.
;
; This only happens once and it's not a huge list so while we don't want it
; to be really slow, compactness and simplicity of code are also important.
; This is an insertion sort, implemented based on the pseudocode from
; https://en.m.wikipedia.org/wiki/Insertion_sort, which I've relabelled here
; to match the register use in the following code:
;
; x = 1
; while x < length(vmap_z)
; temp = vmap_z[x]
; y = x - 1
; while y >= 0 and vmap_z[y] > temp
; vmap_z[y+1] = vmap_z[y]
; y = y - 1
; end while
; vmap_z[y+1] = temp
; x = x + 1
; end while
;
; Invariants:
; 1 <= x <= length(vmap_z) <= vmap_max_size <= 255
; -1 <= y < x, so -1 <= y <= 254
;
; This takes about 0.42 seconds to sort 255 shuffled entries at 2MHz; that's
; not great but it's not terrible. It takes about 0.1 seconds to sort 122
; shuffled entries, which is probably a more typical case. Given a sorted
; list - as will happen if the preopt mode has not been used - it takes
; about 0.02 seconds to "sort" 255 entries, so there's no significant
; performance penalty when this is not doing anything useful.
; (We could simply not include this code if we don't have any preopt data,
; but it's discardable init code so it's not really harmful and it seems
; best for support purposes to keep the code identical whether or not preopt
; data is supplied or not.)
ldx #1
.outer_loop
lda vmap_z_l,x
sta zp_temp
lda vmap_z_h,x
sta zp_temp + 1
and #vmem_highbyte_mask
sta zp_temp + 4
txa
tay
.inner_loop
dey
lda vmap_z_h,y
and #vmem_highbyte_mask
cmp zp_temp + 4
bne +
lda vmap_z_l,y
cmp zp_temp
beq .exit_inner_loop
+ bcc .exit_inner_loop
lda vmap_z_l,y
sta vmap_z_l + 1,y
lda vmap_z_h,y
sta vmap_z_h + 1,y
tya
bne .inner_loop
dey
.exit_inner_loop
; We can't omit this iny and use vmap_z_[lh] + 1,y below to compensate
; because Y may be -1 (255) and so they're not equivalent.
iny
lda zp_temp
sta vmap_z_l,y
lda zp_temp + 1
sta vmap_z_h,y
inx
cpx vmap_sort_entries
bne .outer_loop
!ifndef ACORN_NO_DYNMEM_ADJUST {
; The initial vmap created by the build system assumes nonstored_blocks ==
; ACORN_INITIAL_NONSTORED_BLOCKS, so if we changed nonstored_blocks earlier
; we need to adjust the vmap to compensate. If we didn't adjust it, this
; code is a no-op. As the vmap is now sorted by address we just need to find
; the first entry which doesn't correspond to dynamic memory and move
; everything down so that entry becomes the first entry in the vmap. The
; space freed up at the end of the vmap by this move is filled with dummy
; entries so those entries will be used first when the game needs to load
; more blocks from disc.
SFTODOLABEL2
ldx #255
.find_first_non_promoted_entry_loop
inx
lda vmap_z_h,x
and #vmem_highbyte_mask
bne .found_first_non_promoted_entry
lda vmap_z_l,x
cmp nonstored_blocks
bcc .find_first_non_promoted_entry_loop
.found_first_non_promoted_entry
txa
beq .no_dynmem_promotion
ldy #0
.vmap_move_down_loop
cpx #vmap_max_size
beq .use_dummy_entry
lda vmap_z_h,x
sta vmap_z_h,y
lda vmap_z_l,x
inx
bne + ; Always branch
.use_dummy_entry
; We use $0101 as a dummy entry; this has the oldest possible timestamp so
; the entry will be re-used ASAP and because it has the low bit of the
; address set it can never accidentally match a lookup. (We could use 0 in
; practice; that would never match a lookup because address 0 is guaranteed
; to be dynamic memory so we will never search the vmap for it. But it seems
; a little clearer to use $0101, and this needs to execute on all machines
; so we can't micro-optimise by using stz.)
lda #1
sta vmap_z_h,y
+ sta vmap_z_l,y
iny
cpy vmap_max_entries
bne .vmap_move_down_loop
.no_dynmem_promotion
}
; Debugging code - use this in conjunction with --print-vm.
!if 0 {
jsr streams_init
; vmap_used_entries is set later in normal use, but set it early here so
; print_vm shows the entire vmap.
lda vmap_max_entries
sta vmap_used_entries
lda #'X'
jsr s_printchar
lda #>story_start
jsr print_byte_as_hex
lda nonstored_blocks
jsr print_byte_as_hex
jsr newline
jsr osrdch
}
; Now we've got vmap how we want it, load the corresponding blocks into
; memory and initialise vmap_used_entries. (This roughly corresponds to the
; C64 load_suggested_pages subroutine.)
!ifdef ACORN_TURBO_SUPPORTED {
bit is_turbo
bpl .normal_tube_load
; On a turbo second processor we don't do any preloading of the host cache
; so we just use a straightforward load loop like the non-tube-cache case
; below.
stz vmap_index
!ifdef ACORN_TUBE_CACHE {
lda #$ff
sta osword_cache_index_offered
sta osword_cache_index_offered + 1
}
.turbo_load_loop
jsr load_blocks_from_index
inc vmap_index
lda vmap_index
cmp vmap_max_entries
bne .turbo_load_loop
sta vmap_used_entries
jmp .all_loading_done
.normal_tube_load
}
!ifdef ACORN_TUBE_CACHE {
; SFTODO: These labels should probably start with a "."
inflated_vmap_max_entries = zp_temp
from_index = zp_temp + 1
to_index = vmap_index
load_scratch_space = flat_ramtop - vmem_blocksize
SFTODOLABELX2
; vmap_max_entries was deliberately artificially high up to this point so
; we'd retain and sort more of the initial vmap; set it to the correct value
; reflecting the size of the vmap Ozmoo's virtual memory has to work with.
; SFTODO: Worth noting that here - and might be useful in some other code
; too - we are calculating using known-at-build-time values. I could
; potentially simplify/shorten the code in a few places by not treating this
; dynamically, e.g. we wouldn't need the code to populate .game_blocks in
; the first place. (on SWR builds the dynmem growth optimisation means
; nonstored_blocks is not precisely known at build time, but that's not an
; issue for a tube build) This might also simplify some corner cases in the
; "grow nonstored_blocks" logic, because the game size is no longer a
; runtime variable. I just worry a little bit about this breaking
; already-not-supposed-to-work-but-sort-of-does-just-about things where a
; game developer wants to switch in an updated data file without going
; through the Ozmoo build process.
lda vmap_max_entries
sta inflated_vmap_max_entries
lda #>(flat_ramtop - story_start)
ldx .game_blocks + 1
bne +
cmp .game_blocks
bcc +
lda .game_blocks
+ sec
sbc nonstored_blocks
lsr
sta vmap_max_entries
sta vmap_used_entries
; Adjust .host_cache_size so the following load loop won't try to put "too
; much" into the host cache; if this happens we might not have enough blocks
; to load into the local virtual memory cache and so some vmap entries would
; be present but not have actually been loaded. (This can happen because the
; cutover timestamp isn't that precise due to limited timestamp resolution,
; especially for Z4+ games.) Note that this doesn't actually stop us using
; more of the host cache; we will offer it blocks willy-nilly during play
; and if it has space it will hold onto them.
SFTODOLABELX3
lda inflated_vmap_max_entries
sec
sbc vmap_max_entries
sta .host_cache_size
; We now need to load the inflated_vmap_max_entries blocks in the vmap from
; disk; vmap_max_entries blocks will go into our local memory as normal, the
; remainder need to be handed over to the host cache. We want the newer
; (higher timestamp) blocks in local memory, but remember vmap is sorted by
; block address to avoid the disk head jumping around. We use knowledge of
; how the build system generates the timestamps on vmap to identify a
; timestamp cutover point which will (except for the fact that the same
; timestamp can occur on multiple entries) separate the vmap into two chunks
; of the required sizes. (If the cutover timestamp is calculated
; incorrectly, we will still load everything we should, but newer blocks
; will tend to be in the host cache when we'd prefer them to be in local
; memory.)
.vmem_blocks = ((>(flat_ramtop - story_start)) - ACORN_INITIAL_NONSTORED_BLOCKS) / vmem_block_pagecount
.cutover_timestamp = int(ACORN_TUBE_CACHE_MAX_TIMESTAMP + ((float(.vmem_blocks) / vmap_max_size) * (ACORN_TUBE_CACHE_MIN_TIMESTAMP - ACORN_TUBE_CACHE_MAX_TIMESTAMP))) and ($ff xor vmem_highbyte_mask)
; Work through the blocks in vmap, loading each in turn and offering it to
; the host cache if it's old and there's room, and keeping it loaded into
; local memory otherwise. We keep doing this until we've loaded
; vmap_max_entries blocks into local memory (blocks offered to the host
; cache don't count) or until we've loaded all the blocks in vmap.
lda #0
sta from_index
sta to_index
lda #$ff
sta osword_cache_index_offered
sta osword_cache_index_offered + 1
.first_load_loop
ldx from_index
ldy to_index
lda vmap_z_l,x
sta vmap_z_l,y
lda vmap_z_h,x
sta vmap_z_h,y
jsr load_blocks_from_index
ldy to_index
lda vmap_z_h,y
; and #$ff xor vmem_highbyte_mask ; not necessary as we're doing a >= test
cmp #.cutover_timestamp + 1
bcs .dont_put_in_cache
+ ldx .host_cache_size
beq .dont_put_in_cache
dec .host_cache_size
and #$ff xor vmem_highbyte_mask
sta osword_cache_index_offered_timestamp_hint
; load_blocks_from_index will have set osword_cache_index_requested
lda osword_cache_index_requested
sta osword_cache_index_offered
lda osword_cache_index_requested + 1
sta osword_cache_index_offered + 1
jmp .continue
.dont_put_in_cache
lda #$ff
sta osword_cache_index_offered
sta osword_cache_index_offered + 1
inc to_index
.continue
inc from_index
lda to_index
cmp vmap_max_entries
bne .first_load_loop
; We may have already loaded all the blocks, but if we haven't we now need
; to start re-using vmap[vmap_max_entries - 1] to load the rest. (We can
; only load into local memory and we've used it all.) We no longer have the
; luxury of (easily) putting the blocks with older timestamps into the host
; cache and keeping the younger ones in local memory, but if we chose the
; cutover timestamp correctly we should end up with at most one misplaced
; block in each cache. SFTODO: I'M NOT SURE IT'S AS PRECISE AS ONE MISPLACED BLOCK, DUE TO LACK OF TIMESTAMP RESOLUTION - IT MAY BE ONE MISPLACED *TIMESTAMP*. IT ISN'T THAT BIG A DEAL, BUT THINK ABOUT THIS AND UPDATE THIS COMMENT. The misplaced block in the host cache will be the
; newest block in the host cache so it will spend a long time in there
; before being discarded, which should give plenty of opportunity for it to
; be requested during gameplay and moved into local memory before it's lost.
; SFTODO: vmap_index is an alias for to_index, maybe use to_index in the follow loop to match the previous loop? This (double check) is just a labelling change, the code would be identical.
dec vmap_index ; set vmap_index = vmap_max_entries - 1
.second_load_loop
ldx from_index
cpx inflated_vmap_max_entries
beq .second_load_loop_done
ldy vmap_index
lda vmap_z_l,y
sta osword_cache_index_offered
lda vmap_z_h,y
and #vmem_highbyte_mask
sta osword_cache_index_offered + 1
lda vmap_z_h,y
and #$ff xor vmem_highbyte_mask
sta osword_cache_index_offered_timestamp_hint
lda vmap_z_l,x
sta vmap_z_l,y
lda vmap_z_h,x
sta vmap_z_h,y
jsr load_blocks_from_index
inc from_index
jmp .second_load_loop
.second_load_loop_done
; Now we've finished the initial load, specify no timestamp hint for cache
; operations; this setting will remain untouched for the rest of the game.
lda #osword_cache_no_timestamp_hint
sta osword_cache_index_offered_timestamp_hint
} else { ; not ACORN_TUBE_CACHE
; Load the blocks in vmap.
lda #0
sta vmap_index
- jsr load_blocks_from_index
inc vmap_index
lda vmap_index
cmp vmap_max_entries
bne -
SFTODOLABEL4
sta vmap_used_entries
}
.all_loading_done
!ifdef ACORN_SWR {
; The load loop may have left the last bank of sideways RAM paged in; we
; need to page the default bank back in.
+acorn_swr_page_in_default_bank_using_y
}
} ; End of !ifndef PREOPT
} ; End of !ifdef VMEM
; Calculate CRC of block 0 before it gets modified, so we can use it later
; to identify the game disc after a save or restore.
lda #0
ldx #<story_start
ldy #>story_start
jsr calculate_crc ; corrupts some zp_temp locations
stx game_disc_crc
sty game_disc_crc + 1
} ; End of acorn_deletable_init_inline
!ifdef ACORN_SWR {
!macro acorn_swr_page_in_default_bank_using_y {
!ifdef ACORN_SWR_BIG_DYNMEM {
+acorn_page_in_bank_using_y ram_bank_list
} else {
+acorn_page_in_bank_using_y z_pc_mempointer_ram_bank
}
}
}
; Acorn-specific initialization to carry out in deletable_screen_init_2. This is
; quite late in the initialization process - in particular it happens after the
; lengthy loading process in acorn_deletable_init_inline.
!macro acorn_deletable_screen_init_2_inline {
!ifdef ACORN_NO_SHADOW {
; It's not safe to do vdu_cls without having a text window in effect.
; Normally the one set up when we first entered this version of mode 7 is
; in effect, but if there's been any output (e.g. due to disc errors) via
; s_printchar between then and now we may no longer have one in effect.
; s_printchar normally takes care of creating one as needed, but since we're
; going to do vdu_cls directly we need to take care of this.
+define_mode_7_3c00_text_window_inline
lda #vdu_cls
jsr oswrch
} else {
; Set the desired mode. If we're already in the right mode we don't reselect
; it, to avoid the screen flashing briefly to black. This is deletable init
; code so we can afford minor luxuries like this.
lda #osbyte_read_screen_mode
jsr osbyte
cpy screen_mode
beq .already_in_right_mode
lda #vdu_set_mode
jsr oswrch
lda screen_mode
ora #128 ; force shadow mode on
jsr oswrch
jmp .mode_set
.already_in_right_mode
; Clear the screen; this is mostly unnecessary, but for Z3 games which are
; loading from the loader in mode 7 it clears any leftover text on the top
; line of the screen.
lda #vdu_cls
jsr oswrch
.mode_set
; Setting the mode will have turned the cursor back on, so fix that.
jsr init_cursor_control
; We must re-initialise screenkernal to pick up the details of the new mode.
jsr screenkernal_init
; We must also reset the window sizes; we do this by re-executing
; deletable_screen_init_1.
jsr deletable_screen_init_1
}
!ifdef ACORN_HW_SCROLL {
ldx #1
ldy screen_mode
cpy #7
bne +
dex
+ stx use_hw_scroll
}
jsr update_colours
} ; End of acorn_deletable_screen_init_2_inline
!macro clean_up_and_quit_inline {
; TODO: Should this print something like "[Press SPACE]", flush keyboard
; buffer and wait for SPACE before continuing? Maybe also adding a blank
; line of output before we call osbyte_enter_language for neatness. Apart
; from looking nicer, this might have a useful gameplay function as entering
; BASIC could cause text to scroll which the user hasn't read yet, whereas
; our "[Press SPACE]" prompt would be done under control of Ozmoo's paging.
!ifdef ACORN_NO_SHADOW {
jsr undo_mode_7_3c00
}
jsr set_os_normal_video
jsr turn_on_cursor
ldx #0
jsr do_osbyte_rw_escape_key
!ifdef ACORN_CURSOR_PASS_THROUGH {
jsr do_osbyte_set_cursor_editing_x_0
}
!ifdef ACORN_FUNCTION_KEY_PASS_THROUGH {
lda #osbyte_rw_function_key_status
ldx #1 ; default - expand as normal soft key
jsr do_osbyte_y_0
lda #osbyte_rw_shift_function_key_status
ldx #$80 ; default - generate $80+n
jsr do_osbyte_y_0
}
; Re-enter the current language.
re_enter_language
lda #osbyte_enter_language
re_enter_language_ldx_imm
ldx #$ff
jsr osbyte
; never returns
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; OS error handling and associated routines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
error_handler
ldy .error_handler_newlines
beq +
- lda #13
jsr .error_handler_print_char
dey
bne -
+ ldy #1
- lda (error_ptr), y
beq +
jsr .error_handler_print_char
iny
bne - ; Always branch
; The following jmp will be patched by code which wants to gain control
; after an error.
.error_handler_jmp
+ jmp .press_break
default_error_handler_newlines = 2
.error_handler_newlines !byte default_error_handler_newlines
.press_break
; We don't use print_following_string here because we don't want to assume
; Ozmoo's own printing mechanisms are properly initialized.
jsr error_print_following_string
!text " - press BREAK",0
- jmp -
; Depending on what's happening when an error occurs, we need to output using
; different primitives. We therefore always use this subroutine and it gets
; patched at runtime.
.error_handler_print_char
jmp s_printchar
; Like print_following_string, but using .error_handler_print_char.
error_print_following_string
pla
sta .error_print_following_string_lda + 1
pla
sta .error_print_following_string_lda + 2
- inc .error_print_following_string_lda + 1
bne +
inc .error_print_following_string_lda + 2
+
.error_print_following_string_lda
lda $ffff
beq +
jsr .error_handler_print_char
jmp -
+ lda .error_print_following_string_lda + 2
pha
lda .error_print_following_string_lda + 1
pha
rts
error_print_s_printchar = 0
error_print_osasci = 1
.error_print_table_l
!byte <s_printchar
!byte <osasci
.error_print_table_h
!byte >s_printchar
!byte >osasci
; Allow trapping of errors signalled by the OS via BRKV. Used like this:
; ldx #2 ; number of newlines to print before any error
; ldy #n ; type of printing to use if an error occurs (0 s_printchar, 1 osasci)
; jsr setjmp
; beq ok
; ; error occurred, do something
; jsr set_default_error_handler ; before returning
; rts
; ok
; ; do something that might cause an error
; jsr set_default_error_handler ; errors after this point aren't our problem
setjmp
stx .error_handler_newlines
lda .error_print_table_l,y
sta .error_handler_print_char + 1
lda .error_print_table_h,y
sta .error_handler_print_char + 2
lda #<.setjmp_error_handler
sta .error_handler_jmp + 1
lda #>.setjmp_error_handler
sta .error_handler_jmp + 2
!ifdef ACORN_SWR {
; The OS will page the current language back in on BRK, so we need to save
; the current bank and restore it in .setjmp_error_handler.
lda romsel_copy
sta jmp_buf_ram_bank
}
; We need to save the contents of the stack, because they may be corrupted
; when an error message is generated. (They probably won't be, but we can't
; rely on it.) As a nice side effect of this, the return address for our
; caller is saved so .setjmp_error_handler can simply rts after restoring
; the stack.
; SFTODO: If jmp_buf is made smaller, we could probably fairly easily
; detect overflow - initialize y with -buffer_size, do sta jmp_buf+1+buffer_size,y
; and if the bne after the iny isn't taken we've overflowed. There might be
; an off by one error in that, I'm just sketching the idea out. This is
; tempting, *but* at the moment jmp_buf is going to live in $400-800 and
; (except for the possibility of starting code at say $600 on 2P) we have
; loads of free space down there, so adding a few bytes of code to the VM
; to detect overflow and cause a fatal error will eat into valuable memory
; for the sake of optimising use of a currently not-scare resource. Think
; about it, maybe convert this to an SF: comment.
tsx
stx jmp_buf
ldy #0
- inx
beq +
lda stack,x
sta jmp_buf+1,y
iny
bne -
+ ; Z flag is set
rts
.setjmp_error_handler
ldx jmp_buf
txs
ldy #0
- inx
beq +
lda jmp_buf+1,y
sta stack,x
iny
bne -
+
!ifdef ACORN_SWR {
+acorn_page_in_bank_using_a jmp_buf_ram_bank
}
lda #1 ; Z flag is clear
rts
set_default_error_handler
lda #default_error_handler_newlines
sta .error_handler_newlines
lda #<s_printchar
sta .error_handler_print_char + 1
lda #>s_printchar
sta .error_handler_print_char + 2
lda #<.press_break
sta .error_handler_jmp + 1
lda #>.press_break
sta .error_handler_jmp + 2
.set_default_error_handler_rts
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; C64 kernal_readtime emulation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The Acorn OS time counter is a 5 byte value, whereas (ignoring the
; difference in resolution) the Commodore one is 3 bytes. Because the Acorn
; OS time counter may have an arbitrarily large value (perhaps some kind of
; soft RTC solution) when we start up and we don't want to zero it, we read
; the initial value and subtract that from any subsequent reads.
!macro init_readtime_inline {
lda #osword_read_clock
ldx #<initial_clock
ldy #>initial_clock
jsr osword
}
kernal_readtime
.current_clock = scratch_page
lda #osword_read_clock
ldx #<.current_clock
ldy #>.current_clock
jsr osword
ldx #(256-5)
sec
- lda .current_clock-(256-5),x
sbc initial_clock-(256-5),x
sta .current_clock-(256-5),x
inx
bne -
; The Acorn clock is in centiseconds; a PAL C64 would use fiftieths of a
; second, so halve the value before we return it.
ldx #4
clc
- ror .current_clock,x
dex
bpl -
; All the above means we're at no more or less risk than a C64 of having the
; time roll over during a game. It would take >3.8 days for this to happen.
ldy .current_clock+2
ldx .current_clock+1
lda .current_clock+0
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ACORN_NO_SHADOW support (mode 7 screen at $3c00 instead of $7c00)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If we have no shadow RAM, we need to relocate the mode 7 screen to $3c00 to
; create a contiguous area of RAM from $4000-$c000. See
; https://stardot.org.uk/forums/viewtopic.php?f=54&t=20149 for more discussion
; on this.
!ifdef ACORN_NO_SHADOW {
!ifndef ACORN_SWR {
!error "ACORN_NO_SHADOW only makes sense with ACORN_SWR"
}
!ifdef ACORN_HW_SCROLL {
; The OS can't hardware scroll the mode 7 screen at this non-standard
; location.
!error "ACORN_HW_SCROLL is not compatible with ACORN_NO_SHADOW"
}
!macro make_acorn_screen_hole {
.tolerance = 256
!if * <= $3c00 {
!if ($3c00 - *) <= .tolerance {
acorn_screen_hole_start = *
!fill $4000 - *, 'X'
acorn_screen_hole_end
}
}
}
!macro make_acorn_screen_hole_jmp {
.jmp_size = 3
.tolerance = 256
!if * <= ($3c00 - .jmp_size) {
!if ($3c00 - *) <= .tolerance {
jmp acorn_screen_hole_end
acorn_screen_hole_start = *
!fill $4000 - *, 'X'
acorn_screen_hole_end
}
}
}
; On $e00 builds the binary is likely to fit entirely below the screen at $3c00.
; We need the stack and story to be contiguous, so we must insert a large enough
; hole at this point even if we're not close to $3c00.
;
; .swap_pointers_for_save will temporarily corrupt the last few bytes of the
; screen memory just below the start of the stack (i.e. just below $4000), but
; this shouldn't actually be visible because we're using software scrolling and
; the mode 7 screen data actually only occupies the first 40*25 bytes at $3c00,
; so it's not necessary to include some extra padding at $4000 to avoid this.
; SFTODO: BE GOOD TO TEST THIS!
!macro make_acorn_screen_hole_before_stack {
!if * <= $3c00 {
acorn_screen_hole_start = *
!fill $4000 - *, 'X'
acorn_screen_hole_end
}
}
!macro check_acorn_screen_hole {
; This check is important to ensure the no shadow RAM build doesn't crash,
; but when the check fails, we need to be able to disable it in order to
; allow assembly to complete so we can look at the acme report output and
; decide where to add a +make_acorn_screen_hole invocation.
!ifndef ACORN_DISABLE_SCREEN_HOLE_CHECK {
!ifndef acorn_screen_hole_start {
!error "Acorn screen hole has not been added"
} else {
!if acorn_screen_hole_start > $3c00 {
!error "Acorn screen hole starts too late"
}
!if acorn_screen_hole_end < $4000 {
!error "Acorn screen hole ends too soon"
}
}
}
}
; This macro is like an initialization subroutine, but by using a macro we
; can place it in the discardable init code while still having it in this file
; where it logically belongs.
!macro set_up_mode_7_3c00_inline {
; In reality we don't expect to be called with our handlers already
; installed, but be paranoid - this is deletable init code so it's mostly
; free.
lda wrchv
cmp #<our_wrchv
bne +
lda wrchv + 1
cmp #>our_wrchv
beq .set_up_mode_7_3c00_done
+
; Copy the contents of the current screen for neatness.
ldx #$7c
ldy #$3c
jsr screen_copy
; Reprogram the CRTC and poke the OS variables to mostly compensate.
lda #crtc_screen_start_high
sta crtc_register
lda #$20
sta crtc_data
lda #$3c
sta bottom_of_screen_memory_high
sta display_start_address + 1
; Define a text window and reposition the cursor; doing this forces the OS
; to notice the changes we just made. The text window also prevents hardware
; scrolling; all the output from the main Ozmoo code will be protected using
; text windows anyway since ACORN_HW_SCROLL is not defined, but having one
; in place straight away is useful insurance.
lda #osbyte_read_cursor_position
jsr osbyte
+define_mode_7_3c00_text_window_inline
jsr do_oswrch_vdu_goto_xy
; Install our handlers to fix some problems with the OS's handling of this
; unofficial mode.
lda wrchv
sta call_old_wrchv + 1
lda wrchv + 1
sta call_old_wrchv + 2
lda #<our_wrchv
sta wrchv
lda #>our_wrchv
sta wrchv + 1
lda keyv
sta call_old_keyv + 1
lda keyv + 1
sta call_old_keyv + 2
lda #<our_keyv
sta keyv
lda #>our_keyv
sta keyv + 1
.set_up_mode_7_3c00_done
}
!macro define_mode_7_3c00_text_window_inline {
lda #vdu_define_text_window
jsr oswrch
lda #0
jsr oswrch
lda #24
jsr oswrch
lda #39
jsr oswrch
lda #0
jsr oswrch
}
!macro adjust_cursor_inline {
lda #crtc_cursor_start_high
sta crtc_register
lda text_cursor_address + 1
sec
sbc #$1c
sta crtc_data
}
our_wrchv
call_old_wrchv
jsr $ffff ; patched during initialization
pha
+adjust_cursor_inline
pla
rts
our_keyv
bcc call_old_keyv
bvc call_old_keyv
; keyboard timer interrupt entry
jsr call_old_keyv
php
pha
bit vdu_status
bvc .not_cursor_editing
+adjust_cursor_inline
.not_cursor_editing
pla
plp
rts
call_old_keyv
jmp $ffff ; patched during initialization
undo_mode_7_3c00
; Reset the vectors we fiddled with.
lda call_old_wrchv + 1
sta wrchv
lda call_old_wrchv + 2
sta wrchv + 1
lda call_old_keyv + 1
sta keyv
lda call_old_keyv + 2
sta keyv + 1
; Switch to normal mode 7. This clears the screen, so we copy the contents
; back and restore the cursor position. This is maybe overkill, but it's
; important any final message shown when the game quits can be seen by the
; user.
lda #osbyte_read_cursor_position
jsr osbyte
lda #vdu_set_mode
jsr oswrch
lda #7
jsr oswrch
jsr do_oswrch_vdu_goto_xy
ldx #$3c
ldy #$7c
; fall through to screen_copy
screen_copy
stx .screen_copy_lda_abs_y + 2
sty .screen_copy_sta_abs_y + 2
ldx #4
.screen_copy_loop
ldy #0
.screen_copy_loop2
.screen_copy_lda_abs_y
lda $ff00,y ; patched
.screen_copy_sta_abs_y
sta $ff00,y ; patched
iny
bne .screen_copy_loop2
inc .screen_copy_lda_abs_y + 2
inc .screen_copy_sta_abs_y + 2
dex
bne .screen_copy_loop
rts
} ; End of !ifdef ACORN_NO_SHADOW
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Miscellaneous utility routines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Like printstring_raw, but using OSASCI.
printstring_os
stx .printstring_os_lda + 1
sta .printstring_os_lda + 2
-
.printstring_os_lda
lda $ffff
beq .calculate_crc_rts
jsr osasci
inc .printstring_os_lda + 1
bne -
inc .printstring_os_lda + 2
bne - ; Always branch
; Calculate a CRC over A bytes of data at YX (A=0 => 256 bytes), returning it in
; YX.
calculate_crc
; This must not use the same location as .result in acorn-disk.asm as otherwise
; when .get_game_disc_back calls calculate_crc it will be overwritten.
.crc = zp_temp + 2 ; 2 bytes
sta .cpy_imm + 1
stx .eor_abs + 1
sty .eor_abs + 2
lda #0
sta .crc + 1
sta .crc
tay
.nbyt
lda .crc + 1
.eor_abs
eor $ffff,y
sta .crc + 1
ldx #8
.loop
lda .crc + 1
rol
bcc .b7z
lda .crc + 1
eor #8
sta .crc + 1
lda .crc
eor #$10
sta .crc
.b7z
rol .crc
rol .crc + 1
dex
bne .loop
iny
.cpy_imm
cpy #$ff
bne .nbyt
ldx .crc
ldy .crc + 1
.calculate_crc_rts
rts
; Two wrappers for calling osbyte_set_cursor_editing to reduce code size; we do
; this in several places.
do_osbyte_set_cursor_editing_x_0
ldx #0
do_osbyte_set_cursor_editing
lda #osbyte_set_cursor_editing
bne do_osbyte_y_0 ; Always branch
; Two wrappers for calling osbyte_rw_escape_key to reduce code size; we do this
; in several places.
do_osbyte_rw_escape_key
lda #osbyte_rw_escape_key
do_osbyte_y_0
ldy #0
jmp osbyte
; Move the OS cursor to (X, Y).
do_oswrch_vdu_goto_xy
lda #vdu_goto_xy
jsr oswrch
txa
jsr oswrch
tya
jmp oswrch
; SF: ENHANCEMENT: It would potentially be possible to support bold and
; underlined text in modes other than 7, although we'd either need to do it via
; OSWORD 10 and UDG redefinition (which is probably quite slow) or install
; some kind of custom driver around OSWRCH and have that run on the host even if
; we're using a second processor. As a "cheap" version, it would be possible to
; use colours in mode 1 for bold, but I'm not particularly keen to support this
; just for one mode which probably no one would use.
;
; SF: ENHANCEMENT: It would also with a bit more effort probably be possible
; to use a proportionally spaced font in modes other than 7, though this would
; be a more intrusive code change.
;
; SFTODO: Once the upstream dynamic memory access rework is completed and merged, it *may* be possible to do things like (on a turbo copro) use bank 0 free memory plus the whole of bank 1 for dynamic memory, and have banks 2 and 3 for virtual memory cache, or to promote the whole of a game <= ~210K to be pure dynamic memory. Or if we have more main+SWR than the game size, to promote the whole game to dynamic memory and do a simple absolute Z-machine to bank address conversion. I suspect it won't allow >64K dynamic memory, but just making this note so I can consider it when I see how upstream change works.
}
| 34.570109
| 612
| 0.705608
|
918292781ee252d0b7a8e95ab4a5df10ca55fa30
| 668
|
asm
|
Assembly
|
oeis/167/A167032.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/167/A167032.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/167/A167032.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A167032: a(n) = 20*a(n-1) - 64*a(n-2) + 2 for n > 1; a(0) = 1, a(1) = 21.
; Submitted by Jon Maiga
; 1,21,358,5818,93450,1496650,23952202,383258442,6132227914,98116017994,1569857773386,25117730316106,401883708825418,6430139436277578,102882231360724810,1646115703292731210,26337851258768236362,421405620164629929802,6742489922731431468874,107879838764092313870154,1726077420227034663395146,27617238723638785180213066,441875819578245485146971978,7070013113252027451405803338,113120209812032837978709860170,1809923356992527002684225789770,28958773711880438423047084744522
mov $1,5
mov $2,1
lpb $0
sub $0,1
mul $2,16
add $2,$1
mul $1,4
add $1,2
lpe
mov $0,$2
| 44.533333
| 469
| 0.808383
|
a50f4a1a79bdeeca02d1fdd57df1e51b395c3305
| 1,770
|
asm
|
Assembly
|
programs/oeis/143/A143272.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/143/A143272.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/143/A143272.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A143272: a(n) = d(n)*T(n), where d(n) is the number of divisors of n (A000005) and T(n)=n(n+1)/2 are the triangular numbers (A000217).
; 1,6,12,30,30,84,56,144,135,220,132,468,182,420,480,680,306,1026,380,1260,924,1012,552,2400,975,1404,1512,2436,870,3720,992,3168,2244,2380,2520,5994,1406,2964,3120,6560,1722,7224,1892,5940,6210,4324,2256,11760,3675,7650,5304,8268,2862,11880,6160,12768,6612,6844,3540,21960,3782,7812,12096,14560,8580,17688,4556,14076,9660,19880,5112,31536,5402,11100,17100,17556,12012,24648,6320,32400,16605,13612,6972,42840,14620,14964,15312,31328,8010,49140,16744,25668,17484,17860,18240,55872,9506,29106,29700,45450,10302,42024,10712,43680,44520,22684,11556,70632,11990,48840,24864,63280,12882,52440,26680,40716,41418,28084,28560,116160,22143,30012,30504,46500,31500,96012,16256,66048,33540,68120,17292,105336,35644,36180,73440,74528,18906,76728,19460,118440,40044,40612,41184,156600,42340,42924,65268,66156,22350,135900,22952,93024,70686,95480,48360,146952,24806,50244,50880,154560,52164,132030,26732,81180,109560,55444,28056,227136,43095,116280,88236,89268,30102,121800,92400,155760,63012,63724,32220,293220,32942,133224,67344,136160,68820,139128,70312,106596,143640,145160,36672,259392,37442,75660,152880,173754,39006,236412,39800,241200,81204,82012,82824,250920,84460,85284,129168,217360,87780,354480,44732,135468,91164,92020,92880,374976,94612,95484,96360,291720,98124,198024,49952,302400,228825,102604,51756,313272,52670,212520,214368,216224,54522,329940,110920,167796,112812,227528,57360,578400,58322,176418,177876,179340,180810,243048,122512,247008,124500,251000
mov $1,$0
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
add $1,2
bin $1,2
mul $1,2
mov $2,$0
mul $2,2
mul $1,$2
sub $1,4
div $1,4
add $1,1
| 118
| 1,457
| 0.790395
|
527a23f82fd8cb9e14a437911086c8169213dfdb
| 23,576
|
asm
|
Assembly
|
tests/lr35902/LR35902_syntax_by_neo.asm
|
fengjixuchui/sjasmplus
|
df0fabd2411bf89e23637fce46d273f52dafbe16
|
[
"BSD-3-Clause"
] | 220
|
2016-10-22T19:44:39.000Z
|
2022-03-29T20:57:04.000Z
|
tests/lr35902/LR35902_syntax_by_neo.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 153
|
2018-05-07T10:31:23.000Z
|
2022-03-30T04:35:59.000Z
|
tests/lr35902/LR35902_syntax_by_neo.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 51
|
2016-05-12T21:27:36.000Z
|
2022-03-27T15:16:16.000Z
|
;; Sharp LR35902 - various syntax variants provided by NEO SPECTRUMAN
;; https://zx-pk.ru/threads/30314-sjasmplus-ot-z00m.html?p=1028186&viewfull=1#post1028186
;; Syntax examples are from IDA (disassembler), bgb (emulator) and GameBoy CPU Manual
;; also cross-checked with http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html
;; 10 errors are expected! These syntax variants are *NOT* compatible with sjasmplus:
; 4x "($FF00+c)" to emit `ld a,(c)` or `ld (c),a`; use "(c)" or "[c]" without $FF00 constant
; 4x "HLI"/"HLD" as "HL+"/"HL-"; use HL+/HL- (or LDI/LDD with HL only)
; "ld hl,[sp+n]"; use logical syntax `ld hl,sp+rel8`, it's not accessing memory
; "ldhl" alias; same as above, use the `ld hl,sp+rel8` syntax
;; these are intentionally left out. don't expect sjasmplus to support any of these.
; reasons: either the syntax is atrocious like "ld hl,[sp+0]" or the extra syntax adds
; too much complexity and/or possible accidental collisions, like "hli" label, etc.
; in the end the sjasmplus is 100% compatible with IDA disassembler syntax and supports
; at least one variant from CPU Manual (if not all of them).
; Only bgb compatibility is not 100%, and sources from bgb may need syntax fixing.
n: OPT --syntax=ab ; "a" = multiarg is ",," to support "sub a,n" syntax
nn: ; "b" = "(expr.)" is legit only for memory access
; :IDA :bgb :GBCPUman.pdf
defb $06,0 :ld b,0 :ld b,$00 :LD B,n
defb $0E,0 :ld c,0 :ld c,$00 :LD C,n
defb $16,0 :ld d,0 :ld d,$00 :LD D,n
defb $1E,0 :ld e,0 :ld e,$00 :LD E,n
defb $26,0 :ld h,0 :ld h,$00 :LD H,n
defb $2E,0 :ld l,0 :ld l,$00 :LD L,n
defb $36,0 :ld [hl],0 :ld [hl],$00 :LD (HL),n
defb $3E,0 :ld a,0 :ld a,$00 :LD A,n
defb $40 :ld b,b :ld b,b :LD B,B
defb $41 :ld b,c :ld b,c :LD B,C
defb $42 :ld b,d :ld b,d :LD B,D
defb $43 :ld b,e :ld b,e :LD B,E
defb $44 :ld b,h :ld b,h :LD B,H
defb $45 :ld b,l :ld b,l :LD B,L
defb $46 :ld b,[hl] :ld b,[hl] :LD B,(HL)
defb $47 :ld b,a :ld b,a :LD B,A
defb $48 :ld c,b :ld c,b :LD C,B
defb $49 :ld c,c :ld c,c :LD C,C
defb $4A :ld c,d :ld c,d :LD C,D
defb $4B :ld c,e :ld c,e :LD C,E
defb $4C :ld c,h :ld c,h :LD C,H
defb $4D :ld c,l :ld c,l :LD C,L
defb $4E :ld c,[hl] :ld c,[hl] :LD C,(HL)
defb $4F :ld c,a :ld c,a :LD C,A
defb $50 :ld d,b :ld d,b :LD D,B
defb $51 :ld d,c :ld d,c :LD D,C
defb $52 :ld d,d :ld d,d :LD D,D
defb $53 :ld d,e :ld d,e :LD D,E
defb $54 :ld d,h :ld d,h :LD D,H
defb $55 :ld d,l :ld d,l :LD D,L
defb $56 :ld d,[hl] :ld d,[hl] :LD D,(HL)
defb $57 :ld d,a :ld d,a :LD D,A
defb $58 :ld e,b :ld e,b :LD E,B
defb $59 :ld e,c :ld e,c :LD E,C
defb $5A :ld e,d :ld e,d :LD E,D
defb $5B :ld e,e :ld e,e :LD E,E
defb $5C :ld e,h :ld e,h :LD E,H
defb $5D :ld e,l :ld e,l :LD E,L
defb $5E :ld e,[hl] :ld e,[hl] :LD E,(HL)
defb $5F :ld e,a :ld e,a :LD E,A
defb $60 :ld h,b :ld h,b :LD H,B
defb $61 :ld h,c :ld h,c :LD H,C
defb $62 :ld h,d :ld h,d :LD H,D
defb $63 :ld h,e :ld h,e :LD H,E
defb $64 :ld h,h :ld h,h :LD H,H
defb $65 :ld h,l :ld h,l :LD H,L
defb $66 :ld h,[hl] :ld h,[hl] :LD H,(HL)
defb $67 :ld h,a :ld h,a :LD H,A
defb $68 :ld l,b :ld l,b :LD L,B
defb $69 :ld l,c :ld l,c :LD L,C
defb $6A :ld l,d :ld l,d :LD L,D
defb $6B :ld l,e :ld l,e :LD L,E
defb $6C :ld l,h :ld l,h :LD L,H
defb $6D :ld l,l :ld l,l :LD L,L
defb $6E :ld l,[hl] :ld l,[hl] :LD L,(HL)
defb $6F :ld l,a :ld l,a :LD L,A
defb $70 :ld [hl],b :ld [hl],b :LD (HL),B
defb $71 :ld [hl],c :ld [hl],c :LD (HL),C
defb $72 :ld [hl],d :ld [hl],d :LD (HL),D
defb $73 :ld [hl],e :ld [hl],e :LD (HL),E
defb $74 :ld [hl],h :ld [hl],h :LD (HL),H
defb $75 :ld [hl],l :ld [hl],l :LD (HL),L
defb $76 :halt :halt :HALT
defb $77 :ld [hl],a :ld [hl],a :LD (HL),A
defb $78 :ld a,b :ld a,b :LD A,B
defb $79 :ld a,c :ld a,c :LD A,C
defb $7A :ld a,d :ld a,d :LD A,D
defb $7B :ld a,e :ld a,e :LD A,E
defb $7C :ld a,h :ld a,h :LD A,H
defb $7D :ld a,l :ld a,l :LD A,L
defb $7E :ld a,[hl] :ld a,[hl] :LD A,(HL)
defb $7F :ld a,a :ld a,a :LD A,A
defb $0A :ld a,[bc] :ld a,[bc] :LD A,(BC)
defb $1A :ld a,[de] :ld a,[de] :LD A,(DE)
defb $02 :ld [bc],a :ld [bc],a :LD (BC),A
defb $12 :ld [de],a :ld [de],a :LD (DE),A
defb $F0,0 :ld a,[$FF00] :ldh a,[$FF00] :LDH A,(n) : LD A,($FF00+n)
defb $E0,0 :ld [$FF00],a :ldh [$FF00],a :LDH (n),A : LD ($FF00+n),A
; syntax "ld a,($ff00+c)" is not accepted by sjasmplus, only "(c)" argument works: 2x error
defb $F2 :ld a,[c] :ld a,[$ff00+c] :LD A,(C) : LD A,($FF00+C)
; syntax "ld ($ff00+c),a" is not accepted by sjasmplus, only "(c)" argument works: 2x error
defb $E2 :ld [c], a :ld [$ff00+c],a :ld (C),A : LD ($FF00+C),A
defb $FA,0,0 :ld a,[0] :ld a,[$0000] :LD A,(nn)
defb $EA,0,0 :ld [0],a :ld [$0000],a :LD (nn),A
; syntax with HLI and HLD is not accepted by sjasmplus: 4x error
defb $22 :ldi [hl],a :ldi [hl],a :LD (HLI),A : LDI (HL),A : LD (HL+),A
defb $32 :ldd [hl],a :ldd [hl],a :LD (HLD),A : LDD (HL),A : LD (HL-),A
defb $2A :ldi a,[hl] :ldi a,[hl] :LD A,(HLI) : LDI A,(HL) : LD A,(HL+)
defb $3A :ldd a,[hl] :ldd a,[hl] :LD A,(HLD) : LDD A,(HL) : LD A,(HL-)
defb $01,0,0 :ld bc,0 :ld bc,$0000 :LD BC,nn
defb $11,0,0 :ld de,0 :ld de,$0000 :LD DE,nn
defb $21,0,0 :ld hl,0 :ld hl,$0000 :LD HL,nn
defb $31,0,0 :ld sp,0 :ld sp,$0000 :LD SP,nn
defb $F9 :ld sp,hl :ld sp,hl :LD SP,HL
; syntax "ld hl,[sp+$00]" and "LDHL" is not accepted by sjasmplus: 2x error
defb $F8,0 :ld hl,sp+0 :ld hl,[sp+$00] :LD HL,SP+n : LDHL SP,n
defb $08,0,0 :ld [0],sp :ld [$0000],sp :LD (nn),SP
defb $F5 :push af :push af :PUSH AF
defb $C5 :push bc :push bc :PUSH BC
defb $D5 :push de :push de :PUSH DE
defb $E5 :push hl :push hl :PUSH HL
defb $F1 :pop af :pop af :POP AF
defb $C1 :pop bc :pop bc :POP BC
defb $D1 :pop de :pop de :POP DE
defb $E1 :pop hl :pop hl :POP HL
defb $80 :add a,b :add b :ADD A,B
defb $81 :add a,c :add c :ADD A,C
defb $82 :add a,d :add d :ADD A,D
defb $83 :add a,e :add e :ADD A,E
defb $84 :add a,h :add h :ADD A,H
defb $85 :add a,l :add l :ADD A,L
defb $86 :add a,[hl] :add [hl] :ADD A,(HL)
defb $87 :add a,a :add a :ADD A,A
defb $88 :adc a,b :adc b :ADC A,B
defb $89 :adc a,c :adc c :ADC A,C
defb $8A :adc a,d :adc d :ADC A,D
defb $8B :adc a,e :adc e :ADC A,E
defb $8C :adc a,h :adc h :ADC A,H
defb $8D :adc a,l :adc l :ADC A,L
defb $8E :adc a,[hl] :adc [hl] :ADC A,(HL)
defb $8F :adc a,a :adc a :ADC A,A
defb $90 :sub b :sub b :SUB B
defb $91 :sub c :sub c :SUB C
defb $92 :sub d :sub d :SUB D
defb $93 :sub e :sub e :SUB E
defb $94 :sub h :sub h :SUB H
defb $95 :sub l :sub l :SUB L
defb $96 :sub [hl] :sub [hl] :SUB (HL)
defb $97 :sub a :sub a :SUB A
defb $98 :sbc a,b :sbc b :SBC A,B
defb $99 :sbc a,c :sbc c :SBC A,C
defb $9A :sbc a,d :sbc d :SBC A,D
defb $9B :sbc a,e :sbc e :SBC A,E
defb $9C :sbc a,h :sbc h :SBC A,H
defb $9D :sbc a,l :sbc l :SBC A,L
defb $9E :sbc a,[hl] :sbc [hl] :SBC A,(HL)
defb $9F :sbc a,a :sbc a :SBC A,A
defb $A0 :and b :and b :AND B
defb $A1 :and c :and c :AND C
defb $A2 :and d :and d :AND D
defb $A3 :and e :and e :AND E
defb $A4 :and h :and h :AND H
defb $A5 :and l :and l :AND L
defb $A6 :and [hl] :and [hl] :AND (HL)
defb $A7 :and a :and a :AND A
defb $B0 :or b :or b :OR B
defb $B1 :or c :or c :OR C
defb $B2 :or d :or d :OR D
defb $B3 :or e :or e :OR E
defb $B4 :or h :or h :OR H
defb $B5 :or l :or l :OR L
defb $B6 :or [hl] :or [hl] :OR (HL)
defb $B7 :or a :or a :OR A
defb $A8 :xor b :xor b :XOR B
defb $A9 :xor c :xor c :XOR C
defb $AA :xor d :xor d :XOR D
defb $AB :xor e :xor e :XOR E
defb $AC :xor h :xor h :XOR H
defb $AD :xor l :xor l :XOR L
defb $AE :xor [hl] :xor [hl] :XOR (HL)
defb $AF :xor a :xor a :XOR A
defb $B8 :cp b :cp b :CP B
defb $B9 :cp c :cp c :CP C
defb $BA :cp d :cp d :CP D
defb $BB :cp e :cp e :CP E
defb $BC :cp h :cp h :CP H
defb $BD :cp l :cp l :CP L
defb $BE :cp [hl] :cp [hl] :CP (HL)
defb $BF :cp a :cp a :CP A
defb $04 :inc b :inc b :INC B
defb $0C :inc c :inc c :INC C
defb $14 :inc d :inc d :INC D
defb $1C :inc e :inc e :INC E
defb $24 :inc h :inc h :INC H
defb $2C :inc l :inc l :INC L
defb $34 :inc [hl] :inc [hl] :INC (HL)
defb $3C :inc a :inc a :INC A
defb $05 :dec b :dec b :DEC B
defb $0D :dec c :dec c :DEC C
defb $15 :dec d :dec d :DEC D
defb $1D :dec e :dec e :DEC E
defb $25 :dec h :dec h :DEC H
defb $2D :dec l :dec l :DEC L
defb $35 :dec [hl] :dec [hl] :DEC (HL)
defb $3D :dec a :dec a :DEC A
; the sub/and/xor/or/cp needs "--syntax=a" in sjasmplus for "a," recognition like this
; by default the sjasmplus understands "a," as multi-arg: "sub a,0" = "sub a : sub 0" (!)
defb $C6,0 :add a,0 :add a,$00 :ADD A,n
defb $CE,0 :adc a,0 :adc a,$00 :ADC A,n
defb $D6,0 :sub 0 :sub a,$00 :SUB n ; "sub a,*" needs `--syntax=a` in sjasmplus
defb $DE,0 :sbc a,0 :sbc a,$00 :SBC A,n
defb $E6,0 :and 0 :and a,$00 :AND n ; "and a,*" needs `--syntax=a` in sjasmplus
defb $EE,0 :xor 0 :xor a,$00 :XOR n ; "xor a,*" needs `--syntax=a` in sjasmplus
defb $F6,0 :or 0 :or a,$00 :OR n ; "or a,*" needs `--syntax=a` in sjasmplus
defb $FE,0 :cp 0 :cp a,$00 :CP n ; "cp a,*" needs `--syntax=a` in sjasmplus
defb $09 :add hl,bc :add hl,bc :ADD HL,BC
defb $19 :add hl,de :add hl,de :ADD HL,DE
defb $29 :add hl,hl :add hl,hl :ADD HL,HL
defb $39 :add hl,sp :add hl,sp :ADD HL,SP
defb $E8,0 :add sp,0 :add sp,$00 :ADD SP,n
defb $03 :inc bc :inc bc :INC BC
defb $13 :inc de :inc de :INC DE
defb $23 :inc hl :inc hl :INC HL
defb $33 :inc sp :inc sp :INC SP
defb $0B :dec bc :dec bc :DEC BC
defb $1B :dec de :dec de :DEC DE
defb $2B :dec hl :dec hl :DEC HL
defb $3B :dec sp :dec sp :DEC SP
defb $CB,$30 :swap b :swap b :SWAP B
defb $CB,$31 :swap c :swap c :SWAP C
defb $CB,$32 :swap d :swap d :SWAP D
defb $CB,$33 :swap e :swap e :SWAP E
defb $CB,$34 :swap h :swap h :SWAP H
defb $CB,$35 :swap l :swap l :SWAP L
defb $CB,$36 :swap [hl] :swap [hl] :SWAP (HL)
defb $CB,$37 :swap a :swap a :SWAP A
defb $27 :daa :daa :DAA
defb $2F :cpl :cpl :CPL
defb $3F :ccf :ccf :CCF
defb $37 :scf :scf :SCF
defb $00 :nop :nop :NOP
defb $10,$00 :stop :stop :STOP
defb $F3 :di :di :DI
defb $FB :ei :ei :EI
defb $07 :rlca :rlca :RLCA
defb $17 :rla :rla :RLA
defb $0F :rrca :rrca :RRCA
defb $1F :rra :rra :RRA
defb $CB,$00 :rlc b :rlc b :RLC B
defb $CB,$01 :rlc c :rlc c :RLC C
defb $CB,$02 :rlc d :rlc d :RLC D
defb $CB,$03 :rlc e :rlc e :RLC E
defb $CB,$04 :rlc h :rlc h :RLC H
defb $CB,$05 :rlc l :rlc l :RLC L
defb $CB,$06 :rlc [hl] :rlc [hl] :RLC (HL)
defb $CB,$07 :rlc a :rlc a :RLC A
defb $CB,$10 :rl b :rl b :RL B
defb $CB,$11 :rl c :rl c :RL C
defb $CB,$12 :rl d :rl d :RL D
defb $CB,$13 :rl e :rl e :RL E
defb $CB,$14 :rl h :rl h :RL H
defb $CB,$15 :rl l :rl l :RL L
defb $CB,$16 :rl [hl] :rl [hl] :RL (HL)
defb $CB,$17 :rl a :rl a :RL A
defb $CB,$08 :rrc b :rrc b :RRC B
defb $CB,$09 :rrc c :rrc c :RRC C
defb $CB,$0A :rrc d :rrc d :RRC D
defb $CB,$0B :rrc e :rrc e :RRC E
defb $CB,$0C :rrc h :rrc h :RRC H
defb $CB,$0D :rrc l :rrc l :RRC L
defb $CB,$0E :rrc [hl] :rrc [hl] :RRC (HL)
defb $CB,$0F :rrc a :rrc a :RRC A
defb $CB,$18 :rr b :rr b :RR B
defb $CB,$19 :rr c :rr c :RR C
defb $CB,$1A :rr d :rr d :RR D
defb $CB,$1B :rr e :rr e :RR E
defb $CB,$1C :rr h :rr h :RR H
defb $CB,$1D :rr l :rr l :RR L
defb $CB,$1E :rr [hl] :rr [hl] :RR (HL)
defb $CB,$1F :rr a :rr a :RR A
defb $CB,$20 :sla b :sla b :SLA B
defb $CB,$21 :sla c :sla c :SLA C
defb $CB,$22 :sla d :sla d :SLA D
defb $CB,$23 :sla e :sla e :SLA E
defb $CB,$24 :sla h :sla h :SLA H
defb $CB,$25 :sla l :sla l :SLA L
defb $CB,$26 :sla [hl] :sla [hl] :SLA (HL)
defb $CB,$27 :sla a :sla a :SLA A
defb $CB,$28 :sra b :sra b :SRA B
defb $CB,$29 :sra c :sra c :SRA C
defb $CB,$2A :sra d :sra d :SRA D
defb $CB,$2B :sra e :sra e :SRA E
defb $CB,$2C :sra h :sra h :SRA H
defb $CB,$2D :sra l :sra l :SRA L
defb $CB,$2E :sra [hl] :sra [hl] :SRA (HL)
defb $CB,$2F :sra a :sra a :SRA A
defb $CB,$38 :srl b :srl b :SRL B
defb $CB,$39 :srl c :srl c :SRL C
defb $CB,$3A :srl d :srl d :SRL D
defb $CB,$3B :srl e :srl e :SRL E
defb $CB,$3C :srl h :srl h :SRL H
defb $CB,$3D :srl l :srl l :SRL L
defb $CB,$3E :srl [hl] :srl [hl] :SRL (HL)
defb $CB,$3F :srl a :srl a :SRL A
defb $CB,$40 :bit 0,b :bit 0,b :BIT 0,B
defb $CB,$41 :bit 0,c :bit 0,c :BIT 0,C
defb $CB,$42 :bit 0,d :bit 0,d :BIT 0,D
defb $CB,$43 :bit 0,e :bit 0,e :BIT 0,E
defb $CB,$44 :bit 0,h :bit 0,h :BIT 0,H
defb $CB,$45 :bit 0,l :bit 0,l :BIT 0,L
defb $CB,$46 :bit 0,[hl] :bit 0,[hl] :BIT 0,(HL)
defb $CB,$47 :bit 0,a :bit 0,a :BIT 0,A
defb $CB,$40+$08 :bit 1,b :bit 1,b :BIT 1,B
defb $CB,$41+$08 :bit 1,c :bit 1,c :BIT 1,C
defb $CB,$42+$08 :bit 1,d :bit 1,d :BIT 1,D
defb $CB,$43+$08 :bit 1,e :bit 1,e :BIT 1,E
defb $CB,$44+$08 :bit 1,h :bit 1,h :BIT 1,H
defb $CB,$45+$08 :bit 1,l :bit 1,l :BIT 1,L
defb $CB,$46+$08 :bit 1,[hl] :bit 1,[hl] :BIT 1,(HL)
defb $CB,$47+$08 :bit 1,a :bit 1,a :BIT 1,A
defb $CB,$40+$10 :bit 2,b :bit 2,b :BIT 2,B
defb $CB,$41+$10 :bit 2,c :bit 2,c :BIT 2,C
defb $CB,$42+$10 :bit 2,d :bit 2,d :BIT 2,D
defb $CB,$43+$10 :bit 2,e :bit 2,e :BIT 2,E
defb $CB,$44+$10 :bit 2,h :bit 2,h :BIT 2,H
defb $CB,$45+$10 :bit 2,l :bit 2,l :BIT 2,L
defb $CB,$46+$10 :bit 2,[hl] :bit 2,[hl] :BIT 2,(HL)
defb $CB,$47+$10 :bit 2,a :bit 2,a :BIT 2,A
defb $CB,$40+$18 :bit 3,b :bit 3,b :BIT 3,B
defb $CB,$41+$18 :bit 3,c :bit 3,c :BIT 3,C
defb $CB,$42+$18 :bit 3,d :bit 3,d :BIT 3,D
defb $CB,$43+$18 :bit 3,e :bit 3,e :BIT 3,E
defb $CB,$44+$18 :bit 3,h :bit 3,h :BIT 3,H
defb $CB,$45+$18 :bit 3,l :bit 3,l :BIT 3,L
defb $CB,$46+$18 :bit 3,[hl] :bit 3,[hl] :BIT 3,(HL)
defb $CB,$47+$18 :bit 3,a :bit 3,a :BIT 3,A
defb $CB,$40+$20 :bit 4,b :bit 4,b :BIT 4,B
defb $CB,$41+$20 :bit 4,c :bit 4,c :BIT 4,C
defb $CB,$42+$20 :bit 4,d :bit 4,d :BIT 4,D
defb $CB,$43+$20 :bit 4,e :bit 4,e :BIT 4,E
defb $CB,$44+$20 :bit 4,h :bit 4,h :BIT 4,H
defb $CB,$45+$20 :bit 4,l :bit 4,l :BIT 4,L
defb $CB,$46+$20 :bit 4,[hl] :bit 4,[hl] :BIT 4,(HL)
defb $CB,$47+$20 :bit 4,a :bit 4,a :BIT 4,A
defb $CB,$40+$28 :bit 5,b :bit 5,b :BIT 5,B
defb $CB,$41+$28 :bit 5,c :bit 5,c :BIT 5,C
defb $CB,$42+$28 :bit 5,d :bit 5,d :BIT 5,D
defb $CB,$43+$28 :bit 5,e :bit 5,e :BIT 5,E
defb $CB,$44+$28 :bit 5,h :bit 5,h :BIT 5,H
defb $CB,$45+$28 :bit 5,l :bit 5,l :BIT 5,L
defb $CB,$46+$28 :bit 5,[hl] :bit 5,[hl] :BIT 5,(HL)
defb $CB,$47+$28 :bit 5,a :bit 5,a :BIT 5,A
defb $CB,$40+$30 :bit 6,b :bit 6,b :BIT 6,B
defb $CB,$41+$30 :bit 6,c :bit 6,c :BIT 6,C
defb $CB,$42+$30 :bit 6,d :bit 6,d :BIT 6,D
defb $CB,$43+$30 :bit 6,e :bit 6,e :BIT 6,E
defb $CB,$44+$30 :bit 6,h :bit 6,h :BIT 6,H
defb $CB,$45+$30 :bit 6,l :bit 6,l :BIT 6,L
defb $CB,$46+$30 :bit 6,[hl] :bit 6,[hl] :BIT 6,(HL)
defb $CB,$47+$30 :bit 6,a :bit 6,a :BIT 6,A
defb $CB,$40+$38 :bit 7,b :bit 7,b :BIT 7,B
defb $CB,$41+$38 :bit 7,c :bit 7,c :BIT 7,C
defb $CB,$42+$38 :bit 7,d :bit 7,d :BIT 7,D
defb $CB,$43+$38 :bit 7,e :bit 7,e :BIT 7,E
defb $CB,$44+$38 :bit 7,h :bit 7,h :BIT 7,H
defb $CB,$45+$38 :bit 7,l :bit 7,l :BIT 7,L
defb $CB,$46+$38 :bit 7,[hl] :bit 7,[hl] :BIT 7,(HL)
defb $CB,$47+$38 :bit 7,a :bit 7,a :BIT 7,A
defb $CB,$C0 :set 0,b :set 0,b :SET 0,B
defb $CB,$C1 :set 0,c :set 0,c :SET 0,C
defb $CB,$C2 :set 0,d :set 0,d :SET 0,D
defb $CB,$C3 :set 0,e :set 0,e :SET 0,E
defb $CB,$C4 :set 0,h :set 0,h :SET 0,H
defb $CB,$C5 :set 0,l :set 0,l :SET 0,L
defb $CB,$C6 :set 0,[hl] :set 0,[hl] :SET 0,(HL)
defb $CB,$C7 :set 0,a :set 0,a :SET 0,A
defb $CB,$C0+$08 :set 1,b :set 1,b :SET 1,B
defb $CB,$C1+$08 :set 1,c :set 1,c :SET 1,C
defb $CB,$C2+$08 :set 1,d :set 1,d :SET 1,D
defb $CB,$C3+$08 :set 1,e :set 1,e :SET 1,E
defb $CB,$C4+$08 :set 1,h :set 1,h :SET 1,H
defb $CB,$C5+$08 :set 1,l :set 1,l :SET 1,L
defb $CB,$C6+$08 :set 1,[hl] :set 1,[hl] :SET 1,(HL)
defb $CB,$C7+$08 :set 1,a :set 1,a :SET 1,A
defb $CB,$C0+$10 :set 2,b :set 2,b :SET 2,B
defb $CB,$C1+$10 :set 2,c :set 2,c :SET 2,C
defb $CB,$C2+$10 :set 2,d :set 2,d :SET 2,D
defb $CB,$C3+$10 :set 2,e :set 2,e :SET 2,E
defb $CB,$C4+$10 :set 2,h :set 2,h :SET 2,H
defb $CB,$C5+$10 :set 2,l :set 2,l :SET 2,L
defb $CB,$C6+$10 :set 2,[hl] :set 2,[hl] :SET 2,(HL)
defb $CB,$C7+$10 :set 2,a :set 2,a :SET 2,A
defb $CB,$C0+$18 :set 3,b :set 3,b :SET 3,B
defb $CB,$C1+$18 :set 3,c :set 3,c :SET 3,C
defb $CB,$C2+$18 :set 3,d :set 3,d :SET 3,D
defb $CB,$C3+$18 :set 3,e :set 3,e :SET 3,E
defb $CB,$C4+$18 :set 3,h :set 3,h :SET 3,H
defb $CB,$C5+$18 :set 3,l :set 3,l :SET 3,L
defb $CB,$C6+$18 :set 3,[hl] :set 3,[hl] :SET 3,(HL)
defb $CB,$C7+$18 :set 3,a :set 3,a :SET 3,A
defb $CB,$C0+$20 :set 4,b :set 4,b :SET 4,B
defb $CB,$C1+$20 :set 4,c :set 4,c :SET 4,C
defb $CB,$C2+$20 :set 4,d :set 4,d :SET 4,D
defb $CB,$C3+$20 :set 4,e :set 4,e :SET 4,E
defb $CB,$C4+$20 :set 4,h :set 4,h :SET 4,H
defb $CB,$C5+$20 :set 4,l :set 4,l :SET 4,L
defb $CB,$C6+$20 :set 4,[hl] :set 4,[hl] :SET 4,(HL)
defb $CB,$C7+$20 :set 4,a :set 4,a :SET 4,A
defb $CB,$C0+$28 :set 5,b :set 5,b :SET 5,B
defb $CB,$C1+$28 :set 5,c :set 5,c :SET 5,C
defb $CB,$C2+$28 :set 5,d :set 5,d :SET 5,D
defb $CB,$C3+$28 :set 5,e :set 5,e :SET 5,E
defb $CB,$C4+$28 :set 5,h :set 5,h :SET 5,H
defb $CB,$C5+$28 :set 5,l :set 5,l :SET 5,L
defb $CB,$C6+$28 :set 5,[hl] :set 5,[hl] :SET 5,(HL)
defb $CB,$C7+$28 :set 5,a :set 5,a :SET 5,A
defb $CB,$C0+$30 :set 6,b :set 6,b :SET 6,B
defb $CB,$C1+$30 :set 6,c :set 6,c :SET 6,C
defb $CB,$C2+$30 :set 6,d :set 6,d :SET 6,D
defb $CB,$C3+$30 :set 6,e :set 6,e :SET 6,E
defb $CB,$C4+$30 :set 6,h :set 6,h :SET 6,H
defb $CB,$C5+$30 :set 6,l :set 6,l :SET 6,L
defb $CB,$C6+$30 :set 6,[hl] :set 6,[hl] :SET 6,(HL)
defb $CB,$C7+$30 :set 6,a :set 6,a :SET 6,A
defb $CB,$C0+$38 :set 7,b :set 7,b :SET 7,B
defb $CB,$C1+$38 :set 7,c :set 7,c :SET 7,C
defb $CB,$C2+$38 :set 7,d :set 7,d :SET 7,D
defb $CB,$C3+$38 :set 7,e :set 7,e :SET 7,E
defb $CB,$C4+$38 :set 7,h :set 7,h :SET 7,H
defb $CB,$C5+$38 :set 7,l :set 7,l :SET 7,L
defb $CB,$C6+$38 :set 7,[hl] :set 7,[hl] :SET 7,(HL)
defb $CB,$C7+$38 :set 7,a :set 7,a :SET 7,A
defb $CB,$80 :res 0,b :res 0,b :RES 0,B
defb $CB,$81 :res 0,c :res 0,c :RES 0,C
defb $CB,$82 :res 0,d :res 0,d :RES 0,D
defb $CB,$83 :res 0,e :res 0,e :RES 0,E
defb $CB,$84 :res 0,h :res 0,h :RES 0,H
defb $CB,$85 :res 0,l :res 0,l :RES 0,L
defb $CB,$86 :res 0,[hl] :res 0,[hl] :RES 0,(HL)
defb $CB,$87 :res 0,a :res 0,a :RES 0,A
defb $CB,$80+$08 :res 1,b :res 1,b :RES 1,B
defb $CB,$81+$08 :res 1,c :res 1,c :RES 1,C
defb $CB,$82+$08 :res 1,d :res 1,d :RES 1,D
defb $CB,$83+$08 :res 1,e :res 1,e :RES 1,E
defb $CB,$84+$08 :res 1,h :res 1,h :RES 1,H
defb $CB,$85+$08 :res 1,l :res 1,l :RES 1,L
defb $CB,$86+$08 :res 1,[hl] :res 1,[hl] :RES 1,(HL)
defb $CB,$87+$08 :res 1,a :res 1,a :RES 1,A
defb $CB,$80+$10 :res 2,b :res 2,b :RES 2,B
defb $CB,$81+$10 :res 2,c :res 2,c :RES 2,C
defb $CB,$82+$10 :res 2,d :res 2,d :RES 2,D
defb $CB,$83+$10 :res 2,e :res 2,e :RES 2,E
defb $CB,$84+$10 :res 2,h :res 2,h :RES 2,H
defb $CB,$85+$10 :res 2,l :res 2,l :RES 2,L
defb $CB,$86+$10 :res 2,[hl] :res 2,[hl] :RES 2,(HL)
defb $CB,$87+$10 :res 2,a :res 2,a :RES 2,A
defb $CB,$80+$18 :res 3,b :res 3,b :RES 3,B
defb $CB,$81+$18 :res 3,c :res 3,c :RES 3,C
defb $CB,$82+$18 :res 3,d :res 3,d :RES 3,D
defb $CB,$83+$18 :res 3,e :res 3,e :RES 3,E
defb $CB,$84+$18 :res 3,h :res 3,h :RES 3,H
defb $CB,$85+$18 :res 3,l :res 3,l :RES 3,L
defb $CB,$86+$18 :res 3,[hl] :res 3,[hl] :RES 3,(HL)
defb $CB,$87+$18 :res 3,a :res 3,a :RES 3,A
defb $CB,$80+$20 :res 4,b :res 4,b :RES 4,B
defb $CB,$81+$20 :res 4,c :res 4,c :RES 4,C
defb $CB,$82+$20 :res 4,d :res 4,d :RES 4,D
defb $CB,$83+$20 :res 4,e :res 4,e :RES 4,E
defb $CB,$84+$20 :res 4,h :res 4,h :RES 4,H
defb $CB,$85+$20 :res 4,l :res 4,l :RES 4,L
defb $CB,$86+$20 :res 4,[hl] :res 4,[hl] :RES 4,(HL)
defb $CB,$87+$20 :res 4,a :res 4,a :RES 4,A
defb $CB,$80+$28 :res 5,b :res 5,b :RES 5,B
defb $CB,$81+$28 :res 5,c :res 5,c :RES 5,C
defb $CB,$82+$28 :res 5,d :res 5,d :RES 5,D
defb $CB,$83+$28 :res 5,e :res 5,e :RES 5,E
defb $CB,$84+$28 :res 5,h :res 5,h :RES 5,H
defb $CB,$85+$28 :res 5,l :res 5,l :RES 5,L
defb $CB,$86+$28 :res 5,[hl] :res 5,[hl] :RES 5,(HL)
defb $CB,$87+$28 :res 5,a :res 5,a :RES 5,A
defb $CB,$80+$30 :res 6,b :res 6,b :RES 6,B
defb $CB,$81+$30 :res 6,c :res 6,c :RES 6,C
defb $CB,$82+$30 :res 6,d :res 6,d :RES 6,D
defb $CB,$83+$30 :res 6,e :res 6,e :RES 6,E
defb $CB,$84+$30 :res 6,h :res 6,h :RES 6,H
defb $CB,$85+$30 :res 6,l :res 6,l :RES 6,L
defb $CB,$86+$30 :res 6,[hl] :res 6,[hl] :RES 6,(HL)
defb $CB,$87+$30 :res 6,a :res 6,a :RES 6,A
defb $CB,$80+$38 :res 7,b :res 7,b :RES 7,B
defb $CB,$81+$38 :res 7,c :res 7,c :RES 7,C
defb $CB,$82+$38 :res 7,d :res 7,d :RES 7,D
defb $CB,$83+$38 :res 7,e :res 7,e :RES 7,E
defb $CB,$84+$38 :res 7,h :res 7,h :RES 7,H
defb $CB,$85+$38 :res 7,l :res 7,l :RES 7,L
defb $CB,$86+$38 :res 7,[hl] :res 7,[hl] :RES 7,(HL)
defb $CB,$87+$38 :res 7,a :res 7,a :RES 7,A
defb $C3,0,0 :jp 0 :jp $0000 :JP nn
defb $C2,0,0 :jp nz,0 :jp nz,$0000 :JP NZ,nn
defb $CA,0,0 :jp z,0 :jp z,$0000 :JP Z,nn
defb $D2,0,0 :jp nc,0 :jp nc,$0000 :JP NC,nn
defb $DA,0,0 :jp c,0 :jp c,$0000 :JP C,nn
defb $E9 :jp [hl] :jp [hl] :JP (HL)
defb $18,0 :jr $+2 :jr $+2 :JR $+2
defb $20,0 :jr nz,$+2 :jr nz,$+2 :JR NZ,$+2 ; was literal "n", but needs "$+2" for tests
defb $28,0 :jr z,$+2 :jr z,$+2 :JR Z,$+2
defb $30,0 :jr nc,$+2 :jr nc,$+2 :JR NC,$+2
defb $38,0 :jr c,$+2 :jr c,$+2 :JR C,$+2
defb $CD,0,0 :call 0 :call $0000 :CALL nn
defb $C4,0,0 :call nz,0 :call nz,$0000 :CALL NZ,nn
defb $CC,0,0 :call z,0 :call z,$0000 :CALL Z,nn
defb $D4,0,0 :call nc,0 :call nc,$0000 :CALL NC,nn
defb $DC,0,0 :call c,0 :call c,$0000 :CALL C,nn
defb $C7 :rst 0 :rst $00 :RST 00H
defb $CF :rst 8 :rst $08 :RST 08H
defb $D7 :rst $10 :rst $10 :RST 10H
defb $DF :rst $18 :rst $18 :RST 18H
defb $E7 :rst $20 :rst $20 :RST 20H
defb $EF :rst $28 :rst $28 :RST 28H
defb $F7 :rst $30 :rst $30 :RST 30H
defb $FF :rst $38 :rst $38 :RST 38H
defb $C9 :ret :ret :RET
defb $C0 :ret nz :ret nz :RET NZ
defb $C8 :ret z :ret z :RET Z
defb $D0 :ret nc :ret nc :RET NC
defb $D8 :ret c :ret c :RET C
defb $D9 :reti :reti :RETI
| 38.585925
| 93
| 0.531303
|
76a902745dc4947d5b802d2cc4e0eb6a8ed96eb6
| 2,251
|
nasm
|
Assembly
|
lib/mutex-inline/futex-bivar.nasm
|
DerickEddington/cabna
|
d53305542a808aeb628db4cefdf6d1094e57559b
|
[
"Unlicense"
] | null | null | null |
lib/mutex-inline/futex-bivar.nasm
|
DerickEddington/cabna
|
d53305542a808aeb628db4cefdf6d1094e57559b
|
[
"Unlicense"
] | null | null | null |
lib/mutex-inline/futex-bivar.nasm
|
DerickEddington/cabna
|
d53305542a808aeb628db4cefdf6d1094e57559b
|
[
"Unlicense"
] | null | null | null |
; TODO: The interface must be the same across the other implementations of
; mutex-inline (futex-bivar, futex-tristate). What about the registers
; the syscalls don't preserve?
Instead of a futex variable having three states (unlocked, locked w/o waiters,
locked w/ waiters), have two variables: a futex, and an indication of waiters.
If the below isn't good, investigate using a 64-bit field where the low 32 bits
are the futex and the high indicate if there's waiters - this allows atomic
64-bit reads/writes of the field - does this support an implementation that is
good?
(Remember to use faster private-flaged futex syscall operations.)
; TODO: What about the registers destroyed for the syscalls? Should the
; abstract mutex-inline interface be that all the registers used by the most
; register-using implementation are destroyed?
; Should be aligned to cache_line_size
struc mutex
.futex: dd 1 ; 1 = unlocked, 0 = locked
alignb cache_line_size ; Avoid false sharing. TODO: Worth it?
.waiters: dd 0 ; Amount of waiting threads, limited to u32_max.
endstruc
macro lock_mutex 2
; ; Test if it's already locked, before doing expensive atomic xchg operation.
; TODO: Is test-only first good? It's not a spin-loop, so I'm thinking this
; isn't needed.
; mov %2, [%1]
; test %2, %2
; jz %%wait1
; It was unlocked, so try to lock it.
xor %2, %2
xchg [%1], %2 ; Locking automatically done for xchg.
test %2, %2
jz %%wait1
; Acquired the lock.
jmp %%done
%%wait1:
; Note: wait2 loop is so that atomic inc/dec is not repeated if will just go
; back to sleep.
lock add dword [%1 + mutex.waiters], 1
%%wait2:
futex_wait %1, 0
; TODO: Check syscall error status.
; TODO: Is %1 preserved after syscall? If not, need to restore before continuing.
; It was just unlocked, so try to lock it.
xor %2, %2
xchg [%1], %2 ; Locking automatically done for xchg.
test %2, %2
jz %%wait2
; Acquired the lock.
lock sub dword [%1 + mutex.waiters], 1
%%done:
macro unlock_mutex 1
mov dword [%1], 1 ; Unlock its mutex.futex.
test dword [%1 + mutex.waiters], -1
jnz %%wake
jmp %%done
%%wake:
futex_wake %1, 1
; TODO: Check syscall error status.
%%done:
| 31.263889
| 84
| 0.693914
|
8e51412869fa94639f0e211f47a6591a2c4722af
| 636
|
asm
|
Assembly
|
src/timer_interrupt.asm
|
ISSOtm/smooth-player-demo
|
e511fb786f2ca9e75f2d4fd38f34d1ecfe608253
|
[
"MIT"
] | 4
|
2019-06-26T16:04:03.000Z
|
2021-12-01T12:22:13.000Z
|
src/timer_interrupt.asm
|
ISSOtm/smooth-player-demo
|
e511fb786f2ca9e75f2d4fd38f34d1ecfe608253
|
[
"MIT"
] | 1
|
2021-07-19T18:40:35.000Z
|
2021-07-19T18:40:35.000Z
|
src/timer_interrupt.asm
|
ISSOtm/smooth-player-demo
|
e511fb786f2ca9e75f2d4fd38f34d1ecfe608253
|
[
"MIT"
] | null | null | null |
INCLUDE "src/include/hardware.inc/hardware.inc"
; Here is how you set up a timer int appropriately
; Yes, it *has* to be the timer int
SECTION "Timer interrupt", ROM0[$50]
TimerHandler:
; These two registers are used, so they must be saved
push af
push hl
; You don't have to include the code inline,
; you may have to split the handler in two, especially if using the serial or joypad interrupts
INCLUDE "src/smooth-player/sample_player.asm"
; After running this code, you will probably want to restore the ROM bank
ldh a, [hROMBank]
ld [rROMB0], a
; Then restore the registers...
pop hl
pop af
; ...and return.
reti
| 25.44
| 96
| 0.731132
|
19cedbc3ad6c5731c9e951192d15970f73f2172e
| 766
|
asm
|
Assembly
|
programs/oeis/157/A157651.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/157/A157651.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/157/A157651.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A157651: a(n) = 100*n^2 - 49*n + 6.
; 57,308,759,1410,2261,3312,4563,6014,7665,9516,11567,13818,16269,18920,21771,24822,28073,31524,35175,39026,43077,47328,51779,56430,61281,66332,71583,77034,82685,88536,94587,100838,107289,113940,120791,127842,135093,142544,150195,158046,166097,174348,182799,191450,200301,209352,218603,228054,237705,247556,257607,267858,278309,288960,299811,310862,322113,333564,345215,357066,369117,381368,393819,406470,419321,432372,445623,459074,472725,486576,500627,514878,529329,543980,558831,573882,589133,604584,620235,636086,652137,668388,684839,701490,718341,735392,752643,770094,787745,805596,823647,841898,860349,879000,897851,916902,936153,955604,975255,995106
mov $1,$0
mul $0,10
pow $0,2
add $0,57
mov $2,$1
mul $2,151
add $0,$2
| 69.636364
| 656
| 0.798956
|
4c918d5d0ffac29586c5dead93eb31857a2dfee0
| 387
|
asm
|
Assembly
|
code/non1996/34.asm
|
KongoHuster/assembly-exercise
|
1c4a44c60c0e93a1350ed4f887aeaf1414702a51
|
[
"0BSD"
] | 1
|
2021-08-20T03:57:29.000Z
|
2021-08-20T03:57:29.000Z
|
code/non1996/34.asm
|
KongoHuster/assembly-exercise
|
1c4a44c60c0e93a1350ed4f887aeaf1414702a51
|
[
"0BSD"
] | null | null | null |
code/non1996/34.asm
|
KongoHuster/assembly-exercise
|
1c4a44c60c0e93a1350ed4f887aeaf1414702a51
|
[
"0BSD"
] | null | null | null |
DATA SEGMENT
NUM DW 10
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX
MOV AX, NUM
CALL SKIPLINES
MOV AH, 4CH
INT 21H
SKIPLINES PROC
PUSH AX
PUSH CX
PUSH DX
MOV CX, AX
MOV AH, 02H
OUT:
MOV DL, '-'
INT 21H
MOV DL, 0DH
INT 21H
MOV DL, 0AH
INT 21H
LOOP OUT
POP DX
POP CX
POP AX
RET
SKIPLINES ENDP
CODE ENDS
END START
| 9
| 24
| 0.653747
|
9b2f40f86f3c30e5c4a024c30dff10a092d6764f
| 54
|
asm
|
Assembly
|
VirtualMachine/Win32/UnitTests/Arithmetic/test3_multii_Arithmetic.asm
|
ObjectPascalInterpreter/BookPart_3
|
95150d4d02f7e13e5b1ebb58c249073a384f2a0a
|
[
"Apache-2.0"
] | 8
|
2021-11-07T22:45:25.000Z
|
2022-03-12T21:38:53.000Z
|
VirtualMachine/Win32/UnitTests/Arithmetic/test3_multii_Arithmetic.asm
|
Irwin1985/BookPart_2
|
4e8c2e47cd09b77c6e5bd3455ddfe7492adf26bf
|
[
"Apache-2.0"
] | 4
|
2021-09-23T02:13:55.000Z
|
2021-12-07T06:08:17.000Z
|
VirtualMachine/Win32/UnitTests/Arithmetic/test3_multii_Arithmetic.asm
|
Irwin1985/BookPart_2
|
4e8c2e47cd09b77c6e5bd3455ddfe7492adf26bf
|
[
"Apache-2.0"
] | 4
|
2021-11-24T17:24:56.000Z
|
2021-12-21T04:56:58.000Z
|
# Test 3 - mult
pushi 2
pushi 5
mult
halt
| 9
| 15
| 0.537037
|
2b1b0328ec6ef979bc0c7626fe0a8eea7da9249e
| 2,896
|
asm
|
Assembly
|
wireframe/_includes/macros.asm
|
ArcadeTV/megadrive-samples
|
bb00902a844f63d55c6f449d50b0ae8a72c3c05e
|
[
"CC0-1.0"
] | 5
|
2021-05-15T21:47:38.000Z
|
2022-03-27T19:33:15.000Z
|
whitenoise/_includes/macros.asm
|
ArcadeTV/megadrive-samples
|
bb00902a844f63d55c6f449d50b0ae8a72c3c05e
|
[
"CC0-1.0"
] | 1
|
2021-06-09T10:17:41.000Z
|
2021-06-09T15:07:37.000Z
|
wireframe/_includes/macros.asm
|
ArcadeTV/megadrive-samples
|
bb00902a844f63d55c6f449d50b0ae8a72c3c05e
|
[
"CC0-1.0"
] | null | null | null |
;==============================================================
; MACROS
;==============================================================
; Set the VRAM (video RAM) address to write to next
macro SetVRAMWrite
move.l #(vdp_cmd_vram_write)|((\1)&$3FFF)<<16|(\1)>>14,vdp_control
endm
; Set the CRAM (colour RAM) address to write to next
macro SetCRAMWrite
move.l #(vdp_cmd_cram_write)|((\1)&$3FFF)<<16|(\1)>>14,vdp_control
endm
; Set the VSRAM (vertical scroll RAM) address to write to next
macro SetVSRAMWrite
move.l #(vdp_cmd_vsram_write)|((\1)&$3FFF)<<16|(\1)>>14,vdp_control
endm
; Wait for VBlank
macro WaitVBlank
jsr WaitVBlank
endm
* Wait for msumd driver ready
macro MCD_WAIT
.\@
tst.b MCD_STAT
bne.s .\@
endm
* Load Palette [Label] to Palette Slot [0-3]
macro loadPalette \1 \2
lea \1,a0
moveq.l \2,d2
jsr loadPaletteAdressToCram
endm
; ---------------------------------------------------------------------------
; stop the Z80
; ---------------------------------------------------------------------------
macro stopZ80
move.w #$100,(z80_bus_request).l
endm
; ---------------------------------------------------------------------------
; wait for Z80 to stop
; ---------------------------------------------------------------------------
macro waitZ80
.\@wait:
btst #0,(z80_bus_request).l
bne.s .\@wait
endm
; ---------------------------------------------------------------------------
; reset the Z80
; ---------------------------------------------------------------------------
macro resetZ80
move.w #$100,(z80_reset).l
endm
macro resetZ80a
move.w #0,(z80_reset).l
endm
; ---------------------------------------------------------------------------
; start the Z80
; ---------------------------------------------------------------------------
macro startZ80
move.w #0,(z80_bus_request).l
endm
; ---------------------------------------------------------------------------
; disable interrupts
; ---------------------------------------------------------------------------
macro disable_ints
move #$2700,sr
endm
; ---------------------------------------------------------------------------
; enable interrupts
; ---------------------------------------------------------------------------
macro enable_ints
move #$2300,sr
endm
; ---------------------------------------------------------------------------
; DMA copy data from 68K (ROM/RAM) to the CRAM
; input: source, length, destination
; ---------------------------------------------------------------------------
macro writeCRAM_DMA
lea (vdp_control).l,a5
move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5)
move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5)
move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5)
move.w #$C000+(\3&$3FFF),(a5)
move.w #$80+((\3&$C000)>>14),(RAM_VDP_BUFFER).w
move.w (RAM_VDP_BUFFER).w,(a5)
endm
| 27.065421
| 77
| 0.383978
|
3a22bf62ec4dca859921bc6d3294e3deeac04048
| 9,829
|
asm
|
Assembly
|
src/enemies.asm
|
jannone/westen
|
e3883ded0f150355e43d68d69d5e102b2024eec4
|
[
"Apache-2.0"
] | 49
|
2021-09-22T04:12:15.000Z
|
2022-02-25T07:16:48.000Z
|
src/enemies.asm
|
jannone/westen
|
e3883ded0f150355e43d68d69d5e102b2024eec4
|
[
"Apache-2.0"
] | 2
|
2021-09-26T19:46:28.000Z
|
2021-09-28T00:25:06.000Z
|
src/enemies.asm
|
jannone/westen
|
e3883ded0f150355e43d68d69d5e102b2024eec4
|
[
"Apache-2.0"
] | 4
|
2021-09-26T16:45:52.000Z
|
2022-01-09T21:20:17.000Z
|
;-----------------------------------------------
init_object_screen_coordinates:
ld a,(n_objects)
or a
ret z
ld iy,objects
ld b,a
init_object_screen_coordinates_loop:
push bc
ld a,(iy)
bit 7,a ; enemies are marked with the msb = 1
jr z,init_object_screen_coordinates_loop_skip
call update_enemy_screen_coordinates
init_object_screen_coordinates_loop_skip:
ld bc,OBJECT_STRUCT_SIZE
add iy,bc
pop bc
djnz init_object_screen_coordinates_loop
ret
update_enemy_screen_coordinates:
; screen_x = room_x + (x*2 - y*2)/16 - 1
ld a,(room_x)
add a,a
add a,a
add a,a
add a,(iy+OBJECT_STRUCT_PIXEL_ISO_X)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
sub 8
ld (iy+OBJECT_STRUCT_SCREEN_PIXEL_X),a
rrca
rrca
rrca
and #1f
ld (iy+OBJECT_STRUCT_SCREEN_TILE_X),a
ld a,(iy)
cp OBJECT_TYPE_STOOL
jr z,update_enemy_screen_coordinates_skip_ptr_update
cp OBJECT_TYPE_CHAIR_RIGHT
jr z,update_enemy_screen_coordinates_skip_ptr_update
cp OBJECT_TYPE_CHAIR_LEFT
jr z,update_enemy_screen_coordinates_skip_ptr_update
cp OBJECT_TYPE_BULLET
jr z,update_enemy_screen_coordinates_skip_ptr_update
cp OBJECT_TYPE_TALL_STOOL
jr z,update_enemy_screen_coordinates_skip_ptr_update
ld a,(iy+OBJECT_STRUCT_SCREEN_PIXEL_X)
and #06
ld d,a
ld a,(iy+OBJECT_STRUCT_FRAME)
; += (a * 4 + d/2) * 16 * 3 * 2 -> += (8*a + d) * 16 * 3
add a,a
add a,a
add a,a
add a,d
ld h,0
ld l,a
add hl,hl
add hl,hl
add hl,hl
add hl,hl
ld b,h
ld c,l
ld hl,enemy_data_buffer
add hl,bc
add hl,bc
add hl,bc ; hl = pointer of the sprite to draw
ld (iy+OBJECT_STRUCT_PTR),l
ld (iy+OBJECT_STRUCT_PTR+1),h
update_enemy_screen_coordinates_skip_ptr_update:
; screen_y = room_y + (x + y)/16 - z/8 - 1
ld a,(room_y)
add a,a
add a,a
add a,a
ld c,a
ld a,(iy+OBJECT_STRUCT_PIXEL_ISO_Y)
add a,(iy+OBJECT_STRUCT_PIXEL_ISO_X)
jr nc,update_enemy_screen_coordinates_ncy
srl a
or #80
jr update_enemy_screen_coordinates_continuey
update_enemy_screen_coordinates_ncy:
srl a
update_enemy_screen_coordinates_continuey:
sub (iy+OBJECT_STRUCT_PIXEL_ISO_Z)
add c
sub (iy+OBJECT_STRUCT_PIXEL_ISO_Z_H)
ld (iy+OBJECT_STRUCT_SCREEN_PIXEL_Y),a
rrca
rrca
rrca
and #1f
ld (iy+OBJECT_STRUCT_SCREEN_TILE_Y),a
ret
;-----------------------------------------------
update_enemies_rat:
bit 7,(iy+OBJECT_STRUCT_STATE)
jp nz,update_enemies_hit
inc (iy+OBJECT_STRUCT_STATE_TIMER)
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
and #03
jp nz,update_objects_loop_skip
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
rrca
rrca
rrca
and #01
add a,(iy+OBJECT_STRUCT_STATE)
add a,(iy+OBJECT_STRUCT_STATE)
ld (iy+OBJECT_STRUCT_FRAME),a
ld a,(iy+OBJECT_STRUCT_STATE)
or a
jr z,update_enemies_rat_ne
dec a
jr z,update_enemies_rat_se
dec a
jr z,update_enemies_rat_sw
update_enemies_rat_nw:
ld a,(iy+OBJECT_STRUCT_PIXEL_ISO_X)
or a
jr z,update_enemies_rat_ne_collision
ld de,#00fe
ld c,d
call check_enemy_collision
jr z,update_enemies_rat_nw_collision
dec (iy+OBJECT_STRUCT_PIXEL_ISO_X)
dec (iy+OBJECT_STRUCT_PIXEL_ISO_X)
jp update_enemies_redraw
update_enemies_rat_nw_collision:
ld (iy+OBJECT_STRUCT_STATE),1
jp update_enemies_redraw
update_enemies_rat_ne:
ld a,(iy+OBJECT_STRUCT_PIXEL_ISO_Y)
or a
jr z,update_enemies_rat_ne_collision
ld de,#fe00
ld c,e
call check_enemy_collision
jr z,update_enemies_rat_ne_collision
dec (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
dec (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
jp update_enemies_redraw
update_enemies_rat_ne_collision:
ld (iy+OBJECT_STRUCT_STATE),2
jp update_enemies_redraw
update_enemies_rat_sw:
ld de,#0200
ld c,e
call check_enemy_collision
jr z,update_enemies_rat_sw_collision
inc (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
inc (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
jp update_enemies_redraw
update_enemies_rat_sw_collision:
ld (iy+OBJECT_STRUCT_STATE),0
jp update_enemies_redraw
update_enemies_rat_se:
ld de,#0002
ld c,d
call check_enemy_collision
jr z,update_enemies_rat_se_collision
inc (iy+OBJECT_STRUCT_PIXEL_ISO_X)
inc (iy+OBJECT_STRUCT_PIXEL_ISO_X)
jp update_enemies_redraw
update_enemies_rat_se_collision:
ld (iy+OBJECT_STRUCT_STATE),3
jp update_enemies_redraw
;-----------------------------------------------
update_enemies_spider:
bit 7,(iy+OBJECT_STRUCT_STATE)
jp nz,update_enemies_hit
inc (iy+OBJECT_STRUCT_STATE_TIMER)
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
and #01
jp nz,update_objects_loop_skip
ld a,(iy+OBJECT_STRUCT_STATE)
or a
jr z,update_enemies_spider_waiting
dec a
jr z,update_enemies_spider_attack
update_enemies_spider_rest:
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
cp 32
jp nz,update_objects_loop_skip
ld (iy+OBJECT_STRUCT_STATE),0
jp update_objects_loop_skip
update_enemies_spider_waiting:
; Check the player position:
ld a,(player_iso_x)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_X)
cp 48
jp p,update_objects_loop_skip
cp -48
jp m,update_objects_loop_skip
ld a,(player_iso_y)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
cp 48
jp p,update_objects_loop_skip
cp -48
jp m,update_objects_loop_skip
; player near! attack!
ld (iy+OBJECT_STRUCT_STATE),1
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
; keep the lowest bit, which determines whether the spider is updated in odd or even frames:
and #01
ld (iy+OBJECT_STRUCT_STATE_TIMER),a
jp update_objects_loop_skip
update_enemies_spider_attack:
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
cp 40
jr nz,update_enemies_spider_attack_not_done
ld (iy+OBJECT_STRUCT_STATE),2
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
; keep the lowest bit, which determines whether the spider is updated in odd or even frames:
and #01
ld (iy+OBJECT_STRUCT_STATE_TIMER),a
jp update_enemies_redraw
update_enemies_spider_attack_not_done:
ld a,(player_iso_x)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_X)
jr z,update_enemies_spider_attack_x_done
jp p,update_enemies_spider_attack_x_positive
update_enemies_spider_attack_x_negative:
call update_enemy_dec_x
ld c,6
jr update_enemies_spider_attack_x_movement_continue
; ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
; srl a
; and #01
; add a,c
; ld (iy+OBJECT_STRUCT_FRAME),a
; jr update_enemies_spider_attack_x_done
update_enemies_spider_attack_x_positive:
call update_enemy_inc_x
ld c,2
update_enemies_spider_attack_x_movement_continue:
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
srl a
and #01
add a,c
ld (iy+OBJECT_STRUCT_FRAME),a
update_enemies_spider_attack_x_done:
ld a,(player_iso_y)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
jr z,update_enemies_spider_attack_y_done
jp p,update_enemies_spider_attack_y_positive
update_enemies_spider_attack_y_negative:
call update_enemy_dec_y
ld c,0
jr update_enemies_spider_attack_y_movement_continue
; ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
; srl a
; and #01
; ld (iy+OBJECT_STRUCT_FRAME),a
; jr update_enemies_spider_attack_y_done
update_enemies_spider_attack_y_positive:
call update_enemy_inc_y
ld c,4
update_enemies_spider_attack_y_movement_continue:
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
srl a
and #01
add a,c
ld (iy+OBJECT_STRUCT_FRAME),a
update_enemies_spider_attack_y_done:
jp update_enemies_redraw
;-----------------------------------------------
update_enemies_slime:
bit 7,(iy+OBJECT_STRUCT_STATE)
jp nz,update_enemies_hit
inc (iy+OBJECT_STRUCT_STATE_TIMER)
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
and #03
jp nz,update_objects_loop_skip
; follow player:
ld a,(player_iso_x)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_X)
jr z,update_enemies_slime_attack_x_done
jp p,update_enemies_slime_attack_x_positive
update_enemies_slime_attack_x_negative:
call update_enemy_dec_x
jr update_enemies_slime_attack_x_done
update_enemies_slime_attack_x_positive:
call update_enemy_inc_x
update_enemies_slime_attack_x_done:
ld a,(player_iso_y)
sub (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
jr z,update_enemies_slime_attack_y_done
jp p,update_enemies_slime_attack_y_positive
update_enemies_slime_attack_y_negative:
call update_enemy_dec_y
jr update_enemies_slime_attack_y_done
update_enemies_slime_attack_y_positive:
call update_enemy_inc_y
update_enemies_slime_attack_y_done:
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
srl a
srl a
and #01
ld (iy+OBJECT_STRUCT_FRAME),a
jr update_enemies_redraw
;-----------------------------------------------
update_enemies_bat:
; bats cannot be killed:
; bit 7,(iy+OBJECT_STRUCT_STATE)
; jp nz,update_enemies_hit
inc (iy+OBJECT_STRUCT_STATE_TIMER)
ld a,(iy+OBJECT_STRUCT_STATE_TIMER)
and #01
jp nz,update_objects_loop_skip
ld a,(iy+OBJECT_STRUCT_PIXEL_ISO_Z)
cp 12
jp z,update_enemies_spider_attack_not_done
ld de,#0000
ld c,1
call check_enemy_collision
jp z,update_enemies_spider_attack_not_done
dec (iy+OBJECT_STRUCT_PIXEL_ISO_Z)
jp update_enemies_spider_attack_not_done
;-----------------------------------------------
update_enemies_redraw:
call update_enemy_screen_coordinates
; redraw:
; out (#2c),a
; Timing: (measured in room 34)
; min: 57952, max: 110812
push iy
ld e,(iy+OBJECT_STRUCT_SCREEN_TILE_X)
ld d,(iy+OBJECT_STRUCT_SCREEN_TILE_Y)
dec e
dec d
ld bc,#0404
call render_room_rectangle_safe
pop iy
; out (#2d),a
jp update_objects_loop_skip
;-----------------------------------------------
update_enemies_hit:
; delete the enemy:
push iy
pop ix
push iy
call remove_room_object
pop iy
ld de,-OBJECT_STRUCT_SIZE ; since we are deleting the object, decrement iy, so the update loop can continue
add iy,de
jp update_objects_loop_skip
;-----------------------------------------------
update_enemy_dec_x:
ld de,#00ff
ld c,d
call check_enemy_collision
ret z
dec (iy+OBJECT_STRUCT_PIXEL_ISO_X)
ret
update_enemy_inc_x:
ld de,#0001
ld c,d
call check_enemy_collision
ret z
inc (iy+OBJECT_STRUCT_PIXEL_ISO_X)
ret
update_enemy_dec_y:
ld de,#ff00
ld c,e
call check_enemy_collision
ret z
dec (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
ret
update_enemy_inc_y:
ld de,#0100
ld c,e
call check_enemy_collision
ret z
inc (iy+OBJECT_STRUCT_PIXEL_ISO_Y)
ret
| 22.964953
| 109
| 0.775969
|
c4cc2373160fdcac02c32cb7cd66885b09962996
| 1,477
|
asm
|
Assembly
|
programs/oeis/001/A001105.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/001/A001105.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/001/A001105.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A001105: a(n) = 2*n^2.
; 0,2,8,18,32,50,72,98,128,162,200,242,288,338,392,450,512,578,648,722,800,882,968,1058,1152,1250,1352,1458,1568,1682,1800,1922,2048,2178,2312,2450,2592,2738,2888,3042,3200,3362,3528,3698,3872,4050,4232,4418,4608,4802,5000,5202,5408,5618,5832,6050,6272,6498,6728,6962,7200,7442,7688,7938,8192,8450,8712,8978,9248,9522,9800,10082,10368,10658,10952,11250,11552,11858,12168,12482,12800,13122,13448,13778,14112,14450,14792,15138,15488,15842,16200,16562,16928,17298,17672,18050,18432,18818,19208,19602,20000,20402,20808,21218,21632,22050,22472,22898,23328,23762,24200,24642,25088,25538,25992,26450,26912,27378,27848,28322,28800,29282,29768,30258,30752,31250,31752,32258,32768,33282,33800,34322,34848,35378,35912,36450,36992,37538,38088,38642,39200,39762,40328,40898,41472,42050,42632,43218,43808,44402,45000,45602,46208,46818,47432,48050,48672,49298,49928,50562,51200,51842,52488,53138,53792,54450,55112,55778,56448,57122,57800,58482,59168,59858,60552,61250,61952,62658,63368,64082,64800,65522,66248,66978,67712,68450,69192,69938,70688,71442,72200,72962,73728,74498,75272,76050,76832,77618,78408,79202,80000,80802,81608,82418,83232,84050,84872,85698,86528,87362,88200,89042,89888,90738,91592,92450,93312,94178,95048,95922,96800,97682,98568,99458,100352,101250,102152,103058,103968,104882,105800,106722,107648,108578,109512,110450,111392,112338,113288,114242,115200,116162,117128,118098,119072,120050,121032,122018,123008,124002
mov $1,$0
pow $1,2
mul $1,2
| 211
| 1,422
| 0.811104
|
4d9a3a3f1da40e5b756da8903ca3e387f748b86f
| 5,952
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1979.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_notsx.log_21829_1979.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_notsx.log_21829_1979.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xe1ea, %rsi
lea addresses_UC_ht+0xc7ea, %rdi
nop
nop
nop
and %r10, %r10
mov $81, %rcx
rep movsw
nop
nop
nop
nop
sub $53633, %rcx
lea addresses_WT_ht+0x14dea, %r13
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %rbx
movq %rbx, %xmm2
movups %xmm2, (%r13)
nop
inc %rsi
lea addresses_D_ht+0x1c042, %rsi
lea addresses_D_ht+0x1d1ea, %rdi
nop
add $13213, %rbx
mov $30, %rcx
rep movsq
and %rbx, %rbx
lea addresses_A_ht+0xa8ea, %r10
add $1960, %rbx
movb (%r10), %cl
sub $17197, %rcx
lea addresses_A_ht+0x95ea, %rbp
nop
nop
sub $23725, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
vmovups %ymm5, (%rbp)
nop
nop
nop
nop
and $21891, %rbx
lea addresses_D_ht+0x9bca, %rsi
lea addresses_UC_ht+0x27ea, %rdi
nop
nop
and %rdx, %rdx
mov $62, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $52198, %rdx
lea addresses_A_ht+0x1d9ea, %rbp
nop
nop
nop
nop
cmp $37439, %r10
movl $0x61626364, (%rbp)
nop
xor %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %rax
push %rcx
push %rdi
push %rdx
// Store
lea addresses_normal+0xadea, %rcx
xor %rdi, %rdi
movb $0x51, (%rcx)
nop
nop
nop
nop
inc %r12
// Faulty Load
lea addresses_normal+0xadea, %rcx
nop
nop
cmp %r13, %r13
mov (%rcx), %edx
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': True, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'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
*/
| 41.333333
| 2,999
| 0.659778
|
debbc6fd9142a0c50983ae59070c39e0c3d1ac93
| 13,482
|
asm
|
Assembly
|
Source/Levels/L0214.asm
|
AbePralle/FGB
|
52f004b8d9d4091a2a242a012dc8c1f90d4c160d
|
[
"MIT"
] | null | null | null |
Source/Levels/L0214.asm
|
AbePralle/FGB
|
52f004b8d9d4091a2a242a012dc8c1f90d4c160d
|
[
"MIT"
] | null | null | null |
Source/Levels/L0214.asm
|
AbePralle/FGB
|
52f004b8d9d4091a2a242a012dc8c1f90d4c160d
|
[
"MIT"
] | null | null | null |
; L0214.asm skippy's prison
; Generated 07.09.2000 by mlevel
; Modified 07.09.2000 by Abe Pralle
INCLUDE "Source/Defs.inc"
INCLUDE "Source/Levels.inc"
;---------------------------------------------------------------------
SECTION "Level0214Section",ROMX
;---------------------------------------------------------------------
L0214_Contents::
DW L0214_Load
DW L0214_Init
DW L0214_Check
DW L0214_Map
dialog:
haiku_enterPrison_gtx:
INCBIN "Data/Dialog/IntroHaiku/haiku_enterPrison.gtx"
skippy_clues_gtx:
INCBIN "Data/Dialog/IntroHaiku/skippy_clues.gtx"
skippy_letsGo_gtx:
INCBIN "Data/Dialog/IntroHaiku/skippy_letsGo.gtx"
skippy_holdOn_gtx:
INCBIN "Data/Dialog/IntroHaiku/skippy_holdOn.gtx"
;---------------------------------------------------------------------
; Load
;---------------------------------------------------------------------
L0214_Load:
DW ((L0214_LoadFinished - L0214_Load2)) ;size
L0214_Load2:
call ParseMap
ret
L0214_LoadFinished:
;---------------------------------------------------------------------
; Map
;---------------------------------------------------------------------
L0214_Map:
INCBIN "Data/Levels/L0214_intro_haiku3.lvl"
;---------------------------------------------------------------------
; Init
;---------------------------------------------------------------------
STATE_INITIALDRAW EQU 0
STATE_ENTER EQU 1
STATE_CLUES EQU 2
STATE_ALARMOFF EQU 3
STATE_DIALOG_WAIT EQU 4
STATE_WAIT_DIALOG EQU 4
STATE_NEXTLEVEL EQU 5
STATE_LEAVE EQU 6
STATE_NORMAL EQU 7
VAR_LIGHT EQU 0
VAR_FLASHER EQU 1
VAR_PRISONOPEN EQU 2
LIGHTINDEX EQU 37
FLASHERINDEX EQU 42
GUARDINDEX EQU 48
GOBLININDEX EQU 49
SKIPPYINDEX EQU 50
L0214_Init:
DW ((L0214_InitFinished - L0214_Init2)) ;size
L0214_Init2:
call SetPressBDialog
ld a,BANK(dialog)
ld [dialogBank],a
ld a,[bgTileMap+LIGHTINDEX] ;tile index of first light
ld [levelVars+VAR_LIGHT],a
ld a,[bgTileMap+FLASHERINDEX] ;tile index of first light
ld [levelVars+VAR_FLASHER],a
ld bc,classCroutonDoctor
ld de,classGuard
call ChangeClass
;dest dest to unreachable so Skippy will pace around
ld c,SKIPPYINDEX
call GetFirst
ld hl,$d1ef
call SetActorDestLoc
xor a
ld [guardAlarm],a
ldio [mapState],a
ld [levelVars + VAR_PRISONOPEN],a
ret
L0214_InitFinished:
;---------------------------------------------------------------------
; Check
;---------------------------------------------------------------------
L0214_Check:
DW ((L0214_CheckFinished - L0214_Check2)) ;size
L0214_Check2:
call ((.animateLights - L0214_Check2) + levelCheckRAM)
call ((.moveGuards - L0214_Check2) + levelCheckRAM)
call ((.checkOpenPrison - L0214_Check2) + levelCheckRAM)
ldio a,[mapState]
cp STATE_NORMAL
jr nz,.checkInitialDraw
call ((.checkNearSkippy - L0214_Check2) + levelCheckRAM)
call ((.addGoblins - L0214_Check2) + levelCheckRAM)
ret
.checkInitialDraw
cp STATE_INITIALDRAW
jr nz,.checkAlarmOff
ld a,STATE_ENTER
ldio [mapState],a
ret
.checkAlarmOff
cp STATE_ALARMOFF
jr nz,.checkDialogWait
call ((.checkNearSkippy - L0214_Check2) + levelCheckRAM)
;fade the palette if alarm just tripped
ld a,[guardAlarm]
or a
ret z
ld a,BANK(alarm_gbm)
ld hl,alarm_gbm
call InitMusic
ld hl,gamePalette
ld de,fadeCurPalette
call CopyPalette64
ld hl,((.darkRedPalette - L0214_Check2) + levelCheckRAM)
ld de,fadeFinalPalette
call CopyPalette32
ld de,fadeFinalPalette+64
call CopyPalette32
ld a,16
call FadeInit
ld de,gamePalette
call CopyPalette32
ld de,gamePalette+64
call CopyPalette32
;remove door
ld a,MAPBANK
ldio [$ff70],a
ld hl,$d023
xor a
ld [hl+],a
ld [hl+],a
ld hl,$d242
ld [hl+],a
ld [hl+],a
ld a,STATE_NORMAL
;ldio [mapState+1],a
;ld a,STATE_DIALOG_WAIT
ldio [mapState],a
ret
.checkDialogWait
cp STATE_DIALOG_WAIT
jr nz,.checkNextLevel
call CheckDialogContinue
or a
ret z
call RestoreIdle
ld bc,classDoNothing
ld de,classCroutonGoblin
call ChangeClass
ld bc,classDoNothing2
ld de,classGuard
call ChangeClass
ldio a,[mapState+1]
ldio [mapState],a
ret
.checkNextLevel
cp STATE_NEXTLEVEL
jr nz,.checkEnter
ld hl,$0314
ld a,h
ld [curLevelIndex+1],a
ld a,l
ld [curLevelIndex],a
ld a,EXIT_D
call YankRemotePlayer
ld a,EXIT_D
ld [hero0_enterLevelFacing],a
ld [hero1_enterLevelFacing],a
ld a,1
ld [timeToChangeLevel],a
ret
.checkEnter
cp STATE_ENTER
jr nz,.checkClues
;ld a,1
;ld [heroesIdle],a
;call SetSpeakerToFirstHero
;ld a,BANK(haiku_enterPrison_gtx)
;ld de,haiku_enterPrison_gtx
;call ShowDialogAtBottomNoWait
;ld a,STATE_CLUES
;ldio [mapState+1],a
;ld a,STATE_DIALOG_WAIT
;ldio [mapState],a
xor a
ld [heroesIdle],a
ld [allIdle],a
call SetSpeakerToFirstHero
DIALOGBOTTOM haiku_enterPrison_gtx
WAITDIALOG STATE_CLUES
ret
.checkClues
cp STATE_CLUES
jr nz,.checkLeave
xor a
ld [heroesIdle],a
ld [allIdle],a
ld c,SKIPPYINDEX
DIALOGTOP skippy_clues_gtx
WAITDIALOG STATE_ALARMOFF
ret
.checkLeave
call ((.addGoblins - L0214_Check2) + levelCheckRAM)
ret
;----support routines-------------------------------------------------
.addGoblins
;normal state
;add goblins
ld a,MAPBANK
ldio [$ff70],a
ld hl,$d023
ld a,[hl]
or a
jr nz,.afterAddGoblin1
ld c,GOBLININDEX
call CreateInitAndDrawObject
.afterAddGoblin1
ld hl,$d242
ld a,[hl]
or a
jr nz,.afterAddGoblin2
ld c,GOBLININDEX
call CreateInitAndDrawObject
.afterAddGoblin2
ret
.checkOpenPrison
ld a,[levelVars + VAR_PRISONOPEN]
or a
ret nz
ld a,[hero0_index]
call ((.checkHeroOpen - L0214_Check2) + levelCheckRAM)
ld a,[hero1_index]
call ((.checkHeroOpen - L0214_Check2) + levelCheckRAM)
ret
.checkHeroOpen
or a
ret z
ld c,a
ld [dialogSpeakerIndex],a
call GetFirst
call GetCurLocation
ld a,h
cp $d1
ret nz
ld a,l
cp $ca
ret nz
;open bars
ld a,1
ld [levelVars + VAR_PRISONOPEN],a
ld a,MAPBANK
ldio [$ff70],a
ld hl,$d1cc
call ((.clearBars - L0214_Check2) + levelCheckRAM)
ld hl,$d1ec
call ((.clearBars - L0214_Check2) + levelCheckRAM)
ld hl,((.openBarsSound - L0214_Check2) + levelCheckRAM)
call PlaySound
ld c,SKIPPYINDEX
call GetFirst
ld hl,$d1ef
call SetActorDestLoc
ret
.openBarsSound
DB 4,$00,$f4,$4f,$80
.clearBars
ld c,8
xor a
.clearBarsLoop
ld [hl+],a
dec c
jr nz,.clearBarsLoop
ret
.checkNearSkippy
ld a,[hero0_index]
call ((.checkHeroNearSkippy - L0214_Check2) + levelCheckRAM)
ld a,[hero1_index]
call ((.checkHeroNearSkippy - L0214_Check2) + levelCheckRAM)
ret
.checkHeroNearSkippy
or a
ret z
ld c,a
call GetFirst
call GetCurZone
cp 3
ret nz
call SetSpeakerFromHeroIndex
ld a,[guardAlarm]
or a
jr nz,.alarmIsOn
ld a,1
ld [heroesIdle],a
ld bc,classCroutonGoblin
ld de,classDoNothing
call ChangeClass
ld bc,classGuard
ld de,classDoNothing2
call ChangeClass
ld a,BANK(skippy_letsGo_gtx)
ld de,skippy_letsGo_gtx
ld c,SKIPPYINDEX
call ShowDialogAtTopNoWait
ld a,STATE_NEXTLEVEL
ldio [mapState+1],a
ld a,STATE_DIALOG_WAIT
ldio [mapState],a
ret
.alarmIsOn
ld a,1
ld [heroesIdle],a
ld bc,classCroutonGoblin
ld de,classDoNothing
call ChangeClass
ld bc,classGuard
ld de,classDoNothing2
call ChangeClass
ld a,BANK(skippy_holdOn_gtx)
ld de,skippy_holdOn_gtx
ld c,SKIPPYINDEX
call ShowDialogAtTopNoWait
ld a,STATE_LEAVE
ldio [mapState+1],a
ld a,STATE_DIALOG_WAIT
ldio [mapState],a
ret
.animateLights
;animate dice lights
ld a,[levelVars+VAR_LIGHT]
ld b,a
;slow lights
ldio a,[updateTimer]
swap a
and %00000011
add b
ld hl,bgTileMap+LIGHTINDEX
call ((.updateTwoLights - L0214_Check2) + levelCheckRAM)
;fast lights
ldio a,[updateTimer]
swap a
rlca
and %00000011
add b
call ((.updateTwoLights - L0214_Check2) + levelCheckRAM)
;flasher
ld a,[guardAlarm]
or a
jr z,.afterAnimateFlasher
ld hl,levelVars+VAR_FLASHER
ldio a,[updateTimer]
rrca
rrca
push af
and %11
add [hl]
ld [bgTileMap+FLASHERINDEX],a
pop af
and %100
jr z,.afterAnimateFlasher
ld hl,((.klaxonSound - L0214_Check2) + levelCheckRAM)
call PlaySound
.afterAnimateFlasher
ret
.moveGuards
;----move guards----------------------------------------------
ld c,GUARDINDEX
call GetFirst
or a
jr z,.afterMoveGuards
.moveGuard
call IsActorAtDest
or a
jr z,.nextGuard
call GetCurLocation
push bc
push de
ld d,h ;save location
ld e,l
ld hl,((.patrolTable-L0214_Check2)+levelCheckRAM)
ld c,14 ;14 chances to find cur location
.tryNextLocation
ld a,[hl+]
cp e
jr nz,.notTheOne
ld a,[hl]
cp d
jr nz,.notTheOne
;found it
pop de
pop bc
inc hl
ld a,[hl+]
ld h,[hl]
ld l,a
call SetActorDestLoc
jr .nextGuard
.notTheOne
inc hl
inc hl
inc hl
dec c
jr nz,.tryNextLocation
pop de
pop bc
.nextGuard
call GetNextObject
or a
jr nz,.moveGuard
.afterMoveGuards
ret
.patrolTable
DW $d042,$d046
DW $d046,$d0a6
DW $d0a6,$d0a2
DW $d0a2,$d042
DW $d0eb,$d16b
DW $d16b,$d0eb
DW $d0f1,$d171
DW $d171,$d0f1
DW $d166,$d126
DW $d126,$d166
DW $d204,$d202
DW $d202,$d204
DW $d206,$d208
DW $d208,$d206
;14 total
.updateTwoLights
ld [hl+],a
call ((.incCount4 - L0214_Check2) + levelCheckRAM)
ld [hl+],a
ret
.incCount4
sub b
inc a
and %00000011
add b
ret
.darkRedPalette
DW $0000, $0424, $0848, $0c6f
DW $0000, $0005, $000f, $0c6f
DW $0000, $080a, $0c4f, $0c6f
DW $0000, $0025, $006f, $0c6f
DW $0000, $0808, $082a, $0c6f
DW $0000, $0027, $006f, $0c6f
DW $0000, $0008, $002f, $0c6f
DW $0000, $0809, $0c2f, $0c6f
.klaxonSound
DB 4,$00,$f7,$5a,$c0
L0214_CheckFinished:
PRINT "0214 Script Sizes (Load/Init/Check) (of $500): "
PRINT (L0214_LoadFinished - L0214_Load2)
PRINT " / "
PRINT (L0214_InitFinished - L0214_Init2)
PRINT " / "
PRINT (L0214_CheckFinished - L0214_Check2)
PRINT "\n"
| 24.379747
| 71
| 0.483979
|
13cddd36e58f34bc9bd8fdea1b61b515222de19f
| 911
|
asm
|
Assembly
|
programs/oeis/204/A204556.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/204/A204556.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/204/A204556.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A204556: Left edge of the triangle A045975.
; 1,2,9,24,45,90,133,224,297,450,561,792,949,1274,1485,1920,2193,2754,3097,3800,4221,5082,5589,6624,7225,8450,9153,10584,11397,13050,13981,15872,16929,19074,20265,22680,24013,26714,28197,31200,32841,36162,37969,41624,43605,47610,49773,54144,56497,61250,63801,68952,71709,77274,80245,86240,89433,95874,99297,106200,109861,117242,121149,129024,133185,141570,145993,154904,159597,169050,174021,184032,189289,199874,205425,216600,222453,234234,240397,252800,259281,272322,279129,292824,299965,314330,321813,336864,344697,360450,368641,385112,393669,410874,419805,437760,447073,465794,475497,495000
mov $4,$0
add $4,1
mov $7,$0
lpb $4
mov $0,$7
sub $4,1
sub $0,$4
mov $2,2
mov $3,$0
div $3,2
add $2,$3
mov $5,$0
gcd $0,2
mul $5,2
mul $5,$3
div $5,$0
mov $6,$2
add $6,$5
mov $3,$6
sub $3,2
mul $3,2
add $3,1
add $1,$3
lpe
mov $0,$1
| 31.413793
| 593
| 0.712404
|
2c5f8e5e7d6a5ec1bc3472070f0153c72c5cff6c
| 672
|
asm
|
Assembly
|
lab3example.asm
|
NFrisiani/Microcontroller-Engineering-I
|
563d19f3355e536985ae7033b569db6fb450804d
|
[
"MIT"
] | 1
|
2017-12-10T15:24:46.000Z
|
2017-12-10T15:24:46.000Z
|
lab3example.asm
|
NFrisiani/Microcontroller-Engineering-I
|
563d19f3355e536985ae7033b569db6fb450804d
|
[
"MIT"
] | null | null | null |
lab3example.asm
|
NFrisiani/Microcontroller-Engineering-I
|
563d19f3355e536985ae7033b569db6fb450804d
|
[
"MIT"
] | null | null | null |
processor 18F8722
config OSC=HS, WDT=OFF, LVP=OFF
org 0x0000
radix decimal
LATF equ 0xF8E ;assignign port F --> LEDs and U1/U2
TRISF equ 0xF97 ;assignign port F --> LEDs and U1/U2
PORTF equ 0xF85 ;assigning port F --> LEDs and U1/U2
LATH equ 0xF90 ;A --> transistor Q3
TRISH equ 0xF99 ;assigning port H --> transistor Q2 and leftmost toggle switches
PORTH equ 0xF87 ;assigning port H --> transistor Q2 and leftmost toggle switches
small equ 14
big equ 15
CALL big_delay
L2 BRA L2
delay
MOVLW 71
MOVWF small
loop
NOP
NOP
NOP
NOP
DECF small
BNZ loop
RETURN
big_delay
MOVLW 99
MOVWF big
loop2
CALL delay
DECF big
BNZ loop2
RETURN
end
| 15.272727
| 80
| 0.723214
|
fe64f8156fce02cafc6103644150b825a231926d
| 444
|
asm
|
Assembly
|
programs/oeis/006/A006591.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/006/A006591.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/006/A006591.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A006591: Sum_{k = 1..n } nearest integer to n/k (if n/k is midway between two numbers take the smaller).
; 1,3,5,8,11,14,17,22,24,28,33,36,40,45,48,53,57,62,66,71,74,79,86,89,93,99,102,109,114,117,122,129,133,138,143,148,152,159,164,169,175,178,185,190,193,202,207,212,215,223,227,232,241,244,249,256,259,266,273
mul $0,2
mov $3,1
lpb $0
div $0,2
mul $0,2
mov $2,$0
sub $0,1
div $2,$3
add $1,$2
add $3,2
lpe
add $1,1
mov $0,$1
| 26.117647
| 207
| 0.63964
|
2da0830f2d8926e96e32bb1cbf8a35b6f2eab513
| 364
|
asm
|
Assembly
|
oeis/021/A021835.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/021/A021835.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/021/A021835.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A021835: Decimal expansion of 1/831.
; Submitted by Christian Krause
; 0,0,1,2,0,3,3,6,9,4,3,4,4,1,6,3,6,5,8,2,4,3,0,8,0,6,2,5,7,5,2,1,0,5,8,9,6,5,1,0,2,2,8,6,4,0,1,9,2,5,3,9,1,0,9,5,0,6,6,1,8,5,3,1,8,8,9,2,9,0,0,1,2,0,3,3,6,9,4,3,4,4,1,6,3,6,5,8,2,4,3,0,8,0,6,2,5,7,5
seq $0,83811 ; Numbers n such that 2n+1 is the digit reversal of n+1.
div $0,3324
mod $0,10
| 45.5
| 199
| 0.598901
|
8d63c84a52da21470a1e72108d39d45eb8b4acbc
| 353
|
asm
|
Assembly
|
programs/oeis/267/A267043.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/267/A267043.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/267/A267043.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A267043: Middle column of the "Rule 91" elementary cellular automaton starting with a single ON (black) cell.
; 1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0
mov $1,$0
mod $0,2
cmp $1,2
cmp $0,$1
| 44.125
| 201
| 0.586402
|
cb249ab9dd11ce99092400c3ee382968cf10c36d
| 346
|
asm
|
Assembly
|
programs/oeis/028/A028329.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/028/A028329.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/028/A028329.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A028329: Twice central binomial coefficients.
; 2,4,12,40,140,504,1848,6864,25740,97240,369512,1410864,5408312,20801200,80233200,310235040,1202160780,4667212440,18150270600,70690527600,275693057640,1076515748880,4208197927440,16466861455200,64495207366200,252821212875504,991837065896208,3893878851296224
mov $1,$0
mul $1,2
bin $1,$0
mul $1,2
| 43.25
| 258
| 0.83237
|
2e9909ecc6adae05ba8f56383f8299eeaf2fdfce
| 658
|
asm
|
Assembly
|
sbsext/ext/read.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
sbsext/ext/read.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
sbsext/ext/read.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; READ / EOF V2.00 1990 Tony Tebby QJUMP
;
; READ
; EOF (#n)
;
section exten
xdef read
xdef eof
xdef eofw
xref ut_chan0 ; get channel default #0
xref ut_rtfd1
xref ut_trap3
include 'dev8_keys_qdos_io'
include 'dev8_keys_err'
include 'dev8_keys_sbasic'
read
moveq #err.nimp,d0
read_rts
rts
dc.l 'READ'
eofw
moveq #-1,d7
eof
cmp.l a3,a5 ; is it channel?
bne.s eof_chan ; ... no
move.l sb_ndata(a6),d1 ; ... yes, ndata=-1 at end
bra.s eof_set
eof_chan
jsr ut_chan0
bne.s read_rts
moveq #iob.test,d0
move.l d7,d3
trap #3
moveq #err.eof,d1
sub.l d1,d0
seq d1
eof_set
moveq #1,d0
and.l d0,d1
jmp ut_rtfd1
end
| 13.708333
| 52
| 0.670213
|
5010ba1579b0dc126b7baa58cb22d86a810d6aba
| 605
|
asm
|
Assembly
|
oeis/064/A064232.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/064/A064232.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/064/A064232.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A064232: a(n) = n^(n+2) mod (n+1)^(n+1).
; 0,1,16,243,971,31469,32530,6799175,298900846,1381059609,144064988167,7774410799163,72418038179852,6737865711858693,426377776285933636,6292404967145601295,586165173437961392811,2993987233372099394609,877718282434196639693502,85063895693373205673756419,1044930871298122350332129053,186585733558681390152548804573,19087816645346881539491783840687,375881357117272470581160626939735,57689071705663469811546660779889976,106075009393411224011514808939181641,170698442032698412564305143386188717349
mov $1,$0
mov $2,2
add $2,$0
pow $0,$2
add $1,1
pow $1,$1
mod $0,$1
| 55
| 492
| 0.856198
|
6044d670e50077bc26eed3def33ce0cfcac9860c
| 446
|
asm
|
Assembly
|
oeis/036/A036711.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/036/A036711.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/036/A036711.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A036711: a(n)=number of Gaussian integers z=a+bi satisfying |z|<=n+1/2, a>0, b>=0.
; Submitted by Christian Krause
; 0,2,5,9,17,24,34,44,56,73,87,105,122,144,166,187,215,243,271,300,328,364,399,435,471,513,554,594,640,683,733,781,828,880,936,992,1049,1105,1167,1226,1292,1354,1420,1489,1555,1627,1696
mul $0,2
add $0,1
pow $0,2
div $0,4
seq $0,57655 ; The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n.
div $0,4
| 40.545455
| 185
| 0.690583
|
427cc5617dd701b07569ef01b96e8508f2ad047b
| 4,139
|
asm
|
Assembly
|
savefile/main_sram3.asm
|
stranck/fools2018-1
|
1c506b17343fcdfa708aafaf8e596153e2c63254
|
[
"MIT"
] | 35
|
2018-04-01T06:55:28.000Z
|
2021-05-09T19:09:42.000Z
|
savefile/main_sram3.asm
|
stranck/fools2018-1
|
1c506b17343fcdfa708aafaf8e596153e2c63254
|
[
"MIT"
] | 4
|
2018-04-01T15:32:55.000Z
|
2019-02-23T20:46:49.000Z
|
savefile/main_sram3.asm
|
stranck/fools2018-1
|
1c506b17343fcdfa708aafaf8e596153e2c63254
|
[
"MIT"
] | 12
|
2018-04-01T15:48:09.000Z
|
2021-01-27T10:22:33.000Z
|
; === main_sram3.asm
; SRAM bank 3. Contains the map loader, custom audio tracks,
; and the connection test procedure.
SECTION "SRAM3", ROM0[$A000]
; This is where it all begins.
_EntryPoint:
jp _Start
; This flag is unset on a brand new save file.
FirstRunFlag:
db 0
; Custom audio tracks
include "includes/audio_macros.asm"
include "includes/audio_intro.asm"
include "includes/audio_flute.asm"
; Emulation testing subroutines
include "engine/emulator_tests.asm"
; Connection test procedure
include "engine/first_run.asm"
include "engine/connection_test.asm"
; Map loader and overworld functions
include "engine/overworld.asm"
; Load a solid black tile into VRAM and fill the screen with it.
BlackScreenWithVRAMCopy:
ld hl, $dd00
ld bc, $0008
ld a, $ff
call FillMemory
ld c, 1
ld de, $dd00
ld hl, $9010
call CopyVideoDataDouble
BlackScreen:
ld hl, $c3a0
ld bc, 18*20
ld a, $01
jp FillMemory
; Game start
_Start:
call OpenTextboxInOverworld
call BlackScreenWithVRAMCopy
call HideAllSprites
ld a, $ff
call PlaySound
.drawInitializing
coord hl, 3, 7
ld bc, $010c
call TextBoxBorder
coord hl, 4, 8
ld de, Initializing
call PutString
ld c, $60
.muteFadeoutLoop
ld a, $ff
call PlaySound
call DelayFrame
dec c
jr nz, .muteFadeoutLoop
.loadIntroMusic
ld de, $c6f0
ld hl, Intro1_Ch1OffsetStart
ld bc, 900
call CopyData
ld de, $dcd0
ld hl, Intro1_Ch2OffsetStart
ld bc, 700
call CopyData
ld de, $d163
ld hl, Intro1_Ch2CallChannels
ld bc, 400
call CopyData
ld de, $d8a0
ld hl, Intro1_Ch3OffsetStart
ld bc, 460
call CopyData
.loadIntroMusicPointers
ld de, $d320
ld hl, Intro1_Pointers
ld bc, 8
call CopyData
.checkEmulatorCompatibility
call BlackScreen
call EchoRAMTest
jp c, UnsupportedEmulator
call VRAMInaccessibilityTest
jp c, UnsupportedEmulator
; Fall through to TestConnectionAndLoadMap
; Perform a connection test.
; Also display some flavor text if the user has loaded the save
; for the first time
TestConnectionAndLoadMap:
ld a, [FirstRunFlag]
and a
jp z, FirstRun
ld hl, $d320
call PlayMusicFromRAM
call ConnectionTest
; Fall through to SetUpAndLoadFirstMap
; Set up all critical game variables and warp the player to the first
; map (Central Square, X=10, Y=12)
SetUpAndLoadFirstMap:
; Player has 255 items in inventory. This makes the inventory invalid,
; so when it's sent to the server, it will be rejected and the
; previously saved inventory data will be reloaded instead.
; This is what we want!
ld a, $ff
ld [$d31c], a
; Target map warp
ld a, $01
ld [MapWarpTargetIDH], a
ld a, $10
ld [MapWarpTargetIDL], a
ld a, 10
ld [MapWarpTargetX], a
ld a, 12
ld [MapWarpTargetY], a
; Player is in the Cable Club
; (that is - replace the Save option with Reset)
ld hl, $d72d
set 6, [hl]
; Empty the player party
ld hl, $d162
xor a
ld [hli], a
ld [hl], $ff
; Begin loading the map
jp ReceiveMap
; Called when any of the emulation accuracy tests fail
UnsupportedEmulator:
ld c, $20
ld a, $a3
call PlayMusic
ld hl, EmulatorFailText
call PrintTextEnhanced
.forever
jr .forever
; You can't stop people from doing bad things, because it would
; also stop them from doing nice things.
; If someone really wants to run the game regardless of the
; emulation problems, it is made easy here by including this jump.
; To bypass the message, just nop out the infinite loop above.
jp TestConnectionAndLoadMap
; Serial packet struct definitions.
include "includes/serial_structs.asm"
Initializing:
db $88,$ad,$a8,$b3,$a8,$a0,$ab,$a8,$b9,$a8,$ad,$a6,$50
EmulatorFailText:
text "You are using an inaccurate"
next "or unsupported emulator."
cont "The game cannot be played."
para "Refer to the following site"
next "for further information:"
cont "zzazzdzz.github.io/emu"
done
| 22.867403
| 74
| 0.681807
|
789f966ce65199bb5a3a9bf18879f48b81592055
| 403
|
asm
|
Assembly
|
programs/oeis/212/A212691.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/212/A212691.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/212/A212691.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A212691: Number of (w,x,y,z) with all terms in {1,...,n} and w+|x-y|<=|x-z|+|y-z|.
; 0,0,2,8,26,50,100,154,252,348,510,660,902,1118,1456,1750,2200,2584,3162,3648,4370,4970,5852,6578,7636,8500,9750,10764,12222,13398,15080,16430,18352,19888,22066,23800,26250,28194,30932,33098,36140
mov $2,$0
mov $3,$0
lpb $2
sub $2,1
sub $3,1
mov $0,$3
mul $0,$3
add $1,$0
sub $2,1
lpe
mul $1,2
mov $0,$1
| 25.1875
| 197
| 0.637717
|
a71d7340cd9718ce945f6e450625d33f97c47089
| 11,029
|
asm
|
Assembly
|
Games/CMonster (Breakout)/Source/title.asm
|
CiaranGruber/Ti-84-Calculator
|
96742a4a2b9e21aa9d675575dc7e4f26365430c0
|
[
"MIT"
] | 1
|
2019-03-31T11:49:12.000Z
|
2019-03-31T11:49:12.000Z
|
Games/CMonster (Breakout)/Source/title.asm
|
CiaranGruber/Ti-84-Calculator
|
96742a4a2b9e21aa9d675575dc7e4f26365430c0
|
[
"MIT"
] | null | null | null |
Games/CMonster (Breakout)/Source/title.asm
|
CiaranGruber/Ti-84-Calculator
|
96742a4a2b9e21aa9d675575dc7e4f26365430c0
|
[
"MIT"
] | 1
|
2020-03-09T13:21:19.000Z
|
2020-03-09T13:21:19.000Z
|
;############# CMonster by Patrick Davidson - title screen
title_show_highscore:
call show_highscores
Show_Title_Screen:
call Clear_Screen
ld hl,levelData
ld de,map
ld bc,160
ldir
ld a,18
ld (delay_amount),a
call timer_init
ld c,3
call Draw_Map_Partial
ld hl,title_screen
call Draw_Strings
ld hl,$b000
ld (wait_count),hl
ld h,l
ld (title_count),hl
xor a
ld (hard_flag),a
ld a,sk1
jp before_search_speed
loop_title:
ld hl,(wait_count)
inc hl
ld (wait_count),hl
ld a,h
or l
ld c,1
ret z
ld hl,(title_count)
inc hl
inc hl
ld a,h
and 31 ; for 32 * 256 = 8192 pixels (1024 chars) in length
ld h,a
ld (title_count),hl
ld hl,0 ; HL = X coordinate of segment of scroll being drawn
loop_scroll_message:
push hl
push hl
ld a,(title_count)
sub l
ld hl,scroll_table
#ifdef TI84CE
ld de,0
#else
ld d,0
#endif
ld e,a
add hl,de
ld b,(hl) ; B = Y coordinate for character
pop hl ; HL = X coordinate for character
push hl
ld hl,(title_count)
pop de ; DE = X coordinate for character
add hl,de
ex de,hl ; HL = X coordinate, DE = X coordinate + adjust amount
ld a,e
and 7
ld c,a ; C = X coordinate within character
srl d
rr e
srl d
rr e
srl d
rr e
push hl
ld hl,scroll_message
add hl,de
ld a,(hl)
pop hl
call Draw_Vertical_Subchar
pop hl
inc hl
ld a,h
dec a
jr nz,loop_scroll_message
ld a,l
cp 64
jr nz,loop_scroll_message
call GET_KEY
cp skPrgm
jr z,preview_levels
#ifdef TI84CE
ld c,1
#else
ld c,2
cp skCos
ret z
dec c
#endif
cp skDel
ret z
cp skClear
ret z
dec c
cp skVars
jp z,Load_External_Levels
cp sk2nd
ret z
cp skAdd
jr z,easy_selected
cp skSub
jr z,hard_selected
cp skAlpha
jp z,title_show_highscore
before_search_speed:
ld b,9
ld hl,speed_table
loop_search_speed:
cp (hl)
inc hl
jr z,speed_match
inc hl
djnz loop_search_speed
jp loop_title
easy_selected:
xor a
ld hl,easy
jr difficulty_selected
hard_selected:
ld a,-1
ld hl,hard
difficulty_selected:
ld (hard_flag),a
ld bc,(52*256)+110
call Draw_String
jp loop_title
speed_match:
ld a,'0'+10
sub b
ld (score_inc),a
ld a,(hl)
ld (delay_amount),a
ld a,(score_inc)
ld bc,(40*256)+120
call Draw_Char
jp loop_title
preview_levels:
ld a,1
ld (level),a
call Clear_Below_Tiles
preview_show:
ld a,(level)
call Load_Level
ld a,(level)
ld de,preview_level + 2
call Decode_A_DE_3
ld hl,preview_message
call Draw_Strings
call Draw_Map
ld hl,WAIT_RESET
ld (wait_count),hl
preview_loop:
call timer_wait
ld hl,(wait_count)
inc hl
ld (wait_count),hl
ld a,h
or l
ld c,1
ret z
call GET_KEY
cp skUp
jr z,preview_previous
cp skDown
jr z,preview_next
cp skClear
ret z
cp skDel
ret z
cp skEnter
jp z,Show_Title_Screen
jr preview_loop
preview_next:
ld a,(map_name)
or a
ld a,(level_count)
jr nz,preview_ext
ld a,NUM_LEVELS
preview_ext:
ld hl,level
cp (hl)
jr z,preview_loop
inc (hl)
jr preview_show
preview_previous:
ld hl,level
ld a,(hl)
dec a
jr z,preview_loop
dec (hl)
jr preview_show
preview_message:
.db 0,232
.db "Previewing level "
preview_level:
.db "--- - Use up/down/enter", 0, -1
speed_table:
.db sk1,63
.db sk2,57
.db sk3,51
.db sk4,45
.db sk5,39
.db sk6,33
.db sk7,28
.db sk8,23
.db sk9,18
; ############# Draw a vertical slice of a character
; HL = X coordinate
; A = character
; B = Y coordinate
; C = slice (0 - 7)
Draw_Vertical_Subchar:
#ifdef TI84CE
push hl
sub 32
ld hl,0
add a,a
ld l,a
add hl,hl
add hl,hl
ld de,tileData
add hl,de ; HL -> start of char
ex de,hl
pop hl ; HL = X coordinate
push de ; save character pointer on stack
push hl ; save X coordinate on stack
ld a,c
add a,a
add a,a
add a,a
xor %01111111
ld (smc_bit_selection+1),a
ld hl,0
ld de,0
ld e,b
ld l,b
add hl,hl
add hl,hl
add hl,de ; HL = 5 * Y
add hl,hl
add hl,hl ; HL = 20 * Y
add hl,hl
add hl,hl ; HL = 80 * Y
add hl,hl
add hl,hl ; HL = 320 * Y
pop de
add hl,de ; HL = 320 * Y + X
add hl,hl ; HL = 640 * Y + 2 * X
ld de,$D40000
add hl,de
call blank_6_rows
pop de
ld b,8
loop_char_main_slice:
ld a,(de)
inc de
smc_bit_selection:
bit 0,a
ld a,$ff
jr z,char_slice_set
xor a
char_slice_set:
push bc
ld bc,320*2-1
ld (hl),a
inc hl
ld (hl),a
add hl,bc
ld (hl),a
inc hl
ld (hl),a
add hl,bc
pop bc
djnz loop_char_main_slice
blank_6_rows:
ld bc,320*2-1
ld a,6
loop_verticalsub:
ld (hl),0
inc hl
ld (hl),0
add hl,bc
dec a
jr nz,loop_verticalsub
ret
#else
push af
push bc
ld a,$52 ; minimum X
call Write_Display_Control
ld a,$21 ; current X
call Write_Display_Control
ld a,$53 ; maximum X
call Write_Display_Control
pop bc
push bc
ld h,0
ld l,b
ld a,$50 ; minimum Y
call Write_Display_Control
ld a,$20 ; current Y
call Write_Display_Control
ld a,27
add a,l
ld l,a
ld a,$51 ; maximum Y
call Write_Display_Control
ld a,$22
out ($10),a
out ($10),a
pop bc
ld a,c
add a,a
add a,a
add a,a
xor %01111111
ld (smc_bit_selection+1),a
call blank_6_rows
pop af
sub 32
add a,a
ld l,a
ld h,0
ld de,tileData
add hl,hl
add hl,hl
add hl,de
ld b,8
loop_char_main_slice:
ld a,(hl)
inc hl
smc_bit_selection:
bit 0,a
ld a,$ff
jr z,char_slice_set
xor a
char_slice_set:
out ($11),a
out ($11),a
out ($11),a
out ($11),a
djnz loop_char_main_slice
blank_6_rows:
ld b,3
xor a
loop_verticalsub:
out ($11),a
out ($11),a
out ($11),a
out ($11),a
djnz loop_verticalsub
ret
#endif
title_screen:
.db 24,40
.db "CMonster by Patrick Davidson",0
.db 40,50
.db "eeulplek@hotmail.com",0
.DB 14,60
.db "http://www.ocf.berkeley.edu/~pad/",0
.db 6,70
.db "IRC: PatrickD on EfNet #ti, #cemetech",0
.db 18,80
.db "eeulplek on Twitter and YouTube",0
#ifndef TI84CE
.db 20,100
.db "Press COS to open level editor",0
#endif
.db 4,110
.db "Difficulty: "
easy: .db "Easy (Select with + and -)",0
.db 12,120
.db "Speed: 1 (Select with 1 through 9)",0
.db 26,130
.db "Press 2ND to start the game",0
.db 4,140
.db "Arrows move, CLEAR exits, P (8) pauses",0
.db 28,150
.db "ENTER saves game and exits",0
.db 26,160
.db "Press PRGM to preview levels",0
.db 8,170
.db "Press VARS to select external levels",0
.db -1
hard: .db "Hard",0
scroll_message:
.fill 40,' '
#import "scroll.txt"
.fill (scroll_message+1024+40-$),' '
| 24.508889
| 94
| 0.386073
|
f5f363fb655eda19b1bd5d854809344f25e7dbbb
| 515
|
asm
|
Assembly
|
sertest.asm
|
WA6YDQ/nano80
|
17de2a6c13a3161f4702589f08ba53aadae3e84b
|
[
"MIT"
] | 2
|
2021-01-19T13:56:06.000Z
|
2022-03-04T10:37:13.000Z
|
sertest.asm
|
WA6YDQ/nano80
|
17de2a6c13a3161f4702589f08ba53aadae3e84b
|
[
"MIT"
] | null | null | null |
sertest.asm
|
WA6YDQ/nano80
|
17de2a6c13a3161f4702589f08ba53aadae3e84b
|
[
"MIT"
] | null | null | null |
; sertest.asm
; test serial read/write of nano80
; k theis 2019
; this program reads from the serial port. When a character
; is available, is returns it on the serial port ans sends it to
;the LED display port as well.
org 0
STATUS equ 2 ; serial status 0=not ready, n=# of chars
SIN equ 1 ; serial in
SOUT equ 1 ; serial out
LED equ 0 ; LED output port
start in STATUS
cpi 0
jz start
mov c,a ; save char count to receive
loop in SIN
out SOUT
out LED
dcr c
jnz loop
jmp start ; continue forever
| 17.758621
| 65
| 0.714563
|
ca1d3e4e174f69b3da5166f45d60c9b5d71649cc
| 4,640
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_787_1622.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_787_1622.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_787_1622.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 %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xe941, %rbx
nop
nop
nop
nop
cmp $20514, %r13
movl $0x61626364, (%rbx)
nop
nop
cmp %r8, %r8
lea addresses_WT_ht+0x5941, %rsi
lea addresses_normal_ht+0xe59a, %rdi
clflush (%rdi)
nop
xor $65028, %r9
mov $91, %rcx
rep movsl
nop
nop
nop
nop
nop
add $46473, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r15
push %r9
push %rcx
push %rdi
// Store
mov $0xe41, %r14
nop
sub $36165, %rdi
mov $0x5152535455565758, %r9
movq %r9, %xmm3
movups %xmm3, (%r14)
nop
nop
nop
nop
nop
sub $34844, %r14
// Store
lea addresses_US+0xab41, %rcx
add $43878, %r9
mov $0x5152535455565758, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
and $16252, %r11
// Store
lea addresses_WC+0x13569, %rdi
nop
nop
nop
nop
nop
add %r13, %r13
mov $0x5152535455565758, %rcx
movq %rcx, (%rdi)
nop
and $33768, %r13
// Faulty Load
lea addresses_US+0x1b341, %r11
nop
nop
nop
nop
nop
xor $34270, %r9
vmovups (%r11), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rdi
lea oracles, %r9
and $0xff, %rdi
shlq $12, %rdi
mov (%r9,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}}
{'00': 787}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 35.968992
| 2,360
| 0.658621
|
3d871288d97d3efdd4e605a126dd613021079a6f
| 225
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_init_callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 8
|
2017-01-18T12:02:17.000Z
|
2021-06-12T09:40:28.000Z
|
libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_init_callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 1
|
2017-03-06T07:41:56.000Z
|
2017-03-06T07:41:56.000Z
|
libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_init_callee.asm
|
teknoplop/z88dk
|
bb03fbfd6b2ab0f397a1358559089f9cd3706485
|
[
"ClArtistic"
] | 3
|
2017-03-07T03:19:40.000Z
|
2021-09-15T17:59:19.000Z
|
; bv_stack_t *bv_stack_init(void *p, size_t capacity, size_t max_size)
SECTION code_clib
SECTION code_adt_bv_stack
PUBLIC bv_stack_init_callee
EXTERN b_vector_init_callee
defc bv_stack_init_callee = b_vector_init_callee
| 18.75
| 70
| 0.853333
|
60e5cfc2be7cbade8ea0b04caf57d61b88f7865c
| 404
|
asm
|
Assembly
|
oeis/089/A089907.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/089/A089907.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/089/A089907.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A089907: Sum of digits of numbers between 0 and (6/9)*(10^n-1).
; Submitted by Christian Krause
; 0,21,483,7785,107787,1377789,16777791,197777793,2277777795,25777777797,287777777799,3177777777801,34777777777803,377777777777805,4077777777777807,43777777777777809,467777777777777811
mov $2,$0
lpb $0
sub $0,1
add $1,1
mul $2,10
sub $2,$1
add $1,1
sub $2,$1
add $1,1
lpe
mov $0,$2
mul $0,3
| 23.764706
| 184
| 0.727723
|
370e344ae3bfe5005b048a8f202c0cab09222a30
| 688
|
asm
|
Assembly
|
oeis/306/A306495.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/306/A306495.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/306/A306495.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A306495: Expansion of e.g.f. (2-exp(-x))*exp(x)/(x-1)^2.
; Submitted by Jon Maiga
; 1,4,16,74,402,2542,18446,151482,1390738,14126582,157365222,1908110866,25022451482,352918443438,5327630246542,85716034274282,1464281837606946,26470821156031462,504879319309407158,10132393298394712002,213441590598213760042,4708941619799198880926,108583416414789993621342,2612112695461945072833178,65443363521209287017011762,1704900558783297307150681302,46116642767945423410777782406,1293458517203178154562221975922,37569495030811236556936427152698,1128742395818071058797788530407822
sub $1,$0
lpb $0
add $1,$0
add $0,1
add $1,$0
sub $0,2
add $2,1
mul $1,$2
add $1,1
lpe
mov $0,$1
add $0,1
| 40.470588
| 482
| 0.813953
|
ba5ef7346834723f729a7da5f26df5da2050984d
| 479
|
asm
|
Assembly
|
programs/oeis/008/A008794.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/008/A008794.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/008/A008794.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A008794: Squares repeated; a(n) = floor(n/2)^2.
; 0,0,1,1,4,4,9,9,16,16,25,25,36,36,49,49,64,64,81,81,100,100,121,121,144,144,169,169,196,196,225,225,256,256,289,289,324,324,361,361,400,400,441,441,484,484,529,529,576,576,625,625,676,676,729,729,784,784,841,841,900,900,961,961,1024,1024,1089,1089,1156,1156,1225,1225,1296,1296,1369,1369,1444,1444,1521,1521,1600,1600,1681,1681,1764,1764,1849,1849,1936,1936,2025,2025,2116,2116,2209,2209,2304,2304,2401,2401
div $0,2
pow $0,2
| 79.833333
| 409
| 0.730689
|
0bf201bccf16e5935c492e1c8f267c9b761089c2
| 6,864
|
asm
|
Assembly
|
src/menu.asm
|
onslaught-demogroup/ons_paddo_music_disk
|
6a945f918fd1220b325385d14327b5e1ee86295d
|
[
"MIT"
] | null | null | null |
src/menu.asm
|
onslaught-demogroup/ons_paddo_music_disk
|
6a945f918fd1220b325385d14327b5e1ee86295d
|
[
"MIT"
] | null | null | null |
src/menu.asm
|
onslaught-demogroup/ons_paddo_music_disk
|
6a945f918fd1220b325385d14327b5e1ee86295d
|
[
"MIT"
] | null | null | null |
/*
Defined in menu_items.asm
.var menu_x = 5
.var menu_y = 10
.var menu_h = 10
.var menu_w = 8
.var item_w = 64
Deifned in sid_include.asm
sid_name.size()
*/
.var keyboard_scanning_delay_frames = 3
.var title_scroll_delay_frames = 5
.var title_scroll_delay_frames_major = 30
m_key_scan_delay:
.byte $05
m_title_scroll_delay_counter:
.byte $10
m_title_scroll_position:
.byte $05
m_title_scroll_direction:
.byte $01
m_modal_context:
.byte $00
m_modal_ack:
.byte $00
menu_init:
lda #$00
sta menu_selected_item
rts
menu_irq_handler:
jsr menu_scroll_title
jsr menu_redraw
jsr menu_input
rts
menu_modal:
lda #$00
sta m_modal_ack
lda #$01
sta m_modal_context
rts
menu_no_modal:
lda #$00
sta m_modal_context
lda #$00
sta m_modal_ack
rts
//-----------------------
//internal functions
menu_scroll_title:
dec m_title_scroll_delay_counter
beq !+
rts
!:
lda #title_scroll_delay_frames
sta m_title_scroll_delay_counter
ldx m_title_scroll_position
lda m_title_scroll_direction
bne !backwards+
!forwards:
inx
jmp !+
!backwards:
dex
!:
cpx #$00
bne !+
ldx #$01
lda #$00
sta m_title_scroll_direction
lda #title_scroll_delay_frames_major
sta m_title_scroll_delay_counter
!:
ldy menu_selected_item
lda menu_title_length,y
sta m_st_cmp
cpx m_st_cmp: #32 // for ping pong
bne !+
lda #$01
sta m_title_scroll_direction
lda #title_scroll_delay_frames_major
sta m_title_scroll_delay_counter
!:
stx m_title_scroll_position
rts
menu_input:
dec m_key_scan_delay
beq !+
rts
!:
lda #keyboard_scanning_delay_frames
sta m_key_scan_delay
clc
jsr keyboard
bcc !valid_input+
!:
rts
!valid_input:
sta menu_is_space
lda m_modal_context
beq !+
lda menu_is_space: #$00
cmp #$20
beq !modal_ack+
cpx #$00
bne !modal_ack+
cpy #$00
bne !modal_ack+
rts
!modal_ack:
lda #$01
sta m_modal_ack
rts
!:
tya
and #%00001000
beq !+ //not home key pressed
!home:
lda #$00
sta menu_selected_item
lda #title_scroll_delay_frames_major
sta m_title_scroll_delay_counter
lda #$05 //default location
sta m_title_scroll_position
lda #$01
sta m_title_scroll_direction
rts
!:
/*
Todo: add some easter eggs in here!
*/
tya
clc
and #%10100000
cmp #%10100000
bne !no_eggs+
lda #title_scroll_delay_frames_major
sta m_title_scroll_delay_counter
lda #$05 //default location
sta m_title_scroll_position
lda #$01
sta m_title_scroll_direction
lda #100
jmp !egg_song+
!no_eggs:
txa
and #%00000010
beq !+ //not return key pressed
!return:
lda menu_selected_item
!egg_song:
sta menu_chosen_song
tay
lda menu_indexes_lo,y
sta menu_song_ptr
lda menu_indexes_hi,y
sta menu_song_ptr + 1
ldy #$00
jsr !read_byte+
sta menu_next_song_disk
iny
jsr !read_byte+
sta menu_next_song_filename_a
iny
jsr !read_byte+
sta menu_next_song_filename_b
lda #$01
sta menu_next_song_ready_flag
rts
!read_byte:
lda menu_song_ptr: $ffff,y
rts
!:
txa
and #%10000000 //check up/down key
asl //push key onto carry
bcs !updown+
rts
!updown:
lda #title_scroll_delay_frames_major
sta m_title_scroll_delay_counter
lda #$05 //default location
sta m_title_scroll_position
lda #$01
sta m_title_scroll_direction
tya
and #%01010000 //check shift key to determine direction
bne !up+
!down:
ldx menu_selected_item
cpx #99
beq !+
inx
stx menu_selected_item
!:
rts
!up:
ldx menu_selected_item
cpx #00
beq !+
dex
stx menu_selected_item
!:
rts
menu_redraw:
/*
if menu_selected_item < (menu_h/2):
loop from Y=0, X=0 and draw items
set selected item index to different color
elseif menu_selected > (sid_name.size() - menu_h)
loop from Y=(sid_name.size() - menu_h), X=0
set selected item index to different color
else
loop from Y= menu_selected_item - (menu_h/2), X=0
set selected item index to different color
*/
ldx #$00
lda menu_selected_item
cmp #(menu_h / 2)
bcs !+ //if menu_selected_item < (menu_h/2):
ldy #$00
jmp !redraw+
!: cmp #(sid_name.size() - 1 - (menu_h/2)) //elseif menu_selected > (sid_name.size() - menu_h)
bcc !+
ldy #(sid_name.size() - 1 - menu_h)
jmp !redraw+
!: //else
sec
sbc #(menu_h/2)
tay
!redraw:
!loop:
cpy menu_selected_item
bne !skip+
lda #$01
sta menu_item_color_addra
jsr menu_active_draw_item
jmp !+
!skip:
lda #$0e
sta menu_item_color_addr
jsr menu_draw_item
!:
inx
iny
cpx #menu_h
bne !loop-
rts
/*
Y = menu item
X = onscreen menu row
*/
menu_draw_item:
stx menu_tmp_x
sty menu_tmp_y
lda menu_screen_lo,x
sta menu_screen_addr
sta menu_color_addr
lda menu_screen_hi,x
sta menu_screen_addr + 1
clc
adc #$d4 // 04 + d4 = d8 which is color RAM
sta menu_color_addr + 1
lda menu_indexes_lo,y
sta menu_item_addr
lda menu_indexes_hi,y
sta menu_item_addr + 1
ldy #$05
ldx #$00
!:
lda menu_item_addr: $ffff,y
sta menu_screen_addr: $ffff,x
lda menu_item_color_addr: #$00
sta menu_color_addr: $ffff,x
inx
iny
cpx #menu_w
bne !-
ldx menu_tmp_x: #$00
ldy menu_tmp_y: #$00
rts
/*
Y = menu item
X = onscreen menu row
A = scroll offset (of selected item)
*/
menu_active_draw_item:
stx menu_tmp_xa
sty menu_tmp_ya
lda menu_row_sprite_y_locations,x
sta $d007
sta $d009
lda menu_screen_lo,x
sta menu_screen_addra
sta menu_color_addra
lda menu_screen_hi,x
sta menu_screen_addra + 1
clc
adc #$d4 // 04 + d4 = d8 which is color RAM
sta menu_color_addra + 1
lda menu_indexes_lo,y
sta menu_item_addra
lda menu_indexes_hi,y
sta menu_item_addra + 1
ldy m_title_scroll_position
ldx #$00
!:
lda menu_item_addra: $ffff,y
clc
adc #$80 //reverse
sta menu_screen_addra: $ffff,x
lda menu_item_color_addra: #$00
sta menu_color_addra: $ffff,x
inx
iny
cpx #menu_w
bne !-
ldx menu_tmp_xa: #$00
ldy menu_tmp_ya: #$00
rts
menu_chosen_song:
.byte $00
menu_selected_item:
.byte $00
menu_next_song_filename_a:
.byte $00
menu_next_song_filename_b:
.byte $00
menu_next_song_disk:
.byte $00
menu_next_song_ready_flag:
.byte $00
menu_row_sprite_y_locations:
.pc=* "menu_row_sprite_y_locations"
.for(var i=0;i<menu_h;i++){
.byte <($32 + (menu_y * $08) + (i*8))
}
| 18.909091
| 95
| 0.64831
|
2b82ed4c497966c74f0fd8c36c7d8df632425c99
| 4,572
|
asm
|
Assembly
|
Pages.asm
|
vcte/eclectic
|
46d82f3a573d9fd09847a07cb9017d8a57db9b1a
|
[
"MIT"
] | 1
|
2018-10-22T23:38:28.000Z
|
2018-10-22T23:38:28.000Z
|
Pages.asm
|
vcte/eclectic
|
46d82f3a573d9fd09847a07cb9017d8a57db9b1a
|
[
"MIT"
] | null | null | null |
Pages.asm
|
vcte/eclectic
|
46d82f3a573d9fd09847a07cb9017d8a57db9b1a
|
[
"MIT"
] | null | null | null |
; ===============================================================
; Pages
; ===============================================================
; ---------------------------------------------------------------
; PAGE 1 (General)
; ---------------------------------------------------------------
second1:
xor A
ld (curpage), A
call page
ld A, 1
ld (PenRow), A
ld DE, tWeight
call WriteTagline
push HL
call WriteWeight
ld HL, tGPerMol
b_call(_VPutS)
pop HL
call NextBCD
push HL
ld DE, 2 + 256 * 13 ;display category
ld (PenCol), DE
ld A, (HL)
and %11110000
srl A
srl A
srl A
ld B, 0
ld C, A
ld HL, category
add HL, BC
call LdHLInd
b_call(_VPutS)
ld DE, tGroup ;display group #
call WriteTagline
call GetColumn
or A
jr nz, second1a
ld HL, tNA ;"NA"
b_call(_VPutS)
jr second1b
second1a:
call IntStr
b_call(_VPutS)
second1b:
ld DE, tPeriod ;display period #
call WriteTagline
call GetPeriod
call IntStr
b_call(_VPutS)
second1d:
ld DE, tBlock ;display block
call WriteTagline
call GetBlock
ld HL, blocktable
ld B, 0
ld C, A
add HL, BC
ld A, (HL)
b_call(_VPutMap)
pop HL
call ifastcopy
jp secondhandle
; ---------------------------------------------------------------
; Page 2 (Physical)
; ---------------------------------------------------------------
second2:
ld A, 1
ld (curpage), A
call page
ld DE, 2 + 256
ld (PenCol), DE
call SkipMass
ld DE, tState ;write state
call WriteTagline
push HL
ld A, (HL)
and %00001111
add A, A
ld B, 0
ld C, A
ld HL, states
add HL, BC
call LdHLInd
b_call(_VPutS)
pop HL
inc HL
ld DE, tDensity ;write density
call WriteTagline
ld DE, tGperCm3
call WriteData
ld DE, tVolume ;write volume
call WriteTagline
ld DE, tCm3perMol
call WriteData
call ifastcopy
jp secondhandle
; ---------------------------------------------------------------
; PAGE 3 (Temperature)
; ---------------------------------------------------------------
second3:
ld A, 2
ld (curpage), A
call page
ld DE, 2 + 256
ld (PenCol), DE
ld DE, tMeltingPt ;write melting point
call WriteTagline
call SkipToTemp
ld DE, tKelvin
call WriteData
ld DE, tBoilingPt ;write boiling point
call WriteTagline
ld DE, tKelvin
call WriteData
ld DE, tHFusion ;write heat of fusion
call WriteTagline
ld DE, tkJMol
call WriteData
ld DE, tHVapor ;write heat of vaporization
call WriteTagline
ld DE, tkJMol
call WriteData
ld DE, tSpecHeat
call WriteTagline
ld DE, tJgK
call WriteData
call ifastcopy
jp secondhandle
; ---------------------------------------------------------------
; PAGE 4 (Atomic)
; ---------------------------------------------------------------
second4:
ld A, 3
ld (curpage), A
call page
ld DE, 2 + 256 * 7
ld (PenCol), DE
push HL
call WriteEConf
ld DE, tRadius ;write atomic Radius
call WriteTagline
pop HL
call SkipToAtomic
ld DE, tAngstrom
call WriteData
ld DE, tCovRadius ;write covalent radius
call WriteTagline
ld DE, tAngstrom
call WriteData
ld DE, tIonizationE ;write ionization energy
call WriteTagline
call GetDataA
bit 6, A
jr z, second4c
call WriteUnknown
jr second4d
second4c:
push HL
call BCDStr
b_call(_VPutS)
ld HL, tVolt
b_call(_VPutS)
pop HL
call NextBCD
second4d:
ld DE, tElectroneg
call WriteTagline
call GetDataA
bit 5, A
jr z, second4e
call WriteUnknown
jr second4f
second4e:
push HL
call BCDStr
b_call(_VPutS)
pop HL
call NextBCD
second4f:
ld DE, tEAffinity
call WriteTagline
call GetDataA
bit 4, A
jr z, second4g
call WriteUnknown
jr second4h
second4g:
push HL
call BCDStr
b_call(_VPutS)
ld HL, tVolt
b_call(_VPutS)
pop HL
call NextBCD
second4h:
ld DE, tOxidationSts
call WriteTagline
call GetDataA
bit 3, A
jr z, second4i
call WriteUnknown
jr second4j
second4i:
push HL
call WriteOxidation
pop HL
call nextstr
second4j:
call ifastcopy
jr secondhandle
; ---------------------------------------------------------------
; PAGE 5 (Misc.)
; ---------------------------------------------------------------
second5:
ld A, 4
ld (curpage), A
call page
ld DE, 2 + 256 * 7
ld (PenCol), DE
call SkipToMisc
push HL
ld A, (HL)
add A, A
ld HL, crystaltab
ld B, 0
ld C, A
add HL, BC
call LdHLInd
b_call(_VPutS)
pop HL
inc HL
ld DE, tThermalCond
call WriteTagline
ld DE, tWmK
call WriteData
ld DE, tElectCond
call WriteTagline
call WriteElectCond
call ifastcopy
; jr secondhandle ;jumps to next code section
| 14.748387
| 65
| 0.571522
|
4eae69ada5e0a26fa90b60739ca32933b6fe5724
| 406
|
asm
|
Assembly
|
oeis/111/A111715.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/111/A111715.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/111/A111715.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A111715: Sum of the squares of the first n squarefree numbers.
; Submitted by Jon Maiga
; 0,1,5,14,39,75,124,224,345,514,710,935,1224,1585,2026,2510,3039,3715,4556,5456,6417,7506,8662,9887,11256,12700,14221,15902,17666,19515,21631,23840,26441,29250,32275,35524,38888,42369,46090,49934,54159
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,62503 ; Squarefree numbers squared.
add $1,$2
lpe
mov $0,$1
| 31.230769
| 202
| 0.724138
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.