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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fa73251b9382e95acb20b7f4d7f1736b5d286ca3 | 290 | asm | Assembly | programs/oeis/035/A035017.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/035/A035017.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/035/A035017.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A035017: One quarter of 9-factorial numbers.
; 1,13,286,8866,354640,17377360,1007886880,67528420960,5132159992960,436233599401600,41005958343750400,4223613709406291200,473044735453504614400,57238412989874058342400
mov $1,1
mov $2,4
lpb $0
sub $0,1
add $2,9
mul $1,$2
lpe
mov $0,$1
| 24.166667 | 168 | 0.77931 |
d5a5f3f481eb2290049e9e60d040f83c9cf61fa3 | 320 | asm | Assembly | programs/oeis/040/A040563.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/040/A040563.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/040/A040563.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A040563: Continued fraction for sqrt(588).
; 24,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48,4,48
sub $0,1
mod $0,2
mul $0,11
add $0,2
pow $0,2
mov $1,$0
div $1,15
mul $1,4
add $1,4
| 24.615385 | 189 | 0.60625 |
5ba869b15393f1edc337edad1eef4effb7c935f0 | 460 | asm | Assembly | oeis/249/A249998.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/249/A249998.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/249/A249998.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A249998: Expansion of 1/((1+x)*(1+3*x)*(1-4*x)).
; Submitted by Jon Maiga
; 1,0,13,12,169,312,2341,6084,34177,107184,517309,1803516,8011225,29653416,125788117,481629108,1991086513,7770635808,31663673965,124911303660,504875391241,2003811035160,8062315730053,32108048151972,128855836912609,514152414736272,2060422457687581
add $0,1
lpb $0
sub $0,1
add $2,$4
mov $1,$2
mul $1,12
mov $2,$4
mov $4,1
sub $4,$2
add $4,$3
add $3,$1
lpe
mov $0,$4
| 25.555556 | 246 | 0.71087 |
4694ead4c473da18ac4d0bf70bfb3e308c8a0933 | 2,700 | asm | Assembly | asm/indicator_x_lut.asm | HowyoungZhou/cyber-melody-2 | b96fff16f4bc57b47867389f8d6dc297fae58387 | [
"MIT"
] | null | null | null | asm/indicator_x_lut.asm | HowyoungZhou/cyber-melody-2 | b96fff16f4bc57b47867389f8d6dc297fae58387 | [
"MIT"
] | null | null | null | asm/indicator_x_lut.asm | HowyoungZhou/cyber-melody-2 | b96fff16f4bc57b47867389f8d6dc297fae58387 | [
"MIT"
] | null | null | null | .word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x20
.word 0x74
.word 0xc8
.word 0x11c
.word 0x170
.word 0x1c4
.word 0x218
.word 0x26c
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x26
.word 0x7a
.word 0xce
.word 0x122
.word 0x176
.word 0x1ca
.word 0x21e
.word 0x272
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x2c
.word 0x80
.word 0xd4
.word 0x128
.word 0x17c
.word 0x1d0
.word 0x224
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x32
.word 0x86
.word 0xda
.word 0x12e
.word 0x182
.word 0x1d6
.word 0x22a
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x38
.word 0x8c
.word 0xe0
.word 0x134
.word 0x188
.word 0x1dc
.word 0x230
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x44
.word 0x98
.word 0xec
.word 0x140
.word 0x194
.word 0x1e8
.word 0x23c
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x4a
.word 0x9e
.word 0xf2
.word 0x146
.word 0x19a
.word 0x1ee
.word 0x242
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x50
.word 0xa4
.word 0xf8
.word 0x14c
.word 0x1a0
.word 0x1f4
.word 0x248
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x56
.word 0xaa
.word 0xfe
.word 0x152
.word 0x1a6
.word 0x1fa
.word 0x24e
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x8
.word 0x5c
.word 0xb0
.word 0x104
.word 0x158
.word 0x1ac
.word 0x200
.word 0x254
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0xe
.word 0x62
.word 0xb6
.word 0x10a
.word 0x15e
.word 0x1b2
.word 0x206
.word 0x25a
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x14
.word 0x68
.word 0xbc
.word 0x110
.word 0x164
.word 0x1b8
.word 0x20c
.word 0x260
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
.word 0x0
| 10.505837 | 11 | 0.715556 |
7eab257ec9a75e7668c917929d034007ee876f5e | 294 | asm | Assembly | data/mapHeaders/RocketHideoutB3F.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | data/mapHeaders/RocketHideoutB3F.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | data/mapHeaders/RocketHideoutB3F.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | RocketHideoutB3F_h:
db FACILITY ; tileset
db ROCKET_HIDEOUT_B3F_HEIGHT, ROCKET_HIDEOUT_B3F_WIDTH ; dimensions (y, x)
dw RocketHideoutB3F_Blocks ; blocks
dw RocketHideoutB3F_TextPointers ; texts
dw RocketHideoutB3F_Script ; scripts
db 0 ; connections
dw RocketHideoutB3F_Object ; objects
| 32.666667 | 75 | 0.826531 |
b82ddfea1f5fff4e697eb352b6aa2dbf944794a9 | 2,921 | asm | Assembly | programs/oeis/017/A017099.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017099.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017099.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017099: a(n) = (8*n + 2)^11.
; 2048,100000000000,64268410079232,3670344486987776,70188843638032384,717368321110468608,4882812500000000000,24986644000165537792,103510234140112521216,364375289404334925824,1127073856954876807168,3138105960900000000000,8007313507497959524352,18982985583354248390656,42262322980951656843264,89116503268220597577728,179216039403700000000000,345676575099245416998912,642512252044000682756096,1155388203804953497544704,2016810807672035804940288,3427189630763300000000000,5683554455074796217321472,9218120615459689670977536,14649372735243886851590144,22848887739705683048654848,35027750054222100000000000,52847132780654751438252032,78558436364536056991614976,115179299131727923510339584,166712830744247830760081408,238418579101562500000000000,337145032839390594819950592,471734895039369510442428416,653515949089146258317953024,896892085195750456196179968,1220050976570582900000000000,1645806998829973233948977152,2202600286091874661776377856,2925675324340604967987390464,3858465208964226558463510528,5054210651372681700000000000,6577846022051543255362291712,8508188177411469292077623296,10940467548815308008476411904,13989244988004316189622233088,17791762177946041300000000000,22511778046375868461571254272,28343948575831725778577524736,35518812703959534278923577344,44308452666811124371870107648,55032903171624844100000000000,68067390210373163218005624832,83850487157725321590910642176,102893283053893453600144246784,125789665671337497908806494208,153227830122070312500000000000,186003132397245379497877563392,225032416361083806744810735616,271369952365606399975686580224,326225135830024659938776352768,390982104858298804900000000000,467221447269921365272965629952,556744179312404460981246765056,661598190829553353623447537664,784107364798056947318294243328,926903592937219159700000000000,1092961923564137946058318784512,1285639093030998565918998890496,1508715707964414645985848879104,1766442362151297812563548325888,2063589989304280119300000000000,2405504771115312043978880387072,2798167938992114215508674471936,3248260827692417886246573164544,3763235559749474995117984360448,4351391761143583866100000000000,5021959731143134429686032197632,5785190512640043499796164069376,6652453333663885125801859753984,7636340916102325292153969707008,8750783174008789062500000000000,10011169851268109349812058376192,11434482676844060410283537442816,13039437645376339360654360807424,14846638061556241842956537325568,16878739018517842626900000000000,19160624013463140550410529482752,21719594437923904738055379552256,24585572715478753372817557284864,27791319896420538179177209776128,31372668556835970837700000000000,35368771888846528308990606477312,39822369909397271896318566557696,44780073756998912102538734946304,50292669089259193101885903218688,56415439638913744997300000000000,63208512032415589898313264719872,70737223022998463045083481819136,79072510339524339415468520351744
mul $0,8
add $0,2
pow $0,11
| 417.285714 | 2,859 | 0.954468 |
8b454f6f7b6770d0bc544288561272bbaefd4734 | 439 | asm | Assembly | oeis/077/A077841.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/077/A077841.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/077/A077841.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A077841: Expansion of (1-x)/(1-2*x-3*x^2-2*x^3).
; Submitted by Jon Maiga
; 1,1,5,15,47,149,469,1479,4663,14701,46349,146127,460703,1452485,4579333,14437527,45518023,143507293,452443709,1426445343,4497236399,14178696245,44701992373,140934546279,444332462167,1400872547917,4416611574893,13924505717871
lpb $0
sub $0,1
add $1,$4
add $2,$1
add $3,1
add $4,$3
add $1,$4
mov $4,$3
mov $3,$2
mul $3,2
lpe
mov $0,$3
add $0,1
| 24.388889 | 226 | 0.699317 |
caba163632c0845ac65e9f416a4136285833f114 | 954 | asm | Assembly | examples/asm-64/factorial.asm | patrickf2000/upl | a58e3fd3f185e52d40332d4e7473ff7de8245f04 | [
"BSD-3-Clause"
] | null | null | null | examples/asm-64/factorial.asm | patrickf2000/upl | a58e3fd3f185e52d40332d4e7473ff7de8245f04 | [
"BSD-3-Clause"
] | 6 | 2019-06-15T12:38:26.000Z | 2019-06-15T13:03:05.000Z | examples/asm-64/factorial.asm | patrickf2000/upl | a58e3fd3f185e52d40332d4e7473ff7de8245f04 | [
"BSD-3-Clause"
] | null | null | null | .intel_syntax noprefix
.data
STR_1: .string "Enter a number:"
STR_2: .string ""
STR_3: .string "The factorial is:"
.bss
.text
.extern puts
.extern printf
.extern exit
.extern fflush
.extern input_int
.extern print_int
.global factorial
.global main
factorial:
push rbp
mov rbp, rsp
sub rsp, 48
mov eax, edi
mov [rbp-8], eax
mov DWORD PTR [rbp-16], 1
jmp L2
L1:
mov eax, [rbp-16]
imul eax, [rbp-8]
mov DWORD PTR[rbp-16], eax
mov eax, [rbp-8]
sub eax, 1
mov DWORD PTR[rbp-8], eax
L2:
mov eax, [rbp-8]
cmp eax, 1
jne L1
mov eax, [rbp-16]
leave
ret
main:
push rbp
mov rbp, rsp
sub rsp, 48
mov edi, OFFSET FLAT:STR_1
call puts
call input_int
mov DWORD PTR [rbp-8], eax
mov eax, [rbp-8]
mov edi, eax
call factorial
mov DWORD PTR [rbp-12], eax
mov edi, OFFSET FLAT:STR_2
call puts
mov edi, OFFSET FLAT:STR_3
call puts
mov eax, [rbp-12]
mov edi, eax
call print_int
leave
ret
| 12.075949 | 35 | 0.651992 |
f6dc4fdadddc867d60d4f7fe86083cc284576b33 | 5,992 | asm | Assembly | source/main/commands/structures/for.asm | paulscottrobson/6502-basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | 3 | 2021-09-30T19:34:11.000Z | 2021-10-31T06:55:50.000Z | source/main/commands/structures/for.asm | paulscottrobson/6502-Basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | null | null | null | source/main/commands/structures/for.asm | paulscottrobson/6502-Basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | 1 | 2021-12-07T21:58:44.000Z | 2021-12-07T21:58:44.000Z | ; *****************************************************************************
; *****************************************************************************
;
; Name: for.asm
; Author: Paul Robson (paul@robsons.org.uk)
; Date: 1st March 2021
; Reviewed: 8th March 2021
; Purpose: For/Next
;
; *****************************************************************************
; *****************************************************************************
; *****************************************************************************
; For/Next usage.
; *****************************************************************************
;
; +7..+10 Terminal value
; +6 Step (-128..127 maximum)
; +4..+5 Address of index.
; +1..+3 Loop position (end of the command)
; +0 Marker (consumes 11 bytes)
;
; *****************************************************************************
.section code
; *****************************************************************************
;
; FOR Command
;
; *****************************************************************************
Command_FOR: ;; [for]
lda #markerFOR ; allocate the space and set the marker
ldx #11
jsr RSClaim
jsr CommandLET ; do the same as LET FOR [a = 4]
;
lda esType ; check type should be integer reference.
cmp #$80 ; we do not do FOR floats.
bne _CFType
;
lda #TKW_TO ; check TO present.
jsr CheckToken
;
ldx #1 ; keep the variable address in stack 0
jsr EvaluateInteger ; get terminal value in stack 1
;
; Set up the FOR stack frame.
;
.pshy ; copy things into the area with the default STEP
ldy #4
lda esInt0 ; copy the address of the index variable into 4 and 5
sta (rsPointer),y
iny
lda esInt1
sta (rsPointer),y
iny
;
lda #1 ; the default step in 6, (-128 .. 127 only)
sta (rsPointer),y
iny
;
lda esInt0+1 ; terminal value in 7 to 11.
sta (rsPointer),y
iny
lda esInt1+1
sta (rsPointer),y
iny
lda esInt2+1
sta (rsPointer),y
iny
lda esInt3+1
sta (rsPointer),y
.puly
;
; Check for STEP
;
lda (codePtr),y ; followed by STEP.
cmp #TKW_STEP
bne _CFDone
;
; Calculate STEP
;
iny ; skip over step.
jsr EvaluateInteger ; get step
.pshy
lda esInt0,x ; copy it into step (bit lazy here)
ldy #6
sta (rsPointer),y
.puly
_CFDone:
lda #1
jsr RSSavePosition ; save position.
rts
_CFType:
.throw BadType
; *****************************************************************************
;
; NEXT Command
;
; *****************************************************************************
Command_NEXT: ;; [next]
rscheck markerFOR,nextErr ; check TOS is a FOR
lda (codePtr),y ; is it NEXT <index>
cmp #$40 ; e.g. a variable follows 00-3F
bcs _CNNoIndex
;
; Check NEXT <something> is right.
;
ldx #0 ; start on stack
jsr EvaluateReference ; this is the variable/parameter to localise.
;
.pshy
ldy #4 ; check same variable as that stored at +4,+5
lda (rsPointer),y
cmp esInt0,x
bne _CNBadIndex
iny
lda (rsPointer),y
cmp esInt1,x
bne _CNBadIndex
.puly
;
; Main NEXT code.
;
_CNNoIndex:
.pshy ; don't need this for the rest of the instruction.
;
; Adjust the variable by the STEP
;
ldy #4 ; make temp0 point to the index
lda (rsPointer),y
sta temp0
iny
lda (rsPointer),y
sta temp0+1
;
iny
ldx #0 ; X is the sign extend part of the step.
lda (rsPointer),y ; get the step.
sta temp2+1 ; save for later.
bpl _CNSignX
dex ; X = $FF
_CNSignX:
clc ; add to the LSB
ldy #0
adc (temp0),y
sta (temp0),y
_CNPropogate:
iny ; add the sign extended in X to the rest.
txa
adc (temp0),y
sta (temp0),y
iny
txa
adc (temp0),y
sta (temp0),y
iny
txa
adc (temp0),y
sta (temp0),y
;
; Do the terminal value check.
;
clc ; point temp1 to the terminal value stored in the stack.
lda rsPointer
adc #7
sta temp1
lda #0
sta temp2 ; clear temp2, which is the OR of all the subtractions.
tay ; and clear the Y register again.
adc rsPointer+1
sta temp1+1
;
sec ; calculate current - limit oring interim values.
jsr _CNCompare ; each of these does a byte.
jsr _CNCompare ; we calculate the OR of all these subtractions.
jsr _CNCompare ; and the carry of the subtraction.
jsr _CNCompare
;
; At this point temp2 zero if the same, and CS if current >= limit.
;
bvc _CNNoOverflow ; converts to a signed comparison on the sign bit.
eor #$80
_CNNoOverflow:
ldy temp2+1 ; get step back
bmi _CNCheckDownto
;
; Test for positive steps
;
cmp #0
bmi _CNLoopRound ; loop round if < =
lda temp2
beq _CNLoopRound
;
; Exit the loop as complete
;
_CNLoopExit:
.puly
lda #11
jsr RSFree
rts
;
; Loop back
;
_CNLoopRound:
.puly
lda #1
jsr RSLoadPosition ; go back to the loop top
rts
_CNBadIndex:
.throw BadIndex
;
; Test for negative steps
;
_CNCheckDownto:
cmp #0
bpl _CNLoopRound
jmp _CNLoopExit
_CNCompare:
lda (temp0),y ; do the subtraction - compare don't care about answer
sbc (temp1),y
ora temp2 ; Or into temp2 (does not affect carry)
sta temp2
iny
rts
.send code
; ************************************************************************************************
;
; Changes and Updates
;
; ************************************************************************************************
;
; Date Notes
; ==== =====
; 07-Mar-21 Pre code read v0.01
;
; ************************************************************************************************
| 23.968 | 98 | 0.474299 |
0035a4a8801d0f4f5c171598078298ebd1510cf5 | 694 | asm | Assembly | oeis/021/A021229.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021229.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021229.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021229: Expansion of 1/((1-x)(1-2x)(1-7x)(1-9x)).
; Submitted by Jon Maiga
; 1,19,248,2786,28983,288273,2786566,26424112,247232645,2291004287,21080414004,192953358078,1759187655187,15990940940461,145026232803362,1312990445670284,11871194464243809,107220713350935195,967646162368127440,8727433656782170330,78677230279324793711,709007364091924162889,6387452317873332991038,57531773148182122371816,518098874344894013068093,4665080281182830566773943,42001055415196966379310956,378116828928633136630652342,3403802771700721304730718155,30639484124707653269034134757
add $0,2
lpb $0
sub $0,1
add $2,2
mul $2,7
sub $2,11
mul $3,9
add $3,$1
mul $1,2
add $1,$2
lpe
mov $0,$3
div $0,3
| 38.555556 | 484 | 0.814121 |
7d30b8adef975bb92425f38168e3bbf1945f84eb | 395 | asm | Assembly | oeis/349/A349707.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/349/A349707.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/349/A349707.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A349707: Numbers that are congruent to {0, 1, 4, 6, 8, 10, 11} (mod 12).
; Submitted by Simon Strandgaard
; 0,1,4,6,8,10,11,12,13,16,18,20,22,23,24,25,28,30,32,34,35,36,37,40,42,44,46,47,48,49,52,54,56,58,59,60,61,64,66,68,70,71,72,73,76,78,80,82,83,84,85,88,90,92,94,95,96,97,100,102,104,106,107,108,109
mov $1,$0
sub $1,1
lpb $1
add $0,1
add $0,$1
trn $1,4
sub $0,$1
trn $1,3
lpe
| 28.214286 | 198 | 0.625316 |
d15f7c290021c768306d4554b3e303e686d5476a | 12 | asm | Assembly | Tests/Test1/1.asm | 5ayam5/COL216-A5 | 9d34e672c20f84a1d5e324a0e57edc1ba14518a0 | [
"MIT"
] | null | null | null | Tests/Test1/1.asm | 5ayam5/COL216-A5 | 9d34e672c20f84a1d5e324a0e57edc1ba14518a0 | [
"MIT"
] | null | null | null | Tests/Test1/1.asm | 5ayam5/COL216-A5 | 9d34e672c20f84a1d5e324a0e57edc1ba14518a0 | [
"MIT"
] | null | null | null | lw $t0, 100
| 6 | 11 | 0.583333 |
43d6f318ba058c3f11ec88bae622e35038918da9 | 1,952 | asm | Assembly | atlatl/zstr.asm | richRemer/atlatl | 169c0c9c29d277dc1295e6c37b0963af6e02741a | [
"MIT"
] | null | null | null | atlatl/zstr.asm | richRemer/atlatl | 169c0c9c29d277dc1295e6c37b0963af6e02741a | [
"MIT"
] | null | null | null | atlatl/zstr.asm | richRemer/atlatl | 169c0c9c29d277dc1295e6c37b0963af6e02741a | [
"MIT"
] | null | null | null | global zstr.len
global zstr.lenq
global zstr.eachq
%include "util.inc"
section .text
; zstr.len(RAX) => RAX
; calculate length of null-terminated string
zstr.len: ; zstr.len(ptr) => length
prsv rcx, rdi ; preserve
mov rdi, rax ; beginning of scan
mov al, 0 ; scan for NULL
mov rcx, 0xffffffff ; limit scan to 2GiB
repne scasb ; scan (RCX = limit-1-length)
mov rax, 0xfffffffe ; limit - 1
sub rax, rcx ; length
rstr rcx, rdi ; restore
ret
; zstr.lenq(RAX) => RAX
; calculate length of null-terminated string of QWords
zstr.lenq: ; zstr.lenq(ptr) => length
prsv rcx, rdi ; preserve
mov rdi, rax ; beginning of scan
mov rax, 0 ; scan for NULL
mov rcx, 0x1fffffff ; limit scan to 2GiB
repne scasq ; scan (RCX = limit-1-length)
mov rax, 0x1ffffffe ; limit - 1
sub rax, rcx ; length
rstr rcx, rdi ; restore
ret
; zstr.eachq(RAX, RBX)
; call subroutine for values in null-terminated string of QWords
zstr.eachq: ; zstr.eachq(ptr, fn)
push rcx ; preserve
push rax ; save address
call zstr.lenq ; calculate length
lea rcx, [rax+1] ; length + 1
pop rax ; restore address of first value
.invoke:
dec rcx ; decrement counter
jz .exit ; break on counter reaching 0
push rax ; preserve
push rbx ; preserve
mov rax, [rax] ; current value
call rbx ; invoke callback
pop rbx ; restore
pop rax ; restore
add rax, 8 ; adjust to next pointer
jmp .invoke ; loop
.exit:
pop rcx ; restore
ret
| 30.5 | 64 | 0.507684 |
2a67a41682088289fd54124408569776dade1fe8 | 458 | asm | Assembly | Ficheiros assembly (TP's e Testes)/viewer/afunc5.asm | pemesteves/mpcp-1718 | a0255feb961fc6cb33f1dae60bf0bfa19ade081d | [
"MIT"
] | null | null | null | Ficheiros assembly (TP's e Testes)/viewer/afunc5.asm | pemesteves/mpcp-1718 | a0255feb961fc6cb33f1dae60bf0bfa19ade081d | [
"MIT"
] | null | null | null | Ficheiros assembly (TP's e Testes)/viewer/afunc5.asm | pemesteves/mpcp-1718 | a0255feb961fc6cb33f1dae60bf0bfa19ade081d | [
"MIT"
] | null | null | null | ;; Funcao 5 em linguagem assembly
;; Valor de retorno: nenhum
.686
.model flat, C
.data
linha DWORD 20
coluna DWORD 20
.code
afunc5 PROC USES edi pixels: ptr byte, largura: sdword, altura:sdword
;; preencher com a funcionalidade pretendido
mov eax, linha
sub eax, 1
mul largura
add eax, coluna
mov edi, pixels
sal eax, 2
add edi, eax
mov byte ptr [edi], 0
mov byte ptr [edi+1], 0
mov byte ptr [edi+2], 255
fim:
ret
afunc5 ENDP
END | 13.470588 | 69 | 0.69214 |
0026b859bf8d7292d7a4f74a2e80f842d3fac559 | 719 | asm | Assembly | programs/oeis/258/A258059.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/258/A258059.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/258/A258059.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A258059: Let n = Sum_{i=0..k} d_i*4^i be the base-4 expansion of n, with 0 <= d_i < 4. Then a(n) = minimal i such that d_i is not 1, or k+1 if there is no such i.
; 1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0
mul $0,3
add $0,4
lpb $0
dif $0,4
add $1,1
lpe
| 71.9 | 501 | 0.531293 |
0f110637c3bc018fbf78cfb19631339b613f539b | 2,978 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_210_1587.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_210_1587.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_210_1587.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1e974, %rsi
lea addresses_normal_ht+0x58c2, %rdi
clflush (%rsi)
nop
nop
nop
dec %rax
mov $79, %rcx
rep movsb
nop
nop
nop
add %rsi, %rsi
lea addresses_UC_ht+0x55b6, %rdi
nop
nop
nop
cmp $22408, %rcx
movb (%rdi), %r9b
nop
nop
nop
inc %rcx
lea addresses_normal_ht+0x5592, %rcx
nop
nop
nop
dec %r9
vmovups (%rcx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rax
nop
nop
nop
nop
xor $63994, %r9
lea addresses_UC_ht+0x15ef8, %r14
sub %r8, %r8
movw $0x6162, (%r14)
nop
inc %r14
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r9
push %rbp
push %rcx
push %rsi
// Store
lea addresses_PSE+0x13b62, %r14
sub $1104, %r15
movw $0x5152, (%r14)
nop
nop
nop
and $39878, %r14
// Store
mov $0xd62, %r10
nop
nop
sub %rbp, %rbp
movl $0x51525354, (%r10)
nop
sub %r15, %r15
// Faulty Load
lea addresses_WT+0x5162, %r14
nop
nop
nop
nop
inc %rsi
movups (%r14), %xmm6
vpextrq $0, %xmm6, %r15
lea oracles, %r9
and $0xff, %r15
shlq $12, %r15
mov (%r9,%r15,1), %r15
pop %rsi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'39': 210}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 23.634921 | 629 | 0.649765 |
d81b1ca2eeb1650aeac77f719c1a6cc422138a2f | 766 | asm | Assembly | programs/oeis/296/A296079.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/296/A296079.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/296/A296079.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A296079: a(n) = 1 if 1+phi(n) is prime, 0 otherwise, where phi = A000010, Euler totient function.
; 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,1,1,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,0,1,0,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,0,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,1,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,0,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,0,1,1,0,1,0,0,1,0,1,1,1,0,0,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,0,1,0,0,0,0,0,0,1
cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
mov $1,$0
| 109.428571 | 501 | 0.565274 |
db305ec218e5f0be25ec439a7949a855e8cb20b7 | 1,334 | asm | Assembly | boot/i386/stage1.asm | wordandahalf/Stelox | 814852684dece8c4bd4d406973b72255fd043332 | [
"MIT"
] | 5 | 2020-11-19T00:50:42.000Z | 2022-01-05T22:18:44.000Z | boot/i386/stage1.asm | wordandahalf/Stelox | 814852684dece8c4bd4d406973b72255fd043332 | [
"MIT"
] | 1 | 2019-09-30T02:59:40.000Z | 2019-09-30T03:16:30.000Z | boot/i386/stage1.asm | wordandahalf/Stelox | 814852684dece8c4bd4d406973b72255fd043332 | [
"MIT"
] | 1 | 2021-05-23T08:12:21.000Z | 2021-05-23T08:12:21.000Z | BITS 16
jmp stage1
%include "bios.inc"
%include "a20.inc"
%include "gdt.inc"
loading_message db "Loading...", 0xD, 0xA, 0x0
error_message db "Unrecoverable error, please try restarting...", 0xD, 0xA, 0x0
global stage1
stage1:
mov si, loading_message
call print_string
call get_memory_map
call enable_a20
cmp ax, 0x1 ; The sub enable_a20 sets ax to 1 iff it successfully enabled the A20
je enter_protected_mode
mov si, error_message
call print_string
cli
hlt
enter_protected_mode:
cli
xor eax, eax
mov ds, ax ; The GDT is located at DS:gdtp
lgdt [gdtp]
mov eax, cr0
or al, 0x1 ; Set the protected mode bit of the control register
mov cr0, eax
jmp 0x08:protected_mode_main ; The GDT's code descriptor is 8 bytes from the offset
hlt
BITS 32
extern loader_main
protected_mode_main:
mov ax, 0x10 ; The GDT's data descriptor is 16 bytes from the offset
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov esp, 0x90000
jmp loader_main ; Jump to the C loader
hang:
jmp hang | 22.610169 | 109 | 0.562969 |
dd94c62ad417f0670c52b27cdc09adfa2518e42e | 858 | asm | Assembly | programs/oeis/215/A215097.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/215/A215097.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/215/A215097.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A215097: a(n) = n^3 - a(n-2) for n >= 2 and a(0)=0, a(1)=1.
; 0,1,8,26,56,99,160,244,352,485,648,846,1080,1351,1664,2024,2432,2889,3400,3970,4600,5291,6048,6876,7776,8749,9800,10934,12152,13455,14848,16336,17920,19601,21384,23274,25272,27379,29600,31940,34400,36981,39688,42526
mov $15,$0
mov $17,$0
lpb $17
clr $0,15
mov $0,$15
sub $17,1
sub $0,$17
mov $12,$0
mov $14,$0
lpb $14
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
lpb $11
mov $0,$9
sub $11,1
sub $0,$11
mul $0,2
mov $6,7
add $6,$0
lpb $0
mod $0,2
pow $6,2
mov $8,5
mul $8,$6
mov $1,$8
div $1,2
mod $1,8
mul $1,4
lpe
div $1,4
sub $1,1
add $10,$1
lpe
add $13,$10
lpe
add $16,$13
lpe
mov $1,$16
| 18.652174 | 217 | 0.491841 |
f33435ebef09227e01471ad81ca3f31a6a5a0f71 | 592 | asm | Assembly | oeis/305/A305153.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/305/A305153.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/305/A305153.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A305153: a(n) = 30*2^n + 12.
; 42,72,132,252,492,972,1932,3852,7692,15372,30732,61452,122892,245772,491532,983052,1966092,3932172,7864332,15728652,31457292,62914572,125829132,251658252,503316492,1006632972,2013265932,4026531852,8053063692,16106127372,32212254732,64424509452,128849018892,257698037772,515396075532,1030792151052,2061584302092,4123168604172,8246337208332,16492674416652,32985348833292,65970697666572,131941395333132,263882790666252,527765581332492,1055531162664972,2111062325329932,4222124650659852,8444249301319692
mov $1,2
pow $1,$0
sub $1,1
mul $1,30
add $1,42
mov $0,$1
| 59.2 | 501 | 0.841216 |
44a0c9670baf84eb66b962e99efbc0359c1d07ea | 2,253 | asm | Assembly | asm/giepy/shooter.asm | boldowa/GIEPY | 5aa326b264ef19f71d2e0ab5513b08fac7bca941 | [
"MIT"
] | 8 | 2018-03-15T22:01:35.000Z | 2019-07-13T18:04:41.000Z | asm/giepy/shooter.asm | telinc1/GIEPY | 9c87ad1070e519637fc4b11b6bef01f998961678 | [
"MIT"
] | 21 | 2018-02-18T06:25:40.000Z | 2018-07-13T17:54:40.000Z | asm/giepy/shooter.asm | telinc1/GIEPY | 9c87ad1070e519637fc4b11b6bef01f998961678 | [
"MIT"
] | 2 | 2018-07-25T21:04:23.000Z | 2022-01-01T08:40:13.000Z | @include
;-------------------------------------------------------------------------------
; GIEPY Shooter code
;-------------------------------------------------------------------------------
pushpc
%org_assert_long2($02aba3, 839d,c8e9)
jsl SetShooterExBits
nop
if !true == !EXTRA_BYTES_EXT
if !sa1
%org_assert_long2($02abeb, 5c02,a6c8)
else
%org_assert_long2($02abeb, e802,a6c8)
endif
jsl LoadShooterExByte
endif
%org_assert_long2($02b39e, abde,0390)
jml ShooterHijack
pullpc
;-------------------------------------------------
; Set shooter extra bits for origin shooter
; this code work original shooter only.
; When use custom shooter, this routine will
; be not execute.
;-------------------------------------------------
SetShooterExBits:
sbc.b #$c8
sta.w !1783,x
if !EXTRA_BYTES_EXT
lda.b #0
sta.l !extra_byte_sh,x
endif
lda.b $07
sta.l !extra_bits_sh,x
rtl
;-------------------------------------------------
; Load Shooter's Extra byte
;-------------------------------------------------
if !true == !EXTRA_BYTES_EXT
LoadShooterExByte:
%putdebug("LoadShooterExByte")
jsr LoadExBytesSub
beq + ;\ Load extra bytes.
- lda.b [$ce],y ; | if extra bytes size greater than 4,
sta.l !extra_byte_sh,x ; | extra byte will overwrite by
iny ; | latest extra byte value.
dec $04 ; |
bne - ;/
+ ldx.b $02
inx
rtl
endif
;-------------------------------------------------
; Shooter Hijack
;-------------------------------------------------
ShooterHijack:
%putdebug("ShooterHijack")
bcc +
dec !17ab,x
+ lda.l !extra_bits_sh,x ; C---EE-- : C=custom, EE=sprite grp
bmi .isCustom
pla
jml $02b3a4|!bankB ; SMW original shooter
.isCustom
%putdebug("Custom Shooter")
;--- Set args for CallSpriteFunction
and.b #$0c ;\ Y <- Extra bits
tay ;/
lda.b #(ShooterTablePtr>>16) ;\
sta.b $0b ; | $00-$02 <- Shooter ptr group adddress
rep #$20 ; |
lda.w #(ShooterTablePtr&$ffff) ; |
sta.b $09 ;/
sep #$20
pla ; Sprite number.
dec
;--- Call shooter main routine
xba
lda.b #(($020000|!bankB)>>16) ;\ rtl bank
pha ;/
xba
pea $b3a6 ; rtl return address
jmp CallSpriteFunction
| 24.48913 | 81 | 0.506436 |
7e551b183bf5fcc89f7d7ac89d92595e99d7d7f8 | 3,741 | asm | Assembly | Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xca_notsx.log_128_1281.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xca_notsx.log_128_1281.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xca_notsx.log_128_1281.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 %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xdcbf, %rsi
lea addresses_A_ht+0x3bef, %rdi
clflush (%rdi)
nop
nop
add %r9, %r9
mov $50, %rcx
rep movsl
nop
inc %rbp
lea addresses_WC_ht+0x1a49f, %rsi
lea addresses_D_ht+0x291b, %rdi
sub %r13, %r13
mov $10, %rcx
rep movsl
nop
nop
nop
nop
add %rbp, %rbp
lea addresses_WC_ht+0x30ff, %rcx
nop
nop
nop
nop
add $8726, %rdi
mov (%rcx), %r9d
nop
nop
nop
nop
nop
dec %rbp
lea addresses_normal_ht+0x1c0ff, %rsi
lea addresses_D_ht+0x1c0ff, %rdi
nop
nop
cmp %r10, %r10
mov $90, %rcx
rep movsq
nop
nop
nop
nop
nop
xor $43637, %rbp
lea addresses_UC_ht+0xa0ff, %rcx
add $26841, %rbp
vmovups (%rcx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r10
nop
nop
nop
add %r9, %r9
lea addresses_WC_ht+0x8cbf, %rsi
lea addresses_WC_ht+0x1d07f, %rdi
nop
nop
nop
nop
sub %rbx, %rbx
mov $13, %rcx
rep movsw
cmp %rdi, %rdi
lea addresses_A_ht+0x1acef, %rsi
lea addresses_normal_ht+0x529f, %rdi
nop
nop
sub $54903, %rbp
mov $18, %rcx
rep movsq
nop
nop
nop
add %rbx, %rbx
lea addresses_A_ht+0x1b0ff, %r9
clflush (%r9)
nop
nop
nop
cmp %rcx, %rcx
and $0xffffffffffffffc0, %r9
movntdqa (%r9), %xmm6
vpextrq $0, %xmm6, %r13
nop
nop
nop
nop
inc %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %rbp
push %rdi
push %rdx
push %rsi
// Store
lea addresses_PSE+0x53f, %rsi
and %rdi, %rdi
movl $0x51525354, (%rsi)
sub %rsi, %rsi
// Faulty Load
mov $0x8ff, %r11
nop
nop
nop
nop
nop
and $31340, %r12
movups (%r11), %xmm4
vpextrq $0, %xmm4, %rdx
lea oracles, %r11
and $0xff, %rdx
shlq $12, %rdx
mov (%r11,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rbp
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 4, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 10}}
{'00': 128}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 22.401198 | 383 | 0.654638 |
825f8122b5da877841341c22b7466f6921538aa3 | 3,615 | asm | Assembly | src/sound/song336restored.asm | MusicTheorist/Mother2GbaTranslation | 70de3975a3284c4002a33e8ef8c20e4c2b039037 | [
"MIT"
] | 1 | 2021-04-18T04:26:52.000Z | 2021-04-18T04:26:52.000Z | src/sound/song336restored.asm | MusicTheorist/Mother2GbaTranslation | 70de3975a3284c4002a33e8ef8c20e4c2b039037 | [
"MIT"
] | null | null | null | src/sound/song336restored.asm | MusicTheorist/Mother2GbaTranslation | 70de3975a3284c4002a33e8ef8c20e4c2b039037 | [
"MIT"
] | null | null | null |
song336restored_pri equ 100
song336restored_rev equ 0
song336restored_mvl equ 127
song336restored_key equ 0
song336restored_tbs equ 1
song336restored_exg equ 0
song336restored_cmp equ 1
.align 4
;**************** Track 1 (Midi-Chn.7) ****************;
@song336restored_1:
.byte KEYSH , song336restored_key+0
; 000 ----------------------------------------
.byte VOICE , 8
.byte MODT , 0
.byte LFOS , 44
.byte PAN , c_v-64
.byte VOL , 0*song336restored_mvl/mxv
.byte BENDR , 12
.byte 12
.byte 12
.byte BEND , c_v-1
.byte W07
.byte VOL , 24*song336restored_mvl/mxv
.byte PAN , c_v-64
.byte BEND , c_v-1
.byte N02 , Cs3 , v088
.byte W04
.byte Gs3
.byte W03
.byte VOL , 44*song336restored_mvl/mxv
.byte W01
.byte N02 , As3
.byte W04
.byte Cn4
.byte W03
.byte VOL , 31*song336restored_mvl/mxv
.byte W01
.byte N02 , Cs3
.byte W04
.byte Gs3
.byte W03
.byte VOL , 24*song336restored_mvl/mxv
.byte W01
.byte N02 , As3
.byte W04
.byte Cn4
.byte W03
.byte VOL , 0*song336restored_mvl/mxv
.byte W01
.byte N02 , Cs3
.byte W04
.byte Gs3
.byte W04
.byte As3
.byte W04
.byte Cn4
.byte W44
.byte W01
; 001 ----------------------------------------
.byte W92
.byte W03
.byte VOICE , 8
.byte W01
; 002 ----------------------------------------
.byte 8
.byte BENDR , 12
.byte 12
.byte BEND , c_v-1
.byte FINE
;**************** Track 2 (Midi-Chn.8) ****************;
@song336restored_2:
.byte KEYSH , song336restored_key+0
; 000 ----------------------------------------
.byte VOICE , 8
.byte MODT , 0
.byte LFOS , 44
.byte PAN , c_v+0
.byte VOL , 100*song336restored_mvl/mxv
.byte BENDR , 12
.byte PAN , c_v+0
.byte VOL , 100*song336restored_mvl/mxv
.byte 100*song336restored_mvl/mxv
.byte PAN , c_v+0
.byte BENDR , 12
.byte PAN , c_v+0
.byte VOL , 100*song336restored_mvl/mxv
.byte 100*song336restored_mvl/mxv
.byte PAN , c_v+0
.byte BENDR , 12
.byte PAN , c_v+0
.byte VOL , 100*song336restored_mvl/mxv
.byte BEND , c_v+0
.byte N02 , Cs3 , v088
.byte W04
.byte Gs3
.byte W03
.byte VOL , 85*song336restored_mvl/mxv
.byte W01
.byte N02 , As3
.byte W04
.byte Cn4
.byte W03
.byte VOL , 65*song336restored_mvl/mxv
.byte W01
.byte N02 , Cs3
.byte W04
.byte Gs3
.byte W04
.byte As3
.byte W04
.byte Cn4
.byte W03
.byte VOL , 59*song336restored_mvl/mxv
.byte W01
.byte N02 , Cs3
.byte W04
.byte Gs3
.byte W03
.byte VOL , 24*song336restored_mvl/mxv
.byte W01
.byte N02 , As3
.byte W04
.byte Cn4
.byte W52
; 001 ----------------------------------------
.byte W92
.byte W03
.byte VOICE , 8
.byte VOL , 100*song336restored_mvl/mxv
.byte PAN , c_v+0
.byte BEND , c_v+0
.byte W01
; 002 ----------------------------------------
.byte VOICE , 8
.byte BENDR , 12
.byte PAN , c_v+0
.byte VOL , 24*song336restored_mvl/mxv
.byte BENDR , 12
.byte PAN , c_v+0
.byte VOL , 24*song336restored_mvl/mxv
.byte BEND , c_v+0
.byte FINE
;******************************************************;
.align 4
song336restored:
.byte 2 ; NumTrks
.byte 0 ; NumBlks
.byte song336restored_pri ; Priority
.byte song336restored_rev ; Reverb.
//emit_clean_voicegroup_offset_for_song 336
.word 0x81071B4 //Voice Table
.word @song336restored_1
.word @song336restored_2
| 21.390533 | 56 | 0.551037 |
4327be82584496457029202f1d37bb2d269c4681 | 5,755 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1841.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1841.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1841.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r8
push %r9
push %rax
push %rdi
lea addresses_WC_ht+0x13f0e, %rdi
add %r11, %r11
movl $0x61626364, (%rdi)
nop
nop
nop
dec %rdi
lea addresses_UC_ht+0x1310e, %r8
nop
nop
mfence
mov $0x6162636465666768, %r9
movq %r9, %xmm6
vmovups %ymm6, (%r8)
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x1314a, %r9
nop
and %rax, %rax
movl $0x61626364, (%r9)
nop
nop
nop
add %rax, %rax
lea addresses_WT_ht+0xa20e, %r9
nop
nop
add %r10, %r10
movw $0x6162, (%r9)
xor $21102, %r10
lea addresses_UC_ht+0x1b50e, %r10
nop
nop
nop
nop
xor %r11, %r11
mov (%r10), %r8
nop
nop
inc %r8
pop %rdi
pop %rax
pop %r9
pop %r8
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r9
push %rax
push %rbx
push %rdi
// Store
lea addresses_normal+0x1f30e, %rdi
nop
nop
nop
nop
nop
sub %r13, %r13
movl $0x51525354, (%rdi)
nop
nop
nop
sub $50528, %r13
// Store
mov $0x401df70000000b2e, %rax
nop
nop
nop
nop
nop
and $30097, %r9
mov $0x5152535455565758, %rbx
movq %rbx, %xmm0
vmovntdq %ymm0, (%rax)
nop
nop
cmp %r11, %r11
// Load
lea addresses_D+0xa70e, %r9
add %r11, %r11
mov (%r9), %r15
inc %rdi
// Faulty Load
lea addresses_D+0xa70e, %rdi
nop
nop
nop
nop
nop
xor $14679, %r11
movb (%rdi), %al
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_NC', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 6}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 39.689655 | 2,999 | 0.655256 |
e35ae14c22dd81e8b74f039f765de5edec5dd9fd | 2,816 | asm | Assembly | 08/ProgramFlow_tests/BasicLoop/BasicLoop.asm | ashiroji/Nand2Tetris | 1eba908d0134ecbc7c6e8e252558caa8725ed70c | [
"MIT"
] | null | null | null | 08/ProgramFlow_tests/BasicLoop/BasicLoop.asm | ashiroji/Nand2Tetris | 1eba908d0134ecbc7c6e8e252558caa8725ed70c | [
"MIT"
] | null | null | null | 08/ProgramFlow_tests/BasicLoop/BasicLoop.asm | ashiroji/Nand2Tetris | 1eba908d0134ecbc7c6e8e252558caa8725ed70c | [
"MIT"
] | null | null | null | //push constant 0
@0 //A=index
D=A //D is now the constant
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
//pop local 0
@SP
AM=M-1 //AM = M[SP] - 1
D=M //D = the value to pop
@R13
M=D //save the value in R13
@LCL //A=LCL
D=M //save M[local] in D
@0 //A = index
D=D+A //D is now @(local + index)
@R14
M=D //save D value
@R13
D=M //D= value to pop
@R14
A=M //A = (segmentBase+index)
M=D //M[A] = value to pop
//label LOOP_START
(LOOP_START) //label declaration
//push argument 0
@ARG //A=ARG
D=M //save M[argument] in D
@0 //A = index
D=D+A //D is now @(argument + index)
A=D //A = @ contained in D
D=M//D=M[A], value to push
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
//push local 0
@LCL //A=LCL
D=M //save M[local] in D
@0 //A = index
D=D+A //D is now @(local + index)
A=D //A = @ contained in D
D=M//D=M[A], value to push
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
//add
@SP
AM=M-1 //AM[SP] = M[SP] - 1 e.g @y
D=M //D=M[A] e.g y
A=A-1 //A = @y - 1 e.g @x
M=D+M //M[@x] = y + M[@x]
//pop local 0
@SP
AM=M-1 //AM = M[SP] - 1
D=M //D = the value to pop
@R13
M=D //save the value in R13
@LCL //A=LCL
D=M //save M[local] in D
@0 //A = index
D=D+A //D is now @(local + index)
@R14
M=D //save D value
@R13
D=M //D= value to pop
@R14
A=M //A = (segmentBase+index)
M=D //M[A] = value to pop
//push argument 0
@ARG //A=ARG
D=M //save M[argument] in D
@0 //A = index
D=D+A //D is now @(argument + index)
A=D //A = @ contained in D
D=M//D=M[A], value to push
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
//push constant 1
@1 //A=index
D=A //D is now the constant
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
//sub
@SP
AM=M-1 //AM[SP] = M[SP] - 1 e.g @y
D=-M //D=-M[A] e.g -y
A=A-1 //A = @y - 1 e.g @x
M=D+M //M[@x] = -y + M[@x]
//pop argument 0
@SP
AM=M-1 //AM = M[SP] - 1
D=M //D = the value to pop
@R13
M=D //save the value in R13
@ARG //A=ARG
D=M //save M[argument] in D
@0 //A = index
D=D+A //D is now @(argument + index)
@R14
M=D //save D value
@R13
D=M //D= value to pop
@R14
A=M //A = (segmentBase+index)
M=D //M[A] = value to pop
//push argument 0
@ARG //A=ARG
D=M //save M[argument] in D
@0 //A = index
D=D+A //D is now @(argument + index)
A=D //A = @ contained in D
D=M//D=M[A], value to push
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
//if-goto LOOP_START
@SP
AM=M-1 //AM = M[SP] - 1
D=M //D = the value to pop
@LOOP_START
D;JNE //if D != 0 jump to LOOP_START
//push local 0
@LCL //A=LCL
D=M //save M[local] in D
@0 //A = index
D=D+A //D is now @(local + index)
A=D //A = @ contained in D
D=M//D=M[A], value to push
@SP
A=M //A = @SP
M=D //M[A] = value to push
@SP
M=M+1 //sp+1
| 19.027027 | 37 | 0.53267 |
3459a8075af0350704edd238c51dc977539810e0 | 250 | asm | Assembly | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_Invalidate.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_Invalidate.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_Invalidate.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void __FASTCALL__ sp1_Invalidate(struct sp1_Rect *r)
SECTION code_clib
SECTION code_temp_sp1
PUBLIC _sp1_Invalidate
EXTERN _sp1_Invalidate_fastcall
_sp1_Invalidate:
pop af
pop hl
push hl
push af
jp _sp1_Invalidate_fastcall
| 13.157895 | 54 | 0.78 |
274d330737e1440fd7c4f7c9816d105e5e2dd5cc | 343 | asm | Assembly | zos/old/disk.asm | zzh8829/OSPP | 788ccdebaf71d41fb6123c83c6dbd1ac9896ac2d | [
"MIT"
] | null | null | null | zos/old/disk.asm | zzh8829/OSPP | 788ccdebaf71d41fb6123c83c6dbd1ac9896ac2d | [
"MIT"
] | null | null | null | zos/old/disk.asm | zzh8829/OSPP | 788ccdebaf71d41fb6123c83c6dbd1ac9896ac2d | [
"MIT"
] | 1 | 2022-01-21T04:03:34.000Z | 2022-01-21T04:03:34.000Z | ; load dh sectors to es:bx from drive dl
loadDisk:
push dx
mov ah, 0x02
mov al, dh
mov ch, 0x00
mov dh, 0x00
mov cl, 0x2
int 0x13
jc loadDiskError
pop dx
cmp dh,al
jne loadDiskError
ret
; Error
loadDiskError:
mov si, MSG_DISK_LOAD_ERROR
call printString16
jmp $
MSG_DISK_LOAD_ERROR db "Read disk Err",0
BOOT_DRIVE db 0 | 11.064516 | 40 | 0.720117 |
96bad8b827e9cdd8f7e9b924389b76bd2e8804e1 | 2,333 | asm | Assembly | savefile/maps/2632_LookoutPoint.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 35 | 2018-04-01T06:55:28.000Z | 2021-05-09T19:09:42.000Z | savefile/maps/2632_LookoutPoint.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 4 | 2018-04-01T15:32:55.000Z | 2019-02-23T20:46:49.000Z | savefile/maps/2632_LookoutPoint.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 12 | 2018-04-01T15:48:09.000Z | 2021-01-27T10:22:33.000Z | SECTION "Map_2632", ROM0[$B800]
Map_2632_Header:
hdr_tileset 0
hdr_dimensions 6, 5
hdr_pointers_a Map_2632_Blocks, Map_2632_TextPointers
hdr_pointers_b Map_2632_Script, Map_2632_Objects
hdr_pointers_c Map_2632_InitScript, Map_2632_RAMScript
hdr_palette $06
hdr_music $ff, $02
hdr_connection NORTH, $0000, 0, 0
hdr_connection SOUTH, $0000, 0, 0
hdr_connection WEST, $0000, 0, 0
hdr_connection EAST, $2435, 1, 5
Map_2632_Objects:
hdr_border $43
hdr_warp_count 0
hdr_sign_count 0
hdr_object_count 1
hdr_object SPRITE_GIRL, 2, 6, STAY, LEFT, $01
Map_2632_RAMScript:
rs_fill_byte $0f
rs_fill_3 $c715
rs_fill_3 $c721
rs_fill_byte $6c
rs_fill_3 $c72d
rs_fill_byte $31
rs_fill_3 $c739
rs_fill_byte $52
rs_fill_3 $c745
rs_end
Map_2632_Blocks:
db $19,$0f,$0f,$0f,$0f,$0f
db $19,$0f,$0f,$0f,$0f,$0f
db $19,$6c,$6c,$6c,$6c,$6c
db $19,$0a,$31,$31,$31,$31
db $19,$52,$52,$52,$52,$52
Map_2632_TextPointers:
dw Map_2632_TX1
dw Map_2632_TX1
Map_2632_InitScript:
ld a, [PlayerFunValue]
cp $80
ret nc
ld hl, $c214
ld a, $cc
ld [hli], a
ld [hl], a
ret
Map_2632_Script:
ret
Map_2632_TX1:
TX_ASM
jp EnhancedTextOnly
text "When someone makes you"
next "cry every night, you need"
cont "to think to yourself."
para "Is it a person?"
next "Or is it a giant onion?"
para "Should you perhaps stop"
next "caring and accept whatever"
cont "the life brought you?"
para "And seek happiness in"
next "some other place, in some"
cont "other timeline?"
para "Sometimes, there is no"
next "choice other than to just"
cont "keep believing."
para "And to expect changes."
next "Wait for a miracle."
para "Because there is nothing"
next "else to do."
para "It's important to never"
next "lose faith."
para "No matter how bad things"
next "may look right now,"
cont "there might be a bright"
cont "future ahead."
para "And while there's that"
next "nonzero chance of a"
cont "miracle happening..."
para "You have to push through,"
next "continue the struggle."
done
| 25.637363 | 63 | 0.625804 |
a8279e7bb1c599170c6c7e5ac7ab48b07f24552c | 674 | asm | Assembly | asm/repl/hello.asm | willbr/gameboy-tests | a0d9f68f5a4898067b7993f690d8d4ca6de831c5 | [
"MIT"
] | null | null | null | asm/repl/hello.asm | willbr/gameboy-tests | a0d9f68f5a4898067b7993f690d8d4ca6de831c5 | [
"MIT"
] | null | null | null | asm/repl/hello.asm | willbr/gameboy-tests | a0d9f68f5a4898067b7993f690d8d4ca6de831c5 | [
"MIT"
] | null | null | null | INCLUDE "./bootstrap.asm"
SECTION "Game code", ROM0[end_of_cartridge_header]
main:
var xpos, ds, 2
var ypos, ds, 2
call init
xor a
ld [xpos], a
;ld [ypos], a
.dead_end:
halt
nop
jr .dead_end
init:
di
wait_for_vblank
lcd LCDCF_OFF
lda [rBGP], default_palette
memcpy _VRAM, sprite01, 16
lda [_SCRN0 + 0], 0
xor a
lda [rSCX], a
lda [rSCY], a
sound AUDENA_OFF
lcd LCDCF_ON | LCDCF_BG8000 | LCDCF_BGON
reti
SECTION "tiles", ROM0
sprite01:
dw `00000000
dw `00111100
dw `01122110
dw `01233210
dw `01233210
dw `01122110
dw `00111100
dw `00000000
| 11.824561 | 50 | 0.591988 |
661918b9ae89ed26bb0a7d53a622f9cab1a3aa73 | 19,618 | asm | Assembly | src/snake.asm | bengabay11/Snake | b1904e443da35345297ccbc5396dc2f779b6a4b4 | [
"MIT"
] | 2 | 2020-11-27T07:14:32.000Z | 2021-12-05T09:39:29.000Z | src/snake.asm | bengabay11/Snake | b1904e443da35345297ccbc5396dc2f779b6a4b4 | [
"MIT"
] | 1 | 2020-07-31T12:10:15.000Z | 2020-08-02T01:45:54.000Z | src/snake.asm | bengabay11/Snake | b1904e443da35345297ccbc5396dc2f779b6a4b4 | [
"MIT"
] | null | null | null | .286P
IDEAL
MODEL small
STACK 100h
; --------------------- Snake -------------------
; Snake game written in assembly by Ben Gabay
; TASM Syntax
; 32-bit x86 - DOS
; -----------------------------------------------
MAX_BMP_WIDTH = 320
MAX_BMP_HEIGHT = 200
SMALL_BMP_HEIGHT = 40
SMALL_BMP_WIDTH = 40
DATASEG
; General
CurrentPixelX dw ?
CurrentPixelY dw ?
CurrentPixelColor db ?
Clock equ es:6ch
ErrorFile db 0
; Messsages
ScoreMessage db 'SCORE: ', 10, 13,'$'
ScoreMessegeGameOver db 'Your score is: ', 10, 13,'$'
BmpFileErrorMsg db 'Error At Opening Bmp File .', 0dh, 0ah,'$'
HighscoreMessage db 'Best score: ', 10, 13,'$'
; Menu
PlayKey db 'w'
InstructionsKey db 's'
HighScoreKey db 'h'
BackKey db 'e'
QuitKey db 'q'
BackToMenu db ?
; Game
AppleEaten db 0
IsGameOver db ?
CurrentScore db 0
HighScore db 0
MaxScore db 9
KeyPressed db 0
BoardHeight dw 170
BoardWidth dw 300
SnakeX dw 160
SnakeY dw 100
BaseSnakeWidth dw 5
BaseSnakeHeight dw 25
SnakeWidth dw ?
SnakeHeight dw ?
AppleX dw ?
AppleY dw ?
AppleWidth dw 5
AppleHeight dw 5
StartingFrameX dw 10
StartingFramey dw 10
SnakeMovementDistance dw 5
SnakeIncreamentSize dw 2
;Snake Movement
IsUp db 0
IsDown db 0
IsRight db 0
IsLeft db 0
; BMP File data
FileHandle dw ?
Header db 54 dup(0)
Palette db 400h dup (0)
BmpLeft dw 0
BmpTop dw 0
BmpColSize dw 320
BmpRowSize dw 200
OneBmpLineOneBmpLine db MAX_BMP_WIDTH dup (0) ; One Color line read buffer
ScreenLineMax db MAX_BMP_WIDTH dup (0) ; One Color line read buffer
; Images
MenuImage db 'snake/images/Menu.bmp',0
InstructionsImage db 'snake/images/Instruc.bmp',0
GameOverImage db 'snake/images/GameOver.bmp',0
QuitImage db 'snake/images/Quit.bmp',0
HighscoreImage db 'snake/images/HScore.bmp',0
WinImage db 'snake/images/Win.bmp',0
; Pixel Colors
Black db 0
Blue db 1
Green db 2
Red db 4
Organge db 6
; Direction Keys
LeftKeyCode db 4Bh
RightKeyCode db 4dh
UpKeyCode db 48h
DownKeyCode db 50h
EKeyCode db 12h
CODESEG
; ---------------------- Utils ----------------------
proc SetGraphicMode
push ax
mov ax, 13h
int 10h
pop ax
ret
endp SetGraphicMode
proc GetInput
mov ah, 1
int 21h
ret
endp GetInput
proc DrawPixel
pusha
mov bh,0h
mov cx, [CurrentPixelX]
mov dx, [CurrentPixelY]
mov al, [CurrentPixelColor]
mov ah,0ch
int 10h
popa
ret
endp DrawPixel
proc GetPixelColor
pusha
mov cx, [CurrentPixelX]
mov dx, [CurrentPixelY]
mov ah, 0Dh
int 10h ; return al the pixel value read
mov [CurrentPixelColor], al
popa
ret
endp GetPixelColor
proc Sleep
pusha
mov ax, 40h
mov es, ax
mov ax, [Clock]
FirstTick:
cmp ax, [Clock]
je FirstTick
mov cx, 1
DelayLoop:
mov ax, [Clock]
Tick:
cmp ax, [Clock]
je Tick
loop DelayLoop
popa
ret
endp Sleep
proc Sleep2Seconds
mov cx, 20
wait_2_seco:
call Sleep
loop wait_2_seco
endp Sleep2Seconds
; ---------------------- BMP Procedures ----------------------
proc PrintImage near
push cx
push bx
call OpenBmpFile
cmp [ErrorFile], 1
je @@ExitProc
call ReadBmpHeader
call ReadBmpPalette
call CopyBmpPalette
call ShowBMP
call CloseBmpFile
@@ExitProc:
pop bx
pop cx
ret
endp PrintImage
proc OpenBmpFile near
mov ah, 3Dh
xor al, al
int 21h
jc @@ErrorAtOpen
mov [FileHandle], ax
jmp @@ExitProc
@@ErrorAtOpen:
mov [ErrorFile], 1
@@ExitProc:
ret
endp OpenBmpFile
proc CloseBmpFile near
mov ah, 3Eh
mov bx, [FileHandle]
int 21h
ret
endp CloseBmpFile
proc ReadBmpHeader near
push cx
push dx
mov ah, 3fh
mov bx, [FileHandle]
mov cx, 54
mov dx, offset Header
int 21h
pop dx
pop cx
ret
endp ReadBmpHeader
proc ReadBmpPalette near
push cx
push dx
mov ah, 3fh
mov cx, 400h
mov dx, offset Palette
int 21h
pop dx
pop cx
ret
endp ReadBmpPalette
proc CopyBmpPalette near
push cx
push dx
mov si,offset Palette
mov cx,256
mov dx,3C8h
mov al,0 ; black first
out dx,al ;3C8h
inc dx ;3C9h
CopyNextColor:
mov al,[si+2] ; Red
shr al,2 ; divide by 4 Max (cos max is 63 and we have here max 255 ) (loosing color resolution)
out dx,al
mov al,[si+1] ; Green.
shr al,2
out dx,al
mov al,[si] ; Blue.
shr al,2
out dx,al
add si,4 ; Point to next color. (4 bytes for each color BGR + null)
loop CopyNextColor
pop dx
pop cx
ret
endp CopyBmpPalette
proc ShowBMP
push cx
mov ax, 0A000h
mov es, ax
mov cx, [BmpRowSize]
mov ax, [BmpColSize] ; row size must dived by 4 so if it less we must calculate the extra padding bytes
xor dx, dx
mov si,4
div si
mov bp,dx
mov dx,[BmpLeft]
@@NextLine:
push cx
push dx
mov di, cx ; Current Row at the small bmp (each time -1)
add di, [BmpTop] ; add the Y on entire screen
mov cx,di
shl cx, 6
shl di, 8
add di, cx
add di, dx
mov ah, 3fh
mov cx, [BmpColSize]
add cx, bp ; Extra bytes to each row must be divided by 4
mov dx, offset ScreenLineMax
int 21h
cld ; Clear direction flag, for movsb
mov cx,[BmpColSize]
mov si, offset ScreenLineMax
rep movsb ; Copy line to the screen
pop dx
pop cx
loop @@NextLine
pop cx
ret
endp ShowBMP
; ---------------------- Move Values Between Variables Procedures ----------------------
proc MoveSnakeCoordinatesToCurrentCoordinates
pusha
mov bx, [SnakeX]
mov dx, [SnakeY]
mov [CurrentPixelX], bx
mov [CurrentPixelY], dx
popa
ret
endp MoveSnakeCoordinatesToCurrentCoordinates
proc MoveSnakeBaseCoordinatesToCurrentCoordinates
pusha
mov bx, [BaseSnakeWidth]
mov dx, [BaseSnakeHeight]
mov [SnakeWidth], bx
mov [SnakeHeight], dx
popa
ret
endp MoveSnakeBaseCoordinatesToCurrentCoordinates
proc MoveAppleCoordinatesToCurrentCoordinates
pusha
mov bx, [AppleX]
mov dx, [AppleY]
mov [CurrentPixelX], bx
mov [CurrentPixelY], dx
popa
ret
endp MoveAppleCoordinatesToCurrentCoordinates
proc MoveFrameCoordinatesToCurrentCoordinates
pusha
mov ax, [StartingFrameX]
mov bx, [StartingFramey]
mov [CurrentPixelX], ax
mov [CurrentPixelY], bx
popa
ret
endp MoveFrameCoordinatesToCurrentCoordinates
proc MoveCurrentCoordinatesToSnakeCoordinates
pusha
mov ax, [CurrentPixelX]
mov bx, [CurrentPixelY]
mov [SnakeX], ax
mov [SnakeY], bx
popa
ret
endp MoveCurrentCoordinatesToSnakeCoordinates
; ---------------------- Game ----------------------
proc CheckWin
pusha
mov al, [MaxScore]
cmp al, [CurrentScore]
ja not_win
call Win
not_win:
popa
ret
endp CheckWin
proc Win
pusha
mov [BackToMenu], 1
mov dx,offset WinImage
call PrintImage
win_input:
mov ah, 2
int 10h
mov ah, 1
int 21h
cmp al, [BackKey]
jne win_input
popa
ret
endp Win
; Prints an image with the highscore of the player
proc ShowHighscore
pusha
mov dx,offset HighscoreImage
call PrintImage
mov dl, 11
mov dh, 4
mov bx, 0
mov ah, 2
int 10h
mov dx, offset HighscoreMessage
mov ah, 9h
int 21h
mov dl, 24
mov dh, 4
mov bx, 0
mov ah, 2
int 10h
mov dl, [HighScore] ; same as: mov dl, 58h
add dl, 30h
mov ah, 2
int 21h
highscore_exit_input: ; Input for exit.
mov ah, 2
int 10h
mov ah, 1
int 21h
cmp al, [BackKey]
jne highscore_exit_input
popa
ret
endp ShowHighscore
; Prints the instructions of the game
proc Instructions
pusha
mov dx,offset InstructionsImage
call PrintImage
instructions_exit_input: ; Input for exit.
mov ah, 2
int 10h
mov ah, 1
int 21h
cmp al, [BackKey]
jne instructions_exit_input
popa
ret
endp instructions
proc CheckFramePixel
call GetPixelColor
mov al, [CurrentPixelColor]
cmp al, [Blue]
je frame_not_overide
mov [IsGameOver], 1
frame_not_overide:
ret
endp CheckFramePixel
; Checks if one of the pixels on the frame changed to green, and finish the game if it does
proc CheckFrame
pusha
call MoveFrameCoordinatesToCurrentCoordinates
mov cx, [BoardWidth]
check_frame_upper_row:
call CheckFramePixel
inc [CurrentPixelX]
loop check_frame_upper_row
mov cx, [BoardHeight]
check_frame_right_column:
call CheckFramePixel
inc [CurrentPixelY]
loop check_frame_right_column
mov cx, [BoardWidth]
check_frame_bottom_row:
call CheckFramePixel
dec [CurrentPixelX]
loop check_frame_bottom_row
mov cx, [BoardHeight]
check_frame_left_column:
call CheckFramePixel
dec [CurrentPixelY]
loop check_frame_left_column
popa
ret
endp CheckFrame
proc CheckDisqualification
call CheckFrame
; call CheckSnakeHitsGimself
cmp [IsGameOver], 1
jne game_continues
call GameOver
game_continues:
ret
endp CheckDisqualification
proc DrawHorizontalSnake
pusha
call MoveSnakeCoordinatesToCurrentCoordinates
mov ax, [SnakeWidth]
horizontal_snake_row:
mov cx, [SnakeHeight]
horizontal_snake_column:
push cx
inc [CurrentPixelX]
call DrawPixel
pop cx
loop horizontal_snake_column
inc [CurrentPixelY]
mov bx, [SnakeHeight]
sub [CurrentPixelX], bx
dec ax
cmp ax, 0
jne horizontal_snake_row
mov bx, [SnakeWidth]
sub [CurrentPixelY], bx
popa
ret
endp DrawHorizontalSnake
proc DrawVerticalSnake
pusha
call MoveSnakeCoordinatesToCurrentCoordinates
mov ax, [SnakeWidth]
vertical_snake_row:
mov cx, [SnakeHeight]
vertical_snake_column:
push cx
inc [CurrentPixelY]
call DrawPixel
pop cx
loop vertical_snake_column
inc [CurrentPixelX]
mov bx, [SnakeHeight]
sub [CurrentPixelY], bx
dec ax
cmp ax, 0
jne vertical_snake_row
mov bx, [SnakeWidth]
sub [CurrentPixelX], bx
popa
ret
endp DrawVerticalSnake
proc DrawApple
pusha
call MoveAppleCoordinatesToCurrentCoordinates
mov ax, [AppleHeight]
new_apple_row:
mov cx, [AppleWidth]
new_apple_column:
call DrawPixel
inc [CurrentPixelY]
loop new_apple_column
inc [CurrentPixelX]
mov bx, [AppleHeight]
sub [CurrentPixelY], bx
dec ax
cmp ax, 0
jne new_apple_row
popa
ret
endp DrawApple
; Clear a vertical rectangle
proc ClearVerticalOblong
pusha
mov al, [Black]
mov [CurrentPixelColor], al
call DrawVerticalSnake
popa
ret
endp ClearVerticalOblong
; Clear a horizontal rectangle
proc ClearHorizontalOblong
pusha
mov al, [Black]
mov [CurrentPixelColor], al
call DrawHorizontalSnake
popa
ret
endp ClearHorizontalOblong
; Draw a blue frame
proc DrawFrame
pusha
mov al, [Blue]
mov [CurrentPixelColor], al
mov ax, [StartingFrameX]
mov bx, [StartingFramey]
mov [CurrentPixelX], ax
mov [CurrentPixelY], bx
mov cx, [BoardWidth]
frame_upper_row:
call DrawPixel
inc [CurrentPixelX]
loop frame_upper_row
mov cx, [BoardHeight]
frame_right_column:
call DrawPixel
inc [CurrentPixelY]
loop frame_right_column
mov cx, [BoardWidth]
frame_bottom_row:
call DrawPixel
dec [CurrentPixelX]
loop frame_bottom_row
mov cx, [BoardHeight]
frame_left_column:
call DrawPixel
dec [CurrentPixelY]
loop frame_left_column
popa
ret
endp DrawFrame
proc IncreaseSnake
pusha
mov ax, [SnakeIncreamentSize]
add [SnakeHeight], ax
popa
ret
endp IncreaseSnake
proc MoveSnakeUp
pusha
call ClearVerticalOblong
mov al, [Green]
mov [CurrentPixelColor], al
mov bx, [SnakeMovementDistance]
sub [SnakeY], bx
call DrawVerticalSnake
popa
ret
endp MoveSnakeUp
proc MoveSnakeDown
pusha
call ClearVerticalOblong
mov al, [Green]
mov [CurrentPixelColor], al
mov bx, [SnakeMovementDistance]
add [SnakeY], bx
call DrawVerticalSnake
popa
ret
endp MoveSnakeDown
proc MoveSnakeRight
pusha
call ClearHorizontalOblong
mov al, [Green]
mov [CurrentPixelColor], al
mov bx, [SnakeMovementDistance]
add [SnakeX], bx
call DrawHorizontalSnake
popa
ret
endp MoveSnakeRight
proc MoveSnakeLeft
pusha
call ClearHorizontalOblong
mov al, [Green]
mov [CurrentPixelColor], al
mov bx, [SnakeMovementDistance]
sub [SnakeX], bx
call DrawHorizontalSnake
popa
ret
endp MoveSnakeLeft
proc FixUpMovement
pusha
mov ax, [SnakeHeight]
cmp [IsLeft], 1
jne fix_up_check_right
sub [SnakeY], ax
fix_up_check_right:
cmp [IsRight], 1
jne exit_fix_up
add [SnakeX], ax
sub [SnakeY], ax
exit_fix_up:
popa
ret
endp FixUpMovement
proc FixDownMovement
pusha
cmp [IsRight], 1
jne exit_fix_down
mov ax, [SnakeHeight]
add [SnakeX], ax
exit_fix_down:
popa
ret
endp FixDownMovement
proc FixRightMovement
pusha
mov ax, [SnakeHeight]
cmp [IsUp], 1
jne fix_right_check_down
add [SnakeX], ax
fix_right_check_down:
cmp [IsDown], 1
jne exit_fix_right
add [SnakeY], ax
exit_fix_right:
popa
ret
endp FixRightMovement
proc FixLeftMovement
pusha
mov ax, [SnakeHeight]
sub [SnakeX], ax
fix_left_check_right:
cmp [IsDown], 1
jne exit_fix_left
add [SnakeY], ax
exit_fix_left:
popa
ret
endp FixLeftMovement
proc PrintScoreGameOver
pusha
mov dl, 11
mov dh, 4
mov bx, 0
mov ah, 2
int 10h
mov dx, offset ScoreMessegeGameOver
mov ah, 9h
int 21h
mov dl, 26
mov dh, 4
mov bx, 0
mov ah, 2
int 10h
mov dl, [CurrentScore]
add dl, 30h
mov ah, 2
int 21h
popa
ret
endp PrintScoreGameOver
; Prints the current score of the player in the left side down
proc PrintScore
pusha
mov dl, 4
mov dh, 23
mov bx, 0
mov ah, 2
int 10h
mov dx, offset ScoreMessage
mov ah, 9h
int 21h
mov dl, 10
mov dh, 23
mov bx, 0
mov ah, 2
int 10h
mov dl, [CurrentScore]
add dl, 30h
mov ah, 2
int 21h
popa
ret
endp PrintScore
; Prints apple in random location on the screen
proc DrawRandomApple
pusha
mov al, [Red]
mov [CurrentPixelColor], al
call GenerateRandomAppleY
call GenerateRandomAppleX
call DrawApple
popa
ret
endp DrawRandomApple
proc CheckApplePixel
pusha
call GetPixelColor
mov al, [CurrentPixelColor]
cmp al, [Red]
je apple_pixel_is_red
mov [AppleEaten], 1
apple_pixel_is_red:
popa
ret
endp CheckApplePixel
proc CheckAppleEaten
pusha
call MoveAppleCoordinatesToCurrentCoordinates
mov ax, [AppleHeight]
check_apple_column:
mov cx, [AppleWidth]
check_apple_row:
call CheckApplePixel
inc [CurrentPixelY]
loop check_apple_row
inc [CurrentPixelX]
sub [CurrentPixelY], 5
dec ax
cmp ax, 0
jne check_apple_column
popa
ret
endp CheckAppleEaten
proc CheckApple
call CheckAppleEaten
cmp [AppleEaten], 1
jne apple_not_eaten
call HandleAppleEaten
apple_not_eaten:
ret
endp CheckApple
proc DeleteApple
mov al, [Black]
mov [CurrentPixelColor], al
call DrawApple
ret
endp DeleteApple
proc DeleteSnake
cmp [IsUp], 1
jne delete_snake_check_down
call ClearVerticalOblong
delete_snake_check_down:
cmp [IsDown], 1
jne delete_snake_check_right
call ClearVerticalOblong
delete_snake_check_right:
cmp [IsRight], 1
jne delete_snake_check_left
call ClearHorizontalOblong
delete_snake_check_left:
cmp [IsLeft], 1
jne finish_delete_snake
call ClearHorizontalOblong
finish_delete_snake:
ret
endp DeleteSnake
proc MoveSnake
pusha
check_up:
cmp [IsUp], 1
jne check_down
call MoveSnakeUp
check_down:
cmp [IsDown], 1
jne check_right
call MoveSnakeDown
check_right:
cmp [IsRight], 1
jne check_left
call MoveSnakeRight
check_left:
cmp [IsLeft], 1
jne finish_move_snake
call MoveSnakeLeft
finish_move_snake:
popa
ret
endp MoveSnake
proc HandleAppleEaten
call DeleteApple
call DrawRandomApple
inc [CurrentScore]
call IncreaseSnake
mov [AppleEaten], 0
ret
endp HandleAppleEaten
proc ResetDirections
mov [IsRight], 0
mov [IsDown], 0
mov [IsLeft], 0
mov [IsUp], 0
ret
endp ResetDirections
proc CheckNonBlockInput
; Checks if a key was pressed
in al, 64h ; Read keyboard status port
cmp al, 10b ; Data in buffer ?
je key_not_pressed ; if no key was pressed, repeat
in al, 60h ; AL = scan code pressed key
mov [KeyPressed], 1
key_not_pressed:
ret
endp
proc GetSnakeMovementInput
call CheckNonBlockInput
cmp [KeyPressed], 1
jne get_snake_movement_end
mov [KeyPressed], 0
check_up_direction:
cmp al, [UpKeyCode] ; Checks if key up is pressed
jne check_left_direction
call FixUpMovement
cmp [IsDown], 1 ; Checks whether the snake is on his way down, and if it does, the program prevent it from going up
je get_snake_movement_end
call ResetDirections
mov [IsUp], 1
check_left_direction:
cmp al, [LeftKeyCode] ; Checks if key left is pressed
jne check_down_direction
call FixLeftMovement
cmp [IsRight], 1 ; Checks whether the snake is on his way right, and if it does, the program prevent it from going left
je get_snake_movement_end
call ResetDirections
mov [IsLeft], 1
check_down_direction:
cmp al, [DownKeyCode] ; Checks if key down is pressed
jne check_right_direction
call FixDownMovement
cmp [IsUp], 1 ; Checks whether the snake is on his way up, and if it does, the program prevent it from going down
je get_snake_movement_end
call ResetDirections
mov [IsDown], 1
check_right_direction:
cmp al, [RightKeyCode] ; Checks if key right is pressed
jne check_back_key
call FixRightMovement
cmp [IsLeft], 1 ; Checks whether the snake is on his way left, and if it does, the program prevent it from going right
je get_snake_movement_end
call ResetDirections
mov [IsRight], 1
check_back_key:
cmp al , [EKeyCode]
jne get_snake_movement_end
mov [BackToMenu], 1
get_snake_movement_end:
ret
endp GetSnakeMovementInput
proc InitBoard
pusha
call SetGraphicMode
call DrawFrame
mov bl, [Green]
mov [CurrentPixelColor], bl
call DrawHorizontalSnake
mov [IsRight], 1
call DrawRandomApple
popa
ret
endp InitBoard
proc InitGameVariables
call ResetDirections
call MoveSnakeBaseCoordinatesToCurrentCoordinates
mov [BackToMenu], 0
mov [CurrentScore], 0
mov [IsGameOver], 0
mov [SnakeX], 160
mov [SnakeY], 100
mov [AppleEaten], 0
ret
endp InitGameVariables
proc Play
call InitGameVariables
call InitBoard
game_loop:
call DeleteSnake
call GetSnakeMovementInput
call MoveSnake
call CheckApple
call CheckDisqualification
call CheckWin
call PrintScore
call Sleep
cmp [BackToMenu], 1
jne game_loop
ret
endp Play
proc GameOver
pusha
mov [BackToMenu], 1
mov dx,offset GameOverImage
call PrintImage
call PrintScoreGameOver
mov cx, 25
wait_3_sec:
call Sleep
loop wait_3_sec
popa
ret
endp GameOver
proc GenerateRandomAppleX
pusha
mov ax, 40h
mov es, ax
mov cx, 10
mov bx, 0
random_loop_apple_x:
mov ax, [Clock]
mov ah, [byte cs:bx]
xor al, ah
and al, 11111111b
xor ah, ah
mov [AppleX], ax
add [AppleX], 11
loop random_loop_apple_x
popa
ret
endp GenerateRandomAppleX
proc GenerateRandomAppleY
pusha
mov ax, 40h
mov es, ax
mov cx, 10
mov bx, 0
random_loop_apple_y:
mov ax, [Clock]
mov ah, [byte cs:bx]
xor al, ah
and al, 10011111b
xor ah, ah
mov [AppleY], ax
add [AppleY], 11
loop random_loop_apple_y
popa
ret
endp GenerateRandomAppleY
proc PrintQuitImage
mov dx,offset QuitImage
call PrintImage
call Sleep2Seconds
endp PrintQuitImage
proc CheckHighscore
mov al, [CurrentScore]
cmp al, [HighScore] ; Compare between the highscore and the current score
jbe no_change
mov [HighScore], al ; Insert the current score to the highscore variable
no_change:
ret
endp CheckHighscore
proc InitMenu
pusha
call SetGraphicMode
mov dx, offset MenuImage
call PrintImage
mov ah, 2
int 10h
popa
ret
endp InitMenu
proc Menu
menu_loop:
call InitMenu
get_input_label:
call GetInput
cmp al, [PlayKey]
je play_label
cmp al, [InstructionsKey]
je instructions_label
cmp al, [HighScoreKey]
je highscore_label
cmp al, [QuitKey]
je exit_label
jmp get_input_label
play_label:
call Play
call CheckHighscore
jmp menu_loop
highscore_label:
call ShowHighscore
jmp menu_loop
instructions_label:
call Instructions
jmp menu_loop
exit_label:
call PrintQuitImage
ret
endp Menu
start:
mov ax, @data
mov ds, ax
call Menu
mov ax, 2
int 10h
mov ax, 4c00h
int 21h
ret
END start | 18.047838 | 120 | 0.7356 |
0442bf777f818b4ceefcffdfd6698203116448f6 | 2,210 | asm | Assembly | dos/cga_comp.asm | michaelcmartin/bumbershoot | d465d18997c5651bb1d71488705b0d6e1271660c | [
"MIT"
] | 20 | 2016-06-22T10:04:48.000Z | 2022-03-13T23:16:10.000Z | dos/cga_comp.asm | michaelcmartin/bumbershoot | d465d18997c5651bb1d71488705b0d6e1271660c | [
"MIT"
] | null | null | null | dos/cga_comp.asm | michaelcmartin/bumbershoot | d465d18997c5651bb1d71488705b0d6e1271660c | [
"MIT"
] | 2 | 2016-12-19T02:31:06.000Z | 2020-02-04T02:56:27.000Z | ;;; CGALORES.ASM - Demonstration of the 160x100x16 mode on CGA systems.
;;; by Michael Martin, 2015, for the Bumbershoot Software blog
;;; This code is BSD-licensed; see the repository's general license
;;; for details
;;; This was written for the Netwide Assembler (www.nasm.us)
;;; To assemble, put this and cgalores.dat in the same directory
;;; and issue this command:
;;; nasm -f bin -o cga_comp.com cga_comp.asm
;;;
;;; The result will run in DOSBox, but you need to change the line
;;; machine=svga_s3
;;; to
;;; machine=cga
;;; or you will get a stippled monochrome display instead.
;; This is a .COM file, so, 16-bit real mode, starts at 100h
cpu 8086
org 100h
bits 16
;; Enter CGA Composite artifact color mode
mov ax, 0x0006
int 10h
mov al, 0x1a
mov dx, 0x3d8
out dx, al
;; Create our sample display
call draw_bars
;; Cycle through the 15 foreground options.
;; NOTE: This is CGA-specific; VGA systems will ignore this
;; and just make you hit a key 16 times to quit
mov cx, 15
loop: mov al, cl
mov dx, 0x3d9
out dx, al
call wait_for_key
loop loop
;; Back to 80-column color text mode
mov ax, 3
int 10h
ret
draw_bars:
;; Draw the even scanlines
xor di, di
call .halfframe
;; Now draw the odd scanlines by altering the base offset and
;; falling through
mov di, 0x2000
.halfframe:
cld
mov ax, 0xb800
mov es, ax
xor ax, ax
add di, 0x140 ; Skip first 8 scanlines
mov dx, 16
.lp: mov cx, 240 ; 6 scanlines per bar
rep stosw
add ax, 0x1111 ; next color
dec dx
jnz .lp
ret
wait_for_key:
mov ah, 06h
mov dl, 0xff
int 21h
jz wait_for_key
.wait_for_no_key:
mov ah, 06h
mov dl, 0xff
int 21h
jnz .wait_for_no_key
ret
| 26.309524 | 71 | 0.536652 |
1022a4507cdfd0c799480a05166bd23ffb1ba535 | 122 | asm | Assembly | libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/mtx_lock.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/mtx_lock.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/mtx_lock.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int mtx_lock(mtx_t *m)
SECTION code_threads_mutex
PUBLIC mtx_lock
EXTERN asm_mtx_lock
defc mtx_lock = asm_mtx_lock
| 11.090909 | 28 | 0.803279 |
f09229fd74e114ce3ef1474c53a310869ed73222 | 768 | asm | Assembly | oeis/350/A350134.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/350/A350134.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/350/A350134.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A350134: Number of endofunctions on [n] with at least one isolated fixed point.
; Submitted by Christian Krause
; 0,1,1,10,87,1046,15395,269060,5440463,124902874,3208994379,91208536112,2841279322871,96258245162678,3523457725743059,138573785311560916,5827414570508386335,260928229315498155314,12393729720071855683739,622422708333615857463608,32952635809758634551588359,1834274006000767359611001742,107094235549253429667415934499,6544095343525857466549908595868,417687385286946817840166799413423,27795868175023677593067288203343626,1925346060210402332094697890173722475,138600813978483419719496348750572753600
mov $4,$0
add $0,1
lpb $0
sub $0,1
max $0,1
mov $2,$1
pow $2,$1
mov $3,$4
bin $3,$1
add $1,1
mul $3,$2
div $5,-1
add $5,$3
lpe
mov $0,$5
| 38.4 | 495 | 0.816406 |
ddb88f7bb24f307f35630f0d07f2e9d69a67e5b9 | 21,730 | asm | Assembly | Assembly/Project/Array.asm | Myself086/Project-Nested | 89153325af8e5e2d443994352eae60ad06ed5922 | [
"MIT"
] | 338 | 2020-07-26T23:26:20.000Z | 2022-03-31T15:26:49.000Z | Assembly/Project/Array.asm | Myself086/Project-Nested | 89153325af8e5e2d443994352eae60ad06ed5922 | [
"MIT"
] | 47 | 2020-08-08T10:21:02.000Z | 2022-03-30T16:28:35.000Z | Assembly/Project/Array.asm | Myself086/Project-Nested | 89153325af8e5e2d443994352eae60ad06ed5922 | [
"MIT"
] | 8 | 2020-08-10T19:04:09.000Z | 2021-09-27T07:25:02.000Z |
// 0 3 6 9
// Array format: =current, =base, =top, _increment
// ---------------------------------------------------------------------------
Array__Resize_Error:
unlock
trap
Exception "Array resize fail{}{}{}Array can't be sized down below their current amount of data used."
.mx 0x00
.func Array__Resize
// Entry: X = List Pointer, Y = New size
// Return: X = List Pointer
Array__Resize:
.local _listPointer
.local _bytesUsed
.local _newSize
.local =originalData
.local =newData
stx $.listPointer
sty $.newSize
lda $0x0000,x
sec
sbc $0x0003,x
clc
adc $0x0009,x
sta $.bytesUsed
// Are we resizing to a smaller size than required for our data?
cpy $.bytesUsed
bcc $-Array__Resize_Error
// Keep original data pointer
lda $0x0003,x
sta $.originalData+0
lda $0x0004,x
sta $.originalData+1
// Allocate memory
tyx
lda #0x007e
call Memory__Alloc
// Return: A = Bank number, X = Memory address, Y = HeapStack pointer
// Keep local pointer
smx #0x20
sta $.newData+2
stx $.newData+0
// Set bank number
ldy $.listPointer
sta $0x0008,y
sta $0x0005,y
sta $0x0002,y
smx #0x00
// Set base address
txa
sta $0x0003,y
// Set current address
clc
adc $.bytesUsed
sec
sbc $0x0009,y
sta $0x0000,y
// Set top address
lda $0x0003,y
clc
adc $.newSize
dec a
sta $0x0006,y
// Copy bytes over
lda $.bytesUsed
dec a
and #0xfffe
tay
b_loop:
lda [$.originalData],y
sta [$.newData],y
dey
dey
bpl $-b_loop
// TODO: Deallocate old memory
ldx $.listPointer
return
// ---------------------------------------------------------------------------
.mx 0x00
.func Array__Insert
// Entry: X = List Pointer
Array__Insert_Resize:
// Double the size of the array
lda $0x0006,x
sec
sbc $0x0003,x
inc a
asl a
tay
call Array__Resize
Array__Insert:
.local =p
// Increment
lda $0x0009,x
tay
clc
adc $0x0000,x
sta $0x0000,x
sta $.p
// Can we increment one more time?
adc $0x0009,x
cmp $0x0006,x
// Is array full?
bcs $-Array__Insert_Resize
// Change mode
sep #0x20
.mx 0x20
// Zero out the next element
lda $0x0002,x
sta $.p+2
lda #0x00
Array__Insert_loop1:
dey
sta [$.p],y
bne $-Array__Insert_loop1
// Return
rep #0x30
return
// ---------------------------------------------------------------------------
.mx 0x00
.func Array__InsertAt
// Entry: X = List Pointer, Y = Insert at
.local _at, _listPointer
Array__InsertAt_Resize:
// Double the size of the array
lda $0x0006,x
sec
sbc $0x0003,x
inc a
asl a
tay
call Array__Resize
// Return: X = List Pointer
bra $+b_in
Array__InsertAt:
// Save some params
sty $.at
stx $.listPointer
b_in:
.local =p, _inc, _x, _bytes, _tempElement
.local .dummy, 4 move
// NOTE: 'dummy' is for writing the first byte of 'move' in 16-bit mode
// Prepare move instruction
lda $0x0002,x
and #0x00ff
ora #0x6b00
sta $.move+1
sta $.move+2
// Increment
lda $0x0009,x
sta $.inc
tay
clc
adc $0x0000,x
sta $.p
// Can we increment it?
adc $.inc
cmp $0x0006,x
// Is array full?
bcs $-Array__InsertAt_Resize
// Move new bytes up by one element, assume carry clear from last compare
lda #0x5400 // Mvn
sta $.move-1
// Prepare move registers
lda $0x0000,x
tax
adc $.inc
tay
sty $.tempElement
lda $.inc
dec a
// Move
phb
jsr $=move
plb
// Move bytes
lda #0x4400 // Mvp
sta $.move-1
// How many bytes to move?
ldx $.listPointer
lda $0x0000,x
sec
sbc $.at
sec
sbc $0x0003,x
sta $.bytes
// Destination and source
lda $.p
dec a
tay
sec
sbc $.inc
tax
lda $.bytes
dec a
// Move
phb
jsr $=move
plb
// Move new element
lda #0x5400 // Mvn
sta $.move-1
// Destination
ldx $.listPointer
lda $.at
clc
adc $0x0003,x
tay
// Source
ldx $.tempElement
// Byte count
lda $.inc
dec a
// Move
phb
jsr $=move
plb
// Copy new current pointer
ldx $.listPointer
lda $.p
sta $0x0000,x
// Change mode
sep #0x20
.mx 0x20
// Zero out the next element
ldy $.inc
lda $0x0002,x
sta $.p+2
lda #0x00
Array__InsertAt_loop1:
dey
sta [$.p],y
bne $-Array__InsertAt_loop1
// Return
rep #0x30
return
// ---------------------------------------------------------------------------
.mx 0x00
.func Array__InsertIfDifferentBase
// Entry: X = List Pointer, Y = Compare length
// Return: A = Index offset
Array__InsertIfDifferentBase:
ldy $0x0009,x
// Function override
.pushaddr
call Array__InsertIfDifferent
.pulladdr
.func Array__InsertIfDifferent
Array__InsertIfDifferent:
.local _listPointer
// Keep list pointer
stx $.listPointer
// Find match
call Array__Find
tay
bpl $+Array__InsertIfDifferent__SkipNew
ldx $.listPointer
// Keep index of new element
.local _index
lda $0x0000,x
sec
sbc $0x0003,x
sta $.index
// Accept insert
call Array__Insert
lda $.index
return
Array__InsertIfDifferent__SkipNew:
return
// ---------------------------------------------------------------------------
Array__Find_IncError:
unlock
trap
Exception "Find length too large{}{}{}Array.Find attempted to search for a larger sequence of bytes than programmed for."
.mx 0x00
.func Array__Find
// Entry: X = List Pointer, Y = Compare length
// Return: A = 16-bit index of element, or negative (0xffff) if not found, P.n = Set when not found
Array__Find:
lda #0
//bra $+Array__Find2
FakeCall Array__Find2
.mx 0x00
.func Array__Find2
// Entry: A = Compare start offset, X = List Pointer, Y = Compare length
// Return: A = 16-bit index of element, or negative (0xffff) if not found, P.n = Set when not found
Array__Find2:
.local =pCurrent
.local =pThis
.local _listPointer
.local _inc
.local _cmpLength
.local _offset
// Save compare length (optimized into Y register only)
//sty $.cmpLength
// Keep list pointer
stx $.listPointer
// Keep current and base address (optimized by merging 2x 24-bit copy)
sta $.offset
clc
adc $0x0000,x
sta $.pCurrent
lda $0x0002,x
sta $.pCurrent+2
// Keep base address + offset
lda $0x0004,x
sta $.pThis+1
lda $.offset
clc
adc $.pThis
sta $.pThis
// Keep increment
lda $0x0009,x
sta $.inc
// Error out if cmpLength is too high
cpy #0x0009
bcs $-Array__Find_IncError
// Which increment? Supports up to 8 at the moment
// Assume carry clear from "asl a"
tya
asl a
tax
jsr ($_Array__Find_calling,x)
// Is it new?
lda $.pCurrent
eor $.pThis
beq $+Array__Find_NotFound
ldx $.listPointer
lda $.pThis
sec
sbc $.offset
sec
sbc $0x0003,x
return
Array__Find_NotFound:
dec a
return
Array__Find_loop0:
bra $-Array__Find_loop0
Array__Find_calling:
.data16 _Array__Find_loop0
.data16 _Array__Find_loop1
.data16 _Array__Find_loop2
.data16 _Array__Find_loop3
.data16 _Array__Find_loop4
.data16 _Array__Find_loop5
.data16 _Array__Find_loop6
.data16 _Array__Find_loop7
.data16 _Array__Find_loop8
Array__Find_loop1:
ldx $.inc
lda [$.pCurrent]
tay
bra $+Array__Find_loop1_QuickStart
Array__Find_loop1_reset:
Array__Find_loop1_inc:
txa
adc $.pThis
sta $.pThis
Array__Find_loop1_0:
tya
Array__Find_loop1_QuickStart:
eor [$.pThis]
and #0x00ff
bne $-Array__Find_loop1_inc
// Return
rts
Array__Find_loop2:
ldx $.inc
lda [$.pCurrent]
tay
bra $+Array__Find_loop2_QuickStart
Array__Find_loop2_reset:
Array__Find_loop2_inc:
txa
adc $.pThis
sta $.pThis
Array__Find_loop2_0:
tya
Array__Find_loop2_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop2_inc
// Return
rts
Array__Find_loop3:
lda [$.pCurrent]
tax
ldy #0x0001
bra $+Array__Find_loop3_QuickStart
Array__Find_loop3_reset:
ldy #0x0001
Array__Find_loop3_inc:
lda $.inc
adc $.pThis
sta $.pThis
Array__Find_loop3_0:
txa
Array__Find_loop3_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop3_inc
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop3_inc
// Return
rts
Array__Find_loop4:
lda [$.pCurrent]
tax
ldy #0x0002
bra $+Array__Find_loop4_QuickStart
Array__Find_loop4_reset:
ldy #0x0002
Array__Find_loop4_inc:
lda $.inc
adc $.pThis
sta $.pThis
Array__Find_loop4_0:
txa
Array__Find_loop4_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop4_inc
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop4_inc
// Return
rts
Array__Find_loop5:
lda [$.pCurrent]
tax
ldy #0x0002
bra $+Array__Find_loop5_QuickStart
Array__Find_loop5_reset:
ldy #0x0002
Array__Find_loop5_inc:
lda $.inc
adc $.pThis
sta $.pThis
Array__Find_loop5_0:
txa
Array__Find_loop5_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop5_inc
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop5_inc
iny
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop5_reset
// Return
rts
Array__Find_loop6:
lda [$.pCurrent]
tax
ldy #0x0002
bra $+Array__Find_loop6_QuickStart
Array__Find_loop6_reset:
ldy #0x0002
Array__Find_loop6_inc:
lda $.inc
adc $.pThis
sta $.pThis
Array__Find_loop6_0:
txa
Array__Find_loop6_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop6_inc
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop6_inc
ldy #0x0004
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop6_reset
// Return
rts
Array__Find_loop7:
lda [$.pCurrent]
tax
ldy #0x0002
bra $+Array__Find_loop7_QuickStart
Array__Find_loop7_reset:
ldy #0x0002
Array__Find_loop7_inc:
lda $.inc
adc $.pThis
sta $.pThis
Array__Find_loop7_0:
txa
Array__Find_loop7_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop7_inc
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop7_inc
ldy #0x0004
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop7_reset
iny
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop7_reset
// Return
rts
Array__Find_loop8:
lda [$.pCurrent]
tax
ldy #0x0002
bra $+Array__Find_loop8_QuickStart
Array__Find_loop8_reset:
ldy #0x0002
Array__Find_loop8_inc:
lda $.inc
adc $.pThis
sta $.pThis
Array__Find_loop8_0:
txa
Array__Find_loop8_QuickStart:
eor [$.pThis]
bne $-Array__Find_loop8_inc
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop8_inc
ldy #0x0004
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop8_reset
ldy #0x0006
lda [$.pCurrent],y
eor [$.pThis],y
bne $-Array__Find_loop8_reset
// Return
rts
// ---------------------------------------------------------------------------
Array__FindLow_IncError:
unlock
trap
Exception "Find length too large{}{}{}Array.Find attempted to search for a larger sequence of bytes than programmed for."
.mx 0x00
.func Array__FindLow
// Entry: X = List Pointer, Y = Compare length
// Return: A = 16-bit index of element, or negative (0xf000) if not found
Array__FindLow:
.local =pCurrent
.local =pThis
.local _listPointer
.local _inc
.local _cmpLength
// Save compare length (optimized into Y register only)
//sty $.cmpLength
// Keep list pointer
stx $.listPointer
// Keep current and base address (optimized by merging 2x 24-bit copy)
lda $0x0000,x
sta $.pCurrent
lda $0x0002,x
sta $.pCurrent+2
// Keep base address
//lda $0x0003,x
//sta $.pThis
lda $0x0004,x
sta $.pThis+1
// Keep increment
lda $0x0009,x
sta $.inc
// Error out if cmpLength is too high
cpy #0x0009
bcs $-Array__FindLow_IncError
// Which increment? Supports up to 8 at the moment
// Assume carry clear from "asl a"
tya
asl a
tax
jsr ($_Array__FindLow_calling,x)
// Is it new?
lda $.pCurrent
eor $.pThis
beq $+Array__FindLow_NotFound
ldx $.listPointer
lda $.pThis
sec
sbc $0x0003,x
return
Array__FindLow_NotFound:
dec a
return
Array__FindLow_loop0:
bra $-Array__FindLow_loop0
Array__FindLow_calling:
.data16 _Array__FindLow_loop0
.data16 _Array__FindLow_loop1
.data16 _Array__FindLow_loop2
.data16 _Array__FindLow_loop0
.data16 _Array__FindLow_loop0
.data16 _Array__FindLow_loop0
.data16 _Array__FindLow_loop0
.data16 _Array__FindLow_loop0
.data16 _Array__FindLow_loop0
Array__FindLow_loop1:
ldx $.inc
lda [$.pCurrent]
and #0x00ff
tay
bra $+Array__FindLow_loop1_QuickStart
Array__FindLow_loop1_reset:
Array__FindLow_loop1_inc:
txa
adc $.pThis
sta $.pThis
Array__FindLow_loop1_0:
tya
Array__FindLow_loop1_QuickStart:
sep #0x20
cmp [$.pThis]
ror a
rep #0x31
bpl $-Array__FindLow_loop1_inc
// Return
rts
Array__FindLow_loop2:
ldx $.inc
lda [$.pCurrent]
tay
bra $+Array__FindLow_loop2_QuickStart
Array__FindLow_loop2_reset:
Array__FindLow_loop2_inc:
txa
clc
adc $.pThis
sta $.pThis
Array__FindLow_loop2_0:
tya
Array__FindLow_loop2_QuickStart:
cmp [$.pThis]
bcc $-Array__FindLow_loop2_inc
// Return
rts
// ---------------------------------------------------------------------------
.mx 0x00
.func Array__Clear
// Entry: X = List Pointer
Array__Clear:
.local _p, .p_b
// Copy base address to current address, change to 8-bit midway
lda $0x0003,x
sta $0x0000,x
sta $.p
// Continue in 8-bit mode
sep #0x20
.mx 0x20
lda $0x0005,x
sta $0x0002,x
sta $.p+2
// Zero out first element
lda #0x00
ldy $0x0009,x
Array__Insert_loop1:
dey
sta [$.p],y
bne $-Array__Insert_loop1
rep #0x30
.mx 0x00
return
// ---------------------------------------------------------------------------
Array__Sort_Error:
unlock
trap
Exception "Sort length too large{}{}{}Array.Sort attempted to sort for a larger sequence of bytes than programmed for."
.mx 0x00
.func Array__SortBase
// Entry: X = List Pointer, Y = Compare length
Array__SortBase:
ldy $0x0009,x
// Function override
.pushaddr
call Array__Sort
.pulladdr
.func Array__Sort
Array__Sort:
.local _compareLength
.local _inc, _incX2
.local _firstP
.local _lastP
.local _swapC
// Keep length
sty $.compareLength
// TODO: Support other base length than 2
cpy #2
bne $-Array__Sort_Error
// Keep pointers
lda $0x0003,x
sta $.firstP
lda $0x0009,x
sta $.inc
asl a
sta $.incX2
lda $0x0000,x
sec
sbc $.inc
sta $.lastP
// Does this array contain at least 2 elements?
dec a
cmp $.firstP
bcs $+Array__Sort_in
return
Array__Sort_in:
// Change bank
phb
lda $0x0001,x
pha
plb
plb
.local _bestFirstIndex, _bestLastIndex
.local _bestFirstValue, _bestLastValue
.local _index
Array__Sort_loop1:
// Reset first and last values, also keep loop index in X
ldx $.firstP
stx $.bestLastIndex
stx $.bestFirstIndex
lda $0x0000,x
sta $.bestLastValue
sta $.bestFirstValue
// Start Looking for better first and last
Array__Sort_loop1_loop:
// Load value at this index
lda $0x0000,x
// Is it lower than first value?
cmp $.bestFirstValue
bcs $+Array__Sort_loop1_loop_skipFirst
sta $.bestFirstValue
stx $.bestFirstIndex
Array__Sort_loop1_loop_skipFirst:
// Is it greater than last value?
cmp $.bestLastValue
bcc $+Array__Sort_loop1_loop_skipLast
sta $.bestLastValue
stx $.bestLastIndex
// Optimization for adc
clc
Array__Sort_loop1_loop_skipLast:
// Increment index
txa
adc $.inc
tax
// Have we gone over limit? Optimized '>' because carry is assumed clear
sbc $.lastP
// Next
bcc $-Array__Sort_loop1_loop
Array__Sort_loop1_next:
// Is there an index conflict?
lda $.bestLastIndex
cmp $.firstP
beq $+Array__Sort_loop1_inConflict
lda $.bestFirstIndex
cmp $.lastP
bne $+Array__Sort_loop1_skipConflict
Array__Sort_loop1_inConflict:
// Swap first and last
lda $.bestFirstIndex
ldy $.bestLastIndex
ldx $.incX2
jsr ($_Array__Sort_SwapTable,x)
// Redo this range
jmp $_Array__Sort_loop1
Array__Sort_loop1_skipConflict:
// Swap with first
lda $.bestFirstIndex
cmp $.firstP
beq $+Array__Sort_loop1_skipSwapFirst
ldy $.firstP
ldx $.incX2
jsr ($_Array__Sort_SwapTable,x)
Array__Sort_loop1_skipSwapFirst:
// Swap with last
lda $.bestLastIndex
cmp $.lastP
beq $+Array__Sort_loop1_skipSwapLast
ldy $.lastP
ldx $.incX2
jsr ($_Array__Sort_SwapTable,x)
Array__Sort_loop1_skipSwapLast:
// Decrement last pointer
lda $.lastP
sec
sbc $.inc
sta $.lastP
// Increment first pointer
ldx $.inc
txa
clc
adc $.firstP
sta $.firstP
// Next if first >= last
cmp $.lastP
bcs $+Array__Sort_loop1_exit
jmp $_Array__Sort_loop1
Array__Sort_loop1_exit:
Array__Sort_return:
// Return
plb
return
// Swap 0 to 8 bytes
Array__Sort_SwapTable:
.data16 _Array__Sort_Swap0,
.data16 _Array__Sort_Swap1, _Array__Sort_Swap2, _Array__Sort_Swap3, _Array__Sort_Swap4,
.data16 _Array__Sort_Swap5, _Array__Sort_Swap6, _Array__Sort_Swap7, _Array__Sort_Swap8,
// Entry: A = swapA, X = Free, Y = swapB
Array__Sort_Swap8:
tax
phd
// Swap
lda $0x0000,x
tcd
lda $0x0000,y
sta $0x0000,x
tdc
sta $0x0000,y
lda $0x0002,x
tcd
lda $0x0002,y
sta $0x0002,x
tdc
sta $0x0002,y
lda $0x0004,x
tcd
lda $0x0004,y
sta $0x0004,x
tdc
sta $0x0004,y
lda $0x0006,x
tcd
lda $0x0006,y
sta $0x0006,x
tdc
sta $0x0006,y
// Return
pld
Array__Sort_Swap0:
rts
Array__Sort_Swap6:
tax
phd
// Swap
lda $0x0000,x
tcd
lda $0x0000,y
sta $0x0000,x
tdc
sta $0x0000,y
lda $0x0002,x
tcd
lda $0x0002,y
sta $0x0002,x
tdc
sta $0x0002,y
lda $0x0004,x
tcd
lda $0x0004,y
sta $0x0004,x
tdc
sta $0x0004,y
// Return
pld
rts
Array__Sort_Swap4:
tax
phd
// Swap
lda $0x0000,x
tcd
lda $0x0000,y
sta $0x0000,x
tdc
sta $0x0000,y
lda $0x0002,x
tcd
lda $0x0002,y
sta $0x0002,x
tdc
sta $0x0002,y
// Return
pld
rts
Array__Sort_Swap2:
tax
// Swap
lda $0x0000,x
sta $.swapC
lda $0x0000,y
sta $0x0000,x
lda $.swapC
sta $0x0000,y
// Return
rts
Array__Sort_Swap7:
tax
phd
// Swap
lda $0x0001,x
tcd
lda $0x0001,y
sta $0x0001,x
tdc
sta $0x0001,y
lda $0x0003,x
tcd
lda $0x0003,y
sta $0x0003,x
tdc
sta $0x0003,y
lda $0x0005,x
tcd
lda $0x0005,y
sta $0x0005,x
tdc
sta $0x0005,y
// Swap 8-bit
sep #0x20
.mx 0x20
lda $0x0000,x
xba
lda $0x0000,y
sta $0x0000,x
xba
sta $0x0000,y
// Return
rep #0x20
.mx 0x00
pld
rts
Array__Sort_Swap5:
tax
phd
// Swap
lda $0x0001,x
tcd
lda $0x0001,y
sta $0x0001,x
tdc
sta $0x0001,y
lda $0x0003,x
tcd
lda $0x0003,y
sta $0x0003,x
tdc
sta $0x0003,y
// Swap 8-bit
sep #0x20
.mx 0x20
lda $0x0000,x
xba
lda $0x0000,y
sta $0x0000,x
xba
sta $0x0000,y
// Return
rep #0x20
.mx 0x00
pld
rts
Array__Sort_Swap3:
tax
// Swap
lda $0x0001,x
sta $.swapC
lda $0x0001,y
sta $0x0001,x
lda $.swapC
sta $0x0001,y
// Swap 8-bit
sep #0x20
.mx 0x20
lda $0x0000,x
xba
lda $0x0000,y
sta $0x0000,x
xba
sta $0x0000,y
// Return
rep #0x20
.mx 0x00
rts
Array__Sort_Swap1:
tax
sep #0x20
.mx 0x20
// Swap (23.3 cycles)
lda $0x0000,x
xba
lda $0x0000,y
sta $0x0000,x
xba
sta $0x0000,y
// Return
rep #0x20
.mx 0x00
rts
// ---------------------------------------------------------------------------
Array__DeleteDuplicates_Error:
unlock
trap
Exception "Delete length too large{}{}{}Array.DeleteDuplicates attempted to search for a larger sequence of bytes than programmed for."
.mx 0x00
.func Array__DeleteDuplicates
// Entry: X = List Pointer
Array__DeleteDuplicates:
.local _firstP, _lastP, _oobP, _length
.local _currentP
.local _temp
// Keep list pointer for later
.local _listPointer
stx $.listPointer
// Load first and last pointers
lda $0x0003,x
sta $.firstP
sta $.currentP
lda $0x0000,x
sta $.oobP
sec
sbc $0x0009,x
sta $.lastP
// Load length
ldy $0x0009,x
sty $.length
// Support up to 8 bytes compare
cpy #9
bcs $-Array__DeleteDuplicates_Error
// Change bank and clear carry
sep #0x20
phb
lda $0x0002,x
pha
plb
rep #0x21
// Which increment? Supports up to 8 at the moment
tya
asl a
tax
jsr ($_Array__DeleteDuplicates_calling,x)
// Restore bank
plb
// Change the current top end of this array list
lda $.oobP
sta ($.listPointer)
// Return
return
Array__DeleteDuplicates_calling:
.data16 _Array__DeleteDuplicates_loop0
.data16 _Array__DeleteDuplicates_loop1
.data16 _Array__DeleteDuplicates_loop2
.data16 _Array__DeleteDuplicates_loop3
.data16 _Array__DeleteDuplicates_loop4
.data16 _Array__DeleteDuplicates_loop5
.data16 _Array__DeleteDuplicates_loop6
.data16 _Array__DeleteDuplicates_loop7
.data16 _Array__DeleteDuplicates_loop8
Array__DeleteDuplicates_loop1:
Array__DeleteDuplicates_loop2:
Array__DeleteDuplicates_loop4:
Array__DeleteDuplicates_loop5:
Array__DeleteDuplicates_loop6:
Array__DeleteDuplicates_loop7:
Array__DeleteDuplicates_loop8:
Array__DeleteDuplicates_loop0:
bra $-Array__DeleteDuplicates_loop0
// X = Left element, Y = Right element
Array__DeleteDuplicates_loop3:
// Load lower bytes of current element
ldy $.currentP
tyx
lda $0x0000,x
// Start second loop
bra $+Array__DeleteDuplicates_loop3_loop
Array__DeleteDuplicates_loop3_next:
// Load next element
inx
inx
inx
cpx $.oobP
bcs $-Array__DeleteDuplicates_loop3_loopEnd
txy
// Load lower bytes of current element
lda $0x0000,y
// Start second loop
bra $+Array__DeleteDuplicates_loop3_loop
Array__DeleteDuplicates_loop3_loopReloadA:
lda $0x0000,x
Array__DeleteDuplicates_loop3_loop:
// Next
iny
iny
iny
Array__DeleteDuplicates_loop3_loopRedo:
cpy $.oobP
bcs $-Array__DeleteDuplicates_loop3_next
Array__DeleteDuplicates_loop3_loopCmp:
// Compare lower bytes of both elements
cmp $0x0000,y
bne $-Array__DeleteDuplicates_loop3_loop
lda $0x0001,x
cmp $0x0001,y
bne $-Array__DeleteDuplicates_loop3_loopReloadA
// Write "Top element" into "Right element"
stx $.temp
ldx $.lastP
lda $0x0000,x
sta $0x0000,y
lda $0x0001,x
sta $0x0001,y
// Decrement top by 1 element
stx $.oobP
dex
dex
dex
stx $.lastP
// Continue on the same index
ldx $.temp
lda $0x0000,x
bra $-Array__DeleteDuplicates_loop3_loopRedo
Array__DeleteDuplicates_loop3_loopEnd:
rts
// ---------------------------------------------------------------------------
| 16.844961 | 137 | 0.692913 |
81ccb86ab01d4b0af1b7352e9901661ae03def70 | 599 | asm | Assembly | bddisasm_test/basic/stack_32.asm | andreaswimmer/bddisasm | 960e9eaeee4f87d8269095031cd6cfb8aabb998b | [
"Apache-2.0"
] | 675 | 2020-07-09T12:57:49.000Z | 2022-03-26T15:03:53.000Z | bddisasm_test/basic/stack_32.asm | andreaswimmer/bddisasm | 960e9eaeee4f87d8269095031cd6cfb8aabb998b | [
"Apache-2.0"
] | 41 | 2020-07-22T07:15:07.000Z | 2022-03-23T08:34:28.000Z | bddisasm_test/basic/stack_32.asm | andreaswimmer/bddisasm | 960e9eaeee4f87d8269095031cd6cfb8aabb998b | [
"Apache-2.0"
] | 94 | 2020-07-09T14:39:02.000Z | 2022-03-27T10:37:03.000Z | bits 32
push ax
pop ax
push eax
pop eax
push word 0x7F
push dword 0x7FFF
push word [bx]
pop word [bx]
push word [ebx]
pop word [ebx]
push dword [bx]
pop dword [bx]
push dword [ebx]
pop dword [ebx]
enter 0x10, 0x20
leave
push es
pop es
push ds
pop ds
push ss
pop ss
push fs
pop fs
push gs
pop gs
pusha
popa
pushad
popad
pushfw
popfw
pushfd
popfd | 14.609756 | 24 | 0.427379 |
9f2789d04c12f3ba3570f89b45547defa847fb00 | 4,655 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_219.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_219.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_219.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x11cb5, %rsi
lea addresses_A_ht+0x1283c, %rdi
nop
nop
nop
nop
xor $58810, %r10
mov $118, %rcx
rep movsb
nop
cmp $30136, %rdx
lea addresses_WT_ht+0x13e29, %rsi
lea addresses_normal_ht+0x18c9, %rdi
nop
nop
nop
nop
sub %r14, %r14
mov $114, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r8
push %rcx
push %rdx
push %rsi
// Store
lea addresses_RW+0xd901, %rcx
nop
nop
cmp %r8, %r8
movb $0x51, (%rcx)
nop
nop
nop
nop
add %r14, %r14
// Faulty Load
lea addresses_RW+0x701, %r15
nop
cmp %rdx, %rdx
movb (%r15), %r8b
lea oracles, %r15
and $0xff, %r8
shlq $12, %r8
mov (%r15,%r8,1), %r8
pop %rsi
pop %rdx
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_RW', 'AVXalign': False, 'size': 1}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 48.489583 | 2,999 | 0.662084 |
54f411386a8a3e7a2c9eefeef06bebf06529b847 | 569 | asm | Assembly | oeis/184/A184882.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/184/A184882.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/184/A184882.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A184882: a(n)=1-4*n-4*n^2.
; 1,-7,-23,-47,-79,-119,-167,-223,-287,-359,-439,-527,-623,-727,-839,-959,-1087,-1223,-1367,-1519,-1679,-1847,-2023,-2207,-2399,-2599,-2807,-3023,-3247,-3479,-3719,-3967,-4223,-4487,-4759,-5039,-5327,-5623,-5927,-6239,-6559,-6887,-7223,-7567,-7919,-8279,-8647,-9023,-9407,-9799,-10199,-10607,-11023,-11447,-11879,-12319,-12767,-13223,-13687,-14159,-14639,-15127,-15623,-16127,-16639,-17159,-17687,-18223,-18767,-19319,-19879,-20447,-21023,-21607,-22199,-22799,-23407,-24023,-24647,-25279,-25919,-26567
add $0,1
bin $0,2
mul $0,-8
add $0,1
| 71.125 | 501 | 0.653779 |
233386b5b55c1f676f76d93f526b529fe4a10804 | 709 | asm | Assembly | programs/oeis/313/A313786.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/313/A313786.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/313/A313786.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A313786: Coordination sequence Gal.4.128.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,10,15,21,26,32,36,43,46,54,56,65,66,76,76,87,86,98,96,109,106,120,116,131,126,142,136,153,146,164,156,175,166,186,176,197,186,208,196,219,206,230,216,241,226,252,236,263,246
mov $2,$0
mov $3,2
mov $5,$0
mov $8,$0
mov $11,$0
lpb $2,1
mod $5,2
mov $4,$5
mov $6,$8
mov $7,$2
lpb $5,1
trn $5,$2
mov $7,1
lpe
lpb $6,1
mov $2,$4
add $4,$6
sub $6,$2
mov $10,$7
sub $10,1
mov $3,$10
trn $6,2
lpe
sub $2,1
lpe
div $3,2
add $3,25
mov $1,$3
sub $1,25
mov $9,$11
mul $9,5
add $1,$9
| 19.694444 | 179 | 0.605078 |
bedb157b1855ebda19021820516df22628e3db51 | 448 | asm | Assembly | oeis/271/A271944.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/271/A271944.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/271/A271944.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A271944: Expansion of 2*x*(1 + x)/(1 - x - 9*x^2 + x^3).
; Submitted by Jamie Morken(s4)
; 0,2,4,22,56,250,732,2926,9264,34866,115316,419846,1422824,5086122,17471692,61823966,213983072,752927074,2616950756,9179311350,31978941080,111975792474,390606950844,1366410142030,4769896907152,16676981234578,58239643256916
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $3,8
add $4,$1
add $1,$3
add $2,1
mov $3,$4
mov $4,$2
lpe
mov $0,$3
mul $0,2
| 24.888889 | 223 | 0.691964 |
ea123bb6b2f492168f33f006805696d4c4dbb221 | 436 | asm | Assembly | oeis/131/A131553.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/131/A131553.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/131/A131553.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A131553: a(n) = Product_{k=1..n, gcd(k,n)=1} (1+k).
; Submitted by Christian Krause
; 2,2,6,8,120,12,5040,384,12960,640,39916800,1152,6227020800,80640,5443200,10321920,355687428096000,290304,121645100408832000,38707200,384758035200,6812467200,25852016738884976640000,139345920
add $0,1
mov $1,1
mov $2,$0
lpb $0
mov $3,$2
gcd $3,$0
pow $3,$0
mov $4,$0
sub $0,1
div $4,$3
mov $3,$4
mul $3,$1
add $1,$3
lpe
mov $0,$1
| 21.8 | 192 | 0.672018 |
24fca9ffeafd86200253febcb49027893fb72e1d | 8,783 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1292.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1292.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1292.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 %r15
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x9222, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
add %r15, %r15
movb (%rcx), %bl
sub $41906, %r8
lea addresses_WT_ht+0xc7fa, %r13
nop
nop
xor $1847, %r12
movb $0x61, (%r13)
nop
nop
nop
cmp %r8, %r8
lea addresses_UC_ht+0x1efa, %r13
nop
nop
nop
inc %r12
mov (%r13), %r8
nop
nop
add $40846, %r15
lea addresses_WC_ht+0xfefa, %r13
nop
inc %r15
movw $0x6162, (%r13)
nop
nop
nop
inc %rax
lea addresses_D_ht+0x110fa, %r12
nop
nop
nop
nop
nop
add $42804, %r13
and $0xffffffffffffffc0, %r12
movntdqa (%r12), %xmm5
vpextrq $1, %xmm5, %rbx
nop
nop
nop
xor $35350, %r13
lea addresses_normal_ht+0x1d96a, %r13
nop
nop
nop
add %r12, %r12
movw $0x6162, (%r13)
nop
nop
nop
add %r8, %r8
lea addresses_D_ht+0x1dd3a, %rsi
lea addresses_A_ht+0x16bf8, %rdi
clflush (%rsi)
nop
nop
nop
nop
cmp $14329, %r13
mov $78, %rcx
rep movsb
nop
add $13456, %r12
lea addresses_WC_ht+0x1e10a, %rax
clflush (%rax)
nop
xor %rdi, %rdi
movb $0x61, (%rax)
nop
nop
nop
nop
nop
cmp %r13, %r13
lea addresses_UC_ht+0x76fa, %rsi
nop
nop
nop
cmp $43034, %r12
mov (%rsi), %eax
nop
lfence
lea addresses_normal_ht+0x1e6fa, %rsi
nop
nop
inc %rcx
movups (%rsi), %xmm1
vpextrq $1, %xmm1, %rdi
nop
and $2579, %r15
lea addresses_D_ht+0x138ee, %r13
nop
nop
nop
and %rdi, %rdi
mov (%r13), %r15w
nop
nop
nop
nop
sub %r15, %r15
lea addresses_WC_ht+0x6f4a, %rax
nop
nop
nop
inc %rcx
movl $0x61626364, (%rax)
nop
nop
nop
nop
nop
add $53904, %rbx
lea addresses_WT_ht+0x15bfa, %rsi
lea addresses_WC_ht+0x22fa, %rdi
nop
nop
nop
add %r15, %r15
mov $55, %rcx
rep movsl
nop
sub %rbx, %rbx
lea addresses_UC_ht+0xac3a, %rsi
add $62501, %r12
mov $0x6162636465666768, %rcx
movq %rcx, %xmm7
vmovups %ymm7, (%rsi)
nop
nop
nop
nop
dec %r12
lea addresses_WT_ht+0x182fa, %rsi
lea addresses_D_ht+0x82fa, %rdi
clflush (%rdi)
nop
nop
nop
nop
add $14690, %rax
mov $3, %rcx
rep movsw
nop
nop
nop
nop
nop
inc %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r8
push %r9
push %rbx
push %rcx
// Store
lea addresses_RW+0x11efa, %r12
nop
nop
nop
inc %r9
mov $0x5152535455565758, %r15
movq %r15, %xmm7
movups %xmm7, (%r12)
nop
nop
add %rcx, %rcx
// Store
mov $0x163d47000000076a, %rcx
nop
nop
nop
nop
nop
cmp %r8, %r8
mov $0x5152535455565758, %r10
movq %r10, %xmm7
movups %xmm7, (%rcx)
nop
nop
nop
nop
dec %rcx
// Store
lea addresses_RW+0xea1e, %rcx
nop
nop
and %r12, %r12
mov $0x5152535455565758, %r10
movq %r10, %xmm0
movups %xmm0, (%rcx)
cmp $61343, %r15
// Store
lea addresses_UC+0x1553a, %r9
inc %rbx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm1
vmovups %ymm1, (%r9)
nop
nop
nop
and %rbx, %rbx
// Faulty Load
lea addresses_WT+0x146fa, %r15
nop
nop
nop
nop
and %r10, %r10
mov (%r15), %bx
lea oracles, %r8
and $0xff, %rbx
shlq $12, %rbx
mov (%r8,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'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
*/
| 30.078767 | 2,999 | 0.654105 |
54f11cce0c23d666f05f4097bd5fd16d0983acce | 704 | asm | Assembly | exec/sample.asm | rfblue2/pic-disassembler | 24f22fb81c96b78a95c8580489087a119ef0dccf | [
"Unlicense"
] | 16 | 2018-02-09T11:29:07.000Z | 2021-12-20T23:41:25.000Z | exec/sample.asm | rfblue2/pic-disassembler | 24f22fb81c96b78a95c8580489087a119ef0dccf | [
"Unlicense"
] | null | null | null | exec/sample.asm | rfblue2/pic-disassembler | 24f22fb81c96b78a95c8580489087a119ef0dccf | [
"Unlicense"
] | 1 | 2018-09-12T09:19:56.000Z | 2018-09-12T09:19:56.000Z | #include <p16f877A.inc>
ORG 0
GOTO main
ORG 4
GOTO isr
main:
BANKSEL TRISB
MOVLW 0xFF
MOVWF TRISB
BANKSEL PORTB
CLRF PORTB
BANKSEL TRISD
CLRF TRISD
BANKSEL PORTD
CLRF PORTD
BANKSEL INTCON
BSF INTCON, 7
BSF INTCON, 3
BSF INTCON, 4
BANKSEL OPTION_REG
BSF OPTION_REG, 6
loop:
BTFSS PORTC, 0
GOTO loop
GOTO reset_led
reset_led:
BTFSC PORTC, 0
GOTO reset_led
BCF PORTD, 0
BCF PORTD, 4
BCF PORTD, 5
BCF PORTD, 7
GOTO loop
isr:
BCF INTCON, RBIF
BCF INTCON, INTF
BANKSEL PORTB
BANKSEL PORTD
BTFSC PORTB,0
BSF PORTD,0
BTFSC PORTB,4
BSF PORTD,4
BTFSC PORTB,5
BSF PORTD,5
BTFSC PORTB,7
BSF PORTD,7
RETFIE
END
| 12.571429 | 24 | 0.664773 |
d245c3a9c95f84d5b67d798412f223e295509f62 | 9,409 | asm | Assembly | targets/armv7/bmptk_arm_startup.asm | FStoeltie/themaopdracht04 | d1c3a9d29fac778d7675b48b14b51c3d7498d228 | [
"BSL-1.0"
] | null | null | null | targets/armv7/bmptk_arm_startup.asm | FStoeltie/themaopdracht04 | d1c3a9d29fac778d7675b48b14b51c3d7498d228 | [
"BSL-1.0"
] | null | null | null | targets/armv7/bmptk_arm_startup.asm | FStoeltie/themaopdracht04 | d1c3a9d29fac778d7675b48b14b51c3d7498d228 | [
"BSL-1.0"
] | null | null | null | #define mkt_fatal__unhandled_undefined_instruction 19
#define mkt_fatal__unhandled_software_interrupt 20
#define mkt_fatal__unhandled_prefetch_abort 21
#define mkt_fatal__unhandled_data_abort 22
#define mkt_fatal__unhandled_reserved 23
#define mkt_fatal__unhandled_IRQ 24
#define mkt_fatal__unhandled_FIQ 25
#define mkt_fatal__memory_allocation_failure 26
#define mkt_fatal__return_from_main 27
#define mkt_fatal__invalid_pin_number 28
#define mkt_fatal__out_of_interrupt_slots 29
//==================================================================
//
// default fatal error handler
//
// The default mkt_user_error_vector just jumps back to
// mkt_fatal_error because there is nothing more usefull to do.
// You can have the mkt_user_error_handler point to a routine
// of your choice, but don't assume too much in that routine
// (state of peripherals, processor state, availability of a
// stack, etc.).
//
// TIP: Set a breakpoint on mkt_fatal_error to identify
// fatal errors.
// When it hits, examine R0 to find the cause.
// The Insight debugger by default sets a breakpoint at 'exit',
// hence that label is defined equal to mkt_fatal_error.
//
//==================================================================
#if mkt_error_handling == 0
// suppress all error handling code
.macro mkt_fatal, NN
// no error handling code
.endm
#endif
#if mkt_error_handling != 0
.macro mkt_fatal, NN
mov R0, #\NN
bl mkt_fatal_error
.endm
#endif
// start of a section of assembler code that can be placed in ROM
.macro mkt_code
.text
.align
.arm
.endm
// start of a section for read/write,
// explicitly initialised data
.macro mkt_data
.data
.align
.endm
.macro mkt_uninitialized
.section .uninitialized
.align
.endm
// start of a section for read/write,
// 0-initialised data
.macro mkt_bss
.bss
.align
.endm
// start of a section for read-only, initialised data
.macro mkt_rodata
.text
.align
.endm
// this used to give problems with Insight, I have no idea why.
// but with the new gcc and gdb these seem to be solved
.macro mkt_code_separate_section, Name
.text
.section .text.\Name,"ax"
.arm
.align
.endm
//==================================================================
//
// ARM exception vectors
//
// The "vectors" section is mapped to a 64-byte memory area that is
// handled in a special way: when running from ROM its content is
// first copied to RAM and next that RAM area is remapped to
// address 0.
// This makes it possible for a running program to change the
// exception (interrupt) vectors
//
//==================================================================
// this section is handled in a special way by the link script
.section vectors, "awx"
.arm
.align
.global __startup
__startup:
// the ARM exception vectors, at physical address 0
ldr pc, mkt_reset_vector
ldr pc, mkt_undefined_instruction_vector
ldr pc, mkt_software_interrupt_vector
ldr pc, mkt_prefetch_abort_vector
ldr pc, mkt_data_abort_vector
ldr pc, mkt_reserved_vector
.global irq_vec
irq_vec:
ldr pc, mkt_reserved_vector // b _mkt_IRQ_interrupt_handler
// ldr pc, mkt_IRQ_vector
ldr pc, mkt_FIQ_vector
.global mkt_reset_vector
.global mkt_undefined_instruction_vector
.global mkt_software_interrupt_vector
.global mkt_prefetch_abort_vector
.global mkt_data_abort_vector
.global mkt_reserved_vector
.global mkt_IRQ_vector
.global mkt_FIQ_vector
//==================================================================
//
// The following vectors are variables that contain the addresses
// the various execptions will jump to. Change the content of a
// vector to redirect the corresponding exception.
//
//==================================================================
mkt_reset_vector: .word mkt_reset_handler
mkt_undefined_instruction_vector: .word 0
mkt_software_interrupt_vector: .word 0
mkt_prefetch_abort_vector: .word 0
mkt_data_abort_vector: .word 0
mkt_reserved_vector: .word 0
// mkt_IRQ_vector: .word unexp_exc_handler_6
mkt_IRQ_vector: .word 0
mkt_FIQ_vector: .word 0
//==================================================================
//
// default unexpected exception handlers
//
// These handlers just load a unique value into R0 and jumps
// to the mkt_fatal_error handler.
//
//==================================================================
mkt_code
mkt_reset_handler:
/*
//==================================================================
//
// set stacks
//
// note: Early ARM ARM erroneously stated that msr cpsr_c, <imm>
// is not an allowed form, and this error can still be found for
// instance in Furber's book.
// ref: http://www.arm.com/support/faqdev/1472.html
//
//==================================================================
mkt_uninitialized
.global _mkt_first_free
_mkt_first_free: .space 4
mkt_code
// get first free location
ldr r6, = _mkt_first_free
ldr r5, = mkt_ln_bss_beyond;
// ldr r5, [ r6 ]
str r5, [ r6 ]
#define MKT_FIQ_STACK_SIZE 2048
#define MKT_IRQ_STACK_SIZE 2048
#define MKT_MAIN_STACK_SIZE 2048
#define ROUND_UP( N, M ) ((N + (M-1)) & ~ (M-1))
// select supervisor mode
msr cpsr_c, #0x13
nop
// select supervisor mode
//msr cpsr_c, #0xD3
//nop
// claim stack area
add r5, r5, #ROUND_UP(MKT_MAIN_STACK_SIZE, 4 )
// set stack pointer
mov sp, r5
// update the 'free ram' pointer
str r5, [ r6 ]
//==================================================================
// clear BSS (non-initialized variables)
//==================================================================
mov r0, #0
ldr r1, = mkt_ln_bss_first
ldr r2, = mkt_ln_bss_beyond
clear_bss_loop:
cmp r1, r2
beq clear_bss_beyond
str r0, [ r1 ], #4
b clear_bss_loop
clear_bss_beyond:
//==================================================================
// copy DATA segment (initialised data, RAM code) from ROM to RAM
//==================================================================
ldr r1, = mkt_ln_data_rom_first
ldr r2, = mkt_ln_data_ram_first
ldr r3, = mkt_ln_data_ram_beyond
copy_data_loop:
cmp r3, r2
beq copy_data_beyond
ldr r0, [ r1 ], #4
str r0, [ r2 ], #4
b copy_data_loop
copy_data_beyond:
//==================================================================
//
// select fast or slow GPIO access
//
//==================================================================
#ifdef SCS
#if mkt_fast_gpio == 1
mov r0, #3
#else
mov r0, #0
#endif
ldr r1, =SCS
str r0, [ r1 ]
#endif
//==================================================================
// call main (= the application)
//==================================================================
*/
mov r0, #0 // no arguments
mov r1, #0 // no argv either
bl main
| 35.37218 | 86 | 0.434265 |
44beddd9b4d28a17eb5f7753a02f16c373d9564c | 128 | asm | Assembly | WangShuang_book/my.asm | SmirnovKol/Learning_x86_assembly_language | 239b2fb60d6df87316b98184c9c6b6f36940ccbe | [
"MIT"
] | 1 | 2018-11-21T23:34:24.000Z | 2018-11-21T23:34:24.000Z | WangShuang_book/my.asm | SmirnovKol/Learning_x86_assembly_language | 239b2fb60d6df87316b98184c9c6b6f36940ccbe | [
"MIT"
] | null | null | null | WangShuang_book/my.asm | SmirnovKol/Learning_x86_assembly_language | 239b2fb60d6df87316b98184c9c6b6f36940ccbe | [
"MIT"
] | null | null | null | assume cs:codesg
codesg segment
mov ax,0123H
mov bx,0456H
add ax,bx
add ax,ax
mov ax,4c00H
int 21H
codesg ends
end
| 8 | 16 | 0.703125 |
dce2f76707a08459a075eff95637339041067c53 | 4,976 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_991.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_991.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_991.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xf73c, %r9
clflush (%r9)
nop
nop
nop
nop
sub $8373, %r14
mov $0x6162636465666768, %rdx
movq %rdx, %xmm6
movups %xmm6, (%r9)
nop
cmp %r10, %r10
lea addresses_normal_ht+0x1e85e, %rdi
nop
nop
nop
nop
cmp %r8, %r8
mov $0x6162636465666768, %r14
movq %r14, %xmm5
and $0xffffffffffffffc0, %rdi
vmovaps %ymm5, (%rdi)
nop
nop
add %r10, %r10
lea addresses_A_ht+0x178bc, %rdx
nop
sub $673, %rbp
movb (%rdx), %r8b
nop
xor $57881, %r9
lea addresses_UC_ht+0x143bc, %rsi
lea addresses_D_ht+0x1b7dc, %rdi
nop
nop
sub $46395, %r10
mov $98, %rcx
rep movsw
nop
nop
nop
nop
sub $55889, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r8
push %rbp
push %rsi
// Faulty Load
lea addresses_D+0xdf3c, %r13
nop
nop
nop
nop
dec %r11
movb (%r13), %r10b
lea oracles, %r11
and $0xff, %r10
shlq $12, %r10
mov (%r11,%r10,1), %r10
pop %rsi
pop %rbp
pop %r8
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_normal_ht', 'congruent': 1}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 6}}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 6, 'type': 'addresses_UC_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 45.651376 | 2,999 | 0.66258 |
88f13e84edbb41c547b66ecf7d9daace08669580 | 3,581 | asm | Assembly | Driver/Printer/PScript/qmsColorScriptf35Info.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/PScript/qmsColorScriptf35Info.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/PScript/qmsColorScriptf35Info.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z |
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1993 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: PostScript driver
FILE: qmsColorScriptf35Info.asm
AUTHOR: Dave Durran 13 April 1993
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 4/13/93 Initial revision parsed from pscriptNecColor.asm
DESCRIPTION:
This file contains the device information for the PostScript printer:
QMS ColorScript
Other Printers Supported by this resource:
$Id: qmsColorScriptf35Info.asm,v 1.1 97/04/18 11:56:13 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
qmsColorScriptf35Info segment resource
; info blocks
PrinterInfo < ; ---- PrinterType -------------
< PT_RASTER, BMF_4CMYK>,
; ---- PrinterConnections ------
< IC_NO_IEEE488,
CC_NO_CUSTOM,
SC_SCSI,
RC_RS232C,
CC_CENTRONICS,
FC_FILE,
AC_APPLETALK >,
; ---- PrinterSmarts -----------
PS_PDL,
;-------Custom Entry Routine-------
NULL,
;-------Custom Exit Routine-------
NULL,
; ---- Mode Info Offsets -------
NULL,
NULL,
offset qmsColorScriptf35hires,
NULL,
NULL,
; ---- Font Geometry -----------
NULL,
; ---- Symbol Set list -----------
NULL,
; ---- PaperMargins ------------
< PR_MARGIN_LEFT, ; Tractor Margins
PR_MARGIN_TRACTOR,
PR_MARGIN_RIGHT,
PR_MARGIN_TRACTOR >,
< PR_MARGIN_LEFT, ; ASF Margins
72,
PR_MARGIN_RIGHT,
72 >,
; ---- PaperInputOptions -------
< MF_MANUAL1,
TF_NO_TRACTOR,
ASF_TRAY1 >,
; ---- PaperOutputOptions ------
< OC_COPIES,
PS_REVERSE,
OD_SIMPLEX,
SO_NO_STAPLER,
OS_NO_SORTER,
OB_NO_OUTPUTBIN >,
;
612, ; paper width (points).
NULL, ; Main UI
NoSettingsDialogBox, ; Options UI
offset PrintEvalDummyASF ; UI eval Routine
>
;----------------------------------------------------------------------------
; Graphics modes info
;----------------------------------------------------------------------------
qmsColorScriptf35hires GraphicsProperties < 300, ; xres
300, ; yres
1, ; band height
1, ; buff height
1, ; interleaves
BMF_24BIT, ; color format
NULL > ; color correct
;----------------------------------------------------------------------------
; PostScript Info
;----------------------------------------------------------------------------
; This structure holds PostScript-specific info about the printer. It
; *must* be placed directly after the hires GraphicProperties struct
PSInfoStruct <
PSFL_STANDARD_35C, ; PSFontList
0x9001, ; PSLevel flags
; 9=PSL_CMYK or PSL_FILE
COLORSCRIPT_PROLOG_LEN, ; prolog length
offset qmsColorScriptf35Prolog ; ptr to prolog
> ; (see pscriptConstant.def)
qmsColorScriptf35Prolog label byte
char "GWDict begin", NL
char "/SDC { 85 35 currentscreen 3 1 roll pop pop setscreen", NL
char "{} setblackgeneration {} setundercolorremoval }bdef", NL
char "end", NL
qmsColorScriptf35EndProlog label byte
COLORSCRIPT_PROLOG_LEN equ offset qmsColorScriptf35EndProlog - offset qmsColorScriptf35Prolog
qmsColorScriptf35Info ends
| 29.113821 | 94 | 0.511589 |
4569dfe6e95d30ef2b2b198b90c2fc947645575a | 380 | asm | Assembly | programs/oeis/301/A301721.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/301/A301721.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/301/A301721.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A301721: Partial sums of A301720.
; 1,7,16,34,55,79,115,151,190,244,295,349,421,487,556,646,727,811,919,1015,1114,1240,1351,1465,1609,1735,1864,2026,2167,2311,2491,2647,2806,3004,3175,3349,3565,3751,3940,4174,4375,4579,4831,5047,5266,5536,5767,6001,6289,6535,6784,7090,7351,7615,7939,8215,8494,8836
cal $0,298790 ; Partial sums of A298788.
div $0,2
mov $1,$0
mul $1,3
add $1,1
| 42.222222 | 264 | 0.742105 |
b4838c0059a82f882d96c42fbc786d5c54bf4037 | 759 | asm | Assembly | oeis/176/A176174.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/176/A176174.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/176/A176174.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A176174: Starting with 1, multiply the n-th term by 10, then subtract the sum of all terms up to and including the n-th, to make the (n+1)th term.
; Submitted by Jon Maiga
; 1,9,80,710,6300,55900,496000,4401000,39050000,346490000,3074400000,27279100000,242047000000,2147679000000,19056320000000,169086410000000,1500300900000000,13312144900000000,118118440000000000,1048062951000000000,9299445110000000000,82513821590000000000,732143764800000000000,6496299432100000000000,57641556673000000000000,511452572409000000000000,4538110157360000000000000,40266575849510000000000000,357284656921500000000000000,3170180810719900000000000000,28128961537984000000000000000
add $0,1
mov $3,1
lpb $0
sub $0,1
sub $3,$2
add $2,$3
mul $3,10
lpe
mov $0,$3
div $0,10
| 50.6 | 487 | 0.832675 |
26c78b1d1958b32e3e80fbdf7f3b01c5668f5e55 | 1,889 | asm | Assembly | payload.asm | janding/lzfx-boot | 88b159660237ad6ef0a20b79d7cb6167a873f037 | [
"BSD-2-Clause"
] | 5 | 2017-08-13T06:13:49.000Z | 2021-08-19T23:27:10.000Z | payload.asm | janding/lzfx-boot | 88b159660237ad6ef0a20b79d7cb6167a873f037 | [
"BSD-2-Clause"
] | null | null | null | payload.asm | janding/lzfx-boot | 88b159660237ad6ef0a20b79d7cb6167a873f037 | [
"BSD-2-Clause"
] | 1 | 2020-04-18T01:35:06.000Z | 2020-04-18T01:35:06.000Z | ; Offset where the bootloader will put this after unpacking
org 0x7e00
; Print the message
xor ax, ax
mov ds, ax
mov si, msg
print:
lodsb
test al, al
jz .done
mov ah, 0x0e
int 0x10
jmp print
.done:
jmp $
; ASCII art of a bean
msg:
db " DICKB", 13, 10
db " UTTDICKBUTTD", 13, 10
db " ICKBUT TDIC", 13, 10
db " KBUTTDIC KBU", 13, 10
db " TTDICKBUT TDICKBU TT", 13, 10
db " DIC KBUTT DICKBUTTDIC", 13, 10
db " KBUTTDICKB UTTDICKBUTT", 13, 10
db " DIC KBUTTDICK BUT", 13, 10
db " TDI CKB", 13, 10
db " UTT DIC", 13, 10
db " KB UTTDI CKB", 13, 10
db " UT TDICK BU TTDICK", 13, 10
db " BU TTDI CKB UTTD IC", 13, 10
db " KB UTTD ICKBUTTDIC KBUT TDI", 13, 10
db " CK BUT TD IC KBUTT DIC", 13, 10
db " KBU TTDICK BUTTDICKB UTT", 13, 10
db " DI CKBUTTD ICKB UTTD", 13, 10
db " ICK BU TT DIC KBUT", 13, 10
db " TDIC KB UTT DI", 13, 10
db " C KBUTT DI CKBUTTDI", 13, 10
db " CKBUTTD ICKBUTTDIC KB UTT", 13, 10
db " DI CKBUT TDICKBUTTDICKBUT", 13, 10
db " TDICK BUTTDI CK", 13, 10
db " BU TTD IC", 13, 10
db " KBUTT", 0 | 42.931818 | 75 | 0.353097 |
421c08832dcf0b83622d89524a0f8d208ab598dc | 74 | asm | Assembly | test/du2.asm | kspalaiologos/asmbf | c98a51d61724a46855de291a27d68a49a034810b | [
"MIT"
] | 67 | 2020-08-03T06:26:35.000Z | 2022-03-24T19:50:51.000Z | test/du2.asm | pyautogui/asmbf | 37c54a8a62df2fc4bab28bdeb43237b4905cbecd | [
"MIT"
] | 55 | 2019-10-02T19:37:08.000Z | 2020-06-12T19:40:53.000Z | test/du2.asm | pyautogui/asmbf | 37c54a8a62df2fc4bab28bdeb43237b4905cbecd | [
"MIT"
] | 9 | 2019-05-18T11:59:41.000Z | 2020-06-21T20:40:25.000Z | psh .0
psh .1
dp2
pop r1
pop r2
out r1
out r2
pop r1
pop r2
out r1
out r2
| 6.166667 | 6 | 0.689189 |
5500520fcecad7d287cd1b656a8049e0fd7cfdf7 | 1,808 | asm | Assembly | src/spread/main/wsiz.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/spread/main/wsiz.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/spread/main/wsiz.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | ; calculate window size
include win1_mac_oli
include win1_keys_wdef_long
include win1_keys_wman
include win1_keys_wwork
include win1_keys_wstatus
section utility
xdef qwm_wsiz
xdef qwm_rset
;+++
; re-setup a window into a given definition
;
; Entry Exit
; d1.l size (or 0, or -1) position
; a2 wman vector
; a4 wwork
;---
qwm_rset subr a0/a1/a3/d3/d2
move.l ww_chid(a4),a0 ; channel id
move.l ww_wstat(a4),a1 ; window status area
move.l ww_wdef(a4),a3 ; window defintion
move.l ws_ptpos(a1),d3 ; absolute pointer position
move.l ww_xorg(a4),d2 ; origin of window..
sub.l d2,d3 ; ptr pos in primary
add.l ww_xsize(a4),d2 ; ..bottom right hand corner
bsr.s qwm_wsiz ; check window size
xjsr ut_wm_setup ; setup window
move.l d3,ww_xorg(a4) ; adjust pointer position
sub.l ww_xsize(a4),d2 ; get new origin
add.l d3,d2 ; rel. by ptr pos
move.l d2,d1
subend
;+++
; calculate window size
;
; Entry Exit
; d1.l size (or -1 for max) new size
; a0 channel id
; a3 wdef
;---
qwm_wsiz subr d2/d3/a3
move.b wd_wattr+wda_shdd(a3),d0 ; shadow x
ext.w d0
mulu #ww.shadx,d0
move.w d0,d2
swap d2
move.b wd_wattr+wda_shdd(a3),d0 ; shadow y
ext.w d0
mulu #ww.shady,d0
move.w d0,d2
move.w wd_wattr+wda_borw(a3),d0 ; border x
lsl.w #1,d0
swap d0
move.w wd_wattr+wda_borw(a3),d0 ; border y
lsl.l #1,d0
add.l d0,d2 ; d2 border/shadow pixels
move.l d1,d3 ; d3 requested size
bpl.s siz_ok
move.l #$7fff7fff,d3
siz_ok
xjsr ut_gwlma ; d1 screen limits
beq.s siz_ok1
xjmp ut_appr
siz_ok1
sub.l d2,d1 ; ...less border/shadow
xjsr row_siz
cmp.w d3,d1
bge.s y_ok
move.w d1,d3
y_ok
swap d3
swap d1
cmp.w d3,d1
bge.s x_ok
move.w d1,d3
x_ok
andi.w #-4,d3 ; x size multiple of 4
swap d3
move.l d3,d1
moveq #0,d0
exit subend
end
| 17.72549 | 52 | 0.688053 |
3d69e585c581e0b562a21e15bd6fe266af252277 | 301 | asm | Assembly | oeis/282/A282692.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/282/A282692.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/282/A282692.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A282692: a(n) = maximal number of nonzero real roots of any of the 3^(n+1) polynomials c_0 + c_1*x + c_2*x^2 + ... + c_n*x^n where the coefficients c_i are -1, 0, or 1.
; 0,1,2,3,3,3,4,5,5,5,5,5,6,7,7
mov $1,1
lpb $0
trn $0,$1
add $1,$0
trn $0,1
sub $1,$0
add $1,1
lpe
mov $0,$1
sub $0,1
| 21.5 | 170 | 0.578073 |
5490e26e4e872d209ef12a844333e5cb5c07dc79 | 863 | asm | Assembly | oeis/200/A200752.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/200/A200752.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/200/A200752.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A200752: Expansion of (-x^2 + 3*x - 1)/(x^3 - x^2 + 3*x - 1).
; 1,0,0,1,3,8,22,61,169,468,1296,3589,9939,27524,76222,211081,584545,1618776,4482864,12414361,34378995,95205488,263651830,730128997,2021940649,5599344780,15506222688,42941263933,118916913891,329315700428,911971451326,2525515567441,6993890951425,19368128738160,53636010830496,148533794704753,411333502021923,1139102722191512,3154508459257366,8735756157602509,24191862735741673,66994340508879876,185526914948500464,513778267072363189,1422802226777468979,3940155328208544212,10911442024920526846
mov $3,$0
mov $5,2
lpb $5
mov $0,$3
sub $5,1
add $0,$5
sub $0,1
trn $0,1
seq $0,98182 ; a(n) = 3*a(n-1) - a(n-2) + a(n-3), a(0)=1,a(1)=1,a(2)=3.
mul $0,10
add $0,10
mov $2,$5
mov $4,$0
lpb $2
mov $1,$4
sub $2,1
lpe
lpe
lpb $3
sub $1,$4
mov $3,0
lpe
div $1,20
mov $0,$1
| 30.821429 | 492 | 0.710313 |
88d585e35de83896a9ecf49cff4f78fed8f1a150 | 2,906 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_45_735.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_45_735.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_45_735.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %r9
push %rax
push %rbp
push %rdi
push %rdx
lea addresses_WT_ht+0x1021d, %r11
nop
sub %rdx, %rdx
movb (%r11), %r9b
nop
and %rdi, %rdi
lea addresses_D_ht+0x60fd, %r11
nop
nop
nop
nop
nop
sub $47187, %rax
mov (%r11), %r15w
nop
nop
xor %r15, %r15
lea addresses_UC_ht+0x17c1d, %r9
nop
nop
add %rdx, %rdx
mov (%r9), %rdi
nop
nop
nop
and %r11, %r11
lea addresses_UC_ht+0x1caab, %rdx
nop
nop
cmp %rbp, %rbp
movw $0x6162, (%rdx)
nop
nop
and $10488, %rdi
pop %rdx
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %r9
push %rbx
push %rcx
push %rsi
// Store
mov $0x321, %r10
nop
nop
xor $28523, %rbx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm5
movups %xmm5, (%r10)
nop
nop
add %rcx, %rcx
// Store
lea addresses_RW+0x101dd, %r9
nop
nop
xor $36648, %r8
mov $0x5152535455565758, %r12
movq %r12, %xmm7
vmovups %ymm7, (%r9)
nop
nop
nop
nop
add %r9, %r9
// Load
mov $0x214ec2000000001d, %r10
nop
nop
nop
nop
nop
and %rbx, %rbx
movups (%r10), %xmm0
vpextrq $1, %xmm0, %rsi
nop
add %rbx, %rbx
// Load
lea addresses_PSE+0x8c1d, %r8
nop
nop
nop
dec %r9
mov (%r8), %r12w
sub $40503, %r8
// Faulty Load
lea addresses_PSE+0x3e1d, %rcx
nop
nop
nop
nop
nop
add %rbx, %rbx
movb (%rcx), %r9b
lea oracles, %r8
and $0xff, %r9
shlq $12, %r9
mov (%r8,%r9,1), %r9
pop %rsi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'33': 45}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 19.245033 | 134 | 0.63627 |
32d172d855d3b82894be18ade6356c3595210485 | 922 | asm | Assembly | programs/oeis/001/A001316.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/001/A001316.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/001/A001316.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A001316: Gould's sequence: a(n) = Sum_{k=0..n} (binomial(n,k) mod 2); number of odd entries in row n of Pascal's triangle (A007318); 2^A000120(n).
; 1,2,2,4,2,4,4,8,2,4,4,8,4,8,8,16,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,8,16,16,32,16,32,32,64,16,32,32,64,32,64,64,128,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,8,16,16,32,16,32,32,64,16,32,32,64,32,64,64,128,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,8,16,16,32,16,32,32,64,16,32,32,64,32,64,64,128,8,16,16,32,16,32,32,64,16,32,32,64,32,64,64,128,16,32,32,64,32,64,64,128,32,64
mov $1,$0
lpb $0
div $1,2
sub $0,$1
lpe
mul $1,2
pow $1,$0
add $1,1
mul $1,2
sub $1,4
div $1,2
add $1,1
| 57.625 | 663 | 0.618221 |
0fc6f1209b674b8a758b8f67e3aa5bb25fbefe86 | 332 | asm | Assembly | base/runtime/int.asm | zbyti/Mad-Pascal | 546cae9724828f93047080109488be7d0d07d47e | [
"MIT"
] | 7 | 2020-05-02T15:37:57.000Z | 2021-02-17T01:59:41.000Z | base/runtime/int.asm | michalkolodziejski/Mad-Pascal | 0a7a1e2f379e50b0a23878b0d881ff3407269ed6 | [
"MIT"
] | 14 | 2020-05-03T02:02:35.000Z | 2020-08-10T08:41:19.000Z | base/runtime/int.asm | michalkolodziejski/Mad-Pascal | 0a7a1e2f379e50b0a23878b0d881ff3407269ed6 | [
"MIT"
] | 5 | 2020-06-02T18:34:14.000Z | 2020-07-09T18:13:44.000Z |
/*
@INT
@INT_SHORT
*/
.proc @INT
ldy :STACKORIGIN+STACKWIDTH*3,x
spl
jsr negCARD
lda #$00
sta :STACKORIGIN,x
tya
spl
jsr negCARD
rts
.endp
.proc @INT_SHORT
ldy :STACKORIGIN+STACKWIDTH,x
spl
jsr negSHORT
lda #$00
sta :STACKORIGIN,x
tya
spl
jsr negSHORT
rts
.endp
| 8.512821 | 33 | 0.593373 |
07af36b2f7d4f9ef581bf8d0898575b001537606 | 473 | asm | Assembly | programs/oeis/156/A156637.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/156/A156637.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/156/A156637.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A156637: Pell numbers A000129 mod 9. Period 24: repeat 0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1.
; 0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1,0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1,0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1,0,1,2,5,3,2,7,7,3,4,2,8,0,8,7,4,6,7,2,2,6,5,7,1
seq $0,163271 ; Numerators of fractions in a 'zero-transform' approximation of sqrt(2) by means of a(n) = (a(n-1) + c)/(a(n-1) + 1) with c=2 and a(1)=0.
mod $0,18
div $0,2
| 67.571429 | 193 | 0.575053 |
cdc11958d2288e89b316c58f432c0af570acc2f6 | 1,134 | asm | Assembly | examples/cmpstr.asm | crgimenes/assembly | 0e0abbf68a44ae7e7c2e2c2a495c8a68ac072da5 | [
"MIT"
] | 1 | 2020-06-29T05:27:38.000Z | 2020-06-29T05:27:38.000Z | examples/cmpstr.asm | crgimenes/assembly | 0e0abbf68a44ae7e7c2e2c2a495c8a68ac072da5 | [
"MIT"
] | null | null | null | examples/cmpstr.asm | crgimenes/assembly | 0e0abbf68a44ae7e7c2e2c2a495c8a68ac072da5 | [
"MIT"
] | 3 | 2019-08-13T10:09:50.000Z | 2022-02-24T16:43:22.000Z | lea si, string1
lea di, string2
dec di
lab1:
inc di ;ds:di -> next character in string2
lodsb ;load al with next char from string 1
;note: lodsb increments si automatically
cmp [di], al ;compare characters
jne NotEqual ;jump out of loop if they are not the same
cmp al, 0 ;they are the same, but end of string?
jne lab1 ;no - so go round loop again
;-----------------------------------------------------------------------------
;end of string, and the "jne NotEqual" instruction hasn't been executed so they're equal
;-----------------------------------------------------------------------------
lea dx, msg1 ;point ds:dx at message to say so
mov ah, 9 ;print message
int 21h
jmp lab2 ;continue with rest of program
NotEqual:
lea dx, msg2 ;not equal, so point ds:dx at appropriate message
mov ah, 9 ;print message
int21h
lab2:
;rest of prog here
mov ax, 4c00h
int 21h
db msg1 'Strings are equal$'
db msg2 'Strings are not equal$' | 30.648649 | 88 | 0.5097 |
cdd72b9385fad0049e78713db2cc5fd8026f7331 | 7,966 | asm | Assembly | Transynther/x86/_processed/US/_st_zr_4k_sm_/i7-7700_9_0xca_notsx.log_21829_686.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_st_zr_4k_sm_/i7-7700_9_0xca_notsx.log_21829_686.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_st_zr_4k_sm_/i7-7700_9_0xca_notsx.log_21829_686.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x2bfe, %rdx
cmp %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%rdx)
nop
add $37298, %r11
lea addresses_D_ht+0x71fe, %rax
nop
nop
add $23606, %rcx
mov (%rax), %r12d
cmp %rdx, %rdx
lea addresses_A_ht+0x4e7e, %rsi
lea addresses_D_ht+0xf7fe, %rdi
nop
nop
xor %rdx, %rdx
mov $90, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_D_ht+0x1028e, %rax
clflush (%rax)
nop
nop
xor $9762, %rcx
movups (%rax), %xmm4
vpextrq $0, %xmm4, %rdi
nop
nop
nop
inc %rdx
lea addresses_A_ht+0x952, %rax
xor $19330, %rdx
movb (%rax), %r12b
and $41446, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %rax
push %rbx
push %rcx
push %rsi
// Store
mov $0x5be, %rcx
nop
nop
cmp %rsi, %rsi
movw $0x5152, (%rcx)
nop
nop
sub %rbx, %rbx
// Store
lea addresses_UC+0xbbfe, %rcx
nop
nop
nop
and $33414, %rbx
mov $0x5152535455565758, %rax
movq %rax, (%rcx)
nop
nop
xor $658, %rbx
// Store
lea addresses_D+0xbc72, %r12
and $19569, %r8
mov $0x5152535455565758, %rax
movq %rax, %xmm1
vmovntdq %ymm1, (%r12)
nop
sub %r12, %r12
// Store
lea addresses_A+0xa2be, %r12
nop
nop
nop
cmp $37293, %rax
movb $0x51, (%r12)
nop
dec %rbx
// Store
lea addresses_US+0x14bfe, %rsi
nop
nop
nop
sub $51082, %rax
movl $0x51525354, (%rsi)
nop
nop
inc %rcx
// Store
lea addresses_normal+0x180e6, %rax
nop
cmp $8160, %r12
movl $0x51525354, (%rax)
sub %r8, %r8
// Store
lea addresses_RW+0xb3fe, %rcx
and $57060, %rbx
movl $0x51525354, (%rcx)
nop
nop
nop
nop
nop
sub $1209, %r11
// Store
lea addresses_US+0x86fe, %rsi
nop
sub $6388, %rcx
mov $0x5152535455565758, %r12
movq %r12, %xmm4
movups %xmm4, (%rsi)
nop
nop
nop
add $21279, %r8
// Load
lea addresses_A+0x437e, %r11
nop
nop
add $386, %r12
mov (%r11), %si
nop
nop
nop
sub %r12, %r12
// Store
lea addresses_US+0x14bfe, %r11
nop
nop
nop
nop
nop
inc %rax
movw $0x5152, (%r11)
nop
nop
xor %r12, %r12
// Store
lea addresses_UC+0x48fe, %rbx
nop
nop
inc %r11
movl $0x51525354, (%rbx)
nop
nop
nop
sub %rax, %rax
// Store
lea addresses_US+0x1bbfe, %rbx
xor %rcx, %rcx
movb $0x51, (%rbx)
nop
sub $52783, %r12
// Faulty Load
lea addresses_US+0x14bfe, %rsi
nop
sub %rbx, %rbx
mov (%rsi), %r8w
lea oracles, %rbx
and $0xff, %r8
shlq $12, %r8
mov (%rbx,%r8,1), %r8
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 2, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'54': 10, '00': 474, '51': 12199, '52': 9146}
52 51 51 51 52 52 52 51 52 52 52 51 52 51 51 52 52 52 51 51 51 52 51 52 52 52 51 52 51 52 51 51 52 52 52 52 52 52 51 52 51 51 52 51 51 51 52 52 52 51 51 52 52 51 51 51 51 51 51 51 52 52 52 52 52 51 52 51 51 51 52 52 51 51 52 52 51 51 52 52 52 52 51 51 51 51 51 51 52 51 52 51 51 51 51 52 51 52 51 52 52 52 51 51 52 52 51 52 52 51 52 51 51 52 51 51 52 52 52 52 52 51 51 52 51 51 52 51 52 52 51 52 51 51 52 52 52 51 51 52 51 52 52 51 52 51 51 51 51 51 52 51 52 51 52 51 51 51 51 52 00 52 52 51 52 52 51 51 52 51 52 52 51 52 51 52 51 51 52 51 51 52 51 52 00 51 51 51 51 52 52 52 51 51 51 51 51 51 51 51 51 51 52 51 51 52 51 52 52 52 51 51 51 52 51 52 51 51 52 52 52 51 52 51 51 52 52 51 52 51 52 51 51 52 51 51 51 51 51 51 51 52 52 52 51 51 51 51 51 52 51 51 51 51 51 51 51 51 51 52 52 52 51 51 52 52 52 52 51 51 52 51 52 51 51 51 51 51 52 51 51 51 52 51 51 52 51 51 51 51 51 52 51 52 51 52 52 52 00 52 51 52 52 51 51 51 51 51 51 52 51 52 51 52 51 51 51 51 52 51 51 51 52 51 51 51 51 52 52 51 52 52 52 52 00 51 51 51 52 52 51 51 51 51 52 51 51 51 52 52 52 51 51 52 52 52 52 51 52 51 52 51 51 51 52 52 51 51 51 52 51 51 51 52 00 52 52 52 51 51 52 51 51 52 51 52 51 51 51 51 51 52 51 52 52 51 51 52 51 52 51 51 52 51 52 51 51 51 51 51 51 00 52 52 51 52 51 52 52 52 52 51 52 51 51 51 51 52 52 51 52 52 52 52 52 51 51 51 51 51 52 51 52 52 52 51 51 52 52 51 51 52 51 51 51 52 52 51 52 52 51 52 52 52 52 51 52 51 51 52 52 51 51 51 51 52 52 51 52 52 51 52 51 51 52 51 51 51 51 51 52 52 00 52 52 52 51 51 52 51 52 51 51 52 51 51 51 51 52 51 51 51 51 52 52 52 51 51 52 51 52 51 52 51 52 51 52 52 51 52 52 52 51 52 51 52 52 52 52 51 51 51 51 51 51 52 51 51 52 51 51 52 00 51 52 51 52 51 51 52 52 51 52 51 51 51 52 52 51 51 51 51 51 51 52 51 51 51 52 52 51 52 52 52 51 52 51 52 51 51 52 52 52 51 51 52 52 51 52 51 52 51 52 52 51 51 52 52 51 52 52 51 52 51 51 51 51 51 52 51 51 51 51 52 52 51 52 51 52 52 52 00 52 52 51 51 51 51 51 52 52 52 52 00 52 52 51 52 52 52 51 52 52 51 51 51 52 00 51 51 51 52 51 51 51 52 51 51 51 51 52 51 51 52 52 51 51 52 52 51 51 51 51 51 00 52 51 51 52 51 51 52 52 52 51 51 00 52 51 51 51 51 51 52 51 52 51 51 51 51 51 51 51 51 51 51 51 52 51 52 51 51 51 52 51 52 00 52 51 51 51 51 51 52 51 51 51 51 51 52 52 51 52 52 52 52 51 52 51 51 51 52 52 52 51 52 51 52 52 52 52 51 51 52 51 51 52 51 52 51 52 51 52 52 51 51 51 51 52 51 51 52 51 52 51 51 51 52 52 51 52 51 51 51 51 52 51 52 52 00 52 51 51 51 52 51 52 51 51 51 52 52 00 52 52 52 52 52 52 52 00 51 51 51 52 51 52 51 52 52 51 52 52 51 51 52 51 51 52 52 52 52 52 51 52 51 51 52 51 51 52 51 52 52 52 51 51 51 51 52 52 52 51 51 52 51 51 52 51 51 52 51 51 51 51 52 51 51 52 51 51 51 51 52 51 51 52 51 52 52 52 51 52 52 52 51 52 52 51 51 52 52 52 51 51 51 51 51 51 51 51 52 52 51 51 51 51 00 52 51 51 51 52 52 52 52 51 51 51 52 51 52 52 51 51 52 51 52 51 52 52 51 52 52 52 51 52 51 52 51 51 52 51 52 52 51 51 51 51 52 51 52 51 52 52 52 51 52 52 51 51 51 52 51 51 51 52 52 52 51 51 52 51 51 51 52 52 51 51 51 52 52 51 52 52 51 51 51 51 51
*/
| 33.330544 | 2,999 | 0.645117 |
a8738ed9b48299ce634d8fce86ba3ed1d710831d | 6,983 | asm | Assembly | Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_572.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_572.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_572.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1ddd1, %rsi
lea addresses_WC_ht+0x6af5, %rdi
clflush (%rsi)
nop
nop
xor $16463, %rax
mov $96, %rcx
rep movsq
nop
nop
sub $5369, %rbp
lea addresses_WC_ht+0x6f5, %r14
nop
nop
dec %r15
movb $0x61, (%r14)
nop
nop
sub %rax, %rax
lea addresses_WC_ht+0x1040b, %rcx
nop
nop
xor %rax, %rax
mov (%rcx), %r15
nop
nop
nop
nop
nop
add $2237, %rdi
lea addresses_D_ht+0x1a7f5, %rax
nop
nop
cmp %r15, %r15
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%rax)
nop
nop
and $56674, %rax
lea addresses_WT_ht+0x87f5, %rsi
lea addresses_UC_ht+0x9ef5, %rdi
clflush (%rdi)
nop
and %r9, %r9
mov $85, %rcx
rep movsw
nop
nop
nop
nop
sub $51590, %rsi
lea addresses_normal_ht+0x3455, %rsi
lea addresses_normal_ht+0x8ff5, %rdi
nop
nop
lfence
mov $95, %rcx
rep movsw
nop
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x60f5, %rsi
lea addresses_WC_ht+0x1ea87, %rdi
clflush (%rsi)
nop
nop
sub $22922, %rax
mov $52, %rcx
rep movsw
nop
and %r14, %r14
lea addresses_WT_ht+0xaff5, %rbp
nop
nop
nop
add %r9, %r9
mov $0x6162636465666768, %rcx
movq %rcx, (%rbp)
xor %rax, %rax
lea addresses_D_ht+0x9731, %rsi
clflush (%rsi)
nop
nop
nop
and %r9, %r9
mov (%rsi), %r14
dec %r15
lea addresses_UC_ht+0xdc35, %r14
nop
nop
nop
nop
nop
sub %r9, %r9
movb (%r14), %cl
nop
xor $6666, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %r9
push %rax
push %rsi
// Store
lea addresses_UC+0x96d5, %r10
clflush (%r10)
nop
nop
dec %r12
mov $0x5152535455565758, %rax
movq %rax, %xmm4
movups %xmm4, (%r10)
nop
nop
xor %r10, %r10
// Store
lea addresses_normal+0x5ff5, %r12
dec %rax
mov $0x5152535455565758, %rsi
movq %rsi, (%r12)
nop
sub %r9, %r9
// Faulty Load
lea addresses_US+0x7ff5, %r8
nop
sub %r12, %r12
movb (%r8), %r9b
lea oracles, %r10
and $0xff, %r9
shlq $12, %r9
mov (%r10,%r9,1), %r9
pop %rsi
pop %rax
pop %r9
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 1}}
{'src': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 36.94709 | 2,999 | 0.656881 |
96b57ad32f296ae1aa22e393dfb45934b91d6ec8 | 98 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/atanh.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/atanh.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/atanh.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC _atanh
EXTERN cm48_sdcciy_atanh
defc _atanh = cm48_sdcciy_atanh
| 10.888889 | 31 | 0.846939 |
ae9cd27b7e6a6bc0fd7fce28873517e53275f2a6 | 182 | asm | Assembly | data/pokemon/dex_entries/spinarak.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/dex_entries/spinarak.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/dex_entries/spinarak.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | db "STRINGSPIT@" ; species name
db "If prey becomes"
next "ensnared in its"
next "nest of spun"
page "string, it waits"
next "motionlessly until"
next "it becomes dark.@"
| 18.2 | 32 | 0.681319 |
32639d22dbb304f817e2ed999864f075de621bcb | 75 | asm | Assembly | data/maps/headers/SafariZoneNorth.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/headers/SafariZoneNorth.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/headers/SafariZoneNorth.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null |
map_header SafariZoneNorth, SAFARI_ZONE_NORTH, FOREST, 0
end_map_header
| 18.75 | 57 | 0.84 |
ba84e3734b079a8cbf5d32adf8811bc852da99a3 | 546 | asm | Assembly | libsrc/_DEVELOPMENT/input/basic/z80/asm_in_wait_key.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/input/basic/z80/asm_in_wait_key.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/input/basic/z80/asm_in_wait_key.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; ===============================================================
; feilipu Jan 2020
; ===============================================================
;
; void in_wait_key(void)
;
; Busy wait until a key is pressed.
;
; ===============================================================
SECTION code_clib
SECTION code_input
PUBLIC asm_in_wait_key
.asm_in_wait_key
; exit : if one key is pressed
;
; uses : potentially all (ix, iy saved for sdcc)
jp 0x0010 ; direct console i/o input, blocking call, key in A
| 22.75 | 83 | 0.419414 |
7714f3523824ac05ab524a3d628c0ec15a3c53ff | 999 | asm | Assembly | fasm/simple.asm | Kharacternyk/ceto19 | 80dea5e78204c53d801ce249d7d247b5d0c5ec9a | [
"MIT"
] | null | null | null | fasm/simple.asm | Kharacternyk/ceto19 | 80dea5e78204c53d801ce249d7d247b5d0c5ec9a | [
"MIT"
] | null | null | null | fasm/simple.asm | Kharacternyk/ceto19 | 80dea5e78204c53d801ce249d7d247b5d0c5ec9a | [
"MIT"
] | null | null | null | ; Fill `cubes` array.
cubes=buffer
zer rdi
@@: inc rdi
mov rbx, rdi
imul rbx, rdi; ^2
imul rbx, rdi; ^3
mov [cubes+rdi*8], rbx
cmp rbx, rax
jb @b
; Store the highest index.
mov rcx, rdi
; Counter.
zer r9
; Check every combination, x>=y>=z.
mov r15, rax
mov r12, 1 ; x
xLoop:
mov r13, 1 ; y
yLoop:
mov r14, 1 ; z
zLoop:
mov rbx, [cubes+r12*8]
add rbx, [cubes+r13*8]
add rbx, [cubes+r14*8]
cmp rbx, r15
jne @f
push LF
push r12
push TAB
push r13
push TAB
push r14
inc r9
@@: inc r14
cmp r14, r13
jna zLoop
inc r13
cmp r13, r12
jna yLoop
inc r12
cmp r12, rcx
jna xLoop
; Push a counter.
push LF
push r9
| 19.588235 | 38 | 0.405405 |
fa36d1de139419d1a108f427955146af62a0986d | 5,723 | asm | Assembly | data/moves/fling_damage.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/moves/fling_damage.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/moves/fling_damage.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | FlingDamage:
db -1 ; MASTER_BALL
db -1 ; ULTRA_BALL
db 10 ; BRIGHTPOWDER
db -1 ; GREAT_BALL
db -1 ; POKE_BALL
db -1 ; TOWN_MAP
db -1 ; BICYCLE
db 30 ; MOON_STONE
db 30 ; ANTIDOTE
db 30 ; BURN_HEAL
db 30 ; ICE_HEAL
db 30 ; AWAKENING
db 30 ; PARLYZ_HEAL
db 30 ; FULL_RESTORE
db 30 ; MAX_POTION
db 30 ; HYPER_POTION
db 30 ; SUPER_POTION
db 30 ; POTION
db 30 ; ESCAPE_ROPE
db 30 ; REPEL
db 30 ; MAX_ELIXER
db 30 ; FIRE_STONE
db 30 ; THUNDERSTONE
db 30 ; WATER_STONE
db -1 ; ITEM_19
db 30 ; HP_UP
db 30 ; PROTEIN
db 30 ; IRON
db 30 ; CARBOS
db 40 ; LUCKY_PUNCH
db 30 ; CALCIUM
db 30 ; RARE_CANDY
db 30 ; X_ACCURACY
db 30 ; LEAF_STONE
db 10 ; METAL_POWDER
db 30 ; NUGGET
db 30 ; POKE_DOLL
db 30 ; FULL_HEAL
db 30 ; REVIVE
db 30 ; MAX_REVIVE
db 30 ; GUARD_SPEC
db 30 ; SUPER_REPEL
db 30 ; MAX_REPEL
db 30 ; DIRE_HIT
db -1 ; ITEM_2D
db 30 ; FRESH_WATER
db 30 ; SODA_POP
db 30 ; LEMONADE
db 30 ; X_ATTACK
db -1 ; ITEM_32
db 30 ; X_DEFEND
db 30 ; X_SPEED
db 30 ; X_SPECIAL
db -1 ; COIN_CASE
db -1 ; ITEMFINDER
db -1 ; POKE_FLUTE
db 30 ; EXP_SHARE
db -1 ; OLD_ROD
db -1 ; GOOD_ROD
db 20 ; SILVER_LEAF
db -1 ; SUPER_ROD
db 30 ; PP_UP
db 30 ; ETHER
db 30 ; MAX_ETHER
db 30 ; ELIXER
db -1 ; RED_SCALE
db -1 ; SECRETPOTION
db -1 ; S_S_TICKET
db -1 ; MYSTERY_EGG
db -1 ; CLEAR_BELL
db -1 ; SILVER_WING
db 30 ; MOOMOO_MILK
db 80 ; QUICK_CLAW
db 10 ; PSNCUREBERRY
db 20 ; GOLD_LEAF
db 10 ; SOFT_SAND
db 50 ; SHARP_BEAK
db 10 ; PRZCUREBERRY
db 10 ; BURNT_BERRY
db 10 ; ICE_BERRY
db 70 ; POISON_BARB
db 30 ; KINGS_ROCK
db 10 ; BITTER_BERRY
db 10 ; MINT_BERRY
db -1 ; RED_APRICORN
db 30 ; TINYMUSHROOM
db 30 ; BIG_MUSHROOM
db 10 ; SILVERPOWDER
db -1 ; BLU_APRICORN
db -1 ; ITEM_5A
db 30 ; AMULET_COIN
db -1 ; YLW_APRICORN
db -1 ; GRN_APRICORN
db 30 ; CLEANSE_TAG
db 30 ; MYSTIC_WATER
db 30 ; TWISTEDSPOON
db -1 ; WHT_APRICORN
db 30 ; BLACKBELT
db -1 ; BLK_APRICORN
db -1 ; ITEM_64
db -1 ; PNK_APRICORN
db 30 ; BLACKGLASSES
db 30 ; SLOWPOKETAIL
db 10 ; PINK_BOW
db 60 ; STICK
db 30 ; SMOKE_BALL
db 30 ; NEVERMELTICE
db 30 ; MAGNET
db 10 ; MIRACLEBERRY
db 30 ; PEARL
db 30 ; BIG_PEARL
db 30 ; EVERSTONE
db 30 ; SPELL_TAG
db 30 ; RAGECANDYBAR
db -1 ; GS_BALL
db -1 ; BLUE_CARD
db 30 ; MIRACLE_SEED
db 90 ; THICK_CLUB
db 10 ; FOCUS_BAND
db -1 ; ITEM_78
db 30 ; ENERGYPOWDER
db 30 ; ENERGY_ROOT
db 30 ; HEAL_POWDER
db 30 ; REVIVAL_HERB
db 100 ; HARD_STONE
db 30 ; LUCKY_EGG
db -1 ; CARD_KEY
db -1 ; MACHINE_PART
db -1 ; EGG_TICKET
db -1 ; LOST_ITEM
db 30 ; STARDUST
db 30 ; STAR_PIECE
db -1 ; BASEMENT_KEY
db -1 ; PASS
db -1 ; ITEM_87
db -1 ; ITEM_88
db -1 ; ITEM_89
db 30 ; CHARCOAL
db 30 ; BERRY_JUICE
db 30 ; SCOPE_LENS
db -1 ; ITEM_8D
db -1 ; ITEM_8E
db 30 ; METAL_COAT
db 70 ; DRAGON_FANG
db -1 ; ITEM_91
db 10 ; LEFTOVERS
db -1 ; ITEM_93
db -1 ; ITEM_94
db -1 ; ITEM_95
db 10 ; MYSTERYBERRY
db 10 ; DRAGON_SCALE
db 24 ; BERSERK_GENE
db -1 ; ITEM_99
db -1 ; ITEM_9A
db -1 ; ITEM_9B
db 30 ; SACRED_ASH
db -1 ; HEAVY_BALL
db -1 ; FLOWER_MAIL
db -1 ; LEVEL_BALL
db -1 ; LURE_BALL
db -1 ; FAST_BALL
db -1 ; ITEM_A2
db 30 ; LIGHT_BALL
db -1 ; FRIEND_BALL
db -1 ; MOON_BALL
db -1 ; LOVE_BALL
db 40 ; NORMAL_BOX
db 80 ; GORGEOUS_BOX
db 30 ; SUN_STONE
db 12 ; POLKADOT_BOW
db -1 ; ITEM_AB
db 30 ; UP_GRADE
db 10 ; BERRY
db 10 ; GOLD_BERRY
db -1 ; SQUIRTBOTTLE
db -1 ; ITEM_B0
db -1 ; PARK_BALL
db -1 ; RAINBOW_WING
db -1 ; ITEM_B3
db 30 ; BRICK_PIECE
db -1 ; SURF_MAIL
db -1 ; LITEBLUEMAIL
db -1 ; PORTRAITMAIL
db -1 ; LOVELY_MAIL
db -1 ; EON_MAIL
db -1 ; MORPH_MAIL
db -1 ; BLUESKY_MAIL
db -1 ; MUSIC_MAIL
db -1 ; MIRAGE_MAIL
db -1 ; ITEM_BE
db -1 ; ITEM_DC
db -1 ; ITEM_C3
db -1 ; ITEM_FA
db -1 ; NET_BALL
db -1 ; DIVE_BALL
db -1 ; NEST_BALL
db -1 ; REPEAT_BALL
db -1 ; TIMER_BALL
db -1 ; LUXURY_BALL
db -1 ; DUSK_BALL
db -1 ; HEAL_BALL
db -1 ; QUICK_BALL
db 30 ; SHINY_STONE
db 30 ; DUSK_STONE
db 30 ; DAWN_STONE
db 80 ; OVAL_STONE
db 80 ; PROTECTOR
db 80 ; ELECTRIZER
db 80 ; MAGMARIZER
db 50 ; DUBIOUS_DISC
db 10 ; REAPER_CLOTH
db 80 ; RAZOR_CLAW
db 30 ; RAZOR_FANG
db 80 ; ODD_KEYSTONE
db 90 ; DRACO_PLATE
db 90 ; DREAD_PLATE
db 90 ; EARTH_PLATE
db 90 ; FIST_PLATE
db 90 ; FLAME_PLATE
db 90 ; ICICLE_PLATE
db 90 ; INSECT_PLATE
db 90 ; IRON_PLATE
db 90 ; MEADOW_PLATE
db 90 ; MIND_PLATE
db 90 ; SKY_PLATE
db 90 ; SPLASH_PLATE
db 90 ; SPOOKY_PLATE
db 90 ; STONE_PLATE
db 90 ; TOXIC_PLATE
db 90 ; ZAP_PLATE
db -1 ; GRACIDEA
db 60 ; GRISEOUS_ORB
db 60 ; ADAMANT_ORB
db 60 ; LUSTROUS_ORB
db 100 ; DOME_FOSSIL
db 100 ; HELIX_FOSSIL
db 100 ; OLD_AMBER
db 100 ; ROOT_FOSSIL
db 100 ; CLAW_FOSSIL
db 100 ; SKULL_FOSSIL
db 100 ; ARMOR_FOSSIL
db 90 ; DEEPSEATOOTH
db 30 ; DEEPSEASCALE
db 10 ; SEA_INCENSE
db 10 ; LAX_INCENSE
db 10 ; ODD_INCENSE
db 10 ; ROCK_INCENSE
db 10 ; FULL_INCENSE
db 10 ; WAVE_INCENSE
db 10 ; ROSE_INCENSE
db 10 ; LUCK_INCENSE
db 10 ; PURE_INCENSE
db 30 ; HONEY
db 30 ; PRISM_SCALE
flingeffectdata: MACRO
db \1
dba \2
ENDM
FlingEffects:
flingeffectdata KINGS_ROCK, BattleCommand_flinchtarget
flingeffectdata RAZOR_FANG, BattleCommand_flinchtarget
flingeffectdata LIGHT_BALL, BattleCommand_paralyzetarget
flingeffectdata POISON_BARB, FlingPoisonEffect
flingeffectdata BERSERK_GENE, BattleCommand_confusetarget
flingeffectdata GOLD_LEAF, BattleCommand_burntarget
flingeffectdata POLKADOT_BOW, BattleCommand_sleeptarget
db -1
| 21.118081 | 58 | 0.665211 |
e0056b8e60235de87240b810e198c1dc00db4d78 | 453 | asm | Assembly | programs/oeis/047/A047271.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/047/A047271.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/047/A047271.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A047271: Numbers that are congruent to {0, 3, 5} mod 6.
; 0,3,5,6,9,11,12,15,17,18,21,23,24,27,29,30,33,35,36,39,41,42,45,47,48,51,53,54,57,59,60,63,65,66,69,71,72,75,77,78,81,83,84,87,89,90,93,95,96,99,101,102,105,107,108,111,113,114,117,119,120,123,125,126,129,131,132,135,137,138,141,143,144,147,149,150,153,155,156,159,161,162,165,167,168,171,173,174,177,179,180,183,185,186,189,191,192,195,197,198
mul $0,2
mov $1,$0
gcd $1,3
mod $1,3
add $0,$1
| 50.333333 | 346 | 0.682119 |
80eca946eef62110cd79250b0b6e02b0c0ff7ccf | 1,426 | asm | Assembly | _incObj/16 Harpoon.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 9 | 2021-01-15T13:47:53.000Z | 2022-01-17T15:33:55.000Z | _incObj/16 Harpoon.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 7 | 2021-01-14T02:18:48.000Z | 2021-03-24T15:44:30.000Z | _incObj/16 Harpoon.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 2 | 2021-01-14T13:14:26.000Z | 2021-01-29T17:46:04.000Z | ; ---------------------------------------------------------------------------
; Object 16 - harpoon (LZ)
; ---------------------------------------------------------------------------
Harpoon:
moveq #0,d0
move.b obRoutine(a0),d0
move.w Harp_Index(pc,d0.w),d1
jmp Harp_Index(pc,d1.w)
; ===========================================================================
Harp_Index: dc.w Harp_Main-Harp_Index
dc.w Harp_Move-Harp_Index
dc.w Harp_Wait-Harp_Index
harp_time: equ $30 ; time between stabbing/retracting
; ===========================================================================
Harp_Main: ; Routine 0
addq.b #2,obRoutine(a0)
move.l #Map_Harp,obMap(a0)
move.w #$3CC,obGfx(a0)
ori.b #4,obRender(a0)
move.b #4,obPriority(a0)
move.b obSubtype(a0),obAnim(a0) ; get type (vert/horiz)
move.b #$14,obActWid(a0)
move.w #60,harp_time(a0) ; set time to 1 second
Harp_Move: ; Routine 2
lea (Ani_Harp).l,a1
bsr.w AnimateSprite
moveq #0,d0
move.b obFrame(a0),d0 ; get frame number
move.b @types(pc,d0.w),obColType(a0) ; get collision type
bra.w RememberState
@types:
dc.b $9B, $9C, $9D, $9E, $9F, $A0
even
Harp_Wait: ; Routine 4
subq.w #1,harp_time(a0) ; decrement timer
bpl.s @chkdel ; branch if time remains
move.w #60,harp_time(a0) ; reset timer
subq.b #2,obRoutine(a0) ; run "Harp_Move" subroutine
bchg #0,obAnim(a0) ; reverse animation
@chkdel:
bra.w RememberState | 29.708333 | 77 | 0.537868 |
fa91f1463347eb480fdbb8dbb91df4e97a279bd2 | 6,428 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_10673_705.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_0xca.log_10673_705.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_0xca.log_10673_705.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x4581, %rsi
lea addresses_A_ht+0x19b81, %rdi
nop
xor $15796, %r10
mov $124, %rcx
rep movsq
nop
nop
nop
xor $23030, %rbp
lea addresses_WT_ht+0x7781, %r8
nop
nop
nop
add %rdx, %rdx
movb $0x61, (%r8)
nop
nop
xor $25151, %r10
lea addresses_A_ht+0x1ab51, %r10
nop
nop
nop
nop
nop
add $63103, %rcx
mov (%r10), %dx
nop
xor %rcx, %rcx
lea addresses_WT_ht+0x16cc1, %rsi
nop
nop
nop
nop
nop
add %rcx, %rcx
mov (%rsi), %r8d
nop
nop
nop
nop
nop
dec %rdi
lea addresses_D_ht+0x17c9, %rdx
nop
nop
nop
sub $49208, %rsi
movb $0x61, (%rdx)
nop
nop
nop
nop
cmp %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rsi
// Store
lea addresses_RW+0x13b81, %rbp
nop
nop
nop
cmp $57625, %rsi
mov $0x5152535455565758, %r14
movq %r14, %xmm6
movups %xmm6, (%rbp)
nop
nop
nop
nop
nop
add %rax, %rax
// Store
lea addresses_WC+0x1181, %rax
nop
nop
and $51835, %r9
mov $0x5152535455565758, %rcx
movq %rcx, %xmm1
movntdq %xmm1, (%rax)
add $38379, %r9
// Store
lea addresses_US+0x15541, %r12
nop
nop
nop
nop
nop
sub %r9, %r9
movb $0x51, (%r12)
nop
nop
nop
xor %r12, %r12
// Store
lea addresses_WC+0x7801, %rbp
nop
nop
nop
add $26040, %r12
mov $0x5152535455565758, %r9
movq %r9, %xmm2
movups %xmm2, (%rbp)
nop
sub %rax, %rax
// Load
lea addresses_D+0x6181, %rbp
nop
nop
cmp %r9, %r9
mov (%rbp), %si
nop
nop
nop
nop
sub %rbp, %rbp
// Faulty Load
lea addresses_UC+0x1eb81, %rax
nop
nop
nop
add %r12, %r12
vmovups (%rax), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r9
lea oracles, %r14
and $0xff, %r9
shlq $12, %r9
mov (%r14,%r9,1), %r9
pop %rsi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_US'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_D_ht'}}
{'00': 10673}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 34.010582 | 2,999 | 0.652925 |
5564c19a3565e7af7dfbcf27721e84adef86b80e | 633 | asm | Assembly | programs/oeis/020/A020655.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/020/A020655.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/020/A020655.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A020655: Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 5.
; 1,2,3,4,6,7,8,9,11,12,13,14,16,17,18,19,26,27,28,29,31,32,33,34,36,37,38,39,41,42,43,44,51,52,53,54,56,57,58,59,61,62,63,64,66,67,68,69,76,77,78,79,81,82,83,84,86,87,88,89,91,92,93,94,126,127,128,129,131,132,133,134,136,137,138,139,141,142,143,144,151,152,153,154,156,157,158,159,161,162,163,164,166,167,168,169,176,177,178,179
mov $2,$0
add $2,1
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
mov $3,1
lpb $0
dif $0,4
mul $3,5
lpe
div $3,4
add $3,1
add $1,$3
lpe
mov $0,$1
| 30.142857 | 329 | 0.660348 |
9b16b2f28e9d6217bdfbfdb02832b7aba64c0144 | 447 | asm | Assembly | libsrc/target/zx/if1/if1_checksum.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/target/zx/if1/if1_checksum.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/target/zx/if1/if1_checksum.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ;
; ZX IF1 & Microdrive functions
;
; if1_checksum (internal routine)
;
; check BC bytes starting from HL
; and compare with the following byte
;
; $Id: if1_checksum.asm,v 1.3 2016-07-01 22:08:20 dom Exp $
;
SECTION code_clib
PUBLIC if1_checksum
if1_checksum:
push hl
ld e,0
nxt_byte:
ld a,e
add (hl)
inc hl
adc 1
jr z,noround
dec a
noround: ld e,a
dec bc
ld a,b
or c
jr nz,nxt_byte
ld a,e
cp (hl)
pop hl
ret
| 13.147059 | 59 | 0.657718 |
fc380dcdd7f5d041584449345cab5b0535d34e80 | 824 | asm | Assembly | oeis/142/A142423.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142423.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142423.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142423: Primes congruent to 11 mod 49.
; Submitted by Jon Maiga
; 11,109,599,991,1187,1481,1579,1873,2069,2657,3049,3343,3539,3637,3833,3931,4127,4421,4519,4813,5009,5107,5303,6577,6871,7459,7753,7949,8243,8537,8831,8929,9419,9811,10007,10301,10399,10889,10987,12163,12457,12653,13241,13339,13633,13829,14221,15299,15887,16573,17749,18043,19121,19219,19709,20101,20297,20983,21179,21277,21767,22159,22453,22943,23041,23531,23629,24413,25589,25981,26177,26863,27059,27647,27941,28627,28921,29411,29803,30097,30293,30391,30881,31469,31567,32057,32939,33037,33331
mov $1,5
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,2
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,49
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,97
| 34.333333 | 496 | 0.728155 |
b31deb37211b3dcee4420ae354cab894bb2fb0c0 | 145 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math16/c/sccz80/cm16_sccz80_exp2.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math16/c/sccz80/cm16_sccz80_exp2.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math16/c/sccz80/cm16_sccz80_exp2.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math16
PUBLIC cm16_sccz80_exp2
EXTERN cm16_sccz80_read1, exp2f16
cm16_sccz80_exp2:
call cm16_sccz80_read1
jp exp2f16
| 13.181818 | 33 | 0.82069 |
d50eb0aa726de54f2c223baa9f3f25064393b6d9 | 201 | asm | Assembly | data/pokemon/dex_entries/machop.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/pokemon/dex_entries/machop.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/pokemon/dex_entries/machop.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | db "SUPERPOWER@" ; species name
dw 207, 430 ; height, weight
db "It trains by"
next "lifting rocks in"
next "the mountains. It"
page "can even pick up a"
next "GRAVELER with"
next "ease.@"
| 18.272727 | 32 | 0.661692 |
ab30931e410308fdc6b1b027d004e82b2f76d49a | 2,499 | asm | Assembly | Teme/Tema1/tema1.asm | DanBrezeanu/IOCLA | 1a22cc2949afc72818289f47288e32004f633fd1 | [
"MIT"
] | 2 | 2019-11-18T15:56:21.000Z | 2020-01-18T01:22:37.000Z | Teme/Tema1/tema1.asm | zatbogdan99/IOCLA | 3d499ad18624f571e6c49ff891649a05ac9908e4 | [
"MIT"
] | null | null | null | Teme/Tema1/tema1.asm | zatbogdan99/IOCLA | 3d499ad18624f571e6c49ff891649a05ac9908e4 | [
"MIT"
] | null | null | null | %include "io.inc"
%define MAX_INPUT_SIZE 4096
section .bss
expr: resb MAX_INPUT_SIZE
section .text
global CMAIN
make_number: ; se parseaza stringul citit cat timp contine cifre si se creeaza un nou numar
push ebp
lea ebp, [esp]
xor edx, edx ; dl va contine fiecare caracter
xor eax, eax ; eax contine numarul din string, care va fi "returnat"
parse_input:
mov dl, [ecx]
cmp dl, ' ' ; daca s-a gasit un spatiu sau un \0
jbe return
imul eax, 10
lea eax, [eax + edx - '0'] ; eax = eax * 10 + [ecx] - '0'
inc ecx
jmp parse_input
return:
leave
ret
CMAIN:
push ebp
lea ebp, [esp]
GET_STRING expr, MAX_INPUT_SIZE
lea ecx, [expr] ; se va lucra direct pe octetii stringului, pana la '\0'
evaluate_expr:
mov ebx, 1 ; ebx tine initial semnul unui numar gasit
cmp byte [ecx], 0 ; s-a ajuns la finalul stringului
je print
cmp byte [ecx], '*'
je multiplication
cmp byte [ecx], '/'
je division
cmp byte [ecx], '+'
je addition
cmp byte [ecx], '-' ; '-' poate simboliza o scadere sau un numar negativ
je minus
cmp byte [ecx], ' '
je next_char
jmp get_number ; daca nu s-au gasit alte semne, s-a gasit o cifra
minus:
cmp byte [ecx + 1], ' ' ; daca urmeaza un spatiu sau '\0'
jbe subtraction
mov ebx, -1 ; se schimba semnul numarului
inc ecx
get_number:
push eax ; se salveaza pe stiva fostul numar obtinut sau creat
call make_number ; se returneaza in eax noul numar gasit, fara semn
imul ebx ; se aplica semnul
jmp next_char
multiplication:
imul dword [esp] ; se retine in eax rezultatul inmultirii
add esp, 4 ; se scoate inmultitorul de pe stiva
jmp next_char
division: ; se impart primele 2 numere gasite in ordine inversa, respectand semnul
pop ebx ; deimpartitul este pe stiva si se preia de catre ebx
xchg eax, ebx ; se pun operanzii in ordinea corecta
cdq
idiv ebx
jmp next_char
addition:
add eax, dword [esp] ; se aduna primele 2 numere disponibile
add esp, 4 ; se scoate al doilea termen de pe stiva
jmp next_char
subtraction: ; se scad primele 2 numere disponibile, in ordine inversa
pop ebx ; descazutul se gaseste pe stiva si se extrage
sub ebx, eax
lea eax, [ebx]
jmp next_char
next_char:
inc ecx
jmp evaluate_expr
print:
PRINT_DEC 4, eax ; la final, rezultatul va fi in eax
NEWLINE
xor eax, eax
leave
ret | 23.8 | 92 | 0.654662 |
da7cd963615bf2f62147dc874b317d71305999a3 | 787 | asm | Assembly | programs/oeis/067/A067272.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/067/A067272.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/067/A067272.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A067272: 2*10^(n-1)-1.
; 1,19,199,1999,19999,199999,1999999,19999999,199999999,1999999999,19999999999,199999999999,1999999999999,19999999999999,199999999999999,1999999999999999,19999999999999999,199999999999999999,1999999999999999999,19999999999999999999,199999999999999999999,1999999999999999999999,19999999999999999999999,199999999999999999999999,1999999999999999999999999,19999999999999999999999999,199999999999999999999999999,1999999999999999999999999999,19999999999999999999999999999,199999999999999999999999999999,1999999999999999999999999999999,19999999999999999999999999999999,199999999999999999999999999999999,1999999999999999999999999999999999,19999999999999999999999999999999999,199999999999999999999999999999999999
add $0,1
mov $1,10
pow $1,$0
sub $1,4
div $1,5
mov $0,$1
| 78.7 | 703 | 0.90216 |
d635c2062b7b59b81aaa8de3e29f386288f7ddc8 | 7,330 | asm | Assembly | Code/VKDebug/Src/fpudump.asm | CherryDT/FbEditMOD | beb0eb22cae1b8f7203d55bd6b293d8ec88231ca | [
"Unlicense"
] | 11 | 2016-12-03T16:35:42.000Z | 2022-03-26T06:02:53.000Z | Code/VKDebug/Src/fpudump.asm | CherryDT/FbEditMOD | beb0eb22cae1b8f7203d55bd6b293d8ec88231ca | [
"Unlicense"
] | 1 | 2018-02-24T20:17:46.000Z | 2018-03-02T08:57:40.000Z | Code/VKDebug/Src/fpudump.asm | CherryDT/FbEditMOD | beb0eb22cae1b8f7203d55bd6b293d8ec88231ca | [
"Unlicense"
] | 4 | 2018-10-19T01:14:55.000Z | 2021-09-11T18:51:48.000Z | ;-----------------------------------------------------------------------------
;FPUDump function is written by NaN.
;-----------------------------------------------------------------------------
.386
.model flat, stdcall
option casemap: none
include VKDebug.inc
includelib kernel32.lib
includelib user32.lib
includelib masm32.lib
DebugProc proto :dword
FPUDump proto
.data?
dbbuf byte 128 dup (?)
dbbuf1 byte 32 dup (?) ; New buffer for building String Messages, used WITH dbbuf together
.data
szFPU1 byte "Conditional: ST > Source",0 ; Floading point messages to be displayed
szFPU2 byte "Conditional: ST < Source",0
szFPU3 byte "Conditional: ST = Source",0
szFPU4 byte "Conditional: Undefined",0
szFPU5 byte "FPU Levels : %d ",0
szFPU6 byte "Exception : e s p u o z d i",0 ; Exception bits
szFPU7 byte "St(%d) : %s",0
.code
FPUDump proc
LOCAL sts :WORD ; Original Status Reg when called
LOCAL lev :DWORD ; Levels used on the stack
LOCAL stks[8] :QWORD ; Stack values
fstsw sts ; Save the current status of FPU
xor eax, eax ; EAX = 0
mov ax, sts ; EAX = 0000XXXX
shr eax, 11 ; AX = 00000000 00000111
neg eax ; AX = 11111111 11111001
and eax, 7 ; AX = 00000000 00000[001]
mov lev, eax ; Save the levels found
.if( lev == 0 ) ; If special case (0)
fst qword ptr [stks][0] ; Try storing ST(0)
fstsw ax ; Get status reg again
.if(ax & 0041h) ; See if Underflow and Not Valid
mov lev, 0 ; Yes, then it IS empty (0)
.else ;
mov lev, 8 ; No, Then its FULL (8)
.endif
.endif
invoke wsprintf, addr dbbuf, addr szFPU5, lev ; Display Levels found
invoke DebugPrint, addr dbbuf ; DPrint It!
xor eax, eax ; EAX = 00000000
mov ax, sts ; EAX = 0000????
shr eax, 6 ; AX = 000000X* XXY*Y*ZZ
shl al, 3 ; AX = 000000X* *Y*ZZ---
shl ax, 1 ; AX = 00000X** Y*ZZ----
shl al, 1 ; AX = 00000X** *ZZ-----
shr eax, 7 ; AX = -------0 0000X***
and eax, 7 ; AX = 00000000 00000***
.if( eax == 0 ) ; If ST > Source
push offset szFPU1 ; Then say so
.elseif( eax == 1 ) ; If ST < Source
push offset szFPU2 ; Then say so
.elseif( eax == 4 ) ; IF ST = Source
push offset szFPU3 ; Then say so
.else ; Anything else
push offset szFPU4 ; Say as Undefined
.endif
call DebugPrint ; Print it up!
xor eax, eax ; EAX = 0
xor ecx, ecx ; ECX = 0
mov ax, sts ; AX = Status first found
lea edx, szFPU6 ; EDX = Exception String Address
add edx, 13 ; EDX = First Exception Bit
.while( ecx < 8 ) ; Go thru 8 exception bits
rol al, 1 ; Rol the exception bits left 1
jc @F ; See if a '1' Passed out
or byte ptr [edx], 20h ; No, then force lower case (not set)
jmp @next ; and onto next section
@@: ;
and byte ptr [edx],0DFh ; Yes, then Force Upper case (Exception set)
@next: ; and onto next section
add edx, 2 ; Since Spaces, inc 2 in string
inc ecx ; Next bit!
.endw
push offset szFPU6 ; Push modified exception string
call DebugPrint ; Display The exception flags
xor esi, esi ; ESI = Counter = 0
lea edi, stks ; EDI = QWORD Buffer address
.while( esi < lev ) ; Go thru all known stack entries
fstp QWORD PTR [edi + esi*8] ; And pop into the buffer
inc esi ; Next entry
.endw
xor esi, esi ; ESI = 0 again!
.while( esi < lev ) ; Go thru all known buffer entries
invoke FloatToStr, [edi + esi*8], addr dbbuf1 ; Create Text Strings from them
invoke wsprintf, addr dbbuf, addr szFPU7, ; And display their contents
esi, addr dbbuf1 ;
invoke DebugPrint, addr dbbuf ;
inc esi ; Next entry
.endw
mov esi, lev ; ESI = # of stack entries
dec esi ; ESI = 0 Based number of entries
.if (SDWORD PTR esi >= 0) ; If and While still positive
.while (SDWORD PTR esi >= 0) ;
fld QWORD PTR [edi +esi*8] ; Push the dwords back in proper order
dec esi ; dec esi (for proper ordering)
.endw ;
.endif ;
ret ; DONE!
FPUDump endp
end
| 59.112903 | 110 | 0.331787 |
90030debde839bfd666804911c3a3a540d729372 | 9,881 | asm | Assembly | Transynther/x86/_processed/NC/_st_zr_sm_/i7-8650U_0xd2_notsx.log_1526_1475.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_zr_sm_/i7-8650U_0xd2_notsx.log_1526_1475.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_zr_sm_/i7-8650U_0xd2_notsx.log_1526_1475.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 %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x9ab2, %r15
nop
nop
nop
nop
nop
cmp %rax, %rax
movb (%r15), %r11b
nop
nop
nop
nop
nop
dec %r10
lea addresses_WT_ht+0x53a8, %rsi
lea addresses_A_ht+0x3758, %rdi
nop
nop
nop
nop
cmp $48365, %rbp
mov $121, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rax
lea addresses_WC_ht+0x15364, %rsi
lea addresses_UC_ht+0x1a424, %rdi
nop
sub $31890, %rbp
mov $20, %rcx
rep movsw
cmp $30053, %r11
lea addresses_WT_ht+0x14c2c, %r15
cmp $62487, %rbp
mov $0x6162636465666768, %rax
movq %rax, %xmm5
vmovups %ymm5, (%r15)
nop
nop
nop
nop
dec %rcx
lea addresses_WC_ht+0x17264, %r10
nop
nop
nop
dec %r15
movups (%r10), %xmm6
vpextrq $1, %xmm6, %rsi
nop
nop
nop
nop
nop
cmp %rbp, %rbp
lea addresses_normal_ht+0x13e28, %rax
clflush (%rax)
nop
cmp $36396, %rcx
vmovups (%rax), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %r11
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0x3764, %rdi
nop
nop
nop
and %rax, %rax
movw $0x6162, (%rdi)
inc %rcx
lea addresses_WC_ht+0x16396, %rsi
lea addresses_WC_ht+0xb3c, %rdi
nop
nop
nop
nop
and %rax, %rax
mov $15, %rcx
rep movsw
nop
nop
nop
add $53365, %rsi
lea addresses_UC_ht+0xf064, %r10
add %rbp, %rbp
mov $0x6162636465666768, %r15
movq %r15, (%r10)
inc %rbp
lea addresses_UC_ht+0xc194, %rax
nop
cmp %r10, %r10
mov (%rax), %rcx
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x4c64, %rsi
lea addresses_normal_ht+0x17d64, %rdi
clflush (%rdi)
nop
xor $47585, %r11
mov $72, %rcx
rep movsw
nop
and %rbp, %rbp
lea addresses_normal_ht+0x1e272, %r15
nop
nop
cmp %r11, %r11
mov (%r15), %bp
nop
nop
nop
nop
nop
and $25894, %rcx
lea addresses_D_ht+0xc120, %rsi
lea addresses_A_ht+0x1a364, %rdi
nop
nop
nop
nop
nop
add $37843, %rax
mov $122, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $37585, %rdi
lea addresses_UC_ht+0x35, %r10
nop
nop
nop
nop
add %rsi, %rsi
movl $0x61626364, (%r10)
nop
nop
cmp %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rdx
// Load
lea addresses_PSE+0x6da4, %r12
nop
nop
nop
dec %r9
mov (%r12), %edx
nop
nop
nop
cmp $27446, %r12
// Store
lea addresses_RW+0x5a5c, %rax
clflush (%rax)
nop
nop
nop
nop
cmp $63862, %rcx
mov $0x5152535455565758, %r14
movq %r14, (%rax)
nop
nop
nop
sub $40699, %r12
// Store
lea addresses_normal+0x72fc, %rcx
nop
and $3239, %r9
movb $0x51, (%rcx)
nop
add $40972, %rax
// Store
lea addresses_D+0xcb30, %r9
nop
sub $35184, %rcx
movw $0x5152, (%r9)
nop
nop
cmp %r14, %r14
// Load
lea addresses_RW+0xc204, %rdx
nop
nop
nop
nop
add $32048, %rcx
vmovups (%rdx), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r12
nop
nop
nop
nop
xor $9012, %r9
// Store
mov $0x1e206f000000066c, %r14
cmp $63006, %r9
mov $0x5152535455565758, %rax
movq %rax, (%r14)
nop
nop
cmp %rax, %rax
// Store
lea addresses_PSE+0x1c4fa, %rcx
nop
nop
inc %r9
movw $0x5152, (%rcx)
nop
nop
nop
nop
nop
dec %rax
// Store
mov $0x358f100000000364, %r9
add %rax, %rax
mov $0x5152535455565758, %rdx
movq %rdx, %xmm3
movups %xmm3, (%r9)
nop
nop
sub %r14, %r14
// Store
lea addresses_RW+0x1cac4, %rdx
nop
sub $20080, %rcx
mov $0x5152535455565758, %rdi
movq %rdi, %xmm3
vmovups %ymm3, (%rdx)
nop
nop
nop
nop
dec %rcx
// Faulty Load
mov $0x358f100000000364, %rdx
nop
nop
nop
nop
add %r12, %r12
mov (%rdx), %di
lea oracles, %r12
and $0xff, %rdi
shlq $12, %rdi
mov (%r12,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 6, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'00': 1520, '58': 6}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 29.147493 | 2,999 | 0.652161 |
7b4d3810d7968e9de0f3018b4604c5f7604f4280 | 318 | asm | Assembly | programs/oeis/040/A040423.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040423.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040423.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040423: Continued fraction for sqrt(445).
; 21,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10,1,1,10,42,10
seq $0,10217 ; Continued fraction for sqrt(173).
seq $0,7092 ; Numbers in base 6.
| 53 | 189 | 0.654088 |
ff9a7c52544debf93ed942e31fd3f0456d2725e6 | 100 | asm | Assembly | src/util/sprite/f3.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/sprite/f3.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/sprite/f3.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | * Sprite f3
section sprite
xdef mes_f3
include 'dev8_keys_sysspr'
mes_f3
dc.b 0,sp.f3
*
end
| 8.333333 | 27 | 0.71 |
0c665914d0c7c78fb7358cf7a6336ee1b978a552 | 1,993 | asm | Assembly | Assembly/keyboard/set_string.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 14 | 2015-01-15T19:08:06.000Z | 2021-09-27T17:27:22.000Z | Assembly/keyboard/set_string.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 5 | 2015-01-13T21:19:45.000Z | 2015-04-12T15:51:18.000Z | Assembly/keyboard/set_string.asm | WildGenie/Ninokuni | 019b4b7f069b311d0146d634f0af4c3096be7dd9 | [
"Apache-2.0"
] | 7 | 2015-02-02T20:14:00.000Z | 2017-05-14T07:58:12.000Z | ;;----------------------------------------------------------------------------;;
;; Fix the initialization of the keyboard string.
;; Copyright 2015 Benito Palacios (aka pleonex)
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
;;----------------------------------------------------------------------------;;
.arm
.org 0x020C62E4
STMFD SP!, {R3,LR}
; Initial size to 0
MOV R2, #0
B @readChar
@writeChar:
LDR R3, [R0,#0x3D0] ; Name ptr
MOV R2, LR ;,LSL#1 ; Get index
STRB R12, [R3,R2] ; Write char into the name pointer
LDR R2, [R0,#0x3D4] ; Update current size...
ADD R2, R2, #1 ; ... adding one
@readChar:
STR R2, [R0,#0x3D4] ; Store the current size
LDR LR, [R0,#0x3D4] ; Get the it again -.-'
MOV R2, LR ;,LSL#1 ; And use it as index to get next char
LDRB R12, [R1,R2] ; ...
CMP R12, #0 ; ... so we check it is not null
BEQ @writeNull
LDR R2, [R0,#0x3CC] ; Check if we can copy more bytes...
CMP LR, R2 ; ...
BLT @writeChar ; ...
@writeNull:
LDR R2, [R0,#0x3D0] ; Get the name pointer
MOV R1, LR ;,LSL#1 ; ... and use the size as index
MOV R3, #0 ; ... to write a null char
STRB R3, [R2,R1] ; ... at the end
LDR R1, [R0,#0x3D4] ; Get the size to call now update_cursor
| 38.326923 | 80 | 0.522328 |
4d8641cca47fa73027f682a2c60df6880968401d | 3,787 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2.log_464_559.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2.log_464_559.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2.log_464_559.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 %r15
push %rax
push %rdi
lea addresses_A_ht+0x1b542, %rax
and %r15, %r15
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
and $0xffffffffffffffc0, %rax
movntdq %xmm3, (%rax)
nop
nop
nop
nop
cmp $30782, %r10
pop %rdi
pop %rax
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
// Store
lea addresses_normal+0x9862, %r9
nop
cmp %rbp, %rbp
mov $0x5152535455565758, %r12
movq %r12, (%r9)
cmp $60582, %rdi
// Load
lea addresses_D+0x15752, %rcx
cmp $63595, %rbx
movb (%rcx), %r14b
nop
nop
nop
nop
nop
add $18218, %r14
// Store
lea addresses_PSE+0x7e12, %rbx
nop
nop
add %rdi, %rdi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm3
movups %xmm3, (%rbx)
nop
nop
nop
nop
nop
cmp $27256, %r9
// Store
lea addresses_PSE+0x5f32, %r9
nop
nop
nop
nop
nop
add %rbx, %rbx
movb $0x51, (%r9)
nop
nop
nop
nop
nop
xor %rbx, %rbx
// Store
lea addresses_WT+0x62f2, %rbx
nop
dec %r9
mov $0x5152535455565758, %r14
movq %r14, (%rbx)
nop
nop
nop
nop
nop
add $41087, %rdi
// Faulty Load
lea addresses_normal+0x16d72, %r12
nop
nop
nop
nop
nop
sub %rbp, %rbp
mov (%r12), %rcx
lea oracles, %rbx
and $0xff, %rcx
shlq $12, %rcx
mov (%rbx,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 8, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 2, 'same': False}}
{'34': 464}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 28.051852 | 1,391 | 0.65408 |
0ac2fbdc128976b4cd8b823df0b297dd6dca7b1c | 4,781 | asm | Assembly | 1541/64tass/equate.asm | silverdr/assembly | c2851f7033223e089285dce22443b7e219ed4f61 | [
"Unlicense"
] | 23 | 2015-03-23T15:16:57.000Z | 2022-03-18T12:43:42.000Z | 1541/64tass/equate.asm | silverdr/assembly | c2851f7033223e089285dce22443b7e219ed4f61 | [
"Unlicense"
] | null | null | null | 1541/64tass/equate.asm | silverdr/assembly | c2851f7033223e089285dce22443b7e219ed4f61 | [
"Unlicense"
] | 8 | 2016-04-13T11:19:35.000Z | 2021-12-22T07:39:00.000Z |
; Equates
bit0 = 1
bit1 = 2
bit2 = 4
bit3 = 8
bit4 = 16
bit5 = 32
bit6 = 64
bit7 = 128
all = 255
buff0 =$0300 ; buffers
buff1 =$0400
buff2 =$0500
buff3 =$0600
buff4 =$0700
.comment
bam1 =$0a00 ; trk 1-40
bam2 =$0b00 ; trk 41-80
buffcache=$0c00 ; 20 pages for track cache
cache_high=$20
.endc
skip1 =$24 ; bit zp
skip2 =$2c ; bit abs
numjob =6 ; number of jobs
notfnd =6
lrf =$80 ; last record flag
dyfile =$40 ; dirty flag for rr file
ovrflo =$20 ; rr print overflow
nssl =6 ; # of side-sector links
.comment
systrack =40 ; system track
sysdirsec=3 ; system directory sector
sysiz =2 ; default sector size
sysiob =$c0 ; iobyte default
dtos =$8f ; default top of stack
zpvar =2 ; zp start
.endc
; offset into ss for dat blk ptrs
ssioff =4+nssl+nssl
nssp =120 ; # of ptrs in ss
mxchns =6 ; max # channels in system
maxsa =18 ; max sa # +1
cr =13 ; carriage return
bindx =16 ; bam offset index
bfcnt =5 ; available buffer count
; command buffer ptr
cbptr =bfcnt+bfcnt
; error channel #
errchn =mxchns-1
errsa =16 ; error channel sa #
; command channel #
cmdchn =mxchns-2
; pwr up linuse (logical index usage)
lxint =%00001111
cmdsa =15 ; command channel sa #
apmode =2 ; open append mode
mdmode =3 ; open modify mode
wtmode =1 ; open write mode
reltyp =4 ; open relative type
dirtyp =7 ; open direct type
seqtyp =1 ; open sequential type
prgtyp =2 ; open program type
usrtyp =3 ; open user type
typmsk =7 ; mask for type bits
irsa =17 ; internal read sa #
iwsa =18 ; internal write sa #
.comment
; controller jobs
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
read_dv =$80 ; Read into track cache buffer.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
reset_dv =$82 ; Reset disk controller.
moton_dv =$84 ; Turn on spindle motor with spinup sequence.
motoff_dv=$86 ; Turn off spindle motor with spin down sequence.
motoni_dv=$88 ; Turn on spindle motor.
motoffi_dv=$8a ; Turn off spindle motor.
seek_dv =$8c ; Move head to a specific cylinder.
format_dv=$8e ; Format one cylinder side.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wrtsd_dv =$90 ; Write out track cache buffer.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diskin_dv=$92 ; Determine whether there is a disk present in the drive.
ledacton_dv=$94 ; Will turn on the activity led.
; Will turn off the activity led.
ledactoff_dv=$96
errledon_dv=$98 ; Will enable error led blinking.
; Will disable error led blinking.
errledoff_dv=$9a
side_dv=$9c ; Will select side.
bufmove_dv=$9e ; Will move data from/to a specific area
; in the track cache buffer.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wrtver_dv=$a0 ; Track cache verify write.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
trkwrt_dv=$a2 ; Will dump track cache buffer to disk.
pread_dv=$a4 ; Read sector notranslation.
pwrt_dv=$a6 ; Write sector notranslation.
pseek_dv=$a8 ; Move head to a specific logical cylinder.
tread_dv=$aa ; Read sector notrx.
twrt_dv=$ac ; Write sector notrx.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
seekhd_dv=$b0 ; Seek any header.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
tpread_dv=$b2 ; Read sector notranslation, notrx.
tpwrt_dv=$b4 ; Write sector notranslation, notrx.
detwp_dv=$b6 ; Check write protect status
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
seekphd_dv=$b8 ; Sector seek a particular header.
restore_dv=$c0 ; Restore head against track zero stop.
jumpc_dv =$d0 ; Execute buffer.
exbuf_dv =$e0 ; Execute buffer after motor is up to
; speed and on track.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
formatdk_dv=$f0 ; Format diskette.
precmptrk=43 ; precompensation starts at track 43
.endc
mxfils =5 ; max # filenames in string
dirlen =24 ; directory length used
nbsiz =27 ; nambuf text size
cmdlen =41 ; length of command buffer
tolong = 2
tomany = 3
tobig = 4
tosmal = 5
frmtt = $70
bumpc = $40
execd = $60
read = $80
write = $90
jumpc = $d0
seek = $b0
fread = $88
bump = $c0
secsek = $b8
exec = $e0
led0 = 8
led1 = 0
topwrt = $45
wrtmin = 9
wrtmax = 12
rdmax = 6
blindx = 6
numsyn = 5
gap1 = 11
drvmsk = 1
toprd = 69
fm4040 = $41
tim = 58
bam_one = $146
rom = $c000
tim2 = 64
gap2 = 4
mscnt = 255
dosver = 2
sysdirsec = 0
sysiz = 0
sysiob = 0
detwp_dv = 0
| 25.704301 | 73 | 0.553859 |
ef77acb8b96cfe143e020beb158402e46eedf699 | 287 | asm | Assembly | programs/oeis/053/A053469.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/053/A053469.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/053/A053469.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A053469: a(n) = n*6^(n-1).
; 1,12,108,864,6480,46656,326592,2239488,15116544,100776960,665127936,4353564672,28298170368,182849716224,1175462461440,7522959753216,47958868426752,304679870005248,1929639176699904,12187194800209920
add $0,1
mov $2,6
pow $2,$0
mul $0,$2
mov $1,$0
div $1,6
| 28.7 | 199 | 0.770035 |
2968ee15ffc23397057b8f64a9ea886295ecc7f4 | 603 | asm | Assembly | MEMZ/NyanMBR/Source/Stage1/main.asm | johnmelodyme/viruses | c8c4b628a6ae725a45312b4365fa8a6876509706 | [
"BSD-2-Clause"
] | 4 | 2018-11-15T08:23:06.000Z | 2019-04-29T13:30:44.000Z | MEMZ/NyanMBR/Source/Stage1/main.asm | johnmelodyme/Viruses | c8c4b628a6ae725a45312b4365fa8a6876509706 | [
"BSD-2-Clause"
] | null | null | null | MEMZ/NyanMBR/Source/Stage1/main.asm | johnmelodyme/Viruses | c8c4b628a6ae725a45312b4365fa8a6876509706 | [
"BSD-2-Clause"
] | 2 | 2019-02-13T19:53:26.000Z | 2021-05-30T19:04:43.000Z | use16
org 0x7c00
;setup cpu
;correct cs
jmp 0x0000:correct_cs
correct_cs:
; setup stack properly
cli
xor ax, ax
mov ss, ax
mov sp, 0x7BF0
sti
%include "decompress.asm" ; Decompress Code & Data
; Prepare the CPU segments
mov ax, 0x2000
mov ds, ax
mov es, ax
jmp 0x2000:0x0000 ; Jump to the decompressed Data, booting the actual "Kernel"
; Boot sector signature
times 510 - ($ - $$) db 0
dw 0xAA55
; Include the compressed data
comp: incbin "../../Build/stage2-compressed.bin" ; Hardcoded build dir :(
compsize: equ $-comp
; Align it to sectors
;align 512
times 4096 - ($ - $$) db 0
| 15.868421 | 86 | 0.694859 |
b9306584f51f6fe40e8b1c914b5a6b6df0c18bea | 660 | asm | Assembly | oeis/084/A084057.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/084/A084057.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/084/A084057.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A084057: a(n) = 2*a(n-1) + 4*a(n-2), a(0)=1, a(1)=1.
; Submitted by Jon Maiga
; 1,1,6,16,56,176,576,1856,6016,19456,62976,203776,659456,2134016,6905856,22347776,72318976,234029056,757334016,2450784256,7930904576,25664946176,83053510656,268766806016,869747654656,2814562533376,9108115685376,29474481504256,95381425750016,308660777517056,998847258034176,3232337626136576,10460064284409856,33849479073366016,109539215284371456,354476346862206976,1147109554861899776,3712124497172627456,12012687213792854016,38873872416276217856,125798493687723851776,407092477040552574976
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $2,5
add $3,$1
add $1,$2
lpe
mov $0,$3
| 47.142857 | 490 | 0.804545 |
21fd9f870036ee928deba2a13170c12c396b16a2 | 300 | asm | Assembly | libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_reserve.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_reserve.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_reserve.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; int bv_stack_reserve(bv_stack_t *s, size_t n)
SECTION code_clib
SECTION code_adt_bv_stack
PUBLIC bv_stack_reserve
EXTERN b_vector_reserve
defc bv_stack_reserve = b_vector_reserve
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _bv_stack_reserve
defc _bv_stack_reserve = bv_stack_reserve
ENDIF
| 15.789474 | 47 | 0.843333 |
d51d47d25af53f3feebb8557c536c2c3c16c7fbe | 569 | asm | Assembly | oeis/217/A217478.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/217/A217478.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/217/A217478.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A217478: Triangle of coefficients of polynomials providing the second term of the numerator for the generating function for odd powers (2*m+1) of Chebyshev S-polynomials. The present polynomials are called P(m;1,x^2).
; Submitted by Jamie Morken(s4)
; -2,3,-4,-4,10,-6,5,-20,21,-8,-6,35,-56,36,-10,7,-56,126,-120,55,-12,-8,84,-252,330,-220,78,-14,9,-120,462,-792,715,-364,105,-16,-10,165,-792,1716,-2002,1365,-560,136,-18,11,-220,1287,-3432,5005,-4368,2380,-816,171,-20
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
add $0,1
mul $0,-2
add $2,1
bin $0,$2
| 37.933333 | 219 | 0.666081 |
b3c942408394ca2c0573225f10b1dcca7346148f | 403 | asm | Assembly | programs/oeis/055/A055401.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/055/A055401.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/055/A055401.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A055401: Number of positive cubes needed to sum to n using the greedy algorithm.
; 0,1,2,3,4,5,6,7,1,2,3,4,5,6,7,8,2,3,4,5,6,7,8,9,3,4,5,1,2,3,4,5,6,7,8,2,3,4,5,6,7,8,9,3,4,5,6,7,8,9,10,4,5,6,2,3,4,5,6,7,8,9,3,4,1,2,3,4,5,6,7,8,2,3,4,5,6,7,8,9,3,4,5,6,7,8,9,10,4,5,6,2,3,4,5,6,7,8,9,3
lpb $0
seq $0,55400 ; Cube excess: difference between n and largest cube <= n.
add $1,5
lpe
div $1,5
mov $0,$1
| 40.3 | 203 | 0.598015 |
5ddb271ebcfdfd5cbbfcecd1b0cfb9910c28e0bb | 676 | asm | Assembly | oeis/000/A000056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/000/A000056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/000/A000056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A000056: Order of the group SL(2,Z_n).
; Submitted by Christian Krause
; 1,6,24,48,120,144,336,384,648,720,1320,1152,2184,2016,2880,3072,4896,3888,6840,5760,8064,7920,12144,9216,15000,13104,17496,16128,24360,17280,29760,24576,31680,29376,40320,31104,50616,41040,52416,46080,68880,48384,79464,63360,77760,72864,103776,73728,115248,90000,117504,104832,148824,104976,158400,129024,164160,146160,205320,138240,226920,178560,217728,196608,262080,190080,300696,235008,291456,241920,357840,248832,388944,303696,360000,328320,443520,314496,492960,368640,472392,413280,571704
mov $1,$0
add $0,1
seq $1,7434 ; Jordan function J_2(n) (a generalization of phi(n)).
mul $1,$0
mov $0,$1
| 67.6 | 495 | 0.786982 |
8fce9d276d3e7155bfc8778d4e8ba3b5479fec4a | 28 | asm | Assembly | tests/genabove.asm | dimitrit/uz80as | b4fd490c9ce89ac30c5b130d951a1ed4288233d0 | [
"MIT"
] | 8 | 2017-05-03T10:49:20.000Z | 2022-02-03T02:55:21.000Z | tests/genabove.asm | vipoo/uz80as | 7cf5c353a5c1ceeaf5ba7b502e220fb41e7d9fb0 | [
"MIT"
] | 1 | 2020-02-25T06:28:30.000Z | 2020-03-30T17:09:50.000Z | tests/genabove.asm | vipoo/uz80as | 7cf5c353a5c1ceeaf5ba7b502e220fb41e7d9fb0 | [
"MIT"
] | 2 | 2020-02-26T21:12:55.000Z | 2022-02-02T17:51:03.000Z | .ORG 65535
.DB 1, 2
.END
| 7 | 11 | 0.535714 |
f820bfd5556da951a3d57aaf020b631c55504f44 | 4,753 | asm | Assembly | src/asmmath.asm | johschmitz/TI-84-CE-Raytracing | 44ddd8802e236fe7b8045706574bed1a0104a7bf | [
"MIT"
] | 298 | 2022-02-10T15:22:39.000Z | 2022-03-27T19:26:03.000Z | src/asmmath.asm | TheLastMillennial/TI-84-CE-Raytracing | 254feecbafc93b1a05c8ee714e2854f2f7ed59a5 | [
"MIT"
] | 4 | 2022-02-11T15:41:34.000Z | 2022-02-25T23:35:03.000Z | src/asmmath.asm | TheLastMillennial/TI-84-CE-Raytracing | 254feecbafc93b1a05c8ee714e2854f2f7ed59a5 | [
"MIT"
] | 12 | 2022-02-10T20:40:46.000Z | 2022-03-01T17:17:06.000Z | public _fp_mul
public _fp_sqr
; Multiplies two Fixed24 values and returns the new value in HL
_fp_mul:
push ix
push bc
push iy
ld iy, $0
; Align ix to below the stack. Zero-fill 48 bits
ld ix, $FFFFFA
add ix, sp
ld (ix), iy
ld (ix + $3), iy
; Align iy to the arguments in the stack
ld iy, $C
add iy, sp
; We use the E register to track whether we need to negate the result
ld e, $0
; Take absolute value of the stack elements
bit 7, (iy + $2)
jp z, abs_x_end
inc e
ld a, $0
sub a, (iy + $0)
ld (iy + $0), a
ld a, $0
sbc a, (iy + $1)
ld (iy + $1), a
ld a, $0
sbc a, (iy + $2)
ld (iy + $2), a
abs_x_end:
bit 7, (iy + $5)
jp z, abs_y_end
inc e
ld a, $0
sub a, (iy + $3)
ld (iy + $3), a
ld a, $0
sbc a, (iy + $4)
ld (iy + $4), a
ld a, $0
sbc a, (iy + $5)
ld (iy + $5), a
abs_y_end:
; Perform each of the component-wise multiplications
; Multiply CF
ld h, (iy + $0)
ld l, (iy + $3)
mlt hl
; Shift our answer over by 8 bits
ld (ix), hl
ld hl, (ix + $1)
; Multiply BF
ld b, (iy + $1)
ld c, (iy + $3)
mlt bc
add hl, bc
; Multiply CE
ld b, (iy + $0)
ld c, (iy + $4)
mlt bc
add hl, bc
; Shift our answer over by 8 bits
ld (ix + $1), hl
ld hl, (ix + $2)
; Multiply AF
ld b, (iy + $2)
ld c, (iy + $3)
mlt bc
add hl, bc
; Multiply BE
ld b, (iy + $1)
ld c, (iy + $4)
mlt bc
add hl, bc
; Multiply CD
ld b, (iy + $0)
ld c, (iy + $5)
mlt bc
add hl, bc
; Shift our answer over by 8 bits
ld (ix + $2), hl
ld hl, (ix + $3)
; Multiply BD
ld b, (iy + $1)
ld c, (iy + $5)
mlt bc
add hl, bc
; Multiply AE
ld b, (iy + $2)
ld c, (iy + $4)
mlt bc
add hl, bc
; Shift our answer over by 8 bits
ld (ix + $3), hl
ld hl, (ix + $4)
; Multiply AD
ld b, (iy + $2)
ld c, (iy + $5)
mlt bc
add hl, bc
ld (ix + $4), hl
; Grab the last 24 bits of our computation
ld hl, (ix + $2)
; Shift hl left by 4 bits
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld (ix + $2), hl
ld bc, (ix + $2)
; Grab one byte below our 24 bit chunk
ld hl, $0
ld l, (ix + $1)
; Shift hl right by 4 bits
srl l
srl l
srl l
srl l
add hl, bc
; Negate the result if necessary
bit 0, e
jp z, negate_end
ld (ix), hl
ld a, $0
sub a, (ix + $0)
ld (ix + $0), a
ld a, $0
sbc a, (ix + $1)
ld (ix + $1), a
ld a, $0
sbc a, (ix + $2)
ld (ix + $2), a
ld hl, (ix)
negate_end:
pop iy
pop bc
pop ix
ret
; Computes the square of a Fixed24 value and returns the new value in HL
; This code is just a specialized case of the above code with a few conditions
; and redundant calculations removed
_fp_sqr:
push ix
push bc
push iy
ld iy, $0
; Align ix to below the stack. Zero-fill 48 bits
ld ix, $FFFFFA
add ix, sp
ld (ix), iy
ld (ix + $3), iy
; Align iy to the arguments in the stack
ld iy, $C
add iy, sp
; Take absolute value of the stack elements
bit 7, (iy + $2)
jp z, abs_x_end_sqr
ld a, $0
sub a, (iy + $0)
ld (iy + $0), a
ld a, $0
sbc a, (iy + $1)
ld (iy + $1), a
ld a, $0
sbc a, (iy + $2)
ld (iy + $2), a
abs_x_end_sqr:
; Perform each of the component-wise multiplications
; Multiply CC
ld h, (iy + $0)
ld l, (iy + $0)
mlt hl
; Shift our answer over by 8 bits
ld (ix), hl
ld hl, (ix + $1)
; Multiply 2 * BC
ld b, (iy + $1)
ld c, (iy + $0)
mlt bc
add hl, bc
add hl, bc
; Shift our answer over by 8 bits
ld (ix + $1), hl
ld hl, (ix + $2)
; Multiply 2 * AC
ld b, (iy + $2)
ld c, (iy + $0)
mlt bc
add hl, bc
add hl, bc
; Multiply BB
ld b, (iy + $1)
ld c, (iy + $1)
mlt bc
add hl, bc
; Shift our answer over by 8 bits
ld (ix + $2), hl
ld hl, (ix + $3)
; Multiply 2 * AB
ld b, (iy + $1)
ld c, (iy + $2)
mlt bc
add hl, bc
add hl, bc
; Shift our answer over by 8 bits
ld (ix + $3), hl
ld hl, (ix + $4)
; Multiply AA
ld b, (iy + $2)
ld c, (iy + $2)
mlt bc
add hl, bc
ld (ix + $4), hl
; Grab the last 24 bits of our computation
ld hl, (ix + $2)
; Shift hl left by 4 bits
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld (ix + $2), hl
ld bc, (ix + $2)
; Grab one byte below our 24 bit chunk
ld hl, $0
ld l, (ix + $1)
; Shift hl right by 4 bits
srl l
srl l
srl l
srl l
add hl, bc
pop iy
pop bc
pop ix
ret | 15.381877 | 79 | 0.491269 |
5b9b20cb2e524be9d5b489f77960463a40e3579d | 692 | asm | Assembly | oeis/038/A038121.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/038/A038121.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/038/A038121.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A038121: E.g.f.: (1 + 15*x + (45/2)*x^2 + (5/2)*x^3)/(1 - 2*x)^(13/2).
; Submitted by Jon Maiga
; 1,28,630,13860,315315,7567560,192972780,5237832600,151242416325,4638100767300,150738274937250,5179915266025500,187771928393424375,7164221267933730000,287080580807915895000,12057384393932467590000,529771326808407794735625,24307154994738710581987500,1162692247248334989505068750,57889835047206573687989212500,2995798963692940188353441746875,160917201478363644402984870975000,8960162355045248381529839406562500,516572838382173884952546393613125000,30800655488537117890295578719182578125
add $0,1
mov $2,$0
seq $0,1880 ; Coefficients of Bessel polynomials y_n (x).
mul $2,$0
mov $0,$2
div $0,15
| 62.909091 | 485 | 0.83237 |
0e1a78c66db63eb5293a106b54e83606b8a35aef | 468 | asm | Assembly | programs/oeis/098/A098359.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/098/A098359.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/098/A098359.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A098359: Multiplication table of the square numbers read by antidiagonals.
; 1,4,4,9,16,9,16,36,36,16,25,64,81,64,25,36,100,144,144,100,36,49,144,225,256,225,144,49,64,196,324,400,400,324,196,64,81,256,441,576,625,576,441,256,81,100,324,576,784,900,900,784,576,324,100,121,400,729
seq $0,224195 ; Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1.
seq $0,161511 ; Number of 1...0 pairs in the binary representation of 2n.
sub $0,1
pow $0,2
| 58.5 | 205 | 0.700855 |
67556759e4bfd378856372bba0af861edc1b0fdb | 700 | asm | Assembly | oeis/152/A152107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/152/A152107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/152/A152107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A152107: a(n) = ((6+sqrt(5))^n+(6-sqrt(5))^n)/2.
; Submitted by Christian Krause
; 1,6,41,306,2401,19326,157481,1290666,10606081,87262326,718359401,5915180706,48713027041,401185722606,3304124833001,27212740595226,224125017319681,1845905249384166,15202987455699881,125212786737489426,1031260829723176801,8493533567815949406,69953317092372912041,576140264506180512906,4745130344210605881601,39081215930835674679126,321875550499499313819881,2650988912138085850785666,21833724880172551481011681,179824042285789956397784526,1481043036144130380862052201,12197971122870075922013306106
mov $1,6
lpb $0
sub $0,1
mov $2,$3
mul $2,5
mul $3,6
add $3,$1
mul $1,6
add $1,$2
lpe
mov $0,$1
div $0,6
| 41.176471 | 496 | 0.814286 |
592d10dd7cf148503aebc11266a2335b73df205e | 174 | asm | Assembly | alice2/brads_alice2_archive/asm/timer.asm | lkesteloot/alice | 44b85caf744e5830536b5e813e761cc0ce3f695e | [
"Apache-2.0"
] | 63 | 2015-08-14T23:27:39.000Z | 2022-03-09T22:46:11.000Z | alice2/brads_alice2_archive/asm/timer.asm | lkesteloot/alice | 44b85caf744e5830536b5e813e761cc0ce3f695e | [
"Apache-2.0"
] | 64 | 2015-09-11T23:13:03.000Z | 2018-10-29T09:38:06.000Z | alice2/brads_alice2_archive/asm/timer.asm | lkesteloot/alice | 44b85caf744e5830536b5e813e761cc0ce3f695e | [
"Apache-2.0"
] | 9 | 2016-01-06T00:06:33.000Z | 2021-12-07T10:38:15.000Z |
;
; int get_timer_counter();
;
_get_timer_counter
PUSH AF
LD A, (TIMER_COUNTER)
LD L, A
LD H, 0
POP AF
RET
| 11.6 | 34 | 0.436782 |
fe963704248b62d22723b03a3bc00467917c45eb | 360 | asm | Assembly | programs/oeis/051/A051830.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/051/A051830.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/051/A051830.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A051830: Fibonacci(Pn+1) mod Pn, where Pn is the n-th prime.
; 0,0,3,0,1,0,0,1,0,1,1,0,1,0,0,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,0,1,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,0,1,0,1,1,0,1,1,0,1
seq $0,138689 ; Numbers of the form 26+p^2 (where p is a prime).
mul $0,64
mod $0,40
div $0,8
| 45 | 201 | 0.569444 |
5ef4fead362f9183a631b036bd0e2278f9285010 | 1,142 | asm | Assembly | asm/printhexa.asm | alexandru-dinu/programming-practice | 4e18db73f7146f35988bff0b193b5ec6b8e567fb | [
"MIT"
] | null | null | null | asm/printhexa.asm | alexandru-dinu/programming-practice | 4e18db73f7146f35988bff0b193b5ec6b8e567fb | [
"MIT"
] | 4 | 2019-07-18T22:21:32.000Z | 2020-04-27T22:47:28.000Z | asm/printhexa.asm | alexandru-dinu/programming-practice | 4e18db73f7146f35988bff0b193b5ec6b8e567fb | [
"MIT"
] | null | null | null | .model small
.stack 100h
.data
nr dw 0ACBDh
.code
main:
mov ax, @data
mov ds, ax
mov ax, nr
mov cx, 0
division:
mov bx, 16
div bx
push dx
inc cx
mov dx, 0
cmp ax, 0
jne division
aggregate:
pop ax
cmp ax, 0ah
je isa
cmp ax, 0bh
je isb
cmp ax, 0ch
je isc
cmp ax, 0dh
je isd
cmp ax, 0eh
je ise
cmp ax, 0fh
je isf
mov dl, al
add dl, '0'
append:
mov ah, 02h
int 21h
dec cx
cmp cx, 0
jne aggregate
je done
isa:
mov dl, 'A'
jmp append
isb:
mov dl, 'B'
jmp append
isc:
mov dl, 'C'
jmp append
isd:
mov dl, 'D'
jmp append
ise:
mov dl, 'E'
jmp append
isf:
mov dl, 'F'
jmp append
done:
mov ah, 4ch
int 21h
end main | 15.432432 | 43 | 0.359895 |
bddce3ae1e3e335e3f8efd8a27574f7ed51a2002 | 3,577 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_405_363.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_405_363.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_405_363.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 %rbp
push %rcx
push %rsi
lea addresses_normal_ht+0x16598, %rsi
sub $60020, %r13
mov (%rsi), %r11w
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_A_ht+0x8838, %r13
nop
nop
nop
xor %rsi, %rsi
mov $0x6162636465666768, %r11
movq %r11, %xmm2
and $0xffffffffffffffc0, %r13
movaps %xmm2, (%r13)
nop
nop
cmp $23007, %r14
lea addresses_normal_ht+0x1bc78, %r10
nop
nop
nop
nop
inc %r13
mov (%r10), %ebp
nop
sub %r13, %r13
lea addresses_D_ht+0x3858, %r10
clflush (%r10)
inc %r13
movw $0x6162, (%r10)
nop
nop
inc %r14
lea addresses_normal_ht+0x5c30, %r11
nop
nop
and %rcx, %rcx
mov $0x6162636465666768, %r14
movq %r14, (%r11)
nop
dec %rsi
pop %rsi
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %r9
push %rbx
push %rcx
push %rdi
// Store
mov $0x69ee4f0000000c88, %rcx
nop
sub $59655, %r14
mov $0x5152535455565758, %rbx
movq %rbx, %xmm4
vmovaps %ymm4, (%rcx)
nop
add %rbx, %rbx
// Faulty Load
lea addresses_US+0x14878, %rdi
nop
nop
nop
nop
nop
xor %r15, %r15
mov (%rdi), %rcx
lea oracles, %r15
and $0xff, %rcx
shlq $12, %rcx
mov (%r15,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'00': 405}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 29.319672 | 1,214 | 0.656696 |
b5221ae423ad9fcce35f315b5629accf34391744 | 44,628 | asm | Assembly | src/SKEIN/skein_block_x64.asm | NickViz/BinDiff | d089a38b0a334885aa86790eac46823eb28ed951 | [
"MIT"
] | 34 | 2015-02-04T18:03:14.000Z | 2020-11-10T06:45:28.000Z | src/SKEIN/skein_block_x64.asm | NickViz/BinDiff | d089a38b0a334885aa86790eac46823eb28ed951 | [
"MIT"
] | 5 | 2015-06-30T21:17:00.000Z | 2016-06-14T22:31:51.000Z | src/SKEIN/skein_block_x64.asm | NickViz/BinDiff | d089a38b0a334885aa86790eac46823eb28ed951 | [
"MIT"
] | 15 | 2015-10-29T14:21:58.000Z | 2022-01-19T07:33:14.000Z | ;
;----------------------------------------------------------------
; 64-bit x86 assembler code (Microsoft ML64) for Skein block functions
;
; Author: Doug Whiting, Hifn
;
; This code is released to the public domain.
;----------------------------------------------------------------
;
.code
;
_MASK_ALL_ equ (256+512+1024) ;all three algorithm bits
_MAX_FRAME_ equ 240
;
;;;;;;;;;;;;;;;;;
ifndef SKEIN_USE_ASM
_USE_ASM_ = _MASK_ALL_
elseif SKEIN_USE_ASM and _MASK_ALL_
_USE_ASM_ = SKEIN_USE_ASM
else
_USE_ASM_ = _MASK_ALL_
endif
;;;;;;;;;;;;;;;;;
ifndef SKEIN_LOOP ;configure loop unrolling
_SKEIN_LOOP = 0 ;default is all fully unrolled
else
_SKEIN_LOOP = SKEIN_LOOP
endif
; the unroll counts (0 --> fully unrolled)
SKEIN_UNROLL_256 = (_SKEIN_LOOP / 100) mod 10
SKEIN_UNROLL_512 = (_SKEIN_LOOP / 10) mod 10
SKEIN_UNROLL_1024 = (_SKEIN_LOOP ) mod 10
;
SKEIN_ASM_UNROLL = 0
irp _NN_,<256,512,1024>
if (SKEIN_UNROLL_&_NN_) eq 0
SKEIN_ASM_UNROLL = SKEIN_ASM_UNROLL + _NN_
endif
endm
;;;;;;;;;;;;;;;;;
;
ifndef SKEIN_ROUNDS
ROUNDS_256 = 72
ROUNDS_512 = 72
ROUNDS_1024 = 80
else
ROUNDS_256 = 8*((((SKEIN_ROUNDS / 100) + 5) mod 10) + 5)
ROUNDS_512 = 8*((((SKEIN_ROUNDS / 10) + 5) mod 10) + 5)
ROUNDS_1024 = 8*((((SKEIN_ROUNDS ) + 5) mod 10) + 5)
endif
;
irp _NN_,<256,512,1024>
if _USE_ASM_ and _NN_
irp _RR_,<%(ROUNDS_&_NN_)>
if _NN_ eq 1024
%out +++ SKEIN_ROUNDS_&_NN_ = _RR_
else
%out +++ SKEIN_ROUNDS_&_NN_ = _RR_
endif
endm
endif
endm
;;;;;;;;;;;;;;;;;
;
ifndef SKEIN_CODE_SIZE
ifdef SKEIN_PERF
SKEIN_CODE_SIZE equ (1)
endif
endif
;
;;;;;;;;;;;;;;;;;
;
ifndef SKEIN_DEBUG
_SKEIN_DEBUG = 0
else
_SKEIN_DEBUG = 1
endif
;;;;;;;;;;;;;;;;;
;
; define offsets of fields in hash context structure
;
HASH_BITS = 0 ;# bits of hash output
BCNT = 8 + HASH_BITS ;number of bytes in BUFFER[]
TWEAK = 8 + BCNT ;tweak values[0..1]
X_VARS = 16 + TWEAK ;chaining vars
;
;(Note: buffer[] in context structure is NOT needed here :-)
;
r08 equ <r8>
r09 equ <r9>
;
KW_PARITY = 01BD11BDAA9FC1A22h ;overall parity of key schedule words
FIRST_MASK = NOT (1 SHL 62)
;
; rotation constants for Skein
;
RC_256_0_0 = 14
RC_256_0_1 = 16
RC_256_1_0 = 52
RC_256_1_1 = 57
RC_256_2_0 = 23
RC_256_2_1 = 40
RC_256_3_0 = 5
RC_256_3_1 = 37
RC_256_4_0 = 25
RC_256_4_1 = 33
RC_256_5_0 = 46
RC_256_5_1 = 12
RC_256_6_0 = 58
RC_256_6_1 = 22
RC_256_7_0 = 32
RC_256_7_1 = 32
RC_512_0_0 = 46
RC_512_0_1 = 36
RC_512_0_2 = 19
RC_512_0_3 = 37
RC_512_1_0 = 33
RC_512_1_1 = 27
RC_512_1_2 = 14
RC_512_1_3 = 42
RC_512_2_0 = 17
RC_512_2_1 = 49
RC_512_2_2 = 36
RC_512_2_3 = 39
RC_512_3_0 = 44
RC_512_3_1 = 9
RC_512_3_2 = 54
RC_512_3_3 = 56
RC_512_4_0 = 39
RC_512_4_1 = 30
RC_512_4_2 = 34
RC_512_4_3 = 24
RC_512_5_0 = 13
RC_512_5_1 = 50
RC_512_5_2 = 10
RC_512_5_3 = 17
RC_512_6_0 = 25
RC_512_6_1 = 29
RC_512_6_2 = 39
RC_512_6_3 = 43
RC_512_7_0 = 8
RC_512_7_1 = 35
RC_512_7_2 = 56
RC_512_7_3 = 22
RC_1024_0_0 = 24
RC_1024_0_1 = 13
RC_1024_0_2 = 8
RC_1024_0_3 = 47
RC_1024_0_4 = 8
RC_1024_0_5 = 17
RC_1024_0_6 = 22
RC_1024_0_7 = 37
RC_1024_1_0 = 38
RC_1024_1_1 = 19
RC_1024_1_2 = 10
RC_1024_1_3 = 55
RC_1024_1_4 = 49
RC_1024_1_5 = 18
RC_1024_1_6 = 23
RC_1024_1_7 = 52
RC_1024_2_0 = 33
RC_1024_2_1 = 4
RC_1024_2_2 = 51
RC_1024_2_3 = 13
RC_1024_2_4 = 34
RC_1024_2_5 = 41
RC_1024_2_6 = 59
RC_1024_2_7 = 17
RC_1024_3_0 = 5
RC_1024_3_1 = 20
RC_1024_3_2 = 48
RC_1024_3_3 = 41
RC_1024_3_4 = 47
RC_1024_3_5 = 28
RC_1024_3_6 = 16
RC_1024_3_7 = 25
RC_1024_4_0 = 41
RC_1024_4_1 = 9
RC_1024_4_2 = 37
RC_1024_4_3 = 31
RC_1024_4_4 = 12
RC_1024_4_5 = 47
RC_1024_4_6 = 44
RC_1024_4_7 = 30
RC_1024_5_0 = 16
RC_1024_5_1 = 34
RC_1024_5_2 = 56
RC_1024_5_3 = 51
RC_1024_5_4 = 4
RC_1024_5_5 = 53
RC_1024_5_6 = 42
RC_1024_5_7 = 41
RC_1024_6_0 = 31
RC_1024_6_1 = 44
RC_1024_6_2 = 47
RC_1024_6_3 = 46
RC_1024_6_4 = 19
RC_1024_6_5 = 42
RC_1024_6_6 = 44
RC_1024_6_7 = 25
RC_1024_7_0 = 9
RC_1024_7_1 = 48
RC_1024_7_2 = 35
RC_1024_7_3 = 52
RC_1024_7_4 = 23
RC_1024_7_5 = 31
RC_1024_7_6 = 37
RC_1024_7_7 = 20
;
; Input: reg
; Output: <reg> <<< RC_BlkSize_roundNum_mixNum, BlkSize=256/512/1024
;
RotL64 macro reg,BLK_SIZE,ROUND_NUM,MIX_NUM
_RCNT_ = ( RC_&BLK_SIZE&_&ROUND_NUM&_&MIX_NUM AND 63 )
if _RCNT_ ;is there anything to do?
rol reg,_RCNT_
endif
endm
;
;----------------------------------------------------------------
;
; MACROS: define local vars and configure stack
;
;----------------------------------------------------------------
; declare allocated space on the stack
StackVar macro localName,localSize
localName = _STK_OFFS_
_STK_OFFS_ = _STK_OFFS_+(localSize)
endm ;StackVar
;
;----------------------------------------------------------------
;
; MACRO: Configure stack frame, allocate local vars
;
Setup_Stack macro BLK_BITS,KS_CNT,NO_FRAME,debugCnt
WCNT = (BLK_BITS)/64
;
_PushCnt_ = 0 ;save nonvolatile regs on stack
irp _reg_,<rbp,rsi,rdi,rbx,r12,r13,r14,r15>
push _reg_
.pushreg _reg_ ;pseudo-op push for exception handling
_PushCnt_ = _PushCnt_ + 1 ;track count to keep alignment
endm
;
_STK_OFFS_ = 0 ;starting offset from rsp
;---- local variables ;<-- rsp
StackVar X_stk ,8*(WCNT) ;local context vars
StackVar ksTwk ,8*3 ;key schedule: tweak words
StackVar ksKey ,8*(WCNT)+8 ;key schedule: key words
if (SKEIN_ASM_UNROLL and (BLK_BITS)) eq 0
StackVar ksRot ,16*(KS_CNT+0);leave space for "rotation" to happen
endif
StackVar Wcopy ,8*(WCNT) ;copy of input block
if _SKEIN_DEBUG
ifnb <debugCnt> ;temp location for debug X[] info
StackVar xDebug_&BLK_BITS ,8*(debugCnt)
endif
endif
if ((8*_PushCnt_ + _STK_OFFS_) and 8) eq 0
StackVar align16,8 ;keep 16-byte aligned (adjust for retAddr?)
tmpStk_&BLK_BITS = align16 ;use this
endif
LOCAL_SIZE = _STK_OFFS_ ;size of local vars
;----
StackVar savRegs,8*_PushCnt_ ;saved registers
StackVar retAddr,8 ;return address
;---- caller parameters
StackVar ctxPtr ,8 ;context ptr
StackVar blkPtr ,8 ;pointer to block data
StackVar blkCnt ,8 ;number of full blocks to process
StackVar bitAdd ,8 ;bit count to add to tweak
;---- caller's stack frame
;
; set up the stack frame pointer (rbp)
;
FRAME_OFFS = ksTwk + 128 ;allow short (negative) offset to ksTwk, kwKey
if FRAME_OFFS gt _STK_OFFS_ ;keep rbp in the "locals" range
FRAME_OFFS = _STK_OFFS_
endif
if FRAME_OFFS gt _MAX_FRAME_ ;keep Microsoft .setframe happy
FRAME_OFFS = _MAX_FRAME_
endif
;
ifdef SKEIN_ASM_INFO
if FRAME_OFFS+128 lt savRegs
%out +++ SKEIN_&BLK_BITS: Unable to reach all of Wcopy with short offset from rbp.
elseif FRAME_OFFS+128 lt Wcopy
%out +++ SKEIN_&BLK_BITS: Unable to reach end of Wcopy with short offset from rbp.
elseif FRAME_OFFS+128 lt _STK_OFFS_
%out +++ SKEIN_&BLK_BITS: Unable to reach caller parms with short offset from rbp
endif
endif
;put some useful defines in the .lst file (for grep)
__STK_LCL_SIZE_&BLK_BITS = LOCAL_SIZE
__STK_TOT_SIZE_&BLK_BITS = _STK_OFFS_
__STK_FRM_OFFS_&BLK_BITS = FRAME_OFFS
;
; Notes on stack frame setup:
; * the most frequently used variable is X_stk[], based at [rsp+0]
; * the next most used is the key schedule arrays, ksKey and ksTwk
; so rbp is "centered" there, allowing short offsets to the key
; schedule even in 1024-bit Skein case
; * the Wcopy variables are infrequently accessed, but they have long
; offsets from both rsp and rbp only in the 1024-bit case.
; * all other local vars and calling parameters can be accessed
; with short offsets, except in the 1024-bit case
;
sub rsp,LOCAL_SIZE ;make room for the locals
.allocstack LOCAL_SIZE ;pseudo op for exception handling
lea rbp,[rsp+FRAME_OFFS] ;maximize use of short offsets
ifb <NO_FRAME>
.setframe rbp, FRAME_OFFS ;pseudo op for exception handling
endif
mov [FP_+ctxPtr],rcx ;save caller's parameters on the stack
mov [FP_+blkPtr],rdx
mov [FP_+blkCnt],r08
mov [FP_+bitAdd],r09
.endprolog ;pseudo op to support exception handling
mov rdi,[FP_+ctxPtr ] ;rdi --> context
;
endm ;Setup_Stack
;
FP_ equ <rbp-FRAME_OFFS> ;keep as many short offsets as possible
;
;----------------------------------------------------------------
;
Reset_Stack macro procStart
add rsp,LOCAL_SIZE ;get rid of locals (wipe??)
irp _reg_,<r15,r14,r13,r12,rbx,rdi,rsi,rbp>
pop _reg_
_PushCnt_ = _PushCnt_ - 1
endm
if _PushCnt_
.err "Mismatched push/pops?"
endif
;display code size in bytes to stdout
irp _BCNT_,<%($+1-procStart)> ;account for return opcode
_ProcBytes_ = _BCNT_
if _BCNT_ ge 10000
%out procStart code size = _BCNT_ bytes
elseif _BCNT_ ge 1000
%out procStart code size = _BCNT_ bytes
else
%out procStart code size = _BCNT_ bytes
endif
endm ;irp _BCNT_
endm ; Reset_Stack
;
;----------------------------------------------------------------
; macros to help debug internals
;
if _SKEIN_DEBUG
extrn Skein_Show_Block:proc ;calls to C routines
extrn Skein_Show_Round:proc
;
SKEIN_RND_SPECIAL = 1000
SKEIN_RND_KEY_INITIAL = SKEIN_RND_SPECIAL+0
SKEIN_RND_KEY_INJECT = SKEIN_RND_SPECIAL+1
SKEIN_RND_FEED_FWD = SKEIN_RND_SPECIAL+2
;
Skein_Debug_Block macro BLK_BITS
;
;void Skein_Show_Block(uint_t bits,const Skein_Ctxt_Hdr_t *h,const u64b_t *X,
; const u08b_t *blkPtr, const u64b_t *wPtr,
; const u64b_t *ksPtr,const u64b_t *tsPtr);
;
irp _reg_,<rax,rcx,rdx,r08,r09,r10,r11>
push _reg_ ;save all volatile regs on tack before the call
endm
; get and push call parameters
lea rax,[FP_+ksTwk] ;tweak pointer
push rax
lea rax,[FP_+ksKey] ;key pointer
push rax
lea rax,[FP_+Wcopy] ;wPtr
push rax
mov r09,[FP_+blkPtr] ;blkPtr
push r09 ;(push register parameters anyway to make room on stack)
mov rdx,[FP_+ctxPtr]
lea r08,[rdx+X_VARS] ;X (pointer)
push r08
push rdx ;h (pointer)
mov rcx, BLK_BITS ;bits
push rdx
call Skein_Show_Block ;call external debug handler
add rsp,7*8 ;discard parameters on stack
irp _reg_,<r11,r10,r09,r08,rdx,rcx,rax>
pop _reg_ ;restore regs
endm
endm ; Skein_Debug_Block
;
;
; the macro to "call" to debug a round
;
Skein_Debug_Round macro BLK_BITS,R,RDI_OFFS,afterOp
; call the appropriate (local) debug function
push r08
if (SKEIN_ASM_UNROLL and BLK_BITS) or (R ge SKEIN_RND_SPECIAL)
mov r08, R
else ;compute round number using edi
_rOffs_ = RDI_OFFS + 0
if BLK_BITS eq 1024
mov r08,[rsp+8+rIdx_offs] ;get rIdx off the stack (adjust for push r08)
lea r08,[4*r08+1+(((R)-1) and 3)+_rOffs_]
else
lea r08,[4*rdi+1+(((R)-1) and 3)+_rOffs_]
endif
endif
call Skein_Debug_Round_&BLK_BITS
pop r08
;
afterOp
endm ; Skein_Debug_Round
else ;------- _SKEIN_DEBUG (dummy macros if debug not enabled)
Skein_Debug_Block macro BLK_BITS,afterOp
endm
;
Skein_Debug_Round macro BLK_BITS,R,RDI_OFFS,afterOp
endm
;
endif ; _SKEIN_DEBUG
;
;----------------------------------------------------------------
;
addReg macro dstReg,srcReg_A,srcReg_B,useAddOp,immOffs
ifnb <immOffs>
lea dstReg,[srcReg_A&&srcReg_B + dstReg + immOffs]
elseif ((useAddOp + 0) eq 0)
ifndef ASM_NO_LEA
;lea seems to be faster on Core 2 Duo CPUs!
lea dstReg,[srcReg_A&&srcReg_B + dstReg]
else
add dstReg, srcReg_A&&srcReg_B
endif
else
add dstReg, srcReg_A&&srcReg_B
endif
endm
;
;=================================== Skein_256 =============================================
;
if _USE_ASM_ and 256
public Skein_256_Process_Block
;
; void Skein_256_Process_Block(Skein_256_Ctxt_t *ctx,const u08b_t *blkPtr,size_t blkCnt,size_t bitcntAdd);
;
;;;;;;;;;;;;;;;;;
;
; code
;
Skein_256_Process_Block proc frame
Setup_Stack 256,((ROUNDS_256/8)+1)
mov r14,[rdi+TWEAK+8]
jmp short Skein_256_block_loop
align 16
; main hash loop for Skein_256
Skein_256_block_loop:
;
; general register usage:
; RAX..RDX = X0..X3
; R08..R12 = ks[0..4]
; R13..R15 = ts[0..2]
; RSP, RBP = stack/frame pointers
; RDI = round counter or context pointer
; RSI = temp
;
mov r13,[rdi+TWEAK+0]
add r13,[FP_+bitAdd] ;computed updated tweak value T0
mov r15,r14
xor r15,r13 ;now r13.r15 is set as the tweak
mov r12,KW_PARITY
mov r08,[rdi+X_VARS+ 0]
mov r09,[rdi+X_VARS+ 8]
mov r10,[rdi+X_VARS+16]
mov r11,[rdi+X_VARS+24]
mov [rdi+TWEAK+0],r13 ;save updated tweak value ctx->h.T[0]
xor r12,r08 ;start accumulating overall parity
mov rsi,[FP_+blkPtr ] ;esi --> input block
xor r12,r09
mov rax,[rsi+ 0] ;get X[0..3]
xor r12,r10
mov rbx,[rsi+ 8]
xor r12,r11
mov rcx,[rsi+16]
mov rdx,[rsi+24]
mov [FP_+Wcopy+ 0],rax ;save copy of input block
mov [FP_+Wcopy+ 8],rbx
mov [FP_+Wcopy+16],rcx
mov [FP_+Wcopy+24],rdx
add rax, r08 ;initial key injection
add rbx, r09
add rcx, r10
add rdx, r11
add rbx, r13
add rcx, r14
if _SKEIN_DEBUG
mov [rdi+TWEAK+ 8],r14 ;save updated tweak T[1] (start bit cleared?)
mov [FP_+ksKey+ 0],r08 ;save key schedule on stack for Skein_Debug_Block
mov [FP_+ksKey+ 8],r09
mov [FP_+ksKey+16],r10
mov [FP_+ksKey+24],r11
mov [FP_+ksKey+32],r12
mov [FP_+ksTwk+ 0],r13
mov [FP_+ksTwk+ 8],r14
mov [FP_+ksTwk+16],r15
mov [rsp+X_stk + 0],rax ;save X[] on stack for Skein_Debug_Block
mov [rsp+X_stk + 8],rbx
mov [rsp+X_stk +16],rcx
mov [rsp+X_stk +24],rdx
Skein_Debug_Block 256 ;debug dump
Skein_Debug_Round 256,SKEIN_RND_KEY_INITIAL
endif
;
if ((SKEIN_ASM_UNROLL and 256) eq 0)
mov [FP_+ksKey+40],r08 ;save key schedule on stack for looping code
mov [FP_+ksKey+ 8],r09
mov [FP_+ksKey+16],r10
mov [FP_+ksKey+24],r11
mov [FP_+ksKey+32],r12
mov [FP_+ksTwk+24],r13
mov [FP_+ksTwk+ 8],r14
mov [FP_+ksTwk+16],r15
endif
add rsi, WCNT*8 ;skip the block
mov [FP_+blkPtr ],rsi ;update block pointer
;
opLoop macro op1,op2
if (SKEIN_ASM_UNROLL and 256) eq 0
op1
else
op2
endif
endm
;
;
; now the key schedule is computed. Start the rounds
;
if SKEIN_ASM_UNROLL and 256
_UNROLL_CNT = ROUNDS_256/8
else
_UNROLL_CNT = SKEIN_UNROLL_256
if ((ROUNDS_256/8) mod _UNROLL_CNT)
.err "Invalid SKEIN_UNROLL_256"
endif
xor rdi,rdi ;rdi = iteration count
Skein_256_round_loop:
endif
_Rbase_ = 0
rept _UNROLL_CNT*2
; all X and ks vars in regs ; (ops to "rotate" ks vars, via mem, if not unrolled)
; round 4*_RBase_ + 0
addReg rax, rbx
RotL64 rbx, 256,%((4*_RBase_+0) and 7),0
addReg rcx, rdx
opLoop <mov r08,[FP_+ksKey+8*rdi+8*1]>
xor rbx, rax
RotL64 rdx, 256,%((4*_RBase_+0) and 7),1
xor rdx, rcx
if SKEIN_ASM_UNROLL and 256
irp _r0_,<%(08+(_Rbase_+3) mod 5)>
irp _r1_,<%(13+(_Rbase_+2) mod 3)>
lea rdi,[r&_r0_+r&_r1_] ;precompute key injection value for rcx
endm
endm
endif
opLoop <mov r13,[FP_+ksTwk+8*rdi+8*1]>
Skein_Debug_Round 256,%(4*_RBase_+1)
; round 4*_RBase_ + 1
addReg rax, rdx
RotL64 rdx, 256,%((4*_RBase_+1) and 7),0
xor rdx, rax
opLoop <mov r09,[FP_+ksKey+8*rdi+8*2]>
addReg rcx, rbx
RotL64 rbx, 256,%((4*_RBase_+1) and 7),1
xor rbx, rcx
opLoop <mov r11,[FP_+ksKey+8*rdi+8*4]>
Skein_Debug_Round 256,%(4*_RBase_+2)
if SKEIN_ASM_UNROLL and 256
irp _r0_,<%(08+(_Rbase_+2) mod 5)>
irp _r1_,<%(13+(_Rbase_+1) mod 3)>
lea rsi,[r&_r0_+r&_r1_] ;precompute key injection value for rbx
endm
endm
endif
; round 4*_RBase_ + 2
addReg rax, rbx
RotL64 rbx, 256,%((4*_RBase_+2) and 7),0
addReg rcx, rdx
opLoop <mov r10,[FP_+ksKey+8*rdi+8*3]>
xor rbx, rax
RotL64 rdx, 256,%((4*_RBase_+2) and 7),1
xor rdx, rcx
opLoop <mov [FP_+ksKey+8*rdi+8*6],r08> ;"rotate" the key
opLoop <lea r11,[r11+rdi+1]> ;precompute key + tweak
Skein_Debug_Round 256,%(4*_RBase_+3)
; round 4*_RBase_ + 3
addReg rax, rdx
RotL64 rdx, 256,%((4*_RBase_+3) and 7),0
addReg rcx, rbx
opLoop <add r10,[FP_+ksTwk+8*rdi+8*2]> ;precompute key + tweak
opLoop <mov [FP_+ksTwk+8*rdi+8*4],r13> ;"rotate" the tweak
xor rdx, rax
RotL64 rbx, 256,%((4*_RBase_+3) and 7),1
xor rbx, rcx
Skein_Debug_Round 256,%(4*_RBase_+4)
opLoop <addReg r09,r13> ;precompute key+tweak
;inject key schedule words
_Rbase_ = _Rbase_+1
if SKEIN_ASM_UNROLL and 256
addReg rax,r,%(08+((_Rbase_+0) mod 5))
addReg rbx,rsi
addReg rcx,rdi
addReg rdx,r,%(08+((_Rbase_+3) mod 5)),,_Rbase_
else
inc rdi
addReg rax,r08
addReg rcx,r10
addReg rbx,r09
addReg rdx,r11
endif
Skein_Debug_Round 256,SKEIN_RND_KEY_INJECT
endm ;rept _UNROLL_CNT
;
if (SKEIN_ASM_UNROLL and 256) eq 0
cmp rdi,2*(ROUNDS_256/8)
jb Skein_256_round_loop
endif ; (SKEIN_ASM_UNROLL and 256) eq 0
mov rdi,[FP_+ctxPtr ] ;restore edi --> context
;----------------------------
; feedforward: ctx->X[i] = X[i] ^ w[i], {i=0..3}
xor rax,[FP_+Wcopy + 0]
mov r14,FIRST_MASK
xor rbx,[FP_+Wcopy + 8]
xor rcx,[FP_+Wcopy +16]
xor rdx,[FP_+Wcopy +24]
mov [rdi+X_VARS+ 0],rax ;store final result
and r14,[rdi+TWEAK + 8]
dec qword ptr [FP_+blkCnt] ;set zero flag
mov [rdi+X_VARS+ 8],rbx
mov [rdi+X_VARS+16],rcx
mov [rdi+X_VARS+24],rdx
Skein_Debug_Round 256,SKEIN_RND_FEED_FWD,,<cmp qword ptr [FP_+blkCnt],0>
; go back for more blocks, if needed
jnz Skein_256_block_loop
mov [rdi+TWEAK + 8],r14
Reset_Stack Skein_256_Process_Block
ret
if _SKEIN_DEBUG
Skein_Debug_Round_256:
mov [FP_+X_stk+ 0],rax ;first, save X[] state on stack so debug routines can access it
mov [FP_+X_stk+ 8],rbx ;(use FP_ since rsp has changed!)
mov [FP_+X_stk+16],rcx
mov [FP_+X_stk+24],rdx
push rdx ;save two regs for BLK_BITS-specific parms
push rcx
mov rdx,[FP_+ctxPtr] ;ctx_hdr_ptr
mov rcx, 256
jmp Skein_Debug_Round_Common
endif
Skein_256_Process_Block endp
;
ifdef SKEIN_CODE_SIZE
public Skein_256_Process_Block_CodeSize
Skein_256_Process_Block_CodeSize proc
mov rax,_ProcBytes_
ret
Skein_256_Process_Block_CodeSize endp
;
public Skein_256_Unroll_Cnt
Skein_256_Unroll_Cnt proc
if _UNROLL_CNT ne ROUNDS_256/8
mov rax,_UNROLL_CNT
else
xor rax,rax
endif
ret
Skein_256_Unroll_Cnt endp
endif
;
endif ;_USE_ASM_ and 256
;
;=================================== Skein_512 =============================================
;
if _USE_ASM_ and 512
public Skein_512_Process_Block
;
; void Skein_512_Process_Block(Skein_512_Ctxt_t *ctx,const u08b_t *blkPtr,size_t blkCnt,size_t bitcntAdd);
;
rX_512_0 equ r08 ;register assignments for X[] values during rounds
rX_512_1 equ r09
rX_512_2 equ r10
rX_512_3 equ r11
rX_512_4 equ r12
rX_512_5 equ r13
rX_512_6 equ r14
rX_512_7 equ r15
;
;;;;;;;;;;;;;;;;;
; MACRO: one round for 512-bit blocks
;
R_512_OneRound macro r0,r1,r2,r3,r4,r5,r6,r7,_Rn_,op1,op2,op3,op4
;
addReg rX_512_&r0, rX_512_&r1
RotL64 rX_512_&r1, 512,%((_Rn_) and 7),0
xor rX_512_&r1, rX_512_&r0
op1
addReg rX_512_&r2, rX_512_&r3
RotL64 rX_512_&r3, 512,%((_Rn_) and 7),1
xor rX_512_&r3, rX_512_&r2
op2
addReg rX_512_&r4, rX_512_&r5
RotL64 rX_512_&r5, 512,%((_Rn_) and 7),2
xor rX_512_&r5, rX_512_&r4
op3
addReg rX_512_&r6, rX_512_&r7
RotL64 rX_512_&r7, 512,%((_Rn_) and 7),3
xor rX_512_&r7, rX_512_&r6
op4
Skein_Debug_Round 512,%(_Rn_+1),-4
;
endm ;R_512_OneRound
;
;;;;;;;;;;;;;;;;;
; MACRO: eight rounds for 512-bit blocks
;
R_512_FourRounds macro _RR_ ;RR = base round number (0 mod 8)
if SKEIN_ASM_UNROLL and 512
; here for fully unrolled case.
_II_ = ((_RR_)/4) + 1 ;key injection counter
R_512_OneRound 0,1,2,3,4,5,6,7,%((_RR_)+0),<mov rax,[FP_+ksKey+8*(((_II_)+3) mod 9)]>,,<mov rbx,[FP_+ksKey+8*(((_II_)+4) mod 9)]>
R_512_OneRound 2,1,4,7,6,5,0,3,%((_RR_)+1),<mov rcx,[FP_+ksKey+8*(((_II_)+5) mod 9)]>,,<mov rdx,[FP_+ksKey+8*(((_II_)+6) mod 9)]>
R_512_OneRound 4,1,6,3,0,5,2,7,%((_RR_)+2),<mov rsi,[FP_+ksKey+8*(((_II_)+7) mod 9)]>,,<add rcx,[FP_+ksTwk+8*(((_II_)+0) mod 3)]>
R_512_OneRound 6,1,0,7,2,5,4,3,%((_RR_)+3),<add rdx,[FP_+ksTwk+8*(((_II_)+1) mod 3)]>,
; inject the key schedule
add r08,[FP_+ksKey+8*(((_II_)+0) mod 9)]
addReg r11,rax
add r09,[FP_+ksKey+8*(((_II_)+1) mod 9)]
addReg r12,rbx
add r10,[FP_+ksKey+8*(((_II_)+2) mod 9)]
addReg r13,rcx
addReg r14,rdx
addReg r15,rsi,,,(_II_)
else
; here for looping case ;"rotate" key/tweak schedule (move up on stack)
inc rdi ;bump key injection counter
R_512_OneRound 0,1,2,3,4,5,6,7,%((_RR_)+0),<mov rdx,[FP_+ksKey+8*rdi+8*6]>,<mov rax,[FP_+ksTwk+8*rdi-8*1]> ,<mov rsi,[FP_+ksKey+8*rdi-8*1]>
R_512_OneRound 2,1,4,7,6,5,0,3,%((_RR_)+1),<mov rcx,[FP_+ksKey+8*rdi+8*5]>,<mov [FP_+ksTwk+8*rdi+8*2],rax>,<mov [FP_+ksKey+8*rdi+8*8],rsi>
R_512_OneRound 4,1,6,3,0,5,2,7,%((_RR_)+2),<mov rbx,[FP_+ksKey+8*rdi+8*4]>,<add rdx,[FP_+ksTwk+8*rdi+8*1]> ,<mov rsi,[FP_+ksKey+8*rdi+8*7]>
R_512_OneRound 6,1,0,7,2,5,4,3,%((_RR_)+3),<mov rax,[FP_+ksKey+8*rdi+8*3]>,<add rcx,[FP_+ksTwk+8*rdi+8*0]>
; inject the key schedule
add r08,[FP_+ksKey+8*rdi+8*0]
addReg r11,rax
addReg r12,rbx
add r09,[FP_+ksKey+8*rdi+8*1]
addReg r13,rcx
addReg r14,rdx
add r10,[FP_+ksKey+8*rdi+8*2]
addReg r15,rsi
addReg r15,rdi ;inject the round number
endif
;show the result of the key injection
Skein_Debug_Round 512,SKEIN_RND_KEY_INJECT
endm ;R_512_EightRounds
;
;;;;;;;;;;;;;;;;;
; instantiated code
;
Skein_512_Process_Block proc frame
Setup_Stack 512,ROUNDS_512/8
mov rbx,[rdi+TWEAK+ 8]
jmp short Skein_512_block_loop
align 16
; main hash loop for Skein_512
Skein_512_block_loop:
; general register usage:
; RAX..RDX = temps for key schedule pre-loads
; R08..R15 = X0..X7
; RSP, RBP = stack/frame pointers
; RDI = round counter or context pointer
; RSI = temp
;
mov rax,[rdi+TWEAK+ 0]
add rax,[FP_+bitAdd] ;computed updated tweak value T0
mov rcx,rbx
xor rcx,rax ;rax/rbx/rcx = tweak schedule
mov [rdi+TWEAK+ 0],rax ;save updated tweak value ctx->h.T[0]
mov [FP_+ksTwk+ 0],rax
mov rdx,KW_PARITY
mov rsi,[FP_+blkPtr ] ;rsi --> input block
mov [FP_+ksTwk+ 8],rbx
mov [FP_+ksTwk+16],rcx
irp _Rn_,<0,1,2,3,4,5,6,7>
mov rX_512_&_Rn_,[rdi+X_VARS+8*(_Rn_)]
xor rdx,rX_512_&_Rn_ ;compute overall parity
mov [FP_+ksKey+8*(_Rn_)],rX_512_&_Rn_
endm ;load state into r08..r15, compute parity
mov [FP_+ksKey+8*(8)],rdx ;save key schedule parity
addReg rX_512_5,rax ;precompute key injection for tweak
addReg rX_512_6,rbx
if _SKEIN_DEBUG
mov [rdi+TWEAK+ 8],rbx ;save updated tweak value ctx->h.T[1] for Skein_Debug_Block below
endif
mov rax,[rsi+ 0] ;load input block
mov rbx,[rsi+ 8]
mov rcx,[rsi+16]
mov rdx,[rsi+24]
addReg r08,rax ;do initial key injection
addReg r09,rbx
mov [FP_+Wcopy+ 0],rax ;keep local copy for feedforward
mov [FP_+Wcopy+ 8],rbx
addReg r10,rcx
addReg r11,rdx
mov [FP_+Wcopy+16],rcx
mov [FP_+Wcopy+24],rdx
mov rax,[rsi+32]
mov rbx,[rsi+40]
mov rcx,[rsi+48]
mov rdx,[rsi+56]
addReg r12,rax
addReg r13,rbx
addReg r14,rcx
addReg r15,rdx
mov [FP_+Wcopy+32],rax
mov [FP_+Wcopy+40],rbx
mov [FP_+Wcopy+48],rcx
mov [FP_+Wcopy+56],rdx
if _SKEIN_DEBUG
irp _Rn_,<0,1,2,3,4,5,6,7> ;save values on stack for debug output
mov [rsp+X_stk+8*(_Rn_)],rX_512_&_Rn_
endm
Skein_Debug_Block 512 ;debug dump
Skein_Debug_Round 512,SKEIN_RND_KEY_INITIAL
endif
add rsi, 8*WCNT ;skip the block
mov [FP_+blkPtr ],rsi ;update block pointer
;
;;;;;;;;;;;;;;;;;
; now the key schedule is computed. Start the rounds
;
if SKEIN_ASM_UNROLL and 512
_UNROLL_CNT = ROUNDS_512/8
else
_UNROLL_CNT = SKEIN_UNROLL_512
if ((ROUNDS_512/8) mod _UNROLL_CNT)
.err "Invalid SKEIN_UNROLL_512"
endif
xor rdi,rdi ;rdi = round counter
Skein_512_round_loop:
endif
;
_Rbase_ = 0
rept _UNROLL_CNT*2
R_512_FourRounds %(4*_Rbase_+00)
_Rbase_ = _Rbase_+1
endm ;rept _UNROLL_CNT
;
if (SKEIN_ASM_UNROLL and 512) eq 0
cmp rdi,2*(ROUNDS_512/8)
jb Skein_512_round_loop
mov rdi,[FP_+ctxPtr ] ;restore rdi --> context
endif
; end of rounds
;;;;;;;;;;;;;;;;;
; feedforward: ctx->X[i] = X[i] ^ w[i], {i=0..7}
irp _Rn_,<0,1,2,3,4,5,6,7>
if (_Rn_ eq 0)
mov rbx,FIRST_MASK
endif
xor rX_512_&_Rn_,[FP_+Wcopy+8*(_Rn_)] ;feedforward XOR
mov [rdi+X_VARS+8*(_Rn_)],rX_512_&_Rn_ ;and store result
if (_Rn_ eq 6)
and rbx,[rdi+TWEAK+ 8]
endif
endm
Skein_Debug_Round 512,SKEIN_RND_FEED_FWD
; go back for more blocks, if needed
dec qword ptr [FP_+blkCnt]
jnz Skein_512_block_loop
mov [rdi+TWEAK + 8],rbx
Reset_Stack Skein_512_Process_Block
ret
;
if _SKEIN_DEBUG
; call here with r08 = "round number"
Skein_Debug_Round_512:
push rdx ;save two regs for BLK_BITS-specific parms
push rcx
mov rcx,[rsp+24] ;get back original r08 (pushed on stack in macro call)
mov [FP_+X_stk],rcx ;and save it in X_stk
irp _Rn_,<1,2,3,4,5,6,7> ;save rest of X[] state on stack so debug routines can access it
mov [FP_+X_stk+8*(_Rn_)],rX_512_&_Rn_
endm
mov rdx,[FP_+ctxPtr] ;ctx_hdr_ptr
mov rcx, 512 ;block size
jmp Skein_Debug_Round_Common
endif
;
Skein_512_Process_Block endp
;
ifdef SKEIN_CODE_SIZE
public Skein_512_Process_Block_CodeSize
Skein_512_Process_Block_CodeSize proc
mov rax,_ProcBytes_
ret
Skein_512_Process_Block_CodeSize endp
;
public Skein_512_Unroll_Cnt
Skein_512_Unroll_Cnt proc
if _UNROLL_CNT ne ROUNDS_512/8
mov rax,_UNROLL_CNT
else
xor rax,rax
endif
ret
Skein_512_Unroll_Cnt endp
endif
;
endif ; _USE_ASM_ and 512
;
;=================================== Skein1024 =============================================
if _USE_ASM_ and 1024
public Skein1024_Process_Block
;
; void Skein1024_Process_Block(Skein_1024_Ctxt_t *ctx,const u08b_t *blkPtr,size_t blkCnt,size_t bitcntAdd);
;
;;;;;;;;;;;;;;;;;
; use details of permutation to make register assignments
;
r1K_x0 equ rdi
r1K_x1 equ rsi
r1K_x2 equ rbp
r1K_x3 equ rax
r1K_x4 equ rcx ;"shared" with X6, since X4/X6 alternate
r1K_x5 equ rbx
r1K_x6 equ rcx
r1K_x7 equ rdx
r1K_x8 equ r08
r1K_x9 equ r09
r1K_xA equ r10
r1K_xB equ r11
r1K_xC equ r12
r1K_xD equ r13
r1K_xE equ r14
r1K_xF equ r15
;
rIdx equ r1K_x0 ;index register for looping versions
rIdx_offs equ tmpStk_1024
;
R1024_Mix macro w0,w1,_RN0_,_Rn1_,op1
_w0 = 0&w0&h ;handle the hex conversion
_w1 = 0&w1&h
_II_ = ((_RN0_)/4)+1 ;injection count
;
addReg r1K_x&w0 , r1K_x&w1 ;perform the MIX
RotL64 r1K_x&w1 , 1024,%((_RN0_) and 7),_Rn1_
xor r1K_x&w1 , r1K_x&w0
if ((_RN0_) and 3) eq 3 ;time to do key injection?
if _SKEIN_DEBUG
mov [rsp+xDebug_1024+8*_w0],r1K_x&w0 ;save intermediate values for Debug_Round
mov [rsp+xDebug_1024+8*_w1],r1K_x&w1 ; (before inline key injection)
endif
if SKEIN_ASM_UNROLL and 1024 ;here to do fully unrolled key injection
add r1K_x&w0, [rsp+ksKey+ 8*((_II_+_w0) mod 17)]
add r1K_x&w1, [rsp+ksKey+ 8*((_II_+_w1) mod 17)]
if _w1 eq 13 ;tweak injection
add r1K_x&w1, [rsp+ksTwk+ 8*((_II_+0 ) mod 3)]
elseif _w0 eq 14
add r1K_x&w0, [rsp+ksTwk+ 8*((_II_+1 ) mod 3)]
elseif _w1 eq 15
add r1K_x&w1, _II_ ;(injection counter)
endif
else ;here to do looping key injection
if (_w0 eq 0)
mov [rsp+X_stk+8*_w0],r1K_x0 ;if so, store N0 so we can use reg as index
mov rIdx, [rsp+rIdx_offs] ;get the injection counter index into rIdx (N0)
else
add r1K_x&w0, [rsp+ksKey+8+8*rIdx+8*_w0] ;even key injection
endif
if _w1 eq 13 ;tweak injection
add r1K_x&w1, [rsp+ksTwk+8+8*rIdx+8*0 ]
elseif _w0 eq 14
add r1K_x&w0, [rsp+ksTwk+8+8*rIdx+8*1 ]
elseif _w1 eq 15
addReg r1K_x&w1, rIdx,,,1 ;(injection counter)
endif
add r1K_x&w1, [rsp+ksKey+8+8*rIdx+8*_w1] ;odd key injection
endif
endif
; insert the op provided, if any
op1
endm
;;;;;;;;;;;;;;;;;
; MACRO: one round for 1024-bit blocks
;
R1024_OneRound macro x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,xA,xB,xC,xD,xE,xF,_Rn_
if (x0 ne 0) or ((x4 ne 4) and (x4 ne 6)) or (x4 ne (x6 xor 2))
.err "faulty register assignment!"
endif
R1024_Mix x0,x1,_Rn_,0
R1024_Mix x2,x3,_Rn_,1
R1024_Mix x4,x5,_Rn_,2, <mov [rsp+X_stk+8*0&x4&h],r1K_x4> ;save x4 on stack (x4/x6 alternate)
R1024_Mix x8,x9,_Rn_,4, <mov r1K_x6,[rsp+X_stk+8*0&x6&h]> ;load x6 from stack
R1024_Mix xA,xB,_Rn_,5
R1024_Mix xC,xD,_Rn_,6
R1024_Mix x6,x7,_Rn_,3
R1024_Mix xE,xF,_Rn_,7
if _SKEIN_DEBUG
Skein_Debug_Round 1024,%(_Rn_+1)
endif
endm ;R1024_OneRound
;;;;;;;;;;;;;;;;;
; MACRO: four rounds for 1024-bit blocks
;
R1024_FourRounds macro _RR_ ;RR = base round number (0 mod 4)
; should be here with r1K_x4 set properly, x6 stored on stack
R1024_OneRound 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,%((_RR_)+0)
R1024_OneRound 0,9,2,D,6,B,4,F,A,7,C,3,E,5,8,1,%((_RR_)+1)
R1024_Oneround 0,7,2,5,4,3,6,1,C,F,E,D,8,B,A,9,%((_RR_)+2)
R1024_Oneround 0,F,2,B,6,D,4,9,E,1,8,5,A,3,C,7,%((_RR_)+3)
if (SKEIN_ASM_UNROLL and 1024) eq 0 ;here with r1K_x0 == rIdx, X0 on stack
;rotate the key schedule on the stack
mov [rsp+X_stk+ 8* 8],r1K_x8;free up a reg
mov r1K_x8,[rsp+ksKey+8*rIdx+8* 0] ;get key
mov [rsp+ksKey+8*rIdx+8*17],r1K_x8 ;rotate it (must do key first or tweak clobbers it!)
mov r1K_x8,[rsp+ksTwk+8*rIdx+8* 0] ;get tweak
mov [rsp+ksTwk+8*rIdx+8* 3],r1K_x8 ;rotate it
mov r1K_x8,[rsp+X_stk+ 8* 8] ;get the reg back
inc rIdx ;bump the index
mov [rsp+rIdx_offs],rIdx ;save it
mov r1K_x0,[rsp+ksKey+8*rIdx] ;get the key schedule word for X0
add r1K_x0,[rsp+X_stk+8*0] ;perform the X0 key injection
endif
;show the result of the key injection
Skein_Debug_Round 1024,SKEIN_RND_KEY_INJECT
endm ;R1024_FourRounds
;
;;;;;;;;;;;;;;;;
; code
;
Skein1024_Process_Block proc frame
;
Setup_Stack 1024,ROUNDS_1024/8,NO_FRAME,<WCNT>
mov r09,[rdi+TWEAK+ 8]
jmp short Skein1024_block_loop
align 16
; main hash loop for Skein1024
Skein1024_block_loop:
; general register usage:
; RSP = stack pointer
; RAX..RDX,RSI,RDI= X1, X3..X7 (state words)
; R08..R15 = X8..X15 (state words)
; RBP = temp (used for X0 and X2)
;
if (SKEIN_ASM_UNROLL and 1024) eq 0
xor rax,rax ;init loop index on the stack
mov [rsp+rIdx_offs],rax
endif
mov r08,[rdi+TWEAK+ 0]
add r08,[FP_+bitAdd] ;computed updated tweak value T0
mov r10,r09
xor r10,r08 ;rax/rbx/rcx = tweak schedule
mov [rdi+TWEAK+ 0],r08 ;save updated tweak value ctx->h.T[0]
mov [FP_+ksTwk+ 0],r08
mov [FP_+ksTwk+ 8],r09 ;keep values in r08,r09 for initial tweak injection below
mov [FP_+ksTwk+16],r10
if _SKEIN_DEBUG
mov [rdi+TWEAK+ 8],r09 ;save updated tweak value ctx->h.T[1] for Skein_Debug_Block
endif
mov rsi ,[FP_+blkPtr ] ;r1K_x2 --> input block
mov rax , KW_PARITY ;overall key schedule parity
; logic here assumes the set {rdi,rsi,rbp,rax} = r1K_x{0,1,2,3}
irp _rN_,<0,1,2,3,4,6> ;process the "initial" words, using r14,r15 as temps
mov r14,[rdi+X_VARS+8*_rN_] ;get state word
mov r15,[rsi+ 8*_rN_] ;get msg word
xor rax,r14 ;update key schedule parity
mov [FP_+ksKey +8*_rN_],r14 ;save key schedule word on stack
mov [FP_+Wcopy +8*_rN_],r15 ;save local msg Wcopy
add r14,r15 ;do the initial key injection
mov [rsp+X_stk +8*_rN_],r14 ;save initial state var on stack
endm
; now process the rest, using the "real" registers
; (MUST do it in reverse order to inject tweaks r08/r09 first)
irp _rN_,<F,E,D,C,B,A,9,8,7,5>
_rr_ = 0&_rN_&h
mov r1K_x&_rN_,[rdi+X_VARS+8*_rr_] ;get key schedule word from context
mov r1K_x4 ,[rsi+ 8*_rr_] ;get next input msg word
mov [rsp+ksKey +8*_rr_],r1K_x&_rN_ ;save key schedule on stack
xor rax , r1K_x&_rN_ ;accumulate key schedule parity
mov [FP_+Wcopy +8*_rr_],r1K_x4 ;save copy of msg word for feedforward
add r1K_x&_rN_, r1K_x4 ;do the initial key injection
if _rr_ eq 13 ;do the initial tweak injection
addReg r1K_x&_rN_,r08 ; (only in words 13/14)
elseif _rr_ eq 14
addReg r1K_x&_rN_,r09
endif
endm
mov [FP_+ksKey+8*WCNT],rax ;save key schedule parity
if _SKEIN_DEBUG
Skein_Debug_Block 1024 ;debug dump
endif
addReg rsi,8*WCNT ;bump the msg ptr
mov [FP_+blkPtr],rsi ;save bumped msg ptr
; re-load words 0..4 [rbp,rsi,rdi,rax,rbx] from stack, enter the main loop
irp _rN_,<0,1,2,3,4> ;(no need to re-load x6)
mov r1K_x&_rN_,[rsp+X_stk+8*_rN_] ;re-load state and get ready to go!
endm
if _SKEIN_DEBUG
Skein_Debug_Round 1024,SKEIN_RND_KEY_INITIAL ;show state after initial key injection
endif
;
;;;;;;;;;;;;;;;;;
; now the key schedule is computed. Start the rounds
;
if SKEIN_ASM_UNROLL and 1024
_UNROLL_CNT = ROUNDS_1024/8
else
_UNROLL_CNT = SKEIN_UNROLL_1024
if ((ROUNDS_1024/8) mod _UNROLL_CNT)
.err "Invalid SKEIN_UNROLL1024"
endif
Skein1024_round_loop:
endif
;
_Rbase_ = 0
rept _UNROLL_CNT*2 ;implement the rounds, 4 at a time
R1024_FourRounds %(4*_Rbase_+00)
_Rbase_ = _Rbase_+1
endm ;rept _UNROLL_CNT
;
if (SKEIN_ASM_UNROLL and 1024) eq 0
cmp qword ptr [rsp+tmpStk_1024],2*(ROUNDS_1024/8) ;see if we are done
jb Skein1024_round_loop
endif
; end of rounds
;;;;;;;;;;;;;;;;;
;
; feedforward: ctx->X[i] = X[i] ^ w[i], {i=0..15}
mov [rsp+X_stk+8*7],r1K_x7 ;we need a register. x6 already on stack
mov r1K_x7,[rsp+ctxPtr]
irp _rN_,<0,1,2,3,4,5,8,9,A,B,C,D,E,F> ;do all but x6,x7
xor r1K_x&_rN_,[rsp +Wcopy +8*(0&_rN_&h)] ;feedforward XOR
mov [r1K_x7+X_VARS+8*(0&_rN_&h)],r1K_x&_rN_ ;save result into context
if (0&_rN_&h eq 9)
mov r09,FIRST_MASK
endif
if (0&_rN_&h eq 0eh)
and r09,[r1K_x7+TWEAK+ 8]
endif
endm
;
mov rax,[rsp+X_stk +8*6] ;now process x6,x7
mov rbx,[rsp+X_stk +8*7]
xor rax,[rsp+Wcopy +8*6]
xor rbx,[rsp+Wcopy +8*7]
mov [r1K_x7+X_VARS+8*6],rax
dec qword ptr [rsp+blkCnt] ;set zero flag iff done
mov [r1K_x7+X_VARS+8*7],rbx
Skein_Debug_Round 1024,SKEIN_RND_FEED_FWD,,<cmp qword ptr [rsp+blkCnt],0>
; go back for more blocks, if needed
mov rdi,[rsp+ctxPtr] ;don't muck with the flags here!
lea rbp,[rsp+FRAME_OFFS]
jnz Skein1024_block_loop
mov [r1K_x7+TWEAK+ 8],r09
Reset_Stack Skein1024_Process_Block
ret
;
if _SKEIN_DEBUG
; call here with r08 = "round number"
Skein_Debug_Round_1024:
_SP_OFFS_ = 8*2 ;stack "offset" here: r08, return addr
SP_ equ <rsp + _SP_OFFS_> ;useful shorthand below
;
irp _wN_,<1,2,3,5,7,9,A,B,C,D,E,F> ;save rest of X[] state on stack so debug routines can access it
mov [SP_+X_stk+8*(0&_wN_&h)],r1K_x&_wN_
endm
;figure out what to do with x0. On rounds R where R==0 mod 4, it's already on the stack
cmp r08,SKEIN_RND_SPECIAL ;special rounds always save
jae save_x0
test r08,3
jz save_x0_not
save_x0:
mov [SP_+X_stk+8*0],r1K_x0
save_x0_not:
;figure out the x4/x6 swapping state and save the correct one!
cmp r08,SKEIN_RND_SPECIAL ;special rounds always do x4
jae save_x4
test r08,1 ;and even ones have r4 as well
jz save_x4
mov [SP_+X_stk+8*6],r1K_x6
jmp short debug_1024_go
save_x4:
mov [SP_+X_stk+8*4],r1K_x4
debug_1024_go:
;now all is saved in Xstk[] except for X8
push rdx ;save two regs for BLK_BITS-specific parms
push rcx
_SP_OFFS_ = _SP_OFFS_ + 16 ;adjust stack offset accordingly
; now stack offset is 32 to X_stk
mov rcx,[SP_ - 8] ;get back original r08 (pushed on stack in macro call)
mov [SP_+X_stk+8*8],rcx ;and save it in its rightful place in X_stk[8]
mov rdx,[SP_+ctxPtr] ;ctx_hdr_ptr
mov rcx, 1024 ;block size
jmp Skein_Debug_Round_Common
endif
;
Skein1024_Process_Block endp
;
ifdef SKEIN_CODE_SIZE
public Skein1024_Process_Block_CodeSize
Skein1024_Process_Block_CodeSize proc
mov rax,_ProcBytes_
ret
Skein1024_Process_Block_CodeSize endp
;
public Skein1024_Unroll_Cnt
Skein1024_Unroll_Cnt proc
if _UNROLL_CNT ne ROUNDS_1024/8
mov rax,_UNROLL_CNT
else
xor rax,rax
endif
ret
Skein1024_Unroll_Cnt endp
endif
;
endif ; _USE_ASM_ and 1024
;
if _SKEIN_DEBUG
;----------------------------------------------------------------
;local debug routine to set up for calls to:
; void Skein_Show_Round(uint_t bits,const Skein_Ctxt_Hdr_t *h,int r,const u64b_t *X);
;
; here with r08 = round number
; rdx = ctx_hdr_ptr
; rcx = block size (256/512/1024)
;
Skein_Debug_Round_Common:
_SP_OFFS_ = 32 ;current stack "offset": r08, retAddr, rcx, rdx
irp _rr_,<rax,rbx,rsi,rdi,rbp,r09,r10,r11,r12,r13,r14,r15> ;save the rest of the regs
push _rr_
_SP_OFFS_ = _SP_OFFS_+8
endm
if (_SP_OFFS_ and 0Fh) ; make sure stack is still 16-byte aligned here
.err "Debug_Round_Common: stack alignment"
endif
; compute r09 = ptr to the X[] array on the stack
lea r09,[SP_+X_stk] ;adjust for reg pushes, return address
cmp r08,SKEIN_RND_FEED_FWD ;special handling for feedforward "round"?
jnz _got_r09a
lea r09,[rdx+X_VARS]
_got_r09a:
if _USE_ASM_ and 1024
; special handling for 1024-bit case
; (for rounds right before with key injection:
; use xDebug_1024[] instead of X_stk[])
cmp r08,SKEIN_RND_SPECIAL
jae _got_r09b ;must be a normal round
or r08,r08
jz _got_r09b ;just before key injection
test r08,3
jne _got_r09b
cmp rcx,1024 ;only 1024-bit(s) for now
jne _got_r09b
lea r09,[SP_+xDebug_1024]
_got_r09b:
endif
sub rsp, 8*4 ;make room for parms on stack
call Skein_Show_Round ;call external debug handler
add rsp, 8*4 ;discard parm space on the stack
irp _rr_,<r15,r14,r13,r12,r11,r10,r09,rbp,rdi,rsi,rbx,rax> ;restore regs
pop _rr_
_SP_OFFS_ = _SP_OFFS_-8
endm
if _SP_OFFS_ - 32
.err "Debug_Round_Common: push/pop misalignment!"
endif
pop rcx
pop rdx
ret
endif
;----------------------------------------------------------------
end
| 33.404192 | 151 | 0.569799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.