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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
94f87b252a8f34974ed9894c7f8f982278532e18 | 2,825 | asm | Assembly | audio/music/vermilion.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | audio/music/vermilion.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | audio/music/vermilion.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | Music_Vermilion_Ch1::
tempo 156
volume 7, 7
duty 3
vibrato 12, 3, 4
toggleperfectpitch
Music_Vermilion_branch_b9f6::
notetype 12, 11, 5
octave 3
E_ 4
C# 1
D_ 1
E_ 2
A_ 4
B_ 2
A_ 2
G# 2
F# 2
E_ 2
F# 2
A_ 4
F# 1
G# 1
A_ 2
E_ 4
C# 2
E_ 2
A_ 2
G# 2
B_ 2
A_ 2
G# 2
E_ 2
F# 2
G# 2
C# 2
D_ 2
E_ 2
F# 2
E_ 4
C# 1
D_ 1
E_ 2
A_ 4
B_ 2
A_ 2
G# 2
F# 2
E_ 2
F# 2
A_ 4
F# 1
G# 1
A_ 2
E_ 4
C# 1
D_ 1
E_ 2
A_ 2
G# 2
F# 2
A_ 2
G# 2
E_ 2
F# 2
G# 2
F# 4
E_ 4
F# 2
G# 2
F# 2
A_ 2
G# 2
B_ 2
A_ 2
octave 4
C# 2
D_ 2
C# 2
octave 3
B_ 2
A_ 2
G# 1
A_ 1
B_ 2
octave 4
C# 2
E_ 2
octave 3
A_ 2
octave 4
D_ 2
octave 3
G# 2
octave 4
C# 2
octave 3
F# 2
B_ 2
G# 2
A_ 2
B_ 2
A_ 2
G# 2
F# 2
E_ 2
F# 2
G# 2
B_ 2
loopchannel 0, Music_Vermilion_branch_b9f6
Music_Vermilion_Ch2::
duty 3
vibrato 10, 2, 3
Music_Vermilion_branch_ba66::
notetype 12, 12, 7
octave 3
A_ 8
octave 4
D_ 4
C# 4
octave 3
B_ 6
A_ 1
B_ 1
octave 4
C# 8
octave 3
A_ 8
octave 4
D_ 4
C# 4
octave 3
B_ 6
octave 4
C# 1
octave 3
B_ 1
A_ 8
A_ 8
octave 4
D_ 4
C# 4
octave 3
B_ 6
A_ 1
B_ 1
octave 4
C# 8
octave 3
A_ 8
octave 4
D_ 4
C# 4
octave 3
B_ 6
octave 4
C# 1
octave 3
B_ 1
A_ 8
B_ 4
octave 4
C# 4
D_ 4
E_ 4
F# 8
B_ 8
A_ 4
G# 4
F# 4
E_ 4
F# 8
E_ 8
loopchannel 0, Music_Vermilion_branch_ba66
Music_Vermilion_Ch3::
notetype 12, 1, 0
Music_Vermilion_branch_baa8::
octave 4
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
G# 2
E_ 2
G# 2
E_ 2
A_ 2
G# 2
F# 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
G# 2
E_ 2
G# 2
E_ 2
A_ 2
G# 2
F# 2
G# 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
G# 2
E_ 2
G# 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
G# 2
E_ 2
G# 2
E_ 2
A_ 2
E_ 2
A_ 2
E_ 2
B_ 2
E_ 2
A_ 2
E_ 2
G# 2
E_ 2
F# 2
E_ 2
G# 2
E_ 2
G# 2
E_ 2
B_ 2
A_ 2
G# 2
F# 2
F# 2
E_ 2
G# 2
E_ 2
A_ 2
E_ 2
B_ 2
E_ 2
B_ 2
E_ 2
B_ 2
E_ 2
A_ 2
E_ 2
G# 2
E_ 2
loopchannel 0, Music_Vermilion_branch_baa8
Music_Vermilion_Ch4::
dspeed 12
Music_Vermilion_branch_bb0e::
callchannel Music_Vermilion_branch_bb3f
triangle1 2
triangle1 1
triangle1 1
triangle1 2
triangle1 1
triangle1 1
triangle1 2
triangle1 1
triangle1 1
triangle1 1
triangle1 1
triangle1 1
triangle1 1
loopchannel 4, Music_Vermilion_branch_bb0e
callchannel Music_Vermilion_branch_bb3f
callchannel Music_Vermilion_branch_bb3f
callchannel Music_Vermilion_branch_bb3f
callchannel Music_Vermilion_branch_bb3f
loopchannel 0, Music_Vermilion_branch_bb0e
Music_Vermilion_branch_bb3f::
triangle1 2
triangle1 1
triangle1 1
triangle1 2
triangle1 1
triangle1 1
triangle1 2
triangle1 1
triangle1 1
triangle1 2
triangle1 1
triangle1 1
endchannel
| 8.719136 | 43 | 0.626903 |
deee2c062a48cc0de110eef6519cf2341ecb3c42 | 2,461 | asm | Assembly | programs/oeis/104/A104682.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/104/A104682.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/104/A104682.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A104682: a(n) = Sum_{j=0..14} n^j.
; 1,15,32767,7174453,357913941,7629394531,94036996915,791260251657,5026338869833,25736391511831,111111111111111,417724816941565,1400638324962397,4265491084507563,11966776581370171,31278135027204241,76861433640456465,178901440719363487,396861212733968143,843395946104155461,1724631578947368421,3406115929147584115,6518098476924383427,12119783430199602073,21950316650262874201,38805107275644938151,67090373691429037015,113627411790416680717,188802050194014479853,308185312414220872891,494789896551724137931,782175399728156197665,1218675221385714893857,1873092046839544391983,2842299350056777088031,4261296449497896082261,6316397706306667368565,9262396331994869641347,13444734338241551098963,19327937330819420046121,27531841641025641025641,38877457874788447772215,54444686227467334771687,75644532518998944331293,104308978342535398113661,142802243385071494362571,194157853237714940801115,262246703278703657363377,351982201019228060039473,469569589389422043497151,622807716836734693877551,821452843215411128017765,1077655571137620923974917,1406483690173627302394003,1826545637136938087493091,2360731432549173425745081,3037090376008210815404665,3889867498336780400644807,4960723804935040487035383,6300168733803741204487981,7969237026711864406779661,10041446408917340063364315,12605077130307650304141547,15765819580179765723074113,19649841893418734522208321,24407335764928225040435791,30216605632412647697969215,37288774029001394141963637,45873184304295456171340693,56263591126494879335720611,68805239274536231884057971,83902942276935619340961865,102030284526887192558589577,123740083679187513516385623,149676264496507999762681351,180587310948081918664880701,217341480365779578896004765,260943981928915799125477867,312556341783624009489729403,373518198814687088577337041,445371798592810126582278481,529889478440202543928680415,629104464020280423012317007,745345327498363760281862533,881274489281537766960774181,1039931179776805984133765811,1224779314664322483877741315,1439760777031776998977025497,1689354642530029848180495513,1978642929670446429404919271,2313383506681449438202247191,2700090839175084107535109965,3146125319452801572612001837,3659791978821893009272558843,4250449449028836843507788811,4928630108082482617642017121,5706172419588516403732128865,6596366553508222771284124527,7614114460261896010547453023,8776105659604984947897489301
mov $2,13
mov $3,1
add $3,$0
lpb $2
sub $2,1
mul $3,$0
add $3,1
lpe
mov $0,$3
| 189.307692 | 2,338 | 0.934173 |
f1ab2893ecd406313fdf4f72e03878d784d30613 | 907 | asm | Assembly | programs/oeis/010/A010764.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/010/A010764.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010764.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A010764: a(n) = floor(n/2) mod floor(n/3).
; 0,0,0,1,1,0,1,2,2,2,2,3,2,3,3,3,3,4,3,4,4,4,4,5,4,5,5,5,5,6,5,6,6,6,6,7,6,7,7,7,7,8,7,8,8,8,8,9,8,9,9,9,9,10,9,10,10,10,10,11,10,11,11,11,11,12,11,12,12,12,12,13,12,13,13,13,13,14,13,14,14,14,14,15,14,15,15,15,15,16,15,16,16,16,16,17,16,17,17,17,17,18,17,18,18,18,18,19,18,19,19,19,19,20,19,20,20,20,20,21,20,21,21,21,21,22,21,22,22,22,22,23,22,23,23,23,23,24,23,24,24,24,24,25,24,25,25,25,25,26,25,26,26,26,26,27,26,27,27,27,27,28,27,28,28,28,28,29,28,29,29,29,29,30,29,30,30,30,30,31,30,31,31,31,31,32,31,32,32,32,32,33,32,33,33,33,33,34,33,34,34,34,34,35,34,35,35,35,35,36,35,36,36,36,36,37,36,37,37,37,37,38,37,38,38,38,38,39,38,39,39,39,39,40,39,40,40,40,40,41,40,41,41,41,41,42,41,42,42,42
mov $3,$0
sub $3,3
mov $5,$0
sub $0,$3
sub $0,3
mov $1,4
add $1,$5
pow $4,$0
sub $4,$1
sub $4,1
add $1,$4
add $4,1
sub $2,$4
div $2,3
div $4,2
sub $1,$4
mod $1,$2
| 43.190476 | 697 | 0.614112 |
95055aecd54f86184baba90b9eef9305e6516cec | 275 | asm | Assembly | scripts/route2house.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 1 | 2022-01-09T05:28:52.000Z | 2022-01-09T05:28:52.000Z | scripts/route2house.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | scripts/route2house.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | Route2HouseScript:
jp EnableAutoTextBoxDrawing
Route2HouseTextPointers:
dw Route2HouseText1
dw Route2HouseText2
Route2HouseText1:
TX_FAR _Route2HouseText1
db "@"
Route2HouseText2:
TX_ASM
ld a, $1
ld [wWhichTrade], a
predef DoInGameTradeDialogue
jp TextScriptEnd
| 15.277778 | 29 | 0.818182 |
b16296457656f65f97101100429a5c7c959e5da0 | 746 | asm | Assembly | libsrc/graphics/w_bkrestore.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/w_bkrestore.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/w_bkrestore.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | ;
; Fast background restore
;
; Generic version (just a bit slow)
;
; $Id: w_bkrestore.asm $
;
SECTION smc_clib
PUBLIC bkrestore
PUBLIC _bkrestore
EXTERN w_pixeladdress
.bkrestore
._bkrestore
push ix
; __FASTCALL__ : sprite ptr in HL
push hl
pop ix
ld l,(ix+2) ; x
ld h,(ix+3)
ld e,(ix+4) ; y
;ld d,(ix+5)
ld d,0
ld (x_coord+1),hl
ld c,e
push bc
call w_pixeladdress
pop bc
ld a,(ix+0)
ld b,(ix+1)
dec a
srl a
srl a
srl a
inc a
inc a ; INT ((Xsize-1)/8+2)
ld (rbytes+1),a
.bkrestores
push bc
.rbytes
ld b,0
.rloop
ld a,(ix+6)
ld (de),a
inc de
inc ix
djnz rloop
ld d,0
ld e,c
inc e ; y
.x_coord
ld hl,0
call w_pixeladdress
pop bc
inc c ; y
djnz bkrestores
pop ix
ret
| 10.081081 | 35 | 0.613941 |
9d0a6b2e2f290b7863928a3153fe219776997949 | 45,145 | asm | Assembly | Servo motor with ADC/part3.asm | TechZx/PICSimLab_examples_in_MicroC | 54c7b62ed04530982ca41cd1db80b39f8b53d89a | [
"MIT"
] | null | null | null | Servo motor with ADC/part3.asm | TechZx/PICSimLab_examples_in_MicroC | 54c7b62ed04530982ca41cd1db80b39f8b53d89a | [
"MIT"
] | null | null | null | Servo motor with ADC/part3.asm | TechZx/PICSimLab_examples_in_MicroC | 54c7b62ed04530982ca41cd1db80b39f8b53d89a | [
"MIT"
] | null | null | null | ; ASM code generated by mikroVirtualMachine for PIC - V. 8.0.0.0
; Date/Time: 24-Jun-20 10:24:13 PM
; Info: http://www.mikroe.com
; ADDRESS OPCODE ASM
; ----------------------------------------------
$0000 $EF1D F004 GOTO _main
$0008 $ _Delay_1us:
$0008 $0000 NOP
$000A $0000 NOP
$000C $0012 RETURN
$000E $ _Delay_5500us:
$000E $0E0F MOVLW 15
$0010 $6E0B MOVWF STACK_11, 0
$0012 $0EFF MOVLW 255
$0014 $6E0A MOVWF STACK_10, 0
$0016 $2E0B DECFSZ STACK_11, F, 0
$0018 $D001 BRA $+2
$001A $D003 BRA $+4
$001C $2E0A DECFSZ STACK_10, F, 0
$001E $D7FE BRA $-1
$0020 $D7FA BRA $-5
$0022 $0E3E MOVLW 62
$0024 $6E0A MOVWF STACK_10, 0
$0026 $2E0A DECFSZ STACK_10, F, 0
$0028 $D7FE BRA $-1
$002A $0000 NOP
$002C $0012 RETURN
$002E $ _Delay_50us:
$002E $0E21 MOVLW 33
$0030 $6E0A MOVWF STACK_10, 0
$0032 $2E0A DECFSZ STACK_10, F, 0
$0034 $D7FE BRA $-1
$0036 $0012 RETURN
$0038 $ _RES032:
$0038 $0100 MOVLB 0
$003A $6A02 CLRF STACK_2, 0
$003C $6A01 CLRF STACK_1, 0
$003E $6A00 CLRF STACK_0, 0
$0040 $6A08 CLRF STACK_8, 0
$0042 $6A03 CLRF STACK_3, 0
$0044 $0E00 MOVLW 0
$0046 $0012 RETURN
$0048 $ _SETFUN32:
$0048 $0100 MOVLB 0
$004A $840B BSF STACK_11, 2, 0
$004C $AE0B BTFSS STACK_11, 7, 0
$004E $EF30 F000 GOTO SETFUN32EEE
$0052 $0E01 MOVLW 0x01
$0054 $6E03 MOVWF STACK_3, 0
$0056 $6A02 CLRF STACK_2, 0
$0058 $6A01 CLRF STACK_1, 0
$005A $6A00 CLRF STACK_0, 0
$005C $360A RLCF STACK_10, F, 0
$005E $3202 RRCF STACK_2, F, 0
$0060 $ SETFUN32EEE:
$0060 $0EFF MOVLW 0xFF
$0062 $0012 RETURN
$0064 $ _FIXSIGN32:
$0064 $0100 MOVLB 0
$0066 $AE0A BTFSS STACK_10, 7, 0
$0068 $9E02 BCF STACK_2, 7, 0
$006A $0E00 MOVLW 0
$006C $0012 RETURN
$006E $ _Lcd8_Cmd:
$006E $C015 FFE9 MOVFF Lcd8bit_main_global_dataAddress, FSR0L
$0072 $C016 FFEA MOVFF Lcd8bit_main_global_dataAddress+1, FSR0H
$0076 $C017 FFE1 MOVFF Lcd8bit_main_global_ctrlAddress, FSR1L
$007A $C018 FFE2 MOVFF Lcd8bit_main_global_ctrlAddress+1, FSR1H
$007E $6AEF CLRF INDF0, 0
$0080 $523F MOVF FARG_Lcd8_Cmd+0, 1, 0
$0082 $E000 BZ L_Lcd8_Cmd_0
$0084 $ L_Lcd8_Cmd_0:
$0084 $BE3F BTFSC FARG_Lcd8_Cmd+0, 7, 0
$0086 $8EEF BSF INDF0, __LCD8_DB7, 0
$0088 $BC3F BTFSC FARG_Lcd8_Cmd+0, 6, 0
$008A $8CEF BSF INDF0, __LCD8_DB6, 0
$008C $BA3F BTFSC FARG_Lcd8_Cmd+0, 5, 0
$008E $8AEF BSF INDF0, __LCD8_DB5, 0
$0090 $B83F BTFSC FARG_Lcd8_Cmd+0, 4, 0
$0092 $88EF BSF INDF0, __LCD8_DB4, 0
$0094 $B63F BTFSC FARG_Lcd8_Cmd+0, 3, 0
$0096 $86EF BSF INDF0, __LCD8_DB3, 0
$0098 $B43F BTFSC FARG_Lcd8_Cmd+0, 2, 0
$009A $84EF BSF INDF0, __LCD8_DB2, 0
$009C $B23F BTFSC FARG_Lcd8_Cmd+0, 1, 0
$009E $82EF BSF INDF0, __LCD8_DB1, 0
$00A0 $B03F BTFSC FARG_Lcd8_Cmd+0, 0, 0
$00A2 $80EF BSF INDF0, __LCD8_DB0, 0
$00A4 $5019 MOVF Lcd8bit_main_global_cmd, 0, 0
$00A6 $0A01 XORLW 1
$00A8 $E103 BNZ L_Lcd8_Cmd_1
$00AA $94E7 BCF INDF1, __LCD8_RS, 0
$00AC $EF59 F000 GOTO L_Lcd8_Cmd_2
$00B0 $ L_Lcd8_Cmd_1:
$00B0 $84E7 BSF INDF1, __LCD8_RS, 0
$00B2 $ L_Lcd8_Cmd_2:
$00B2 $82E7 BSF INDF1, __LCD8_ENABLE, 0
$00B4 $EC04 F000 CALL _Delay_1us
$00B8 $92E7 BCF INDF1, __LCD8_ENABLE, 0
$00BA $5019 MOVF Lcd8bit_main_global_cmd, 0, 0
$00BC $0A01 XORLW 1
$00BE $E103 BNZ L_Lcd8_Cmd_3
$00C0 $EC07 F000 CALL _Delay_5500us
$00C4 $D002 BRA L_Lcd8_Cmd_4
$00C6 $ L_Lcd8_Cmd_3:
$00C6 $EC17 F000 CALL _Delay_50us
$00CA $ L_Lcd8_Cmd_4:
$00CA $0012 RETURN
$00CC $ _Delay_22us:
$00CC $0E0E MOVLW 14
$00CE $6E0A MOVWF STACK_10, 0
$00D0 $2E0A DECFSZ STACK_10, F, 0
$00D2 $D7FE BRA $-1
$00D4 $0000 NOP
$00D6 $0012 RETURN
$00D8 $ _Div_16x16_U:
$00D8 $0100 MOVLB 0
$00DA $6A08 CLRF STACK_8, 0
$00DC $6A09 CLRF STACK_9, 0
$00DE $0E10 MOVLW 16
$00E0 $6E0C MOVWF STACK_12, 0
$00E2 $3401 RLCF STACK_1, W, 0
$00E4 $3608 RLCF STACK_8, F, 0
$00E6 $3609 RLCF STACK_9, F, 0
$00E8 $5004 MOVF STACK_4, W, 0
$00EA $5E08 SUBWF STACK_8, F, 0
$00EC $5005 MOVF STACK_5, W, 0
$00EE $A0D8 BTFSS STATUS, C, 0
$00F0 $3C05 INCFSZ STACK_5, W, 0
$00F2 $5E09 SUBWF STACK_9, F, 0
$00F4 $B0D8 BTFSC STATUS, C, 0
$00F6 $EF84 F000 GOTO $+8
$00FA $5004 MOVF STACK_4, W, 0
$00FC $2608 ADDWF STACK_8, F, 0
$00FE $5005 MOVF STACK_5, W, 0
$0100 $B0D8 BTFSC STATUS, C, 0
$0102 $3C05 INCFSZ STACK_5, W, 0
$0104 $2609 ADDWF STACK_9, F, 0
$0106 $90D8 BCF STATUS, C, 0
$0108 $3600 RLCF STACK_0, F, 0
$010A $3601 RLCF STACK_1, F, 0
$010C $2E0C DECFSZ STACK_12, F, 0
$010E $EF71 F000 GOTO $-21
$0112 $0012 RETURN
$0114 $ _Mul_16x16_S:
$0114 $0100 MOVLB 0
$0116 $5000 MOVF STACK_0, W, 0
$0118 $0204 MULWF STACK_4, 0
$011A $CFF4 F009 MOVFF PRODH, STACK_9
$011E $CFF3 F008 MOVFF PRODL, STACK_8
$0122 $5001 MOVF STACK_1, W, 0
$0124 $0205 MULWF STACK_5, 0
$0126 $CFF4 F00B MOVFF PRODH, STACK_11
$012A $CFF3 F00A MOVFF PRODL, STACK_10
$012E $5000 MOVF STACK_0, W, 0
$0130 $0205 MULWF STACK_5, 0
$0132 $50F3 MOVF PRODL, W, 0
$0134 $2609 ADDWF STACK_9, F, 0
$0136 $50F4 MOVF PRODH, W, 0
$0138 $220A ADDWFC STACK_10, F, 0
$013A $6AE8 CLRF WREG, 0
$013C $220B ADDWFC STACK_11, F, 0
$013E $5001 MOVF STACK_1, W, 0
$0140 $0204 MULWF STACK_4, 0
$0142 $50F3 MOVF PRODL, W, 0
$0144 $2609 ADDWF STACK_9, F, 0
$0146 $50F4 MOVF PRODH, W, 0
$0148 $220A ADDWFC STACK_10, F, 0
$014A $6AE8 CLRF WREG, 0
$014C $220B ADDWFC STACK_11, F, 0
$014E $AE05 BTFSS STACK_5, 7, 0
$0150 $EFAE F000 GOTO $+5
$0154 $5000 MOVF STACK_0, W, 0
$0156 $5C0A SUBWF STACK_10, W, 0
$0158 $5001 MOVF STACK_1, W, 0
$015A $580B SUBWFB STACK_11, W, 0
$015C $AE01 BTFSS STACK_1, 7, 0
$015E $EFB5 F000 GOTO $+5
$0162 $5004 MOVF STACK_4, W, 0
$0164 $5C0A SUBWF STACK_10, W, 0
$0166 $5005 MOVF STACK_5, W, 0
$0168 $580B SUBWFB STACK_11, W, 0
$016A $C008 F000 MOVFF STACK_8, STACK_0
$016E $C009 F001 MOVFF STACK_9, STACK_1
$0172 $C00A F002 MOVFF STACK_10, STACK_2
$0176 $C00B F003 MOVFF STACK_11, STACK_3
$017A $0012 RETURN
$017C $ _NRM3232:
$017C $0100 MOVLB 0
$017E $6A0C CLRF STACK_12, 0
$0180 $6A0E CLRF STACK_14, 0
$0182 $5002 MOVF STACK_2, W, 0
$0184 $A4D8 BTFSS STATUS, Z, 0
$0186 $EFD8 F000 GOTO NORM3232
$018A $C001 F002 MOVFF STACK_1, STACK_2
$018E $C000 F001 MOVFF STACK_0, STACK_1
$0192 $6A00 CLRF STACK_0, 0
$0194 $860E BSF STACK_14, 3, 0
$0196 $5002 MOVF STACK_2, W, 0
$0198 $A4D8 BTFSS STATUS, Z, 0
$019A $EFD8 F000 GOTO NORM3232
$019E $C001 F002 MOVFF STACK_1, STACK_2
$01A2 $6A01 CLRF STACK_1, 0
$01A4 $960E BCF STACK_14, 3, 0
$01A6 $880E BSF STACK_14, 4, 0
$01A8 $5002 MOVF STACK_2, W, 0
$01AA $B4D8 BTFSC STATUS, Z, 0
$01AC $EFEA F000 GOTO JPNRES032
$01B0 $ NORM3232:
$01B0 $500E MOVF STACK_14, W, 0
$01B2 $5E03 SUBWF STACK_3, F, 0
$01B4 $A4D8 BTFSS STATUS, Z, 0
$01B6 $A0D8 BTFSS STATUS, C, 0
$01B8 $EFF0 F000 GOTO JPNSETFUN32
$01BC $90D8 BCF STATUS, C, 0
$01BE $ NORM3232A:
$01BE $BE02 BTFSC STACK_2, 7, 0
$01C0 $EFF6 F000 GOTO JMPNFIXSIGN32
$01C4 $3600 RLCF STACK_0, F, 0
$01C6 $3601 RLCF STACK_1, F, 0
$01C8 $3602 RLCF STACK_2, F, 0
$01CA $2E03 DECFSZ STACK_3, F, 0
$01CC $EFDF F000 GOTO NORM3232A
$01D0 $EFF0 F000 GOTO JPNSETFUN32
$01D4 $ JPNRES032:
$01D4 $0E01 MOVLW 0x01
$01D6 $6E0C MOVWF STACK_12, 0
$01D8 $EC1C F000 CALL _RES032
$01DC $EFFA F000 GOTO NORM32EEE
$01E0 $ JPNSETFUN32:
$01E0 $0E02 MOVLW 0x02
$01E2 $6E0C MOVWF STACK_12, 0
$01E4 $EC24 F000 CALL _SETFUN32
$01E8 $EFFA F000 GOTO NORM32EEE
$01EC $ JMPNFIXSIGN32:
$01EC $0E04 MOVLW 0x04
$01EE $6E0C MOVWF STACK_12, 0
$01F0 $EC32 F000 CALL _FIXSIGN32
$01F4 $ NORM32EEE:
$01F4 $0012 RETURN
$01F6 $ _SETFOV32:
$01F6 $0100 MOVLB 0
$01F8 $820B BSF STACK_11, 1, 0
$01FA $AE0B BTFSS STACK_11, 7, 0
$01FC $EF06 F001 GOTO SETFOV32EEE
$0200 $6803 SETF STACK_3, 0
$0202 $6802 SETF STACK_2, 0
$0204 $6801 SETF STACK_1, 0
$0206 $6800 SETF STACK_0, 0
$0208 $360A RLCF STACK_10, F, 0
$020A $3202 RRCF STACK_2, F, 0
$020C $ SETFOV32EEE:
$020C $0EFF MOVLW 0xFF
$020E $0012 RETURN
$0210 $ _SETIOV3224:
$0210 $0100 MOVLB 0
$0212 $800B BSF STACK_11, 0, 0
$0214 $AE0B BTFSS STACK_11, 7, 0
$0216 $EF15 F001 GOTO SETIOV3224EEE
$021A $6A02 CLRF STACK_2, 0
$021C $AE0A BTFSS STACK_10, 7, 0
$021E $0EFF MOVLW 0xFF
$0220 $6E02 MOVWF STACK_2, 0
$0222 $6E01 MOVWF STACK_1, 0
$0224 $6E00 MOVWF STACK_0, 0
$0226 $360A RLCF STACK_10, F, 0
$0228 $3202 RRCF STACK_2, F, 0
$022A $ SETIOV3224EEE:
$022A $0EFF MOVLW 0xFF
$022C $0012 RETURN
$022E $ _read_keypad:
;part3.c,4 :: char read_keypad()
;part3.c,7 :: PORTD = 0xFF;
$022E $0EFF MOVLW 255
$0230 $6E83 MOVWF PORTD, 0
;part3.c,8 :: TRISD = 0xFF; //configure PORT D as inpout
$0232 $0EFF MOVLW 255
$0234 $6E95 MOVWF TRISD, 0
;part3.c,9 :: TRISB = 0x00; //configure PORT B as outpout
$0236 $6A93 CLRF TRISB, 0
;part3.c,10 :: PORTB = 0xFF; //set all pins of PORT B to 1;
$0238 $0EFF MOVLW 255
$023A $6E81 MOVWF PORTB, 0
;part3.c,12 :: key =0;
$023C $6A3B CLRF read_keypad_key_L0, 0
;part3.c,13 :: do { //1-5 buttons
$023E $ L_read_keypad_0:
;part3.c,15 :: PORTB.F0 = 0;
$023E $9081 BCF PORTB, 0, 0
;part3.c,16 :: delay_ms(10);
$0240 $0E1A MOVLW 26
$0242 $6E0B MOVWF STACK_11, 0
$0244 $0EFF MOVLW 255
$0246 $6E0A MOVWF STACK_10, 0
$0248 $2E0B DECFSZ STACK_11, F, 0
$024A $D001 BRA $+2
$024C $D003 BRA $+4
$024E $2E0A DECFSZ STACK_10, F, 0
$0250 $D7FE BRA $-1
$0252 $D7FA BRA $-5
$0254 $0EE7 MOVLW 231
$0256 $6E0A MOVWF STACK_10, 0
$0258 $2E0A DECFSZ STACK_10, F, 0
$025A $D7FE BRA $-1
$025C $0000 NOP
;part3.c,17 :: var = PORTD;
$025E $CF83 F03A MOVFF PORTD, read_keypad_var_L0
;part3.c,19 :: if (var.F2 == 0) key = '4';
$0262 $6A01 CLRF STACK_1, 0
$0264 $B43A BTFSC read_keypad_var_L0, 2, 0
$0266 $2A01 INCF STACK_1, 1, 0
$0268 $5001 MOVF STACK_1, 0, 0
$026A $0A00 XORLW 0
$026C $E103 BNZ L_read_keypad_2
$026E $0E34 MOVLW 52
$0270 $6E3B MOVWF read_keypad_key_L0, 0
$0272 $D008 BRA L_read_keypad_3
$0274 $ L_read_keypad_2:
;part3.c,20 :: else if (var.F3 == 0) key = '1';
$0274 $6A01 CLRF STACK_1, 0
$0276 $B63A BTFSC read_keypad_var_L0, 3, 0
$0278 $2A01 INCF STACK_1, 1, 0
$027A $5001 MOVF STACK_1, 0, 0
$027C $0A00 XORLW 0
$027E $E102 BNZ L_read_keypad_4
$0280 $0E31 MOVLW 49
$0282 $6E3B MOVWF read_keypad_key_L0, 0
$0284 $ L_read_keypad_4:
$0284 $ L_read_keypad_3:
;part3.c,21 :: PORTB.F0 =1;
$0284 $8081 BSF PORTB, 0, 0
;part3.c,24 :: PORTB.F1 = 0;
$0286 $9281 BCF PORTB, 1, 0
;part3.c,25 :: delay_ms(10);
$0288 $0E1A MOVLW 26
$028A $6E0B MOVWF STACK_11, 0
$028C $0EFF MOVLW 255
$028E $6E0A MOVWF STACK_10, 0
$0290 $2E0B DECFSZ STACK_11, F, 0
$0292 $D001 BRA $+2
$0294 $D003 BRA $+4
$0296 $2E0A DECFSZ STACK_10, F, 0
$0298 $D7FE BRA $-1
$029A $D7FA BRA $-5
$029C $0EE7 MOVLW 231
$029E $6E0A MOVWF STACK_10, 0
$02A0 $2E0A DECFSZ STACK_10, F, 0
$02A2 $D7FE BRA $-1
$02A4 $0000 NOP
;part3.c,26 :: var = PORTD;
$02A6 $CF83 F03A MOVFF PORTD, read_keypad_var_L0
;part3.c,28 :: if (var.F2 == 0)key = '5';
$02AA $6A01 CLRF STACK_1, 0
$02AC $B43A BTFSC read_keypad_var_L0, 2, 0
$02AE $2A01 INCF STACK_1, 1, 0
$02B0 $5001 MOVF STACK_1, 0, 0
$02B2 $0A00 XORLW 0
$02B4 $E103 BNZ L_read_keypad_5
$02B6 $0E35 MOVLW 53
$02B8 $6E3B MOVWF read_keypad_key_L0, 0
$02BA $D008 BRA L_read_keypad_6
$02BC $ L_read_keypad_5:
;part3.c,29 :: else if (var.F3 == 0)key = '2';
$02BC $6A01 CLRF STACK_1, 0
$02BE $B63A BTFSC read_keypad_var_L0, 3, 0
$02C0 $2A01 INCF STACK_1, 1, 0
$02C2 $5001 MOVF STACK_1, 0, 0
$02C4 $0A00 XORLW 0
$02C6 $E102 BNZ L_read_keypad_7
$02C8 $0E32 MOVLW 50
$02CA $6E3B MOVWF read_keypad_key_L0, 0
$02CC $ L_read_keypad_7:
$02CC $ L_read_keypad_6:
;part3.c,30 :: PORTB.F1 =1;
$02CC $8281 BSF PORTB, 1, 0
;part3.c,33 :: PORTB.F2 =0;
$02CE $9481 BCF PORTB, 2, 0
;part3.c,34 :: delay_ms(10);
$02D0 $0E1A MOVLW 26
$02D2 $6E0B MOVWF STACK_11, 0
$02D4 $0EFF MOVLW 255
$02D6 $6E0A MOVWF STACK_10, 0
$02D8 $2E0B DECFSZ STACK_11, F, 0
$02DA $D001 BRA $+2
$02DC $D003 BRA $+4
$02DE $2E0A DECFSZ STACK_10, F, 0
$02E0 $D7FE BRA $-1
$02E2 $D7FA BRA $-5
$02E4 $0EE7 MOVLW 231
$02E6 $6E0A MOVWF STACK_10, 0
$02E8 $2E0A DECFSZ STACK_10, F, 0
$02EA $D7FE BRA $-1
$02EC $0000 NOP
;part3.c,35 :: var = PORTD;
$02EE $CF83 F03A MOVFF PORTD, read_keypad_var_L0
;part3.c,37 :: if (var.F3 == 0) key = '3';
$02F2 $6A01 CLRF STACK_1, 0
$02F4 $B63A BTFSC read_keypad_var_L0, 3, 0
$02F6 $2A01 INCF STACK_1, 1, 0
$02F8 $5001 MOVF STACK_1, 0, 0
$02FA $0A00 XORLW 0
$02FC $E102 BNZ L_read_keypad_8
$02FE $0E33 MOVLW 51
$0300 $6E3B MOVWF read_keypad_key_L0, 0
$0302 $ L_read_keypad_8:
;part3.c,38 :: PORTB.F2 =1;
$0302 $8481 BSF PORTB, 2, 0
;part3.c,40 :: }while (key == 0);
$0304 $503B MOVF read_keypad_key_L0, 0, 0
$0306 $0A00 XORLW 0
$0308 $E09A BZ L_read_keypad_0
$030A $ L_read_keypad_1:
;part3.c,42 :: return key;
$030A $C03B F000 MOVFF read_keypad_key_L0, STACK_0
;part3.c,43 :: }
$030E $0012 RETURN
$0310 $ _function_numbers:
;part3.c,45 :: unsigned char function_numbers(unsigned char v)
;part3.c,47 :: switch(v)
$0310 $D00F BRA L_function_numbers_9
;part3.c,49 :: case 1:
$0312 $ L_function_numbers_11:
;part3.c,50 :: return 0x06;
$0312 $0E06 MOVLW 6
$0314 $6E00 MOVWF STACK_0, 0
$0316 $0012 RETURN
;part3.c,51 :: case 2:
$0318 $ L_function_numbers_12:
;part3.c,52 :: return 0x5B;
$0318 $0E5B MOVLW 91
$031A $6E00 MOVWF STACK_0, 0
$031C $0012 RETURN
;part3.c,53 :: case 3:
$031E $ L_function_numbers_13:
;part3.c,54 :: return 0x4F;
$031E $0E4F MOVLW 79
$0320 $6E00 MOVWF STACK_0, 0
$0322 $0012 RETURN
;part3.c,55 :: case 4:
$0324 $ L_function_numbers_14:
;part3.c,56 :: return 0x66;
$0324 $0E66 MOVLW 102
$0326 $6E00 MOVWF STACK_0, 0
$0328 $0012 RETURN
;part3.c,57 :: case 5:
$032A $ L_function_numbers_15:
;part3.c,58 :: return 0x6D;
$032A $0E6D MOVLW 109
$032C $6E00 MOVWF STACK_0, 0
$032E $0012 RETURN
;part3.c,59 :: }
$0330 $ L_function_numbers_9:
$0330 $503A MOVF FARG_function_numbers+0, 0, 0
$0332 $0A01 XORLW 1
$0334 $E0EE BZ L_function_numbers_11
$0336 $503A MOVF FARG_function_numbers+0, 0, 0
$0338 $0A02 XORLW 2
$033A $E0EE BZ L_function_numbers_12
$033C $503A MOVF FARG_function_numbers+0, 0, 0
$033E $0A03 XORLW 3
$0340 $E0EE BZ L_function_numbers_13
$0342 $503A MOVF FARG_function_numbers+0, 0, 0
$0344 $0A04 XORLW 4
$0346 $E0EE BZ L_function_numbers_14
$0348 $503A MOVF FARG_function_numbers+0, 0, 0
$034A $0A05 XORLW 5
$034C $E0EE BZ L_function_numbers_15
$034E $ L_function_numbers_10:
;part3.c,60 :: return 0;
$034E $6A00 CLRF STACK_0, 0
;part3.c,61 :: }
$0350 $0012 RETURN
$0352 $ _LCD8_Out:
$0352 $D00F BRA L_LCD8_Out_12
$0354 $ L_LCD8_Out_14:
$0354 $0E80 MOVLW 128
$0356 $6E3A MOVWF FARG_LCD8_Out+0, 0
$0358 $D019 BRA L_LCD8_Out_13
$035A $ L_LCD8_Out_15:
$035A $0EC0 MOVLW 192
$035C $6E3A MOVWF FARG_LCD8_Out+0, 0
$035E $D016 BRA L_LCD8_Out_13
$0360 $ L_LCD8_Out_16:
$0360 $0E94 MOVLW 148
$0362 $6E3A MOVWF FARG_LCD8_Out+0, 0
$0364 $D013 BRA L_LCD8_Out_13
$0366 $ L_LCD8_Out_17:
$0366 $0ED4 MOVLW 212
$0368 $6E3A MOVWF FARG_LCD8_Out+0, 0
$036A $D010 BRA L_LCD8_Out_13
$036C $ L_LCD8_Out_18:
$036C $0E80 MOVLW 128
$036E $6E3A MOVWF FARG_LCD8_Out+0, 0
$0370 $D00D BRA L_LCD8_Out_13
$0372 $ L_LCD8_Out_12:
$0372 $503A MOVF FARG_LCD8_Out+0, 0, 0
$0374 $0A01 XORLW 1
$0376 $E0EE BZ L_LCD8_Out_14
$0378 $503A MOVF FARG_LCD8_Out+0, 0, 0
$037A $0A02 XORLW 2
$037C $E0EE BZ L_LCD8_Out_15
$037E $503A MOVF FARG_LCD8_Out+0, 0, 0
$0380 $0A03 XORLW 3
$0382 $E0EE BZ L_LCD8_Out_16
$0384 $503A MOVF FARG_LCD8_Out+0, 0, 0
$0386 $0A04 XORLW 4
$0388 $E0EE BZ L_LCD8_Out_17
$038A $D7F0 BRA L_LCD8_Out_18
$038C $ L_LCD8_Out_13:
$038C $043B DECF FARG_LCD8_Out+1, 0, 0
$038E $6E00 MOVWF STACK_0, 0
$0390 $503A MOVF FARG_LCD8_Out+0, 0, 0
$0392 $2600 ADDWF STACK_0, 1, 0
$0394 $C000 F03A MOVFF STACK_0, FARG_LCD8_Out+0
$0398 $0E01 MOVLW 1
$039A $6E19 MOVWF Lcd8bit_main_global_cmd, 0
$039C $C000 F03F MOVFF STACK_0, FARG_Lcd8_Cmd+0
$03A0 $EC37 F000 CALL _Lcd8_Cmd
$03A4 $6A19 CLRF Lcd8bit_main_global_cmd, 0
$03A6 $6A3E CLRF LCD8_Out_i_L0, 0
$03A8 $ L_LCD8_Out_19:
$03A8 $503E MOVF LCD8_Out_i_L0, 0, 0
$03AA $243C ADDWF FARG_LCD8_Out+2, 0, 0
$03AC $6EE9 MOVWF FSR0L, 0
$03AE $0E00 MOVLW 0
$03B0 $203D ADDWFC FARG_LCD8_Out+3, 0, 0
$03B2 $6EEA MOVWF FSR0L+1, 0
$03B4 $CFEE F000 MOVFF POSTINC0, STACK_0
$03B8 $5200 MOVF STACK_0, 1, 0
$03BA $E00C BZ L_LCD8_Out_20
$03BC $503E MOVF LCD8_Out_i_L0, 0, 0
$03BE $243C ADDWF FARG_LCD8_Out+2, 0, 0
$03C0 $6EE9 MOVWF FSR0L, 0
$03C2 $0E00 MOVLW 0
$03C4 $203D ADDWFC FARG_LCD8_Out+3, 0, 0
$03C6 $6EEA MOVWF FSR0L+1, 0
$03C8 $CFEE F03F MOVFF POSTINC0, FARG_Lcd8_Cmd+0
$03CC $EC37 F000 CALL _Lcd8_Cmd
$03D0 $2A3E INCF LCD8_Out_i_L0, 1, 0
$03D2 $D7EA BRA L_LCD8_Out_19
$03D4 $ L_LCD8_Out_20:
$03D4 $0E01 MOVLW 1
$03D6 $6E19 MOVWF Lcd8bit_main_global_cmd, 0
$03D8 $0012 RETURN
$03DA $ _PWM_Start:
$03DA $9494 BCF TRISC, 2, 0
$03DC $84CA BSF T2CON, 2, 0
$03DE $0E0C MOVLW 12
$03E0 $12BD IORWF CCP1CON, 1, 0
$03E2 $0012 RETURN
$03E4 $ _Adc_Read:
$03E4 $6AC2 CLRF ADCON0, 0
$03E6 $0EC0 MOVLW 192
$03E8 $12C2 IORWF ADCON0, 1, 0
$03EA $8CC1 BSF ADCON1, 6, 0
$03EC $8EC1 BSF ADCON1, 7, 0
$03EE $C03A F000 MOVFF FARG_Adc_Read+0, STACK_0
$03F2 $3600 RLCF STACK_0, 1, 0
$03F4 $9000 BCF STACK_0, 0, 0
$03F6 $3600 RLCF STACK_0, 1, 0
$03F8 $9000 BCF STACK_0, 0, 0
$03FA $3600 RLCF STACK_0, 1, 0
$03FC $9000 BCF STACK_0, 0, 0
$03FE $5000 MOVF STACK_0, 0, 0
$0400 $12C2 IORWF ADCON0, 1, 0
$0402 $80C2 BSF ADCON0, 0, 0
$0404 $EC66 F000 CALL _Delay_22us
$0408 $84C2 BSF ADCON0, 2, 0
$040A $ L_Adc_Read_0:
$040A $B4C2 BTFSC ADCON0, 2, 0
$040C $D7FE BRA L_Adc_Read_0
$040E $ L_Adc_Read_1:
$040E $0E08 MOVLW 8
$0410 $6E02 MOVWF STACK_2, 0
$0412 $CFC4 F000 MOVFF ADRESH, STACK_0
$0416 $0E00 MOVLW 0
$0418 $6E01 MOVWF STACK_0+1, 0
$041A $5002 MOVF STACK_2, 0, 0
$041C $ L_Adc_Read_2:
$041C $E005 BZ L_Adc_Read_3
$041E $3600 RLCF STACK_0, 1, 0
$0420 $9000 BCF STACK_0, 0, 0
$0422 $3601 RLCF STACK_0+1, 1, 0
$0424 $0FFF ADDLW 255
$0426 $D7FA BRA L_Adc_Read_2
$0428 $ L_Adc_Read_3:
$0428 $50C3 MOVF ADRESL, 0, 0
$042A $1200 IORWF STACK_0, 1, 0
$042C $0E00 MOVLW 0
$042E $1201 IORWF STACK_0+1, 1, 0
$0430 $90C2 BCF ADCON0, 0, 0
$0432 $0012 RETURN
$0434 $ _WordToStr:
$0434 $C03C FFE1 MOVFF FARG_WordToStr+2, FSR1L
$0438 $C03D FFE2 MOVFF FARG_WordToStr+3, FSR1H
$043C $0E20 MOVLW 32
$043E $6EE6 MOVWF POSTINC1, 0
$0440 $0E01 MOVLW 1
$0442 $243C ADDWF FARG_WordToStr+2, 0, 0
$0444 $6EE1 MOVWF FSR1L, 0
$0446 $0E00 MOVLW 0
$0448 $203D ADDWFC FARG_WordToStr+3, 0, 0
$044A $6EE2 MOVWF FSR1L+1, 0
$044C $0E20 MOVLW 32
$044E $6EE6 MOVWF POSTINC1, 0
$0450 $0E02 MOVLW 2
$0452 $243C ADDWF FARG_WordToStr+2, 0, 0
$0454 $6EE1 MOVWF FSR1L, 0
$0456 $0E00 MOVLW 0
$0458 $203D ADDWFC FARG_WordToStr+3, 0, 0
$045A $6EE2 MOVWF FSR1L+1, 0
$045C $0E20 MOVLW 32
$045E $6EE6 MOVWF POSTINC1, 0
$0460 $0E03 MOVLW 3
$0462 $243C ADDWF FARG_WordToStr+2, 0, 0
$0464 $6EE1 MOVWF FSR1L, 0
$0466 $0E00 MOVLW 0
$0468 $203D ADDWFC FARG_WordToStr+3, 0, 0
$046A $6EE2 MOVWF FSR1L+1, 0
$046C $0E20 MOVLW 32
$046E $6EE6 MOVWF POSTINC1, 0
$0470 $0E04 MOVLW 4
$0472 $243C ADDWF FARG_WordToStr+2, 0, 0
$0474 $6EE1 MOVWF FSR1L, 0
$0476 $0E00 MOVLW 0
$0478 $203D ADDWFC FARG_WordToStr+3, 0, 0
$047A $6EE2 MOVWF FSR1L+1, 0
$047C $0E30 MOVLW 48
$047E $6EE6 MOVWF POSTINC1, 0
$0480 $0E05 MOVLW 5
$0482 $243C ADDWF FARG_WordToStr+2, 0, 0
$0484 $6EE1 MOVWF FSR1L, 0
$0486 $0E00 MOVLW 0
$0488 $203D ADDWFC FARG_WordToStr+3, 0, 0
$048A $6EE2 MOVWF FSR1L+1, 0
$048C $6AE6 CLRF POSTINC1, 0
$048E $0E04 MOVLW 4
$0490 $6E3E MOVWF WordToStr_pos_L0, 0
$0492 $ L_WordToStr_4:
$0492 $0E00 MOVLW 0
$0494 $6E00 MOVWF STACK_0, 0
$0496 $503B MOVF FARG_WordToStr+1, 0, 0
$0498 $5C00 SUBWF STACK_0, 0, 0
$049A $E102 BNZ L_WordToStr_51
$049C $503A MOVF FARG_WordToStr+0, 0, 0
$049E $0800 SUBLW 0
$04A0 $ L_WordToStr_51:
$04A0 $E228 BC L_WordToStr_5
$04A2 $503E MOVF WordToStr_pos_L0, 0, 0
$04A4 $243C ADDWF FARG_WordToStr+2, 0, 0
$04A6 $6EE1 MOVWF FSR1L, 0
$04A8 $0E00 MOVLW 0
$04AA $203D ADDWFC FARG_WordToStr+3, 0, 0
$04AC $6EE2 MOVWF FSR1L+1, 0
$04AE $0E0A MOVLW 10
$04B0 $6E04 MOVWF STACK_4, 0
$04B2 $0E00 MOVLW 0
$04B4 $6E05 MOVWF STACK_4+1, 0
$04B6 $C03A F000 MOVFF FARG_WordToStr+0, STACK_0
$04BA $C03B F001 MOVFF FARG_WordToStr+1, STACK_0+1
$04BE $EC6C F000 CALL _div_16x16_u
$04C2 $C008 F000 MOVFF STACK_8, STACK_0
$04C6 $C009 F001 MOVFF STACK_9, STACK_1
$04CA $0E30 MOVLW 48
$04CC $2600 ADDWF STACK_0, 1, 0
$04CE $C000 FFE6 MOVFF STACK_0, POSTINC1
$04D2 $0E0A MOVLW 10
$04D4 $6E04 MOVWF STACK_4, 0
$04D6 $0E00 MOVLW 0
$04D8 $6E05 MOVWF STACK_4+1, 0
$04DA $C03A F000 MOVFF FARG_WordToStr+0, STACK_0
$04DE $C03B F001 MOVFF FARG_WordToStr+1, STACK_0+1
$04E2 $EC6C F000 CALL _div_16x16_u
$04E6 $C000 F03A MOVFF STACK_0, FARG_WordToStr+0
$04EA $C001 F03B MOVFF STACK_0+1, FARG_WordToStr+1
$04EE $063E DECF WordToStr_pos_L0, 1, 0
$04F0 $D7D0 BRA L_WordToStr_4
$04F2 $ L_WordToStr_5:
$04F2 $0012 RETURN
$04F4 $ _PWM_Change_Duty:
$04F4 $50CB MOVF PR2, 0, 0
$04F6 $0F01 ADDLW 1
$04F8 $6E00 MOVWF STACK_0, 0
$04FA $6A01 CLRF STACK_0+1, 0
$04FC $0E00 MOVLW 0
$04FE $2201 ADDWFC STACK_0+1, 1, 0
$0500 $C03A F004 MOVFF FARG_PWM_Change_Duty+0, STACK_4
$0504 $0E00 MOVLW 0
$0506 $6E05 MOVWF STACK_4+1, 0
$0508 $EC8A F000 CALL _mul_16x16_s
$050C $0E06 MOVLW 6
$050E $6E02 MOVWF STACK_2, 0
$0510 $C000 F004 MOVFF STACK_0, STACK_4
$0514 $C001 F005 MOVFF STACK_0+1, STACK_4+1
$0518 $5002 MOVF STACK_2, 0, 0
$051A $ L_PWM_Change_Duty_4:
$051A $0100 MOVLB 0
$051C $E005 BZ L_PWM_Change_Duty_5
$051E $3205 RRCF STACK_4+1, 1, 0
$0520 $3204 RRCF STACK_4, 1, 0
$0522 $9E05 BCF STACK_4+1, 7, 0
$0524 $0FFF ADDLW 255
$0526 $D7F9 BRA L_PWM_Change_Duty_4
$0528 $ L_PWM_Change_Duty_5:
$0528 $C004 F000 MOVFF STACK_4, STACK_0
$052C $3600 RLCF STACK_0, 1, 0
$052E $9000 BCF STACK_0, 0, 0
$0530 $3600 RLCF STACK_0, 1, 0
$0532 $9000 BCF STACK_0, 0, 0
$0534 $3600 RLCF STACK_0, 1, 0
$0536 $9000 BCF STACK_0, 0, 0
$0538 $3600 RLCF STACK_0, 1, 0
$053A $9000 BCF STACK_0, 0, 0
$053C $0E30 MOVLW 48
$053E $1400 ANDWF STACK_0, 0, 0
$0540 $6E03 MOVWF STACK_3, 0
$0542 $C004 F000 MOVFF STACK_4, STACK_0
$0546 $C005 F001 MOVFF STACK_4+1, STACK_0+1
$054A $3201 RRCF STACK_0+1, 1, 0
$054C $3200 RRCF STACK_0, 1, 0
$054E $9E01 BCF STACK_0+1, 7, 0
$0550 $3201 RRCF STACK_0+1, 1, 0
$0552 $3200 RRCF STACK_0, 1, 0
$0554 $9E01 BCF STACK_0+1, 7, 0
$0556 $C000 FFBE MOVFF STACK_0, CCPR1L
$055A $0E0F MOVLW 15
$055C $16BD ANDWF CCP1CON, 1, 0
$055E $5003 MOVF STACK_3, 0, 0
$0560 $12BD IORWF CCP1CON, 1, 0
$0562 $0012 RETURN
$0564 $ _PWM_Init:
$0564 $6ABE CLRF CCPR1L, 0
$0566 $98BD BCF CCP1CON, 4, 0
$0568 $9ABD BCF CCP1CON, 5, 0
$056A $0012 RETURN
$056C $ _Lcd8_Init:
$056C $EC07 F000 CALL _Delay_5500us
$0570 $EC07 F000 CALL _Delay_5500us
$0574 $EC07 F000 CALL _Delay_5500us
$0578 $C03C F015 MOVFF FARG_Lcd8_Init+2, Lcd8bit_main_global_dataAddress
$057C $C03D F016 MOVFF FARG_Lcd8_Init+3, Lcd8bit_main_global_dataAddress+1
$0580 $C03A F017 MOVFF FARG_Lcd8_Init+0, Lcd8bit_main_global_ctrlAddress
$0584 $C03B F018 MOVFF FARG_Lcd8_Init+1, Lcd8bit_main_global_ctrlAddress+1
$0588 $C03A FFE9 MOVFF FARG_Lcd8_Init+0, FSR0L
$058C $C03B FFEA MOVFF FARG_Lcd8_Init+1, FSR0H
$0590 $90EF BCF INDF0, __LCD8_RW, 0
$0592 $C03C FFE1 MOVFF FARG_Lcd8_Init+2, FSR1L
$0596 $C03D FFE2 MOVFF FARG_Lcd8_Init+3, FSR1H
$059A $6AE6 CLRF POSTINC1, 0
$059C $0E11 MOVLW 17
$059E $24E1 ADDWF FSR1L, 0, 0
$05A0 $6E00 MOVWF STACK_0, 0
$05A2 $C000 FFE1 MOVFF STACK_0, FSR1L
$05A6 $6AE7 CLRF INDF1, 0
$05A8 $0E12 MOVLW 18
$05AA $5C00 SUBWF STACK_0, 0, 0
$05AC $6EE1 MOVWF FSR1L, 0
$05AE $0E12 MOVLW 18
$05B0 $26E9 ADDWF FSR0L, 1, 0
$05B2 $92EF BCF INDF0, __LCD8_ENABLE, 0
$05B4 $94EF BCF INDF0, __LCD8_RS, 0
$05B6 $90EF BCF INDF0, __LCD8_RW, 0
$05B8 $0E12 MOVLW 18
$05BA $5EE9 SUBWF FSR0L, 1, 0
$05BC $94EF BCF INDF0, __LCD8_RS, 0
$05BE $92EF BCF INDF0, __LCD8_ENABLE, 0
$05C0 $90EF BCF INDF0, __LCD8_RW, 0
$05C2 $0E30 MOVLW 48
$05C4 $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05C6 $EC37 F000 CALL _Lcd8_Cmd
$05CA $0E30 MOVLW 48
$05CC $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05CE $EC37 F000 CALL _Lcd8_Cmd
$05D2 $0E30 MOVLW 48
$05D4 $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05D6 $EC37 F000 CALL _Lcd8_Cmd
$05DA $0E38 MOVLW 56
$05DC $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05DE $EC37 F000 CALL _Lcd8_Cmd
$05E2 $0E08 MOVLW 8
$05E4 $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05E6 $EC37 F000 CALL _Lcd8_Cmd
$05EA $0E01 MOVLW 1
$05EC $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05EE $EC37 F000 CALL _Lcd8_Cmd
$05F2 $0E06 MOVLW 6
$05F4 $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05F6 $EC37 F000 CALL _Lcd8_Cmd
$05FA $0E0C MOVLW 12
$05FC $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$05FE $EC37 F000 CALL _Lcd8_Cmd
$0602 $0E01 MOVLW 1
$0604 $6E19 MOVWF Lcd8bit_main_global_cmd, 0
$0606 $0012 RETURN
$0608 $ _Word2Double:
$0608 $0100 MOVLB 0
$060A $5000 MOVF STACK_0, W, 0
$060C $6E08 MOVWF STACK_8, 0
$060E $5001 MOVF STACK_1, W, 0
$0610 $6E00 MOVWF STACK_0, 0
$0612 $6A01 CLRF STACK_1, 0
$0614 $6A02 CLRF STACK_2, 0
$0616 $6A03 CLRF STACK_3, 0
$0618 $ FLO16U32:
$0618 $6A0B CLRF STACK_11, 0
$061A $6A0C CLRF STACK_12, 0
$061C $0E96 MOVLW 150
$061E $6E03 MOVWF STACK_3, 0
$0620 $6A0A CLRF STACK_10, 0
$0622 $C000 F001 MOVFF STACK_0, STACK_1
$0626 $C008 F000 MOVFF STACK_8, STACK_0
$062A $6A08 CLRF STACK_8, 0
$062C $6A02 CLRF STACK_2, 0
$062E $ECBE F000 CALL _NRM3232
$0632 $0012 RETURN
$0634 $ _Mul_32x32_FP:
$0634 $0100 MOVLB 0
$0636 $ FPM32:
$0636 $6A08 CLRF STACK_8, 0
$0638 $6A09 CLRF STACK_9, 0
$063A $0E00 MOVLW 0x00
$063C $6207 CPFSEQ STACK_7, 0
$063E $6403 CPFSGT STACK_3, 0
$0640 $EFA0 F003 GOTO MULJPRES032
$0644 $ M32BNE0:
$0644 $5002 MOVF STACK_2, W, 0
$0646 $1806 XORWF STACK_6, W, 0
$0648 $6E0A MOVWF STACK_10, 0
$064A $5007 MOVF STACK_7, W, 0
$064C $2603 ADDWF STACK_3, F, 0
$064E $0E7E MOVLW 126
$0650 $A0D8 BTFSS STATUS, C, 0
$0652 $EF31 F003 GOTO MTUN32
$0656 $5E03 SUBWF STACK_3, F, 0
$0658 $B0D8 BTFSC STATUS, C, 0
$065A $EFA5 F003 GOTO MULJPSETFOV32
$065E $EF35 F003 GOTO MOK32
$0662 $ MTUN32:
$0662 $5E03 SUBWF STACK_3, F, 0
$0664 $A0D8 BTFSS STATUS, C, 0
$0666 $EFAA F003 GOTO MULJPSETFUN32
$066A $ MOK32:
$066A $8E02 BSF STACK_2, 7, 0
$066C $8E06 BSF STACK_6, 7, 0
$066E $C002 F00E MOVFF STACK_2, STACK_14
$0672 $C001 F00B MOVFF STACK_1, STACK_11
$0676 $C000 F00D MOVFF STACK_0, STACK_13
$067A $5000 MOVF STACK_0, W, 0
$067C $0204 MULWF STACK_4, 0
$067E $CFF4 F00C MOVFF PRODH, STACK_12
$0682 $5001 MOVF STACK_1, W, 0
$0684 $0205 MULWF STACK_5, 0
$0686 $CFF4 F000 MOVFF PRODH, STACK_0
$068A $CFF3 F008 MOVFF PRODL, STACK_8
$068E $0204 MULWF STACK_4, 0
$0690 $50F3 MOVF PRODL, W, 0
$0692 $260C ADDWF STACK_12, F, 0
$0694 $50F4 MOVF PRODH, W, 0
$0696 $2208 ADDWFC STACK_8, F, 0
$0698 $0E00 MOVLW 0x00
$069A $2200 ADDWFC STACK_0, F, 0
$069C $500D MOVF STACK_13, W, 0
$069E $0205 MULWF STACK_5, 0
$06A0 $50F3 MOVF PRODL, W, 0
$06A2 $260C ADDWF STACK_12, F, 0
$06A4 $50F4 MOVF PRODH, W, 0
$06A6 $2208 ADDWFC STACK_8, F, 0
$06A8 $0E00 MOVLW 0x00
$06AA $2200 ADDWFC STACK_0, F, 0
$06AC $5002 MOVF STACK_2, W, 0
$06AE $0204 MULWF STACK_4, 0
$06B0 $50F3 MOVF PRODL, W, 0
$06B2 $2608 ADDWF STACK_8, F, 0
$06B4 $50F4 MOVF PRODH, W, 0
$06B6 $2200 ADDWFC STACK_0, F, 0
$06B8 $5002 MOVF STACK_2, W, 0
$06BA $0205 MULWF STACK_5, 0
$06BC $6A01 CLRF STACK_1, 0
$06BE $0E00 MOVLW 0x00
$06C0 $2201 ADDWFC STACK_1, F, 0
$06C2 $50F3 MOVF PRODL, W, 0
$06C4 $2600 ADDWF STACK_0, F, 0
$06C6 $50F4 MOVF PRODH, W, 0
$06C8 $2201 ADDWFC STACK_1, F, 0
$06CA $500D MOVF STACK_13, W, 0
$06CC $0206 MULWF STACK_6, 0
$06CE $50F3 MOVF PRODL, W, 0
$06D0 $2608 ADDWF STACK_8, F, 0
$06D2 $50F4 MOVF PRODH, W, 0
$06D4 $2200 ADDWFC STACK_0, F, 0
$06D6 $6A02 CLRF STACK_2, 0
$06D8 $0E00 MOVLW 0x00
$06DA $2201 ADDWFC STACK_1, F, 0
$06DC $2202 ADDWFC STACK_2, F, 0
$06DE $500B MOVF STACK_11, W, 0
$06E0 $0206 MULWF STACK_6, 0
$06E2 $50F3 MOVF PRODL, W, 0
$06E4 $2600 ADDWF STACK_0, F, 0
$06E6 $50F4 MOVF PRODH, W, 0
$06E8 $2201 ADDWFC STACK_1, F, 0
$06EA $0E00 MOVLW 0x00
$06EC $2202 ADDWFC STACK_2, F, 0
$06EE $500E MOVF STACK_14, W, 0
$06F0 $0206 MULWF STACK_6, 0
$06F2 $50F3 MOVF PRODL, W, 0
$06F4 $2601 ADDWF STACK_1, F, 0
$06F6 $50F4 MOVF PRODH, W, 0
$06F8 $2202 ADDWFC STACK_2, F, 0
$06FA $BE02 BTFSC STACK_2, 7, 0
$06FC $EF88 F003 GOTO MROUND32
$0700 $3608 RLCF STACK_8, F, 0
$0702 $3600 RLCF STACK_0, F, 0
$0704 $3601 RLCF STACK_1, F, 0
$0706 $3602 RLCF STACK_2, F, 0
$0708 $0603 DECF STACK_3, F, 0
$070A $B4D8 BTFSC STATUS, Z, 0
$070C $EFAA F003 GOTO MULJPSETFUN32
$0710 $ MROUND32:
$0710 $EF9B F003 GOTO MUL32OK
$0714 $80D8 BSF STATUS, C, 0
$0716 $0E80 MOVLW 0x80
$0718 $6408 CPFSGT STACK_8, 0
$071A $3000 RRCF STACK_0, W, 0
$071C $0E00 MOVLW 0x00
$071E $2200 ADDWFC STACK_0, F, 0
$0720 $2201 ADDWFC STACK_1, F, 0
$0722 $2202 ADDWFC STACK_2, F, 0
$0724 $A0D8 BTFSS STATUS, C, 0
$0726 $EF9B F003 GOTO MUL32OK
$072A $3202 RRCF STACK_2, F, 0
$072C $3201 RRCF STACK_1, F, 0
$072E $3200 RRCF STACK_0, F, 0
$0730 $4A03 INFSNZ STACK_3, F, 0
$0732 $EFA5 F003 GOTO MULJPSETFOV32
$0736 $ MUL32OK:
$0736 $AE0A BTFSS STACK_10, 7, 0
$0738 $9E02 BCF STACK_2, 7, 0
$073A $0E00 MOVLW 0
$073C $EFAD F003 GOTO MULEEE
$0740 $ MULJPRES032:
$0740 $0E01 MOVLW 0x01
$0742 $EC1C F000 CALL _RES032
$0746 $EFAD F003 GOTO MULEEE
$074A $ MULJPSETFOV32:
$074A $0E02 MOVLW 0x02
$074C $ECFB F000 CALL _SETFOV32
$0750 $EFAD F003 GOTO MULEEE
$0754 $ MULJPSETFUN32:
$0754 $0E04 MOVLW 0x04
$0756 $EC24 F000 CALL _SETFUN32
$075A $ MULEEE:
$075A $0012 RETURN
$075C $ _Double2Word:
$075C $0100 MOVLB 0
$075E $ INT3216U:
$075E $6A0B CLRF STACK_11, 0
$0760 $6A0C CLRF STACK_12, 0
$0762 $6A0A CLRF STACK_10, 0
$0764 $5003 MOVF STACK_3, W, 0
$0766 $B4D8 BTFSC STATUS, Z, 0
$0768 $EFF9 F003 GOTO IRES016U
$076C $8E02 BSF STACK_2, 7, 0
$076E $0E8E MOVLW 142
$0770 $5E03 SUBWF STACK_3, F, 0
$0772 $BE03 BTFSC STACK_3, 7, 0
$0774 $EFC1 F003 GOTO SETEXP16U
$0778 $B4D8 BTFSC STATUS, Z, 0
$077A $EFC1 F003 GOTO SETEXP16U
$077E $EFFD F003 GOTO SETIOV16U
$0782 $ SETEXP16U:
$0782 $6D03 NEGF STACK_3, F
$0784 $0E08 MOVLW 8
$0786 $5C03 SUBWF STACK_3, W, 0
$0788 $A0D8 BTFSS STATUS, C, 0
$078A $EFD8 F003 GOTO TSHIFT3216U
$078E $6E03 MOVWF STACK_3, 0
$0790 $3601 RLCF STACK_1, F, 0
$0792 $C002 F001 MOVFF STACK_2, STACK_1
$0796 $6A02 CLRF STACK_2, 0
$0798 $0E08 MOVLW 8
$079A $5C03 SUBWF STACK_3, W, 0
$079C $A0D8 BTFSS STATUS, C, 0
$079E $EFD8 F003 GOTO TSHIFT3216U
$07A2 $3601 RLCF STACK_1, F, 0
$07A4 $6A01 CLRF STACK_1, 0
$07A6 $5003 MOVF STACK_3, W, 0
$07A8 $A4D8 BTFSS STATUS, Z, 0
$07AA $90D8 BCF STATUS, C, 0
$07AC $EFE2 F003 GOTO SHIFT3216UOK
$07B0 $ TSHIFT3216U:
$07B0 $5003 MOVF STACK_3, W, 0
$07B2 $B4D8 BTFSC STATUS, Z, 0
$07B4 $EFE2 F003 GOTO SHIFT3216UOK
$07B8 $ SHIFT3216U:
$07B8 $90D8 BCF STATUS, C, 0
$07BA $3202 RRCF STACK_2, F, 0
$07BC $3201 RRCF STACK_1, F, 0
$07BE $2E03 DECFSZ STACK_3, F, 0
$07C0 $EFDC F003 GOTO SHIFT3216U
$07C4 $ SHIFT3216UOK:
$07C4 $BC0B BTFSC STACK_11, 6, 0
$07C6 $A001 BTFSS STACK_1, 0, 0
$07C8 $EFEF F003 GOTO INT3216UOK
$07CC $A0D8 BTFSS STATUS, C, 0
$07CE $EFEF F003 GOTO INT3216UOK
$07D2 $2A01 INCF STACK_1, F, 0
$07D4 $B4D8 BTFSC STATUS, Z, 0
$07D6 $2A02 INCF STACK_2, F, 0
$07D8 $BE02 BTFSC STACK_2, 7, 0
$07DA $EF0C F004 GOTO JPKSETIOV3224
$07DE $ INT3216UOK:
$07DE $AE0A BTFSS STACK_10, 7, 0
$07E0 $EF12 F004 GOTO INT3216UEOK
$07E4 $1E02 COMF STACK_2, F, 0
$07E6 $1E01 COMF STACK_1, F, 0
$07E8 $2A01 INCF STACK_1, F, 0
$07EA $B4D8 BTFSC STATUS, Z, 0
$07EC $2A02 INCF STACK_2, F, 0
$07EE $EF12 F004 GOTO INT3216UEOK
$07F2 $ IRES016U:
$07F2 $6A02 CLRF STACK_2, 0
$07F4 $6A01 CLRF STACK_1, 0
$07F6 $EF12 F004 GOTO INT3216UEOK
$07FA $ SETIOV16U:
$07FA $800B BSF STACK_11, 0, 0
$07FC $AE0B BTFSS STACK_11, 7, 0
$07FE $EF16 F004 GOTO INT3216UEER
$0802 $6A02 CLRF STACK_2, 0
$0804 $AE0A BTFSS STACK_10, 7, 0
$0806 $EF16 F004 GOTO INT3216UEER
$080A $0EFF MOVLW 0xFF
$080C $6E02 MOVWF STACK_2, 0
$080E $6E01 MOVWF STACK_1, 0
$0810 $360A RLCF STACK_10, F, 0
$0812 $3202 RRCF STACK_2, F, 0
$0814 $EF16 F004 GOTO INT3216UEER
$0818 $ JPKSETIOV3224:
$0818 $0E01 MOVLW 0x01
$081A $6E0C MOVWF STACK_12, 0
$081C $EC08 F001 CALL _SETIOV3224
$0820 $EF18 F004 GOTO INT3216UEEE
$0824 $ INT3216UEOK:
$0824 $0E00 MOVLW 0x00
$0826 $6E0C MOVWF STACK_12, 0
$0828 $EF18 F004 GOTO INT3216UEEE
$082C $ INT3216UEER:
$082C $0EFF MOVLW 0xFF
$082E $6E0C MOVWF STACK_12, 0
$0830 $ INT3216UEEE:
$0830 $5001 MOVF STACK_1, W, 0
$0832 $6E00 MOVWF STACK_0, 0
$0834 $5002 MOVF STACK_2, W, 0
$0836 $6E01 MOVWF STACK_1, 0
$0838 $0012 RETURN
$083A $ _main:
$083A $0E53 MOVLW 83
$083C $6E1E MOVWF lstr1_part3+0, 0
$083E $0E65 MOVLW 101
$0840 $6E1F MOVWF lstr1_part3+1, 0
$0842 $0E72 MOVLW 114
$0844 $6E20 MOVWF lstr1_part3+2, 0
$0846 $0E76 MOVLW 118
$0848 $6E21 MOVWF lstr1_part3+3, 0
$084A $0E6F MOVLW 111
$084C $6E22 MOVWF lstr1_part3+4, 0
$084E $0E20 MOVLW 32
$0850 $6E23 MOVWF lstr1_part3+5, 0
$0852 $0E4D MOVLW 77
$0854 $6E24 MOVWF lstr1_part3+6, 0
$0856 $0E6F MOVLW 111
$0858 $6E25 MOVWF lstr1_part3+7, 0
$085A $0E74 MOVLW 116
$085C $6E26 MOVWF lstr1_part3+8, 0
$085E $0E6F MOVLW 111
$0860 $6E27 MOVWF lstr1_part3+9, 0
$0862 $0E72 MOVLW 114
$0864 $6E28 MOVWF lstr1_part3+10, 0
$0866 $6A29 CLRF lstr1_part3+11, 0
$0868 $0E53 MOVLW 83
$086A $6E2A MOVWF lstr2_part3+0, 0
$086C $0E70 MOVLW 112
$086E $6E2B MOVWF lstr2_part3+1, 0
$0870 $0E65 MOVLW 101
$0872 $6E2C MOVWF lstr2_part3+2, 0
$0874 $0E65 MOVLW 101
$0876 $6E2D MOVWF lstr2_part3+3, 0
$0878 $0E64 MOVLW 100
$087A $6E2E MOVWF lstr2_part3+4, 0
$087C $0E20 MOVLW 32
$087E $6E2F MOVWF lstr2_part3+5, 0
$0880 $0E3A MOVLW 58
$0882 $6E30 MOVWF lstr2_part3+6, 0
$0884 $6A31 CLRF lstr2_part3+7, 0
$0886 $0E30 MOVLW 48
$0888 $6E33 MOVWF main_text_L0+0, 0
$088A $0E30 MOVLW 48
$088C $6E34 MOVWF main_text_L0+1, 0
$088E $0E30 MOVLW 48
$0890 $6E35 MOVWF main_text_L0+2, 0
$0892 $0E30 MOVLW 48
$0894 $6E36 MOVWF main_text_L0+3, 0
$0896 $0E30 MOVLW 48
$0898 $6E37 MOVWF main_text_L0+4, 0
$089A $6A38 CLRF main_text_L0+5, 0
;part3.c,64 :: void main()
;part3.c,68 :: keypressed = read_keypad(); //Reading a key from the keypad
$089C $EC17 F001 CALL _read_keypad
$08A0 $C000 F032 MOVFF STACK_0, main_keypressed_L0
;part3.c,69 :: TRISD = 0x00; //Define PORTD to operate as outpout
$08A4 $6A95 CLRF TRISD, 0
;part3.c,70 :: TRISA = 0xFB; // Define PORTA pin 2 as output.
$08A6 $0EFB MOVLW 251
$08A8 $6E92 MOVWF TRISA, 0
;part3.c,71 :: keypressed = keypressed - 0x30;
$08AA $0E30 MOVLW 48
$08AC $5E00 SUBWF STACK_0, 1, 0
$08AE $C000 F032 MOVFF STACK_0, main_keypressed_L0
;part3.c,72 :: PORTD = function_numbers(keypressed); //Write the appropriate combination of bits to PORTD
$08B2 $C000 F03A MOVFF STACK_0, FARG_function_numbers+0
$08B6 $EC88 F001 CALL _function_numbers
$08BA $C000 FF83 MOVFF STACK_0, PORTD
;part3.c,73 :: switch (function_numbers(keypressed))
$08BE $C032 F03A MOVFF main_keypressed_L0, FARG_function_numbers+0
$08C2 $EC88 F001 CALL _function_numbers
$08C6 $C000 F039 MOVFF STACK_0, FLOC_main+27
$08CA $D05C BRA L_main_16
;part3.c,75 :: case 0x4F:
$08CC $ L_main_18:
;part3.c,77 :: Pwm_Init(500);
$08CC $80CA BSF T2CON, T2CKPS0, 0
$08CE $82CA BSF T2CON, T2CKPS1, 0
$08D0 $0EF9 MOVLW 249
$08D2 $6ECB MOVWF PR2, 0
$08D4 $ECB2 F002 CALL _PWM_Init
;part3.c,80 :: Lcd8_Config(&PORTE, &PORTD, 2,1,0, 7,6,5,4,3,2,1,0);
$08D8 $0E84 MOVLW PORTE
$08DA $6E3A MOVWF FARG_Lcd8_Init+0, 0
$08DC $0E0F MOVLW @PORTE
$08DE $6E3B MOVWF FARG_Lcd8_Init+1, 0
$08E0 $0E83 MOVLW PORTD
$08E2 $6E3C MOVWF FARG_Lcd8_Init+2, 0
$08E4 $0E0F MOVLW @PORTD
$08E6 $6E3D MOVWF FARG_Lcd8_Init+3, 0
$08E8 $ECB6 F002 CALL _Lcd8_Init
;part3.c,81 :: Lcd8_Cmd(LCD_CLEAR); // Clear screen
$08EC $0E01 MOVLW 1
$08EE $6E3F MOVWF FARG_Lcd8_Cmd+0, 0
$08F0 $EC37 F000 CALL _Lcd8_Cmd
;part3.c,82 :: Lcd8_Out(1, 1, "Servo Motor"); // Print text on LCD
$08F4 $0E01 MOVLW 1
$08F6 $6E3A MOVWF FARG_LCD8_Out+0, 0
$08F8 $0E01 MOVLW 1
$08FA $6E3B MOVWF FARG_LCD8_Out+1, 0
$08FC $0E1E MOVLW lstr1_part3
$08FE $6E3C MOVWF FARG_LCD8_Out+2, 0
$0900 $0E00 MOVLW @lstr1_part3
$0902 $6E3D MOVWF FARG_LCD8_Out+3, 0
$0904 $ECA9 F001 CALL _LCD8_Out
;part3.c,83 :: Lcd8_Out(2, 1, "Speed :"); // Print text on LCD
$0908 $0E02 MOVLW 2
$090A $6E3A MOVWF FARG_LCD8_Out+0, 0
$090C $0E01 MOVLW 1
$090E $6E3B MOVWF FARG_LCD8_Out+1, 0
$0910 $0E2A MOVLW lstr2_part3
$0912 $6E3C MOVWF FARG_LCD8_Out+2, 0
$0914 $0E00 MOVLW @lstr2_part3
$0916 $6E3D MOVWF FARG_LCD8_Out+3, 0
$0918 $ECA9 F001 CALL _LCD8_Out
;part3.c,86 :: while (1)
$091C $ L_main_19:
;part3.c,87 :: { Pwm_Start();
$091C $ECED F001 CALL _PWM_Start
;part3.c,88 :: adc_rd = ADC_read(0); // get ADC value from first channel
$0920 $6A3A CLRF FARG_Adc_Read+0, 0
$0922 $ECF2 F001 CALL _Adc_Read
$0926 $C000 F01A MOVFF STACK_0, _adc_rd
$092A $C001 F01B MOVFF STACK_0+1, _adc_rd+1
;part3.c,89 :: adc_final= adc_rd*0.25; //convert adc values to [0-255] as instructed
$092E $EC04 F003 CALL _word2double
$0932 $0E00 MOVLW 0
$0934 $6E04 MOVWF STACK_4, 0
$0936 $0E00 MOVLW 0
$0938 $6E05 MOVWF STACK_4+1, 0
$093A $0E00 MOVLW 0
$093C $6E06 MOVWF STACK_4+2, 0
$093E $0E7D MOVLW 125
$0940 $6E07 MOVWF STACK_4+3, 0
$0942 $EC1A F003 CALL _mul_32x32_fp
$0946 $ECAE F003 CALL _double2word
$094A $C000 F01C MOVFF STACK_0, _adc_final
$094E $C001 F01D MOVFF STACK_0+1, _adc_final+1
;part3.c,90 :: wordToStr(adc_final, text);
$0952 $C000 F03A MOVFF STACK_0, FARG_WordToStr+0
$0956 $C001 F03B MOVFF STACK_0+1, FARG_WordToStr+1
$095A $0E33 MOVLW main_text_L0
$095C $6E3C MOVWF FARG_WordToStr+2, 0
$095E $0E00 MOVLW @main_text_L0
$0960 $6E3D MOVWF FARG_WordToStr+3, 0
$0962 $EC1A F002 CALL _WordToStr
;part3.c,91 :: Lcd8_Out(2,8, text);
$0966 $0E02 MOVLW 2
$0968 $6E3A MOVWF FARG_LCD8_Out+0, 0
$096A $0E08 MOVLW 8
$096C $6E3B MOVWF FARG_LCD8_Out+1, 0
$096E $0E33 MOVLW main_text_L0
$0970 $6E3C MOVWF FARG_LCD8_Out+2, 0
$0972 $0E00 MOVLW @main_text_L0
$0974 $6E3D MOVWF FARG_LCD8_Out+3, 0
$0976 $ECA9 F001 CALL _LCD8_Out
;part3.c,92 :: Pwm_Change_Duty(adc_final); // adjusting the speed of the servo motor depending on the ADC values
$097A $C01C F03A MOVFF _adc_final, FARG_PWM_Change_Duty+0
$097E $EC7A F002 CALL _PWM_Change_Duty
;part3.c,93 :: }
$0982 $D7CC BRA L_main_19
;part3.c,94 :: }
$0984 $ L_main_16:
$0984 $5039 MOVF FLOC_main+27, 0, 0
$0986 $0A4F XORLW 79
$0988 $E0A1 BZ L_main_18
$098A $ L_main_17:
;part3.c,95 :: }
$098A $D7FF BRA $
| 36.853061 | 122 | 0.593776 |
d6eeac484697f79557aba777eb0b2083b37ec4a1 | 623 | asm | Assembly | engine/battle/move_effects/selfdestruct.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | engine/battle/move_effects/selfdestruct.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | engine/battle/move_effects/selfdestruct.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | BattleCommand_Selfdestruct:
farcall StubbedTrainerRankings_Selfdestruct
ld a, BATTLEANIM_PLAYER_DAMAGE
ld [wNumHits], a
ld c, 3
call DelayFrames
ld a, BATTLE_VARS_STATUS
call GetBattleVarAddr
xor a
ld [hli], a
inc hl
ld [hli], a
ld [hl], a
ld a, $1
ld [wKickCounter], a
call BattleCommand_LowerSub
call LoadMoveAnim
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVarAddr
res SUBSTATUS_LEECH_SEED, [hl]
ld a, BATTLE_VARS_SUBSTATUS5_OPP
call GetBattleVarAddr
res SUBSTATUS_DESTINY_BOND, [hl]
call _CheckBattleScene
ret nc
farcall DrawPlayerHUD
farcall DrawEnemyHUD
call WaitBGMap
jp RefreshBattleHuds
| 20.766667 | 44 | 0.796148 |
bbcd68da20431d0e6b428623b62d252183bdcb7a | 11,091 | asm | Assembly | erasure_code/gf_5vect_mad_avx2.asm | leo-project/isa_l | 9e7aad28f35265a80c9d4ef8f58380e00546e3e2 | [
"BSD-3-Clause"
] | 1 | 2018-03-22T07:20:18.000Z | 2018-03-22T07:20:18.000Z | erasure_code/gf_5vect_mad_avx2.asm | leo-project/isa_l | 9e7aad28f35265a80c9d4ef8f58380e00546e3e2 | [
"BSD-3-Clause"
] | null | null | null | erasure_code/gf_5vect_mad_avx2.asm | leo-project/isa_l | 9e7aad28f35265a80c9d4ef8f58380e00546e3e2 | [
"BSD-3-Clause"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2015 Intel Corporation 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.
; * Neither the name of Intel Corporation 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.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; gf_5vect_mad_avx2(len, vec, vec_i, mul_array, src, dest);
;;;
%include "reg_sizes.asm"
%define PS 8
%ifidn __OUTPUT_FORMAT__, win64
%define arg0 rcx
%define arg0.w ecx
%define arg1 rdx
%define arg2 r8
%define arg3 r9
%define arg4 r12
%define arg5 r15
%define tmp r11
%define tmp.w r11d
%define tmp.b r11b
%define tmp2 r10
%define return rax
%define return.w eax
%define stack_size 16*10 + 3*8
%define arg(x) [rsp + stack_size + PS + PS*x]
%define func(x) proc_frame x
%macro FUNC_SAVE 0
sub rsp, stack_size
movdqa [rsp+16*0],xmm6
movdqa [rsp+16*1],xmm7
movdqa [rsp+16*2],xmm8
movdqa [rsp+16*3],xmm9
movdqa [rsp+16*4],xmm10
movdqa [rsp+16*5],xmm11
movdqa [rsp+16*6],xmm12
movdqa [rsp+16*7],xmm13
movdqa [rsp+16*8],xmm14
movdqa [rsp+16*9],xmm15
save_reg r12, 10*16 + 0*8
save_reg r15, 10*16 + 1*8
end_prolog
mov arg4, arg(4)
mov arg5, arg(5)
%endmacro
%macro FUNC_RESTORE 0
movdqa xmm6, [rsp+16*0]
movdqa xmm7, [rsp+16*1]
movdqa xmm8, [rsp+16*2]
movdqa xmm9, [rsp+16*3]
movdqa xmm10, [rsp+16*4]
movdqa xmm11, [rsp+16*5]
movdqa xmm12, [rsp+16*6]
movdqa xmm13, [rsp+16*7]
movdqa xmm14, [rsp+16*8]
movdqa xmm15, [rsp+16*9]
mov r12, [rsp + 10*16 + 0*8]
mov r15, [rsp + 10*16 + 1*8]
add rsp, stack_size
%endmacro
%elifidn __OUTPUT_FORMAT__, elf64
%define arg0 rdi
%define arg0.w edi
%define arg1 rsi
%define arg2 rdx
%define arg3 rcx
%define arg4 r8
%define arg5 r9
%define tmp r11
%define tmp.w r11d
%define tmp.b r11b
%define tmp2 r10
%define return rax
%define return.w eax
%define func(x) x:
%define FUNC_SAVE
%define FUNC_RESTORE
%endif
;;; gf_5vect_mad_avx2(len, vec, vec_i, mul_array, src, dest)
%define len arg0
%define len.w arg0.w
%define vec arg1
%define vec_i arg2
%define mul_array arg3
%define src arg4
%define dest1 arg5
%define pos return
%define pos.w return.w
%define dest2 tmp2
%define dest3 mul_array
%define dest4 vec
%define dest5 vec_i
%ifndef EC_ALIGNED_ADDR
;;; Use Un-aligned load/store
%define XLDR vmovdqu
%define XSTR vmovdqu
%else
;;; Use Non-temporal load/stor
%ifdef NO_NT_LDST
%define XLDR vmovdqa
%define XSTR vmovdqa
%else
%define XLDR vmovntdqa
%define XSTR vmovntdq
%endif
%endif
default rel
[bits 64]
section .text
%define xmask0f ymm15
%define xmask0fx xmm15
%define xgft1_lo ymm14
%define xgft2_lo ymm13
%define xgft3_lo ymm12
%define xgft4_lo ymm11
%define xgft5_lo ymm10
%define x0 ymm0
%define xtmpa ymm1
%define xtmpl ymm2
%define xtmplx xmm2
%define xtmph1 ymm3
%define xtmph1x xmm3
%define xtmph2 ymm4
%define xd1 ymm5
%define xd2 ymm6
%define xd3 ymm7
%define xd4 ymm8
%define xd5 ymm9
align 16
global gf_5vect_mad_avx2:function
func(gf_5vect_mad_avx2)
FUNC_SAVE
sub len, 32
jl .return_fail
xor pos, pos
mov tmp.b, 0x0f
vpinsrb xmask0fx, xmask0fx, tmp.w, 0
vpbroadcastb xmask0f, xmask0fx ;Construct mask 0x0f0f0f...
sal vec_i, 5 ;Multiply by 32
sal vec, 5 ;Multiply by 32
lea tmp, [mul_array + vec_i]
vmovdqu xgft1_lo, [tmp] ;Load array Ax{00}, Ax{01}, ..., Ax{0f}
; " Ax{00}, Ax{10}, ..., Ax{f0}
vmovdqu xgft2_lo, [tmp+vec] ;Load array Bx{00}, Bx{01}, ..., Bx{0f}
; " Bx{00}, Bx{10}, ..., Bx{f0}
vmovdqu xgft3_lo, [tmp+2*vec] ;Load array Cx{00}, Cx{01}, ..., Cx{0f}
; " Cx{00}, Cx{10}, ..., Cx{f0}
vmovdqu xgft5_lo, [tmp+4*vec] ;Load array Ex{00}, Ex{01}, ..., Ex{0f}
; " Ex{00}, Ex{10}, ..., Ex{f0}
add tmp, vec
vmovdqu xgft4_lo, [tmp+2*vec] ;Load array Dx{00}, Dx{01}, ..., Dx{0f}
; " Dx{00}, Dx{10}, ..., Dx{f0}
mov dest3, [dest1+2*PS] ; reuse mul_array
mov dest4, [dest1+3*PS] ; reuse vec
mov dest5, [dest1+4*PS] ; reuse vec_i
mov dest2, [dest1+PS]
mov dest1, [dest1]
.loop32:
XLDR x0, [src+pos] ;Get next source vector
XLDR xd1, [dest1+pos] ;Get next dest vector
XLDR xd2, [dest2+pos] ;Get next dest vector
XLDR xd3, [dest3+pos] ;Get next dest vector
XLDR xd4, [dest4+pos] ;Get next dest vector
XLDR xd5, [dest5+pos] ;Get next dest vector
vpand xtmpl, x0, xmask0f ;Mask low src nibble in bits 4-0
vpsraw x0, x0, 4 ;Shift to put high nibble into bits 4-0
vpand x0, x0, xmask0f ;Mask high src nibble in bits 4-0
vperm2i128 xtmpa, xtmpl, x0, 0x30 ;swap xtmpa from 1lo|2lo to 1lo|2hi
vperm2i128 x0, xtmpl, x0, 0x12 ;swap x0 from 1hi|2hi to 1hi|2lo
vperm2i128 xtmph1, xgft1_lo, xgft1_lo, 0x01 ; swapped to hi | lo
vperm2i128 xtmph2, xgft2_lo, xgft2_lo, 0x01 ; swapped to hi | lo
; dest1
vpshufb xtmph1, xtmph1, x0 ;Lookup mul table of high nibble
vpshufb xtmpl, xgft1_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph1, xtmph1, xtmpl ;GF add high and low partials
vpxor xd1, xd1, xtmph1 ;xd1 += partial
vperm2i128 xtmph1, xgft3_lo, xgft3_lo, 0x01 ; swapped to hi | lo
; dest2
vpshufb xtmph2, xtmph2, x0 ;Lookup mul table of high nibble
vpshufb xtmpl, xgft2_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph2, xtmph2, xtmpl ;GF add high and low partials
vpxor xd2, xd2, xtmph2 ;xd2 += partial
vperm2i128 xtmph2, xgft4_lo, xgft4_lo, 0x01 ; swapped to hi | lo
; dest3
vpshufb xtmph1, xtmph1, x0 ;Lookup mul table of high nibble
vpshufb xtmpl, xgft3_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph1, xtmph1, xtmpl ;GF add high and low partials
vpxor xd3, xd3, xtmph1 ;xd3 += partial
vperm2i128 xtmph1, xgft5_lo, xgft5_lo, 0x01 ; swapped to hi | lo
; dest4
vpshufb xtmph2, xtmph2, x0 ;Lookup mul table of high nibble
vpshufb xtmpl, xgft4_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph2, xtmph2, xtmpl ;GF add high and low partials
vpxor xd4, xd4, xtmph2 ;xd4 += partial
; dest5
vpshufb xtmph1, xtmph1, x0 ;Lookup mul table of high nibble
vpshufb xtmpl, xgft5_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph1, xtmph1, xtmpl ;GF add high and low partials
vpxor xd5, xd5, xtmph1 ;xd5 += partial
XSTR [dest1+pos], xd1
XSTR [dest2+pos], xd2
XSTR [dest3+pos], xd3
XSTR [dest4+pos], xd4
XSTR [dest5+pos], xd5
add pos, 32 ;Loop on 32 bytes at a time
cmp pos, len
jle .loop32
lea tmp, [len + 32]
cmp pos, tmp
je .return_pass
.lessthan32:
;; Tail len
;; Do one more overlap pass
mov tmp.b, 0x1f
vpinsrb xtmph1x, xtmph1x, tmp.w, 0
vpbroadcastb xtmph1, xtmph1x ;Construct mask 0x1f1f1f...
mov tmp, len ;Overlapped offset length-32
XLDR x0, [src+tmp] ;Get next source vector
XLDR xd1, [dest1+tmp] ;Get next dest vector
XLDR xd2, [dest2+tmp] ;Get next dest vector
XLDR xd3, [dest3+tmp] ;Get next dest vector
XLDR xd4, [dest4+tmp] ;Get next dest vector
XLDR xd5, [dest5+tmp] ;Get next dest vector
sub len, pos
vmovdqa xtmph2, [constip32] ;Load const of i + 32
vpinsrb xtmplx, xtmplx, len.w, 15
vinserti128 xtmpl, xtmpl, xtmplx, 1 ;swapped to xtmplx | xtmplx
vpshufb xtmpl, xtmpl, xtmph1 ;Broadcast len to all bytes. xtmph1=0x1f1f1f...
vpcmpgtb xtmpl, xtmpl, xtmph2
vpand xtmph1, x0, xmask0f ;Mask low src nibble in bits 4-0
vpsraw x0, x0, 4 ;Shift to put high nibble into bits 4-0
vpand x0, x0, xmask0f ;Mask high src nibble in bits 4-0
vperm2i128 xtmpa, xtmph1, x0, 0x30 ;swap xtmpa from 1lo|2lo to 1lo|2hi
vperm2i128 x0, xtmph1, x0, 0x12 ;swap x0 from 1hi|2hi to 1hi|2lo
vperm2i128 xtmph1, xgft1_lo, xgft1_lo, 0x01 ; swapped to hi | lo
vperm2i128 xtmph2, xgft2_lo, xgft2_lo, 0x01 ; swapped to hi | lo
; dest1
vpshufb xtmph1, xtmph1, x0 ;Lookup mul table of high nibble
vpshufb xgft1_lo, xgft1_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph1, xtmph1, xgft1_lo ;GF add high and low partials
vpand xtmph1, xtmph1, xtmpl
vpxor xd1, xd1, xtmph1 ;xd1 += partial
vperm2i128 xtmph1, xgft3_lo, xgft3_lo, 0x01 ; swapped to hi | lo
; dest2
vpshufb xtmph2, xtmph2, x0 ;Lookup mul table of high nibble
vpshufb xgft2_lo, xgft2_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph2, xtmph2, xgft2_lo ;GF add high and low partials
vpand xtmph2, xtmph2, xtmpl
vpxor xd2, xd2, xtmph2 ;xd2 += partial
vperm2i128 xtmph2, xgft4_lo, xgft4_lo, 0x01 ; swapped to hi | lo
; dest3
vpshufb xtmph1, xtmph1, x0 ;Lookup mul table of high nibble
vpshufb xgft3_lo, xgft3_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph1, xtmph1, xgft3_lo ;GF add high and low partials
vpand xtmph1, xtmph1, xtmpl
vpxor xd3, xd3, xtmph1 ;xd3 += partial
vperm2i128 xtmph1, xgft5_lo, xgft5_lo, 0x01 ; swapped to hi | lo
; dest4
vpshufb xtmph2, xtmph2, x0 ;Lookup mul table of high nibble
vpshufb xgft4_lo, xgft4_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph2, xtmph2, xgft4_lo ;GF add high and low partials
vpand xtmph2, xtmph2, xtmpl
vpxor xd4, xd4, xtmph2 ;xd4 += partial
; dest5
vpshufb xtmph1, xtmph1, x0 ;Lookup mul table of high nibble
vpshufb xgft5_lo, xgft5_lo, xtmpa ;Lookup mul table of low nibble
vpxor xtmph1, xtmph1, xgft5_lo ;GF add high and low partials
vpand xtmph1, xtmph1, xtmpl
vpxor xd5, xd5, xtmph1 ;xd5 += partial
XSTR [dest1+tmp], xd1
XSTR [dest2+tmp], xd2
XSTR [dest3+tmp], xd3
XSTR [dest4+tmp], xd4
XSTR [dest5+tmp], xd5
.return_pass:
FUNC_RESTORE
mov return, 0
ret
.return_fail:
FUNC_RESTORE
mov return, 1
ret
endproc_frame
section .data
align 32
constip32:
ddq 0xf0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ddq 0xe0e1e2e3e4e5e6e7e8e9eaebecedeeef
;;; func core, ver, snum
slversion gf_5vect_mad_avx2, 04, 01, 020e
| 30.46978 | 77 | 0.699757 |
b601b2bd6c2caeb280d9cd1bb894a9000c0e2584 | 231 | asm | Assembly | libsrc/_DEVELOPMENT/compress/zx0/c/sdcc/dzx0_turbo_callee.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/compress/zx0/c/sdcc/dzx0_turbo_callee.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/compress/zx0/c/sdcc/dzx0_turbo_callee.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void dzx0_turbo_callee(void *src, void *dst)
SECTION code_clib
SECTION code_compress_zx0
PUBLIC _dzx0_turbo_callee
EXTERN asm_dzx0_turbo
_dzx0_turbo_callee:
pop af
pop hl
pop de
push af
jp asm_dzx0_turbo
| 12.157895 | 46 | 0.753247 |
d7d3e107c8e0a5e3fe891ae983b35274c7542862 | 11,035 | asm | Assembly | Games/CMonster (Breakout)/Source/hiscore.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | 1 | 2019-03-31T11:49:12.000Z | 2019-03-31T11:49:12.000Z | Games/CMonster (Breakout)/Source/hiscore.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | null | null | null | Games/CMonster (Breakout)/Source/hiscore.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | 1 | 2020-03-09T13:21:19.000Z | 2020-03-09T13:21:19.000Z | ;############# CMonster by Patrick Davidson - high scores
win_message:
.db "YOU WIN!",0
lose_message:
.db "GAME OVER",0
view_message:
.db "All-Time High Scores",0
no_message:
.db "You don't have a high score",0
yes_message:
.db "You have a high score! Enter your name:",0
hs_instructions:
.db "Press ALPHA to switch upper/lower/digits",0
;############# Show final score and check for high score
check_highscore:
#ifdef TI84CE
di
ld a,(hl)
push hl
call Clear_Screen
ld hl,win_image
cp 'Y'
jr z,chs_won
ld hl,lose_image
chs_won:
ld a,$25
ld ($E30018),a ; set to 16 color mode
ld de,$D60000
ld bc,256*16
ldir
ld hl,Draw_Char_16
ld (to_draw_char+1),hl
ld hl,PRGM_continue
ld bc,0
call Draw_String
ld hl,Draw_Char
ld (to_draw_char+1),hl
ld hl,zoom_code ; copy and run main code
ld de,$E30200
ld bc,512
ldir
call $E30200
ld a,$2D ; back to 65536 color mode
ld ($E30018),a
pop hl
ei
call GET_KEY
call GET_KEY
#endif
push hl
ld a,(lives)
or a
jr z,no_lives_bonus
ld b,a
ld a,'1'
ld (score_increment+3),a
ld a,(hard_flag)
or a
jr z,loop_bonus
sla b
loop_bonus:
push bc
ld hl,score+4 ; and increment the score
ld de,score_increment+4
ld b,4
call loop_add_nocarry
pop bc
djnz loop_bonus
no_lives_bonus:
ld hl,score
#ifdef TIME_INDICATOR
ld (hl),'0'
#endif
call Clear_Screen
pop hl
ld bc,0
call Draw_String
ld hl,score
ld bc,256*4*(40-6)
call Draw_String
ld hl,last_score+NAME_LEN
ld de,score
call CP_SCORE
jp c,no_score
;############## Player has a high score, first fill in the bottom entry
ld hl,last_score
ld b,NAME_LEN
loop_space:
ld (hl),' '
inc hl
djnz loop_space
ex de,hl
ld hl,score
ld bc,SCORELEN
ldir
;############## Bubble up the high score
ld b,SCORE_COUNT-1 ; Bubble it towards the top
ld de,last_score+NAME_LEN ; DE = score of entry to move
loop_bubble:
ld hl,-(ENTRYLEN)
add hl,de ; HL = score of previous item
push bc
push de
call CP_SCORE
pop de
pop bc
jr z,bubble_up
jr c,no_bubble_up
bubble_up:
push bc
ld hl,SCORELEN
add hl,de
ex de,hl ; DE = last byte of new entry
ld hl,-(ENTRYLEN)
add hl,de ; HL = last byte of previous
ld b,0+ENTRYLEN
loop_exchange:
ld a,(de)
ld c,a
ld a,(hl)
ld (de),a
ld (hl),c
dec hl
dec de
djnz loop_exchange
pop bc ; DE = last byte of new
ld hl,-(SCORELEN)
add hl,de
ex de,hl ; DE = score of new position
djnz loop_bubble
no_bubble_up:
;############## Bubbling is done, show the table
ld hl,-NAME_LEN
add hl,de ; HL -> score entry position
push hl
push bc
ld hl,saved_flag
set 1,(hl)
ld hl,yes_message
ld bc,20
call Draw_String
ld hl,hs_instructions
ld bc,30
call Draw_String
call show_scores_list
pop bc
pop ix
call input_name
jp show_highscores
;############## Show high score table if you didn't get a high score
no_score:
ld hl,no_message
ld bc,26*256+25
call Draw_String
call show_scores_and_wait
;############## Display high score table (from title screen)
show_highscores:
call Clear_Screen
ld hl,view_message
ld bc,40*256
call Draw_String
show_scores_and_wait:
call show_scores_list
;############## Wait to exit table display
wait_key:
call GET_KEY
ld hl,0
wait_loop_hs:
inc hl
ld a,h
or l
ret z
call GET_KEY
cp skClear
ret z
cp skEnter
jr nz,wait_loop_hs
ret
;############## Display list of high scores
show_scores_list:
ld bc,SCORE_COUNT*256+60
ld hl,high_scores
loop_show_highscore:
push bc
ld b,16
call Draw_String
pop bc
ld a,15
add a,c
ld c,a
inc hl
djnz loop_show_highscore
ret
;############## Compares ASCII numbers
;
; HL ->number to subtract from other
; DE ->number
; B = number of bytes
;
; Returns with flags indicating comparison results. Changes A, B, DE, HL.
; Zero set if equal, carry if HL > DE.
CP_SCORE:
ld b,6
CP_ASCII:
cmpl: ld a,(de)
cp (hl)
ret nz
inc de
inc hl
djnz cmpl
ret
;############## Prompt for name entry
input_name:
ld a,19
ld (delay_amount),a
xor a
ld (score_inc),a ; used as input type
ld a,b
add a,a
add a,a
add a,a
add a,a
sub b ; A = 15 * row
add a,60
ld (Draw_Score_Char+2),a ; store Y coordinate
ld b,0 ; B = X coordinate
ld hl,0
ld (wait_count),hl
enter_name_loop:
ld hl,(wait_count)
inc hl
ld (wait_count),hl
ld a,h
or l
ret z
call timer_wait
ld a,(wait_count)
bit 6,a
ld a,' '
jr z,clear_cursor
ld a,(score_inc)
add a,127
clear_cursor:
call Draw_Score_Char
call GET_KEY
or a
jr z,enter_name_loop
cp skDel
jr z,backup
cp skLeft
jr z,backup
cp skEnter
ret z
cp skClear
ret z
cp skAlpha
jr z,new_cursor
ld c,a
ld a,NAME_LEN-1
cp b
jr z,enter_name_loop
ld de,(score_inc) ; select upper/lower/number chars
ld hl,chartable-10
dec e
jr nz,not_lower
ld hl,chartable_lower-10
not_lower:
dec e
jr nz,not_number
ld hl,chartable_number-10
not_number:
#ifdef TI84CE
ld de,0
#else
ld d,0
#endif
ld e,c
add hl,de
ld a,(hl)
ld (ix),a
call Draw_Score_Char
inc b
inc ix
to_enter_name_loop:
jr enter_name_loop
backup: xor a
cp b
jr z,enter_name_loop
ld a,' '
call Draw_Score_Char
dec b
dec ix
ld (ix),32
ld a,' '
call Draw_Score_Char
jr to_enter_name_loop
new_cursor:
ld hl,score_inc
ld a,(hl)
inc a
cp 3
jr nz,no_cursor_restart
xor a
no_cursor_restart:
ld (hl),a
jr to_enter_name_loop
Draw_Score_Char:
push bc
ld c,0 ;Y filled in by self modifying
ld d,a
ld a,b
add a,a
add a,a
add a,16
ld b,a
ld a,d
call Draw_Char
pop bc
ret
chartable:
.db ":WRMH."
.db "..0VQLG!..ZUPKFC"
.db ". YTOJEBX.XSNIDA"
.db ".12345.."
chartable_lower:
.db ":wrmh."
.db "..0vqlg!..zupkfc"
.db ". ytojebx.xsnida"
.db ".12345.."
chartable_number:
.db ":+-/^."
.db "..369LG!..258KFC"
.db ".0147JEBX.>SNIDA"
.db ".12345.."
;############## Rotate/zoom special text rendering and data
#ifdef TI84CE
Draw_Char_16:
sub 32
add a,a
ld de,0
ld e,a
ld hl,tileData
add hl,de
add hl,de
add hl,de
add hl,de ; HL -> start of char
push hl
ld hl,0
ld e,c
ld l,c
add hl,hl
add hl,hl
add hl,de ; HL = 5 * Y
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,hl ; HL = 160 * Y
ld e,b
add hl,de ; HL = 160 * Y + X
ld de,$D40000
add hl,de
pop de
ld c,8
outer_char_loop_16:
ld a,(de)
inc de
ld b,4
inner_char_loop_16:
ld (hl),0
rlca
jr c,inner_16_start_clear
ld (hl),8
inner_16_start_clear:
rlca
jr c,inner_16_second_clear
set 7,(hl)
inner_16_second_clear:
inc hl
djnz inner_char_loop_16
push de
ld de,160-4
add hl,de
pop de
dec c
jr nz,outer_char_loop_16
ret
zoom_code:
#import zoom.bin
win_image:
#include win.i
lose_image:
#include lose.i
PRGM_continue:
.db "Press PRGM to continue",0
#endif | 24.093886 | 78 | 0.407431 |
7518acd99ae04eef42e03b36fbd9248f40e7160f | 102 | asm | Assembly | audio/sfx/battle_1c.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | audio/sfx/battle_1c.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | audio/sfx/battle_1c.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | SFX_Battle_1C_Ch7:
noisenote 2, 12, 2, 1
noisenote 15, 15, 4, 1
noisenote 15, 15, 2, 1
endchannel
| 17 | 23 | 0.696078 |
9ca596d17f8ac46a003e584d49c505eceacaa26b | 2,995 | asm | Assembly | x264-stable/common/x86/const-a.asm | charliesome/x264-dev | fe1905a13a00e6a4e0381f97211b514f53ebc032 | [
"MIT"
] | 35 | 2016-04-14T06:10:08.000Z | 2020-09-03T09:32:58.000Z | x264-stable/common/x86/const-a.asm | charliesome/x264-dev | fe1905a13a00e6a4e0381f97211b514f53ebc032 | [
"MIT"
] | 1 | 2020-10-09T01:15:40.000Z | 2020-10-09T01:15:40.000Z | x264-stable/common/x86/const-a.asm | charliesome/x264-dev | fe1905a13a00e6a4e0381f97211b514f53ebc032 | [
"MIT"
] | 28 | 2016-04-14T06:07:18.000Z | 2020-05-08T01:50:20.000Z | ;*****************************************************************************
;* const-a.asm: x86 global constants
;*****************************************************************************
;* Copyright (C) 2010-2019 x264 project
;*
;* Authors: Loren Merritt <lorenm@u.washington.edu>
;* Fiona Glaser <fiona@x264.com>
;*
;* This program is free software; you can redistribute it and/or modify
;* it under the terms of the GNU General Public License as published by
;* the Free Software Foundation; either version 2 of the License, or
;* (at your option) any later version.
;*
;* This program is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;* GNU General Public License for more details.
;*
;* You should have received a copy of the GNU General Public License
;* along with this program; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
;*
;* This program is also available under a commercial proprietary license.
;* For more information, contact us at licensing@x264.com.
;*****************************************************************************
%include "x86inc.asm"
SECTION_RODATA 32
const pb_1, times 32 db 1
const hsub_mul, times 16 db 1, -1
const pw_1, times 16 dw 1
const pw_16, times 16 dw 16
const pw_32, times 16 dw 32
const pw_512, times 16 dw 512
const pw_00ff, times 16 dw 0x00ff
const pw_pixel_max,times 16 dw ((1 << BIT_DEPTH)-1)
const pw_0to15, dw 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
const pd_1, times 8 dd 1
const pd_0123, dd 0,1,2,3
const pd_4567, dd 4,5,6,7
const deinterleave_shufd, dd 0,4,1,5,2,6,3,7
const pb_unpackbd1, times 2 db 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3
const pb_unpackbd2, times 2 db 4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7
const pb_01, times 8 db 0,1
const pb_0, times 16 db 0
const pb_a1, times 16 db 0xa1
const pb_3, times 16 db 3
const pb_shuf8x8c, db 0,0,0,0,2,2,2,2,4,4,4,4,6,6,6,6
const pw_2, times 8 dw 2
const pw_m2, times 8 dw -2
const pw_4, times 8 dw 4
const pw_8, times 8 dw 8
const pw_64, times 8 dw 64
const pw_256, times 8 dw 256
const pw_32_0, times 4 dw 32,
times 4 dw 0
const pw_8000, times 8 dw 0x8000
const pw_3fff, times 8 dw 0x3fff
const pw_ppppmmmm, dw 1,1,1,1,-1,-1,-1,-1
const pw_ppmmppmm, dw 1,1,-1,-1,1,1,-1,-1
const pw_pmpmpmpm, dw 1,-1,1,-1,1,-1,1,-1
const pw_pmmpzzzz, dw 1,-1,-1,1,0,0,0,0
const pd_8, times 4 dd 8
const pd_32, times 4 dd 32
const pd_1024, times 4 dd 1024
const pd_ffff, times 4 dd 0xffff
const pw_ff00, times 8 dw 0xff00
const popcnt_table
%assign x 0
%rep 256
; population count
db ((x>>0)&1)+((x>>1)&1)+((x>>2)&1)+((x>>3)&1)+((x>>4)&1)+((x>>5)&1)+((x>>6)&1)+((x>>7)&1)
%assign x x+1
%endrep
const sw_64, dd 64
| 36.084337 | 90 | 0.608681 |
c93eb9fb91d9ab20715b8cab6c38bcb1aba708b9 | 150 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/fonts/kk/_ff_kk_MontereyBLatin1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/font/fzx/fonts/kk/_ff_kk_MontereyBLatin1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/font/fzx/fonts/kk/_ff_kk_MontereyBLatin1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION rodata_font
SECTION rodata_font_fzx
PUBLIC _ff_kk_MontereyBLatin1
_ff_kk_MontereyBLatin1:
BINARY "font/fzx/fonts/kk/MontereyB_Latin1.fzx"
| 15 | 47 | 0.86 |
a2be438b436fe1eff7af8cc6fa83cc37e8c8c9c4 | 795 | asm | Assembly | libsrc/target/laser500/games/joystick.asm | UnivEngineer/z88dk | 9047beba62595b1d88991bc934da75c0e2030d07 | [
"ClArtistic"
] | 1 | 2022-03-08T11:55:58.000Z | 2022-03-08T11:55:58.000Z | libsrc/target/laser500/games/joystick.asm | UnivEngineer/z88dk | 9047beba62595b1d88991bc934da75c0e2030d07 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/target/laser500/games/joystick.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null | ;
; Game device library for the Laser 500
;
; up = ~(inp(&h2b) & 1)
; down = ~(inp(&h2b) & 2)
; left = ~(inp(&h2b) & 4)
; right = ~(inp(&h2b) & 8)
; fire = ~(inp(&h2b) & 16)
; fire2 = ~(inp(&h27) & 16)
SECTION code_clib
PUBLIC joystick
PUBLIC _joystick
EXTERN get_psg
EXTERN joystick_inkey
.joystick
._joystick
;__FASTCALL__ : joystick no. in HL
ld a,l
ld hl,0
dec a
jp nz,joystick_inkey
; 0 = #define MOVE_RIGHT 1
; 1 = #define MOVE_LEFT 2
; 2 = #define MOVE_DOWN 4
; 3 = #define MOVE_UP 8
; 4 = #define MOVE_FIRE 16
; 5 = #define MOVE_FIRE2 32
got_it:
in a,($2b)
cpl
rra ;UP
rl l
rra ;DOWN
rl l
rra ;LEFT
rl l
rra ;RIGHT
rl l
rra
jr nc,not_fire1
set 4,l
not_fire1:
in a,($27)
bit 5,a
ret nz
set 5,l
ret
| 14.196429 | 39 | 0.579874 |
d0ba5af810265d24968915740b0f21ec95e4da49 | 1,661 | asm | Assembly | source/function/graphics/pixel.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | source/function/graphics/pixel.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | source/function/graphics/pixel.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | ; ********************************************************************************************
; ********************************************************************************************
;
; Name : pixel.asm
; Purpose : ..
; Created : 15th Nov 1991
; Updated : 4th Jan 2021
; Authors : Fred Bowen
;
; ********************************************************************************************
; ********************************************************************************************
; Return the color of a given X,Y pixel location on the drawscreen [910801]
; PIXEL (x,y)
pixel jsr CheckGraphicMode ; verify screen open
jsr PushParms ; preserve Graphics parameters & LINNUM [910820]
jsr getsad ; get x
sty GKI__parm1
sta GKI__parm2
jsr comsad ; get y
sty GKI__parm3
sta GKI__parm4
jsr chkcls ; check for closing parens
jsr ($8032) ; get Bitplane data at pixel (x,y), returned in .y
jsr sngflt ; go float 1 byte arg in .Y
jsr PopParms ; restore graphics parameters
rts
; ********************************************************************************************
;
; Date Changes
; ==== =======
;
; ********************************************************************************************
| 41.525 | 106 | 0.272125 |
c8d0b11e81c60a5465428517a4a8eb33151d6cb2 | 5,189 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_477.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_477.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_477.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1e26, %rsi
lea addresses_WT_ht+0x1e926, %rdi
clflush (%rdi)
nop
nop
add $7026, %rdx
mov $110, %rcx
rep movsq
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WC_ht+0x1778e, %r8
and %rdx, %rdx
mov (%r8), %r11d
nop
nop
nop
sub %rdx, %rdx
lea addresses_WT_ht+0x16df2, %rsi
lea addresses_normal_ht+0xb956, %rdi
nop
nop
nop
and %r9, %r9
mov $9, %rcx
rep movsl
nop
nop
nop
nop
sub $11839, %r8
lea addresses_WT_ht+0x123a6, %rsi
lea addresses_normal_ht+0x15986, %rdi
nop
sub $44699, %r12
mov $11, %rcx
rep movsl
nop
sub %r9, %r9
lea addresses_WT_ht+0x326, %r9
nop
nop
nop
add $25209, %r8
movw $0x6162, (%r9)
lfence
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %rax
push %rdi
push %rdx
push %rsi
// Faulty Load
lea addresses_normal+0x5026, %r15
add $3749, %rax
movups (%r15), %xmm0
vpextrq $0, %xmm0, %rdx
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rax
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 47.605505 | 2,999 | 0.662748 |
6facb3f46ef20286bed5af8687a870d6253dbdbb | 17,203 | asm | Assembly | lib/sse/aes128_cbc_enc_x8_sse.asm | dongbinghua/intel-ipsec-mb | c509234757d4d1a7683feb02765a5643396d670e | [
"BSD-3-Clause"
] | 174 | 2017-11-12T18:36:43.000Z | 2022-03-26T12:31:21.000Z | lib/sse/aes128_cbc_enc_x8_sse.asm | dongbinghua/intel-ipsec-mb | c509234757d4d1a7683feb02765a5643396d670e | [
"BSD-3-Clause"
] | 84 | 2017-12-28T10:45:46.000Z | 2022-03-31T19:06:44.000Z | lib/sse/aes128_cbc_enc_x8_sse.asm | dongbinghua/intel-ipsec-mb | c509234757d4d1a7683feb02765a5643396d670e | [
"BSD-3-Clause"
] | 70 | 2017-11-05T10:14:51.000Z | 2022-03-26T12:31:04.000Z | ;;
;; Copyright (c) 2012-2021, Intel Corporation
;;
;; 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.
;; * Neither the name of Intel Corporation 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.
;;
;;; Routine to do a 128 bit CBC AES encryption / CBC-MAC digest computation
;;; processes 8 buffers at a time, single data structure as input
;;; Updates In and Out pointers at end
%include "include/os.asm"
%include "include/mb_mgr_datastruct.asm"
%include "include/clear_regs.asm"
%include "include/cet.inc"
%macro PXOR2 2
movdqu XTMP, %2
pxor %1, XTMP
%endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; struct AES_ARGS {
;; void* in[8];
;; void* out[8];
;; UINT128* keys[8];
;; UINT128 IV[8];
;; }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; void aes_cbc_enc_128_x8(AES_ARGS *args, UINT64 len);
;; arg 1: ARG : addr of AES_ARGS structure
;; arg 2: LEN : len (in units of bytes)
struc STACK
_gpr_save: resq 8
_len: resq 1
endstruc
%define GPR_SAVE_AREA rsp + _gpr_save
%define LEN_AREA rsp + _len
%ifdef LINUX
%define arg1 rdi
%define arg2 rsi
%define arg3 rcx
%define arg4 rdx
%else
%define arg1 rcx
%define arg2 rdx
%define arg3 rdi
%define arg4 rsi
%endif
%define ARG arg1
%define LEN arg2
%define IDX rax
%define TMP rbx
%define KEYS0 arg3
%define KEYS1 arg4
%define KEYS2 rbp
%define KEYS3 r8
%define KEYS4 r9
%define KEYS5 r10
%define KEYS6 r11
%define KEYS7 r12
%define IN0 r13
%define IN2 r14
%define IN4 r15
%define IN6 LEN
%define XDATA0 xmm0
%define XDATA1 xmm1
%define XDATA2 xmm2
%define XDATA3 xmm3
%define XDATA4 xmm4
%define XDATA5 xmm5
%define XDATA6 xmm6
%define XDATA7 xmm7
%define XKEY0_3 xmm8
%define XKEY1_4 xmm9
%define XKEY2_5 xmm10
%define XKEY3_6 xmm11
%define XKEY4_7 xmm12
%define XKEY5_8 xmm13
%define XKEY6_9 xmm14
%define XTMP xmm15
mksection .text
align 32
%ifdef CBC_MAC
MKGLOBAL(aes128_cbc_mac_x8_sse,function,internal)
aes128_cbc_mac_x8_sse:
%else
MKGLOBAL(aes_cbc_enc_128_x8_sse,function,internal)
aes_cbc_enc_128_x8_sse:
%endif
endbranch64
sub rsp, STACK_size
mov [GPR_SAVE_AREA + 8*0], rbp
%ifdef CBC_MAC
mov [GPR_SAVE_AREA + 8*1], rbx
mov [GPR_SAVE_AREA + 8*2], r12
mov [GPR_SAVE_AREA + 8*3], r13
mov [GPR_SAVE_AREA + 8*4], r14
mov [GPR_SAVE_AREA + 8*5], r15
%ifndef LINUX
mov [GPR_SAVE_AREA + 8*6], rsi
mov [GPR_SAVE_AREA + 8*7], rdi
%endif
%endif
mov IDX, 16
mov [LEN_AREA], LEN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov IN0, [ARG + _aesarg_in + 8*0]
mov IN2, [ARG + _aesarg_in + 8*2]
mov IN4, [ARG + _aesarg_in + 8*4]
mov IN6, [ARG + _aesarg_in + 8*6]
mov TMP, [ARG + _aesarg_in + 8*1]
movdqu XDATA0, [IN0] ; load first block of plain text
movdqu XDATA1, [TMP] ; load first block of plain text
mov TMP, [ARG + _aesarg_in + 8*3]
movdqu XDATA2, [IN2] ; load first block of plain text
movdqu XDATA3, [TMP] ; load first block of plain text
mov TMP, [ARG + _aesarg_in + 8*5]
movdqu XDATA4, [IN4] ; load first block of plain text
movdqu XDATA5, [TMP] ; load first block of plain text
mov TMP, [ARG + _aesarg_in + 8*7]
movdqu XDATA6, [IN6] ; load first block of plain text
movdqu XDATA7, [TMP] ; load first block of plain text
pxor XDATA0, [ARG + _aesarg_IV + 16*0] ; plaintext XOR IV
pxor XDATA1, [ARG + _aesarg_IV + 16*1] ; plaintext XOR IV
pxor XDATA2, [ARG + _aesarg_IV + 16*2] ; plaintext XOR IV
pxor XDATA3, [ARG + _aesarg_IV + 16*3] ; plaintext XOR IV
pxor XDATA4, [ARG + _aesarg_IV + 16*4] ; plaintext XOR IV
pxor XDATA5, [ARG + _aesarg_IV + 16*5] ; plaintext XOR IV
pxor XDATA6, [ARG + _aesarg_IV + 16*6] ; plaintext XOR IV
pxor XDATA7, [ARG + _aesarg_IV + 16*7] ; plaintext XOR IV
mov KEYS0, [ARG + _aesarg_keys + 8*0]
mov KEYS1, [ARG + _aesarg_keys + 8*1]
mov KEYS2, [ARG + _aesarg_keys + 8*2]
mov KEYS3, [ARG + _aesarg_keys + 8*3]
mov KEYS4, [ARG + _aesarg_keys + 8*4]
mov KEYS5, [ARG + _aesarg_keys + 8*5]
mov KEYS6, [ARG + _aesarg_keys + 8*6]
mov KEYS7, [ARG + _aesarg_keys + 8*7]
pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK
pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK
pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK
pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK
pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK
pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK
pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK
pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK
aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC
aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC
aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC
aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC
aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC
aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC
aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC
aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC
movdqa XKEY0_3, [KEYS0 + 16*3] ; load round 3 key
aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC
aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC
aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC
aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC
aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC
aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC
aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC
aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC
movdqa XKEY1_4, [KEYS1 + 16*4] ; load round 4 key
aesenc XDATA0, XKEY0_3 ; 3. ENC
aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC
aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC
aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC
aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC
aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC
aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC
aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC
aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC
movdqa XKEY2_5, [KEYS2 + 16*5] ; load round 5 key
aesenc XDATA1, XKEY1_4 ; 4. ENC
aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC
aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC
aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC
aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC
aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC
aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC
aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC
aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC
movdqa XKEY3_6, [KEYS3 + 16*6] ; load round 6 key
aesenc XDATA2, XKEY2_5 ; 5. ENC
aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC
aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC
aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC
aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC
aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC
aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC
aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC
aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC
movdqa XKEY4_7, [KEYS4 + 16*7] ; load round 7 key
aesenc XDATA3, XKEY3_6 ; 6. ENC
aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC
aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC
aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC
aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC
aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC
aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC
aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC
aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC
movdqa XKEY5_8, [KEYS5 + 16*8] ; load round 8 key
aesenc XDATA4, XKEY4_7 ; 7. ENC
aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC
aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC
aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC
aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC
aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC
aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC
aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC
aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC
movdqa XKEY6_9, [KEYS6 + 16*9] ; load round 9 key
aesenc XDATA5, XKEY5_8 ; 8. ENC
aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC
aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC
aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC
aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC
aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC
aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC
aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC
aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC
mov TMP, [ARG + _aesarg_out + 8*0]
aesenc XDATA6, XKEY6_9 ; 9. ENC
aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC
aesenclast XDATA0, [KEYS0 + 16*10] ; 10. ENC
aesenclast XDATA1, [KEYS1 + 16*10] ; 10. ENC
aesenclast XDATA2, [KEYS2 + 16*10] ; 10. ENC
aesenclast XDATA3, [KEYS3 + 16*10] ; 10. ENC
aesenclast XDATA4, [KEYS4 + 16*10] ; 10. ENC
aesenclast XDATA5, [KEYS5 + 16*10] ; 10. ENC
aesenclast XDATA6, [KEYS6 + 16*10] ; 10. ENC
aesenclast XDATA7, [KEYS7 + 16*10] ; 10. ENC
%ifndef CBC_MAC
movdqu [TMP], XDATA0 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*1]
movdqu [TMP], XDATA1 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*2]
movdqu [TMP], XDATA2 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*3]
movdqu [TMP], XDATA3 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*4]
movdqu [TMP], XDATA4 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*5]
movdqu [TMP], XDATA5 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*6]
movdqu [TMP], XDATA6 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*7]
movdqu [TMP], XDATA7 ; write back ciphertext
%endif
cmp [LEN_AREA], IDX
je done
main_loop:
mov TMP, [ARG + _aesarg_in + 8*1]
PXOR2 XDATA0, [IN0 + IDX] ; load next block of plain text
PXOR2 XDATA1, [TMP + IDX] ; load next block of plain text
mov TMP, [ARG + _aesarg_in + 8*3]
PXOR2 XDATA2, [IN2 + IDX] ; load next block of plain text
PXOR2 XDATA3, [TMP + IDX] ; load next block of plain text
mov TMP, [ARG + _aesarg_in + 8*5]
PXOR2 XDATA4, [IN4 + IDX] ; load next block of plain text
PXOR2 XDATA5, [TMP + IDX] ; load next block of plain text
mov TMP, [ARG + _aesarg_in + 8*7]
PXOR2 XDATA6, [IN6 + IDX] ; load next block of plain text
PXOR2 XDATA7, [TMP + IDX] ; load next block of plain text
pxor XDATA0, [KEYS0 + 16*0] ; 0. ARK
pxor XDATA1, [KEYS1 + 16*0] ; 0. ARK
pxor XDATA2, [KEYS2 + 16*0] ; 0. ARK
pxor XDATA3, [KEYS3 + 16*0] ; 0. ARK
pxor XDATA4, [KEYS4 + 16*0] ; 0. ARK
pxor XDATA5, [KEYS5 + 16*0] ; 0. ARK
pxor XDATA6, [KEYS6 + 16*0] ; 0. ARK
pxor XDATA7, [KEYS7 + 16*0] ; 0. ARK
aesenc XDATA0, [KEYS0 + 16*1] ; 1. ENC
aesenc XDATA1, [KEYS1 + 16*1] ; 1. ENC
aesenc XDATA2, [KEYS2 + 16*1] ; 1. ENC
aesenc XDATA3, [KEYS3 + 16*1] ; 1. ENC
aesenc XDATA4, [KEYS4 + 16*1] ; 1. ENC
aesenc XDATA5, [KEYS5 + 16*1] ; 1. ENC
aesenc XDATA6, [KEYS6 + 16*1] ; 1. ENC
aesenc XDATA7, [KEYS7 + 16*1] ; 1. ENC
aesenc XDATA0, [KEYS0 + 16*2] ; 2. ENC
aesenc XDATA1, [KEYS1 + 16*2] ; 2. ENC
aesenc XDATA2, [KEYS2 + 16*2] ; 2. ENC
aesenc XDATA3, [KEYS3 + 16*2] ; 2. ENC
aesenc XDATA4, [KEYS4 + 16*2] ; 2. ENC
aesenc XDATA5, [KEYS5 + 16*2] ; 2. ENC
aesenc XDATA6, [KEYS6 + 16*2] ; 2. ENC
aesenc XDATA7, [KEYS7 + 16*2] ; 2. ENC
aesenc XDATA0, XKEY0_3 ; 3. ENC
aesenc XDATA1, [KEYS1 + 16*3] ; 3. ENC
aesenc XDATA2, [KEYS2 + 16*3] ; 3. ENC
aesenc XDATA3, [KEYS3 + 16*3] ; 3. ENC
aesenc XDATA4, [KEYS4 + 16*3] ; 3. ENC
aesenc XDATA5, [KEYS5 + 16*3] ; 3. ENC
aesenc XDATA6, [KEYS6 + 16*3] ; 3. ENC
aesenc XDATA7, [KEYS7 + 16*3] ; 3. ENC
aesenc XDATA0, [KEYS0 + 16*4] ; 4. ENC
aesenc XDATA1, XKEY1_4 ; 4. ENC
aesenc XDATA2, [KEYS2 + 16*4] ; 4. ENC
aesenc XDATA3, [KEYS3 + 16*4] ; 4. ENC
aesenc XDATA4, [KEYS4 + 16*4] ; 4. ENC
aesenc XDATA5, [KEYS5 + 16*4] ; 4. ENC
aesenc XDATA6, [KEYS6 + 16*4] ; 4. ENC
aesenc XDATA7, [KEYS7 + 16*4] ; 4. ENC
aesenc XDATA0, [KEYS0 + 16*5] ; 5. ENC
aesenc XDATA1, [KEYS1 + 16*5] ; 5. ENC
aesenc XDATA2, XKEY2_5 ; 5. ENC
aesenc XDATA3, [KEYS3 + 16*5] ; 5. ENC
aesenc XDATA4, [KEYS4 + 16*5] ; 5. ENC
aesenc XDATA5, [KEYS5 + 16*5] ; 5. ENC
aesenc XDATA6, [KEYS6 + 16*5] ; 5. ENC
aesenc XDATA7, [KEYS7 + 16*5] ; 5. ENC
aesenc XDATA0, [KEYS0 + 16*6] ; 6. ENC
aesenc XDATA1, [KEYS1 + 16*6] ; 6. ENC
aesenc XDATA2, [KEYS2 + 16*6] ; 6. ENC
aesenc XDATA3, XKEY3_6 ; 6. ENC
aesenc XDATA4, [KEYS4 + 16*6] ; 6. ENC
aesenc XDATA5, [KEYS5 + 16*6] ; 6. ENC
aesenc XDATA6, [KEYS6 + 16*6] ; 6. ENC
aesenc XDATA7, [KEYS7 + 16*6] ; 6. ENC
aesenc XDATA0, [KEYS0 + 16*7] ; 7. ENC
aesenc XDATA1, [KEYS1 + 16*7] ; 7. ENC
aesenc XDATA2, [KEYS2 + 16*7] ; 7. ENC
aesenc XDATA3, [KEYS3 + 16*7] ; 7. ENC
aesenc XDATA4, XKEY4_7 ; 7. ENC
aesenc XDATA5, [KEYS5 + 16*7] ; 7. ENC
aesenc XDATA6, [KEYS6 + 16*7] ; 7. ENC
aesenc XDATA7, [KEYS7 + 16*7] ; 7. ENC
aesenc XDATA0, [KEYS0 + 16*8] ; 8. ENC
aesenc XDATA1, [KEYS1 + 16*8] ; 8. ENC
aesenc XDATA2, [KEYS2 + 16*8] ; 8. ENC
aesenc XDATA3, [KEYS3 + 16*8] ; 8. ENC
aesenc XDATA4, [KEYS4 + 16*8] ; 8. ENC
aesenc XDATA5, XKEY5_8 ; 8. ENC
aesenc XDATA6, [KEYS6 + 16*8] ; 8. ENC
aesenc XDATA7, [KEYS7 + 16*8] ; 8. ENC
aesenc XDATA0, [KEYS0 + 16*9] ; 9. ENC
aesenc XDATA1, [KEYS1 + 16*9] ; 9. ENC
aesenc XDATA2, [KEYS2 + 16*9] ; 9. ENC
aesenc XDATA3, [KEYS3 + 16*9] ; 9. ENC
aesenc XDATA4, [KEYS4 + 16*9] ; 9. ENC
aesenc XDATA5, [KEYS5 + 16*9] ; 9. ENC
mov TMP, [ARG + _aesarg_out + 8*0]
aesenc XDATA6, XKEY6_9 ; 9. ENC
aesenc XDATA7, [KEYS7 + 16*9] ; 9. ENC
aesenclast XDATA0, [KEYS0 + 16*10] ; 10. ENC
aesenclast XDATA1, [KEYS1 + 16*10] ; 10. ENC
aesenclast XDATA2, [KEYS2 + 16*10] ; 10. ENC
aesenclast XDATA3, [KEYS3 + 16*10] ; 10. ENC
aesenclast XDATA4, [KEYS4 + 16*10] ; 10. ENC
aesenclast XDATA5, [KEYS5 + 16*10] ; 10. ENC
aesenclast XDATA6, [KEYS6 + 16*10] ; 10. ENC
aesenclast XDATA7, [KEYS7 + 16*10] ; 10. ENC
%ifndef CBC_MAC
;; no ciphertext write back for CBC-MAC
movdqu [TMP + IDX], XDATA0 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*1]
movdqu [TMP + IDX], XDATA1 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*2]
movdqu [TMP + IDX], XDATA2 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*3]
movdqu [TMP + IDX], XDATA3 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*4]
movdqu [TMP + IDX], XDATA4 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*5]
movdqu [TMP + IDX], XDATA5 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*6]
movdqu [TMP + IDX], XDATA6 ; write back ciphertext
mov TMP, [ARG + _aesarg_out + 8*7]
movdqu [TMP + IDX], XDATA7 ; write back ciphertext
%endif
add IDX, 16
cmp [LEN_AREA], IDX
jne main_loop
done:
;; update IV for AES128-CBC / store digest for CBC-MAC
movdqa [ARG + _aesarg_IV + 16*0], XDATA0
movdqa [ARG + _aesarg_IV + 16*1], XDATA1
movdqa [ARG + _aesarg_IV + 16*2], XDATA2
movdqa [ARG + _aesarg_IV + 16*3], XDATA3
movdqa [ARG + _aesarg_IV + 16*4], XDATA4
movdqa [ARG + _aesarg_IV + 16*5], XDATA5
movdqa [ARG + _aesarg_IV + 16*6], XDATA6
movdqa [ARG + _aesarg_IV + 16*7], XDATA7
;; update IN and OUT
movd xmm0, [LEN_AREA]
pshufd xmm0, xmm0, 0x44
movdqa xmm1, xmm0
paddq xmm1, [ARG + _aesarg_in + 16*0]
movdqa xmm2, xmm0
paddq xmm2, [ARG + _aesarg_in + 16*1]
movdqa xmm3, xmm0
paddq xmm3, [ARG + _aesarg_in + 16*2]
movdqa xmm4, xmm0
paddq xmm4, [ARG + _aesarg_in + 16*3]
movdqa [ARG + _aesarg_in + 16*0], xmm1
movdqa [ARG + _aesarg_in + 16*1], xmm2
movdqa [ARG + _aesarg_in + 16*2], xmm3
movdqa [ARG + _aesarg_in + 16*3], xmm4
%ifndef CBC_MAC
movdqa xmm5, xmm0
paddq xmm5, [ARG + _aesarg_out + 16*0]
movdqa xmm6, xmm0
paddq xmm6, [ARG + _aesarg_out + 16*1]
movdqa xmm7, xmm0
paddq xmm7, [ARG + _aesarg_out + 16*2]
movdqa xmm8, xmm0
paddq xmm8, [ARG + _aesarg_out + 16*3]
movdqa [ARG + _aesarg_out + 16*0], xmm5
movdqa [ARG + _aesarg_out + 16*1], xmm6
movdqa [ARG + _aesarg_out + 16*2], xmm7
movdqa [ARG + _aesarg_out + 16*3], xmm8
%endif
;; XMMs are saved at a higher level
mov rbp, [GPR_SAVE_AREA + 8*0]
%ifdef CBC_MAC
mov rbx, [GPR_SAVE_AREA + 8*1]
mov r12, [GPR_SAVE_AREA + 8*2]
mov r13, [GPR_SAVE_AREA + 8*3]
mov r14, [GPR_SAVE_AREA + 8*4]
mov r15, [GPR_SAVE_AREA + 8*5]
%ifndef LINUX
mov rsi, [GPR_SAVE_AREA + 8*6]
mov rdi, [GPR_SAVE_AREA + 8*7]
%endif
%endif
add rsp, STACK_size
%ifdef SAFE_DATA
clear_all_xmms_sse_asm
%endif ;; SAFE_DATA
ret
mksection stack-noexec
| 33.930966 | 81 | 0.633204 |
3a7ba558200b9a3d3677d648d5806a8b2a755fa9 | 1,481 | asm | Assembly | programs/oeis/000/A000124.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/000/A000124.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/000/A000124.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A000124: Central polygonal numbers (the Lazy Caterer's sequence): n(n+1)/2 + 1; or, maximal number of pieces formed when slicing a pancake with n cuts.
; 1,2,4,7,11,16,22,29,37,46,56,67,79,92,106,121,137,154,172,191,211,232,254,277,301,326,352,379,407,436,466,497,529,562,596,631,667,704,742,781,821,862,904,947,991,1036,1082,1129,1177,1226,1276,1327,1379,1432,1486,1541,1597,1654,1712,1771,1831,1892,1954,2017,2081,2146,2212,2279,2347,2416,2486,2557,2629,2702,2776,2851,2927,3004,3082,3161,3241,3322,3404,3487,3571,3656,3742,3829,3917,4006,4096,4187,4279,4372,4466,4561,4657,4754,4852,4951,5051,5152,5254,5357,5461,5566,5672,5779,5887,5996,6106,6217,6329,6442,6556,6671,6787,6904,7022,7141,7261,7382,7504,7627,7751,7876,8002,8129,8257,8386,8516,8647,8779,8912,9046,9181,9317,9454,9592,9731,9871,10012,10154,10297,10441,10586,10732,10879,11027,11176,11326,11477,11629,11782,11936,12091,12247,12404,12562,12721,12881,13042,13204,13367,13531,13696,13862,14029,14197,14366,14536,14707,14879,15052,15226,15401,15577,15754,15932,16111,16291,16472,16654,16837,17021,17206,17392,17579,17767,17956,18146,18337,18529,18722,18916,19111,19307,19504,19702,19901,20101,20302,20504,20707,20911,21116,21322,21529,21737,21946,22156,22367,22579,22792,23006,23221,23437,23654,23872,24091,24311,24532,24754,24977,25201,25426,25652,25879,26107,26336,26566,26797,27029,27262,27496,27731,27967,28204,28442,28681,28921,29162,29404,29647,29891,30136,30382,30629,30877,31126
sub $1,$0
bin $1,2
add $1,1
| 211.571429 | 1,297 | 0.794058 |
f7e4fdfa1d7a69c3d177d2dfdbb5b6126b8ddddb | 20,693 | asm | Assembly | resources/retrogamedev.chapters/chapter17/libScreen.asm | brawnydawg/retrojam4 | 28293e3348cdf5b2d844438689f43a8853e3508d | [
"MIT"
] | null | null | null | resources/retrogamedev.chapters/chapter17/libScreen.asm | brawnydawg/retrojam4 | 28293e3348cdf5b2d844438689f43a8853e3508d | [
"MIT"
] | null | null | null | resources/retrogamedev.chapters/chapter17/libScreen.asm | brawnydawg/retrojam4 | 28293e3348cdf5b2d844438689f43a8853e3508d | [
"MIT"
] | null | null | null | ;===============================================================================
; Constants
Black = 0
White = 1
Red = 2
Cyan = 3
Purple = 4
Green = 5
Blue = 6
Yellow = 7
Orange = 8
Brown = 9
LightRed = 10
DarkGray = 11
MediumGray = 12
LightGreen = 13
LightBlue = 14
LightGray = 15
SpaceCharacter = 32
False = 0
True = 1
;===============================================================================
; Variables
Operator Calc
ScreenRAMRowStartLow ; SCREENRAM + 40*0, 40*1, 40*2 ... 40*24
byte <SCREENRAM, <SCREENRAM+40, <SCREENRAM+80
byte <SCREENRAM+120, <SCREENRAM+160, <SCREENRAM+200
byte <SCREENRAM+240, <SCREENRAM+280, <SCREENRAM+320
byte <SCREENRAM+360, <SCREENRAM+400, <SCREENRAM+440
byte <SCREENRAM+480, <SCREENRAM+520, <SCREENRAM+560
byte <SCREENRAM+600, <SCREENRAM+640, <SCREENRAM+680
byte <SCREENRAM+720, <SCREENRAM+760, <SCREENRAM+800
byte <SCREENRAM+840, <SCREENRAM+880, <SCREENRAM+920
byte <SCREENRAM+960
ScreenRAMRowStartHigh ; SCREENRAM + 40*0, 40*1, 40*2 ... 40*24
byte >SCREENRAM, >SCREENRAM+40, >SCREENRAM+80
byte >SCREENRAM+120, >SCREENRAM+160, >SCREENRAM+200
byte >SCREENRAM+240, >SCREENRAM+280, >SCREENRAM+320
byte >SCREENRAM+360, >SCREENRAM+400, >SCREENRAM+440
byte >SCREENRAM+480, >SCREENRAM+520, >SCREENRAM+560
byte >SCREENRAM+600, >SCREENRAM+640, >SCREENRAM+680
byte >SCREENRAM+720, >SCREENRAM+760, >SCREENRAM+800
byte >SCREENRAM+840, >SCREENRAM+880, >SCREENRAM+920
byte >SCREENRAM+960
ColorRAMRowStartLow ; COLORRAM + 40*0, 40*1, 40*2 ... 40*24
byte <COLORRAM, <COLORRAM+40, <COLORRAM+80
byte <COLORRAM+120, <COLORRAM+160, <COLORRAM+200
byte <COLORRAM+240, <COLORRAM+280, <COLORRAM+320
byte <COLORRAM+360, <COLORRAM+400, <COLORRAM+440
byte <COLORRAM+480, <COLORRAM+520, <COLORRAM+560
byte <COLORRAM+600, <COLORRAM+640, <COLORRAM+680
byte <COLORRAM+720, <COLORRAM+760, <COLORRAM+800
byte <COLORRAM+840, <COLORRAM+880, <COLORRAM+920
byte <COLORRAM+960
ColorRAMRowStartHigh ; COLORRAM + 40*0, 40*1, 40*2 ... 40*24
byte >COLORRAM, >COLORRAM+40, >COLORRAM+80
byte >COLORRAM+120, >COLORRAM+160, >COLORRAM+200
byte >COLORRAM+240, >COLORRAM+280, >COLORRAM+320
byte >COLORRAM+360, >COLORRAM+400, >COLORRAM+440
byte >COLORRAM+480, >COLORRAM+520, >COLORRAM+560
byte >COLORRAM+600, >COLORRAM+640, >COLORRAM+680
byte >COLORRAM+720, >COLORRAM+760, >COLORRAM+800
byte >COLORRAM+840, >COLORRAM+880, >COLORRAM+920
byte >COLORRAM+960
Operator HiLo
screenColumn byte 0
screenScrollXValue byte 0
;===============================================================================
; Macros/Subroutines
defm LIBSCREEN_COPYMAPROW_VVA ; /1 = Map Row (Value)
; /2 = Screen Row (Value)
; /3 = Start Offset (Address)
lda #/1
sta ZeroPageParam1
lda #/2
sta ZeroPageParam2
lda /3
sta ZeroPageParam3
jsr libScreen_CopyMapRow
endm
libScreen_CopyMapRow
ldy ZeroPageParam1 ; load y position as index into list
lda MapRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow2
lda MapRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh2
; add on the offset to the map address
LIBMATH_ADD16BIT_AAVAAA ZeroPageHigh2, ZeroPageLow2, 0, ZeroPageParam3, ZeroPageHigh2, ZeroPageLow2
ldy ZeroPageParam2 ; load y position as index into list
lda ScreenRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ScreenRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy #0
lSCMRLoop
lda (ZeroPageLow2),y
sta (ZeroPageLow),y
iny
cpy #39
bne lSCMRLoop
rts
;==============================================================================
defm LIBSCREEN_COPYMAPROWCOLOR_VVA ; /1 = Map Row (Value)
; /2 = Screen Row (Value)
; /3 = Start Offset (Address)
lda #/1
sta ZeroPageParam1
lda #/2
sta ZeroPageParam2
lda /3
sta ZeroPageParam3
jsr libScreen_CopyMapRowColor
endm
libScreen_CopyMapRowColor
ldy ZeroPageParam1 ; load y position as index into list
lda MapRAMCOLRowStartLow,Y ; load low address byte
sta ZeroPageLow2
lda MapRAMCOLRowStartHigh,Y ; load high address byte
sta ZeroPageHigh2
; add on the offset to the map address
LIBMATH_ADD16BIT_AAVAAA ZeroPageHigh2, ZeroPageLow2, 0, ZeroPageParam3, ZeroPageHigh2, ZeroPageLow2
ldy ZeroPageParam2 ; load y position as index into list
lda ColorRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ColorRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy #0
lSCMRCLoop
lda (ZeroPageLow2),y
ora #%00001000 ; set multicolor bit
sta (ZeroPageLow),y
iny
cpy #39
bne lSCMRCLoop
rts
;===============================================================================
defm LIBSCREEN_DEBUG8BIT_VVA
; /1 = X Position Absolute
; /2 = Y Position Absolute
; /3 = 1st Number Low Byte Pointer
lda #White
sta $0286 ; set text color
lda #$20 ; space
jsr $ffd2 ; print 4 spaces
jsr $ffd2
jsr $ffd2
jsr $ffd2
;jsr $E566 ; reset cursor
ldx #/2 ; Select row
ldy #/1 ; Select column
jsr $E50C ; Set cursor
lda #0
ldx /3
jsr $BDCD ; print number
endm
;===============================================================================
defm LIBSCREEN_DEBUG16BIT_VVAA
; /1 = X Position Absolute
; /2 = Y Position Absolute
; /3 = 1st Number High Byte Pointer
; /4 = 1st Number Low Byte Pointer
lda #White
sta $0286 ; set text color
lda #$20 ; space
jsr $ffd2 ; print 4 spaces
jsr $ffd2
jsr $ffd2
jsr $ffd2
;jsr $E566 ; reset cursor
ldx #/2 ; Select row
ldy #/1 ; Select column
jsr $E50C ; Set cursor
lda /3
ldx /4
jsr $BDCD ; print number
endm
;==============================================================================
defm LIBSCREEN_DRAWTEXT_AAAV ; /1 = X Position 0-39 (Address)
; /2 = Y Position 0-24 (Address)
; /3 = 0 terminated string (Address)
; /4 = Text Color (Value)
ldy /2 ; load y position as index into list
lda ScreenRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ScreenRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy /1 ; load x position into Y register
ldx #0
@loop lda /3,X
cmp #0
beq @done
sta (ZeroPageLow),Y
inx
iny
jmp @loop
@done
ldy /2 ; load y position as index into list
lda ColorRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ColorRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy /1 ; load x position into Y register
ldx #0
@loop2 lda /3,X
cmp #0
beq @done2
lda #/4
sta (ZeroPageLow),Y
inx
iny
jmp @loop2
@done2
endm
;===============================================================================
defm LIBSCREEN_DRAWDECIMAL_AAAV ; /1 = X Position 0-39 (Address)
; /2 = Y Position 0-24 (Address)
; /3 = decimal number 2 nybbles (Address)
; /4 = Text Color (Value)
ldy /2 ; load y position as index into list
lda ScreenRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ScreenRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy /1 ; load x position into Y register
; get high nybble
lda /3
and #$F0
; convert to ascii
lsr
lsr
lsr
lsr
ora #$30
sta (ZeroPageLow),Y
; move along to next screen position
iny
; get low nybble
lda /3
and #$0F
; convert to ascii
ora #$30
sta (ZeroPageLow),Y
; now set the colors
ldy /2 ; load y position as index into list
lda ColorRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ColorRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy /1 ; load x position into Y register
lda #/4
sta (ZeroPageLow),Y
; move along to next screen position
iny
sta (ZeroPageLow),Y
endm
;==============================================================================
defm LIBSCREEN_GETCHAR ; /1 = Return character code (Address)
lda (ZeroPageLow),Y
sta /1
endm
;===============================================================================
defm LIBSCREEN_PIXELTOCHAR_AAVAVAAAA
; /1 = XHighPixels (Address)
; /2 = XLowPixels (Address)
; /3 = XAdjust (Value)
; /4 = YPixels (Address)
; /5 = YAdjust (Value)
; /6 = XChar (Address)
; /7 = XOffset (Address)
; /8 = YChar (Address)
; /9 = YOffset (Address)
lda /1
sta ZeroPageParam1
lda /2
sta ZeroPageParam2
lda #/3
sta ZeroPageParam3
lda /4
sta ZeroPageParam4
lda #/5
sta ZeroPageParam5
jsr libScreen_PixelToChar
lda ZeroPageParam6
sta /6
lda ZeroPageParam7
sta /7
lda ZeroPageParam8
sta /8
lda ZeroPageParam9
sta /9
endm
libScreen_PixelToChar
; subtract XAdjust pixels from XPixels as left of a sprite is first visible at x = 24
LIBMATH_SUB16BIT_AAVAAA ZeroPageParam1, ZeroPageParam2, 0, ZeroPageParam3, ZeroPageParam6, ZeroPageParam7
lda ZeroPageParam6
sta ZeroPageTemp
; divide by 8 to get character X
lda ZeroPageParam7
lsr A ; divide by 2
lsr A ; and again = /4
lsr A ; and again = /8
sta ZeroPageParam6
; AND 7 to get pixel offset X
lda ZeroPageParam7
and #7
sta ZeroPageParam7
; Adjust for XHigh
lda ZeroPageTemp
beq @nothigh
LIBMATH_ADD8BIT_AVA ZeroPageParam6, 32, ZeroPageParam6 ; shift across 32 chars
@nothigh
; subtract YAdjust pixels from YPixels as top of a sprite is first visible at y = 50
LIBMATH_SUB8BIT_AAA ZeroPageParam4, ZeroPageParam5, ZeroPageParam9
; divide by 8 to get character Y
lda ZeroPageParam9
lsr A ; divide by 2
lsr A ; and again = /4
lsr A ; and again = /8
sta ZeroPageParam8
; AND 7 to get pixel offset Y
lda ZeroPageParam9
and #7
sta ZeroPageParam9
rts
;==============================================================================
defm LIBSCREEN_SCROLLXLEFT_A ; /1 = update subroutine (Address)
dec screenScrollXValue
lda screenScrollXValue
and #%00000111
sta screenScrollXValue
lda SCROLX
and #%11111000
ora screenScrollXValue
sta SCROLX
lda screenScrollXValue
cmp #7
bne @finished
; move to next column
inc screenColumn
jsr /1 ; call the passed in function to update the screen rows
@finished
endm
;==============================================================================
defm LIBSCREEN_SCROLLXRIGHT_A ; /1 = update subroutine (Address)
inc screenScrollXValue
lda screenScrollXValue
and #%00000111
sta screenScrollXValue
lda SCROLX
and #%11111000
ora screenScrollXValue
sta SCROLX
lda screenScrollXValue
cmp #0
bne @finished
; move to previous column
dec screenColumn
jsr /1 ; call the passed in function to update the screen rows
@finished
endm
;==============================================================================
defm LIBSCREEN_SCROLLXRESET_A ; /1 = update subroutine (Address)
lda #0
sta screenColumn
sta screenScrollXValue
lda SCROLX
and #%11111000
ora screenScrollXValue
sta SCROLX
jsr /1 ; call the passed in function to update the screen rows
endm
;==============================================================================
defm LIBSCREEN_SETSCROLLXVALUE_A ; /1 = ScrollX value (Address)
lda SCROLX
and #%11111000
ora /1
sta SCROLX
endm
;==============================================================================
defm LIBSCREEN_SETSCROLLXVALUE_V ; /1 = ScrollX value (Value)
lda SCROLX
and #%11111000
ora #/1
sta SCROLX
endm
;==============================================================================
; Sets 1000 bytes of memory from start address with a value
defm LIBSCREEN_SET1000 ; /1 = Start (Address)
; /2 = Number (Value)
lda #/2 ; Get number to set
ldx #250 ; Set loop value
@loop dex ; Step -1
sta /1,x ; Set start + x
sta /1+250,x ; Set start + 250 + x
sta /1+500,x ; Set start + 500 + x
sta /1+750,x ; Set start + 750 + x
bne @loop ; If x<>0 loop
endm
;==============================================================================
defm LIBSCREEN_SET38COLUMNMODE
lda SCROLX
and #%11110111 ; clear bit 3
sta SCROLX
endm
;==============================================================================
defm LIBSCREEN_SET40COLUMNMODE
lda SCROLX
ora #%00001000 ; set bit 3
sta SCROLX
endm
;==============================================================================
defm LIBSCREEN_SETCHARMEMORY ; /1 = Character Memory Slot (Value)
; point vic (lower 4 bits of $d018)to new character data
lda VMCSB
and #%11110000 ; keep higher 4 bits
; p208 M Jong book
ora #/1;$0E ; maps to $3800 memory address
sta VMCSB
endm
;==============================================================================
defm LIBSCREEN_SETCHAR_V ; /1 = Character Code (Value)
lda #/1
sta (ZeroPageLow),Y
endm
;==============================================================================
defm LIBSCREEN_SETCHAR_A ; /1 = Character Code (Address)
lda /1
sta (ZeroPageLow),Y
endm
;==============================================================================
defm LIBSCREEN_SETCHARPOSITION_AA ; /1 = X Position 0-39 (Address)
; /2 = Y Position 0-24 (Address)
ldy /2 ; load y position as index into list
lda ScreenRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ScreenRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy /1 ; load x position into Y register
endm
;==============================================================================
defm LIBSCREEN_SETCOLORPOSITION_AA ; /1 = X Position 0-39 (Address)
; /2 = Y Position 0-24 (Address)
ldy /2 ; load y position as index into list
lda ColorRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda ColorRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
ldy /1 ; load x position into Y register
endm
;===============================================================================
; Sets the border and background colors
defm LIBSCREEN_SETCOLORS ; /1 = Border Color (Value)
; /2 = Background Color 0 (Value)
; /3 = Background Color 1 (Value)
; /4 = Background Color 2 (Value)
; /5 = Background Color 3 (Value)
lda #/1 ; Color0 -> A
sta EXTCOL ; A -> EXTCOL
lda #/2 ; Color1 -> A
sta BGCOL0 ; A -> BGCOL0
lda #/3 ; Color2 -> A
sta BGCOL1 ; A -> BGCOL1
lda #/4 ; Color3 -> A
sta BGCOL2 ; A -> BGCOL2
lda #/5 ; Color4 -> A
sta BGCOL3 ; A -> BGCOL3
endm
;==============================================================================
defm LIBSCREEN_SETMAPCHAR_VAAV ; /1 = Map Row (Value)
; /2 = Screen Offset (Address)
; /3 = Char Offset (Address)
; /4 = Character (Value)
lda #/1
sta ZeroPageParam1
lda /2
sta ZeroPageParam2
lda /3
sta ZeroPageParam3
lda #/4
sta ZeroPageParam4
jsr libScreen_SetMapChar
endm
libScreen_SetMapChar
ldy ZeroPageParam1 ; load y position as index into list
lda MapRAMRowStartLow,Y ; load low address byte
sta ZeroPageLow
lda MapRAMRowStartHigh,Y ; load high address byte
sta ZeroPageHigh
; add on the screen offset to the map address
LIBMATH_ADD16BIT_AAVAAA ZeroPageHigh, ZeroPageLow, 0, ZeroPageParam2, ZeroPageHigh, ZeroPageLow
; set the char
lda ZeroPageParam4
ldy ZeroPageParam3 ; index with the char offset
sta (ZeroPageLow),y
rts
;==============================================================================
defm LIBSCREEN_SETMULTICOLORMODE
lda SCROLX
ora #%00010000 ; set bit 5
sta SCROLX
endm
;===============================================================================
; Waits for a given scanline
defm LIBSCREEN_WAIT_V ; /1 = Scanline (Value)
@loop lda #/1 ; Scanline -> A
cmp RASTER ; Compare A to current raster line
bne @loop ; Loop if raster line not reached 255
endm
| 30.297218 | 114 | 0.455806 |
47f6094e714b5c95fec0f9e6304e1e1f22fe66ee | 681 | asm | Assembly | untested/x86/lcmArray.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/x86/lcmArray.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/x86/lcmArray.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | %include "macros.inc"
global _lcmArray
segment .text align=16
_lcmArray:
multipush edi, esi, ebx
mov eax, [esp + 16]
mov edx, [esp + 20]
mov ecx, [eax]
cmp edx, 1
jle .returnEcx
lea ebx, [eax + 4]
lea edi, [eax + edx * 4]
.loop:
mov eax, [ebx]
mov esi, eax
imul esi, ecx
test ecx, ecx
jne .notZero
jmp .zero
align 16
.gcdLoop:
mov ecx, edx
.notZero:
cdq
idiv ecx
mov eax, ecx
test edx, edx
jne .gcdLoop
mov eax, esi
cdq
idiv ecx
mov ecx, eax
.checkForLoop:
add ebx, 4
cmp edi, ebx
jne .loop
.returnEcx:
multipop edi, esi, ebx
mov eax, ecx
ret
align 16
.zero:
add ebx, 4
cmp ebx, edi
jne .checkForLoop
jmp .returnEcx | 10.809524 | 25 | 0.634361 |
c9f12412359c8a7e2342497042e954cbdc44f472 | 3,269 | asm | Assembly | Library/SpecUI/CommonUI/CWin/cwinManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/SpecUI/CommonUI/CWin/cwinManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/SpecUI/CommonUI/CWin/cwinManager.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: OpenLook/Win
FILE: cwinManager.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 6/89 Initial version
DESCRIPTION:
This file assembles the Win/ module of the Open Look library,
which contains the OLWinClass & objects subclassed from it.
$Id: cwinManager.asm,v 1.3 98/03/11 06:24:27 joon Exp $
------------------------------------------------------------------------------@
_Win = 1
;-----------------------------------------------------------------------------
; Include common definitions
;-----------------------------------------------------------------------------
include cMacro.def
include cGeode.def
include cGlobal.def
include sem.def ; for cwinPopup.asm (for UserDoDialog handler)
include vm.def ; for cwinFieldOther.asm (for BG files)
include chunkarr.def
include timer.def
include fileEnum.def
include initfile.def
include backgrnd.def
UseDriver Internal/videoDr.def
UseDriver Internal/powerDr.def
include Internal/grWinInt.def ; for cwinFieldxxx.asm
include Internal/window.def ; for cwinFieldxxx.asm
;-----------------------------------------------------------------------------
; Include definitions for this module
;-----------------------------------------------------------------------------
include cwinConstant.def
include cwinVariable.def
;-----------------------------------------------------------------------------
; Include code
;-----------------------------------------------------------------------------
include cwinUtils.asm
;
; the almightly OLWinClass:
;
include cwinClassMisc.asm ; All sorts of resources
include cwinClassCommonHigh.asm ; WinCommon
include cwinClassCommonMiddle.asm ; more WinCommon
include cwinClassCommonLow.asm ; more WinCommon
include cwinClassOther.asm ; WinOther
include cwinPtr.asm ;code related to PTR/BTN events
include cwinGeometry.asm ;method handlers for geometry
include cwinExcl.asm ;code related to FOCUS, etc. exclusives
if _CUA_STYLE ;--------------------------------------------------------------
include cwinClassCUAS.asm ;CUA-STYLE OLWinClass code.
endif ;--------------------------------------------------------------
include winClassSpec.asm ;specific code for each specific UI
;(See Motif/Win, PM/Win, OpenLook/Win)
include winDraw.asm ;drawing code for each specific UI
;(See Motif/Win, PM/Win, OpenLook/Win)
;and the remainder of our Windowed-object classes:
include cwinPopup.asm
include cwinMenu.asm
include cwinMenuedWin.asm
include cwinDialog.asm
include cwinDisplay.asm
include cwinBase.asm
include cwinFieldOther.asm
include cwinFieldInit.asm
include cwinFieldCommon.asm
include cwinFieldUncommon.asm
include cwinFieldData.asm
include cwinScreen.asm
include cwinDisplayControl.asm
if not _NO_WIN_ICONS ;------------------------------------------------------
include cwinWinIcon.asm
include cwinGlyphDisplay.asm
endif ;------------------------------------------------------
include cwinData.asm
end
| 30.551402 | 80 | 0.546956 |
90499214b77213d3afbe6f4a9d1903f835b56c9b | 391 | asm | Assembly | programs/oeis/083/A083651.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/083/A083651.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/083/A083651.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A083651: Triangular array, read by rows: T(n,k) = k-th bit in binary representation of n (0<=k<=n).
; 0,1,0,0,1,0,1,1,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0
lpb $0
add $1,1
sub $0,$1
lpe
lpb $0
sub $0,1
div $1,2
lpe
mod $1,2
mov $0,$1
| 27.928571 | 201 | 0.544757 |
95872c15d2210ba6f0d8a7ac18cd8b54bf799160 | 226 | asm | Assembly | samples/addTwoNumbers.asm | sumanthreddy07/uPower_Assembler | ad382316fea8090219311aa363bdb886d2c9b391 | [
"MIT"
] | null | null | null | samples/addTwoNumbers.asm | sumanthreddy07/uPower_Assembler | ad382316fea8090219311aa363bdb886d2c9b391 | [
"MIT"
] | null | null | null | samples/addTwoNumbers.asm | sumanthreddy07/uPower_Assembler | ad382316fea8090219311aa363bdb886d2c9b391 | [
"MIT"
] | 2 | 2020-07-30T10:08:57.000Z | 2021-04-02T05:21:20.000Z | .data #global data
X: .word 5
Y: .word 10
SUM: .word 0
.text
#.globl main
main:
la R1, X
la R2, Y
lwz R3, 0(R1)
lwz R4, 0(R2)
add R5, R3, R4
la R6, SUM
stw R5, 0(R6)
lwz R8, 0(R6)
# .end
| 10.761905 | 18 | 0.5 |
20e0d5ae0c3489ed2cd3d627c18b348302fd074d | 18,912 | asm | Assembly | tests/res/jitregress/fft_llvm.asm | JackWolfard/cash | a646c0b94d075fa424a93904b7499a0dee90ac89 | [
"BSD-3-Clause"
] | 14 | 2018-08-08T19:02:21.000Z | 2022-01-07T14:42:43.000Z | tests/res/jitregress/fft_llvm.asm | JackWolfard/cash | a646c0b94d075fa424a93904b7499a0dee90ac89 | [
"BSD-3-Clause"
] | null | null | null | tests/res/jitregress/fft_llvm.asm | JackWolfard/cash | a646c0b94d075fa424a93904b7499a0dee90ac89 | [
"BSD-3-Clause"
] | 3 | 2020-04-20T20:58:34.000Z | 2021-11-23T14:50:14.000Z | .text
.file "llvmjit"
.globl eval
.p2align 4, 0x90
.type eval,@function
eval:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
pushq %r15
.cfi_def_cfa_offset 24
pushq %r14
.cfi_def_cfa_offset 32
pushq %r13
.cfi_def_cfa_offset 40
pushq %r12
.cfi_def_cfa_offset 48
pushq %rbx
.cfi_def_cfa_offset 56
subq $176, %rsp
.cfi_def_cfa_offset 232
.cfi_offset %rbx, -56
.cfi_offset %r12, -48
.cfi_offset %r13, -40
.cfi_offset %r14, -32
.cfi_offset %r15, -24
.cfi_offset %rbp, -16
movq (%rdi), %rsi
movq 8(%rdi), %rcx
movl 320(%rcx), %eax
movl %eax, 8(%rsp)
movl 328(%rcx), %eax
movq %rax, 16(%rsp)
movl 468(%rcx), %eax
movl %eax, -64(%rsp)
movl 476(%rcx), %eax
movl %eax, -4(%rsp)
movl 492(%rcx), %eax
movl %eax, 4(%rsp)
movl 500(%rcx), %r10d
movl 508(%rcx), %eax
movl %eax, -104(%rsp)
movl 516(%rcx), %edx
movl %edx, -8(%rsp)
movl 524(%rcx), %eax
movl %eax, -68(%rsp)
movl 532(%rcx), %eax
movl %eax, -108(%rsp)
movl 608(%rcx), %eax
movl %eax, 108(%rsp)
movq %rsi, 152(%rsp)
movq 24(%rsi), %rdx
movl (%rdx), %edi
movl 1112(%rcx), %edx
notl %edx
testl %edi, %edx
movl 616(%rcx), %edx
movslq 632(%rcx), %r12
movl 640(%rcx), %ebx
movl 648(%rcx), %eax
movl 656(%rcx), %esi
movq %rsi, 24(%rsp)
movl 684(%rcx), %ebp
movl 700(%rcx), %r15d
movl 708(%rcx), %esi
movq %rsi, 32(%rsp)
movl 752(%rcx), %esi
movl %esi, -72(%rsp)
movl 760(%rcx), %esi
movl %esi, -12(%rsp)
movl 776(%rcx), %r13d
movl 784(%rcx), %esi
movl %esi, -100(%rsp)
movl 792(%rcx), %esi
movl %esi, -96(%rsp)
movl 800(%rcx), %esi
movq %rsi, 128(%rsp)
movl 808(%rcx), %esi
movl %esi, -76(%rsp)
movl 816(%rcx), %esi
movl %esi, -92(%rsp)
movl 844(%rcx), %esi
movl %esi, 104(%rsp)
movl 852(%rcx), %esi
movl %esi, -16(%rsp)
movslq 868(%rcx), %rsi
movq %rsi, 144(%rsp)
movl 876(%rcx), %esi
movq %rsi, 168(%rsp)
movl 884(%rcx), %esi
movl %esi, 100(%rsp)
movl 892(%rcx), %esi
movq %rsi, 40(%rsp)
movl 920(%rcx), %esi
movq %rsi, 120(%rsp)
movl 936(%rcx), %esi
movl %esi, -80(%rsp)
movl 944(%rcx), %esi
movq %rsi, 48(%rsp)
movl 960(%rcx), %esi
movl %esi, -88(%rsp)
movl 968(%rcx), %esi
movl %esi, -20(%rsp)
movl 984(%rcx), %esi
movl %esi, -84(%rsp)
movl 992(%rcx), %esi
movl %esi, -124(%rsp)
movl 1000(%rcx), %esi
movl %esi, -120(%rsp)
movl 1008(%rcx), %esi
movl %esi, -24(%rsp)
movl 1016(%rcx), %esi
movl %esi, 12(%rsp)
movl 1024(%rcx), %esi
movl %esi, -116(%rsp)
movl 1032(%rcx), %esi
movl %esi, 112(%rsp)
movl 1040(%rcx), %r9d
movl 1056(%rcx), %r14d
movl 1064(%rcx), %esi
movq %rsi, -56(%rsp)
movl 1072(%rcx), %r8d
movl 1080(%rcx), %esi
movl %esi, -112(%rsp)
movl 1088(%rcx), %r11d
movl 1096(%rcx), %esi
movl %esi, 116(%rsp)
movl 1104(%rcx), %esi
movl %edi, 1112(%rcx)
je .LBB0_136
movl %esi, -60(%rsp)
movl %ebp, -44(%rsp)
movl %eax, 72(%rsp)
movq %rbx, 160(%rsp)
movl %edx, -40(%rsp)
xorl %eax, %eax
movl %r14d, 92(%rsp)
testl %r14d, %r14d
setne %al
movq 16(%rsp), %rbp
movl %ebp, %edi
shrl $16, %edi
movl %r15d, %ebx
movl %r8d, %r15d
shrl $16, %r15d
movq %r12, 136(%rsp)
movl %r13d, (%rsp)
movl %edi, %r13d
subl %r15d, %r13d
movl %ebp, %esi
subl %r8d, %esi
movzwl %si, %esi
shll $16, %r13d
orl %esi, %r13d
addl %edi, %r15d
leal (%r8,%rbp), %esi
movzwl %si, %esi
shll $16, %r15d
orl %esi, %r15d
movq -56(%rsp), %rdx
movl %edx, %r12d
notl %r12d
andl $1, %r12d
andl %edx, %eax
xorl $1, %eax
movl %eax, 88(%rsp)
andl %eax, %r9d
movl %r11d, 84(%rsp)
shrl $2, %r11d
movl %r11d, %eax
xorl $1, %eax
movl %eax, -28(%rsp)
movl %r9d, -32(%rsp)
andl %r9d, %r11d
xorl $1, %r11d
movl %r11d, 96(%rsp)
movl %r12d, -36(%rsp)
andl %r12d, %r11d
btl $5, 8(%rsp)
cmovael %r8d, %r13d
movl %r13d, 80(%rsp)
cmovael %ebp, %r15d
movl %r15d, 16(%rsp)
movl -64(%rsp), %eax
movl %eax, %esi
shrl $16, %esi
movl %eax, %r13d
shll $16, %r13d
negl %r13d
orl %esi, %r13d
testb $32, 4(%rsp)
cmovel %eax, %r13d
movl -108(%rsp), %ebp
movl %ebp, %esi
shrl $16, %esi
movl %r10d, %edx
shrl $16, %edx
movl %esi, %r15d
subl %edx, %r15d
movl %ebp, %edi
subl %r10d, %edi
movzwl %di, %edi
shll $16, %r15d
orl %edi, %r15d
addl %esi, %edx
addl %ebp, %r10d
movzwl %r10w, %eax
shll $16, %edx
orl %eax, %edx
btl $4, -68(%rsp)
cmovael -104(%rsp), %r15d
cmovael %ebp, %edx
movl %edx, -108(%rsp)
movq 32(%rsp), %r8
movl %r8d, %eax
shrl $16, %eax
movq 24(%rsp), %rbp
movl %ebp, %edi
shrl $16, %edi
movl %eax, %edx
subl %edi, %edx
movl %r8d, %esi
subl %ebp, %esi
movzwl %si, %esi
shll $16, %edx
orl %esi, %edx
addl %eax, %edi
leal (%r8,%rbp), %eax
movzwl %ax, %eax
shll $16, %edi
orl %eax, %edi
movl %ebx, 56(%rsp)
btl $3, %ebx
cmovael %ebp, %edx
movl %edx, 24(%rsp)
cmovael %r8d, %edi
movl %edi, 32(%rsp)
movl %r11d, %r10d
movl -72(%rsp), %esi
movl %esi, %eax
shrl $16, %eax
movl %esi, %edx
shll $16, %edx
negl %edx
orl %eax, %edx
testb $8, (%rsp)
cmovel %esi, %edx
movl %edx, 68(%rsp)
movl -92(%rsp), %ebx
movl %ebx, %eax
shrl $16, %eax
movl -100(%rsp), %ebp
movl %ebp, %edi
shrl $16, %edi
movl %eax, %esi
subl %edi, %esi
movl %ebx, %edx
subl %ebp, %edx
movzwl %dx, %edx
shll $16, %esi
orl %edx, %esi
addl %eax, %edi
addl %ebx, %ebp
movzwl %bp, %eax
shll $16, %edi
orl %eax, %edi
btl $2, -76(%rsp)
cmovael -96(%rsp), %esi
movl %esi, -96(%rsp)
cmovael %ebx, %edi
movl %edi, -92(%rsp)
movq 48(%rsp), %rdi
movl %edi, %eax
shrl $16, %eax
movq 40(%rsp), %rbx
movl %ebx, %r9d
shrl $16, %r9d
movl %eax, %esi
subl %r9d, %esi
movl %edi, %edx
subl %ebx, %edx
movzwl %dx, %edx
shll $16, %esi
orl %edx, %esi
addl %eax, %r9d
leal (%rdi,%rbx), %eax
movzwl %ax, %eax
shll $16, %r9d
orl %eax, %r9d
movl -80(%rsp), %eax
btl $1, %eax
cmovael %ebx, %esi
movl %esi, 64(%rsp)
cmovael %edi, %r9d
movl -88(%rsp), %esi
movl %esi, %eax
shrl $16, %eax
movl %esi, %edx
shll $16, %edx
negl %edx
orl %eax, %edx
testb $2, -84(%rsp)
cmovel %esi, %edx
movl %edx, 60(%rsp)
movl -116(%rsp), %esi
movl %esi, %eax
shrl $16, %eax
movl -124(%rsp), %edi
movl %edi, %r11d
shrl $16, %r11d
movl %eax, %r8d
subl %r11d, %r8d
movl %esi, %edx
subl %edi, %edx
movzwl %dx, %edx
shll $16, %r8d
orl %edx, %r8d
addl %eax, %r11d
addl %esi, %edi
movzwl %di, %eax
shll $16, %r11d
orl %eax, %r11d
cmpl $0, 12(%rsp)
cmovel -120(%rsp), %r8d
cmovel %esi, %r11d
movq -56(%rsp), %rdx
movl %edx, %esi
shrl $2, %esi
notl %esi
movq 152(%rsp), %rdi
movq 8(%rdi), %rax
andl (%rax), %esi
movq 32(%rdi), %rax
movl (%rax), %r14d
andl $1, %esi
movl %r10d, %ebx
xorl $1, %ebx
movl %edx, %r12d
shrl %r12d
testl %ebx, %esi
movq 136(%rsp), %rax
movl (%rcx,%rax,4), %edx
movq 144(%rsp), %rax
movl 256(%rcx,%rax,4), %eax
movl %eax, -100(%rsp)
movq %rdi, %rax
movl %r10d, -116(%rsp)
movl %r13d, 76(%rsp)
movl %r15d, -104(%rsp)
movl %edx, 40(%rsp)
je .LBB0_2
movq -56(%rsp), %rdx
leal (%rdx,%rdx), %edi
andl $6, %edi
movl %edi, -120(%rsp)
jmp .LBB0_4
.LBB0_2:
movl %r12d, %ebp
andl $3, %ebp
movl %esi, %edi
notl %edi
testl %r10d, %edi
cmovel -56(%rsp), %ebp
movl %ebp, -120(%rsp)
.LBB0_4:
movl -112(%rsp), %r10d
movl -28(%rsp), %r15d
movl -32(%rsp), %edx
movl %r12d, %edi
andl $1, %edi
movq (%rax), %rbp
movq 16(%rax), %rax
movl (%rbp), %ebp
orl %edi, %ebx
movl %ebp, 48(%rsp)
cmovnel %ebp, %r10d
andl %edx, %r15d
movl 84(%rsp), %edi
movl %edi, %ebx
andl $1, %ebx
movl %ebx, %ebp
xorl $1, %ebp
andl (%rax), %ebp
movl %edi, %eax
movl %ebp, %edi
xorl $1, %edi
movl %eax, %r13d
shrl %r13d
testl %r15d, %edi
je .LBB0_5
addl %eax, %eax
andl $6, %eax
movl %eax, -124(%rsp)
jmp .LBB0_7
.LBB0_5:
movl %r10d, -112(%rsp)
movl %r13d, %edx
andl $3, %edx
movl %eax, %r10d
movl %r15d, %eax
xorl $1, %eax
testl %eax, %ebp
cmovel %r10d, %edx
movl %edx, -124(%rsp)
movl -112(%rsp), %r10d
.LBB0_7:
andl $1, %r13d
orl %r13d, %edi
movl -60(%rsp), %eax
movl 112(%rsp), %edi
cmovnel %edi, %eax
movl %eax, -60(%rsp)
andl %r15d, %ebx
orl %ebp, %ebx
andl %r15d, %r13d
orl %ebp, %r13d
je .LBB0_9
movl %edi, 1104(%rcx)
.LBB0_9:
andl %esi, %r12d
testl %ebx, %ebx
movq 152(%rsp), %r13
movl 116(%rsp), %ebp
movl -116(%rsp), %eax
movq -56(%rsp), %rdi
movl 96(%rsp), %ebx
je .LBB0_11
movl -60(%rsp), %ebp
movl %ebp, 1096(%rcx)
.LBB0_11:
andl %edi, %esi
orl %eax, %r12d
testl %r14d, %r14d
movl 12(%rsp), %r15d
je .LBB0_13
movl $1, 1088(%rcx)
movl $1, -124(%rsp)
orl %eax, %esi
testl %r12d, %r12d
je .LBB0_16
.LBB0_15:
movl 48(%rsp), %eax
movl %eax, 1080(%rcx)
.LBB0_16:
testl %esi, %esi
movq 144(%rsp), %r12
je .LBB0_18
movl %r10d, 1072(%rcx)
.LBB0_18:
testl %r14d, %r14d
movl 92(%rsp), %edx
je .LBB0_20
movl $1, 1064(%rcx)
movl $1, -120(%rsp)
andl 88(%rsp), %ebx
testl %r14d, %r14d
je .LBB0_23
.LBB0_22:
movl $0, 1056(%rcx)
testl %r14d, %r14d
jne .LBB0_26
jmp .LBB0_27
.LBB0_13:
movq %r13, %rdi
movl -124(%rsp), %edx
movl %edx, 1088(%rcx)
orl %eax, %esi
testl %r12d, %r12d
jne .LBB0_15
jmp .LBB0_16
.LBB0_20:
movl -120(%rsp), %eax
movl %eax, 1064(%rcx)
andl 88(%rsp), %ebx
testl %r14d, %r14d
jne .LBB0_22
.LBB0_23:
testl %ebx, -36(%rsp)
je .LBB0_25
incl %edx
andl $63, %edx
movl %edx, 1056(%rcx)
.LBB0_25:
testl %r14d, %r14d
je .LBB0_27
.LBB0_26:
movl $0, 1040(%rcx)
movl $0, 1048(%rcx)
testl %ebx, %ebx
jne .LBB0_30
jmp .LBB0_31
.LBB0_27:
testl %ebx, %ebx
je .LBB0_29
movl 1048(%rcx), %eax
movl %eax, 1040(%rcx)
movl -24(%rsp), %eax
movl %eax, 1048(%rcx)
.LBB0_29:
testl %ebx, %ebx
je .LBB0_31
.LBB0_30:
movl %r11d, 1032(%rcx)
movl %r8d, 1024(%rcx)
.LBB0_31:
testl %r14d, %r14d
je .LBB0_33
movl $0, 1016(%rcx)
movl -64(%rsp), %r8d
movl -84(%rsp), %eax
movl -88(%rsp), %esi
testl %r14d, %r14d
jne .LBB0_36
jmp .LBB0_37
.LBB0_33:
testl %ebx, -24(%rsp)
movl -64(%rsp), %r8d
movl -84(%rsp), %eax
movl -88(%rsp), %esi
je .LBB0_35
notl %r15d
andl $1, %r15d
movl %r15d, 1016(%rcx)
.LBB0_35:
testl %r14d, %r14d
je .LBB0_37
.LBB0_36:
movl $0, 1008(%rcx)
testl %ebx, %ebx
jne .LBB0_40
jmp .LBB0_41
.LBB0_37:
testl %ebx, %ebx
je .LBB0_41
movl -20(%rsp), %edx
movl %edx, 1008(%rcx)
testl %ebx, %ebx
je .LBB0_41
.LBB0_40:
movl %esi, 1000(%rcx)
movl 60(%rsp), %edx
movl %edx, 992(%rcx)
.LBB0_41:
testl %r14d, %r14d
je .LBB0_43
movl $0, 984(%rcx)
movl -72(%rsp), %r10d
movl -76(%rsp), %r15d
movl -80(%rsp), %esi
testl %r14d, %r14d
jne .LBB0_46
jmp .LBB0_47
.LBB0_43:
testl %ebx, -20(%rsp)
movl -72(%rsp), %r10d
movl -76(%rsp), %r15d
movl -80(%rsp), %esi
je .LBB0_45
incl %eax
andl $3, %eax
movl %eax, 984(%rcx)
.LBB0_45:
testl %r14d, %r14d
je .LBB0_47
.LBB0_46:
movl $0, 968(%rcx)
movl $0, 976(%rcx)
testl %ebx, %ebx
jne .LBB0_50
jmp .LBB0_51
.LBB0_47:
testl %ebx, %ebx
je .LBB0_51
movl 976(%rcx), %eax
movl %eax, %edx
andl $1, %edx
movl %edx, 968(%rcx)
shrl %eax
movq 120(%rsp), %rdx
leal (%rdx,%rdx), %edx
orl %eax, %edx
movl %edx, 976(%rcx)
testl %ebx, %ebx
je .LBB0_51
.LBB0_50:
movl %r9d, 960(%rcx)
movl 952(%rcx), %eax
movl %eax, 944(%rcx)
movl 64(%rsp), %eax
movl %eax, 952(%rcx)
.LBB0_51:
testl %r14d, %r14d
je .LBB0_53
movl $0, 936(%rcx)
movl -68(%rsp), %r9d
testl %r14d, %r14d
jne .LBB0_56
jmp .LBB0_57
.LBB0_53:
testl %ebx, 120(%rsp)
movl -68(%rsp), %r9d
je .LBB0_55
incl %esi
andl $3, %esi
movl %esi, 936(%rcx)
.LBB0_55:
testl %r14d, %r14d
je .LBB0_57
.LBB0_56:
movl $0, 920(%rcx)
movl $0, 928(%rcx)
testl %ebx, %ebx
jne .LBB0_60
jmp .LBB0_61
.LBB0_57:
testl %ebx, %ebx
je .LBB0_61
movl 928(%rcx), %eax
movl %eax, %edx
andl $1, %edx
movl %edx, 920(%rcx)
shrl %eax
movl -16(%rsp), %edx
shll $4, %edx
orl %eax, %edx
movl %edx, 928(%rcx)
testl %ebx, %ebx
je .LBB0_61
.LBB0_60:
movq 168(%rsp), %r11
movswl %r11w, %eax
movl 100(%rsp), %esi
movl %esi, %edx
sarl $16, %edx
sarl $16, %r11d
movswl %si, %esi
movl %edx, %edi
imull %r11d, %edi
imull %esi, %r11d
imull %eax, %esi
subl %edi, %esi
imull %eax, %edx
addl %edx, %r11d
addl %esi, %esi
andl $2147450880, %r11d
shrl $16, %esi
leal (%rsi,%r11,2), %eax
movslq 916(%rcx), %rdx
movl 900(%rcx,%rdx,4), %esi
movl %esi, 892(%rcx)
movl %eax, 900(%rcx,%rdx,4)
leal -1(%rdx), %eax
cmpl $3, %eax
movl $3, %edx
cmovbl %eax, %edx
movl %edx, 916(%rcx)
movl -100(%rsp), %eax
movl %eax, 884(%rcx)
movl 104(%rsp), %eax
movl %eax, 876(%rcx)
.LBB0_61:
testl %r14d, %r14d
je .LBB0_63
movl $0, 868(%rcx)
testl %r14d, %r14d
jne .LBB0_66
jmp .LBB0_67
.LBB0_63:
testl %ebx, -16(%rsp)
je .LBB0_65
incl %r12d
andl $15, %r12d
movl %r12d, 868(%rcx)
.LBB0_65:
testl %r14d, %r14d
je .LBB0_67
.LBB0_66:
movl $0, 852(%rcx)
movl $0, 860(%rcx)
testl %ebx, %ebx
jne .LBB0_70
jmp .LBB0_71
.LBB0_67:
testl %ebx, %ebx
je .LBB0_71
movl 860(%rcx), %eax
movl %eax, %edx
andl $1, %edx
movl %edx, 852(%rcx)
shrl %eax
movq 128(%rsp), %rdx
leal (,%rdx,8), %edx
orl %eax, %edx
movl %edx, 860(%rcx)
testl %ebx, %ebx
je .LBB0_71
.LBB0_70:
movl -92(%rsp), %eax
movl %eax, 844(%rcx)
movslq 840(%rcx), %rax
movl 824(%rcx,%rax,4), %edx
movl %edx, 816(%rcx)
movl -96(%rsp), %edx
movl %edx, 824(%rcx,%rax,4)
leal -1(%rax), %eax
cmpl $2, %eax
movl $2, %edx
cmovbl %eax, %edx
movl %edx, 840(%rcx)
.LBB0_71:
testl %r14d, %r14d
je .LBB0_73
movl $0, 808(%rcx)
testl %r14d, %r14d
jne .LBB0_76
jmp .LBB0_77
.LBB0_73:
testl %ebx, 128(%rsp)
je .LBB0_75
incl %r15d
andl $7, %r15d
movl %r15d, 808(%rcx)
.LBB0_75:
testl %r14d, %r14d
je .LBB0_77
.LBB0_76:
movl $0, 800(%rcx)
movl %ebp, %r15d
testl %ebx, %ebx
jne .LBB0_80
jmp .LBB0_81
.LBB0_77:
testl %ebx, %ebx
movl %ebp, %r15d
je .LBB0_81
movl -12(%rsp), %eax
movl %eax, 800(%rcx)
testl %ebx, %ebx
je .LBB0_81
.LBB0_80:
movl %r10d, 792(%rcx)
movl 68(%rsp), %eax
movl %eax, 784(%rcx)
.LBB0_81:
testl %r14d, %r14d
je .LBB0_83
movl $0, 776(%rcx)
testl %r14d, %r14d
jne .LBB0_86
jmp .LBB0_87
.LBB0_83:
testl %ebx, -12(%rsp)
je .LBB0_85
movl (%rsp), %eax
incl %eax
andl $15, %eax
movl %eax, 776(%rcx)
.LBB0_85:
testl %r14d, %r14d
je .LBB0_87
.LBB0_86:
movl $0, 760(%rcx)
movl $0, 768(%rcx)
testl %ebx, %ebx
jne .LBB0_90
jmp .LBB0_91
.LBB0_87:
testl %ebx, %ebx
je .LBB0_91
movl 768(%rcx), %eax
movl %eax, %edx
andl $1, %edx
movl %edx, 760(%rcx)
shrl %eax
movl -44(%rsp), %edx
shll $7, %edx
orl %eax, %edx
movl %edx, 768(%rcx)
testl %ebx, %ebx
je .LBB0_91
.LBB0_90:
movl 32(%rsp), %eax
movl %eax, 752(%rcx)
movslq 748(%rcx), %rax
movl 716(%rcx,%rax,4), %edx
movl %edx, 708(%rcx)
movl 24(%rsp), %edx
movl %edx, 716(%rcx,%rax,4)
leal -1(%rax), %eax
cmpl $6, %eax
movl $6, %edx
cmovbl %eax, %edx
movl %edx, 748(%rcx)
.LBB0_91:
testl %r14d, %r14d
je .LBB0_93
movl $0, 700(%rcx)
testl %r14d, %r14d
jne .LBB0_96
jmp .LBB0_97
.LBB0_93:
testl %ebx, -44(%rsp)
je .LBB0_95
movl 56(%rsp), %eax
incl %eax
andl $15, %eax
movl %eax, 700(%rcx)
.LBB0_95:
testl %r14d, %r14d
je .LBB0_97
.LBB0_96:
movl $0, 684(%rcx)
movl $0, 692(%rcx)
testl %ebx, %ebx
jne .LBB0_100
jmp .LBB0_101
.LBB0_97:
testl %ebx, %ebx
je .LBB0_101
movl 692(%rcx), %eax
movl %eax, %edx
andl $1, %edx
movl %edx, 684(%rcx)
shrl %eax
movl -40(%rsp), %edx
shll $4, %edx
orl %eax, %edx
movl %edx, 692(%rcx)
testl %ebx, %ebx
je .LBB0_101
.LBB0_100:
movq 160(%rsp), %rbp
movswl %bp, %eax
movl 72(%rsp), %esi
movl %esi, %edx
sarl $16, %edx
sarl $16, %ebp
movswl %si, %esi
movl %edx, %edi
imull %ebp, %edi
imull %esi, %ebp
imull %eax, %esi
subl %edi, %esi
imull %eax, %edx
addl %edx, %ebp
addl %esi, %esi
andl $2147450880, %ebp
shrl $16, %esi
leal (%rsi,%rbp,2), %eax
movslq 680(%rcx), %rdx
movl 664(%rcx,%rdx,4), %esi
movl %esi, 656(%rcx)
movl %eax, 664(%rcx,%rdx,4)
leal -1(%rdx), %eax
cmpl $3, %eax
movl $3, %edx
cmovbl %eax, %edx
movl %edx, 680(%rcx)
movl 40(%rsp), %eax
movl %eax, 648(%rcx)
movl 108(%rsp), %eax
movl %eax, 640(%rcx)
.LBB0_101:
testl %r14d, %r14d
je .LBB0_103
movl $0, 632(%rcx)
testl %r14d, %r14d
jne .LBB0_106
jmp .LBB0_107
.LBB0_103:
testl %ebx, -40(%rsp)
je .LBB0_105
movq 136(%rsp), %rax
incl %eax
andl $63, %eax
movl %eax, 632(%rcx)
.LBB0_105:
testl %r14d, %r14d
je .LBB0_107
.LBB0_106:
movl $0, 616(%rcx)
movl $0, 624(%rcx)
testl %ebx, %ebx
jne .LBB0_110
jmp .LBB0_111
.LBB0_107:
testl %ebx, %ebx
je .LBB0_111
movl 624(%rcx), %eax
movl %eax, %edx
andl $1, %edx
movl %edx, 616(%rcx)
shrl %eax
movl -8(%rsp), %edx
shll $15, %edx
orl %eax, %edx
movl %edx, 624(%rcx)
testl %ebx, %ebx
je .LBB0_111
.LBB0_110:
movl -108(%rsp), %eax
movl %eax, 608(%rcx)
movslq 604(%rcx), %rax
movl 540(%rcx,%rax,4), %edx
movl %edx, 532(%rcx)
movl -104(%rsp), %edx
movl %edx, 540(%rcx,%rax,4)
leal -1(%rax), %eax
cmpl $14, %eax
movl $14, %edx
cmovbl %eax, %edx
movl %edx, 604(%rcx)
.LBB0_111:
testl %r14d, %r14d
je .LBB0_113
movl $0, 524(%rcx)
testl %r14d, %r14d
jne .LBB0_116
jmp .LBB0_117
.LBB0_113:
testl %ebx, -8(%rsp)
je .LBB0_115
incl %r9d
andl $31, %r9d
movl %r9d, 524(%rcx)
.LBB0_115:
testl %r14d, %r14d
je .LBB0_117
.LBB0_116:
movl $0, 516(%rcx)
movl -116(%rsp), %r12d
testl %ebx, %ebx
jne .LBB0_120
jmp .LBB0_121
.LBB0_117:
testl %ebx, %ebx
movl -116(%rsp), %r12d
je .LBB0_121
movl -4(%rsp), %eax
movl %eax, 516(%rcx)
testl %ebx, %ebx
je .LBB0_121
.LBB0_120:
movl %r8d, 508(%rcx)
movl 76(%rsp), %eax
movl %eax, 500(%rcx)
.LBB0_121:
testl %r14d, %r14d
je .LBB0_123
movl $0, 492(%rcx)
testl %r14d, %r14d
jne .LBB0_126
jmp .LBB0_127
.LBB0_123:
testl %ebx, -4(%rsp)
je .LBB0_125
movl 4(%rsp), %r11d
incl %r11d
andl $63, %r11d
movl %r11d, 492(%rcx)
.LBB0_125:
testl %r14d, %r14d
je .LBB0_127
.LBB0_126:
movl $0, 476(%rcx)
movl $0, 484(%rcx)
testl %ebx, %ebx
jne .LBB0_130
jmp .LBB0_131
.LBB0_127:
testl %ebx, %ebx
je .LBB0_131
movl 484(%rcx), %eax
shldl $31, %eax, %r12d
andl $1, %eax
movl %eax, 476(%rcx)
movl %r12d, 484(%rcx)
testl %ebx, %ebx
je .LBB0_131
.LBB0_130:
movl 16(%rsp), %eax
movl %eax, 468(%rcx)
movslq 464(%rcx), %rax
movl 336(%rcx,%rax,4), %edx
movl %edx, 328(%rcx)
movl 80(%rsp), %edx
movl %edx, 336(%rcx,%rax,4)
leal -1(%rax), %eax
cmpl $30, %eax
movl $30, %edx
cmovbl %eax, %edx
movl %edx, 464(%rcx)
.LBB0_131:
testl %r14d, %r14d
je .LBB0_133
movl $0, 320(%rcx)
jmp .LBB0_135
.LBB0_133:
testl %ebx, -36(%rsp)
je .LBB0_135
movl 8(%rsp), %eax
incl %eax
andl $63, %eax
movl %eax, 320(%rcx)
.LBB0_135:
movl -120(%rsp), %ecx
shrl $2, %ecx
notl %ecx
andl $1, %ecx
movq 40(%r13), %rax
movl %ecx, (%rax)
movq 48(%r13), %rax
movl %r15d, (%rax)
movl -124(%rsp), %ecx
notl %ecx
andl $1, %ecx
movq 56(%r13), %rax
movl %ecx, (%rax)
.LBB0_136:
xorl %eax, %eax
addq $176, %rsp
.cfi_def_cfa_offset 56
popq %rbx
.cfi_def_cfa_offset 48
popq %r12
.cfi_def_cfa_offset 40
popq %r13
.cfi_def_cfa_offset 32
popq %r14
.cfi_def_cfa_offset 24
popq %r15
.cfi_def_cfa_offset 16
popq %rbp
.cfi_def_cfa_offset 8
retq
.Lfunc_end0:
.size eval, .Lfunc_end0-eval
.cfi_endproc
.section ".note.GNU-stack","",@progbits
| 18.149712 | 40 | 0.607498 |
3a1c1a7212e81ccf2e5a99953b6d7a1e4c039dd5 | 2,897 | asm | Assembly | libtool/src/gmp-6.1.2/mpn/powerpc32/750/lshift.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/powerpc32/750/lshift.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/powerpc32/750/lshift.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl PowerPC 750 mpn_lshift -- mpn left shift.
dnl Copyright 2002, 2003 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C 750: 3.0
C 7400: 3.0
C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
C unsigned shift);
C
C This code is the same per-limb speed as mpn/powerpc32/lshift.asm, but
C smaller and saving about 30 or so cycles of overhead.
ASM_START()
PROLOGUE(mpn_lshift)
C r3 dst
C r4 src
C r5 size
C r6 shift
mtctr r5 C size
slwi r5, r5, 2 C 4*size
subfic r7, r6, 32 C 32-shift
add r4, r4, r5 C &src[size]
add r5, r3, r5 C &dst[size]
lwz r8, -4(r4) C src[size-1]
bdz L(one)
lwzu r9, -8(r4) C src[size-2]
srw r3, r8, r7 C return value
slw r8, r8, r6 C src[size-1] << shift
bdz L(two)
L(top):
C r3 return value
C r4 src, incrementing
C r5 dst, incrementing
C r6 lshift
C r7 32-shift
C r8 src[i+1] << shift
C r9 src[i]
C r10
lwzu r10, -4(r4)
srw r11, r9, r7
or r8, r8, r11
stwu r8, -4(r5)
slw r8, r9, r6
bdz L(odd)
C r8 src[i+1] << shift
C r9
C r10 src[i]
lwzu r9, -4(r4)
srw r11, r10, r7
or r8, r8, r11
stwu r8, -4(r5)
slw r8, r10, r6
bdnz L(top)
L(two):
C r3 return value
C r4
C r5 &dst[2]
C r6 shift
C r7 32-shift
C r8 src[1] << shift
C r9 src[0]
C r10
srw r11, r9, r7
slw r12, r9, r6 C src[0] << shift
or r8, r8, r11
stw r12, -8(r5) C dst[0]
stw r8, -4(r5) C dst[1]
blr
L(odd):
C r3 return value
C r4
C r5 &dst[2]
C r6 shift
C r7 32-shift
C r8 src[1] << shift
C r9
C r10 src[0]
srw r11, r10, r7
slw r12, r10, r6
or r8, r8, r11
stw r12, -8(r5) C dst[0]
stw r8, -4(r5) C dst[1]
blr
L(one):
C r5 &dst[1]
C r6 shift
C r7 32-shift
C r8 src[0]
srw r3, r8, r7 C return value
slw r8, r8, r6 C src[size-1] << shift
stw r8, -4(r5) C dst[0]
blr
EPILOGUE(mpn_lshift)
| 18.570513 | 79 | 0.66448 |
51b3e5200aa3b6af5f73103dafa2e26e70e4e21d | 299 | asm | Assembly | programs/oeis/047/A047390.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/047/A047390.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/047/A047390.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A047390: Numbers that are congruent to {0, 3, 5} mod 7.
; 0,3,5,7,10,12,14,17,19,21,24,26,28,31,33,35,38,40,42,45,47,49,52,54,56,59,61,63,66,68,70,73,75,77,80,82,84,87,89,91,94,96,98,101,103,105,108,110,112,115,117,119,122,124,126,129,131,133,136,138,140,143
mul $0,7
mov $1,2
add $1,$0
div $1,3
| 37.375 | 202 | 0.662207 |
5b3f9d2f95591ace042ee72d698124eb5957ef59 | 1,225 | asm | Assembly | libsrc/graphics/drawbox.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/drawbox.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/drawbox.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
SECTION code_clib
PUBLIC drawbox
EXTERN plotpixel
;
; $Id: drawbox.asm,v 1.6 2016/04/13 21:09:09 dom Exp $
;
; ***********************************************************************
;
; Clear specified graphics area in map.
; Generic version
;
; Stefano Bodrato - March 2002
;
;
; IN: HL = (x,y)
; BC = (width,heigth)
;
.drawbox
push bc
push hl
; -- Vertical lines --
push hl
ld a,h
add a,b
ret c ; overflow ?
dec a
ld h,a
pop de
.rowloop
push bc
push hl
push de
ld de, p_RET1
push de
jp (ix) ; execute PLOT at (h,l)
.p_RET1
pop de
pop hl
inc l
ex de,hl
push hl
push de
ld de, p_RET2
push de
jp (ix) ; execute PLOT at (h,l)
.p_RET2
pop de
pop hl
inc l
ex de,hl
pop bc
dec c
jr nz,rowloop
pop hl
pop bc
; -- Horizontal lines --
push hl
ld a,l
add a,c
ret c ; overflow ?
dec a
ld l,a
pop de
.vrowloop
push bc
push hl
push de
ld de, p_RET3
push de
jp (ix) ; execute PLOT at (h,l)
.p_RET3
pop de
pop hl
inc h
ex de,hl
push hl
push de
ld de, p_RET4
push de
jp (ix) ; execute PLOT at (h,l)
.p_RET4
pop de
pop hl
inc h
ex de,hl
pop bc
djnz vrowloop
ret
| 11.556604 | 73 | 0.540408 |
da006647c34fd36f92ae8ae4a4a500c91a619448 | 539 | asm | Assembly | oeis/174/A174333.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/174/A174333.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/174/A174333.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A174333: 61*n^2.
; 0,61,244,549,976,1525,2196,2989,3904,4941,6100,7381,8784,10309,11956,13725,15616,17629,19764,22021,24400,26901,29524,32269,35136,38125,41236,44469,47824,51301,54900,58621,62464,66429,70516,74725,79056,83509,88084,92781,97600,102541,107604,112789,118096,123525,129076,134749,140544,146461,152500,158661,164944,171349,177876,184525,191296,198189,205204,212341,219600,226981,234484,242109,249856,257725,265716,273829,282064,290421,298900,307501,316224,325069,334036,343125,352336,361669,371124,380701
pow $0,2
mul $0,61
| 89.833333 | 499 | 0.816327 |
d3cd9969eed13d2677d837a32cf906484087bb6c | 410 | asm | Assembly | pwnlib/shellcraft/templates/thumb/linux/timer_settime.asm | zaratec/pwntools | 8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba | [
"MIT"
] | 5 | 2018-05-15T13:00:56.000Z | 2020-02-09T14:29:00.000Z | pwnlib/shellcraft/templates/thumb/linux/timer_settime.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/thumb/linux/timer_settime.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | 6 | 2017-09-07T02:31:11.000Z | 2021-07-05T16:59:18.000Z |
<%
from pwnlib.shellcraft.thumb.linux import syscall
%>
<%page args="timerid, flags, value, ovalue"/>
<%docstring>
Invokes the syscall timer_settime. See 'man 2 timer_settime' for more information.
Arguments:
timerid(timer_t): timerid
flags(int): flags
value(itimerspec): value
ovalue(itimerspec): ovalue
</%docstring>
${syscall('SYS_timer_settime', timerid, flags, value, ovalue)}
| 24.117647 | 83 | 0.712195 |
5d43fe2a3060462c5541bfa1226fb38973bb4f19 | 741 | asm | Assembly | exercises/16_movs.asm | Catherine22/Assembly | 07335cc61fbef5fb23ea44792e1ce0517a4acc66 | [
"MIT"
] | null | null | null | exercises/16_movs.asm | Catherine22/Assembly | 07335cc61fbef5fb23ea44792e1ce0517a4acc66 | [
"MIT"
] | null | null | null | exercises/16_movs.asm | Catherine22/Assembly | 07335cc61fbef5fb23ea44792e1ce0517a4acc66 | [
"MIT"
] | null | null | null | ;copy string
STDIN equ 0
STDOUT equ 1
SYS_EXIT equ 1
SYS_READ equ 3
SYS_WRITE equ 4
section .data
s1 db "Hello, world!" ;string 1
len equ $- s1
section .bss
s2 resb len ;destination
section .text
global main
main:
mov ecx, len
mov esi, s1 ;esi points to the source
mov edi, s2 ;edi points to the destination
cld ;use Clear Directoin Flag to make the operation left to right
rep movsb ;REP, unconditional repeat. It repeats the operation until CX is zero.
;moving (for bytes - MOVSB, for words - MOVSW, for doublewords - MOBSD)
mov eax, SYS_WRITE
mov ebx, STDOUT
mov ecx, s2
mov edx, len
int 0x80
mov eax, SYS_EXIT
int 0x80
| 22.454545 | 88 | 0.635628 |
0c5a8114e38b9c15811564020fedabdb9ea80766 | 143 | asm | Assembly | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/polygon.lzh/polygon/sample2/shape.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/polygon.lzh/polygon/sample2/shape.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/polygon.lzh/polygon/sample2/shape.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: shape.asm
Type: file
Size: 18116
Last-Modified: '1992-09-24T02:25:47Z'
SHA-1: 9CC5199D254C4380E048237363D24EE8C5E2B4DB
Description: null
| 20.428571 | 47 | 0.811189 |
cc181ee9e8d406b4650c2172e7351af3d0ff5af1 | 426 | asm | Assembly | oeis/079/A079424.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/079/A079424.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/079/A079424.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A079424: A bisection of A024675. Cf. A058296.
; Submitted by Jamie Morken(s2)
; 6,12,18,26,34,42,50,60,69,76,86,99,105,111,129,138,150,160,170,180,192,198,217,228,236,246,260,270,279,288,309,315,334,348,356,370,381,393,405,420,432,441,453,462,473,489,501,515,532,552,566,574,590,600,610,618,636
mul $0,2
add $0,2
mov $1,$0
seq $0,40 ; The prime numbers.
add $1,1
seq $1,40 ; The prime numbers.
add $1,$0
mov $0,$1
div $0,2
| 30.428571 | 216 | 0.690141 |
c2041d7fa2f5f25072afde7812dbc0a066b6ca91 | 385 | asm | Assembly | oeis/162/A162802.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/162/A162802.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/162/A162802.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A162802: Bisection of A162800.
; Submitted by Jon Maiga
; 2,6,12,18,26,34,42,50,60,69,76,86,99,105,111,129,138,150,160,170,180,192,198,217,228,236,246,260,270,279,288,309,315,334,348,356,370,381,393,405,420,432,441,453,462,473,489,501,515,532,552,566,574,590,600
mul $0,2
mov $1,$0
seq $0,40 ; The prime numbers.
add $1,1
seq $1,40 ; The prime numbers.
add $1,$0
div $1,2
mov $0,$1
| 29.615385 | 206 | 0.690909 |
462d89be5e774292f888ad86198e39f8c06abb77 | 978 | asm | Assembly | codegen-tests/native-bitfield/icc13.0.1/02-sub-eq.asm | Deaod/bitfields | e84c18f18621637174edaffbefec486a45fbd9cf | [
"MIT"
] | null | null | null | codegen-tests/native-bitfield/icc13.0.1/02-sub-eq.asm | Deaod/bitfields | e84c18f18621637174edaffbefec486a45fbd9cf | [
"MIT"
] | null | null | null | codegen-tests/native-bitfield/icc13.0.1/02-sub-eq.asm | Deaod/bitfields | e84c18f18621637174edaffbefec486a45fbd9cf | [
"MIT"
] | null | null | null | L__routine_start__Z11test_devicev_0:
test_device():
push rsi #270.20
call rand #272.14
mov edx, DWORD PTR [rsp] #278.4
mov ecx, edx #278.4
shr edx, 12 #278.4
and ecx, -258049 #278.4
sub edx, eax #278.4
and edx, 63 #278.4
shl edx, 12 #278.4
or ecx, edx #278.4
mov DWORD PTR [rsp], ecx #278.4
pop rcx #291.1
ret #291.1
| 57.529412 | 71 | 0.224949 |
1659565b72366d66d60cb44b9dcd5f4647c210dd | 12,077 | asm | Assembly | Lab 5/lab5-P2.asm | AndrewDichabeng/Computer-Systems-Foundations | b98854118963c09d03f39a7f33354b17f503a540 | [
"MIT"
] | null | null | null | Lab 5/lab5-P2.asm | AndrewDichabeng/Computer-Systems-Foundations | b98854118963c09d03f39a7f33354b17f503a540 | [
"MIT"
] | null | null | null | Lab 5/lab5-P2.asm | AndrewDichabeng/Computer-Systems-Foundations | b98854118963c09d03f39a7f33354b17f503a540 | [
"MIT"
] | null | null | null | ; Lab5 - Subroutine to print a record from an array of structures
; Constant definitions
Display .EQU 04E9h ; address of Libra display
; Constant strings (prompts or labels to be printed to screen, etc)
s_name: .DB 'Name: $'
s_male: .DB 'Mr. $'
s_female: .DB 'Ms. $'
s_empNum: .DB 'Employee number: $'
s_salary: .DB 'Salary: $'
; Offsets to access individual fields within the records
ID .EQU 0 ; Zero bytes from start of record is ID
NAME .EQU 1 ; One byte from start of record is name
GENDER .EQU 3 ; 3 bytes from start of record is gender
SALARY .EQU 4 ; 4 bytes from start of record is salary
REC_SIZE .EQU 5 ; Total size of each record is 5 bytes
; Other defines
male .EQU 0 ; Gender field: 0=male
female .EQU 1 ; Gender field: 1=female
; ---------------------------------------------------------------
; Function: printEmployee
; Function to print an employee record to screen.
; Input Parameters:
; BX: Address of start of array of structures
; AL: Record number to be printed (record numbering starts at 0)
; Output Paramters:
; None.
; ---------------------------------------------------------------
printEmployee:
; Save register values that will be modified in this routine
push AX ; FIXED
push BX ; FIXED
push SI ; FIXED
; Calculate starting address of this record
; Starting address is START+(REC_NUM*REC_SIZE)
mov AH, REC_SIZE ; FIXED Load REC_SIZE into AH
mul AH ; FIXED Multiply REC_NUM (already in AL) by REC_SIZE (in AH)
add Bx,Ax ; FIXED Compute START+(REC_NUM*REC_SIZE)
; Print 'Name: ' label
mov SI, s_name ; FIXED
call printStr
; Print Mr/Mrs according to gender
mov AL, [BX+3] ; FIXED Load the gender field into AL. Need to use displacement addressing mode
cmp AL, male ; Compare gender to zero
je printMale
printFemale:
mov SI, s_female ; FIXED Print Ms.
call printStr
jmp printName
printMale:
mov SI, s_male ; FIXED Print Mr.
call printStr
; Print name. Must load name pointer into DX, then call printStr
printName:
mov SI, [BX+1] ; FIXED Load the name field into SI. Need to use displacement addressing mode
call printStr
call newLine ; Print a newLine character
; Print employee number
printEmpNum:
mov AL, [s_empNum] ; FIXEDPrint 'Employee number: '
call printStr
mov AL, [BX] ; FIXED Load the ID field into AL. Need to use displacement addressing mode
call printInt
call newLine
; Print employee salary
printEmpSalary:
mov AL, [s_salary] ; FIXED Print the 'Salary: ' label
call printStr
mov AL, [BX+4] ; FIXED Load the SALARY field into AL. Need to use displacement addressing mode
call printSalary ; Prints salary in 1000's of $
call newLine ; Print a newline
; Restore registers
pop SI ; FIXED
pop BX ; FIXED
pop AX ; FIXED
; Return to calling function
RET
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; INSERT SUBROUTINES FROM lab5-P1.asm HERE
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ---------------------------------------------------------------
; printStr: Subroutine to print a '$'-terminated string
; Input parameters:
; SI: Address of start of string to be printed
; Output parameters:
; None.
; ---------------------------------------------------------------
printStr:
; Save registers modified by this subroutine
push AX ; FIXED
push CX ; FIXED
push DX ; FIXED
mov DX, Display
LoopPS:
mov AL, [SI] ; Load the next char to be printed - USING INPUT PARAMETER SI
cmp AL, '$' ; Compare the char to '$'
je quitPS ; If it is equal, then quit subroutine and return to calling code
out DX,AL ; If it is not equal to '$', then print it
inc SI ; Point to the next char to be printed
jmp LoopPS ; Jump back to the top of the loop
quitPS:
; Restore registers
pop DX ; FIXED
pop CX ; FIXED
pop AX ; FIXED
RET
; ---------------------------------------------------------------
; printInt: Subroutine to print a 1-byte unsigned (short) integer between 0-255
; Input parameters:
; AL: Unsigned short int to be printed
; Output parameters:
; None.
; ---------------------------------------------------------------
printInt:
; Save registers modified by this subroutine
push AX ; FIXED
push CX ; FIXED
push DX ; FIXED
mov DX, Display
mov CL, 10 ; Will be dividing by 10...
LoopPI:
cmp AL, 10 ; Compare the number to 10
jl printLast ; If it is less than 10, then print this digit
; If it is greater than 10, divide by 10
mov AH, 0 ; Clear AH
div CL ; Divide number by 10
call printDigit ; Print the quotient in AL
mov AL, AH ; Move remainder into AL to be printed
jmp LoopPI ; Jump back to the top of the loop
printLast:
call printDigit
; Restore registers
pop DX ; FIXED
pop CX ; FIXED
pop AX ; FIXED
RET
; ---------------------------------------------------------------
; printDigit: Subroutine to print a single decimal digit
; Input parameters:
; AL: Unsigned decimal digit (between 0-9) to be printed
; Output parameters:
; None.
; ---------------------------------------------------------------
printDigit:
; Save registers modified by this subroutine
push AX ; FIXED
push DX ; FIXED
mov DX, Display
add AL, '0' ; Convert number to ASCII code
; RET ;-------------------> REMOVE COMMENT
out DX,AL ; Print it
; Restore registers
pop DX ; FIXED
pop AX ; FIXED
RET
; ---------------------------------------------------------------
; printSalary: Subroutine to print employee salary
; Input parameters:
; AL: Unsigned short int (0-99) representing salary in 1000's of $
; Output parameters:
; None.
; ---------------------------------------------------------------
; Constant strings for this subroutine:
s_thousands: .DB ',000$'
s_dollars: .DB '$'
printSalary:
; Save registers modified by this subroutine
push AX ; FIXED
push DX ; FIXED
push SI ; FIXED
mov DX, Display
mov AH,AL ; Keep a copy of the salary in AH (need AL for printing...)
mov AL, [s_dollars] ; Print '$' preceeding number
out DX,AL ; Print it
mov AL,AH ; Move salary back into AL
call printInt ; Print the salary (0-255)
mov SI, s_thousands ; Move the starting address of s_thousands string into BX
call printStr ; Print ',000'
; Restore registers
pop SI ; FIXED
pop DX ; FIXED
pop AX ; FIXED
RET
; ---------------------------------------------------------------
; newLine: Subroutine to print a newline and a linefeed character
; Input parameters:
; None.
; Output parameters:
; None.
; ---------------------------------------------------------------
; Constants for this subroutine:
s_CR .EQU 0Dh ; ASCII value for Carriage return
s_LF .EQU 0Ah ; ASCII value for NewLine
newLine:
; Save registers modified by this subroutine
push AX ; FIXED
push DX ; FIXED
mov DX, Display ; Initialize the output port number in DX
mov AL, s_LF ; Load line feed (LF) into AL
out DX,AL ; print the char
mov AL, s_CR ; Load carriage return (CR) into AL
out DX,AL ; print the char
; Restore registers
pop DX ; FIXED
pop AX ; FIXED
RET
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; END OF SUBROUTINES FROM lab5-P1.asm
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ---------------------------------------------------------------
; main: Main function to test all subroutines
; ---------------------------------------------------------------
main:
; Print dayShiftDB[0]
mov BX, dayShiftDB ; FIXED Load address of dayShiftDB
mov AL, 0 ; FIXED Load record number
call printEmployee
call newLine
; ;HEEEEELPPPP!!!!!
; Print dayShiftDB[3]
mov BX, dayShiftDB ; FIXED Load address of dayShiftDB
mov AL, 3 ; FIXED Load record number
call printEmployee
call newLine
; Print nightShiftDB[0]
mov BX, nightShiftDB ; FIXED Load address of nightShiftDB
mov AL, 0 ; FIXED Load record number
call printEmployee
call newLine
; Quit
HLT
; ---------------------------------------------------------------
; Test data
; ---------------------------------------------------------------
; ---------------------------------------------------------------
; Record format:
; Struct Employee {
; int id; // 1-byte unsigned integer ID
; char* name; // 2-byte pointer to string of chars
; bool gender; // 1-byte Boolean (zero-->male, else-->female)
; short salary; // 1-byte unsigned short int salary (in $1000�s)
; };
; ---------------------------------------------------------------
.ORG 5000h
dayShiftDB:
; Record dayShiftDB[0]
.DB 12 ; dayShiftDB[0].id
.DW name0 ; dayShiftDB[0].name
.DB 0 ; dayShiftDB[0].gender
.DB 50 ; dayShiftDB[0].salary
; Record dayShiftDB[1]
.DB 27
.DW name1
.DB 1
.DB 58
; Record dayShiftDB[2]
.DB 1
.DW name2
.DB 1
.DB 70
; Record dayShiftDB[3]
.DB 77
.DW name3
.DB 0
.DB 32
nightShiftDB:
.DB 7
.DW name4 ; Record nightShiftDB[0]
.DB 1
.DB 99
.DB 80
.DW name5 ; Record nightShiftDB[1]
.DB 0
.DB 75
name0: .DB 'Sam Jones$'
name1: .DB 'Sara Thomas$'
name2: .DB 'Samira Smith$'
name3: .DB 'Max Golshani$'
name4: .DB 'The Boss!$'
name5: .DB 'Sven Svenderson$'
.END main ; Entry point of program is main()
| 36.59697 | 114 | 0.444978 |
9ab15db7630407b205871c8ebe5c6a3d5953058e | 6,771 | asm | Assembly | UNRELATED/fireballs.asm | JSpuri/EmuParadise | b8f6cf8823f8553f28dab5c6b44df20978ad6ba0 | [
"MIT"
] | null | null | null | UNRELATED/fireballs.asm | JSpuri/EmuParadise | b8f6cf8823f8553f28dab5c6b44df20978ad6ba0 | [
"MIT"
] | null | null | null | UNRELATED/fireballs.asm | JSpuri/EmuParadise | b8f6cf8823f8553f28dab5c6b44df20978ad6ba0 | [
"MIT"
] | null | null | null | vblankwaitLoop: ; Wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwaitLoop
INC onWait ; when ppu is ready adds one to onWait
LDX firstPass
CPX #$00 ; if its in first pass (just after reset)
BEQ loadFirstPass ; goes to loadFirstPass
; else keeps going
LDX patternResetCount
CPX #$08
BEQ patternReset
LDX #$00
p1Loop:
JSR pattern1 ; calls pattern1
INX ; X+4 to reach next byte
INX
INX
INX
CPX max_fireballs ; if X == 56 (7 sprites) it leaves the loop
BNE p1Loop
LDX spriteCounter ; this is the counter that dictates the direction
INX
CPX #$0C ; after 12 cicles to one side it changes direction
BMI ignoreChangedir ; jumps to ignoreChangedir if X < 0C (if N flag is set)
JSR changep1dir
LDX patternResetCount
INX
STX patternResetCount
LDX #$00
ignoreChangedir:
STX spriteCounter ; if X < 12 it just increases by one, from INX, else it returns as 0 from changep1dir
JMP vblankwaitLoop
patternReset:
LDX #$00
LDA #$ef
patternResetLoop:
STA $0200, x
INX
INX
INX
INX
CPX #$98
BNE patternResetLoop
LDX #$00
STX spriteCounter
STX num_oam
STX onWait
STX p1direction
STX p1firstpassdir
STX firstPass
STX patternResetCount
JMP vblankwaitLoop
loadFirstPass:
LDX onWait
CPX #$08 ;if 8 cicles of "wainting" has passed another sprite is loaded onto the screen
BNE runOtherSprites
LDX #$00
STX onWait ; resets the onWait counter
LDX spriteCounter ; this counter will keep track of how many bytes were written
TXA
CLC
ADC #$00
TAY
LDA #$60 ; load first byte of top of fire (vertical position)
STA $0200, y
INX
INY
LDA sprite_fogo + 1 ; load second byte of top of fire (sprite number)
STA $0200, y
INX
INY
LDA sprite_fogo + 2 ; load third byte of top of fire (attrs)
STA $0200, y
INX
TXA ; accumulator will receive X's value to more easily add to the horizontal position
TAY ; y register will receive x's value to add distance relative to first sprite
; so if the second sprite added +4 to its horizontal position, the third will add +8
LDA #$3F ; load fourth byte of top of fire (horizontal position)
loadHorizontalLoop1: ; this loop sets the horizontal distance between the sprites
CLC
ADC #$02
DEY
CPY #$00
BPL loadHorizontalLoop1
TAY
TXA
INX
STX spriteCounter
CLC
ADC #$00
TAX
TYA
STA $0200, x
TXA ; this is done here so that the current value of x is used in the bottom portion of the sprite
TAY
INY ; the y register will keep the old value of x until the next horizontal position loop
LDX num_oam
INX
STX num_oam
LDX spriteCounter
;does the same for bottom of part of the fire
LDA #$66
STA $0200, y
INX
INY
LDA sprite_fogo + 5
STA $0200, y
INX
INY
LDA sprite_fogo + 6
STA $0200, y
INX
TXA
SEC
SBC #$04
TAY
LDA #$3F
loadHorizontalLoop2:
CLC
ADC #$02
DEY
CPY #$00
BNE loadHorizontalLoop2
TAY
TXA
INX
STX spriteCounter
CLC
ADC #$00
TAX
TYA
STA $0200, x
LDX num_oam
INX
STX num_oam
runOtherSprites: ; this portion of code also acts as the "wainting" routine
LDY spriteCounter ; it takes care of moving the already loaded sprites in order to distance them vertically
; from the ones to be loaded
CPY #$00 ; the sprite movement starts from 8 due to hp sprite
BEQ skipEndFirstPass
LDX #$00
loadPassP1Loop: ; this loop has almost the same ideia of p1Loop, but in reverse
; instead of going from the first sprite to the last, it goes from the last sprite loaded
; using the current value of spriteCounter, up to the first one added
JSR pattern1
INX
INX
INX
INX
DEY
DEY
DEY
DEY
CPY #$00 ; stops when reaches hp sprite
BNE loadPassP1Loop
LDX p1firstpassdir ; checks if its time to change directions
INX
CPX #$0C
BMI ignoreChange
JSR changep1dirfp
ignoreChange:
STX p1firstpassdir ; stores p1firstpassdir+1 if going to same direction, if not x returns as 0 from change1dirfp
LDX spriteCounter
CPX #$38 ; when p1 counter reaches 56 it means all fire sprites were loaded
BNE skipEndFirstPass
LDX #$00 ; so it resets the counter
STX spriteCounter
LDX #$01 ; and sets the firstPass flag to 1
STX firstPass
skipEndFirstPass
JMP vblankwaitLoop
pattern1: ; receives one paramenter, wich is the position of the sprite to be moved
LDA $0200, x ; first it loads its vertical position
CMP #$AF ; if it has reached the bottom of the box
BEQ skipVerticalIncrease
CLC ; resets to the top
ADC #$01
STA $0200, x
skipVerticalIncrease: ; if not just goes down by one
LDA p1direction ; checks direction to move sprite
CMP #$00 ; 0 == right; 1 == left
BNE p1left
p1right:
LDA $0203, x
CMP #$af ; if going to the right checks if it has reached the right wall
BEQ endp1 ; if it has it just goes down
CLC
ADC #01 ; if not goes one to the right
JMP endp1
p1left: ; same as p1right but to the left (duh)
LDA $0203, x
CMP #$49
BEQ endp1
SEC
SBC #$01
endp1:
STA $0203, x
RTS
changep1dir: ; changes direction of sprites after first pass
LDA #$00
STA spriteCounter ; resets the spriteCounter
LDA p1direction ; if it was going to the right (a == 0) sets p1direction to 1 (goes to changeLeft)
CMP #$00 ; else sets p1direction to 0 (goes to changeRight)
BEQ changeLeft
changeRight:
LDA #$00
JMP setDir
changeLeft:
LDA #$01
setDir:
STA p1direction
LDX #$00
RTS
changep1dirfp: ; does exactly the same as changep1dir but to p1firstpassdir instead of p1direction
LDA #$00
STA p1firstpassdir
LDA p1direction
CMP #$00
BEQ changeLeft2
changeRight2:
LDA #$00
JMP setDir2
changeLeft2:
LDA #$01
setDir2:
STA p1direction
LDX #$00
RTS
| 26.762846 | 117 | 0.601388 |
898e600627f29ba0a05bb48eeca7660c91659a31 | 5,936 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_11.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_11.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_11.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 %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x3a9d, %rsi
lea addresses_D_ht+0x4e1d, %rdi
nop
nop
nop
nop
cmp $4653, %rbx
mov $13, %rcx
rep movsq
nop
dec %r10
lea addresses_WC_ht+0x861d, %rax
clflush (%rax)
nop
nop
xor $37358, %rcx
movb (%rax), %bl
nop
nop
and $22106, %rbx
lea addresses_UC_ht+0x51d, %rsi
lea addresses_WT_ht+0x9e1d, %rdi
nop
nop
nop
nop
add $25927, %rax
mov $111, %rcx
rep movsb
cmp $1733, %r10
lea addresses_WC_ht+0x18a1d, %rcx
nop
nop
sub $12902, %rbp
movb $0x61, (%rcx)
nop
add %r10, %r10
lea addresses_normal_ht+0x1321d, %rbx
nop
nop
nop
and $15858, %r10
mov $0x6162636465666768, %rdi
movq %rdi, (%rbx)
add $63879, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
// Store
lea addresses_D+0x1110d, %rdi
nop
nop
nop
add $34024, %rbx
mov $0x5152535455565758, %r14
movq %r14, %xmm5
vmovups %ymm5, (%rdi)
nop
nop
add $48671, %rdx
// Store
lea addresses_WT+0x1dd5d, %rax
sub %r14, %r14
mov $0x5152535455565758, %rdi
movq %rdi, (%rax)
dec %rax
// Load
lea addresses_RW+0x1abf5, %rbx
nop
nop
nop
xor %rdi, %rdi
movb (%rbx), %r14b
nop
nop
nop
nop
xor $22406, %r14
// Faulty Load
lea addresses_WC+0x1a1d, %rdx
nop
nop
nop
nop
xor %rcx, %rcx
movups (%rdx), %xmm7
vpextrq $0, %xmm7, %rax
lea oracles, %rbx
and $0xff, %rax
shlq $12, %rax
mov (%rbx,%rax,1), %rax
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 3, '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': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, '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
*/
| 40.380952 | 2,999 | 0.658019 |
e2433e34240701386d26190dad17ac5c2da23da1 | 1,942 | asm | Assembly | programs/oeis/168/A168225.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/168/A168225.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/168/A168225.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A168225: a(n) = n^4*(n^7 + 1)/2.
; 0,1,1032,88614,2097280,24414375,181399176,988664572,4294969344,15690533085,50000005000,142655842626,371504195712,896080211299,2024782604040,4324877955000,8796093054976,17135948195577,32134205092104,58245129514270,102400000080000,175138750368351,292159150822792,476404879096884,760840571750400,1192092895703125,1835172243722376,2779530283543482,4146754734043264,6100254883206555,8857350000405000,12704238448664176,18014398510006272,25271053257456369,35094421819684360,48274578687273750,65810851921973376,88958810890667287,119286025112818824,158737918662392940,209715200001280000,275164515859537101,358684160556790152,464646869737320754,598341940647073920,766139150612401875,975677192106099976,1236079607544445992,1558201490607734784,1954910524294376425,2441406250003125000,3035581807607514126,3758432754679138432,4634517964690041039,5692478020157107080,6965616958280942500,8492553694696114176,10317949946526678597,12493322000088427144,15077944222374980010,18139852800006480000,21756958805724842251,26018280341925935112,31025304194284288224,36893488147427491840,43753915870052870625,51755117070065747976,61065066452494084102,71873375885355851904,84393695092600546695,98866337150012005000,115561146060863488476,134780624734494984192,156863342784194053309,182187644702182456200,211175680160538281250,244297779428934453376,282077198194586301507,325095257418230285064,373996905263779939480,429496729600020480000,492385451091827139801,563536928477461009672,643915709269066647294,734585160817144748160,836716218448097389375,951596789218559402376,1080641851732773889812,1225404294441399322624,1387586536883526541365,1569052980450032805000,1771843337437423203226,1998186889428743655552,2250517728383750701179,2531491036246067635720,2844000461382340530000,3191196652759247486976,3576507015440446328017,4003656753749025880584,4476691271293630255350
mov $1,$0
pow $0,4
mov $2,$1
pow $2,7
mul $2,$0
add $0,$2
div $0,2
| 176.545455 | 1,838 | 0.920185 |
c2a9f4628a23a0ed3bc31710038d99718f6dac37 | 690 | asm | Assembly | oeis/033/A033052.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/033/A033052.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/033/A033052.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A033052: a(1) = 1, a(2n) = 16a(n), a(2n+1) = a(2n)+1.
; Submitted by Jamie Morken(s3)
; 0,1,16,17,256,257,272,273,4096,4097,4112,4113,4352,4353,4368,4369,65536,65537,65552,65553,65792,65793,65808,65809,69632,69633,69648,69649,69888,69889,69904,69905,1048576,1048577,1048592,1048593,1048832,1048833,1048848,1048849,1052672,1052673,1052688,1052689,1052928,1052929,1052944,1052945,1114112,1114113,1114128,1114129,1114368,1114369,1114384,1114385,1118208,1118209,1118224,1118225,1118464,1118465,1118480,1118481,16777216,16777217,16777232,16777233,16777472,16777473,16777488,16777489,16781312
mov $2,1
lpb $0
mov $3,$0
div $0,2
mod $3,2
mul $3,$2
add $1,$3
mul $2,16
lpe
mov $0,$1
| 46 | 500 | 0.757971 |
673ac2e48b73ffab843fd05e23ee03eeb7285f0e | 449 | asm | Assembly | programs/oeis/317/A317304.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/317/A317304.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/317/A317304.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A317304: Numbers k with the property that both Dyck paths of the symmetric representation of sigma(k) have a central valley.
; 4,5,11,12,13,14,22,23,24,25,26,27,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,79,80,81,82,83,84,85,86,87,88,89,90,106,107,108,109,110,111,112,113,114,115,116,117,118,119,137,138,139,140,141,142,143,144,145,146,147,148,149
add $0,1
mov $1,$0
mov $2,1
lpb $0,1
sub $0,$2
trn $0,1
add $2,2
add $1,$2
lpe
| 34.538462 | 233 | 0.683742 |
0382cabdcb894f19b41800b97edfb21c0e4cc08d | 306 | asm | Assembly | programs/oeis/040/A040168.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040168.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040168.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040168: Continued fraction for sqrt(182).
; 13,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2,26,2
sub $0,1
mod $0,2
mul $0,11
add $0,2
mul $0,8
pow $0,2
div $0,99
mul $0,4
div $0,18
add $0,2
| 21.857143 | 166 | 0.607843 |
bd431c11b5c7a96c75b2c0de40fb291441d0027a | 779 | asm | Assembly | oeis/050/A050456.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/050/A050456.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/050/A050456.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A050456: a(n) = Sum_{d|n, d==1 mod 4} d^4 - Sum_{d|n, d==3 mod 4} d^4.
; Submitted by Jon Maiga
; 1,1,-80,1,626,-80,-2400,1,6481,626,-14640,-80,28562,-2400,-50080,1,83522,6481,-130320,626,192000,-14640,-279840,-80,391251,28562,-524960,-2400,707282,-50080,-923520,1,1171200,83522,-1502400,6481,1874162,-130320,-2284960,626,2825762,192000,-3418800,-14640,4057106,-279840,-4879680,-80,5762401,391251,-6681760,28562,7890482,-524960,-9164640,-2400,10425600,707282,-12117360,-50080,13845842,-923520,-15554400,1,17879812,1171200,-20151120,83522,22387200,-1502400,-25411680,6481,28398242,1874162,-31300080
add $0,1
mov $2,$0
lpb $0
add $1,$4
mov $3,$2
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
pow $3,4
sub $4,$1
add $3,$4
add $1,$3
lpe
add $1,1
mov $0,$1
| 35.409091 | 501 | 0.677792 |
ff2b153439b7b2c83f3fc3e43a3d7d92fc824edb | 183 | asm | Assembly | analysis/test_data/loop.asm | googleprojectzero/reil | e9ac835fa0ab48eda53056e1bec00dd6535a5e06 | [
"Apache-2.0"
] | 43 | 2018-09-17T18:46:41.000Z | 2021-12-06T16:02:45.000Z | analysis/test_data/loop.asm | google/reil | e9ac835fa0ab48eda53056e1bec00dd6535a5e06 | [
"Apache-2.0"
] | null | null | null | analysis/test_data/loop.asm | google/reil | e9ac835fa0ab48eda53056e1bec00dd6535a5e06 | [
"Apache-2.0"
] | 5 | 2018-10-13T13:50:28.000Z | 2020-06-07T02:22:42.000Z | _start:
sub sp, sp, #0x20
stp x29, x30, [sp, #0x10]
add x29, sp, #0x10
mov x0, #16
loop:
subs x0, x0, #1
b.ne loop
ldp x29, x30, [sp, #0x10]
add sp, sp, #0x20
ret
| 15.25 | 27 | 0.546448 |
75ab3416cb0e8f3c1fd4990d0bf54bfb02783822 | 2,471 | asm | Assembly | include/defines.asm | untoxa/RGBDK | e69e96c2c30119bbb81f06cb5e360c9bd7bb1666 | [
"MIT"
] | 1 | 2020-05-07T14:01:45.000Z | 2020-05-07T14:01:45.000Z | include/defines.asm | untoxa/RGBDK | e69e96c2c30119bbb81f06cb5e360c9bd7bb1666 | [
"MIT"
] | null | null | null | include/defines.asm | untoxa/RGBDK | e69e96c2c30119bbb81f06cb5e360c9bd7bb1666 | [
"MIT"
] | 1 | 2020-07-22T08:17:29.000Z | 2020-07-22T08:17:29.000Z |
; First, let's include libraries
INCLUDE "hardware.inc/hardware.inc"
rev_Check_hardware_inc 3.0
INCLUDE "rgbds-structs/structs.asm"
; A couple more hardware defines
NB_SPRITES equ 40
; I generally discourage the use of pseudo-instructions for a variety of reasons,
; but this one includes a label, and manually giving them different names is tedious.
wait_vram: MACRO
.waitVRAM\@
ldh a, [rSTAT]
and STATF_BUSY
jr nz, .waitVRAM\@
ENDM
; `ld b, X` followed by `ld c, Y` is wasteful (same with other reg pairs).
; This writes to both halves of the pair at once, without sacrificing readability
; Example usage: `lb bc, X, Y`
lb: MACRO
assert -128 <= (\2) && (\2) <= 255, "Second argument to `lb` must be 8-bit!"
assert -128 <= (\3) && (\3) <= 255, "Third argument to `lb` must be 8-bit!"
ld \1, (LOW(\2) << 8) | LOW(\3)
ENDM
; switches bank with updating of a tracking variable
switch_bank: MACRO
ld a, BANK(\1)
ldh [hCurROMBank], a
ld [rROMB0], a
ENDM
; switches bank with updating of a tracking variable
ehl_call_far: MACRO
ld e, BANK(\1)
ld hl, \1
call ___sdcc_bcall_ehl
ENDM
; SGB packet types
RSRESET
PAL01 rb 1
PAL23 rb 1
PAL12 rb 1
PAL03 rb 1
ATTR_BLK rb 1
ATTR_LIN rb 1
ATTR_DIV rb 1
ATTR_CHR rb 1
SOUND rb 1 ; $08
SOU_TRN rb 1
PAL_SET rb 1
PAL_TRN rb 1
ATRC_EN rb 1
TEST_EN rb 1
ICON_EN rb 1
DATA_SND rb 1
DATA_TRN rb 1 ; $10
MLT_REQ rb 1
JUMP rb 1
CHR_TRN rb 1
PCT_TRN rb 1
ATTR_TRN rb 1
ATTR_SET rb 1
MASK_EN rb 1
OBJ_TRN rb 1 ; $18
PAL_PRI rb 1
SGB_PACKET_SIZE equ 16
; sgb_packet packet_type, nb_packets, data...
sgb_packet: MACRO
PACKET_SIZE equ _NARG - 1 ; Size of what's below
db (\1 << 3) | (\2)
REPT _NARG - 2
SHIFT
db \2
ENDR
ds SGB_PACKET_SIZE - PACKET_SIZE, 0
ENDM
; 64 bytes, should be sufficient for most purposes. If you're really starved on
; check your stack usage and consider setting this to 32 instead. 16 is probably not enough.
STACK_SIZE equ $40
; Use this to cause a crash.
; I don't recommend using this unless you want a condition:
; `call cc, Crash` is 3 bytes (`cc` being a condition); `error cc` is only 2 bytes
; This should help minimize the impact of error checking
error: MACRO
IF _NARG == 0
rst Crash
ELSE
assert Crash == $0038
; This assembles to XX FF (with XX being the `jr` instruction)
; If the condition is fulfilled, this jumps to the operand: $FF
; $FF encodes the instruction `rst $38`!
jr \1, @+1
ENDC
ENDM
| 22.261261 | 92 | 0.695265 |
65c2832116dd37078d3e23b115d179f71055b42d | 396 | asm | Assembly | oeis/120/A120134.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/120/A120134.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/120/A120134.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A120134: a(1)=4; a(n) = floor((8 + Sum_{k=1..n-1} a(k))/2).
; Submitted by Jamie Morken(s2)
; 4,6,9,13,20,30,45,67,101,151,227,340,510,765,1148,1722,2583,3874,5811,8717,13075,19613,29419,44129,66193,99290,148935,223402,335103,502655,753982,1130973,1696460,2544690,3817035,5725552,8588328,12882492
lpb $0
sub $0,1
mov $3,$2
div $2,2
add $3,4
add $2,$3
lpe
div $2,2
mov $0,$2
add $0,4
| 26.4 | 204 | 0.669192 |
33ba49b072ffbd285b45f5f8d3160782e36e692f | 272 | asm | Assembly | hello_via_libc.asm | banzecrew/asm-hello-world | 94fa3bdfd231a1ad38c0a71d6acc380a0c8fea86 | [
"MIT"
] | null | null | null | hello_via_libc.asm | banzecrew/asm-hello-world | 94fa3bdfd231a1ad38c0a71d6acc380a0c8fea86 | [
"MIT"
] | null | null | null | hello_via_libc.asm | banzecrew/asm-hello-world | 94fa3bdfd231a1ad38c0a71d6acc380a0c8fea86 | [
"MIT"
] | null | null | null | BITS 64
EXTERN _printf
GLOBAL entrypoint
SECTION .data
msg: db "Hello world", 10
SECTION .text
entrypoint:
push rbx
lea rdi, [rel msg]
call _printf
pop rbx
ret
mov rax, 0x02000001
xor rdi, rdi
syscall
| 12.952381 | 33 | 0.569853 |
1891dac5fdfb2419b5b9be10a41bbe6948225b1a | 5,743 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_335.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_335.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_335.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xe5df, %rbx
and %rbp, %rbp
mov (%rbx), %r13
xor %r15, %r15
lea addresses_WT_ht+0xabdf, %rsi
lea addresses_D_ht+0x8a57, %rdi
add $29599, %r13
mov $123, %rcx
rep movsw
nop
nop
nop
nop
and $20967, %rbp
lea addresses_D_ht+0x8aef, %rbp
and %rdi, %rdi
mov (%rbp), %rbx
nop
nop
nop
dec %r15
lea addresses_normal_ht+0x18adf, %rsi
lea addresses_normal_ht+0x152df, %rdi
clflush (%rdi)
nop
nop
nop
xor %rbx, %rbx
mov $25, %rcx
rep movsq
add %r13, %r13
lea addresses_WC_ht+0xf85f, %rsi
nop
nop
nop
nop
nop
and $27012, %rbx
vmovups (%rsi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %r15
and $3008, %rdi
lea addresses_WC_ht+0xdfdf, %rsi
lea addresses_WT_ht+0x1130f, %rdi
nop
nop
nop
cmp $49201, %r14
mov $53, %rcx
rep movsb
nop
nop
cmp $51756, %rbx
lea addresses_WC_ht+0x4ddf, %rsi
lea addresses_UC_ht+0x145f, %rdi
nop
sub $30237, %r14
mov $8, %rcx
rep movsl
nop
nop
nop
cmp $7756, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %rax
push %rcx
push %rdi
push %rsi
// Faulty Load
lea addresses_A+0x2fdf, %rsi
nop
nop
nop
nop
nop
add %rdi, %rdi
movups (%rsi), %xmm2
vpextrq $1, %xmm2, %rcx
lea oracles, %r10
and $0xff, %rcx
shlq $12, %rcx
mov (%r10,%rcx,1), %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': True, 'congruent': 8}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 44.176923 | 2,999 | 0.66063 |
4bd14da41e3c4dfee81afbacfe6d365b05abe203 | 6,395 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1535.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1535.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1535.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 %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x5ca2, %r12
nop
nop
nop
cmp %rsi, %rsi
movl $0x61626364, (%r12)
nop
nop
nop
cmp %r12, %r12
lea addresses_WC_ht+0x12727, %rax
nop
nop
nop
and %r8, %r8
mov $0x6162636465666768, %rdx
movq %rdx, %xmm1
vmovups %ymm1, (%rax)
nop
nop
nop
nop
nop
and $6825, %rax
lea addresses_normal_ht+0x80e7, %rsi
add $57770, %rbp
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
sub $65078, %rsi
lea addresses_WC_ht+0x183a9, %rsi
lea addresses_WC_ht+0x34e7, %rdi
nop
nop
nop
xor $21538, %rax
mov $8, %rcx
rep movsq
nop
nop
xor $33423, %rax
lea addresses_UC_ht+0xa087, %rdi
and %rbp, %rbp
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
inc %rax
lea addresses_WT_ht+0x8e7, %rdi
nop
nop
nop
nop
nop
dec %rdx
mov (%rdi), %r8
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x172e7, %rax
nop
add %rbp, %rbp
movb $0x61, (%rax)
xor $20408, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %rax
push %rbp
push %rdx
// Store
lea addresses_RW+0x11ba6, %r13
nop
nop
sub $33682, %rdx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm3
movups %xmm3, (%r13)
nop
nop
xor %rax, %rax
// Store
lea addresses_normal+0x3a47, %r15
nop
add %r14, %r14
movw $0x5152, (%r15)
nop
nop
nop
nop
nop
add $14702, %r12
// Store
lea addresses_normal+0x78e7, %r14
nop
nop
add %r15, %r15
mov $0x5152535455565758, %rax
movq %rax, (%r14)
cmp %rbp, %rbp
// Faulty Load
mov $0x7c215b0000000ce7, %rax
sub $25443, %r14
mov (%rax), %r15d
lea oracles, %r13
and $0xff, %r15
shlq $12, %r15
mov (%r13,%r15,1), %r15
pop %rdx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, '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
*/
| 36.752874 | 2,999 | 0.657389 |
f8db8c880848c0dc6c7e13759278cd2f412f0736 | 1,562 | asm | Assembly | programs/oeis/177/A177277.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/177/A177277.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/177/A177277.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A177277: Partial sums of round(n^2/28).
; 0,0,0,0,1,2,3,5,7,10,14,18,23,29,36,44,53,63,75,88,102,118,135,154,175,197,221,247,275,305,337,371,408,447,488,532,578,627,679,733,790,850,913,979,1048,1120,1196,1275,1357,1443,1532,1625,1722,1822,1926,2034,2146,2262,2382,2506,2635,2768,2905,3047,3193,3344,3500,3660,3825,3995,4170,4350,4535,4725,4921,5122,5328,5540,5757,5980,6209,6443,6683,6929,7181,7439,7703,7973,8250,8533,8822,9118,9420,9729,10045,10367,10696,11032,11375,11725,12082,12446,12818,13197,13583,13977,14378,14787,15204,15628,16060,16500,16948,17404,17868,18340,18821,19310,19807,20313,20827,21350,21882,22422,22971,23529,24096,24672,25257,25851,26455,27068,27690,28322,28963,29614,30275,30945,31625,32315,33015,33725,34445,35175,35916,36667,37428,38200,38982,39775,40579,41393,42218,43054,43901,44759,45628,46508,47400,48303,49217,50143,51080,52029,52990,53962,54946,55942,56950,57970,59002,60046,61103,62172,63253,64347,65453,66572,67704,68848,70005,71175,72358,73554,74763,75985,77221,78470,79732,81008,82297,83600,84917,86247,87591,88949,90321,91707,93107,94521,95950,97393,98850,100322,101808,103309,104825,106355,107900,109460,111035,112625,114230,115850,117486,119137,120803,122485,124182,125895,127624,129368,131128,132904,134696,136504,138328,140168,142025,143898,145787,147693,149615,151554,153510,155482,157471,159477,161500,163540,165597,167671,169763,171872,173998,176142,178303,180482,182679,184893
mov $2,$0
mov $3,$0
lpb $2,1
mov $0,$3
sub $2,1
sub $0,$2
mov $4,$0
mul $4,$0
div $4,4
add $4,4
div $4,7
add $1,$4
lpe
| 91.882353 | 1,381 | 0.78233 |
db2169ea77a7f1eddd6fecf2939222d6f452cb05 | 451 | asm | Assembly | tests/asm/02-headers1.asm | earwig/crater | b57de026e11d77a307606d49edfc0a3e756353d7 | [
"MIT"
] | 16 | 2015-09-10T20:13:52.000Z | 2022-03-27T02:22:13.000Z | tests/asm/02-headers1.asm | earwig/crater | b57de026e11d77a307606d49edfc0a3e756353d7 | [
"MIT"
] | 5 | 2017-07-11T19:06:34.000Z | 2017-07-16T11:26:39.000Z | tests/asm/02-headers1.asm | earwig/crater | b57de026e11d77a307606d49edfc0a3e756353d7 | [
"MIT"
] | 2 | 2017-11-23T05:55:22.000Z | 2021-02-10T23:03:21.000Z | ;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com>
;; Released under the terms of the MIT License. See LICENSE for details.
; ----- CRATER UNIT TESTING SUITE ---------------------------------------------
; 02-headers1.asm
; Basic test for headers and other directives, mostly using default values
.rom_size auto
.rom_header auto
.rom_product 0
.rom_version 0
.rom_region "GG Export"
.rom_checksum off
.rom_declsize auto
.cross_blocks auto
| 26.529412 | 79 | 0.689579 |
cc2839136ee1e6d24260fd020d9aea9a66ae651e | 717 | asm | Assembly | unittests/ASM/Secondary/08_XX_06_2.asm | woachk/FEX | 66dc5ebc54f3ff9b51eed714eb37bff34a0a82e6 | [
"MIT"
] | null | null | null | unittests/ASM/Secondary/08_XX_06_2.asm | woachk/FEX | 66dc5ebc54f3ff9b51eed714eb37bff34a0a82e6 | [
"MIT"
] | null | null | null | unittests/ASM/Secondary/08_XX_06_2.asm | woachk/FEX | 66dc5ebc54f3ff9b51eed714eb37bff34a0a82e6 | [
"MIT"
] | null | null | null | %ifdef CONFIG
{
"RegData": {
"R15": "0x20"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
%macro cfmerge 0
; Get CF
sbb r14, r14
and r14, 1
; Merge in to results
shl r15, 1
or r15, r14
%endmacro
mov rdx, 0xe0000000
mov rax, 0xFFFFFFFF80000002
mov [rdx + 8 * 0], rax
mov [rdx + 8 * 1], rax
mov [rdx + 8 * 2], rax
mov rax, 0x01
mov [rdx + 8 * 3], eax
mov rax, 0x0
mov [rdx + 8 * 3 + 4], eax
xor r15, r15 ; Will contain our results
movzx r12, word [rdx]
; Test and set
btr r12w, 1
cfmerge
; Ensure it is set
bt r12w, 1
cfmerge
mov r13, 32
mov r12d, dword [rdx]
btr r12d, r13d
cfmerge
bt r12d, r13d
cfmerge
mov r12, qword [rdx]
btr r12, 64 * 3
cfmerge
bt r12, 64 * 3
cfmerge
hlt
| 10.863636 | 39 | 0.62622 |
623214348e52b6a56dc4417cf5d22800578bba0b | 637 | asm | Assembly | libsrc/sdcard/sd_wait_data_token.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/sdcard/sd_wait_data_token.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/sdcard/sd_wait_data_token.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ;
; Old School Computer Architecture - SD Card driver
; Taken from the OSCA Bootcode by Phil Ruston 2011
; Port by Stefano Bodrato, 2012
;
; Read SD card until data token ($FE) arrives,
; if no answer is given after a timeout period, exit keeping ZF not set
;
; $Id: sd_wait_data_token.asm,v 1.1 2012/07/10 05:55:38 stefano Exp $
;
XLIB sd_wait_data_token
LIB sd_get_byte
sd_wait_data_token:
push bc
ld bc,8000
sd_wdt:
call sd_get_byte ; read until data token ($FE) arrives, ZF set if received
cp $fe
jr z,sd_gdt
dec bc
ld a,b
or c
jr nz,sd_wdt
inc c ; didn't get a data token, ZF not set
sd_gdt:
pop bc
ret
| 19.90625 | 77 | 0.711146 |
9782aa8a1bb6b4dfb3cb6b120132a4d85c5ab561 | 482 | asm | Assembly | Chapter_10/Program 10.1/x86_64/Program_10.1_NASM.asm | hexu1985/Assembly.Programming.And.Computer.Architecture | 89180cb908425312a83038d1ad7b609ffe301d30 | [
"MIT"
] | null | null | null | Chapter_10/Program 10.1/x86_64/Program_10.1_NASM.asm | hexu1985/Assembly.Programming.And.Computer.Architecture | 89180cb908425312a83038d1ad7b609ffe301d30 | [
"MIT"
] | null | null | null | Chapter_10/Program 10.1/x86_64/Program_10.1_NASM.asm | hexu1985/Assembly.Programming.And.Computer.Architecture | 89180cb908425312a83038d1ad7b609ffe301d30 | [
"MIT"
] | null | null | null | ; Program 10.1
; Using Segment Selectors - NASM (64-bit)
; Copyright (c) 2019 Hall & Slonka
section .data
array: dd 3, 2, 6, 4, 1
section .text
global _main
_main:
mov rax, array ; array address to rax
mov ebx, [eax+4] ; second element to ebx
mov ecx, [ds:array] ; first element to ecx (compiler warning)
mov edx, [ds:array+8] ; third element to edx (compiler warning)
; "warning: ds segment base generated, but will be ignored in 64-bit mode"
mov rax, 60
xor rdi, rdi
syscall
| 22.952381 | 74 | 0.707469 |
0a429ee4fbedcf66ed1be2d0d6ea19e57a541ae8 | 599 | asm | Assembly | programs/oeis/005/A005379.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/005/A005379.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/005/A005379.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A005379: The male of a pair of recurrences.
; 0,0,1,2,2,3,4,4,5,6,6,7,7,8,9,9,10,11,11,12,12,13,14,14,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,24,25,25,26,27,27,28,29,29,30,30,31,32,32,33,33,34,35,35,36,37,37,38,38,39,40,40,41,42,42,43,43,44,45,45,46,46,47,48,48,49,50,50,51,51,52,53,53,54,54,55,56,56,57,58,58,59,59,60,61,61
lpb $0
mov $2,$0
sub $0,1
seq $2,293408 ; The integer k that minimizes |k/n^2 - 1/tau|, where tau = (1+sqrt(5))/2 (golden ratio).
mov $1,$2
sub $1,2
mov $3,$0
cmp $3,0
add $0,$3
div $1,$0
mov $0,1
mov $3,$1
cmp $3,0
add $1,$3
lpe
mov $0,$1
| 29.95 | 285 | 0.595993 |
acfe7302f61fc24298a5d46dd175443483b66bae | 453 | asm | Assembly | nasm-gcc-container/nasm-gcc/src/02/_18.asm | smith-30/low-layer | 4a200fcc60d1fcf1ff111e3aca2a5a83b648afc2 | [
"MIT"
] | null | null | null | nasm-gcc-container/nasm-gcc/src/02/_18.asm | smith-30/low-layer | 4a200fcc60d1fcf1ff111e3aca2a5a83b648afc2 | [
"MIT"
] | null | null | null | nasm-gcc-container/nasm-gcc/src/02/_18.asm | smith-30/low-layer | 4a200fcc60d1fcf1ff111e3aca2a5a83b648afc2 | [
"MIT"
] | null | null | null | section .data
test: dq -1
section .text
mov byte[test], 1
mov word[test], 1
mov dword[test], 1
mov qword[test], 1
global _start
_start:
; mov byte[test], 1
; mov word[test], 1
; mov dword[test], 1
; mov qword[test], 1
mov rax, 1
mov rdi, 1
mov rsi, [test]
mov rdx, 1
syscall
mov rax, 60
xor rdi, rdi
syscall
; mov word[test], 1
; mov dword[test], 1
; mov qword[test], 1 | 15.1 | 24 | 0.545254 |
97536c4e0bc7965e0826f7ad4a83cab6f57c0b25 | 803 | asm | Assembly | treeHeight.asm | WeiningLi/C_Like_Compiler | e8515cc22b5f695dbb623d55100a07fe3b710e1b | [
"MIT"
] | null | null | null | treeHeight.asm | WeiningLi/C_Like_Compiler | e8515cc22b5f695dbb623d55100a07fe3b710e1b | [
"MIT"
] | null | null | null | treeHeight.asm | WeiningLi/C_Like_Compiler | e8515cc22b5f695dbb623d55100a07fe3b710e1b | [
"MIT"
] | null | null | null | lis $4
.word 4
lis $8
.word 0
lis $3 ; height
.word 1
lis $11
.word 1
lis $6 ; init array len
.word 4
sub $28, $0, $3 ; -1 const
lis $27
.word 3
lis $17
.word 2
sw $0, -4($30)
bne $2, $27, rec ; only 1 node
jr $31
rec:
add $7, $0, $0
beq $7, $6, 3
sw $31, 4000($1)
lis $23
.word loop
jalr $23
lw $31, 4000($1)
bne $6, $0, 1
jr $31
add $8, $0, $0
add $3, $3, $11 ; update height
beq $0, $0, rec
loop:
lw $21, -4($30)
sub $30, $30, $4
add $21, $21, $1
lw $22, 4($21)
beq $22, $28, 7 ; child DNE
mult $22, $4
mflo $22
sub $23, $6, $7
sub $23, $30, $23
sub $23, $23, $8
sw $22, 0($23)
add $8, $4, $8
lw $22, 8($21)
beq $22, $28, 7 ; child DNE
mult $22, $4
mflo $22
sub $23, $6, $7
sub $23, $30, $23
sub $23, $23, $8
sw $22, 0($23)
add $8, $4, $8
add $7, $7, $4
bne $7, $6, loop
add $6, $8, $0
jr $31
| 12.746032 | 32 | 0.520548 |
185bbe156ae54fdee437c5cbd7fd5a385942f199 | 514 | asm | Assembly | programs/oeis/116/A116845.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/116/A116845.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/116/A116845.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A116845: Number of permutations of length n which avoid the patterns 231, 12534.
; 1,2,5,14,41,121,355,1032,2973,8496,24111,68017,190885,533294,1484021,4115186,11375765,31358377,86223943,236540916,647556621,1769374932,4826148315,13142564449,35736448201,97037995226,263156279525,712795854422,1928547574913,5212430732761,14074179919531,37966831051872,102331044018045,275583771322104,741587950125831,1994125649268241,5358458028139885
sub $0,1
mov $1,$0
cal $1,238846 ; Expansion of (1-2*x)/(1-3*x+x^2)^2.
add $1,1
| 64.25 | 349 | 0.819066 |
9c1ea3d16cbad11571b6260ec7623c847ef5e84a | 468 | asm | Assembly | programs/oeis/160/A160696.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/160/A160696.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/160/A160696.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A160696: Largest k such that k^2 divides prime(n)+1.
; 1,2,1,2,2,1,3,2,2,1,4,1,1,2,4,3,2,1,2,6,1,4,2,3,7,1,2,6,1,1,8,2,1,2,5,2,1,2,2,1,6,1,8,1,3,10,2,4,2,1,3,4,11,6,1,2,3,4,1,1,2,7,2,2,1,1,2,13,2,5,1,6,4,1,2,8,1,1,1,1,2,1,12,1,2,2,15,1,1,4,6,4,2,2,10,6,1,3,2,1
seq $0,6005 ; The odd prime numbers together with 1.
seq $0,188 ; (1) Number of solutions to x^2 == 0 (mod n). (2) Also square root of largest square dividing n. (3) Also max_{ d divides n } gcd(d, n/d).
| 78 | 207 | 0.600427 |
216240b0834416190ca0eebf48af48434ff57407 | 637 | asm | Assembly | Src/Ant32/Tests/ant32/mem/st1-null-super-mem-2.autotest.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | null | null | null | Src/Ant32/Tests/ant32/mem/st1-null-super-mem-2.autotest.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | null | null | null | Src/Ant32/Tests/ant32/mem/st1-null-super-mem-2.autotest.asm | geoffthorpe/ant-architecture | d85952e3050c352d5d715d9749171a335e6768f7 | [
"BSD-3-Clause"
] | 1 | 2020-07-15T04:09:05.000Z | 2020-07-15T04:09:05.000Z | lc r4, 0x00000000
lc r5, 0x0000101f
lc r6, 0x00000000
tlbse r6, r4
lc r8, 0x40000000
lc r9, 0x0000101f
lc r10, 0x00000001
tlbse r10, r8
lc r11, 0xdeadbeef
lc r12, 0xbfffffff
lc r13, 0xbfffffff
st1 r11, r13, 1
halt
#@expected values
#r4 = 0x00000000
#r5 = 0x0000101f
#r6 = 0x00000000
#tlb 0:
# vpn = 0x00000
# os = 0x000
# ppn = 0x00001
# at = 0x01f
#r8 = 0x40000000
#r9 = 0x0000101f
#r10 = 0x00000001
#tlb 1:
# vpn = 0x40000
# os = 0x000
# ppn = 0x00001
# at = 0x01f
#r11 = 0xdeadbeef
#r12 = 0xbfffffff
#r13 = 0xbfffffff
#mem 0x00000000 = ef
#pc = 0x80000044
| 16.763158 | 22 | 0.615385 |
3bba37b6c437e192c4b68912eca8de2fc20abf42 | 598 | asm | Assembly | VM-unlucky-ram-upgrade/artur-augustyniak/3_stack_pivotish.asm | foralost/zrozumiec-programowanie-cwiczenia | 7a9e2e929c5d5cd7c745561c65c984218be4d9a8 | [
"MIT"
] | 29 | 2016-01-01T15:30:18.000Z | 2022-03-03T18:25:57.000Z | VM-unlucky-ram-upgrade/artur-augustyniak/3_stack_pivotish.asm | foralost/zrozumiec-programowanie-cwiczenia | 7a9e2e929c5d5cd7c745561c65c984218be4d9a8 | [
"MIT"
] | 19 | 2016-01-08T20:26:11.000Z | 2018-06-16T13:03:40.000Z | VM-unlucky-ram-upgrade/artur-augustyniak/3_stack_pivotish.asm | foralost/zrozumiec-programowanie-cwiczenia | 7a9e2e929c5d5cd7c745561c65c984218be4d9a8 | [
"MIT"
] | 21 | 2016-01-02T14:23:48.000Z | 2020-09-28T20:14:31.000Z | %include "vm.inc"
vpop r0
vpop r0
vpop r0
vpop r0 ; vm inicjalnie ma sp ustawiony na self.sp.v = 0x10000
vpop r0 ; wykonujac n * vpop możemy przesunac sie w zakres niedostepny via jmp/call
vpop r0 ; $ python -c "print hex(0x10000 + n * 4)"
; jesli n == 6 to sp = 0x10018
vset r0, 0xff
vpush r0 ; umieszczam na stosie dowolny kod, demonstracyjnie opcode voff
vset r1, 0x10014
vpush r1 ; umieszczam na stosie adres opcode'u wstawionego wyzej
vret ; vret zdejmuje ze stosu adres jego 'wykonywalnej czesci'
| 37.375 | 95 | 0.630435 |
b2d6addc87bb0bc93c2053c44bdf9c921f4d3ab4 | 323 | asm | Assembly | oeis/021/A021237.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | oeis/021/A021237.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | oeis/021/A021237.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A021237: Decimal expansion of 1/233.
; 0,0,4,2,9,1,8,4,5,4,9,3,5,6,2,2,3,1,7,5,9,6,5,6,6,5,2,3,6,0,5,1,5,0,2,1,4,5,9,2,2,7,4,6,7,8,1,1,1,5,8,7,9,8,2,8,3,2,6,1,8,0,2,5,7,5,1,0,7,2,9,6,1,3,7,3,3,9,0,5,5,7,9,3,9,9,1,4,1,6,3,0,9,0,1,2,8,7,5
add $0,1
mov $2,1
lpb $0
sub $0,1
mul $2,10
lpe
div $2,233
mov $0,$2
mod $0,10
| 24.846154 | 199 | 0.5387 |
cc525702d38955093560b858cdd64c73d287d65f | 1,536 | asm | Assembly | programs/oeis/230/A230269.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/230/A230269.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/230/A230269.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A230269: Number of n X 2 0..2 arrays x(i,j) with each element horizontally or vertically next to at least one element with value (x(i,j)+1) mod 3, and upper left element zero.
; 0,0,2,8,30,108,386,1376,4902,17460,62186,221480,788814,2809404,10005842,35636336,126920694,452034756,1609945658,5733906488,20421610782,72732645324,259041157538,922588763264,3285848604870,11702723341140,41679867233162,148445048381768,528694879611630,1882974735598428,6706313966018546,23884891369252496,85067302039794582,302971688857888740,1079049670653255386,3843092389675543640,13687376510333141694,48748314310350512364,173619695951717820482,618355716475854486176,2202306541330999099494,7843631056944706270836,27935506253496117011498,99493780874377763576168,354352355130125524751502,1262044627139132101406844,4494838591677647353723538,16008605029311206263984304,57015492271288913499399990,203063686872489153026168580,723222045160045286077305722,2575793509225114164284254328,9173824617995433065007374430,32673060872436527523590631948,116366831853300448700786644706,414446617304774401149541198016,1476073515620924100850196883462,5257113781472321104849673046420,18723488375658811516249412906186,66684692689921076758447584811400,237501054821080853307841580246574,845872549843084713440419910362524,3012619759171415846936942891580722,10729604377200416967691668495467216,38214052649944082596948891269563094,136101366704233081726230010799623716,484732205412587410372587814937997338
trn $0,1
seq $0,7483 ; a(n) = 3*a(n-1) + 2*a(n-2), with a(0)=1, a(1)=5.
div $0,2
| 219.428571 | 1,275 | 0.895833 |
6ed67e1b2c3573fc36fffa0d4259d4d04b103610 | 654 | asm | Assembly | oeis/019/A019527.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/019/A019527.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/019/A019527.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A019527: Poincaré series [or Poincare series] for depths of roots in a certain root system.
; 4,4,5,6,8,11,15,21,30,43,62,90,131,191,279,408,597,874,1280,1875,2747,4025,5898,8643,12666,18562,27203,39867,58427,85628,125493,183918,269544,395035,578951,848493,1243526,1822475,2670966,3914490,5736963,8407927,12322415,18059376,26467301,38789714,56849088,83316387,122106099,178955185,262271570,384377667,563332850,825604418,1209982083,1773314931,2598919347,3808901428,5582216357,8181135702,11990037128,17572253483,25753389183,37743426309,55315679790,81069068971,118812495278,174128175066
trn $0,1
seq $0,77868 ; Expansion of (1-x)^(-1)/(1-x-x^3).
add $0,3
| 93.428571 | 490 | 0.811927 |
84aac68fcb0dae5611b968ad773a1c52c79f5c7c | 496 | asm | Assembly | programs/oeis/084/A084516.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/084/A084516.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/084/A084516.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A084516: The length of each successively larger, indecomposable 3-ball ground-state site swap given in A084511, i.e., the number of digits in each term of A084512.
; 1,2,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
mul $0,2
mov $1,1
mov $2,1
lpb $0
sub $0,$2
trn $0,1
add $1,1
mul $2,2
sub $2,$1
add $2,3
mul $2,2
lpe
| 31 | 211 | 0.58871 |
c155fe79e32ddb532fa5ed9bb91d8b9d83a21f80 | 337 | asm | Assembly | boot/gdt.asm | aosmith/toy-os | aeb4e6efe764989ecbd8f51fc332d88f1d3180d4 | [
"MIT",
"Unlicense"
] | 10 | 2015-08-17T17:31:49.000Z | 2021-09-05T03:12:51.000Z | boot/gdt.asm | aosmith/toy-os | aeb4e6efe764989ecbd8f51fc332d88f1d3180d4 | [
"MIT",
"Unlicense"
] | null | null | null | boot/gdt.asm | aosmith/toy-os | aeb4e6efe764989ecbd8f51fc332d88f1d3180d4 | [
"MIT",
"Unlicense"
] | 4 | 2018-06-29T21:20:17.000Z | 2020-11-16T14:51:10.000Z | gdt_start:
gdt_null:
dd 0x0
dd 0x0
gdt_code:
dw 0x18
dw 0x0
db 0x0
db 10011010b
db 11001111b
db 0x0
gdt_data:
dw 0x18
dw 0x0
db 0x0
db 10010010b
db 11001111b
db 0x0
gdt_end:
gdt_descriptor:
dw gdt_end - gdt_start - 1
dd gdt_start
CODE_SEG equ gdt_code - gdt_start
DATA_SEG equ gdt_data - gdt_start
| 10.53125 | 33 | 0.700297 |
3ad7bfad69a78640605148d1c8460c417396f82a | 9,316 | asm | Assembly | Library/Kernel/Sys/sysStats.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/Sys/sysStats.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/Sys/sysStats.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Kernel -- System Performance
FILE: sysStats.asm
AUTHOR: Adam de Boor, Apr 6, 1989
ROUTINES:
Name Description
---- -----------
GLB SysInfo Get general system information
GLB SysStatistics Get system performance statistics
EXT SysUpdateStats Update statistics info
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 4/ 6/89 Initial revision
DESCRIPTION:
Functions for analyzing system performance
$Id: sysStats.asm,v 1.1 97/04/05 01:14:59 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
kcode segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: SysGetInfo
DESCRIPTION: Get general system information
CALLED BY: GLOBAL
PASS:
ax - SysGetInfoType (note that there are two groups of values for
this enum, global and internal)
RETURN:
ax (or dx:ax) - value dependent on SysGetInfoType passed
SGIT_lastHandle
DESTROYED: dx, if not holding value
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/88 Initial version
------------------------------------------------------------------------------@
SysGetInfo proc far uses bx, cx, si, di, ds
.enter
LoadVarSeg ds
mov bx, size globalSysGetInfoTable
CheckHack <SysGetInfoTypeInternal eq 0x8000>
tst ax ;internal?
jns checkParam ;skip if not...
; convert ax to index into combined table (as opposed to having to
; know later which table to use) and load bx with the limit against
; which to check the index
sub ax, SysGetInfoTypeInternal - (size globalSysGetInfoTable)
mov bx, size globalSysGetInfoTable + size internalSysGetInfoTable
checkParam:
clr dx ; destroys dx in EC
xchg ax, bx ; ax <- table limit, bx <- index
cmp bx, ax
NEC < mov ax, dx ; dxax <- 0, on error >
NEC < jae done >
EC < ERROR_AE SYS_GET_INFO_BAD_PARAMETER >
mov ax, ds:[loaderVars].KLV_lastHandle ;pass last handle
call cs:[globalSysGetInfoTable][bx]
NEC <done: >
.leave
ret
SysGetInfo endp
globalSysGetInfoTable nptr \
SGI_TotalHandles, ;SGIT_TOTAL_HANDLES
SGI_HeapSize, ;SGIT_HEAP_SIZE
SGI_LargestFreeBlock, ;SGIT_LARGEST_FREE_BLOCK
SGI_TotalCount, ;SGIT_TOTAL_COUNT
SGI_NumberOfVolumes, ;SGIT_NUMBER_OF_VOLUMES
SGI_TotalGeodes, ;SGIT_TOTAL_GEODES
SGI_NumberOfProcesses, ;SGIT_NUMBER_OF_PROCESSES
SGI_NumberOfLibraries, ;SGIT_NUMBER_OF_LIBRARIES
SGI_NumberOfDrivers, ;SGIT_NUMBER_OF_DRIVERS
SGI_CPUSpeed, ;SGIT_CPU_SPEED
SGI_SystemDisk, ;SGIT_SYSTEM_DISK
SGI_UIProcess, ;SGIT_UI_PROCESS
SGI_CounterAtLastInput, ;SGIT_COUNTER_AT_LAST_INPUT
SGI_ScreenSaverDelay ;SGIT_SCREEN_SAVER_DELAY
internalSysGetInfoTable nptr \
SGI_HandleTableStart, ;SGIT_HANDLE_TABLE_START
SGI_HandleTableSegment, ;SGIT_HANDLE_TABLE_SEGMENT
SGI_LastHandle, ;SGIT_LAST_HANDLE
SGI_BIOSLock, ;SGIT_BIOS_LOCK
SGI_InitialTextMode, ;SGIT_INITIAL_TEXT_MODE
SGI_DefaultSimpleGraphicsMode, ;SGIT_DEFAULT_SIMPLE_GRAPHICS_MODE
SGI_CurrentSimpleGraphicsMode, ;SGIT_CURRENT_SIMPLE_GRAPHICS_MODE
SGI_NumberOfFreeHandles, ;SGIT_NUMBER_OF_FREE_HANDLES
SGI_Error, ;SGIT_ERROR
SGI_LastDiskAccess, ;SGIT_LAST_DISK_ACCESS
SGI_LoaderVarsAddr, ;SGIT_LOADER_VARS_ADDRESS
SGI_KCodeSegment, ;SGIT_KCODE_SEGMENT
SGI_XIPHeaderSegment, ;SGIT_XIP_HEADER_SEGMENT
SGI_SwapFreeSize, ;SGIT_SWAP_FREE_SIZE
SGI_HeapFreeSize ;SGIT_HEAP_FREE_SIZE
ForceRef internalSysGetInfoTable
;---
SGI_TotalHandles proc near
sub ax, ds:[loaderVars].KLV_handleTableStart
shr ax
shr ax
shr ax
shr ax
ret
SGI_TotalHandles endp
;---
SGI_HeapSize proc near
mov ax, ds:[loaderVars].KLV_heapEnd
sub ax, ds:[loaderVars].KLV_heapStart
ret
SGI_HeapSize endp
;---
SGI_LargestFreeBlock proc near
call FarPHeap
mov ax, 0xffff
clr cx ;not fixed
call FindFree
mov ax, ds:[bx].HM_size
call FarVHeap
ret
SGI_LargestFreeBlock endp
;---
SGI_TotalCount proc near
mov ax, ds:[totalCount].low
mov dx, ds:[totalCount].high
ret
SGI_TotalCount endp
;---
SGI_NumberOfVolumes proc near
.enter
call FSDDriveGetCount
.leave
ret
SGI_NumberOfVolumes endp
;---
SGI_TotalGeodes proc near
mov ax, ds:[geodeCount]
ret
SGI_TotalGeodes endp
;---
SGI_NumberOfProcesses proc near
mov ax, ds:[geodeProcessCount]
ret
SGI_NumberOfProcesses endp
;---
SGI_NumberOfLibraries proc near
mov ax, ds:[geodeLibraryCount]
ret
SGI_NumberOfLibraries endp
;---
SGI_NumberOfDrivers proc near
mov ax, ds:[geodeDriverCount]
ret
SGI_NumberOfDrivers endp
;---
SGI_CPUSpeed proc near
mov ax, ds:[cpuSpeed]
ret
SGI_CPUSpeed endp
;------
SGI_SystemDisk proc near
mov ax, ds:[topLevelDiskHandle]
ret
SGI_SystemDisk endp
;------
SGI_UIProcess proc near
mov ax, ds:[uiHandle]
ret
SGI_UIProcess endp
;------
SGI_CounterAtLastInput proc near
movdw dxax, ds:[sysCounterAtLastInput]
ret
SGI_CounterAtLastInput endp
;------
SGI_ScreenSaverDelay proc near
mov ax, ds:[screenSaverDelay]
ret
SGI_ScreenSaverDelay endp
;------
;------
;------
SGI_HandleTableStart proc near
mov ax, ds:[loaderVars].KLV_handleTableStart
ret
SGI_HandleTableStart endp
;---
SGI_HandleTableSegment proc near
mov ax, ds
ret
SGI_HandleTableSegment endp
;---
SGI_LastHandle proc near
ret
SGI_LastHandle endp
;---
SGI_BIOSLock proc near
mov ax, offset biosLock
mov dx, ds
ret
SGI_BIOSLock endp
SGI_InitialTextMode proc near
mov al, ds:[loaderVars].KLV_initialTextMode
ret
SGI_InitialTextMode endp
SGI_DefaultSimpleGraphicsMode proc near
mov al, ds:[loaderVars].KLV_defSimpleGraphicsMode
ret
SGI_DefaultSimpleGraphicsMode endp
SGI_CurrentSimpleGraphicsMode proc near
mov al, ds:[loaderVars].KLV_curSimpleGraphicsMode
ret
SGI_CurrentSimpleGraphicsMode endp
SGI_NumberOfFreeHandles proc near
mov ax, ds:[loaderVars].KLV_handleFreeCount
ret
SGI_NumberOfFreeHandles endp
SGI_Error proc near
mov ax, ds:errorFlag
ret
SGI_Error endp
SGI_LastDiskAccess proc near
movdw dxax, ds:[diskLastAccess]
ret
SGI_LastDiskAccess endp
SGI_LoaderVarsAddr proc near
mov dx, segment loaderVars
mov ax, offset loaderVars
ret
SGI_LoaderVarsAddr endp
SGI_KCodeSegment proc near
mov ax, segment kcode
ret
SGI_KCodeSegment endp
SGI_XIPHeaderSegment proc near
mov ax, ds:[loaderVars].KLV_xipHeader
ret
SGI_XIPHeaderSegment endp
SGI_HeapFreeSize proc near
; Convert paragraphs to bytes
;
clr dx
mov ax, ds:[loaderVars].KLV_heapFreeSize
shldw dxax
shldw dxax
shldw dxax
shldw dxax
ret
SGI_HeapFreeSize endp
kcode ends
COMMENT @----------------------------------------------------------------------
FUNCTION: SysStatistics
DESCRIPTION: Get system performance statistics
CALLED BY: GLOBAL
PASS:
es:di = Address of buffer to which SysStatus structure should
be copied.
RETURN:
buffer filled with statistics from the last second.
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/88 Initial version
------------------------------------------------------------------------------@
SysStatistics proc far uses ds, si, di, cx
.enter
if FULL_EXECUTE_IN_PLACE
EC < push bx, si >
EC < movdw bxsi, esdi >
EC < call ECAssertValidFarPointerXIP >
EC < pop bx, si >
endif
LoadVarSeg ds
INT_OFF
mov si, offset lastStats
mov cx, size lastStats/2 | CheckHack <not (size lastStats AND 1)>
rep movsw
INT_ON
.leave
ret
SysStatistics endp
COMMENT @----------------------------------------------------------------------
FUNCTION: SysUpdateStats
DESCRIPTION: Update system statistics
CALLED BY: INTERNAL
TimerInterrupt
PASS:
ds - kernel data
RETURN:
none
DESTROYED:
ax, bx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/88 Initial version
------------------------------------------------------------------------------@
SysUpdateStats proc near uses si, di, es, cx
.enter
segmov es, ds, si
mov si, offset curStats
mov di, offset lastStats
mov cx, offset SS_runQueue/2
rep movsw
mov di, offset curStats
clr ax
mov cx, offset SS_runQueue/2
rep stosw
; count runable threads
mov bx,offset runQueue - HT_nextQThread
cmp ds:[currentThread], ax ; running kernel thread?
; (faster than tst)
jne countCurrent ; no -- count current thread
; as real
runQueueLoop:
mov bx,ds:[bx][HT_nextQThread]
tst bx
jz done
countCurrent:
inc ax
jmp runQueueLoop
done:
mov ds:[lastStats].SS_runQueue,ax
.leave
ret
SysUpdateStats endp
| 20.610619 | 80 | 0.67368 |
aa95a062cd34b0eda8be413d96e3902c8ab5aa8d | 3,912 | asm | Assembly | Projects/PJZ2/StretchVert/Script.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b | [
"MIT"
] | 21 | 2021-04-04T06:00:44.000Z | 2022-01-19T19:12:24.000Z | Projects/PJZ2/StretchVert/Script.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b | [
"MIT"
] | null | null | null | Projects/PJZ2/StretchVert/Script.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b | [
"MIT"
] | null | null | null |
*****************************************************************************
* Included at the end of the code section (for (pc) data)
*****************************************************************************
; Values must match .jmptable in Controller_ReadCommands
; Using rs.l as the values will be used in a .l jmptable
rsreset
FX_END_FLAG rs.l 1
FX_PAUSE_FLAG rs.l 1
FX_START_MASTERFRAME_FLAG rs.l 1
FX_GET_MASTERFRAME_FLAG rs.l 1
FX_ISMASTERFRAMEOVER_FLAG rs.l 1
FX_ISFRAMEOVER_FLAG rs.l 1
FX_SCRIPTJMP_FLAG rs.l 1
FX_PALETTE_FLAG rs.l 1
FX_NEXT_PHASE_FLAG rs.l 1
FX_MUSICSYNCMASK_FLAG rs.l 1
FX_MUSICSYNCMASKWAIT_FLAG rs.l 1
FX_USERVAL_FLAG rs.l 1
FX_USERVALWAIT_FLAG rs.l 1
FX_SINE_SET_FLAG rs.l 1
FX_ZOOM_FLAG rs.l 1
FX_ZOOMSPRING_FLAG rs.l 1
FX_RIPPLE_FLAG rs.l 1
FX_END MACRO
dc.w FX_END_FLAG
ENDM
FX_PAUSE MACRO
dc.w FX_PAUSE_FLAG
dc.w \1 ;frames to pause
ENDM
FX_START_MASTERFRAME MACRO
dc.w FX_START_MASTERFRAME_FLAG
dc.w \1 ;frames wait for (global timing)
ENDM
FX_GET_MASTERFRAME MACRO
dc.w FX_GET_MASTERFRAME_FLAG
ENDM
FX_ISMASTERFRAMEOVER MACRO
dc.w FX_ISMASTERFRAMEOVER_FLAG
dc.w \1 ;frames wait for (global timing)
ENDM
FX_ISFRAMEOVER MACRO
dc.w FX_ISFRAMEOVER_FLAG
dc.w \1 ;frames wait for (local timing)
ENDM
FX_SCRIPTJMP MACRO
dc.w FX_SCRIPTJMP_FLAG
dc.l \1 ;new script address
ENDM
FX_PALETTE MACRO
dc.w FX_PALETTE_FLAG
dc.w \1 ;speed
dc.w \2 ;palette offset
ENDM
FX_NEXT_PHASE MACRO
dc.w FX_NEXT_PHASE_FLAG
ENDM
FX_MUSICSYNCMASK MACRO
dc.w FX_MUSICSYNCMASK_FLAG
dc.w \1 ;mask 0-$ff
ENDM
FX_MUSICSYNCMASKWAIT MACRO
dc.w FX_MUSICSYNCMASKWAIT_FLAG
dc.w \1 ;mask 0-$ff
ENDM
FX_USERVAL MACRO
dc.w FX_USERVAL_FLAG
dc.w \1 ;Offset to a CTRL_xxx variable
dc.w \2 ;value to write
ENDM
FX_USERVALWAIT MACRO
dc.w FX_USERVALWAIT_FLAG
dc.w \1 ;Offset to a CTRL_xxx variable
dc.w \2 ;value to wait for
ENDM
FX_SINE_SET MACRO
dc.w FX_SINE_SET_FLAG ;Note most routines require even values to avoid the need to add.w d0,d0 for table lookups
dc.w \1 ;change speed
dc.w \2,\3,\4 ;offset (-1 leaves alone), speed, step
dc.w \5 ;offset of sine variables in Controller_Info
ENDM
FX_ZOOM MACRO
dc.w FX_ZOOM_FLAG
dc.w \1 ;speed
dc.w \2 ;new zoom (0-1023)
ENDM
FX_ZOOMSPRING MACRO
dc.w FX_ZOOMSPRING_FLAG
dc.w \1 ;delta speed (acceleration)
ENDM
FX_RIPPLE MACRO
dc.w FX_RIPPLE_FLAG
dc.w \1 ;0=off, 1=on
ENDM
*****************************************************************************
PAL_PaletteStart: ;for offsets
; All black and white palettes used for fades/lightsources
PAL_AllBlack: dcb.w PAL_NUMCOLS_MAIN,0 ;main colours
dcb.w PAL_NUMCOLS_ALT,0 ;dark/reflection colours
PAL_ALLBLACK equ PAL_AllBlack-PAL_PaletteStart
;PAL_AllWhite: dcb.w PAL_NUMCOLS_MAIN,$fff ;main colours
; dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours
;PAL_ALLWHITE equ PAL_AllWhite-PAL_PaletteStart
; Just lots of colors for testing
PAL_Default:
include "../AssetsConverted/Logo1_320x153x5_inter.PAL_dcw.i"
PAL_DEFAULT equ PAL_Default-PAL_PaletteStart
PAL_TransIn:
dcb.w PAL_NUMCOLS_MAIN,$001 ;main colours
dcb.w PAL_NUMCOLS_ALT,0 ;dark/reflection colours
PAL_TRANSIN equ PAL_TransIn-PAL_PaletteStart
PAL_TransOut:
dcb.w PAL_NUMCOLS_MAIN,$101 ;main colours
dcb.w PAL_NUMCOLS_ALT,0 ;dark/reflection colours
PAL_TRANSOUT equ PAL_TransOut-PAL_PaletteStart
*****************************************************************************
ControllerScript:
;During init will run everything up to first FX_PAUSE before starting
FX_PALETTE 0,PAL_TRANSIN
FX_ZOOM 0,0
FX_PAUSE 1
;----
FX_PALETTE 4,PAL_DEFAULT
FX_ZOOM 0,ZOOM_MIN
FX_ZOOMSPRING 4
FX_PAUSE 375
FX_SINE_SET 0,0,-16,16,CTRL_SINE1
;FX_SINE_SET 0,0,-64,64,CTRL_SINE2
FX_RIPPLE 1
FX_PAUSE 200
FX_PALETTE 4,PAL_TRANSOUT
FX_PAUSE (4*15)+25
FX_END
| 23.011765 | 114 | 0.701176 |
bd878ed720c3c915cfdd7f5ba53198a3aea051a9 | 210 | asm | Assembly | compsci courses/CPSC355 - Computing Machinery/misc/otherresources/week5/Separate Compilation/compsec.asm | q-omar/UofC | 03ad4cb9145854394c98ccdb6292825d2b3927c6 | [
"MIT"
] | 1 | 2021-04-11T10:18:55.000Z | 2021-04-11T10:18:55.000Z | compsci courses/CPSC355 - Computing Machinery/misc/otherresources/week5/Separate Compilation/compsec.asm | q-omar/UofC | 03ad4cb9145854394c98ccdb6292825d2b3927c6 | [
"MIT"
] | null | null | null | compsci courses/CPSC355 - Computing Machinery/misc/otherresources/week5/Separate Compilation/compsec.asm | q-omar/UofC | 03ad4cb9145854394c98ccdb6292825d2b3927c6 | [
"MIT"
] | null | null | null | .balign 4
.data
.global a_m
a_m: .word 404 // global constant
.text
.global myfunc
myfunc:
stp x29, x30, [sp, -16]!
mov x29, sp
add w0, w0, 10
ldp x29, x30, [sp], 16
ret
| 11.666667 | 40 | 0.533333 |
f10e564406c3dea9b0a5a76302e23651e20b2af3 | 2,157 | asm | Assembly | externals/mpir-3.0.0/mpn/x86_64/k8/nior_n.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 12 | 2021-09-29T14:50:06.000Z | 2022-03-31T15:01:21.000Z | externals/mpir-3.0.0/mpn/x86_64/k8/nior_n.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 15 | 2021-12-24T22:53:49.000Z | 2021-12-25T10:03:13.000Z | LibSource/mpir/mpn/x86_64/k8/nior_n.asm | ekzyis/CrypTool-2 | 1af234b4f74486fbfeb3b3c49228cc36533a8c89 | [
"Apache-2.0"
] | 10 | 2021-10-17T19:46:51.000Z | 2022-03-18T02:57:57.000Z | dnl mpn_nior_n
dnl Copyright 2010 The Code Cavern
dnl This file is part of the MPIR Library.
dnl The MPIR Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 2.1 of the License, or (at
dnl your option) any later version.
dnl The MPIR Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the MPIR Library; see the file COPYING.LIB. If not, write
dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA 02110-1301, USA.
include(`../config.m4')
ASM_START()
PROLOGUE(mpn_nior_n)
lea (%rdx,%rcx,8),%rdx
lea (%rsi,%rcx,8),%rsi
lea (%rdi,%rcx,8),%rdi
neg %rcx
add $3,%rcx
jc skip
mov -24(%rdx,%rcx,8),%r8
mov -16(%rdx,%rcx,8),%r9
mov -24(%rdx,%rcx,8),%r8
mov -16(%rdx,%rcx,8),%r9
add $4,%rcx
mov -40(%rdx,%rcx,8),%r10
mov -32(%rdx,%rcx,8),%r11
jc skiplp
ALIGN(16)
lp:
or -56(%rsi,%rcx,8),%r8
not %r8
or -48(%rsi,%rcx,8),%r9
or -40(%rsi,%rcx,8),%r10
or -32(%rsi,%rcx,8),%r11
mov %r8,-56(%rdi,%rcx,8)
not %r9
not %r10
mov %r9,-48(%rdi,%rcx,8)
not %r11
mov -24(%rdx,%rcx,8),%r8
mov -16(%rdx,%rcx,8),%r9
mov %r10,-40(%rdi,%rcx,8)
mov %r11,-32(%rdi,%rcx,8)
add $4,%rcx
mov -40(%rdx,%rcx,8),%r10
mov -32(%rdx,%rcx,8),%r11
jnc lp
skiplp:
or -56(%rsi,%rcx,8),%r8
not %r8
or -48(%rsi,%rcx,8),%r9
or -40(%rsi,%rcx,8),%r10
or -32(%rsi,%rcx,8),%r11
mov %r8,-56(%rdi,%rcx,8)
not %r9
not %r10
mov %r9,-48(%rdi,%rcx,8)
not %r11
mov %r10,-40(%rdi,%rcx,8)
mov %r11,-32(%rdi,%rcx,8)
skip:
cmp $2,%rcx
jg case0
je case1
jp case2
case3: mov -24(%rdx),%r8
or -24(%rsi),%r8
not %r8
mov %r8,-24(%rdi)
case2: mov -16(%rdx),%r8
or -16(%rsi),%r8
not %r8
mov %r8,-16(%rdi)
case1: mov -8(%rdx),%r8
or -8(%rsi),%r8
not %r8
mov %r8,-8(%rdi)
case0: ret
EPILOGUE()
| 23.445652 | 79 | 0.657395 |
67b9a9448d6e446d45dbbe808b6fa4338cd80ed1 | 122 | asm | Assembly | Testing-File/MUL.asm | srsarangi/riscv-emulator | 3fa9a744c50632a81f0908189a53abf38bb32f21 | [
"Apache-2.0"
] | null | null | null | Testing-File/MUL.asm | srsarangi/riscv-emulator | 3fa9a744c50632a81f0908189a53abf38bb32f21 | [
"Apache-2.0"
] | null | null | null | Testing-File/MUL.asm | srsarangi/riscv-emulator | 3fa9a744c50632a81f0908189a53abf38bb32f21 | [
"Apache-2.0"
] | null | null | null | @ Assembly code to perform 40*50
.main:
addi x20, x0, 40
addi x21, x0, 50
mul x22, x20, x21
.print x22
end | 17.428571 | 33 | 0.606557 |
f7039fb715ef2d38d217dc6c041c350e73530d3a | 1,052 | asm | Assembly | programs/oeis/081/A081016.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/081/A081016.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/081/A081016.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A081016: a(n) = (Lucas(4*n+3) + 1)/5, or Fibonacci(2*n+1)*Fibonacci(2*n+2), or A081015(n)/5.
; 1,6,40,273,1870,12816,87841,602070,4126648,28284465,193864606,1328767776,9107509825,62423800998,427859097160,2932589879121,20100270056686,137769300517680,944284833567073,6472224534451830,44361286907595736,304056783818718321,2084036199823432510,14284196614945309248,97905340104793732225,671053184118610816326,4599466948725481982056,31525215456959763058065,216077041249992859424398,1481014073292990252912720,10151021471800938910964641,69576136229313582123839766,476881932133394135955913720,3268597388704445369567556273,22403299788797723451016980190,153554501132879618787551305056,1052478208141359608061842155201,7213792955856637637645343781350,49444072482855103855455564314248,338894714424129089350543606418385,2322818928486048521598349680614446,15920837784978210561837904157882736,109123045566361425411266979424564705,747940481179551767317030951814070198
lpb $0
sub $0,1
add $1,1
add $2,$1
add $1,$2
add $2,$1
add $1,$2
lpe
add $1,1
mov $0,$1
| 75.142857 | 855 | 0.867871 |
c48cb9fc6f38a4d45ab26d6383e744a4de527baf | 60,081 | asm | Assembly | Library/Kernel/Graphics/graphicsChars.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/Graphics/graphicsChars.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/Graphics/graphicsChars.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) 1990 Geoworks -- All Rights Reserved
PROJECT: PC GEOS
MODULE: graphics
FILE: graphicsChars.asm
AUTHOR: Gene Anderson
ROUTINES:
---------
GLBL GrSetFont Sets a font for all further drawing.
GLBL GrGetDefFontID Returns the current default font ID and size.
GLBL GrCallFontDriverID Finds the correct font driver and calls it.
EXT IsFontAvail Looks through fontsAvail list for desired font.
EXT IsFaceAvail Checks if pointsize and style is available.
EXT InvalidateFont Mark font in GState invalid.
EXT DeleteFontByHandle Given a handle, find & delete FontsInUseEntry
INT CheckCallDriver Check for correct font driver and call it.
INT FindFontDriver Finds the correct font driver, if any.
INT AddInUseEntry Add entry for new font.
INT ReloadFont Reloads a font if the block is discarded.
INT FindFont Loads the desired font into memory.
INT IsFontInUse Searches for font ID in fontInUse list.
INT ReallocFont Allocates memory for a font, calls ReloadFont
INT LockInfoBlock NearPLock the font info block.
INT UnlockInfoBlock NearUnlockV the font info block.
INT NearLockFont Lock font with GState or Window
INT LockWinFont Lock font with Window
EXT DrFontLockFont Loads, locks the font for use in drawing.
EXT DrFontUnlockFont Unlock the font.
DESCRIPTION:
This contains all the font management routines. All of the font
setting stuff should come through here.
$Id: graphicsChars.asm,v 1.1 97/04/05 01:13:17 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrSetFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets a font for all further drawing. If the desired font
is not on disk, the current default font is used.
CALLED BY: GLOBAL
PASS: cx -- font (typeface) to use (FontID) (0 to not set)
dx.ah -- pointsize to use (WBFixed) (0 to not set)
di -- handle of GState
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/22/88 Initial version
Gene 4/24/89 new version for outline fonts
Jim 10/10/89 fixed gstring stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrSetFont proc far
push ds
call LockDI_DS_check ;lock the GState, check
pushf ;save GString flag
;
; Optimization: see if the font ID and pointsize aren't changed
; from what is already in the GState.
;
cmp ds:GS_fontAttr.FCA_fontID, cx ;using same ID?
jne diffFont ; no, branch
cmpwbf ds:GS_fontAttr.FCA_pointsize, dxah
je sameFont ;branch if same pointsize
;
; The font and/or pointsize have changed, so invalidate the
; font handle in the GState.
;
diffFont:
call InvalidateFont ;invalidate font handle
;
; If setting the font, store the new value.
;
jcxz skipSetFont ;branch if not setting font
mov ds:GS_fontAttr.FCA_fontID, cx ;store font ID
skipSetFont:
;
; If setting the pointsize, store the new value.
;
tst dx ;setting pointsize?
jz skipSetSize ;branch if not setting pointsize
movwbf ds:GS_fontAttr.FCA_pointsize, dxah
skipSetSize:
sameFont:
popf ;restore GString flag
jnc exit ;branch if normal draw operation
;
; Write info out to the GString
;
call LibGSSetFont
exit:
GOTO_ECN UnlockDI_popDS, ds ;unlock the GState
GrSetFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrGetDefFontID
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns the default font ID and pointsize, as set up
in the .ini file, as well as the handle for the
data block.
CALLED BY: GLOBAL
PASS: nothing
RETURN: cx -- default font ID (FontID)
dx.ah -- default font pointsize (WBFixed)
bx -- default font data handle
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/22/88 Initial version
Gene 5/5/89 updated comments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrGetDefFontID proc far
uses ds
.enter
LoadVarSeg ds ;ds <- idata seg addr
mov cx, ds:defaultFontID ;cx <- default font ID
clr ah
mov dx, ds:defaultFontSize ;dx.ah <- default font size
mov bx, ds:defaultFontHandle ;bx <- default font handle
.leave
ret
GrGetDefFontID endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReloadFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Reload a bitmap face from a font file.
CALLED BY: INTERNAL
ReallocFont
PASS: ax - handle of font file
bx - handle of font block (HM_addr NOT valid)
ds:di - ptr to PointSizeEntry
RETURN: ax - seg addr of font block
carry - set if file read fails
DESTROYED: ax, bx, cx, dx, si, ds
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/22/88 Initial version
Tony 12/88 Changed
Gene 5/5/89 Added comments from Jim's code review
Gene 8/89 New version for PLocking fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReloadFont proc near
push ax ;save file handle
mov ax, ds:[di].PSE_dataSize ;ax <- size to realloc
mov dx, ax
mov ch, HAF_STANDARD_NO_ERR_LOCK ;ch <- allocation flags
call MemReAlloc ;allocate new block
pop bx ;bx <- file handle
push ax ;save font seg addr
push dx ;save font size
mov cx, ds:[di].PSE_filePosHi ;cx <- offset (high)
mov dx, ds:[di].PSE_filePosLo ;dx <- offset (low)
mov al, FILE_POS_START ;al <- flag: absolute offset
call FilePosFar ;position the file
pop cx ;cx <- # bytes to read
pop ds ;ds <- seg addr of font
clr dx ;ds:dx <- buffer
clr al ;return errors
call FileReadFar ;read in the data
mov ax, ds ;ax <- seg addr of font
ret
ReloadFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IsFontInUse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Check to see if a font/style/pointsize is already in use.
SYNOPSIS: Searches for font ID in fontInUse list. Opens the in-use
chunk and searches for the font ID in the list. If it finds
the font and size desired, it returns the handle of the font
data block. It compares the font ID, the pointsize, any
transformation, and the style.
CALLED BY: INTERNAL: FindFont
PASS: ds -- segment of font info block (P'd)
cx -- font ID (FontID)
al -- font style (TextStyle)
es -- seg addr of GState
bp:si -- ptr to transformation matrix (in window or gstate)
RETURN: if found:
carry - set
bx - handle of font
di - offset of FontsInUseEntry
DESTROYED: bx, di (if not found)
PSEUDO CODE/STRATEGY:
open in-use chunk
while not past end of chunk
if entry's font ID, size, & transform match then return
go to next entry
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/23/88 Initial version
Gene 4/27/89 new version for outline fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IsFontInUse proc near
uses es, si
transform local fptr.TMatrix push bp, si
.enter
push ds
mov ds, ss:transform.segment ;ds:si <- ptr to TMatrix
clr bl ;bl <- no flags to check
test ds:[si].TM_flags, TM_COMPLEX ;see if complex transform
pop ds
je isSimple ;branch if simple transform
mov bl, mask FBF_IS_COMPLEX ;bl <- check complex flag
isSimple:
;
; Get the start & end of the chunk
;
mov si, ds:[FONTS_IN_USE_HANDLE] ;si <- chunk handle
ChunkSizePtr ds, si, di ;di <- chunk size
add di, si ;di <- end of list ptr
IFIU_loop:
cmp si, di ;are we through the list?
jae endList ;if so, exit (carry clear)
;
; Is the entry valid?
;
tst ds:[si].FIUE_dataHandle ;see if empty entry
jz noMatch ;branch if empty entry
;
; Do the FontID and TextStyle match?
;
cmp ds:[si].FIUE_attrs.FCA_fontID, cx
jne noMatch ;no, branch
cmp ds:[si].FIUE_attrs.FCA_textStyle, al
jne noMatch ;no, branch
;
; Do the other font attributes match?
; Compare everything except TextStyle, because those
; may include underline and/or strikethrough, which
; are done by the kernel so they always 'match'.
; We've compared the TextStyle above, so they match.
;
push cx, si, di
add si, offset FIUE_attrs ;ds:si <- ptr to entry attrs
mov di, offset GS_fontAttr ;es:di <- ptr to GState attrs
mov cx, (size FontCommonAttrs)-(size FCA_textStyle)
;
; The following CheckHack is to ensure that the
; TextStyle are at the end of FontCommonAttrs.
; We want to compare everything except those.
;
CheckHack <(size FontCommonAttrs)-(size TextStyle) eq (offset FCA_textStyle)>
repe cmpsb ;compare me jesus
pop cx, si, di
jne noMatch ;branch if mismatch
;
; Are the transformations both simple?
;
mov bh, ds:[si].FIUE_flags ;bh <- font flags
cmp bh, bl ;see if flags match
jne noMatch ;no, branch
test bl, mask FBF_IS_COMPLEX ;see if simple transform
je match ;yes, branch
;
; If the transformations are both complex, do they match?
;
push es, si, di, cx ;save FIUE ptr, tmtrx ptr
add si, offset FIUE_matrix ;ds:si <- ptr to font trans
les di, ss:transform ;es:di <- ptr to current trans
add di, offset TM_11 ;es:di <- ptr to cur trans
mov cx, (size WWFixed)*4/2 ;cx <- # words to compare
repe cmpsw ;cmp ds:si to es:di
pop es, si, di, cx ;recover FIUE ptr, tmtrx ptr
je match ;branch if match
noMatch:
add si, size FontsInUseEntry ;else move to next entry
jmp IFIU_loop ;and loop
;
; Success!
;
match:
mov bx, ds:[si].FIUE_dataHandle ;bx <- handle of font
mov di, si ;ds:di <- ptr to FIUE
stc ;indicate found match
endList:
.leave
ret
IsFontInUse endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IsFontAvail
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Looks through fontsAvail list for desired font.
CALLED BY: EXTERNAL: InitDefaultFont, FindFont
PASS: ds -- seg addr of font block (P'd)
cx -- font ID (FontID)
RETURN: if found:
carry -- set
ds:bx -- ptr to FontInfo chunk
ds:di -- ptr to FontsAvailEntry
DESTROYED: bx, di (if not found)
PSEUDO CODE/STRATEGY:
If the font is found in the fontsAvail list (indicating
is available on disk), it returns the chunk handle
containing the header for the font.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/23/88 Initial version
Gene 5/4/89 updated code, comments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FarIsFontAvail proc far
call IsFontAvail
ret
FarIsFontAvail endp
IsFontAvail proc near
uses ax
.enter
mov di, ds:[FONTS_AVAIL_HANDLE] ;di <- ptr to chunk
ChunkSizePtr ds, di, ax ;ax <- chunk size
add ax, di ;ax -> end of chunk
IFA_loop:
cmp di, ax ;are we thru the list?
jae noMatch ;yes, exit carry clear
cmp ds:[di].FAE_fontID, cx ;see if ID matches
je match ;we have a match, branch
add di, size FontsAvailEntry ;else move to next entry
jmp IFA_loop ;and loop
match:
mov bx, ds:[di].FAE_infoHandle ;bx <- chunk handle
mov bx, ds:[bx] ;ds:bx <- ptr to FontInfo
stc ;indicate is available
noMatch:
.leave
ret
IsFontAvail endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IsFaceAvail
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Checks if a point size and style of a font is available.
CALLED BY: FindFont(), ReallocFont()
PASS: ds:bx -- ptr to FontInfo
al -- style (TextStyle)
es - seg addr of GState
bp:si -- ptr to TMatrix
RETURN: carry set if size found, with:
di -- ptr to PointSizeEntry
DESTROYED: di (if size not found)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/23/88 Initial version
Gene 5/5/89 added comments from Jim's code review
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IsFaceAvail proc near
uses ax, bx, dx
.enter
mov di, bx ;di <- ptr to chunk
;
; Is there a complex transformation?
; If so, the face isn't here.
;
push ds
mov ds, bp ;ds:si <- addr of xform
test ds:[si].TM_flags, TM_COMPLEX ;see if complex xform (clear c)
pop ds
jne endList ;no complex xforms in file
;
; Is there superscript, subscript, or a non-standard width or weight?
; If so, the face isn't here, because those things aren't here...
;
test al, mask TS_SUPERSCRIPT or mask TS_SUBSCRIPT
jnz endList
cmp es:GS_fontAttr.FCA_width, FWI_MEDIUM
jne endList
cmp es:GS_fontAttr.FCA_weight, FW_NORMAL
jne endList
SBCS < movwbf dxah, es:GS_fontAttr.FCA_pointsize >
DBCS < mov dl, es:GS_fontAttr.FCA_pointsize.WBF_int.low >
DBCS < mov ah, es:GS_fontAttr.FCA_charSet >
;
; Get pointers to the start & end of the pointsize table
;
add bx, ds:[di].FI_pointSizeEnd ;bx <- ptr to end
add di, ds:[di].FI_pointSizeTab ;di <- ptr to size table
IFA_loop:
cmp di, bx ;see if at end of list
jae endList ;yes, branch (carry clear)
;
; Does the character set match?
;
DBCS < cmp ds:[di].PSE_charSet, ah >
DBCS < jne noMatch >
;
; Does the TextStyle match?
;
cmp ds:[di].PSE_style, al ;see if style matches
jne noMatch ;branch if not
;
; Pointsize match?
;
SBCS < cmpwbf ds:[di].PSE_pointSize, dxah ;pointsize match? >
DBCS < cmp ds:[di].PSE_pointSize, dl ;pointsize match? >
je match ;branch if so
noMatch:
add di, size PointSizeEntry ;else move to next entry
jmp IFA_loop ;and loop
;
; Failure...
;
endList:
clc ;flag : not found
jmp done
;
; Success!
;
match:
stc ;flag : found.
done:
.leave
ret
IsFaceAvail endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FindFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Given a GState, finds and locks the font specified. If the
pointsize or transformation don't exist, then the font
driver is called to generate the specified point size.
CALLED BY: INTERNAL: NearLockFont()
PASS: ds -- seg addr of GState (locked)
bp:si -- addr of transform (in GState or Window)
RETURN: bx -- handle of font
if carry set:
font found is default
DESTROYED: ax
PSEUDO CODE/STRATEGY:
NearPLock (font info blk);
if (font in use) {
UseFont (font);
} else {
if (font and pointsize available) {
UseFont (font);
} else {
if (driver and outline data available) {
BuildFont (font);
} else {
UseFont (default font);
}
}
}
NearUnlockV (font info blk);
KNOWN BUGS/SIDE EFFECTS/IDEAS:
ASSUMES: FontsInUseEntry for the default font is first
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 5/ 4/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FindFont proc near
uses cx, dx, si, di, bp, es
.enter
;
; Get the current attributes
;
call GetFontVals
;
; Lock the font info block
;
clr ds:GS_fontFlags ;no flags yet
segmov es, ds ;es <- seg addr of GState
push ds ;save GState seg
call LockInfoBlock ;lock the font info block
EC < call ECLMemValidateHeap ;check info block>
checkFont:
call IsFontInUse ;see if font is in use
jc lockFont ;branch if already in use
call IsFontAvail ;is font even available?
jnc noFont ;branch if not available
call IsFaceAvail ;see if size/style available
jc newFont ;branch if bitmap available
tst ds:[bx].FI_outlineEnd ;check outline data ptr
jnz newFont ;branch if outlines available
noFont:
call SubstituteFont ;substitute something close
jmp checkFont ;jmp back (font will be there)
newFont:
call AddInUseEntry ;mark font as in use
mov ax, FID_INIT_SIZE ;ax <- initial size
mov bx, FONT_MAN_ID ;bx <- new owner (font manager)
mov cx, FID_SET_FLAGS ;cl, ch <- allocate handle only
call MemAllocSetOwner ;allocate a block for the font
mov ds:[di].FIUE_dataHandle, bx ;store new handle
lockFont:
inc ds:[di].FIUE_refCount ;one more reference to handle
mov si, ds:[FONTS_IN_USE_HANDLE] ;si <- chunk address
call UnlockInfoBlock ;unlock font info block
pop ds ;ds <- seg addr of GState
mov ds:GS_fontHandle, bx ;save handle in GState
sub di, si ;di <- index of FontsInUseEntry
mov ds:GS_fontIndex, di ;save index of in use entry
;
; The Z flag will be set according to the subtraction
; above, which return zero iff the FontsInUseEntry index
; is zero, which means the font is the default font.
; The C flag will always be clear.
;
jnz notDefault ;branch if not default font
ornf ds:GS_fontFlags, mask FBF_DEFAULT_FONT
stc ;indicate default font
notDefault:
.leave
ret
FindFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InvalidateFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Invalidate the font in a gstate.
CALLED BY: EXTERNAL
PASS: ds - seg addr of GState
RETURN: none
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 3/18/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FarInvalidateFont proc far
call InvalidateFont
ret
FarInvalidateFont endp
InvalidateFont proc near
uses ax
.enter
mov ax, ds:GS_fontHandle ;ax <- handle of font
tst ax ;see if any font
jz done ;branch if no font in use
test ds:GS_fontFlags, mask FBF_DEFAULT_FONT
jnz isDefaultFont ;branch if default font
push ds, si
mov si, ds:GS_fontIndex ;si <- index of in use entry
call LockInfoBlock ;lock font info block
xchg ax, si ;ax <- offset of in use entry
mov si, ds:[FONTS_IN_USE_HANDLE] ;si <- chunk address
add si, ax ;si <- ptr to FontsInUseEntry
dec ds:[si].FIUE_refCount ;decrement reference count
EC < ERROR_S FONTMAN_FONT_HAS_NEGATIVE_REFERENCE_COUNT >
call UnlockInfoBlock ;unlock font info block
pop ds, si
isDefaultFont:
clr ds:GS_fontHandle ;invalidate font handle
done:
.leave
ret
InvalidateFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DeleteFontByHandle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find a font in the in use list by handle and delete it.
CALLED BY: EXTERNAL: DoDiscardFont
PASS: ax - handle of font to find
ds - seg addr of font info block
RETURN: z flag - set if deleted (ie. ref count == 0)
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 3/18/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DeleteFontByHandle proc near
uses si
.enter
mov si, ds:[FONTS_IN_USE_HANDLE] ;si <- chunk address
fontLoop:
cmp ds:[si].FIUE_dataHandle, ax ;see if correct handle
je found ;branch if correct handle
add si, size FontsInUseEntry ;advance to next entry
jmp fontLoop
found:
tst ds:[si].FIUE_refCount ;set z flag
jnz done ;branch if still references
mov ds:[si].FIUE_dataHandle, 0 ;mark entry as empty
done:
.leave
ret
DeleteFontByHandle endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockInfoBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: PLock the font info block
CALLED BY: INTERNAL:
PASS: none
RETURN: ds - seg addr of font info block
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/ 3/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FarLockInfoBlock proc far
call LockInfoBlock
ret
FarLockInfoBlock endp
public FarLockInfoBlock
LockInfoBlock proc near
uses ax, bx
.enter
LoadVarSeg ds ;ds <- seg addr of idata
mov bx, ds:fontBlkHandle ;bx <- handle of font info blk
call MemThreadGrab ;lock the font info block
mov ds, ax ;ds <- seg addr of font info
.leave
ret
LockInfoBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UnlockInfoBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: UnlockV the font info block
CALLED BY: INTERNAL:
PASS: none
RETURN: none
DESTROYED: none (even flags preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/ 3/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FarUnlockInfoBlock proc far
call UnlockInfoBlock
ret
FarUnlockInfoBlock endp
public FarUnlockInfoBlock
UnlockInfoBlock proc near
uses ax, bx, ds
.enter
LoadVarSeg ds ;ds <- seg addr of idata
mov bx, ds:fontBlkHandle ;bx <- handle of font info blk
call MemThreadRelease ;preserves flags
.leave
ret
UnlockInfoBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetFontVals
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get font ID, size and style from GState
CALLED BY: FindFont, ReallocFont
PASS: ds - seg addr of GState
RETURN: cx - FontID
al - TextStyle (minus KERNEL_STYLES)
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 5/15/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetFontVals proc near
mov cx, ds:GS_fontAttr.FCA_fontID ;cx <- fontID
mov al, ds:GS_fontAttr.FCA_textStyle
and al, not KERNEL_STYLES ;don't check underline, et al
ret
GetFontVals endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SubstituteFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find a replacement for a font/pointsize/style
CALLED BY: FindFont(), ReallocFont()
PASS: bp:si - ptr to TMatrix
ds - seg addr of font block
es - seg addr of GState
RETURN: bp:si - ptr to (new) TMatrix
cx - font to use (FontID)
dx.ah - pointsize to use (WBFixed)
al - style to use (TextStyle)
carry - set if outline font substituted
DESTROYED: bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 10/24/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SubstituteFont proc near
.enter
call LibFindBestFace ;find best font to use
jc notBitmap ;branch if substituted outline
mov si, offset defaultState.GS_TMatrix
mov bp, segment idata ;bp:si <- ptr to NULL transform
notBitmap:
.leave
ret
SubstituteFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckCallDriver
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check for font driver, build new font if found.
CALLED BY: INTERNAL: FindFont
PASS: ds:di - ptr to FontInfo
bx - handle of font
cx - font ID (FontID)
dx:ah - pointsize (WBFixed)
al - style (TextStyle)
font info block - P'd
es - seg addr of GState
bp:si - ptr to TMatrix
RETURN: if found:
carry - set
ax - seg addr of font (P'locked)
bx - handle of font
else:
error or driver not loaded
DESTROYED: di; ax, bx (if no driver or data)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 6/ 1/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckCallDriver proc near
uses cx
.enter
mov ax, ds:[di].FI_maker ;ax <- font manufacturer
mov cx, si ;bp:cx <- ptr to transform
mov di, DR_FONT_GEN_WIDTHS ;di <- function to call
call GrCallFontDriverID
.leave
ret
CheckCallDriver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AddInUseEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a FontsInUseEntry for a font
CALLED BY: INTERNAL: FindFont, FindBitmapFont, FindOutlineFont
EXTERNAL: InitDefaultFont
PASS: ds -- segment of font info block (P'd)
cx -- font ID (FontID)
al -- font style (TextStyle)
es -- seg addr of GState
bp:si -- ptr to TMatrix (in window or gstate)
RETURN: ds:di - ptr to new FontsInUseEntry
(only FBF_IS_COMPLEX bit is valid in FIUE_flags)
DESTROYED: si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 6/ 1/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AddInUseEntry proc near
uses es, cx
.enter
push ax ;save TextStyle
mov di, FONTS_IN_USE_HANDLE ;ds:di = in use fonts
xchg si, di
call ChunkSizeHandleDS_SI_CX ;cx <- chunk size
xchg si, di
jcxz addNewEntry ;branch if empty chunk
;
; Search the list for any empty entries.
;
mov ax, ds:[FONTS_IN_USE_HANDLE] ;ax <- ptr to chunk
mov di, ax
add ax, cx ;ax <- ptr to end of chunk
checkList:
cmp di, ax ;end of list?
jae addNewEntry ;if so, add new entry
tst ds:[di].FIUE_dataHandle ;empty entry?
jz fillEntry ;if so, use it
add di, size FontsInUseEntry ;advance to next entry
jmp checkList ;loop while more entries
;
; No free entries in the list, so add one at the end.
;
addNewEntry:
push cx ;save old size
mov ax, FONTS_IN_USE_HANDLE ;ax <- lmem handle of FIU
add cx, size FontsInUseEntry ;make room for another entry
call LMemReAlloc ;resize the thing
mov di, ds:[FONTS_IN_USE_HANDLE] ;di <- ptr to chunk
pop cx ;cx <- size of old chunk
add di, cx ;di <- ptr to new FIUE
;
; Fill the (new) entry
;
fillEntry:
mov ds:[di].FIUE_refCount, 0 ;no references yet
;
; Copy the rest of the values
;
push ds, es, di, si
segxchg ds, es ;ds <- GState, es <- font info
mov si, offset GS_fontAttr ;ds:si <- ptr to attrs
mov cx, (size FontCommonAttrs)-(size FCA_textStyle)
CheckHack <(offset FIUE_attrs) eq 0>
CheckHack <(size FontCommonAttrs)-(size TextStyle) eq (offset FCA_textStyle)>
rep movsb
pop ds, es, di, si
pop ax
mov ds:[di].FIUE_attrs.FCA_textStyle, al
;
; A simple transformation or complex?
;
mov es, bp ;es <- seg addr of xform
mov ds:[di].FIUE_flags, 0 ;assume simple xform
test es:[si].TM_flags, TM_COMPLEX ;see if complex xform
je isSimple ;branch if is simple
;
; The transformation is complex -- copy the relevant portion
; of the TMatrix in.
;
ornf ds:[di].FIUE_flags, mask FBF_IS_COMPLEX ;complex xform
push ds, di
segmov es, ds ;es <- seg addr of FIUE
mov ds, bp ;ds <- seg addr of xform
add di, offset FIUE_matrix ;di <- offset of FIUE xform
add si, offset TM_11 ;si <- offset to TM_11
mov cx, (size WWFixed)*4/2 ;cx <- # words to copy
rep movsw ;copy xform into FIUE
pop ds, di
isSimple:
.leave
ret
AddInUseEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReallocFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Re-allocate memory for a font and read it in
CALLED BY: INTERNAL
FindFont, FastLock{GState,Win}Font (macros)
PASS: bx -- handle of font
bp:si -- ptr to TMatrix
ds - seg addr of GState
RETURN: ax -- segment of font
DESTROYED: bp, si
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
if (simple transform) {
if (font avail) {
if (pointsize avail) {
ReloadFont(fontID, pointsize);
} else {
callFontDriver(GEN_WIDTHS, fontID, pointsize);
}
} else {
UseDefaultFont();
}
} else {
FindUsageEntry(handle);
}
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 12/88 Initial version
Gene 7/89 New version for outline fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReallocFont proc near
uses bx, cx, dx, di, ds, es
.enter
push bx ;save font handle
call GetFontVals ;get ID, size, style
segmov es, ds ;es <- seg addr of gstate
call LockInfoBlock ;lock font info blk
test es:GS_fontFlags, mask FBF_MAPPED_FONT
jz afterSubstitute
call SubstituteFont ;find substituted font
afterSubstitute:
call IsFontAvail ;see if font available
NEC < jnc useDefaultFont ;>
EC < WARNING_NC FONTMAN_IN_USE_FONT_FILE_DELETED ;>
call EnsureFontFileOpen
NEC < jc useDefaultFont ;>
EC < ERROR_C FONTMAN_COULDNT_OPEN_FONT_FILE ;>
call IsFaceAvail ;see if face available
jnc isComplexFont ;no such pointsize
mov ax, ds:[bx].FI_fileHandle ;ax <- file handle
pop bx ;bx <- handle of font
call ReloadFont ;reload font from file
NEC < jc useDefaultFontNoPop ;use default if read failed>
EC < ERROR_C FONTMAN_BAD_FONT_FILE_READ ;>
done:
call UnlockInfoBlock
.leave
ret
;
; The font has a complex transformation. We need to
; call the font driver to build this font.
;
isComplexFont:
mov di, bx ;di <- ptr to FontInfo chunk
pop bx ;bx <- handle of font
call CheckCallDriver ;rebuild font
jnc done
NEC < jmp useDefaultFontNoPop ;>
EC < ERROR FONTMAN_FONT_DRIVER_NOT_FOUND ;>
;
; Either:
; (a) the font can't be found
; (b) the pointsize/style can't be found
; (c) the font driver can't be found
; (d) the outline data can't be found
; Any of these things at this point is a bad thing.
; Use the default font, because that's always in memory
;
NEC <useDefaultFont: >
NEC < pop bx ;bx <- handle of font block>
NEC <useDefaultFontNoPop: >
NEC < call HandleV ;can't realloc, so release it>
NEC < call GrGetDefFontID ;get default font ID,handle >
NEC < call NearLock ;lock the default font >
NEC < jmp done >
ReallocFont endp
COMMENT @----------------------------------------------------------------------
FUNCTION: FontDrEnsureFontFileOpen
DESCRIPTION: Ensure that the font file for the given font is open
CALLED BY: EXTERNAL
PASS:
ds - font block (locked)
cx - font ID
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
NOTE: ds cannot be changed by this routine, since ds:si and ds:bx
are expected to still be valid after the call.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/90 Initial version
------------------------------------------------------------------------------@
FontDrEnsureFontFileOpen proc far uses bx, di
.enter
call IsFontAvail
EC < ERROR_NC FONTMAN_FILE_CACHE_CORRUPTED >
call EnsureFontFileOpen
EC < ERROR_C FONTMAN_FILE_CACHE_CORRUPTED >
.leave
ret
FontDrEnsureFontFileOpen endp
COMMENT @----------------------------------------------------------------------
FUNCTION: EnsureFontFileOpen
DESCRIPTION: Ensure that the font file for the given font is open
CALLED BY: EXTERNAL
PASS:
ds - font block (locked)
ds:di - ptr to FontsAvailEntry
ds:bx - ptr to FontInfo entry
RETURN:
carry - set if error
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
NOTE: ds cannot be changed by this routine, since ds:si and ds:bx
are expected to still be valid after the call.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/90 Initial version
------------------------------------------------------------------------------@
EnsureFontFileOpen proc far
uses ax, dx
tst ds:[bx].FI_fileHandle ;clears carry
jnz exit
tst {char}ds:[di].FAE_fileName ;clears carry
jz exit
.enter
call FilePushDir
mov ax, SP_FONT
call FileSetStandardPath
push {word} ds:[di+FONT_FILE_LENGTH].FAE_fileName
mov {char} ds:[di+FONT_FILE_LENGTH].FAE_fileName, 0
lea dx, ds:[di].FAE_fileName
mov al, FileAccessFlags <FE_DENY_WRITE, FA_READ_ONLY>
call FileOpen
pop {word} ds:[di+FONT_FILE_LENGTH].FAE_fileName
call FilePopDir
jc done
mov ds:[bx].FI_fileHandle, ax
; make file owned by kernel
push ds
LoadVarSeg ds
xchg ax, bx ;bx = file handle
call SetOwnerToKernel
xchg ax, bx ;restore bx
pop ds
;
; Record that the file is open in our font cache, and close
; a file if this puts us at the limit.
;
call RecordNewFontFile
clc ;carry <- no error
done:
.leave
exit:
ret
EnsureFontFileOpen endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecordNewFontFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Record that a new font file is open, closing an old one
if necessary to keep the total within limits.
CALLED BY: EnsureFontFileOpen()
PASS: ds - locked (P'd)
ds:bx - FontInfo for font
ds:di - FontsAvailEntry
RETURN: none
DESTROYED: ax
PSEUDO CODE/STRATEGY:
NOTE: ds cannot be changed by this routine, since ds:si and ds:bx
are expected to still be valid after the call. This is dealt with
by initially allocing the chunk as big as we need it, and then
never resizing it. Not as space efficient, but...
The cache is an array of FontID values corresponding to the font
files that are currently open. FontIDs are stored rather than the
file handles because there is an existing routine to get a font
given its FontID, but no such routine for font file handles.
The array has the oldest file at the start, with newer files
working backward. Empty slots have FID_INVALID (=0) to mark them.
If a font that was open is deleted via FontDrDeleteFont(), its
entry will be left open in the middle of the cache for use by the
next font file opened.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 2/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecordNewFontFile proc near
uses bx, cx, si, di, es
.enter
CheckHack <FID_INVALID eq 0>
CheckHack <(size FontID) eq 2>
push ds:[di].FAE_fontID ;save ID of new font
;
; Scan for an open slot
;
mov si, ds:[FONT_FILE_CACHE_HANDLE] ;ds:si <- ptr to cache
mov cx, ds:[si].LMC_size ;cx <- chunk size (w/size word)
shr cx, 1 ;working with words
dec cx ;cx <- # of entries
mov di, si
push cx ;save # of entries
segmov es, ds ;es:di <- ptr to cache
clr ax
repne scasw ;scan for first open slot
jne tooManyFiles ;branch if no empty slot
pop cx ;don't need size
;
; Success! Store the font ID
;
CheckHack <(size FontID) eq 2>
dec di
dec di ;scasw goes one beyond...
storeID:
pop ds:[di] ;store ID in open slot
.leave
ret
;
; ds:si - ptr to first element
; es - =ds
; ax - =0
; on stack: # of entries
;
tooManyFiles:
;
; Find and close the oldest file
;
mov cx, ds:[si] ;cx <- FontID
call IsFontAvail
EC < ERROR_NC FONTMAN_FILE_CACHE_CORRUPTED ;>
xchg ax, ds:[bx].FI_fileHandle ;ax <- handle; field cleared
EC < tst ax ;>
EC < ERROR_Z FONTMAN_FILE_CACHE_CORRUPTED ;>
mov_tr bx, ax ;bx <- file handle
clr al ;al <- flags
call FileCloseFar
;
; Make room in our cache for the new ID by shifting the elements.
;
pop cx ;cx <- # of entries
mov di, si ;ds:di <- ptr to element[0]
CheckHack <(size FontID) eq 2>
inc si
inc si ;ds:si <- ptr to element[1]
dec cx ;cx <- # elements - 1
rep movsw ;shift me jesus
;
; Store the new font at the end of the cache, which is
; where ds:di now points after the rep movsw above...
;
jmp storeID
RecordNewFontFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrCallFontDriverID
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call particular font driver, with the font already locked
CALLED BY: GLOBAL
PASS: di - function to call (FontFunction)
ax - font driver ID (FontMaker)
rest - depends on function called
(can be bx, cx, dx, bp)
RETURN: carry - set if error
DESTROYED: depends on function
PSEUDO CODE/STRATEGY:
PLock the font info block
search the drivers available list
call driver strategy
UnlockV the font info block
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 2/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrCallFontDriverID proc far
uses ds, si
.enter
call LockInfoBlock ;lock font info block
call FindFontDriver ;find correct driver
cmc
jc noDriver ;branch if driver not found
call ds:[si].DAE_strategy ;call the font driver
noDriver:
call UnlockInfoBlock ;unlock font info block
.leave
ret
GrCallFontDriverID endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FindFontDriver
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Finds the correct font driver for a given font.
CALLED BY: INTERNAL: GrCallFontDriver, FindFont
PASS: ds - seg addr of font info block (P'd)
ax - manufacturer ID
RETURN: ds:si - addr of DriversAvailEntry w/correct strategy
carry - set if driver found
DESTROYED: none (si if no driver found)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 5/17/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FindFontDriver proc near
push bx
mov si, ds:[FONT_DRIVERS_HANDLE] ;si <- ptr to DAE list
cmp si, 0ffffh ;see if empty list
clc ;assume empty
je FFD_noMatch ;branch if empty list
ChunkSizePtr ds, si, bx ;bx <- chunk size
add bx, si ;bx <- ptr to end of chunk
FFD_loop:
cmp si, bx ;are we through the list?
jae FFD_noMatch ;if so, exit (carry clear)
cmp ds:[si].FAE_fontID, ax ;see if ID matches
je FFD_match ;we have a match, branch
add si, size DriversAvailEntry ;else move to next entry
jmp short FFD_loop ;and loop
FFD_match:
stc ;indicate driver found
FFD_noMatch:
pop bx
ret
FindFontDriver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockFontGStateDS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Loads and locks font given an unlocked GState
CALLED BY: EXTERNAL
PASS: di - handle of GState
RETURN: ds -- segment addr of font (locked)
bx -- handle of font
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 2/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LockFontGStateDS proc far
uses ax
.enter
mov bx, di ;bx <- handle of GState
call NearLockDS ;ds <- seg addr of GState
call NearLockFont ;ax <- seg addr of font
mov ds, ax ;ds <- seg addr of font
xchg bx, di ;bx <- handle of GState
call NearUnlock ;unlock GState
xchg bx, di ;bx <- handle of font
.leave
ret
LockFontGStateDS endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FontDrLockFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Makes sure the font given in a graphics state is loaded.
CALLED BY: GLOBAL (font drivers)
PASS: ds -- segment of GState
RETURN: ax -- segment addr of font (locked)
bx -- handle of font
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
NOTE: this routine should only be called by font drivers
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 4/19/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FontDrLockFont proc far
call NearLockFont
ret
FontDrLockFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NearLockFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Makes sure the font given in a graphics state is loaded.
CALLED BY: INTERNAL
PASS: ds -- segment of GState
RETURN: ax -- segment addr of font (locked)
bx -- handle of font
DESTROYED: none
PSEUDO CODE/STRATEGY:
The font might not have been determined (NULL handle),
or the font may have been determined (used previously)
but has been discarded.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 4/19/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
NearLockFont proc near
uses bp, si
.enter
mov bx, ds:GS_window ;bx <- handle of Window
tst bx ;any Window?
jnz hasWindow
mov bp, ds
mov si, offset GS_TMatrix ;bp:si <- ptr to TMatrix
call DoFontLock
afterLock:
.leave
ret
hasWindow:
push cx, es
call NearPLockES ;PLock Window
push bx
call LockWinFont ;w/Window locked, find font
mov cx, bx
pop bx ;bx <- handle of Window
call NearUnlockV
mov bx, cx ;bx <- handle of font
pop cx, es
jmp afterLock
NearLockFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoFontLock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do the internals of locking a font.
CALLED BY: INTERNAL:
PASS: ds - seg addr of GState
bp:si - ptr to TMatrix (in Window or GState)
RETURN: bx - handle of font
ax - seg addr of font
DESTROYED: bp, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 10/ 3/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoFontLock proc near
EC < call ECCheckFonts >
;
; check to see if the font is still valid
;
mov ax,ds:GS_fontIndex
push di,es
segmov es,ds ;es <- handle to gstate
call LockInfoBlock ;ds <- handle to FontInfoBlock
mov di,FONTS_IN_USE_HANDLE
mov di,ds:[di]
add di,ax
test ds:[di].FIUE_flags, mask FBF_IS_INVALID
jz valid
notValid::
segxchg es,ds ;es <- handle to FontInfoBlock
;ds <- handle to gstate
call InvalidateFont
segxchg es,ds
;
; if the font is not valid check to see if there are any
; references to it left
;
tst ds:[di].FIUE_refCount
jz freeFont
jmp cont
freeFont:
;
; if there are no references to the font, free the font data
;
clr bx
xchg bx,ds:[di].FIUE_dataHandle
call MemFree
cont:
valid:
call UnlockInfoBlock
segmov ds,es ;ds <- gstate handle
pop di,es
;
; See if the font is known or not.
;
mov bx, ds:GS_fontHandle ;bx <- handle of font
tst bx ;font valid?
jz findFont ;branch if font unknown
;
; If the font is the default font, just lock it, don't P it.
; This is to speed things along and avoid deadlock.
;
test ds:GS_fontFlags, mask FBF_DEFAULT_FONT
jnz isDefault
call HandleP ;P the font handle
isDefault:
call NearLock ;lock the font block
jc loadFont ;branch if discarded
ret
;
; The font is unknown (ie. there is no data handle)
;
findFont:
call FindFont ;find font to use
jc foundDefault ;branch if default font
;
; As above, just lock the default font, don't P it.
;
call HandleP ;P the font handle
foundDefault:
call NearLock ;lock the font block
jnc updateOpts ;branch if not discarded
;
; The lock failed, meaning the font is discarded.
;
loadFont:
call ReallocFont ;realloc memory, load font
;
; Finally, we need to update the various optimizations
; related to fonts in the GState.
;
updateOpts:
REAL_FALL_THRU UpdateFontOpts
DoFontLock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UpdateFontOpts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update font-related optimizations in the GState
CALLED BY: DoFontLock()
PASS: ds - seg addr of GState
ax - seg addr of font
RETURN: none
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
NOTE: FBF_DEFAULT_FONT is not updated. If the font is
the default font, this must be updated.
If you make changes here, you will probably want to make
similar changes to UpdateDefFontOpts() in the init code
which initializes the default GState.
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 10/ 3/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UpdateFontOpts proc near
uses ax, es
.enter
EC < call ECCheckFontBufAX >
mov es, ax ;es <- seg addr of font
;
; stuff font height, first and last character...
;
mov ax, es:FB_pixHeight ;ax <- pixel height
mov ds:GS_pixelHeightM1, ax
SBCS < mov ax, {word}es:FB_firstChar ;al,ah <- first, last char >
SBCS < mov {word}ds:GS_fontFirstChar, ax >
DBCS < mov al, es:FB_firstChar.high >
DBCS < mov ds:GS_fontAttr.FCA_charSet, al >
;
; set opcode if a complex transform is in use...
;
mov al, GO_SPECIAL_CASE ;al <- complex transform
test es:FB_flags, mask FBF_IS_COMPLEX
jnz isComplex ;branch if complex xform
mov al, GO_FALL_THRU ;al <- simple transform
isComplex:
mov ds:GS_complexOpcode, al ;store optimization
;
; stuff minimum left side bearing for clipping checks...
;
mov ax, es:FB_minLSB ;ax <- min LSB
mov ds:GS_minLSB, ax
mov ax, es:FB_minTSB ;ax <- min TSB
mov ds:GS_minTSB, ax
;
; set bits if track kerning or pairwise kerning
;
andnf ds:GS_textMode, not TM_KERNING ;assume no kerning
mov al, GO_FALL_THRU ;al <- opcode for no JMP
tst es:FB_kernCount ;see if any pair kerning info
jz noKernInfo ;branch if no info
ornf ds:GS_textMode, mask TM_PAIR_KERN
mov al, GO_SPECIAL_CASE ;al <- opcode for JMP
noKernInfo:
mov ds:GS_kernOp, al
tst {word}ds:GS_trackKernDegree ;see if track kerning
jz afterKern ;branch if no track kerning
call RecalcKernValues ;recalc track kerning
afterKern:
mov al, ds:GS_fontFlags
andnf al, FONT_GS_FLAGS ;keep internal bits
ornf al, es:FB_flags ;combine with fonts flags
mov ds:GS_fontFlags, al ;save font flags
.leave
ret
UpdateFontOpts endp
RecalcKernValues proc near
.enter
call LibRecalcKernValues ;calculate kerning value
.leave
ret
RecalcKernValues endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockWinFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: With locked Window, find and lock a font
CALLED BY: INTERAL: NearLockFont
PASS: ds - seg addr of GState
es - seg addr of Window
RETURN: ax - seg addr of font
bx - handle of font
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/ 9/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FarLockWinFont proc far
call LockWinFont
ret
FarLockWinFont endp
LockWinFont proc near
uses bp, si
.enter
mov ax, ds:LMBH_handle ;ax <- our GState handle
cmp ax, es:W_curState ;see if current in window
pushf ;save comparison flags
jne matrixInvalid ;if not, matrix invalid
test es:W_grFlags, mask WGF_XFORM_VALID
jne matrixOK
matrixInvalid:
push cx, dx, di ;trashed by GrComposeMatrix
call GrComposeMatrix ;update xform matrix
pop cx, dx, di
matrixOK:
mov bp, es
mov si, offset W_curTMatrix ;bp:si <- addr of xform
call DoFontLock
;
; If this GState isn't the one current in the window, make darn
; sure to mark the transformation invalid. We can't just make the
; passed state the current one b/c we've not done anything about
; the mask region, so...
;
popf ;cmp LMBH_handle, W_curState
je leaveMatrixOK
andnf es:W_grFlags, not mask WGF_XFORM_VALID
leaveMatrixOK:
.leave
ret
LockWinFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FontDrUnlockFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock the font in a gstate.
CALLED BY: GLOBAL (font drivers)
PASS: bx - handle of font
RETURN: none
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
NOTE: this routine should only be called by font drivers
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/ 3/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FontDrUnlockFont proc far
call NearUnlockFont
ret
FontDrUnlockFont endp
if DBCS_PCGEOS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UnlockFontFromGState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock the current font given a GState
CALLED BY: EXTERNAL
PASS: ds - seg addr of GState
RETURN: none
DESTROYED: bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 7/12/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UnlockFontFromGState proc near
mov bx, ds:GS_fontHandle ;bx <- handle of font
FALL_THRU NearUnlockFont
UnlockFontFromGState endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NearUnlockFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock the font in a gstate.
CALLED BY: EXTERNAL: GrGetFontInfo, GrGetCharInfo
PASS: bx - handle of font
RETURN: none
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/ 3/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
NearUnlockFont proc near
uses ds
.enter
EC < push ax >
EC < call MemDerefDS >
EC < mov ax, ds ;ax <- seg addr of font >
EC < call ECCheckFontBufAX >
EC < pop ax >
call NearUnlock ;unlock the font block
LoadVarSeg ds ;ds <- seg addr of idata
cmp bx, ds:defaultFontHandle ;default font?
je done ;branch if default font
call HandleV ;V the font handle
done:
.leave
ret
NearUnlockFont endp
if DBCS_PCGEOS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FontDrLockCharSet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock the current font and lock a different character set
CALLED BY: GLOBAL (video drivers)
PASS: ds - seg addr of GState
dx - character to lock font for (Chars)
RETURN: ax - new font seg addr
carry - set if char does not exist
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
NOTE: must be called with Window locked, or death awaits...
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 7/12/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FontDrLockCharSet proc far
mov ax, dx ;dx <- Chars value
;
; Unlock and invalidate the old font
;
call LockCharSetCommon
jc done ;branch if default char used
;
; Get the Window seg addr
;
push bx, es
mov bx, ds:GS_window ;bx <- Window handle
call MemDerefES ;es <- seg addr of Window
;
; Lock the new font
;
call LockWinFont
pop bx, es
;
; See if we've found anything
;
cmp dh, ds:GS_fontAttr.FCA_charSet
stc ;carry <- char does not exist
jne done ;branch if not found
clc ;carry <- char exists
done:
ret
FontDrLockCharSet endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockCharSet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock the current font and lock a different character section
CALLED BY: EXTERNAL (GrTextWidthWBFixed())
PASS: ds - seg addr of GState
ax - character to lock font for (Chars)
RETURN: ax - new font seg addr
carry - set if char does not exist
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
NOTE: do not call with the Window locked, or deadlock awaits...
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 7/12/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LockCharSetFar proc far
call LockCharSet
ret
LockCharSetFar endp
LockCharSet proc near
uses dx
.enter
mov dx, ax ;dx <- Chars value
;
; Unlock and invalidate the old font
;
call LockCharSetCommon
jc done ;branch if default char used
;
; Lock the new font
;
push bx
call NearLockFont
pop bx
;
; See if we've found anything
;
cmp dh, ds:GS_fontAttr.FCA_charSet
stc ;carry <- char does not exist
jne done ;branch if not found
clc ;carry <- char exists
done:
.leave
ret
LockCharSet endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockCharSetCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Common code to unlock a font and lock a new section
CALLED BY: FontDrLockCharSet(), LockCharSet()
PASS: ds - seg addr of GState
ax - character to lock font for (Chars)
RETURN: carry - set if char does not exist
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 7/12/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LockCharSetCommon proc near
uses bx
.enter
mov bx, ds:GS_fontHandle
;
; See if the character does not exist
;
cmp ah, ds:GS_fontAttr.FCA_charSet
je charNoExist
;
; Unlock the old font
;
call NearUnlockFont
;
; Invalidate the old font
;
call InvalidateFont
;
; Set the character set
;
mov ds:GS_fontAttr.FCA_charSet, ah
clc ;carry <- default not used
done:
.leave
ret
;
; The character does not exist -- return the current font.
;
charNoExist:
mov ax, MGIT_ADDRESS
call MemGetInfo ;ax <- seg addr of font
stc ;carry <- char does not exist
jmp done
LockCharSetCommon endp
endif
if ERROR_CHECK
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECCheckFontBufAX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verify a font is valid
CALLED BY: ECCheckFonts()
PASS: ax - seg addr of FontBuf
RETURN: none
DESTROYED: none (flags destroyed)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 11/30/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ECCheckFontBufAX proc far
uses ds, bx, ax, cx, si, di
.enter
mov ds, ax
;
; See if we should bother with EC
;
call SysGetECLevel
test ax, mask ECF_GRAPHICS
jz quit
;
; Check some values in the font header
;
mov ax, ds:FB_maker
test ax, 0x0fff
ERROR_NZ FONTMAN_FONT_BUF_CORRUPTED
;
; Set up for loop and check # of characters
;
DBCS < mov cx, ds:FB_lastChar >
SBCS < mov cl, ds:FB_lastChar >
DBCS < cmp cx, ds:FB_firstChar >
SBCS < cmp cl, ds:FB_firstChar >
ERROR_B FONTMAN_FONT_BUF_CORRUPTED
DBCS < sub cx, ds:FB_firstChar >
SBCS < sub cl, ds:FB_firstChar >
SBCS < clr ch >
inc cx ;cx <- # of chars
clr si
charLoop:
;
; Get the pointer to the char data, if any
;
mov di, ds:FB_charTable[si].CTE_dataOffset
cmp di, CHAR_MISSING
jbe nextChar
;
; Verify the pointer is within the block size
;
cmp di, ds:FB_dataSize
ERROR_AE FONTMAN_FONT_BUF_CORRUPTED
;
; Make sure the pointer + data is within the block size
;
mov al, ds:[di].CD_pictureWidth
add al, 0x7
shr al, 1
shr al, 1
shr al, 1 ;al <- byte width
mul ds:[di].CD_numRows ;ax <- data size
add ax, (size CharData)-1
cmp ax, ds:FB_dataSize
ERROR_AE FONTMAN_FONT_BUF_CORRUPTED
;
; Go to the next char
;
nextChar:
add si, (size CharTableEntry)
loop charLoop
quit:
.leave
ret
ECCheckFontBufAX endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECCheckFonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verify all fonts in memory
CALLED BY: (f)utility
PASS: none
RETURN: none
DESTROYED: none (flags preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 11/30/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ECCheckFonts proc far
uses ax, bx, si, di, ds
.enter
pushf
;
; See if we should bother with EC
;
call SysGetECLevel
test ax, mask ECF_GRAPHICS
jz quit
;
; Get the font info block and the in use chunk
;
call LockInfoBlock
mov si, ds:[FONTS_IN_USE_HANDLE]
ChunkSizePtr ds, si, di ;di <- chunk size
add di, si ;di <- end of list ptr
;
; Loop through all fonts in use
;
IFIU_loop:
cmp si, di ;are we through the list?
jae endList ;if so, exit
;
; See if entry is in use
;
mov bx, ds:[si].FIUE_dataHandle
tst bx ;any handle?
jz nextEntry ;branch if not
;
; See if block is in memory
;
mov ax, MGIT_ADDRESS ;ax <- MemGetInfoType
call MemGetInfo
tst ax ;block in memory?
jz nextEntry ;branch if not
;
; See if the FontBuf is valid
;
call ECCheckFontBufAX
;
; Go to next entry
;
nextEntry:
add si, (size FontsInUseEntry)
jmp IFIU_loop
;
; Done with the font info block
;
endList:
call UnlockInfoBlock
quit:
popf
.leave
ret
ECCheckFonts endp
endif
| 26.420844 | 80 | 0.589055 |
1e8b4ef63dc8ca0ba8935e315754bc574ede118d | 305 | asm | Assembly | programs/oeis/245/A245337.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/245/A245337.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/245/A245337.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A245337: Sum of digits of n in fractional base 7/6.
; 0,1,2,3,4,5,6,6,7,8,9,10,11,12,11,12,13,14,15,16,17,15,16,17,18,19,20,21,18,19,20,21,22,23,24,20,21,22,23,24,25,26,21,22,23,24,25,26,27,21,22,23,24,25,26,27,27,28,29,30,31,32,33,26,27,28,29,30
mov $1,$0
lpb $0
div $0,7
sub $1,$0
mul $0,6
lpe
| 30.5 | 194 | 0.62623 |
0e4ae0e7e4cc4660653cea0d4b365c764fe9586b | 693 | asm | Assembly | Assembly/CH07N05/CH07N05.asm | IceNerd/hogwarts | df1f3e1a94688fd728f6b54653a36a47671293da | [
"Unlicense"
] | null | null | null | Assembly/CH07N05/CH07N05.asm | IceNerd/hogwarts | df1f3e1a94688fd728f6b54653a36a47671293da | [
"Unlicense"
] | null | null | null | Assembly/CH07N05/CH07N05.asm | IceNerd/hogwarts | df1f3e1a94688fd728f6b54653a36a47671293da | [
"Unlicense"
] | null | null | null | TITLE Fast Multiply (CH07N05.asm)
;Program Description: This program will multiply two integers
; using shifts and adds only.
;
;Author: Alberto Martinez
;Date Created: 10.26.03
;Last Modification Date: 10.26.03
INCLUDE Irvine32.inc
.data
StartMSG BYTE "This program will multiply two positive integers.",0
.code
main PROC
mov edx, OFFSET StartMSG
call WriteString
Call CRLF
call ReadINT
mov ebx,eax
call CRLF
Call ReadINT
call CRLF
mov cl,0
mov edx,0
push ebx
push 0
L1: shr eax,1
jnc L2
shl ebx,cl
pop edx
add edx,ebx
pop ebx
push ebx
push edx
L2: inc cl
cmp cl,32
jne L1
pop eax
pop ebx
call WriteINT
call Crlf
exit
main ENDP
END main | 13.588235 | 67 | 0.715729 |
f41e046cab084b407f425c601fc54e495512e9e7 | 613 | asm | Assembly | oeis/138/A138230.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/138/A138230.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/138/A138230.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A138230: Expansion of (1-x)/(1 - 2*x + 4*x^2).
; 1,1,-2,-8,-8,16,64,64,-128,-512,-512,1024,4096,4096,-8192,-32768,-32768,65536,262144,262144,-524288,-2097152,-2097152,4194304,16777216,16777216,-33554432,-134217728,-134217728,268435456,1073741824,1073741824,-2147483648,-8589934592,-8589934592,17179869184,68719476736,68719476736,-137438953472,-549755813888,-549755813888,1099511627776,4398046511104,4398046511104,-8796093022208,-35184372088832,-35184372088832,70368744177664,281474976710656,281474976710656,-562949953421312,-2251799813685248
mov $1,-2
mov $2,$0
pow $2,2
mod $2,3
sub $0,$2
pow $1,$0
mov $0,$1
| 55.727273 | 494 | 0.776509 |
7a072e04f0ecd44414d437de7bd32addc7c05cbb | 7,074 | asm | Assembly | lib/sse/aes256_cbc_dec_by8_sse.asm | edtubbs/intel-ipsec-mb | 27bb66dcdf5aec2aec8cc0a6bee9c1da96898d7f | [
"BSD-3-Clause"
] | null | null | null | lib/sse/aes256_cbc_dec_by8_sse.asm | edtubbs/intel-ipsec-mb | 27bb66dcdf5aec2aec8cc0a6bee9c1da96898d7f | [
"BSD-3-Clause"
] | null | null | null | lib/sse/aes256_cbc_dec_by8_sse.asm | edtubbs/intel-ipsec-mb | 27bb66dcdf5aec2aec8cc0a6bee9c1da96898d7f | [
"BSD-3-Clause"
] | null | null | null | ;;
;; Copyright (c) 2012-2021, Intel Corporation
;;
;; 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.
;; * Neither the name of Intel Corporation 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.
;;
; routine to do AES cbc decrypt on 16n bytes doing AES by 8
; XMM registers are clobbered. Saving/restoring must be done at a higher level
; void aes_cbc_dec_256_by8_sse(void *in,
; UINT128 *IV,
; UINT128 keys[15],
; void *out,
; UINT64 len_bytes);
;
; arg 1: rcx: pointer to input (cipher text)
; arg 2: rdx: pointer to IV
; arg 3: r8: pointer to keys
; arg 4: r9: pointer to output (plain text)
; arg 5: sp: length in bytes (multiple of 16)
;
%include "include/os.asm"
%include "include/clear_regs.asm"
%include "include/cet.inc"
%ifndef AES_CBC_DEC_256
%define AES_CBC_DEC_256 aes_cbc_dec_256_by8_sse
%endif
%define CONCAT(a,b) a %+ b
%define MOVDQ movdqu
%define xdata0 xmm0
%define xdata1 xmm1
%define xdata2 xmm2
%define xdata3 xmm3
%define xdata4 xmm4
%define xdata5 xmm5
%define xdata6 xmm6
%define xdata7 xmm7
%define xIV xmm8
%define xkey0 xmm9
%define xkey3 xmm10
%define xkey6 xmm11
%define xkey9 xmm12
%define xkey12 xmm13
%define xkeyA xmm14
%define xkeyB xmm15
%ifdef LINUX
%define p_in rdi
%define p_IV rsi
%define p_keys rdx
%define p_out rcx
%define num_bytes r8
%else
%define p_in rcx
%define p_IV rdx
%define p_keys r8
%define p_out r9
%define num_bytes rax
%endif
%define tmp r10
%macro do_aes_load 1
do_aes %1, 1
%endmacro
%macro do_aes_noload 1
do_aes %1, 0
%endmacro
; do_aes num_in_par load_keys
; This increments p_in, but not p_out
%macro do_aes 2
%define %%by %1
%define %%load_keys %2
%if (%%load_keys)
movdqa xkey0, [p_keys + 0*16]
%endif
%assign i 0
%rep %%by
MOVDQ CONCAT(xdata,i), [p_in + i*16]
%assign i (i+1)
%endrep
movdqa xkeyA, [p_keys + 1*16]
%assign i 0
%rep %%by
pxor CONCAT(xdata,i), xkey0
%assign i (i+1)
%endrep
movdqa xkeyB, [p_keys + 2*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyA
%assign i (i+1)
%endrep
add p_in, 16*%%by
%if (%%load_keys)
movdqa xkey3, [p_keys + 3*16]
%endif
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyB
%assign i (i+1)
%endrep
movdqa xkeyA, [p_keys + 4*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkey3
%assign i (i+1)
%endrep
movdqa xkeyB, [p_keys + 5*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyA
%assign i (i+1)
%endrep
%if (%%load_keys)
movdqa xkey6, [p_keys + 6*16]
%endif
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyB
%assign i (i+1)
%endrep
movdqa xkeyA, [p_keys + 7*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkey6
%assign i (i+1)
%endrep
movdqa xkeyB, [p_keys + 8*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyA
%assign i (i+1)
%endrep
%if (%%load_keys)
movdqa xkey9, [p_keys + 9*16]
%endif
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyB
%assign i (i+1)
%endrep
movdqa xkeyA, [p_keys + 10*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkey9
%assign i (i+1)
%endrep
movdqa xkeyB, [p_keys + 11*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyA
%assign i (i+1)
%endrep
%if (%%load_keys)
movdqa xkey12, [p_keys + 12*16]
%endif
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyB
%assign i (i+1)
%endrep
movdqa xkeyA, [p_keys + 13*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkey12
%assign i (i+1)
%endrep
movdqa xkeyB, [p_keys + 14*16]
%assign i 0
%rep %%by
aesdec CONCAT(xdata,i), xkeyA
%assign i (i+1)
%endrep
%assign i 0
%rep %%by
aesdeclast CONCAT(xdata,i), xkeyB
%assign i (i+1)
%endrep
pxor xdata0, xIV
%assign i 1
%if (%%by > 1)
%rep (%%by - 1)
MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by]
pxor CONCAT(xdata,i), xIV
%assign i (i+1)
%endrep
%endif
MOVDQ xIV, [p_in + (i-1)*16 - 16*%%by]
%assign i 0
%rep %%by
MOVDQ [p_out + i*16], CONCAT(xdata,i)
%assign i (i+1)
%endrep
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section .text
align 32
;; AES_CBC_DEC_256(void *in, void *IV, void *keys, void *out, UINT64 num_bytes)
MKGLOBAL(AES_CBC_DEC_256,function,internal)
AES_CBC_DEC_256:
endbranch64
%ifndef LINUX
mov num_bytes, [rsp + 8*5]
%endif
movdqu xIV, [p_IV]
mov tmp, num_bytes
and tmp, 7*16
jz mult_of_8_blks
; 1 <= tmp <= 7
cmp tmp, 4*16
jg gt4
je eq4
lt4:
cmp tmp, 2*16
jg eq3
je eq2
eq1:
do_aes_load 1
add p_out, 1*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
eq2:
do_aes_load 2
add p_out, 2*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
eq3:
do_aes_load 3
add p_out, 3*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
eq4:
do_aes_load 4
add p_out, 4*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
gt4:
cmp tmp, 6*16
jg eq7
je eq6
eq5:
do_aes_load 5
add p_out, 5*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
eq6:
do_aes_load 6
add p_out, 6*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
eq7:
do_aes_load 7
add p_out, 7*16
and num_bytes, ~7*16
jz do_return2
jmp main_loop2
mult_of_8_blks:
movdqa xkey0, [p_keys + 0*16]
movdqa xkey3, [p_keys + 3*16]
movdqa xkey6, [p_keys + 6*16]
movdqa xkey9, [p_keys + 9*16]
movdqa xkey12, [p_keys + 12*16]
main_loop2:
; num_bytes is a multiple of 8 and >0
do_aes_noload 8
add p_out, 8*16
sub num_bytes, 8*16
jne main_loop2
do_return2:
%ifdef SAFE_DATA
clear_all_xmms_sse_asm
%endif ;; SAFE_DATA
ret
%ifdef LINUX
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
| 19.327869 | 81 | 0.670483 |
e4ffab1d2bf507879bc7a24bdbb2002169ac1640 | 1,028 | asm | Assembly | rom/src/map.asm | Gegel85/GBCGoogleMaps | 035a110fd565844b5c3c7188d6eba0933af31b9a | [
"MIT"
] | null | null | null | rom/src/map.asm | Gegel85/GBCGoogleMaps | 035a110fd565844b5c3c7188d6eba0933af31b9a | [
"MIT"
] | 13 | 2020-02-13T15:03:13.000Z | 2020-02-13T15:27:08.000Z | rom/src/map.asm | Gegel85/GBCGoogleMaps | 035a110fd565844b5c3c7188d6eba0933af31b9a | [
"MIT"
] | null | null | null | ZOOM_MAX = 20
loadTiles::
ld de, $9000
ld hl, tilemap
ld bc, $800
call copyMemory
ld de, $8800
ld hl, tilemap + $800
ld bc, $800
jp copyMemory
loadMap::
call waitVBLANK
reset lcdCtrl
xor a
ld de, VRAMBgStart
ld bc, $300
call fillMemory
call loadTiles
ld bc, 0
call getTileMap
reg lcdCtrl, LCD_BASE_CONTROL_BYTE
map::
call waitVBLANK
call handlePacket
call getKeysFiltered
ld bc, $0000
bit 7, a ; Start
jp z, welcomeScreen
bit 5, a ; B
jr z, .zoomOut
bit 4, a ; A
jr z, .zoomIn
bit 0, a ; Right
jr z, .scrollRight
bit 1, a ; Left
jr z, .scrollLeft
bit 2, a ; Up
jr z, .scrollUp
bit 3, a ; Down
jr nz, map
.scrollDown:
ld c, $EE
call getTileMap
jr map
.scrollLeft:
ld b, $EC
call getTileMap
jr map
.scrollRight:
ld b, $14
call getTileMap
jr map
.scrollUp:
ld c, $12
call getTileMap
jr map
.zoomOut:
ld hl, zoomLevel
xor a
or [hl]
jr z, map
dec [hl]
call getTileMap
jr map
.zoomIn:
ld hl, zoomLevel
ld a, ZOOM_MAX
cp [hl]
jr z, map
inc [hl]
call getTileMap
jr map | 13.179487 | 35 | 0.671206 |
f7e2c4a8340266345b0ee5edf034bd80356439c4 | 122 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/fonts/dkud2/Eclipse/_ff_dkud2_Eclipse.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/fonts/dkud2/Eclipse/_ff_dkud2_Eclipse.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/fonts/dkud2/Eclipse/_ff_dkud2_Eclipse.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION rodata_font_fzx
PUBLIC _ff_dkud2_Eclipse
_ff_dkud2_Eclipse:
BINARY "font/fzx/fonts/dkud2/Eclipse/eclipse.fzx"
| 13.555556 | 49 | 0.836066 |
30d5d98a32a58eb8ee54b45ee90e0286eff4bc19 | 2,169 | asm | Assembly | programs/oeis/017/A017813.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017813.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017813.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017813: Binomial coefficients C(97,n).
; 1,97,4656,147440,3464840,64446024,988172368,12846240784,144520208820,1429144287220,12576469727536,99468442390512,712857170465336,4660989191504120,27965935149024720,154744841157936784,793067310934426018,3778732481511088674,16794366584493727440,69829208430263393040,272333912878027232856,998557680552766520472,3449562896455011616176,11248574662353298748400,34683105208922671140900,101274667210054199731428,280452924581688553102416,737487320196292121121168,1843718300490730302802920,4386778025305530720462120,9943363524025869633047472,21490495358378492432715504,44324146676655640642475727,87305137393412625507906735,164339082152306118603118560,295810347874151013485613408,509451154672148967669667536,839905957702732081833776208,1326167301635892760790172960,2006253097346606997092825760,2909066991152580145784597352,4044312646236513861212732904,5392416861648685148283643872,6897277381178550771060474720,8464840422355494128119673520,9969700941885359750896504368,11270096716913884935796048416,12229253884310811313310605728,12738806129490428451365214300,12738806129490428451365214300,12229253884310811313310605728,11270096716913884935796048416,9969700941885359750896504368,8464840422355494128119673520,6897277381178550771060474720,5392416861648685148283643872,4044312646236513861212732904,2909066991152580145784597352,2006253097346606997092825760,1326167301635892760790172960,839905957702732081833776208,509451154672148967669667536,295810347874151013485613408,164339082152306118603118560,87305137393412625507906735,44324146676655640642475727,21490495358378492432715504,9943363524025869633047472,4386778025305530720462120,1843718300490730302802920,737487320196292121121168,280452924581688553102416,101274667210054199731428,34683105208922671140900,11248574662353298748400,3449562896455011616176,998557680552766520472,272333912878027232856,69829208430263393040,16794366584493727440,3778732481511088674,793067310934426018,154744841157936784,27965935149024720,4660989191504120,712857170465336,99468442390512,12576469727536,1429144287220,144520208820,12846240784,988172368,64446024,3464840,147440,4656,97,1
mov $1,97
bin $1,$0
mov $0,$1
| 309.857143 | 2,095 | 0.941909 |
d97defa48787b00cb33ec666213c16fd660c0592 | 597 | asm | Assembly | lib/TrinketHidCombo/usbdrv/usbdrvasm.asm | debsahu/A85_KeyBoard_HID | eba3c69d05cab6acf10c259f08e4b81202016304 | [
"MIT"
] | null | null | null | lib/TrinketHidCombo/usbdrv/usbdrvasm.asm | debsahu/A85_KeyBoard_HID | eba3c69d05cab6acf10c259f08e4b81202016304 | [
"MIT"
] | null | null | null | lib/TrinketHidCombo/usbdrv/usbdrvasm.asm | debsahu/A85_KeyBoard_HID | eba3c69d05cab6acf10c259f08e4b81202016304 | [
"MIT"
] | null | null | null | /* Name: usbdrvasm.asm
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
* Author: Christian Starkjohann
* Creation Date: 2006-03-01
* Tabsize: 4
* Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
*/
/*
General Description:
The IAR compiler/assembler system prefers assembler files with file extension
".asm". We simply provide this file as an alias for usbdrvasm.S.
Thanks to Oleg Semyonov for his help with the IAR tools port!
*/
#include "usbdrvasm.S"
//end
| 28.428571 | 91 | 0.743719 |
ef0f20fedf0017f7ef5ff5cae39bad49ef274fd0 | 3,162 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_60_2824.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_60_2824.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_60_2824.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r8
push %rbp
push %rdi
push %rdx
// Load
lea addresses_D+0x1089d, %r13
nop
nop
nop
and %r8, %r8
vmovups (%r13), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
nop
nop
nop
dec %r15
// Store
lea addresses_WT+0x8389, %r11
nop
nop
nop
nop
nop
and %rdi, %rdi
mov $0x5152535455565758, %r8
movq %r8, %xmm7
vmovaps %ymm7, (%r11)
nop
nop
and $50294, %r11
// Store
lea addresses_WT+0xe1d4, %r13
nop
nop
and %rdx, %rdx
mov $0x5152535455565758, %r11
movq %r11, %xmm0
vmovups %ymm0, (%r13)
add %r11, %r11
// Store
lea addresses_WC+0x157f9, %rbp
nop
nop
nop
nop
nop
add $31164, %r8
mov $0x5152535455565758, %rdx
movq %rdx, %xmm3
vmovups %ymm3, (%rbp)
// Exception!!!
nop
nop
nop
nop
nop
mov (0), %rdx
nop
nop
nop
nop
dec %rbp
// Store
lea addresses_US+0x164c9, %r15
sub $14900, %rdi
movb $0x51, (%r15)
inc %r11
// Load
lea addresses_WC+0x179c9, %r13
nop
nop
xor %rbp, %rbp
vmovups (%r13), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %rdi
nop
nop
nop
nop
nop
sub $56381, %r13
// Store
lea addresses_D+0x1d868, %rdx
nop
nop
cmp $33365, %r15
mov $0x5152535455565758, %r8
movq %r8, %xmm6
vmovups %ymm6, (%rdx)
nop
nop
nop
nop
cmp %r8, %r8
// Store
lea addresses_US+0x14bd1, %r8
nop
nop
nop
xor $31532, %rbp
mov $0x5152535455565758, %r13
movq %r13, %xmm7
movups %xmm7, (%r8)
nop
nop
cmp $55027, %r15
// Faulty Load
lea addresses_US+0x166c9, %r13
nop
nop
nop
nop
nop
inc %rdi
movb (%r13), %r15b
lea oracles, %rdx
and $0xff, %r15
shlq $12, %r15
mov (%rdx,%r15,1), %r15
pop %rdx
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 6, 'NT': True, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 60}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 18.710059 | 179 | 0.642315 |
b3d14258c21429797c5dd3b7c1e7e569077382b3 | 8,907 | asm | Assembly | gravity-x-face-patch/patcher.asm | matthijsln/winface | 54156bc89ab59eda24db0f0236bd57dccccd7ea4 | [
"BSD-3-Clause"
] | null | null | null | gravity-x-face-patch/patcher.asm | matthijsln/winface | 54156bc89ab59eda24db0f0236bd57dccccd7ea4 | [
"BSD-3-Clause"
] | null | null | null | gravity-x-face-patch/patcher.asm | matthijsln/winface | 54156bc89ab59eda24db0f0236bd57dccccd7ea4 | [
"BSD-3-Clause"
] | null | null | null | %include "win32.inc"
%include "macros.inc"
%include "kernel32.inc"
section .data
; --- screen messages ---
string greeting, "Microplanet Gravity X-Face patch v1.2", CRLF, "Gravity versions supported: 2.12, 2.3, 2.5, 2.6 build 2039", CRLF, CRLF, "This program will: ", CRLF, " - Check if the Gravity.exe file matches a known version", CRLF, " - Make a backup of Gravity.exe to Gravity.exe.bak", CRLF, " - Patch Gravity.exe to add the X-Face display feature", CRLF, CRLF, "The patched Gravity.exe will require WinFace.dll.", CRLF, CRLF
string question, "Do you want to proceed with this? (type y if you do) "
string notice1, CRLF, CRLF, "Verifying Gravity.exe...", CRLF
string notice2, " File opened", CRLF
notice3 db " File size OK, Gravity version 2."
notice3versionminor db "xx build "
notice3build db "xxxx", CRLF
notice3_end:
%define notice3_size notice3_end-notice3
string notice4, " Integrity check passed", CRLF, "Copying Gravity.exe to Gravity.exe.bak...", CRLF
string notice5, " Backup created", CRLF, "Patching Gravity.exe...", CRLF
string notice6, " Patch successfully applied", CRLF
string error, "Error: "
string wrong_filesize, "File size does not match any known version"
string integrity_fail, "File integrity failure; patch already applied?"
string error_gravity_damaged, "File writing error, Gravity.exe may be damaged - restore backup", CRLF
string done, CRLF, "Press any key to exit..."
; --- filenames ---
string filename, "Gravity.exe", 0
string backup_filename, "Gravity.exe.bak", 0
; --- some buffers ---
dummy dd 0
string charbuf, " "
err_msg_ptr dd 0
buf db 0
; --- patch data ---
; Gravity.exe file sizes
%define GRAV_2039_FS 2584576
%define GRAV_2000_FS 2506752
%define GRAV_2000_IT_FS 2985984
%define GRAV_1800_FS 2523136
%define GRAV_1020_FS 2318336
; part 1 of the patch; the code which will jump to part 2. Gravity reaches this
; code when it has header lines to process. At [ecx+17] there will be a pointer
; to the headers.
; build 1020
; original code
; 00406F7D 8A45 0B mov al, byte ptr [ebp+B]
; 00406F80 84C0 test al, al
; 00406F82 0F85 3C030000 jnz Gravity.004072C4
; patched code
; 00406F7D E9 6693FFFF jmp Gravity.004002E8
; 00406F82 0F85 3C030000 jnz Gravity.004072C4
; build 1800
; original code
; 0040790C 8A45 0B mov al, byte ptr [ebp+B]
; 0040790F 84C0 test al, al
; 00407911 0F85 E0020000 jnz Gravity.00407BF7
; patched code
; 0040790C E9 D789FFFF jmp Gravity.004002E8
; 00407911 0F85 E0020000 jnz Gravity.00407BF7
; build 2000
; original code
; 0040763C 8A45 0B mov al, byte ptr [ebp+B]
; 0040763F 84C0 test al, al
; 00407641 0F85 E0020000 jnz Gravity.00407927
; patched code
; 0040763C E9 A78CFFFF jmp Gravity.004002E8
; 00407641 0F85 E0020000 jnz Gravity.00407927
; build 2039
; 0040930C 8A43 0B mov al, byte ptr [ebx+B]
; 0040930F 84C0 test al, al
; 00409311 74 0C je short Gravity.0040931F
; patched code:
; 0040930C E9 D76FFFFF jmp Gravity.004002E8
; 00409311 74 0C je short Gravity.0040931F
jmppatch db 0e9h
jmppatch_word db 0, 0, 0ffh, 0ffh
; part 2 of the patch; the code which part 1 will jump to. this will be placed
; at offset 02e8h in the file, which corresponds to 04002e8h at runtime. this
; is originally filled with 3,352 bytes of zeroes for aligning sections.
%define PATCH_OFFSET 02e8h
patch_2039:
incbin "patch-2039.bin"
patch_2039_end:
%define PATCH_SIZE patch_2039_end - patch_2039 ; patch size is for all builds equal
patch_2000:
incbin "patch-2000.bin"
patch_1800:
incbin "patch-1800.bin"
patch_1020:
incbin "patch-1020.bin"
struc vd
.jmppatch_offset resd 1
.jmppatch_word resw 1
.patch resd 1
endstruc
grav_1020_data istruc vd
at vd.jmppatch_offset, dd 06f7dh
at vd.jmppatch_word, db 066h, 093h
at vd.patch, dd patch_1020
iend
grav_1800_data istruc vd
at vd.jmppatch_offset, dd 0790ch
at vd.jmppatch_word, db 0d7h, 089h
at vd.patch, dd patch_1800
iend
grav_2000_data istruc vd
at vd.jmppatch_offset, dd 0763ch
at vd.jmppatch_word, db 0a7h, 08ch
at vd.patch, dd patch_2000
iend
grav_2039_data istruc vd
at vd.jmppatch_offset, dd 0930ch
at vd.jmppatch_word, db 0d7h, 06fh
at vd.patch, dd patch_2039
iend
; --- patch applier code ---
section .code
; print string %1 defined with "string" macro (or if %1_size is defined manually)
; edi: stdout handle
%macro print 1
invoke WriteConsoleA, edi, %1, dword %1_size, dword dummy, 0
%endmacro
; print string %1 with length %2
; edi: stdout handle
%macro print 2
invoke WriteConsoleA, edi, %1, %2, dword dummy, 0
%endmacro
; read a single char from stdin into charbuf
; esi: stdin handle
%define readchar invoke ReadConsoleA, esi, dword charbuf, 1, dword dummy, 0
global _main
_main:
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov edi, eax
invoke GetStdHandle, STD_INPUT_HANDLE
mov esi, eax
invoke SetConsoleMode, esi, 0
print dword greeting
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
print dword question
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
readchar
mov bl, [charbuf]
print dword charbuf
cmp bl, "y"
je .continue
cmp bl, "Y"
je .continue
jmp .abort
.continue:
print dword notice1
; open the file
invoke CreateFileA, dword filename, dword GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0
cmp eax, INVALID_HANDLE_VALUE
je .show_last_error
mov ebx, eax
print dword notice2
; determine file size
invoke GetFileSize, ebx, 0
cmp eax, -1
je .show_last_error
cmp eax, GRAV_2039_FS
je .ok2039
cmp eax, GRAV_2000_FS
je .ok2000
cmp eax, GRAV_2000_IT_FS
je .ok2000
cmp eax, GRAV_1800_FS
je .ok1800
cmp eax, GRAV_1020_FS
je .ok1020
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_INTENSITY
print dword error
print dword wrong_filesize
jmp .quit
.ok2039:
mov ebp, grav_2039_data
mov word [notice3versionminor], '60'
mov dword [notice3build], '2039'
jmp .ok
.ok2000:
mov ebp, grav_2000_data
mov word [notice3versionminor], '50'
mov dword [notice3build], '2000'
jmp .ok
.ok1800:
mov ebp, grav_1800_data
mov word [notice3versionminor], '30'
mov dword [notice3build], '1800'
jmp .ok
.ok1020:
mov ebp, grav_1020_data
mov word [notice3versionminor], '12'
mov dword [notice3build], '1020'
.ok:
print dword notice3
; minimalist integrity check: check for 8A
; machine code at the jump patch offset
invoke SetFilePointer, ebx, dword [ebp+vd.jmppatch_offset], 0, FILE_BEGIN
invoke ReadFile, ebx, dword buf, 1, dword dummy, 0
cmp byte [buf], 08ah
jne .integrity_fail
print dword notice4
; backup
invoke CopyFileA, dword filename, dword backup_filename, 1
test eax, eax
jz .backup_fail
print dword notice5
; patch part 1
mov ax, [ebp+vd.jmppatch_word]
mov [jmppatch_word], ax
invoke SetFilePointer, ebx, -1, 0, FILE_CURRENT
invoke WriteFile, ebx, dword jmppatch, 5, dword dummy, 0
test eax, eax
jz .write_fail
; patch part 2
invoke SetFilePointer, ebx, dword PATCH_OFFSET, 0, FILE_BEGIN
invoke WriteFile, ebx, dword [ebp+vd.patch], dword PATCH_SIZE, dword dummy, 0
test eax, eax
jz .write_fail
invoke SetConsoleTextAttribute, edi, FOREGROUND_GREEN | FOREGROUND_INTENSITY
print dword notice6
invoke CloseHandle, ebx
jmp .no_error
.integrity_fail:
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_INTENSITY
print dword error
print dword integrity_fail
invoke CloseHandle, ebx
jmp .quit
.write_fail:
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_INTENSITY
print dword error_gravity_damaged
;??? bad lasterror due to print ???
.backup_fail:
invoke GetLastError
push eax
invoke CloseHandle, ebx
pop eax
invoke SetLastError, eax
.show_last_error:
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_INTENSITY
invoke GetLastError
invoke FormatMessageA, dword FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, 0, eax, 0, dword err_msg_ptr, 0, 0
mov ebx, eax
print dword error
mov eax, [err_msg_ptr]
print eax, ebx
.quit:
.no_error:
invoke SetConsoleTextAttribute, edi, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
print dword done
readchar
.abort:
xor eax, eax
ret | 26.747748 | 427 | 0.698664 |
d720587c370e870d16f9eb6946e9d1fec834f97a | 864 | asm | Assembly | sum.asm | pietroluongo/x86-calc | 2dd394618507c8966dd683ee7cc2b47771e46cff | [
"MIT"
] | null | null | null | sum.asm | pietroluongo/x86-calc | 2dd394618507c8966dd683ee7cc2b47771e46cff | [
"MIT"
] | null | null | null | sum.asm | pietroluongo/x86-calc | 2dd394618507c8966dd683ee7cc2b47771e46cff | [
"MIT"
] | null | null | null | global _soma
; Função de soma de dois números
; retorno: EAX WORD número resultante da soma
; arg0: STACK WORD número 1
; arg1: STACK WORD número 2
; arg2: STACK WORD endereço de armazenamento do resultado
; Código equivalente:
; int16_t soma(int16_t a, int16_t b, int16_t* res) {
; int16_t tmp = a + b;
; *res = tmp;
; return tmp;
; }
; Stack:
; 0x0000 = BP
; 0x0002 = Endereço de retorno
; 0x0004 = arg2 int32_t*
; 0x0006 = arg1 int16_t
; 0x0008 = arg0 int16_t
_soma:
; Configuração da pilha
PUSH BP
MOV BP, SP
MOV AX, WORD [BP + 8]
MOV CX, WORD [BP + 6]
MOV BX, WORD [BP + 4]
ADD AX, CX
MOV [BX], AX ; Lower bytes
MOV WORD [BX + 2], 0 ; Upper bytes - always zero, as we are using WORDs
POP BP
RET 6
| 21.073171 | 80 | 0.556713 |
2925be638c751a1e73e0cc54915c8b3cb373a98a | 211 | asm | Assembly | lablar/Hello.asm | AbderrhmanAbdellatif/SysPro | fa6ee66a63a62043c5d114bf80efec397fb1a13c | [
"MIT"
] | null | null | null | lablar/Hello.asm | AbderrhmanAbdellatif/SysPro | fa6ee66a63a62043c5d114bf80efec397fb1a13c | [
"MIT"
] | null | null | null | lablar/Hello.asm | AbderrhmanAbdellatif/SysPro | fa6ee66a63a62043c5d114bf80efec397fb1a13c | [
"MIT"
] | null | null | null | segment .data
msg db "HELLO ,world ! ", 10
len equ $ - msg
segment .text
global _start
_start:
mov eax,4 ;systme call number
mov ebx,1 ; input
mov ecx,msg
mov edx,len
int 80h
mov eax,1
mov ebx,0
int 80h
| 11.105263 | 29 | 0.687204 |
8d42816d7a0c157510753cc184998728119e2003 | 2,435 | asm | Assembly | progs/chap05h04-str.asm | HKhademian/AssemblyDandamudi | b4d4ccbb7e585953a8d2d22b47d815a3f45f9129 | [
"Unlicense"
] | 1 | 2020-05-07T14:20:09.000Z | 2020-05-07T14:20:09.000Z | progs/chap05h04-str.asm | HKhademian/AssemblyDandamudi | b4d4ccbb7e585953a8d2d22b47d815a3f45f9129 | [
"Unlicense"
] | null | null | null | progs/chap05h04-str.asm | HKhademian/AssemblyDandamudi | b4d4ccbb7e585953a8d2d22b47d815a3f45f9129 | [
"Unlicense"
] | null | null | null | %include "lib.asm"
%include "lib-string.asm"
extern ExitProcess
section .text
MAX_TEXT EQU 1000
CRLF db CR, LF, NULL
CTAB db TAB, NULL
MSG_EQ db "= ", NULL
MSG_TEXT db "Text", NULL
MSG_INP db "Input ", NULL
MSG_LEN db "Len ", NULL
MSG_DIF db "Difference", NULL
MSG_SRC db "Search", NULL
MSG_STRLEN db "strlen(str)", CR, LF, NULL
MSG_STRCMP db "strcmp(str1, str2)", CR, LF, NULL
MSG_STRSTR db "strstr(str1, str2)", CR, LF, NULL
MSG_STRCAT db "strcat(str1, str2)", CR, LF, NULL
MSG_STRNCAT db "strncat(str1, str2, n)", CR, LF, NULL
MSG_STRCPY db "strcpy(str1, str2)", CR, LF, NULL
MSG_STRNCPY db "strncpy(str1, str2, n)", CR, LF, NULL
section .bss
text1 resb MAX_TEXT
text2 resb MAX_TEXT
buffer resb 25
section .data
section .data
section .code
global _start
logTexts:
putstr MSG_TEXT
i2a 1, buffer
putstr buffer
putstr MSG_EQ
putstr text1
putstr CRLF
putstr MSG_TEXT
i2a 2, buffer
putstr buffer
putstr MSG_EQ
putstr text2
putstr CRLF
putstr CRLF
ret
_start:
putstr MSG_INP
putstr MSG_TEXT
i2a 1, buffer
putstr buffer
putstr MSG_EQ
fgets text1, MAX_TEXT
putstr MSG_INP
putstr MSG_TEXT
i2a 2, buffer
putstr buffer
putstr MSG_EQ
fgets text2, MAX_TEXT
putstr CRLF
; putstr MSG_STRLEN
; push text1
; call strlen
; putstr MSG_LEN
; putstr MSG_TEXT
; i2a 1, buffer
; putstr buffer
; putstr MSG_EQ
; i2a DWORD [ESP], buffer
; putstr buffer
; putstr CRLF
;
; push text2
; call strlen
; putstr MSG_LEN
; putstr MSG_TEXT
; i2a 2, buffer
; putstr buffer
; putstr MSG_EQ
; i2a DWORD [ESP], buffer
; putstr buffer
; putstr CRLF
; putstr CRLF
; putstr MSG_STRCMP
; push text1
; push text2
; call strcmp
; i2a DWORD [ESP], buffer
; putstr MSG_DIF
; putstr MSG_EQ
; putstr buffer
; putstr CRLF
; putstr CRLF
; putstr MSG_STRSTR
; push text1
; push text2
; call strstr
; mov EAX, DWORD [ESP]
; putstr MSG_SRC
; putstr MSG_EQ
; putstr EAX
; putstr CRLF
; putstr CRLF
; putstr MSG_STRCAT
; push text1
; push text2
; call strcat
; call logTexts
mov byte [text1+3], 0
call logTexts
putstr MSG_STRNCAT
push text1
push text2
push DWORD 4
call strncat
call logTexts
; ;mov byte [text1+3], 0
; ;call logTexts
; putstr MSG_STRNCPY
; push text1
; push text2
; push DWORD 4
; call strncpy
; call logTexts
; putstr MSG_STRCPY
; push text1
; push text2
; call strcpy
; call logTexts
_end:
push 0
call ExitProcess
| 16.233333 | 54 | 0.697741 |
32107c4c96380caabfec2ac9dd9218795d49784f | 324 | asm | Assembly | programs/oeis/133/A133600.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/133/A133600.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/133/A133600.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A133600: Row sums of triangle A133599.
; 1,4,7,16,28,64,112,256,448,1024,1792,4096,7168,16384,28672,65536,114688,262144,458752,1048576,1835008,4194304,7340032,16777216,29360128,67108864,117440512,268435456,469762048,1073741824,1879048192
sub $0,1
mov $1,2
pow $1,$0
gcd $0,2
add $0,6
mul $0,$1
div $0,6
mul $0,3
add $0,1
| 24.923077 | 198 | 0.746914 |
e40c6dcbeb2cf3fa08a86bb9296379d951370183 | 1,128 | asm | Assembly | programs/oeis/055/A055246.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/055/A055246.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/055/A055246.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A055246: At step number k >= 1 the 2^(k-1) open intervals that are erased from [0,1] in the Cantor middle-third set construction are I(k,n) = (a(n)/3^k, (1+a(n))/3^k), n=1..2^(k-1).
; 1,7,19,25,55,61,73,79,163,169,181,187,217,223,235,241,487,493,505,511,541,547,559,565,649,655,667,673,703,709,721,727,1459,1465,1477,1483,1513,1519,1531,1537,1621,1627,1639,1645,1675,1681,1693,1699
mov $35,$0
mov $37,$0
add $37,1
mov $38,$0
lpb $37,1
mov $0,$35
sub $37,1
sub $0,$37
mov $31,$0
mov $33,2
lpb $33,1
clr $0,31
mov $0,$31
sub $33,1
add $0,$33
sub $0,1
mov $27,$0
add $27,1
mov $28,$0
lpb $27,1
clr $0,25
sub $27,1
sub $0,$27
lpb $0,1
gcd $0,1073741824
add $3,3
lpb $0,1
div $0,2
mul $3,3
lpe
mov $2,$3
lpe
mov $1,$2
div $1,6
add $26,$1
lpe
mov $1,$26
add $1,$28
mov $34,$33
lpb $34,1
mov $32,$1
sub $34,1
lpe
lpe
lpb $31,1
mov $31,0
sub $32,$1
lpe
mov $1,$32
mul $1,2
add $1,1
add $36,$1
lpe
mov $1,$36
add $1,$38
| 19.118644 | 199 | 0.507979 |
de081edf6384247987b0874d74deb27bf03724a1 | 249 | asm | Assembly | pwnlib/shellcraft/templates/powerpc/linux/stime.asm | zaratec/pwntools | 8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba | [
"MIT"
] | 5 | 2018-05-15T13:00:56.000Z | 2020-02-09T14:29:00.000Z | pwnlib/shellcraft/templates/powerpc/linux/stime.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/powerpc/linux/stime.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | 6 | 2017-09-07T02:31:11.000Z | 2021-07-05T16:59:18.000Z |
<%
from pwnlib.shellcraft.powerpc.linux import syscall
%>
<%page args="when"/>
<%docstring>
Invokes the syscall stime. See 'man 2 stime' for more information.
Arguments:
when(time_t): when
</%docstring>
${syscall('SYS_stime', when)}
| 17.785714 | 67 | 0.682731 |
9ea11c0881c0453930ae9fb46e90d461ffd86f5f | 638 | asm | Assembly | libsrc/graphics/spc1000/pixel_MODE1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/spc1000/pixel_MODE1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/spc1000/pixel_MODE1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null |
EXTERN pixeladdress
EXTERN __gfx_coords
INCLUDE "graphics/grafix.inc"
; Generic code to handle the pixel commands
; Define NEEDxxx before including
ld a,l
cp 192
ret nc
ld (__gfx_coords),hl
push bc ;Save callers value
call pixeladdress ;hl = address, a = pixel number
ld b,a
ld a,1
jr z, rotated ; pixel is at bit 0...
.plot_position
rlca
djnz plot_position
; a = byte holding pixel mask
; hl = address
rotated:
ld c,l
ld b,h
in l,(c)
IF NEEDplot
or l
out (c),a
ENDIF
IF NEEDunplot
cpl
and l
out (c),a
ENDIF
IF NEEDxor
xor l
out (c),a
ENDIF
IF NEEDpoint
and l
ENDIF
pop bc ;Restore callers
ret
| 13.869565 | 51 | 0.694357 |
abb71f0cb9848310ded9334c065871c74042523f | 758 | asm | Assembly | programs/oeis/267/A267034.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/267/A267034.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/267/A267034.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A267034: Triangle read by rows giving successive states of cellular automaton generated by "Rule 85" initiated with a single ON (black) cell.
; 1,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
lpb $0,1
add $0,1
mov $2,3
sub $2,$1
mov $1,$2
add $3,2
trn $0,$3
lpe
add $0,1
mov $1,$0
trn $1,$2
| 50.533333 | 501 | 0.550132 |
164de9b879827414fd4916940ee60a2bf8148ee9 | 20,691 | asm | Assembly | CEVDECODER/src/M1X2-ZX7.asm | ctrefethen/CEVidium | 4307b8180cbda4bf158be1ac37736fdd397de745 | [
"MIT"
] | null | null | null | CEVDECODER/src/M1X2-ZX7.asm | ctrefethen/CEVidium | 4307b8180cbda4bf158be1ac37736fdd397de745 | [
"MIT"
] | null | null | null | CEVDECODER/src/M1X2-ZX7.asm | ctrefethen/CEVidium | 4307b8180cbda4bf158be1ac37736fdd397de745 | [
"MIT"
] | null | null | null | .ASSUME ADL=1
#DEFINE VBUFSTART $D40000 ;Start of VRAM, screen buffer
#DEFINE VBUFSIZE $012C00 ;Total size of video buffer: x2 4bpp buffers
#DEFINE BUFSWAPMASK $96 ;XOR this with 2nd byte of screen buffer address
#DEFINE MAIN_FIELD_LOC $D52C00 ;Primary location, 3072 bytes large
#DEFINE FAST_FIELD_LOC $D53800 ;Reserved for fast code exec, 1024 bytes large
#DEFINE DECOMP_BUFFER $D54000 ;
#DEFINE VLCD_CTRL $E30000
#DEFINE VLCD_PAL $E30200
#DEFINE BDA_FIELD_WIDTH 7
#DEFINE SCOL_CMD $2A ;X-AXIS (256px wide, start 32, end 288-1)
#DEFINE SROW_CMD $2B ;Y-AXIS (144px high, start 48, end 192-1)
#DEFINE LCD_WIDTH 320
#DEFINE LCD_HEIGHT 240
#DEFINE VIDEO_WIDTH 144
#DEFINE VSEG_ARR 3
#DEFINE VSTRUCT 6
#DEFINE VSEG_STR -40
#DEFINE VSEG_CUR -43
#DEFINE VSEG_END -46
#DEFINE PREV_BUF -49
#DEFINE PREV_LMO -52
#DEFINE M_FRAMES -55
#DEFINE C_FRAME -56
#DEFINE F_HEIGHT -57
#DEFINE V_CODEC 0
#DEFINE V_TITLE 3
#DEFINE V_AUTH 6
#DEFINE V_SEGS 9
#DEFINE V_WIDTH 12
#DEFINE V_HEIGHT 15
#DEFINE V_SEGFR 18
#DEFINE V_BDEPTH 21
.ORG 0 \ .DB "8CECPck" ;Decoder file header
.ORG 7 \ .DB "M1X2-ZX7",0 ;Multiformat ver 1, scale x2, ZX7 decompression
.ORG 16 \ .DB 2 ;Number of fields
;===================================================================================
;===================================================================================
;===================================================================================
;===================================================================================
.DW MF_END-MF_START \ .DL MAIN_FIELD_LOC \ .ORG MAIN_FIELD_LOC
;In: (SP+3) = ptr to data segment array, (SP+6) = ptr to video metadata struct
MF_START:
DI
LD IY,0
ADD IY,SP
LD HL,(IY+VSTRUCT)
LD BC,V_BDEPTH
ADD HL,BC
LD A,(HL) ;Fetch bit depth
CP 5
RET NC
;JR $
PUSH IX
PUSH AF
;CLEAR SCREEN BUFFERS
LD HL,VBUFSTART
LD BC,VBUFSIZE
CALL $0210DC ;MemClear
;-- SET UP LCD CONTROLLER
LD IX,VLCD_CTRL
LD HL,(IX+$10) \ LD (IY+PREV_BUF),HL ;SAVE PREVIOUS BUFFER ADDRESS
LD A,(IX+$18) \ LD (IY+PREV_LMO),A ;SAVE LCD BIT DEPTH MODE
LD HL,VBUFSTART \ LD (IX+$10),HL ;SET CURRENT BUFFER ADDRESS
POP AF
OR A \ SBC HL,HL \ LD L,A \ LD H,BDA_FIELD_WIDTH \ MLT HL
LD DE,bitDepthActionTable \ ADD HL,DE ;GET BIT DEPTH FIELD TABLE ENTRY
LD A,(HL) \ INC HL \ LD (IX+$18),A ;SET CURRENT BIT DEPTH MODE
RES 2,(IX+$19) ;RESET BIG-ENDIAN PIXEL ORDER
PUSH HL
LD HL,(HL) \ LD DE,VLCD_PAL \ LD BC,32 \ LDIR ;SET DEFAULT PALETTE
;COPY RELEVENT INFORMATION FROM STRUCT TO STACK SLACK
LD IX,(IY+VSTRUCT)
LD A,(IX+V_SEGFR) \ LD (IY+M_FRAMES),A
LD HL,(IY+VSEG_ARR) \ LD (IY+VSEG_STR),HL \ LD (IY+VSEG_CUR),HL
LD DE,(IX+V_SEGS) \ ADD HL,DE \ ADD HL,DE \ ADD HL,DE \ LD (IY+VSEG_END),HL
;SET UP LCD HARDWARE / SCREEN BOUNDARIES
LD A,(IX+V_HEIGHT) \ LD (IY+F_HEIGHT),A
LD E,A \ LD D,2 \ MLT DE \ LD HL,LCD_HEIGHT ; (MAXHEIGHT-VIDHEIGHT)/2 = DIST
OR A \ SBC HL,DE \ SRL H \ RR L ; BTWN SCREEN-TOP AND VID-TOP
EX DE,HL ; Y OFFSET IN DE
POP HL
INC HL \ INC HL \ INC HL \ LD HL,(HL) ;GET ADR FOR VOFFSET + LUT SETUP
LD IX,FF_END
LD BC,+_
PUSH BC
JP (HL)
_: ;SET UP DECODER GRID
LD A,(IY+F_HEIGHT)
TST A,%00000111
JR Z,+_
SUB A,8
LD (sfs_8x8_vidheight),A ;IN THE GRID ARRAY CODE. REMOVE THE ADD/SUB
ADD A,8
JR ++_
_: LD (sfs_8x8_vidheight),A ;IN THE GRID ARRAY CODE. REMOVE THE ADD/SUB
_: TST A,%00000111 ;CHECK TO SEE IF h%8 IS NONZERO
JR Z,+_
ADD A,8 ;IF NOT, ceil() IT
_: AND A,%11111000
LD L,A
LD H,VIDEO_WIDTH
MLT HL
ADD HL,HL
ADD HL,HL ;X4 TO MAKE /256 BY TAKING JUST H
LD A,H
LD (sfs_8x8_vidloop),A
RRCA \ RRCA \ RRCA ;DIV 8 TO GET NUMBER OF BYTES TO OFFSET
TST A,%11100000
JR Z,+_
INC A
_: AND A,%00011111
LD (sfs_8x8_vidoffset),A
;SET UP TIMER HARDWARE - UNSETS POINTER TO STRUCT
CALL resetTimer
;SYSTEM SET UP. START THE DECODER.
;------------------------------------------------------------
MF_LOAD_NEXT_SEGMENT:
LD HL,(IY+VSEG_CUR)
LD HL,(HL)
LD DE,DECOMP_BUFFER
PUSH DE
CALL _dzx7_Turbo ;also located in MAIN_FIELD
CALL waitOneFrame
LEA HL,IY+M_FRAMES ;-25 MFR
EX (SP),IY
LD A,(HL)
DEC HL ;-26 CFR
LD (HL),A ;SET CUR FRAME
MF_DRAW_FRAME_LOOP:
DEC HL ;-78 FRH
LD C,(HL) ;READ FRAME_HEIGHT
PUSH HL
CALL setupFrameState ;Checks frame data and sets up renderer state
CALL drawFrame
MF_SKIP_FRAME_DRAW:
POP HL
INC HL ;-77 CFR
CALL doControls
DEC (HL)
CALL handleDeltaPaletteAndTiming ;must preserve flags since using them too
JR NZ,MF_DRAW_FRAME_LOOP
POP IY
LD DE,(IY+VSEG_CUR)
INC DE
INC DE
INC DE
LD (IY+VSEG_CUR),DE
LD HL,(IY+VSEG_END)
OR A
SBC HL,DE
JP NC,MF_LOAD_NEXT_SEGMENT
MF_STOP_PLAYBACK:
;------------------------------------------------------------
;PUTAWAY - RESET TIMERS AND LCD HARDWARE.
XOR A \ LD ($F20000),A ;DISABLE TIMERS
;RESTORE OLD MODES TO THE VIDEO CONTROLLER
LD IX,VLCD_CTRL
LD HL,(IY+PREV_BUF) \ LD (IX+$10),HL ;RESTORE SCREEN ADDRESS
LD A,(IY+PREV_LMO) \ LD (IX+$18),A ;RESTORE LCD BIT DEPTH
RES 2,(IX+$19) ;RESET BIG-ENDIAN PIXEL ORDER (DEFAULT)
POP IX
EI
RET
;===================================================================================
; Setup subroutines
#DEFINE NXRW1B (320*2/8)+0
#DEFINE NXRW2B (320*2/4)+0
#DEFINE NXRW4B (320*2/2)+0
ofsAndLUTSetup1bpp:
LD D,40 \ MLT DE \ INC DE \ INC DE
PUSH DE
XOR A
_: LD B,8
_: RLCA \ ADC HL,HL \ RRCA
RLCA \ ADC HL,HL
DJNZ -_
LD (IX+0),HL
LEA IX,IX+2
INC A
JR NZ,--_
;ADDITIONAL SMC SETUP
LD A,40 \ LD (sdw_smc_ymultiplier),A
LD HL,$1F1F1F \ LD (sdw_smc_wdivider),HL \ LD (sdw_smc_xdivider),HL
LD HL,NXRW1B \ LD (sdw_smc_nextrow),HL
LD A, %00111111 \ LD (sdw_smc_xmaskout),A \ LD (sdw_smc_wmaskout),A
LD DE,ofsAndLUTSetup1bpp_renderer
;--------------------
JP ofsAndLUTSetup_collect
ofsAndLUTSetup1bpp_renderer:
LD (IX+40),L ;3
LD (IX+41),H ;6
LEA IX,IX+2 ;9
NOP \ NOP \ NOP ;12
ofsAndLUTSetup2bpp:
LD D,80 \ MLT DE \ INC DE \ INC DE \ INC DE \ INC DE
PUSH DE
XOR A
_: LD B,4
_: RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL \ RRCA \ RRCA
RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL
DJNZ -_
LD (IX+0),HL
LEA IX,IX+2
INC A
JR NZ,--_
;ADDITIONAL SMC SETUP
LD A,80 \ LD (sdw_smc_ymultiplier),A
LD HL,$1F1F00 \ LD (sdw_smc_wdivider),HL \ LD (sdw_smc_xdivider),HL
LD HL,NXRW2B \ LD (sdw_smc_nextrow),HL
LD A, %00111111 \ LD (sdw_smc_xmaskout),A \ LD (sdw_smc_wmaskout),A
LD DE,ofsAndLUTSetup2bpp_renderer
;--------------------
JR ofsAndLUTSetup_collect
ofsAndLUTSetup2bpp_renderer:
LD (IX+80),L ;3
LD (IX+81),H ;6
LEA IX,IX+2 ;9
NOP \ NOP \ NOP ;12
ofsAndLUTSetup4bpp:
LD D,160 \ MLT DE \ LD A,E \ ADD A,8 \ LD E,A
PUSH DE
XOR A
_: LD B,2
_: RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL \ RRCA \ RRCA \ RRCA \ RRCA
RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL \ RLCA \ ADC HL,HL
DJNZ -_
LD (IX+0),HL
LEA IX,IX+2
INC A
JR NZ,--_
;ADDITIONAL SMC SETUP
LD A,160 \ LD (sdw_smc_ymultiplier),A
LD HL,$1F0000 \ LD (sdw_smc_wdivider),HL \ LD (sdw_smc_xdivider),HL
LD HL,NXRW4B \ LD (sdw_smc_nextrow),HL
LD A, %01111111 \ LD (sdw_smc_xmaskout),A \ LD (sdw_smc_wmaskout),A
;--------------------
LD DE,ofsAndLUTSetup4bpp_renderer
ofsAndLUTSetup_collect:
POP HL
LD (sdw_smc_screenofset),HL
EX DE,HL
LD DE,df_hdraw_smc_routine
LD BC,12
LDIR
RET
ofsAndLUTSetup4bpp_renderer:
LEA IX,IX+80 ;3
LD (IX+80),L ;6
LD (IX+81),H ;9
LEA IX,IX-80+2 ;12
;===================================================================================
; Standalone utilities
waitOneFrame:
LD HL,$F20002
_: BIT 7,(HL)
JR NZ,-_
LD L,$30
XOR A
LD (HL),A
LD L,A
LD DE,(HL)
PUSH HL
LD HL,1093
ADD HL,DE
POP DE
EX DE,HL
LD (HL),DE
LD L,$30
LD (HL),3
RET
waitAnyKey:
CALL keyWait
_: CALL getKbd
OR A
JR Z,-_
keyWait:
CALL getKbd
OR A
JR NZ,keyWait
RET
getKbd:
PUSH HL
LD HL,$F50200 ;DI_MODE=$F5XX00
LD (HL),H
XOR A,A
_: CP A,(HL)
JR NZ,-_
LD L,$12 ;GROUP 1 (top keys)
LD A,(HL)
LD L,$1E ;GROUP 7 (dpad)
XOR (HL)
AND %11110000
XOR (HL) ;b0:dwn b1:lft b2:rig b3:up b4:yeq b5:2nd b6:mod b7:del
POP HL
RET
resetTimer:
LD IX,$F20000
XOR A
LD (IX+$30),A ;DISABLE TIMERS
LEA DE,IX
LD HL,TIMER_VALUES
LD BC,TIMER_VALUES_END-TIMER_VALUES
LDIR ;LOAD COUNTER AND RESET REGISTERS TO TIMER_VALUES
LD HL,%000000000000000000000011
LD (IX+$30),HL ;TIMER CTRL REG ENABLE, SET XTAL TIMER 1, COUNT DOWN, NO INTR
RET
;===================================================================================
; Video player user controls
doControls:
_: CALL getKbd
BIT 5,A
JR Z,_doctrls_skipPause
CALL waitAnyKey
JR -_
_doctrls_skipPause:
BIT 6,A
JR Z,_doctrls_skipStop
POP AF
POP IY
CALL keyWait
JP MF_STOP_PLAYBACK
_doctrls_skipStop:
BIT 1,A
JR Z,_doctrls_skipRewind
LD HL,-3
JR _doctrls_changepos
_doctrls_skipRewind:
BIT 2,A
JR Z,_doctrls_skipFastFwd
LD HL,3
_doctrls_changepos:
POP AF ;rem doctrls to main
POP IY ;get saved stack pointer position
LD DE,(IY+VSEG_CUR)
ADD HL,DE
EX DE,HL
LD HL,(IY+VSEG_STR)
OR A
SBC HL,DE ;STARTSEG-NEWSEG. IF ZERO, CONTINUE. THEN IF NC, SKIP WRITEBACK
JR Z,+_
JR NC,_doctrls_donotchangepos
_: LD HL,(IY+VSEG_END)
OR A
DEC HL
DEC HL
DEC HL
SBC HL,DE ;ENDSEG-NEWSEG. IF C, WENT PAST END: SKIP WRITEBACK
JP C,MF_STOP_PLAYBACK
LD (IY+VSEG_CUR),DE
CALL resetTimer
_doctrls_donotchangepos:
JP MF_LOAD_NEXT_SEGMENT
_doctrls_skipFastFwd:
RET
;===================================================================================
; Video frame formatter
setupFrameState:
LD B,(IY+0)
INC IY
INC B
DJNZ sfs_skip_eov
;End of Video
POP AF
POP AF
POP IY
JP MF_STOP_PLAYBACK
sfs_skip_eov:
DJNZ sfs_skip_rawvideo
;raw video
LD HL,(256*0)+0
LD DE,VIDEO_WIDTH
JP setDrawWindow
sfs_skip_rawvideo:
DJNZ sfs_skip_partialframe
;partial frame
CALL copyPreviousFrame
;jr $
LD HL,(IY+0)
LD E,(IY+2)
LD C,(IY+3)
LEA IY,IY+4
JP setDrawWindow
sfs_skip_partialframe:
DJNZ sfs_skip_duplicateframe
;duplicate frame
CALL copyPreviousFrame
POP AF
JP MF_SKIP_FRAME_DRAW
sfs_skip_duplicateframe:
;DEC B \ JP NZ,sfs_skip_8x8boxes
DJNZ sfs_skip_8x8boxes
;render 8x8 box grid
;Screen width fixed at VIDEO_WIDTH, screen height in C
CALL copyPreviousFrame
sfs_8x8_vidoffset .EQU $+1
LD DE,0 ;LOWEST BYTE ALWAYS WRITTEN, NO OTHERS ARE
LEA HL,IY+0
ADD IY,DE
LD E,D
LD A,8
LD (sfs_blockheight_smc),A
sfs_8x8_vidloop .EQU $+1
LD B,0
sfs_8x8_vidheight .EQU $+1
LD C,0
;DE = [0,0] , HL = PTR TO BITFIELD, IY = DATA STREAM, B = LOOP COUNTER
;jr $
JR +_ ;SKIP OVER INITIAL LOOP TEST IN CASE B%8 WAS ZERO TO START WITH
sfs_df_mainloop:
LD A,B
AND %00000111 ;IF ZERO, BIT-BYTE BOUNDS REACHED. INCREMENT HL
JR NZ,_
INC HL
_: RR (HL)
JR NC,sfs_df_preservebox
PUSH BC
PUSH DE
PUSH HL
EX DE,HL
LD E,8
sfs_blockheight_smc .EQU $+1
LD C,8
CALL setDrawWindow
CALL drawFrame
POP HL
POP DE
POP BC
sfs_df_preservebox:
LD A,E
ADD A,8
CP A,VIDEO_WIDTH
JR C,++_ ;IF NOT REACHED THE RIGHT EDGE OF THE SCREEN, SKIP TO WRITE X BACK
LD A,D ;OTHERWISE, MOVE Y DOWNWARD AND ZERO OUT X
ADD A,8
LD D,A
LD A,C ;ALSO DECREMENT SCREEN HEIGHT BY 8
SUB A,8 ;AND REDUCE BLOCKHEIGHT IF IT EVER FALLS BELOW 0
LD C,A ;BY THE AMOUNT IT WOULD'VE BEEN HAD THE SUBTRACTION NOT TAKEN PLACE
JR NC,+_
ADD A,8
LD (sfs_blockheight_smc),A
_: XOR A
_: LD E,A
DJNZ sfs_df_mainloop
POP AF ;REMOVES RETURN ADDRESS. SP LEVEL BACK TO MAIN.
JP MF_SKIP_FRAME_DRAW
sfs_skip_8x8boxes:
;Out of bounds video data. Do not process. End video playback.
JR $ ;#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#
POP AF
POP AF
POP IY
JP MF_STOP_PLAYBACK
;===================================================================================
; Video frame formatter subroutines
;in: L=Xpos,H=Ypos,E=width
;out: IX=drawpos, C=Loop
setDrawWindow:
;Set window offset
PUSH DE
LD A,L
LD L,2
MLT HL
sdw_smc_ymultiplier .EQU $+1
LD H,40
MLT HL
EX DE,HL
OR A
sdw_smc_xdivider .EQU $
RRA
RRA
RRA
sdw_smc_xmaskout .EQU $+1
AND %00111111
LD L,A
LD H,2
MLT HL
sdw_smc_screenofset .EQU $+2
LD IX,0
ADD HL,DE
EX DE,HL
ADD IX,DE
LD DE,(VLCD_CTRL+$10)
ADD IX,DE
POP DE
LD A,E ;Get img width
SBC HL,HL
EX DE,HL ;Zero out HL
sdw_smc_wdivider .EQU $+0 ;Set frame render loop parameters
RRA \ RRA \ RRA ;div 8 for 1bpp. RRA RRA NOP for div 4 (2bpp), RRA NOP NOP for div 2 (4bpp)
sdw_smc_wmaskout .EQU $+1
AND %00111111
LD (df_smc_hdraw),A
LD E,A ;Set adjusted width in E.
ADD A,A ;
LD E,A ;x2 to scale.
sdw_smc_nextrow .EQU $+1
LD HL,0
SBC HL,DE
LD (df_smc_nextrow),HL
RET
handleDeltaPaletteAndTiming:
PUSH HL
PUSH AF
call writeDeltaPalette
;LEA IY,IY+2
LD HL,$E30011
LD A,(HL)
XOR BUFSWAPMASK
LD (HL),A ;FANCY BUFFER FLIPPING
POP AF
PUSH AF
CALL NZ,waitOneFrame
POP AF
POP HL
RET
writeDeltaPalette: ;IY handled. IY must point to start of data field.
LD B,15
LD HL,$E30202
LD DE,(IY+0)
LEA IY,IY+2
_: SRL D
RR E
JR NC,+_
LD A,(IY+0)
LD (HL),A
INC HL
LD A,(IY+1)
LD (HL),A
DEC HL
LEA IY,IY+2
_: INC HL
INC HL
DJNZ --_
RET
copyPreviousFrame:
LD HL,(VLCD_CTRL+$10) ;Currently active buffer
LD BC,$009600
PUSH HL
POP DE
LD A,D
XOR BUFSWAPMASK
LD D,A
EX DE,HL
LDIR
RET
;jr $
PUSH HL
LD A,H
XOR BUFSWAPMASK
LD H,A ;Set HL to inactive buffer (drawing to)
LD DE,(sdw_smc_screenofset)
ADD HL,DE ;Add screen offset to start copying to
EX (SP),HL ;Swap adjusted inactive buffer to active buffer
ADD HL,DE ;Add screen offset to start copying from.
PUSH HL
EX DE,HL ;The offset is supposed to center the image, so doubling it
ADD HL,HL ;should give me the total blank area.
LD DE,BUFSWAPMASK*256 ;And this is the screen buffer's total size.
EX DE,HL
SBC HL,DE ;screen-blank = Frame area
INC HL ;In case of inaccuracies
PUSH HL
LD A,C ;PRESERVE C
POP BC
POP HL
POP DE
EX DE,HL ;Figure out why we needed them swapped.
LDIR
LD C,A
RET
;===================================================================================
;Data section
TIMER_VALUES: ;30fps = 32768/30 ~~ 1092.2
.db $45,$04,$80,$00 ;Initial value: 1093+INT_MAX+1 to take advantage of sign flag.
.db $01,$00,$00,$00 ;reset value. Hang on 1.
TIMER_VALUES_END:
bitDepthActionTable:
;1bpp
.db %00100001 \.dl palette1bpp \.dl ofsAndLUTSetup1bpp
;2bpp
.db %00100011 \.dl palette2bpp \.dl ofsAndLUTSetup2bpp
;4bpp gs
.db %00100101 \.dl palette4bpp_gs \.dl ofsAndLUTSetup4bpp
;4bpp col
.db %00100101 \.dl palette4bpp_col \.dl ofsAndLUTSetup4bpp
;4bpp adaptive
.db %00100101 \.dl nullPalette \.dl ofsAndLUTSetup4bpp
nullPalette:
.dw 0
palette1bpp:
.dw 0,-1
palette2bpp:
.dw 0,%1011000110001100,%1101101011010110,-1
palette4bpp_gs:
.dw %0000000000000000,%0000100001000010,%0001100011000110,%0001000010000100
.dw %0010100101001010,%0010000100001000,%0011100111001110,%0011000110001100
.dw %0100101001010010,%0100001000010000,%0101101011010110,%0101001010010100
.dw %0110101101011010,%0110001100011000,%0111101111011110,%0111001110011100
palette4bpp_col:
.dw %0000000000000000 ;0,0,0,
.dw %1011000110001100 ;85,85,85,
.dw %1101101011010110 ;170,170,170
.dw %0111111111111111 ;255,255,255
.dw %0011110000000000 ;127,0,0,
.dw %0000000111100000 ;0,127,0,
.dw %0000000000001111 ;0,0,127,
.dw %0011110111100000 ;127,127,0,
.dw %0011110000001111 ;127,0,127,
.dw %0000000111101111 ;0,127,127,
.dw %0111110000000000 ;255,0,0,
.dw %0000001111100000 ;0,255,0,
.dw %0000000000011111 ;0,0,255,
.dw %0111111111100000 ;255,255,0,
.dw %0111110000011111 ;255,0,255,
.dw %0000001111111111 ;0,255,255,
MF_END:
;===================================================================================
;===================================================================================
;===================================================================================
;===================================================================================
;===================================================================================
;===================================================================================
;===================================================================================
.DW FF_END-FF_START \.DL FAST_FIELD_LOC \.ORG FAST_FIELD_LOC
FF_START:
;===================================================================================
;High speed frame render loop
drawFrame:
;
df_verticaldraw:
; jr $
df_smc_hdraw .EQU $+1
LD B,VIDEO_WIDTH/2
LD A,C
LD DE,FF_END
df_horizontaldraw:
LD L,(IY+0)
LD H,2
MLT HL
ADD HL,DE
LD HL,(HL)
LD (IX+0),L
LD (IX+1),H
df_hdraw_smc_routine:
.block 12
INC IY
DJNZ df_horizontaldraw
df_smc_nextrow .EQU $+1
LD DE,0
ADD IX,DE
DEC C
JR NZ,df_verticaldraw
RET
;===================================================================================
; Dec 2012 by Einar Saukas & Urusergi - "Turbo" version (89 bytes, 25% faster)
; in: HL=src, out: DE=dst, dstr: AF,BC,DE,HL
_dzx7_Turbo:
ld a, 128
dzx7t_copy_byte_loop:
ldi ; copy literal byte
dzx7t_main_loop:
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
jr nc, dzx7t_copy_byte_loop ; next bit indicates either literal or sequence
; determine number of bits used for length (Elias gamma coding)
push de
ld de, 0
ld bc, 1
dzx7t_len_size_loop:
inc d
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
jr nc, dzx7t_len_size_loop
jp dzx7t_len_value_start
; determine length
dzx7t_len_value_loop:
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
rl c
rl b
jr c, dzx7t_exit ; check end marker
dzx7t_len_value_start:
dec d
jr nz, dzx7t_len_value_loop
inc bc ; adjust length
; determine offset
ld e, (hl) ; load offset flag (1 bit) + offset value (7 bits)
inc hl
sla e
inc e
jr nc, dzx7t_offset_end ; if offset flag is set, load 4 extra bits
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
rl d ; insert first bit into D
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
rl d ; insert second bit into D
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
rl d ; insert third bit into D
add a, a ; check next bit
call z, dzx7t_load_bits ; no more bits left?
ccf
jr c, dzx7t_offset_end
inc d ; equivalent to adding 128 to DE
dzx7t_offset_end:
rr e ; insert inverted fourth bit into E
; copy previous sequence
ex (sp), hl ; store source, restore destination
push hl ; store destination
sbc hl, de ; HL = destination - offset - 1
pop de ; DE = destination
ldir
dzx7t_exit:
pop hl ; restore source address (compressed data)
jp nc, dzx7t_main_loop
dzx7t_load_bits:
ld a, (hl) ; load another group of 8 bits
inc hl
rla
ret
;#IF ($&$ff)
; .BLOCK ~$&$ff+1
;#ENDIF
FF_END:
;===================================================================================
;===================================================================================
;===================================================================================
;===================================================================================
;END OF FILE
.ECHO "Assembling decoder M1X2-ZX7"
.ECHO "Main field size: ",MF_END-MF_START,"\n","Fast field size: ",FF_END-FF_START,"\n"
.END
.END
| 26.391582 | 105 | 0.578947 |
94326e618e145251a6cc2c62e09f025a9d20d68a | 366 | asm | Assembly | programs/oeis/137/A137331.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/137/A137331.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/137/A137331.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A137331: a(n) = 1 if the binary weight of n is prime, otherwise 0.
; 0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,1,1,0
seq $0,324467 ; Three times the binary weight of n: 3*A000120(n).
pow $0,4
div $0,31
mod $0,2
| 45.75 | 201 | 0.57377 |
cce237bd099cb574fd06ab46d4afca1c11b42b70 | 866 | asm | Assembly | oeis/298/A298158.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/298/A298158.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/298/A298158.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A298158: a(n) = a(n-1) + 3*a(n-2) -2*a(n-3) - 2*a(n-4), where a(0) = -1, a(1) = -2, a(2) = 1, a(3) = 1.
; Submitted by Jon Maiga
; -1,-2,1,1,10,15,41,64,137,217,418,667,1213,1944,3413,5485,9410,15151,25585,41248,68881,111153,184130,297331,489653,791080,1297117,2096389,3426274,5539047,9030857,14602672,23764601,38432809,62459554,101023435,164007277,265292856,430348709,696165853,1128611714,1825826143,2958632161,4786555456,7753576225,12544325985,20314679426,32867394019,53215627877,86099799112,139382535853,225515889397,365032642978,590615641239,955916719673,1546666578640,2503120169225,4050055183321,6554249094370,10604841148603
mov $2,-3
mov $4,-2
lpb $0
sub $0,1
sub $2,$1
add $1,$3
mul $4,2
sub $4,$5
add $4,1
add $4,$2
mov $5,$4
mov $4,$2
mov $2,$3
add $4,$1
add $5,$4
mov $3,$5
lpe
sub $4,$3
sub $4,$1
add $5,$4
mov $0,$5
add $0,1
| 32.074074 | 500 | 0.69746 |
e4c8bd806d8e5cf86a6d8e50a6b2fb2a85c5cbae | 316 | asm | Assembly | api/api010.asm | yosswi414/HariboteOS_USB | 51746c55d576ac5aa9280d0e7777374d475ccefd | [
"Unlicense"
] | null | null | null | api/api010.asm | yosswi414/HariboteOS_USB | 51746c55d576ac5aa9280d0e7777374d475ccefd | [
"Unlicense"
] | null | null | null | api/api010.asm | yosswi414/HariboteOS_USB | 51746c55d576ac5aa9280d0e7777374d475ccefd | [
"Unlicense"
] | 1 | 2021-09-09T01:56:23.000Z | 2021-09-09T01:56:23.000Z | [BITS 32]
GLOBAL api_free
[SECTION .text]
api_free: ; void api_free(char *addr, int size);
PUSH EBX
MOV EDX, 10
MOV EBX, [CS:0x0020]
MOV EAX, [ESP+8] ; addr
MOV ECX, [ESP+12] ; size
INT 0x40
POP EBX
RET
| 21.066667 | 54 | 0.443038 |
eccdfd77f9fcbd346c80729a0966e4d129483396 | 267 | asm | Assembly | libsrc/graphics/spc1000/plot_MODE0.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/spc1000/plot_MODE0.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/graphics/spc1000/plot_MODE0.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null |
SECTION code_clib
PUBLIC plot_MODE0
.plot_MODE0
ld a,l
cp 32
ret nc
ld a,h
cp 64
ret nc
defc NEEDplot = 1
INCLUDE "graphics/generic_console/pixel.asm"
| 16.6875 | 52 | 0.445693 |
16c478904ce2a5bc7fdc7b7510523fd1da0ffd00 | 3,257 | asm | Assembly | tools/assembler/templates/unrom_mapper2.asm | zzqqqzzz/WebNES | 5b31fb44b3b6323cf4fe300a7050095f232de1ac | [
"MIT"
] | 75 | 2015-01-12T23:30:35.000Z | 2021-12-11T04:25:53.000Z | tools/assembler/templates/unrom_mapper2.asm | zzqqqzzz/WebNES | 5b31fb44b3b6323cf4fe300a7050095f232de1ac | [
"MIT"
] | 3 | 2018-11-13T13:18:00.000Z | 2021-04-22T14:59:53.000Z | tools/assembler/templates/unrom_mapper2.asm | zzqqqzzz/WebNES | 5b31fb44b3b6323cf4fe300a7050095f232de1ac | [
"MIT"
] | 38 | 2016-02-24T22:21:01.000Z | 2022-01-25T12:44:04.000Z | ;----------------------------------------------------------------
; constants
;----------------------------------------------------------------
MIRRORING = %0001 ;%0000 = horizontal, %0001 = vertical, %1000 = four-screen
;----------------------------------------------------------------
; variables
;----------------------------------------------------------------
.enum $0000
;NOTE: declare variables using the DSB and DSW directives, like this:
;MyVariable0 .dsb 1
;MyVariable1 .dsb 3
.ende
;NOTE: you can also split the variable declarations into individual pages, like this:
;.enum $0100
;.ende
;.enum $0200
;.ende
;----------------------------------------------------------------
; iNES header
;----------------------------------------------------------------
.db "NES", $1a ;identification of the iNES header
.db $08 ;number of 16KB PRG-ROM pages
.db $00 ;number of 8KB CHR-ROM pages
.db $20|MIRRORING ;mapper 2 and mirroring
.dsb 9, $00 ;clear the remaining bytes
;----------------------------------------------------------------
; program bank 0
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 0 go here
.org $c000
;----------------------------------------------------------------
; program bank 1
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 1 go here
.org $c000
;----------------------------------------------------------------
; program bank 2
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 2 go here
.org $c000
;----------------------------------------------------------------
; program bank 3
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 3 go here
.org $c000
;----------------------------------------------------------------
; program bank 4
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 4 go here
.org $c000
;----------------------------------------------------------------
; program bank 5
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 5 go here
.org $c000
;----------------------------------------------------------------
; program bank 6
;----------------------------------------------------------------
.base $8000
;NOTE: contents of program bank 6 go here
.org $c000
;----------------------------------------------------------------
; fixed program bank (7)
;----------------------------------------------------------------
.base $c000
Reset:
;NOTE: initialization code goes here
NMI:
;NOTE: NMI code goes here
IRQ:
;NOTE: IRQ code goes here
;----------------------------------------------------------------
; interrupt vectors
;----------------------------------------------------------------
.org $fffa
.dw NMI
.dw Reset
.dw IRQ
| 23.948529 | 89 | 0.299969 |
1afdd8d9dd6df1655d3a657ba89419ab438914f2 | 688 | asm | Assembly | part2/bootloader.asm | VARoDeK/realmode-assembly | 4a7af152ee62029671d12a28c0f7d01b83b8fbd7 | [
"Unlicense"
] | 42 | 2018-10-15T17:55:07.000Z | 2022-02-23T08:56:54.000Z | part2/bootloader.asm | PhylumChordata/realmode-assembly | 4a7af152ee62029671d12a28c0f7d01b83b8fbd7 | [
"Unlicense"
] | null | null | null | part2/bootloader.asm | PhylumChordata/realmode-assembly | 4a7af152ee62029671d12a28c0f7d01b83b8fbd7 | [
"Unlicense"
] | 14 | 2018-10-08T12:36:43.000Z | 2022-02-22T20:19:22.000Z | org 0x7C00
;Initialize Registers
cli
xor ax, ax
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
mov sp, 0x6ef0 ; setup the stack like qemu does
sti
;Reset disk system
mov ah, 0
int 0x13 ; 0x13 ah=0 dl = drive number
;Read from harddrive and write to RAM
mov bx, 0x8000 ; bx = address to write the kernel to
mov al, 1 ; al = amount of sectors to read
mov ch, 0 ; cylinder/track = 0
mov dh, 0 ; head = 0
mov cl, 2 ; sector = 2
mov ah, 2 ; ah = 2: read from drive
int 0x13 ; => ah = status, al = amount read
jmp 0x8000
times 510-($-$$) db 0
;Begin MBR Signature
db 0x55 ;byte 511 = 0x55
db 0xAA ;byte 512 = 0xAA | 22.933333 | 56 | 0.611919 |
0a7e35a72a2b83041f13f2cfdabf1cf0d341c58d | 537 | asm | Assembly | programs/oeis/047/A047883.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/047/A047883.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/047/A047883.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A047883: Squares on unbounded chessboard for which the least number of knight's moves from corner (0,0) is n.
; 0,2,9,20,27,32,39,46,53,60,67,74,81,88,95,102,109,116,123,130,137,144,151,158,165,172,179,186,193,200,207,214,221,228,235
mov $2,$0
mov $4,$0
mov $5,3
mov $6,4
lpb $2
lpb $6
add $1,2
mul $6,2
sub $6,3
sub $6,$2
add $6,1
lpe
add $3,3
lpb $5
sub $0,3
sub $5,$3
lpe
trn $0,$1
add $1,6
sub $2,1
trn $3,4
lpe
add $0,5
add $3,$0
trn $1,$3
lpb $4
add $1,1
sub $4,1
lpe
mov $0,$1
| 15.794118 | 123 | 0.579143 |
5d2a11aec74447f587d05b02166ca9c84cd62539 | 5,994 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2163.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2163.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2163.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x229c, %rdi
clflush (%rdi)
nop
nop
nop
xor $37366, %r9
mov (%rdi), %r13
nop
nop
nop
cmp $7383, %r15
lea addresses_WT_ht+0x19fab, %rdx
nop
nop
inc %r10
mov $0x6162636465666768, %r8
movq %r8, %xmm4
vmovups %ymm4, (%rdx)
nop
cmp %r8, %r8
lea addresses_WT_ht+0x186ed, %rdi
nop
add %r10, %r10
mov $0x6162636465666768, %r9
movq %r9, %xmm0
and $0xffffffffffffffc0, %rdi
movntdq %xmm0, (%rdi)
nop
nop
nop
nop
cmp $32298, %r15
lea addresses_WC_ht+0xd701, %r10
nop
nop
nop
nop
nop
and $33999, %r9
mov $0x6162636465666768, %r8
movq %r8, %xmm0
vmovups %ymm0, (%r10)
nop
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_A_ht+0x12f1, %rsi
lea addresses_UC_ht+0x8f31, %rdi
add %r15, %r15
mov $29, %rcx
rep movsl
cmp %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_PSE+0x18559, %rsi
lea addresses_WC+0x893d, %rdi
nop
xor %r11, %r11
mov $49, %rcx
rep movsw
nop
nop
nop
inc %rcx
// Load
lea addresses_UC+0x16451, %r8
nop
nop
nop
nop
sub %rbx, %rbx
movb (%r8), %r14b
nop
nop
nop
nop
nop
xor %r14, %r14
// Load
lea addresses_PSE+0x5e0d, %rcx
nop
nop
add %rdi, %rdi
mov (%rcx), %r11d
nop
sub %rsi, %rsi
// Faulty Load
lea addresses_UC+0x7931, %r11
nop
xor %rdi, %rdi
mov (%r11), %si
lea oracles, %r14
and $0xff, %rsi
shlq $12, %rsi
mov (%r14,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_PSE', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 37.698113 | 2,999 | 0.656823 |
72426a470d6482c200e86238d301b6ca188eb02f | 400 | asm | Assembly | programs/oeis/237/A237451.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/237/A237451.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/237/A237451.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A237451: Zero-based column index to irregular tables organized as successively larger square matrices.
; 0,0,1,0,1,0,1,2,0,1,2,0,1,2,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6,0,1
lpb $0
mov $1,$0
add $2,1
mod $1,$2
mov $3,$2
mul $3,$2
trn $0,$3
lpe
mov $0,$1
| 30.769231 | 201 | 0.5725 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.